Fix marking styles as tainted (#2049)
authorFabii547 <Fabii547@users.noreply.github.com>
Thu, 23 Jun 2016 16:03:45 +0000 (18:03 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 23 Jun 2016 16:03:45 +0000 (18:03 +0200)
wcfsetup/install/files/acp/templates/styleAdd.tpl
wcfsetup/install/files/js/WoltLab/WCF/Acp/Ui/Style/Editor.js
wcfsetup/install/files/js/WoltLab/WCF/Ajax.js

index 7511c0b1c68743e5f99f2f3165ba04eff5c1ad7f..2525bf96a98114fcfec55564cf7c0ac31f0941b7 100644 (file)
@@ -62,7 +62,9 @@
        </nav>
 </header>
 
-<p class="info">{lang}wcf.acp.style.protected{/lang}</p>
+{if !$isTainted}
+       <p class="info">{lang}wcf.acp.style.protected{/lang}</p>
+{/if}
 
 {include file='formError'}
 
        </dl>
        
        <div class="formSubmit">
-               <button id="styleDisableProtectionSubmit" disabled>{lang}wcf.global.button.submit{/lang}</button>
+               <button id="styleDisableProtectionSubmit" class="buttonPrimary" disabled>{lang}wcf.global.button.submit{/lang}</button>
        </div>
 </div>
 
index 7ae492419295a46248af56f3606758fa18e19ad1..a78f4a2f1099b5606e41ca18df5a6b591b343b22 100644 (file)
@@ -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 <http://opensource.org/licenses/lgpl-license.php>
- * @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');
                        
index 1d32756690069bb184e98b466d4fe6b66c09809b..3703f45e3e90123c8bc11dc8b6ffeb1db1c50439 100644 (file)
@@ -77,6 +77,9 @@ define(['AjaxRequest', 'Core', 'ObjectMap'], function(AjaxRequest, Core, ObjectM
                 * @param       {object<string, *>}     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;