Roo/HtmlEditorCore.js wip_leon_T7717_boilderplate_included_invalid_fontfamily
authorleon <leon@roojs.com>
Mon, 7 Aug 2023 03:51:17 +0000 (11:51 +0800)
committerleon <leon@roojs.com>
Mon, 7 Aug 2023 03:51:17 +0000 (11:51 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/HtmlEditorCore.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 3912dfa..1605af7 100644 (file)
@@ -598,6 +598,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
    
     onPasteEvent : function(e,v)
     {
+        Roo.log('HTMLEDITOR ON PASTE EVENT');
         // I think we better assume paste is going to be a dirty load of rubish from word..
         
         // even pasting into a 'email version' of this widget will have to clean up that mess.
index 809502a..81d7048 100644 (file)
@@ -31445,6 +31445,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
     
     // private
     initEditor : function(){
+        Roo.log('HTMLEDITOR INITEDITOR');
         //console.log("INIT EDITOR");
         this.assignDocWin();
         
@@ -31503,6 +31504,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
    
     onPasteEvent : function(e,v)
     {
+        Roo.log('HTMLEDITOR ON PASTE EVENT');
         // I think we better assume paste is going to be a dirty load of rubish from word..
         
         // even pasting into a 'email version' of this widget will have to clean up that mess.
index cce60be..7e903a0 100644 (file)
@@ -1354,10 +1354,10 @@ this.owner.fireEvent('sync',this,D);}}},pushValue:function(){if(this.initialized
 this.owner.fireEvent('push',this,v);}if(this.autoClean){new Roo.htmleditor.FilterParagraph({node:this.doc.body});new Roo.htmleditor.FilterSpan({node:this.doc.body});}if(this.enableBlocks){Roo.htmleditor.Block.initAll(this.doc.body);}this.updateLanguage();
 var lc=this.doc.body.lastChild;if(lc&&lc.nodeType==1&&lc.getAttribute("contenteditable")=="false"){this.doc.body.appendChild(this.doc.createElement('br'));}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus();
 }else{this.el.focus();}},assignDocWin:function(){var A=this.iframe;if(Roo.isIE){this.doc=A.contentWindow.document;this.win=A.contentWindow;}else{if(!Roo.get(this.frameId)&&!A.contentDocument){return;}this.doc=(A.contentDocument||Roo.get(this.frameId).dom.document);
-this.win=(A.contentWindow||Roo.get(this.frameId).dom.contentWindow);}},initEditor:function(){this.assignDocWin();this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A=(this.doc.body||this.doc.documentElement);
+this.win=(A.contentWindow||Roo.get(this.frameId).dom.contentWindow);}},initEditor:function(){Roo.log('HTMLEDITOR INITEDITOR');this.assignDocWin();this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A=(this.doc.body||this.doc.documentElement);
 A.bgProperties='fixed';A.setAttribute("translate","no");Roo.EventManager.on(this.doc,{'mouseup':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this});Roo.EventManager.on(this.doc,{'paste':this.onPasteEvent,scope:this}
 );if(Roo.isGecko){Roo.EventManager.on(this.doc,'keypress',this.mozKeyPress,this);}if(Roo.isIE||Roo.isSafari||Roo.isOpera){Roo.EventManager.on(this.doc,'keydown',this.fixKeys,this);}this.initialized=true;new Roo.htmleditor.KeyEnter({core:this});this.owner.fireEvent('initialize',this);
-this.pushValue();},onPasteEvent:function(e,v){var cd=(e.browserEvent.clipboardData||window.clipboardData);if(cd.files&&cd.files.length>0&&cd.types.indexOf('text/html')<0){var A=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);
+this.pushValue();},onPasteEvent:function(e,v){Roo.log('HTMLEDITOR ON PASTE EVENT');var cd=(e.browserEvent.clipboardData||window.clipboardData);if(cd.files&&cd.files.length>0&&cd.types.indexOf('text/html')<0){var A=(window.createObjectURL&&window)||(window.URL&&URL.revokeObjectURL&&URL)||(window.webkitURL&&webkitURL);
 var r=new FileReader();var t=this;r.addEventListener('load',function(){var d=(new DOMParser().parseFromString('<img src="'+r.result+'">','text/html')).body;if(t.enableBlocks){Array.from(d.getElementsByTagName('img')).forEach(function(E){if(E.closest('figure')){return;
 }var F=new Roo.htmleditor.BlockFigure({image_src:E.src});F.updateElement(E);});}t.insertAtCursor(d.innerHTML.replace(/&nbsp;/g,' '));t.owner.fireEvent('paste',this);});r.readAsDataURL(cd.files[0]);e.preventDefault();return false;}if(cd.types.indexOf('text/html')<0){return false;
 }var B=[];var C=cd.getData('text/html');if(cd.types.indexOf('text/rtf')>-1){var D=new Roo.rtf.Parser(cd.getData('text/rtf'));B=D.doc?D.doc.getElementsByType('pict'):[];}B=B.filter(function(g){return !g.path.match(/^rtf\/(head|pgdsctbl|listtable|footerf)/);