From 81f62a1fd0f5e0d088018a15f0a28d65a12ff439 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 26 Jun 2015 11:38:33 +0200 Subject: [PATCH] Removed unused code --- .../js/3rdParty/redactor/plugins/wbutton.js | 40 +++++++------------ 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js index 7ea3d5e511..c939aff115 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js @@ -163,36 +163,24 @@ RedactorPlugins.wbutton = function() { var $selectedHtml = this.selection.getHtml(); $selectedHtml = $selectedHtml.replace(/

@@@wcf_empty_line@@@<\/p>/g, '


'); - // TODO: this behaves pretty weird at this time, fix or remove - if (false && $bbcode === 'tt') { - var $parent = (this.selection.getParent()) ? $(this.selection.getParent()) : null; - if ($parent && $parent.closest('inline.inlineCode', this.$editor.get()[0]).length) { - this.inline.toggleClass('inlineCode'); - } - else { - this.inline.toggleClass('inlineCode'); + this.buffer.set(); + + if (this.utils.browser('mozilla') && !$selectedHtml.length) { + var $container = getSelection().getRangeAt(0).startContainer; + if ($container.nodeType === Node.ELEMENT_NODE && $container.tagName === 'P' && $container.innerHTML === '
') { + //
is not removed in Firefox, instead content gets inserted afterwards creating a leading empty line + $container.removeChild($container.children[0]); } } + + if (this._bbcodes[buttonName].voidElement) { + this.insert.html($selectedHtml + this.selection.getMarkerAsHtml() + '[' + $bbcode + ']', false); + } else { - this.buffer.set(); - - if (this.utils.browser('mozilla') && !$selectedHtml.length) { - var $container = getSelection().getRangeAt(0).startContainer; - if ($container.nodeType === Node.ELEMENT_NODE && $container.tagName === 'P' && $container.innerHTML === '
') { - //
is not removed in Firefox, instead content gets inserted afterwards creating a leading empty line - $container.removeChild($container.children[0]); - } - } - - if (this._bbcodes[buttonName].voidElement) { - this.insert.html($selectedHtml + this.selection.getMarkerAsHtml() + '[' + $bbcode + ']', false); - } - else { - this.insert.html('[' + $bbcode + ']' + $selectedHtml + this.selection.getMarkerAsHtml() + '[/' + $bbcode + ']', false); - } - - this.selection.restore(); + this.insert.html('[' + $bbcode + ']' + $selectedHtml + this.selection.getMarkerAsHtml() + '[/' + $bbcode + ']', false); } + + this.selection.restore(); } }, -- 2.20.1