From 0d8f112c9e11719cb9199baeb490754c190ba9ea Mon Sep 17 00:00:00 2001 From: nriault Date: Thu, 18 Apr 2019 14:09:54 +0200 Subject: [PATCH] Adding notify JS to alert if connexion to APIs is lost. --- index.html | 3 +-- js/timelaps.js | 9 ++++++--- karts.html | 33 +++++++++++++++++++++++++++++++-- params.html | 3 +-- pilots.html | 2 +- vendor/notify/notify.min.js | 1 + 6 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 vendor/notify/notify.min.js diff --git a/index.html b/index.html index 10d9699..3d80329 100644 --- a/index.html +++ b/index.html @@ -468,6 +468,7 @@ + @@ -477,9 +478,7 @@ diff --git a/js/timelaps.js b/js/timelaps.js index bc81efd..33f9422 100644 --- a/js/timelaps.js +++ b/js/timelaps.js @@ -31,7 +31,8 @@ function showKarts() { }); }, error: function (xhr) { - alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText); + $.notify("APIs unreachable!", "error"); + console.log('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText); }, }); } @@ -54,7 +55,8 @@ function getKartsMenu() { }); }, error: function (xhr) { - alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText); + $.notify("APIs unreachable!", "error"); + console.log('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText); }, }); } @@ -129,7 +131,8 @@ function getPilotsByKart() { }); }, error: function (xhr) { - alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText); + $.notify("APIs unreachable!", "error"); + console.log('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText); }, }); } diff --git a/karts.html b/karts.html index 510cd21..3a80647 100644 --- a/karts.html +++ b/karts.html @@ -195,7 +195,7 @@
Karting list - - +
@@ -264,6 +264,35 @@
+ +