mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-24 23:58:54 +01:00
split constructor function and place of instanciation for app.js objects: app[appname] = new app.classes[appname]();
This commit is contained in:
parent
f41480a3f6
commit
6d226a7921
@ -6,7 +6,7 @@
|
||||
* @author Hadi Nategh <hn-AT-stylite.de>
|
||||
* @copyright (c) 2008-13 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @version $id
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -14,7 +14,7 @@
|
||||
*
|
||||
* @augments AppJS
|
||||
*/
|
||||
app.addressbook = AppJS.extend(
|
||||
app.classes.addressbook = AppJS.extend(
|
||||
{
|
||||
appname: 'addressbook',
|
||||
/**
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
* @augments AppJS
|
||||
*/
|
||||
app.admin = AppJS.extend(
|
||||
app.classes.admin = AppJS.extend(
|
||||
{
|
||||
appname: 'admin',
|
||||
/**
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
* @augments AppJS
|
||||
*/
|
||||
app.calendar = AppJS.extend(
|
||||
app.classes.calendar = AppJS.extend(
|
||||
{
|
||||
/**
|
||||
* application name
|
||||
|
@ -214,7 +214,13 @@ etemplate2.prototype.load = function(_name, _url, _data, _callback)
|
||||
// Initialize application js
|
||||
var app_callback = null;
|
||||
// Only initialize once
|
||||
if(typeof app[appname] == "function")
|
||||
// new app class with constructor function in app.classes[appname]
|
||||
if (typeof app[appname] !== 'object' && typeof app.classes[appname] == 'function')
|
||||
{
|
||||
app[appname] = new app.classes[appname]();
|
||||
}
|
||||
// old app class with constructor function in app[appname] (deprecated)
|
||||
else if(typeof app[appname] == "function")
|
||||
{
|
||||
(function() { new app[appname]();}).call();
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
* @augments AppJS
|
||||
*/
|
||||
app.filemanager = AppJS.extend(
|
||||
app.classes.filemanager = AppJS.extend(
|
||||
{
|
||||
appname: 'filemanager',
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@
|
||||
* @see http://gridster.net
|
||||
* @augments AppJS
|
||||
*/
|
||||
app.home = AppJS.extend(
|
||||
app.classes.home = AppJS.extend(
|
||||
{
|
||||
/**
|
||||
* AppJS requires overwriting this with the actual application name
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
* @augments AppJS
|
||||
*/
|
||||
app.importexport = AppJS.extend(
|
||||
app.classes.importexport = AppJS.extend(
|
||||
{
|
||||
appname: 'importexport',
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @author Hadi Nategh <hn-AT-stylite.de>
|
||||
* @copyright (c) 2008-13 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @version
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -14,7 +14,7 @@
|
||||
*
|
||||
* @augments AppJS
|
||||
*/
|
||||
app.infolog = AppJS.extend(
|
||||
app.classes.infolog = AppJS.extend(
|
||||
{
|
||||
appname: 'infolog',
|
||||
/**
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
* @augments AppJS
|
||||
*/
|
||||
app.mail = AppJS.extend(
|
||||
app.classes.mail = AppJS.extend(
|
||||
{
|
||||
appname: 'mail',
|
||||
|
||||
|
@ -15,7 +15,19 @@
|
||||
egw_inheritance;
|
||||
*/
|
||||
|
||||
window.app = {};
|
||||
/**
|
||||
* Object to collect instanciated appliction objects
|
||||
*
|
||||
* Attributes classes collects loaded application classes,
|
||||
* which can get instanciated:
|
||||
*
|
||||
* app[appname] = new app.classes[appname]();
|
||||
*
|
||||
* On destruction only app[appname] gets deleted, app.classes[appname] need to be used again!
|
||||
*
|
||||
* @type object
|
||||
*/
|
||||
window.app = {classes: {}};
|
||||
|
||||
/**
|
||||
* Common base class for application javascript
|
||||
@ -47,8 +59,8 @@ window.app = {};
|
||||
* }
|
||||
* });
|
||||
*/
|
||||
var AppJS = Class.extend({
|
||||
|
||||
var AppJS = Class.extend(
|
||||
{
|
||||
/**
|
||||
* Internal application name - override this
|
||||
*/
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
* @augments AppJS
|
||||
*/
|
||||
app.timesheet = AppJS.extend(
|
||||
app.classes.timesheet = AppJS.extend(
|
||||
{
|
||||
appname: 'timesheet',
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user