Improve add spot page warning and server-side validation. #71

This commit is contained in:
Ian Renton
2025-11-01 10:29:18 +00:00
parent 69821f817b
commit a3ec923c56
6 changed files with 45 additions and 10 deletions

View File

@@ -48,7 +48,7 @@ function addSpot() {
}, 1000);
},
error: function (result) {
showAddSpotError(result.responseText);
showAddSpotError(result.responseText.slice(1,-1));
}
});
} catch (error) {
@@ -73,8 +73,20 @@ $("#mode").change(function () {
$(this).val($(this).val().trim().toUpperCase());
});
// Display the intro box, unless the user has already dismissed it once.
function displayIntroBox() {
if (localStorage.getItem("add-spot-intro-box-dismissed") == null) {
$("#add-spot-intro-box").show();
}
$("#add-spot-intro-box-dismiss").click(function() {
localStorage.setItem("add-spot-intro-box-dismissed", true);
});
}
// Startup
$(document).ready(function() {
// Load settings from settings storage
loadSettings();
// Display intro box
displayIntroBox();
});