src/js/libs/spiritual-gui.js
function() {
			var that = this,
				add = function(target, events, capture) {
					events.split(' ').forEach(function(type) {
						target.addEventListener(type, that, capture);
					});
				};
			add(document, 'DOMContentLoaded');
			add(document, 'click mousedown mouseup', true);
			add(window, 'load hashchange');
			if (!gui.hosted) {
				add(window, 'resize orientationchange');
			}
			if (!(window.chrome && chrome.app && chrome.runtime)) {
				add(window, 'unload');
			}
			
			/*
			if (document.readyState === "complete") { // TODO: IE cornercase?
				if (!this._loaded) {
					this._ondom();
					this._onload();
				}
			}
			*/
		}
function() {
			var that = this,
				add = function(target, events, capture) {
					events.split(' ').forEach(function(type) {
						target.addEventListener(type, that, capture);
					});
				};
			add(document, 'DOMContentLoaded');
			add(document, 'click mousedown mouseup', true);
			add(window, 'load hashchange');
			if (!gui.hosted) {
				add(window, 'resize orientationchange');
			}
			if (!(window.chrome && chrome.app && chrome.runtime)) {
				add(window, 'unload');
			}
			
			/*
			if (document.readyState === "complete") { // TODO: IE cornercase?
				if (!this._loaded) {
					this._ondom();
					this._onload();
				}
			}
			*/
		}
function ( ) { var that = this , add = function ( target , events , capture ) { events . split ( ' ' ) . forEach ( function ( type ) { target . addEventListener ( type , that , capture ) ; } ) ; } ; add ( document , 'DOMContentLoaded' ) ; add ( document , 'click mousedown mouseup' , true ) ; add ( window , 'load hashchange' ) ; if ( ! gui . hosted ) { add ( window , 'resize orientationchange' ) ; } if ( ! ( window . chrome && chrome . app && chrome . runtime ) ) { add ( window , 'unload' ) ; } /*
			if (document.readyState === "complete") { // TODO: IE cornercase?
				if (!this._loaded) {
					this._ondom();
					this._onload();
				}
			}
			*/ }
Setup loads of event listeners.
Setup loads of event listeners .