gridtracker/package.nw/gt_lookup.html

149 wiersze
5.2 KiB
HTML

<!DOCTYPE html>
<!--
This file is part of GridTracker.
GridTracker is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
GridTracker is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GridTracker. If not, see <https://www.gnu.org/licenses/>.
-->
<html lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Callsign Lookup</title>
<link rel="stylesheet" href="./lib/style.css" />
<script src="./lib/protos.js" type="text/javascript"></script>
<script src="./lib/jquery-3.6.1.min.js"></script>
<script src="./lib/CLDRPluralRuleParser.js" type="text/javascript"></script>
<script src="./lib/jquery.i18n.js" type="text/javascript"></script>
<script src="./lib/jquery.i18n.messagestore.js" type="text/javascript"></script>
<script src="./lib/jquery.i18n.fallbacks.js" type="text/javascript"></script>
<script src="./lib/jquery.i18n.parser.js" type="text/javascript"></script>
<script src="./lib/jquery.i18n.emitter.js" type="text/javascript"></script>
<script src="./lib/jquery.i18n.language.js" type="text/javascript"></script>
<script src="./lib/i18n.js" type="text/javascript"></script>
<script src="./lib/screens.js"></script>
<script>
document.oncontextmenu = function () {
return false;
};
document.addEventListener("dragover", function (event) {
event.preventDefault();
});
document.addEventListener("drop", function (event) {
event.preventDefault();
});
function lookupCallsign(callsign, grid, cache) {
window.opener.lookupCallsign(callsign, grid, cache);
}
function statsFocus(selection) {
let 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) {
let 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);
window.opener.GT.lookupWindowInitialized = true;
loadChildWindowI18n();
}
function addTextToClipboard(data) {
navigator.clipboard.writeText(data);
}
function setClipboardFromLookup() {
if (window.opener.GT.lastLookupAddress) {
addTextToClipboard(window.opener.GT.lastLookupAddress);
}
}
function Resize() {
lookupBoxDiv.style.height = window.innerHeight + "px";
}
</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>
<label data-i18n="lookup.callsign.label" for="lookupCallsignInput">Callsign</label>
<input
id="lookupCallsignInput" type="text" class="inputTextValue" size="12" onkeyup="if (event.keyCode == 13) lookupButtonID.click();" oninput="ValidateCallsign(this,null);"/>
<div
data-i18n="lookup.callsign.button"
id="lookupButtonID"
title="Lookup Callsign"
class="button"
onclick="if ( ValidateCallsign(lookupCallsignInput,null) ) { lookupCallsign(lookupCallsignInput.value, null, false);}">
Lookup
</div>
</div>
<div id="lookupLocalDiv"></div>
<div data-i18n="lookup.noinfo" id="lookupInfoDiv">No Callsign information to display<br />try a lookup!</div>
</div>
</div>
</body>
</html>