Fixed a few issues
authorAlexander Ebert <ebert@woltlab.com>
Mon, 30 Mar 2015 11:20:59 +0000 (13:20 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 30 Mar 2015 11:20:59 +0000 (13:20 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js
wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js

index 06718ba9aa90b448661575873a2d37a30663c24a..039e3f95145fe4ee5a057cebc8bef51167cfaabc 100644 (file)
@@ -27,7 +27,7 @@ RedactorPlugins.wbbcode = function() {
                                // use stored editor contents
                                var $content = $.trim(this.wutil.getOption('woltlab.originalValue'));
                                if ($content.length) {
-                                       this.wutil.replaceText($content, false);
+                                       this.wutil.replaceText($content);
                                        
                                        // ensure that the caret is not within a quote tag
                                        this.wutil.selectionEndOfEditor();
@@ -877,7 +877,7 @@ RedactorPlugins.wbbcode = function() {
                        
                        // [s]
                        data = data.replace(/\[s\]([\s\S]*?)\[\/s]/gi, (function(match, content) {
-                               return this.wbbcode._expandFormatting(content, '<strike>', '</strike>');
+                               return this.wbbcode._expandFormatting(content, '<del>', '</del>');
                        }).bind(this));
                        
                        // [sub]
index 813d1407d173f016b5a60b8b4877bf8cfece34b0..302b302d190c7aff276868e785a7784d77461b20 100644 (file)
@@ -884,9 +884,8 @@ RedactorPlugins.wutil = function() {
                 * Replaces the current content with the provided value.
                 * 
                 * @param       string          value
-                * @param       boolean         addNewlines
                 */
-               replaceText: function(value, addNewlines) {
+               replaceText: function(value) {
                        var $document = $(document);
                        var $offsetTop = $document.scrollTop();
                        var $wasInWysiwygMode = false;
@@ -896,10 +895,7 @@ RedactorPlugins.wutil = function() {
                                $wasInWysiwygMode = true;
                        }
                        
-                       if (addNewlines !== false) {
-                               value = this.wutil.addNewlines(value);
-                       }
-                       
+                       value = this.wutil.addNewlines(value);
                        this.$textarea.val(value);
                        
                        if ($wasInWysiwygMode) {
@@ -1017,6 +1013,15 @@ RedactorPlugins.wutil = function() {
                                        continue;
                                }
                                
+                               if ($child.innerHTML === "\n") {
+                                       $child.parentElement.removeChild($child);
+                                       
+                                       $i--;
+                                       $length--;
+                                       
+                                       continue;
+                               }
+                               
                                if ($child.textContent.length > 0) {
                                        // element is non-empty
                                        continue;