From 996dd9e033e7686c167b9aa6116e189f599abb29 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 8 Jul 2014 13:32:05 +0200 Subject: [PATCH] Improved Redactor integration --- .../templates/messageFormSettings.tpl | 2 +- .../templates/messageFormSettingsInline.tpl | 51 ++++++++ .../templates/messageFormSmilies.tpl | 2 +- com.woltlab.wcf/templates/messageFormTabs.tpl | 24 ---- .../templates/messageFormTabsInline.tpl | 28 ++++ com.woltlab.wcf/templates/wysiwyg.tpl | 71 +--------- .../js/3rdParty/redactor/plugins/woptions.js | 121 ------------------ .../js/3rdParty/redactor/plugins/wupload.js | 72 ----------- wcfsetup/install/files/js/WCF.Message.js | 55 +++----- wcfsetup/install/files/js/WCF.js | 63 ++++++++- .../MessageFormSettingsHandler.class.php | 72 +++++++++++ .../message/QuickReplyManager.class.php | 15 ++- 12 files changed, 243 insertions(+), 333 deletions(-) create mode 100644 com.woltlab.wcf/templates/messageFormSettingsInline.tpl create mode 100644 com.woltlab.wcf/templates/messageFormTabsInline.tpl delete mode 100644 wcfsetup/install/files/js/3rdParty/redactor/plugins/woptions.js delete mode 100644 wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js create mode 100644 wcfsetup/install/files/lib/system/message/MessageFormSettingsHandler.class.php diff --git a/com.woltlab.wcf/templates/messageFormSettings.tpl b/com.woltlab.wcf/templates/messageFormSettings.tpl index c41c4a04c9..f7146dc5b3 100644 --- a/com.woltlab.wcf/templates/messageFormSettings.tpl +++ b/com.woltlab.wcf/templates/messageFormSettings.tpl @@ -1,4 +1,4 @@ -
+
{if $__wcf->getSession()->getPermission($permissionCanUseBBCodes)}
diff --git a/com.woltlab.wcf/templates/messageFormSettingsInline.tpl b/com.woltlab.wcf/templates/messageFormSettingsInline.tpl new file mode 100644 index 0000000000..64e7219cec --- /dev/null +++ b/com.woltlab.wcf/templates/messageFormSettingsInline.tpl @@ -0,0 +1,51 @@ +
+
+ {if $__wcf->getSession()->getPermission('user.message.canUseBBCodes')} +
+
+ + {lang}wcf.message.settings.preParse.description{/lang} +
+ {/if} + {if MODULE_SMILEY && $__wcf->getSession()->getPermission('user.message.canUseSmilies')} +
+
+ + {lang}wcf.message.settings.enableSmilies.description{/lang} +
+ {/if} + {if $__wcf->getSession()->getPermission('user.message.canUseBBCodes')} +
+
+ + {lang}wcf.message.settings.enableBBCodes.description{/lang} +
+ {/if} + + {event name='settings'} +
+
+ diff --git a/com.woltlab.wcf/templates/messageFormSmilies.tpl b/com.woltlab.wcf/templates/messageFormSmilies.tpl index f3abb1229d..38fe26a612 100644 --- a/com.woltlab.wcf/templates/messageFormSmilies.tpl +++ b/com.woltlab.wcf/templates/messageFormSmilies.tpl @@ -9,7 +9,7 @@
{capture assign=__defaultSmilies} - {include file='__messageFormSmilies' smilies=$defaultSmilies} + {include file='__messageFormSmilies' smilies=$__wcf->getSmileyCache()->getCategorySmilies()} {/capture} {if $__tabCount > 1} diff --git a/com.woltlab.wcf/templates/messageFormTabs.tpl b/com.woltlab.wcf/templates/messageFormTabs.tpl index b09fef638a..0adf6d72c9 100644 --- a/com.woltlab.wcf/templates/messageFormTabs.tpl +++ b/com.woltlab.wcf/templates/messageFormTabs.tpl @@ -21,31 +21,7 @@ \ No newline at end of file diff --git a/com.woltlab.wcf/templates/messageFormTabsInline.tpl b/com.woltlab.wcf/templates/messageFormTabsInline.tpl new file mode 100644 index 0000000000..db551aee5d --- /dev/null +++ b/com.woltlab.wcf/templates/messageFormTabsInline.tpl @@ -0,0 +1,28 @@ +{assign var=smileyCategories value=$__wcf->getSmileyCache()->getCategories()} +{if !$permissionCanUseSmilies|isset}{assign var=permissionCanUseSmilies value='user.message.canUseSmilies'}{/if} +{if !$wysiwygContainerID|isset}{assign var=wysiwygContainerID value='text'}{/if} +
+ + + {if MODULE_SMILEY && $__wcf->getSession()->getPermission($permissionCanUseSmilies) && $smileyCategories|count}{include file='messageFormSmilies'}{/if} + {if MODULE_ATTACHMENT && !$attachmentHandler|empty && $attachmentHandler->canUpload()}{include file='messageFormAttachments'}{/if} + + {include file='messageFormSettingsInline'} + + {event name='tabMenuContents'} +
+ + \ No newline at end of file diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index 3249394339..94ec2e67fb 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -1,8 +1,7 @@ -{if !$wysiwygEnableUpload|isset}{assign var=wysiwygEnableUpload value=false}{/if}