mirror of
https://github.com/magicbug/Cloudlog
synced 2024-11-23 10:08:38 +00:00
[Contesting] Added saving and restoring of contestid, exchangetype and exchangesent.
This commit is contained in:
parent
3fe6a69807
commit
11736ea938
@ -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());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user