| 1 |
/** |
| 2 |
* EVENTS |
| 3 |
*/ |
| 4 |
jQuery( document ).ready( function () { |
| 5 |
|
| 6 |
jQuery( '.ud-admin-notice' ).on( 'click', '.button-action', function(e){ |
| 7 |
var _this = jQuery( this ); |
| 8 |
if(_this.attr('href') != '#'){ |
| 9 |
return; |
| 10 |
} |
| 11 |
|
| 12 |
e.preventDefault(); |
| 13 |
|
| 14 |
|
| 15 |
var data = { |
| 16 |
action: 'button_action', |
| 17 |
key: _this.data('key'), |
| 18 |
} |
| 19 |
|
| 20 |
jQuery.post( ajaxurl, data, function ( result_data ) { |
| 21 |
if( result_data.success == '1' ) { |
| 22 |
_this.closest('.ud-admin-notice').remove(); |
| 23 |
} else if ( result_data.success == '0' ) { |
| 24 |
alert(result_data.error); |
| 25 |
} |
| 26 |
}, "json" ); |
| 27 |
return false; |
| 28 |
}); |
| 29 |
|
| 30 |
jQuery('#stless_settings_tab .sm-mode input[type=radio]').on('change', function(){ |
| 31 |
var $this = jQuery('#sm_mode_stateless'); |
| 32 |
if($this.is(':checked')){ |
| 33 |
var notice = jQuery('#stateless-notice-stateless-cache-busting'); |
| 34 |
if(!notice.length){ |
| 35 |
notice = jQuery(jQuery('#template-stateless-cache-busting').html()); |
| 36 |
notice.appendTo("#stateless-settings-page-title"); |
| 37 |
} |
| 38 |
jQuery('#stateless-notice-stateless-cache-busting').show(); |
| 39 |
} |
| 40 |
else{ |
| 41 |
jQuery('#stateless-notice-stateless-cache-busting').hide(); |
| 42 |
} |
| 43 |
}); |
| 44 |
|
| 45 |
} ); |