From: Alan Date: Tue, 28 Sep 2021 08:40:09 +0000 (+0800) Subject: sync X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=b12e9d5547a74e77c9d649f1968263c8a569de43;p=roojs1 sync --- diff --git a/Roo/HtmlEditorCore.js b/Roo/HtmlEditorCore.js index 4671397ed5..f25bd8c9be 100644 --- a/Roo/HtmlEditorCore.js +++ b/Roo/HtmlEditorCore.js @@ -332,6 +332,10 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { if(this.initialized){ var bd = (this.doc.body || this.doc.documentElement); //this.cleanUpPaste(); -- this is done else where and causes havoc.. + + // remove content editable. (blocks) + new Roo.htmleditor.FilterAttribute({node : bd, attrib_black: [ 'contenteditable' ] }); + var html = bd.innerHTML; if(Roo.isSafari){ var bs = bd.getAttribute('style'); // Safari puts text-align styles on the body element! diff --git a/Roo/htmleditor/BlockFigure.js b/Roo/htmleditor/BlockFigure.js index 8a7216f83a..1c9ff61ce9 100644 --- a/Roo/htmleditor/BlockFigure.js +++ b/Roo/htmleditor/BlockFigure.js @@ -8,10 +8,10 @@ usage: -- add to document.. - new Roo.htmleditor.BlockFigure{ + new Roo.htmleditor.BlockFigure{ image_src : 'http://www.google.com', caption : 'test', - } + } -- load document, and search for elements of this... Roo.DomQuery.select('*[data-block]) // loop each and call ctor ({node : xxx}) @@ -42,6 +42,8 @@ Roo.htmleditor.BlockFigure.prototype = { image_width : '', image_height : '', + // used by context menu + context : { // ?? static really image_width : { title: "Width", @@ -72,7 +74,10 @@ Roo.htmleditor.BlockFigure.prototype = { width: 220 } }, - + /** + * create a DomHelper friendly object - for use with + * Roo.DomHelper.markup / overwrite / etc.. + */ toObject : function() { @@ -96,7 +101,6 @@ Roo.htmleditor.BlockFigure.prototype = { img, { tag: 'figcaption', - 'data-name' : 'caption', contenteditable : true, style : 'text-align:left', html : this.caption @@ -104,6 +108,7 @@ Roo.htmleditor.BlockFigure.prototype = { ] }; }, + readElement : function(node) { this.image_src = this.getVal(node, 'img', 'src'); @@ -115,7 +120,10 @@ Roo.htmleditor.BlockFigure.prototype = { updateElement : function(node) { Roo.DomHelper.overwrite(node, this.toObject()); - + }, + toHTML : function() + { + Roo.DomHelper.markup(this.toObject()); }, getVal : function(node, tag, attr, style)