roojs-ui.js
authorAlan <alan@roojs.com>
Wed, 6 Oct 2021 06:05:17 +0000 (14:05 +0800)
committerAlan <alan@roojs.com>
Wed, 6 Oct 2021 06:05:17 +0000 (14:05 +0800)
roojs-ui-debug.js
roojs-bootstrap.js
roojs-bootstrap-debug.js
roojs-all.js
roojs-debug.js

roojs-all.js
roojs-bootstrap-debug.js
roojs-bootstrap.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index ab20c63..3fa07f5 100644 (file)
@@ -1872,8 +1872,8 @@ Roo.htmleditor.FilterStyleToTag=function(A){this.tags={B:['fontWeight','bold'],I
 }var B=[];for(var k in this.tags){if(A.style[this.tags[k][0]]==this.tags[k][1]){B.push(k);A.style.removeProperty(this.tags[k][0]);}}if(!B.length){return true;}var cn=Array.from(A.childNodes);var nn=A;Roo.each(B,function(t){var nc=A.ownerDocument.createelement(t);
 nn.appendChild(nc);nn=nc;});for(var i=0;i<cn.length;cn++){A.removeChild(cn[i]);nn.appendChild(cn[i]);}return true}})
 // Roo/htmleditor/FilterLongBr.js
-Roo.htmleditor.FilterLongBr=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterLongBr,Roo.htmleditor.Filter,{tag:'BR',replaceTag:function(A){if(!A.previousSibling||A.previousSibling.tagName!='BR'){return false;}if(!A.nextSibling||A.nextSibling.tagName!='BR'){return false;
-}A.parentNode.removeChild(A);return false;}});
+Roo.htmleditor.FilterLongBr=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterLongBr,Roo.htmleditor.Filter,{tag:'BR',replaceTag:function(A){if(!A.previousSibling){return false;}var ps=A.previousSibling;if(ps&&ps.nodeType==3&&ps.nodeValue.trim()){ps=ps.previousSibling;
+}if(!ps||ps.tagName!='BR'){return false;}var ps=A.nextSibling;if(ps&&ps.nodeType==3&&ps.nodeValue.trim()){ps=ps.nextSibling;}if(!ps||ps.tagName!='BR'){return false;}A.parentNode.removeChild(A);return false;}});
 // Roo/htmleditor/Tidy.js
 Roo.htmleditor.Tidy=function(A){Roo.apply(this,A);this.core.doc.body.innerHTML=this.tidy(this.core.doc.body,'');};Roo.htmleditor.Tidy.toString=function(A){return Roo.htmleditor.Tidy.prototype.tidy(A,'');};Roo.htmleditor.Tidy.prototype={wrap:function(s){return s.replace(/\n/g," ").replace(/(?![^\n]{1,80}$)([^\n]{1,80})\s/g,'$1\n');
 },tidy:function(A,B){if(A.nodeType==3){return B===false?A.nodeValue:this.wrap(A.nodeValue.trim()).split("\n").join("\n"+B);}if(A.nodeType!=1){return '';}if(A.tagName=='BODY'){return this.cn(A,'');}var C="<"+A.tagName+this.attr(A);if(['IMG','BR','HR','INPUT'].indexOf(A.tagName)>-1){return C+'/>';
index eda9c14..139ecc4 100644 (file)
@@ -26623,12 +26623,28 @@ Roo.extend(Roo.htmleditor.FilterLongBr, Roo.htmleditor.Filter,
     replaceTag : function(node)
     {
         
-        if (!node.previousSibling || node.previousSibling.tagName != 'BR') {
+        if (!node.previousSibling) {
             return false;
         }
-        if (!node.nextSibling || node.nextSibling.tagName != 'BR') {
+        var ps = node.previousSibling;
+        
+        if (ps && ps.nodeType == 3 && ps.nodeValue.trim()) {
+            ps = ps.previousSibling;
+        }
+        if (!ps || ps.tagName != 'BR') {
             return false;
         }
+        
+        var ps = node.nextSibling;
+        
+        if (ps && ps.nodeType == 3 && ps.nodeValue.trim()) {
+            ps = ps.nextSibling;
+        }
+        if (!ps || ps.tagName != 'BR') {
+            return false;
+        }
+        
+        
         node.parentNode.removeChild(node); // remove me...
         
         return false; // no need to do children
index d1cc095..8dadf2a 100644 (file)
@@ -1150,8 +1150,8 @@ Roo.htmleditor.FilterStyleToTag=function(A){this.tags={B:['fontWeight','bold'],I
 }var B=[];for(var k in this.tags){if(A.style[this.tags[k][0]]==this.tags[k][1]){B.push(k);A.style.removeProperty(this.tags[k][0]);}}if(!B.length){return true;}var cn=Array.from(A.childNodes);var nn=A;Roo.each(B,function(t){var nc=A.ownerDocument.createelement(t);
 nn.appendChild(nc);nn=nc;});for(var i=0;i<cn.length;cn++){A.removeChild(cn[i]);nn.appendChild(cn[i]);}return true}})
 // Roo/htmleditor/FilterLongBr.js
-Roo.htmleditor.FilterLongBr=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterLongBr,Roo.htmleditor.Filter,{tag:'BR',replaceTag:function(A){if(!A.previousSibling||A.previousSibling.tagName!='BR'){return false;}if(!A.nextSibling||A.nextSibling.tagName!='BR'){return false;
-}A.parentNode.removeChild(A);return false;}});
+Roo.htmleditor.FilterLongBr=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterLongBr,Roo.htmleditor.Filter,{tag:'BR',replaceTag:function(A){if(!A.previousSibling){return false;}var ps=A.previousSibling;if(ps&&ps.nodeType==3&&ps.nodeValue.trim()){ps=ps.previousSibling;
+}if(!ps||ps.tagName!='BR'){return false;}var ps=A.nextSibling;if(ps&&ps.nodeType==3&&ps.nodeValue.trim()){ps=ps.nextSibling;}if(!ps||ps.tagName!='BR'){return false;}A.parentNode.removeChild(A);return false;}});
 // Roo/htmleditor/KeyEnter.js
 Roo.htmleditor.KeyEnter=function(A){Roo.apply(this,A);Roo.get(this.core.doc.body).on('keypress',this.keypress,this);};Roo.htmleditor.KeyEnter.prototype={core:false,keypress:function(e){if(e.charCode!=13){return true;}e.preventDefault();var A=this.core.doc;
 var B=A.createDocumentFragment();var C=A.createTextNode('\n');B.appendChild(C);C=A.createElement('br');B.appendChild(C);var D=this.core.win.getSelection().getRangeAt(0);D.deleteContents();D.insertNode(B);D=A.createRange();D.setStartAfter(C);D.collapse(true);
index d7f7597..2358d0e 100644 (file)
@@ -45155,12 +45155,28 @@ Roo.extend(Roo.htmleditor.FilterLongBr, Roo.htmleditor.Filter,
     replaceTag : function(node)
     {
         
-        if (!node.previousSibling || node.previousSibling.tagName != 'BR') {
+        if (!node.previousSibling) {
             return false;
         }
-        if (!node.nextSibling || node.nextSibling.tagName != 'BR') {
+        var ps = node.previousSibling;
+        
+        if (ps && ps.nodeType == 3 && ps.nodeValue.trim()) {
+            ps = ps.previousSibling;
+        }
+        if (!ps || ps.tagName != 'BR') {
             return false;
         }
+        
+        var ps = node.nextSibling;
+        
+        if (ps && ps.nodeType == 3 && ps.nodeValue.trim()) {
+            ps = ps.nextSibling;
+        }
+        if (!ps || ps.tagName != 'BR') {
+            return false;
+        }
+        
+        
         node.parentNode.removeChild(node); // remove me...
         
         return false; // no need to do children
index 1657f8d..63bec29 100644 (file)
@@ -21187,12 +21187,28 @@ Roo.extend(Roo.htmleditor.FilterLongBr, Roo.htmleditor.Filter,
     replaceTag : function(node)
     {
         
-        if (!node.previousSibling || node.previousSibling.tagName != 'BR') {
+        if (!node.previousSibling) {
             return false;
         }
-        if (!node.nextSibling || node.nextSibling.tagName != 'BR') {
+        var ps = node.previousSibling;
+        
+        if (ps && ps.nodeType == 3 && ps.nodeValue.trim()) {
+            ps = ps.previousSibling;
+        }
+        if (!ps || ps.tagName != 'BR') {
             return false;
         }
+        
+        var ps = node.nextSibling;
+        
+        if (ps && ps.nodeType == 3 && ps.nodeValue.trim()) {
+            ps = ps.nextSibling;
+        }
+        if (!ps || ps.tagName != 'BR') {
+            return false;
+        }
+        
+        
         node.parentNode.removeChild(node); // remove me...
         
         return false; // no need to do children
index e2f3b48..b5fb60c 100644 (file)
@@ -948,8 +948,8 @@ Roo.htmleditor.FilterStyleToTag=function(A){this.tags={B:['fontWeight','bold'],I
 }var B=[];for(var k in this.tags){if(A.style[this.tags[k][0]]==this.tags[k][1]){B.push(k);A.style.removeProperty(this.tags[k][0]);}}if(!B.length){return true;}var cn=Array.from(A.childNodes);var nn=A;Roo.each(B,function(t){var nc=A.ownerDocument.createelement(t);
 nn.appendChild(nc);nn=nc;});for(var i=0;i<cn.length;cn++){A.removeChild(cn[i]);nn.appendChild(cn[i]);}return true}})
 // Roo/htmleditor/FilterLongBr.js
-Roo.htmleditor.FilterLongBr=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterLongBr,Roo.htmleditor.Filter,{tag:'BR',replaceTag:function(A){if(!A.previousSibling||A.previousSibling.tagName!='BR'){return false;}if(!A.nextSibling||A.nextSibling.tagName!='BR'){return false;
-}A.parentNode.removeChild(A);return false;}});
+Roo.htmleditor.FilterLongBr=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterLongBr,Roo.htmleditor.Filter,{tag:'BR',replaceTag:function(A){if(!A.previousSibling){return false;}var ps=A.previousSibling;if(ps&&ps.nodeType==3&&ps.nodeValue.trim()){ps=ps.previousSibling;
+}if(!ps||ps.tagName!='BR'){return false;}var ps=A.nextSibling;if(ps&&ps.nodeType==3&&ps.nodeValue.trim()){ps=ps.nextSibling;}if(!ps||ps.tagName!='BR'){return false;}A.parentNode.removeChild(A);return false;}});
 // Roo/htmleditor/Tidy.js
 Roo.htmleditor.Tidy=function(A){Roo.apply(this,A);this.core.doc.body.innerHTML=this.tidy(this.core.doc.body,'');};Roo.htmleditor.Tidy.toString=function(A){return Roo.htmleditor.Tidy.prototype.tidy(A,'');};Roo.htmleditor.Tidy.prototype={wrap:function(s){return s.replace(/\n/g," ").replace(/(?![^\n]{1,80}$)([^\n]{1,80})\s/g,'$1\n');
 },tidy:function(A,B){if(A.nodeType==3){return B===false?A.nodeValue:this.wrap(A.nodeValue.trim()).split("\n").join("\n"+B);}if(A.nodeType!=1){return '';}if(A.tagName=='BODY'){return this.cn(A,'');}var C="<"+A.tagName+this.attr(A);if(['IMG','BR','HR','INPUT'].indexOf(A.tagName)>-1){return C+'/>';