2015-06-21 19:20:17 +00:00
|
|
|
var routes = {
|
|
|
|
'/lobby': function() {
|
|
|
|
alert('lobby');
|
|
|
|
},
|
2015-06-21 11:09:29 +00:00
|
|
|
|
2015-06-21 19:20:17 +00:00
|
|
|
'/deck-builder': function() {
|
|
|
|
alert('deck-builder');
|
|
|
|
},
|
2015-06-21 11:09:29 +00:00
|
|
|
|
2015-06-21 19:20:17 +00:00
|
|
|
'/highscore': function() {
|
|
|
|
alert('highscore');
|
|
|
|
}
|
|
|
|
};
|
2015-06-21 11:09:29 +00:00
|
|
|
|
2015-06-21 19:20:17 +00:00
|
|
|
var options = {
|
2015-06-22 08:47:05 +00:00
|
|
|
html5history: true
|
2015-06-21 19:20:17 +00:00
|
|
|
}
|
2015-06-21 15:14:53 +00:00
|
|
|
|
2015-06-21 19:20:17 +00:00
|
|
|
var Router = require('director').Router;
|
|
|
|
var router = new Router(routes).configure(options).init();
|
2015-06-21 11:09:29 +00:00
|
|
|
|
2015-06-21 19:20:17 +00:00
|
|
|
module.exports = {
|
|
|
|
changeRoute: function(route) {
|
|
|
|
router.setRoute(route);
|
2015-06-21 11:09:29 +00:00
|
|
|
}
|
|
|
|
}
|