change some socket calls to use the callback, when user changes their email if they are using a gravatar picture it will be updated too, fixed email updating

This commit is contained in:
Baris Soner Usakli
2013-07-30 18:30:43 -04:00
parent 235553eaf6
commit 3f6f4e347d
10 changed files with 251 additions and 168 deletions

View File

@@ -195,7 +195,29 @@ var socket,
}
}
app.alertSuccess = function(message, timeout) {
if(!timeout)
timeout = 2000;
app.alert({
title: 'Success',
message: message,
type: 'success',
timeout: timeout
});
}
app.alertError = function(message, timeout) {
if(!timeout)
timeout = 2000;
app.alert({
title: 'Error',
message: message,
type: 'error',
timeout: timeout
});
}
app.current_room = null;
app.enter_room = function(room) {
@@ -254,9 +276,8 @@ var socket,
}, 100);
}
app.showLoginMessage = function() {
if(location.href.indexOf('loggedin') !== -1) {
function showAlert() {
app.alert({
type: 'success',
title: 'Welcome Back ' + app.username + '!',
@@ -264,6 +285,14 @@ var socket,
timeout: 5000
});
}
if(location.href.indexOf('loggedin') !== -1) {
if(document.readyState !== 'complete') {
$(document).ready(showAlert);
} else {
showAlert();
}
}
}
jQuery('document').ready(function() {
@@ -272,7 +301,7 @@ var socket,
loadConfig();
function addTouchEvents() {
return; // later.