[Contesting] Added saving and restoring of contestid, exchangetype and exchangesent.

This commit is contained in:
Andreas 2020-12-27 09:37:48 +01:00
parent 3fe6a69807
commit 11736ea938
2 changed files with 41 additions and 0 deletions

View File

@ -2575,6 +2575,11 @@ function deleteQsl(id) {
$("#exch_sent").val(+$("#exch_sent").val() + 1);
}
$("#callsign").focus();
// Store contest session
localStorage.setItem("contestid", $("#contestname").val());
localStorage.setItem("exchangetype", $('input[name=exchangeradio]:checked', '#qso_input').val());
localStorage.setItem("exchangesent", $("#exch_sent").val());
}
});
}

View File

@ -4,6 +4,42 @@ $("#callsign").focus();
// Init serial sent as 1 when loading page
$("#exch_sent").val(1);
$( document ).ready(function() {
restoreContestSession();
});
// We are restoring the settings in the contest logging form here
function restoreContestSession() {
var contestname = localStorage.getItem("contestid");
if (contestname != null) {
$("#contestname").val(contestname);
}
var exchangetype = localStorage.getItem("exchangetype");
if (exchangetype == "other") {
$("[name=exchangeradio]").val(["other"]);
}
var exchangesent = localStorage.getItem("exchangesent");
if (exchangesent != null) {
$("#exch_sent").val(exchangesent);
}
}
// Storing the contestid in contest session
$('#contestname').change(function() {
localStorage.setItem("contestid", $("#contestname").val());
});
// Storing the exchange type in contest session
$('input[type=radio][name=exchangeradio]').change(function() {
localStorage.setItem("exchangetype", $('input[name=exchangeradio]:checked', '#qso_input').val());
});
// realtime clock
$(function($) {
var options = {