sync
authorAlan <alan@roojs.com>
Thu, 30 Sep 2021 01:24:07 +0000 (09:24 +0800)
committerAlan <alan@roojs.com>
Thu, 30 Sep 2021 01:24:07 +0000 (09:24 +0800)
roojs-all.js
roojs-bootstrap-debug.js
roojs-bootstrap.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index aa6910a..c3a7a66 100644 (file)
@@ -1880,10 +1880,10 @@ Roo.htmleditor.Block=function(A){};Roo.htmleditor.Block.factory=function(A){var
 );};Roo.htmleditor.Block.prototype={friendly_name:'Image with caption',context:false,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);},toObject:function(){return {};},readElement:function(A){}};
 // 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.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"]],width:80},text_align:{title:"Caption Align",opts:[["left"],["right"],["center"]],width:80},image_src:{title:"Src",width:220}},toObject:function(){var d=document.createElement('div');
-d.innerHTML=this.caption;var A={tag:'img',src:this.image_src,alt:d.innerText.replace(/\n/g," ")};if((''+this.image_width).length>0){A.width=this.image_width;}if((''+this.image_height).length>0){A.height=this.image_height;}return {tag:'figure','data-block':'Figure',contenteditable:'false',style:'display:table; float:'+this.align,cn:[A,{tag:'figcaption',contenteditable:true,style:'text-align:'+this.text_align,html:this.caption}
-]};},readElement:function(A){this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','style','float');this.caption=this.getVal(A,'figcaption','html');this.text_align=this.getVal(A,'figcaption','style','text-align');this.image_width=this.getVal(A,'img','width');
+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',width:'100',friendly_name:'Image with caption',context:{width:{title:"Width %",width:40}
+,align:{title:"Align",opts:[["left"],["right"]],width:80},text_align:{title:"Caption Align",opts:[["left"],["right"],["center"]],width:80},image_src:{title:"Src",width:220}},toObject:function(){var d=document.createElement('div');d.innerHTML=this.caption;
+return {tag:'figure','data-block':'Figure',contenteditable:'false',style:{display:'table',float:this.align,width:this.width+'%'},cn:[{tag:'img',src:this.image_src,alt:d.innerText.replace(/\n/g," "),style:{width:'100%'}},{tag:'figcaption',contenteditable:true,style:{'text-align':this.text_align}
+,html:this.caption}]};},readElement:function(A){this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','style','float');this.caption=this.getVal(A,'figcaption','html');this.text_align=this.getVal(A,'figcaption','style','text-align');this.image_width=this.getVal(A,'img','width');
 this.image_height=this.getVal(A,'img','height');}})
 // 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='';
index 90f4e23..0d66baf 100644 (file)
@@ -26732,21 +26732,18 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
     caption : '',
     text_align: 'left',
     
-    image_width : '',
-    image_height : '',
+    width : '100',
     
     // used by context menu
     friendly_name : 'Image with caption',
     
     context : { // ?? static really
-        image_width : {
-            title: "Width",
-            width: 40
-        },
-        image_height:  {
-            title: "Height",
+        width : {
+            title: "Width %",
             width: 40
+            // ?? number
         },
+        
         align: {
             title: "Align",
             opts : [[ "left"],[ "right"]],
@@ -26774,29 +26771,32 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
         var d = document.createElement('div');
         d.innerHTML = this.caption;
         
-        var img = {
-            tag : 'img',
-            src : this.image_src,
-            alt : d.innerText.replace(/\n/g, " ") // removeHTML..
-        };
-        if ((''+this.image_width).length > 0) {
-            img.width = this.image_width;
-        }
-        if ((''+ this.image_height).length > 0) {
-            img.height = this.image_height;
-        }
         return {
             tag: 'figure',
             'data-block' : 'Figure',
             contenteditable : 'false',
-            style : 'display:table; float:' + this.align,
+            style : {
+                display: 'table',
+                float :  this.align ,
+                width :  this.width + '%'
+            },
             cn : [
-                img,
+                {
+                    tag : 'img',
+                    src : this.image_src,
+                    alt : d.innerText.replace(/\n/g, " "), // removeHTML..
+                    style: {
+                        width: '100%'
+                    }
+                },
                 {
                     tag: 'figcaption',
                     contenteditable : true,
-                    style : 'text-align:' + this.text_align,
-                    html : this.caption 
+                    style : {
+                        'text-align': this.text_align
+                    },
+                    html : this.caption
+                    
                 }
             ]
         };
index f87b197..13e5d34 100644 (file)
@@ -1152,10 +1152,10 @@ Roo.htmleditor.Block=function(A){};Roo.htmleditor.Block.factory=function(A){var
 );};Roo.htmleditor.Block.prototype={friendly_name:'Image with caption',context:false,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);},toObject:function(){return {};},readElement:function(A){}};
 // 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.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"]],width:80},text_align:{title:"Caption Align",opts:[["left"],["right"],["center"]],width:80},image_src:{title:"Src",width:220}},toObject:function(){var d=document.createElement('div');
