modified exec_body_scripts to load external scripts. finally moved all the js files out of tpls into their own js

todo: still need to organize the individual scripts client side,
This commit is contained in:
psychobunny
2013-05-29 12:17:44 -04:00
parent 9c546c92ad
commit 34131ad46c
23 changed files with 1326 additions and 1340 deletions

View File

@@ -0,0 +1,42 @@
(function() {
var yourid = templates.get('yourid'),
theirid = templates.get('theirid');
var isFriend = {isFriend};
$(document).ready(function() {
var rep = $('#reputation');
rep.html(app.addCommas(rep.html()));
var postcount = $('#postcount');
postcount.html(app.addCommas(postcount.html()));
var editLink = $('#editLink');
var addFriendBtn = $('#add-friend-btn');
if( yourid !== theirid) {
editLink.hide();
if(isFriend)
addFriendBtn.hide();
else
addFriendBtn.show();
}
else {
addFriendBtn.hide();
}
addFriendBtn.on('click', function() {
$.post('/users/addfriend', {uid: theirid},
function(data) {
addFriendBtn.remove();
$('#user-action-alert').html('Friend Added!').show();
}
);
return false;
});
});
}());