roojs-ui.js
authorAlan <alan@roojs.com>
Mon, 13 Dec 2021 04:49:31 +0000 (12:49 +0800)
committerAlan <alan@roojs.com>
Mon, 13 Dec 2021 04:49:31 +0000 (12:49 +0800)
roojs-ui-debug.js
roojs-all.js
roojs-debug.js

roojs-all.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index addfea3..4a14b54 100644 (file)
@@ -2071,10 +2071,10 @@ return;}e.setValue(this.tb.selectedNode.getAttribute(e.attrname));},this);this.u
 if(A.menu.el){A.menu.el.destroy();}}A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();});},buildToolbar:function(A,nm,B,C){var D=this.editor;var E=this.editorcore;var F=D.wrap.createChild({tag:'div'},D.wrap.dom.firstChild.nextSibling,true);
 var tb=new Roo.Toolbar(F);this.tb=tb;if(A===false&&C){A=C.contextMenu(this);}tb.hasStyles=false;tb.name=nm;tb.add((typeof(B)=='undefined'?nm:B)+":&nbsp;");var G=Array.from(this.styles);if(G&&G.length){tb.hasStyles=true;tb.addField(new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'val',fields:['val','selected'],data:[]}
 ),name:'-roo-edit-className',attrname:'className',displayField:'val',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Select Style',selectOnFocus:true,width:130,listeners:{'select':function(c,r,i){tb.selectedNode.className=r?r.get('val'):'';
-E.syncValue();}}}));}var H=Roo.form.HtmlEditor.ToolbarContext;for(var i in A){if(typeof(A[i].xtype)!='undefined'){tb[typeof(A[i].name)=='undefined'?'add':'addField'](Roo.factory(A[i]));continue;}var I=A[i];tb.add(I.title+":&nbsp;");var J=I.opts?I.opts:false;
-if(I.optname){J=Roo.form.HtmlEditor.ToolbarContext.options[I.optname];}if(J){tb.addField(new Roo.form.ComboBox({store:typeof(H.stores[i])!='undefined'?Roo.factory(H.stores[i],Roo.data):new Roo.data.SimpleStore({id:'val',fields:['val','display'],data:J}),name:'-roo-edit-'+i,attrname:i,stylename:I.style?I.style:false,displayField:I.displayField?I.displayField:'val',valueField:'val',typeAhead:false,mode:typeof(H.stores[i])!='undefined'?'remote':'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:I.width?I.width:130,listeners:{'select':function(c,r,i){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);
+E.syncValue();}}}));}var H=Roo.form.HtmlEditor.ToolbarContext;for(var i=0;i<A.length;i++){if(typeof(A[i].xtype)!='undefined'){tb[typeof(A[i].name)=='undefined'?'add':'addField'](Roo.factory(A[i]));continue;}var I=A[i];tb.add(I.title+":&nbsp;");var J=I.opts?I.opts:false;
+if(I.optname){J=Roo.form.HtmlEditor.ToolbarContext.options[I.optname];}if(J){tb.addField(new Roo.form.ComboBox({store:typeof(H.stores[i])!='undefined'?Roo.factory(H.stores[i],Roo.data):new Roo.data.SimpleStore({id:'val',fields:['val','display'],data:J}),name:'-roo-edit-'+A[i].name,attrname:A[i].name,stylename:I.style?I.style:false,displayField:I.displayField?I.displayField:'val',valueField:'val',typeAhead:false,mode:typeof(H.stores[A[i].name])!='undefined'?'remote':'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:I.width?I.width:130,listeners:{'select':function(c,r,i){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);
 b[c.attrname]=r.get('val');b.updateElement(tb.selectedNode);E.syncValue();return;}if(c.stylename){tb.selectedNode.style[c.stylename]=r.get('val');E.syncValue();return;}if(r===false){tb.selectedNode.removeAttribute(c.attrname);E.syncValue();return;}tb.selectedNode.setAttribute(c.attrname,r.get('val'));
-E.syncValue();}}}));continue;}tb.addField(new Roo.form.TextField({name:'-roo-edit-'+i,attrname:i,width:I.width,value:'',listeners:{'change':function(f,nv,ov){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);
+E.syncValue();}}}));continue;}tb.addField(new Roo.form.TextField({name:'-roo-edit-'+A[i].name,attrname:A[i].name,width:I.width,value:'',listeners:{'change':function(f,nv,ov){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);
 b[f.attrname]=nv;b.updateElement(tb.selectedNode);E.syncValue();return;}tb.selectedNode.setAttribute(f.attrname,nv);E.syncValue();}}}));}var K=this;if(nm=='BODY'){tb.addSeparator();tb.addButton({text:'Stylesheets',listeners:{click:function(){K.editor.fireEvent('stylesheetsclick',K.editor);
 }}});}tb.addFill();tb.addButton({text:'Remove Block or Formating',listeners:{click:function(){var sn=tb.selectedNode;if(!sn){return;}var L=sn.childNodes[0]||sn.nextSibling||sn.previousSibling||sn.parentNode;if(sn.hasAttribute('data-block')){L=sn.nextSibling||sn.previousSibling||sn.parentNode;
 sn.parentNode.removeChild(sn);}else if(sn&&sn.tagName!='BODY'){a=new Roo.htmleditor.FilterKeepChildren({tag:false});a.removeTag(sn);}var M=E.createRange();M.setStart(L,0);M.setEnd(L,0);var N=E.getSelection();N.removeAllRanges();N.addRange(M);K.updateToolbar(null,null,null);
index ef18484..67170df 100644 (file)
@@ -49653,7 +49653,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
         var tbc = Roo.form.HtmlEditor.ToolbarContext;
         
         
-        for (var i in tlist) {
+        for (var i = 0; i < tlist.length; i++) {
             
             // newer versions will use xtype cfg to create menus.
             if (typeof(tlist[i].xtype) != 'undefined') {
@@ -49683,15 +49683,15 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
                         fields: ['val', 'display'],
                         data : opts  
                     }),
-                    name : '-roo-edit-' + i,
+                    name : '-roo-edit-' + tlist[i].name,
                     
-                    attrname : i,
+                    attrname : tlist[i].name,
                     stylename : item.style ? item.style : false,
                     
                     displayField: item.displayField ? item.displayField : 'val',
                     valueField :  'val',
                     typeAhead: false,
-                    mode: typeof(tbc.stores[i]) != 'undefined'  ? 'remote' : 'local',
+                    mode: typeof(tbc.stores[tlist[i].name]) != 'undefined'  ? 'remote' : 'local',
                     editable : false,
                     triggerAction: 'all',
                     emptyText:'Select',
@@ -49737,8 +49737,8 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
                 */
             }
             tb.addField( new Roo.form.TextField({
-                name: '-roo-edit-' + i,
-                attrname : i,
+                name: '-roo-edit-' + tlist[i].name,
+                attrname : tlist[i].name,
                 
                 width: item.width,
                 //allowBlank:true,
index c2b5e84..282e878 100644 (file)
@@ -25666,7 +25666,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
         var tbc = Roo.form.HtmlEditor.ToolbarContext;
         
         
-        for (var i in tlist) {
+        for (var i = 0; i < tlist.length; i++) {
             
             // newer versions will use xtype cfg to create menus.
             if (typeof(tlist[i].xtype) != 'undefined') {
@@ -25696,15 +25696,15 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
                         fields: ['val', 'display'],
                         data : opts  
                     }),
-                    name : '-roo-edit-' + i,
+                    name : '-roo-edit-' + tlist[i].name,
                     
-                    attrname : i,
+                    attrname : tlist[i].name,
                     stylename : item.style ? item.style : false,
                     
                     displayField: item.displayField ? item.displayField : 'val',
                     valueField :  'val',
                     typeAhead: false,
-                    mode: typeof(tbc.stores[i]) != 'undefined'  ? 'remote' : 'local',
+                    mode: typeof(tbc.stores[tlist[i].name]) != 'undefined'  ? 'remote' : 'local',
                     editable : false,
                     triggerAction: 'all',
                     emptyText:'Select',
@@ -25750,8 +25750,8 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
                 */
             }
             tb.addField( new Roo.form.TextField({
-                name: '-roo-edit-' + i,
-                attrname : i,
+                name: '-roo-edit-' + tlist[i].name,
+                attrname : tlist[i].name,
                 
                 width: item.width,
                 //allowBlank:true,
index 731662c..3ad6cf6 100644 (file)
@@ -1147,10 +1147,10 @@ return;}e.setValue(this.tb.selectedNode.getAttribute(e.attrname));},this);this.u
 if(A.menu.el){A.menu.el.destroy();}}A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();});},buildToolbar:function(A,nm,B,C){var D=this.editor;var E=this.editorcore;var F=D.wrap.createChild({tag:'div'},D.wrap.dom.firstChild.nextSibling,true);
 var tb=new Roo.Toolbar(F);this.tb=tb;if(A===false&&C){A=C.contextMenu(this);}tb.hasStyles=false;tb.name=nm;tb.add((typeof(B)=='undefined'?nm:B)+":&nbsp;");var G=Array.from(this.styles);if(G&&G.length){tb.hasStyles=true;tb.addField(new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'val',fields:['val','selected'],data:[]}
 ),name:'-roo-edit-className',attrname:'className',displayField:'val',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Select Style',selectOnFocus:true,width:130,listeners:{'select':function(c,r,i){tb.selectedNode.className=r?r.get('val'):'';
-E.syncValue();}}}));}var H=Roo.form.HtmlEditor.ToolbarContext;for(var i in A){if(typeof(A[i].xtype)!='undefined'){tb[typeof(A[i].name)=='undefined'?'add':'addField'](Roo.factory(A[i]));continue;}var I=A[i];tb.add(I.title+":&nbsp;");var J=I.opts?I.opts:false;
-if(I.optname){J=Roo.form.HtmlEditor.ToolbarContext.options[I.optname];}if(J){tb.addField(new Roo.form.ComboBox({store:typeof(H.stores[i])!='undefined'?Roo.factory(H.stores[i],Roo.data):new Roo.data.SimpleStore({id:'val',fields:['val','display'],data:J}),name:'-roo-edit-'+i,attrname:i,stylename:I.style?I.style:false,displayField:I.displayField?I.displayField:'val',valueField:'val',typeAhead:false,mode:typeof(H.stores[i])!='undefined'?'remote':'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:I.width?I.width:130,listeners:{'select':function(c,r,i){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);
+E.syncValue();}}}));}var H=Roo.form.HtmlEditor.ToolbarContext;for(var i=0;i<A.length;i++){if(typeof(A[i].xtype)!='undefined'){tb[typeof(A[i].name)=='undefined'?'add':'addField'](Roo.factory(A[i]));continue;}var I=A[i];tb.add(I.title+":&nbsp;");var J=I.opts?I.opts:false;
+if(I.optname){J=Roo.form.HtmlEditor.ToolbarContext.options[I.optname];}if(J){tb.addField(new Roo.form.ComboBox({store:typeof(H.stores[i])!='undefined'?Roo.factory(H.stores[i],Roo.data):new Roo.data.SimpleStore({id:'val',fields:['val','display'],data:J}),name:'-roo-edit-'+A[i].name,attrname:A[i].name,stylename:I.style?I.style:false,displayField:I.displayField?I.displayField:'val',valueField:'val',typeAhead:false,mode:typeof(H.stores[A[i].name])!='undefined'?'remote':'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:I.width?I.width:130,listeners:{'select':function(c,r,i){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);
 b[c.attrname]=r.get('val');b.updateElement(tb.selectedNode);E.syncValue();return;}if(c.stylename){tb.selectedNode.style[c.stylename]=r.get('val');E.syncValue();return;}if(r===false){tb.selectedNode.removeAttribute(c.attrname);E.syncValue();return;}tb.selectedNode.setAttribute(c.attrname,r.get('val'));
-E.syncValue();}}}));continue;}tb.addField(new Roo.form.TextField({name:'-roo-edit-'+i,attrname:i,width:I.width,value:'',listeners:{'change':function(f,nv,ov){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);
+E.syncValue();}}}));continue;}tb.addField(new Roo.form.TextField({name:'-roo-edit-'+A[i].name,attrname:A[i].name,width:I.width,value:'',listeners:{'change':function(f,nv,ov){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);
 b[f.attrname]=nv;b.updateElement(tb.selectedNode);E.syncValue();return;}tb.selectedNode.setAttribute(f.attrname,nv);E.syncValue();}}}));}var K=this;if(nm=='BODY'){tb.addSeparator();tb.addButton({text:'Stylesheets',listeners:{click:function(){K.editor.fireEvent('stylesheetsclick',K.editor);
 }}});}tb.addFill();tb.addButton({text:'Remove Block or Formating',listeners:{click:function(){var sn=tb.selectedNode;if(!sn){return;}var L=sn.childNodes[0]||sn.nextSibling||sn.previousSibling||sn.parentNode;if(sn.hasAttribute('data-block')){L=sn.nextSibling||sn.previousSibling||sn.parentNode;
 sn.parentNode.removeChild(sn);}else if(sn&&sn.tagName!='BODY'){a=new Roo.htmleditor.FilterKeepChildren({tag:false});a.removeTag(sn);}var M=E.createRange();M.setStart(L,0);M.setEnd(L,0);var N=E.getSelection();N.removeAllRanges();N.addRange(M);K.updateToolbar(null,null,null);