From 5fb4439901c2d0d1b608eaf09689a1d01a57db07 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 2 Jan 2015 15:32:11 +0100 Subject: [PATCH] Overhauled some editor features, wysiwyg code handling --- com.woltlab.wcf/templates/wysiwyg.tpl | 12 + .../js/3rdParty/redactor/plugins/wbbcode.js | 343 +++++++++++++++--- .../3rdParty/redactor/plugins/wmonkeypatch.js | 44 +++ .../js/3rdParty/redactor/plugins/wutil.js | 15 +- wcfsetup/install/files/js/WCF.Message.js | 2 +- .../lib/data/bbcode/BBCodeCache.class.php | 21 +- .../files/lib/page/AbstractPage.class.php | 15 +- .../lib/system/bbcode/BBCodeHandler.class.php | 9 + .../builder/BBCodeCacheBuilder.class.php | 15 +- .../lib/system/request/LinkHandler.class.php | 7 + wcfsetup/install/files/style/bbcode.less | 1 + wcfsetup/install/files/style/redactor.less | 40 ++ wcfsetup/install/lang/de.xml | 13 +- wcfsetup/install/lang/en.xml | 13 +- 14 files changed, 480 insertions(+), 70 deletions(-) diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index 0395ef7e14..fe5537309b 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -3,6 +3,7 @@ var __REDACTOR_ICON_PATH = '{@$__wcf->getPath()}icon/'; var __REDACTOR_BUTTONS = [ {implode from=$__wcf->getBBCodeHandler()->getButtonBBCodes() item=__bbcode}{ icon: '{$__bbcode->wysiwygIcon}', label: '{$__bbcode->buttonLabel|language}', name: '{$__bbcode->bbcodeTag}' }{/implode} ]; var __REDACTOR_SMILIES = { {implode from=$__wcf->getSmileyCache()->getCategorySmilies() item=smiley}'{@$smiley->smileyCode|encodeJS}': '{@$smiley->getURL()|encodeJS}'{/implode} }; var __REDACTOR_SOURCE_BBCODES = [ {implode from=$__wcf->getBBCodeHandler()->getSourceBBCodes() item=__bbcode}'{@$__bbcode->bbcodeTag}'{/implode} ]; +var __REDACTOR_CODE_HIGHLIGHTERS = { {implode from=$__wcf->getBBCodeHandler()->getHighlighters() item=__highlighter}'{@$__highlighter}': '{lang}wcf.bbcode.code.{@$__highlighter}.title{/lang}'{/implode} };