mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-13 07:47:12 +00:00
(js) Move Settings to a value in Common ng module
Also removed explicit settings and defaults that were imported in various app modules. We now always use the Preferences ng service.
This commit is contained in:
1 parent
375eac2be0
commit
a330ff7320
21 files changed
+99
-87
No files matched your search
@@ -19,7 +19,7 @@
|
||||
angular.extend(Acl, {
|
||||
$q: $q,
|
||||
$timeout: $timeout,
|
||||
$$resource: new Resource(Settings.activeUser.folderURL, Settings.activeUser),
|
||||
$$resource: new Resource(Settings.activeUser('folderURL'), Settings.activeUser()),
|
||||
$User: User
|
||||
});
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
function AlarmService($timeout, Settings, Resource, $mdToast) {
|
||||
angular.extend(Alarm, {
|
||||
$timeout: $timeout,
|
||||
$$resource: new Resource(Settings.activeUser.folderURL + 'Calendar', Settings.activeUser),
|
||||
$$resource: new Resource(Settings.activeUser('folderURL') + 'Calendar', Settings.activeUser()),
|
||||
$toast: $mdToast
|
||||
});
|
||||
|
||||
|
||||
@@ -4,14 +4,22 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('SOGo.Common', ['ngMaterial'])
|
||||
.constant('sgSettings', {
|
||||
baseURL: ApplicationBaseURL,
|
||||
activeUser: {
|
||||
login: UserLogin,
|
||||
identification: UserIdentification,
|
||||
language: UserLanguage,
|
||||
folderURL: UserFolderURL,
|
||||
isSuperUser: IsSuperUser
|
||||
.value('sgSettings', {
|
||||
baseURL: function() {
|
||||
return ApplicationBaseURL || null;
|
||||
},
|
||||
activeUser: function(param) {
|
||||
var settings = {
|
||||
login: UserLogin || null,
|
||||
identification: UserIdentification || null,
|
||||
language: UserLanguage || null,
|
||||
folderURL: UserFolderURL || null,
|
||||
isSuperUser: IsSuperUser || null
|
||||
};
|
||||
if (param)
|
||||
return settings[param];
|
||||
else
|
||||
return settings;
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
angular.extend(User, {
|
||||
$q: $q,
|
||||
$log: $log,
|
||||
$$resource: new Resource(Settings.activeUser.folderURL, Settings.activeUser),
|
||||
$$resource: new Resource(Settings.activeUser('folderURL'), Settings.activeUser()),
|
||||
$gravatar: Gravatar
|
||||
});
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
navController.$inject = ['$scope', '$timeout', '$interval', '$http', '$mdSidenav', '$mdBottomSheet', '$mdMedia', '$log', 'sgConstant', 'sgSettings', 'Alarm'];
|
||||
function navController($scope, $timeout, $interval, $http, $mdSidenav, $mdBottomSheet, $mdMedia, $log, sgConstant, sgSettings, Alarm) {
|
||||
|
||||
$scope.activeUser = sgSettings.activeUser;
|
||||
$scope.activeUser = sgSettings.activeUser();
|
||||
|
||||
// Show current day in top bar
|
||||
$scope.currentDay = window.currentDay;
|
||||
@@ -23,7 +23,7 @@
|
||||
$scope.currentDay = data;
|
||||
});
|
||||
}, 24 * 3600 * 1000);
|
||||
}, window.secondsBeforeTomorrow * 1000);
|
||||
}, window.currentDay.secondsBeforeTomorrow * 1000);
|
||||
|
||||
$scope.toggleLeft = function () {
|
||||
$mdSidenav('left').toggle()
|
||||
|
||||
Reference in new issue
Block a user