| 1 |
jQuery( document ).ready(function() { |
| 2 |
jQuery('#spoiler-title').click(function() { |
| 3 |
if( jQuery('#spoiler-content').hasClass('closed') ) { |
| 4 |
jQuery('#spoiler-content').removeClass('closed'); |
| 5 |
jQuery('#spoiler-content').addClass('open'); |
| 6 |
jQuery('#spoiler-arrow').removeClass('down'); |
| 7 |
jQuery('#spoiler-arrow').addClass('up'); |
| 8 |
} else { |
| 9 |
jQuery('#spoiler-content').removeClass('open'); |
| 10 |
jQuery('#spoiler-content').addClass('closed'); |
| 11 |
jQuery('#spoiler-arrow').removeClass('up'); |
| 12 |
jQuery('#spoiler-arrow').addClass('down'); |
| 13 |
} |
| 14 |
}); |
| 15 |
|
| 16 |
jQuery('#sendwp-enabled-checkbox').change(function() { |
| 17 |
if( jQuery('#sendwp-enabled-checkbox').is(':checked') ) { |
| 18 |
jQuery('#sendwp-enabled-status').html(sendwpAdmin.loading); |
| 19 |
var data = { |
| 20 |
action: 'sendwp_forwarding', |
| 21 |
sendwp_forwarding: 'enable', |
| 22 |
security: sendwpAdmin.ajaxNonce |
| 23 |
}; |
| 24 |
jQuery.post( ajaxurl, data, function( response ){ |
| 25 |
var response = JSON.parse( response ); |
| 26 |
jQuery('#sendwp-enabled-status').html(sendwpAdmin.enabled); |
| 27 |
}); |
| 28 |
} else { |
| 29 |
jQuery('#sendwp-enabled-status').html(sendwpAdmin.loading); |
| 30 |
var data = { |
| 31 |
action: 'sendwp_forwarding', |
| 32 |
sendwp_forwarding: 'disable', |
| 33 |
security: sendwpAdmin.ajaxNonce |
| 34 |
}; |
| 35 |
jQuery.post( ajaxurl, data, function( response ){ |
| 36 |
var response = JSON.parse( response ); |
| 37 |
jQuery('#sendwp-enabled-status').html(sendwpAdmin.disabled); |
| 38 |
}); |
| 39 |
} |
| 40 |
}); |
| 41 |
}); |