- Stories
- May 17, 2019
Zero Emissions Outside, New Bus Smell Inside
Springtime at SJC brought April showers, May flowers, and green buses. San José Mayor Sam Liccardo led the commissioning of our brand-new fleet of 10 battery-electric, zero-emission buses. Passengers shuttling between SJC’s parking lots, rental car center, and terminals have another reason to feel good about choosing Silicon Valley’s airport for this important investment in ebuses which are reducing emissions along their journey.
document.addEventListener('DOMContentLoaded', function () { const acceptButton = document.querySelector('.cm-btn-success')[0]; const declineButton = document.querySelector('.cm-btn-danger')[0]; acceptButton.addEventListener('click', function () { // Handle accept action loadChatbot(); // Load chatbot immediately on accept }); declineButton.addEventListener('click', function () { loadChatbot(); // Load chatbot immediately on decline }); function loadChatbot() { (function (d, m) { var defaultSettings = { "defaultBotIds": ["sjc-oj2ht"], "defaultAssignee": "sjc-oj2ht", "skipRouting": true, }; var kommunicateSettings = { "appId": "115795fb883b8512e78ed54540345f318", "popupWidget": true, "automaticChatOpenOnNavigation": true, "talkToHuman": true, "primaryCTA": "TALK_TO_HUMAN", "onInit": function () { /* Hide Kommunicate branding */ var css = ".mck-running-on {display:none !important;}"; Kommunicate.customizeWidgetCss(css); // Disable input - before widget loads document.addEventListener("DOMContentLoaded", function () { const attempt = setInterval(() => { const iframeDoc = window.KommunicateGlobal?.document; if (!iframeDoc) return; const box = iframeDoc.querySelector(".mck-box-form.mck-row"); if (box) { box.style.pointerEvents = "none"; box.style.opacity = "0.5"; clearInterval(attempt); // stop polling } }, 50); }); // Main logic - Run after widget loaded setTimeout(() => { const kmDoc = window.KommunicateGlobal?.document; if (!kmDoc) return; let consentGiven = false; function disableInput() { const box = kmDoc.querySelector(".mck-box-form.mck-row"); if (box) { box.style.pointerEvents = "none"; box.style.opacity = "0.5"; } } function enableInput() { const box = kmDoc.querySelector(".mck-box-form.mck-row"); if (box) { box.style.pointerEvents = "auto"; box.style.opacity = "1"; } } /* Disable input again (persistent) */ disableInput(); /* Detect clicking the “I Agree” button */ Kommunicate.subscribeToEvents({ onRichMessageButtonClick: function (resp) { if (resp.eventLabel === "I Agree") { consentGiven = true; } } }); /* Keep enforcing the rule even after re-renders */ const observer = new MutationObserver(() => { if (consentGiven) enableInput(); else disableInput(); }); const target = kmDoc.querySelector("#mck-sidebox-content") || kmDoc.body; observer.observe(target, { childList: true, subtree: true }); }, 1200); // widget render delay Kommunicate.updateSettings(defaultSettings); } }; /* Default Kommunicate loader */ kommunicateSettings.restartConversationByUser = true; var s = document.createElement("script"); s.type = "text/javascript"; s.async = true; s.src = "https://widget.kommunicate.io/v2/kommunicate.app"; var h = document.getElementsByTagName("head")[0]; h.appendChild(s); window.kommunicate = m; m._globals = kommunicateSettings; })(document, window.kommunicate || {}); } });