Format file

这个提交包含在:
Robert Sammelson 2023-11-11 01:31:07 -05:00
父节点 15f52f99ca
当前提交 7ebf909fd7
找不到此签名对应的密钥
GPG 密钥 ID: BEA2C00D29709D51

查看文件

@ -8,11 +8,11 @@ var callsign = "";
var errors = []; var errors = [];
var qsoList = []; var qsoList = [];
$('#simpleFleInfoButton').click(function (event) { $("#simpleFleInfoButton").click(function (event) {
var awardInfoLines = [ var awardInfoLines = [
lang_qso_simplefle_info_ln2, lang_qso_simplefle_info_ln2,
lang_qso_simplefle_info_ln3, lang_qso_simplefle_info_ln3,
lang_qso_simplefle_info_ln4 lang_qso_simplefle_info_ln4,
]; ];
var simpleFleInfo = ""; var simpleFleInfo = "";
awardInfoLines.forEach(function (line) { awardInfoLines.forEach(function (line) {
@ -24,8 +24,8 @@ $('#simpleFleInfoButton').click(function (event) {
}); });
}); });
$('#js-syntax').click(function (event) { $("#js-syntax").click(function (event) {
$('#js-syntax').prop("disabled", false); $("#js-syntax").prop("disabled", false);
$.ajax({ $.ajax({
url: base_url + "index.php/simplefle/displaySyntax", url: base_url + "index.php/simplefle/displaySyntax",
type: "post", type: "post",
@ -133,13 +133,15 @@ function handleInput() {
var originalDate = new Date(extraQsoDate); var originalDate = new Date(extraQsoDate);
originalDate.setDate(originalDate.getDate() + plusCount); originalDate.setDate(originalDate.getDate() + plusCount);
extraQsoDate = originalDate.toISOString().split("T")[0]; extraQsoDate = originalDate.toISOString().split("T")[0];
} else if (item.match(/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/)) {
extraQsoDate = item;
} else if ( } else if (
item.match(/^[0-2][0-9][0-5][0-9]$/) item.match(/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/)
) { ) {
extraQsoDate = item;
} else if (item.match(/^[0-2][0-9][0-5][0-9]$/)) {
qsotime = item; qsotime = item;
} else if (item.match(/^CW$|^SSB$|^LSB$|^USB$|^FM$|^AM$|^PSK$|^FT8$/i)) { } else if (
item.match(/^CW$|^SSB$|^LSB$|^USB$|^FM$|^AM$|^PSK$|^FT8$/i)
) {
mode = item.toUpperCase(); mode = item.toUpperCase();
} else if ( } else if (
item.match(/^[0-9]{1,4}(?:m|cm|mm)$/) || item.match(/^[0-9]{1,4}(?:m|cm|mm)$/) ||
@ -164,13 +166,13 @@ function handleInput() {
qsotime = qsotime.slice(0, -2) + item; qsotime = qsotime.slice(0, -2) + item;
} else if ( } else if (
item.match( item.match(
/^[A-Z0-9]{1,3}\/[A-Z]{2}-\d{3}|[AENOS]*[FNSUACA]-\d{3}|(?!.*FF)[A-Z0-9]{1,3}-\d{4,5}|[A-Z0-9]{1,3}[F]{2}-\d{4}$/i /^[A-Z0-9]{1,3}\/[A-Z]{2}-\d{3}|[AENOS]*[FNSUACA]-\d{3}|(?!.*FF)[A-Z0-9]{1,3}-\d{4,5}|[A-Z0-9]{1,3}[F]{2}-\d{4}$/i,
) )
) { ) {
sotaWwff = item.toUpperCase(); sotaWwff = item.toUpperCase();
} else if ( } else if (
item.match( item.match(
/([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|.*\/([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])\/.*/ /([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|.*\/([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])\/.*/,
) )
) { ) {
callsign = item.toUpperCase(); callsign = item.toUpperCase();
@ -206,7 +208,9 @@ function handleInput() {
} }
if (isValidDate(extraQsoDate) === false) { if (isValidDate(extraQsoDate) === false) {
addErrorMessage(lang_qso_simplefle_error_date + " " + extraQsoDate); addErrorMessage(
lang_qso_simplefle_error_date + " " + extraQsoDate,
);
extraQsoDate = qsodate; extraQsoDate = qsodate;
} }
@ -251,14 +255,38 @@ function handleInput() {
$("#qsoTable > tbody:last-child").append(tableRow); $("#qsoTable > tbody:last-child").append(tableRow);
localStorage.setItem(`user_${user_id}_tabledata`, $("#qsoTable").html()); localStorage.setItem(
localStorage.setItem(`user_${user_id}_my-call`, $("#station-call").val()); `user_${user_id}_tabledata`,
localStorage.setItem(`user_${user_id}_operator`, $("#operator").val()); $("#qsoTable").html(),
localStorage.setItem(`user_${user_id}_my-sota-wwff`, $("#my-sota-wwff").val()); );
localStorage.setItem(`user_${user_id}_qso-area`, $(".qso-area").val()); localStorage.setItem(
localStorage.setItem(`user_${user_id}_qsodate`, $("#qsodate").val()); `user_${user_id}_my-call`,
localStorage.setItem(`user_${user_id}_my-power`, $("#my-power").val()); $("#station-call").val(),
localStorage.setItem(`user_${user_id}_my-grid`, $("#my-grid").val()); );
localStorage.setItem(
`user_${user_id}_operator`,
$("#operator").val(),
);
localStorage.setItem(
`user_${user_id}_my-sota-wwff`,
$("#my-sota-wwff").val(),
);
localStorage.setItem(
`user_${user_id}_qso-area`,
$(".qso-area").val(),
);
localStorage.setItem(
`user_${user_id}_qsodate`,
$("#qsodate").val(),
);
localStorage.setItem(
`user_${user_id}_my-power`,
$("#my-power").val(),
);
localStorage.setItem(
`user_${user_id}_my-grid`,
$("#my-grid").val(),
);
callsign = ""; callsign = "";
sotaWwff = ""; sotaWwff = "";
@ -272,7 +300,14 @@ function handleInput() {
var qsoCount = qsoList.length; var qsoCount = qsoList.length;
if (qsoCount) { if (qsoCount) {
$(".js-qso-count").html("<strong>" + lang_qso_simplefle_qso_list_total + ":</strong> " + qsoCount + " " + lang_gen_hamradio_qso); $(".js-qso-count").html(
"<strong>" +
lang_qso_simplefle_qso_list_total +
":</strong> " +
qsoCount +
" " +
lang_gen_hamradio_qso,
);
} else { } else {
$(".js-qso-count").html(""); $(".js-qso-count").html("");
} }
@ -283,30 +318,30 @@ function handleInput() {
} }
function checkMainFieldsErrors() { function checkMainFieldsErrors() {
if ($("#station-call").val() === '-') { if ($("#station-call").val() === "-") {
$('#warningStationCall').show(); $("#warningStationCall").show();
$('#station-call').css('border', '2px solid rgb(217, 83, 79)'); $("#station-call").css("border", "2px solid rgb(217, 83, 79)");
$('#warningStationCall').text(lang_qso_simplefle_error_stationcall); $("#warningStationCall").text(lang_qso_simplefle_error_stationcall);
} else { } else {
$('#station-call').css('border', ''); $("#station-call").css("border", "");
$('#warningStationCall').hide(); $("#warningStationCall").hide();
} }
if ($("#operator").val() === "") { if ($("#operator").val() === "") {
$('#warningOperatorField').show(); $("#warningOperatorField").show();
$('#operator').css('border', '2px solid rgb(217, 83, 79)'); $("#operator").css("border", "2px solid rgb(217, 83, 79)");
$('#warningOperatorField').text(lang_qso_simplefle_error_operator); $("#warningOperatorField").text(lang_qso_simplefle_error_operator);
} else { } else {
$('#operator').css('border', ''); $("#operator").css("border", "");
$('#warningOperatorField').hide(); $("#warningOperatorField").hide();
} }
if ($("textarea").val() === "") { if ($("textarea").val() === "") {
$('#textarea').css('border', '2px solid rgb(217, 83, 79)'); $("#textarea").css("border", "2px solid rgb(217, 83, 79)");
setTimeout(function () { setTimeout(function () {
$('#textarea').css('border', ''); $("#textarea").css("border", "");
}, 2000); }, 2000);
} else { } else {
$('#textarea').css('border', ''); $("#textarea").css("border", "");
} }
} }
@ -382,7 +417,6 @@ $(".js-download-qso").click(function () {
handleInput(); handleInput();
}); });
function getBandFromFreq(freq) { function getBandFromFreq(freq) {
if (freq > 1.7 && freq < 2) { if (freq > 1.7 && freq < 2) {
return "160m"; return "160m";
@ -423,12 +457,16 @@ function getFreqFromBand(band, mode) {
if (bandData) { if (bandData) {
return bandData[settingsMode] / 1000000; return bandData[settingsMode] / 1000000;
} }
} }
function getSettingsMode(mode) { function getSettingsMode(mode) {
if (mode === "AM" || mode === "FM" || mode === "SSB" || mode === "LSB" || mode === "USB") { if (
mode === "AM" ||
mode === "FM" ||
mode === "SSB" ||
mode === "LSB" ||
mode === "USB"
) {
return "SSB"; return "SSB";
} }
@ -451,7 +489,7 @@ for (const [key, value] of Object.entries(Bands)) {
<div class="form-group"> <div class="form-group">
<label for="${key.slice(1)}CW">CW</label> <label for="${key.slice(1)}CW">CW</label>
<input type="text" class="form-control text-uppercase" id="${key.slice( <input type="text" class="form-control text-uppercase" id="${key.slice(
1 1,
)}CW" value="${value.cw}"> )}CW" value="${value.cw}">
</div> </div>
</div> </div>
@ -459,7 +497,7 @@ for (const [key, value] of Object.entries(Bands)) {
<div class="form-group"> <div class="form-group">
<label for="${key.slice(1)}SSB">SSB</label> <label for="${key.slice(1)}SSB">SSB</label>
<input type="text" class="form-control text-uppercase" id="${key.slice( <input type="text" class="form-control text-uppercase" id="${key.slice(
1 1,
)}SSB" value="${value.ssb}"> )}SSB" value="${value.ssb}">
</div> </div>
</div> </div>
@ -467,7 +505,7 @@ for (const [key, value] of Object.entries(Bands)) {
<div class="form-group"> <div class="form-group">
<label for="${key.slice(1)}DIGI">DIGI</label> <label for="${key.slice(1)}DIGI">DIGI</label>
<input type="text" class="form-control text-uppercase" id="${key.slice( <input type="text" class="form-control text-uppercase" id="${key.slice(
1 1,
)}DIGI" value="${value.digi}"> )}DIGI" value="${value.digi}">
</div> </div>
</div> </div>
@ -503,10 +541,8 @@ function isExampleDataEntered() {
let isExampleData = false; let isExampleData = false;
if (textarea.value.startsWith("*example-data*")) { if (textarea.value.startsWith("*example-data*")) {
isExampleData = true; isExampleData = true;
}
};
return isExampleData; return isExampleData;
} }
function getAdifTag(tagName, value) { function getAdifTag(tagName, value) {
@ -572,7 +608,6 @@ function isWWFF(value) {
return false; return false;
} }
$(document).ready(function () { $(document).ready(function () {
setInterval(updateUTCTime, 1000); setInterval(updateUTCTime, 1000);
updateUTCTime(); updateUTCTime();
@ -621,9 +656,9 @@ $(document).ready(function () {
$(".js-save-to-log").click(function () { $(".js-save-to-log").click(function () {
if ($("textarea").val() === "") { if ($("textarea").val() === "") {
$('#textarea').css('border', '2px solid rgb(217, 83, 79)'); $("#textarea").css("border", "2px solid rgb(217, 83, 79)");
setTimeout(function () { setTimeout(function () {
$('#textarea').css('border', ''); $("#textarea").css("border", "");
}, 2000); }, 2000);
return false; return false;
} }
@ -659,13 +694,11 @@ $(".js-save-to-log").click(function () {
btnOKClass: "btn-warning", btnOKClass: "btn-warning",
}); });
return false; return false;
} } else {
else {
handleInput(); handleInput();
BootstrapDialog.confirm({ BootstrapDialog.confirm({
title: lang_general_word_attention, title: lang_general_word_attention,
message: message: lang_qso_simplefle_confirm_save_to_log,
lang_qso_simplefle_confirm_save_to_log,
type: BootstrapDialog.TYPE_INFO, type: BootstrapDialog.TYPE_INFO,
btnCancelLabel: lang_general_word_cancel, btnCancelLabel: lang_general_word_cancel,
btnOKLabel: lang_general_word_ok, btnOKLabel: lang_general_word_ok,
@ -686,15 +719,20 @@ $(".js-save-to-log").click(function () {
var rst_rcvd = item[7]; var rst_rcvd = item[7];
var rst_sent = item[6]; var rst_sent = item[6];
var start_date = item[0]; var start_date = item[0];
var start_time = item[1][0] + item[1][1] + ":" + item[1][2] + item[1][3]; var start_time =
item[1][0] +
item[1][1] +
":" +
item[1][2] +
item[1][3];
var band = item[4]; var band = item[4];
var mode = item[5]; var mode = item[5];
var freq_display = item[3] * 1000000; var freq_display = item[3] * 1000000;
var station_profile = $(".station_id").val(); var station_profile = $(".station_id").val();
var sota_ref = ''; var sota_ref = "";
var iota_ref = ''; var iota_ref = "";
var pota_ref = ''; var pota_ref = "";
var wwff_ref = ''; var wwff_ref = "";
if (isSOTA(item[8])) { if (isSOTA(item[8])) {
sota_ref = item[8]; sota_ref = item[8];
} else if (isIOTA(item[8])) { } else if (isIOTA(item[8])) {
@ -730,8 +768,7 @@ $(".js-save-to-log").click(function () {
clearSession(); clearSession();
BootstrapDialog.alert({ BootstrapDialog.alert({
title: lang_qso_simplefle_success_save_to_log_header, title: lang_qso_simplefle_success_save_to_log_header,
message: message: lang_qso_simplefle_success_save_to_log,
lang_qso_simplefle_success_save_to_log,
}); });
} }
}, },