Use the filedrop jQuery plugin to allow for drag & drop uploading

This commit is contained in:
Paul van Tilburg 2012-01-18 22:12:03 +01:00
parent 5a4ab521b3
commit 29f6b52dff

View file

@ -37,6 +37,16 @@ $(document).ready(function() {
});
};
// For drag & drop file uploading via the filedrop jQuery plugin and HTML5.
$("body").filedrop({ url: '/draggables',
paramname: 'file',
data: { type: 'dnd' },
maxfiles: 1,
maxfilesize: 50,
error: function(err, file) { console.log(err, file); },
afterAll: function() { window.location.reload(true) }
});
// Populate the canvas with the draggables.
$.get("draggables", function(data) {
$.each(data, function(drag_id, drag_info) {