From 76733c4ca2787157801234885baa2cb6e32938f1 Mon Sep 17 00:00:00 2001 From: Mark Salsbery Date: Thu, 3 Oct 2013 09:29:20 -0700 Subject: [PATCH 1/6] Button event signatures fixed for consistency Button event signatures now "handlerMethod(eventSource, eventData)" where eventData == { button } --- src/button.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/button.js b/src/button.js index 062abf8a..cc7febb7 100644 --- a/src/button.js +++ b/src/button.js @@ -178,7 +178,7 @@ $.Button = function( options ) { enterHandler: function( tracker, eventData ) { if ( eventData.insideElementPressed ) { inTo( _this, $.ButtonState.DOWN ); - _this.raiseEvent( "enter", _this ); + _this.raiseEvent( "enter", { button: _this } ); } else if ( !eventData.buttonDownAny ) { inTo( _this, $.ButtonState.HOVER ); } @@ -186,30 +186,30 @@ $.Button = function( options ) { focusHandler: function ( tracker, eventData ) { this.enterHandler( tracker, eventData ); - _this.raiseEvent( "focus", _this ); + _this.raiseEvent( "focus", { button: _this } ); }, exitHandler: function( tracker, eventData ) { outTo( _this, $.ButtonState.GROUP ); if ( eventData.insideElementPressed ) { - _this.raiseEvent( "exit", _this ); + _this.raiseEvent( "exit", { button: _this } ); } }, blurHandler: function ( tracker, eventData ) { this.exitHandler( tracker, eventData ); - _this.raiseEvent( "blur", _this ); + _this.raiseEvent( "blur", { button: _this } ); }, pressHandler: function ( tracker, eventData ) { inTo( _this, $.ButtonState.DOWN ); - _this.raiseEvent( "press", _this ); + _this.raiseEvent( "press", { button: _this } ); }, releaseHandler: function( tracker, eventData ) { if ( eventData.insideElementPressed && eventData.insideElementReleased ) { outTo( _this, $.ButtonState.HOVER ); - _this.raiseEvent( "release", _this ); + _this.raiseEvent( "release", { button: _this } ); } else if ( eventData.insideElementPressed ) { outTo( _this, $.ButtonState.GROUP ); } else { @@ -219,15 +219,15 @@ $.Button = function( options ) { clickHandler: function( tracker, eventData ) { if ( eventData.quick ) { - _this.raiseEvent("click", _this); + _this.raiseEvent("click", { button: _this }); } }, keyHandler: function( tracker, eventData ){ //console.log( "%s : handling key %s!", _this.tooltip, eventData.keyCode); if( 13 === eventData.keyCode ){ - _this.raiseEvent( "click", _this ); - _this.raiseEvent( "release", _this ); + _this.raiseEvent( "click", { button: _this } ); + _this.raiseEvent( "release", { button: _this } ); return false; } return true; From 2aca47d88f10d5555954c4b2d165347fef6ebb86 Mon Sep 17 00:00:00 2001 From: Mark Salsbery Date: Thu, 3 Oct 2013 09:31:45 -0700 Subject: [PATCH 2/6] changelog.txt update for button event signatures --- changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.txt b/changelog.txt index 1ea02eb6..b8d5cd96 100644 --- a/changelog.txt +++ b/changelog.txt @@ -15,6 +15,7 @@ OPENSEADRAGON CHANGELOG * Button "onExit" changed to "exit" * Button "onFocus" changed to "focus" * Button "onBlur" changed to "blur" +* BREAKING CHANGE: Button event handler method signatures changed to 'handlerMethod( eventSource, eventData)' (#224) * MouseTracker now passes the original event objects to its handler methods (#23) * MouseTracker now supports an optional 'moveHandler' method for tracking mousemove events (#215) * Fixed: Element-relative mouse coordinates now correct if the element and/or page is scrolled (using new OpenSeadragon.getElementOffset() method) (#131) From d65ed9ff5080a7a2ba8f6fe3019de9874cc6b6e2 Mon Sep 17 00:00:00 2001 From: Mark Salsbery Date: Thu, 3 Oct 2013 16:37:37 -0700 Subject: [PATCH 3/6] changelog.txt update for Button event signatures --- changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index b8d5cd96..116f7cb3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -15,7 +15,7 @@ OPENSEADRAGON CHANGELOG * Button "onExit" changed to "exit" * Button "onFocus" changed to "focus" * Button "onBlur" changed to "blur" -* BREAKING CHANGE: Button event handler method signatures changed to 'handlerMethod( eventSource, eventData)' (#224) +* BREAKING CHANGE: Button event handler method signatures changed to 'handlerMethod( eventSource, eventData)' where eventData == { button } (#224) * MouseTracker now passes the original event objects to its handler methods (#23) * MouseTracker now supports an optional 'moveHandler' method for tracking mousemove events (#215) * Fixed: Element-relative mouse coordinates now correct if the element and/or page is scrolled (using new OpenSeadragon.getElementOffset() method) (#131) From 2264306785d59b5f1c495c15d1403c4e77fbb213 Mon Sep 17 00:00:00 2001 From: Mark Salsbery Date: Thu, 3 Oct 2013 16:41:09 -0700 Subject: [PATCH 4/6] changelog.txt update for event signature change --- changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 45fe8038..ee099c7f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,7 +3,7 @@ OPENSEADRAGON CHANGELOG 1.0.0: (in progress) -* BREAKING CHANGE: TileSource 'ready' event handler signature changed for consistency to 'handlerMethod( eventSource, eventData)' (#239) +* BREAKING CHANGE: TileSource 'ready' event handler signature changed for consistency to 'handlerMethod( eventSource, eventData)' where eventData == { tileSource } (#239) * BREAKING CHANGE: Renamed EventHandler to EventSource (#225) * BREAKING CHANGE: MouseTracker event handler method signatures changed to 'handlerMethod( tracker, eventData)' (#23) * BREAKING CHANGE: Event names changed for consistency: changed to lower case, compound names hyphenated, and "on" prefixes removed (#226): From 9aae564f436fa1abc5e84d1d2758939e3efb982b Mon Sep 17 00:00:00 2001 From: Mark Salsbery Date: Thu, 3 Oct 2013 19:43:47 -0700 Subject: [PATCH 5/6] changelog.txt update for TileSource event sigs --- changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.txt b/changelog.txt index 116f7cb3..ba2298ac 100644 --- a/changelog.txt +++ b/changelog.txt @@ -16,6 +16,7 @@ OPENSEADRAGON CHANGELOG * Button "onFocus" changed to "focus" * Button "onBlur" changed to "blur" * BREAKING CHANGE: Button event handler method signatures changed to 'handlerMethod( eventSource, eventData)' where eventData == { button } (#224) +* BREAKING CHANGE: TileSource 'ready' event handler signature changed to 'handlerMethod( eventSource, eventData)' where eventData == { tileSource } (#239) * MouseTracker now passes the original event objects to its handler methods (#23) * MouseTracker now supports an optional 'moveHandler' method for tracking mousemove events (#215) * Fixed: Element-relative mouse coordinates now correct if the element and/or page is scrolled (using new OpenSeadragon.getElementOffset() method) (#131) From 634f60bd58dfade813d2dff71f732f995160ce97 Mon Sep 17 00:00:00 2001 From: Mark Salsbery Date: Thu, 3 Oct 2013 19:52:08 -0700 Subject: [PATCH 6/6] Post-merge quick fix --- changelog.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 6e81a18c..8a2eba66 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,7 +3,6 @@ OPENSEADRAGON CHANGELOG 1.0.0: (in progress) -* BREAKING CHANGE: TileSource 'ready' event handler signature changed for consistency to 'handlerMethod( eventSource, eventData)' where eventData == { tileSource } (#239) * BREAKING CHANGE: Renamed EventHandler to EventSource (#225) * BREAKING CHANGE: MouseTracker event handler method signatures changed to 'handlerMethod( tracker, eventData)' (#23) * BREAKING CHANGE: Event names changed for consistency: changed to lower case, compound names hyphenated, and "on" prefixes removed (#226):