Merge branch 'master' of github.com:psychobunny/node-forum

This commit is contained in:
Julian Lam
2013-04-23 16:18:50 -04:00
4 changed files with 25 additions and 14 deletions

View File

@@ -18,13 +18,19 @@ var ajaxify = {};
current_state = url;
window.history.pushState({}, url, "/" + url);
content.innerHTML = templates[tpl_url];
exec_body_scripts(content);
jQuery('#content').fadeOut(100, function() {
content.innerHTML = templates[tpl_url];
exec_body_scripts(content);
ajaxify.enable();
if (callback) {
callback();
}
ajaxify.enable();
if (callback) {
callback();
}
jQuery('#content').fadeIn(200);
});
}
return true;
@@ -42,6 +48,7 @@ var ajaxify = {};
if (ajaxify.go(url)) {
ev.preventDefault();
return false;
}
}

View File

@@ -13,6 +13,10 @@ var socket,
socket.on('event:connect', function(data) {
});
socket.on('event:alert', function(data) {
app.alert(data);
});
},
async: false

View File

@@ -58,14 +58,7 @@
socket.on('user.create', function(data) {
//console.log('user create: ' + data.status);
ajaxify.go('/', function() {
app.alert({
title: 'Thank you for registering',
message: 'You have successfully registered - welcome to nodebb!',
type: 'notify',
timeout: 2000
});
});
ajaxify.go('/');
});
socket.on('user.exists', function(data) {

View File

@@ -68,6 +68,13 @@ var config = require('../config.js'),
io.sockets.emit('user.latest', {username: username});
global.socket.emit('user.create', {'status': 1});
global.socket.emit('event:alert', {
title: 'Thank you for registering',
message: 'You have successfully registered - welcome to nodebb!',
type: 'notify',
timeout: 2000
});
});
});
};