1/** 2 * 2007-2022 ETS-Soft 3 * 4 * NOTICE OF LICENSE 5 * 6 * This file is not open source! Each license that you purchased is only available for 1 wesite only. 7 * If you want to use this file on more websites (or projects), you need to purchase additional licenses. 8 * You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party. 9 * 10 * DISCLAIMER 11 * 12 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer 13 * versions in the future. If you wish to customize PrestaShop for your 14 * needs please contact us for extra customization service at an affordable price 15 * 16 * @author ETS-Soft <[email protected]> 17 * @copyright 2007-2022 ETS-Soft 18 * @license Valid for 1 website (or project) for each purchase of license 19 * International Registered Trademark & Property of ETS-Soft 20 */ 21 22if (ets_ct7_recaptcha_enabled!='undefined') { 23 if (!ets_ct7_recaptcha_v3) { 24 25 var recaptchaWidgets = []; 26 var recaptchaCallback = function () { 27 28 var forms = document.getElementsByTagName('form'); 29 var pattern = /(^|\s)g-recaptcha(\s|$)/; 30 for (var i = 0; i < forms.length; i++) { 31 var divs = forms[i].getElementsByTagName('div'); 32 33 for (var j = 0; j < divs.length; j++) { 34 var sitekey = divs[j].getAttribute('data-key'); 35 36 if (divs[j].className && divs[j].className.match(pattern) && sitekey) { 37 var params = { 38 'sitekey': sitekey, 39 'type': divs[j].getAttribute('data-type'), 40 'size': divs[j].getAttribute('data-size'), 41 'theme': divs[j].getAttribute('data-theme'), 42 'badge': divs[j].getAttribute('data-badge'), 43 'tabindex': divs[j].getAttribute('data-tabindex') 44 }; 45 46 var callback = divs[j].getAttribute('data-callback'); 47 48 if (callback && 'function' == typeof window[callback]) { 49 params['callback'] = window[callback]; 50 } 51 52 var expired_callback = divs[j].getAttribute('data-expired-callback'); 53 54 if (expired_callback && 'function' == typeof window[expired_callback]) { 55 params['expired-callback'] = window[expired_callback]; 56 } 57 var widget_id = grecaptcha.render(divs[j], params); 58 recaptchaWidgets.push(widget_id); 59 break; 60 } 61 } 62 } 63 }; 64 $(document).on('wpcf7submit',function(){ 65 for (var i = 0; i < recaptchaWidgets.length; i++) { 66 grecaptcha.reset(recaptchaWidgets[i]); 67 } 68 }); 69 } else { 70//v3. 71 (function ($) { 72 var ct7_re_captcha_v3 = function (form) { 73 if ($('.wpcf7 form:not(.g-loaded)').length <= 0) 74 return; 75 var g_captcha = form.find('.g-recaptcha').eq(0); 76 if (g_captcha.length > 0) { 77 grecaptcha.ready(function () { 78 grecaptcha.execute(ets_ct7_recaptcha_key, {action: 'contact'}).then(function (token) { 79 g_captcha.html('<input type="hidden" class="g-recaptcha-response" name="g-recaptcha-response" value="' + token + '"/>'); 80 if (g_captcha.find('.g-recaptcha-response').length > 0) { 81 form.addClass('g-loaded'); 82 ct7_re_captcha_v3(form); 83 } 84 }); 85 }); 86 } 87 }; 88 $(document).on('wpcf7submit',function(){ 89 ct7_re_captcha_v3($('.wpcf7 form').removeClass('g-loaded')); 90 }); 91 $(document).ready(function () { 92 if (ets_ct7_recaptcha_v3) { 93 ct7_re_captcha_v3($('.wpcf7 form:not(.g-loaded)')); 94 } 95 }); 96 })(jQuery); 97 } 98}
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.