Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
atruskie committed Nov 5, 2013
1 parent f0c8ff7 commit 30c47bb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
build_configs: {
configFile: appConfigFile,
development: {
apiRoot: "http://131.181.33.143:3000", //"http://staging.ecosounds.org",
apiRoot: "http://staging.ecosounds.org",
siteRoot: "localhost:8080",
siteDir: "/"
},
Expand Down
14 changes: 9 additions & 5 deletions src/app/listen/listen.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ angular.module('bawApp.listen', [])
}
else {

// the core resource used in this controller
var recordingId = $scope.recordingId = baw.parseInt($routeParams.recordingId);

// parse the start and end offsets
$routeParams.start = parseFloat($routeParams.start) || 0.0;
$routeParams.end = parseFloat($routeParams.end) || CHUNK_DURATION_SECONDS;
Expand All @@ -58,8 +61,7 @@ angular.module('bawApp.listen', [])
console.warn("invalid end offsets specified, reverting to safe value: end=" + $routeParams.end);
}

// the core resource used in this controller
var recordingId = $scope.recordingId = $routeParams.recordingId;


// set up some dummy objects for use later
$scope.model = {
Expand Down Expand Up @@ -331,17 +333,19 @@ angular.module('bawApp.listen', [])

$scope.addAnnotation = function createAnnotation() {
// BUG: ONLY SAVES FIRST ONE
var a = $scope.model.selectedAudioEvents[0];
//var a = $scope.model.selectedAudioEvents[0];
//TODO: BROKEN!
var a = $scope.model;
var a = $scope.model.audioEvents.filter(function (value) {
return value._selected === true;
})[0];

// prep tags
// a.audio_event_tags_attributes = a.audioEventTags.map(function (v) {
// return {tag_id: v};
// });
// delete a.audioEventTags;

if (a.audioRecordingId != recordingId) {
if (a.audioRecordingId !== recordingId) {
throw "The audioRecordingId should have been set way earlier!";
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/directives/bawAnnotationViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ bawds.directive('bawAnnotationViewer', [ 'conf.paths', function (paths) {
scope.$canvas.drawabox({
"selectionCallbackTrigger": "mousedown",
"newBox": function (element, newBox) {
var newAudioEvent = create(newBox, "a dummy id!", scope);
var newAudioEvent = create(newBox, scope.model.audioRecording.id, scope);


scope.$apply(function () {
Expand Down

0 comments on commit 30c47bb

Please sign in to comment.