jQuery(document).ready(function($) { $modal = $('.bill-vote-desactivate-wrap') $('#imagewait').hide(); $deactivateSearch = $(".active").filter('[data-slug="antihacker"]'); $deactivateSearch.click(function (evt) { mystr = evt.target.href; if(! mystr.includes("deactivate")) {return;} evt.preventDefault(); $modal.prependTo($('#wpcontent')).slideDown(); $('html, body').scrollTop(0); $('.bill-vote-desactivate-wrap').css('width', '650px'); $('.deactivate').find('a').each(function() { mystr = $(this).attr('href'); if(mystr.includes("antihacker")) { $deactivateLink = mystr; } }); $( ".button-deactivate" ).click(function() { if( !$(this).hasClass('disabled')) { window.location.href = $deactivateLink; } }); $( ".button-close-submit" ).click(function() { var isAnonymousFeedback = $(".anonymous").prop("checked"); var explanation = $('#explanation').val(); var username = $('#username').val(); var version = $("#version").val(); var email = $('#email').val(); var produto = $('#produto').val(); var produto = $('#produto').val(); var wpversion = $('#wpversion').val(); var dom = document.domain; $('#imagewait').show(); $( ".button-close-submit" ).addClass('disabled'); $( ".button-close-dialog" ).addClass('disabled'); $( ".button-deactivate" ).addClass('disabled'); if(isAnonymousFeedback) { email = 'anonymous'; username = 'anonymous'; dom = 'anonymous'; version = 'anonymous'; wpversion = 'anonymous'; } $.ajax({ url : 'http://billminozzi.com/httpapi/httpapi.php', withCredentials: true, timeout: 15000, method : 'POST', data : { email: email, name: username, obs: explanation, dom: dom, version: version, produto: produto, wpversion: wpversion }, complete : function () { // Do not show the dialog box, deactivate the plugin. window.location.href = $deactivateLink; } }); // end ajax }); // end clicked button share ... $( ".button-close-dialog" ).click(function() { if( ! $(this).hasClass('disabled')) { $('#imagewait').hide(); $modal.slideUp(); } }); }); // end clicked Deactivated ... }); // end jQuery