From 5840fdfdb9d9a01b161da9ad3922a7878c00bc5d Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 20 Jun 2016 15:32:09 +0200 Subject: [PATCH] Added support for headlines in Redactor --- com.woltlab.wcf/templates/wysiwyg.tpl | 11 +++++++++++ com.woltlab.wcf/templates/wysiwygToolbar.tpl | 5 +++++ wcfsetup/install/files/style/ui/redactor.scss | 13 +++++++++++++ wcfsetup/install/lang/de.xml | 6 ++++++ wcfsetup/install/lang/en.xml | 6 ++++++ 5 files changed, 41 insertions(+) diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index b3efb1532f..1011067dfc 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -97,7 +97,18 @@ var config = { buttons: buttons, + formatting: ['p', 'h2', 'h3', 'h4'], imageCaption: false, + lang: 'wsc', // fake language to offload phrases + langs: { + wsc: { + // formatting dropdown + heading2: '{lang}wcf.editor.format.heading2{/lang}', + heading3: '{lang}wcf.editor.format.heading3{/lang}', + heading4: '{lang}wcf.editor.format.heading4{/lang}', + paragraph: '{lang}wcf.editor.format.paragraph{/lang}' + } + }, minHeight: 200, plugins: [ 'alignment', diff --git a/com.woltlab.wcf/templates/wysiwygToolbar.tpl b/com.woltlab.wcf/templates/wysiwygToolbar.tpl index 0a934062dc..d0f180fcbe 100644 --- a/com.woltlab.wcf/templates/wysiwygToolbar.tpl +++ b/com.woltlab.wcf/templates/wysiwygToolbar.tpl @@ -2,6 +2,7 @@ buttonOptions = { alignment: { icon: 'fa-align-left', title: '{lang}wcf.editor.button.alignment{/lang}' }, bold: { icon: 'fa-bold', title: '{lang}wcf.editor.button.bold{/lang}' }, deleted: { icon: 'fa-strikethrough', title: '{lang}wcf.editor.button.strikethrough{/lang}' }, + format: { icon: 'fa-paragraph', title: '{lang}wcf.editor.button.format{/lang}' }, html: { icon: 'fa-code', title: '{lang}wcf.editor.button.html{/lang}' }, italic: { icon: 'fa-italic', title: '{lang}wcf.editor.button.italic{/lang}' }, link: { icon: 'fa-link', title: '{lang}wcf.editor.button.link{/lang}' }, @@ -21,6 +22,10 @@ buttons.push('html'); buttons.push('wcfSeparator'); +buttons.push('format'); + +buttons.push('wcfSeparator'); + buttons.push('bold'); buttons.push('italic'); buttons.push('underline'); diff --git a/wcfsetup/install/files/style/ui/redactor.scss b/wcfsetup/install/files/style/ui/redactor.scss index 15b9fc38d4..c00c63be94 100644 --- a/wcfsetup/install/files/style/ui/redactor.scss +++ b/wcfsetup/install/files/style/ui/redactor.scss @@ -366,6 +366,19 @@ display: none; } +/* format */ +.redactor-dropdown-h2 { + @include wcfFontSection; +} + +.redactor-dropdown-h3 { + @include wcfFontHeadline; +} + +.redactor-dropdown-h4 { + // TODO: add styling +} + /* alignment plugin */ .text-center { text-align: center; diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index c805561669..f76f0b6a70 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -2120,6 +2120,7 @@ Fehler sind beispielsweise: + @@ -2146,6 +2147,11 @@ Fehler sind beispielsweise: + + + + + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index db8a1cb096..62f423d492 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -2131,6 +2131,7 @@ Errors are: + @@ -2157,6 +2158,11 @@ Errors are: + + + + + -- 2.20.1