From b4346e66b2f179e2f2ee5eb8db529475f7ec992e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 24 Nov 2015 00:10:56 +0100 Subject: [PATCH] Added experimental mention support Still buggy and anything but finished, more like a proof of concept than a working implementation. Naming is still inconsistent and is something I'm working on. --- .../templates/htmlNodeWoltlabMention.tpl | 7 + com.woltlab.wcf/templates/wysiwyg.tpl | 15 + .../redactor2/plugins/WoltLabEvent.js | 38 ++ .../redactor2/plugins/WoltLabMention.js | 13 + wcfsetup/install/files/js/WCF.Assets.js | 3 + .../js/WoltLab/WCF/Ui/Redactor/Mention.js | 345 ++++++++++++++++++ .../html/input/HtmlInputProcessor.class.php | 32 +- .../filter/MessageHtmlInputFilter.class.php | 6 + .../node/HtmlInputNodeProcessor.class.php | 18 + .../HtmlInputNodeWoltlabMention.class.php | 31 ++ .../html/input/node/IHtmlInputNode.class.php | 6 + .../html/node/HtmlNodeProcessor.class.php | 57 +++ .../output/HtmlOutputNodeProcessor.class.php | 53 +-- .../html/output/HtmlOutputProcessor.class.php | 6 +- ...php => HtmlOutputNodeBlockquote.class.php} | 6 +- .../HtmlOutputNodeWoltlabMention.class.php | 74 ++++ .../system/session/SessionHandler.class.php | 4 +- 17 files changed, 664 insertions(+), 50 deletions(-) create mode 100644 com.woltlab.wcf/templates/htmlNodeWoltlabMention.tpl create mode 100644 wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabMention.js create mode 100644 wcfsetup/install/files/js/WoltLab/WCF/Ui/Redactor/Mention.js create mode 100644 wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php create mode 100644 wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMention.class.php create mode 100644 wcfsetup/install/files/lib/system/html/input/node/IHtmlInputNode.class.php create mode 100644 wcfsetup/install/files/lib/system/html/node/HtmlNodeProcessor.class.php rename wcfsetup/install/files/lib/system/html/output/node/{QuoteHtmlOutputNode.class.php => HtmlOutputNodeBlockquote.class.php} (96%) create mode 100644 wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeWoltlabMention.class.php diff --git a/com.woltlab.wcf/templates/htmlNodeWoltlabMention.tpl b/com.woltlab.wcf/templates/htmlNodeWoltlabMention.tpl new file mode 100644 index 0000000000..ac2b3d7e47 --- /dev/null +++ b/com.woltlab.wcf/templates/htmlNodeWoltlabMention.tpl @@ -0,0 +1,7 @@ +{if $userProfile === null} + {* user no longer exists, use plain output rather than using a broken link *} + @{$username} +{else} + {* non-breaking space below to prevent wrapping of user avatar and username *} + {@$userProfile->getAvatar()->getImageTag(16)} {$userProfile->username} +{/if} \ No newline at end of file diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index 475c223556..272816bb3c 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -1,3 +1,12 @@ +