Removed double separators for link tooltips
authorAlexander Ebert <ebert@woltlab.com>
Mon, 23 May 2016 10:59:58 +0000 (12:59 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 23 May 2016 10:59:58 +0000 (12:59 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js

index 8606c10e0a4991ae789c7fcbb17fc66f3aa81e53..6146decf67094f9e7691c5a6d879cfe545913df6 100644 (file)
@@ -1164,6 +1164,26 @@ RedactorPlugins.wmonkeypatch = function() {
                                if (!$link.hasClass('redactorQuoteEdit')) {
                                        $mpShowTooltip.call(this, e);
                                }
+                               
+                               // remove pipe ("|") separators
+                               $('.redactor-link-tooltip').each(function(index, tooltip) {
+                                       var textNodes = [], i, length, node;
+                                       for (i = 0, length = tooltip.childNodes.length; i < length; i++) {
+                                               node = tooltip.childNodes[i];
+                                               
+                                               if (node.nodeType === Node.TEXT_NODE) {
+                                                       textNodes.push(node);
+                                               }
+                                       }
+                                       
+                                       for (i = 0, length = textNodes.length; i < length; i++) {
+                                               node = textNodes[i];
+                                               
+                                               if (node.textContent.trim() === '|') {
+                                                       node.parentNode.removeChild(node);
+                                               }
+                                       }
+                               });
                        }).bind(this);
                },