includes/clientside/static/loader.js
author Dan Fuhry <dan@enanocms.org>
Fri, 19 Nov 2010 02:47:10 -0500
changeset 1328 2a5845ef8c1d
parent 1227 bdac73ed481e
permissions -rw-r--r--
Some enhancements to the error handler. It replaces out ENANO_ROOT for security, and if the warning is from dbal.php and ENANO_DEBUG is set, prints out a much more verbose message.

// Some final stuff - loader routines, etc.

var onload_complete = false;

function mdgInnerLoader(e)
{
	window.onkeydown = isKeyPressed;
	window.onkeyup = function(e) { isKeyPressed(e); };
	
	if ( typeof(dbx_set_key) == 'function')
	{
		dbx_set_key();
	}
	
	runOnloadHooks(e);
}

// Enano's main init function.
function enano_init(e)
{
	mdgInnerLoader(e);
	
	// we're loaded; set flags to true
	console.info('Enano::JS runtime: system init complete');
	onload_complete = true;
}

// don't init the page if less than IE6
if ( typeof(KILL_SWITCH) == 'boolean' && !KILL_SWITCH )
{
	window.onload = enano_init;
}