From: Alexander Ebert Date: Thu, 28 Jul 2016 15:42:30 +0000 (+0200) Subject: Including settings when submitting inline edit X-Git-Tag: 3.0.0_Beta_1~930 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a9d6d4e5e34f657b738baef572f8c4e461c77f9e;p=GitHub%2FWoltLab%2FWCF.git Including settings when submitting inline edit --- diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Ui/Message/InlineEditor.js b/wcfsetup/install/files/js/WoltLab/WCF/Ui/Message/InlineEditor.js index 4258efa481..54acb6904e 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Ui/Message/InlineEditor.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Ui/Message/InlineEditor.js @@ -425,6 +425,25 @@ define( var id = this._getEditorId(); + // add any available settings + var settingsContainer = elById('settings_' + id); + 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', 'getText_' + id, parameters.data); if (!this._validate(parameters)) {