diff --git a/app/js/app.js b/app/js/app.js index b233ca4..ce6fae3 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -15,101 +15,14 @@ angular.module('GSB', [ //Global functions -//Now you can check with str1.startWith(str2) whether a string str1 starts with another string str2 +//Define "str1".startsWith("str2") if undefined. if (typeof String.prototype.startsWith != 'function') { - // see below for better implementation! + /** + * Returns whether the String starts with the given str + * @param str + * @returns {boolean} + */ String.prototype.startsWith = function (str){ return this.indexOf(str) == 0; }; -} -// -//var AddSubjectDropDownCtrl = function($scope, $http) { -// // List of available subject classes that can be added to the workspace. -// $scope.availableSubjectClasses = []; -// -// // Subject selected to be added to the workspace. -// $scope.selectedSubjectClass = null; -// -// // Get Availabe Subject Classes from Server -// $http.get('/app/mockup/classes.json').success(function(data) { -// var availClasses = data.results.bindings; -// for (var key in availClasses) { -// if(availClasses.hasOwnProperty(key)){ -// $scope.availableSubjectClasses.push( -// { -// alias: availClasses[key].alias.value, -// uri: availClasses[key].class.value -// } -// ); -// } -// // console.log(availClasses[key].alias.value); -// } -// }); -// -// $scope.dropDownAddSubject = function() { -// // console.log($scope.selectedSubjectClass); -// if($scope.selectedSubjectClass) { // If the selected option is undefined no subject will be added. -// $scope.$emit('newSubjectEvent', $scope.selectedSubjectClass); -// } -// }; -//}; - -//var ModalCtrl = function($scope, $http, $modal, $log) { -// -// $scope.items = []; // Is this the right place? -// -// // Get Availabe Subject Classes from Server -// $http.get('/app/mockup/classes.json').success(function(data) { -// $scope.items = []; // This is a duplicate of the code 4 lines above. Any ideas which one is preferable? -// var availClasses = data.results.bindings; -// for (var key in availClasses) { -// $scope.items.push( -// { -// alias: availClasses[key].alias.value, -// uri: availClasses[key].class.value -// } -// ); -// } -// }); -// -// $scope.open = function() { -// -// // Create modalInstance -// var modalInstance = $modal.open({ -// templateUrl: 'template/modal.html', -// controller: ModalInstanceCtrl, -// resolve: { -// items: function() { -// return $scope.items; -// } -// } -// }); -// -// // User closed modal -// modalInstance.result.then(function(selectedItem) { -// $scope.selected = selectedItem; -// $scope.$emit('newSubjectEvent', selectedItem); -// }, function() { -// $log.info('Modal dismissed at: ' + new Date()); -// }); -// }; -//}; -// -//var ModalInstanceCtrl = function($scope, $modalInstance, items) { -// -// $scope.items = items; -// $scope.selected = { -// item: $scope.items[0] -// }; -// -// // User clicked okay -// $scope.ok = function() { -// $modalInstance.close($scope.selected.item); -// }; -// -// // USer clicked cancel -// $scope.cancel = function() { -// $modalInstance.dismiss('cancel'); -// }; -//}; -// +} \ No newline at end of file diff --git a/app/js/config.js b/app/js/config.js index 760b6f5..4a56db5 100644 --- a/app/js/config.js +++ b/app/js/config.js @@ -1,3 +1,5 @@ +'use strict'; + angular.module('GSB.config', []) .constant('globalConfig', { dataTypeURIs : [ diff --git a/app/js/filters.js b/app/js/filters.js index c2224fc..03a60ba 100644 --- a/app/js/filters.js +++ b/app/js/filters.js @@ -1,6 +1,12 @@ +'use strict'; angular.module('GSB.filters', []) - // custom filter which filters an array of objects based on a key and an array of allowed values for that key. .filter('filterArrayOfObjectsByKeyWithArray', function() { + /** + * Filters an array of Objects based on a given Key and allowed values for that key + * @param arrayOfObjects + * @param filterKey + * @param allowedKeyValues + */ return function(arrayOfObjects, filterKey, allowedKeyValues) { return arrayOfObjects.filter( function(currentObject){ diff --git a/app/translator/translatorXchangeURIs.js b/app/translator/translatorXchangeURIs.js index c5438c8..ea73d22 100644 --- a/app/translator/translatorXchangeURIs.js +++ b/app/translator/translatorXchangeURIs.js @@ -1,4 +1,9 @@ - +/** + * Translator + * TODO: Make nicer + * TODO: Move to own service! + * + */ /* * test function, to run a translation (together with testHTML.html)