From: Alexander Ebert Date: Sat, 2 Feb 2019 00:07:06 +0000 (+0100) Subject: Experimental support for lists inside quotes/spoilers X-Git-Tag: 5.2.0_Alpha_1~317 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fd4e9c70920bde5bc5ace0f2fc7991a6213f3e41;p=GitHub%2FWoltLab%2FWCF.git Experimental support for lists inside quotes/spoilers --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js index 2847d5a733..bc4982be39 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js @@ -2,6 +2,8 @@ $.Redactor.prototype.WoltLabList = function() { "use strict"; return { + parentsQualifiedForLists: ['woltlab-quote', 'woltlab-spoiler'], + init: function () { this.list.combineAfterAndBefore = (function(block) { var $prev = $(block).prev(); @@ -99,6 +101,20 @@ $.Redactor.prototype.WoltLabList = function() { return nodes; }).bind(this); + + this.list._getBlocks = (function() { + return this.selection.blocks().filter((function(block) { + var parent = block.parentNode; + if (parent.classList.contains('redactor-in')) { + return true; + } + else if (this.WoltLabList.parentsQualifiedForLists.indexOf(parent.nodeName.toLowerCase()) !== -1) { + return true; + } + + return false; + }).bind(this)); + }).bind(this); } }; };