mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-15 10:52:30 +02:00
phpgwapi:
* 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.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* eGroupWare eTemplate2 - A simple PHP expression parser written in JS
|
||||
* eGroupWare eTemplate2 - Execution layer for legacy event code
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @package etemplate
|
||||
@ -114,8 +114,14 @@
|
||||
context = _widget.getDOMNode();
|
||||
}
|
||||
|
||||
// Generate the function itself
|
||||
var func = new Function('egw', 'widget', 'window', _code);
|
||||
// Generate the function itself, if it fails, log the error message and
|
||||
// return a function which always returns false
|
||||
try {
|
||||
var func = new Function('egw', 'widget', 'window', 'document', _code);
|
||||
} catch(e) {
|
||||
_widget.egw().debug('error', 'Error while compiling JS code ', _code);
|
||||
return (function() {return false});
|
||||
}
|
||||
|
||||
// Execute the code and return its results, pass the egw instance and
|
||||
// the widget
|
||||
@ -127,7 +133,8 @@
|
||||
egw.debug('log', 'Executing legacy JS code: ', _code);
|
||||
|
||||
// Return the result of the called function
|
||||
return func.call(context, egw, _widget, egw.window);
|
||||
return func.call(context, egw, _widget, egw.window,
|
||||
egw.window.document);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user