Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f32759d4
authored
Dec 19, 2023
by
taufikyu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaiki conflict script file size dan preview
1 parent
11fb0f7d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
opensipkd/base/views/widgets/file_upload.pt
opensipkd/base/views/widgets/file_upload.pt
View file @
f32759d
...
@@ -15,10 +15,7 @@
...
@@ -15,10 +15,7 @@
tal:attributes="style style;
tal:attributes="style style;
accept accept|field.widget.accept;
accept accept|field.widget.accept;
data-filename fname;
data-filename fname;
attributes|field.widget.attributes|{};"
attributes|field.widget.attributes|{};"/>
onchange="document.getElementById('preview-'+this.id).src = window.URL.createObjectURL(this.files[0]);
document.getElementById('labeldelete-'+this.id).remove();
document.getElementById('label-'+this.id).remove();"/>
<input tal:define="uid cstruct.get('uid')"
<input tal:define="uid cstruct.get('uid')"
tal:condition="uid"
tal:condition="uid"
type="hidden" name="uid" value="${uid}"/>
type="hidden" name="uid" value="${uid}"/>
...
@@ -29,9 +26,13 @@
...
@@ -29,9 +26,13 @@
});
});
document.getElementById("${oid}").onchange = function() {
document.getElementById("${oid}").onchange = function() {
if(this.files[0].size > ${maxsize}){
if(this.files[0].size > ${maxsize}){
alert("File is too big!");
alert("File is too big!");
this.value = "";
this.value = "";
document.getElementById('preview-'+this.id).src = '';
}
}
document.getElementById('preview-'+this.id).src = window.URL.createObjectURL(this.files[0]);
document.getElementById('labeldelete-'+this.id).remove();
document.getElementById('label-'+this.id).remove();
};
};
</script>
</script>
</tal:block>
</tal:block>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment