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
27 * @cfg {String} image_src the url for the image
28 * @cfg {String} align (left|right) alignment for the block default left
29 * @cfg {String} text_align (left|right) alignment for the text caption default left.
30 * @cfg {String} caption the text to appear below (and in the alt tag)
31 * @cfg {String|number} image_width the width of the image number or %?
32 * @cfg {String|number} image_height the height of the image number or %?
35 * Create a new Filter.
36 * @param {Object} config Configuration options
39 Roo.htmleditor.BlockFigure = function(cfg)
42 this.readElement(cfg.node);
43 this.updateElement(cfg.node);
47 Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
60 // used by context menu
61 friendly_name : 'Image with caption',
63 context : { // ?? static really
74 opts : [ [""],[ "left"],[ "right"],[ "center"],[ "top"]],
79 title: "Caption Align",
80 opts : [ [""],[ "left"],[ "right"],[ "center"],[ "top"]],
91 * create a DomHelper friendly object - for use with
92 * Roo.DomHelper.markup / overwrite / etc..
102 if ((''+this.image_width).length) {
103 img.width = this.image_width;
105 if ((''+ this.height).length) {
106 img.height = this.image_height;
110 'data-block' : 'Figure',
111 contenteditable : 'false',
112 style : 'text-align:' + this.align,
117 contenteditable : true,
118 style : 'text-align:left',
125 readElement : function(node)
127 this.image_src = this.getVal(node, 'img', 'src');
128 this.align = this.getVal(node, 'figure', 'style', 'text-align');
129 this.caption = this.getVal(node, 'figcaption', 'html');
130 this.text_align = this.getVal(node, 'figcaption', 'style','text-align');