X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-debug.js;h=27f607683cfc9137cb51c7d1ab1977af84eeedc3;hb=b999dac6d220ed742af894af4750d19d0e6dc586;hp=fd59d16cf1e2bfe23778f8e8438ea496aa3b6ab7;hpb=c0b943e982fe1ff8575284c337553e18b7733cec;p=roojs1
diff --git a/roojs-debug.js b/roojs-debug.js
index fd59d16cf1..27f607683c 100644
--- a/roojs-debug.js
+++ b/roojs-debug.js
@@ -46711,6 +46711,9 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
caption : '',
caption_display : 'block',
width : '100%',
+ cls : '',
+ href: '',
+ video_url : '',
// margin: '2%', not used
@@ -46877,6 +46880,54 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
var m = this.width == '50%' && this.align == 'center' ? '0 auto' : 0;
+ var img = {
+ tag : 'img',
+ contenteditable : 'false',
+ src : this.image_src,
+ alt : d.innerText.replace(/\n/g, " "), // removeHTML..
+ style: {
+ width : 'auto',
+ 'max-width': '100%',
+ margin : '0px'
+
+
+ }
+ };
+ /*
+ '
',
+ */
+
+ 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
+ ]
+ };
+ }
+
return {
tag: 'figure',
'data-block' : 'Figure',
@@ -46890,20 +46941,12 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
padding: '10px'
},
+
+
align : this.align,
cn : [
- {
- tag : 'img',
- src : this.image_src,
- alt : d.innerText.replace(/\n/g, " "), // removeHTML..
- style: {
- width : 'auto',
- 'max-width': '100%',
- margin : '0px'
-
-
- }
- },
+ img,
+
{
tag: 'figcaption',
contenteditable : true,
@@ -46915,6 +46958,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
'font-style': 'italic',
display : this.caption_display
},
+ cls : this.cls.length > 0 ? (this.cls + '-thumbnail' ) : '',
html : this.caption
}
@@ -46925,7 +46969,13 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
readElement : function(node)
{
+ // this should not really come from the link...
+ 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');
+
this.align = this.getVal(node, 'figure', 'align');
this.caption = this.getVal(node, 'figcaption', 'html');
//this.text_align = this.getVal(node, 'figcaption', 'style','text-align');
@@ -48697,7 +48747,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, {
dbody.bgProperties = 'fixed'; // ie
//Roo.DomHelper.applyStyles(dbody, ss);
Roo.EventManager.on(this.doc, {
- //'mousedown': this.onEditorEvent,
+
'mouseup': this.onEditorEvent,
'dblclick': this.onEditorEvent,
'click': this.onEditorEvent,
@@ -48728,7 +48778,8 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, {
this.owner.fireEvent('initialize', this);
this.pushValue();
},
-
+ // this is to prevent a href clicks resulting in a redirect?
+
onPasteEvent : function(e,v)
{
// I think we better assume paste is going to be a dirty load of rubish from word..
@@ -48887,6 +48938,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, {
onEditorEvent : function(e)
{
+
if (e && (e.ctrlKey || e.metaKey) && e.keyCode === 90) {
return; // we do not handle this.. (undo manager does..)