mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-13 17:52:22 +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
|
npm-debug.log
|
||||||
lib
|
lib
|
||||||
public/bower_components
|
public/bower_components
|
||||||
|
builtAssets/
|
||||||
|
|
||||||
src/*/*.js
|
src/*/*.js
|
||||||
src/*/*.map
|
src/*/*.map
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
The authentication controller (login & facebook)
|
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 runAuth;
|
||||||
var showedFacebookMessage;
|
var showedFacebookMessage;
|
||||||
$scope.useUUID = false;
|
$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.
|
/* 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.modals = {};
|
||||||
$rootScope.User = User;
|
$rootScope.User = User;
|
||||||
$rootScope.user = User.user;
|
$rootScope.user = User.user;
|
||||||
|
|
@ -35,4 +36,4 @@ habitrpg.controller("RootCtrl", function($scope, $rootScope, $location, User) {
|
||||||
$rootScope.set('flags.newStuff',false);
|
$rootScope.set('flags.newStuff',false);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
}]);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"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) {
|
$scope.save = function(task) {
|
||||||
var log, setVal;
|
var log, setVal;
|
||||||
setVal = function(k, v) {
|
setVal = function(k, v) {
|
||||||
|
|
@ -54,4 +55,4 @@ habitrpg.controller("TaskDetailsCtrl", function($scope, $rootScope, $location, U
|
||||||
$scope.editedTask = null;
|
$scope.editedTask = null;
|
||||||
$scope.editing = false;
|
$scope.editing = false;
|
||||||
};
|
};
|
||||||
});
|
}]);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"use strict";
|
"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
|
/*FIXME
|
||||||
*/
|
*/
|
||||||
$scope.taskLists = [
|
$scope.taskLists = [
|
||||||
|
|
@ -152,4 +153,4 @@ habitrpg.controller("TasksCtrl", function($scope, $rootScope, $location, User, A
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
}]);
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,16 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
habitrpg.controller("UserAvatarCtrl", function($scope, $location, filterFilter, User) {
|
habitrpg.controller("UserAvatarCtrl", ['$scope', '$location', 'User',
|
||||||
debugger
|
function($scope, $location, User) {
|
||||||
$scope.profile = User.user;
|
$scope.profile = User.user;
|
||||||
$scope.hideUserAvatar = function() {
|
$scope.hideUserAvatar = function() {
|
||||||
$(".userAvatar").hide();
|
$(".userAvatar").hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.clickAvatar = function(profile) {
|
$scope.clickAvatar = function(profile) {
|
||||||
debugger
|
|
||||||
if (User.user.id == profile.id) {
|
if (User.user.id == profile.id) {
|
||||||
if ($location.path() == '/tasks') {
|
if ($location.path() == '/tasks') {
|
||||||
$location.path('/options')
|
$location.path('/options');
|
||||||
} else {
|
} else {
|
||||||
$location.path('/tasks');
|
$location.path('/tasks');
|
||||||
}
|
}
|
||||||
|
|
@ -20,4 +19,4 @@ habitrpg.controller("UserAvatarCtrl", function($scope, $location, filterFilter,
|
||||||
//$("#avatar-modal-#{uid}").modal('show')
|
//$("#avatar-modal-#{uid}").modal('show')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}]);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue