1 2$(document).ready(function () { 3 4 Twig.extendFunction('i18n', function (name) { 5 for (i18n of i18ns) if (i18n.name == name) return i18n.value; 6 return name; 7 }); 8 9 Twig.extendFilter('json_encode_pretty', function (value) { 10 return JSON.stringify(value, null, 4); 11 }); 12 13}); 14 15function api_query(params) { 16 params.query.method = params.method; 17 $.post({ 18 url: (params.url ? params.url : '') + '/api.php', dataType: 'json', data: JSON.stringify(params.query), 19 success: function (result) { params.onsuccess(result); }, 20 error: function (result) { console.log("api_query_error", result); }, 21 }); 22} 23 24// Send GA4 track_click when elements with data-track-click are clicked. 25document.addEventListener('click', function (event) { 26 var el = event.target.closest('[data-track-click]'); 27 if (!el || typeof gtag !== 'function') 28 return; 29 30 gtag('event', 'track_click', { 31 click_id: el.getAttribute('data-track-click'), 32 link_url: el.getAttribute('href') || '', 33 page_path: location.pathname 34 }); 35}); 36
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.