wiki-plugin-assets
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -90,3 +90,3 @@ (function() { | ||
bind = function($item, item) { | ||
var $button, $input, $progress, assets, tick; | ||
var $button, $input, $progress, assets, ignore, tick, upload; | ||
assets = item.text.match(/([\w\/-]*)/)[1]; | ||
@@ -99,2 +99,6 @@ $item.dblclick(function() { | ||
$progress = $item.find('.progress-bar'); | ||
ignore = function(e) { | ||
e.preventDefault(); | ||
return e.stopPropagation(); | ||
}; | ||
tick = function(e) { | ||
@@ -113,6 +117,15 @@ var percentComplete; | ||
}); | ||
return $input.on('change', function(e) { | ||
var file, files, form, i, len; | ||
files = $(this).get(0).files; | ||
if (!files.length) { | ||
$input.on('change', function(e) { | ||
return upload($(this).get(0).files); | ||
}); | ||
$item.on('dragover', ignore); | ||
$item.on('dragenter', ignore); | ||
$item.on('drop', function(e) { | ||
var ref; | ||
ignore(e); | ||
return upload((ref = e.originalEvent.dataTransfer) != null ? ref.files : void 0); | ||
}); | ||
return upload = function(files) { | ||
var file, form, i, len; | ||
if (!(files != null ? files.length : void 0)) { | ||
return; | ||
@@ -149,3 +162,3 @@ } | ||
}); | ||
}); | ||
}; | ||
}; | ||
@@ -152,0 +165,0 @@ |
{ | ||
"name": "wiki-plugin-assets", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "Federated Wiki - Assets Plugin", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
30454
293