From 13744d6e85c589fc142a364155178af2b3d960c7 Mon Sep 17 00:00:00 2001 From: Fabii547 Date: Thu, 23 Jun 2016 18:03:45 +0200 Subject: [PATCH] Fix marking styles as tainted (#2049) --- wcfsetup/install/files/acp/templates/styleAdd.tpl | 6 ++++-- .../files/js/WoltLab/WCF/Acp/Ui/Style/Editor.js | 12 ++++++------ wcfsetup/install/files/js/WoltLab/WCF/Ajax.js | 3 +++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/styleAdd.tpl b/wcfsetup/install/files/acp/templates/styleAdd.tpl index 7511c0b1c6..2525bf96a9 100644 --- a/wcfsetup/install/files/acp/templates/styleAdd.tpl +++ b/wcfsetup/install/files/acp/templates/styleAdd.tpl @@ -62,7 +62,9 @@ -

{lang}wcf.acp.style.protected{/lang}

+{if !$isTainted} +

{lang}wcf.acp.style.protected{/lang}

+{/if} {include file='formError'} @@ -934,7 +936,7 @@
- +
diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Acp/Ui/Style/Editor.js b/wcfsetup/install/files/js/WoltLab/WCF/Acp/Ui/Style/Editor.js index 7ae4924192..a78f4a2f10 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Acp/Ui/Style/Editor.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Acp/Ui/Style/Editor.js @@ -1,10 +1,10 @@ /** - * Provides the basic core functionality. + * Provides the style editor. * * @author Alexander Ebert - * @copyright 2001-2015 WoltLab GmbH + * @copyright 2001-2016 WoltLab GmbH * @license GNU Lesser General Public License - * @module WoltLab/WCF/Core + * @module WoltLab/WCF/Acp/Ui/Style/Editor */ define(['Ajax', 'Dictionary', 'Dom/Util', 'EventHandler'], function(Ajax, Dictionary, DomUtil, EventHandler) { "use strict"; @@ -21,7 +21,7 @@ define(['Ajax', 'Dictionary', 'Dom/Util', 'EventHandler'], function(Ajax, Dictio */ setup: function(options) { this._handleLayoutWidth(); - this._handleLess(options.isTainted); + this._handleScss(options.isTainted); if (!options.isTainted) { this._handleProtection(options.styleId); @@ -53,11 +53,11 @@ define(['Ajax', 'Dictionary', 'Dom/Util', 'EventHandler'], function(Ajax, Dictio }, /** - * Handles LESS input fields. + * Handles SCSS input fields. * * @param {boolean} isTainted false if style is in protected mode */ - _handleLess: function(isTainted) { + _handleScss: function(isTainted) { var individualScss = elById('individualScss'); var overrideScss = elById('overrideScss'); diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Ajax.js b/wcfsetup/install/files/js/WoltLab/WCF/Ajax.js index 1d32756690..3703f45e3e 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Ajax.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Ajax.js @@ -77,6 +77,9 @@ define(['AjaxRequest', 'Core', 'ObjectMap'], function(AjaxRequest, Core, ObjectM * @param {object} options request options */ apiOnce: function(options) { + // Fetch AjaxRequest, as it cannot be provided because of a circular dependency + if (AjaxRequest === undefined) AjaxRequest = require('AjaxRequest'); + options.pinData = false; options.callbackObject = null; if (!options.url) options.url = 'index.php/AJAXProxy/?t=' + SECURITY_TOKEN; -- 2.20.1