Created
June 5, 2013 15:10
-
-
Save anonymous/5714596 to your computer and use it in GitHub Desktop.
director routes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var routes = { | |
'!/': function() {load_app(socket)}, | |
/* '/comments/list': function(){loader("#main","html/main-box/WelcomeMsg.html",bind_welcome_msg)}, | |
'/home': function(){loader("#main","html/main-box/WelcomeMsg.html",bind_welcome_msg)}, | |
'/maps': function(){loader("#main","html/main-box/Map.html",bind_location)},*/ | |
'\!/blog': function(){console.log('Jestę routingę');load_blog("default",socket)}, | |
'!/mealselector': function(){load_meal_selector(socket)}, | |
'!/blog/:id': function(id){load_blog(id,socket)}, | |
'!/blog/post/2013/03/20/kitchen-couture-krynickie-jadlo-': function(){router.setRoute('/blog/post/2013/03/20/kitchen-couture-krynickie-jadlo')}, | |
'!/blog/post/2013/03/20/kitchen-couture-krynickie-jadlo': function(){router.setRoute('/blog/post/2013/03/20/dominique-just-ate-good-krynicki')}, | |
'!/blog/post/2013/03/11/pierwsze-odwiedziny-dominique-z': function(){router.setRoute('/blog/post/2013/03/11/pierwsze-odwiedziny-dominique-z-')}, | |
'!/blog/post/':{ | |
'/:year':{ | |
'/:month' :{ | |
'/:day' : { | |
'/:post' :{ | |
on: function(year,month,day,post){load_post(socket,{year:year,month:month,day:day,post:post});} | |
}, | |
on: function(year,month,day){load_post(socket,{year:year,month:month,day:day})} | |
}, | |
on: function(year,month){load_post(socket,{year:year,month:month})} | |
}, | |
on: function(year){load_post(socket,{year:year})} | |
} | |
}, | |
'!/user':{ | |
'/register/:method':{ | |
on: function(method){register(socket,method);} | |
}, | |
'/find': { | |
on: function(){findUsers(socket)} | |
}, | |
'/invites': { | |
on: function(){userInvites(socket)} | |
}, | |
'/login': { | |
on: function(){load_login(socket)} | |
}, | |
'/profile': { | |
'/:uid': function(uid){socket.send({reqUserProfile: uid});}, | |
on: function(){socket.send({reqUserProfile:-1})} | |
}, | |
}, | |
'!/diet': { | |
'/generate': function(){socket.send({reqGenerateDiet:"generate"})}, | |
on: function(){showDiet(socket)}, | |
}, | |
'!/messages':{ | |
on: function(){$.getScript("js/messages.js",function(){socket.messages = new messages(socket);});} | |
}, | |
'!/pantry':{ | |
on: function(){$.getScript("js/pantry.js",function(){socket.pantry = new pantry(socket)})} | |
}, | |
'!/search': { | |
on: function(){$.getScript('js/search.js',function(){socket.search = new search(socket)});} | |
}, | |
'!/payment': { | |
on: function(){socket.send({reqPayment:'saldo'});} | |
}, | |
'!/together':{ on: function(){$.getScript('js/together.js',function(){socket.together = new together(socket)})}, | |
'/:tid': { | |
on: function(tid){socket.send({reqTogetherDetails:tid})} | |
} | |
}, | |
'!/logout': function(){socket.send({reqLogout:"OK"})}, | |
'!/product/:id':function(id){$.getScript("js/rest.js",function(){socket.rest = new rest(socket,'product',id)})}, | |
'!/user/list': function(){loader("#main","html/user-social/user_list.html",bind_user_list)}, | |
'!/quiz': function(){loadQuiz(socket)}, | |
'!/footer/:type': function(type){loadFooter(socket,type);}, | |
}; | |
var opts = { | |
async: true, | |
//html5history: true | |
}; | |
var router = Router(routes).configure(opts); | |
router.init('\!/blog'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment