2014-04-02 21:08:05 +00:00
|
|
|
// Generated by CoffeeScript 1.7.1
|
2014-02-23 23:59:49 +00:00
|
|
|
(function() {
|
|
|
|
|
var fOnLoad;
|
|
|
|
|
|
|
|
|
|
fOnLoad = function() {
|
|
|
|
|
document.title = 'Administrate';
|
|
|
|
|
$('#pagetitle').text('Hi {{{user.username}}}, issue your commands please:');
|
2014-04-21 12:42:26 +00:00
|
|
|
if (!window.CryptoJS) {
|
|
|
|
|
$('#info').attr('class', 'error');
|
|
|
|
|
$('#info').text('CryptoJS library missing! Are you connected to the internet?');
|
|
|
|
|
}
|
|
|
|
|
$('#but_submit').click(function() {
|
2014-02-23 23:59:49 +00:00
|
|
|
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) {
|
2014-04-04 17:53:42 +00:00
|
|
|
var fDelayed;
|
|
|
|
|
fDelayed = function() {
|
|
|
|
|
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';
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return setTimeout(fDelayed, 500);
|
2014-02-23 23:59:49 +00:00
|
|
|
});
|
|
|
|
|
});
|
2014-04-21 12:42:26 +00:00
|
|
|
return $('#inp_password').keyup(function() {
|
|
|
|
|
var hp;
|
|
|
|
|
hp = CryptoJS.SHA3($(this).val(), {
|
|
|
|
|
outputLength: 512
|
|
|
|
|
});
|
|
|
|
|
return $('#display_hash').text(hp.toString());
|
|
|
|
|
});
|
2014-02-23 23:59:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
window.addEventListener('load', fOnLoad, true);
|
|
|
|
|
|
|
|
|
|
}).call(this);
|