/* * To change this template, choose Tools | Templates * and open the template in the editor. */ Ext.onReady(function(){ Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); var tabPanel = new Ext.TabPanel({ region: 'center', deferredRender: false, activeTab: 0, items: [{ id: 'welcome', xtype: 'panel', title: 'Welcome', // closable: true, autoScroll: true }] }); new Ext.Viewport({ layout: 'border', items: [ new Ext.BoxComponent({ region: 'north', id: 'north-panel', contentEl: 'north', height: 75 }), { region: 'west', id: 'west', title: 'Navigation', xtype: 'navPanel', split: true, width: 200, minSize: 175, maxSize: 400, collapsible: true, margins: '0 0 0 5' }, new Ext.BoxComponent({ region: 'south', id: 'south-panel', contentEl: 'south', height: 16, margins: '2 2 2 5' }), tabPanel ]}); function addTabPanel(id, xtype, title){ tabPanel.add({ id: id, xtype: xtype, title: title, closable: true, autoScroll: true }); tabPanel.setActiveTab(id); } function addGroupPanel(){ addTabPanel('t_group', 'groupGrid', 'Groups'); } function addRepositoryPanel(){ addTabPanel('t_repository', 'repositoryGrid', 'Repositories'); } function addConfigPanel(){ addTabPanel('t_config', 'configPanel', 'Repository Config'); } function createMainMenu(){ var panel = Ext.getCmp('west'); panel.addSections([{ title: 'Main', items: [{ label: 'Groups', fn: addGroupPanel },{ label: 'Repositories', fn: addRepositoryPanel }] },{ title: 'Config', items: [{ label: 'General', fn: function(){ console.debug( 'General Config' ); } },{ label: 'Repository Types', fn: addConfigPanel },{ label: 'Server', fn: function(){ console.debug( 'Server Config' ); } }] }]); } // create menu after login authCallbacks.push( createMainMenu ); Ext.Ajax.request({ url: restUrl + 'authentication.json', method: 'GET', success: function(response){ var s = Ext.decode(response.responseText); loadState(s); }, failure: function(){ var loginWin = new Sonia.login.Window(); loginWin.show(); } }); });