4 * @class Roo.htmleditor.BlockFigure
5 * Block that has an image and a figcaption
6 * @cfg {String} image_src the url for the image
7 * @cfg {String} align (left|right) alignment for the block default left
8 * @cfg {String} text_align (left|right) alignment for the text caption default left.
9 * @cfg {String} caption the text to appear below (and in the alt tag)
10 * @cfg {String|number} image_width the width of the image number or %?
11 * @cfg {String|number} image_height the height of the image number or %?
14 * Create a new Filter.
15 * @param {Object} config Configuration options
18 Roo.htmleditor.BlockFigure = function(cfg)
21 this.readElement(cfg.node);
22 this.updateElement(cfg.node);
26 Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
39 // used by context menu
40 friendly_name : 'Image with caption',
42 context : { // ?? static really
55 opts : [[ "left"],[ "right"]],
60 title: "Caption Align",
61 opts : [ [ "left"],[ "right"],[ "center"]],
72 * create a DomHelper friendly object - for use with
73 * Roo.DomHelper.markup / overwrite / etc..
77 var d = document.createElement('div');
78 d.innerHTML = this.caption;
82 'data-block' : 'Figure',
83 contenteditable : 'false',
94 alt : d.innerText.replace(/\n/g, " "), // removeHTML..
101 contenteditable : true,
103 'text-align': this.text_align
112 readElement : function(node)
114 this.image_src = this.getVal(node, 'img', 'src');
115 this.align = this.getVal(node, 'figure', 'style', 'float');
116 this.caption = this.getVal(node, 'figcaption', 'html');
117 this.text_align = this.getVal(node, 'figcaption', 'style','text-align');
118 this.width = this.getVal(node, 'figure', 'style', 'width');
119 this.margin = this.getVal(node, 'figure', 'style', 'margin');