2013-05-29 12:17:44 -04:00
|
|
|
(function() {
|
|
|
|
|
var yourid = templates.get('yourid'),
|
2013-06-05 16:01:26 -04:00
|
|
|
theirid = templates.get('theirid'),
|
2013-06-20 16:13:23 -04:00
|
|
|
isFollowing = templates.get('isFollowing');
|
2013-05-29 12:17:44 -04:00
|
|
|
|
2013-06-20 16:13:23 -04:00
|
|
|
$(document).ready(function() {
|
2013-05-29 12:17:44 -04:00
|
|
|
|
2013-06-20 16:13:23 -04:00
|
|
|
var rep = $('#reputation');
|
|
|
|
|
rep.html(app.addCommas(rep.html()));
|
|
|
|
|
|
|
|
|
|
var postcount = $('#postcount');
|
|
|
|
|
postcount.html(app.addCommas(postcount.html()));
|
|
|
|
|
|
|
|
|
|
var editLink = $('#editLink');
|
2013-06-17 15:25:09 -04:00
|
|
|
var followBtn = $('#follow-btn');
|
2013-06-20 16:13:23 -04:00
|
|
|
|
|
|
|
|
if( yourid !== theirid) {
|
|
|
|
|
editLink.hide();
|
|
|
|
|
if(isFollowing)
|
|
|
|
|
followBtn.hide();
|
|
|
|
|
else
|
|
|
|
|
followBtn.show();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
followBtn.hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
followBtn.on('click', function() {
|
2013-07-10 11:20:31 -04:00
|
|
|
|
|
|
|
|
followBtn.remove();
|
|
|
|
|
socket.emit('api:user.follow', {uid: theirid});
|
2013-06-20 16:13:23 -04:00
|
|
|
return false;
|
|
|
|
|
});
|
2013-05-29 12:17:44 -04:00
|
|
|
|
2013-07-19 12:03:54 -04:00
|
|
|
$('.user-recent-posts .topic-row').on('click', function() {
|
|
|
|
|
ajaxify.go($(this).attr('topic-url'));
|
|
|
|
|
})
|
|
|
|
|
|
2013-06-20 16:13:23 -04:00
|
|
|
});
|
2013-05-29 12:17:44 -04:00
|
|
|
|
|
|
|
|
}());
|