Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Commit d253515

Browse files
committed
Update prettier to version 2.
1 parent 8cb40fc commit d253515

17 files changed

+513
-540
lines changed

cors/postmessage.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
'use strict';
2727
var origin = /^https:\/\/example.org/,
2828
target = new RegExp('^(http(s)?:)?\\/\\/' + location.host + '\\/');
29-
$(window).on('message', function(e) {
29+
$(window).on('message', function (e) {
3030
e = e.originalEvent;
3131
var s = e.data,
3232
xhr = $.ajaxSettings.xhr(),
@@ -39,7 +39,7 @@
3939
'Target "' + e.data.url + '" does not match ' + target
4040
);
4141
}
42-
$(xhr.upload).on('progress', function(ev) {
42+
$(xhr.upload).on('progress', function (ev) {
4343
ev = ev.originalEvent;
4444
e.source.postMessage(
4545
{
@@ -53,17 +53,17 @@
5353
e.origin
5454
);
5555
});
56-
s.xhr = function() {
56+
s.xhr = function () {
5757
return xhr;
5858
};
5959
if (!(s.data instanceof Blob)) {
6060
f = new FormData();
61-
$.each(s.data, function(i, v) {
61+
$.each(s.data, function (i, v) {
6262
f.append(v.name, v.value);
6363
});
6464
s.data = f;
6565
}
66-
$.ajax(s).always(function(result, statusText, jqXHR) {
66+
$.ajax(s).always(function (result, statusText, jqXHR) {
6767
if (!jqXHR.done) {
6868
jqXHR = result;
6969
result = null;

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ <h1 id="title">jQuery File Upload Demo</h1>
137137
>
138138
<div
139139
class="progress-bar progress-bar-success"
140-
style="width:0%;"
140+
style="width: 0%;"
141141
></div>
142142
</div>
143143
<!-- The extended global progress state -->

js/cors/jquery.postmessage-transport.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/* global define, require */
1313

14-
(function(factory) {
14+
(function (factory) {
1515
'use strict';
1616
if (typeof define === 'function' && define.amd) {
1717
// Register as an anonymous AMD module:
@@ -23,7 +23,7 @@
2323
// Browser globals:
2424
factory(window.jQuery);
2525
}
26-
})(function($) {
26+
})(function ($) {
2727
'use strict';
2828

2929
var counter = 0,
@@ -46,7 +46,7 @@
4646
'url',
4747
'username'
4848
],
49-
convert = function(p) {
49+
convert = function (p) {
5050
return p;
5151
};
5252

@@ -58,7 +58,7 @@
5858
}
5959
});
6060

61-
$.ajaxTransport('postmessage', function(options) {
61+
$.ajaxTransport('postmessage', function (options) {
6262
if (options.postMessage && window.postMessage) {
6363
var iframe,
6464
loc = $('<a>').prop('href', options.postMessage)[0],
@@ -71,7 +71,7 @@
7171
target = target.replace(/:(80|443)$/, '');
7272
}
7373
return {
74-
send: function(_, completeCallback) {
74+
send: function (_, completeCallback) {
7575
counter += 1;
7676
var message = {
7777
id: 'postmessage-transport-' + counter
@@ -84,12 +84,12 @@
8484
message.id +
8585
'"></iframe>'
8686
)
87-
.on('load', function() {
88-
$.each(names, function(i, name) {
87+
.on('load', function () {
88+
$.each(names, function (i, name) {
8989
message[name] = options[name];
9090
});
9191
message.dataType = message.dataType.replace('postmessage ', '');
92-
$(window).on(eventName, function(event) {
92+
$(window).on(eventName, function (event) {
9393
var e = event.originalEvent;
9494
var data = e.data;
9595
var ev;
@@ -115,7 +115,7 @@
115115
})
116116
.appendTo(document.body);
117117
},
118-
abort: function() {
118+
abort: function () {
119119
if (iframe) {
120120
iframe.remove();
121121
}

js/cors/jquery.xdr-transport.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
/* global define, require, XDomainRequest */
1616

17-
(function(factory) {
17+
(function (factory) {
1818
'use strict';
1919
if (typeof define === 'function' && define.amd) {
2020
// Register as an anonymous AMD module:
@@ -26,18 +26,18 @@
2626
// Browser globals:
2727
factory(window.jQuery);
2828
}
29-
})(function($) {
29+
})(function ($) {
3030
'use strict';
3131
if (window.XDomainRequest && !$.support.cors) {
32-
$.ajaxTransport(function(s) {
32+
$.ajaxTransport(function (s) {
3333
if (s.crossDomain && s.async) {
3434
if (s.timeout) {
3535
s.xdrTimeout = s.timeout;
3636
delete s.timeout;
3737
}
3838
var xdr;
3939
return {
40-
send: function(headers, completeCallback) {
40+
send: function (headers, completeCallback) {
4141
var addParamChar = /\?/.test(s.url) ? '&' : '?';
4242
/**
4343
* Callback wrapper function
@@ -65,26 +65,26 @@
6565
s.type = 'POST';
6666
}
6767
xdr.open(s.type, s.url);
68-
xdr.onload = function() {
68+
xdr.onload = function () {
6969
callback(
7070
200,
7171
'OK',
7272
{ text: xdr.responseText },
7373
'Content-Type: ' + xdr.contentType
7474
);
7575
};
76-
xdr.onerror = function() {
76+
xdr.onerror = function () {
7777
callback(404, 'Not Found');
7878
};
7979
if (s.xdrTimeout) {
80-
xdr.ontimeout = function() {
80+
xdr.ontimeout = function () {
8181
callback(0, 'timeout');
8282
};
8383
xdr.timeout = s.xdrTimeout;
8484
}
8585
xdr.send((s.hasContent && s.data) || null);
8686
},
87-
abort: function() {
87+
abort: function () {
8888
if (xdr) {
8989
xdr.onerror = $.noop();
9090
xdr.abort();

js/demo.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/* global $ */
1313

14-
$(function() {
14+
$(function () {
1515
'use strict';
1616

1717
// Initialize the jQuery File Upload widget:
@@ -46,7 +46,7 @@ $(function() {
4646
$.ajax({
4747
url: '//jquery-file-upload.appspot.com/',
4848
type: 'HEAD'
49-
}).fail(function() {
49+
}).fail(function () {
5050
$('<div class="alert alert-danger"/>')
5151
.text('Upload server currently unavailable - ' + new Date())
5252
.appendTo('#fileupload');
@@ -62,10 +62,10 @@ $(function() {
6262
dataType: 'json',
6363
context: $('#fileupload')[0]
6464
})
65-
.always(function() {
65+
.always(function () {
6666
$(this).removeClass('fileupload-processing');
6767
})
68-
.done(function(result) {
68+
.done(function (result) {
6969
$(this)
7070
.fileupload('option', 'done')
7171
// eslint-disable-next-line new-cap

js/jquery.fileupload-audio.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/* global define, require */
1313

14-
(function(factory) {
14+
(function (factory) {
1515
'use strict';
1616
if (typeof define === 'function' && define.amd) {
1717
// Register as an anonymous AMD module:
@@ -27,7 +27,7 @@
2727
// Browser globals:
2828
factory(window.jQuery, window.loadImage);
2929
}
30-
})(function($, loadImage) {
30+
})(function ($, loadImage) {
3131
'use strict';
3232

3333
// Prepend to the default processQueue:
@@ -63,7 +63,7 @@
6363
// as audio element if the browser supports playing it.
6464
// Accepts the options fileTypes (regular expression)
6565
// and maxFileSize (integer) to limit the files to load:
66-
loadAudio: function(data, options) {
66+
loadAudio: function (data, options) {
6767
if (options.disabled) {
6868
return data;
6969
}
@@ -90,7 +90,7 @@
9090
},
9191

9292
// Sets the audio element as a property of the file object:
93-
setAudio: function(data, options) {
93+
setAudio: function (data, options) {
9494
if (data.audio && !options.disabled) {
9595
data.files[data.index][options.name || 'preview'] = data.audio;
9696
}

js/jquery.fileupload-image.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/* global define, require */
1313

14-
(function(factory) {
14+
(function (factory) {
1515
'use strict';
1616
if (typeof define === 'function' && define.amd) {
1717
// Register as an anonymous AMD module:
@@ -39,7 +39,7 @@
3939
// Browser globals:
4040
factory(window.jQuery, window.loadImage);
4141
}
42-
})(function($, loadImage) {
42+
})(function ($, loadImage) {
4343
'use strict';
4444

4545
// Prepend to the default processQueue:
@@ -150,7 +150,7 @@
150150
// as img element, if the browser supports the File API.
151151
// Accepts the options fileTypes (regular expression)
152152
// and maxFileSize (integer) to limit the files to load:
153-
loadImage: function(data, options) {
153+
loadImage: function (data, options) {
154154
if (options.disabled) {
155155
return data;
156156
}
@@ -164,7 +164,7 @@
164164
(options.fileTypes && !options.fileTypes.test(file.type)) ||
165165
!loadImage(
166166
file,
167-
function(img) {
167+
function (img) {
168168
if (img.src) {
169169
data.img = img;
170170
}
@@ -183,7 +183,7 @@
183183
// Also stores the resized image as preview property.
184184
// Accepts the options maxWidth, maxHeight, minWidth,
185185
// minHeight, canvas and crop:
186-
resizeImage: function(data, options) {
186+
resizeImage: function (data, options) {
187187
if (options.disabled || !(data.canvas || data.img)) {
188188
return data;
189189
}
@@ -193,7 +193,7 @@
193193
// eslint-disable-next-line new-cap
194194
dfd = $.Deferred(),
195195
img = (options.canvas && data.canvas) || data.img,
196-
resolve = function(newImg) {
196+
resolve = function (newImg) {
197197
if (
198198
newImg &&
199199
(newImg.width !== img.width ||
@@ -233,7 +233,7 @@
233233

234234
// Saves the processed image given as data.canvas
235235
// inplace at data.index of data.files:
236-
saveImage: function(data, options) {
236+
saveImage: function (data, options) {
237237
if (!data.canvas || options.disabled) {
238238
return data;
239239
}
@@ -243,7 +243,7 @@
243243
dfd = $.Deferred();
244244
if (data.canvas.toBlob) {
245245
data.canvas.toBlob(
246-
function(blob) {
246+
function (blob) {
247247
if (!blob.name) {
248248
if (file.type === blob.type) {
249249
blob.name = file.name;
@@ -272,7 +272,7 @@
272272
return dfd.promise();
273273
},
274274

275-
loadImageMetaData: function(data, options) {
275+
loadImageMetaData: function (data, options) {
276276
if (options.disabled) {
277277
return data;
278278
}
@@ -281,7 +281,7 @@
281281
dfd = $.Deferred();
282282
loadImage.parseMetaData(
283283
data.files[data.index],
284-
function(result) {
284+
function (result) {
285285
$.extend(data, result);
286286
dfd.resolveWith(that, [data]);
287287
},
@@ -290,7 +290,7 @@
290290
return dfd.promise();
291291
},
292292

293-
saveImageMetaData: function(data, options) {
293+
saveImageMetaData: function (data, options) {
294294
if (
295295
!(
296296
data.imageHead &&
@@ -318,14 +318,14 @@
318318

319319
// Sets the resized version of the image as a property of the
320320
// file object, must be called after "saveImage":
321-
setImage: function(data, options) {
321+
setImage: function (data, options) {
322322
if (data.preview && !options.disabled) {
323323
data.files[data.index][options.name || 'preview'] = data.preview;
324324
}
325325
return data;
326326
},
327327

328-
deleteImageReferences: function(data, options) {
328+
deleteImageReferences: function (data, options) {
329329
if (!options.disabled) {
330330
delete data.img;
331331
delete data.canvas;

0 commit comments

Comments
 (0)