From: Tim Düsterhus Date: Tue, 8 Jan 2019 22:13:20 +0000 (+0100) Subject: Fix JS code style X-Git-Tag: 5.2.0_Alpha_1~296^2~47 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=34df184fe56613193a7541ae04a896b9a91127d2;p=GitHub%2FWoltLab%2FWCF.git Fix JS code style See #2825 Co-Authored-By: joshuaruesweg --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js index 0ba8593df9..53e334f3fe 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js @@ -184,7 +184,7 @@ define(['AjaxRequest', 'Core', 'Dom/ChangeListener', 'Language', 'Dom/Util', 'Do DomUtil.insertAfter(innerError, elBySel('small', this._fileElements[uploadId][i])); } - throw new Error("Upload failed: "+ data.message); + throw new Error("Upload failed: " + data.message); return false; }, @@ -242,10 +242,10 @@ define(['AjaxRequest', 'Core', 'Dom/ChangeListener', 'Language', 'Dom/Util', 'Do */ _success: function(uploadId, data, responseText, xhr, requestOptions) { for (var i in this._fileElements[uploadId]) { - if (typeof data['files'][i] !== 'undefined') { + if (data['files'][i] !== undefined) { if (this._options.imagePreview) { if (data['files'][i].image === null) { - throw new Error("Excpect image for uploaded file. None given."); + throw new Error("Expect image for uploaded file. None given."); } elRemove(this._fileElements[uploadId][i]); @@ -270,7 +270,7 @@ define(['AjaxRequest', 'Core', 'Dom/ChangeListener', 'Language', 'Dom/Util', 'Do elBySel('.icon', this._fileElements[uploadId][i]).classList.add('fa-' + data['files'][i].icon); } } - else if (typeof data['error'][i] !== 'undefined') { + else if (data['error'][i] !== undefined) { this._fileElements[uploadId][i].classList.add('uploadFailed'); elBySel('small', this._fileElements[uploadId][i]).innerHTML = ''; @@ -367,7 +367,7 @@ define(['AjaxRequest', 'Core', 'Dom/ChangeListener', 'Language', 'Dom/Util', 'Do DomUtil.insertAfter(innerError, this._buttonContainer); } - innerError.textContent= WCF.Language.get('wcf.upload.error.reachedRemainingLimit').replace(/#remaining#/, this._options.maxFiles); + innerError.textContent = WCF.Language.get('wcf.upload.error.reachedRemainingLimit').replace(/#remaining#/, this._options.maxFiles); } // re-create upload button to effectively reset the 'files'