[Contesting] PR #778 from AndreasK79 - Stores Contest Info into localStorage
Contestid, exchangetype etc are stored within the browsers localStorage.
这个提交包含在:
当前提交
bccfa6762b
共有 2 个文件被更改,包括 41 次插入 和 0 次删除
|
|
@ -2575,6 +2575,11 @@ function deleteQsl(id) {
|
||||||
$("#exch_sent").val(+$("#exch_sent").val() + 1);
|
$("#exch_sent").val(+$("#exch_sent").val() + 1);
|
||||||
}
|
}
|
||||||
$("#callsign").focus();
|
$("#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
|
// Init serial sent as 1 when loading page
|
||||||
$("#exch_sent").val(1);
|
$("#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
|
// realtime clock
|
||||||
$(function($) {
|
$(function($) {
|
||||||
var options = {
|
var options = {
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用