From 8fdca4dc05a4bfde83d45bf2f6f1064d447f729e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 12 Aug 2016 15:45:50 +0200 Subject: [PATCH] Using alternate approach to deal with mentions Using a custom element has too many drawbacks and issues, all though being far more elegant, it is just not worth it. --- com.woltlab.wcf/bbcode.xml | 10 +++ com.woltlab.wcf/objectType.xml | 5 ++ ...deWoltlabMention.tpl => userBBCodeTag.tpl} | 2 +- com.woltlab.wcf/templates/wysiwyg.tpl | 22 ------ .../install/files/acp/templates/wysiwyg.tpl | 10 --- .../redactor2/plugins/WoltLabMention.js | 2 - .../WoltLabSuite/Core/Ui/Redactor/Mention.js | 10 +-- .../lib/system/bbcode/UserBBCode.class.php | 37 +++++++++ .../filter/MessageHtmlInputFilter.class.php | 6 -- .../node/HtmlInputNodeTextParser.class.php | 8 +- .../HtmlInputNodeWoltlabMention.class.php | 48 ----------- .../HtmlOutputNodeWoltlabMention.class.php | 79 ------------------- ...UserMessageEmbeddedObjectHandler.class.php | 35 ++++++++ .../BBCodeSelectUserGroupOptionType.class.php | 2 +- .../files/lib/util/MessageUtil.class.php | 8 +- 15 files changed, 101 insertions(+), 183 deletions(-) rename com.woltlab.wcf/templates/{htmlNodeWoltlabMention.tpl => userBBCodeTag.tpl} (98%) create mode 100644 wcfsetup/install/files/lib/system/bbcode/UserBBCode.class.php delete mode 100644 wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMention.class.php delete mode 100644 wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeWoltlabMention.class.php create mode 100644 wcfsetup/install/files/lib/system/message/embedded/object/UserMessageEmbeddedObjectHandler.class.php diff --git a/com.woltlab.wcf/bbcode.xml b/com.woltlab.wcf/bbcode.xml index 994191ce16..405afd3774 100644 --- a/com.woltlab.wcf/bbcode.xml +++ b/com.woltlab.wcf/bbcode.xml @@ -227,5 +227,15 @@ + + + wcf\system\bbcode\UserBBCode + + + ^\d+$ + 1 + + + diff --git a/com.woltlab.wcf/objectType.xml b/com.woltlab.wcf/objectType.xml index 7e8e7d8253..238c692a73 100644 --- a/com.woltlab.wcf/objectType.xml +++ b/com.woltlab.wcf/objectType.xml @@ -770,6 +770,11 @@ com.woltlab.wcf.message.embeddedObject wcf\system\message\embedded\object\MediaMessageEmbeddedObjectHandler + + com.woltlab.wcf.user + com.woltlab.wcf.message.embeddedObject + wcf\system\message\embedded\object\UserMessageEmbeddedObjectHandler + diff --git a/com.woltlab.wcf/templates/htmlNodeWoltlabMention.tpl b/com.woltlab.wcf/templates/userBBCodeTag.tpl similarity index 98% rename from com.woltlab.wcf/templates/htmlNodeWoltlabMention.tpl rename to com.woltlab.wcf/templates/userBBCodeTag.tpl index ac2b3d7e47..540243b6c1 100644 --- a/com.woltlab.wcf/templates/htmlNodeWoltlabMention.tpl +++ b/com.woltlab.wcf/templates/userBBCodeTag.tpl @@ -4,4 +4,4 @@ {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 +{/if} diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index ac556360d4..00ed92391c 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -1,25 +1,3 @@ - -