Skip to content

Commit

Permalink
Fine grained logging for #619
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Jul 7, 2017
1 parent 4cabf76 commit 8e676b9
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 0 deletions.
110 changes: 110 additions & 0 deletions js/input/BrowserEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onpointerdown: function onpointerdown( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'pointerdown' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.POINTER_TYPE, 'pointerDown', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -298,8 +303,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onpointerup: function onpointerup( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'pointerup' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.POINTER_TYPE, 'pointerUp', true );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -309,8 +319,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onpointermove: function onpointermove( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'pointermove' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.POINTER_TYPE, 'pointerMove', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -320,8 +335,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onpointerover: function onpointerover( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'pointerover' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.POINTER_TYPE, 'pointerOver', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -331,8 +351,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onpointerout: function onpointerout( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'pointerout' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.POINTER_TYPE, 'pointerOut', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -342,8 +367,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onpointercancel: function onpointercancel( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'pointercancel' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.POINTER_TYPE, 'pointerCancel', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -353,8 +383,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onMSPointerDown: function onMSPointerDown( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'MSPointerDown' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.MS_POINTER_TYPE, 'pointerDown', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -364,8 +399,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onMSPointerUp: function onMSPointerUp( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'MSPointerUp' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.MS_POINTER_TYPE, 'pointerUp', true );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -375,8 +415,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onMSPointerMove: function onMSPointerMove( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'MSPointerMove' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.MS_POINTER_TYPE, 'pointerMove', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -386,8 +431,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onMSPointerOver: function onMSPointerOver( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'MSPointerOver' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.MS_POINTER_TYPE, 'pointerOver', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -397,8 +447,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onMSPointerOut: function onMSPointerOut( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'MSPointerOut' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.MS_POINTER_TYPE, 'pointerOut', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -408,8 +463,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onMSPointerCancel: function onMSPointerCancel( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'MSPointerCancel' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.MS_POINTER_TYPE, 'pointerCancel', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -419,8 +479,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
ontouchstart: function ontouchstart( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'touchstart' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.TOUCH_TYPE, 'touchStart', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -430,8 +495,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
ontouchend: function ontouchend( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'touchend' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.TOUCH_TYPE, 'touchEnd', true );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -441,8 +511,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
ontouchmove: function ontouchmove( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'touchmove' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.TOUCH_TYPE, 'touchMove', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -452,8 +527,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
ontouchcancel: function ontouchcancel( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'touchcancel' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.TOUCH_TYPE, 'touchCancel', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -463,8 +543,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onmousedown: function onmousedown( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'mousedown' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.MOUSE_TYPE, 'mouseDown', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -474,8 +559,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onmouseup: function onmouseup( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'mouseup' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.MOUSE_TYPE, 'mouseUp', true );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -485,8 +575,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onmousemove: function onmousemove( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'mousemove' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.MOUSE_TYPE, 'mouseMove', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -496,8 +591,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onmouseover: function onmouseover( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'mouseover' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.MOUSE_TYPE, 'mouseOver', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -507,8 +607,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onmouseout: function onmouseout( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'mouseout' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.MOUSE_TYPE, 'mouseOut', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
},

/**
Expand All @@ -518,8 +623,13 @@ define( function( require ) {
* @param {Event} domEvent
*/
onwheel: function onwheel( domEvent ) {
sceneryLog && sceneryLog.OnInput && sceneryLog.OnInput( 'wheel' );
sceneryLog && sceneryLog.OnInput && sceneryLog.push();

// NOTE: Will be called without a proper 'this' reference. Do NOT rely on it here.
BrowserEvents.batchWindowEvent( domEvent, BatchedDOMEvent.WHEEL_TYPE, 'wheel', false );

sceneryLog && sceneryLog.OnInput && sceneryLog.pop();
}
};

Expand Down
1 change: 1 addition & 0 deletions js/scenery.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ define( function( require ) {
FittedBlock: { name: 'FittedBlock', style: 'color: #000;' },
Input: { name: 'Input', style: 'color: #000;' },
InputEvent: { name: 'InputEvent', style: 'color: #000;' },
OnInput: { name: 'OnInput', style: 'color: #000;' },
InputListener: { name: 'InputListener', style: 'color: #000;' },
Instance: { name: 'Instance', style: 'color: #000;' },
InstanceTree: { name: 'InstanceTree', style: 'color: #000;' },
Expand Down

0 comments on commit 8e676b9

Please sign in to comment.