Fixed a few issues related to line endings and smilies
authorAlexander Ebert <ebert@woltlab.com>
Wed, 27 Aug 2014 17:56:41 +0000 (19:56 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 27 Aug 2014 17:56:41 +0000 (19:56 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js
wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js

index 1332c35a640381e0f51eb17f0db331225a633970..4680e221e41d1789c95a0ab52d475f505f0b0819 100644 (file)
@@ -628,7 +628,7 @@ RedactorPlugins.wbbcode = {
                        if ($line.indexOf('<') === 0) {
                                data += $line;
                                
-                               if (!$line.match(/>$/)) {
+                               if (!$line.match(/>$/) || $line.match(/<span[^>]+>.*?<\/span>$/)) {
                                        data += '<br>';
                                }
                        }
index 7ecc8bc22c9f29336993c8559b2c0b05f0081a17..d3b943962bb11d098a101d29aae666b41d612c95 100644 (file)
@@ -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.
         *