Removed the now obsolete `WoltLabDropdown.js` module
authorAlexander Ebert <ebert@woltlab.com>
Mon, 11 Mar 2019 17:12:52 +0000 (18:12 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 11 Mar 2019 17:12:52 +0000 (18:12 +0100)
com.woltlab.wcf/templates/wysiwyg.tpl
wcfsetup/install/files/acp/templates/wysiwyg.tpl
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabDropdown.js [deleted file]

index 1aac1ff3f3c85b57811f2f2e5d74d6d60c5a8633..394a223ce3646b9efe7fea44e4ab82006548cde8 100644 (file)
@@ -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}',
                                        
                                        // WoltLab specials
                                        'WoltLabBlock',
-                                       'WoltLabDropdown',
                                        'WoltLabEvent',
                                        'WoltLabKeydown',
                                        
index c944243280e9075623da294ab928e480abda8d9c..394a223ce3646b9efe7fea44e4ab82006548cde8 100644 (file)
@@ -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}',
                                
                                        
                                        // WoltLab specials
                                        'WoltLabBlock',
-                                       'WoltLabDropdown',
                                        'WoltLabEvent',
                                        'WoltLabKeydown',
                                        
                                        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}'
                                }
                                        
                                        // 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 (file)
index 4cd1823..0000000
+++ /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);
-                       
-               }
-       };
-};