Skip to content

Commit 9a4d9fd

Browse files
committed
Update to JS file 5.31.2
1 parent 3dce496 commit 9a4d9fd

File tree

9 files changed

+787
-18
lines changed

9 files changed

+787
-18
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/*
2+
* jQuery postMessage Transport Plugin 1.1
3+
* https://github.com/blueimp/jQuery-File-Upload
4+
*
5+
* Copyright 2011, Sebastian Tschan
6+
* https://blueimp.net
7+
*
8+
* Licensed under the MIT license:
9+
* http://www.opensource.org/licenses/MIT
10+
*/
11+
12+
/*jslint unparam: true, nomen: true */
13+
/*global define, window, document */
14+
15+
(function (factory) {
16+
'use strict';
17+
if (typeof define === 'function' && define.amd) {
18+
// Register as an anonymous AMD module:
19+
define(['jquery'], factory);
20+
} else {
21+
// Browser globals:
22+
factory(window.jQuery);
23+
}
24+
}(function ($) {
25+
'use strict';
26+
27+
var counter = 0,
28+
names = [
29+
'accepts',
30+
'cache',
31+
'contents',
32+
'contentType',
33+
'crossDomain',
34+
'data',
35+
'dataType',
36+
'headers',
37+
'ifModified',
38+
'mimeType',
39+
'password',
40+
'processData',
41+
'timeout',
42+
'traditional',
43+
'type',
44+
'url',
45+
'username'
46+
],
47+
convert = function (p) {
48+
return p;
49+
};
50+
51+
$.ajaxSetup({
52+
converters: {
53+
'postmessage text': convert,
54+
'postmessage json': convert,
55+
'postmessage html': convert
56+
}
57+
});
58+
59+
$.ajaxTransport('postmessage', function (options) {
60+
if (options.postMessage && window.postMessage) {
61+
var iframe,
62+
loc = $('<a>').prop('href', options.postMessage)[0],
63+
target = loc.protocol + '//' + loc.host,
64+
xhrUpload = options.xhr().upload;
65+
return {
66+
send: function (_, completeCallback) {
67+
var message = {
68+
id: 'postmessage-transport-' + (counter += 1)
69+
},
70+
eventName = 'message.' + message.id;
71+
iframe = $(
72+
'<iframe style="display:none;" src="' +
73+
options.postMessage + '" name="' +
74+
message.id + '"></iframe>'
75+
).bind('load', function () {
76+
$.each(names, function (i, name) {
77+
message[name] = options[name];
78+
});
79+
message.dataType = message.dataType.replace('postmessage ', '');
80+
$(window).bind(eventName, function (e) {
81+
e = e.originalEvent;
82+
var data = e.data,
83+
ev;
84+
if (e.origin === target && data.id === message.id) {
85+
if (data.type === 'progress') {
86+
ev = document.createEvent('Event');
87+
ev.initEvent(data.type, false, true);
88+
$.extend(ev, data);
89+
xhrUpload.dispatchEvent(ev);
90+
} else {
91+
completeCallback(
92+
data.status,
93+
data.statusText,
94+
{postmessage: data.result},
95+
data.headers
96+
);
97+
iframe.remove();
98+
$(window).unbind(eventName);
99+
}
100+
}
101+
});
102+
iframe[0].contentWindow.postMessage(
103+
message,
104+
target
105+
);
106+
}).appendTo(document.body);
107+
},
108+
abort: function () {
109+
if (iframe) {
110+
iframe.remove();
111+
}
112+
}
113+
};
114+
}
115+
});
116+
117+
}));
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*
2+
* jQuery XDomainRequest Transport Plugin 1.1.3
3+
* https://github.com/blueimp/jQuery-File-Upload
4+
*
5+
* Copyright 2011, Sebastian Tschan
6+
* https://blueimp.net
7+
*
8+
* Licensed under the MIT license:
9+
* http://www.opensource.org/licenses/MIT
10+
*
11+
* Based on Julian Aubourg's ajaxHooks xdr.js:
12+
* https://github.com/jaubourg/ajaxHooks/
13+
*/
14+
15+
/*jslint unparam: true */
16+
/*global define, window, XDomainRequest */
17+
18+
(function (factory) {
19+
'use strict';
20+
if (typeof define === 'function' && define.amd) {
21+
// Register as an anonymous AMD module:
22+
define(['jquery'], factory);
23+
} else {
24+
// Browser globals:
25+
factory(window.jQuery);
26+
}
27+
}(function ($) {
28+
'use strict';
29+
if (window.XDomainRequest && !$.support.cors) {
30+
$.ajaxTransport(function (s) {
31+
if (s.crossDomain && s.async) {
32+
if (s.timeout) {
33+
s.xdrTimeout = s.timeout;
34+
delete s.timeout;
35+
}
36+
var xdr;
37+
return {
38+
send: function (headers, completeCallback) {
39+
var addParamChar = /\?/.test(s.url) ? '&' : '?';
40+
function callback(status, statusText, responses, responseHeaders) {
41+
xdr.onload = xdr.onerror = xdr.ontimeout = $.noop;
42+
xdr = null;
43+
completeCallback(status, statusText, responses, responseHeaders);
44+
}
45+
xdr = new XDomainRequest();
46+
// XDomainRequest only supports GET and POST:
47+
if (s.type === 'DELETE') {
48+
s.url = s.url + addParamChar + '_method=DELETE';
49+
s.type = 'POST';
50+
} else if (s.type === 'PUT') {
51+
s.url = s.url + addParamChar + '_method=PUT';
52+
s.type = 'POST';
53+
} else if (s.type === 'PATCH') {
54+
s.url = s.url + addParamChar + '_method=PATCH';
55+
s.type = 'POST';
56+
}
57+
xdr.open(s.type, s.url);
58+
xdr.onload = function () {
59+
callback(
60+
200,
61+
'OK',
62+
{text: xdr.responseText},
63+
'Content-Type: ' + xdr.contentType
64+
);
65+
};
66+
xdr.onerror = function () {
67+
callback(404, 'Not Found');
68+
};
69+
if (s.xdrTimeout) {
70+
xdr.ontimeout = function () {
71+
callback(0, 'timeout');
72+
};
73+
xdr.timeout = s.xdrTimeout;
74+
}
75+
xdr.send((s.hasContent && s.data) || null);
76+
},
77+
abort: function () {
78+
if (xdr) {
79+
xdr.onerror = $.noop();
80+
xdr.abort();
81+
}
82+
}
83+
};
84+
}
85+
});
86+
}
87+
}));

