1"use strict"; 2 3qWebshop.recaptcha = (function () 4{ 5 const init = function () 6 { 7 addRecaptchaTagToAllForms(); 8 } 9 10 const addRecaptchaTagToAllForms = function () 11 { 12 if (isRecaptchaEnabled()) { 13 $('form').each(function () 14 { 15 // Skip search form since it sends a GET request 16 if ($(this).hasClass('searchStrip')) 17 return; 18 addRecaptchaTokenToForm(this); 19 }); 20 } 21 } 22 23 const addRecaptchaTokenToForm = function (form) 24 { 25 let recaptchaSiteKey = qWebshop.settings.varRecaptchaSiteKey; 26 grecaptcha.ready(function () 27 { 28 grecaptcha.execute(recaptchaSiteKey, {action: form.id}).then(function (token) 29 { 30 $(form).prepend('<input type="hidden" name="recaptchaToken" value=' + token + '></input>'); 31 }); 32 }); 33 } 34 35 const isRecaptchaEnabled = function () 36 { 37 return qWebshop.settings.varRacaptchaEnabled; 38 } 39 40 return { 41 init: init 42 }; 43 44})();
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.