From: Alan Date: Mon, 10 Jan 2022 07:21:34 +0000 (+0800) Subject: roojs-ui.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=529565bae1474a2832b202421e1ebda471c46a6c roojs-ui.js roojs-ui-debug.js roojs-bootstrap.js roojs-bootstrap-debug.js roojs-all.js roojs-debug.js --- diff --git a/roojs-all.js b/roojs-all.js index 5cb41be65b..722abbbbca 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1985,9 +1985,10 @@ 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:'Button',text:'Edit Src',listeners:{click:function(F,G){Roo.MessageBox.show({title:"Image Source URL",msg:"Enter the url for the image",buttons:Roo.MessageBox.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 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:'Change Image URL',listeners:{click:function(F,G){Roo.MessageBox.show({title:"Image Source URL",msg:"Enter the url for the image",buttons:Roo.MessageBox.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:'Button',text:'Change Link URL',listeners:{click:function(F,G){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(H){B().href=H; +B().updateElement();D();A.editorcore.onEditorEvent();},minWidth:250,prompt:true,modal:true,value:B().href});}},xns:C.Toolbar},{xtype:'Button',text:'Show Video URL',listeners:{click:function(F,G){Roo.MessageBox.alert("Video URL",B().video_url==''?'This image is not linked ot a video':'The image is linked to: '+B().video_url+''); +}},xns:C.Toolbar},{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); },listeners:{toggle:function(F,G){var b=B();b.caption_display=b.caption_display=='block'?'none':'block';this.setText(b.caption_display=='block'?"Hide Caption":"Show Caption");b.updateElement();D();A.editorcore.selectNode(A.tb.selectedNode);A.editorcore.onEditorEvent(); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 93c44f89f6..7e2c4e7b25 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -27037,7 +27037,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { }, { xtype : 'Button', - text: 'Edit Src', + text: 'Change Image URL', listeners : { click: function (btn, state) @@ -27066,24 +27066,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: ", diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index aff412c387..6449b194a0 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1175,9 +1175,10 @@ 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:'Button',text:'Edit Src',listeners:{click:function(F,G){Roo.MessageBox.show({title:"Image Source URL",msg:"Enter the url for the image",buttons:Roo.MessageBox.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 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:'Change Image URL',listeners:{click:function(F,G){Roo.MessageBox.show({title:"Image Source URL",msg:"Enter the url for the image",buttons:Roo.MessageBox.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:'Button',text:'Change Link URL',listeners:{click:function(F,G){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(H){B().href=H; +B().updateElement();D();A.editorcore.onEditorEvent();},minWidth:250,prompt:true,modal:true,value:B().href});}},xns:C.Toolbar},{xtype:'Button',text:'Show Video URL',listeners:{click:function(F,G){Roo.MessageBox.alert("Video URL",B().video_url==''?'This image is not linked ot a video':'The image is linked to: '+B().video_url+''); +}},xns:C.Toolbar},{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); },listeners:{toggle:function(F,G){var b=B();b.caption_display=b.caption_display=='block'?'none':'block';this.setText(b.caption_display=='block'?"Hide Caption":"Show Caption");b.updateElement();D();A.editorcore.selectNode(A.tb.selectedNode);A.editorcore.onEditorEvent(); diff --git a/roojs-debug.js b/roojs-debug.js index 38b158f99f..87999257fc 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -47867,7 +47867,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { }, { xtype : 'Button', - text: 'Edit Src', + text: 'Change Image URL', listeners : { click: function (btn, state) @@ -47896,24 +47896,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: ", diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 0c0ff86d80..762656a509 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -23398,7 +23398,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { }, { xtype : 'Button', - text: 'Edit Src', + text: 'Change Image URL', listeners : { click: function (btn, state) @@ -23427,24 +23427,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: ", diff --git a/roojs-ui.js b/roojs-ui.js index 443501e70b..48bd50273a 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1040,9 +1040,10 @@ 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:'Button',text:'Edit Src',listeners:{click:function(F,G){Roo.MessageBox.show({title:"Image Source URL",msg:"Enter the url for the image",buttons:Roo.MessageBox.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 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:'Change Image URL',listeners:{click:function(F,G){Roo.MessageBox.show({title:"Image Source URL",msg:"Enter the url for the image",buttons:Roo.MessageBox.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:'Button',text:'Change Link URL',listeners:{click:function(F,G){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(H){B().href=H; +B().updateElement();D();A.editorcore.onEditorEvent();},minWidth:250,prompt:true,modal:true,value:B().href});}},xns:C.Toolbar},{xtype:'Button',text:'Show Video URL',listeners:{click:function(F,G){Roo.MessageBox.alert("Video URL",B().video_url==''?'This image is not linked ot a video':'The image is linked to: '+B().video_url+''); +}},xns:C.Toolbar},{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); },listeners:{toggle:function(F,G){var b=B();b.caption_display=b.caption_display=='block'?'none':'block';this.setText(b.caption_display=='block'?"Hide Caption":"Show Caption");b.updateElement();D();A.editorcore.selectNode(A.tb.selectedNode);A.editorcore.onEditorEvent();