From: Alexander Ebert Date: Fri, 29 Dec 2017 12:44:35 +0000 (+0100) Subject: Merge remote-tracking branch 'refs/remotes/origin/3.0' X-Git-Tag: 3.1.0_RC_1~33 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b4ea9d269020219b97f889812e98db4969279a51;p=GitHub%2FWoltLab%2FWCF.git Merge remote-tracking branch 'refs/remotes/origin/3.0' # Conflicts: # wcfsetup/install/files/js/WoltLabSuite/Core/Ui/TabMenu/Simple.js --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js index 59163536f6..2847d5a733 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabList.js @@ -68,6 +68,37 @@ $.Redactor.prototype.WoltLabList = function() { return false; }).bind(this); + + this.list.toggle = (function(type) { + if (this.utils.inBlocks(['table', 'td', 'th', 'tr'])) { + return; + } + + type = (type === 'orderedlist') ? 'ol' : type; + type = (type === 'unorderedlist') ? 'ul' : type; + + type = type.toLowerCase(); + + this.buffer.set(); + this.selection.save(); + + var nodes = this.list._getBlocks(); + var block = this.selection.block(); + + // WoltLab modification: the selector matches lists outside the editor + //var $list = $(block).parents('ul, ol').last(); + var $list = $(block).parent().closest('ol, ul', this.core.editor()[0]); + // WoltLab modification END + if (nodes.length === 0 && $list.length !== 0) { + nodes = [$list.get(0)]; + } + + nodes = (this.list._isUnformat(type, nodes)) ? this.list._unformat(type, nodes) : this.list._format(type, nodes); + + this.selection.restore(); + + return nodes; + }).bind(this); } }; }; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/TabMenu/Simple.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/TabMenu/Simple.js index 4806e45559..2badc20f23 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/TabMenu/Simple.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/TabMenu/Simple.js @@ -273,7 +273,7 @@ define(['Dictionary', 'EventHandler', 'Dom/Traverse', 'Dom/Util'], function(Dict }); } - var location = window.location.href.replace(/#[^#]+$/, ''); + var location = window.location.href.replace(/#+[^#]*$/, ''); if (TabMenuSimple.getIdentifierFromHash() === name) { location += window.location.hash; } @@ -389,7 +389,7 @@ define(['Dictionary', 'EventHandler', 'Dom/Traverse', 'Dom/Util'], function(Dict }; TabMenuSimple.getIdentifierFromHash = function () { - if (window.location.hash.match(/^#([^\/]+)+(?:\/.+)?/)) { + if (window.location.hash.match(/^#+([^\/]+)+(?:\/.+)?/)) { return RegExp.$1; }