Roo/HtmlEditorCore.js
authorAlan Knowles <alan@roojs.com>
Wed, 3 Sep 2014 07:53:59 +0000 (15:53 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 3 Sep 2014 07:53:59 +0000 (15:53 +0800)
roojs-ui.js
roojs-ui-debug.js
roojs-all.js
roojs-debug.js

Roo/HtmlEditorCore.js
roojs-all.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index a51b25c..613deea 100644 (file)
@@ -1188,7 +1188,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
                 if (cls.match(/Mso[a-zA-Z]+/)) {
                     return;
                 }
-                cna.push(cn);
+                cna.push(cls);
             });
             node.className = cna.length ? cna.join(' ') : '';
             if (!cna.length) {
index 24674ef..b02feb2 100644 (file)
@@ -902,7 +902,7 @@ A.removeAttribute(n);}function cleanStyle(n,v){if(v.match(/expression/)){A.remov
 F.push(p);return true;});if(F.length){A.setAttribute(n,F.join(';'));}else {A.removeAttribute(n);}}for(var i=A.attributes.length-1;i>-1;i--){var a=A.attributes[i];if(a.name.toLowerCase().substr(0,2)=='on'){A.removeAttribute(a.name);continue;}if(Roo.HtmlEditorCore.ablack.indexOf(a.name.toLowerCase())>-1){A.removeAttribute(a.name);continue;}if(Roo.HtmlEditorCore.aclean.indexOf(a.name.toLowerCase())>-1){cleanAttr(a.name,a.value);continue;}if(a.name=='style'){cleanStyle(a.name,a.value);continue;}if(a.name=='class'){if(a.value.match(/^Mso/)){A.className='';}if(a.value.match(/body/)){A.className='';}continue;}}
 this.cleanUpChildren(A);},cleanWord:function(A){var _t=this;var B=function(){if(!A.childNodes.length){return;}for(var i=A.childNodes.length-1;i>-1;i--){_t.cleanWord(A.childNodes[i]);}};if(!A){this.cleanWord(this.doc.body);return;}if(A.nodeName=="#text"){return;}if(A.nodeName=="#comment"){A.parentNode.removeChild(A);return;}if(A.tagName.toLowerCase().match(/^(style|script|applet|embed|noframes|noscript)$/)){A.parentNode.removeChild(A);return;}if(A.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|font)/)){while(A.childNodes.length){var cn=A.childNodes[0];A.removeChild(cn);A.parentNode.insertBefore(cn,A);}
 A.parentNode.removeChild(A);B();return;}if(A.className.length){var cn=A.className.split(/\W+/);var cna=[];Roo.each(cn,function(C){if(C.match(/Mso[a-zA-Z]+/)){return;}
-cna.push(cn);});A.className=cna.length?cna.join(' '):'';if(!cna.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var styles=A.getAttribute("style").split(";");var nstyle=[];Roo.each(styles,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return;}
+cna.push(C);});A.className=cna.length?cna.join(' '):'';if(!cna.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var styles=A.getAttribute("style").split(";");var nstyle=[];Roo.each(styles,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return;}
 nstyle.push(s);});A.setAttribute("style",nstyle.length?nstyle.join(';'):'');if(!nstyle.length){A.removeAttribute('style');}}
 B();},domToHTML:function(A,B,C){B=B||0;C=C||false;if(!A){return this.domToHTML(this.doc.body);}var j;var D=false;var E=A.nodeName;var F=Roo.util.Format.htmlEncode(A.tagName);if(E=='#text'){return A.nodeValue;}var G='';if(E!='BODY'){var i=0;if(F){var H=[];for(i=0;i<A.attributes.length;i++){var I=A.attributes.item(i).name;if(!A.attributes.item(i).value.length){continue;}
 H.push(I+'="'+Roo.util.Format.htmlEncode(A.attributes.item(i).value)+'"');}
index 3c376fc..551ae7b 100644 (file)
@@ -42073,7 +42073,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
                 if (cls.match(/Mso[a-zA-Z]+/)) {
                     return;
                 }
-                cna.push(cn);
+                cna.push(cls);
             });
             node.className = cna.length ? cna.join(' ') : '';
             if (!cna.length) {
index 28ced65..483281c 100644 (file)
@@ -25755,7 +25755,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
                 if (cls.match(/Mso[a-zA-Z]+/)) {
                     return;
                 }
-                cna.push(cn);
+                cna.push(cls);
             });
             node.className = cna.length ? cna.join(' ') : '';
             if (!cna.length) {
index 1b7af2b..3d8cc03 100644 (file)
@@ -568,7 +568,7 @@ A.removeAttribute(n);}function cleanStyle(n,v){if(v.match(/expression/)){A.remov
 F.push(p);return true;});if(F.length){A.setAttribute(n,F.join(';'));}else {A.removeAttribute(n);}}for(var i=A.attributes.length-1;i>-1;i--){var a=A.attributes[i];if(a.name.toLowerCase().substr(0,2)=='on'){A.removeAttribute(a.name);continue;}if(Roo.HtmlEditorCore.ablack.indexOf(a.name.toLowerCase())>-1){A.removeAttribute(a.name);continue;}if(Roo.HtmlEditorCore.aclean.indexOf(a.name.toLowerCase())>-1){cleanAttr(a.name,a.value);continue;}if(a.name=='style'){cleanStyle(a.name,a.value);continue;}if(a.name=='class'){if(a.value.match(/^Mso/)){A.className='';}if(a.value.match(/body/)){A.className='';}continue;}}
 this.cleanUpChildren(A);},cleanWord:function(A){var _t=this;var B=function(){if(!A.childNodes.length){return;}for(var i=A.childNodes.length-1;i>-1;i--){_t.cleanWord(A.childNodes[i]);}};if(!A){this.cleanWord(this.doc.body);return;}if(A.nodeName=="#text"){return;}if(A.nodeName=="#comment"){A.parentNode.removeChild(A);return;}if(A.tagName.toLowerCase().match(/^(style|script|applet|embed|noframes|noscript)$/)){A.parentNode.removeChild(A);return;}if(A.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|font)/)){while(A.childNodes.length){var cn=A.childNodes[0];A.removeChild(cn);A.parentNode.insertBefore(cn,A);}
 A.parentNode.removeChild(A);B();return;}if(A.className.length){var cn=A.className.split(/\W+/);var cna=[];Roo.each(cn,function(C){if(C.match(/Mso[a-zA-Z]+/)){return;}
-cna.push(cn);});A.className=cna.length?cna.join(' '):'';if(!cna.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var styles=A.getAttribute("style").split(";");var nstyle=[];Roo.each(styles,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return;}
+cna.push(C);});A.className=cna.length?cna.join(' '):'';if(!cna.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var styles=A.getAttribute("style").split(";");var nstyle=[];Roo.each(styles,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return;}
 nstyle.push(s);});A.setAttribute("style",nstyle.length?nstyle.join(';'):'');if(!nstyle.length){A.removeAttribute('style');}}
 B();},domToHTML:function(A,B,C){B=B||0;C=C||false;if(!A){return this.domToHTML(this.doc.body);}var j;var D=false;var E=A.nodeName;var F=Roo.util.Format.htmlEncode(A.tagName);if(E=='#text'){return A.nodeValue;}var G='';if(E!='BODY'){var i=0;if(F){var H=[];for(i=0;i<A.attributes.length;i++){var I=A.attributes.item(i).name;if(!A.attributes.item(i).value.length){continue;}
 H.push(I+'="'+Roo.util.Format.htmlEncode(A.attributes.item(i).value)+'"');}