X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-debug.js;h=27f607683cfc9137cb51c7d1ab1977af84eeedc3;hb=b999dac6d220ed742af894af4750d19d0e6dc586;hp=c96dc16a22c3df19a0c590f3140b216602cde40d;hpb=42f8fea01a43e6eba8c36f5cc9b7318081be8001;p=roojs1 diff --git a/roojs-debug.js b/roojs-debug.js index c96dc16a22..27f607683c 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -34771,6 +34771,7 @@ Roo.extend(Roo.LayoutDialog, Roo.BasicDialog, { /** * @class Roo.MessageBox + * @static * Utility class for generating different styles of message boxes. The alias Roo.Msg can also be used. * Example usage: *

@@ -46710,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
     
@@ -46874,6 +46878,56 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, {
         var d = document.createElement('div');
         d.innerHTML = this.caption;
         
+        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', @@ -46883,24 +46937,16 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { float : this.align , 'max-width': this.width, width : 'auto', - margin: 0, + margin: m, 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, @@ -46912,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 } @@ -46922,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'); @@ -48307,6 +48360,11 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { * */ stylesheets: false, + /** + * @cfg {String} language default en - language of text (usefull for rtl languages) + * + */ + language: 'en', /** * @cfg {boolean} allowComments - default false - allow comments in HTML source @@ -48617,6 +48675,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { } Roo.htmleditor.Block.initAll(this.doc.body); + this.updateLanguage(); var lc = this.doc.body.lastChild; if (lc && lc.nodeType == 1 && lc.getAttribute("contenteditable") == "false") { @@ -48688,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, @@ -48719,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.. @@ -48878,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..) @@ -49609,6 +49670,16 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { }, + + updateLanguage : function() + { + if (!this.iframe || !this.iframe.contentDocument) { + return; + } + Roo.get(this.iframe.contentDocument.body).attr("lang", this.language); + }, + + removeStylesheets : function() { var _this = this; @@ -49844,7 +49915,13 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, { * @cfg {string} bodyCls- default '' default classes to add to body of editable area - usually undoreset is a good start.. */ bodyCls : '', + /** + * @cfg {String} language default en - language of text (usefull for rtl languages) + * + */ + language: 'en', + // id of frame.. frameId: false, @@ -50288,7 +50365,17 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, { this.editorcore.pushValue(); }, + /** + * update the language in the body - really done by core + * @param {String} language - eg. en / ar / zh-CN etc.. + */ + updateLanguage : function(lang) + { + this.language = lang; + this.editorcore.language = lang; + this.editorcore.updateLanguage(); + }, // private deferFocus : function(){ this.focus.defer(10, this); @@ -50921,10 +51008,13 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype, { // private used internally createLink : function(){ Roo.log("create link?"); - var url = prompt(this.createLinkText, this.defaultLinkValue); - if(url && url != 'http:/'+'/'){ - this.editorcore.relayCmd('createlink', url); - } + var ec = this.editorcore; + Roo.MessageBox.prompt("Add Link URL",this.createLinkText, function(url) { + if(url && url != 'http:/'+'/'){ + ec.relayCmd('createlink', url); + } + }); + },