From: Matthias Schmidt Date: Sun, 29 Sep 2019 14:10:28 +0000 (+0200) Subject: Submit attachment tmpHash in AJAX form builder forms X-Git-Tag: 5.2.0_Beta_2~25 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aa398f90b832cecaeffe3c6915fbaa38c46b6533;p=GitHub%2FWoltLab%2FWCF.git Submit attachment tmpHash in AJAX form builder forms Close #3075 --- diff --git a/com.woltlab.wcf/templates/__wysiwygAttachmentFormField.tpl b/com.woltlab.wcf/templates/__wysiwygAttachmentFormField.tpl index 6517d07e96..7061590169 100644 --- a/com.woltlab.wcf/templates/__wysiwygAttachmentFormField.tpl +++ b/com.woltlab.wcf/templates/__wysiwygAttachmentFormField.tpl @@ -72,6 +72,6 @@ }); - + {include file='__formFieldFooter'} diff --git a/wcfsetup/install/files/acp/templates/__wysiwygAttachmentFormField.tpl b/wcfsetup/install/files/acp/templates/__wysiwygAttachmentFormField.tpl index 6517d07e96..7061590169 100644 --- a/wcfsetup/install/files/acp/templates/__wysiwygAttachmentFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__wysiwygAttachmentFormField.tpl @@ -72,6 +72,6 @@ }); - + {include file='__formFieldFooter'} diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.js new file mode 100644 index 0000000000..e287068b49 --- /dev/null +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment.js @@ -0,0 +1,22 @@ +/** + * Data handler for a wysiwyg attachment form builder field that stores the temporary hash. + * + * @author Matthias Schmidt + * @copyright 2001-2019 WoltLab GmbH + * @license GNU Lesser General Public License + * @module WoltLabSuite/Core/Form/Builder/Field/Checked + * @since 5.2 + */ +define(['Core', '../Value'], function(Core, FormBuilderFieldValue) { + "use strict"; + + /** + * @constructor + */ + function FormBuilderFieldAttachment(fieldId) { + this.init(fieldId + '_tmpHash'); + }; + Core.inherit(FormBuilderFieldAttachment, FormBuilderFieldValue, {}); + + return FormBuilderFieldAttachment; +}); diff --git a/wcfsetup/install/files/lib/system/form/builder/field/wysiwyg/WysiwygAttachmentFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/wysiwyg/WysiwygAttachmentFormField.class.php index b607e32e89..93d778edfe 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/wysiwyg/WysiwygAttachmentFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/wysiwyg/WysiwygAttachmentFormField.class.php @@ -28,6 +28,11 @@ class WysiwygAttachmentFormField extends AbstractFormField { */ protected $attachmentHandler; + /** + * @inheritDoc + */ + protected $javaScriptDataHandlerModule = 'WoltLabSuite/Core/Form/Builder/Field/Wysiwyg/Attachment'; + /** * @inheritDoc */