From 60f514e49792289cc20b451471017d686bbd3109 Mon Sep 17 00:00:00 2001 From: Alan Date: Mon, 10 Jan 2022 15:21:10 +0800 Subject: [PATCH] Roo/htmleditor/BlockFigure.js --- Roo/htmleditor/BlockFigure.js | 56 +++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/Roo/htmleditor/BlockFigure.js b/Roo/htmleditor/BlockFigure.js index d99a94a1c3..b5ee535ad5 100644 --- a/Roo/htmleditor/BlockFigure.js +++ b/Roo/htmleditor/BlockFigure.js @@ -67,7 +67,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { }, { xtype : 'Button', - text: 'Edit Src', + text: 'Change Image URL', listeners : { click: function (btn, state) @@ -96,24 +96,50 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { }, { - xtype : 'TextField', - allowBlank : false, - width : 150, - name : 'image_src', + xtype : 'Button', + text: 'Change Link URL', + listeners : { - keyup : function (combo, e) - { - toolbar.editorcore.selectNode(toolbar.tb.selectedNode); - var b = block(); - b.image_src = this.getValue(); - b.updateElement(); - syncValue(); - toolbar.editorcore.onEditorEvent(); + click: function (btn, state) + { + + + Roo.MessageBox.show({ + title : "Link URL", + msg : "Enter the url for the link - leave blank to have no link", + buttons: Roo.MessageBox.OKCANCEL, + fn: function(val){ + block().href = val; + block().updateElement(); + syncValue(); + toolbar.editorcore.onEditorEvent(); + }, + minWidth:250, + prompt:true, + //multiline: multiline, + modal : true, + value : block().href + }); } }, - xns : rooui.form - + xns : rooui.Toolbar }, + { + xtype : 'Button', + text: 'Show Video URL', + + listeners : { + click: function (btn, state) + { + Roo.MessageBox.alert("Video URL", + block().video_url == '' ? 'This image is not linked ot a video' : + 'The image is linked to: ' + block().video_url + ''); + } + }, + xns : rooui.Toolbar + }, + + { xtype : 'TextItem', text : "Width: ", -- 2.39.2