101 lines
3.9 KiB
Plaintext
101 lines
3.9 KiB
Plaintext
<div id="musician-hover" class="hidden bubble">
|
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
var rest = JK.Rest();
|
|
|
|
// function addLike(userId) {
|
|
// rest.addLike({user_id: userId})
|
|
// .done(function(response) {
|
|
// $("#spnLikeCount", "#musician-hover").text(parseInt($("#spnLikeCount", "#musician-hover").text()) + 1);
|
|
// var $btnLikeSelector = $("#btnLike", "#musician-hover");
|
|
// $btnLikeSelector.unbind("click");
|
|
// $btnLikeSelector.html("LIKED");
|
|
// });
|
|
// }
|
|
|
|
function addMusicianFollowing(userId) {
|
|
rest.addFollowing({user_id: userId})
|
|
.done(function(response) {
|
|
adjustMusicianFollowingCount(1);
|
|
|
|
var $btnFollowSelector = $("#btnFollow", "#musician-hover");
|
|
$btnFollowSelector.unbind('click');
|
|
$btnFollowSelector.attr('onclick', '');
|
|
$btnFollowSelector.click(function() {
|
|
removeMusicianFollowing(userId);
|
|
});
|
|
$btnFollowSelector.html("UNFOLLOW");
|
|
});
|
|
}
|
|
|
|
function removeMusicianFollowing(userId) {
|
|
rest.removeFollowing(userId)
|
|
.done(function(response) {
|
|
adjustMusicianFollowingCount(-1);
|
|
|
|
var $btnFollowSelector = $("#btnFollow", "#musician-hover");
|
|
$btnFollowSelector.unbind('click');
|
|
$btnFollowSelector.attr('onclick', '');
|
|
$btnFollowSelector.click(function() {
|
|
addMusicianFollowing(userId);
|
|
});
|
|
$btnFollowSelector.html("FOLLOW");
|
|
});
|
|
}
|
|
|
|
function adjustMusicianFollowingCount(value) {
|
|
$("#spnFollowCount", "#musician-hover").html(parseInt($("#spnFollowCount", "#musician-hover").html()) + value);
|
|
}
|
|
|
|
function sendMusicianFriendRequest(userId) {
|
|
rest.sendFriendRequest(JK.app, userId);
|
|
$("#btnFriend", "#musician-hover").hide();
|
|
}
|
|
|
|
function removeMusicianFriend(userId) {
|
|
rest.removeFriend({friend_id: userId})
|
|
.done(function() {
|
|
var $btnFriendSelector = $("#btnFriend", "#musician-hover");
|
|
$btnFriendSelector.unbind("click");
|
|
$btnFriendSelector.attr('onclick', '');
|
|
$btnFriendSelector.html("CONNECT");
|
|
$btnFriendSelector.click(function() {
|
|
sendMusicianFriendRequest(userId);
|
|
});
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<script type="text/template" id="template-hover-musician">
|
|
<div class="bubble-inner">
|
|
<a href="#" class="avatar_large left mr20"><img src="{avatar_url}" /></a>
|
|
<div class="left ib">
|
|
<h3>{name}</h3>
|
|
<small>{location}</small><br /><br />
|
|
{instruments}
|
|
<br clear="all" />
|
|
<span id="spnFriendCount">{friend_count}</span> <img src="/assets/content/icon_friend.png" align="absmiddle" />
|
|
<span id="spnFollowCount">{follower_count}</span> <img src="/assets/content/icon_followers.png" width="22" height="12" align="absmiddle" />
|
|
{recording_count} <img src="/assets/content/icon_recordings.png" width="12" height="13" align="absmiddle" />
|
|
{session_count} <img src="/assets/content/icon_session_tiny.png" width="12" height="12" align="absmiddle" />
|
|
</div>
|
|
<br clear="all" /><br />
|
|
<div style="display:{session_display}" class="f12"><strong>IN SESSION — <a href="/client#/session/{session_id}">Click to Join</a></strong></div>
|
|
<br />
|
|
<div class="f11">{biography}</div><br />
|
|
<small><strong>FOLLOWING:</strong></small><br /><br />
|
|
<table class="musicians" cellpadding="0" cellspacing="5">
|
|
{followings}
|
|
</table>
|
|
<br />
|
|
<div align="center">
|
|
<div class="left"><a href="{profile_url}" class="button-orange">PROFILE</a></div>
|
|
<div class="left" style="display:none;"><a id="btnLike" onclick="addLike('{userId}');" class="button-orange">LIKE</a></div>
|
|
<div class="left"><a id="btnFriend" onclick="{friendAction}('{userId}');" class="button-orange">CONNECT</a></div>
|
|
<div class="left"><a id="btnFollow" onclick="{followAction}('{userId}');" class="button-orange">FOLLOW</a></div>
|
|
</div>
|
|
<br /><br />
|
|
</div>
|
|
</script> |