3 * <figure data-block="BlockFigure" contenteditable="false" role="group" style="text-align:left">' +
4 <img data-name="image" src="{SRC}">' +
5 <figcaption data-name="caption" contenteditable="true" style="text-align:left">XXXX</figcaption>
11 new Roo.htmleditor.BlockFigure{
12 image_src : 'http://www.google.com',
15 -- load document, and search for elements of this...
16 Roo.DomQuery.select('*[data-block])
17 // loop each and call ctor ({node : xxx})
19 ** see if parent has Element.findParent(*[data-block]);
24 Roo.htmleditor.BlockFigure = function(cfg)
27 this.readElement(cfg.node);
28 this.updateElement(cfg.node);
32 Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
45 // used by context menu
46 friendly_name : 'Image with caption',
48 context : { // ?? static really
59 opts : [ [""],[ "left"],[ "right"],[ "center"],[ "top"]],
64 title: "Caption Align",
65 opts : [ [""],[ "left"],[ "right"],[ "center"],[ "top"]],
76 * create a DomHelper friendly object - for use with
77 * Roo.DomHelper.markup / overwrite / etc..
87 if ((''+this.image_width).length) {
88 img.width = this.image_width;
90 if ((''+ this.height).length) {
91 img.height = this.image_height;
95 'data-block' : 'Figure',
96 contenteditable : 'false',
97 style : 'text-align:' + this.align,
102 contenteditable : true,
103 style : 'text-align:left',
110 readElement : function(node)
112 this.image_src = this.getVal(node, 'img', 'src');
113 this.align = this.getVal(node, 'figure', 'style', 'text-align');
114 this.caption = this.getVal(node, 'figcaption', 'html');
115 this.text_align = this.getVal(node, 'figcaption', 'style','text-align');