2014-03-31 23:54:37 +04:00
|
|
|
(function($, undefined) {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Plugin to force OpenSeadragon to use the legacy mouse pointer event model
|
|
|
|
*/
|
|
|
|
|
2014-04-22 20:23:56 +04:00
|
|
|
$.MouseTracker.subscribeEvents = [ "click", "dblclick", "keypress", "focus", "blur", $.MouseTracker.wheelEventName ];
|
2014-03-31 23:54:37 +04:00
|
|
|
|
|
|
|
if( $.MouseTracker.wheelEventName == "DOMMouseScroll" ) {
|
|
|
|
// Older Firefox
|
|
|
|
$.MouseTracker.subscribeEvents.push( "MozMousePixelScroll" );
|
|
|
|
}
|
|
|
|
|
2015-01-13 03:08:26 +03:00
|
|
|
$.MouseTracker.havePointerEvents = false;
|
2020-07-25 06:05:39 +03:00
|
|
|
$.MouseTracker.subscribeEvents.push( "mouseenter", "mouseleave" );
|
|
|
|
if ( $.Browser.vendor !== $.BROWSERS.IE || $.Browser.version > 8 ) {
|
2015-01-13 03:08:26 +03:00
|
|
|
$.MouseTracker.subscribeEvents.push( "mouseover", "mouseout" );
|
2020-07-26 04:30:06 +03:00
|
|
|
$.MouseTracker.havePointerOverOut = true;
|
2020-07-25 06:05:39 +03:00
|
|
|
} else {
|
2020-07-26 04:30:06 +03:00
|
|
|
$.MouseTracker.havePointerOverOut = false;
|
2015-01-13 03:08:26 +03:00
|
|
|
}
|
|
|
|
$.MouseTracker.subscribeEvents.push( "mousedown", "mouseup", "mousemove" );
|
2014-03-31 23:54:37 +04:00
|
|
|
if ( 'ontouchstart' in window ) {
|
2015-01-15 23:15:22 +03:00
|
|
|
// iOS, Android, and other W3c Touch Event implementations
|
|
|
|
// (see http://www.w3.org/TR/touch-events/)
|
|
|
|
// (see https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html)
|
|
|
|
// (see https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html)
|
2014-03-31 23:54:37 +04:00
|
|
|
$.MouseTracker.subscribeEvents.push( "touchstart", "touchend", "touchmove", "touchcancel" );
|
|
|
|
}
|
|
|
|
if ( 'ongesturestart' in window ) {
|
2015-01-15 23:15:22 +03:00
|
|
|
// iOS (see https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html)
|
2014-03-31 23:54:37 +04:00
|
|
|
// Subscribe to these to prevent default gesture handling
|
|
|
|
$.MouseTracker.subscribeEvents.push( "gesturestart", "gesturechange" );
|
|
|
|
}
|
|
|
|
$.MouseTracker.mousePointerId = "legacy-mouse";
|
2015-01-13 03:08:26 +03:00
|
|
|
|
2014-03-31 23:54:37 +04:00
|
|
|
}(OpenSeadragon));
|