' + troubleshooting_strings.suffixesRemoved + '
';
jQuery(termSuffixUpdatedHTML).dialog(
{
dialogClass: 'wpml-dialog otgs-ui-dialog',
width : 'auto',
modal : true,
buttons : {
Ok: function () {
jQuery(this).dialog("close");
}
}
}
);
}
});
}
jQuery('#icl_cache_clear').click(function () {
var self = jQuery(this);
self.prop( 'disabled', true );
self.after(icl_ajxloaderimg);
jQuery.post(location.href + '&debug_action=cache_clear&nonce=' + troubleshooting_strings.cacheClearNonce, function () {
self.prop('disabled', false);
alert( troubleshooting_strings.done );
self.next().fadeOut();
});
});
sync_posts_taxonomies_button.click(function(){
var requestData = {};
sync_posts_taxonomies_button.siblings('.wpml-notice').empty();
sync_posts_taxonomies_button.prop('disabled', true);
sync_posts_taxonomies_button.after(icl_ajxloaderimg);
requestData.batch_number = 0;
requestData.post_type = sync_posts_taxonomies_button.siblings('select[name="wpml_post_type"]').val();
sync_posts_taxonomies_send_ajax(requestData);
});
var sync_posts_taxonomies_send_ajax = function(requestData) {
requestData.debug_action = 'synchronize_posts_taxonomies';
requestData.nonce = troubleshooting_strings.syncPostsTaxNonce;
jQuery.ajax({
type : "POST",
url : location.href,
data : requestData,
success: sync_posts_taxonomies_receive_ajax
});
};
var sync_posts_taxonomies_receive_ajax = function(response) {
sync_posts_taxonomies_button.siblings('.wpml-notice').html(response.data.message);
if ( response.success && ! response.data.completed ) {
var requestData = response.data || {};
requestData.debug_action = 'synchronize_posts_taxonomies';
requestData.nonce = troubleshooting_strings.syncPostsTaxNonce;
sync_posts_taxonomies_send_ajax(requestData);
} else {
sync_posts_taxonomies_button.next().fadeOut();
sync_posts_taxonomies_button.prop('disabled', false);
}
};
});