Permalink
Browse files

Add check hook on pluploader. Manual merge and close #957

  • Loading branch information...
1 parent 31c08f4 commit ab5a844fc572be4d8a9ed421d50e86da747d3b60 @cdujeu cdujeu committed Sep 22, 2016
Showing with 14 additions and 2 deletions.
  1. +14 −2 core/src/plugins/uploader.plupload/pluploader_tpl.html
@@ -31,7 +31,8 @@
var config_runtimes = '<?php echo $pluginConfigs["RUNTIMES"]; ?>';
var config_max_file_size = '<?php echo $pluginConfigs["MAX_FILE_SIZE"]; ?>';
var config_chunk_size = '<?php echo (!empty($pluginConfigs["CHUNK_SIZE"]) ? $pluginConfigs["CHUNK_SIZE"] : (($UploadMaxSize/1048576) - 1)."mb"); ?>';
-var currentDir = parent.ajaxplorer.getContextNode().getPath();
+var currentDir = parent.pydio.getContextNode().getPath();
+var AjxpNode = parent.AjxpNode;
$(function() {
$("#plupload_uploader").pluploadQueue({
@@ -59,12 +60,23 @@
// attach callbacks for FileUploaded
function attachCallbacks(Uploader) {
+ Uploader.bind('FilesAdded', function(up, files){
+ plupload.each(files, function(file){
+ var node = new AjxpNode(currentDir + '/' + file.name);
+ if(file.size) node.getMetadata().set('filesize', file.size);
+ try{
+ parent.pydio.getContextHolder().applyCheckHook(node);
+ }catch(e){
+ Uploader.removeFile(file);
+ }
+ });
+ });
Uploader.bind('UploadFile', function(up, file, res) {
parent.document.fire("ajaxplorer:longtask_starting");
});
Uploader.bind('FileUploaded', function(up, file, res) {
if(this.total.queued <= 1) {
- parent.ajaxplorer.fireContextRefresh();
+ parent.pydio.fireContextRefresh();
parent.document.fire("ajaxplorer:longtask_finished");
}
});

0 comments on commit ab5a844

Please sign in to comment.