-d.innerHTML=this.caption;var A={tag:'img',src:this.image_src,alt:d.innerText.replace(/\n/g," ")};if((''+this.image_width).length>0){A.width=this.image_width;}if((''+this.image_height).length>0){A.height=this.image_height;}return {tag:'figure','data-block':'Figure',contenteditable:'false',style:'display:table; float:'+this.align,cn:[A,{tag:'figcaption',contenteditable:true,style:'text-align:'+this.text_align,html:this.caption}
-]};},readElement:function(A){this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','style','float');this.caption=this.getVal(A,'figcaption','html');this.text_align=this.getVal(A,'figcaption','style','text-align');this.image_width=this.getVal(A,'img','width');
+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',width:'100',friendly_name:'Image with caption',context:{width:{title:"Width %",width:40}
+,align:{title:"Align",opts:[["left"],["right"]],width:80},text_align:{title:"Caption Align",opts:[["left"],["right"],["center"]],width:80},image_src:{title:"Src",width:220}},toObject:function(){var d=document.createElement('div');d.innerHTML=this.caption;
+return {tag:'figure','data-block':'Figure',contenteditable:'false',style:{display:'table',float:this.align,width:this.width+'%'},cn:[{tag:'img',src:this.image_src,alt:d.innerText.replace(/\n/g," "),style:{width:'100%'}},{tag:'figcaption',contenteditable:true,style:{'text-align':this.text_align}
+,html:this.caption}]};},readElement:function(A){this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','style','float');this.caption=this.getVal(A,'figcaption','html');this.text_align=this.getVal(A,'figcaption','style','text-align');this.image_width=this.getVal(A,'img','width');
 this.image_height=this.getVal(A,'img','height');}})
 // 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='';
index b225e38..cffc560 100644 (file)
@@ -45408,21 +45408,18 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
     caption : '',
     text_align: 'left',
     
