FR.addDefaultViewer={typeStore:new Ext.data.SimpleStore({idIndex:0,fields:["type","name","extList"],data:FR.types})};FR.addDefaultViewer.formPanel=new FR.components.editForm({title:"Add default viewer",layout:"form",autoScroll:true,defaults:{width:220},labelWidth:150,items:[{xtype:"combo",fieldLabel:"File type",name:"type",autoCreate:true,mode:"local",editable:false,displayField:"name",valueField:"type",value:"-",triggerAction:"all",store:FR.addDefaultViewer.typeStore,listeners:{beforeselect:function(f,record){if(record.data.type=="-"){f.ownerCt.extList.setVisible(false);f.ownerCt.ext.setVisible(true)}else{f.ownerCt.extList.setValue(record.data.extList);f.ownerCt.extList.setVisible(true);f.ownerCt.ext.setValue("");f.ownerCt.ext.setVisible(false)}}}},{xtype:"textfield",fieldLabel:"File extension",width:60,name:"ext",ref:"ext",value:""},{xtype:"displayfield",ref:"extList",fieldLabel:"File extensions",hidden:true,value:""},{xtype:"combo",fieldLabel:"Preview with",name:"handler",autoCreate:true,mode:"local",editable:false,displayField:"name",valueField:"handler",triggerAction:"all",value:"open_in_browser",store:new Ext.data.SimpleStore({fields:["handler","name"],data:FR.viewers})},{xtype:"combo",fieldLabel:"Edit with",name:"handler_edit",autoCreate:true,mode:"local",editable:false,displayField:"name",valueField:"handler",triggerAction:"all",value:"-",store:new Ext.data.SimpleStore({fields:["handler","name"],data:FR.viewers})},{xtype:"combo",fieldLabel:"Web links preview with",name:"weblink_handler",autoCreate:true,mode:"local",editable:false,displayField:"name",valueField:"handler",triggerAction:"all",value:"-",store:new Ext.data.SimpleStore({fields:["handler","name"],data:FR.weblink_handlers})},{xtype:"combo",fieldLabel:"Web links edit with",name:"weblink_edit_handler",autoCreate:true,mode:"local",editable:false,displayField:"name",valueField:"handler",triggerAction:"all",value:"-",store:new Ext.data.SimpleStore({fields:["handler","name"],data:FR.weblink_handlers})}],tbar:[{text:"Add",cls:"fr-btn-primary",ref:"saveBtn",handler:function(){var editForm=this.ownerCt.ownerCt;var params=editForm.form.getFieldValues();var opts={url:FR.URLRoot+"/?module=custom_actions&section=cpanel&page=defaults_add&action=add",maskText:"Saving changes...",params:params};editForm.submitForm(opts)}}]});Ext.getCmp("gridTabPanel").add(FR.addDefaultViewer.formPanel);FR.addDefaultViewer.formPanel.show();