mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-18 19:58:52 +00:00
rewrite: add back in bulid-safe angular DI
This commit is contained in:
parent
e355627bf0
commit
e641fe9cf1
6 changed files with 17 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -7,6 +7,7 @@ config.json
|
|||
npm-debug.log
|
||||
lib
|
||||
public/bower_components
|
||||
builtAssets/
|
||||
|
||||
src/*/*.js
|
||||
src/*/*.map
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
The authentication controller (login & facebook)
|
||||
*/
|
||||
|
||||
habitrpg.controller("AuthCtrl", function($scope, $rootScope, Facebook, LocalAuth, User, $http, $location, API_URL) {
|
||||
habitrpg.controller("AuthCtrl", ['$scope', '$rootScope', 'Facebook', 'LocalAuth', 'User', '$http', '$location', 'API_URL',
|
||||
function($scope, $rootScope, Facebook, LocalAuth, User, $http, $location, API_URL) {
|
||||
var runAuth;
|
||||
var showedFacebookMessage;
|
||||
$scope.useUUID = false;
|
||||
|
|
@ -65,4 +66,4 @@ habitrpg.controller("AuthCtrl", function($scope, $rootScope, Facebook, LocalAuth
|
|||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
}]);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
/* Make user and settings available for everyone through root scope.
|
||||
*/
|
||||
|
||||
habitrpg.controller("RootCtrl", function($scope, $rootScope, $location, User) {
|
||||
habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User',
|
||||
function($scope, $rootScope, $location, User) {
|
||||
$rootScope.modals = {};
|
||||
$rootScope.User = User;
|
||||
$rootScope.user = User.user;
|
||||
|
|
@ -35,4 +36,4 @@ habitrpg.controller("RootCtrl", function($scope, $rootScope, $location, User) {
|
|||
$rootScope.set('flags.newStuff',false);
|
||||
}
|
||||
|
||||
});
|
||||
}]);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
habitrpg.controller("TaskDetailsCtrl", function($scope, $rootScope, $location, User) {
|
||||
habitrpg.controller("TaskDetailsCtrl", ['$scope', '$rootScope', '$location', 'User',
|
||||
function($scope, $rootScope, $location, User) {
|
||||
$scope.save = function(task) {
|
||||
var log, setVal;
|
||||
setVal = function(k, v) {
|
||||
|
|
@ -54,4 +55,4 @@ habitrpg.controller("TaskDetailsCtrl", function($scope, $rootScope, $location, U
|
|||
$scope.editedTask = null;
|
||||
$scope.editing = false;
|
||||
};
|
||||
});
|
||||
}]);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
habitrpg.controller("TasksCtrl", function($scope, $rootScope, $location, User, Algos, Helpers, Notification) {
|
||||
habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User', 'Algos', 'Helpers', 'Notification',
|
||||
function($scope, $rootScope, $location, User, Algos, Helpers, Notification) {
|
||||
/*FIXME
|
||||
*/
|
||||
$scope.taskLists = [
|
||||
|
|
@ -152,4 +153,4 @@ habitrpg.controller("TasksCtrl", function($scope, $rootScope, $location, User, A
|
|||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
}]);
|
||||
|
|
|
|||
|
|
@ -1,17 +1,16 @@
|
|||
"use strict";
|
||||
|
||||
habitrpg.controller("UserAvatarCtrl", function($scope, $location, filterFilter, User) {
|
||||
debugger
|
||||
habitrpg.controller("UserAvatarCtrl", ['$scope', '$location', 'User',
|
||||
function($scope, $location, User) {
|
||||
$scope.profile = User.user;
|
||||
$scope.hideUserAvatar = function() {
|
||||
$(".userAvatar").hide();
|
||||
};
|
||||
|
||||
$scope.clickAvatar = function(profile) {
|
||||
debugger
|
||||
if (User.user.id == profile.id) {
|
||||
if ($location.path() == '/tasks') {
|
||||
$location.path('/options')
|
||||
$location.path('/options');
|
||||
} else {
|
||||
$location.path('/tasks');
|
||||
}
|
||||
|
|
@ -20,4 +19,4 @@ habitrpg.controller("UserAvatarCtrl", function($scope, $location, filterFilter,
|
|||
//$("#avatar-modal-#{uid}").modal('show')
|
||||
}
|
||||
}
|
||||
});
|
||||
}]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue