1(function( $ ) { 2 3 'use strict'; 4 5 $( window ).load( function() { 6 7 // Render the CAPTCHA on "gform_post_render" event (maintains compatibility with AJAX) 8 $( document ).bind( 'gform_post_render', function() { 9 10 // Iterate over each "g-recaptcha" div 11 $( '.g-recaptcha' ).each( function( index, element ) { 12 13 // Ensure field is empty before rendering CAPTCHA 14 if( $( this ).is( ':empty' ) ) { 15 16 // Site key 17 var site_key = $( this ).attr( 'data-sitekey' ); 18 19 // CAPTCHA theme 20 var theme = $( this ).attr( 'data-theme' ); 21 22 // Native DOM element 23 var element = $( this ).get( 0 ); 24 25 // Render CAPTCHA 26 grecaptcha.render( element, { 'sitekey': site_key, 'theme': theme } ); 27 } 28 }); 29 }); 30 31 // Manually render CAPTCHA on window load 32 $( document ).trigger( 'gform_post_render' ); 33 }); 34 35})( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.