Skip to content

Commit c575b37

Browse files
committed
Change line feed style for left brace
1 parent 5003782 commit c575b37

File tree

1 file changed

+38
-19
lines changed

1 file changed

+38
-19
lines changed

src/js/jquery.dm-uploader.js

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
this.id = Math.random().toString(36).substr(2);
8585
};
8686

87-
DmUploaderFile.prototype.upload = function () {
87+
DmUploaderFile.prototype.upload = function ()
88+
{
8889
var file = this;
8990

9091
if (!file.canUpload()) {
@@ -135,20 +136,23 @@
135136
return true;
136137
};
137138

138-
DmUploaderFile.prototype.onSuccess = function (data) {
139+
DmUploaderFile.prototype.onSuccess = function (data)
140+
{
139141
this.status = FileStatus.COMPLETED;
140142
this.widget.settings.onUploadSuccess.call(this.widget.element, this.id, data);
141143
};
142144

143-
DmUploaderFile.prototype.onError = function (xhr, status, errMsg) {
145+
DmUploaderFile.prototype.onError = function (xhr, status, errMsg)
146+
{
144147
// If the status is: cancelled (by the user) don't invoke the error callback
145148
if (this.status !== FileStatus.CANCELLED) {
146149
this.status = FileStatus.FAILED;
147150
this.widget.settings.onUploadError.call(this.widget.element, this.id, xhr, status, errMsg);
148151
}
149152
};
150153

151-
DmUploaderFile.prototype.onComplete = function () {
154+
DmUploaderFile.prototype.onComplete = function ()
155+
{
152156
this.widget.activeFiles--;
153157

154158
if (this.status !== FileStatus.CANCELLED) {
@@ -162,7 +166,8 @@
162166
}
163167
};
164168

165-
DmUploaderFile.prototype.getXhr = function () {
169+
DmUploaderFile.prototype.getXhr = function ()
170+
{
166171
var file = this;
167172
var xhrobj = $.ajaxSettings.xhr();
168173

@@ -182,7 +187,8 @@
182187
return xhrobj;
183188
};
184189

185-
DmUploaderFile.prototype.cancel = function (abort) {
190+
DmUploaderFile.prototype.cancel = function (abort)
191+
{
186192
// The abort flag is to track if we are calling this function directly (using the cancel Method, by id)
187193
// or the call comes from the 'gobal' method aka cancelAll.
188194
// THis mean that we don't want to trigger the cancel event on file that isn't uploading, UNLESS directly doing it
@@ -206,7 +212,8 @@
206212
return true;
207213
};
208214

209-
DmUploaderFile.prototype.canUpload = function () {
215+
DmUploaderFile.prototype.canUpload = function ()
216+
{
210217
return (
211218
this.status === FileStatus.PENDING ||
212219
this.status === FileStatus.FAILED
@@ -230,7 +237,8 @@
230237
return this;
231238
};
232239

233-
DmUploader.prototype.checkSupport = function () {
240+
DmUploader.prototype.checkSupport = function ()
241+
{
234242
// This one is mandatory for all modes
235243
if (typeof window.FormData === "undefined") {
236244
return false;
@@ -250,7 +258,8 @@
250258
return !$("<input type=\"file\" />").prop("disabled");
251259
};
252260

253-
DmUploader.prototype.init = function () {
261+
DmUploader.prototype.init = function ()
262+
{
254263
var widget = this;
255264

256265
// Queue vars
@@ -303,7 +312,8 @@
303312
return this;
304313
};
305314

306-
DmUploader.prototype.initDnD = function () {
315+
DmUploader.prototype.initDnD = function ()
316+
{
307317
var widget = this;
308318

309319
// -- Now our own Drop
@@ -392,7 +402,8 @@
392402
});
393403
};
394404

395-
DmUploader.prototype.initPaste = function () {
405+
DmUploader.prototype.initPaste = function ()
406+
{
396407
var widget = this;
397408
$(document).on("paste." + pluginName, function (evt) {
398409
evt.preventDefault();
@@ -413,7 +424,8 @@
413424

414425
};
415426

416-
DmUploader.prototype.releaseEvents = function () {
427+
DmUploader.prototype.releaseEvents = function ()
428+
{
417429
// Leave everyone ALONE ;_;
418430

419431
this.element.off("." + pluginName);
@@ -424,7 +436,8 @@
424436
}
425437
};
426438

427-
DmUploader.prototype.validateFile = function (file) {
439+
DmUploader.prototype.validateFile = function (file)
440+
{
428441
// Check file size
429442
if ((this.settings.maxFileSize > 0) &&
430443
(file.size > this.settings.maxFileSize)) {
@@ -457,7 +470,8 @@
457470
return new DmUploaderFile(file, this);
458471
};
459472

460-
DmUploader.prototype.addFiles = function (files) {
473+
DmUploader.prototype.addFiles = function (files)
474+
{
461475
var nFiles = 0;
462476

463477
for (var i = 0; i < files.length; i++) {
@@ -496,7 +510,8 @@
496510
return this;
497511
};
498512

499-
DmUploader.prototype.processQueue = function () {
513+
DmUploader.prototype.processQueue = function ()
514+
{
500515
this.queuePos++;
501516

502517
if (this.queuePos >= this.queue.length) {
@@ -518,14 +533,16 @@
518533
return this.queue[this.queuePos].upload();
519534
};
520535

521-
DmUploader.prototype.restartQueue = function () {
536+
DmUploader.prototype.restartQueue = function ()
537+
{
522538
this.queuePos = -1;
523539
this.queueRunning = false;
524540

525541
this.processQueue();
526542
};
527543

528-
DmUploader.prototype.findById = function (id) {
544+
DmUploader.prototype.findById = function (id)
545+
{
529546
var r = false;
530547

531548
for (var i = 0; i < this.queue.length; i++) {
@@ -538,7 +555,8 @@
538555
return r;
539556
};
540557

541-
DmUploader.prototype.cancelAll = function () {
558+
DmUploader.prototype.cancelAll = function ()
559+
{
542560
var queueWasRunning = this.queueRunning;
543561
this.queueRunning = false;
544562

@@ -552,7 +570,8 @@
552570
}
553571
};
554572

555-
DmUploader.prototype.startAll = function () {
573+
DmUploader.prototype.startAll = function ()
574+
{
556575
if (this.settings.queue) {
557576
// Resume queue
558577
this.restartQueue();

0 commit comments

Comments
 (0)