From: Alexander Ebert Date: Mon, 1 Aug 2016 09:37:43 +0000 (+0200) Subject: Fixed image handling X-Git-Tag: 3.0.0_Beta_1~827 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8dbbbdefa47b6be63b8bcf99272f6af63ac1b01d;p=GitHub%2FWoltLab%2FWCF.git Fixed image handling --- diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index e7bb151a13..5a3e8a03ef 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -37,7 +37,8 @@ '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabQuote.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSize.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSmiley.js?v={@LAST_UPDATE_TIME}', - '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSpoiler.js?v={@LAST_UPDATE_TIME}' + '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSpoiler.js?v={@LAST_UPDATE_TIME}', + '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabUtils.js?v={@LAST_UPDATE_TIME}' {else} '{@$__wcf->getPath()}js/3rdParty/redactor2/redactor.min.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/combined.min.js?v={@LAST_UPDATE_TIME}' @@ -173,7 +174,8 @@ 'WoltLabQuote', 'WoltLabSize', 'WoltLabSmiley', - 'WoltLabSpoiler' + 'WoltLabSpoiler', + 'WoltLabUtils' ], toolbarFixed: false, woltlab: { diff --git a/wcfsetup/install/files/acp/templates/wysiwyg.tpl b/wcfsetup/install/files/acp/templates/wysiwyg.tpl index e7bb151a13..5a3e8a03ef 100644 --- a/wcfsetup/install/files/acp/templates/wysiwyg.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwyg.tpl @@ -37,7 +37,8 @@ '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabQuote.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSize.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSmiley.js?v={@LAST_UPDATE_TIME}', - '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSpoiler.js?v={@LAST_UPDATE_TIME}' + '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabSpoiler.js?v={@LAST_UPDATE_TIME}', + '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabUtils.js?v={@LAST_UPDATE_TIME}' {else} '{@$__wcf->getPath()}js/3rdParty/redactor2/redactor.min.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/combined.min.js?v={@LAST_UPDATE_TIME}' @@ -173,7 +174,8 @@ 'WoltLabQuote', 'WoltLabSize', 'WoltLabSmiley', - 'WoltLabSpoiler' + 'WoltLabSpoiler', + 'WoltLabUtils' ], toolbarFixed: false, woltlab: { diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabUtils.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabUtils.js new file mode 100644 index 0000000000..539cf4b8c0 --- /dev/null +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabUtils.js @@ -0,0 +1,17 @@ +$.Redactor.prototype.WoltLabUtils = function() { + "use strict"; + + return { + init: function() { + var mpReplaceToTag = this.utils.replaceToTag; + this.utils.replaceToTag = (function (node, tag) { + if (tag === 'figure') { + // prevent

wrapping an being replaced + return node; + } + + return mpReplaceToTag.call(this, node, tag); + }).bind(this); + } + }; +};