vendor/assets/javascripts/jquery-fileupload/jquery.fileupload-angular.js

100755100644
Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload AngularJS Plugin 1.0.1
2+
* jQuery File Upload AngularJS Plugin 1.2
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2013, Sebastian Tschan
@@ -10,9 +10,24 @@
1010
*/
1111

1212
/*jslint nomen: true, unparam: true */
13-
/*global angular */
13+
/*global define, angular */
1414

15-
(function () {
15+
(function (factory) {
16+
'use strict';
17+
if (typeof define === 'function' && define.amd) {
18+
// Register as an anonymous AMD module:
19+
define([
20+
'jquery',
21+
'angular',
22+
'./jquery.fileupload-image',
23+
'./jquery.fileupload-audio',
24+
'./jquery.fileupload-video',
25+
'./jquery.fileupload-validate'
26+
], factory);
27+
} else {
28+
factory();
29+
}
30+
}(function () {
1631
'use strict';
1732

1833
angular.module('blueimp.fileupload', [])
@@ -96,10 +111,11 @@
96111
if (data.errorThrown === 'abort') {
97112
return;
98113
}
99-
if (data.dataType.indexOf('json') === data.dataType.length - 4) {
114+
if (data.dataType &&
115+
data.dataType.indexOf('json') === data.dataType.length - 4) {
100116
try {
101117
data.result = angular.fromJson(data.jqXHR.responseText);
102-
} catch (err) {}
118+
} catch (ignore) {}
103119
}
104120
data.scope().$apply(function () {
105121
data.handleResponse.call(that, e, data);
@@ -340,9 +356,9 @@
340356
elm.prop('href')
341357
].join(':')
342358
);
343-
} catch (err) {}
359+
} catch (ignore) {}
344360
});
345361
};
346362
});
347363

