Roo/bootstrap/form/HtmlEditorToolbar/Standard.js
authorleon <leon@roojs.com>
Wed, 29 Mar 2023 04:50:54 +0000 (12:50 +0800)
committerleon <leon@roojs.com>
Wed, 29 Mar 2023 04:50:54 +0000 (12:50 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/form/HtmlEditorToolbar/Standard.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index ccd7255..3b07e5b 100644 (file)
@@ -325,6 +325,7 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp
                     this.editorcore.relayCmd('createlink', newurl);
                 }
                 this.editorcore.focus();
+                Roo.log("SYNC VALUE");
                 this.editor.syncValue();
             },
             cls : 'pub-error'
index 4f79480..55d4dad 100644 (file)
@@ -33241,6 +33241,7 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp
                     this.editorcore.relayCmd('createlink', newurl);
                 }
                 this.editorcore.focus();
+                Roo.log("SYNC VALUE");
                 this.editor.syncValue();
             },
             cls : 'pub-error'
index 3c0e4c2..30ee567 100644 (file)
@@ -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('<img src="'+D.result+'">');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();this.editor.syncValue();},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();Roo.log("SYNC VALUE");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');