}
Roo.apply(this, cfg);
}
-
-Roo.htmleditor.BlockFigure.prototype = {
+Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
+
// setable values.
image_src: '',
image_height : '',
// used by context menu
+ friendly_name : 'Image with caption',
context : { // ?? static really
image_width : {
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);
-
- }
-
-
-
-}
+})