From: Alexander Ebert Date: Fri, 26 Jun 2015 09:38:33 +0000 (+0200) Subject: Removed unused code X-Git-Tag: 3.0.0_Beta_1~2244^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=81f62a1fd0f5e0d088018a15f0a28d65a12ff439;p=GitHub%2FWoltLab%2FWCF.git Removed unused code --- 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(); } },