Skip to content

Commit

Permalink
Added preinit/init options to to ease up the binding of custom events…
Browse files Browse the repository at this point in the history
… to queueWidget and the Uploader class.
  • Loading branch information
spocke committed Sep 25, 2010
1 parent 402f864 commit b0469d8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
3 changes: 2 additions & 1 deletion changelog.txt
@@ -1,11 +1,12 @@
Version 1.2.x (2010-xx-xx)
Added support for crossdomain loading of the XAP and SWF files and crossdomain upload.
Added preinit/init options to to ease up the binding of custom events to queueWidget and the Uploader class.
Added drag/drop support for Safari kind of a hack until they release official drag/drop support like Chrome.
Fixed logic issue with the upload.php example file. Chunking wasn't working correctly.
Fixed issue with HTML4 not handling the form encoding correctly on older IE versions. Patch contributed by jinxdone.
Fixed so the HTML4 runtime only submits the defined multipart_params arguments.
Fixes issue where it wasn't possible to dynamically override url or mutlipart_params for the HTML4 runtime.
Fixed so all runtimes pass the name, chunk and chunks parameters as multipart parameters instead of querystring parameters.
Fixed drag/drop support for Safari kind of a hack until they release official drag/drop support like Chrome.
Version 1.2.4 (2010-09-08)
Added new BeforeUpload event to make it easier to override settings before a file is uploaded.
Added new automatic usage of FileReference in Flash if it's possible. Contributed by Marcel Jackwerth.
Expand Down
5 changes: 0 additions & 5 deletions src/javascript/jquery.plupload.queue.js
Expand Up @@ -94,11 +94,6 @@
container : id
}, settings));

// Call preinit function
if (settings.preinit) {
settings.preinit(uploader);
}

uploaders[id] = uploader;

function handleStatus(file) {
Expand Down
16 changes: 16 additions & 0 deletions src/javascript/plupload.js
Expand Up @@ -708,6 +708,14 @@
init : function() {
var self = this, i, runtimeList, a, runTimeIndex = 0, items;

if (typeof(settings.preinit) == "function") {
settings.preinit(self);
} else {
plupload.each(settings.preinit, function(func, name) {
self.bind(name, func);
});
}

settings.page_url = settings.page_url || document.location.pathname.replace(/\/[^\/]+$/g, '/');

// If url is relative force it absolute to the current page
Expand Down Expand Up @@ -885,6 +893,14 @@
}

callNextInit();

if (typeof(settings.init) == "function") {
settings.init(self);
} else {
plupload.each(settings.init, function(func, name) {
self.bind(name, func);
});
}
},

/**
Expand Down

0 comments on commit b0469d8

Please sign in to comment.