Roo/Document.js
[roojs1] / Roo / Document.js
1 /*
2  * Original code for Roojs - LGPL
3  * <script type="text/javascript">
4  */
5  
6 /**
7  * @class Roo.Documents
8  * @extends Roo.data.Observable
9  * 
10  * Document and interface builder class..
11  * 
12  * MyApp = new Roo.Document({
13  *     loadingIndicator : 'loading',
14  *     listeners :  Roo.Login.onLoad();
15  * });
16  * 
17  * MyApp.on('beforeload', function() {
18  *      MyApp.register()
19  
20  * 
21  * 
22  * 
23  */
24 Roo.Document = function(cfg) {
25      
26     this.addEvents({ 
27         'ready' : true,
28         'beforeload' : true, // fired after page ready, before module building.
29         'load' : true, // fired after module building
30         'authrefreshed' : true // fire on auth updated?? - should be on Login?!?!?
31         
32     });
33     Roo.util.Observable.call(this,cfg);
34     var _this = this;
35     Roo.onReady(function() {
36         _this.fireEvent('ready');
37     },null,false);
38     
39     this.on('ready', onReady, this);
40     this.on('load', onLoad, this);  
41     
42 }
43 Roo.extend(Roo.Document, Roo.util.Observable, {
44     /**
45      * @property  buildCompleted
46      * True when the builder has completed building the interface.
47      * @type Boolean
48      */
49     buildCompleted : false,
50      /**
51      * @property  loadingIndicator
52      * ID of loading indictor element.
53      * @type String
54      */
55     loadingIndicator : false,
56     
57       
58     // protected - on Ready handler.
59     onReady :   function()
60     {
61         // kludge to fix firebug debugger
62         if (typeof(console) == 'undefined') {
63             console = { log : function() {  } };
64         }
65          
66         // init cookies..
67         Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
68             
69         // link errors...
70         
71       
72        
73             
74     },
75      
76 },
77    
78     
79     
80 });
81