roojs-ui.js
authorAlan <alan@roojs.com>
Wed, 29 Sep 2021 09:22:12 +0000 (17:22 +0800)
committerAlan <alan@roojs.com>
Wed, 29 Sep 2021 09:22:12 +0000 (17:22 +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 75fabe0..e717c41 100644 (file)
@@ -1876,12 +1876,10 @@ Roo.htmleditor.KeyEnter=function(A){Roo.apply(this,A);Roo.get(this.core.doc.body
 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);
 var E=this.core.win.getSelection();E.removeAllRanges();E.addRange(D);return false;}};
 // Roo/htmleditor/BlockFigure.js
-Roo.htmleditor.BlockFigure=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);};Roo.htmleditor.BlockFigure.prototype={image_src:'',align:'left',caption:'',text_align:'left',image_width:'',image_height:'',friendly_name:'Image with caption',context:{image_width:{title:"Width",width:40}
+Roo.htmleditor.BlockFigure=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);};Roo.extend(Roo.htmleditor.BlockFigure,Roo.htmleditor.Block,{image_src:'',align:'left',caption:'',text_align:'left',image_width:'',image_height:'',friendly_name:'Image with caption',context:{image_width:{title:"Width",width:40}
 ,image_height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80},text_align:{title:"Caption Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80},image_src:{title:"Src",width:220}},toObject:function(){var A={tag:'img',src:this.image_src,alt:this.caption}
 ;if((''+this.image_width).length){A.width=this.image_width;}if((''+this.height).length){A.height=this.image_height;}return {tag:'figure','data-block':'Figure',contenteditable:'false',style:'text-align:'+this.align,cn:[A,{tag:'figcaption',contenteditable:true,style:'text-align:left',html:this.caption}
-]};},readElement:function(A){this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','style','text-align');this.caption=this.getVal(A,'figcaption','html');this.text_align=this.getVal(A,'figcaption','style','text-align');},updateElement:function(A){Roo.DomHelper.update(A,this.toObject());
-},toHTML:function(){return Roo.DomHelper.markup(this.toObject());},getVal:function(A,B,C,D){var n=A;if(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);
-}};
+]};},readElement:function(A){this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','style','text-align');this.caption=this.getVal(A,'figcaption','html');this.text_align=this.getVal(A,'figcaption','style','text-align');}})
 // Roo/HtmlEditorCore.js
 Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,stylesheets:false,allowComments:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',getDocMarkup:function(){var st='';
 if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);});Roo.get(document.head).select('link').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);
index 60dde65..c0d6526 100644 (file)
@@ -26234,6 +26234,9 @@ Roo.extend(Roo.htmleditor.FilterComment, Roo.htmleditor.Filter,
 Roo.htmleditor.FilterKeepChildren = function(cfg)
 {
     Roo.apply(this, cfg);
+    if (this.tag === false) {
+        return; // dont walk.. (you can use this to use this just to do a child removal on a single tag )
+    }
     this.walk(cfg.node);
 }
 
@@ -26249,7 +26252,9 @@ Roo.extend(Roo.htmleditor.FilterKeepChildren, Roo.htmleditor.FilterBlack,
             node.removeChild(ar[i]);
             // what if we need to walk these???
             node.parentNode.insertBefore(ar[i], node);
-            this.walk(ar[i]);
+            if (this.tag !== false) {
+                this.walk(ar[i]);
+            }
         }
         node.parentNode.removeChild(node);
         return false; // don't walk children
@@ -26604,8 +26609,8 @@ Roo.htmleditor.BlockFigure = function(cfg)
     }
     Roo.apply(this, cfg);
 }
-
-Roo.htmleditor.BlockFigure.prototype = {
+Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
     
     // setable values.
     image_src: '',
@@ -26618,6 +26623,7 @@ Roo.htmleditor.BlockFigure.prototype = {
     image_height : '',
     
     // used by context menu
+    friendly_name : 'Image with caption',
     
     context : { // ?? static really
         image_width : {
@@ -26687,45 +26693,16 @@ Roo.htmleditor.BlockFigure.prototype = {
         this.align = this.getVal(node, 'figure', 'style', 'text-align');
         this.caption = this.getVal(node, 'figcaption', 'html');
         this.text_align = this.getVal(node, 'figcaption', 'style','text-align');
-    },
-    
-    updateElement : function(node)
-    {
-        Roo.DomHelper.overwrite(node, this.toObject());
-    },
-    /**
-     * convert to plain HTML for calling insertAtCursor..
-     */
-    toHTML : function()
-    {
-        return Roo.DomHelper.markup(this.toObject());
-    },
-    
-    getVal : function(node, tag, attr, style)
-    {
-        var n = node;
-        if (n.tagName != tag.toUpperCase()) {
-            // in theory we could do figure[3] << 3rd figure? or some more complex search..?
-            // but kiss for now.
-            n = node.getElementsByTagName(tag).item(0);
-        }
-        if (attr == 'html') {
-            return n.innerHTML;
-        }
-        if (attr == 'style') {
-            return Roo.get(n).getStyle(style);
-        }
-        
-        return Roo.get(n).attr(attr);
-            
-    }
-    
+    } 
     
+  
+   
+     
     
     
     
     
-}
+})
 
 //<script type="text/javascript">
 
