roojs-core.js
authorAlan <alan@roojs.com>
Wed, 24 Nov 2021 04:20:35 +0000 (12:20 +0800)
committerAlan <alan@roojs.com>
Wed, 24 Nov 2021 04:20:35 +0000 (12:20 +0800)
roojs-core-debug.js
roojs-ui.js
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-core-debug.js
roojs-core.js
roojs-debug.js

index 0e0086e..888e475 100644 (file)
@@ -221,19 +221,19 @@ var cn=o.children||o.cn;if(cn){if((cn instanceof Array)||(Roo.isSafari&&typeof(c
 var i=-1,el=A;while(++i<N&&el.firstChild){el=el.firstChild;}return el;};var ts='<table>',te='</table>',H=ts+'<tbody>',I='</tbody>'+te,J=H+'<tr>',K='</tr>'+I;var L=function(N,O,el,P){if(!A){A=document.createElement('div');}var Q;var R=null;if(N=='td'){if(O=='afterbegin'||O=='beforeend'){return;
 }if(O=='beforebegin'){R=el;el=el.parentNode;}else{R=el.nextSibling;el=el.parentNode;}Q=G(4,J,P,K);}else if(N=='tr'){if(O=='beforebegin'){R=el;el=el.parentNode;Q=G(3,H,P,I);}else if(O=='afterend'){R=el.nextSibling;el=el.parentNode;Q=G(3,H,P,I);}else{if(O=='afterbegin'){R=el.firstChild;
 }Q=G(4,J,P,K);}}else if(N=='tbody'){if(O=='beforebegin'){R=el;el=el.parentNode;Q=G(2,ts,P,te);}else if(O=='afterend'){R=el.nextSibling;el=el.parentNode;Q=G(2,ts,P,te);}else{if(O=='afterbegin'){R=el.firstChild;}Q=G(3,H,P,I);}}else{if(O=='beforebegin'||O=='afterend'){return;
-}if(O=='afterbegin'){R=el.firstChild;}Q=G(2,ts,P,te);}el.insertBefore(Q,R);return Q;};var M=function(N,to){if(N.nodeType!=to.nodeType){N.parentNode.replaceChild(to,N);}if(N.nodeType==3){if(N.data==to.data){return;}N.data=to.data;return;}if(N.nodeType!=1||N.tagName!=to.tagName){N.parentNode.replaceChild(to,N);
-return;}var ar=Array.from(N.attributes);for(var i=0;i<ar.length;i++){if(to.hasAttribute(ar[i].name)){continue;}N.removeAttribute(ar[i].name);}ar=to.attributes;for(var i=0;i<ar.length;i++){if(N.getAttribute(ar[i].name)==to.getAttribute(ar[i].name)){continue;
-}N.setAttribute(ar[i].name,to.getAttribute(ar[i].name));}var O=Array.from(N.childNodes);var P=Array.from(to.childNodes);if(N.innerHTML==to.innerHTML){return;}if(O.length!=P.length){N.innerHTML=to.innerHTML;return;}for(var i=0;i<O.length;i++){M(O[i],P[i]);
-}};return {useDom:false,markup:function(o){return E(o);},applyStyles:function(el,N){if(N){el=Roo.fly(el);if(typeof N=="string"){var re=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var O;while((O=re.exec(N))!=null){el.setStyle(O[1],O[2]);}}else if(typeof N=="object"){for(var P in N){el.setStyle(P,N[P]);
-}}else if(typeof N=="function"){Roo.DomHelper.applyStyles(el,N.call());}}},insertHtml:function(N,el,O){N=N.toLowerCase();if(el.insertAdjacentHTML){if(C.test(el.tagName)){var rs;if(rs=L(el.tagName.toLowerCase(),N,el,O)){return rs;}}switch(N){case "beforebegin":el.insertAdjacentHTML('BeforeBegin',O);
-return el.previousSibling;case "afterbegin":el.insertAdjacentHTML('AfterBegin',O);return el.firstChild;case "beforeend":el.insertAdjacentHTML('BeforeEnd',O);return el.lastChild;case "afterend":el.insertAdjacentHTML('AfterEnd',O);return el.nextSibling;}throw 'Illegal insertion point -> "'+N+'"';
-}var P=el.ownerDocument.createRange();var Q;switch(N){case "beforebegin":P.setStartBefore(el);Q=P.createContextualFragment(O);el.parentNode.insertBefore(Q,el);return el.previousSibling;case "afterbegin":if(el.firstChild){P.setStartBefore(el.firstChild);Q=P.createContextualFragment(O);
-el.insertBefore(Q,el.firstChild);return el.firstChild;}else{el.innerHTML=O;return el.firstChild;}case "beforeend":if(el.lastChild){P.setStartAfter(el.lastChild);Q=P.createContextualFragment(O);el.appendChild(Q);return el.lastChild;}else{el.innerHTML=O;return el.lastChild;
-}case "afterend":P.setStartAfter(el);Q=P.createContextualFragment(O);el.parentNode.insertBefore(Q,el.nextSibling);return el.nextSibling;}throw 'Illegal insertion point -> "'+N+'"';},insertBefore:function(el,o,N){return this.doInsert(el,o,N,"beforeBegin");
-},insertAfter:function(el,o,N){return this.doInsert(el,o,N,"afterEnd","nextSibling");},insertFirst:function(el,o,N){return this.doInsert(el,o,N,"afterBegin");},doInsert:function(el,o,N,O,P){el=Roo.getDom(el);var Q;if(this.useDom||o.ns){Q=F(o,null);el.parentNode.insertBefore(Q,P?el[P]:el);
-}else{var R=E(o);Q=this.insertHtml(O,el,R);}return N?Roo.get(Q,true):Q;},append:function(el,o,N){el=Roo.getDom(el);var O;if(this.useDom||o.ns){O=F(o,null);el.appendChild(O);}else{var P=E(o);O=this.insertHtml("beforeEnd",el,P);}return N?Roo.get(O,true):O;}
-,overwrite:function(el,o,N){el=Roo.getDom(el);if(o.ns){while(el.childNodes.length){el.removeChild(el.firstChild);}F(o,el);}else{el.innerHTML=E(o);}return N?Roo.get(el.firstChild,true):el.firstChild;},createTemplate:function(o){var N=E(o);return new Roo.Template(N);
-},update:function(el,o){M(Roo.getDom(el),F(o));}};}();
+}if(O=='afterbegin'){R=el.firstChild;}Q=G(2,ts,P,te);}el.insertBefore(Q,R);return Q;};var M=function(N,to){Roo.log(["UpdateNode",N,to]);if(N.nodeType!=to.nodeType){Roo.log(["ReplaceChild - mismatch notType",to,N]);N.parentNode.replaceChild(to,N);}if(N.nodeType==3){if(N.data==to.data){return;
+}N.data=to.data;return;}if(N.nodeType!=1||N.tagName!=to.tagName){Roo.log(["ReplaceChild",N,to]);N.parentNode.replaceChild(to,N);return;}var ar=Array.from(N.attributes);for(var i=0;i<ar.length;i++){if(to.hasAttribute(ar[i].name)){continue;}if(ar[i].name=='id'){continue;
+}N.removeAttribute(ar[i].name);}ar=to.attributes;for(var i=0;i<ar.length;i++){if(N.getAttribute(ar[i].name)==to.getAttribute(ar[i].name)){continue;}N.setAttribute(ar[i].name,to.getAttribute(ar[i].name));}var O=Array.from(N.childNodes);var P=Array.from(to.childNodes);
+for(var i=0;i<Math.max(P.length,O.length);i++){if(i>=O.length){N.appendChild(P[i]);Roo.log(["add",P[i]]);}else if(i>=P.length){N.removeChild(O[i]);Roo.log(["remove",O[i]]);}else{M(O[i],P[i]);}}};return {useDom:false,markup:function(o){return E(o);},applyStyles:function(el,N){if(N){el=Roo.fly(el);
+if(typeof N=="string"){var re=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var O;while((O=re.exec(N))!=null){el.setStyle(O[1],O[2]);}}else if(typeof N=="object"){for(var P in N){el.setStyle(P,N[P]);}}else if(typeof N=="function"){Roo.DomHelper.applyStyles(el,N.call());
+}}},insertHtml:function(N,el,O){N=N.toLowerCase();if(el.insertAdjacentHTML){if(C.test(el.tagName)){var rs;if(rs=L(el.tagName.toLowerCase(),N,el,O)){return rs;}}switch(N){case "beforebegin":el.insertAdjacentHTML('BeforeBegin',O);return el.previousSibling;case "afterbegin":el.insertAdjacentHTML('AfterBegin',O);
+return el.firstChild;case "beforeend":el.insertAdjacentHTML('BeforeEnd',O);return el.lastChild;case "afterend":el.insertAdjacentHTML('AfterEnd',O);return el.nextSibling;}throw 'Illegal insertion point -> "'+N+'"';}var P=el.ownerDocument.createRange();var Q;
+switch(N){case "beforebegin":P.setStartBefore(el);Q=P.createContextualFragment(O);el.parentNode.insertBefore(Q,el);return el.previousSibling;case "afterbegin":if(el.firstChild){P.setStartBefore(el.firstChild);Q=P.createContextualFragment(O);el.insertBefore(Q,el.firstChild);
+return el.firstChild;}else{el.innerHTML=O;return el.firstChild;}case "beforeend":if(el.lastChild){P.setStartAfter(el.lastChild);Q=P.createContextualFragment(O);el.appendChild(Q);return el.lastChild;}else{el.innerHTML=O;return el.lastChild;}case "afterend":P.setStartAfter(el);
+Q=P.createContextualFragment(O);el.parentNode.insertBefore(Q,el.nextSibling);return el.nextSibling;}throw 'Illegal insertion point -> "'+N+'"';},insertBefore:function(el,o,N){return this.doInsert(el,o,N,"beforeBegin");},insertAfter:function(el,o,N){return this.doInsert(el,o,N,"afterEnd","nextSibling");
+},insertFirst:function(el,o,N){return this.doInsert(el,o,N,"afterBegin");},doInsert:function(el,o,N,O,P){el=Roo.getDom(el);var Q;if(this.useDom||o.ns){Q=F(o,null);el.parentNode.insertBefore(Q,P?el[P]:el);}else{var R=E(o);Q=this.insertHtml(O,el,R);}return N?Roo.get(Q,true):Q;
+},append:function(el,o,N){el=Roo.getDom(el);var O;if(this.useDom||o.ns){O=F(o,null);el.appendChild(O);}else{var P=E(o);O=this.insertHtml("beforeEnd",el,P);}return N?Roo.get(O,true):O;},overwrite:function(el,o,N){el=Roo.getDom(el);if(o.ns){while(el.childNodes.length){el.removeChild(el.firstChild);
+}F(o,el);}else{el.innerHTML=E(o);}return N?Roo.get(el.firstChild,true):el.firstChild;},createTemplate:function(o){var N=E(o);return new Roo.Template(N);},update:function(el,o){M(Roo.getDom(el),F(o));}};}();
 // Roo/Template.js
 Roo.Template=function(A){if(A instanceof Array){A=A.join("");}else if(arguments.length>1){A=Array.prototype.join.call(arguments,"");}if(typeof(A)=='object'){Roo.apply(this,A)}else{this.html=A;}if(this.url){this.load();}};Roo.Template.prototype={onLoad:false,url:false,html:'',compiled:false,loaded:false,applyTemplate:function(A){try{if(this.compiled){return this.compiled(A);
 }var B=this.disableFormats!==true;var fm=Roo.util.Format,C=this;var fn=function(m,D,E,F){if(E&&B){if(E.substr(0,5)=="this."){return C.call(E.substr(5),A[D],A);}else{if(F){var re=/^\s*['"](.*)["']\s*$/;F=F.split(',');for(var i=0,G=F.length;i<G;i++){F[i]=F[i].replace(re,"$1");
index 355d87b..41bde2c 100644 (file)
@@ -1,4 +1,4 @@
-/**
+Roo.bootstrap = {};/**
  * set the version of bootstrap based on the stylesheet...
  *
  */
@@ -26813,6 +26813,7 @@ Roo.htmleditor.Block.factory = function(node)
     
     var id = Roo.get(node).id;
     if (typeof(Roo.htmleditor.Block.cache[id]) != 'undefined') {
+        Roo.htmleditor.Block.cache[id].readElement();
         return Roo.htmleditor.Block.cache[id];
     }
     
@@ -26830,6 +26831,8 @@ Roo.htmleditor.Block.cache = {};
 
 Roo.htmleditor.Block.prototype = {
     
+    node : false,
+    
      // used by context menu
     friendly_name : 'Image with caption',
     
@@ -26840,7 +26843,7 @@ Roo.htmleditor.Block.prototype = {
      */
     updateElement : function(node)
     {
-        Roo.DomHelper.update(node, this.toObject());
+        Roo.DomHelper.update(node === undefined ? this.node : node, this.toObject());
     },
      /**
      * convert to plain HTML for calling insertAtCursor..
@@ -27369,9 +27372,10 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
             // the blocks are synced occasionaly - since we currently dont add listeners on the blocks
             // this has to update attributes that get duped.. like alt and caption..
             
-            Roo.each(Roo.get(this.doc.body).query('*[data-block]'), function(e) {
-                 Roo.htmleditor.Block.factory(e);
-            },this);
+            
+            //Roo.each(Roo.get(this.doc.body).query('*[data-block]'), function(e) {
+            //     Roo.htmleditor.Block.factory(e);
+            //},this);
             
             
             var div = document.createElement('div');
@@ -27379,7 +27383,6 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
             // remove content editable. (blocks)
             
            
-            
             new Roo.htmleditor.FilterAttributes({node : div, attrib_black: [ 'contenteditable' ] });
             //?? tidy?
             var html = div.innerHTML;
@@ -29983,7 +29986,7 @@ Roo.extend(Roo.bootstrap.Graph, Roo.bootstrap.Component,  {
 });
 
  
-/*
+Roo.bootstrap.dash = {};/*
  * - LGPL
  *
  * numberBox
index 482e28a..47a7554 100644 (file)
@@ -1,3 +1,5 @@
+// Roo/bootstrap/namespace.js
+Roo.bootstrap={};
 // Roo/bootstrap/version.js
 Roo.bootstrap.version=(function(){var A=3;Roo.each(document.styleSheets,function(s){if(s.href&&s.href.match(/css-bootstrap4/)){A=4;}});if(A>3){Roo.Element.prototype.visibilityMode=Roo.Element.DISPLAY;}return A;})();
 // Roo/bootstrap/menu/namespace.js
@@ -1162,8 +1164,8 @@ n.appendChild(li);}if(n&&n.tagName=='LI'){li=A.createElement('LI');if(n.nextSibl
 E.removeAllRanges();E.addRange(D);return false;}C=A.createElement('br');B.appendChild(C);D.deleteContents();D.insertNode(B);D=A.createRange();D.setStartAfter(C);D.collapse(true);var E=this.core.win.getSelection();E.removeAllRanges();E.addRange(D);return false;
 }};
 // Roo/htmleditor/Block.js
-Roo.htmleditor.Block=function(A){};Roo.htmleditor.Block.factory=function(A){var id=Roo.get(A).id;if(typeof(Roo.htmleditor.Block.cache[id])!='undefined'){return Roo.htmleditor.Block.cache[id];}var B=Roo.htmleditor['Block'+Roo.get(A).attr('data-block')];if(typeof(B)=='undefined'){Roo.log("OOps missing block : "+'Block'+Roo.get(A).attr('data-block'));
-return false;}Roo.htmleditor.Block.cache[id]=new B({node:A});return Roo.htmleditor.Block.cache[id];};Roo.htmleditor.Block.cache={};Roo.htmleditor.Block.prototype={friendly_name:'Image with caption',context:false,updateElement:function(A){Roo.DomHelper.update(A,this.toObject());
+Roo.htmleditor.Block=function(A){};Roo.htmleditor.Block.factory=function(A){var id=Roo.get(A).id;if(typeof(Roo.htmleditor.Block.cache[id])!='undefined'){Roo.htmleditor.Block.cache[id].readElement();return Roo.htmleditor.Block.cache[id];}var B=Roo.htmleditor['Block'+Roo.get(A).attr('data-block')];
+if(typeof(B)=='undefined'){Roo.log("OOps missing block : "+'Block'+Roo.get(A).attr('data-block'));return false;}Roo.htmleditor.Block.cache[id]=new B({node:A});return Roo.htmleditor.Block.cache[id];};Roo.htmleditor.Block.cache={};Roo.htmleditor.Block.prototype={node:false,friendly_name:'Image with caption',context:false,updateElement:function(A){Roo.DomHelper.update(A===undefined?this.node:A,this.toObject());
 },toHTML:function(){return Roo.DomHelper.markup(this.toObject());},getVal:function(A,B,C,D){var n=A;if(B!==true&&n.tagName!=B.toUpperCase()){n=A.getElementsByTagName(B).item(0);}if(C=='html'){return n.innerHTML;}if(C=='style'){return Roo.get(n).getStyle(D);
 }return Roo.get(n).attr(C);},toObject:function(){return {};},readElement:function(A){}};
 // Roo/htmleditor/BlockFigure.js
@@ -1183,17 +1185,17 @@ this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var C={run:
 }},interval:10,duration:10000,scope:this};Roo.TaskMgr.start(C);},onResize:function(w,h){Roo.log('resize: '+w+','+h);if(!this.iframe){return;}if(typeof w=='number'){this.iframe.style.width=w+'px';}if(typeof h=='number'){this.iframe.style.height=h+'px';if(this.doc){(this.doc.body||this.doc.documentElement).style.height=(h-(this.iframePad*2))+'px';
 }}},toggleSourceEdit:function(A){this.sourceEditMode=A===true;if(this.sourceEditMode){Roo.get(this.iframe).addClass(['x-hidden','hide','d-none']);}else{Roo.get(this.iframe).removeClass(['x-hidden','hide','d-none']);this.deferFocus();}},cleanHtml:function(A){A=String(A);
 if(A.length>5){if(Roo.isSafari){A=A.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,'');}}if(A=='&nbsp;'){A='';}return A;},syncValue:function(){Roo.log("HtmlEditorCore:syncValue (EDITOR->TEXT)");if(this.initialized){var bd=(this.doc.body||this.doc.documentElement);
-Roo.each(Roo.get(this.doc.body).query('*[data-block]'),function(e){Roo.htmleditor.Block.factory(e);},this);var A=document.createElement('div');A.innerHTML=bd.innerHTML;new Roo.htmleditor.FilterAttributes({node:A,attrib_black:['contenteditable']});var B=A.innerHTML;
-if(Roo.isSafari){var bs=bd.getAttribute('style');var m=bs?bs.match(/text-align:(.*?);/i):false;if(m&&m[1]){B='<div style="'+m[0]+'">'+B+'</div>';}}B=this.cleanHtml(B);B=B.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\u0080-\uFFFF]/g,function(C){var cc=C.charCodeAt();
-if(C.length==2){var D=C.charCodeAt(0)-0xD800;var E=C.charCodeAt(1)-0xDC00;cc=(D*0x400)+E+0x10000;}else if((cc>=0x4E00&&cc<0xA000)||(cc>=0x3400&&cc<0x4E00)||(cc>=0xf900&&cc<0xfb00)){return C;}return "&#"+cc+";";});if(this.owner.fireEvent('beforesync',this,B)!==false){this.el.dom.value=B;
-this.owner.fireEvent('sync',this,B);}}},pushValue:function(){Roo.log("HtmlEditorCore:pushValue (TEXT->EDITOR)");if(this.initialized){var v=this.el.dom.value.trim();if(this.owner.fireEvent('beforepush',this,v)!==false){var d=(this.doc.body||this.doc.documentElement);
-d.innerHTML=v;this.el.dom.value=d.innerHTML;this.owner.fireEvent('push',this,v);}Roo.each(Roo.get(this.doc.body).query('*[data-block]'),function(e){Roo.htmleditor.Block.factory(e);},this);var lc=this.doc.body.lastChild;if(lc&&lc.nodeType==1&&lc.getAttribute("contenteditable")=="false"){this.doc.body.appendChild(this.doc.createElement('br'));
-}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus();}else{this.el.focus();}},assignDocWin:function(){var A=this.iframe;if(Roo.isIE){this.doc=A.contentWindow.document;this.win=A.contentWindow;
-}else{if(!Roo.get(this.frameId)&&!A.contentDocument){return;}this.doc=(A.contentDocument||Roo.get(this.frameId).dom.document);this.win=(A.contentWindow||Roo.get(this.frameId).dom.contentWindow);}},initEditor:function(){this.assignDocWin();this.doc.designMode="on";
-this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A=(this.doc.body||this.doc.documentElement);A.bgProperties='fixed';Roo.EventManager.on(this.doc,{'mouseup':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this}
-);Roo.EventManager.on(this.doc,{'paste':this.onPasteEvent,scope:this});if(Roo.isGecko){Roo.EventManager.on(this.doc,'keypress',this.mozKeyPress,this);}if(Roo.isIE||Roo.isSafari||Roo.isOpera){Roo.EventManager.on(this.doc,'keydown',this.fixKeys,this);}this.initialized=true;
-new Roo.htmleditor.KeyEnter({core:this});this.owner.fireEvent('initialize',this);this.pushValue();},onPasteEvent:function(e,v){var cd=(e.browserEvent.clipboardData||window.clipboardData);if(cd.files.length>0){var A=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);
-var B=A.createObjectURL(cd.files[0]);this.insertAtCursor('<img src=" + url + ">');return false;}var C=cd.getData('text/html');var D=new Roo.rtf.Parser(cd.getData('text/rtf'));var E=D.doc.getElementsByType('pict');Roo.log(E);E=E.filter(function(g){return !g.path.match(/^rtf\/(head|pgdsctbl|listtable)/);
+var A=document.createElement('div');A.innerHTML=bd.innerHTML;new Roo.htmleditor.FilterAttributes({node:A,attrib_black:['contenteditable']});var B=A.innerHTML;if(Roo.isSafari){var bs=bd.getAttribute('style');var m=bs?bs.match(/text-align:(.*?);/i):false;if(m&&m[1]){B='<div style="'+m[0]+'">'+B+'</div>';
+}}B=this.cleanHtml(B);B=B.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\u0080-\uFFFF]/g,function(C){var cc=C.charCodeAt();if(C.length==2){var D=C.charCodeAt(0)-0xD800;var E=C.charCodeAt(1)-0xDC00;cc=(D*0x400)+E+0x10000;}else if((cc>=0x4E00&&cc<0xA000)||(cc>=0x3400&&cc<0x4E00)||(cc>=0xf900&&cc<0xfb00)){return C;
+}return "&#"+cc+";";});if(this.owner.fireEvent('beforesync',this,B)!==false){this.el.dom.value=B;this.owner.fireEvent('sync',this,B);}}},pushValue:function(){Roo.log("HtmlEditorCore:pushValue (TEXT->EDITOR)");if(this.initialized){var v=this.el.dom.value.trim();
+if(this.owner.fireEvent('beforepush',this,v)!==false){var d=(this.doc.body||this.doc.documentElement);d.innerHTML=v;this.el.dom.value=d.innerHTML;this.owner.fireEvent('push',this,v);}Roo.each(Roo.get(this.doc.body).query('*[data-block]'),function(e){Roo.htmleditor.Block.factory(e);
+},this);var lc=this.doc.body.lastChild;if(lc&&lc.nodeType==1&&lc.getAttribute("contenteditable")=="false"){this.doc.body.appendChild(this.doc.createElement('br'));}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus();
+}else{this.el.focus();}},assignDocWin:function(){var A=this.iframe;if(Roo.isIE){this.doc=A.contentWindow.document;this.win=A.contentWindow;}else{if(!Roo.get(this.frameId)&&!A.contentDocument){return;}this.doc=(A.contentDocument||Roo.get(this.frameId).dom.document);
+this.win=(A.contentWindow||Roo.get(this.frameId).dom.contentWindow);}},initEditor:function(){this.assignDocWin();this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A=(this.doc.body||this.doc.documentElement);
+A.bgProperties='fixed';Roo.EventManager.on(this.doc,{'mouseup':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this});Roo.EventManager.on(this.doc,{'paste':this.onPasteEvent,scope:this}
+);if(Roo.isGecko){Roo.EventManager.on(this.doc,'keypress',this.mozKeyPress,this);}if(Roo.isIE||Roo.isSafari||Roo.isOpera){Roo.EventManager.on(this.doc,'keydown',this.fixKeys,this);}this.initialized=true;new Roo.htmleditor.KeyEnter({core:this});this.owner.fireEvent('initialize',this);
+this.pushValue();},onPasteEvent:function(e,v){var cd=(e.browserEvent.clipboardData||window.clipboardData);if(cd.files.length>0){var A=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);var B=A.createObjectURL(cd.files[0]);
+this.insertAtCursor('<img src=" + url + ">');return false;}var C=cd.getData('text/html');var D=new Roo.rtf.Parser(cd.getData('text/rtf'));var E=D.doc.getElementsByType('pict');Roo.log(E);E=E.filter(function(g){return !g.path.match(/^rtf\/(head|pgdsctbl|listtable)/);
 }).map(function(g){return g.toDataURL();});C=this.cleanWordChars(C);var d=(new DOMParser().parseFromString(C,'text/html')).body;if(E.length>0){Roo.each(d.getElementsByTagName('img'),function(F,i){F.setAttribute('src',E[i]);});}new Roo.htmleditor.FilterStyleToTag({node:d}
 );new Roo.htmleditor.FilterAttributes({node:d,attrib_white:['href','src','name','align'],attrib_clean:['href','src']});new Roo.htmleditor.FilterBlack({node:d,tag:this.black});new Roo.htmleditor.FilterKeepChildren({node:d,tag:['FONT']});new Roo.htmleditor.FilterParagraph({node:d}
 );new Roo.htmleditor.FilterSpan({node:d});new Roo.htmleditor.FilterLongBr({node:d});this.insertAtCursor(d.innerHTML);e.preventDefault();return false;},onDestroy:function(){if(this.rendered){}},onFirstFocus:function(){this.assignDocWin();this.activated=true;
@@ -1297,6 +1299,8 @@ return;}this.raphael=Raphael(this.el.dom);},load:function(A,B,C){this.raphael.cl
 ,500,"bounce");if(this.label){this.label[0].animate({r:5},500,"bounce");this.label[1].attr({"font-weight":400});}};switch(A){case 'bar':this.raphael.barchart(this.g_x,this.g_y,this.g_width,this.g_height,B,C).hover(D,E);break;case 'hbar':this.raphael.hbarchart(this.g_x,this.g_y,this.g_width,this.g_height,B,C).hover(D,E);
 break;case 'pie':this.raphael.piechart(this.g_x,this.g_y,this.g_r,B,C).hover(F,G);break;}if(this.title){this.raphael.text(this.title.x,this.title.y,this.title.text).attr(this.title.attr);}},setTitle:function(o){this.title=o;},initEvents:function(){if(!this.href){this.el.on('click',this.onClick,this);
 }},onClick:function(e){Roo.log('img onclick');this.fireEvent('click',this,e);}});
+// Roo/bootstrap/dash/namespace.js
+Roo.bootstrap.dash={};
 // Roo/bootstrap/dash/NumberBox.js
 Roo.bootstrap.dash=Roo.bootstrap.dash||{};Roo.bootstrap.dash.NumberBox=function(A){Roo.bootstrap.dash.NumberBox.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.dash.NumberBox,Roo.bootstrap.Component,{headline:'',content:'',icon:'',footer:'',fhref:'',ficon:'',getAutoCreate:function(){var A={tag:'div',cls:'small-box ',cn:[{tag:'div',cls:'inner',cn:[{tag:'h3',cls:'roo-headline',html:this.headline}
 ,{tag:'p',cls:'roo-content',html:this.content}]}]};if(this.icon){A.cn.push({tag:'div',cls:'icon',cn:[{tag:'i',cls:'ion '+this.icon}]});}if(this.footer){var B={tag:'a',cls:'small-box-footer',href:this.fhref||'#',html:this.footer};A.cn.push(B);}return A;},onRender:function(ct,A){Roo.bootstrap.dash.NumberBox.superclass.onRender.call(this,ct,A);
index f67f186..a8702dc 100644 (file)
@@ -5151,8 +5151,9 @@ Roo.DomHelper = function(){
     var updateNode = function(from, to)
     {
         // should we handle non-standard elements?
-        
+        Roo.log(["UpdateNode" , from, to]);
         if (from.nodeType != to.nodeType) {
+            Roo.log(["ReplaceChild - mismatch notType" , to, from ]);
             from.parentNode.replaceChild(to, from);
         }
         
@@ -5167,6 +5168,7 @@ Roo.DomHelper = function(){
         
         // assume 'to' doesnt have '1/3 nodetypes!
         if (from.nodeType !=1 || from.tagName != to.tagName) {
+            Roo.log(["ReplaceChild" , from, to ]);
             from.parentNode.replaceChild(to, from);
             return;
         }
@@ -5176,6 +5178,9 @@ Roo.DomHelper = function(){
             if (to.hasAttribute(ar[i].name)) {
                 continue;
             }
+            if (ar[i].name == 'id') { // always keep ids?
+                continue;
+            }
             from.removeAttribute(ar[i].name);
         }
         ar = to.attributes;
@@ -5190,19 +5195,34 @@ Roo.DomHelper = function(){
         var tar = Array.from(to.childNodes);
         // if the lengths are different.. then it's probably a editable content change, rather than
         // a change of the block definition..
-        if (from.innerHTML == to.innerHTML) {
+        
+        // this did notwork , as our rebuilt nodes did not include ID's so did not match at all.
+         /*if (from.innerHTML == to.innerHTML) {
             return;
         }
         if (far.length != tar.length) {
             from.innerHTML = to.innerHTML;
             return;
         }
+        */
         
-        for(var i = 0; i < far.length; i++) {
-            updateNode(far[i], tar[i]);
+        for(var i = 0; i < Math.max(tar.length, far.length); i++) {
+            if (i >= far.length) {
+                from.appendChild(tar[i]);
+                Roo.log(["add", tar[i]]);
+                
+            } else if ( i  >= tar.length) {
+                from.removeChild(far[i]);
+                Roo.log(["remove", far[i]]);
+            } else {
+                
+                updateNode(far[i], tar[i]);
+            }    
         }
         
         
+        
+        
     };
     
     
index 95e72e6..d351e51 100644 (file)
@@ -221,19 +221,19 @@ var cn=o.children||o.cn;if(cn){if((cn instanceof Array)||(Roo.isSafari&&typeof(c
 var i=-1,el=A;while(++i<N&&el.firstChild){el=el.firstChild;}return el;};var ts='<table>',te='</table>',H=ts+'<tbody>',I='</tbody>'+te,J=H+'<tr>',K='</tr>'+I;var L=function(N,O,el,P){if(!A){A=document.createElement('div');}var Q;var R=null;if(N=='td'){if(O=='afterbegin'||O=='beforeend'){return;
 }if(O=='beforebegin'){R=el;el=el.parentNode;}else{R=el.nextSibling;el=el.parentNode;}Q=G(4,J,P,K);}else if(N=='tr'){if(O=='beforebegin'){R=el;el=el.parentNode;Q=G(3,H,P,I);}else if(O=='afterend'){R=el.nextSibling;el=el.parentNode;Q=G(3,H,P,I);}else{if(O=='afterbegin'){R=el.firstChild;
 }Q=G(4,J,P,K);}}else if(N=='tbody'){if(O=='beforebegin'){R=el;el=el.parentNode;Q=G(2,ts,P,te);}else if(O=='afterend'){R=el.nextSibling;el=el.parentNode;Q=G(2,ts,P,te);}else{if(O=='afterbegin'){R=el.firstChild;}Q=G(3,H,P,I);}}else{if(O=='beforebegin'||O=='afterend'){return;
-}if(O=='afterbegin'){R=el.firstChild;}Q=G(2,ts,P,te);}el.insertBefore(Q,R);return Q;};var M=function(N,to){if(N.nodeType!=to.nodeType){N.parentNode.replaceChild(to,N);}if(N.nodeType==3){if(N.data==to.data){return;}N.data=to.data;return;}if(N.nodeType!=1||N.tagName!=to.tagName){N.parentNode.replaceChild(to,N);
-return;}var ar=Array.from(N.attributes);for(var i=0;i<ar.length;i++){if(to.hasAttribute(ar[i].name)){continue;}N.removeAttribute(ar[i].name);}ar=to.attributes;for(var i=0;i<ar.length;i++){if(N.getAttribute(ar[i].name)==to.getAttribute(ar[i].name)){continue;
-}N.setAttribute(ar[i].name,to.getAttribute(ar[i].name));}var O=Array.from(N.childNodes);var P=Array.from(to.childNodes);if(N.innerHTML==to.innerHTML){return;}if(O.length!=P.length){N.innerHTML=to.innerHTML;return;}for(var i=0;i<O.length;i++){M(O[i],P[i]);
-}};return {useDom:false,markup:function(o){return E(o);},applyStyles:function(el,N){if(N){el=Roo.fly(el);if(typeof N=="string"){var re=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var O;while((O=re.exec(N))!=null){el.setStyle(O[1],O[2]);}}else if(typeof N=="object"){for(var P in N){el.setStyle(P,N[P]);
-}}else if(typeof N=="function"){Roo.DomHelper.applyStyles(el,N.call());}}},insertHtml:function(N,el,O){N=N.toLowerCase();if(el.insertAdjacentHTML){if(C.test(el.tagName)){var rs;if(rs=L(el.tagName.toLowerCase(),N,el,O)){return rs;}}switch(N){case "beforebegin":el.insertAdjacentHTML('BeforeBegin',O);
-return el.previousSibling;case "afterbegin":el.insertAdjacentHTML('AfterBegin',O);return el.firstChild;case "beforeend":el.insertAdjacentHTML('BeforeEnd',O);return el.lastChild;case "afterend":el.insertAdjacentHTML('AfterEnd',O);return el.nextSibling;}throw 'Illegal insertion point -> "'+N+'"';
-}var P=el.ownerDocument.createRange();var Q;switch(N){case "beforebegin":P.setStartBefore(el);Q=P.createContextualFragment(O);el.parentNode.insertBefore(Q,el);return el.previousSibling;case "afterbegin":if(el.firstChild){P.setStartBefore(el.firstChild);Q=P.createContextualFragment(O);
-el.insertBefore(Q,el.firstChild);return el.firstChild;}else{el.innerHTML=O;return el.firstChild;}case "beforeend":if(el.lastChild){P.setStartAfter(el.lastChild);Q=P.createContextualFragment(O);el.appendChild(Q);return el.lastChild;}else{el.innerHTML=O;return el.lastChild;
-}case "afterend":P.setStartAfter(el);Q=P.createContextualFragment(O);el.parentNode.insertBefore(Q,el.nextSibling);return el.nextSibling;}throw 'Illegal insertion point -> "'+N+'"';},insertBefore:function(el,o,N){return this.doInsert(el,o,N,"beforeBegin");
-},insertAfter:function(el,o,N){return this.doInsert(el,o,N,"afterEnd","nextSibling");},insertFirst:function(el,o,N){return this.doInsert(el,o,N,"afterBegin");},doInsert:function(el,o,N,O,P){el=Roo.getDom(el);var Q;if(this.useDom||o.ns){Q=F(o,null);el.parentNode.insertBefore(Q,P?el[P]:el);
-}else{var R=E(o);Q=this.insertHtml(O,el,R);}return N?Roo.get(Q,true):Q;},append:function(el,o,N){el=Roo.getDom(el);var O;if(this.useDom||o.ns){O=F(o,null);el.appendChild(O);}else{var P=E(o);O=this.insertHtml("beforeEnd",el,P);}return N?Roo.get(O,true):O;}
-,overwrite:function(el,o,N){el=Roo.getDom(el);if(o.ns){while(el.childNodes.length){el.removeChild(el.firstChild);}F(o,el);}else{el.innerHTML=E(o);}return N?Roo.get(el.firstChild,true):el.firstChild;},createTemplate:function(o){var N=E(o);return new Roo.Template(N);
-},update:function(el,o){M(Roo.getDom(el),F(o));}};}();
+}if(O=='afterbegin'){R=el.firstChild;}Q=G(2,ts,P,te);}el.insertBefore(Q,R);return Q;};var M=function(N,to){Roo.log(["UpdateNode",N,to]);if(N.nodeType!=to.nodeType){Roo.log(["ReplaceChild - mismatch notType",to,N]);N.parentNode.replaceChild(to,N);}if(N.nodeType==3){if(N.data==to.data){return;
+}N.data=to.data;return;}if(N.nodeType!=1||N.tagName!=to.tagName){Roo.log(["ReplaceChild",N,to]);N.parentNode.replaceChild(to,N);return;}var ar=Array.from(N.attributes);for(var i=0;i<ar.length;i++){if(to.hasAttribute(ar[i].name)){continue;}if(ar[i].name=='id'){continue;
+}N.removeAttribute(ar[i].name);}ar=to.attributes;for(var i=0;i<ar.length;i++){if(N.getAttribute(ar[i].name)==to.getAttribute(ar[i].name)){continue;}N.setAttribute(ar[i].name,to.getAttribute(ar[i].name));}var O=Array.from(N.childNodes);var P=Array.from(to.childNodes);
+for(var i=0;i<Math.max(P.length,O.length);i++){if(i>=O.length){N.appendChild(P[i]);Roo.log(["add",P[i]]);}else if(i>=P.length){N.removeChild(O[i]);Roo.log(["remove",O[i]]);}else{M(O[i],P[i]);}}};return {useDom:false,markup:function(o){return E(o);},applyStyles:function(el,N){if(N){el=Roo.fly(el);
+if(typeof N=="string"){var re=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var O;while((O=re.exec(N))!=null){el.setStyle(O[1],O[2]);}}else if(typeof N=="object"){for(var P in N){el.setStyle(P,N[P]);}}else if(typeof N=="function"){Roo.DomHelper.applyStyles(el,N.call());
+}}},insertHtml:function(N,el,O){N=N.toLowerCase();if(el.insertAdjacentHTML){if(C.test(el.tagName)){var rs;if(rs=L(el.tagName.toLowerCase(),N,el,O)){return rs;}}switch(N){case "beforebegin":el.insertAdjacentHTML('BeforeBegin',O);return el.previousSibling;case "afterbegin":el.insertAdjacentHTML('AfterBegin',O);
+return el.firstChild;case "beforeend":el.insertAdjacentHTML('BeforeEnd',O);return el.lastChild;case "afterend":el.insertAdjacentHTML('AfterEnd',O);return el.nextSibling;}throw 'Illegal insertion point -> "'+N+'"';}var P=el.ownerDocument.createRange();var Q;
+switch(N){case "beforebegin":P.setStartBefore(el);Q=P.createContextualFragment(O);el.parentNode.insertBefore(Q,el);return el.previousSibling;case "afterbegin":if(el.firstChild){P.setStartBefore(el.firstChild);Q=P.createContextualFragment(O);el.insertBefore(Q,el.firstChild);
+return el.firstChild;}else{el.innerHTML=O;return el.firstChild;}case "beforeend":if(el.lastChild){P.setStartAfter(el.lastChild);Q=P.createContextualFragment(O);el.appendChild(Q);return el.lastChild;}else{el.innerHTML=O;return el.lastChild;}case "afterend":P.setStartAfter(el);
+Q=P.createContextualFragment(O);el.parentNode.insertBefore(Q,el.nextSibling);return el.nextSibling;}throw 'Illegal insertion point -> "'+N+'"';},insertBefore:function(el,o,N){return this.doInsert(el,o,N,"beforeBegin");},insertAfter:function(el,o,N){return this.doInsert(el,o,N,"afterEnd","nextSibling");
+},insertFirst:function(el,o,N){return this.doInsert(el,o,N,"afterBegin");},doInsert:function(el,o,N,O,P){el=Roo.getDom(el);var Q;if(this.useDom||o.ns){Q=F(o,null);el.parentNode.insertBefore(Q,P?el[P]:el);}else{var R=E(o);Q=this.insertHtml(O,el,R);}return N?Roo.get(Q,true):Q;
+},append:function(el,o,N){el=Roo.getDom(el);var O;if(this.useDom||o.ns){O=F(o,null);el.appendChild(O);}else{var P=E(o);O=this.insertHtml("beforeEnd",el,P);}return N?Roo.get(O,true):O;},overwrite:function(el,o,N){el=Roo.getDom(el);if(o.ns){while(el.childNodes.length){el.removeChild(el.firstChild);
+}F(o,el);}else{el.innerHTML=E(o);}return N?Roo.get(el.firstChild,true):el.firstChild;},createTemplate:function(o){var N=E(o);return new Roo.Template(N);},update:function(el,o){M(Roo.getDom(el),F(o));}};}();
 // Roo/Template.js
 Roo.Template=function(A){if(A instanceof Array){A=A.join("");}else if(arguments.length>1){A=Array.prototype.join.call(arguments,"");}if(typeof(A)=='object'){Roo.apply(this,A)}else{this.html=A;}if(this.url){this.load();}};Roo.Template.prototype={onLoad:false,url:false,html:'',compiled:false,loaded:false,applyTemplate:function(A){try{if(this.compiled){return this.compiled(A);
 }var B=this.disableFormats!==true;var fm=Roo.util.Format,C=this;var fn=function(m,D,E,F){if(E&&B){if(E.substr(0,5)=="this."){return C.call(E.substr(5),A[D],A);}else{if(F){var re=/^\s*['"](.*)["']\s*$/;F=F.split(',');for(var i=0,G=F.length;i<G;i++){F[i]=F[i].replace(re,"$1");
index 8bd4c18..f1f5dcf 100644 (file)
@@ -5151,8 +5151,9 @@ Roo.DomHelper = function(){
     var updateNode = function(from, to)
     {
         // should we handle non-standard elements?
-        
+        Roo.log(["UpdateNode" , from, to]);
         if (from.nodeType != to.nodeType) {
+            Roo.log(["ReplaceChild - mismatch notType" , to, from ]);
             from.parentNode.replaceChild(to, from);
         }
         
@@ -5167,6 +5168,7 @@ Roo.DomHelper = function(){
         
         // assume 'to' doesnt have '1/3 nodetypes!
         if (from.nodeType !=1 || from.tagName != to.tagName) {
+            Roo.log(["ReplaceChild" , from, to ]);
             from.parentNode.replaceChild(to, from);
             return;
         }
@@ -5176,6 +5178,9 @@ Roo.DomHelper = function(){
             if (to.hasAttribute(ar[i].name)) {
                 continue;
             }
+            if (ar[i].name == 'id') { // always keep ids?
+                continue;
+            }
             from.removeAttribute(ar[i].name);
         }
         ar = to.attributes;
@@ -5190,19 +5195,34 @@ Roo.DomHelper = function(){
         var tar = Array.from(to.childNodes);
         // if the lengths are different.. then it's probably a editable content change, rather than
         // a change of the block definition..
-        if (from.innerHTML == to.innerHTML) {
+        
+        // this did notwork , as our rebuilt nodes did not include ID's so did not match at all.
+         /*if (from.innerHTML == to.innerHTML) {
             return;
         }
         if (far.length != tar.length) {
             from.innerHTML = to.innerHTML;
             return;
         }
+        */
         
-        for(var i = 0; i < far.length; i++) {
-            updateNode(far[i], tar[i]);
+        for(var i = 0; i < Math.max(tar.length, far.length); i++) {
+            if (i >= far.length) {
+                from.appendChild(tar[i]);
+                Roo.log(["add", tar[i]]);
+                
+            } else if ( i  >= tar.length) {
+                from.removeChild(far[i]);
+                Roo.log(["remove", far[i]]);
+            } else {
+                
+                updateNode(far[i], tar[i]);
+            }    
         }
         
         
+        
+        
     };