forked from extern/egroupware
8b2dae28f7
- Added indexOf function for IE compatiblity - this and some other code is redundant to that in egw_action_common.js - Probably this code should be merged into jsapi and jsapi.js should be cleaned up and splitted into multiple files - Implemented template widget - Implemented dummy implementation of description widget - Improved et2_placeholder - it now shows all properties set for that placeholder - Improved and extended test page - Improved interface system in et2_inheritance.js - each object derrived from Class now has a instanceOf function which checks, whether the object is either an instance of the given class or implements the given interface (same behaviour as instanceOf in Java) - Widgets can now define which other widget classes are allowed inside of them
50 lines
901 B
JavaScript
50 lines
901 B
JavaScript
/**
|
|
* eGroupWare eTemplate2 - JS Widget base class
|
|
*
|
|
* @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
|
|
* @copyright Stylite 2011
|
|
* @version $Id$
|
|
*/
|
|
|
|
function et2_debug(_level, _msg)
|
|
{
|
|
if (typeof console != "undefined")
|
|
{
|
|
if (_level == "log" && typeof console.log == "function")
|
|
{
|
|
console.log(_msg);
|
|
}
|
|
|
|
if (_level == "warn" && typeof console.warn == "function")
|
|
{
|
|
console.warn(_msg);
|
|
}
|
|
|
|
if (_level == "error" && typeof console.error == "function")
|
|
{
|
|
console.error(_msg);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* IE Fix for array.indexOf
|
|
*/
|
|
if (typeof Array.prototype.indexOf == "undefined")
|
|
{
|
|
Array.prototype.indexOf = function(_elem) {
|
|
for (var i = 0; i < this.length; i++)
|
|
{
|
|
if (this[i] === _elem)
|
|
return i;
|
|
}
|
|
return -1;
|
|
};
|
|
}
|
|
|
|
|