Skip to content

Commit

Permalink
Update js.
Browse files Browse the repository at this point in the history
  • Loading branch information
Davit Barbakadze committed Oct 2, 2017
1 parent dd4b7f4 commit 5ccd236
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 45 deletions.
39 changes: 15 additions & 24 deletions js/moxie.js
@@ -1,15 +1,15 @@
;var MXI_DEBUG = true;
/**
* mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
* v1.5.5
* v1.5.6
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*
* Date: 2017-08-26
* Date: 2017-10-02
*/
;(function (global, factory) {
var extract = function() {
Expand Down Expand Up @@ -1447,10 +1447,15 @@ define("moxie/core/utils/Env", [
return false;
},

use_blob_uri: (function() {
use_blob_uri: function() {
var URL = window.URL;
return URL && 'createObjectURL' in URL && 'revokeObjectURL' in URL;
}()),
caps.use_blob_uri = (URL &&
'createObjectURL' in URL &&
'revokeObjectURL' in URL &&
(Env.browser !== 'IE' || Env.verComp(Env.version, '11.0.46', '>=')) // IE supports createObjectURL, but not fully, for example it fails to use it as a src for the image
);
return caps.use_blob_uri;
},

// ideas for this heavily come from Modernizr (http://modernizr.com/)
use_data_uri: (function() {
Expand Down Expand Up @@ -9365,8 +9370,7 @@ define("moxie/runtime/html5/image/Image", [
if (blob.isDetached()) {
_binStr = blob.getSource();
_preload.call(this, _binStr);
} else if (Env.can('use_blob_uri')) {
_preload.call(this, URL.createObjectURL(blob.getSource()));
return;
} else {
_readAsDataUrl.call(this, blob.getSource(), function(dataUrl) {
if (asBinary) {
Expand All @@ -9378,23 +9382,15 @@ define("moxie/runtime/html5/image/Image", [
},

loadFromImage: function(img, exact) {
var comp = this;
comp.meta = img.meta;
this.meta = img.meta;

_blob = new File(null, {
name: img.name,
size: img.size,
type: img.type
});

if (Env.can('create_canvas') && !exact) {
_canvas = img.getAsCanvas();
setTimeout(function() {
comp.trigger('load');
});
} else {
_preload.call(this, exact ? (_binStr = img.getAsBinaryString()) : img.getAsDataURL());
}
_preload.call(this, exact ? (_binStr = img.getAsBinaryString()) : img.getAsDataURL());
},

getInfo: function() {
Expand Down Expand Up @@ -9483,7 +9479,7 @@ define("moxie/runtime/html5/image/Image", [
var quality = arguments[1] || 90;

// if image has not been modified, return the source right away
if (!_modified && _img.src.substr(0, 5) === 'data:') {
if (!_modified) {
return _img.src;
}

Expand Down Expand Up @@ -9602,7 +9598,6 @@ define("moxie/runtime/html5/image/Image", [

function _preload(str) {
var comp = this;
var prefix = str.substr(0, 5);

_img = new Image();
_img.onerror = function() {
Expand All @@ -9613,7 +9608,7 @@ define("moxie/runtime/html5/image/Image", [
comp.trigger('load');
};

_img.src = (prefix === 'data:' || prefix === 'blob:' ? str : _toDataUrl(str, _blob.type));
_img.src = str.substr(0, 5) == 'data:' ? str : _toDataUrl(str, _blob.type);
}


Expand Down Expand Up @@ -9715,10 +9710,6 @@ define("moxie/runtime/html5/image/Image", [
_imgInfo = null;
}

if (_img && Env.can('use_blob_uri')) {
URL.revokeObjectURL(_img.src);
}

_binStr = _img = _canvas = _blob = null;
_modified = false;
}
Expand Down
12 changes: 6 additions & 6 deletions js/moxie.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions js/plupload.dev.js
@@ -1,14 +1,14 @@
/**
* Plupload - multi-runtime File Uploader
* v2.3.3
* v2.3.4
*
* Copyright 2013, Moxiecode Systems AB
* Released under GPL License.
*
* License: http://www.plupload.com/license
* Contributing: http://www.plupload.com/contributing
*
* Date: 2017-08-28
* Date: 2017-10-02
*/
;(function (global, factory) {
var extract = function() {
Expand Down Expand Up @@ -112,7 +112,7 @@ var plupload = {
* @static
* @final
*/
VERSION : '2.3.3',
VERSION : '2.3.4',

/**
* The state of the queue before it has started and after it has finished
Expand Down
18 changes: 9 additions & 9 deletions js/plupload.full.min.js

Large diffs are not rendered by default.

0 comments on commit 5ccd236

Please sign in to comment.