Removed unused code
authorAlexander Ebert <ebert@woltlab.com>
Fri, 26 Jun 2015 09:38:33 +0000 (11:38 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 26 Jun 2015 09:38:33 +0000 (11:38 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js

index 7ea3d5e51191dbd072cb5d40e9f70da2805d8891..c939aff1156a622ed123d3db922d886ca65e8233 100644 (file)
@@ -163,36 +163,24 @@ RedactorPlugins.wbutton = function() {
                                var $selectedHtml = this.selection.getHtml();
                                $selectedHtml = $selectedHtml.replace(/<p>@@@wcf_empty_line@@@<\/p>/g, '<p><br></p>');
                                
-                               // 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 === '<br>') {
+                                               // <br> 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 === '<br>') {
-                                                       // <br> 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();
                        }
                },