sua nha gia re
/* Some global variables */ window.altum = {}; let global_token = document.querySelector('input[name="global_token"]').value; let site_url = document.querySelector('input[name="global_site_url"]').value; let url = document.querySelector('input[name="global_url"]').value; let decimal_point = document.querySelector('[name="global_number_decimal_point"]').value; let thousands_separator = document.querySelector('[name="global_number_thousands_separator"]').value; /* Background backdrop fix on modal */ let backdrop_filter = null; $('.modal').on('show.bs.modal', function () { backdrop_filter = document.querySelector('body').style.backdropFilter; document.querySelector('body').style.backdropFilter = ''; }); $('.modal').on('hide.bs.modal', function () { document.querySelector('body').style.backdropFilter = backdrop_filter; }); /* Internal tracking for biolink page blocks */ document.querySelectorAll('a[data-track-biolink-block-id]').forEach(element => { element.addEventListener('click', event => { let biolink_block_id = event.currentTarget.getAttribute('data-track-biolink-block-id'); navigator.sendBeacon(`${site_url}l/link?biolink_block_id=${biolink_block_id}&no_redirect`); }); }); /* Fix CSS when using scroll for background attachment on long content */ if(document.body.offsetHeight > window.innerHeight) { let background_attachment = document.querySelector('body').style.backgroundAttachment; if(background_attachment == 'scroll') { document.documentElement.style.height = 'auto'; } } let ads_url = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'; let request_ads_to_display = callback => { let xhr = new XMLHttpRequest(); xhr.onreadystatechange = function () { if (xhr.readyState == XMLHttpRequest.DONE) { callback(xhr.status === 0 || xhr.responseURL !== ads_url); } }; xhr.open('HEAD', ads_url, true); xhr.send(null); } request_ads_to_display(is_blocked => { if(is_blocked) { setTimeout(() => { $('#ad_blocker_detector_modal').modal('show'); }, 0 * 1000); } console.log('ads are blocked: ' + is_blocked); });
x server