From b5de8c7f9057a2e74f9ea89579741c153b4d670e Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 21 Jan 2022 11:51:36 +0800 Subject: [PATCH] sync --- docs/src/Roo_HtmlEditorCore.js.html | 4 +- ...oo_form_HtmlEditor_ToolbarStandard.js.html | 42 +++++++++++++++---- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/docs/src/Roo_HtmlEditorCore.js.html b/docs/src/Roo_HtmlEditorCore.js.html index 49bf09550a..80d42a1dae 100644 --- a/docs/src/Roo_HtmlEditorCore.js.html +++ b/docs/src/Roo_HtmlEditorCore.js.html @@ -448,8 +448,10 @@ new Roo.htmleditor.FilterParagraph({node : this.doc.body}); // paragraphs new Roo.htmleditor.FilterSpan({node : this.doc.body}); // empty spans } + if (this.enableBlocks) { + Roo.htmleditor.Block.initAll(this.doc.body); + } - Roo.htmleditor.Block.initAll(this.doc.body); this.updateLanguage(); var lc = this.doc.body.lastChild; diff --git a/docs/src/Roo_form_HtmlEditor_ToolbarStandard.js.html b/docs/src/Roo_form_HtmlEditor_ToolbarStandard.js.html index 9820f06393..1b19c1ffc2 100644 --- a/docs/src/Roo_form_HtmlEditor_ToolbarStandard.js.html +++ b/docs/src/Roo_form_HtmlEditor_ToolbarStandard.js.html @@ -526,15 +526,41 @@ createLink : function(){ //Roo.log("create link?"); var ec = this.editorcore; + var ar = ec.getAllAncestors(); + var n = false; + for(var i = 0;i< ar.length;i++) { + if (ar[i] && ar[i].nodeName == 'A') { + n = ar[i]; + break; + } + } + (function() { - Roo.MessageBox.prompt("Add Link URL",this.createLinkText, function(btn, url) { - if (btn != 'ok') { - return; - } - if(url && url != 'http:/'+'/'){ - ec.relayCmd('createlink', url); - } - }); + + Roo.MessageBox.show({ + title : "Add / Edit Link URL", + msg : "Enter the url for the link", + buttons: Roo.MessageBox.OKCANCEL, + fn: function(btn, url){ + if (btn != 'ok') { + return; + } + if(url && url != 'http:/'+'/'){ + if (n) { + n.setAttribute('href', url); + } else { + ec.relayCmd('createlink', url); + } + } + }, + minWidth:250, + prompt:true, + //multiline: multiline, + modal : true, + value : n ? n.getAttribute('href') : '' + }); + + }).defer(100, this); // we have to defer this , otherwise the mouse click gives focus to the main window. }, -- 2.39.2