From de6aaaaff76315fa803cf17a79899e01ce4f0d04 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 19 Aug 2016 16:29:13 +0200 Subject: [PATCH] Fixed direct quote insert --- wcfsetup/install/files/js/WCF.Message.js | 10 ++++++++++ .../files/js/WoltLabSuite/Core/Ui/Redactor/Quote.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index ea4ddc05b7..43152409af 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -1604,6 +1604,16 @@ WCF.Message.Quote.Manager = Class.extend({ this._toggleShowQuotes(); WCF.System.Event.addListener('com.woltlab.wcf.quote', 'reload', this.countQuotes.bind(this)); + + // event forwarding + WCF.System.Event.addListener('com.woltlab.wcf.message.quote', 'insert', (function(data) { + WCF.System.Event.fireEvent('com.woltlab.wcf.redactor2', 'insertQuote_' + (this._editorIdAlternative ? this._editorIdAlternative : this._editorId), { + author: data.quote.username, + content: data.quote.text, + isText: true, + link: data.quote.link + }); + }).bind(this)); }, /** diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Quote.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Quote.js index e89bf943c5..44409166e9 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Quote.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Quote.js @@ -96,7 +96,7 @@ define(['Core', 'EventHandler', 'EventKey', 'Language', 'StringUtil', 'Dom/Util' elData(quote, 'link', data.link); if (data.isText) { - this.insert.text(data.content); + this._editor.insert.text(data.content); } quote.removeAttribute('id'); -- 2.20.1