Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / examples / shared / extjs / App.js
index ed378f7..c779bf3 100644 (file)
@@ -1,31 +1,10 @@
-/*!
- * Ext JS Library 3.3.1
- * Copyright(c) 2006-2010 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
 /**
  * Ext.App
  * @extends Ext.util.Observable
  * @author Chris Scott
  */
-Ext.App = function(config) {
-    this.views = [];
-    
-    this.initStateProvider();
-    
-    Ext.apply(this, config);
-    
-    if (!this.api.actions) {
-        this.api.actions = {};
-    }
-    
-    Ext.onReady(this.onReady, this);
-    
-    Ext.App.superclass.constructor.apply(this, arguments);
-};
-
-Ext.extend(Ext.App, Ext.util.Observable, {
+Ext.define('Ext.App', {
+    extend: 'Ext.util.Observable',
 
     /***
      * response status codes.
@@ -50,10 +29,26 @@ Ext.extend(Ext.App, Ext.util.Observable, {
     // private, ref to message-box Element.
     msgCt : null,
 
+    constructor: function(config) {
+        this.views = [];
+
+        this.initStateProvider();
+
+        Ext.apply(this, config);
+
+        if (!this.api.actions) {
+            this.api.actions = {};
+        }
+
+        Ext.onReady(this.onReady, this);
+
+        Ext.App.superclass.constructor.apply(this, arguments);
+    },
+
     // @protected, onReady, executes when Ext.onReady fires.
     onReady : function() {
         // create the msgBox container.  used for App.setAlert
-        this.msgCt = Ext.DomHelper.insertFirst(document.body, {id:'msg-div'}, true);
+        this.msgCt = Ext.core.DomHelper.insertFirst(document.body, {id:'msg-div'}, true);
         this.msgCt.setStyle('position', 'absolute');
         this.msgCt.setStyle('z-index', 9999);
         this.msgCt.setWidth(300);
@@ -73,7 +68,7 @@ Ext.extend(Ext.App, Ext.util.Observable, {
         }
 
         // register provider with state manager.
-        Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
+        Ext.state.Manager.setProvider(Ext.create('Ext.state.CookieProvider', {
             path: '/',
             expires: exptime,
             domain: null,
@@ -145,7 +140,7 @@ Ext.extend(Ext.App, Ext.util.Observable, {
         }
 
         this.msgCt.alignTo(document, 't-t');
-        Ext.DomHelper.append(this.msgCt, {html:this.buildMessageBox(status, String.format.apply(String, Array.prototype.slice.call(arguments, 1)))}, true).slideIn('t').pause(delay).ghost("t", {remove:true});
+        Ext.core.DomHelper.append(this.msgCt, {html:this.buildMessageBox(status, String.format.apply(String, Array.prototype.slice.call(arguments, 1)))}, true).slideIn('t').pause(delay).ghost("t", {remove:true});
     },
 
     /***
@@ -174,7 +169,7 @@ Ext.extend(Ext.App, Ext.util.Observable, {
      * @param {Object} status
      */
     decodeStatusIcon : function(status) {
-        iconCls = '';
+        var iconCls = '';
         switch (status) {
             case true:
             case this.STATUS_OK:
@@ -233,4 +228,4 @@ Ext.extend(Ext.App, Ext.util.Observable, {
     handleException : function(res) {
         Ext.MessageBox.alert(res.type.toUpperCase(), res.message);
     }
-});
\ No newline at end of file
+});