small refactor of routing, cleanup, templates are now parsed entirely on client side for /, /register, /login for now

This commit is contained in:
psychobunny
2013-05-01 22:19:54 +00:00
parent 1bec9fc5aa
commit 9119a9d104
5 changed files with 60 additions and 17 deletions

View File

@@ -22,7 +22,7 @@ var ajaxify = {};
ajaxify.go = function(url, callback) {
var url = url.replace(/\/$/, "");
var tpl_url = (url === '') ? 'home' : url.split('/')[0];
var tpl_url = (url === '' || url === '/') ? 'home' : url.split('/')[0];
if (templates[tpl_url]) {
window.history.pushState({}, url, "/" + url);