diff --git a/src/app/annotationLibrary/annotationLibrary.js b/src/app/annotationLibrary/annotationLibrary.js index ba90da59..d6ff011e 100644 --- a/src/app/annotationLibrary/annotationLibrary.js +++ b/src/app/annotationLibrary/annotationLibrary.js @@ -1,5 +1,9 @@ var baw = window.baw = window.baw || {}; +function dontRenameKeys(key) { + return key; +} + baw.annotationLibrary = {}; baw.annotationLibrary.addCalculatedProperties = function addCalculatedProperties(audioEvent, $url, paths) { @@ -10,32 +14,32 @@ baw.annotationLibrary.addCalculatedProperties = function addCalculatedProperties audioEvent.calcOffsetEnd = (Math.floor(audioEvent.startTimeSeconds / 30) * 30) + 30; audioEvent.urls = { - site: $url.formatUri(paths.api.links.siteAbsolute, {projectId: audioEvent.projects[0].id, siteId: audioEvent.siteId}), - user: $url.formatUri(paths.api.links.userAccountsAbsolute, {userId: audioEvent.ownerId}), - tagSearch: $url.formatUri(paths.site.ngRoutes.library, {tagsPartial: audioEvent.priorityTag.text}), + site: $url.formatUri(paths.api.links.siteAbsolute, {projectId: audioEvent.projects[0].id, siteId: audioEvent.siteId}, dontRenameKeys), + user: $url.formatUri(paths.api.links.userAccountsAbsolute, {userId: audioEvent.ownerId}, dontRenameKeys), + tagSearch: $url.formatUri(paths.site.ngRoutes.library, {tagsPartial: audioEvent.priorityTag.text}, dontRenameKeys), similar: $url.formatUri(paths.site.ngRoutes.library, { annotationDuration: Math.round10(audioEvent.annotationDuration, -3), freqMin: Math.round(audioEvent.lowFrequencyHertz), freqMax: Math.round(audioEvent.highFrequencyHertz) - }), + }, dontRenameKeys), singleItem: $url.formatUri(paths.site.ngRoutes.libraryItem, { recordingId: audioEvent.audioRecordingId, audioEventId: audioEvent.audioEventId - }), + }, dontRenameKeys), listen: $url.formatUri(paths.site.ngRoutes.listen, { recordingId: audioEvent.audioRecordingId, start: audioEvent.calcOffsetStart, end: audioEvent.calcOffsetEnd - }), + }, dontRenameKeys), listenWithoutPadding: $url.formatUri(paths.site.ngRoutes.listen, { recordingId: audioEvent.audioRecordingId, start: audioEvent.startTimeSeconds, end: audioEvent.endTimeSeconds - }) + }, dontRenameKeys) }; return audioEvent; @@ -133,7 +137,7 @@ angular.module('bawApp.annotationLibrary', ['bawApp.configuration']) loadFilter(); $scope.setFilter = function setFilter() { - $location.path('/library').search($url.toKeyValue($scope.filterSettings, true)); + $location.path('/library').search($url.toKeyValue($scope.filterSettings, true, dontRenameKeys)); }; $scope.clearFilter = function clearFilter() { @@ -155,7 +159,7 @@ angular.module('bawApp.annotationLibrary', ['bawApp.configuration']) $scope.createFilterUrl = function createFilterUrl(paramObj) { - return $url.formatUri(paths.site.ngRoutes.libraryAbsolute,paramObj); + return $url.formatUri(paths.site.ngRoutes.libraryAbsolute,paramObj, dontRenameKeys); }; function getEmptyFilterSettings() { @@ -318,7 +322,8 @@ angular.module('bawApp.annotationLibrary', ['bawApp.configuration']) { recordingId: $scope.annotation.paging.nextEvent.audioRecordingId, audioEventId: $scope.annotation.paging.nextEvent.audioEventId - } + }, + dontRenameKeys ); } @@ -329,7 +334,8 @@ angular.module('bawApp.annotationLibrary', ['bawApp.configuration']) { recordingId: $scope.annotation.paging.prevEvent.audioRecordingId, audioEventId: $scope.annotation.paging.prevEvent.audioEventId - } + }, + dontRenameKeys ); } }, function annotationShowError(httpResponse) { @@ -337,11 +343,11 @@ angular.module('bawApp.annotationLibrary', ['bawApp.configuration']) }); $scope.createFilterUrl = function createFilterUrl(paramObj) { - return $url.formatUri(paths.site.ngRoutes.libraryAbsolute,paramObj); + return $url.formatUri(paths.site.ngRoutes.libraryAbsolute,paramObj, dontRenameKeys); }; $scope.createProjectUrl = function createProjectUrl(projectId){ - return $url.formatUri(paths.api.links.projectAbsolute, {projectId: projectId}); + return $url.formatUri(paths.api.links.projectAbsolute, {projectId: projectId}, dontRenameKeys); }; }]); \ No newline at end of file