From d75cf96f25b6311786523fef048e33c593a1ba08 Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Tue, 8 Apr 2014 13:54:35 +0400 Subject: [PATCH 1/3] search valid usernames and hashtags --- js/twister_following.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/js/twister_following.js b/js/twister_following.js index 4fc54c2..5dc8d6a 100644 --- a/js/twister_following.js +++ b/js/twister_following.js @@ -367,12 +367,18 @@ function userSearchKeypress(item) { // Enter pressed var dummy = $(''); 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; } From 395e04906cf1305d905612ccd36b0d86121758e4 Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Thu, 10 Apr 2014 02:03:02 +0400 Subject: [PATCH 2/3] update followers counter every 10 minutes --- js/interface_home.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/interface_home.js b/js/interface_home.js index 784a18a..f20f706 100644 --- a/js/interface_home.js +++ b/js/interface_home.js @@ -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() }); } + function updateFollowers() + { + getFollowers( defaultScreenName, $(".mini-profile .followers-count") ); + // update followers every 10 minutes + setTimeout(updateFollowers, 10*60*1000); + } + function updateFollowSuggestion() { $('.follow-suggestions').empty(); From 62daed76bbf488670c0e6b4cdc1e49e8a3388dd0 Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Thu, 10 Apr 2014 02:31:32 +0400 Subject: [PATCH 3/3] fix users suggestion on type hashtag --- js/twister_following.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/twister_following.js b/js/twister_following.js index 5dc8d6a..4bb1ec3 100644 --- a/js/twister_following.js +++ b/js/twister_following.js @@ -383,6 +383,10 @@ function userSearchKeypress(item) { return false; } + if (prefix == '#') { // hashtag + return false; + } + //var partialName = item.val(); if( !partialName.length ) {