Skip to content

Commit

Permalink
Update js.
Browse files Browse the repository at this point in the history
  • Loading branch information
Davit Barbakadze committed Feb 6, 2017
1 parent 30d31fe commit d7150ca
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 29 deletions.
28 changes: 21 additions & 7 deletions js/moxie.js
Expand Up @@ -4354,7 +4354,9 @@ define('moxie/file/FileReader', [
* Contributing: http://www.plupload.com/contributing
*/

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

switch (Basic.typeOf(currentUrl)) {
case 'undefined':
currentUrl = parseUrl(document.location.href, false);
break;

case 'string':
currentUrl = parseUrl(currentUrl, false);
break;
}

while (i--) {
if (m[i]) {
uri[key[i]] = m[i];
}
}

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

if (isSchemeLess || isRelative) {
uri.scheme = currentUrl.scheme;
}

// when url is relative, we set the origin and the path ourselves
if (isRelative) {
uri.host = currentUrl.host;
uri.port = currentUrl.port;

Expand Down
6 changes: 3 additions & 3 deletions js/moxie.min.js

Large diffs are not rendered by default.

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

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

/**
Expand Down Expand Up @@ -1494,11 +1494,11 @@ plupload.Uploader = function(options) {
}

if (up.trigger('BeforeChunkUpload', file, args, chunkBlob, offset)) {
up.trigger('UploadChunk', args, chunkBlob, curChunkSize);
uploadChunk(args, chunkBlob, curChunkSize);
}
}

function onUploadChunk(up, args, chunkBlob, curChunkSize) {
function uploadChunk(args, chunkBlob, curChunkSize) {
var formData;

xhr = new o.xhr.XMLHttpRequest();
Expand Down Expand Up @@ -1630,8 +1630,6 @@ plupload.Uploader = function(options) {
}
}

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

blob = file.getSource();

Expand Down
12 changes: 6 additions & 6 deletions js/plupload.full.min.js

Large diffs are not rendered by default.

0 comments on commit d7150ca

Please sign in to comment.