kopia lustrzana https://gitlab.com/gridtracker.org/gridtracker
Merge branch '173-high-number-of-grid-labels-on-screen-makes-gt-very-slow' into 'master'
Removed short-grids overlay. Reduces screen lag on B overlay Closes #173 See merge request gridtracker.org/gridtracker!241 If this is changing anything in the UI or operational behavior, please prepare to update the wiki!merge-requests/237/merge
commit
9970867963
|
@ -161,33 +161,45 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeCallsignRow(callObj, show) {
|
function makeCallsignRow(callObj, show) {
|
||||||
let oldRow = document.getElementById(callObj.cid);
|
|
||||||
|
if (callObj.row == null)
|
||||||
if (!oldRow) {
|
{
|
||||||
let newCall = callObj.call.formatCallsign();
|
var low = 0;
|
||||||
let x = 0;
|
var mid = 0;
|
||||||
for (x = 0; x < allCallTable.rows.length && newCall > allCallTable.rows[x].cells[0].innerHTML; x++)
|
var high = allCallTable.rows.length;
|
||||||
|
|
||||||
|
while (low < high)
|
||||||
{
|
{
|
||||||
// just count
|
mid = (low + high) >>> 1;
|
||||||
|
if (allCallTable.rows[mid].fCall < callObj.fCall)
|
||||||
|
{
|
||||||
|
low = mid + 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
high = mid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let row = allCallTable.insertRow(x);
|
var row = allCallTable.insertRow(low);
|
||||||
|
callObj.row = row;
|
||||||
row.id = callObj.cid;
|
row.id = callObj.cid;
|
||||||
|
row.fCall = callObj.fCall;
|
||||||
|
|
||||||
row.style.cursor = "pointer";
|
row.style.cursor = "pointer";
|
||||||
row.style.display = show ? "" : "none";
|
row.style.display = show ? "" : "none";
|
||||||
row.onclick = openIdCid;
|
row.onclick = openIdCid;
|
||||||
row.oncontextmenu = openLookupCid;
|
row.oncontextmenu = openLookupCid;
|
||||||
|
|
||||||
let td = row.insertCell();
|
var td = row.insertCell();
|
||||||
|
|
||||||
td.className = callObj.live == false ? "rosterOff" : "rosterOn";
|
td.className = callObj.live == false ? "rosterOff" : "rosterOn";
|
||||||
td.innerHTML = newCall;
|
td.innerHTML = callObj.fCall;
|
||||||
td.onmouseenter = onHoverCid;
|
td.onmouseenter = onHoverCid;
|
||||||
td.onmouseout = onNoHoverCid;
|
td.onmouseout = onNoHoverCid;
|
||||||
|
|
||||||
if (callObj.dxcc > 0 && callObj.dxcc in window.opener.g_dxccInfo) {
|
if (callObj.dxcc > 0 && callObj.dxcc in window.opener.g_dxccInfo) {
|
||||||
let imgClass = callObj.live == false ? "imgGray" : "imgNoFilter";
|
var imgClass = callObj.live == false ? "imgGray" : "imgNoFilter";
|
||||||
td = row.insertCell();
|
td = row.insertCell();
|
||||||
td.innerHTML =
|
td.innerHTML =
|
||||||
"<img class='" +
|
"<img class='" +
|
||||||
|
@ -197,16 +209,17 @@
|
||||||
"'>";
|
"'>";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
oldRow.style.display = show ? "" : "none";
|
callObj.row.style.display = show ? "" : "none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showAllCallsigns() {
|
function showAllCallsigns() {
|
||||||
let count = 0;
|
var count = 0;
|
||||||
for (let x in window.opener.g_gtFlagPins) {
|
for (const x in window.opener.g_gtFlagPins) {
|
||||||
let obj = window.opener.g_gtFlagPins[x];
|
var obj = window.opener.g_gtFlagPins[x];
|
||||||
if (obj.call != "" && obj.call != "NOCALL" && obj.canmsg == true) {
|
if (obj.canmsg == true && obj.call != "" && obj.call != "NOCALL")
|
||||||
let show = true;
|
{
|
||||||
|
var show = true;
|
||||||
try {
|
try {
|
||||||
if (searchBox.value.length > 0 && !obj.call.match(searchBox.value)) {
|
if (searchBox.value.length > 0 && !obj.call.match(searchBox.value)) {
|
||||||
show = false;
|
show = false;
|
||||||
|
@ -217,7 +230,10 @@
|
||||||
|
|
||||||
if (g_viewMode > 0 && window.opener.myMode != obj.mode) show = false;
|
if (g_viewMode > 0 && window.opener.myMode != obj.mode) show = false;
|
||||||
|
|
||||||
if (show) count++;
|
if (show)
|
||||||
|
{
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
makeCallsignRow(obj, show);
|
makeCallsignRow(obj, show);
|
||||||
|
|
||||||
|
@ -228,6 +244,11 @@
|
||||||
messageInput.disabled = false;
|
messageInput.disabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (obj.row)
|
||||||
|
{
|
||||||
|
obj.row.style.display = "none";
|
||||||
|
delete obj.row;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof allCallTable.childNodes != "undefined" && 0 in allCallTable.childNodes) {
|
if (typeof allCallTable.childNodes != "undefined" && 0 in allCallTable.childNodes) {
|
||||||
|
@ -262,7 +283,7 @@
|
||||||
function showAllMessages() {
|
function showAllMessages() {
|
||||||
if (Object.keys(window.opener.g_gtMessages).length > 0) {
|
if (Object.keys(window.opener.g_gtMessages).length > 0) {
|
||||||
var worker = "<table style='width:100%;'>";
|
var worker = "<table style='width:100%;'>";
|
||||||
for (var key in window.opener.g_gtMessages) {
|
for (const key in window.opener.g_gtMessages) {
|
||||||
worker +=
|
worker +=
|
||||||
"<tr style='cursor:pointer;vertical-align:bottom;'><td align=left onclick=\"openId('" + key + "');\">";
|
"<tr style='cursor:pointer;vertical-align:bottom;'><td align=left onclick=\"openId('" + key + "');\">";
|
||||||
if (key in window.opener.g_gtUnread) worker += "🔥";
|
if (key in window.opener.g_gtUnread) worker += "🔥";
|
||||||
|
|
|
@ -49,7 +49,7 @@ textarea {
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background-image: url(img/gridtracker10.png);
|
background-image: url(../img/gridtracker10.png);
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-attachment: fixed;
|
background-attachment: fixed;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
|
|
|
@ -796,6 +796,7 @@ function cycleGridView()
|
||||||
gridViewButton.innerHTML = g_gridViewArray[g_appSettings.gridViewMode];
|
gridViewButton.innerHTML = g_gridViewArray[g_appSettings.gridViewMode];
|
||||||
|
|
||||||
redrawGrids();
|
redrawGrids();
|
||||||
|
saveAppSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleEarth()
|
function toggleEarth()
|
||||||
|
@ -3243,7 +3244,6 @@ function setTrophyOverlay(which)
|
||||||
{
|
{
|
||||||
g_layerVectors["line-grids"].setVisible(false);
|
g_layerVectors["line-grids"].setVisible(false);
|
||||||
g_layerVectors["big-grids"].setVisible(false);
|
g_layerVectors["big-grids"].setVisible(false);
|
||||||
g_layerVectors["short-grids"].setVisible(false);
|
|
||||||
g_layerVectors["long-grids"].setVisible(false);
|
g_layerVectors["long-grids"].setVisible(false);
|
||||||
}
|
}
|
||||||
if (g_timezoneLayer)
|
if (g_timezoneLayer)
|
||||||
|
@ -3289,7 +3289,6 @@ function setTrophyOverlay(which)
|
||||||
{
|
{
|
||||||
g_layerVectors["line-grids"].setVisible(false);
|
g_layerVectors["line-grids"].setVisible(false);
|
||||||
g_layerVectors["big-grids"].setVisible(false);
|
g_layerVectors["big-grids"].setVisible(false);
|
||||||
g_layerVectors["short-grids"].setVisible(false);
|
|
||||||
g_layerVectors["long-grids"].setVisible(false);
|
g_layerVectors["long-grids"].setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4240,7 +4239,7 @@ function qthToQsoBox(
|
||||||
}
|
}
|
||||||
|
|
||||||
var zIndex = 2;
|
var zIndex = 2;
|
||||||
var entityVisibility = Number(g_appSettings.gridViewMode) > 1;
|
var entityVisibility = g_appSettings.gridViewMode > 1;
|
||||||
var returnRectangle = null;
|
var returnRectangle = null;
|
||||||
if (g_appSettings.sixWideMode == 0) iQTH = iQTH.substr(0, 4);
|
if (g_appSettings.sixWideMode == 0) iQTH = iQTH.substr(0, 4);
|
||||||
else iQTH = iQTH.substr(0, 6);
|
else iQTH = iQTH.substr(0, 6);
|
||||||
|
@ -4270,7 +4269,7 @@ function qthToQsoBox(
|
||||||
// Valid QTH
|
// Valid QTH
|
||||||
var triangleView = false;
|
var triangleView = false;
|
||||||
if (
|
if (
|
||||||
Number(g_appSettings.gridViewMode) == 3 &&
|
g_appSettings.gridViewMode == 3 &&
|
||||||
iQTH in g_liveGrids &&
|
iQTH in g_liveGrids &&
|
||||||
entityVisibility == true &&
|
entityVisibility == true &&
|
||||||
g_pushPinMode == false
|
g_pushPinMode == false
|
||||||
|
@ -4946,7 +4945,7 @@ function dimGridsquare()
|
||||||
{
|
{
|
||||||
g_layerSources.live.removeFeature(g_liveGrids[i].rectangle);
|
g_layerSources.live.removeFeature(g_liveGrids[i].rectangle);
|
||||||
|
|
||||||
if (Number(g_appSettings.gridViewMode) == 3 && i in g_qsoGrids)
|
if (g_appSettings.gridViewMode == 3 && i in g_qsoGrids)
|
||||||
{
|
{
|
||||||
if (g_qsoGrids[i].isTriangle)
|
if (g_qsoGrids[i].isTriangle)
|
||||||
{
|
{
|
||||||
|
@ -5607,9 +5606,8 @@ function initMap()
|
||||||
createGlobalMapLayer("live");
|
createGlobalMapLayer("live");
|
||||||
createGlobalMapLayer("live-pins");
|
createGlobalMapLayer("live-pins");
|
||||||
createGlobalMapLayer("line-grids");
|
createGlobalMapLayer("line-grids");
|
||||||
createGlobalMapLayer("long-grids", 3000);
|
createGlobalMapLayer("long-grids", 4500);
|
||||||
createGlobalMapLayer("short-grids", 8000, 3001);
|
createGlobalMapLayer("big-grids", 50000, 4501);
|
||||||
createGlobalMapLayer("big-grids", 50000, 3001);
|
|
||||||
createGlobalMapLayer("pota");
|
createGlobalMapLayer("pota");
|
||||||
createGlobalMapLayer("psk-flights");
|
createGlobalMapLayer("psk-flights");
|
||||||
createGlobalMapLayer("psk-spots");
|
createGlobalMapLayer("psk-spots");
|
||||||
|
@ -5642,7 +5640,6 @@ function initMap()
|
||||||
g_layerVectors["live-pins"],
|
g_layerVectors["live-pins"],
|
||||||
g_layerVectors["line-grids"],
|
g_layerVectors["line-grids"],
|
||||||
g_layerVectors["long-grids"],
|
g_layerVectors["long-grids"],
|
||||||
g_layerVectors["short-grids"],
|
|
||||||
g_layerVectors["big-grids"],
|
g_layerVectors["big-grids"],
|
||||||
g_layerVectors.pota,
|
g_layerVectors.pota,
|
||||||
g_layerVectors["psk-flights"],
|
g_layerVectors["psk-flights"],
|
||||||
|
@ -11576,41 +11573,26 @@ function ValidateGridsquareOnly4(inputText, validDiv)
|
||||||
|
|
||||||
function validateGridFromString(inputText)
|
function validateGridFromString(inputText)
|
||||||
{
|
{
|
||||||
|
var validGrid = false;
|
||||||
if (inputText.length == 4 || inputText.length == 6)
|
if (inputText.length == 4 || inputText.length == 6)
|
||||||
{
|
{
|
||||||
var gridSquare = "";
|
var LETTERS = inputText.substr(0, 2);
|
||||||
var LETTERS = inputText.substr(0, 2).toUpperCase();
|
var NUMBERS = inputText.substr(2, 2);
|
||||||
var NUMBERS = inputText.substr(2, 2).toUpperCase();
|
|
||||||
if (/^[A-R]+$/.test(LETTERS) && /^[0-9]+$/.test(NUMBERS))
|
if (/^[A-R]+$/.test(LETTERS) && /^[0-9]+$/.test(NUMBERS))
|
||||||
{
|
{
|
||||||
gridSquare = LETTERS + NUMBERS;
|
validGrid = true;
|
||||||
}
|
}
|
||||||
if (inputText.length > 4)
|
if (validGrid && inputText.length == 6)
|
||||||
{
|
{
|
||||||
var LETTERS_SUB = inputText.substr(4, 2).toUpperCase();
|
var LETTERS_SUB = inputText.substr(4, 2);
|
||||||
gridSquare = "";
|
if (!(/^[A-Xa-x]+$/.test(LETTERS_SUB)))
|
||||||
if (
|
|
||||||
/^[A-R]+$/.test(LETTERS) &&
|
|
||||||
/^[0-9]+$/.test(NUMBERS) &&
|
|
||||||
/^[A-Xa-x]+$/.test(LETTERS_SUB)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
gridSquare = LETTERS + NUMBERS + LETTERS_SUB;
|
validGrid = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (gridSquare != "")
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return validGrid;
|
||||||
}
|
}
|
||||||
|
|
||||||
function ValidateGridsquare(inputText, validDiv)
|
function ValidateGridsquare(inputText, validDiv)
|
||||||
|
@ -12372,26 +12354,6 @@ function drawAllGrids()
|
||||||
});
|
});
|
||||||
|
|
||||||
var featureStyle = new ol.style.Style({
|
var featureStyle = new ol.style.Style({
|
||||||
text: new ol.style.Text({
|
|
||||||
fill: new ol.style.Fill({ color: "#000" }),
|
|
||||||
font: "normal 16px sans-serif",
|
|
||||||
stroke: new ol.style.Stroke({
|
|
||||||
color: "#88888888",
|
|
||||||
width: 1
|
|
||||||
}),
|
|
||||||
text: String(a) + String(b),
|
|
||||||
offsetY: 1
|
|
||||||
})
|
|
||||||
});
|
|
||||||
feature.setStyle(featureStyle);
|
|
||||||
g_layerSources["short-grids"].addFeature(feature);
|
|
||||||
|
|
||||||
feature = new ol.Feature({
|
|
||||||
geometry: new ol.geom.Point(point),
|
|
||||||
name: String(a) + String(b)
|
|
||||||
});
|
|
||||||
|
|
||||||
featureStyle = new ol.style.Style({
|
|
||||||
text: new ol.style.Text({
|
text: new ol.style.Text({
|
||||||
fill: new ol.style.Fill({ color: "#000" }),
|
fill: new ol.style.Fill({ color: "#000" }),
|
||||||
font: "normal 16px sans-serif",
|
font: "normal 16px sans-serif",
|
||||||
|
@ -12426,7 +12388,7 @@ function drawAllGrids()
|
||||||
font: "normal 24px sans-serif",
|
font: "normal 24px sans-serif",
|
||||||
stroke: new ol.style.Stroke({
|
stroke: new ol.style.Stroke({
|
||||||
color: "#88888888",
|
color: "#88888888",
|
||||||
width: 1
|
width: 2
|
||||||
}),
|
}),
|
||||||
text: String.fromCharCode(x) + String.fromCharCode(y)
|
text: String.fromCharCode(x) + String.fromCharCode(y)
|
||||||
})
|
})
|
||||||
|
@ -13488,6 +13450,7 @@ function startupEventsAndTimers()
|
||||||
var g_finishedLoading = false;
|
var g_finishedLoading = false;
|
||||||
function postInit()
|
function postInit()
|
||||||
{
|
{
|
||||||
|
setGridViewMode(g_appSettings.gridViewMode);
|
||||||
redrawSpots();
|
redrawSpots();
|
||||||
checkForSettings();
|
checkForSettings();
|
||||||
updateForwardListener();
|
updateForwardListener();
|
||||||
|
|
|
@ -316,7 +316,7 @@ function gtChatUpdateCall(jsmesg)
|
||||||
{
|
{
|
||||||
g_gtFlagPins[cid] = Object();
|
g_gtFlagPins[cid] = Object();
|
||||||
g_gtFlagPins[cid].pin = null;
|
g_gtFlagPins[cid].pin = null;
|
||||||
|
g_gtFlagPins[cid].row = null;
|
||||||
g_gtFlagPins[cid].ids = Object();
|
g_gtFlagPins[cid].ids = Object();
|
||||||
g_gtFlagPins[cid].ids[id] = true;
|
g_gtFlagPins[cid].ids[id] = true;
|
||||||
}
|
}
|
||||||
|
@ -324,6 +324,7 @@ function gtChatUpdateCall(jsmesg)
|
||||||
|
|
||||||
g_gtFlagPins[cid].cid = jsmesg.cid;
|
g_gtFlagPins[cid].cid = jsmesg.cid;
|
||||||
g_gtFlagPins[cid].call = jsmesg.call;
|
g_gtFlagPins[cid].call = jsmesg.call;
|
||||||
|
g_gtFlagPins[cid].fCall = jsmesg.call.formatCallsign();
|
||||||
g_gtFlagPins[cid].grid = jsmesg.grid;
|
g_gtFlagPins[cid].grid = jsmesg.grid;
|
||||||
g_gtFlagPins[cid].freq = jsmesg.freq;
|
g_gtFlagPins[cid].freq = jsmesg.freq;
|
||||||
g_gtFlagPins[cid].band = jsmesg.band;
|
g_gtFlagPins[cid].band = jsmesg.band;
|
||||||
|
@ -392,7 +393,7 @@ function makeGtPin(obj)
|
||||||
|
|
||||||
if (obj.grid.length != 4 && obj.grid.length != 6) return;
|
if (obj.grid.length != 4 && obj.grid.length != 6) return;
|
||||||
|
|
||||||
if (validateGridFromString(obj.grid, null) == false) return;
|
if (validateGridFromString(obj.grid) == false) return;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
g_appSettings.gtFlagImgSrc == 2 &&
|
g_appSettings.gtFlagImgSrc == 2 &&
|
||||||
|
@ -443,10 +444,12 @@ function gtChatNewList(jsmesg)
|
||||||
g_gtFlagPins[cid].ids = Object();
|
g_gtFlagPins[cid].ids = Object();
|
||||||
g_gtFlagPins[cid].ids[id] = true;
|
g_gtFlagPins[cid].ids[id] = true;
|
||||||
g_gtFlagPins[cid].pin = null;
|
g_gtFlagPins[cid].pin = null;
|
||||||
|
g_gtFlagPins[cid].row = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_gtIdToCid[id] = cid;
|
g_gtIdToCid[id] = cid;
|
||||||
g_gtFlagPins[cid].call = jsmesg.data.calls[key];
|
g_gtFlagPins[cid].call = jsmesg.data.calls[key];
|
||||||
|
g_gtFlagPins[cid].fCall = g_gtFlagPins[cid].call.formatCallsign();
|
||||||
g_gtFlagPins[cid].grid = jsmesg.data.grid[key];
|
g_gtFlagPins[cid].grid = jsmesg.data.grid[key];
|
||||||
g_gtFlagPins[cid].freq = jsmesg.data.freq[key];
|
g_gtFlagPins[cid].freq = jsmesg.data.freq[key];
|
||||||
g_gtFlagPins[cid].band = jsmesg.data.band[key];
|
g_gtFlagPins[cid].band = jsmesg.data.band[key];
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
let languages = {
|
let languages = {
|
||||||
en: "i18n/en.json",
|
en: "i18n/en.json",
|
||||||
es: "i18n/es.json",
|
|
||||||
cn: "i18n/cn.json",
|
cn: "i18n/cn.json",
|
||||||
cnt: "i18n/cn-t.json",
|
cnt: "i18n/cn-t.json"
|
||||||
de: "i18n/de.json",
|
|
||||||
ja: "i18n/ja.json"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function loadi18n()
|
function loadi18n()
|
||||||
|
|
|
@ -427,19 +427,26 @@ function processPotaSpots(buffer)
|
||||||
newSpot.spotTime = Date.parse(newSpot.spotTime + "Z");
|
newSpot.spotTime = Date.parse(newSpot.spotTime + "Z");
|
||||||
newSpot.frequency = parseInt(newSpot.frequency) / 1000;
|
newSpot.frequency = parseInt(newSpot.frequency) / 1000;
|
||||||
newSpot.band = newSpot.frequency.formatBand();
|
newSpot.band = newSpot.frequency.formatBand();
|
||||||
(g_pota.callSpots[newSpot.activator] = g_pota.callSpots[newSpot.activator] || []).push(newSpot.reference);
|
if (newSpot.spotter == newSpot.activator && newSpot.comments.match(/qrt/gi))
|
||||||
|
|
||||||
if (!(newSpot.reference in g_pota.parkSpots))
|
|
||||||
{
|
{
|
||||||
g_pota.parkSpots[newSpot.reference] = {};
|
// don't add the spot, they have self-QRT'ed
|
||||||
}
|
|
||||||
if (newSpot.activator in g_pota.parkSpots[newSpot.reference])
|
|
||||||
{
|
|
||||||
g_pota.parkSpots[newSpot.reference][newSpot.activator] = fillObjectFromTemplate(g_pota.parkSpots[newSpot.reference][newSpot.activator], newSpot);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_pota.parkSpots[newSpot.reference][newSpot.activator] = newSpot;
|
(g_pota.callSpots[newSpot.activator] = g_pota.callSpots[newSpot.activator] || []).push(newSpot.reference);
|
||||||
|
|
||||||
|
if (!(newSpot.reference in g_pota.parkSpots))
|
||||||
|
{
|
||||||
|
g_pota.parkSpots[newSpot.reference] = {};
|
||||||
|
}
|
||||||
|
if (newSpot.activator in g_pota.parkSpots[newSpot.reference])
|
||||||
|
{
|
||||||
|
g_pota.parkSpots[newSpot.reference][newSpot.activator] = fillObjectFromTemplate(g_pota.parkSpots[newSpot.reference][newSpot.activator], newSpot);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_pota.parkSpots[newSpot.reference][newSpot.activator] = newSpot;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Ładowanie…
Reference in New Issue