From 3f7fc9a80a5a4178421a3845d56334db0de8fa54 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 22 Aug 2022 18:06:21 +0200 Subject: [PATCH] Add support for Font Awesome 6 icons to BBCodes --- XSD/bbcode.xsd | 6 ++++- com.woltlab.wcf/bbcode.xml | 10 ++++----- ts/WoltLabSuite/Core/Ui/Redactor/Autosave.ts | 2 ++ .../install/files/acp/templates/bbcodeAdd.tpl | 22 +++++++++++-------- .../WoltLabSuite/Core/Ui/Redactor/Autosave.js | 2 ++ .../BBCodePackageInstallationPlugin.class.php | 7 ++++++ 6 files changed, 34 insertions(+), 15 deletions(-) diff --git a/XSD/bbcode.xsd b/XSD/bbcode.xsd index 95ac92413f..a6e1015f93 100644 --- a/XSD/bbcode.xsd +++ b/XSD/bbcode.xsd @@ -32,6 +32,10 @@ + + + + @@ -43,7 +47,7 @@ - + diff --git a/com.woltlab.wcf/bbcode.xml b/com.woltlab.wcf/bbcode.xml index 3c5e131c3b..bd40e72465 100644 --- a/com.woltlab.wcf/bbcode.xml +++ b/com.woltlab.wcf/bbcode.xml @@ -83,7 +83,7 @@ 1 wcf.editor.button.quote - fa-quote-left + quote-left @@ -93,7 +93,7 @@ 1 1 wcf.editor.button.code - fa-code + code @@ -150,7 +150,7 @@ 1 wcf.editor.button.spoiler - fa-eye-slash + eye-slash @@ -160,7 +160,7 @@ 1 wcf.editor.button.inlineCode - fa-terminal + terminal wcf\system\bbcode\AttachmentBBCode @@ -219,7 +219,7 @@ 1 1 wcf.editor.button.woltlabHtml - fa-html5 + html5 wcf\system\bbcode\WoltLabSuiteArticleBBCode diff --git a/ts/WoltLabSuite/Core/Ui/Redactor/Autosave.ts b/ts/WoltLabSuite/Core/Ui/Redactor/Autosave.ts index 306800d653..d5b72c0e3b 100644 --- a/ts/WoltLabSuite/Core/Ui/Redactor/Autosave.ts +++ b/ts/WoltLabSuite/Core/Ui/Redactor/Autosave.ts @@ -204,6 +204,7 @@ class UiRedactorAutosave { const buttonKeep = document.createElement("button"); buttonKeep.innerHTML = ''; + buttonKeep.type = "button"; buttonKeep.classList.add("jsTooltip"); buttonKeep.title = Language.get("wcf.editor.autosave.keep"); buttonKeep.addEventListener("click", () => this.hideOverlay()); @@ -211,6 +212,7 @@ class UiRedactorAutosave { const buttonDiscard = document.createElement("button"); buttonDiscard.innerHTML = ''; + buttonDiscard.type = "button"; buttonDiscard.classList.add("jsTooltip"); buttonDiscard.title = Language.get("wcf.editor.autosave.discard"); buttonDiscard.addEventListener("click", () => { diff --git a/wcfsetup/install/files/acp/templates/bbcodeAdd.tpl b/wcfsetup/install/files/acp/templates/bbcodeAdd.tpl index fe339cd6e0..faee5ffd76 100644 --- a/wcfsetup/install/files/acp/templates/bbcodeAdd.tpl +++ b/wcfsetup/install/files/acp/templates/bbcodeAdd.tpl @@ -191,8 +191,8 @@
- - {icon size=16 name='magnifying-glass'} + +
{if $errorField == 'wysiwygIcon'} @@ -277,14 +277,18 @@ {include file='fontAwesomeJavaScript'} diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Autosave.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Autosave.js index 9f1c7ef39e..05b18fa257 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Autosave.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Autosave.js @@ -160,12 +160,14 @@ define(["require", "exports", "tslib", "../../Core", "../../Devtools", "../../Ev container.appendChild(title); const buttonKeep = document.createElement("button"); buttonKeep.innerHTML = ''; + buttonKeep.type = "button"; buttonKeep.classList.add("jsTooltip"); buttonKeep.title = Language.get("wcf.editor.autosave.keep"); buttonKeep.addEventListener("click", () => this.hideOverlay()); container.appendChild(buttonKeep); const buttonDiscard = document.createElement("button"); buttonDiscard.innerHTML = ''; + buttonDiscard.type = "button"; buttonDiscard.classList.add("jsTooltip"); buttonDiscard.title = Language.get("wcf.editor.autosave.discard"); buttonDiscard.addEventListener("click", () => { diff --git a/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php index 52fcc5f8c8..79d7011809 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php @@ -104,6 +104,13 @@ class BBCodePackageInstallationPlugin extends AbstractXMLPackageInstallationPlug $nodeValue[$attributeNo][$attributeValue->tagName] = $attributeValue->nodeValue; } } + } else if ($element->tagName === 'wysiwygicon') { + $solid = $element->getAttribute('solid'); + $nodeValue = \sprintf( + "%s;%s", + $element->nodeValue, + $solid === 'true' ? 'true' : 'false' + ); } $elements[$element->tagName] = $nodeValue; -- 2.20.1