Skip to content

Commit 0f37b16

Browse files
author
Davit Barbakadze
committed
Update js.
1 parent 31851fd commit 0f37b16

File tree

5 files changed

+162
-152
lines changed

5 files changed

+162
-152
lines changed

js/moxie.js

Lines changed: 147 additions & 137 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.5.6
4+
* v1.5.7
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: 2017-10-02
12+
* Date: 2017-11-03
1313
*/
1414
;(function (global, factory) {
1515
var extract = function() {
@@ -280,7 +280,7 @@ define('moxie/core/utils/Basic', [], function() {
280280
child.prototype = new ctor();
281281

282282
// keep a way to reference parent methods
283-
child.super = parent.prototype;
283+
child.parent = parent.prototype;
284284
return child;
285285
}
286286

@@ -1553,7 +1553,8 @@ define("moxie/core/utils/Env", [
15531553
console.appendChild(document.createTextNode(data + "\n"));
15541554
}
15551555

1556-
if (window && window.console && window.console.log) {
1556+
// if debugger present, IE8 might have window.console.log method, but not be able to apply on it (why...)
1557+
if (window && window.console && window.console.log && window.console.log.apply) {
15571558
window.console.log.apply(window.console, arguments);
15581559
} else if (document) {
15591560
var console = document.getElementById('moxie-console');
@@ -3365,7 +3366,7 @@ define("moxie/core/utils/Mime", [
33653366
"moxie/core/utils/Basic",
33663367
"moxie/core/I18n"
33673368
], function(Basic, I18n) {
3368-
3369+
33693370
var mimeData = "" +
33703371
"application/msword,doc dot," +
33713372
"application/pdf,pdf," +
@@ -3416,169 +3417,178 @@ define("moxie/core/utils/Mime", [
34163417
"video/3gpp,3gpp 3gp," +
34173418
"video/3gpp2,3g2," +
34183419
"video/vnd.rn-realvideo,rv," +
3419-
"video/ogg,ogv," +
3420+
"video/ogg,ogv," +
34203421
"video/x-matroska,mkv," +
34213422
"application/vnd.oasis.opendocument.formula-template,otf," +
34223423
"application/octet-stream,exe";
3423-
3424-
3425-
var Mime = {
34263424

3427-
/**
3428-
* Map of mimes to extensions
3429-
*
3430-
* @property mimes
3431-
* @type {Object}
3432-
*/
3433-
mimes: {},
34343425

3435-
/**
3436-
* Map of extensions to mimes
3437-
*
3438-
* @property extensions
3439-
* @type {Object}
3440-
*/
3441-
extensions: {},
3426+
/**
3427+
* Map of mimes to extensions
3428+
*
3429+
* @property mimes
3430+
* @type {Object}
3431+
*/
3432+
var mimes = {};
34423433

3443-
/**
3444-
* Parses mimeData string into a mimes and extensions lookup maps. String should have the
3445-
* following format:
3446-
*
3447-
* application/msword,doc dot,application/pdf,pdf, ...
3448-
*
3449-
* so mime-type followed by comma and followed by space-separated list of associated extensions,
3450-
* then comma again and then another mime-type, etc.
3451-
*
3452-
* If invoked externally will replace override internal lookup maps with user-provided data.
3453-
*
3454-
* @method addMimeType
3455-
* @param {String} mimeData
3456-
*/
3457-
addMimeType: function (mimeData) {
3458-
var items = mimeData.split(/,/), i, ii, ext;
3459-
3460-
for (i = 0; i < items.length; i += 2) {
3461-
ext = items[i + 1].split(/ /);
3434+
/**
3435+
* Map of extensions to mimes
3436+
*
3437+
* @property extensions
3438+
* @type {Object}
3439+
*/
3440+
var extensions = {};
34623441

3463-
// extension to mime lookup
3464-
for (ii = 0; ii < ext.length; ii++) {
3465-
this.mimes[ext[ii]] = items[i];
3466-
}
3467-
// mime to extension lookup
3468-
this.extensions[items[i]] = ext;
3442+
3443+
/**
3444+
* Parses mimeData string into a mimes and extensions lookup maps. String should have the
3445+
* following format:
3446+
*
3447+
* application/msword,doc dot,application/pdf,pdf, ...
3448+
*
3449+
* so mime-type followed by comma and followed by space-separated list of associated extensions,
3450+
* then comma again and then another mime-type, etc.
3451+
*
3452+
* If invoked externally will replace override internal lookup maps with user-provided data.
3453+
*
3454+
* @method addMimeType
3455+
* @param {String} mimeData
3456+
*/
3457+
var addMimeType = function (mimeData) {
3458+
var items = mimeData.split(/,/), i, ii, ext;
3459+
3460+
for (i = 0; i < items.length; i += 2) {
3461+
ext = items[i + 1].split(/ /);
3462+
3463+
// extension to mime lookup
3464+
for (ii = 0; ii < ext.length; ii++) {
3465+
mimes[ext[ii]] = items[i];
34693466
}
3470-
},
3467+
// mime to extension lookup
3468+
extensions[items[i]] = ext;
3469+
}
3470+
};
34713471

34723472

3473-
extList2mimes: function (filters, addMissingExtensions) {
3474-
var self = this, ext, i, ii, type, mimes = [];
3475-
3476-
// convert extensions to mime types list
3477-
for (i = 0; i < filters.length; i++) {
3478-
ext = filters[i].extensions.toLowerCase().split(/\s*,\s*/);
3473+
var extList2mimes = function (filters, addMissingExtensions) {
3474+
var ext, i, ii, type, mimes = [];
34793475

3480-
for (ii = 0; ii < ext.length; ii++) {
3481-
3482-
// if there's an asterisk in the list, then accept attribute is not required
3483-
if (ext[ii] === '*') {
3484-
return [];
3485-
}
3476+
// convert extensions to mime types list
3477+
for (i = 0; i < filters.length; i++) {
3478+
ext = filters[i].extensions.toLowerCase().split(/\s*,\s*/);
34863479

3487-
type = self.mimes[ext[ii]];
3480+
for (ii = 0; ii < ext.length; ii++) {
34883481

3489-
// future browsers should filter by extension, finally
3490-
if (addMissingExtensions && /^\w+$/.test(ext[ii])) {
3491-
mimes.push('.' + ext[ii]);
3492-
} else if (type && Basic.inArray(type, mimes) === -1) {
3493-
mimes.push(type);
3494-
} else if (!type) {
3495-
// if we have no type in our map, then accept all
3496-
return [];
3497-
}
3482+
// if there's an asterisk in the list, then accept attribute is not required
3483+
if (ext[ii] === '*') {
3484+
return [];
3485+
}
3486+
3487+
type = mimes[ext[ii]];
3488+
3489+
// future browsers should filter by extension, finally
3490+
if (addMissingExtensions && /^\w+$/.test(ext[ii])) {
3491+
mimes.push('.' + ext[ii]);
3492+
} else if (type && Basic.inArray(type, mimes) === -1) {
3493+
mimes.push(type);
3494+
} else if (!type) {
3495+
// if we have no type in our map, then accept all
3496+
return [];
34983497
}
34993498
}
3500-
return mimes;
3501-
},
3499+
}
3500+
return mimes;
3501+
};
35023502

35033503

3504-
mimes2exts: function(mimes) {
3505-
var self = this, exts = [];
3506-
3507-
Basic.each(mimes, function(mime) {
3508-
mime = mime.toLowerCase();
3504+
var mimes2exts = function(mimes) {
3505+
var exts = [];
35093506

3510-
if (mime === '*') {
3511-
exts = [];
3512-
return false;
3513-
}
3507+
Basic.each(mimes, function(mime) {
3508+
mime = mime.toLowerCase();
35143509

3515-
// check if this thing looks like mime type
3516-
var m = mime.match(/^(\w+)\/(\*|\w+)$/);
3517-
if (m) {
3518-
if (m[2] === '*') {
3519-
// wildcard mime type detected
3520-
Basic.each(self.extensions, function(arr, mime) {
3521-
if ((new RegExp('^' + m[1] + '/')).test(mime)) {
3522-
[].push.apply(exts, self.extensions[mime]);
3523-
}
3524-
});
3525-
} else if (self.extensions[mime]) {
3526-
[].push.apply(exts, self.extensions[mime]);
3527-
}
3510+
if (mime === '*') {
3511+
exts = [];
3512+
return false;
3513+
}
3514+
3515+
// check if this thing looks like mime type
3516+
var m = mime.match(/^(\w+)\/(\*|\w+)$/);
3517+
if (m) {
3518+
if (m[2] === '*') {
3519+
// wildcard mime type detected
3520+
Basic.each(extensions, function(arr, mime) {
3521+
if ((new RegExp('^' + m[1] + '/')).test(mime)) {
3522+
[].push.apply(exts, extensions[mime]);
3523+
}
3524+
});
3525+
} else if (extensions[mime]) {
3526+
[].push.apply(exts, extensions[mime]);
35283527
}
3529-
});
3530-
return exts;
3531-
},
3528+
}
3529+
});
3530+
return exts;
3531+
};
35323532

35333533

3534-
mimes2extList: function(mimes) {
3535-
var accept = [], exts = [];
3534+
var mimes2extList = function(mimes) {
3535+
var accept = [], exts = [];
35363536

3537-
if (Basic.typeOf(mimes) === 'string') {
3538-
mimes = Basic.trim(mimes).split(/\s*,\s*/);
3539-
}
3537+
if (Basic.typeOf(mimes) === 'string') {
3538+
mimes = Basic.trim(mimes).split(/\s*,\s*/);
3539+
}
35403540

3541-
exts = this.mimes2exts(mimes);
3542-
3543-
accept.push({
3544-
title: I18n.translate('Files'),
3545-
extensions: exts.length ? exts.join(',') : '*'
3546-
});
3541+
exts = mimes2exts(mimes);
35473542

3548-
return accept;
3549-
},
3543+
accept.push({
3544+
title: I18n.translate('Files'),
3545+
extensions: exts.length ? exts.join(',') : '*'
3546+
});
35503547

3551-
/**
3552-
* Extract extension from the given filename
3553-
*
3554-
* @method getFileExtension
3555-
* @param {String} fileName
3556-
* @return {String} File extension
3557-
*/
3558-
getFileExtension: function(fileName) {
3559-
var matches = fileName && fileName.match(/\.([^.]+)$/);
3560-
if (matches) {
3561-
return matches[1].toLowerCase();
3562-
}
3563-
return '';
3564-
},
3548+
return accept;
3549+
};
35653550

3566-
/**
3567-
* Get file mime-type from it's filename - will try to match the extension
3568-
* against internal mime-type lookup map
3569-
*
3570-
* @method getFileMime
3571-
* @param {String} fileName
3572-
* @return File mime-type if found or an empty string if not
3573-
*/
3574-
getFileMime: function(fileName) {
3575-
return this.mimes[this.getFileExtension(fileName)] || '';
3551+
/**
3552+
* Extract extension from the given filename
3553+
*
3554+
* @method getFileExtension
3555+
* @param {String} fileName
3556+
* @return {String} File extension
3557+
*/
3558+
var getFileExtension = function(fileName) {
3559+
var matches = fileName && fileName.match(/\.([^.]+)$/);
3560+
if (matches) {
3561+
return matches[1].toLowerCase();
35763562
}
3563+
return '';
3564+
};
3565+
3566+
3567+
/**
3568+
* Get file mime-type from it's filename - will try to match the extension
3569+
* against internal mime-type lookup map
3570+
*
3571+
* @method getFileMime
3572+
* @param {String} fileName
3573+
* @return File mime-type if found or an empty string if not
3574+
*/
3575+
var getFileMime = function(fileName) {
3576+
return mimes[getFileExtension(fileName)] || '';
35773577
};
35783578

3579-
Mime.addMimeType(mimeData);
35803579

3581-
return Mime;
3580+
addMimeType(mimeData);
3581+
3582+
return {
3583+
mimes: mimes,
3584+
extensions: extensions,
3585+
addMimeType: addMimeType,
3586+
extList2mimes: extList2mimes,
3587+
mimes2exts: mimes2exts,
3588+
mimes2extList: mimes2extList,
3589+
getFileExtension: getFileExtension,
3590+
getFileMime: getFileMime
3591+
}
35823592
});
35833593

35843594
// Included from: src/javascript/file/FileInput.js

js/moxie.min.js

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

js/plupload.dev.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
22
* Plupload - multi-runtime File Uploader
3-
* v2.3.5
3+
* v2.3.6
44
*
55
* Copyright 2013, Moxiecode Systems AB
66
* Released under GPL License.
77
*
88
* License: http://www.plupload.com/license
99
* Contributing: http://www.plupload.com/contributing
1010
*
11-
* Date: 2017-11-02
11+
* Date: 2017-11-03
1212
*/
1313
;(function (global, factory) {
1414
var extract = function() {
@@ -112,7 +112,7 @@ var plupload = {
112112
* @static
113113
* @final
114114
*/
115-
VERSION : '2.3.5',
115+
VERSION : '2.3.6',
116116

117117
/**
118118
* The state of the queue before it has started and after it has finished

js/plupload.full.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)