2 * Ext JS Library 2.2.1
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
9 Ext.app.App = function(cfg){
\r
10 Ext.apply(this, cfg);
\r
13 'beforeunload' : true
\r
16 Ext.onReady(this.initApp, this);
\r
19 Ext.extend(Ext.app.App, Ext.util.Observable, {
\r
24 getStartConfig : function(){
\r
28 initApp : function(){
\r
29 this.startConfig = this.startConfig || this.getStartConfig();
\r
31 this.desktop = new Ext.Desktop(this);
\r
33 this.launcher = this.desktop.taskbar.startMenu;
\r
35 this.modules = this.getModules();
\r
37 this.initModules(this.modules);
\r
42 Ext.EventManager.on(window, 'beforeunload', this.onUnload, this);
\r
43 this.fireEvent('ready', this);
\r
44 this.isReady = true;
\r
47 getModules : Ext.emptyFn,
\r
50 initModules : function(ms){
\r
51 for(var i = 0, len = ms.length; i < len; i++){
\r
53 this.launcher.add(m.launcher);
\r
58 getModule : function(name){
\r
59 var ms = this.modules;
\r
60 for(var i = 0, len = ms.length; i < len; i++){
\r
61 if(ms[i].id == name || ms[i].appType == name){
\r
68 onReady : function(fn, scope){
\r
70 this.on('ready', fn, scope);
\r
72 fn.call(scope, this);
\r
76 getDesktop : function(){
\r
77 return this.desktop;
\r
80 onUnload : function(e){
\r
81 if(this.fireEvent('beforeunload', this) === false){
\r