New Folder
x
diff --git a/www/static/browser.css b/www/static/browser.css
index fa53a61..ed532d1 100644
--- a/www/static/browser.css
+++ b/www/static/browser.css
@@ -156,8 +156,8 @@ input.new-folder-input:focus{
visibility: hidden;
}
-#upload-form{
-
+#legacy-file{
+ display: none;
}
#upload-area{
diff --git a/www/static/js/browser.js b/www/static/js/browser.js
index b32154b..4d201b3 100644
--- a/www/static/js/browser.js
+++ b/www/static/js/browser.js
@@ -20,15 +20,19 @@ function hideUpload(){
document.getElementById("upload-area").style.visibility = "hidden";
//clean up
+ cleanUploads();
+
+ location.reload(false);
+
+ return;
+}
+
+function cleanUploads(){
vfs_upload_queue = [];
var list = document.getElementById("filelist");
while(list.firstChild){
list.removeChild(list.firstChild);
}
-
- location.reload(false);
-
- return;
}
@@ -44,9 +48,19 @@ function showMenu(e) {
//set context item commands
document.getElementById("copy-link").setAttribute("url", url);
-
}
+
+function legacyUploadTrigger() {
+ document.getElementById("legacy-file").click();
+}
+
+function legacyUpload(){
+ //cleanUploads();
+ var files = document.getElementById("legacy-file").files;
+ addToUploadQueue(files);
+}
+
function hideMenu() {
document.getElementById("context-menu").style.display = "none";
}
diff --git a/www/static/js/dropzone.js b/www/static/js/dropzone.js
index bfc5c1a..f4e3399 100644
--- a/www/static/js/dropzone.js
+++ b/www/static/js/dropzone.js
@@ -14,7 +14,12 @@ var vfs_upload_queue = [];
e.preventDefault();
var dropzone = document.getElementById("dropzone");
dropzone.style.backgroundColor = "white";
- for(file of e.dataTransfer.files){
+ addToUploadQueue(e.dataTransfer.files);
+
+ }
+
+ function addToUploadQueue(files){
+ for(file of files){
try {
reader = new FileReader();
reader.readAsBinaryString(file);
@@ -78,12 +83,10 @@ var vfs_upload_queue = [];
xhr.onreadystatechange=function(){
if (xhr.readyState==4 && xhr.status==200){
- document.getElementById("upload-message").innerHTML = xhr.responseText;
}
};
xhr.upload.addEventListener("progress", function(e){
-
document.getElementById("progressBar-"+this.filename).value = Math.ceil(e.loaded/e.total)*100;
});
xhr.send(data);
--
cgit v1.2.3