sogo/UI/WebServerResources/js/Preferences.app.js
Francis Lachapelle 1dc5f0d412 (js) New file structure for Angular modules
JavaScript files are now merged by the 'js' Grunt task.
2015-06-12 12:01:21 -04:00

89 lines
2.1 KiB
JavaScript

/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* JavaScript for SOGoPreferences */
(function() {
'use strict';
angular.module('SOGo.ContactsUI', []);
angular.module('SOGo.MailerUI', []);
angular.module('SOGo.PreferencesUI', ['ngSanitize', 'ui.router', 'SOGo.Common', 'SOGo.MailerUI', 'SOGo.ContactsUI', 'SOGo.Authentication'])
.constant('sgSettings', {
baseURL: ApplicationBaseURL,
activeUser: {
login: UserLogin,
identification: UserIdentification,
language: UserLanguage,
folderURL: UserFolderURL,
isSuperUser: IsSuperUser
}
})
.config(configure);
/**
* @ngInject
*/
configure.$inject = ['$stateProvider', '$urlRouterProvider'];
function configure($stateProvider, $urlRouterProvider) {
$stateProvider
.state('preferences', {
abstract: true,
views: {
preferences: {
templateUrl: 'preferences.html',
controller: 'PreferencesController',
controllerAs: 'app'
}
},
resolve: {
statePreferences: statePreferences
}
})
.state('preferences.general', {
url: '/general',
views: {
module: {
templateUrl: 'generalPreferences.html'
}
}
})
.state('preferences.calendars', {
url: '/calendars',
views: {
module: {
templateUrl: 'calendarsPreferences.html'
}
}
})
.state('preferences.addressbooks', {
url: '/addressbooks',
views: {
module: {
templateUrl: 'addressbooksPreferences.html'
}
}
})
.state('preferences.mailer', {
url: '/mailer',
views: {
module: {
templateUrl: 'mailerPreferences.html'
}
}
});
// if none of the above states are matched, use this as the fallback
$urlRouterProvider.otherwise('/general');
}
/**
* @ngInject
*/
statePreferences.$inject = ['Preferences'];
function statePreferences(Preferences) {
return new Preferences();
}
})();