[#1396] add ability to show tour at any time. Also add ability to show

Bailey at any time
This commit is contained in:
Tyler Renelle
2013-09-10 18:36:10 -04:00
parent 964eb91799
commit a7e99d0ac0
2 changed files with 15 additions and 2 deletions

View File

@@ -2,8 +2,8 @@
// Make user and settings available for everyone through root scope.
habitrpg.controller('SettingsCtrl',
['$scope', 'User', '$rootScope', '$http', 'API_URL',
function($scope, User, $rootScope, $http, API_URL) {
['$scope', 'User', '$rootScope', '$http', 'API_URL', 'Guide', '$location',
function($scope, User, $rootScope, $http, API_URL, Guide, $location) {
// FIXME we have this re-declared everywhere, figure which is the canonical version and delete the rest
// $scope.auth = function (id, token) {
@@ -15,6 +15,16 @@ habitrpg.controller('SettingsCtrl',
// });
// }
$scope.showTour = function(){
User.set('flags.showTour',true);
Guide.initTour();
$location.path('/tasks');
}
$scope.showBailey = function(){
User.set('flags.newStuff',true);
}
$scope.saveDayStart = function(){
var dayStart = +User.user.preferences.dayStart;
if (dayStart < 0 || dayStart > 24) {

View File

@@ -12,6 +12,9 @@
h4 Misc
button.btn(ng-hide='user.preferences.hideHeader', ng-click='set("preferences.hideHeader",true)') Hide Header
button.btn(ng-show='user.preferences.hideHeader', ng-click='set("preferences.hideHeader",false)') Show Header
button.btn(ng-click='showTour()') Show Tour
button.btn(ng-click='showBailey()') Show Bailey
div(ng-show='user.auth.local')
hr
h4 Change Password