PluginProbe ʕ •ᴥ•ʔ
reCaptcha by BestWebSoft / 1.34
reCaptcha by BestWebSoft v1.34
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 8 years ago pre-api-script.js 8 years ago script.js 8 years ago
admin_script.js
114 lines
1 ( function( $ ) {
2 $( document ).ready( function() {
3
4 $( 'input[name="gglcptch_recaptcha_version"]' ).change( function() {
5 var versions = $( 'input[name="gglcptch_recaptcha_version"]' );
6 versions.each( function() {
7 if ( $( this ).is( ':checked' ) ) {
8 $( '.gglcptch_theme_' + $( this ).val() ).show();
9 } else {
10 $( '.gglcptch_theme_' + $( this ).val() ).hide();
11 }
12 } );
13 } ).trigger( 'change' );
14
15 $( 'input[name="gglcptch_private_key"], input[name="gglcptch_public_key"]' ).change( function() {
16 $( '.gglcptch_verified, #gglcptch-test-keys, #gglcptch-test-block' ).hide();
17 } );
18
19 $( '.gglcptch-settings-accordion' ).accordion(
20 {
21 collapsible: true,
22 heightStyle: "content"
23 }
24 );
25
26 /* Prevent jQuery accordion collapsing on link click */
27 $( ".gglcptch-settings-accordion a" ).on( "click", function( event ) {
28 event.stopPropagation();
29 } );
30
31 /**
32 * Handle the "Whitelist" tab on the plugins option page
33 */
34 $( 'button[name="gglcptch_show_whitelist_form"]' ).click( function() {
35 $( this ).closest( 'form' ).hide();
36 $( '.gglcptch_whitelist_form' ).show();
37 return false;
38 } );
39
40 /* add my ip to the whitelist */
41 $( 'input[name="gglcptch_add_to_whitelist_my_ip"]' ).change( function() {
42 if ( $( this ).is( ':checked' ) ) {
43 var my_ip = $( 'input[name="gglcptch_add_to_whitelist_my_ip_value"]' ).val();
44 $( 'input[name="gglcptch_add_to_whitelist"]' ).val( my_ip ).attr( 'readonly', 'readonly' );
45 } else {
46 $( 'input[name="gglcptch_add_to_whitelist"]' ).val( '' ).removeAttr( 'readonly' );
47 }
48 } );
49 } );
50
51 $( document ).on( 'click', '#gglcptch-test-keys a', function( e ) {
52 e.preventDefault();
53
54 if ( ! $( '#gglcptch-test-block' ).length ) {
55 $( '#gglcptch-test-keys' ).after( '<div id="gglcptch-test-block"></div>' );
56 }
57
58 $( '.gglcptch-test-results' ).remove();
59 $( '#gglcptch-test-block' ).load( $( this ).prop( 'href' ), function() {
60 $( '.gglcptch_v1, .gglcptch_v2, .gglcptch_invisible' ).each( function() {
61 var container = $( this ).find( '.gglcptch_recaptcha' ).attr( 'id' );
62 if ( $( this ).is( ':visible' ) ) {
63 gglcptch.display( container );
64 if ( $( this ).hasClass( 'gglcptch_invisible' ) ) {
65 var gglcptch_index = $( this ).find( '.gglcptch_recaptcha' ).data( 'gglcptch_index' );
66 grecaptcha.execute( gglcptch_index );
67 }
68 }
69 } );
70 } );
71
72 e.stopPropagation();
73 $( '#gglcptch-test-keys' ).hide();
74 return false;
75 } );
76
77 $( document ).on( 'click', '#gglcptch_test_keys_verification', function( e ) {
78 e.preventDefault();
79 $.ajax( {
80 async : false,
81 cache : false,
82 type : 'POST',
83 url : ajaxurl,
84 headers : {
85 'Content-Type' : 'application/x-www-form-urlencoded'
86 },
87 data : {
88 action: 'gglcptch_test_keys_verification',
89 recaptcha_challenge_field : $( '#recaptcha_challenge_field' ).val(),
90 recaptcha_response_field : $( '#recaptcha_response_field' ).val(),
91 'g-recaptcha-response' : $( '.g-recaptcha-response' ).val(),
92 _wpnonce : $( '[name="gglcptch_test_keys_verification-nonce"]' ).val()
93 },
94 success: function( data ) {
95 $( '#gglcptch-test-block' ).after( data );
96 $( '#gglcptch-test-block' ).html( '' );
97 if ( $( '.gglcptch-test-results' ).hasClass( 'updated' ) ) {
98 $( '.gglcptch_verified' ).show();
99 } else {
100 $( '.gglcptch_verified' ).hide();
101 if (
102 'v2' == $( 'input[name="gglcptch_recaptcha_version"]:checked' ).val() ||
103 'invisible' == $( 'input[name="gglcptch_recaptcha_version"]:checked' ).val()
104 ) {
105 $( '#gglcptch-test-keys' ).show();
106 }
107 }
108 }
109 } );
110
111 e.stopPropagation();
112 return false;
113 } );
114 } )( jQuery );