-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[web] update html pages to make tests easier
- Loading branch information
1 parent
cec03e1
commit e695723
Showing
3 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<html> | ||
<head> | ||
<title>BasicMouseInterfaceTest</title> | ||
|
||
<style> | ||
div.solidborder { border-style:solid; border-width:1px;} | ||
#draggable { width: 60px; height: 60px; padding: 0.5em; margin: 10px; } | ||
#droppable { width: 75px; height: 75px; padding: 0.5em; margin: 10px; } | ||
</style> | ||
|
||
<link type="text/css" href="css/ui-lightness/jquery-ui-1.12.1.min.css" rel="stylesheet" /> | ||
<script type="text/javascript" src="js/jquery-3.5.1.min.js"></script> | ||
<script type="text/javascript" src="js/jquery-ui-1.12.1.min.js"></script> | ||
<script type="text/javascript"> | ||
jQuery(document).ready(function(){ | ||
$('#mousetracker').mousemove(function(e){ | ||
xPos = e.pageX - this.offsetLeft; | ||
yPos = e.pageY - this.offsetTop; | ||
$('#status').html(xPos + ', ' + yPos); | ||
}); | ||
}) | ||
|
||
</script> | ||
<script type="text/javascript"> | ||
function clickStatus(message) { | ||
document.getElementById('click-status').innerHTML = message; | ||
} | ||
function moveStatus(message) { | ||
document.getElementById('move-status').innerHTML = message; | ||
} | ||
function dropStatus(message) { | ||
document.getElementById('drop-status').innerHTML = message; | ||
} | ||
</script> | ||
<script type="text/javascript"> | ||
$(function () { | ||
$("#draggable").draggable(); | ||
$("#droppable").droppable({ | ||
drop: function (event, ui) { dropStatus("Dropped!") } | ||
}); | ||
}); | ||
</script> | ||
|
||
</head> | ||
<body> | ||
<h2>Mouse Clicks</h2> | ||
|
||
<p><a href="resultPage.html" id="click">Click for Results Page</a></p> | ||
|
||
<div> | ||
<input type="text" id="presses" | ||
onfocus="clickStatus('focus')" | ||
oncontextmenu="clickStatus('contextClick')" | ||
ondblclick="clickStatus('doubleClick')" | ||
placeholder="Click"/> | ||
|
||
<strong id="click-status"> </strong> | ||
</div> | ||
|
||
<h2>Drag & Drop</h2> | ||
|
||
<strong id="drop-status"> </strong> | ||
<div id="draggable" class="ui-widget-content">Drag this</div> | ||
|
||
<div id="droppable" class="ui-widget-header">Drop here</div> | ||
|
||
<h2>Mouse Position</h2> | ||
|
||
<div> | ||
<input type="button" id="hover" onmouseleave="moveStatus('')" onmouseover="moveStatus('hovered')" value="Hover"/> | ||
<strong id="move-status"> </strong> | ||
</div> | ||
|
||
<p><strong id="status">0, 0</strong></p> | ||
<div id="mousetracker" class="solidborder" style="position: absolute; height: 200px; width: 200px;"> | ||
Move mouse here. | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters