caption : '',
caption_display : 'block',
width : '100%',
+ cls : '',
+ href: '',
+ video_url : '',
// margin: '2%', not used
var img = {
tag : 'img',
+ contenteditable : 'false',
src : this.image_src,
- alt : d.innerText.replace(/\n/g, " "), // removeHTML..
+ alt : d.innerText.replace(/\n/g, " ").replace(/\s+/g, ' ').trim(), // removeHTML and reduce spaces..
style: {
width : 'auto',
'max-width': '100%',
}
};
-
+ /*
'<div class="{0}" width="420" height="315" src="{1}" frameborder="0" allowfullscreen>' +
'<a href="{2}">' +
'<img class="{0}-thumbnail" src="{3}/Images/{4}/{5}#image-{4}" />' +
'</a>' +
'</div>',
-
+ */
- if (this.href) {
+ if (this.href.length > 0) {
img = {
tag : 'a',
href: this.href,
+ contenteditable : 'true',
+ cn : [
+ img
+ ]
+ };
+ }
+
+
+ if (this.video_url.length > 0) {
+ img = {
+ tag : 'div',
+ cls : this.cls,
+ frameborder : 0,
+ allowfullscreen : true,
+ width : 420, // these are for video tricks - that we replace the outer
+ height : 315,
+ src : this.video_url,
cn : [
img
]
padding: '10px'
},
- frameborder : 0,
- allowfullscreen : true,
- src : this.video_src,
- cls : this.cls,
+
+
align : this.align,
cn : [
img,
'font-style': 'italic',
display : this.caption_display
},
+ cls : this.cls.length > 0 ? (this.cls + '-thumbnail' ) : '',
html : this.caption
}
readElement : function(node)
{
// this should not really come from the link...
- this.video_src = this.getVal(node, false, 'src');
- this.cls = this.getVal(node, false, 'class');
+ this.video_url = this.getVal(node, 'div', 'src');
+ this.cls = this.getVal(node, 'div', 'class');
this.href = this.getVal(node, 'a', 'href');
this.image_src = this.getVal(node, 'img', 'src');