mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-27 10:23:28 +01:00
d486e50a57
* Changed way of how "webserverUrl" gets set - any type of data can now be injected into the egw object by creating an object with the data and an entry "prefsOnly" set to true. This allows to ensure, that "webserverUrl" is the first thing that is being set in the egw object (as needed when including new JS/CSS files at runtime) jsapi: * Fixed including JS/CSS files at runtime in other windows than the root window * Added "ready" function/module, which provides an alternative to the $j("ready") function. The ready module provides the functionality to postpone calling the "ready" until certain events happened. * using jQuery calendar object instead of jscalendar in the calendar function. * added "jquery" module which takes care of including all jQuery modules in all windows * added possibility for modules to update constants using the "constant" function. * added possibility for modules to access certain other modules using the "module" function etemplate: * Using new egw(window).ready function to build the template first if loading has finished.
46 lines
1000 B
JavaScript
46 lines
1000 B
JavaScript
/**
|
|
* EGroupware clientside API object
|
|
*
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
* @package etemplate
|
|
* @subpackage api
|
|
* @link http://www.egroupware.org
|
|
* @author Andreas Stöckel (as AT stylite.de)
|
|
* @version $Id$
|
|
*/
|
|
|
|
"use strict"
|
|
|
|
/*egw:uses
|
|
egw_core;
|
|
egw_files;
|
|
egw_ready;
|
|
*/
|
|
|
|
egw.extend('jquery', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
|
|
|
|
// Get the reference to the "files" and the "ready" module for the current
|
|
// window
|
|
var files = this.module('files', _wnd);
|
|
var ready = this.module('ready', _wnd);
|
|
|
|
// Include the jQuery and jQuery UI library.
|
|
var token = ready.readyWaitFor();
|
|
files.includeJS([
|
|
this.webserverUrl + '/phpgwapi/js/jquery/jquery.js',
|
|
this.webserverUrl + '/phpgwapi/js/jquery/jquery-ui.js',
|
|
this.webserverUrl + '/phpgwapi/js/jquery/jquery.html5_upload.js'
|
|
], function () {
|
|
this.constant('jquery', '$j', _wnd.$j, _wnd);
|
|
ready.readyDone(token);
|
|
}, this);
|
|
|
|
return {
|
|
'$j': null
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|