Alien-GvaScript
view release on metacpan or search on metacpan
test/functional/keyMap/basic.html view on Meta::CPAN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link href="../../test.css" rel="stylesheet" type="text/css">
<link href="../../images/GvaScript.css" rel="stylesheet" type="text/css">
<script src="../../../lib/Alien/GvaScript/lib/prototype.js"></script>
<script src="../../../lib/Alien/GvaScript/lib/GvaScript.js"></script>
<style type="text/css">
#current_cell {background-color: blue; color: yellow;}
tt {font-size:1.2em;background-color:#eee;}
table {border-width: 2px;}
td {width: 20px; text-align: center;}
td.rborder {border-right: 2px solid black;}
tr.bborder td {border-bottom: 2px solid black;}
</style>
<script>
function Red(event) {
$('current_cell').style.backgroundColor="red";
Event.stop(event);
}
function Up() {
var cell = $('current_cell');
var colIndex = cell.cellIndex;
var row = cell.parentNode;
if (row.rowIndex > 0) {
cell.id = null;
row.parentNode.rows[row.rowIndex - 1].cells[colIndex].id = "current_cell";
}
}
function Down() {
var cell = $('current_cell');
var colIndex = cell.cellIndex;
var row = cell.parentNode;
if (row.rowIndex + 1 < row.parentNode.rows.length) {
cell.id = null;
row.parentNode.rows[row.rowIndex + 1].cells[colIndex].id = "current_cell";
}
}
function Left() {
var cell = $('current_cell');
if (cell.cellIndex > 0) {
cell.id = null;
cell.parentNode.cells[cell.cellIndex - 1].id = "current_cell";
}
}
function Right() {
var cell = $('current_cell');
if (cell.cellIndex + 1 < cell.parentNode.cells.length) {
cell.id = null;
cell.parentNode.cells[cell.cellIndex + 1].id = "current_cell";
}
}
function fill_cell_from_key(event) {
$('current_cell').innerHTML = event.keyName;
Event.stop(event);
}
function say(msg) {
return function() {alert(msg)};
}
( run in 0.582 second using v1.01-cache-2.11-cpan-5735350b133 )