Skip to content

Commit

Permalink
Update js.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayarjo committed Jul 21, 2015
1 parent 1dfcec1 commit 650763a
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 175 deletions.
25 changes: 16 additions & 9 deletions js/jquery.ui.plupload/jquery.ui.plupload.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ Dispatched when file dialog is closed.
/**
Dispatched when upload is started.
@event start
@event started
@param {plupload.Uploader} uploader Uploader instance sending the event.
*/

/**
Dispatched when upload is stopped.
@event stop
@event stopped
@param {plupload.Uploader} uploader Uploader instance sending the event.
*/

Expand Down Expand Up @@ -592,17 +592,26 @@ $.widget("ui.plupload", {
self._trigger('removed', null, { up: up, files: files } );
});

uploader.bind('QueueChanged StateChanged', function() {
uploader.bind('QueueChanged', function() {
self._handleState();
});

uploader.bind('StateChanged', function(up) {
self._handleState();
if (plupload.STARTED === up.state) {
self._trigger('started', null, { up: this.uploader });
} else if (plupload.STOPPED === up.state) {
self._trigger('stopped', null, { up: this.uploader });
}
});

uploader.bind('UploadFile', function(up, file) {
self._handleFileStatus(file);
});

uploader.bind('FileUploaded', function(up, file) {
uploader.bind('FileUploaded', function(up, file, result) {
self._handleFileStatus(file);
self._trigger('uploaded', null, { up: up, file: file } );
self._trigger('uploaded', null, { up: up, file: file, result: result } );
});

uploader.bind('UploadProgress', function(up, file) {
Expand Down Expand Up @@ -656,7 +665,6 @@ $.widget("ui.plupload", {
*/
start: function() {
this.uploader.start();
this._trigger('start', null, { up: this.uploader });
},


Expand All @@ -667,7 +675,6 @@ $.widget("ui.plupload", {
*/
stop: function() {
this.uploader.stop();
this._trigger('stop', null, { up: this.uploader });
},


Expand All @@ -694,7 +701,7 @@ $.widget("ui.plupload", {


/**
Retrieve file by it's unique id.
Retrieve file by its unique id.
@method getFile
@param {String} id Unique id of the file
Expand Down Expand Up @@ -726,7 +733,7 @@ $.widget("ui.plupload", {
Remove the file from the queue.
@method removeFile
@param {plupload.File|String} file File to remove, might be specified directly or by it's unique id
@param {plupload.File|String} file File to remove, might be specified directly or by its unique id
*/
removeFile: function(file) {
if (plupload.typeOf(file) === 'string') {
Expand Down
2 changes: 1 addition & 1 deletion js/jquery.ui.plupload/jquery.ui.plupload.min.js

Large diffs are not rendered by default.

41 changes: 29 additions & 12 deletions js/moxie.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
;var MXI_DEBUG = true;
/**
* mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
* v1.3.3
* v1.3.4
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*
* Date: 2015-07-03
* Date: 2015-07-18
*/
/**
* Compiled inline version. (Library mode)
Expand Down Expand Up @@ -1892,7 +1892,8 @@ define('moxie/core/EventTarget', [
@return {Mixed} Returns a handler if it was found and false, if - not
*/
hasEventListener: function(type) {
return type ? !!(eventpool[this.uid] && eventpool[this.uid][type]) : !!eventpool[this.uid];
var list = type ? eventpool[this.uid] && eventpool[this.uid][type] : eventpool[this.uid];
return list ? list : false;
},

/**
Expand Down Expand Up @@ -6030,14 +6031,6 @@ define("moxie/image/Image", [
info = this.exec('Image', 'getInfo');
}

// store thumbnail data as blob
if (info.meta && info.meta.thumb && !(info.meta.thumb.data instanceof Blob)) {
info.meta.thumb.data = new Blob(this.ruid, {
type: 'image/jpeg',
data: info.meta.thumb.data
});
}

this.size = info.size;
this.width = info.width;
this.height = info.height;
Expand Down Expand Up @@ -6076,7 +6069,7 @@ define("moxie/image/Image", [
// if String
else if (srcType === 'string') {
// if dataUrl String
if (/^data:[^;]*;base64,/.test(src)) {
if (src.substr(0, 5) === 'data:') {
_load.call(this, new Blob(null, { data: src }), arguments[1]);
}
// else assume Url, either relative or absolute
Expand Down Expand Up @@ -8842,6 +8835,14 @@ define("moxie/runtime/html5/image/Image", [
meta: _imgInfo && _imgInfo.meta || this.meta || {}
};

// store thumbnail data as blob
if (info.meta && info.meta.thumb && !(info.meta.thumb.data instanceof Blob)) {
info.meta.thumb.data = new Blob(null, {
type: 'image/jpeg',
data: info.meta.thumb.data
});
}

return info;
},

Expand Down Expand Up @@ -9905,6 +9906,17 @@ define("moxie/runtime/flash/image/Image", [
return self.shimExec.call(this, 'Image', 'loadFromImage', img.uid);
},

getInfo: function() {
var self = this.getRuntime()
, info = self.shimExec.call(this, 'Image', 'getInfo')
;

if (info.meta && info.meta.thumb && !(info.meta.thumb.data instanceof Blob)) {
info.meta.thumb.data = new Blob(self.uid, info.meta.thumb.data);
}
return info;
},

getAsBlob: function(type, quality) {
var self = this.getRuntime()
, blob = self.shimExec.call(this, 'Image', 'getAsBlob', type, quality)
Expand Down Expand Up @@ -10434,6 +10446,11 @@ define("moxie/runtime/silverlight/image/Image", [
}
}
});

// save thumb data as blob
if (info.meta && info.meta.thumb && !(info.meta.thumb.data instanceof Blob)) {
info.meta.thumb.data = new Blob(self.uid, info.meta.thumb.data);
}
}

info.width = parseInt(rawInfo.width, 10);
Expand Down
12 changes: 6 additions & 6 deletions js/moxie.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 650763a

Please sign in to comment.