1 Ext.BLANK_IMAGE_URL = "ext/resources/images/default/s.gif";
2 Ext.ns('jibu.layout.classic');
4 jibu.layout.classic.HeaderPanel = function(){
5 this.bbar = new Ext.Toolbar({
11 text:this.accountText,
12 tooltip: this.accountTooltip,
14 handler : function() {
15 mainPanel.loadModule('system.setting', this.getText());
19 tooltip: this.exitText,
21 handler : function() {
22 window.location = 'Login.x?ci=logout';
27 jibu.layout.classic.HeaderPanel.superclass.constructor.call(this, {
38 Ext.extend(jibu.layout.classic.HeaderPanel, Ext.Panel, {
39 accountText:'Account',
40 accountTooltip:'Account Setting',
44 jibu.layout.classic.NavPanel = function() {
45 this.loader = new Ext.tree.TreeLoader({
46 preloadChildren: true,
49 this.root = new Ext.tree.AsyncTreeNode({
55 new Ext.form.TextField({
57 emptyText:this.findModuleText,
58 enableKeyEvents: true,
61 this.filter = new Ext.tree.TreeFilter(this, {
75 iconCls:'icon-expand-all',
76 tooltip:this.expandText,
77 handler: function(){this.root.expand(true); },
80 iconCls:'icon-collapse-all',
81 tooltip:this.collapseText,
82 handler: function(){this.root.collapse(true); },
86 jibu.layout.classic.NavPanel.superclass.constructor.call(this, {
104 Ext.extend(jibu.layout.classic.NavPanel, Ext.tree.TreePanel, {
105 findModuleText:'Find a Module',
106 expandText:'Expand All',
107 collapseText:'Collapse All',
108 filterTree: function(t, e){
109 var text = t.getValue();
110 Ext.each(this.hiddenPkgs, function(n){
119 var re = new RegExp('^' + Ext.escapeRe(text), 'i');
120 this.filter.filterBy(function(n){
121 return !n.isLeaf() || re.test(n.text);
124 // hide empty packages that weren't filtered
125 this.hiddenPkgs = [];
127 this.root.cascade(function(n){
128 if(!n.isLeaf() && n.ui.ctNode.offsetHeight < 3){
130 me.hiddenPkgs.push(n);
136 jibu.layout.classic.MainPanel = function() {
138 title: this.centerPanelText,
142 jibu.layout.classic.MainPanel.superclass.constructor.call(this, {
145 enableTabScroll : true,
152 Ext.extend(jibu.layout.classic.MainPanel, Ext.TabPanel, {
153 centerPanelText:'Welcome',
154 loadModule : function(moduleName,moduleTitle){
156 if(!(tab = this.getItem(moduleTitle))){
166 this.setActiveTab(moduleName);
170 Ext.onReady(function() {
171 Ext.QuickTips.init();
172 Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
173 var headerPanel = new jibu.layout.classic.HeaderPanel();
174 var navPanel = new jibu.layout.classic.NavPanel();
175 mainPanel = new jibu.layout.classic.MainPanel();
177 Ext.getCmp('module-tree').on('click', function(node, e){
179 mainPanel.loadModule(node.attributes.url, node.attributes.text);
183 var viewport = new Ext.Viewport({