X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6a7e4474cba9d8be4b2ec445e10f1691f7277c50..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/examples/shared/extjs/App.js diff --git a/examples/shared/extjs/App.js b/examples/shared/extjs/App.js index 39e5e3b7..c779bf3f 100644 --- a/examples/shared/extjs/App.js +++ b/examples/shared/extjs/App.js @@ -1,31 +1,10 @@ -/*! - * Ext JS Library 3.2.0 - * Copyright(c) 2006-2010 Ext JS, Inc. - * licensing@extjs.com - * http://www.extjs.com/license - */ /** * Ext.App * @extends Ext.util.Observable * @author Chris Scott */ -Ext.App = function(config) { - - // set up StateProvider - this.initStateProvider(); - - // array of views - this.views = []; - - Ext.apply(this, config); - if (!this.api.actions) { this.api.actions = {}; } - - // init when onReady fires. - 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 +});