Fix JS code style
authorTim Düsterhus <timwolla@googlemail.com>
Tue, 8 Jan 2019 22:13:20 +0000 (23:13 +0100)
committerGitHub <noreply@github.com>
Tue, 8 Jan 2019 22:13:20 +0000 (23:13 +0100)
See #2825

Co-Authored-By: joshuaruesweg <josh@wcflabs.de>
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js

index 0ba8593df9cc6ce3adf06fe4f6c941763e01dfaa..53e334f3fe742e3703bd4811e481d16888f20100 100644 (file)
@@ -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'