roojs-ui.js
authorAlan <alan@roojs.com>
Thu, 17 Mar 2022 08:54:13 +0000 (16:54 +0800)
committerAlan <alan@roojs.com>
Thu, 17 Mar 2022 08:54:13 +0000 (16:54 +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 abbc46f..8eca39c 100644 (file)
@@ -1924,12 +1924,14 @@ Roo.htmleditor.FilterTableWidth=function(A){this.tag=['TABLE','TD','TR','TH','TH
 }if(A.hasAttribute("style")){var B=A.getAttribute("style").split(";");var C=[];Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^\s*(width|min-width)\s*$/)){return;}C.push(s);});A.setAttribute("style",C.length?C.join(';'):'');
 if(!C.length){A.removeAttribute('style');}}return true;}});
 // Roo/htmleditor/FilterWord.js
-Roo.htmleditor.FilterWord=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterWord,Roo.htmleditor.Filter,{tag:true,replaceTag:function(A){if(A.nodeName=='SPAN'&&!A.hasAttributes()&&A.childNodes.length==1&&A.firstChild.nodeName=="#text"){var B=A.firstChild;
+Roo.htmleditor.FilterWord=function(A){this.replaceDocBullets(A.node);this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterWord,Roo.htmleditor.Filter,{tag:true,replaceTag:function(A){if(A.nodeName=='SPAN'&&!A.hasAttributes()&&A.childNodes.length==1&&A.firstChild.nodeName=="#text"){var B=A.firstChild;
 A.removeChild(B);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);}A.parentNode.insertBefore(B,A);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);}A.parentNode.removeChild(A);
 return false;}if(A.tagName.toLowerCase().match(/^(style|script|applet|embed|noframes|noscript)$/)){A.parentNode.removeChild(A);return false;}if(A.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|v:|font)/)){while(A.childNodes.length){var cn=A.childNodes[0];
 A.removeChild(cn);A.parentNode.insertBefore(cn,A);this.replaceTag(cn);}A.parentNode.removeChild(A);return false;}if(A.className.length){var cn=A.className.split(/\W+/);var C=[];Roo.each(cn,function(F){if(F.match(/Mso[a-zA-Z]+/)){return;}C.push(F);});A.className=C.length?C.join(' '):'';
 if(!C.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var D=A.getAttribute("style").split(";");var E=[];Roo.each(D,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return;
-}E.push(s);});A.setAttribute("style",E.length?E.join(';'):'');if(!E.length){A.removeAttribute('style');}}return true;}});
+}E.push(s);});A.setAttribute("style",E.length?E.join(';'):'');if(!E.length){A.removeAttribute('style');}}return true;},styleToObject:function(A){var B=A.getAttribute("style").split(";");var C={};Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");
+C[kv[0]]=kv[1];});return C;}replaceDocBullets:function(doc){var listpara=doc.getElementsByClassName('MsoListParagraph');while(listpara.length){this.replaceDocBullet(listpara.item(0));}},replaceDocBullet:function(p){var ns=p,A=p.parentNode,B=[];while(ns){if(!ns.className.match(/MsoListParagraph/)){break;
+}B.push(ns);ns=ns.nextSibling;}var ul=A.ownerDocument.createElement('ul');B.forEach(function(n){A.removeChild(n);var C=n.getElementsByTagName('span');n.removeChild(C.item(0));});}});
 // Roo/htmleditor/FilterStyleToTag.js
 Roo.htmleditor.FilterStyleToTag=function(A){this.tags={B:['fontWeight','bold'],I:['fontStyle','italic'],SUP:['verticalAlign','super'],SUB:['verticalAlign','sub']};Roo.apply(this,A);this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterStyleToTag,Roo.htmleditor.Filter,{tag:true,tags:false,replaceTag:function(A){if(A.getAttribute("style")===null){return true;
 }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);
index 98ab829..9eb90a1 100644 (file)
@@ -26458,7 +26458,11 @@ Roo.extend(Roo.htmleditor.FilterTableWidth, Roo.htmleditor.Filter,
 Roo.htmleditor.FilterWord = function(cfg)
 {
     // no need to apply config.
+    this.replaceDocBullets(cfg.node);
+    
     this.walk(cfg.node);
+    
+    
 }
 
 Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
@@ -26560,7 +26564,64 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
         
         
         
+    },
+    
+    styleToObject: function(node)
+    {
+        var styles = node.getAttribute("style").split(";");
+        var ret = {};
+        Roo.each(styles, function(s) {
+            if (!s.match(/:/)) {
+                return;
+            }
+            var kv = s.split(":");
+             
+            // what ever is left... we allow.
+            ret[kv[0]] = kv[1];
+        });
+        return ret;
     }
+    
+    
+    replaceDocBullets : function(doc)
+    {
+        var listpara = doc.getElementsByClassName('MsoListParagraph');
+        while(listpara.length) {
+            this.replaceDocBullet(listpara.item(0));
+            //code
+        }
+    },
+    
+    replaceDocBullet : function(p)
+    {
+        // gather all the siblings.
+        var ns = p,
+            parent = p.parentNode,
+            items = []; 
+        while (ns) {
+            if (!ns.className.match(/MsoListParagraph/)) {
+                break;
+            }
+            items.push(ns);
+            ns = ns.nextSibling;
+            
+        }
+        var ul = parent.ownerDocument.createElement('ul'); // what about number lists...
+        
+        items.forEach(function(n) {
+            parent.removeChild(n);
+            var spans = n.getElementsByTagName('span');
+            n.removeChild(spans.item(0)); // remove the fake bullet.
+            
+        });
+        
+        
+        
+        
+    }
+    
+    
+    
 });
 /**
  * @class Roo.htmleditor.FilterStyleToTag
index 2306504..03397f1 100644 (file)
@@ -1143,12 +1143,14 @@ Roo.htmleditor.FilterTableWidth=function(A){this.tag=['TABLE','TD','TR','TH','TH
 }if(A.hasAttribute("style")){var B=A.getAttribute("style").split(";");var C=[];Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^\s*(width|min-width)\s*$/)){return;}C.push(s);});A.setAttribute("style",C.length?C.join(';'):'');
 if(!C.length){A.removeAttribute('style');}}return true;}});
 // Roo/htmleditor/FilterWord.js
-Roo.htmleditor.FilterWord=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterWord,Roo.htmleditor.Filter,{tag:true,replaceTag:function(A){if(A.nodeName=='SPAN'&&!A.hasAttributes()&&A.childNodes.length==1&&A.firstChild.nodeName=="#text"){var B=A.firstChild;
+Roo.htmleditor.FilterWord=function(A){this.replaceDocBullets(A.node);this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterWord,Roo.htmleditor.Filter,{tag:true,replaceTag:function(A){if(A.nodeName=='SPAN'&&!A.hasAttributes()&&A.childNodes.length==1&&A.firstChild.nodeName=="#text"){var B=A.firstChild;
 A.removeChild(B);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);}A.parentNode.insertBefore(B,A);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);}A.parentNode.removeChild(A);
 return false;}if(A.tagName.toLowerCase().match(/^(style|script|applet|embed|noframes|noscript)$/)){A.parentNode.removeChild(A);return false;}if(A.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|v:|font)/)){while(A.childNodes.length){var cn=A.childNodes[0];
 A.removeChild(cn);A.parentNode.insertBefore(cn,A);this.replaceTag(cn);}A.parentNode.removeChild(A);return false;}if(A.className.length){var cn=A.className.split(/\W+/);var C=[];Roo.each(cn,function(F){if(F.match(/Mso[a-zA-Z]+/)){return;}C.push(F);});A.className=C.length?C.join(' '):'';
 if(!C.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var D=A.getAttribute("style").split(";");var E=[];Roo.each(D,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return;
-}E.push(s);});A.setAttribute("style",E.length?E.join(';'):'');if(!E.length){A.removeAttribute('style');}}return true;}});
+}E.push(s);});A.setAttribute("style",E.length?E.join(';'):'');if(!E.length){A.removeAttribute('style');}}return true;},styleToObject:function(A){var B=A.getAttribute("style").split(";");var C={};Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");
+C[kv[0]]=kv[1];});return C;}replaceDocBullets:function(doc){var listpara=doc.getElementsByClassName('MsoListParagraph');while(listpara.length){this.replaceDocBullet(listpara.item(0));}},replaceDocBullet:function(p){var ns=p,A=p.parentNode,B=[];while(ns){if(!ns.className.match(/MsoListParagraph/)){break;
+}B.push(ns);ns=ns.nextSibling;}var ul=A.ownerDocument.createElement('ul');B.forEach(function(n){A.removeChild(n);var C=n.getElementsByTagName('span');n.removeChild(C.item(0));});}});
 // Roo/htmleditor/FilterStyleToTag.js
 Roo.htmleditor.FilterStyleToTag=function(A){this.tags={B:['fontWeight','bold'],I:['fontStyle','italic'],SUP:['verticalAlign','super'],SUB:['verticalAlign','sub']};Roo.apply(this,A);this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterStyleToTag,Roo.htmleditor.Filter,{tag:true,tags:false,replaceTag:function(A){if(A.getAttribute("style")===null){return true;
 }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);
index 1c84d11..5154c8b 100644 (file)
@@ -46071,7 +46071,11 @@ Roo.extend(Roo.htmleditor.FilterTableWidth, Roo.htmleditor.Filter,
 Roo.htmleditor.FilterWord = function(cfg)
 {
     // no need to apply config.
+    this.replaceDocBullets(cfg.node);
+    
     this.walk(cfg.node);
+    
+    
 }
 
 Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
@@ -46173,7 +46177,64 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
         
         
         
+    },
+    
+    styleToObject: function(node)
+    {
+        var styles = node.getAttribute("style").split(";");
+        var ret = {};
+        Roo.each(styles, function(s) {
+            if (!s.match(/:/)) {
+                return;
+            }
+            var kv = s.split(":");
+             
+            // what ever is left... we allow.
+            ret[kv[0]] = kv[1];
+        });
+        return ret;
     }
+    
+    
+    replaceDocBullets : function(doc)
+    {
+        var listpara = doc.getElementsByClassName('MsoListParagraph');
+        while(listpara.length) {
+            this.replaceDocBullet(listpara.item(0));
+            //code
+        }
+    },
+    
+    replaceDocBullet : function(p)
+    {
+        // gather all the siblings.
+        var ns = p,
+            parent = p.parentNode,
+            items = []; 
+        while (ns) {
+            if (!ns.className.match(/MsoListParagraph/)) {
+                break;
+            }
+            items.push(ns);
+            ns = ns.nextSibling;
+            
+        }
+        var ul = parent.ownerDocument.createElement('ul'); // what about number lists...
+        
+        items.forEach(function(n) {
+            parent.removeChild(n);
+            var spans = n.getElementsByTagName('span');
+            n.removeChild(spans.item(0)); // remove the fake bullet.
+            
+        });
+        
+        
+        
+        
+    }
+    
+    
+    
 });
 /**
  * @class Roo.htmleditor.FilterStyleToTag
index fdf8b12..5e6ab22 100644 (file)
@@ -21579,7 +21579,11 @@ Roo.extend(Roo.htmleditor.FilterTableWidth, Roo.htmleditor.Filter,
 Roo.htmleditor.FilterWord = function(cfg)
 {
     // no need to apply config.
+    this.replaceDocBullets(cfg.node);
+    
     this.walk(cfg.node);
+    
+    
 }
 
 Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
@@ -21681,7 +21685,64 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
         
         
         
+    },
+    
+    styleToObject: function(node)
+    {
+        var styles = node.getAttribute("style").split(";");
+        var ret = {};
+        Roo.each(styles, function(s) {
+            if (!s.match(/:/)) {
+                return;
+            }
+            var kv = s.split(":");
+             
+            // what ever is left... we allow.
+            ret[kv[0]] = kv[1];
+        });
+        return ret;
     }
+    
+    
+    replaceDocBullets : function(doc)
+    {
+        var listpara = doc.getElementsByClassName('MsoListParagraph');
+        while(listpara.length) {
+            this.replaceDocBullet(listpara.item(0));
+            //code
+        }
+    },
+    
+    replaceDocBullet : function(p)
+    {
+        // gather all the siblings.
+        var ns = p,
+            parent = p.parentNode,
+            items = []; 
+        while (ns) {
+            if (!ns.className.match(/MsoListParagraph/)) {
+                break;
+            }
+            items.push(ns);
+            ns = ns.nextSibling;
+            
+        }
+        var ul = parent.ownerDocument.createElement('ul'); // what about number lists...
+        
+        items.forEach(function(n) {
+            parent.removeChild(n);
+            var spans = n.getElementsByTagName('span');
+            n.removeChild(spans.item(0)); // remove the fake bullet.
+            
+        });
+        
+        
+        
+        
+    }
+    
+    
+    
 });
 /**
  * @class Roo.htmleditor.FilterStyleToTag
index 6511386..4466af6 100644 (file)
@@ -978,12 +978,14 @@ Roo.htmleditor.FilterTableWidth=function(A){this.tag=['TABLE','TD','TR','TH','TH
 }if(A.hasAttribute("style")){var B=A.getAttribute("style").split(";");var C=[];Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^\s*(width|min-width)\s*$/)){return;}C.push(s);});A.setAttribute("style",C.length?C.join(';'):'');
 if(!C.length){A.removeAttribute('style');}}return true;}});
 // Roo/htmleditor/FilterWord.js
-Roo.htmleditor.FilterWord=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterWord,Roo.htmleditor.Filter,{tag:true,replaceTag:function(A){if(A.nodeName=='SPAN'&&!A.hasAttributes()&&A.childNodes.length==1&&A.firstChild.nodeName=="#text"){var B=A.firstChild;
+Roo.htmleditor.FilterWord=function(A){this.replaceDocBullets(A.node);this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterWord,Roo.htmleditor.Filter,{tag:true,replaceTag:function(A){if(A.nodeName=='SPAN'&&!A.hasAttributes()&&A.childNodes.length==1&&A.firstChild.nodeName=="#text"){var B=A.firstChild;
 A.removeChild(B);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);}A.parentNode.insertBefore(B,A);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);}A.parentNode.removeChild(A);
 return false;}if(A.tagName.toLowerCase().match(/^(style|script|applet|embed|noframes|noscript)$/)){A.parentNode.removeChild(A);return false;}if(A.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|v:|font)/)){while(A.childNodes.length){var cn=A.childNodes[0];
 A.removeChild(cn);A.parentNode.insertBefore(cn,A);this.replaceTag(cn);}A.parentNode.removeChild(A);return false;}if(A.className.length){var cn=A.className.split(/\W+/);var C=[];Roo.each(cn,function(F){if(F.match(/Mso[a-zA-Z]+/)){return;}C.push(F);});A.className=C.length?C.join(' '):'';
 if(!C.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var D=A.getAttribute("style").split(";");var E=[];Roo.each(D,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return;
-}E.push(s);});A.setAttribute("style",E.length?E.join(';'):'');if(!E.length){A.removeAttribute('style');}}return true;}});
+}E.push(s);});A.setAttribute("style",E.length?E.join(';'):'');if(!E.length){A.removeAttribute('style');}}return true;},styleToObject:function(A){var B=A.getAttribute("style").split(";");var C={};Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");
+C[kv[0]]=kv[1];});return C;}replaceDocBullets:function(doc){var listpara=doc.getElementsByClassName('MsoListParagraph');while(listpara.length){this.replaceDocBullet(listpara.item(0));}},replaceDocBullet:function(p){var ns=p,A=p.parentNode,B=[];while(ns){if(!ns.className.match(/MsoListParagraph/)){break;
+}B.push(ns);ns=ns.nextSibling;}var ul=A.ownerDocument.createElement('ul');B.forEach(function(n){A.removeChild(n);var C=n.getElementsByTagName('span');n.removeChild(C.item(0));});}});
 // Roo/htmleditor/FilterStyleToTag.js
 Roo.htmleditor.FilterStyleToTag=function(A){this.tags={B:['fontWeight','bold'],I:['fontStyle','italic'],SUP:['verticalAlign','super'],SUB:['verticalAlign','sub']};Roo.apply(this,A);this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterStyleToTag,Roo.htmleditor.Filter,{tag:true,tags:false,replaceTag:function(A){if(A.getAttribute("style")===null){return true;
 }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);