From b7beeee18a467528f03380e107812660e45c1312 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 27 Aug 2014 19:56:41 +0200 Subject: [PATCH] Fixed a few issues related to line endings and smilies --- .../js/3rdParty/redactor/plugins/wbbcode.js | 2 +- .../3rdParty/redactor/plugins/wmonkeypatch.js | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 1332c35a64..4680e221e4 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -628,7 +628,7 @@ RedactorPlugins.wbbcode = { if ($line.indexOf('<') === 0) { data += $line; - if (!$line.match(/>$/)) { + if (!$line.match(/>$/) || $line.match(/]+>.*?<\/span>$/)) { data += '
'; } } diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 7ecc8bc22c..d3b943962b 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -481,6 +481,31 @@ RedactorPlugins.wmonkeypatch = { }, this)); }, + /** + * Overwrites $.Redactor.observeImages() to prevent smileys being recognized as ordinary images. + * + * @see $.Redactor.observeImages() + */ + observeImages: function() { + if (this.opts.observeImages === false) return false; + + this.$editor.find('img:not(.smiley)').each($.proxy(function(i, elem) + { + if (this.browser('msie')) $(elem).attr('unselectable', 'on'); + + var parent = $(elem).parent(); + if (!parent.hasClass('royalSlider') && !parent.hasClass('fotorama')) + { + this.imageResize(elem); + } + + }, this)); + + // royalSlider and fotorama + this.$editor.find('.fotorama, .royalSlider').on('click', $.proxy(this.editGallery, this)); + + }, + /** * Handles deletion of quotes in design mode. * -- 2.20.1