33 lines
1020 B
JavaScript
33 lines
1020 B
JavaScript
var global = {
|
|
dashModule: angular.module('dashApp', ['pascalprecht.translate', 'ui-notification', 'ngDragDrop', 'ngFileUpload', 'ui.sortable', 'ui.tinymce', 'ngclipboard']),
|
|
PATH_JS_COMPONENTS: 'client/js/components/',
|
|
getParameterByName: function (name) {
|
|
const url = window.location.href;
|
|
const parsedName = name.replace(/[\[\]]/g, '\\$&');
|
|
var regex = new RegExp('[?&]' + parsedName + '(=([^&#]*)|&|#|$)'),
|
|
results = regex.exec(url);
|
|
|
|
if (!results) {
|
|
return null;
|
|
}
|
|
|
|
if (!results[2]) {
|
|
return '';
|
|
}
|
|
|
|
return decodeURIComponent(results[2].replace(/\+/g, ' '));
|
|
}
|
|
};
|
|
|
|
global.dashModule.factory('$', [
|
|
'$window',
|
|
($window) => {
|
|
return $window.jQuery;
|
|
}
|
|
]);
|
|
|
|
global.dashModule.config(function ($httpProvider) {
|
|
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
$httpProvider.defaults.paramSerializer = '$httpParamSerializerJQLike';
|
|
});
|