From 3913e6736be8fb02bd9a0b158f4efb40490cfacd Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 11 Mar 2019 18:12:52 +0100 Subject: [PATCH] Removed the now obsolete `WoltLabDropdown.js` module --- com.woltlab.wcf/templates/wysiwyg.tpl | 2 - .../install/files/acp/templates/wysiwyg.tpl | 11 +++- .../redactor2/plugins/WoltLabDropdown.js | 51 ------------------- 3 files changed, 9 insertions(+), 55 deletions(-) delete mode 100644 wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabDropdown.js diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index 1aac1ff3f3..394a223ce3 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -19,7 +19,6 @@ '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabCode.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabColor.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabDragAndDrop.js?v={@LAST_UPDATE_TIME}', - '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabDropdown.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabEvent.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabFont.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabFullscreen.js?v={@LAST_UPDATE_TIME}', @@ -200,7 +199,6 @@ // WoltLab specials 'WoltLabBlock', - 'WoltLabDropdown', 'WoltLabEvent', 'WoltLabKeydown', diff --git a/wcfsetup/install/files/acp/templates/wysiwyg.tpl b/wcfsetup/install/files/acp/templates/wysiwyg.tpl index c944243280..394a223ce3 100644 --- a/wcfsetup/install/files/acp/templates/wysiwyg.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwyg.tpl @@ -19,7 +19,6 @@ '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabCode.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabColor.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabDragAndDrop.js?v={@LAST_UPDATE_TIME}', - '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabDropdown.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabEvent.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabFont.js?v={@LAST_UPDATE_TIME}', '{@$__wcf->getPath()}js/3rdParty/redactor2/plugins/WoltLabFullscreen.js?v={@LAST_UPDATE_TIME}', @@ -86,6 +85,7 @@ 'wcf.editor.image.float.left': '{lang}wcf.editor.image.float.left{/lang}', 'wcf.editor.image.float.right': '{lang}wcf.editor.image.float.right{/lang}', 'wcf.editor.image.source': '{lang}wcf.editor.image.source{/lang}', + 'wcf.editor.image.source.error.blocked': '{lang}wcf.editor.image.source.error.blocked{/lang}', 'wcf.editor.image.source.error.insecure': '{lang}wcf.editor.image.source.error.insecure{/lang}', 'wcf.editor.image.source.error.invalid': '{lang}wcf.editor.image.source.error.invalid{/lang}', @@ -199,7 +199,6 @@ // WoltLab specials 'WoltLabBlock', - 'WoltLabDropdown', 'WoltLabEvent', 'WoltLabKeydown', @@ -245,6 +244,13 @@ customButtons: customButtons, forceSecureImages: {if MESSAGE_FORCE_SECURE_IMAGES}true{else}false{/if}, highlighters: highlighters, + images: { + external: {if IMAGE_ALLOW_EXTERNAL_SOURCE}true{else}false{/if}, + secureOnly: {if MESSAGE_FORCE_SECURE_IMAGES}true{else}false{/if}, + whitelist: [ + {implode from=$__wcf->getBBCodeHandler()->getImageExternalSourceWhitelist() item=$hostname}'{$hostname|encodeJS}'{/implode} + ] + }, media: {if $__wcf->session->getPermission('admin.content.cms.canUseMedia')}true{else}false{/if}, mediaUrl: '{link controller='Media' id=-123456789 thumbnail='void' forceFrontend=true}{/link}' } @@ -294,6 +300,7 @@ // set code redactor.code.start(content); + redactor.WoltLabImage.validateImages(); // set value redactor.core.textarea().val(redactor.clean.onSync(redactor.$editor.html())); diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabDropdown.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabDropdown.js deleted file mode 100644 index 4cd1823258..0000000000 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabDropdown.js +++ /dev/null @@ -1,51 +0,0 @@ -$.Redactor.prototype.WoltLabDropdown = function() { - "use strict"; - - return { - init: function() { - // prevent overflow: hidden on body while hovering dropdowns - this.utils.disableBodyScroll = function() {}; - this.utils.enableBodyScroll = function() {}; - - // disable slideUp effect for dropdowns on close - this.WoltLabDropdown._hideAll(); - - // disable slideDown effect for dropdowns on open - // enforce dropdownMenu-like DOM - this.WoltLabDropdown._show(); - - // the original implementation didn't perform that well (especially with multiple - // instance being launched at start) and suffered from too many live DOM manipulations - // Integrated into Redactor itself in WoltLab Suite 5.2: - // * this.dropdown.build - // * this.dropdown.buildItem - }, - - _hideAll: function() { - var hideAll = this.dropdown.hideAll; - this.dropdown.hideAll = (function(e, key) { - hideAll.call(this, e, key); - - $('.redactor-dropdown-' + this.uuid).stop(true, true).hide(); - }).bind(this); - }, - - _show: function() { - return; - var show = this.dropdown.show; - this.dropdown.show = (function(e, key) { - var $button = this.button.get(key); - var $dropdown = $button.data('dropdown'); - - var isActive = $button.hasClass('dropact'); - - show.call(this, e, key); - - if (!isActive) { - $dropdown.stop(true).show(); - } - }).bind(this); - - } - }; -}; -- 2.20.1