Skip to content

Commit 650763a

Browse files
committed
Update js.
1 parent 1dfcec1 commit 650763a

File tree

7 files changed

+231
-175
lines changed

7 files changed

+231
-175
lines changed

js/jquery.ui.plupload/jquery.ui.plupload.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@ Dispatched when file dialog is closed.
141141
/**
142142
Dispatched when upload is started.
143143
144-
@event start
144+
@event started
145145
@param {plupload.Uploader} uploader Uploader instance sending the event.
146146
*/
147147

148148
/**
149149
Dispatched when upload is stopped.
150150
151-
@event stop
151+
@event stopped
152152
@param {plupload.Uploader} uploader Uploader instance sending the event.
153153
*/
154154

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

595-
uploader.bind('QueueChanged StateChanged', function() {
595+
uploader.bind('QueueChanged', function() {
596596
self._handleState();
597597
});
598+
599+
uploader.bind('StateChanged', function(up) {
600+
self._handleState();
601+
if (plupload.STARTED === up.state) {
602+
self._trigger('started', null, { up: this.uploader });
603+
} else if (plupload.STOPPED === up.state) {
604+
self._trigger('stopped', null, { up: this.uploader });
605+
}
606+
});
598607

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

603-
uploader.bind('FileUploaded', function(up, file) {
612+
uploader.bind('FileUploaded', function(up, file, result) {
604613
self._handleFileStatus(file);
605-
self._trigger('uploaded', null, { up: up, file: file } );
614+
self._trigger('uploaded', null, { up: up, file: file, result: result } );
606615
});
607616

608617
uploader.bind('UploadProgress', function(up, file) {
@@ -656,7 +665,6 @@ $.widget("ui.plupload", {
656665
*/
657666
start: function() {
658667
this.uploader.start();
659-
this._trigger('start', null, { up: this.uploader });
660668
},
661669

662670

@@ -667,7 +675,6 @@ $.widget("ui.plupload", {
667675
*/
668676
stop: function() {
669677
this.uploader.stop();
670-
this._trigger('stop', null, { up: this.uploader });
671678
},
672679

673680

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

695702

696703
/**
697-
Retrieve file by it's unique id.
704+
Retrieve file by its unique id.
698705
699706
@method getFile
700707
@param {String} id Unique id of the file
@@ -726,7 +733,7 @@ $.widget("ui.plupload", {
726733
Remove the file from the queue.
727734
728735
@method removeFile
729-
@param {plupload.File|String} file File to remove, might be specified directly or by it's unique id
736+
@param {plupload.File|String} file File to remove, might be specified directly or by its unique id
730737
*/
731738
removeFile: function(file) {
732739
if (plupload.typeOf(file) === 'string') {

js/jquery.ui.plupload/jquery.ui.plupload.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/moxie.js

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
;var MXI_DEBUG = true;
22
/**
33
* mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
4-
* v1.3.3
4+
* v1.3.4
55
*
66
* Copyright 2013, Moxiecode Systems AB
77
* Released under GPL License.
88
*
99
* License: http://www.plupload.com/license
1010
* Contributing: http://www.plupload.com/contributing
1111
*
12-
* Date: 2015-07-03
12+
* Date: 2015-07-18
1313
*/
1414
/**
1515
* Compiled inline version. (Library mode)
@@ -1892,7 +1892,8 @@ define('moxie/core/EventTarget', [
18921892
@return {Mixed} Returns a handler if it was found and false, if - not
18931893
*/
18941894
hasEventListener: function(type) {
1895-
return type ? !!(eventpool[this.uid] && eventpool[this.uid][type]) : !!eventpool[this.uid];
1895+
var list = type ? eventpool[this.uid] && eventpool[this.uid][type] : eventpool[this.uid];
1896+
return list ? list : false;
18961897
},
18971898

18981899
/**
@@ -6030,14 +6031,6 @@ define("moxie/image/Image", [
60306031
info = this.exec('Image', 'getInfo');
60316032
}
60326033

6033-
// store thumbnail data as blob
6034-
if (info.meta && info.meta.thumb && !(info.meta.thumb.data instanceof Blob)) {
6035-
info.meta.thumb.data = new Blob(this.ruid, {
6036-
type: 'image/jpeg',
6037-
data: info.meta.thumb.data
6038-
});
6039-
}
6040-
60416034
this.size = info.size;
60426035
this.width = info.width;
60436036
this.height = info.height;
@@ -6076,7 +6069,7 @@ define("moxie/image/Image", [
60766069
// if String
60776070
else if (srcType === 'string') {
60786071
// if dataUrl String
6079-
if (/^data:[^;]*;base64,/.test(src)) {
6072+
if (src.substr(0, 5) === 'data:') {
60806073
_load.call(this, new Blob(null, { data: src }), arguments[1]);
60816074
}
60826075
// else assume Url, either relative or absolute
@@ -8842,6 +8835,14 @@ define("moxie/runtime/html5/image/Image", [
88428835
meta: _imgInfo && _imgInfo.meta || this.meta || {}
88438836
};
88448837

8838+
// store thumbnail data as blob
8839+
if (info.meta && info.meta.thumb && !(info.meta.thumb.data instanceof Blob)) {
8840+
info.meta.thumb.data = new Blob(null, {
8841+
type: 'image/jpeg',
8842+
data: info.meta.thumb.data
8843+
});
8844+
}
8845+
88458846
return info;
88468847
},
88478848

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

9909+
getInfo: function() {
9910+
var self = this.getRuntime()
9911+
, info = self.shimExec.call(this, 'Image', 'getInfo')
9912+
;
9913+
9914+
if (info.meta && info.meta.thumb && !(info.meta.thumb.data instanceof Blob)) {
9915+
info.meta.thumb.data = new Blob(self.uid, info.meta.thumb.data);
9916+
}
9917+
return info;
9918+
},
9919+
99089920
getAsBlob: function(type, quality) {
99099921
var self = this.getRuntime()
99109922
, blob = self.shimExec.call(this, 'Image', 'getAsBlob', type, quality)
@@ -10434,6 +10446,11 @@ define("moxie/runtime/silverlight/image/Image", [
1043410446
}
1043510447
}
1043610448
});
10449+
10450+
// save thumb data as blob
10451+
if (info.meta && info.meta.thumb && !(info.meta.thumb.data instanceof Blob)) {
10452+
info.meta.thumb.data = new Blob(self.uid, info.meta.thumb.data);
10453+
}
1043710454
}
1043810455

1043910456
info.width = parseInt(rawInfo.width, 10);

js/moxie.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)