diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-09-03 13:52:20 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-09-03 13:52:20 -0400 |
| commit | f768ab296c07ce93efe9f2507cdf4b795aa10013 (patch) | |
| tree | 0470e2f1fbf96a23e70e324bbf25d5b286750b30 /public/assets/js/lib | |
| parent | 21b3290d8bc6276fb95ece54494fdfb518552de6 (diff) | |
pull in app skeleton from asdf-yt
Diffstat (limited to 'public/assets/js/lib')
| -rw-r--r-- | public/assets/js/lib/router.js | 31 | ||||
| -rw-r--r-- | public/assets/js/lib/views/index/index.js | 14 | ||||
| -rw-r--r-- | public/assets/js/lib/views/login/login.js | 14 |
3 files changed, 59 insertions, 0 deletions
diff --git a/public/assets/js/lib/router.js b/public/assets/js/lib/router.js new file mode 100644 index 0000000..30646c1 --- /dev/null +++ b/public/assets/js/lib/router.js @@ -0,0 +1,31 @@ +var lobby, room + +var SiteRouter = Router.extend({ + + el: "body", + + routes: { + "/": 'lobby', + "/index": 'index', + "/login": 'login', + "/details/:id": 'room', + }, + + initialize: function(){ + if (! user.username) { + app.view = new LoginView() + } + else { + this.route() + } + }, + + index: function(){ + app.view = new IndexView () + }, + + login: function(){ + app.view = new LoginView () + }, + +})
\ No newline at end of file diff --git a/public/assets/js/lib/views/index/index.js b/public/assets/js/lib/views/index/index.js new file mode 100644 index 0000000..095909d --- /dev/null +++ b/public/assets/js/lib/views/index/index.js @@ -0,0 +1,14 @@ +var IndexView = View.extend({ + + events: { + }, + + initialize: function(opt){ + // opt.parent = parent + }, + + success: function(){ + window.location.href = "/index" + }, + +})
\ No newline at end of file diff --git a/public/assets/js/lib/views/login/login.js b/public/assets/js/lib/views/login/login.js new file mode 100644 index 0000000..06d8808 --- /dev/null +++ b/public/assets/js/lib/views/login/login.js @@ -0,0 +1,14 @@ +var LoginView = FormView.extend({ + + events: { + }, + + initialize: function(opt){ + // opt.parent = parent + }, + + success: function(){ + window.location.href = "/index" + }, + +})
\ No newline at end of file |