@@ -27064,9 +27041,26 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
             var bd = (this.doc.body || this.doc.documentElement);
             //this.cleanUpPaste(); -- this is done else where and causes havoc..
             
+            // not sure if this is really the place for this
+            // 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) {
+                var cls = Roo.htmleditor['Block' + Roo.get(e).attr('data-block')];
+                if (typeof(cls) == 'undefined') {
+                    Roo.log("OOps missing block : " + 'Block' + Roo.get(e).attr('data-block'));
+                    return;
+                }
+                new cls({ node: e });  /// should trigger update element
+            },this);
+            
+            
             var div = document.createElement('div');
             div.innerHTML = bd.innerHTML;
             // remove content editable. (blocks)
+            
+           
+            
             new Roo.htmleditor.FilterAttributes({node : div, attrib_black: [ 'contenteditable' ] });
             //?? tidy?
             var html = div.innerHTML;
@@ -27139,8 +27133,13 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
                     Roo.log("OOps missing block : " + 'Block' + Roo.get(e).attr('data-block'));
                     return;
                 }
-                new cls(e);  /// should trigger update element
-            },this)
+                new cls({ node: e });  /// should trigger update element
+            },this);
+            var lc = this.doc.body.lastChild;
+            if (lc && lc.nodeType == 1 && lc.getAttribute("contenteditable") == "false") {
+                // add an extra line at the end.
+                this.doc.body.appendChild(this.doc.createChild('br'));
+            }
             
             
         }
index 606a88a..9481b15 100644 (file)
@@ -1124,8 +1124,8 @@ Roo.htmleditor.FilterBlack=function(A){Roo.apply(this,A);this.walk(A.node);};Roo
 // Roo/htmleditor/FilterComment.js
 Roo.htmleditor.FilterComment=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterComment,Roo.htmleditor.Filter,{replaceComment:function(n){n.parentNode.removeChild(n);}});
 // Roo/htmleditor/FilterKeepChildren.js
-Roo.htmleditor.FilterKeepChildren=function(A){Roo.apply(this,A);this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterKeepChildren,Roo.htmleditor.FilterBlack,{replaceTag:function(A){var ar=Array.from(A.childNodes);for(var i=0;i<ar.length;i++){A.removeChild(ar[i]);
-A.parentNode.insertBefore(ar[i],A);this.walk(ar[i]);}A.parentNode.removeChild(A);return false;}});
+Roo.htmleditor.FilterKeepChildren=function(A){Roo.apply(this,A);if(this.tag===false){return;}this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterKeepChildren,Roo.htmleditor.FilterBlack,{replaceTag:function(A){var ar=Array.from(A.childNodes);for(var i=0;i<ar.length;
+i++){A.removeChild(ar[i]);A.parentNode.insertBefore(ar[i],A);if(this.tag!==false){this.walk(ar[i]);}}A.parentNode.removeChild(A);return false;}});
 // Roo/htmleditor/FilterParagraph.js
 Roo.htmleditor.FilterParagraph=function(A){this.walk(A.node);};Roo.extend(Roo.htmleditor.FilterParagraph,Roo.htmleditor.Filter,{tag:'P',replaceTag:function(A){if(A.childNodes.length==1&&A.childNodes[0].nodeType==3&&A.childNodes[0].textContent.trim().length<1){A.parentNode.replaceChild(A.ownerDocument.createElement('BR'),A);
 return false;}var ar=Array.from(A.childNodes);for(var i=0;i<ar.length;i++){A.removeChild(ar[i]);A.parentNode.insertBefore(ar[i],A);}A.parentNode.insertBefore(A.ownerDocument.createElement('BR'),A);A.parentNode.removeChild(A);return false;}});
@@ -1148,12 +1148,10 @@ Roo.htmleditor.KeyEnter=function(A){Roo.apply(this,A);Roo.get(this.core.doc.body
 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);
 var E=this.core.win.getSelection();E.removeAllRanges();E.addRange(D);return false;}};
 // Roo/htmleditor/BlockFigure.js
