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 = {
|
|
|
|
html5history: true,
|
|
|
|
run_handler_in_init: false,
|
|
|
|
convert_hash_in_init: false
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
}
|