From 8a2c18de5b75fb10c0c1bd91083cf860d641307f Mon Sep 17 00:00:00 2001 From: psychobunny Date: Mon, 6 May 2013 03:41:22 +0000 Subject: [PATCH] fixed ajaxify bug that was rendering pages twice (solved flicker issue); fixed entering rooms that was casuing rep/streaming posts to not work; fixed /accounts to work by adding get data route; fixed bug that preventing gravatars from loading if there was more than one post in the thread --- public/src/ajaxify.js | 4 +++- src/posts.js | 6 +++--- src/user.js | 5 +++-- src/webserver.js | 20 ++++++++++++-------- src/websockets.js | 4 +--- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index 97907a8b86..c4aea9a599 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -33,7 +33,9 @@ var ajaxify = {}; if (templates[tpl_url]) { window.history.pushState({}, url, "/" + url); - jQuery('#content, #footer').fadeOut(100, function() { + + jQuery('#footer').fadeOut(100); + jQuery('#content').fadeOut(100, function() { load_template(function() { exec_body_scripts(content); diff --git a/src/posts.js b/src/posts.js index 05783591ab..34f60642b8 100644 --- a/src/posts.js +++ b/src/posts.js @@ -47,7 +47,7 @@ var RDB = require('./redis.js'), post_rep = replies[3]; user.get_user_postdetails(uid, function(user_details) { - user.get_gravatars_by_uids([uid], '', function(gravatars) { + user.get_gravatars_by_uids(uid, '', function(gravatars) { var posts = []; var callbacks = content.length; @@ -100,8 +100,8 @@ var RDB = require('./redis.js'), timeout: 2000 }); - user.get_user_postdetails([uid], function(user_details) { - user.get_gravatars_by_uids([uid], '', function(gravatars) { + user.get_user_postdetails(uid, function(user_details) { + user.get_gravatars_by_uids(uid, '', function(gravatars) { var timestamp = new Date().getTime(); socket.in('topic_' + tid).emit('event:new_post', { diff --git a/src/user.js b/src/user.js index 6cdf65414b..ab0eb2298e 100644 --- a/src/user.js +++ b/src/user.js @@ -52,10 +52,11 @@ var config = require('../config.js'), User.get_gravatars_by_uids = function(uids, size, callback) { var gravatars = []; - + for(var i=0, ii=uids.length; i= uids.length) callback(gravatars); diff --git a/src/webserver.js b/src/webserver.js index e3833a33f2..1db3873f25 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -124,7 +124,7 @@ passport.deserializeUser(function(uid, done) { // Basic Routes (entirely client-side parsed, goal is to move the rest of the crap in this file into this one section) (function() { - var routes = ['', 'login', 'register']; + var routes = ['', 'login', 'register', 'account']; for (var i=0, ii=routes.length; i