348-
}());
364+
}));

vendor/assets/javascripts/jquery-fileupload/jquery.fileupload-process.js

100755100644
File mode changed.

vendor/assets/javascripts/jquery-fileupload/jquery.fileupload-ui.js

100755100644
Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload User Interface Plugin 8.2.1
2+
* jQuery File Upload User Interface Plugin 8.3
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -19,7 +19,9 @@
1919
define([
2020
'jquery',
2121
'tmpl',
22-
'./jquery.fileupload-resize',
22+
'./jquery.fileupload-image',
23+
'./jquery.fileupload-audio',
24+
'./jquery.fileupload-video',
2325
'./jquery.fileupload-validate'
2426
], factory);
2527
} else {
@@ -304,16 +306,19 @@
304306
// Callback for file deletion:
305307
destroy: function (e, data) {
306308
var that = $(this).data('blueimp-fileupload') ||
307-
$(this).data('fileupload');
308-
if (data.url) {
309-
$.ajax(data).done(function () {
309+
$(this).data('fileupload'),
310+
removeNode = function () {
310311
that._transition(data.context).done(
311312
function () {
312313
$(this).remove();
313314
that._trigger('destroyed', e, data);
314315
}
315316
);
316-
});
317+
};
318+
if (data.url) {
319+
$.ajax(data).done(removeNode);
320+
} else {
321+
removeNode();
317322
}
318323
}
319324
},

vendor/assets/javascripts/jquery-fileupload/jquery.fileupload-validate.js

100755100644
File mode changed.

vendor/assets/javascripts/jquery-fileupload/jquery.fileupload.js

100755100644
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload Plugin 5.31.1
2+
* jQuery File Upload Plugin 5.31.2
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -439,13 +439,13 @@
439439
},
440440

441441
_initIframeSettings: function (options) {
442+
var targetHost = $('<a></a>').prop('href', options.url).prop('host');
442443
// Setting the dataType to iframe enables the iframe transport:
443444
options.dataType = 'iframe ' + (options.dataType || '');
444445
// The iframe transport accepts a serialized array as form data:
445446
options.formData = this._getFormData(options);
446447
// Add redirect url to form data on cross-domain uploads:
447-
if (options.redirect && $('<a></a>').prop('href', options.url)
448-
.prop('host') !== location.host) {
448+
if (options.redirect && targetHost && targetHost !== location.host) {
449449
options.formData.push({
450450
name: options.redirectParamName || 'redirect',
451451
value: options.redirect

vendor/assets/javascripts/jquery-fileupload/jquery.iframe-transport.js

100755100644
Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery Iframe Transport Plugin 1.6.2
2+
* jQuery Iframe Transport Plugin 1.7
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2011, Sebastian Tschan
@@ -170,7 +170,15 @@
170170
});
171171

172172
// The iframe transport returns the iframe content document as response.
173-
// The following adds converters from iframe to text, json, html, and script:
173+
// The following adds converters from iframe to text, json, html, xml
174+
// and script.
175+
// Please note that the Content-Type for JSON responses has to be text/plain
176+
// or text/html, if the browser doesn't include application/json in the
177+
// Accept header, else IE will show a download dialog.
178+
// The Content-Type for XML responses on the other hand has to be always
179+
// application/xml or text/xml, so IE properly parses the XML response.
180+
// See also
181+
// https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
174182
$.ajaxSetup({
175183
converters: {
176184
'iframe text': function (iframe) {
@@ -182,6 +190,12 @@
182190
'iframe html': function (iframe) {
183191
return iframe && $(iframe[0].body).html();
184192
},
193+
'iframe xml': function (iframe) {
194+
var xmlDoc = iframe && iframe[0];
195+
return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc :
196+
$.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
197+
$(xmlDoc.body).html());
198+
},
185199
'iframe script': function (iframe) {
186200
return iframe && $.globalEval($(iframe[0].body).text());
187201
}

0 commit comments

Comments
 (0)