| 1 |
/* jshint asi: true */ |
| 2 |
jQuery(document).ready(function($){ |
| 3 |
var pluginList = [ |
| 4 |
'aweber-wp/aweber-wp.php', |
| 5 |
'campaign-monitor-wp/campaign-monitor-wp.php', |
| 6 |
'mailchimp-wp/mailchimp-wp.php', |
| 7 |
'getresponse-wp/getresponse-wp.php', |
| 8 |
] |
| 9 |
|
| 10 |
var $deactivateButton = $('#the-list tr.active').filter( function() { return pluginList.indexOf( $(this).data('plugin') ) !== -1 } ).find('.deactivate a') |
| 11 |
|
| 12 |
$deactivateButton.click(function(e){ |
| 13 |
e.preventDefault() |
| 14 |
$deactivateButton.unbind('click') |
| 15 |
$('body').append(fca_eoi.html) |
| 16 |
fca_eoi_uninstall_button_handlers( $deactivateButton.attr('href') ) |
| 17 |
|
| 18 |
}) |
| 19 |
}) |
| 20 |
|
| 21 |
function fca_eoi_uninstall_button_handlers( url ) { |
| 22 |
var $ = jQuery |
| 23 |
$('#fca-eoi-deactivate-skip').click(function(){ |
| 24 |
$(this).prop( 'disabled', true ) |
| 25 |
window.location.href = url |
| 26 |
}) |
| 27 |
$('#fca-eoi-deactivate-send').click(function(){ |
| 28 |
$(this).prop( 'disabled', true ) |
| 29 |
$(this).html('...') |
| 30 |
$('#fca-eoi-deactivate-skip').hide() |
| 31 |
$.ajax({ |
| 32 |
url: fca_eoi.ajaxurl, |
| 33 |
type: 'POST', |
| 34 |
data: { |
| 35 |
"action": "fca_eoi_uninstall", |
| 36 |
"nonce": fca_eoi.nonce, |
| 37 |
"msg": $('#fca-eoi-deactivate-textarea').val() |
| 38 |
} |
| 39 |
}).done( function( response ) { |
| 40 |
console.log ( response ) |
| 41 |
window.location.href = url |
| 42 |
}) |
| 43 |
}) |
| 44 |
|
| 45 |
} |