From 9f3c68644527be9a2c2a0c8cfcf9c2d08acee3c3 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Fri, 26 Aug 2016 14:13:42 +0200 Subject: [PATCH] Fixed handling of settings in quick reply --- .../js/WoltLabSuite/Core/Ui/Message/Reply.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Reply.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Reply.js index d16fa10947..251b4e58c0 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Reply.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Reply.js @@ -125,6 +125,25 @@ define(['Ajax', 'Core', 'EventHandler', 'Language', 'Dom/ChangeListener', 'Dom/U parameters.data = { message: this._getEditor().code.get() }; parameters.removeQuoteIDs = (this._options.quoteManager) ? this._options.quoteManager.getQuotesMarkedForRemoval() : []; + // add any available settings + var settingsContainer = elById('settings_text'); + if (settingsContainer) { + elBySelAll('input, select, textarea', settingsContainer, function (element) { + if (element.nodeName === 'INPUT' && (element.type === 'checkbox' || element.type === 'radio')) { + if (!element.checked) { + return; + } + } + + var name = element.name; + if (parameters.hasOwnProperty(name)) { + throw new Error("Variable overshadowing, key '" + name + "' is already present."); + } + + parameters[name] = element.value.trim(); + }); + } + EventHandler.fire('com.woltlab.wcf.redactor2', 'submit_text', parameters.data); if (!User.userId && !additionalParameters) { -- 2.20.1