Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/main/javascript/base/Facet.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

/**
/**
* @ngdoc function
* @name cat.FacetTerm
* @module cat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,4 @@ function CatBaseDetailController($scope, $state, $stateParams, $location, $windo
}

angular.module('cat.controller.base.detail', ['cat.service.breadcrumbs', 'cat.controller.base.tabs'])
.controller('CatBaseDetailController', CatBaseDetailController);
.controller('CatBaseDetailController', CatBaseDetailController);
8 changes: 3 additions & 5 deletions src/main/javascript/controller/cat-base-list-controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

angular.module('cat.controller.base.list', ['cat.service.breadcrumbs'])

/**
* @ngdoc controller
Expand All @@ -26,6 +27,8 @@
* @param {object} catListDataLoadingService catListDataLoadingService
* @param {object} config holds data like the listData object, the template url, base url, the model constructor, etc.
*/
.controller('CatBaseListController', ['$scope', '$state', '$controller', '$log', 'catBreadcrumbsService', 'catListDataLoadingService', 'config', CatBaseListController]);

function CatBaseListController($scope, $state, $controller, $log, catBreadcrumbsService, catListDataLoadingService, config) {
if (!_.isUndefined(config.listData)) {
this.titleKey = 'cc.catalysts.cat-breadcrumbs.entry.' + config.listData.endpoint.getEndpointName();
Expand Down Expand Up @@ -73,8 +76,3 @@ function CatBaseListController($scope, $state, $controller, $log, catBreadcrumbs
$log.info('Couldn\'t instantiate controller with name ' + config.controller);
}
}


angular.module('cat.controller.base.list', ['cat.service.breadcrumbs'])
.controller('CatBaseListController',
['$scope', '$state', '$controller', '$log', 'catBreadcrumbsService', 'catListDataLoadingService', 'config', CatBaseListController]);
13 changes: 7 additions & 6 deletions src/main/javascript/controller/cat-base-tabs-controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
'use strict';

angular.module('cat.controller.base.tabs', [
'cat.service.elementVisibility',
'cat.url.resolver.service'
])

/**
* @ngdoc controller
* @name cat.controller.base.tabs:CatBaseTabsController
Expand All @@ -16,6 +21,8 @@
* @param {Object} catElementVisibilityService The visibility service to check wheter or not a tab should be rendered
* @param {Object} config The config as handled by state resolve
*/
.controller('CatBaseTabsController', CatBaseTabsController);

function CatBaseTabsController($scope, $controller, $stateParams, $location, catElementVisibilityService, config, urlResolverService) {
var endpoint = config.endpoint;

Expand Down Expand Up @@ -144,9 +151,3 @@ function CatBaseTabsController($scope, $controller, $stateParams, $location, cat
}
}];
}

angular
.module('cat.controller.base.tabs', [
'cat.service.elementVisibility',
'cat.url.resolver.service'
]).controller('CatBaseTabsController', CatBaseTabsController);
31 changes: 15 additions & 16 deletions src/main/javascript/filters/cat-replacetext.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';


angular.module('cat.filters.replaceText', [])

/**
Expand All @@ -15,18 +14,18 @@ angular.module('cat.filters.replaceText', [])
* @param {object} options regular expression options
* @param {string} replacement replacement text
*/
.filter('replaceText', function CatReplaceTetFilter() {
return function (text, pattern, options, replacement) {
if (pattern === undefined)
pattern = '\n';
if (options === undefined)
options = 'g';
if (replacement === undefined)
replacement = ', ';
if (!text) {
return text;
} else {
return String(text).replace(new RegExp(pattern, options), replacement);
}
};
});
.filter('replaceText', function CatReplaceTetFilter() {
return function (text, pattern, options, replacement) {
if (pattern === undefined)
pattern = '\n';
if (options === undefined)
options = 'g';
if (replacement === undefined)
replacement = ', ';
if (!text) {
return text;
} else {
return String(text).replace(new RegExp(pattern, options), replacement);
}
};
});
6 changes: 5 additions & 1 deletion src/main/javascript/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ angular.module('cat.directives', [
'cat.directives.facets',
'cat.directives.sortable',
'cat.directives.form',
'cat.directives.numbersOnly'
'cat.directives.numbersOnly',
'cat.directives.icon',
'cat.directives.messages',
'cat.directives.validation',
'cat.directives.breadcrumbs'
]);

