Skip to content

Commit d7150ca

Browse files
author
Davit Barbakadze
committed
Update js.
1 parent 30d31fe commit d7150ca

File tree

5 files changed

+41
-29
lines changed

5 files changed

+41
-29
lines changed

js/moxie.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4354,7 +4354,9 @@ define('moxie/file/FileReader', [
43544354
* Contributing: http://www.plupload.com/contributing
43554355
*/
43564356

4357-
define('moxie/core/utils/Url', [], function() {
4357+
define('moxie/core/utils/Url', [
4358+
'moxie/core/utils/Basic'
4359+
], function(Basic) {
43584360
/**
43594361
Parse url into separate components and fill in absent parts with parts from current url,
43604362
based on https://raw.github.com/kvz/phpjs/master/functions/url/parse_url.js
@@ -4375,22 +4377,34 @@ define('moxie/core/utils/Url', [], function() {
43754377
, uri = {}
43764378
, regex = /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?(\[[\da-fA-F:]+\]|[^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/
43774379
, m = regex.exec(url || '')
4380+
, isRelative
4381+
, isSchemeLess = /^\/\/\w/.test(url)
43784382
;
43794383

4384+
switch (Basic.typeOf(currentUrl)) {
4385+
case 'undefined':
4386+
currentUrl = parseUrl(document.location.href, false);
4387+
break;
4388+
4389+
case 'string':
4390+
currentUrl = parseUrl(currentUrl, false);
4391+
break;
4392+
}
4393+
43804394
while (i--) {
43814395
if (m[i]) {
43824396
uri[key[i]] = m[i];
43834397
}
43844398
}
43854399

4386-
// when url is relative, we set the origin and the path ourselves
4387-
if (!uri.scheme) {
4388-
// come up with defaults
4389-
if (!currentUrl || typeof(currentUrl) === 'string') {
4390-
currentUrl = parseUrl(currentUrl || document.location.href);
4391-
}
4400+
isRelative = !isSchemeLess && !uri.scheme;
43924401

4402+
if (isSchemeLess || isRelative) {
43934403
uri.scheme = currentUrl.scheme;
4404+
}
4405+
4406+
// when url is relative, we set the origin and the path ourselves
4407+
if (isRelative) {
43944408
uri.host = currentUrl.host;
43954409
uri.port = currentUrl.port;
43964410

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: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
22
* Plupload - multi-runtime File Uploader
3-
* v2.3.0
3+
* v2.3.1
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-02-02
11+
* Date: 2017-02-06
1212
*/
1313
;(function (global, factory) {
1414
var extract = function() {
@@ -112,7 +112,7 @@ var plupload = {
112112
* @static
113113
* @final
114114
*/
115-
VERSION : '2.3.0',
115+
VERSION : '2.3.1',
116116

117117
/**
118118
* The state of the queue before it has started and after it has finished
@@ -897,9 +897,9 @@ plupload.Uploader = function(options) {
897897
* @event BeforeChunkUpload
898898
* @param {plupload.Uploader} uploader Uploader instance sending the event.
899899
* @param {plupload.File} file File to be uploaded.
900-
* @param {Object} POST params to be sent.
901-
* @param {Blob} current Blob.
902-
* @param {offset} current Slice offset.
900+
* @param {Object} args POST params to be sent.
901+
* @param {Blob} chunkBlob Current blob.
902+
* @param {offset} offset Current offset.
903903
*/
904904

905905
/**
@@ -1494,11 +1494,11 @@ plupload.Uploader = function(options) {
14941494
}
14951495

14961496
if (up.trigger('BeforeChunkUpload', file, args, chunkBlob, offset)) {
1497-
up.trigger('UploadChunk', args, chunkBlob, curChunkSize);
1497+
uploadChunk(args, chunkBlob, curChunkSize);
14981498
}
14991499
}
15001500

1501-
function onUploadChunk(up, args, chunkBlob, curChunkSize) {
1501+
function uploadChunk(args, chunkBlob, curChunkSize) {
15021502
var formData;
15031503

15041504
xhr = new o.xhr.XMLHttpRequest();
@@ -1630,8 +1630,6 @@ plupload.Uploader = function(options) {
16301630
}
16311631
}
16321632

1633-
up.unbind('UploadChunk', onUploadChunk); // make sure that we bind only once per file
1634-
up.bind('UploadChunk', onUploadChunk);
16351633

16361634
blob = file.getSource();
16371635

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)