-    image_width : '',
-    image_height : '',
+    width : '100',
     
     // used by context menu
     friendly_name : 'Image with caption',
     
     context : { // ?? static really
-        image_width : {
-            title: "Width",
-            width: 40
-        },
-        image_height:  {
-            title: "Height",
+        width : {
+            title: "Width %",
             width: 40
+            // ?? number
         },
+        
         align: {
             title: "Align",
             opts : [[ "left"],[ "right"]],
@@ -45450,29 +45447,32 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
         var d = document.createElement('div');
         d.innerHTML = this.caption;
         
-        var img = {
-            tag : 'img',
-            src : this.image_src,
-            alt : d.innerText.replace(/\n/g, " ") // removeHTML..
-        };
-        if ((''+this.image_width).length > 0) {
-            img.width = this.image_width;
-        }
-        if ((''+ this.image_height).length > 0) {
-            img.height = this.image_height;
-        }
         return {
             tag: 'figure',
             'data-block' : 'Figure',
             contenteditable : 'false',
-            style : 'display:table; float:' + this.align,
+            style : {
+                display: 'table',
+                float :  this.align ,
+                width :  this.width + '%'
+            },
             cn : [
-                img,
+                {
+                    tag : 'img',
+                    src : this.image_src,
+                    alt : d.innerText.replace(/\n/g, " "), // removeHTML..
+                    style: {
+                        width: '100%'
+                    }
+                },
                 {
                     tag: 'figcaption',
                     contenteditable : true,
-                    style : 'text-align:' + this.text_align,
-                    html : this.caption 
+                    style : {
+                        'text-align': this.text_align
+                    },
+                    html : this.caption
+                    
                 }
             ]
         };
index 52a4a06..d5fe7fc 100644 (file)
@@ -21440,21 +21440,18 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
     caption : '',
     text_align: 'left',
     
-    image_width : '',
-    image_height : '',
+    width : '100',
     
     // used by context menu
     friendly_name : 'Image with caption',
     
     context : { // ?? static really
-        image_width : {
-            title: "Width",
-            width: 40
-        },
-        image_height:  {
-            title: "Height",
+        width : {
+            title: "Width %",
             width: 40
+            // ?? number
         },
+        
         align: {
             title: "Align",
             opts : [[ "left"],[ "right"]],
@@ -21482,29 +21479,32 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
         var d = document.createElement('div');
         d.innerHTML = this.caption;
         
-        var img = {
-            tag : 'img',
-            src : this.image_src,
-            alt : d.innerText.replace(/\n/g, " ") // removeHTML..
-        };
-        if ((''+this.image_width).length > 0) {
-            img.width = this.image_width;
-        }
-        if ((''+ this.image_height).length > 0) {
-            img.height = this.image_height;
-        }
         return {
             tag: 'figure',
             'data-block' : 'Figure',
             contenteditable : 'false',
-            style : 'display:table; float:' + this.align,
+            style : {
+                display: 'table',
+                float :  this.align ,
+                width :  this.width + '%'
+            },
             cn : [
-                img,
+                {
+                    tag : 'img',
+                    src : this.image_src,
+                    alt : d.innerText.replace(/\n/g, " "), // removeHTML..
+                    style: {
+                        width: '100%'
+                    }
+                },
                 {
                     tag: 'figcaption',
                     contenteditable : true,
-                    style : 'text-align:' + this.text_align,
-                    html : this.caption 
+                    style : {
+                        'text-align': this.text_align
+                    },
+                    html : this.caption
+                    
                 }
             ]
         };
index 610979b..6d91f11 100644 (file)
@@ -956,10 +956,10 @@ Roo.htmleditor.Block=function(A){};Roo.htmleditor.Block.factory=function(A){var
 );};Roo.htmleditor.Block.prototype={friendly_name:'Image with caption',context:false,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);},toObject:function(){return {};},readElement:function(A){}};
 // 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.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"]],width:80},text_align:{title:"Caption Align",opts:[["left"],["right"],["center"]],width:80},image_src:{title:"Src",width:220}},toObject:function(){var d=document.createElement('div');
-d.innerHTML=this.caption;var A={tag:'img',src:this.image_src,alt:d.innerText.replace(/\n/g," ")};if((''+this.image_width).length>0){A.width=this.image_width;}if((''+this.image_height).length>0){A.height=this.image_height;}return {tag:'figure','data-block':'Figure',contenteditable:'false',style:'display:table; float:'+this.align,cn:[A,{tag:'figcaption',contenteditable:true,style:'text-align:'+this.text_align,html:this.caption}
-]};},readElement:function(A){this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','style','float');this.caption=this.getVal(A,'figcaption','html');this.text_align=this.getVal(A,'figcaption','style','text-align');this.image_width=this.getVal(A,'img','width');
+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',width:'100',friendly_name:'Image with caption',context:{width:{title:"Width %",width:40}
+,align:{title:"Align",opts:[["left"],["right"]],width:80},text_align:{title:"Caption Align",opts:[["left"],["right"],["center"]],width:80},image_src:{title:"Src",width:220}},toObject:function(){var d=document.createElement('div');d.innerHTML=this.caption;
+return {tag:'figure','data-block':'Figure',contenteditable:'false',style:{display:'table',float:this.align,width:this.width+'%'},cn:[{tag:'img',src:this.image_src,alt:d.innerText.replace(/\n/g," "),style:{width:'100%'}},{tag:'figcaption',contenteditable:true,style:{'text-align':this.text_align}
+,html:this.caption}]};},readElement:function(A){this.image_src=this.getVal(A,'img','src');this.align=this.getVal(A,'figure','style','float');this.caption=this.getVal(A,'figcaption','html');this.text_align=this.getVal(A,'figcaption','style','text-align');this.image_width=this.getVal(A,'img','width');
 this.image_height=this.getVal(A,'img','height');}})
 // 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='';