mirror of
https://github.com/Hopiu/webapi-eca.git
synced 2026-04-26 17:44:49 +00:00
31 lines
908 B
JavaScript
31 lines
908 B
JavaScript
// Generated by CoffeeScript 1.7.1
|
|
(function() {
|
|
var fOnLoad;
|
|
|
|
fOnLoad = function() {
|
|
document.title = 'Administrate';
|
|
$('#pagetitle').text('Hi {{{user.username}}}, issue your commands please:');
|
|
return $('#but_submit').click(function() {
|
|
var data;
|
|
data = {
|
|
command: $('#inp_command').val()
|
|
};
|
|
return $.post('admincommand', data).done(function(data) {
|
|
$('#info').text(data.message);
|
|
return $('#info').attr('class', 'success');
|
|
}).fail(function(err) {
|
|
if (err.responseText === '') {
|
|
err.responseText = 'No Response from Server!';
|
|
}
|
|
$('#info').text('Error: ' + err.responseText);
|
|
$('#info').attr('class', 'error');
|
|
if (err.status === 401) {
|
|
return window.location.href = 'admin';
|
|
}
|
|
});
|
|
});
|
|
};
|
|
|
|
window.addEventListener('load', fOnLoad, true);
|
|
|
|
}).call(this);
|