From 2f1a09dc6b5d39a49a55582c371f8f31b56ba157 Mon Sep 17 00:00:00 2001 From: leon Date: Mon, 27 Mar 2023 10:45:19 +0800 Subject: [PATCH] roojs-bootstrap.js roojs-bootstrap-debug.js --- roojs-bootstrap-debug.js | 8 ++++---- roojs-bootstrap.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 3d4e215815..f76272199e 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -33167,13 +33167,13 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp var reader = new FileReader(); reader.addEventListener('load', (function() { if (bl) { - var oldSn = sn; + var oldSrc = bl.image_src; bl.image_src = reader.result; //bl.caption = f.name; bl.updateElement(sn); this.editor.syncValue(); editor.owner.fireEvent('editorevent', editor.owner, false); - editor.owner.fireEvent('imageupdate', editor.owner, sn, oldSn); + editor.owner.fireEvent('imageupdate', editor.owner, sn, oldSrc); // we only do the first file!! and replace. return; } @@ -33189,11 +33189,11 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp } // just a standard img.. if (sn && sn.tagName.toUpperCase() == 'IMG') { - var oldSn = sn; + var oldSrc = sn.src; sn.src = reader.result; this.editor.syncValue(); editor.owner.fireEvent('editorevent', editor.owner, false); - editor.owner.fireEvent('imageupdate', editor.owner, sn, oldSn); + editor.owner.fireEvent('imageupdate', editor.owner, sn, oldSrc); return; } editor.insertAtCursor(''); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index ec45b8c9ea..01e8bee139 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1424,10 +1424,10 @@ i'); -this.addFiles(A,true);}).createDelegate(this));D.readAsDataURL(f);},onBtnClick:function(id){this.editorcore.relayCmd(id);this.editorcore.focus();},onLinkClick:function(A){var B=this.selectedNode&&this.selectedNode.tagName.toUpperCase()=='A'?this.selectedNode.getAttribute('href'):''; -Roo.bootstrap.MessageBox.show({title:"Add / Edit Link URL",msg:"Enter the URL for the link",buttons:Roo.bootstrap.MessageBox.OKCANCEL,minWidth:250,scope:this,prompt:true,multiline:false,modal:true,value:B,fn:function(C,D){if(C!='ok'){this.editorcore.focus(); +var D=new FileReader();D.addEventListener('load',(function(){if(bl){var E=bl.image_src;bl.image_src=D.result;bl.updateElement(sn);this.editor.syncValue();C.owner.fireEvent('editorevent',C.owner,false);C.owner.fireEvent('imageupdate',C.owner,sn,E);return;} +if(this.editorcore.enableBlocks){var F=new Roo.htmleditor.BlockFigure({image_src:D.result,caption:'',caption_display:'none'});C.insertAtCursor(F.toHTML());this.addFiles(A,true);return;}if(sn&&sn.tagName.toUpperCase()=='IMG'){var E=sn.src;sn.src=D.result;this.editor.syncValue(); +C.owner.fireEvent('editorevent',C.owner,false);C.owner.fireEvent('imageupdate',C.owner,sn,E);return;}C.insertAtCursor('');this.addFiles(A,true);}).createDelegate(this));D.readAsDataURL(f);},onBtnClick:function(id){this.editorcore.relayCmd(id); +this.editorcore.focus();},onLinkClick:function(A){var B=this.selectedNode&&this.selectedNode.tagName.toUpperCase()=='A'?this.selectedNode.getAttribute('href'):'';Roo.bootstrap.MessageBox.show({title:"Add / Edit Link URL",msg:"Enter the URL for the link",buttons:Roo.bootstrap.MessageBox.OKCANCEL,minWidth:250,scope:this,prompt:true,multiline:false,modal:true,value:B,fn:function(C,D){if(C!='ok'){this.editorcore.focus(); return;}if(B!=''){this.selectedNode.setAttribute('href',D);return;}if(D&&D.match(/http(s):\/\/.+/)){this.editorcore.relayCmd('createlink',D);}this.editorcore.focus();}});},updateToolbar:function(A,ev,B){if(!this.editorcore.activated){this.editor.onFirstFocus(); return;}var C=this.buttons;var D=this.editorcore.doc;var E=false;C.each(function(e){if(e.enableToggle&&e.cmd){E=E||(['align-left','align-right','align-center','image','link','underline'].indexOf(e.btnid)<0&&D.queryCommandState(e.cmd));e.setActive(D.queryCommandState(e.cmd)); }},this);if(ev&&(ev.type=='mouseup'||ev.type=='click')&&ev.target&&ev.target.tagName!='BODY'){B=ev.target;}var F=this.editorcore.getAllAncestors();if(!B){B=F.length?(F[0]?F[0]:F[1]):this.editorcore.doc.body;B=B?B:this.editorcore.doc.body;B=B.tagName.length?B:this.editorcore.doc.body; -- 2.39.2