mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-12 17:08:34 +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>
|
* @author Hadi Nategh <hn-AT-stylite.de>
|
||||||
* @copyright (c) 2008-13 by Ralf Becker <RalfBecker-AT-outdoor-training.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
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||||
* @version $id
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* @augments AppJS
|
* @augments AppJS
|
||||||
*/
|
*/
|
||||||
app.addressbook = AppJS.extend(
|
app.classes.addressbook = AppJS.extend(
|
||||||
{
|
{
|
||||||
appname: 'addressbook',
|
appname: 'addressbook',
|
||||||
/**
|
/**
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* @augments AppJS
|
* @augments AppJS
|
||||||
*/
|
*/
|
||||||
app.admin = AppJS.extend(
|
app.classes.admin = AppJS.extend(
|
||||||
{
|
{
|
||||||
appname: 'admin',
|
appname: 'admin',
|
||||||
/**
|
/**
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* @augments AppJS
|
* @augments AppJS
|
||||||
*/
|
*/
|
||||||
app.calendar = AppJS.extend(
|
app.classes.calendar = AppJS.extend(
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* application name
|
* application name
|
||||||
|
@ -214,7 +214,13 @@ etemplate2.prototype.load = function(_name, _url, _data, _callback)
|
|||||||
// Initialize application js
|
// Initialize application js
|
||||||
var app_callback = null;
|
var app_callback = null;
|
||||||
// Only initialize once
|
// 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();
|
(function() { new app[appname]();}).call();
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* @augments AppJS
|
* @augments AppJS
|
||||||
*/
|
*/
|
||||||
app.filemanager = AppJS.extend(
|
app.classes.filemanager = AppJS.extend(
|
||||||
{
|
{
|
||||||
appname: 'filemanager',
|
appname: 'filemanager',
|
||||||
/**
|
/**
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
* @see http://gridster.net
|
* @see http://gridster.net
|
||||||
* @augments AppJS
|
* @augments AppJS
|
||||||
*/
|
*/
|
||||||
app.home = AppJS.extend(
|
app.classes.home = AppJS.extend(
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* AppJS requires overwriting this with the actual application name
|
* AppJS requires overwriting this with the actual application name
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* @augments AppJS
|
* @augments AppJS
|
||||||
*/
|
*/
|
||||||
app.importexport = AppJS.extend(
|
app.classes.importexport = AppJS.extend(
|
||||||
{
|
{
|
||||||
appname: 'importexport',
|
appname: 'importexport',
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @author Hadi Nategh <hn-AT-stylite.de>
|
* @author Hadi Nategh <hn-AT-stylite.de>
|
||||||
* @copyright (c) 2008-13 by Ralf Becker <RalfBecker-AT-outdoor-training.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
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||||
* @version
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* @augments AppJS
|
* @augments AppJS
|
||||||
*/
|
*/
|
||||||
app.infolog = AppJS.extend(
|
app.classes.infolog = AppJS.extend(
|
||||||
{
|
{
|
||||||
appname: 'infolog',
|
appname: 'infolog',
|
||||||
/**
|
/**
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* @augments AppJS
|
* @augments AppJS
|
||||||
*/
|
*/
|
||||||
app.mail = AppJS.extend(
|
app.classes.mail = AppJS.extend(
|
||||||
{
|
{
|
||||||
appname: 'mail',
|
appname: 'mail',
|
||||||
|
|
||||||
|
@ -15,7 +15,19 @@
|
|||||||
egw_inheritance;
|
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
|
* 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
|
* Internal application name - override this
|
||||||
*/
|
*/
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
*
|
*
|
||||||
* @augments AppJS
|
* @augments AppJS
|
||||||
*/
|
*/
|
||||||
app.timesheet = AppJS.extend(
|
app.classes.timesheet = AppJS.extend(
|
||||||
{
|
{
|
||||||
appname: 'timesheet',
|
appname: 'timesheet',
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user