var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; };
if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } }
{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opener = _____WB$wombat$assign$function_____("opener");
var ajax_comments = {
locked: [],
onsubmit: function() {
var form = this;
if (ajax_comments.locked[form]) { return false; } // one at a time
else { ajax_comments.locked[form] = true; } // lock this form
jQuery.ajax({
type: 'POST',
url: 'http://http://dainandincox.com/wp-content/plugins/ajax-comments/ajax-comments-post.php',
data: jQuery(this).formSerialize(),
dataType: 'json',
cache: false,
timeout: 60000,
beforeSend: function(XMLHttpRequest) {
jQuery('.ajax_comments_error', form).remove(); // remove any previous errors
jQuery('input[@type=submit]', form) // select form submit button
.attr('disabled', 'disabled') // disable it
.hide() // hide it
.after('
'); // show AJAX spinner
},
success: function(data, textStatus) {
if ( // validate server response
typeof(data.comment_type) == 'undefined' ||
typeof(data.comment_ID) == 'undefined' ||
typeof(data.comments_template) == 'undefined' ||
!data.comments_template
) { // if response is not as expected...
this.error({responseText:''}, '', ''); // display unknown error
return; // abort
}
var wrapper = jQuery(form).parents('div#ajax_comments_wrapper'),
commentlist = jQuery('.commentlist', wrapper),
new_wrapper = jQuery(data.comments_template),
new_comment = jQuery('#comment-'+ data.comment_ID +', .commentlist *:last', new_wrapper).eq(0).hide();
if (data.comment_type == 'conventional' && commentlist.length > 0) {
commentlist.append(new_comment); // append new comment to existing wrapper
jQuery('#comments', wrapper).after(jQuery('#comments', new_wrapper)).remove(); // replace comment count element
} else { // flexible
var new_comment_form = jQuery('textarea[@name=comment]', new_wrapper).parents('form');
if (new_comment_form.length) {
new_comment_form.after(form).remove(); // replace comment form in new wrapper
} else {
new_wrapper.append(form); // append comment form to new wrapper
}
wrapper.after(new_wrapper).remove(); // replace old wrapper with new
}
new_comment.fadeIn('slow'); // show new comment using nice effect
// WP Ajax Edit Comments compatibility
if (typeof(AjaxEditComments) != 'undefined') {
AjaxEditComments.init();
}
jQuery('textarea#comment', form).val(''); // clear comment
this.cleanup();
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
var error = '';
if (typeof(XMLHttpRequest.responseText) == 'string' && XMLHttpRequest.responseText != '') {
error = XMLHttpRequest.responseText;
} else if (textStatus == 'timeout') {
error = 'The server is taking too long to respond. Please try again later.';
} else {
error = 'Unknown error while submitting your comment. Try again?';
}
jQuery(form).prepend(''); // display error above comment form
this.cleanup();
},
cleanup: function() {
jQuery('.ajax_comments_spinner', form).remove(); // remove the AJAX spinner
jQuery('input[@type=submit]', form) // select form submit button
.removeAttr('disabled') // enable it
.show(); // show it
ajax_comments.locked[form] = false; // unlock this form
}
});
return false; // abort non-AJAX form submission
}
}
// execute on document load
jQuery(function() {
// bind to the comment form
jQuery('#commentform').bind('submit', ajax_comments.onsubmit);
});
}
/*
playback timings (ms):
exclusion.robots: 0.187
PetaboxLoader3.resolve: 312.012 (2)
esindex: 0.033
CDXLines.iter: 19.782 (3)
RedisCDXSource: 2.291
captures_list: 286.693
exclusion.robots.policy: 0.174
PetaboxLoader3.datanode: 216.629 (4)
LoadShardBlock: 261.323 (3)
load_resource: 288.003
*/