app.config.js
5.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
(function () {
'use strict';
angular.module('gestaoRiscosApp')
.config(function ($httpProvider, $locationProvider, httpRequestInterceptorCacheBusterProvider) {
$httpProvider.defaults.xsrfCookieName = 'CSRF-TOKEN';
$httpProvider.defaults.xsrfHeaderName = 'X-CSRF-TOKEN';
//Cache everything except rest api requests
httpRequestInterceptorCacheBusterProvider.setMatchlist([/.*api.*/, /.*protected.*/], true);
$httpProvider.interceptors.push('errorHandlerInterceptor');
$httpProvider.interceptors.push('successInterceptor');
$httpProvider.interceptors.push('authExpiredInterceptor');
$httpProvider.interceptors.push('alertInterceptor');
})
.config(['$urlMatcherFactoryProvider', function ($urlMatcherFactory) {
$urlMatcherFactory.type('boolean', {
name: 'boolean',
decode: function (val) {
return val == true ? true : val == "true" ? true : false
},
encode: function (val) {
return val ? 1 : 0;
},
equals: function (a, b) {
return this.is(a) && a === b;
},
is: function (val) {
return [true, false, 0, 1].indexOf(val) >= 0
},
pattern: /bool|true|0|1/
});
}])
.config(function ($mdThemingProvider) {
$mdThemingProvider.theme("success-toast");
$mdThemingProvider.theme('default').primaryPalette('green');
})
.config(function ($compileProvider) {
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|file|ftp|blob):|data:image\//);
})
.config(function ($mdDateLocaleProvider) {
var myShortMonths = ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'];
$mdDateLocaleProvider.shortMonths = myShortMonths;
$mdDateLocaleProvider.shortDays = ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'];
$mdDateLocaleProvider.firstDayOfWeek = 1;
$mdDateLocaleProvider.monthHeaderFormatter = function (date) {
return myShortMonths[date.getMonth()] + ' ' + date.getFullYear();
};
$mdDateLocaleProvider.weekNumberFormatter = function (weekNumber) {
return 'Semana ' + weekNumber;
};
$mdDateLocaleProvider.formatDate = function (date) {
return date ? moment(date).format('DD/MM/YYYY') : '';
};
$mdDateLocaleProvider.parseDate = function (dateString) {
if (dateString == null || dateString.length == 0) {
return null;
}
var m = moment(dateString, 'DD/MM/YYYY', true);
return m.isValid() ? m.toDate() : new Date(NaN);
}
})
.config(function ($mdIconProvider) {
$mdIconProvider
.defaultIconSet(URL_AVATAR_ICONS, 128)
.icon('menu', URL_ICON_MENU, 24)
.icon('share', URL_ICON_SHARE, 24)
.icon('person', URL_LOGOUT, 48)
.icon('person', URL_ICON_PERSON, 48);
})
.config(['$mdThemingProvider', function ($mdThemingProvider) {
$mdThemingProvider.definePalette('mpogPrimaryPalette', {
'50': '#3ba4e6',
'100': '#2499e4',
'200': '#1b8cd4',
'300': '#187dbd',
'400': '#156ea7',
'500': '#4CAF50',
'600': '#4CAF50',
'700': '#38813C',
'800': '#0a324c',
'900': '#072335',
'A100': '#52aee9',
'A200': '#68b9ec',
'A400': '#7fc3ef',
'A700': '#04141f',
'contrastDefaultColor': 'light',
'contrastDarkColors': ['50', '100', '200', '300', '400', 'A100'],
'contrastLightColors': 'dark'
});
$mdThemingProvider.definePalette('mpogAccentPalette', {
'50': '#666',
'100': '#666',
'200': '#666',
'300': '#666',
'400': '#666',
'500': '#666',
'600': '#666',
'700': '#666',
'800': '#666',
'900': '#666',
'A100': '#666',
'A200': '#666',
'A400': '#666',
'A700': '#666',
'contrastDefaultColor': 'light',
'contrastDarkColors': ['50', '100', '200', '300', '400', 'A100'],
'contrastLightColors': 'dark'
});
$mdThemingProvider.theme('default')
.primaryPalette('mpogPrimaryPalette', {
'hue-1': '100',
'hue-2': '700',
'hue-3': 'A100'
})
.accentPalette('mpogAccentPalette');
}])
.config(['$translateProvider', '$translatePartialLoaderProvider', function ($translateProvider, $translatePartialLoaderProvider) {
$translateProvider.useLoader('$translatePartialLoader', {
urlTemplate: '{part}/{lang}.json'
});
$translateProvider.preferredLanguage('pt-BR');
$translateProvider.useSanitizeValueStrategy('escapeParameters');
}])
.config(function ($urlRouterProvider) {
$urlRouterProvider.when('', '/');
})
.config(function ($breadcrumbProvider) {
$breadcrumbProvider.setOptions({
templateUrl: 'scripts/pages/geral/view/breadcrumb.html'
});
});
})();