Uncategorized

Q97.1’s Greg and Danny Visit Valley Children’s Hospital

' + '

'; tg_div.querySelector('.close a').onclick = function (e) { e.preventDefault(); document.getElementById("tg-centerpoint").remove(); } var iframe_head = '' + '' + '' + ''; var iframe_body = '
' + '
' + '

Add Our App Now

' + '
  • Tap the ' + ' icon on the bottom of your screen.
  • ' + '
  • Scroll down to "Add to Home Screen".
  • ' + '
  • Tap add to home screen
' + '
arrow
' '
'; var ifrm = document.getElementById('tg-dialog-frame') ifrm.contentWindow.document.open(); ifrm.contentWindow.document.write(iframe_head+iframe_body); ifrm.contentWindow.document.close(); }, needsToSeePrompt: function() { const TIMESTAMP_KEY = 'tgLastSeenPrompt'; const FIRST_TIME_KEY = 'tgFirstVisit'; const DO_PWA_INSTALL_KEY = 'tgReturningVisitor'; // check if need iphone prompt let isApple = ['iPhone', 'iPad', 'iPod'].includes(navigator.platform) && navigator.userAgent.indexOf('CriOS') === -1 && navigator.userAgent.indexOf('Safari') > -1; if (isApple) { let standalone = this.getParameter('utm_source') === 'home_screen'; if (navigator.standalone || standalone) { if (typeof(Storage) !== "undefined") { let tgReturningVisitor = localStorage.getItem(DO_PWA_INSTALL_KEY); if (!tgReturningVisitor) { localStorage.setItem(DO_PWA_INSTALL_KEY, true); sendAnalytics(tg_brand, 'pwa/install', navigator.platform); } } else { console.log('no local storage support'); } } else { // should prompt if (typeof(Storage) !== "undefined") { let now = new Date(); // let fortyEightBefore = new Date(now - 172800000); let fortyEightBefore = new Date(now - 345600000); let secondTime = localStorage.getItem(FIRST_TIME_KEY); let lastPrompt = localStorage.getItem(TIMESTAMP_KEY); if (secondTime && lastPrompt) { let fifteenMinutes = new Date(now - 900000); lastPrompt = new Date(lastPrompt); if (lastPrompt > fifteenMinutes) { return false; } else { localStorage.removeItem(FIRST_TIME_KEY); localStorage.setItem(TIMESTAMP_KEY, now); return true; } } else if (lastPrompt) { lastPrompt = new Date(lastPrompt); if (lastPrompt < fortyEightBefore) { localStorage.setItem(TIMESTAMP_KEY, now); } return (lastPrompt < fortyEightBefore); } else { // first time localStorage.setItem(FIRST_TIME_KEY, "true"); localStorage.setItem(TIMESTAMP_KEY, now); return true; } } } } return false; } } if (tgUtils.needsToSeePrompt()) { tgUtils.writeTGDialogToPage(); } } }); }