From c5abe12993556b0f0da6cf57db292c12f4b39a98 Mon Sep 17 00:00:00 2001 From: leon Date: Wed, 29 Mar 2023 12:29:30 +0800 Subject: [PATCH] Roo/bootstrap/form/HtmlEditorToolbar/Standard.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/bootstrap/form/HtmlEditorToolbar/Standard.js | 1 + roojs-bootstrap-debug.js | 1 + roojs-bootstrap.js | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Roo/bootstrap/form/HtmlEditorToolbar/Standard.js b/Roo/bootstrap/form/HtmlEditorToolbar/Standard.js index acb2566958..ccd7255719 100644 --- a/Roo/bootstrap/form/HtmlEditorToolbar/Standard.js +++ b/Roo/bootstrap/form/HtmlEditorToolbar/Standard.js @@ -325,6 +325,7 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp this.editorcore.relayCmd('createlink', newurl); } this.editorcore.focus(); + this.editor.syncValue(); }, cls : 'pub-error' }); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index a3d1d7f0f3..4f79480a09 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -33241,6 +33241,7 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp this.editorcore.relayCmd('createlink', newurl); } this.editorcore.focus(); + this.editor.syncValue(); }, cls : 'pub-error' }); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index dd71c5ded0..3c0e4c2314 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1428,7 +1428,7 @@ var D=new FileReader();D.addEventListener('load',(function(){if(bl){var E=bl.ima 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();},cls:'pub-error'});},updateToolbar:function(A,ev,B){if(!this.editorcore.activated){this.editor.onFirstFocus(); +return;}if(B!=''){this.selectedNode.setAttribute('href',D);return;}if(D&&D.match(/http(s):\/\/.+/)){this.editorcore.relayCmd('createlink',D);}this.editorcore.focus();this.editor.syncValue();},cls:'pub-error'});},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; }var G=this.selectedNode;this.selectedNode=B;var db=false;if(B&&B.hasAttribute('data-block')){db=B;}else if(B&&B.closest('[data-block]')){db=B.closest('[data-block]');}Array.from(this.editorcore.doc.body.querySelectorAll('.roo-ed-selection')).forEach(function(e){e.classList.remove('roo-ed-selection'); -- 2.39.2