From de61bfd1f6b0ef046f893b7e1cdabdf89e4c6ebc Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 7 Jan 2017 12:18:35 +0100 Subject: [PATCH] Improved UI/UX for list indent/outdent --- com.woltlab.wcf/templates/wysiwyg.tpl | 3 +++ wcfsetup/install/files/acp/templates/wysiwyg.tpl | 3 +++ .../files/js/3rdParty/redactor2/plugins/WoltLabButton.js | 8 ++++++++ wcfsetup/install/files/style/ui/redactor.scss | 5 +++-- wcfsetup/install/lang/de.xml | 3 +++ wcfsetup/install/lang/en.xml | 3 +++ 6 files changed, 23 insertions(+), 2 deletions(-) diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index e1b9aef229..5b91b76e1b 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -87,6 +87,9 @@ 'wcf.editor.link.url': '{lang}wcf.editor.link.url{/lang}', 'wcf.editor.link.text': '{lang}wcf.editor.link.text{/lang}', + 'wcf.editor.list.indent': '{lang}wcf.editor.list.indent{/lang}', + 'wcf.editor.list.outdent': '{lang}wcf.editor.list.outdent{/lang}', + 'wcf.editor.quote.author': '{lang}wcf.editor.quote.author{/lang}', 'wcf.editor.quote.edit': '{lang}wcf.editor.quote.edit{/lang}', 'wcf.editor.quote.title': '{lang __literal=true}wcf.editor.quote.title{/lang}', diff --git a/wcfsetup/install/files/acp/templates/wysiwyg.tpl b/wcfsetup/install/files/acp/templates/wysiwyg.tpl index e1b9aef229..5b91b76e1b 100644 --- a/wcfsetup/install/files/acp/templates/wysiwyg.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwyg.tpl @@ -87,6 +87,9 @@ 'wcf.editor.link.url': '{lang}wcf.editor.link.url{/lang}', 'wcf.editor.link.text': '{lang}wcf.editor.link.text{/lang}', + 'wcf.editor.list.indent': '{lang}wcf.editor.list.indent{/lang}', + 'wcf.editor.list.outdent': '{lang}wcf.editor.list.outdent{/lang}', + 'wcf.editor.quote.author': '{lang}wcf.editor.quote.author{/lang}', 'wcf.editor.quote.edit': '{lang}wcf.editor.quote.edit{/lang}', 'wcf.editor.quote.title': '{lang __literal=true}wcf.editor.quote.title{/lang}', diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js index 617ffa7c58..2622325489 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js @@ -63,10 +63,18 @@ $.Redactor.prototype.WoltLabButton = function() { if (!button[0]) { throw new Error("Missing button element for '" + buttonName + "'."); } + // set title //noinspection JSUnresolvedVariable elAttr(button[0], 'title', buttonData.title); button[0].classList.add('jsTooltip'); + + // update dropdown label for list + if (buttonName == 'lists') { + var dropdown = button.data('dropdown'); + elBySel('.redactor-dropdown-outdent span', dropdown[0]).textContent = WCF.Language.get('wcf.editor.list.outdent'); + elBySel('.redactor-dropdown-indent span', dropdown[0]).textContent = WCF.Language.get('wcf.editor.list.indent'); + } } // enforce button order as provided with `opts.buttons` diff --git a/wcfsetup/install/files/style/ui/redactor.scss b/wcfsetup/install/files/style/ui/redactor.scss index d1415a933c..39ebb68365 100644 --- a/wcfsetup/install/files/style/ui/redactor.scss +++ b/wcfsetup/install/files/style/ui/redactor.scss @@ -135,9 +135,10 @@ cursor: default; opacity: .6; - &:hover { - background-color: transparent !important; + > a:hover { + background-color: $wcfDropdownBackground !important; color: $wcfDropdownText !important; + cursor: default !important; } } } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 8bf83ece6b..4f3155ca70 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -2440,6 +2440,9 @@ Fehler sind beispielsweise: + + + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 4eab1457d6..7c9cb6142c 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -2396,6 +2396,9 @@ Errors are: + + + -- 2.20.1