@@ -27,8 +27,7 @@ function Node(paper, nodeName, startX) {
2727 }
2828
2929 this . highlightNode = function ( ) {
30- console . log ( 'in highlightNode for node ' + that ) ;
31- // that.circle.attr({fill: 'red'});
30+ that . circle . attr ( { fill : 'red' } ) ;
3231 this . paper . text ( that . startX + ARM_LEN + NODE_RADIUS , HORIZON , that . nodeName ) . attr ( { "font-size" : 12 } ) ;
3332 }
3433} ;
@@ -51,7 +50,6 @@ function MiddlewareStack() {
5150
5251function Animation ( paper , name ) {
5352 var that = this ; // Create a handle to the current animation
54- console . log ( 'created a new Animation object' ) ;
5553 this . paper = paper ;
5654 this . requestBall = this . paper . circle ( 0 , HORIZON , 5 ) . attr ( { fill : 'green' } ) ;
5755 this . name = name ;
@@ -63,15 +61,11 @@ function Animation(paper, name) {
6361 } ;
6462
6563 this . run = function ( step ) {
66- console . log ( this . steps , step )
6764 this . animateRequestBall ( this . steps [ step ] ) ;
6865 } ;
6966
7067 this . animateRequestBall = function ( destination ) {
71-
72- console . log ( 'in animate destination is ' + destination ) ;
7368 var centerOfNode = destination . startX + ARM_LEN + NODE_RADIUS ;
74- console . log ( centerOfNode ) ;
7569 var anim = Raphael . animation ( { cx : centerOfNode , cy : HORIZON } , SPEED , destination . highlightNode ) ;
7670 this . requestBall . animate ( anim ) ;
7771 destination = this . steps [ step ++ ] ;
@@ -95,7 +89,6 @@ function displayRailsMiddlewareStack() {
9589 // We will add nodes representing each of the middlewares in the stack we are displaying.
9690 // For now, just make 4 generic nodes to play with while I figure out my API.
9791 var configureMiddleware = function ( middlewares ) {
98- console . log ( "configureMiddleware" , middlewares )
9992 var middlewares = middlewares ;
10093 for ( var i = 0 ; i < 4 ; i += 1 ) {
10194 // Create new node with paper, nodeName, and startX parameters
@@ -107,7 +100,6 @@ function displayRailsMiddlewareStack() {
107100 // For each middleware stack, we will provide sets of animations
108101 animation1 = function ( ) {
109102 var anim = new Animation ( p , 'First Animation' ) ;
110- console . log ( "animation1" , middlewares . nodes )
111103 anim . addStep ( middlewares . nodes [ 0 ] ) ;
112104 anim . addStep ( middlewares . nodes [ 1 ] ) ;
113105 anim . addStep ( middlewares . nodes [ 2 ] ) ;
@@ -116,16 +108,14 @@ function displayRailsMiddlewareStack() {
116108 return anim ;
117109 } ;
118110
119- configureMiddleware ( middlewares ) ;
120- var ourAnimation = animation1 ( ) ;
121111 var runAnimation = function ( ) {
122112 ourAnimation . run ( step ) ;
123113 }
124114
125115 // OK now actually do stuff
126-
127- console . debug ( "middlewares before draw" , middlewares )
116+ configureMiddleware ( middlewares ) ;
128117 middlewares . draw ( ) ;
118+ var ourAnimation = animation1 ( ) ;
129119 $ ( '#canvas_container' ) . on ( "click" , runAnimation ) ;
130120} ;
131121
0 commit comments