PluginProbe ʕ •ᴥ•ʔ
reCaptcha by BestWebSoft / 1.12
reCaptcha by BestWebSoft v1.12
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 / script.js
google-captcha / js Last commit date
admin_script.js 11 years ago script.js 11 years ago
script.js
84 lines
1 (function( $ ) {
2 $( document ).ready(function() {
3 $( '#recaptcha_widget_div #recaptcha_response_field' ).live( 'input paste change', function() {
4 $error = $( this ).parents( '#recaptcha_widget_div' ).next( '#gglcptch_error' );
5 if( $error.length ) {
6 $error.remove();
7 }
8 });
9 $( 'form' ).submit( function( e ) {
10 var $form = $( this ),
11 $captcha = $form.find( '#recaptcha_widget_div:visible' ),
12 $captcha_v2 = $form.find( '.g-recaptcha:visible' );
13 if ( $captcha.length ) {
14 $.ajax({
15 async : false,
16 cache : false,
17 type : 'POST',
18 url : ajaxurl,
19 headers : {
20 'Content-Type' : 'application/x-www-form-urlencoded'
21 },
22 data : {
23 action: 'gglcptch_captcha_check',
24 recaptcha_challenge_field : $( '#recaptcha_challenge_field' ).val(),
25 recaptcha_response_field : $( '#recaptcha_response_field' ).val()
26 },
27 success : function( data ) {
28 if ( data == 'error' ) {
29 if ( $captcha.next( '#gglcptch_error' ).length == 0 ) {
30 $captcha.after( '<label id="gglcptch_error">' + gglcptch_error_msg + '</label>' );
31 }
32 $( '#recaptcha_reload' ).trigger( 'click' );
33 e.preventDefault ? e.preventDefault() : (e.returnValue = false);
34 return false;
35 }
36 },
37 error: function( request, status, error ) {
38 if ( $captcha.next( '#gglcptch_error' ).length == 0 ) {
39 $captcha.after( '<label id="gglcptch_error">' + request.status + ' ' + error + '</label>' );
40 }
41 $( '#recaptcha_reload' ).trigger( 'click' );
42 e.preventDefault ? e.preventDefault() : (e.returnValue = false);
43 return false;
44 }
45 });
46 $( '#recaptcha_reload' ).trigger( 'click' );
47 } else if ( $captcha_v2.length ) {
48 $.ajax({
49 async : false,
50 cache : false,
51 type : 'POST',
52 url : ajaxurl,
53 headers : {
54 'Content-Type' : 'application/x-www-form-urlencoded'
55 },
56 data : {
57 action: 'gglcptch_captcha_check',
58 'g-recaptcha-response' : $form.find( '.g-recaptcha-response' ).val()
59 },
60 success : function( data ) {
61 if ( data == 'error' ) {
62 if ( $captcha_v2.next( '#gglcptch_error' ).length == 0 ) {
63 $captcha_v2.after( '<label id="gglcptch_error">' + gglcptch_error_msg + '</label>' );
64 $( "#gglcptch_error" ).fadeOut( 4000, function() {
65 $( "#gglcptch_error" ).remove();
66 });
67 $( 'html, body' ).animate({ scrollTop: $captcha_v2.offset().top - 50 }, 500);
68 }
69 e.preventDefault ? e.preventDefault() : (e.returnValue = false);
70 return false;
71 }
72 },
73 error: function( request, status, error ) {
74 if ( $captcha_v2.next( '#gglcptch_error' ).length == 0 ) {
75 $captcha_v2.after( '<label id="gglcptch_error">' + request.status + ' ' + error + '</label>' );
76 }
77 e.preventDefault ? e.preventDefault() : (e.returnValue = false);
78 return false;
79 }
80 });
81 }
82 });
83 });
84 })(jQuery);