File: /var/www/html/wp-content/plugins/backup-guard-security-platinum/public/js/bgsRequesthandler.js
function bgsRequestHandler(action, data, params){
this.action = action;
this.url = '';
this.data = data;
this.callback = '';
this.type = 'POST';
this.dataType = 'JSON';
this.dataIsObject = true;
this.params = params;
};
bgsRequestHandler.prototype.prepareData = function() {
}
bgsRequestHandler.prototype.run = function(){
var that = this;
that.prepareData();
var settings = {
url: that.url,
data: that.data,
type: that.type,
dataType: that.dataType,
success: function(response){
if(jQuery.isFunction(that.callback)){
that.callback(response, false);
}
},
error: function (e, textStatus) {
if(jQuery.isFunction(that.callback)){
that.callback(false, textStatus);
}
}
};
if (typeof this.params === 'undefined') this.params = {};
jQuery.extend(settings, this.params);
return jQuery.ajax(settings);
};