Battle.ButtonLink = function(url) {
window.location.href=url;
};
Battle.AjaxCall = function(data) {
if (Battle.Loading == false) {
data.pageID = "mWTz5";
Battle.EnableLoading();
$.ajax({
type:'POST',
url: 'core/battles/battle.handler.php?v=2',
data: data,
error:function(json){
$('#battleText').html('An error has occurred.
battle.handler.php:
'+json.responseText.split('{')[0]);
},
success:function(json) {
if (typeof json != 'object') {
if (json.indexOf('PROPER_ERROR_') !== -1)
$('#battleText').html('An error has occurred.
battle.handler.php:
'+json);
else
$('#battleText').html(json.replace("PROPER_ERROR_",''));
} else if (json.hasOwnProperty('indexOf') && json.indexOf('/var/www/tpkrpg.net/') >= -1) {
$('#battleText').html('An error has occurred.
battle.handler.php:
'+json.split('{')[0]);
} else {
Battle.Render(json);
Battle.DisableLoading();
$('.optionsText').css('display','none').html('');
} }
});
}
);
Battle.Move = function(move, e) {
Battle.AjaxCall({
'ID':'NGLHZx9znie9JJk',
'move':move,
'x':e.pageX,
'y':e.pageY
});
};
Battle.Continue = function(contcode, e) {
Battle.AjaxCall({'ID':'NGLHZx9znie9JJk',
'continue':contcode,
'x':e.pageX,
'y':e.pageY});
};
Battle.Restart = function(restart, e) {
Battle.AjaxCall({'ID':'NGLHZx9znie9JJk',
'restart':restart,
'x':e.pageX,
'y':e.pageY});
};