-Roo.htmleditor.BlockFigure=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);};Roo.htmleditor.BlockFigure.prototype={image_src:'',align:'left',caption:'',text_align:'left',image_width:'',image_height:'',context:{image_width:{title:"Width",width:40}
+Roo.htmleditor.BlockFigure=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);};Roo.extend(Roo.htmleditor.BlockFigure,Roo.htmleditor.Block,{image_src:'',align:'left',caption:'',text_align:'left',image_width:'',image_height:'',friendly_name:'Image with caption',context:{image_width:{title:"Width",width:40}
 ,image_height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80},text_align:{title:"Caption Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80},image_src:{title:"Src",width:220}},toObject:function(){var A={tag:'img',src:this.image_src,alt:this.caption}
 ;if((''+this.image_width).length){A.width=this.image_width;}if((''+this.height).length){A.height=this.image_height;}return {tag:'figure','data-block':'Figure',contenteditable:'false',style:'text-align:'+this.align,cn:[A,{tag:'figcaption',contenteditable:true,style:'text-align:left',html:this.caption}
-]};},readElement:function(A){this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','style','text-align');this.caption=this.getVal(A,'figcaption','html');this.text_align=this.getVal(A,'figcaption','style','text-align');},updateElement:function(A){Roo.DomHelper.overwrite(A,this.toObject());
-},toHTML:function(){return Roo.DomHelper.markup(this.toObject());},getVal:function(A,B,C,D){var n=A;if(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);
-}};
+]};},readElement:function(A){this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','style','text-align');this.caption=this.getVal(A,'figcaption','html');this.text_align=this.getVal(A,'figcaption','style','text-align');}})
 // Roo/HtmlEditorCore.js
 Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,stylesheets:false,allowComments:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',getDocMarkup:function(){var st='';
 if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);});Roo.get(document.head).select('link').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);
@@ -1165,13 +1163,15 @@ 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){var C=Roo.htmleditor['Block'+Roo.get(e).attr('data-block')];if(typeof(C)=='undefined'){Roo.log("OOps missing block : "+'Block'+Roo.get(e).attr('data-block'));return;}new C({node: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){var A=Roo.htmleditor['Block'+Roo.get(e).attr('data-block')];
-if(typeof(A)=='undefined'){Roo.log("OOps missing block : "+'Block'+Roo.get(e).attr('data-block'));return;}new A(e);},this)}},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,'paste':this.onPasteEvent,buffer:100,scope:this}
+if(typeof(A)=='undefined'){Roo.log("OOps missing block : "+'Block'+Roo.get(e).attr('data-block'));return;}new A({node:e});},this);var lc=this.doc.body.lastChild;if(lc&&lc.nodeType==1&&lc.getAttribute("contenteditable")=="false"){this.doc.body.appendChild(this.doc.createChild('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,'paste':this.onPasteEvent,buffer:100,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){this.owner.fireEvent('paste',e,v);},onDestroy:function(){if(this.rendered){}},onFirstFocus:function(){this.assignDocWin();this.activated=true;if(Roo.isGecko){this.win.focus();var s=this.win.getSelection();if(!s.focusNode||s.focusNode.nodeType!=3){var r=s.getRangeAt(0);
 r.selectNodeContents((this.doc.body||this.doc.documentElement));r.collapse(true);this.deferFocus();}try{this.execCmd('useCSS',true);this.execCmd('styleWithCSS',false);}catch(e){}}this.owner.fireEvent('activate',this);},adjustFont:function(A){var B=A.cmd=='increasefontsize'?1:-1;
index 88d3050..4884112 100644 (file)
@@ -45285,8 +45285,8 @@ Roo.htmleditor.BlockFigure = function(cfg)
     }
     Roo.apply(this, cfg);
 }
-
-Roo.htmleditor.BlockFigure.prototype = {
+Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
     
     // setable values.
     image_src: '',
@@ -45369,45 +45369,16 @@ Roo.htmleditor.BlockFigure.prototype = {
         this.align = this.getVal(node, 'figure', 'style', 'text-align');
         this.caption = this.getVal(node, 'figcaption', 'html');
         this.text_align = this.getVal(node, 'figcaption', 'style','text-align');
-    },
-    
-    updateElement : function(node)
-    {
-        Roo.DomHelper.update(node, this.toObject());
-    },
-    /**
-     * convert to plain HTML for calling insertAtCursor..
-     */
-    toHTML : function()
-    {
-        return Roo.DomHelper.markup(this.toObject());
-    },
-    
-    getVal : function(node, tag, attr, style)
-    {
-        var n = node;
-        if (n.tagName != tag.toUpperCase()) {
-            // in theory we could do figure[3] << 3rd figure? or some more complex search..?
-            // but kiss for now.
-            n = node.getElementsByTagName(tag).item(0);
-        }
-        if (attr == 'html') {
-            return n.innerHTML;
-        }
-        if (attr == 'style') {
-            return Roo.get(n).getStyle(style);
-        }
-        
-        return Roo.get(n).attr(attr);
-            
-    }
+    } 
     
