You are not logged in.
Pages: 1
Wanted to share the method I used to batch upload files. There is a great plugin out there called Dropzone. I included the CSS and Javascript in the admin panel and in my custom CSS, overwrote the BigTreeFileManager.addFile method.
This basically creates the dialog like the original function but with the content and some other parameters changed (final parameter for onCancel no longer applies) and stores the dialog in a variable. The footer is in the form originally, so we remove the footer, apply the dropzone class to the form, append the footer to the dialog (for a close button which does not need to be in the form) and apply Dropzone to the form.
BigTreeFileManager.addFile = function() {
var dialog = new BigTreeDialog("Upload File",'<input type="hidden" name="folder" value="' + this.currentFolder + '" />',false,"folder",false,"Upload File",true,this.finishedUpload);
dialog.dialogWindow.find("form").addClass("dropzone").find("footer").remove();
dialog.dialogWindow.append('<footer><a class="button bigtree_dialog_close">Close</a></footer>').find(".bigtree_dialog_close").click(function() { $(".bigtree_dialog_overlay").last().remove(); BigTreeFileManager.finishedUpload(); });
var myDropzone = new Dropzone(".dropzone", { url: "admin_root/ajax/file-browser/upload/" });
return false;
};
It's a great library and I think worth considering for inclusion in the next release.
Offline
Very cool! We'll keep Dropzone in mind as we explore the File Manager updates in the 4.1 release. Ben here at Fastspot is also a big fan of Dropzone.
Offline
Pages: 1