From d45eaff6d35ad3f2b64c28cbbd30ba8e49cf8fa9 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 20 May 2013 22:44:03 +0200 Subject: [PATCH] Merged com.woltlab.wcf.message into WCF --- com.woltlab.wcf/bbcode.xml | 14 + com.woltlab.wcf/objectTypeDefinition.xml | 9 +- com.woltlab.wcf/option.xml | 60 + .../template/__messageFormSmilies.tpl | 5 + .../template/__messageQuoteManager.tpl | 13 + .../template/messageFormAttachments.tpl | 57 + .../template/messageFormMultilingualism.tpl | 31 + .../template/messageFormPreviewButton.tpl | 13 + .../template/messageFormSettings.tpl | 36 + .../template/messageFormSmilies.tpl | 50 + com.woltlab.wcf/template/messageFormTabs.tpl | 26 + com.woltlab.wcf/template/messageQuoteList.tpl | 50 + com.woltlab.wcf/template/rssFeed.tpl | 46 + com.woltlab.wcf/template/shareButtons.tpl | 49 + com.woltlab.wcf/template/wysiwyg.tpl | 65 + com.woltlab.wcf/userGroupOption.xml | 24 + wcfsetup/install/files/icon/reddit.png | Bin 0 -> 712 bytes .../ckeditor/plugins/wbbcode/plugin.js | 410 +++ .../ckeditor/plugins/wbutton/plugin.js | 81 + wcfsetup/install/files/js/WCF.Message.js | 2686 +++++++++++++++++ wcfsetup/install/files/js/WCF.Message.min.js | 1 + .../lib/action/MessageQuoteAction.class.php | 187 ++ ...IExtendedMessageQuickReplyAction.class.php | 26 + .../files/lib/data/IFeedEntry.class.php | 28 + .../install/files/lib/data/IMessage.class.php | 50 + .../data/IMessageInlineEditorAction.class.php | 38 + .../data/IMessageQuickReplyAction.class.php | 74 + .../lib/data/IMessageQuoteAction.class.php | 50 + .../bbcode/MessagePreviewAction.class.php | 106 + .../category/SmileyCategoryAction.class.php | 60 + .../files/lib/form/MessageForm.class.php | 384 +++ .../files/lib/page/AbstractFeedPage.class.php | 93 + .../system/bbcode/AttachmentBBCode.class.php | 100 + .../message/QuickReplyManager.class.php | 226 ++ .../message/censorship/Censorship.class.php | 187 ++ .../AbstractMessageQuoteHandler.class.php | 86 + .../quote/IMessageQuoteHandler.class.php | 32 + .../quote/MessageQuoteManager.class.php | 564 ++++ .../message/quote/QuotedMessage.class.php | 145 + .../files/lib/util/MessageUtil.class.php | 37 + wcfsetup/install/files/style/message.less | 971 ++++++ wcfsetup/install/files/style/poll.less | 74 + wcfsetup/install/lang/de.xml | 60 + wcfsetup/install/lang/en.xml | 60 + 44 files changed, 7362 insertions(+), 2 deletions(-) create mode 100644 com.woltlab.wcf/template/__messageFormSmilies.tpl create mode 100644 com.woltlab.wcf/template/__messageQuoteManager.tpl create mode 100644 com.woltlab.wcf/template/messageFormAttachments.tpl create mode 100644 com.woltlab.wcf/template/messageFormMultilingualism.tpl create mode 100644 com.woltlab.wcf/template/messageFormPreviewButton.tpl create mode 100644 com.woltlab.wcf/template/messageFormSettings.tpl create mode 100644 com.woltlab.wcf/template/messageFormSmilies.tpl create mode 100644 com.woltlab.wcf/template/messageFormTabs.tpl create mode 100644 com.woltlab.wcf/template/messageQuoteList.tpl create mode 100644 com.woltlab.wcf/template/rssFeed.tpl create mode 100644 com.woltlab.wcf/template/shareButtons.tpl create mode 100644 com.woltlab.wcf/template/wysiwyg.tpl create mode 100644 wcfsetup/install/files/icon/reddit.png create mode 100644 wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js create mode 100644 wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbutton/plugin.js create mode 100644 wcfsetup/install/files/js/WCF.Message.js create mode 100644 wcfsetup/install/files/js/WCF.Message.min.js create mode 100644 wcfsetup/install/files/lib/action/MessageQuoteAction.class.php create mode 100644 wcfsetup/install/files/lib/data/IExtendedMessageQuickReplyAction.class.php create mode 100644 wcfsetup/install/files/lib/data/IFeedEntry.class.php create mode 100644 wcfsetup/install/files/lib/data/IMessage.class.php create mode 100644 wcfsetup/install/files/lib/data/IMessageInlineEditorAction.class.php create mode 100644 wcfsetup/install/files/lib/data/IMessageQuickReplyAction.class.php create mode 100644 wcfsetup/install/files/lib/data/IMessageQuoteAction.class.php create mode 100644 wcfsetup/install/files/lib/data/bbcode/MessagePreviewAction.class.php create mode 100644 wcfsetup/install/files/lib/data/smiley/category/SmileyCategoryAction.class.php create mode 100644 wcfsetup/install/files/lib/form/MessageForm.class.php create mode 100644 wcfsetup/install/files/lib/page/AbstractFeedPage.class.php create mode 100644 wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php create mode 100644 wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php create mode 100644 wcfsetup/install/files/lib/system/message/censorship/Censorship.class.php create mode 100644 wcfsetup/install/files/lib/system/message/quote/AbstractMessageQuoteHandler.class.php create mode 100644 wcfsetup/install/files/lib/system/message/quote/IMessageQuoteHandler.class.php create mode 100644 wcfsetup/install/files/lib/system/message/quote/MessageQuoteManager.class.php create mode 100644 wcfsetup/install/files/lib/system/message/quote/QuotedMessage.class.php create mode 100644 wcfsetup/install/files/lib/util/MessageUtil.class.php create mode 100644 wcfsetup/install/files/style/message.less create mode 100644 wcfsetup/install/files/style/poll.less diff --git a/com.woltlab.wcf/bbcode.xml b/com.woltlab.wcf/bbcode.xml index 503a402330..dd0079e4e6 100644 --- a/com.woltlab.wcf/bbcode.xml +++ b/com.woltlab.wcf/bbcode.xml @@ -159,5 +159,19 @@ none 1 + + + wcf\system\bbcode\AttachmentBBCode + + + ^\d+$ + 1 + 1 + + + ^(left|right)$ + + + \ No newline at end of file diff --git a/com.woltlab.wcf/objectTypeDefinition.xml b/com.woltlab.wcf/objectTypeDefinition.xml index 383800688c..5ab6bf6097 100644 --- a/com.woltlab.wcf/objectTypeDefinition.xml +++ b/com.woltlab.wcf/objectTypeDefinition.xml @@ -29,6 +29,11 @@ com.woltlab.wcf.attachment.objectType wcf\system\attachment\IAttachmentObjectType - + + + + com.woltlab.wcf.message.quote + wcf\system\message\IMessageQuoteHandler + - \ No newline at end of file + diff --git a/com.woltlab.wcf/option.xml b/com.woltlab.wcf/option.xml index e69fab03f1..5740bf1fee 100644 --- a/com.woltlab.wcf/option.xml +++ b/com.woltlab.wcf/option.xml @@ -110,6 +110,9 @@ security + + security.censorship + @@ -120,6 +123,9 @@ message + + message.general + message @@ -490,6 +496,60 @@ no:!cache_source_memcached_host]]> integer + + + + + + + + + + + + + + + + + + diff --git a/com.woltlab.wcf/template/__messageFormSmilies.tpl b/com.woltlab.wcf/template/__messageFormSmilies.tpl new file mode 100644 index 0000000000..913276edef --- /dev/null +++ b/com.woltlab.wcf/template/__messageFormSmilies.tpl @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/com.woltlab.wcf/template/__messageQuoteManager.tpl b/com.woltlab.wcf/template/__messageQuoteManager.tpl new file mode 100644 index 0000000000..62059c5e45 --- /dev/null +++ b/com.woltlab.wcf/template/__messageQuoteManager.tpl @@ -0,0 +1,13 @@ +WCF.Language.addObject({ + 'wcf.message.quote.insertAllQuotes': '{lang}wcf.message.quote.insertAllQuotes{/lang}', + 'wcf.message.quote.insertSelectedQuotes': '{lang}wcf.message.quote.insertSelectedQuotes{/lang}', + 'wcf.message.quote.manageQuotes': '{lang}wcf.message.quote.manageQuotes{/lang}', + 'wcf.message.quote.quoteSelected': '{lang}wcf.message.quote.quoteSelected{/lang}', + 'wcf.message.quote.removeAllQuotes': '{lang}wcf.message.quote.removeAllQuotes{/lang}', + 'wcf.message.quote.removeSelectedQuotes': '{lang}wcf.message.quote.removeSelectedQuotes{/lang}', + 'wcf.message.quote.showQuotes': '{lang}wcf.message.quote.showQuotes{/lang}' +}); + +{if !$wysiwygSelector|isset}{assign var=wysiwygSelector value=''}{/if} +{if !$supportPaste|isset}{assign var=supportPaste value=false}{/if} +var $quoteManager = new WCF.Message.Quote.Manager({@$__quoteCount}, '{$wysiwygSelector|encodeJS}', {if $supportPaste}true{else}false{/if}, [ {implode from=$__quoteRemove item=quoteID}'{$quoteID}'{/implode} ]); \ No newline at end of file diff --git a/com.woltlab.wcf/template/messageFormAttachments.tpl b/com.woltlab.wcf/template/messageFormAttachments.tpl new file mode 100644 index 0000000000..65a550841a --- /dev/null +++ b/com.woltlab.wcf/template/messageFormAttachments.tpl @@ -0,0 +1,57 @@ +
+ + +
+
+
+ {lang}wcf.attachment.upload.limits{/lang} +
+
+ + {event name='fields'} +
+ + + + + \ No newline at end of file diff --git a/com.woltlab.wcf/template/messageFormMultilingualism.tpl b/com.woltlab.wcf/template/messageFormMultilingualism.tpl new file mode 100644 index 0000000000..bcfa5681c2 --- /dev/null +++ b/com.woltlab.wcf/template/messageFormMultilingualism.tpl @@ -0,0 +1,31 @@ +{if $availableContentLanguages|count} + +
{lang}wcf.user.language{/lang}
+
+ +
+ + + +{/if} \ No newline at end of file diff --git a/com.woltlab.wcf/template/messageFormPreviewButton.tpl b/com.woltlab.wcf/template/messageFormPreviewButton.tpl new file mode 100644 index 0000000000..b175ced1bf --- /dev/null +++ b/com.woltlab.wcf/template/messageFormPreviewButton.tpl @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/com.woltlab.wcf/template/messageFormSettings.tpl b/com.woltlab.wcf/template/messageFormSettings.tpl new file mode 100644 index 0000000000..5c4f52354e --- /dev/null +++ b/com.woltlab.wcf/template/messageFormSettings.tpl @@ -0,0 +1,36 @@ +
+
+ {if $__wcf->getSession()->getPermission('user.message.canUseBBCodes')} +
+ + {lang}wcf.message.settings.preParse.description{/lang} +
+ {/if} + {if $__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} + {if $__wcf->getSession()->getPermission('user.message.canUseHtml')} +
+ + {lang}wcf.message.settings.enableHtml.description{/lang} +
+ {/if} + {if 'MODULE_USER_SIGNATURE'|defined && MODULE_USER_SIGNATURE && $showSignatureSetting && $__wcf->user->userID} +
+ + {lang}wcf.message.settings.showSignature.description{/lang} +
+ {/if} + + {event name='settings'} +
+
diff --git a/com.woltlab.wcf/template/messageFormSmilies.tpl b/com.woltlab.wcf/template/messageFormSmilies.tpl new file mode 100644 index 0000000000..d7c7e7cdf0 --- /dev/null +++ b/com.woltlab.wcf/template/messageFormSmilies.tpl @@ -0,0 +1,50 @@ +{assign var=__tabCount value=0} +{capture assign=__categoryTabs} + {foreach from=$smileyCategories item=smileyCategory} + {assign var=__tabCount value=$__tabCount + 1} + {assign var='__smileyAnchor' value='smilies-'|concat:$smileyCategory->categoryID} +
  • {$smileyCategory->title|language}
  • + {/foreach} +{/capture} + +
    + {capture assign=__defaultSmilies} + {include file='__messageFormSmilies' smilies=$defaultSmilies} + {/capture} + + {if $__tabCount > 1} + + + {foreach from=$smileyCategories item=smileyCategory} + {if !$smileyCategory->isDisabled} + + {/if} + {/foreach} + + + {else} + {@$__defaultSmilies} + {/if} + + {event name='fields'} + + +
    diff --git a/com.woltlab.wcf/template/messageFormTabs.tpl b/com.woltlab.wcf/template/messageFormTabs.tpl new file mode 100644 index 0000000000..81e0ffb26a --- /dev/null +++ b/com.woltlab.wcf/template/messageFormTabs.tpl @@ -0,0 +1,26 @@ +
    + + + {if MODULE_SMILEY && $smileyCategories|count}{include file='messageFormSmilies'}{/if} + {if MODULE_ATTACHMENT && $attachmentHandler !== null && $attachmentHandler->canUpload()}{include file='messageFormAttachments'}{/if} + + {include file='messageFormSettings'} + + {event name='tabMenuContents'} +
    + + \ No newline at end of file diff --git a/com.woltlab.wcf/template/messageQuoteList.tpl b/com.woltlab.wcf/template/messageQuoteList.tpl new file mode 100644 index 0000000000..8f1a1132bc --- /dev/null +++ b/com.woltlab.wcf/template/messageQuoteList.tpl @@ -0,0 +1,50 @@ +{if !$supportPaste|isset}{assign var=supportPaste value=false}{/if} +{foreach from=$messages item=message} +
    +
    +
    +
    +
    +
    + {if $userProfiles[$message->getUserID()]|isset} + {@$userProfiles[$message->getUserID()]->getAvatar()->getImageTag(32)} + {/if} + +
    +

    {$message->getTitle()}

    +

    + {if $userProfiles[$message->getUserID()]|isset}{$message->getUsername()}{else}{$message->getUsername()}{/if} + {@$message->getTime()|time} +

    +
    +
    +
    + +
    +
    +
    +
      + {foreach from=$message key=quoteID item=quote} +
    • + + + {if $supportPaste}{/if} + + +
      + +
      +
      + {$message->getFullQuote($quoteID)} +
      +
    • + {/foreach} +
    +
    +
    +
    +
    +
    +
    +
    +{/foreach} \ No newline at end of file diff --git a/com.woltlab.wcf/template/rssFeed.tpl b/com.woltlab.wcf/template/rssFeed.tpl new file mode 100644 index 0000000000..11242c0053 --- /dev/null +++ b/com.woltlab.wcf/template/rssFeed.tpl @@ -0,0 +1,46 @@ + + + + <![CDATA[{if $title}{$title} - {/if}{@PAGE_TITLE|language|escapeCDATA}]]> + + + {@$__wcf->language->getFixedLanguageCode()} + {'r'|gmdate:TIME_NOW} +{assign var='dummy' value=$items->rewind()} + {if $items->valid()}{'r'|gmdate:$items->current()->getTime()}{else}{'r'|gmdate:TIME_NOW}{/if} + 60 + + +{* *}{foreach from=$items item='item'} + + <![CDATA[{@$item->getTitle()|escapeCDATA}]]> + getLink()|escapeCDATA}]]> + {hascontent}getExcerpt()|escapeCDATA}{/content}]]>{/hascontent} + {'r'|gmdate:$item->getTime()} + {@$item->getUsername()|escapeCDATA} + getLink()|escapeCDATA}]]> + {foreach from=$item->getCategories() item='category'} + + {/foreach} + {hascontent}getFormattedMessage()|escapeCDATA}{/content}]]>{/hascontent} + {@$item->getComments()|escapeCDATA} + +{* *}{/foreach} + +{if ENABLE_BENCHMARK} + +{/if} + \ No newline at end of file diff --git a/com.woltlab.wcf/template/shareButtons.tpl b/com.woltlab.wcf/template/shareButtons.tpl new file mode 100644 index 0000000000..83514dc660 --- /dev/null +++ b/com.woltlab.wcf/template/shareButtons.tpl @@ -0,0 +1,49 @@ +
    + + + +
    diff --git a/com.woltlab.wcf/template/wysiwyg.tpl b/com.woltlab.wcf/template/wysiwyg.tpl new file mode 100644 index 0000000000..e7a768b587 --- /dev/null +++ b/com.woltlab.wcf/template/wysiwyg.tpl @@ -0,0 +1,65 @@ + + + +{event name='javascriptIncludes'} + + diff --git a/com.woltlab.wcf/userGroupOption.xml b/com.woltlab.wcf/userGroupOption.xml index a9bc1f2dd8..37d4267105 100644 --- a/com.woltlab.wcf/userGroupOption.xml +++ b/com.woltlab.wcf/userGroupOption.xml @@ -285,6 +285,30 @@ pdf]]> 0 1 + + + + + + + diff --git a/wcfsetup/install/files/icon/reddit.png b/wcfsetup/install/files/icon/reddit.png new file mode 100644 index 0000000000000000000000000000000000000000..e1bcd7328a107a7b883478cda5ea99d7d6155f65 GIT binary patch literal 712 zcmV;(0yq7MP)aHGehJlD2#^bSEJ>WbHE<@gEG^AFmNxR*a zXgE|`^WZ>o`MeI+k|6Wmdo&ukAeVFXdfh$Q*wFdv+M53M`+Z&KyVL2Y|J(sSG@I_> z`udcu)oLlJfxz$f_b(SL!qK>dNM3 z=B*UuioBu%a#yWZ^}!hA`g;^z_#UVRAM;09rYJb!7JC>zm=gr0%nJgs7Y?}KWG+O* zz{yd9z5ZpujR?X`tX{+n{QBuQ|21(xUp;ka&kAn*=4FZu8*BLB>j#0DEWjyDFmMAO zzrTD|0vogN*YNd0dMrrrd}l|><#I{|!QB;ExOwZJmRIkk#9=mk@b!VJ;DkG=gYkGg z<&?X#B1`W-$@$rj%mBCFew07ozA8DsKE{(tQX^W)4`PkCkB(9#Y`k&*QF4>10*Y;{ z&5~;kHJf?^1v%q!c@XP>K1>l=U6r-0X6W}KnO&F-Lcw6?;UHvKLqq3T_PvE5HDCF to line breaks. + $value = $value.replace(/
    <\/p>/gi,"\n\n"); + $value = $value.replace(/
    /gi, "\n"); + $value = $value.replace(/<\/p>/gi,"\n\n"); + $value = $value.replace(/ /gi," "); + + // remove html tags + $value = $value.replace(/<[^>]+>/g, ''); + + // fix multiple new lines + $value = $value.replace(/\n{3,}/gi,"\n\n"); + + ev.data.dataValue = $value; + + $pasted = true; + } + }, null, null, 9); + + event.editor.on('insertText', function(ev) { + $insertedText = ev.data; + }, null, null, 1); + event.editor.on('mode', function(ev) { + ev.editor.focus(); + + insertFakeSubmitButton(ev); + }); + event.editor.on('afterSetData', function(ev) { + insertFakeSubmitButton(ev); + }); + + event.editor.on('key', function(ev) { + if (ev.data.keyCode == CKEDITOR.ALT + 83) { // [Alt] + [S] + WCF.Message.Submit.execute(ev.editor.name); + } + }); + + insertFakeSubmitButton(event); + }); + + /** + * Inserts a fake submit button, Chrome only. + * + * @param object event + */ + function insertFakeSubmitButton(event) { + if (event.editor.mode === 'source' || !WCF.Browser.isChrome()) { + return; + } + + // place button outside of to prevent it being removed once deleting content + $('