summaryrefslogtreecommitdiff
path: root/public/js/lib/views/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/lib/views/index.js')
-rw-r--r--public/js/lib/views/index.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/public/js/lib/views/index.js b/public/js/lib/views/index.js
new file mode 100644
index 0000000..d5ec35d
--- /dev/null
+++ b/public/js/lib/views/index.js
@@ -0,0 +1,29 @@
+var SiteRouter = Router.extend({
+ el: "body",
+
+ events: {
+ },
+
+ routes: {
+ "/": 'lobby',
+ "/v/:name": 'room',
+ },
+
+ initialize: function(){
+ if (! user.username) {
+ $("#login").show()
+ }
+ else {
+ this.route()
+ }
+ },
+
+ lobby: function(){
+ this.view = new LobbyView ()
+ },
+
+ room: function(name){
+ this.view = new RoomView (name)
+ },
+
+}) \ No newline at end of file