mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-03 01:10:17 +01:00
Added a try catch to the loading to inform user
This commit is contained in:
parent
f2b6040469
commit
1bc8fbed42
@ -815,6 +815,7 @@
|
||||
<script src="js/network-values.js"></script>
|
||||
|
||||
<script>
|
||||
try {
|
||||
setLoadingText('Calculating values..');
|
||||
jsonRequest("../v1/network/overview", loadNetworkOverviewValues);
|
||||
jsonRequest("../v1/network/servers", loadServerBoxes);
|
||||
@ -971,6 +972,13 @@
|
||||
setTimeout(function () {
|
||||
$('.page-loader').fadeOut();
|
||||
}, 50);
|
||||
} catch (loadingError) {
|
||||
setLoadingText("Error occurred, see Developer Console (Ctrl+Shift+I) - Please report this: " + loadingError);
|
||||
setTimeout(function () {
|
||||
$('.page-loader').fadeOut();
|
||||
}, 10000);
|
||||
throw loadingError;
|
||||
}
|
||||
|
||||
function openFunc(i) {
|
||||
return function () {
|
||||
|
@ -737,6 +737,7 @@
|
||||
<script src="js/player-values.js"></script>
|
||||
|
||||
<script>
|
||||
try {
|
||||
setLoadingText('Loading player values..');
|
||||
jsonRequest("../v1/player?player=${playerName}", function (json, error) {
|
||||
loadPlayerOverviewValues(json, error);
|
||||
@ -798,6 +799,13 @@
|
||||
setTimeout(function () {
|
||||
$('.page-loader').fadeOut();
|
||||
}, 50);
|
||||
} catch (loadingError) {
|
||||
setLoadingText("Error occurred, see Developer Console (Ctrl+Shift+I) - Please report this: " + loadingError);
|
||||
setTimeout(function () {
|
||||
$('.page-loader').fadeOut();
|
||||
}, 10000);
|
||||
throw loadingError;
|
||||
}
|
||||
|
||||
function openFunc(i) {
|
||||
return function () {
|
||||
|
@ -271,6 +271,7 @@
|
||||
<script src="js/color-selector.js"></script>
|
||||
|
||||
<script>
|
||||
try {
|
||||
jsonRequest("../v1/players", function (playersTableJson, error) {
|
||||
if (playersTableJson) {
|
||||
$('.player-table').DataTable({
|
||||
@ -286,6 +287,13 @@
|
||||
})
|
||||
}
|
||||
});
|
||||
} catch (loadingError) {
|
||||
window.alert("Error occurred, see Developer Console (Ctrl+Shift+I) - Please report this: " + loadingError);
|
||||
setTimeout(function () {
|
||||
$('.page-loader').fadeOut();
|
||||
}, 10000);
|
||||
throw loadingError;
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
@ -1290,6 +1290,7 @@
|
||||
<script src="js/server-values.js"></script>
|
||||
|
||||
<script>
|
||||
try {
|
||||
var x = document.getElementById("content");
|
||||
|
||||
setLoadingText('Calculating values..');
|
||||
@ -1607,6 +1608,13 @@
|
||||
setTimeout(function () {
|
||||
$('.page-loader').fadeOut();
|
||||
}, 50);
|
||||
} catch (loadingError) {
|
||||
setLoadingText("Error occurred, see Developer Console (Ctrl+Shift+I) - Please report this: " + loadingError);
|
||||
setTimeout(function () {
|
||||
$('.page-loader').fadeOut();
|
||||
}, 10000);
|
||||
throw loadingError;
|
||||
}
|
||||
|
||||
function openPageFunc() {
|
||||
var navButtons = document.getElementsByClassName("nav-button");
|
||||
|
Loading…
Reference in New Issue
Block a user