Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Description: myAJAX
Submitted on June 26, 2015 at 12:50 PM

Section 1 (Text)

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.<br><br>battle.handler.php:<br>'+json.responseText.split('{')[0]);
			},
			success:function(json) {
				if (typeof json != 'object') {
					if (json.indexOf('PROPER_ERROR_') !== -1) 
						$('#battleText').html('An error has occurred.<br><br>battle.handler.php:<br>'+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.<br><br>battle.handler.php:<br>'+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});
};