PluginProbe
WP-Stateless – Google Cloud Storage / 2.2.5
WP-Stateless – Google Cloud Storage v2.2.5
4.4.3 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.3.0 2.3.1 2.3.2 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 All 62 releases
wp-stateless / static / scripts / error-notice.js

error-notice.js in WP-Stateless – Google Cloud Storage 2.2.5, at static/scripts/error-notice.js

71 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * EVENTS
3 */
4 jQuery( document ).ready( function ($) {
5
6 jQuery( document ).on( 'click', '.stateless-admin-notice.ud-admin-notice .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: 'stateless_enable_notice_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
24 var key = _this.attr('data-key');
25 key = key.replace('button_secondary_', '');
26 $("#" + key + " option[value=" + key +"]").attr('selected', 'selected');
27 $("#" + key).val('true');
28 } else if ( result_data.success == '0' ) {
29 // alert(result_data.error);
30 }
31 }, "json" );
32 return false;
33 });
34
35 jQuery( '.stateless-admin-notice.ud-admin-notice' ).off( 'click', '.dismiss');
36 jQuery( document ).on( 'click', '.stateless-admin-notice.ud-admin-notice .dismiss-warning', function(e){
37 e.preventDefault();
38
39 var _this = jQuery( this );
40
41 var data = {
42 action: 'stateless_notice_dismiss',
43 key: _this.data('key'),
44 }
45
46 jQuery.post( ajaxurl, data, function ( result_data ) {
47 if( result_data.success == '1' ) {
48 _this.closest('.ud-admin-notice').remove();
49 } else if ( result_data.success == '0' ) {
50 // alert(result_data.error);
51 }
52 }, "json" );
53 return false;
54 });
55
56 jQuery('#stless_settings_tab .sm-mode input[type=radio]').on('change', function(){
57 var $this = jQuery('#sm_mode_stateless');
58 if($this.is(':checked')){
59 var notice = jQuery('#stateless-notice-stateless-cache-busting');
60 if(!notice.length){
61 notice = jQuery(jQuery('#template-stateless-cache-busting').html());
62 notice.appendTo("#stateless-settings-page-title");
63 }
64 jQuery('#stateless-notice-stateless-cache-busting').show();
65 }
66 else{
67 jQuery('#stateless-notice-stateless-cache-busting').hide();
68 }
69 });
70
71 } );