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',
41 deleteTitle : "Delete Image and Caption",
43 context : { // ?? static really
56 opts : [[ "left"],[ "right"]],
61 title: "Caption Align",
62 opts : [ [ "left"],[ "right"],[ "center"]],
73 * create a DomHelper friendly object - for use with
74 * Roo.DomHelper.markup / overwrite / etc..
78 var d = document.createElement('div');
79 d.innerHTML = this.caption;
83 'data-block' : 'Figure',
84 contenteditable : 'false',
95 alt : d.innerText.replace(/\n/g, " "), // removeHTML..
102 contenteditable : true,
104 'text-align': this.text_align
113 readElement : function(node)
115 this.image_src = this.getVal(node, 'img', 'src');
116 this.align = this.getVal(node, 'figure', 'style', 'float');
117 this.caption = this.getVal(node, 'figcaption', 'html');
118 this.text_align = this.getVal(node, 'figcaption', 'style','text-align');
119 this.width = this.getVal(node, 'figure', 'style', 'width');
120 this.margin = this.getVal(node, 'figure', 'style', 'margin');