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]);
25 * @class Roo.htmleditor.BlockFigure
26 * Block that has an image and a figcaption
29 * Create a new Filter.
30 * @param {Object} config Configuration options
33 Roo.htmleditor.BlockFigure = function(cfg)
36 this.readElement(cfg.node);
37 this.updateElement(cfg.node);
41 Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
54 // used by context menu
55 friendly_name : 'Image with caption',
57 context : { // ?? static really
68 opts : [ [""],[ "left"],[ "right"],[ "center"],[ "top"]],
73 title: "Caption Align",
74 opts : [ [""],[ "left"],[ "right"],[ "center"],[ "top"]],
85 * create a DomHelper friendly object - for use with
86 * Roo.DomHelper.markup / overwrite / etc..
96 if ((''+this.image_width).length) {
97 img.width = this.image_width;
99 if ((''+ this.height).length) {
100 img.height = this.image_height;
104 'data-block' : 'Figure',
105 contenteditable : 'false',
106 style : 'text-align:' + this.align,
111 contenteditable : true,
112 style : 'text-align:left',
119 readElement : function(node)
121 this.image_src = this.getVal(node, 'img', 'src');
122 this.align = this.getVal(node, 'figure', 'style', 'text-align');
123 this.caption = this.getVal(node, 'figcaption', 'html');
124 this.text_align = this.getVal(node, 'figcaption', 'style','text-align');