|
|
@ -353,6 +353,9 @@ function updateFollowing(cbFunc, cbArg) { |
|
|
|
function follow(user, publicFollow, cbFunc, cbArg) { |
|
|
|
function follow(user, publicFollow, cbFunc, cbArg) { |
|
|
|
if( followingUsers.indexOf(user) < 0 ) { |
|
|
|
if( followingUsers.indexOf(user) < 0 ) { |
|
|
|
followingUsers.push(user); |
|
|
|
followingUsers.push(user); |
|
|
|
|
|
|
|
twisterFollowingO.update(user); |
|
|
|
|
|
|
|
$(".following-count").text(followingUsers.length-1); |
|
|
|
|
|
|
|
setTimeout('requestTimelineUpdate("latest",postsPerRefresh,["'+user+'"],promotedPostsOnly)', 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
if( publicFollow == undefined || publicFollow ) |
|
|
|
if( publicFollow == undefined || publicFollow ) |
|
|
|
_isFollowPublic[user] = true; |
|
|
|
_isFollowPublic[user] = true; |
|
|
@ -367,6 +370,7 @@ function unfollow(user, cbFunc, cbArg) { |
|
|
|
if( i >= 0 ) { |
|
|
|
if( i >= 0 ) { |
|
|
|
followingUsers.splice(i,1); |
|
|
|
followingUsers.splice(i,1); |
|
|
|
twisterFollowingO.update(user); |
|
|
|
twisterFollowingO.update(user); |
|
|
|
|
|
|
|
$(".following-count").text(followingUsers.length-1); |
|
|
|
} |
|
|
|
} |
|
|
|
delete _isFollowPublic[user]; |
|
|
|
delete _isFollowPublic[user]; |
|
|
|
saveFollowing(); |
|
|
|
saveFollowing(); |
|
|
@ -570,8 +574,7 @@ function processSuggestion(arg, suggestion, followedBy) { |
|
|
|
|
|
|
|
|
|
|
|
function closeSearchDialog() |
|
|
|
function closeSearchDialog() |
|
|
|
{ |
|
|
|
{ |
|
|
|
var $this = $(".userMenu-search-field");//$( this );
|
|
|
|
$(".userMenu-search-field").siblings().slideUp( "fast" ); |
|
|
|
$( this ).siblings().slideUp( "fast" ); |
|
|
|
|
|
|
|
removeUsersFromDhtgetQueue( _lastSearchUsersResults ); |
|
|
|
removeUsersFromDhtgetQueue( _lastSearchUsersResults ); |
|
|
|
_lastSearchUsersResults = []; |
|
|
|
_lastSearchUsersResults = []; |
|
|
|
} |
|
|
|
} |
|
|
@ -654,6 +657,8 @@ function processDropdownUserResults(partialName, results){ |
|
|
|
resItem.find("a.open-profile-modal").attr("href",$.MAL.userUrl(results[i])); |
|
|
|
resItem.find("a.open-profile-modal").attr("href",$.MAL.userUrl(results[i])); |
|
|
|
getAvatar(results[i],resItem.find(".mini-profile-photo")); |
|
|
|
getAvatar(results[i],resItem.find(".mini-profile-photo")); |
|
|
|
getFullname(results[i],resItem.find(".mini-profile-name")); |
|
|
|
getFullname(results[i],resItem.find(".mini-profile-name")); |
|
|
|
|
|
|
|
if (followingUsers.indexOf(results[i]) >= 0) |
|
|
|
|
|
|
|
toggleFollowButton(resItem.find(".follow"), results[i]); |
|
|
|
resItem.appendTo(typeaheadAccounts); |
|
|
|
resItem.appendTo(typeaheadAccounts); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -677,6 +682,7 @@ function newFollowingConfigModal(username) { |
|
|
|
function userClickFollow(e) { |
|
|
|
function userClickFollow(e) { |
|
|
|
e.stopPropagation(); |
|
|
|
e.stopPropagation(); |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
$(e.target).addClass("followingInitiator"); |
|
|
|
|
|
|
|
|
|
|
|
var $this = $(this); |
|
|
|
var $this = $(this); |
|
|
|
var $userInfo = $this.closest("[data-screen-name]"); |
|
|
|
var $userInfo = $this.closest("[data-screen-name]"); |
|
|
@ -702,7 +708,7 @@ function initUserSearch() { |
|
|
|
var $userSearchField = $( ".userMenu-search-field" ); |
|
|
|
var $userSearchField = $( ".userMenu-search-field" ); |
|
|
|
$userSearchField.keyup( userSearchKeypress ); |
|
|
|
$userSearchField.keyup( userSearchKeypress ); |
|
|
|
$userSearchField.bind( "click", userSearchKeypress ); |
|
|
|
$userSearchField.bind( "click", userSearchKeypress ); |
|
|
|
$userSearchField.clickoutside( closeSearchDialog ); |
|
|
|
$(".userMenu-search").clickoutside( closeSearchDialog ); |
|
|
|
|
|
|
|
|
|
|
|
$("button.follow").bind( "click", userClickFollow ); |
|
|
|
$("button.follow").bind( "click", userClickFollow ); |
|
|
|
|
|
|
|
|
|
|
@ -710,7 +716,7 @@ function initUserSearch() { |
|
|
|
$(".following-config-method-buttons .public-following").click( function() { |
|
|
|
$(".following-config-method-buttons .public-following").click( function() { |
|
|
|
closePrompt(); |
|
|
|
closePrompt(); |
|
|
|
// delay reload so dhtput may do it's job
|
|
|
|
// delay reload so dhtput may do it's job
|
|
|
|
window.setTimeout("loadModalFromHash();",500); |
|
|
|
window.setTimeout("loadModalFromHash();",500); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -754,9 +760,14 @@ function setFollowingMethod(e) { |
|
|
|
if( !$this.hasClass("private") ) { |
|
|
|
if( !$this.hasClass("private") ) { |
|
|
|
publicFollow = true; |
|
|
|
publicFollow = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//console.log("start following @" +username +" by method "+publicFollow);
|
|
|
|
//console.log("start following @" +username +" by method "+publicFollow);
|
|
|
|
follow(username, publicFollow); |
|
|
|
follow(username, publicFollow, |
|
|
|
|
|
|
|
(function() { |
|
|
|
|
|
|
|
var followingInitiator = $(".followingInitiator"); |
|
|
|
|
|
|
|
if (followingInitiator) |
|
|
|
|
|
|
|
toggleFollowButton(followingInitiator, this); |
|
|
|
|
|
|
|
}).bind(username) |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|