3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js">Ext.app.App = function(cfg){
\r
9 Ext.apply(this, cfg);
\r
12 'beforeunload' : true
\r
15 Ext.onReady(this.initApp, this);
\r
18 Ext.extend(Ext.app.App, Ext.util.Observable, {
\r
23 getStartConfig : function(){
\r
27 initApp : function(){
\r
28 this.startConfig = this.startConfig || this.getStartConfig();
\r
30 this.desktop = new Ext.Desktop(this);
\r
32 this.launcher = this.desktop.taskbar.startMenu;
\r
34 this.modules = this.getModules();
\r
36 this.initModules(this.modules);
\r
41 Ext.EventManager.on(window, 'beforeunload', this.onUnload, this);
\r
42 this.fireEvent('ready', this);
\r
43 this.isReady = true;
\r
46 getModules : Ext.emptyFn,
\r
49 initModules : function(ms){
\r
50 for(var i = 0, len = ms.length; i < len; i++){
\r
52 this.launcher.add(m.launcher);
\r
57 getModule : function(name){
\r
58 var ms = this.modules;
\r
59 for(var i = 0, len = ms.length; i < len; i++){
\r
60 if(ms[i].id == name || ms[i].appType == name){
\r
67 onReady : function(fn, scope){
\r
69 this.on('ready', fn, scope);
\r
71 fn.call(scope, this);
\r
75 getDesktop : function(){
\r
76 return this.desktop;
\r
79 onUnload : function(e){
\r
80 if(this.fireEvent('beforeunload', this) === false){
\r