kopia lustrzana https://gitlab.com/gridtracker.org/gridtracker
140 wiersze
3.5 KiB
HTML
140 wiersze
3.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en" xml:lang="en">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>GridTracker Callsign Lookup</title>
|
|
<link rel="stylesheet" href="./lib/style.css"/>
|
|
<script src="./lib/protos.js" type="text/javascript" ></script>
|
|
<script src="./lib/screens.js"></script>
|
|
<script>
|
|
var g_isShowing = true;
|
|
|
|
document.oncontextmenu = function() {
|
|
return false;
|
|
}
|
|
|
|
document.addEventListener("dragover", function (event) {
|
|
event.preventDefault();
|
|
});
|
|
|
|
document.addEventListener("drop", function (event) {
|
|
event.preventDefault();
|
|
});
|
|
|
|
function lookupCallsign( callsign )
|
|
{
|
|
window.opener.lookupCallsign(callsign);
|
|
}
|
|
|
|
function statsFocus( selection )
|
|
{
|
|
var which = document.getElementById(selection);
|
|
if ( which != null )
|
|
{
|
|
which.focus();
|
|
which.selectionStart = which.selectionEnd = which.value.length;
|
|
}
|
|
}
|
|
|
|
function ValidateCallsign(inputText, validDiv) {
|
|
if ((inputText.value.length > 0)) {
|
|
var passed = false;
|
|
inputText.value = inputText.value.toUpperCase();
|
|
if (/\d/.test(inputText.value) || /[A-Z]/.test(inputText.value)) {
|
|
passed = true;
|
|
}
|
|
if (passed) {
|
|
inputText.style.color = "#FF0";
|
|
inputText.style.backgroundColor = "green";
|
|
if (validDiv)
|
|
validDiv.innerHTML = "Valid!";
|
|
return true;
|
|
} else {
|
|
inputText.style.color = "#000";
|
|
inputText.style.backgroundColor = "yellow";
|
|
if (validDiv)
|
|
validDiv.innerHTML = "Invalid!";
|
|
return false;
|
|
}
|
|
} else {
|
|
inputText.style.color = "#000";
|
|
inputText.style.backgroundColor = "yellow";
|
|
if (validDiv)
|
|
validDiv.innerHTML = "Invalid!";
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function validateCallByElement( elementString )
|
|
{
|
|
ValidateCallsign( window[elementString] , null);
|
|
}
|
|
|
|
function init()
|
|
{
|
|
ValidateCallsign(lookupCallsignInput, null);
|
|
document.addEventListener('keydown', onMyKeyDown, false);
|
|
}
|
|
|
|
function addTextToClipboard(data)
|
|
{
|
|
navigator.clipboard.writeText(data);
|
|
}
|
|
|
|
function setClipboardFromLookup()
|
|
{
|
|
if ( window.opener.g_lastLookupAddress )
|
|
{
|
|
addTextToClipboard(window.opener.g_lastLookupAddress);
|
|
}
|
|
}
|
|
|
|
function Resize()
|
|
{
|
|
lookupBoxDiv.style.height = (window.innerHeight) + "px" ;
|
|
}
|
|
|
|
|
|
var g_hotKeys = { "NumpadSubtract":reduceFont , "Minus":reduceFont , "NumpadAdd":increaseFont, "Equal":increaseFont, "Numpad0":resetFont , "Digit0":resetFont };
|
|
|
|
function onMyKeyDown(event)
|
|
{
|
|
if ( event.ctrlKey )
|
|
{
|
|
if ( event.code in g_hotKeys )
|
|
{
|
|
g_hotKeys[event.code]();
|
|
}
|
|
}
|
|
}
|
|
|
|
function reduceFont()
|
|
{
|
|
nw.Window.get().zoomLevel-=0.1;
|
|
}
|
|
|
|
function increaseFont()
|
|
{
|
|
nw.Window.get().zoomLevel+=0.1;
|
|
}
|
|
|
|
function resetFont()
|
|
{
|
|
nw.Window.get().zoomLevel = 0;
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
|
|
<body id='mainBody' onresize="Resize();" onload="init();" >
|
|
<div id="rootInfoDiv"style="margin:0px;right:0px;left:0px;bottom:0px;top:3px;display:block;background-color:black;padding:0px;text-align:center;vertical-align:middle;position:absolute;z-index:600;" class="roundBorder" >
|
|
<div id="lookupBoxDiv" class="lookupContent" style="display:block;overflow:auto;overflow-x:hidden">
|
|
<div >Callsign<input id="lookupCallsignInput" type="text" class="inputTextValue" size="12" onkeyup="if (event.keyCode === 13) lookupButtonID.click();" oninput="ValidateCallsign(this,null);" />
|
|
<div id="lookupButtonID" title="Lookup Callsign" class="button" onclick="if ( ValidateCallsign(lookupCallsignInput,null) ) { lookupCallsign(lookupCallsignInput.value);}">Lookup</div>
|
|
</div>
|
|
<div id="lookupLocalDiv"></div>
|
|
<div id="lookupInfoDiv">No Callsign information to display<br/>try a lookup!</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |