diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-08-05 00:51:32 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-08-05 00:51:32 -0400 |
| commit | d0b4cd4f7e6364a35a420f2f3b0fcdbb502d8a9a (patch) | |
| tree | b05b32e1f283946346e96c9ded24f0966ce584ed /public/js/index.js | |
| parent | 18648921f75a7c458cf0c951c249b28a48f08a6b (diff) | |
basic routing
Diffstat (limited to 'public/js/index.js')
| -rw-r--r-- | public/js/index.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/public/js/index.js b/public/js/index.js index 560a2a1..30f5975 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2,11 +2,25 @@ var app = (function(){ var app = {} app.init = function(){ - // ws.connect() + user.init() + + app.socket = ws.connect() + + app.router = new SiteRouter () $(window).on("focus", app.focus) $(window).on("blur", app.blur) } + app.focused = true + + app.focus = function(){ + app.focused = true + } + + app.blur = function(){ + app.focused = false + } + document.addEventListener('DOMContentLoaded', app.init) })() |
