diff --git a/js/l3d/apps/prototype/replay/main.js b/js/l3d/apps/prototype/replay/main.js index d28c4e3..648dae7 100644 --- a/js/l3d/apps/prototype/replay/main.js +++ b/js/l3d/apps/prototype/replay/main.js @@ -50,6 +50,7 @@ function init() { // Initialize replay camera camera1 = new L3D.ReplayCamera(50, container_size.width() / container_size.height(), 0.01, 100000, coins); recommendations = initMainScene(camera1, scene, coins); + camera1.cameras = recommendations; // Add listeners initListeners(); diff --git a/js/l3d/src/cameras/ReplayCamera.js b/js/l3d/src/cameras/ReplayCamera.js index 6d98675..26c3839 100644 --- a/js/l3d/src/cameras/ReplayCamera.js +++ b/js/l3d/src/cameras/ReplayCamera.js @@ -103,8 +103,6 @@ L3D.ReplayCamera.prototype.nextEvent = function() { this.event = this.path[this.counter]; - console.log(this.event.type); - if (this.event.type == 'camera') { this.move(this.event); } else if (this.event.type == 'coin') { @@ -126,7 +124,8 @@ L3D.ReplayCamera.prototype.nextEvent = function() { })(this); } else if (this.event.type == 'previousnext') { this.move(this.event); - } else if (this.event.type == 'hovered') { + } else { + // Ignore other events this.nextEvent(); } }; diff --git a/js/l3d/src/utils/Logger.js b/js/l3d/src/utils/Logger.js index 41cdcf3..3b6ed52 100644 --- a/js/l3d/src/utils/Logger.js +++ b/js/l3d/src/utils/Logger.js @@ -50,21 +50,21 @@ L3D.BD.Event = {}; L3D.BD.Event.ArrowClicked = function() {}; L3D.BD.Event.ArrowClicked.prototype.send = function() { - var url = "/arrow-clicked"; + var url = "/posts/arrow-clicked"; var data = {arrow_id: this.arrow_id}; L3D.BD.Private.sendData(url, data); }; L3D.BD.Event.CoinClicked = function() {}; L3D.BD.Event.CoinClicked.prototype.send = function() { - var url = "/coin-clicked"; + var url = "/posts/coin-clicked"; var data = {coin_id: this.coin_id}; L3D.BD.Private.sendData(url, data); }; L3D.BD.Event.KeyboardEvent = function() {}; L3D.BD.Event.KeyboardEvent.prototype.send = function() { - var url = "/keyboard-event"; + var url = "/posts/keyboard-event"; var data = { camera: L3D.BD.Private.compactCamera(this.camera) @@ -75,14 +75,14 @@ L3D.BD.Event.KeyboardEvent.prototype.send = function() { L3D.BD.Event.ResetClicked = function() {}; L3D.BD.Event.ResetClicked.prototype.send = function() { - var url = "/reset-clicked"; + var url = "/posts/reset-clicked"; var data = {}; L3D.BD.Private.sendData(url, data); }; L3D.BD.Event.PreviousNextClicked = function() {}; L3D.BD.Event.PreviousNextClicked.prototype.send = function() { - var url = "/previous-next-clicked"; + var url = "/posts/previous-next-clicked"; var data = { // casts previous to boolean previous: this.previous, @@ -94,7 +94,7 @@ L3D.BD.Event.PreviousNextClicked.prototype.send = function() { L3D.BD.Event.Hovered = function() {}; L3D.BD.Event.Hovered.prototype.send = function() { - var url = "/hovered"; + var url = "/posts/hovered"; var data = { start: this.start, arrow_id: this.arrow_id @@ -106,7 +106,7 @@ L3D.BD.Event.Hovered.prototype.send = function() { L3D.BD.Event.Fps = function() {}; L3D.BD.Event.Fps.prototype.send = function() { - var url = "/fps"; + var url = "/posts/fps"; var data = { fps: this.fps }; @@ -117,7 +117,7 @@ L3D.BD.Event.Fps.prototype.send = function() { L3D.BD.Event.PointerLocked = function() {}; L3D.BD.Event.PointerLocked.prototype.send = function() { - var url = "/pointer-locked"; + var url = "/posts/pointer-locked"; var data = { locked: this.locked }; @@ -127,7 +127,7 @@ L3D.BD.Event.PointerLocked.prototype.send = function() { L3D.BD.Event.SwitchedLockOption = function() {}; L3D.BD.Event.SwitchedLockOption.prototype.send = function() { - var url = "/switched-lock-option"; + var url = "/posts/switched-lock-option"; var data = { locked: this.locked diff --git a/lib/posts.js b/lib/posts.js index 3e58109..7382117 100644 --- a/lib/posts.js +++ b/lib/posts.js @@ -30,9 +30,9 @@ module.exports = function(parent){ Log.debug(' ' + name + ':'); for (var key in urls) { - app.post(key, obj[urls[key]]); + app.post('/posts' + key, obj[urls[key]]); - Log.debug(' ' + key + ' -> ' + name + '.' + urls[key]); + Log.debug(' /posts' + key + ' -> posts.' + name + '.' + urls[key]); } Log.debug();