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-25 06:05:39 +03:00
|
|
|
$.MouseTracker.haveMouseOver = true;
|
|
|
|
} else {
|
|
|
|
$.MouseTracker.haveMouseOver = 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";
|
|
|
|
$.MouseTracker.maxTouchPoints = 10;
|
|
|
|
|
2015-01-13 03:08:26 +03:00
|
|
|
|
2014-03-31 23:54:37 +04:00
|
|
|
}(OpenSeadragon));
|