1let widgetId; 2 3function onloadFunction() { 4 if (!window.smartCaptcha) { 5 return; 6 } 7 8 widgetId = window.smartCaptcha.render('yandex-captcha-subscribe', { 9 sitekey: 'ysc1_Udt0KgWPlHfnY9j39gf3Xx7ttGlOJnpGvbI9exoMed84d386', 10 invisible: true, // СделаÑÑ ÐºÐ°Ð¿ÑÑ Ð½ÐµÐ²Ð¸Ð´Ð¸Ð¼Ð¾Ð¹ 11 callback: callback, 12 }); 13} 14 15function callback(token) { 16 sendQuery(token); 17} 18 19function sendQuery(token) { 20 var $form = document.getElementById('form_news_subscribes_2'), 21 url = '/local/ajax/news-subscribes/', 22 formData = new URLSearchParams(new FormData($form)).toString(); 23 24 BX.ajax({ 25 url: url, 26 method: 'POST', 27 data: formData, 28 dataType: 'json', 29 onsuccess: function (data) { 30 if (data['status'] === 'success') { 31 BX.onCustomEvent('notice.show', [{title: 'ÐовоÑÑÐ½Ð°Ñ ÑаÑÑÑлка', message: data['message'], timeOut:5000, type: 0}]); 32 } 33 34 if (data['status'] === 'error') { 35 BX.onCustomEvent('notice.show', [{title: 'ÐовоÑÑÐ½Ð°Ñ ÑаÑÑÑлка', message: data.errors.join('\n'), timeOut:5000, type: -1}]); 36 } 37 window.smartCaptcha.reset(widgetId); 38 }, 39 onfailure: function () { 40 console.log("error"); 41 } 42 }); 43} 44 45document.querySelectorAll('.form-subscribe-ajax')?.forEach((subscribe) => { 46 subscribe.addEventListener('submit', (e) => { 47 e.preventDefault(); 48 49 if (window.smartCaptcha) { 50 window.smartCaptcha.execute(widgetId); 51 } else { 52 sendQuery(); 53 } 54 }); 55});
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.