33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-11-17 02:25:10 +00:00

add processing of errors in response (timeout, server error, expired session, etc.)

This commit is contained in:
Denis Ryabov 2021-03-09 23:25:36 +03:00
parent 2182167574
commit 67f3884315

View File

@ -38,6 +38,18 @@ function check(url, rule) {
var success = target.find('.alert-success').length;
sidebar.find('.badge.bg-success').toggleClass('hidden', !success);
sidebar.find('.spinner-border').addClass('hidden');
},
error: function(xhr, status){
var sidebar = jQuery('#jed-' + rule);
var target = jQuery('#police-check-result-' + rule);
target.html('<span class="text-danger"><b>' + status + ':</b> ' + xhr.status + ' ' + xhr.statusText + '</span>');
sidebar.find('.badge.bg-danger').text('?');
sidebar.find('.badge.bg-warning,.badge.bg-secondary,.badge.bg-info').text('');
sidebar.find('.badge.bg-success').addClass('hidden');
sidebar.find('.spinner-border').addClass('hidden');
}
});