Merge branch 'develop' into classes

Conflicts:
	public/css/index.styl
	src/models/user.js
	views/options/profile.jade
	views/shared/header/avatar.jade
	views/shared/tasks/lists.jade
	views/shared/tasks/task.jade
This commit is contained in:
Tyler Renelle
2013-12-01 19:51:36 -07:00
81 changed files with 1369 additions and 397 deletions

View File

@@ -21,9 +21,25 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
return haystack && ~haystack.indexOf(needle);
}
// styling helpers
$scope.userLevelStyle = function(user,style){
style = style || '';
if(user && user.backer && user.backer.npc)
style += ' label-npc';
if(user && user.contributor && user.contributor.level)
style += ' label-contributor-'+user.contributor.level;
return style;
}
// count pets, mounts collected totals, etc
$rootScope.countExists = function(items) {return _.reduce(items,function(m,v){return m+(v?1:0)},0)}
$rootScope.petCount = window.habitrpgShared.helpers.countPets(null, User.user.items.pets);
$rootScope.$watch('user.items.pets', function(pets){
$rootScope.petCount = window.habitrpgShared.helpers.countPets($rootScope.countExists(pets), User.user.items.pets);
}, true);
$scope.safeApply = function(fn) {
var phase = this.$root.$$phase;
if(phase == '$apply' || phase == '$digest') {