From: Alan Date: Mon, 10 Jan 2022 07:23:00 +0000 (+0800) Subject: roojs-ui.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=5e669fb64d1190d298a236330395f6ba59fd235e 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 722abbbbca..db8e532630 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1985,9 +1985,9 @@ 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:'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+''); +};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){var b=B();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){var b=B();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); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 7e2c4e7b25..7984b4a9a9 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -27042,15 +27042,15 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { listeners : { click: function (btn, state) { - + var b = block(); Roo.MessageBox.show({ title : "Image Source URL", msg : "Enter the url for the image", buttons: Roo.MessageBox.OKCANCEL, fn: function(val){ - block().image_src = val; - block().updateElement(); + b.image_src = val; + b.updateElement(); syncValue(); toolbar.editorcore.onEditorEvent(); }, @@ -27058,7 +27058,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { prompt:true, //multiline: multiline, modal : true, - value : block().image_src + value : b.image_src }); } }, @@ -27072,15 +27072,15 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { listeners : { click: function (btn, state) { - + var b = block(); 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(); + b.href = val; + b.updateElement(); syncValue(); toolbar.editorcore.onEditorEvent(); }, @@ -27088,7 +27088,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { prompt:true, //multiline: multiline, modal : true, - value : block().href + value : b.href }); } }, diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 6449b194a0..7add8fb602 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1175,9 +1175,9 @@ 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:'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+''); +};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){var b=B();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){var b=B();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); diff --git a/roojs-debug.js b/roojs-debug.js index 87999257fc..d3b20b39d2 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -47872,15 +47872,15 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { listeners : { click: function (btn, state) { - + var b = block(); Roo.MessageBox.show({ title : "Image Source URL", msg : "Enter the url for the image", buttons: Roo.MessageBox.OKCANCEL, fn: function(val){ - block().image_src = val; - block().updateElement(); + b.image_src = val; + b.updateElement(); syncValue(); toolbar.editorcore.onEditorEvent(); }, @@ -47888,7 +47888,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { prompt:true, //multiline: multiline, modal : true, - value : block().image_src + value : b.image_src }); } }, @@ -47902,15 +47902,15 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { listeners : { click: function (btn, state) { - + var b = block(); 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(); + b.href = val; + b.updateElement(); syncValue(); toolbar.editorcore.onEditorEvent(); }, @@ -47918,7 +47918,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { prompt:true, //multiline: multiline, modal : true, - value : block().href + value : b.href }); } }, diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 762656a509..a878f4690a 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -23403,15 +23403,15 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { listeners : { click: function (btn, state) { - + var b = block(); Roo.MessageBox.show({ title : "Image Source URL", msg : "Enter the url for the image", buttons: Roo.MessageBox.OKCANCEL, fn: function(val){ - block().image_src = val; - block().updateElement(); + b.image_src = val; + b.updateElement(); syncValue(); toolbar.editorcore.onEditorEvent(); }, @@ -23419,7 +23419,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { prompt:true, //multiline: multiline, modal : true, - value : block().image_src + value : b.image_src }); } }, @@ -23433,15 +23433,15 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { listeners : { click: function (btn, state) { - + var b = block(); 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(); + b.href = val; + b.updateElement(); syncValue(); toolbar.editorcore.onEditorEvent(); }, @@ -23449,7 +23449,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { prompt:true, //multiline: multiline, modal : true, - value : block().href + value : b.href }); } }, diff --git a/roojs-ui.js b/roojs-ui.js index 48bd50273a..a93e7684c9 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1040,9 +1040,9 @@ 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:'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+''); +};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){var b=B();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){var b=B();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);