);};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='';
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"]],
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
+
}
]
};
);};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='';
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"]],
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
+
}
]
};
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"]],
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
+
}
]
};
);};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='';