PageSourceSearch

https://www.businessonline.it/_file/follow_box.js?v=1

js businessonline.it collected 2026-10-02 04:14:55 UTC 6,552 bytes, 92 lines download raw bytes

1/* Box "Rimani aggiornato con BusinessOnline" costruito dal browser nel segnaposto <div id="follow-box"></div>:
2   niente nell'HTML, niente da indicizzare. Statico (classe is-unstuck: nessuno sticky, nessuna X).
3   Il CSS base (.article-follow-box*) sta in top.asp. Il bottone "Chiedi a Bussola" lo aggiunge anche
4   /_file/bussola_box.js: chi arriva per secondo trova il bottone e non lo duplica.
5   Sorgenti: webcontent-sl/sites/businessonline.it/httpdocs/_file/follow_box.js */
6(function () {
7  var holder = document.getElementById('follow-box');
8  if (!holder || holder.querySelector('.article-follow-box')) return;
9
10  var WEBPUSH_KEY = 'BIRv1vIlWL_pqUXdKYouoFwY_fZSKJn3wPzGaBDQli_LzutOWCJ2s3j-pPR30wKfjMA06vOprR2OmsPaOdFesOQ';
11
12  holder.innerHTML =
13    '<div class="article-follow-box is-unstuck" aria-label="Segui BusinessOnline">' +
14      '<div class="article-follow-box__title">Rimani aggiornato con BusinessOnline</div>' +
15      '<div class="article-follow-box__actions">' +
16        '<a href="https://www.google.com/preferences/source?q=https://www.businessonline.it" class="google-preferred-btn" target="_blank" rel="noopener noreferrer" aria-label="Aggiungi BusinessOnline come fonte preferita su Google" data-follow-ga4="google_preferred_source">' +
17          '<svg class="g-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" aria-hidden="true" focusable="false">' +
18            '<path style="fill:#EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"/>' +
19            '<path style="fill:#4285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"/>' +
20            '<path style="fill:#FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"/>' +
21            '<path style="fill:#34A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.18 1.48-4.97 2.35-8.16 2.35-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"/>' +
22          '</svg>' +
23          '<span class="google-btn-text">Aggiungi come fonte <br> preferita su Google</span>' +
24        '</a>' +
25        '<a class="article-follow-box__link article-follow-box__link--x" href="https://x.com/intent/follow?screen_name=businessonlinei" target="_blank" rel="noopener noreferrer" data-follow-ga4="x_follow">X</a>' +
26        '<a class="article-follow-box__link article-follow-box__link--facebook" href="https://www.facebook.com/BusinessOnLineIT" target="_blank" rel="noopener noreferrer" data-follow-ga4="facebook_page">Facebook</a>' +
27        '<a class="article-follow-box__link article-follow-box__link--instagram" href="https://www.instagram.com/businessonlineit2006" target="_blank" rel="noopener noreferrer" data-follow-ga4="instagram_profile">Instagram</a>' +
28        '<button class="article-follow-box__button article-follow-box__button--push" type="button" data-follow-push data-follow-ga4="webpush_activate">Attiva Push</button>' +
29      '</div>' +
30    '</div>';
31
32  var box = holder.firstChild;
33  var actions = box.querySelector('.article-follow-box__actions');
34  var pushButton = box.querySelector('[data-follow-push]');
35
36  // "Chiedi a Bussola": stesso markup di bussola_box.js, per quando questo script arriva dopo di lui
37  var chat = document.getElementById('chatai-box');
38  if (chat && chat.dataset.art && !actions.querySelector('.article-follow-box__button--bussola')) {
39    var st = document.createElement('style');
40    st.textContent = '.article-follow-box__button--bussola{background:#ff6f3d;color:#fff !important;text-decoration:none;}.article-follow-box__button--bussola:hover{background:#d9532a;color:#fff;}';
41    document.head.appendChild(st);
42    actions.insertAdjacentHTML('beforeend',
43      '<a class="article-follow-box__button article-follow-box__button--bussola" rel="nofollow" data-follow-ga4="bussola_open" href="/bussola.asp?art=' +
44      encodeURIComponent(chat.dataset.art) + '&src=followbox">Chiedi a Bussola</a>');
45  }
46
47  function isMobileViewport() { return window.matchMedia('(max-width: 991.98px)').matches; }
48
49  // Tracking GA4: stessi nomi evento del box hard coded delle news (footer.asp)
50  box.addEventListener('click', function (event) {
51    var el = event.target.closest('[data-follow-ga4]');
52    if (!el) return;
53    var eventName = 'article_follow_' + el.getAttribute('data-follow-ga4') + '_click';
54    var params = {
55      link_url: el.href || undefined,
56      link_text: el.textContent ? el.textContent.replace(/\s+/g, ' ').trim() : undefined,
57      page_location: window.location.href
58    };
59    if (typeof window.gtag === 'function') { window.gtag('event', eventName, params); return; }
60    window.dataLayer = window.dataLayer || [];
61    window.dataLayer.push({ event: eventName, article_follow_url: params.link_url, article_follow_text: params.link_text });
62  });
63
64  // Web push (webpushr) caricato solo al click, come in footer.asp
65  var webpushLoading = false, webpushLoaded = false;
66  function subscribeWebpush() {
67    if (typeof window.webpushr !== 'function') return;
68    try { window.webpushr('subscribe'); }
69    catch (e) { var b = document.getElementById('webpushr-subscription-button'); if (b) b.click(); }
70  }
71  function markPushReady() { pushButton.removeAttribute('disabled'); pushButton.textContent = isMobileViewport() ? 'Attiva ora' : 'Attiva Push'; }
72  function onSdkReady() { webpushLoaded = true; webpushLoading = false; markPushReady(); if (!isMobileViewport()) subscribeWebpush(); }
73  pushButton.addEventListener('click', function () {
74    if (webpushLoaded) { subscribeWebpush(); return; }
75    if (webpushLoading) return;
76    webpushLoading = true;
77    pushButton.setAttribute('disabled', 'disabled');
78    pushButton.textContent = 'Caricamento...';
79    if (typeof window.webpushr === 'undefined') {
80      window.webpushr = function () { (window.webpushr.q = window.webpushr.q || []).push(arguments); };
81    }
82    window.webpushr('setup', { key: WEBPUSH_KEY });
83    if (document.getElementById('webpushr-jssdk')) { onSdkReady(); return; }
84    var s = document.createElement('script');
85    s.id = 'webpushr-jssdk';
86    s.async = true;
87    s.src = 'https://cdn.webpushr.com/app.min.js';
88    s.onload = onSdkReady;
89    s.onerror = function () { webpushLoading = false; pushButton.removeAttribute('disabled'); pushButton.textContent = 'Riprova Push'; };
90    document.getElementsByTagName('script')[0].parentNode.appendChild(s);
91  });
92})();

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.