2013-03-05 00:19:35 +04:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>OpenSeadragon Expose Origina Event Demo</title>
|
|
|
|
<script type="text/javascript" src='openseadragon/build/openseadragon/openseadragon.js'></script>
|
|
|
|
<style type="text/css">
|
|
|
|
.openseadragon
|
|
|
|
{
|
2013-03-07 02:34:12 +04:00
|
|
|
width: 800px;
|
|
|
|
height: 600px;
|
|
|
|
border: 1px solid black;
|
|
|
|
color: #333; /* text color for messages */
|
|
|
|
background-color: black;
|
2013-03-05 00:19:35 +04:00
|
|
|
}
|
|
|
|
.openseadragon-small
|
|
|
|
{
|
2013-03-07 02:34:12 +04:00
|
|
|
width: 40px;
|
|
|
|
height: 30px;
|
|
|
|
border: 1px solid black;
|
|
|
|
color: #333; /* text color for messages */
|
|
|
|
background-color: black;
|
2013-03-05 00:19:35 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="demoarea">
|
2013-03-07 02:34:12 +04:00
|
|
|
<div>
|
|
|
|
Simple demo page to verify that event handlers pass along the original source event
|
|
|
|
</div>
|
|
|
|
<div id="contentDiv" class="openseadragon"></div>
|
|
|
|
<div>
|
|
|
|
<span id='consolelog'></span>
|
|
|
|
</div>
|
2013-03-05 00:19:35 +04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
var viewer = OpenSeadragon({
|
2013-03-07 02:34:12 +04:00
|
|
|
id:"contentDiv",
|
|
|
|
prefixUrl:"openseadragon/build/openseadragon/images/",
|
2013-03-05 00:19:35 +04:00
|
|
|
tileSources:{
|
|
|
|
Image:{
|
2013-03-07 02:34:12 +04:00
|
|
|
xmlns:"http://schemas.microsoft.com/deepzoom/2008",
|
|
|
|
Url:"example-images/highsmith/highsmith_files/",
|
|
|
|
Format:"jpg",
|
|
|
|
Overlap:"2",
|
|
|
|
TileSize:"256",
|
|
|
|
Size:{
|
|
|
|
Height:"9221",
|
|
|
|
Width:"7026"
|
|
|
|
}
|
2013-03-05 00:19:35 +04:00
|
|
|
}
|
2013-03-07 02:34:12 +04:00
|
|
|
}
|
2013-03-05 00:19:35 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
var demoMessageLog = "";
|
|
|
|
var screenConsole = document.getElementById('consolelog');
|
|
|
|
|
2013-03-07 02:34:12 +04:00
|
|
|
function checkIfEventWasPassed(event){
|
|
|
|
if(typeof event === 'undefined'){
|
|
|
|
demoMessageLog += "PROBLEM EVENT WAS UNDEFINED:" + event + "\n\n";
|
2013-03-05 00:19:35 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-07 02:34:12 +04:00
|
|
|
function logMessage(){
|
2013-03-05 00:19:35 +04:00
|
|
|
screenConsole.innerHTML = demoMessageLog.replace(/\n/g, '<br />');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-03-07 02:34:12 +04:00
|
|
|
viewer.addHandler("click", function( event ){
|
|
|
|
demoMessageLog += "Additional clickHandler\n" +
|
|
|
|
" tracker:" + event.tracker + "\n" +
|
|
|
|
" position:" + event.position + "\n" +
|
|
|
|
" delta:" + event.delta + "\n" +
|
|
|
|
" shift:" + event.shift + "\n" +
|
|
|
|
" originalEvent:" + event.originalEvent + "\n\n";
|
|
|
|
checkIfEventWasPassed( event.originalEvent );
|
|
|
|
logMessage();
|
|
|
|
});
|
2013-03-05 00:19:35 +04:00
|
|
|
|
2013-03-07 02:34:12 +04:00
|
|
|
viewer.addHandler("press", function( event ){
|
|
|
|
demoMessageLog += "Additional pressHandler\n" +
|
|
|
|
" tracker:" + event.tracker + "\n" +
|
|
|
|
" position:" + event.position + "\n" +
|
|
|
|
" originalEvent:" + event.originalEvent + "\n\n";
|
|
|
|
checkIfEventWasPassed( event.originalEvent );
|
|
|
|
logMessage();
|
2013-03-05 00:19:35 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2013-03-07 02:34:12 +04:00
|
|
|
viewer.addHandler("release", function( event ){
|
|
|
|
demoMessageLog += "Additional releaseHandler\n" +
|
|
|
|
" tracker:" + event.tracker + "\n" +
|
|
|
|
" position:" + event.position + "\n" +
|
|
|
|
" buttonDown:" + event.buttonDown + "\n" +
|
|
|
|
" insideElementRelease:" + event.insideElementRelease + "\n" +
|
|
|
|
" originalEvent:" + event.originalEvent + "\n\n";
|
|
|
|
checkIfEventWasPassed( event.originalEvent );
|
|
|
|
logMessage();
|
2013-03-05 00:19:35 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2013-03-07 02:34:12 +04:00
|
|
|
viewer.addHandler("keypress", function( event ){
|
|
|
|
demoMessageLog += "Additional keyHandler\n" +
|
|
|
|
" tracker:" + event.tracker + "\n" +
|
|
|
|
" keycode:" + event.keycode + "\n" +
|
|
|
|
" shift:" + event.shift + "\n" +
|
|
|
|
" originalEvent:" + event.originalEvent + "\n\n";
|
|
|
|
checkIfEventWasPassed( event.originalEvent );
|
|
|
|
logMessage();
|
2013-03-05 00:19:35 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2013-03-07 02:34:12 +04:00
|
|
|
viewer.addHandler("drag", function( event ){
|
|
|
|
demoMessageLog += "Additional dragHandler\n" +
|
|
|
|
" tracker:" + event.tracker + "\n" +
|
|
|
|
" position:" + event.position + "\n" +
|
|
|
|
" delta:" + event.delta + "\n" +
|
|
|
|
" shift:" + event.shift + "\n" +
|
|
|
|
" originalEvent:" + event.originalEvent + "\n\n";
|
|
|
|
checkIfEventWasPassed( event.originalEvent );
|
|
|
|
logMessage();
|
2013-03-05 00:19:35 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2013-03-07 02:34:12 +04:00
|
|
|
viewer.addHandler("scroll", function( event ){
|
|
|
|
demoMessageLog += "Additional scrollHandler\n" +
|
|
|
|
" tracker:" + event.tracker + "\n" +
|
|
|
|
" position:" + event.position + "\n" +
|
|
|
|
" scroll:" + event.scroll + "\n" +
|
|
|
|
" shift:" + event.shift + "\n" +
|
|
|
|
" originalEvent:" + event.originalEvent + "\n\n";
|
|
|
|
checkIfEventWasPassed( event.originalEvent );
|
|
|
|
logMessage();
|
2013-03-05 00:19:35 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2013-03-07 02:34:12 +04:00
|
|
|
viewer.addHandler("enter", function( event ){
|
|
|
|
demoMessageLog += "Additional enterHandler\n" +
|
|
|
|
" tracker:" + event.tracker + "\n" +
|
|
|
|
" position:" + event.position + "\n" +
|
|
|
|
" buttonDown:" + event.buttonDown + "\n" +
|
|
|
|
" buttonDownAny:" + event..buttonDownAny + "\n" +
|
|
|
|
" originalEvent:" + event.originalEvent + "\n\n";
|
|
|
|
checkIfEventWasPassed( event.originalEvent );
|
|
|
|
logMessage();
|
2013-03-05 00:19:35 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2013-03-07 02:34:12 +04:00
|
|
|
viewer.addHandler("exit", function( event ){
|
|
|
|
demoMessageLog += "Additional exitHandler\n" +
|
|
|
|
" tracker:" + event.tracker + "\n" +
|
|
|
|
" position:" + event.position + "\n" +
|
|
|
|
" buttonDown:" + event.buttonDown + "\n" +
|
|
|
|
" buttonDownAny:" + event.buttonDownAny + "\n" +
|
|
|
|
" originalEvent:" + event.originalEvent + "\n\n";
|
|
|
|
checkIfEventWasPassed( event.originalEvent );
|
|
|
|
logMessage();
|
2013-03-05 00:19:35 +04:00
|
|
|
});
|
|
|
|
|
2013-03-07 02:34:12 +04:00
|
|
|
|
|
|
|
viewer.addHandler("focus", function( event ){
|
|
|
|
demoMessageLog += "Additional focusHandler\n" +
|
|
|
|
" tracker:" + event.tracker + "\n" +
|
|
|
|
" originalEvent:" + event.originalEvent + "\n\n";
|
|
|
|
checkIfEventWasPassed( event.originalEvent );
|
|
|
|
logMessage();
|
|
|
|
});
|
2013-03-05 00:19:35 +04:00
|
|
|
|
|
|
|
|
2013-03-07 02:34:12 +04:00
|
|
|
viewer.addHandler("blur", function( event ){
|
|
|
|
demoMessageLog += "Additional blurHandler\n" +
|
|
|
|
" tracker:" + event.tracker + "\n" +
|
|
|
|
" originalEvent:" + event.originalEvent + "\n\n";
|
|
|
|
checkIfEventWasPassed( event.originalEvent );
|
|
|
|
logMessage();
|
2013-03-05 00:19:35 +04:00
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|