roojs-ui.js
authorAlan <alan@roojs.com>
Thu, 6 Jan 2022 09:22:20 +0000 (17:22 +0800)
committerAlan <alan@roojs.com>
Thu, 6 Jan 2022 09:22:20 +0000 (17:22 +0800)
roojs-ui-debug.js
roojs-all.js
roojs-debug.js

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

index b606309..1291126 100644 (file)
@@ -1940,11 +1940,8 @@ return false;}if(!ps||ps.nodeType!=1){return false;}if(!ps||ps.tagName!='BR'){re
 Roo.htmleditor.FilterBlock=function(A){Roo.apply(this,A);var qa=A.node.querySelectorAll;this.removeAttributes('data-block');this.removeAttributes('contenteditable');this.removeAttributes('id');};Roo.apply(Roo.htmleditor.FilterBlock.prototype,{node:true,removeAttributes:function(A){var ar=this.node.querySelectorAll('*['+A+']');
 for(var i=0;i<ar.length;i++){ar[i].removeAttribute(A);}}});
 // 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+'/>';
-}C+='>';var D=B===false?'':(B+'  ');if(['PRE','TEXTAREA','TD','A','SPAN','B','I','S'].indexOf(A.tagName)>-1){D=false;}var cn=this.cn(A,D);return C+cn+'</'+A.tagName+'>';},cn:function(A,B){var C=[];var ar=Array.from(A.childNodes);for(var i=0;i<ar.length;i++){if(B!==false&&i>0&&ar[i].nodeType==3&&ar[i].nodeValue.length>0&&ar[i].nodeValue.match(/^\s+/)){if(C.length&&C[C.length-1]=="\n"+B){C.pop();
-}C.push(" ");}if(B!==false&&ar[i].nodeType==1){C.push("\n"+B);}C.push(this.tidy(ar[i],B));if(B!==false&&ar[i].nodeType==3&&ar[i].nodeValue.length>0&&ar[i].nodeValue.match(/\s+$/)){C.push("\n"+B);}}return C.join('');},attr:function(A){var B=[];for(i=0;i<A.attributes.length;
-i++){if(!A.attributes.item(i).value.length){continue;}B.push(A.attributes.item(i).name+'="'+Roo.util.Format.htmlEncode(A.attributes.item(i).value)+'"');}return B.length?(' '+B.join(' ')):'';}}
+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={tidy:function(A,B){}
+}
 // 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&&e.charCode!=10){Roo.log([e.charCode,e]);return true;
 }e.preventDefault();var A=this.core.doc;var B=this.core.getSelection();var C=B.getRangeAt(0);var n=C.commonAncestorContainer;var pc=C.closest(['ol','ul']);var D=C.closest('li');if(!pc||e.ctrlKey){B.insertNode('br','after');this.core.undoManager.addEvent();
index 27f6076..5d6e7b2 100644 (file)
@@ -46331,123 +46331,14 @@ Roo.htmleditor.Tidy.toString = function(node)
 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(node, indent) {
      
-        if  (node.nodeType == 3) {
-            // text.
-            
-            
-            return indent === false ? node.nodeValue : this.wrap(node.nodeValue.trim()).split("\n").join("\n" + indent);
-                
-            
-        }
-        
-        if  (node.nodeType != 1) {
-            return '';
-        }
-        
-        
-        
-        if (node.tagName == 'BODY') {
-            
-            return this.cn(node, '');
-        }
-             
-             // Prints the node tagName, such as <A>, <IMG>, etc
-        var ret = "<" + node.tagName +  this.attr(node) ;
-        
-        // elements with no children..
-        if (['IMG', 'BR', 'HR', 'INPUT'].indexOf(node.tagName) > -1) {
-                return ret + '/>';
-        }
-        ret += '>';
-        
-        
-        var cindent = indent === false ? '' : (indent + '  ');
-        // tags where we will not pad the children.. (inline text tags etc..)
-        if (['PRE', 'TEXTAREA', 'TD', 'A', 'SPAN', 'B', 'I', 'S'].indexOf(node.tagName) > -1) { // or code?
-            cindent = false;
-            
-            
-        }
-        
-        var cn = this.cn(node, cindent );
-        
-        return ret + cn  + '</' + node.tagName + '>';
-        
-    },
-    cn: function(node, indent)
-    {
-        var ret = [];
-        
-        var ar = Array.from(node.childNodes);
-        for (var i = 0 ; i < ar.length ; i++) {
-            
-            
-            
-            if (indent !== false   // indent==false preservies everything
-                && i > 0
-                && ar[i].nodeType == 3 
-                && ar[i].nodeValue.length > 0
-                && ar[i].nodeValue.match(/^\s+/)
-            ) {
-                if (ret.length && ret[ret.length-1] == "\n" + indent) {
-                    ret.pop(); // remove line break from last?
-                }
-                
-                ret.push(" "); // add a space if i'm a text item with a space at the front, as tidy will strip spaces.
-            }
-            if (indent !== false
-                && ar[i].nodeType == 1 // element - and indent is not set... 
-            ) {
-                ret.push("\n" + indent); 
-            }
-            
-            ret.push(this.tidy(ar[i], indent));
-            // text + trailing indent 
-            if (indent !== false
-                && ar[i].nodeType == 3
-                && ar[i].nodeValue.length > 0
-                && ar[i].nodeValue.match(/\s+$/)
-            ){
-                ret.push("\n" + indent); 
-            }
-            
-            
-            
-            
-        }
-        // what if all text?
-        
-        
-        return ret.join('');
-    },
-    
          
-        
-    attr : function(node)
-    {
-        var attr = [];
-        for(i = 0; i < node.attributes.length;i++) {
-            
-            // skip empty values?
-            if (!node.attributes.item(i).value.length) {
-                continue;
-            }
-            attr.push(  node.attributes.item(i).name + '="' +
-                    Roo.util.Format.htmlEncode(node.attributes.item(i).value) + '"'
-            );
-        }
-        return attr.length ? (' ' + attr.join(' ') ) : '';
-        
-    }
-    
     
+    }
     
 }
 /**
index 6793628..6e15a5e 100644 (file)
@@ -21862,123 +21862,14 @@ Roo.htmleditor.Tidy.toString = function(node)
 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(node, indent) {
      
-        if  (node.nodeType == 3) {
-            // text.
-            
-            
-            return indent === false ? node.nodeValue : this.wrap(node.nodeValue.trim()).split("\n").join("\n" + indent);
-                
-            
-        }
-        
-        if  (node.nodeType != 1) {
-            return '';
-        }
-        
-        
-        
-        if (node.tagName == 'BODY') {
-            
-            return this.cn(node, '');
-        }
-             
-             // Prints the node tagName, such as <A>, <IMG>, etc
-        var ret = "<" + node.tagName +  this.attr(node) ;
-        
-        // elements with no children..
-        if (['IMG', 'BR', 'HR', 'INPUT'].indexOf(node.tagName) > -1) {
-                return ret + '/>';
-        }
-        ret += '>';
-        
-        
-        var cindent = indent === false ? '' : (indent + '  ');
-        // tags where we will not pad the children.. (inline text tags etc..)
-        if (['PRE', 'TEXTAREA', 'TD', 'A', 'SPAN', 'B', 'I', 'S'].indexOf(node.tagName) > -1) { // or code?
-            cindent = false;
-            
-            
-        }
-        
-        var cn = this.cn(node, cindent );
-        
-        return ret + cn  + '</' + node.tagName + '>';
-        
-    },
-    cn: function(node, indent)
-    {
-        var ret = [];
-        
-        var ar = Array.from(node.childNodes);
-        for (var i = 0 ; i < ar.length ; i++) {
-            
-            
-            
-            if (indent !== false   // indent==false preservies everything
-                && i > 0
-                && ar[i].nodeType == 3 
-                && ar[i].nodeValue.length > 0
-                && ar[i].nodeValue.match(/^\s+/)
-            ) {
-                if (ret.length && ret[ret.length-1] == "\n" + indent) {
-                    ret.pop(); // remove line break from last?
-                }
-                
-                ret.push(" "); // add a space if i'm a text item with a space at the front, as tidy will strip spaces.
-            }
-            if (indent !== false
-                && ar[i].nodeType == 1 // element - and indent is not set... 
-            ) {
-                ret.push("\n" + indent); 
-            }
-            
-            ret.push(this.tidy(ar[i], indent));
-            // text + trailing indent 
-            if (indent !== false
-                && ar[i].nodeType == 3
-                && ar[i].nodeValue.length > 0
-                && ar[i].nodeValue.match(/\s+$/)
-            ){
-                ret.push("\n" + indent); 
-            }
-            
-            
-            
-            
-        }
-        // what if all text?
-        
-        
-        return ret.join('');
-    },
-    
          
-        
-    attr : function(node)
-    {
-        var attr = [];
-        for(i = 0; i < node.attributes.length;i++) {
-            
-            // skip empty values?
-            if (!node.attributes.item(i).value.length) {
-                continue;
-            }
-            attr.push(  node.attributes.item(i).name + '="' +
-                    Roo.util.Format.htmlEncode(node.attributes.item(i).value) + '"'
-            );
-        }
-        return attr.length ? (' ' + attr.join(' ') ) : '';
-        
-    }
-    
     
+    }
     
 }
 /**
index 02acef3..3fe2708 100644 (file)
@@ -995,11 +995,8 @@ return false;}if(!ps||ps.nodeType!=1){return false;}if(!ps||ps.tagName!='BR'){re
 Roo.htmleditor.FilterBlock=function(A){Roo.apply(this,A);var qa=A.node.querySelectorAll;this.removeAttributes('data-block');this.removeAttributes('contenteditable');this.removeAttributes('id');};Roo.apply(Roo.htmleditor.FilterBlock.prototype,{node:true,removeAttributes:function(A){var ar=this.node.querySelectorAll('*['+A+']');
 for(var i=0;i<ar.length;i++){ar[i].removeAttribute(A);}}});
 // 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+'/>';
-}C+='>';var D=B===false?'':(B+'  ');if(['PRE','TEXTAREA','TD','A','SPAN','B','I','S'].indexOf(A.tagName)>-1){D=false;}var cn=this.cn(A,D);return C+cn+'</'+A.tagName+'>';},cn:function(A,B){var C=[];var ar=Array.from(A.childNodes);for(var i=0;i<ar.length;i++){if(B!==false&&i>0&&ar[i].nodeType==3&&ar[i].nodeValue.length>0&&ar[i].nodeValue.match(/^\s+/)){if(C.length&&C[C.length-1]=="\n"+B){C.pop();
-}C.push(" ");}if(B!==false&&ar[i].nodeType==1){C.push("\n"+B);}C.push(this.tidy(ar[i],B));if(B!==false&&ar[i].nodeType==3&&ar[i].nodeValue.length>0&&ar[i].nodeValue.match(/\s+$/)){C.push("\n"+B);}}return C.join('');},attr:function(A){var B=[];for(i=0;i<A.attributes.length;
-i++){if(!A.attributes.item(i).value.length){continue;}B.push(A.attributes.item(i).name+'="'+Roo.util.Format.htmlEncode(A.attributes.item(i).value)+'"');}return B.length?(' '+B.join(' ')):'';}}
+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={tidy:function(A,B){}
+}
 // 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&&e.charCode!=10){Roo.log([e.charCode,e]);return true;
 }e.preventDefault();var A=this.core.doc;var B=this.core.getSelection();var C=B.getRangeAt(0);var n=C.commonAncestorContainer;var pc=C.closest(['ol','ul']);var D=C.closest('li');if(!pc||e.ctrlKey){B.insertNode('br','after');this.core.undoManager.addEvent();