Corrected bugs on replay and changed posts urls
This commit is contained in:
		
							parent
							
								
									e389d1fea8
								
							
						
					
					
						commit
						007da125ae
					
				
							
								
								
									
										1
									
								
								js/l3d/apps/prototype/replay/main.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								js/l3d/apps/prototype/replay/main.js
									
									
									
									
										vendored
									
									
								
							@ -50,6 +50,7 @@ function init() {
 | 
				
			|||||||
    // Initialize replay camera
 | 
					    // Initialize replay camera
 | 
				
			||||||
    camera1 = new L3D.ReplayCamera(50, container_size.width() / container_size.height(), 0.01, 100000, coins);
 | 
					    camera1 = new L3D.ReplayCamera(50, container_size.width() / container_size.height(), 0.01, 100000, coins);
 | 
				
			||||||
    recommendations = initMainScene(camera1, scene, coins);
 | 
					    recommendations = initMainScene(camera1, scene, coins);
 | 
				
			||||||
 | 
					    camera1.cameras = recommendations;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Add listeners
 | 
					    // Add listeners
 | 
				
			||||||
    initListeners();
 | 
					    initListeners();
 | 
				
			||||||
 | 
				
			|||||||
@ -103,8 +103,6 @@ L3D.ReplayCamera.prototype.nextEvent = function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    this.event = this.path[this.counter];
 | 
					    this.event = this.path[this.counter];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    console.log(this.event.type);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (this.event.type == 'camera') {
 | 
					    if (this.event.type == 'camera') {
 | 
				
			||||||
        this.move(this.event);
 | 
					        this.move(this.event);
 | 
				
			||||||
    } else if (this.event.type == 'coin') {
 | 
					    } else if (this.event.type == 'coin') {
 | 
				
			||||||
@ -126,7 +124,8 @@ L3D.ReplayCamera.prototype.nextEvent = function() {
 | 
				
			|||||||
        })(this);
 | 
					        })(this);
 | 
				
			||||||
    } else if (this.event.type == 'previousnext') {
 | 
					    } else if (this.event.type == 'previousnext') {
 | 
				
			||||||
        this.move(this.event);
 | 
					        this.move(this.event);
 | 
				
			||||||
    } else if (this.event.type == 'hovered') {
 | 
					    } else {
 | 
				
			||||||
 | 
					        // Ignore other events
 | 
				
			||||||
        this.nextEvent();
 | 
					        this.nextEvent();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
@ -50,21 +50,21 @@ L3D.BD.Event = {};
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
L3D.BD.Event.ArrowClicked = function() {};
 | 
					L3D.BD.Event.ArrowClicked = function() {};
 | 
				
			||||||
L3D.BD.Event.ArrowClicked.prototype.send = function() {
 | 
					L3D.BD.Event.ArrowClicked.prototype.send = function() {
 | 
				
			||||||
    var url = "/arrow-clicked";
 | 
					    var url = "/posts/arrow-clicked";
 | 
				
			||||||
    var data = {arrow_id: this.arrow_id};
 | 
					    var data = {arrow_id: this.arrow_id};
 | 
				
			||||||
    L3D.BD.Private.sendData(url, data);
 | 
					    L3D.BD.Private.sendData(url, data);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
L3D.BD.Event.CoinClicked = function() {};
 | 
					L3D.BD.Event.CoinClicked = function() {};
 | 
				
			||||||
L3D.BD.Event.CoinClicked.prototype.send = function() {
 | 
					L3D.BD.Event.CoinClicked.prototype.send = function() {
 | 
				
			||||||
    var url = "/coin-clicked";
 | 
					    var url = "/posts/coin-clicked";
 | 
				
			||||||
    var data = {coin_id: this.coin_id};
 | 
					    var data = {coin_id: this.coin_id};
 | 
				
			||||||
    L3D.BD.Private.sendData(url, data);
 | 
					    L3D.BD.Private.sendData(url, data);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
L3D.BD.Event.KeyboardEvent = function() {};
 | 
					L3D.BD.Event.KeyboardEvent = function() {};
 | 
				
			||||||
L3D.BD.Event.KeyboardEvent.prototype.send = function() {
 | 
					L3D.BD.Event.KeyboardEvent.prototype.send = function() {
 | 
				
			||||||
    var url = "/keyboard-event";
 | 
					    var url = "/posts/keyboard-event";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var data = {
 | 
					    var data = {
 | 
				
			||||||
        camera: L3D.BD.Private.compactCamera(this.camera)
 | 
					        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 = function() {};
 | 
				
			||||||
L3D.BD.Event.ResetClicked.prototype.send = function() {
 | 
					L3D.BD.Event.ResetClicked.prototype.send = function() {
 | 
				
			||||||
    var url = "/reset-clicked";
 | 
					    var url = "/posts/reset-clicked";
 | 
				
			||||||
    var data = {};
 | 
					    var data = {};
 | 
				
			||||||
    L3D.BD.Private.sendData(url, data);
 | 
					    L3D.BD.Private.sendData(url, data);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
L3D.BD.Event.PreviousNextClicked = function() {};
 | 
					L3D.BD.Event.PreviousNextClicked = function() {};
 | 
				
			||||||
L3D.BD.Event.PreviousNextClicked.prototype.send = function() {
 | 
					L3D.BD.Event.PreviousNextClicked.prototype.send = function() {
 | 
				
			||||||
    var url = "/previous-next-clicked";
 | 
					    var url = "/posts/previous-next-clicked";
 | 
				
			||||||
    var data = {
 | 
					    var data = {
 | 
				
			||||||
        // casts previous to boolean
 | 
					        // casts previous to boolean
 | 
				
			||||||
        previous: this.previous,
 | 
					        previous: this.previous,
 | 
				
			||||||
@ -94,7 +94,7 @@ L3D.BD.Event.PreviousNextClicked.prototype.send = function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
L3D.BD.Event.Hovered = function() {};
 | 
					L3D.BD.Event.Hovered = function() {};
 | 
				
			||||||
L3D.BD.Event.Hovered.prototype.send = function() {
 | 
					L3D.BD.Event.Hovered.prototype.send = function() {
 | 
				
			||||||
    var url = "/hovered";
 | 
					    var url = "/posts/hovered";
 | 
				
			||||||
    var data = {
 | 
					    var data = {
 | 
				
			||||||
        start: this.start,
 | 
					        start: this.start,
 | 
				
			||||||
        arrow_id: this.arrow_id
 | 
					        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 = function() {};
 | 
				
			||||||
L3D.BD.Event.Fps.prototype.send = function() {
 | 
					L3D.BD.Event.Fps.prototype.send = function() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var url = "/fps";
 | 
					    var url = "/posts/fps";
 | 
				
			||||||
    var data = {
 | 
					    var data = {
 | 
				
			||||||
        fps: this.fps
 | 
					        fps: this.fps
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
@ -117,7 +117,7 @@ L3D.BD.Event.Fps.prototype.send = function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
L3D.BD.Event.PointerLocked = function() {};
 | 
					L3D.BD.Event.PointerLocked = function() {};
 | 
				
			||||||
L3D.BD.Event.PointerLocked.prototype.send = function() {
 | 
					L3D.BD.Event.PointerLocked.prototype.send = function() {
 | 
				
			||||||
    var url = "/pointer-locked";
 | 
					    var url = "/posts/pointer-locked";
 | 
				
			||||||
    var data = {
 | 
					    var data = {
 | 
				
			||||||
        locked: this.locked
 | 
					        locked: this.locked
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
@ -127,7 +127,7 @@ L3D.BD.Event.PointerLocked.prototype.send = function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
L3D.BD.Event.SwitchedLockOption = function() {};
 | 
					L3D.BD.Event.SwitchedLockOption = function() {};
 | 
				
			||||||
L3D.BD.Event.SwitchedLockOption.prototype.send = function() {
 | 
					L3D.BD.Event.SwitchedLockOption.prototype.send = function() {
 | 
				
			||||||
    var url = "/switched-lock-option";
 | 
					    var url = "/posts/switched-lock-option";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var data = {
 | 
					    var data = {
 | 
				
			||||||
        locked: this.locked
 | 
					        locked: this.locked
 | 
				
			||||||
 | 
				
			|||||||
@ -30,9 +30,9 @@ module.exports = function(parent){
 | 
				
			|||||||
        Log.debug('   ' + name + ':');
 | 
					        Log.debug('   ' + name + ':');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (var key in urls) {
 | 
					        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();
 | 
					        Log.debug();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user