From 4ffff0b75e1e2e8e4a75820e2ee3712a4bfd3e2e Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 16 Feb 2023 18:08:43 +0800 Subject: [PATCH] more changes editor --- .../form/HtmlEditorToolbar/Standard.js | 3 ++- docs/src/Roo_HtmlEditorCore.js.html | 1 + ...rap_form_HtmlEditorToolbar_Standard.js.html | 18 +++++++++++++++++- roojs-bootstrap-debug.js | 3 ++- roojs-bootstrap.js | 2 +- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Roo/bootstrap/form/HtmlEditorToolbar/Standard.js b/Roo/bootstrap/form/HtmlEditorToolbar/Standard.js index 7c1bf13787..e28ee235e1 100644 --- a/Roo/bootstrap/form/HtmlEditorToolbar/Standard.js +++ b/Roo/bootstrap/form/HtmlEditorToolbar/Standard.js @@ -185,7 +185,8 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp size : 'sm', xtype: 'Button', xns: Roo.bootstrap, - fa: 'trash', + fa: 'eraser', + tooltip : "Clear Formating / Delete", listeners : { click : this.onDelete.createDelegate(this) } diff --git a/docs/src/Roo_HtmlEditorCore.js.html b/docs/src/Roo_HtmlEditorCore.js.html index cfce2cea93..76e9aaa0c7 100644 --- a/docs/src/Roo_HtmlEditorCore.js.html +++ b/docs/src/Roo_HtmlEditorCore.js.html @@ -907,6 +907,7 @@ break; case 'bold': case 'italic': + case 'underline': // if there is no selection, then we insert, and set the curson inside it.. this.execCmd('styleWithCSS', false); break; diff --git a/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Standard.js.html b/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Standard.js.html index 13316b80a2..1f235d8b55 100644 --- a/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Standard.js.html +++ b/docs/src/Roo_bootstrap_form_HtmlEditorToolbar_Standard.js.html @@ -135,8 +135,14 @@ }); children.push(style); +<<<<<<< Updated upstream btn('bold', false,true); btn('italic', false,true); +======= + btn('bold', 'bold',true); + btn('italic', 'italic',true); + btn('underline', 'underline',true); +>>>>>>> Stashed changes btn('align-left', 'justifyleft',true); btn('align-center', 'justifycenter',true); btn('align-right' , 'justifyright',true); @@ -185,7 +191,8 @@ size : 'sm', xtype: 'Button', xns: Roo.bootstrap, - fa: 'trash', + fa: 'eraser', + tooltip : "Clear Formating / Delete", listeners : { click : this.onDelete.createDelegate(this) } @@ -328,7 +335,11 @@ var hasToggle = false; btns.each(function(e) { if (e.enableToggle && e.cmd) { +<<<<<<< Updated upstream hasToggle = hasToggle || (['align-left', 'align-right', 'align-center'].indexOf(e.btnid) < 0 && doc.queryCommandState(e.cmd)); +======= + hasToggle = hasToggle || (['align-left', 'align-right', 'align-center', 'image' , 'link', 'underline'].indexOf(e.btnid) < 0 && doc.queryCommandState(e.cmd)); +>>>>>>> Stashed changes e.setActive(doc.queryCommandState(e.cmd)); } }, this); @@ -389,6 +400,11 @@ } btns.get('link').setActive(tn == 'A' && this.selectedNode.hasAttribute('href')); +<<<<<<< Updated upstream +======= + btns.get('image').setActive(tn == 'IMG' || this.editorcore.enableBlocks && tn == 'FIGURE'); + btns.get('underline').setActive(tn == 'U' || sel.closest('u') ? true : false); +>>>>>>> Stashed changes Roo.bootstrap.menu.Manager.hideAll(); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index b6dfdfab99..20eb3be570 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -33053,7 +33053,8 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp size : 'sm', xtype: 'Button', xns: Roo.bootstrap, - fa: 'trash', + fa: 'eraser', + tooltip : "Clear Formating / Delete", listeners : { click : this.onDelete.createDelegate(this) } diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index fd03c37149..9a4d336a60 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1419,7 +1419,7 @@ Roo.log(this.el);this.el.dom.style.marginBottom='0';var B=this;var C=this.editor };a.listeners[H?'toggle':'click']=function(){I?I.call(B,this):B.onBtnClick.call(B,G||id);};E.push(a);return a;};var style={xtype:'Button',size:'sm',xns:Roo.bootstrap,fa:'font',menu:{xtype:'Menu',xns:Roo.bootstrap,items:[]}};Roo.each(this.formats,function(f){style.menu.items.push({xtype:'MenuItem',xns:Roo.bootstrap,html:'<'+f+' style="margin:2px">'+f+'',tagname:f,listeners:{click:function(){C.insertTag(this.tagname); D.focus();}}});});E.push(style);F('bold',false,true);F('italic',false,true);F('align-left','justifyleft',true);F('align-center','justifycenter',true);F('align-right','justifyright',true);F('link',false,true,this.onLinkClick);F('image',false,true,this.onImageClick); F('list','insertunorderedlist',true);F('list-ol','insertorderedlist',true);F('pencil',false,true,function(G){Roo.log(this);this.toggleSourceEdit(G.pressed);});if(this.editor.btns.length>0){for(var i=0;i