Subdocs & script templates. Migrate the API from User.tasks =>

User.habits/dailys/todos/rewards. Move /#/tasks & /#/options page
loading from server-sent html to everything loaded in the page as script
templates (including necessary fixes for adsense). NOTE: this commit
won't work, it depends a bit on the *next* commit with Challenges
functionality, but I wanted to separate it out a bit for clarity
This commit is contained in:
Tyler Renelle
2013-10-26 17:23:52 -07:00
parent e81193ef28
commit e45d8307e7
18 changed files with 415 additions and 575 deletions

View File

@@ -12,6 +12,11 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
$rootScope.settings = User.settings;
$rootScope.flash = {errors: [], warnings: []};
// indexOf helper
$scope.indexOf = function(haystack, needle){
return ~haystack.indexOf(needle);
}
$scope.safeApply = function(fn) {
var phase = this.$root.$$phase;
if(phase == '$apply' || phase == '$digest') {