angular.module('cat', [
Expand Down
18 changes: 9 additions & 9 deletions src/main/javascript/service/cat-breadcrumbs-service.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
'use strict';

angular.module('cat.service.breadcrumbs', [])

/**
* @ngdoc overview
* @name cat.service.breadcrumbs:catBreadcrumbs
*/
.value('catBreadcrumbs', [])

/**
* @ngdoc service
Expand All @@ -13,6 +20,8 @@
*
* @constructor
*/
.service('catBreadcrumbsService', CatBreadcrumbsService);

function CatBreadcrumbsService(catBreadcrumbs, $state) {
var that = this;

Expand Down Expand Up @@ -110,12 +119,3 @@ function CatBreadcrumbsService(catBreadcrumbs, $state) {
return uiStack;
};
}

angular.module('cat.service.breadcrumbs', [])

/**
* @ngdoc overview
* @name cat.service.breadcrumbs:catBreadcrumbs
*/
.value('catBreadcrumbs', [])
.service('catBreadcrumbsService', CatBreadcrumbsService);
27 changes: 15 additions & 12 deletions src/main/javascript/service/cat-i18n-locale-service.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
'use strict';

angular.module('cat.service.i18n.locale', [])

/**
* @ngdoc overview
* @name cat.service.i18n:CAT_I18N_DEFAULT_LOCALE
* @constant
*
* @description
* The default locale used for message translation
*/
.constant('CAT_I18N_DEFAULT_LOCALE', 'de')

/**
* @ngdoc service
* @name cat.service.i18n:catI18nLocaleService
* @module cat.service.i18n
*/
.service('catI18nLocaleService', ['$q', '$locale', 'CAT_I18N_DEFAULT_LOCALE', CatI18nLocaleService]);


function CatI18nLocaleService($q, $locale, CAT_I18N_DEFAULT_LOCALE) {
this.getLanguageOfLocale = function (locale) {
if (_.isUndefined(locale)) {
Expand All @@ -26,15 +41,3 @@ function CatI18nLocaleService($q, $locale, CAT_I18N_DEFAULT_LOCALE) {
return CAT_I18N_DEFAULT_LOCALE;
};
}

angular.module('cat.service.i18n.locale', [])
/**
* @ngdoc overview
* @name cat.service.i18n:CAT_I18N_DEFAULT_LOCALE
* @constant
*
* @description
* The default locale used for message translation
*/
.constant('CAT_I18N_DEFAULT_LOCALE', 'de')
.service('catI18nLocaleService', ['$q', '$locale', 'CAT_I18N_DEFAULT_LOCALE', CatI18nLocaleService]);
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* @param {string} CAT_I18N_DEFAULT_LOCALE DOCTODO
* @constructor
*/
angular.module('cat.service.i18n.message', ['cat.service.i18n.locale'])
.service('catI18nMessageSourceService', ['$q', 'catI18nLocaleService', 'CAT_I18N_DEFAULT_LOCALE', CatI18nMessageSourceService]);

function CatI18nMessageSourceService($q, catI18nLocaleService, CAT_I18N_DEFAULT_LOCALE) {
function _getLocale(locale) {
return locale || catI18nLocaleService.getDefaultLocale();
Expand Down Expand Up @@ -89,6 +92,3 @@ function CatI18nMessageSourceService($q, catI18nLocaleService, CAT_I18N_DEFAULT_
return $q.when(!_.isUndefined(bundle) && !_.isUndefined(bundle[key]));
};
}

angular.module('cat.service.i18n.message', ['cat.service.i18n.locale'])
.service('catI18nMessageSourceService', ['$q', 'catI18nLocaleService', 'CAT_I18N_DEFAULT_LOCALE', CatI18nMessageSourceService]);
1 change: 0 additions & 1 deletion src/main/javascript/service/cat-select-config-service.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';


function assignDeep(target, source) {
return _.assign(target, source, function (targetProperty, sourceProperty) {
if (_.isObject(targetProperty) && _.isObject(sourceProperty)) {
Expand Down
17 changes: 9 additions & 8 deletions src/main/javascript/service/cat-view-service.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
'use strict';

angular.module('cat.service.view', [
'cat.service.api',
'cat.service.route',
'cat.service.view.config'
])

/**
* @ngdoc service
* @name cat.service.view:catViewService
Expand All @@ -13,6 +19,8 @@
* @param {CatApiServiceProvider} catApiServiceProvider DOCTODO
* @constructor
*/
.provider('catViewService', CatViewServiceProvider);

function CatViewServiceProvider(catRouteServiceProvider, catApiServiceProvider) {
var viewNames = [];
var endpointNames = [];
Expand Down Expand Up @@ -61,11 +69,4 @@ function CatViewServiceProvider(catRouteServiceProvider, catApiServiceProvider)
endpoints: endpointNames
};
};
}

angular.module('cat.service.view',
[
'cat.service.api',
'cat.service.route',
'cat.service.view.config'
]).provider('catViewService', CatViewServiceProvider);
}
1 change: 0 additions & 1 deletion src/main/javascript/service/http-interceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ angular.module('cat.service.httpIntercept', ['cat.service.message', 'cat.service
* @ngdoc service
* @name cat.service.httpIntercept:errorHttpInterceptor
*/

.factory('errorHttpInterceptor', function CatErrorHttpInterceptor($q, $globalMessages, loadingService, catValidationService) {
return {
'request': function (config) {
Expand Down
10 changes: 6 additions & 4 deletions src/main/javascript/service/loading-service.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
'use strict';

/**
* @ngdoc service
* @name cat.service.loading:loadingService
*/
angular.module('cat.service.loading', ['angularSpinner'])

.constant('CAT_LOADING_SERVICE_DEFAULTS', {
timeout: 50,
animationDuration: 200
})

/**
* @ngdoc service
* @name cat.service.loading:loadingService
*/
.service('loadingService', [
'$rootScope',
'$timeout',
Expand Down
4 changes: 3 additions & 1 deletion src/main/javascript/service/message-service.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
'use strict';

angular.module('cat.service.message', [])

/**
* @ngdoc service
* @name cat.service.message:$globalMessages
*/
angular.module('cat.service.message', []).service('$globalMessages', function CatGlobalMessages($rootScope) {
.service('$globalMessages', function CatGlobalMessages($rootScope) {
var messages = {};

var self = this;
Expand Down