Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Add check hook on pluploader. Manual merge and close #957
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Sep 22, 2016
1 parent 31c08f4 commit ab5a844
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions core/src/plugins/uploader.plupload/pluploader_tpl.html
Expand Up @@ -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({
Expand Down Expand Up @@ -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");
}
});
Expand Down

0 comments on commit ab5a844

Please sign in to comment.