1/** 2 * @file 3 * Contains the definition of the behaviour recaptcha. 4 */ 5 6(function ($, Drupal) { 7 Drupal.behaviors.recaptcha = { 8 attach: function (context) { 9 $('.g-recaptcha', context).each(function () { 10 if (typeof grecaptcha === 'undefined' || typeof grecaptcha.render !== 'function') { 11 return; 12 } 13 if ($(this).closest('body').length > 0) { 14 if ($(this).hasClass('recaptcha-processed')) { 15 grecaptcha.reset(); 16 } 17 else { 18 grecaptcha.render(this, $(this).data()); 19 $(this).addClass('recaptcha-processed'); 20 } 21 } 22 }); 23 } 24 }; 25 26 window.drupalRecaptchaOnload = function () { 27 $('.g-recaptcha').each(function () { 28 if (!$(this).hasClass('recaptcha-processed')) { 29 grecaptcha.render(this, $(this).data()); 30 $(this).addClass('recaptcha-processed'); 31 } 32 }); 33 }; 34})(jQuery, Drupal);
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.