listeners : {
click: function (btn, state)
{
-
+ var b = block();
Roo.MessageBox.show({
title : "Image Source URL",
msg : "Enter the url for the image",
buttons: Roo.MessageBox.OKCANCEL,
- fn: function(val){
- block().image_src = val;
- block().updateElement();
+ fn: function(btn, val){
+ if (btn != 'ok') {
+ return;
+ }
+ b.image_src = val;
+ b.updateElement();
syncValue();
toolbar.editorcore.onEditorEvent();
},
prompt:true,
//multiline: multiline,
modal : true,
- value : block().image_src
+ value : b.image_src
});
}
},
listeners : {
click: function (btn, state)
{
-
+ var b = block();
Roo.MessageBox.show({
title : "Link URL",
msg : "Enter the url for the link - leave blank to have no link",
buttons: Roo.MessageBox.OKCANCEL,
- fn: function(val){
- block().href = val;
- block().updateElement();
+ fn: function(btn, val){
+ if (btn != 'ok') {
+ return;
+ }
+ b.href = val;
+ b.updateElement();
syncValue();
toolbar.editorcore.onEditorEvent();
},
prompt:true,
//multiline: multiline,
modal : true,
- value : block().href
+ value : b.href
});
}
},
};
}
+ var captionhtml = this.caption_display == 'hidden' ? this.caption : (this.caption.length ? this.caption : "Caption");
+
return {
tag: 'figure',
'data-block' : 'Figure',
{
tag: 'figcaption',
- contenteditable : true,
+
style : {
'text-align': 'left',
'margin-top' : '16px',
'font-size' : '16px',
'line-height' : '24px',
- 'font-style': 'italic',
- display : this.caption_display
+ display : this.caption_display
},
cls : this.cls.length > 0 ? (this.cls + '-thumbnail' ) : '',
- html : this.caption
+ cn : [
+ {
+ // we can not rely on yahoo syndication to use CSS elements - so have to use '<i>' to encase stuff.
+ tag : 'i',
+ contenteditable : true,
+ html : captionhtml
+ }
+ ]
}
]
this.align = this.getVal(node, 'figure', 'align');
this.caption = this.getVal(node, 'figcaption', 'html');
+ // remove '<i>
+ if (this.caption.trim().match(/^<i[^>]*>/i)) {
+ this.caption = this.caption.trim().replace(/^<i[^>]*>/i, '').replace(/^<\/i>$/i, '');
+ }
//this.text_align = this.getVal(node, 'figcaption', 'style','text-align');
this.width = this.getVal(node, 'figure', 'style', 'max-width');
//this.margin = this.getVal(node, 'figure', 'style', 'margin');