PluginProbe ʕ •ᴥ•ʔ
reCaptcha by BestWebSoft / trunk
reCaptcha by BestWebSoft vtrunk
1.79 1.80 1.82 1.83 1.84 1.85 1.86 1.87 trunk 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 1.29 1.30 1.31 1.32 1.33 1.34 1.35 1.36 1.37 1.38 1.39 1.40 1.41 1.42 1.43 1.44 1.45 1.46 1.47 1.48 1.49 1.50 1.51 1.52 1.53 1.54 1.55 1.56 1.57 1.58 1.59 1.60 1.61 1.62 1.63 1.64 1.65 1.66 1.67 1.68 1.70 1.71 1.72 1.73 1.74 1.75 1.78
google-captcha / js / admin_script.js
google-captcha / js Last commit date
admin_script.js 4 months ago pre-api-script.js 8 years ago script.js 6 months ago
admin_script.js
171 lines
1 ( function( $ ) {
2 $( document ).ready( function() {
3
4 $( '#gglcptch_score_v3' ).change( function() {
5 var score;
6 score = $( this ).val();
7 $( '#gglcptch_score_out_v3' ).text( score );
8 } ).trigger( 'change' );
9
10 $( 'input[name="gglcptch_recaptcha_version"]' ).change( function() {
11 var versions = $( 'input[name="gglcptch_recaptcha_version"]' );
12 versions.each( function() {
13 if ( $( this ).is( ':checked' ) ) {
14 $( '.gglcptch_theme_' + $( this ).val() ).show();
15 $( '.gglcptch_score_' + $( this ).val() ).show();
16 $( '.gglcptch_badge_v3' ).show();
17 $( '.gglcptch_submit_' + $( this ).val() ).show();
18 } else {
19 $( '.gglcptch_theme_' + $( this ).val() ).hide();
20 $( '.gglcptch_score_' + $( this ).val() ).hide();
21 $( '.gglcptch_badge_' + $( this ).val() ).hide();
22 $( '.gglcptch_submit_' + $( this ).val() ).hide();
23 }
24 } );
25 } ).trigger( 'change' );
26
27 $( 'input[name="gglcptch_private_key"], input[name="gglcptch_public_key"]' ).change( function() {
28 $( '.gglcptch_verified, #gglcptch-test-keys, #gglcptch-test-block' ).hide();
29 } );
30
31 $( '.gglcptch-settings-accordion' ).accordion(
32 {
33 collapsible: true,
34 heightStyle: "content"
35 }
36 );
37
38 $( 'input[class^="gglcptch_all_day"]' ).change( function() {
39 if ( $( this ).is( ':checked' ) ) {
40 $( this ).parent().parent().find( '.gglcptch_hours_wrapper' ).addClass( 'hidden' );
41 } else {
42 $( this ).parent().parent().find( '.gglcptch_hours_wrapper' ).removeClass( 'hidden' );
43 }
44 } );
45 $( 'input[class^="gglcptch_weekdays"]' ).change( function() {
46 if ( $( this ).is( ':checked' ) ) {
47 var next = $( this ).parent().parent().parent().next().children().eq( parseInt( $( this ).val() ) - 1 );
48 if ( $( next ).find( 'input[class^="gglcptch_all_day"]' ).is( ':checked' ) ) {
49 $( next ).children().eq( 0 ).removeClass( 'hidden' );
50 } else {
51 $( next ).children().removeClass( 'hidden' );
52 }
53 } else {
54 $( this ).parent().parent().parent().next().children().eq( parseInt( $( this ).val() ) - 1 ).children().addClass( 'hidden' );
55 }
56 } );
57
58 /* Prevent jQuery accordion collapsing on link click */
59 $( ".gglcptch-settings-accordion a" ).on( "click", function( event ) {
60 event.stopPropagation();
61 } );
62
63 /**
64 * Handle the "Allow list" tab on the plugins option page
65 */
66 $( 'button[name="gglcptch_show_allowlist_form"]' ).click( function() {
67 $( this ).closest( 'form' ).hide();
68 $( '.gglcptch_allowlist_form' ).show();
69 return false;
70 } );
71
72 /* add my ip to the allowlist */
73 $( 'input[name="gglcptch_add_to_allowlist_my_ip"]' ).change( function() {
74 if ( $( this ).is( ':checked' ) ) {
75 var my_ip = $( 'input[name="gglcptch_add_to_allowlist_my_ip_value"]' ).val();
76 $( 'input[name="gglcptch_add_to_allowlist"]' ).val( my_ip ).attr( 'readonly', 'readonly' );
77 } else {
78 $( 'input[name="gglcptch_add_to_allowlist"]' ).val( '' ).removeAttr( 'readonly' );
79 }
80 } );
81
82 /* Hide login block */
83 $( '#gglcptch_hide_login' ).on( 'change', function() {
84 if ( $( this ).is( ':checked' ) ) {
85 $( '.gglcptch_login_slug' ).show();
86 } else {
87 $( '.gglcptch_login_slug' ).hide();
88 }
89 } );
90
91 $( '#gglcptch_force_strong_passwords' ).change( function() {
92 if ( $( this ).is( ':checked' ) ) {
93 $( '.gglcptch_fsp' ).show();
94 } else {
95 $( '.gglcptch_fsp' ).hide();
96 }
97 } ).trigger( 'change' );
98 } );
99
100 $( document ).on( 'click', '#gglcptch-test-keys a', function( e ) {
101 e.preventDefault();
102
103 if ( ! $( '#gglcptch-test-block' ).length ) {
104 $( '#gglcptch-test-keys' ).after( '<div id="gglcptch-test-block"></div>' );
105 }
106
107 $( '.gglcptch-test-results' ).remove();
108 $( '#gglcptch-test-block' ).load( $( this ).prop( 'href' ), function() {
109 $( '.gglcptch_v2, .gglcptch_invisible' ).each( function() {
110 var container = $( this ).find( '.gglcptch_recaptcha' ).attr( 'id' );
111 if ( $( this ).is( ':visible' ) ) {
112 gglcptch.display( container );
113 if ( $( this ).hasClass( 'gglcptch_invisible' ) ) {
114 var gglcptch_index = $( this ).find( '.gglcptch_recaptcha' ).data( 'gglcptch_index' );
115 grecaptcha.execute( gglcptch_index );
116 }
117 }
118 } );
119 } );
120
121 e.stopPropagation();
122 $( '#gglcptch-test-keys' ).hide();
123 setTimeout( function(){
124 if( $( '#gglcptch_test_keys_verification' ).length > 0 ) {
125 $( '#gglcptch_test_keys_verification' ).removeAttr('disabled');
126 $( '#gglcptch_test_keys_verification' ).removeClass( 'cptch_loading' );
127 $( '.bws_form input[type="submit"]' ).removeAttr( 'disabled' );
128 }
129 }, 8000 );
130 return false;
131 } );
132
133 $( document ).on( 'click', '#gglcptch_test_keys_verification', function( e ) {
134 e.preventDefault();
135 $.ajax( {
136 async : false,
137 cache : false,
138 type : 'POST',
139 url : ajaxurl,
140 headers : {
141 'Content-Type' : 'application/x-www-form-urlencoded'
142 },
143 data : {
144 action: 'gglcptch_test_keys_verification',
145 recaptcha_challenge_field : $( '#recaptcha_challenge_field' ).val(),
146 recaptcha_response_field : $( '#recaptcha_response_field' ).val(),
147 'g-recaptcha-response' : $( '.g-recaptcha-response' ).val(),
148 _wpnonce : $( '[name="gglcptch_test_keys_verification-nonce"]' ).val()
149 },
150 success: function( data ) {
151 $( '#gglcptch-test-block' ).after( data );
152 $( '#gglcptch-test-block' ).html( '' );
153 if ( $( '.gglcptch-test-results' ).hasClass( 'updated' ) ) {
154 $( '.gglcptch_verified' ).show();
155 } else {
156 $( '.gglcptch_verified' ).hide();
157 if (
158 'v2' == $( 'input[name="gglcptch_recaptcha_version"]:checked' ).val() ||
159 'invisible' == $( 'input[name="gglcptch_recaptcha_version"]:checked' ).val()
160 ) {
161 $( '#gglcptch-test-keys' ).show();
162 }
163 }
164 }
165 } );
166
167 e.stopPropagation();
168 return false;
169 } );
170 } )( jQuery );
171