Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nightwolfzor
Created October 28, 2013 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nightwolfzor/7192157 to your computer and use it in GitHub Desktop.
Save nightwolfzor/7192157 to your computer and use it in GitHub Desktop.
diff --git a/resources/web/static/scripts/lib/filesystem/fineuploader-4.0.0.js b/resources/web/static/scripts/lib/filesystem/fineuploader-4.0.0.js
index 0b11009..17288f5 100755
--- a/resources/web/static/scripts/lib/filesystem/fineuploader-4.0.0.js
+++ b/resources/web/static/scripts/lib/filesystem/fineuploader-4.0.0.js
@@ -1790,6 +1790,10 @@ qq.basePrivateApi = {
self._onProgress(id, name, loaded, total);
self._options.callbacks.onProgress(id, name, loaded, total);
},
+ onUploadedChunk: function(id, name, response, xhr){
+ self._onUploadedChunk(id, name, response, xhr);
+ self._options.callbacks.onUploadedChunk(id, name, response, xhr);
+ },
onComplete: function(id, name, result, xhr){
var retVal = self._onComplete(id, name, result, xhr);
@@ -1954,6 +1958,10 @@ qq.basePrivateApi = {
//nothing to do yet in core uploader
},
+ _onUploadedChunk: function(id, name, response, xhr) {
+ //nothing to do yet in core uploader
+ },
+
_onComplete: function(id, name, result, xhr) {
if (!result.success) {
this._netUploadedOrQueued--;
@@ -2715,6 +2723,7 @@ qq.FineUploaderBasic = function(o) {
onCancel: function(id, name){},
onUpload: function(id, name){},
onUploadChunk: function(id, name, chunkData){},
+ onUploadedChunk: function(id, name, responseJSON, maybeXhr){},
onResume: function(id, fileName, chunkData){},
onProgress: function(id, name, loaded, total){},
onError: function(id, name, reason, maybeXhrOrXdr) {},
@@ -3273,6 +3282,7 @@ qq.UploadHandler = function(o, namespace) {
onCancel: function(id, fileName){},
onUpload: function(id, fileName){},
onUploadChunk: function(id, fileName, chunkData){},
+ onUploadedChunk: function(id, fileName, response, xhr){},
onAutoRetry: function(id, fileName, response, xhr){},
onResume: function(id, fileName, chunkData){},
onUuidChanged: function(id, newUuid){}
@@ -4378,7 +4388,9 @@ qq.UploadHandlerXhr = function(options, uploadCompleteCallback, onUuidChanged, l
function handleSuccessfullyCompletedChunk(id, response, xhr) {
var chunkIdx = fileState[id].remainingChunkIdxs.shift(),
- chunkData = internalApi.getChunkData(id, chunkIdx);
+ chunkData = internalApi.getChunkData(id, chunkIdx),
+ name = publicApi.getName(id);
+ options.onUploadedChunk(id, name, response, xhr);
fileState[id].attemptingResume = false;
fileState[id].loaded += chunkData.size + getLastRequestOverhead(id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment