From a9d6d4e5e34f657b738baef572f8c4e461c77f9e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 28 Jul 2016 17:42:30 +0200 Subject: [PATCH] Including settings when submitting inline edit --- .../js/WoltLab/WCF/Ui/Message/InlineEditor.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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)) { -- 2.20.1