Skip to content

Commit 9e978f6

Browse files
committed
Migrate WCF.Conversation.Message.InlineEditor to typescript
1 parent 6911143 commit 9e978f6

File tree

4 files changed

+50
-31
lines changed

4 files changed

+50
-31
lines changed

files/js/WCF.Conversation.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,29 +1145,3 @@ WCF.Conversation.Label.Manager = Class.extend({
11451145
this._dialog.wcfDialog('close');
11461146
}
11471147
});
1148-
1149-
/**
1150-
* Namespace for conversation messages.
1151-
*/
1152-
WCF.Conversation.Message = { };
1153-
1154-
/**
1155-
* Provides an inline editor for conversation messages.
1156-
*
1157-
* @see WCF.Message.InlineEditor
1158-
*/
1159-
WCF.Conversation.Message.InlineEditor = WCF.Message.InlineEditor.extend({
1160-
/**
1161-
* @see WCF.Message.InlineEditor.init()
1162-
*/
1163-
init: function(containerID, quoteManager) {
1164-
this._super(containerID, true, quoteManager);
1165-
},
1166-
1167-
/**
1168-
* @see WCF.Message.InlineEditor._getClassName()
1169-
*/
1170-
_getClassName: function() {
1171-
return 'wcf\\data\\conversation\\message\\ConversationMessageAction';
1172-
}
1173-
});

files/js/WoltLabSuite/Core/Conversation/Ui/Message/InlineEditor.js

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/conversation.tpl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@
169169
{assign var=__supportPaste value=true}
170170
{if !$conversation->canReply()}{assign var=__supportPaste value=false}{/if}
171171
{include file='shared_messageQuoteManager' wysiwygSelector='text' supportPaste=$__supportPaste}
172-
173-
new WCF.Conversation.Message.InlineEditor({@$conversation->conversationID}, $quoteManager);
174-
172+
175173
require(["WoltLabSuite/Core/Conversation/Ui/Message/Quote"], ({ UiConversationMessageQuote }) => {
176174
new UiConversationMessageQuote($quoteManager);
177175
});
@@ -187,8 +185,13 @@
187185
});
188186
{/if}
189187
});
190-
191-
require(['WoltLabSuite/Core/Conversation/Ui/Object/Action/RemoveParticipant'], (UiObjectActionRemoveParticipant) => {
188+
189+
require([
190+
'WoltLabSuite/Core/Conversation/Ui/Object/Action/RemoveParticipant',
191+
'WoltLabSuite/Core/Conversation/Ui/Message/InlineEditor',
192+
], (UiObjectActionRemoveParticipant, { UiConversationMessageInlineEditor }) => {
193+
new UiConversationMessageInlineEditor({$conversation->conversationID});
194+
192195
UiObjectActionRemoveParticipant.setup();
193196
});
194197
</script>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Inline editor for conversation messages.
3+
*
4+
* @author Olaf Braun
5+
* @copyright 2001-2025 WoltLab GmbH
6+
* @license WoltLab License <http://www.woltlab.com/license-agreement.html>
7+
* @since 6.2
8+
*/
9+
10+
import UiMessageInlineEditor from "WoltLabSuite/Core/Ui/Message/InlineEditor";
11+
12+
export class UiConversationMessageInlineEditor extends UiMessageInlineEditor {
13+
constructor(containerID: number) {
14+
super({
15+
className: "wcf\\data\\conversation\\message\\ConversationMessageAction",
16+
containerId: containerID.toString(),
17+
});
18+
}
19+
}

0 commit comments

Comments
 (0)