PageSourceSearch

https://vividoptical.com.au/wp-content/cache/min/1/mh1-widget/2023/popup.v1.js?ver=1782693410

js vividoptical.com.au collected 2026-10-08 01:22:26 UTC 10,442 bytes, 32 lines download raw bytes

1(function(){var htmlReset='';var bodyReset='';var w='820px';var GaClientId='',GaCheckCount=1;var hostname=window.location.hostname;var origin='https://www.myhealth1st.com.au';if(hostname.match(/localhost|(^|\.)1stavailable\.com\.au|(^|\.)myhealth1st\.com\.au/ig)){origin=window.location.protocol+'//'+window.location.host}
2var getScrollPosition=function(){return(document.documentElement&&document.documentElement.scrollTop)||document.body.scrollTop}
3let cookieEnabled=(navigator.cookieEnabled)?!0:!1;var createWidget=function(widgetEl,type,treatmentId){var button=widgetEl;var sourceTrackingName=button.getAttribute("data-mh1-source");if(getParameter('mh1-campaign')&&sourceTrackingName){try{sourceTrackingName=sourceTrackingName.split(/\s*/).join('')+'-'+getParameter('mh1-campaign')}catch(e){sourceTrackingName=sourceTrackingName+'-'+getParameter('mh1-campaign')}}else if(sourceTrackingName==undefined){sourceTrackingName='widget'}
4var website=button.getAttribute("website");var popup=document.createElement('div');if(widgetEl.tagName=='LI'){document.body.appendChild(popup);document.getElementsByTagName("body")[0].style.overflow="auto"}else{document.body.appendChild(popup)}
5button.onclick=function(e){var wid_id=this.id;var wid_skin=this.getAttribute('skin');var bnplPartner=this.getAttribute('bnplPartner')
6var model=this.getAttribute('model');if(model=='full-width'){w='100%'}else{w='768px'}
7if(!e)e=window.event;if(e.preventDefault)e.preventDefault();e.returnValue=!1;htmlReset=document.documentElement.style.cssText;bodyReset=document.body.style.cssText;var bg=document.createElement('div');bg.style.position="absolute";bg.style.zIndex="0";bg.style.width="100%";bg.style.height="100%";bg.style.top="0";bg.style.left="0";try{bg.style.backgroundColor="rgba(0,0,0,0.85)"}catch(e){if((navigator.appVersion.indexOf("MSIE 7.")!=-1)||(navigator.appVersion.indexOf("MSIE 8.")!=-1)){bg.style.background="url(#)";bg.style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#CC000000, endColorstr=#CC000000)";if(document.compatMode!='CSS1Compat'){bg.style.position="absolute"}}else{bg.style.backgroundColor="black"}}
8var close=document.createElement('a');close.style.position='relative';close.style.top='0';close.style.right='.5em';close.style.float='right';close.style.fontSize='48px';close.style.zIndex='2';close.style.lineHeight='1';close.style.margin='0';close.style.textDecoration='none';close.style.color='#888';close.style.cursor="pointer";close.innerHTML=' &times; ';var iframeContainer=document.createElement('div');iframeContainer.style.margin='0 auto';iframeContainer.style['-webkit-overflow-scrolling']='touch';iframeContainer.style.width='100%';iframeContainer.style.height='100%';iframeContainer.style.filter='none';iframeContainer.style.border='none';if(window.innerWidth<=768){iframeContainer.style.position='relative';
8iframeContainer.style.height='100%';close.style.right='.2em'}
9var iframe=document.createElement('iframe');iframe.style.boxSizing='border-box';iframe.style.padding='0';iframe.style.margin='0';if(window.innerWidth>768){iframe.style.marginTop='0px'}
10iframe.style.border='none';iframe.style.position='relative';iframe.style.top='-20px';var x=window.matchMedia("(max-width: 700px)")
11iframe.style.left='0';iframe.style.width='100%';iframe.style.height='100%';iframe.setAttribute('width','100%');iframe.setAttribute('height','100%');var mh1WidgetType='pod-widget';var widgetGoogleTagManagerContainerId;if(type==='practice'){try{var xhr=new XMLHttpRequest();var backendOrigin=origin.includes('makatea.myhealth1st.com.au')?'https://testapiv1.myhealth1st.com.au':'https://apiv1.myhealth1st.com.au';var url=`${backendOrigin}/search/podWidget/onloadWidgetType?id=${wid_id}&type=practice`;xhr.open('GET',url,!1);xhr.onload=function(){if(xhr.status==200){var response=JSON.parse(xhr.responseText);if(response&&response.status!=null&&response.status=='OK'||response.status=='ok'){if(response.data.openPodWidget==!1){mh1WidgetType='grails-widget'}
12if(response.data.practiceGtmContainerId!=null&&response.data.practiceGtmContainerId!=""){widgetGoogleTagManagerContainerId=response.data.practiceGtmContainerId}else if((response.data.practiceGtmContainerId==null||response.data.practiceGtmContainerId=="")&&response.data.practiceGroupGtmContainerId!=null&&response.data.practiceGroupGtmContainerId!=""){widgetGoogleTagManagerContainerId=response.data.practiceGroupGtmContainerId}}}}
13xhr.send()}catch(e){console.log(`Exception occurred while calling onloadWidgetType ${e}`)}}else if(type==='practiceGroup'){mh1WidgetType='pod-widget'}
14console.log('mh1WidgetType - '+mh1WidgetType);if(mh1WidgetType==='pod-widget'){close.style.display='none';iframe.style.top='0px'}
15var customerWebsiteEncodedUrl=encodeURIComponent(location.href);var podWidgetUrl=origin+'/appointmentWidget/makatea';var podWidgetQueryParams=type+'_id='+wid_id+(wid_skin?'&skin='+wid_skin:'')+('&theme=popup')+(mh1WidgetType?'&mh1WidgetType='+mh1WidgetType:'')+'&source='+sourceTrackingName+(model?'&model='+model:'')+(treatmentId?'&treatmentId='+treatmentId:'')+(website?'&website='+website:'')+(bnplPartner?'&bnplPartner='+bnplPartner:'')+(GaClientId?'&clientId='+GaClientId:'')+(window.widgetTrackingGaId?'&widgetTrackingGaId='+window.widgetTrackingGaId:'')+('&widgetGoogleTagManagerContainerId='+widgetGoogleTagManagerContainerId)+'&customerWebsiteEncodedUrl='+customerWebsiteEncodedUrl+('&cookies='+(navigator.cookieEnabled?!0:!1));var completeWidgetURL=podWidgetUrl+'?'+podWidgetQueryParams;console.log(`completeWidgetURL ${completeWidgetURL}`)
16iframe.setAttribute('src',completeWidgetURL);iframeContainer.appendChild(iframe);popup.style.display="none";popup.style.position="fixed";popup.style.zIndex="999999";popup.style.textAlign="center";popup.style.top="0";popup.style.left="0";popup.style.width="100%";popup.style.height="100%";popup.setAttribute('id','popup');if((navigator.appVersion.indexOf("MSIE 7.")!=-1)||(navigator.appVersion.indexOf("MSIE 8.")!=-1)||(navigator.appVersion.indexOf("MSIE 9.")!=-1))popup.style.height="100%";popup.appendChild(bg);popup.appendChild(close);popup.appendChild(iframeContainer);popup.getElementsByTagName('a')[0].onclick=function(e){popup.style.display='none';while(popup.lastChild){popup.removeChild(popup.lastChild)}
17document.documentElement.style.cssText=htmlReset;document.body.style.cssText=bodyReset;if(((navigator.appVersion.indexOf("MSIE 7.")!=-1)||(navigator.appVersion.indexOf("MSIE 8.")!=-1))&&(document.compatMode!='CSS1Compat')){document.getElementsByTagName("body")[0].style.overflow="auto";popup.getElementsByTagName('div')[0].style.width='80%'}};popup.getElementsByTagName('iframe')[0].onclick=function(e){if(!e)e=window.event;e.cancelBubble=!0;if(e.stopPropagation)e.stopPropagation()};popup.style.display='block';if(window.innerWidth>1024){document.documentElement.style.cssText='overflow: visible !important; height: 100% !important; max-height: 100% !important;'}else{document.documentElement.style.cssText='overflow: hidden !important; height: 100% !important; max-height: 100% !important;'}
18document.body.style.cssText='overflow: hidden !important; height: 100% !important; max-height: 100% !important;';if(((navigator.appVersion.indexOf("MSIE 7.")!=-1)||(navigator.appVersion.indexOf("MSIE 8.")!=-1))&&(document.compatMode!='CSS1Compat')){document.getElementsByTagName("body")[0].style.overflow="hidden"}
19return!1}}
20var widget_setup=function(){var firstAvailableMenulist=document.getElementById('menu1st');if(firstAvailableMenulist){firstAvailableMenulist.onclick=function(e){if(!e)e=window.event;if(e.preventDefault)e.preventDefault()}}
21var practiceList=document.getElementsByClassName('1stAvailableWidget');for(var i=0;i<practiceList.length;i++){var treatmentDiv=practiceList[i].getElementsByClassName("treatmentId");if(treatmentDiv!=undefined&&treatmentDiv.length>0){for(var j=0;j<treatmentDiv.length;j++){var treatmentId=treatmentDiv[j].id
22createWidget(practiceList[i],'practice',treatmentId)}}else{createWidget(practiceList[i],'practice')}}
23var practitionerList=document.getElementsByClassName('1stAvailableWidget2');for(var i=0;i<practitionerList.length;i++){var treatmentDiv=practitionerList[i].getElementsByClassName("treatmentId");if(treatmentDiv!=undefined&&treatmentDiv.length>0){for(var j=0;j<treatmentDiv.length;j++){var treatmentId=treatmentDiv[j].id
24createWidget(practitionerList[i],'practitioner',treatmentId)}}else{createWidget(practitionerList[i],'practitioner')}}
25var practiceGroupList=document.getElementsByClassName('1stAvailableWidget3');for(var i=0;i<practiceGroupList.length;i++){createWidget(practiceGroupList[i],'practiceGroup')}};function checkIfWidgetTrackingPresent(){var gaFunction=window.ga||window[window.GoogleAnalyticsObject];
25if(gaFunction&&window.widgetTrackingGaId){if(typeof gaFunction!=="undefined"){gaFunction('create',window.widgetTrackingGaId,'auto');gaFunction(function(tracker){GaClientId=tracker.get('clientId');console.log(`GaClientId - ${GaClientId}, GaCheckCount - ${GaCheckCount}`)})}}else if(GaCheckCount<=10){GaCheckCount++;setTimeout(checkIfWidgetTrackingPresent,500)}}
26function getParameter(searchParameter){var search=window.location.search;var patt=new RegExp(searchParameter,"i");var result=patt.exec(search);if(result!=null){var inputParameters=result.input;var source=inputParameters.substr(result.index).split("&")[0];var sourceValue=source.split("=")[1];result=sourceValue}
27return result}
28var onload_old=window.onload;window.addEventListener('load',(event)=>startSetup(event,onload_old));const startSetup=(event,onload_old)=>{if(onload_old){onload_old()}
29widget_setup();window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)};window.ga.l=1*new Date();checkIfWidgetTrackingPresent()}
30window.addEventListener("message",(event)=>{if(event.data&&event.data.sender=="closeIframe"){if(window.istop){alert("main window alert")}else{var popup;var elms=document.querySelectorAll("[id='popup']");for(var i=0;i<elms.length;i++){if(elms[i].style.display=='block'){popup=elms[i]}}
31popup.style.display='none';while(popup.lastChild){popup.removeChild(popup.lastChild)}
32document.body.style.cssText=bodyReset;window.scrollTo(0,parseInt(popup.style.top));if(((navigator.appVersion.indexOf("MSIE 7.")!=-1)||(navigator.appVersion.indexOf("MSIE 8.")!=-1))&&(document.compatMode!='CSS1Compat')){document.getElementsByTagName("body")[0].style.overflow="auto";popup.getElementsByTagName('div')[0].style.width='80%'}}}})})()

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.