From: Alexander Ebert Date: Tue, 26 Aug 2014 17:57:13 +0000 (+0200) Subject: Fixed a few issues related to quotes X-Git-Tag: 2.1.0_Alpha_1~401 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=084ebf23ccd7eb8ad286bb36010c27f870a932e1;p=GitHub%2FWoltLab%2FWCF.git Fixed a few issues related to quotes --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 6807649af6..a299afe433 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -616,6 +616,9 @@ RedactorPlugins.wbbcode = { data = data.replace(/(\[quote.*?\])/gi, '$1\n'); data = data.replace(/(\[\/quote\])/gi, '\n$1'); + // drop trailing line breaks + data = data.replace(/\n*$/, ''); + // convert line breaks into

or empty lines to


var $tmp = data.split("\n"); data = ''; @@ -689,14 +692,18 @@ RedactorPlugins.wbbcode = { + '' + ''; - var $lines = innerContent.split('\n'); + innerContent = $.trim(innerContent); var $tmp = ''; - for (var $i = 0; $i < $lines.length; $i++) { - $tmp += '
' + $lines[$i] + '
'; - } - if (!$tmp) { - $tmp = '
' + this.opts.invisibleSpace + '
'; + if (innerContent.length) { + var $lines = innerContent.split('\n'); + + for (var $i = 0; $i < $lines.length; $i++) { + $tmp += '
' + $lines[$i] + '
'; + } + } + else { + $tmp = '
' + self.opts.invisibleSpace + '
'; } $quote += $tmp; @@ -1030,6 +1037,8 @@ RedactorPlugins.wbbcode = { this.selectionStart($container[0]); this._observeQuotes(); + + this.$toolbar.find('a.re-__wcf_quote').addClass('redactor_button_disabled'); } else { var $bbcode = '[quote]'; diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 281513cc41..d10659901c 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -166,7 +166,7 @@ RedactorPlugins.wmonkeypatch = { if (parent && parent.closest('blockquote.quoteBox', this.$editor.get()[0]).length != 0) { this.$toolbar.find('a.re-__wcf_quote').addClass('redactor_button_disabled'); } - else { + else if (this.opts.visual) { this.$toolbar.find('a.re-__wcf_quote').removeClass('redactor_button_disabled'); } },