From: Alan Date: Mon, 10 Jan 2022 07:08:15 +0000 (+0800) Subject: roojs-ui.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=7191a9a64df4775b1fa5b15bc938e10303c67ace roojs-ui.js roojs-ui-debug.js roojs-bootstrap.js roojs-bootstrap-debug.js roojs-all.js roojs-debug.js Roo/htmleditor/BlockFigure.js --- diff --git a/Roo/htmleditor/BlockFigure.js b/Roo/htmleditor/BlockFigure.js index 0eda7fe1cc..723f867684 100644 --- a/Roo/htmleditor/BlockFigure.js +++ b/Roo/htmleditor/BlockFigure.js @@ -82,6 +82,8 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { fn: function(val){ block().image_src = val; block().updateElement(); + syncValue(); + toolbar.editorcore.onEditorEvent(); }, minWidth:250, prompt:true, diff --git a/roojs-all.js b/roojs-all.js index fd0de233c2..9143c0731f 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1985,7 +1985,8 @@ Roo.htmleditor.Block=function(A){};Roo.htmleditor.Block.factory=function(A){var ;},readElement:function(A){}}; // Roo/htmleditor/BlockFigure.js Roo.htmleditor.BlockFigure=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);};Roo.extend(Roo.htmleditor.BlockFigure,Roo.htmleditor.Block,{image_src:'',align:'center',caption:'',caption_display:'block',width:'100%',cls:'',href:'',video_url:'',text_align:'left',friendly_name:'Image with caption',deleteTitle:"Delete Image and Caption",contextMenu:function(A){var B=function(){return Roo.htmleditor.Block.factory(A.tb.selectedNode); -};var C=typeof(Roo.bootstrap)=='undefined'?Roo:Roo.bootstrap;var D=A.editorcore.syncValue;var E={};return [{xtype:'TextItem',text:"Source: ",xns:C.Toolbar},{xtype:'TextField',allowBlank:false,width:150,name:'image_src',listeners:{keyup:function(F,e){A.editorcore.selectNode(A.tb.selectedNode); +};var C=typeof(Roo.bootstrap)=='undefined'?Roo:Roo.bootstrap;var D=A.editorcore.syncValue;var E={};return [{xtype:'TextItem',text:"Source: ",xns:C.Toolbar},{xtype:'Button',text:'Edit Src',name:'image_src',listeners:{click:function(F,G){Roo.MessageBox.show({title:"Image Source URL",msg:"Enter the url for the image",buttons:this.OKCANCEL,fn:function(H){B().image_src=H; +B().updateElement();D();A.editorcore.onEditorEvent();},minWidth:250,prompt:true,modal:true,value:B().image_src});}},xns:C.Toolbar},{xtype:'TextField',allowBlank:false,width:150,name:'image_src',listeners:{keyup:function(F,e){A.editorcore.selectNode(A.tb.selectedNode); var b=B();b.image_src=this.getValue();b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form},{xtype:'TextItem',text:"Width: ",xns:C.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:70,name:'width',listeners:{select:function(F,r,G){A.editorcore.selectNode(A.tb.selectedNode); var b=B();b.width=r.get('val');b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form,store:{xtype:'SimpleStore',data:[['auto'],['50%'],['100%']],fields:['val'],xns:Roo.data}},{xtype:'TextItem',text:"Align: ",xns:C.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:70,name:'align',listeners:{select:function(F,r,G){A.editorcore.selectNode(A.tb.selectedNode); var b=B();b.align=r.get('val');b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form,store:{xtype:'SimpleStore',data:[['left'],['right'],['center']],fields:['val'],xns:Roo.data}},{xtype:'Button',text:'Hide Caption',name:'caption_display',pressed:false,enableToggle:true,setValue:function(v){this.toggle(v=='block'?false:true); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index e66fdc2593..09a40facf1 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -27035,6 +27035,37 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { text : "Source: ", xns : rooui.Toolbar //Boostrap? }, + { + xtype : 'Button', + text: 'Edit Src', + name : 'image_src', + + listeners : { + click: function (btn, state) + { + + + Roo.MessageBox.show({ + title : "Image Source URL", + msg : "Enter the url for the image", + buttons: this.OKCANCEL, + fn: function(val){ + block().image_src = val; + block().updateElement(); + syncValue(); + toolbar.editorcore.onEditorEvent(); + }, + minWidth:250, + prompt:true, + //multiline: multiline, + modal : true, + value : block().image_src + }); + } + }, + xns : rooui.Toolbar + }, + { xtype : 'TextField', allowBlank : false, diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 1854804461..59cbacc8ab 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1175,7 +1175,8 @@ Roo.htmleditor.Block=function(A){};Roo.htmleditor.Block.factory=function(A){var ;},readElement:function(A){}}; // Roo/htmleditor/BlockFigure.js Roo.htmleditor.BlockFigure=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);};Roo.extend(Roo.htmleditor.BlockFigure,Roo.htmleditor.Block,{image_src:'',align:'center',caption:'',caption_display:'block',width:'100%',cls:'',href:'',video_url:'',text_align:'left',friendly_name:'Image with caption',deleteTitle:"Delete Image and Caption",contextMenu:function(A){var B=function(){return Roo.htmleditor.Block.factory(A.tb.selectedNode); -};var C=typeof(Roo.bootstrap)=='undefined'?Roo:Roo.bootstrap;var D=A.editorcore.syncValue;var E={};return [{xtype:'TextItem',text:"Source: ",xns:C.Toolbar},{xtype:'TextField',allowBlank:false,width:150,name:'image_src',listeners:{keyup:function(F,e){A.editorcore.selectNode(A.tb.selectedNode); +};var C=typeof(Roo.bootstrap)=='undefined'?Roo:Roo.bootstrap;var D=A.editorcore.syncValue;var E={};return [{xtype:'TextItem',text:"Source: ",xns:C.Toolbar},{xtype:'Button',text:'Edit Src',name:'image_src',listeners:{click:function(F,G){Roo.MessageBox.show({title:"Image Source URL",msg:"Enter the url for the image",buttons:this.OKCANCEL,fn:function(H){B().image_src=H; +B().updateElement();D();A.editorcore.onEditorEvent();},minWidth:250,prompt:true,modal:true,value:B().image_src});}},xns:C.Toolbar},{xtype:'TextField',allowBlank:false,width:150,name:'image_src',listeners:{keyup:function(F,e){A.editorcore.selectNode(A.tb.selectedNode); var b=B();b.image_src=this.getValue();b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form},{xtype:'TextItem',text:"Width: ",xns:C.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:70,name:'width',listeners:{select:function(F,r,G){A.editorcore.selectNode(A.tb.selectedNode); var b=B();b.width=r.get('val');b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form,store:{xtype:'SimpleStore',data:[['auto'],['50%'],['100%']],fields:['val'],xns:Roo.data}},{xtype:'TextItem',text:"Align: ",xns:C.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:70,name:'align',listeners:{select:function(F,r,G){A.editorcore.selectNode(A.tb.selectedNode); var b=B();b.align=r.get('val');b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form,store:{xtype:'SimpleStore',data:[['left'],['right'],['center']],fields:['val'],xns:Roo.data}},{xtype:'Button',text:'Hide Caption',name:'caption_display',pressed:false,enableToggle:true,setValue:function(v){this.toggle(v=='block'?false:true); diff --git a/roojs-debug.js b/roojs-debug.js index f370891106..ca9f42c2cb 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -47865,6 +47865,37 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { text : "Source: ", xns : rooui.Toolbar //Boostrap? }, + { + xtype : 'Button', + text: 'Edit Src', + name : 'image_src', + + listeners : { + click: function (btn, state) + { + + + Roo.MessageBox.show({ + title : "Image Source URL", + msg : "Enter the url for the image", + buttons: this.OKCANCEL, + fn: function(val){ + block().image_src = val; + block().updateElement(); + syncValue(); + toolbar.editorcore.onEditorEvent(); + }, + minWidth:250, + prompt:true, + //multiline: multiline, + modal : true, + value : block().image_src + }); + } + }, + xns : rooui.Toolbar + }, + { xtype : 'TextField', allowBlank : false, diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 7e8e6b490f..09b8331f7b 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -23396,6 +23396,37 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { text : "Source: ", xns : rooui.Toolbar //Boostrap? }, + { + xtype : 'Button', + text: 'Edit Src', + name : 'image_src', + + listeners : { + click: function (btn, state) + { + + + Roo.MessageBox.show({ + title : "Image Source URL", + msg : "Enter the url for the image", + buttons: this.OKCANCEL, + fn: function(val){ + block().image_src = val; + block().updateElement(); + syncValue(); + toolbar.editorcore.onEditorEvent(); + }, + minWidth:250, + prompt:true, + //multiline: multiline, + modal : true, + value : block().image_src + }); + } + }, + xns : rooui.Toolbar + }, + { xtype : 'TextField', allowBlank : false, diff --git a/roojs-ui.js b/roojs-ui.js index 7c24529b7b..bab6322df1 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1040,7 +1040,8 @@ Roo.htmleditor.Block=function(A){};Roo.htmleditor.Block.factory=function(A){var ;},readElement:function(A){}}; // Roo/htmleditor/BlockFigure.js Roo.htmleditor.BlockFigure=function(A){if(A.node){this.readElement(A.node);this.updateElement(A.node);}Roo.apply(this,A);};Roo.extend(Roo.htmleditor.BlockFigure,Roo.htmleditor.Block,{image_src:'',align:'center',caption:'',caption_display:'block',width:'100%',cls:'',href:'',video_url:'',text_align:'left',friendly_name:'Image with caption',deleteTitle:"Delete Image and Caption",contextMenu:function(A){var B=function(){return Roo.htmleditor.Block.factory(A.tb.selectedNode); -};var C=typeof(Roo.bootstrap)=='undefined'?Roo:Roo.bootstrap;var D=A.editorcore.syncValue;var E={};return [{xtype:'TextItem',text:"Source: ",xns:C.Toolbar},{xtype:'TextField',allowBlank:false,width:150,name:'image_src',listeners:{keyup:function(F,e){A.editorcore.selectNode(A.tb.selectedNode); +};var C=typeof(Roo.bootstrap)=='undefined'?Roo:Roo.bootstrap;var D=A.editorcore.syncValue;var E={};return [{xtype:'TextItem',text:"Source: ",xns:C.Toolbar},{xtype:'Button',text:'Edit Src',name:'image_src',listeners:{click:function(F,G){Roo.MessageBox.show({title:"Image Source URL",msg:"Enter the url for the image",buttons:this.OKCANCEL,fn:function(H){B().image_src=H; +B().updateElement();D();A.editorcore.onEditorEvent();},minWidth:250,prompt:true,modal:true,value:B().image_src});}},xns:C.Toolbar},{xtype:'TextField',allowBlank:false,width:150,name:'image_src',listeners:{keyup:function(F,e){A.editorcore.selectNode(A.tb.selectedNode); var b=B();b.image_src=this.getValue();b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form},{xtype:'TextItem',text:"Width: ",xns:C.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:70,name:'width',listeners:{select:function(F,r,G){A.editorcore.selectNode(A.tb.selectedNode); var b=B();b.width=r.get('val');b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form,store:{xtype:'SimpleStore',data:[['auto'],['50%'],['100%']],fields:['val'],xns:Roo.data}},{xtype:'TextItem',text:"Align: ",xns:C.Toolbar},{xtype:'ComboBox',allowBlank:false,displayField:'val',editable:true,listWidth:100,triggerAction:'all',typeAhead:true,valueField:'val',width:70,name:'align',listeners:{select:function(F,r,G){A.editorcore.selectNode(A.tb.selectedNode); var b=B();b.align=r.get('val');b.updateElement();D();A.editorcore.onEditorEvent();}},xns:C.form,store:{xtype:'SimpleStore',data:[['left'],['right'],['center']],fields:['val'],xns:Roo.data}},{xtype:'Button',text:'Hide Caption',name:'caption_display',pressed:false,enableToggle:true,setValue:function(v){this.toggle(v=='block'?false:true);