Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. angular.module('grimoldiApollo', ['ui.router', 'LocalStorageModule', 'ui.bootstrap', 'blockUI', 'ngFileUpload', 'ngSanitize', 'amChartsDirective', 'date-picker-simple', 'number-input', 'angularBootstrapNavTree', 'file-upload'])
  2. .run(['$rootScope', '$location', '$state', '$stateParams', '$timeout', 'authServiceFactory',
  3. function ($rootScope, $location, $state, $stateParams, $timeout, authServiceFactory) {
  4.  
  5.     authServiceFactory.fillAuthData();
  6.  
  7.     $rootScope.$on("$stateChangeStart",
  8.         function (event, toState, toParams, fromState, fromParams) {
  9.  
  10.             if (toState.name !== 'appan.login' &&
  11.                 toState.name !== 'appan.resetpassExitoso' &&
  12.                 toState.name !== 'appan.resetpassError' &&
  13.                 toState.name !== 'appan.cambiarPasswordAnonimo' &&
  14.                 !authServiceFactory.authentication.isAuth) {
  15.                 event.preventDefault();
  16.                 $state.go('appan.login');
  17.             }
  18.         });
  19. }])
  20. .config(['$httpProvider', function ($httpProvider) {
  21.  
  22.     $httpProvider.interceptors.push('authInterceptorFactory');
  23.     $httpProvider.interceptors.push('jsonInterceptorFactory');
  24. }])
  25. .config(['blockUIConfig', function (blockUIConfig) {
  26.     blockUIConfig.autoBlock = false;
  27.     blockUIConfig.message = 'Cargando...';
  28. }])
  29. .config(['uibDatepickerPopupConfig', function (uibDatepickerPopupConfig) {
  30.     uibDatepickerPopupConfig.datepickerPopup = 'dd/MM/yyyy';
  31.     uibDatepickerPopupConfig.clearText = "Borrar";
  32.     uibDatepickerPopupConfig.currentText = "Hoy";
  33.     uibDatepickerPopupConfig.closeText = "Cerrar";
  34. }])
  35. .config(['uibPaginationConfig', function (uibPaginationConfig) {
  36.     uibPaginationConfig.maxSize = 9;
  37.     uibPaginationConfig.firstText = 'Primera';
  38.     uibPaginationConfig.previousText = "Anterior";
  39.     uibPaginationConfig.nextText = 'Siguiente';
  40.     uibPaginationConfig.lastText = "Ultima";
  41.     uibPaginationConfig.rotate = false;
  42.     uibPaginationConfig.boundaryLinks = true;
  43. }])
  44. .constant('constants', {
  45.     apiServiceBaseUri: document.location.protocol + '//' + document.location.host + '/',
  46.     clientId: 'GrimoldiApollo',
  47.     applicationName: 'Grimoldi Apollo',
  48.     clientName: 'Grimoldi Apollo',
  49.     reportesTipo: { excel: 1, pdf: 2 },
  50.     apiMediaManagerWeb: 'http://md.grimem.com.ar/',
  51.     regexIso8601: /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/
  52. })
  53. .provider('version', function () {
  54.     this.versionGuid = '1111111';
  55.  
  56.     this.$get = function () {
  57.         var versionGuid = this.versionGuid;
  58.         return {
  59.             getVersionGuid: function () {
  60.                 return versionGuid
  61.             }
  62.         }
  63.     };
  64.  
  65.     this.setVersionGuid = function (versionGuid) {
  66.         this.versionGuid = versionGuid;
  67.     };
  68. })
  69. .config(function (versionProvider) {
  70.     versionProvider.setVersionGuid((new Date()).getTime().toString());
  71. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement