X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..6746dc89c47ed01b165cc1152533605f97eb8e8d:/examples/shared/extjs/App.js diff --git a/examples/shared/extjs/App.js b/examples/shared/extjs/App.js index ed378f78..50e7b881 100644 --- a/examples/shared/extjs/App.js +++ b/examples/shared/extjs/App.js @@ -1,31 +1,24 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ +/* + +This file is part of Ext JS 4 + +Copyright (c) 2011 Sencha Inc + +Contact: http://www.sencha.com/contact + +GNU General Public License Usage +This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. + +If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. + +*/ /** * 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 +43,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 +82,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 +154,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 +183,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 +242,5 @@ Ext.extend(Ext.App, Ext.util.Observable, { handleException : function(res) { Ext.MessageBox.alert(res.type.toUpperCase(), res.message); } -}); \ No newline at end of file +}); +