From: Marcel Werk Date: Fri, 26 Aug 2016 12:13:42 +0000 (+0200) Subject: Fixed handling of settings in quick reply X-Git-Tag: 3.0.0_Beta_1~484 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9f3c68644527be9a2c2a0c8cfcf9c2d08acee3c3;p=GitHub%2FWoltLab%2FWCF.git Fixed handling of settings in quick reply --- 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) {