mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-06-24 05:35:10 +00:00
Fix some IDE warnings
This commit is contained in:
@@ -33,44 +33,44 @@ function addSpot() {
|
||||
saveSettings();
|
||||
|
||||
// Unpack the user's entered values
|
||||
var dx = $("#dx-call").val().toUpperCase();
|
||||
var freqStr = $("#freq").val();
|
||||
var mode = $("#mode")[0].value;
|
||||
var sig = $("#sig")[0].value;
|
||||
var sigRef = $("#sig-ref").val();
|
||||
var dxGrid = $("#dx-grid").val();
|
||||
var comment = $("#comment").val();
|
||||
var de = $("#de-call").val().toUpperCase();
|
||||
const dx = $("#dx-call").val().toUpperCase();
|
||||
const freqStr = $("#freq").val();
|
||||
const mode = $("#mode")[0].value;
|
||||
const sig = $("#sig")[0].value;
|
||||
const sigRef = $("#sig-ref").val();
|
||||
const dxGrid = $("#dx-grid").val();
|
||||
const comment = $("#comment").val();
|
||||
const de = $("#de-call").val().toUpperCase();
|
||||
|
||||
var spot = {}
|
||||
if (dx != "") {
|
||||
const spot = {};
|
||||
if (dx !== "") {
|
||||
spot["dx_call"] = dx;
|
||||
} else {
|
||||
showAddSpotError("A DX callsign is required in order to spot.");
|
||||
return;
|
||||
}
|
||||
if (freqStr != "") {
|
||||
if (freqStr !== "") {
|
||||
spot["freq"] = parseFloat(freqStr) * 1000;
|
||||
} else {
|
||||
showAddSpotError("A frequency is required in order to spot.");
|
||||
return;
|
||||
}
|
||||
if (mode != "") {
|
||||
if (mode !== "") {
|
||||
spot["mode"] = mode;
|
||||
}
|
||||
if (sig != "") {
|
||||
if (sig !== "") {
|
||||
spot["sig"] = sig;
|
||||
}
|
||||
if (sigRef != "") {
|
||||
if (sigRef !== "") {
|
||||
spot["sig_refs"] = [{id: sigRef}];
|
||||
}
|
||||
if (dxGrid != "") {
|
||||
if (dxGrid !== "") {
|
||||
spot["dx_grid"] = dxGrid;
|
||||
}
|
||||
if (comment != "") {
|
||||
if (comment !== "") {
|
||||
spot["comment"] = comment;
|
||||
}
|
||||
if (de != "") {
|
||||
if (de !== "") {
|
||||
spot["de_call"] = de;
|
||||
} else {
|
||||
showAddSpotError("A spotter callsign is required in order to spot.");
|
||||
@@ -83,7 +83,7 @@ function addSpot() {
|
||||
contentType : 'application/json',
|
||||
type : 'POST',
|
||||
timeout: 10000,
|
||||
success: async function (result) {
|
||||
success: async function() {
|
||||
$("#result-good").html("<div class='alert alert-success fade show mb-0 mt-4' role='alert'><i class='fa-solid fa-check'></i> Spot submitted. Returning you to the spots list...</div>");
|
||||
$("#result-bad").html("");
|
||||
setTimeout(() => {
|
||||
@@ -103,7 +103,7 @@ function addSpot() {
|
||||
|
||||
// Show an "add spot" error.
|
||||
function showAddSpotError(text) {
|
||||
var div = $("<div class='alert alert-danger alert-dismissible fade show mb-0 mt-4' role='alert'></div>");
|
||||
const div = $("<div class='alert alert-danger alert-dismissible fade show mb-0 mt-4' role='alert'></div>");
|
||||
div.append("<i class='fa-solid fa-triangle-exclamation'></i> ");
|
||||
div.append(document.createTextNode(text));
|
||||
div.append("<button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close'></button>");
|
||||
|
||||
Reference in New Issue
Block a user