diff options
Diffstat (limited to 'vendor/blueimp/jquery-file-upload/js/cors')
-rw-r--r-- | vendor/blueimp/jquery-file-upload/js/cors/jquery.postmessage-transport.js | 22 | ||||
-rw-r--r-- | vendor/blueimp/jquery-file-upload/js/cors/jquery.xdr-transport.js | 16 |
2 files changed, 19 insertions, 19 deletions
diff --git a/vendor/blueimp/jquery-file-upload/js/cors/jquery.postmessage-transport.js b/vendor/blueimp/jquery-file-upload/js/cors/jquery.postmessage-transport.js index 0a3d9fe45..5d5cc2f8d 100644 --- a/vendor/blueimp/jquery-file-upload/js/cors/jquery.postmessage-transport.js +++ b/vendor/blueimp/jquery-file-upload/js/cors/jquery.postmessage-transport.js @@ -11,7 +11,7 @@ /* global define, require */ -(function(factory) { +(function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { // Register as an anonymous AMD module: @@ -23,7 +23,7 @@ // Browser globals: factory(window.jQuery); } -})(function($) { +})(function ($) { 'use strict'; var counter = 0, @@ -46,7 +46,7 @@ 'url', 'username' ], - convert = function(p) { + convert = function (p) { return p; }; @@ -58,10 +58,10 @@ } }); - $.ajaxTransport('postmessage', function(options) { + $.ajaxTransport('postmessage', function (options) { if (options.postMessage && window.postMessage) { var iframe, - loc = $('<a>').prop('href', options.postMessage)[0], + loc = $('<a></a>').prop('href', options.postMessage)[0], target = loc.protocol + '//' + loc.host, xhrUpload = options.xhr().upload; // IE always includes the port for the host property of a link @@ -71,7 +71,7 @@ target = target.replace(/:(80|443)$/, ''); } return { - send: function(_, completeCallback) { + send: function (_, completeCallback) { counter += 1; var message = { id: 'postmessage-transport-' + counter @@ -84,12 +84,12 @@ message.id + '"></iframe>' ) - .bind('load', function() { - $.each(names, function(i, name) { + .on('load', function () { + $.each(names, function (i, name) { message[name] = options[name]; }); message.dataType = message.dataType.replace('postmessage ', ''); - $(window).bind(eventName, function(event) { + $(window).on(eventName, function (event) { var e = event.originalEvent; var data = e.data; var ev; @@ -107,7 +107,7 @@ data.headers ); iframe.remove(); - $(window).unbind(eventName); + $(window).off(eventName); } } }); @@ -115,7 +115,7 @@ }) .appendTo(document.body); }, - abort: function() { + abort: function () { if (iframe) { iframe.remove(); } diff --git a/vendor/blueimp/jquery-file-upload/js/cors/jquery.xdr-transport.js b/vendor/blueimp/jquery-file-upload/js/cors/jquery.xdr-transport.js index 68e36be58..9e81860b9 100644 --- a/vendor/blueimp/jquery-file-upload/js/cors/jquery.xdr-transport.js +++ b/vendor/blueimp/jquery-file-upload/js/cors/jquery.xdr-transport.js @@ -14,7 +14,7 @@ /* global define, require, XDomainRequest */ -(function(factory) { +(function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { // Register as an anonymous AMD module: @@ -26,10 +26,10 @@ // Browser globals: factory(window.jQuery); } -})(function($) { +})(function ($) { 'use strict'; if (window.XDomainRequest && !$.support.cors) { - $.ajaxTransport(function(s) { + $.ajaxTransport(function (s) { if (s.crossDomain && s.async) { if (s.timeout) { s.xdrTimeout = s.timeout; @@ -37,7 +37,7 @@ } var xdr; return { - send: function(headers, completeCallback) { + send: function (headers, completeCallback) { var addParamChar = /\?/.test(s.url) ? '&' : '?'; /** * Callback wrapper function @@ -65,7 +65,7 @@ s.type = 'POST'; } xdr.open(s.type, s.url); - xdr.onload = function() { + xdr.onload = function () { callback( 200, 'OK', @@ -73,18 +73,18 @@ 'Content-Type: ' + xdr.contentType ); }; - xdr.onerror = function() { + xdr.onerror = function () { callback(404, 'Not Found'); }; if (s.xdrTimeout) { - xdr.ontimeout = function() { + xdr.ontimeout = function () { callback(0, 'timeout'); }; xdr.timeout = s.xdrTimeout; } xdr.send((s.hasContent && s.data) || null); }, - abort: function() { + abort: function () { if (xdr) { xdr.onerror = $.noop(); xdr.abort(); |