Files
teamspeak-teaspeak/TeaSpeak/addons/teamspeak/js/script.js
Kevin Feiler ceee8d9663 Update high
2025-10-16 01:15:48 +02:00

43 lines
1.2 KiB
JavaScript

function test(host, hash) {
// Fork it
var request;
// fire off the request to /form.php
request = $.ajax({
url: '../modules/addons/teamspeak/lib/functions.php',
type: 'get',
data: {
host: host
},
beforeSend: function () {
$('.verify-status').show()
}
});
// callback handler that will be called on success
request.done(function (response, textStatus, jqXHR) {
var status = response.status;
var statusClass;
if (status) {
statusClass = 'success';
$('#' + hash + ' span.manager').removeClass('invisible');
} else {
statusClass = 'danger';
}
$('#' + hash).removeClass('success danger').addClass(statusClass);
});
// callback handler that will be called on failure
request.fail(function (jqXHR, textStatus, errorThrown) {
// log the error to the console
console.error(
"The following error occured: " +
textStatus, errorThrown
);
});
request.always(function () {
setTimeout(function () {
$('.verify-status').hide();
}, 2000);
})
}