Files
NodeBB/public/src/forum/account.js

41 lines
832 B
JavaScript
Raw Normal View History

(function() {
var yourid = templates.get('yourid'),
theirid = templates.get('theirid'),
2013-06-20 16:13:23 -04:00
isFollowing = templates.get('isFollowing');
2013-06-20 16:13:23 -04:00
$(document).ready(function() {
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');
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() {
followBtn.remove();
socket.emit('api:user.follow', {uid: theirid});
2013-06-20 16:13:23 -04:00
return false;
});
$('.user-recent-posts .topic-row').on('click', function() {
ajaxify.go($(this).attr('topic-url'));
})
2013-06-20 16:13:23 -04:00
});
}());