|
|
@ -624,50 +624,50 @@ function getWhoFollows(peerAlias, elem) { |
|
|
|
; |
|
|
|
; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function processWhoToFollowSuggestion(module, suggestion, followedBy, prepend) { |
|
|
|
function processWhoToFollowSuggestion(module, peerAlias, followedBy, prepend) { |
|
|
|
if (suggestion) { |
|
|
|
if (!peerAlias) { |
|
|
|
var list = module.find('.follow-suggestions'); |
|
|
|
console.warn('nothing to proceed: no twisters to follow was suggested'); |
|
|
|
var item = $('#follow-suggestion-template').clone(true) |
|
|
|
return; |
|
|
|
.removeAttr('id'); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
item.find('.twister-user-info').attr('data-screen-name', suggestion); |
|
|
|
|
|
|
|
item.find('.twister-user-name').attr('href', $.MAL.userUrl(suggestion)); |
|
|
|
|
|
|
|
item.find('.twister-user-tag').text('@' + suggestion); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getAvatar(suggestion, item.find('.twister-user-photo')); |
|
|
|
|
|
|
|
getStatusTime(suggestion, item.find('.latest-activity .time')); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (module.hasClass('who-to-follow') || module.hasClass('who-to-follow-modal')) { |
|
|
|
|
|
|
|
item.find('.twister-by-user-name').attr('href', $.MAL.userUrl(followedBy)); |
|
|
|
|
|
|
|
getFullname(followedBy, item.find('.followed-by').text(followedBy)); |
|
|
|
|
|
|
|
item.find('.twister-user-remove').on('click', function () { |
|
|
|
|
|
|
|
item.remove(); |
|
|
|
|
|
|
|
getRandomFollowSuggestion(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (module.hasClass('new-users') || module.hasClass('new-users-modal')){ |
|
|
|
|
|
|
|
item.find('.followers').remove(); |
|
|
|
|
|
|
|
item.find('.twister-user-remove').remove(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (module.hasClass('modal-wrapper')) { |
|
|
|
var list = module.find('.follow-suggestions'); |
|
|
|
getFullname(suggestion, item.find('.twister-user-full')); |
|
|
|
var item = twister.tmpl.whoTofollowPeer.clone(true); |
|
|
|
getBioToElem(suggestion, item.find('.bio')); |
|
|
|
|
|
|
|
item.find('.twister-user-remove').remove(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (prepend) |
|
|
|
item.find('.twister-user-info').attr('data-screen-name', peerAlias); |
|
|
|
list.prepend(item).show(); |
|
|
|
item.find('.twister-user-name').attr('href', $.MAL.userUrl(peerAlias)); |
|
|
|
else |
|
|
|
item.find('.twister-user-tag').text('@' + peerAlias); |
|
|
|
list.append(item).show(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (module.hasClass('new-users') && list.children().length > 3) |
|
|
|
getAvatar(peerAlias, item.find('.twister-user-photo')); |
|
|
|
list.children().last().remove(); |
|
|
|
getStatusTime(peerAlias, item.find('.latest-activity .time')); |
|
|
|
|
|
|
|
|
|
|
|
module.find('.refresh-users').show(); |
|
|
|
if (module.hasClass('who-to-follow') || module.hasClass('who-to-follow-modal')) { |
|
|
|
module.find('.loading-roller').hide(); |
|
|
|
item.find('.twister-by-user-name').attr('href', $.MAL.userUrl(followedBy)); |
|
|
|
} else |
|
|
|
getFullname(followedBy, item.find('.followed-by').text(followedBy)); |
|
|
|
console.warn('nothing to proceed: no twisters to follow was suggested'); |
|
|
|
item.find('.twister-user-remove').on('click', {item: item}, function (event) { |
|
|
|
|
|
|
|
event.data.item.remove(); |
|
|
|
|
|
|
|
getRandomFollowSuggestion(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else if (module.hasClass('new-users') || module.hasClass('new-users-modal')) { |
|
|
|
|
|
|
|
item.find('.followers').remove(); |
|
|
|
|
|
|
|
item.find('.twister-user-remove').remove(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (module.hasClass('modal-wrapper')) { |
|
|
|
|
|
|
|
getFullname(peerAlias, item.find('.twister-user-full')); |
|
|
|
|
|
|
|
getBioToElem(peerAlias, item.find('.bio')); |
|
|
|
|
|
|
|
item.find('.twister-user-remove').remove(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (prepend) |
|
|
|
|
|
|
|
list.prepend(item).show(); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
list.append(item).show(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (module.hasClass('new-users') && list.children().length > 3) |
|
|
|
|
|
|
|
list.children().last().remove(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.find('.refresh-users').show(); |
|
|
|
|
|
|
|
module.find('.loading-roller').hide(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function closeSearchDialog(event) { |
|
|
|
function closeSearchDialog(event) { |
|
|
|