|
|
@ -388,11 +388,14 @@ function isPublicFollowing(user) { |
|
|
|
if( followingUsers.indexOf(user) < 0 ) { |
|
|
|
if( followingUsers.indexOf(user) < 0 ) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
if( (user in _isFollowPublic) && _isFollowPublic[user] == true ) |
|
|
|
if( (user in _isFollowPublic) && _isFollowPublic[user] == true ) { |
|
|
|
|
|
|
|
//console.log("isPublicFollowing( " +user +" ) = "+true);
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
else |
|
|
|
} else { |
|
|
|
|
|
|
|
//console.log("isPublicFollowing( " +user +" ) = "+false);
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// check if following list is empty
|
|
|
|
// check if following list is empty
|
|
|
|
function followingEmptyOrMyself() { |
|
|
|
function followingEmptyOrMyself() { |
|
|
@ -521,7 +524,11 @@ function showFollowingUsers(){ |
|
|
|
resItem.find("a.open-profile-modal").attr("href",$.MAL.userUrl(followingUsers[i])); |
|
|
|
resItem.find("a.open-profile-modal").attr("href",$.MAL.userUrl(followingUsers[i])); |
|
|
|
resItem.find("a.unfollow").attr("href",$.MAL.unfollowUrl(followingUsers[i])); |
|
|
|
resItem.find("a.unfollow").attr("href",$.MAL.unfollowUrl(followingUsers[i])); |
|
|
|
resItem.find("a.direct-messages-with-user").attr("href", $.MAL.dmchatUrl(followingUsers[i])); |
|
|
|
resItem.find("a.direct-messages-with-user").attr("href", $.MAL.dmchatUrl(followingUsers[i])); |
|
|
|
resItem.find(".public-following").prop("checked",isPublicFollowing(followingUsers[i])); |
|
|
|
if (isPublicFollowing(followingUsers[i])) { |
|
|
|
|
|
|
|
resItem.find(".public-following").text(polyglot.t("Public")); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
resItem.find(".public-following").text(polyglot.t("Private")).addClass( "private" ); |
|
|
|
|
|
|
|
} |
|
|
|
getAvatar(followingUsers[i],resItem.find(".mini-profile-photo")); |
|
|
|
getAvatar(followingUsers[i],resItem.find(".mini-profile-photo")); |
|
|
|
getFullname(followingUsers[i],resItem.find(".mini-profile-name")); |
|
|
|
getFullname(followingUsers[i],resItem.find(".mini-profile-name")); |
|
|
|
if( followingUsers[i] == defaultScreenName ) { |
|
|
|
if( followingUsers[i] == defaultScreenName ) { |
|
|
@ -658,6 +665,16 @@ function processDropdownUserResults(partialName, results){ |
|
|
|
_searchingPartialUsers = ""; |
|
|
|
_searchingPartialUsers = ""; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function newFollowingConfigModal(username) { |
|
|
|
|
|
|
|
var FollowingConfigContent = $("#following-config-modal-template").children().clone(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FollowingConfigContent.closest(".following-config-modal-content").attr("data-screen-name", username) |
|
|
|
|
|
|
|
FollowingConfigContent.find(".following-config-method-message").text(polyglot.t("Which way do you want to follow")) |
|
|
|
|
|
|
|
FollowingConfigContent.find(".following-screen-name b").text(username); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return FollowingConfigContent; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function userClickFollow(e) { |
|
|
|
function userClickFollow(e) { |
|
|
|
e.stopPropagation(); |
|
|
|
e.stopPropagation(); |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
@ -672,10 +689,14 @@ function userClickFollow(e) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
follow(username, true, function() { |
|
|
|
var FollowingConfigClass = "following-config-modal"; |
|
|
|
// delay reload so dhtput may do it's job
|
|
|
|
openModal( FollowingConfigClass ); |
|
|
|
window.setTimeout("location.reload();",500); |
|
|
|
|
|
|
|
}); |
|
|
|
var FollowingConfigContent = newFollowingConfigModal(username); |
|
|
|
|
|
|
|
FollowingConfigContent.appendTo("." +FollowingConfigClass +" .modal-content"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//título do modal
|
|
|
|
|
|
|
|
$("." +FollowingConfigClass +" h3").text(polyglot.t("Following config")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function initUserSearch() { |
|
|
|
function initUserSearch() { |
|
|
@ -685,6 +706,13 @@ function initUserSearch() { |
|
|
|
$userSearchField.clickoutside( closeSearchDialog ); |
|
|
|
$userSearchField.clickoutside( closeSearchDialog ); |
|
|
|
|
|
|
|
|
|
|
|
$("button.follow").bind( "click", userClickFollow ); |
|
|
|
$("button.follow").bind( "click", userClickFollow ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(".following-config-method-buttons .public-following").bind( "click", setFollowingMethod ); |
|
|
|
|
|
|
|
$(".following-config-method-buttons .public-following").click( function() { |
|
|
|
|
|
|
|
closeModal($(this)); |
|
|
|
|
|
|
|
// delay reload so dhtput may do it's job
|
|
|
|
|
|
|
|
window.setTimeout("location.reload();",500); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function followingListUnfollow(e) { |
|
|
|
function followingListUnfollow(e) { |
|
|
@ -704,16 +732,32 @@ function followingListPublicCheckbox(e) { |
|
|
|
|
|
|
|
|
|
|
|
var $this = $(this); |
|
|
|
var $this = $(this); |
|
|
|
var username = $this.closest(".mini-profile-info").attr("data-screen-name"); |
|
|
|
var username = $this.closest(".mini-profile-info").attr("data-screen-name"); |
|
|
|
var public = false; |
|
|
|
var method = false; |
|
|
|
$this.toggleClass( "private" ); |
|
|
|
$this.toggleClass( "private" ); |
|
|
|
if( $this.hasClass( "private" ) ) { |
|
|
|
if( $this.hasClass( "private" ) ) { |
|
|
|
$this.text( polyglot.t("Private") ); |
|
|
|
$this.text( polyglot.t("Private") ); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$this.text( polyglot.t("Public") ); |
|
|
|
$this.text( polyglot.t("Public") ); |
|
|
|
public = true; |
|
|
|
method = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//console.log("set following method of @" +username +" for "+method);
|
|
|
|
|
|
|
|
follow(username, method); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setFollowingMethod(e) { |
|
|
|
|
|
|
|
e.stopPropagation(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var $this = $(this); |
|
|
|
|
|
|
|
var username = $this.closest(".following-config-modal-content").attr("data-screen-name"); |
|
|
|
|
|
|
|
var method = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( !$this.hasClass("private") ) { |
|
|
|
|
|
|
|
method = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
follow(username, public); |
|
|
|
//console.log("start following @" +username +" by method "+method);
|
|
|
|
|
|
|
|
follow(username, method); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -764,7 +808,7 @@ function initInterfaceFollowing() { |
|
|
|
initInterfaceDirectMsg(); |
|
|
|
initInterfaceDirectMsg(); |
|
|
|
|
|
|
|
|
|
|
|
$("button.unfollow").bind( "click", followingListUnfollow ); |
|
|
|
$("button.unfollow").bind( "click", followingListUnfollow ); |
|
|
|
$(".public-following").bind( "click", followingListPublicCheckbox ); |
|
|
|
$(".mini-profile-info .public-following").bind( "click", followingListPublicCheckbox ); |
|
|
|
|
|
|
|
|
|
|
|
$(".mentions-from-user").bind( "click", openMentionsModal ); |
|
|
|
$(".mentions-from-user").bind( "click", openMentionsModal ); |
|
|
|
|
|
|
|
|
|
|
|