+  
+   
      
     
     
     
     
-}
+})
 
 //<script type="text/javascript">
 
index a84532a..8e4e4f5 100644 (file)
@@ -21317,8 +21317,8 @@ Roo.htmleditor.BlockFigure = function(cfg)
     }
     Roo.apply(this, cfg);
 }
-
-Roo.htmleditor.BlockFigure.prototype = {
+Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
     
     // setable values.
     image_src: '',
@@ -21401,45 +21401,16 @@ Roo.htmleditor.BlockFigure.prototype = {
         this.align = this.getVal(node, 'figure', 'style', 'text-align');
         this.caption = this.getVal(node, 'figcaption', 'html');
         this.text_align = this.getVal(node, 'figcaption', 'style','text-align');
-    },
-    
-    updateElement : function(node)
-    {
-        Roo.DomHelper.update(node, this.toObject());
-    },
-    /**
-     * convert to plain HTML for calling insertAtCursor..
-     */
-    toHTML : function()
-    {
-        return Roo.DomHelper.markup(this.toObject());
-    },
-    
-    getVal : function(node, tag, attr, style)
-    {
-        var n = node;
-        if (n.tagName != tag.toUpperCase()) {
-            // in theory we could do figure[3] << 3rd figure? or some more complex search..?
-            // but kiss for now.
-            n = node.getElementsByTagName(tag).item(0);
-        }
-        if (attr == 'html') {
-            return n.innerHTML;
-        }
-        if (attr == 'style') {
-            return Roo.get(n).getStyle(style);
-        }
-        
-        return Roo.get(n).attr(attr);
-            
-    }
+    } 
     
+  
+   
      
     
     
     
     
-}
+})
 
 //<script type="text/javascript">
 
index c14e2f7..0973e72 100644 (file)
@@ -952,12 +952,10 @@ Roo.htmleditor.KeyEnter=function(A){Roo.apply(this,A);Roo.get(this.core.doc.body
 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);
 var E=this.core.win.getSelection();E.removeAllRanges();E.addRange(D);return false;}};
 // Roo/htmleditor/BlockFigure.js
-Roo.htmleditor.BlockFigure=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);};Roo.htmleditor.BlockFigure.prototype={image_src:'',align:'left',caption:'',text_align:'left',image_width:'',image_height:'',friendly_name:'Image with caption',context:{image_width:{title:"Width",width:40}
+Roo.htmleditor.BlockFigure=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);};Roo.extend(Roo.htmleditor.BlockFigure,Roo.htmleditor.Block,{image_src:'',align:'left',caption:'',text_align:'left',image_width:'',image_height:'',friendly_name:'Image with caption',context:{image_width:{title:"Width",width:40}
 ,image_height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80},text_align:{title:"Caption Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80},image_src:{title:"Src",width:220}},toObject:function(){var A={tag:'img',src:this.image_src,alt:this.caption}
 ;if((''+this.image_width).length){A.width=this.image_width;}if((''+this.height).length){A.height=this.image_height;}return {tag:'figure','data-block':'Figure',contenteditable:'false',style:'text-align:'+this.align,cn:[A,{tag:'figcaption',contenteditable:true,style:'text-align:left',html:this.caption}
-]};},readElement:function(A){this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','style','text-align');this.caption=this.getVal(A,'figcaption','html');this.text_align=this.getVal(A,'figcaption','style','text-align');},updateElement:function(A){Roo.DomHelper.update(A,this.toObject());
-},toHTML:function(){return Roo.DomHelper.markup(this.toObject());},getVal:function(A,B,C,D){var n=A;if(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);
-}};
+]};},readElement:function(A){this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','style','text-align');this.caption=this.getVal(A,'figcaption','html');this.text_align=this.getVal(A,'figcaption','style','text-align');}})
 // Roo/HtmlEditorCore.js
 Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,stylesheets:false,allowComments:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',getDocMarkup:function(){var st='';
 if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);});Roo.get(document.head).select('link').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);