Browse Source

Merge pull request #38 from dryabov/master

update followers counter every 10 minutes
master
Hedgehog 11 years ago
parent
commit
5148fa8b98
  1. 10
      js/interface_home.js
  2. 20
      js/twister_following.js

10
js/interface_home.js

@ -47,7 +47,8 @@ var InterfaceFunctions = function() @@ -47,7 +47,8 @@ var InterfaceFunctions = function()
getFullname( defaultScreenName, $miniProfile.find(".mini-profile-name") );
getAvatar( defaultScreenName, $miniProfile.find(".mini-profile-photo").find("img") );
getPostsCount( defaultScreenName, $miniProfile.find(".posts-count") );
getFollowers( defaultScreenName, $miniProfile.find(".followers-count") );
updateFollowers();
loadFollowing( function(args) {
$(".mini-profile .following-count").text(followingUsers.length-1);
@ -81,6 +82,13 @@ var InterfaceFunctions = function() @@ -81,6 +82,13 @@ var InterfaceFunctions = function()
});
}
function updateFollowers()
{
getFollowers( defaultScreenName, $(".mini-profile .followers-count") );
// update followers every 10 minutes
setTimeout(updateFollowers, 10*60*1000);
}
function updateFollowSuggestion()
{
$('.follow-suggestions').empty();

20
js/twister_following.js

@ -367,16 +367,26 @@ function userSearchKeypress(item) { @@ -367,16 +367,26 @@ function userSearchKeypress(item) {
// Enter pressed
var dummy = $('<a></a>');
if (prefix == '#') { // hashtag
dummy.attr('href', $.MAL.hashtagUrl(partialName));
dummy.text('#' + partialName);
openHashtagModal.call(dummy.get(0), item);
partialName = _extractHashtag(partialName);
if (partialName) {
dummy.attr('href', $.MAL.hashtagUrl(partialName));
dummy.text('#' + partialName);
openHashtagModal.call(dummy.get(0), item);
}
} else { // username
dummy.attr('href', $.MAL.userUrl(partialName));
openProfileModal.call(dummy.get(0), item);
partialName = _extractUsername(partialName);
if (partialName) {
dummy.attr('href', $.MAL.userUrl(partialName));
openProfileModal.call(dummy.get(0), item);
}
}
return false;
}
if (prefix == '#') { // hashtag
return false;
}
//var partialName = item.val();
if( !partialName.length ) {

Loading…
Cancel
Save