--- /dev/null
+(function() {
+
+ /*
+ Nero module creation
+ */
+ angular
+ .module("nero.app", ["ngAnimate", "ngSanitize", "ui.bootstrap", "pascalprecht.translate",
+ "angularMoment", "moment-picker", "toastr", "angular-promise-cache",
+ "angular-ui-confirm", "ngCkeditor", "ui.bootstrap.contextMenu",
+ "angularTreeview", "angularjs-dropdown-multiselect", "infinite-scroll",
+ "ngImgCrop", "cgBusy", "angular-carousel-3d"])
+
+
+ .config(neroConfiguration)
+ .constant("role_constants", {
+ "STUDENT": 1,
+ "PARENT": 2,
+ "TEACHER": 3,
+ "PERSONNAL": 4,
+ "DIRECTOR": 5
+ });
+
+ /*
+ Service injection
+ */
+ neroConfiguration.$inject = ["$translateProvider", "toastrConfig", "momentPickerProvider"];
+
+ /*
+ Modules configuration : set the locale variable for angular-moment and translate
+ */
+ function neroConfiguration($translateProvider, toastrConfig, momentPickerProvider) {
+ var language = Liferay.ThemeDisplay.getLanguageId();
+
+ //Translate module configuration
+ $translateProvider.useStaticFilesLoader({
+ files: [{
+ prefix: Global.Theme.getURLPortal() + Liferay.ThemeDisplay.getPathJavaScript() + "/angularjs/locale/app-lang-",
+ suffix: '.json'
+ }, {
+ prefix: contextPath + "/js/locale/app-lang-",
+ suffix: ".json"
+ }]
+ });
+ $translateProvider.registerAvailableLanguageKeys(['en', 'fr'], {
+ 'en': 'en',
+ 'en_GB': 'en',
+ 'en_US': 'en',
+ 'fr': 'fr',
+ 'fr_FR': 'fr',
+ 'fr_CA': 'fr',
+ 'fr_BE': 'fr',
+ 'fr_CH': 'fr',
+ 'fr_LU': 'fr'
+ })
+ $translateProvider.preferredLanguage(language);
+ $translateProvider.useSanitizeValueStrategy("escape");
+ //$translate.use(); to switch language at runtime
+
+ //Moment module configuration
+ moment.locale(language);
+
+ angular.extend(toastrConfig, {
+ autoDismiss: true,
+ containerId: 'toast-container',
+ maxOpened: 3,
+ newestOnTop: true,
+ positionClass: 'toast-top-right',
+ preventDuplicates: false,
+ preventOpenDuplicates: false,
+ target: 'body',
+ closeButton: true,
+ timeOut: 5000,
+ extendedTimeOut: 1000
+ });
+
+ // Date-picker configuration
+ momentPickerProvider.options({
+ /* Picker properties */
+ locale: 'fr',
+ format: 'L',
+ minView: 'decade',
+ maxView: 'hour',
+ startView: 'month'
+
+ /* Extra: Views properties */
+ /*
+ leftArrow: '←',
+ rightArrow: '→',
+ yearsFormat: 'YYYY',
+ monthsFormat: 'MMM',
+ daysFormat: 'D',
+ hoursFormat: 'HH:[00]',
+ minutesFormat: moment.localeData().longDateFormat('LT').replace(/[aA]/, ''),
+ secondsFormat: 'ss',
+ minutesStep: 5,
+ secondsStep: 1
+ */
+ });
+ }
+
+})();