Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F13782915
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
View Options
diff --git a/static/js/import.js b/static/js/import.js
index 8019b63..0f293eb 100644
--- a/static/js/import.js
+++ b/static/js/import.js
@@ -1,55 +1,55 @@
const fileForm = document.querySelector('form.import-form');
const selectElem = document.querySelector('select[name="collection"]');
const submitElem = document.querySelector('input[type="submit"]');
const zipInfo = document.querySelector('span.zip > ul.info');
const zipWarning = document.querySelector('span.zip > p.error');
const fileInput = document.querySelector('input[type="file"]')
document.onreadystatechange = () => {
- if ( document.readyState === "complete") {
+ if ( document.readyState === "interactive") {
selectElem.disabled = true;
submitElem.disabled = true;
zipInfo.hidden = true;
zipWarning.hidden = true;
}
}
fileInput.onchange = function() {
if ( this.files.length === 1 ) {
if ( this.files[0].type === 'application/zip' ) {
selectElem.disabled = true;
submitElem.disabled = false;
zipInfo.hidden = false;
zipWarning.hidden = true;
} else {
selectElem.disabled = false;
submitElem.disabled = false;
zipInfo.hidden = true;
zipWarning.hidden = true;
}
}
if ( this.files.length > 1 ) {
selectElem.disabled = false;
submitElem.disabled = false;
var zips = 0;
Array.from(this.files).forEach(file => {
if ( file.name.endsWith(".zip") ) {
zips++;
}
})
if ( zips > 0 ) {
zipInfo.hidden = true;
zipWarning.hidden = false;
} else {
zipInfo.hidden = true;
zipWarning.hidden = true;
}
}
}
submitElem.addEventListener("click", (e) => {
e.preventDefault();
submitElem.disabled = true;
fileForm.submit();
});
\ No newline at end of file
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Jan 31, 6:04 AM (3 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3611915
Attached To
rWF WriteFreely
Event Timeline
Log In to Comment