mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-12-16 09:03:39 +00:00
Improve add spot page warning and server-side validation. #71
This commit is contained in:
@@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user