var app = (function(){ var app = {} app.init = function(){ app.debug = !! window.location.search.match('debug') app.router = new SiteRouter () app.view = null $(window).on("focus", app.focus) $(window).on("blur", app.blur) set_background_color_from_time() auth.init(app.ready) sdk.init() } app.ready = function(){ app.router.route() } app.focused = true app.typing = false app.focus = function(){ app.focused = true } app.blur = function(){ app.focused = false } document.addEventListener('DOMContentLoaded', app.init) return app })()