From: Alexander Ebert Date: Thu, 17 Apr 2014 11:57:42 +0000 (+0200) Subject: Added support for attachment management during inline edit X-Git-Tag: 2.1.0_Alpha_1~892 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f1f694ffb025cd4d3aa8bd448ca3116a30a09e78;p=GitHub%2FWoltLab%2FWCF.git Added support for attachment management during inline edit --- diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index 889da3d328..c721a908b8 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -46,12 +46,25 @@ $(function() { {if $wysiwygEnableUpload} $config.plugins.push('wupload'); $config.wattachment = { + attachments: [ ], maxCount: {@$attachmentHandler->getMaxCount()}, objectType: '{@$attachmentObjectType}', objectID: '{@$attachmentObjectID}', parentObjectID: '{@$attachmentParentObjectID}', tmpHash: '{$tmpHash|encodeJS}' }; + + {if $attachmentList|isset && !$attachmentList|empty} + {foreach from=$attachmentList item=attachment} + $config.wattachment.attachments.push({ + attachmentID: {@$attachment->attachmentID}, + filename: '{$attachment->filename|encodeJs}', + isImage: {if $attachment->isImage}true{else}false{/if}, + tinyThumbnailUrl: '{if $attachment->tinyThumbnailType}{link controller='Attachment' object=$attachment}tiny=1{/link}{/if}', + url: '{link controller='Attachment' object=$attachment}{/link}' + }); + {/foreach} + {/if} {/if} {event name='javascriptInit'} diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js index eb7b2142f5..2ba974dcb0 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js @@ -30,10 +30,34 @@ RedactorPlugins.wupload = { */ _initAttachments: function() { this._attachmentsContainer = $('
').hide().appendTo(this.$box); - $('