1/* global $ */ 2 3// docs for rendering hcaptcha widgets: 4// https://docs.hcaptcha.com/configuration/ 5(function(){ 6 'use strict'; 7 8 // Scale hcaptcha widget to fit within the form container. 9 function scaleCaptcha(el) { 10 var hCaptchaWidth = 304; 11 var formWidth = $(el).closest('form').width(); 12 13 if(hCaptchaWidth > formWidth) { 14 var captchaScale = formWidth / hCaptchaWidth; 15 $(el).closest('.h-captcha-wrap').css({ 16 'transform':'scale('+captchaScale+')' 17 }); 18 } 19 } 20 21 function render(id){ 22 var el = document.getElementById(id); 23 var sitekey = el.getAttribute('data-sitekey'); 24 var locale = el.getAttribute('data-locale'); 25 window.hcaptcha.render(el, {sitekey: sitekey, hl: locale}); 26 27 scaleCaptcha(el); 28 } 29 30 function renderQueue() { 31 while(window.formWidgetHcaptchaQueue.length) { 32 render(window.formWidgetHcaptchaQueue.pop()); 33 } 34 } 35 36 window.hcaptchacb = window.hcaptchacb || renderQueue; 37 if(window.hcaptcha) { 38 renderQueue(); 39 } 40 41})();
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.