Replaced fixed color values with variables / Style API version 5.2
authorAlexander Ebert <ebert@woltlab.com>
Wed, 30 Jan 2019 17:25:05 +0000 (18:25 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 30 Jan 2019 17:25:05 +0000 (18:25 +0100)
com.woltlab.wcf/defaultStyle.tar
wcfsetup/install/files/acp/style/acpStyleEditor.css
wcfsetup/install/files/acp/templates/styleAdd.tpl
wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php
wcfsetup/install/files/lib/data/style/Style.class.php
wcfsetup/install/files/style/ui/wsc52.scss [new file with mode: 0644]
wcfsetup/setup/db/install.sql

index a401dd01b6a8e82f2acf7a7a21cf5a461d5cdbb9..88d9bd8dab56d4a62e8708790c2f33be3a5ad982 100644 (file)
Binary files a/com.woltlab.wcf/defaultStyle.tar and b/com.woltlab.wcf/defaultStyle.tar differ
index 85ed53265b741d91f6c7b7f2d02a8e9efe9d32e2..816939242519b5cd9011a3a34333f13af83e6407 100644 (file)
@@ -59,7 +59,9 @@ html[dir="rtl"] #spTable th { text-align: right; }
 #spButtonPrimary { margin-top: 10px; }
 
 /* ### editor ### */
-#spEditorContent { border: 1px solid rgb(224, 224, 224); border-top-width: 0; height: 100px; }
+#spEditorContent { border: 1px solid rgb(224, 224, 224); border-top-width: 0; min-height: 100px; padding: 10px; }
+#spEditorTable { border-collapse: collapse; border-spacing: 0; margin: 10px 0; min-width: 60%; }
+#spEditorTable td { border: 1px solid rgb(221, 221, 221); padding: 10px; }
 
 /* ### dropdown ### */
 #spDropdown { display: inline-block; float: none; position: relative; visibility: visible; z-index: 10; }
index 2a5a01d6e63e51ca7f7357670f6a71ebe856162e..580d45c2d9ad68cf4d10fc3fc30b49252697c106 100644 (file)
                                                                                                <li><a><span class="icon icon16 fa-strikethrough"></span></a></li>
                                                                                        </ul>
                                                                                </div>
-                                                                               <div id="spEditorContent"></div>
+                                                                               <div id="spEditorContent">
+                                                                                       <table id="spEditorTable" data-region="wcfEditorTable">
+                                                                                               <tr>
+                                                                                                       <td>Lorem</td>
+                                                                                                       <td>&nbsp;</td>
+                                                                                                       <td>&nbsp;</td>
+                                                                                               </tr>
+                                                                                               <tr>
+                                                                                                       <td>Ipsum</td>
+                                                                                                       <td>&nbsp;</td>
+                                                                                                       <td>&nbsp;</td>
+                                                                                               </tr>
+                                                                                       </table>
+                                                                               </div>
                                                                        </div>
                                                                        
                                                                        <div class="spHeadline">Dropdown</div>
                                                                <p>{lang}wcf.acp.style.colors.description{/lang}</p>
                                                                <p><br></p>
                                                                <p><sup class="spApiVersion">3.1</sup> <small>{lang version='3.1'}wcf.acp.style.colors.description.apiVersion{/lang}</small></p>
+                                                               <p><sup class="spApiVersion">5.2</sup> <small>{lang version='5.2'}wcf.acp.style.colors.description.apiVersion{/lang}</small></p>
                                                        </div>
                                                        
                                                        {foreach from=$colors key=spCategory item=spColors}
                                'wcfEditorButtonText': '#spEditor .redactor-toolbar a { color: VALUE; }',
                                'wcfEditorButtonTextActive': '#spEditor .redactor-toolbar a:hover, #spEditor .redactor-toolbar a.dropact { color: VALUE; }',
                                'wcfEditorButtonTextDisabled': '#spEditor .redactor-toolbar a.redactor-button-disabled { color: VALUE; }',
+                               'wcfEditorTableBorder': '#spEditorTable td { border-color: VALUE; }',
                                'wcfDropdownBackground': '#spDropdown { background-color: VALUE; } __COMBO_RULE__ #spDropdown::before { border-bottom-color: VALUE; }',
                                'wcfDropdownBorderInner': '#spDropdown .dropdownDivider { border-color: VALUE; }',
                                'wcfDropdownText': '#spDropdown li { color: VALUE; }',
index 9a48d5531747cf87c056a1cafb5f446c2061f1df..8a52412fa3090648058cb8102c9275004762cd72 100644 (file)
@@ -140,7 +140,10 @@ class StyleAddForm extends AbstractForm {
                'wcfEditorButtonBackgroundActive' => '3.1',
                'wcfEditorButtonText' => '3.1',
                'wcfEditorButtonTextActive' => '3.1',
-               'wcfEditorButtonTextDisabled' => '3.1'
+               'wcfEditorButtonTextDisabled' => '3.1',
+               
+               // 5.2
+               'wcfEditorTableBorder' => '5.2',
        ];
        
        /**
@@ -482,7 +485,7 @@ class StyleAddForm extends AbstractForm {
                        'wcfTabularBox' => 'wcfTabularBox',
                        'wcfInput' => ['wcfInput', 'wcfInputDisabled'],
                        'wcfButton' => ['wcfButton', 'wcfButtonPrimary', 'wcfButtonDisabled'],
-                       'wcfEditor' =>'wcfEditorButton',
+                       'wcfEditor' => ['wcfEditorButton', 'wcfEditorTable'],
                        'wcfDropdown' => 'wcfDropdown',
                        'wcfStatus' => ['wcfStatusInfo', 'wcfStatusSuccess', 'wcfStatusWarning', 'wcfStatusError'],
                        'wcfFooterBox' => ['wcfFooterBox', 'wcfFooterBoxHeadline'],
@@ -509,6 +512,7 @@ class StyleAddForm extends AbstractForm {
                        'wcfButtonPrimary' => ['background', 'text', 'backgroundActive', 'textActive'],
                        'wcfButtonDisabled' => ['background', 'text'],
                        'wcfEditorButton' => ['background', 'backgroundActive', 'text', 'textActive', 'textDisabled'],
+                       'wcfEditorTable' => ['border'],
                        'wcfDropdown' => ['background', 'borderInner', 'text', 'link', 'backgroundActive', 'linkActive'],
                        'wcfStatusInfo' => ['background', 'border', 'text', 'link', 'linkActive'],
                        'wcfStatusSuccess' => ['background', 'border', 'text', 'link', 'linkActive'],
index 620cb9c24ad3d4773ee47381096c547440b76870..5647916d9eb116d24dbe1f1a67846e437bfa1ca1 100644 (file)
@@ -45,9 +45,9 @@ class Style extends DatabaseObject {
         * list of supported API versions
         * @var string[]
         */
-       public static $supportedApiVersions = ['3.0', '3.1'];
+       public static $supportedApiVersions = ['3.0', '3.1', '5.2'];
        
-       const API_VERSION = '3.1';
+       const API_VERSION = '5.2';
        
        const PREVIEW_IMAGE_MAX_HEIGHT = 64;
        const PREVIEW_IMAGE_MAX_WIDTH = 102;
diff --git a/wcfsetup/install/files/style/ui/wsc52.scss b/wcfsetup/install/files/style/ui/wsc52.scss
new file mode 100644 (file)
index 0000000..67b3113
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Special styles for changes introduced in WoltLab Suite 5.2 that
+ * are not compatible with styles created for earlier versions.
+ */
+@include requireApiVersion(52) {
+       .htmlContent table,
+       .table {
+               tr:hover > td {
+                       background-color: $wcfTabularBoxBackgroundActive;
+               }
+       }
+       
+       .redactor-layer table {
+               th,
+               td {
+                       border-color: $wcfEditorTableBorder;
+               }
+       }
+}
index 7c8909e89d4a2d7298bc0401c8488b8399e48c02..919bb38685c1d297950289dd071dc29f1721b6af 100644 (file)
@@ -2269,6 +2269,7 @@ INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfEditorB
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfEditorButtonText', 'rgba(255, 255, 255, 1)');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfEditorButtonTextActive', 'rgba(255, 255, 255, 1)');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfEditorButtonTextDisabled', 'rgba(165, 165, 165, 1)');
+INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfEditorTableBorder', 'rgba(221, 221, 221, 1)');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfFontFamilyFallback', '"Segoe UI", "DejaVu Sans", "Lucida Grande", "Helvetica", sans-serif');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfFontFamilyGoogle', 'Open Sans');
 INSERT INTO wcf1_style_variable (variableName, defaultValue) VALUES ('wcfFontLineHeight', '1.48');