2013-08-27 23:59:53 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
/* Make user and settings available for everyone through root scope.
|
|
|
|
|
*/
|
|
|
|
|
|
2013-08-28 04:28:50 +00:00
|
|
|
habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User',
|
|
|
|
|
function($scope, $rootScope, $location, User) {
|
2013-08-27 23:59:53 +00:00
|
|
|
$rootScope.modals = {};
|
|
|
|
|
$rootScope.User = User;
|
|
|
|
|
$rootScope.user = User.user;
|
|
|
|
|
$rootScope.settings = User.settings;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
FIXME this is dangerous, organize helpers.coffee better, so we can group them by which controller needs them,
|
|
|
|
|
and then simply _.defaults($scope, Helpers.user) kinda thing
|
|
|
|
|
*/
|
|
|
|
|
_.defaults($rootScope, window.habitrpgShared.algos);
|
|
|
|
|
_.defaults($rootScope, window.habitrpgShared.helpers);
|
|
|
|
|
|
2013-08-29 02:51:45 +00:00
|
|
|
$rootScope.set = User.set;
|
|
|
|
|
$rootScope.authenticated = User.authenticated;
|
2013-08-27 23:59:53 +00:00
|
|
|
|
2013-08-28 02:37:56 +00:00
|
|
|
$rootScope.dismissAlert = function() {
|
|
|
|
|
$rootScope.modals.newStuff = false;
|
|
|
|
|
$rootScope.set('flags.newStuff',false);
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-29 02:51:45 +00:00
|
|
|
$rootScope.notPorted = function(){
|
|
|
|
|
alert("This feature is not yet ported from the original site.");
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-28 04:28:50 +00:00
|
|
|
}]);
|