From: Alexander Ebert Date: Sat, 29 Jun 2019 20:32:49 +0000 (+0200) Subject: UglifyJS does not support ES 2015+ X-Git-Tag: 5.2.0_Alpha_1~10 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2bae4f6b61389559889e647e37b8529d35ea3e5e;p=GitHub%2FWoltLab%2FWCF.git UglifyJS does not support ES 2015+ --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/AbstractPackageList.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/AbstractPackageList.js index 3c09870c30..3abd854aea 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/AbstractPackageList.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/AbstractPackageList.js @@ -116,7 +116,7 @@ define(['Dom/ChangeListener', 'Dom/Traverse', 'Dom/Util', 'EventKey', 'Language' /** * Empties the input fields. */ - _emptyInput() { + _emptyInput: function() { this._packageIdentifier.value = ''; }, @@ -184,7 +184,7 @@ define(['Dom/ChangeListener', 'Dom/Traverse', 'Dom/Util', 'EventKey', 'Language' * @param {HTMLElement} listItem package list element holding package data * @param {object} packageData package data */ - _populateListItem(listItem, packageData) { + _populateListItem: function(listItem, packageData) { elData(listItem, 'package-identifier', packageData.packageIdentifier); }, diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/ExcludedPackages.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/ExcludedPackages.js index b2e6b680bb..80a090ceec 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/ExcludedPackages.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/ExcludedPackages.js @@ -47,7 +47,7 @@ define(['./AbstractPackageList', 'Core', 'Language'], function(AbstractPackageLi /** * @see WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/AbstractPackageList#_emptyInput */ - _emptyInput() { + _emptyInput: function() { ExcludedPackages._super.prototype._emptyInput.call(this); this._version.value = ''; @@ -78,7 +78,7 @@ define(['./AbstractPackageList', 'Core', 'Language'], function(AbstractPackageLi /** * @see WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/AbstractPackageList#_populateListItem */ - _populateListItem(listItem, packageData) { + _populateListItem: function(listItem, packageData) { ExcludedPackages._super.prototype._populateListItem.call(this, listItem, packageData); elData(listItem, 'version', packageData.version); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/Instructions.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/Instructions.js index adfda6f40f..257864c8a3 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/Instructions.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/Instructions.js @@ -279,12 +279,14 @@ define([ this._instructionsList.appendChild(listItem); var instructionListContainer = elById(this._formFieldId + '_instructions' + instructionsId + '_instructionListContainer'); - for (var errorMessage of instructionsData.errors || []) { - var small = elCreate('small'); - small.className = 'innerError'; - small.innerHTML = errorMessage; - - instructionListContainer.parentNode.insertBefore(small, instructionListContainer); + if (Array.isArray(instructionsData.errors)) { + instructionsData.errors.forEach(function(errorMessage) { + var small = elCreate('small'); + small.className = 'innerError'; + small.innerHTML = errorMessage; + + instructionListContainer.parentNode.insertBefore(small, instructionListContainer); + }); } new UiSortableList({ @@ -616,18 +618,18 @@ define([ DomTraverse.childrenByTag(elById(instructions.id + '_instructionList'), 'LI').forEach(function(instruction, instructionIndex) { var namePrefix = this._formFieldId + '[' + instructionsIndex + '][instructions][' + instructionIndex + ']'; - for (var property of ['pip', 'value', 'runStandalone']) { + ['pip', 'value', 'runStandalone'].forEach((function(property) { var element = elCreate('input'); elAttr(element, 'type', 'hidden'); - elAttr(element, 'name', namePrefix + '[' + property + ']') + elAttr(element, 'name', namePrefix + '[' + property + ']'); element.value = elData(instruction, property); this._form.appendChild(element); - } + }).bind(this)); if (_applicationPips.indexOf(elData(instruction, 'pip')) !== -1) { var application = elCreate('input'); elAttr(application, 'type', 'hidden'); - elAttr(application, 'name', namePrefix + '[application]') + elAttr(application, 'name', namePrefix + '[application]'); application.value = elData(instruction, 'application'); this._form.appendChild(application); } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/OptionalPackages.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/OptionalPackages.js index e5594f2b15..ff64710b84 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/OptionalPackages.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/OptionalPackages.js @@ -21,7 +21,7 @@ define(['./AbstractPackageList', 'Core', 'Language'], function(AbstractPackageLi /** * @see WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/AbstractPackageList#_populateListItem */ - _populateListItem(listItem, packageData) { + _populateListItem: function(listItem, packageData) { OptionalPackages._super.prototype._populateListItem.call(this, listItem, packageData); listItem.innerHTML = ' ' + Language.get('wcf.acp.devtools.project.optionalPackage.optionalPackage', { diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/RequiredPackages.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/RequiredPackages.js index 474b616ece..30a43907cd 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/RequiredPackages.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/RequiredPackages.js @@ -58,7 +58,7 @@ define(['./AbstractPackageList', 'Core', 'Language'], function(AbstractPackageLi /** * @see WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/AbstractPackageList#_emptyInput */ - _emptyInput() { + _emptyInput: function() { RequiredPackages._super.prototype._emptyInput.call(this); this._minVersion.value = ''; @@ -91,7 +91,7 @@ define(['./AbstractPackageList', 'Core', 'Language'], function(AbstractPackageLi /** * @see WoltLabSuite/Core/Form/Builder/Field/Devtools/Project/AbstractPackageList#_populateListItem */ - _populateListItem(listItem, packageData) { + _populateListItem: function(listItem, packageData) { RequiredPackages._super.prototype._populateListItem.call(this, listItem, packageData); elData(listItem, 'min-version', packageData.minVersion);