updated ajaxify to do a callback after page change, added toaster style notifications (app.alert), changes to webserver to update automatically

This commit is contained in:
psychobunny
2013-04-23 19:38:48 +00:00
parent 96a4cbd8d1
commit 67bf1b6041
6 changed files with 97 additions and 11 deletions

View File

@@ -3,16 +3,18 @@ var ajaxify = {};
(function($) {
var rootUrl = document.location.protocol + '//' + (document.location.hostname || document.location.host) + (document.location.port ? ':'+document.location.port : ''),
var location = document.location || window.location,
rootUrl = location.protocol + '//' + (location.hostname || location.host) + (location.port ? ':' + location.port : ''),
content = null;
var current_state = '';
var current_state = null;
ajaxify.go = function(url) {
ajaxify.go = function(url, callback) {
var url = url.replace(/\/$/, "");
var tpl_url = (url === '') ? 'home' : url;
if (templates[tpl_url]) {
if (current_state != url) {
if (current_state === null || current_state != url) {
current_state = url;
window.history.pushState({}, url, "/" + url);
@@ -20,6 +22,9 @@ var ajaxify = {};
exec_body_scripts(content);
ajaxify.enable();
if (callback) {
callback();
}
}
return true;