diff --git a/js/lib/devicedetector-min.js b/js/lib/devicedetector-min.js index 6758edc..cb0288a 100644 --- a/js/lib/devicedetector-min.js +++ b/js/lib/devicedetector-min.js @@ -1 +1 @@ -var deviceDetector=function(){var b=navigator.userAgent.toLowerCase(),a=function(a){void 0!==a&&(b=a.toLowerCase());return/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(b)?"tablet":/(mobi|ipod|phone|blackberry|opera mini|fennec|minimo|symbian|psp|nintendo ds|archos|skyfire|puffin|blazer|bolt|gobrowser|iris|maemo|semc|teashark|uzard)/.test(b)?"phone":"desktop"};return{device:a(),detect:a,isMobile:"desktop"!=a()?!0:!1,userAgent:b}}(); +var deviceDetector=function(){var e=navigator.userAgent.toLowerCase(),o=function(o){var t=o?o.toLowerCase():e;return/(android tv|google tv|smart tv|apple tv|hbbtv|roku|tizen|webos)/.test(t)?"desktop":/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(t)?"tablet":/(mobi|ipod|phone|blackberry|opera mini|fennec|minimo|symbian|psp|nintendo ds|archos|skyfire|puffin|blazer|bolt|gobrowser|iris|maemo|semc|teashark|uzard|kaios)/.test(t)?"mobile":"desktop"},t=o();return{device:t,detect:o,isMobile:"desktop"!==t,userAgent:e}}(); \ No newline at end of file diff --git a/js/timer.js b/js/timer.js index 5a43e78..2047148 100644 --- a/js/timer.js +++ b/js/timer.js @@ -1502,7 +1502,15 @@ window.addEventListener('DOMContentLoaded', () => { document.getElementById('superContainer').style.display = "block"; if (isFirstRun) { - dialogWelcome.showModal(); + if ((deviceDetector.device === 'phone' && isTouchDevice()) || deviceDetector.device !== 'phone') { + dialogWelcome.showModal(); + } + } + + function isTouchDevice() { + return (('ontouchstart' in window) || + (navigator.maxTouchPoints > 0) || + (navigator.msMaxTouchPoints > 0)); } if (window.innerHeight > window.innerWidth * 2 && window.matchMedia("(orientation: portrait)").matches) { diff --git a/js/timer.min.js b/js/timer.min.js index 495020c..156aa17 100644 --- a/js/timer.min.js +++ b/js/timer.min.js @@ -1 +1 @@ -const displayOutput=document.querySelector(".display-remain-time"),externalLinks=document.getElementsByClassName("externalLinks"),btnPause=document.getElementById("pause"),btnRestart=document.getElementById("btnRestart"),btnStop=document.getElementById("btnStop"),btnTimeTable=document.getElementById("btnTimetable"),btnChampion=document.getElementById("btnChampion"),btnBeep=document.getElementById("btnBeep"),btnVibrate=document.getElementById("btnVibrate"),btnClap=document.getElementById("btnClap"),btnDelete=document.getElementById("btnDelete"),btnInvert=document.getElementById("btnInvert"),btnMultiple=document.getElementById("btnMultiple"),btnEmail=document.getElementById("btnEmail"),btnShare=document.getElementById("btnShare"),btnDownload=document.getElementById("btnDownload"),btnYesChallenge=document.getElementById("btnYesChallenge"),btnYesConfirm=document.getElementById("btnYesConfirm"),btnYesChanges=document.getElementById("btnYesChanges"),btnSponsor2Us=document.getElementById("btnSponsor2Us"),btnSave=document.getElementById("btnSave"),btnSaveClap=document.getElementById("btnSaveClap"),btnAbout=document.getElementById("btnAbout"),imgClap=document.getElementById("imgClap"),imgRestart=document.getElementById("imgRestart"),imgTrophy=document.getElementById("imgTrophy"),imgBeep=document.getElementById("imgBeep"),imgCheckBox=document.getElementById("imgCheckBox"),imgMultiple=document.getElementById("imgMultiple"),imgVibrate=document.getElementById("imgVibrate"),dialogTimeTable=document.getElementById("timeTable"),dialogWelcome=document.getElementById("welcomeDialog"),dialogConfirm=document.getElementById("confirmDialog"),dialogChanges=document.getElementById("changesDialog"),dialogCustomTimes=document.getElementById("customTimes"),dialogAbout=document.getElementById("aboutDialog"),dialogClapping=document.getElementById("clappingDialog"),txtSpeaker=document.getElementById("txtSpeaker"),txtCustom=document.getElementById("txtCustom"),txtMin=document.getElementById("txtMin"),txtAvg=document.getElementById("txtAvg"),txtMax=document.getElementById("txtMax"),clapM=document.getElementById("clapM"),clapS=document.getElementById("clapS"),cmbSpeechType=document.getElementById("cmbSpeechType"),remainTime=document.getElementById("remainTime"),divSpeaker=document.getElementById("divSpeaker"),snackbarMsg=document.getElementById("snackbarMsg"),tickAll=document.getElementById("tickAll"),progressBar=document.querySelector(".e-c-progress"),indicator=document.getElementById("e-indicator"),pointer=document.getElementById("e-pointer"),speakers=document.getElementById("speakers"),customMin=document.getElementById("customMin"),customAvg=document.getElementById("customAvg"),customMax=document.getElementById("customMax"),ddLang=document.getElementById("ddLang"),invert100="invert(100%)",invert0="invert(0%)",length=2*Math.PI*100,fastTransition=.2,defGreenBgn="#60ad5e",defYellowBgn="#ffeb3b",defRedBgn="#e53935",defGreenCBBgn="#2196f3",defYellowCBBgn="#ffeb3b",defRedCBBgn="#ad1457";let greenBgnCss="#60ad5e",yellowBgnCss="#ffeb3b",redBgnCss="#e53935";const isInStandaloneMode=()=>"standalone"in window.navigator&&window.navigator.standalone;let intervalTimer,titleMeeting=document.getElementById("titleMeeting"),externalContainer=null,clappingTime=30,wholeTime=30,selected=-1,minimum=0,average=0,maximum=0,selectedColor=isDarkModeEnabled(),green=0,yellow=0,red=0,timeLeft=0,totalCount=0,isPaused=!1,isStarted=!1,isStopped=!0,isBeepEnabled=!1,isVibrateEnabled=!1,isClappingEnabled=!1,isContestMode=!1,isCustom=!1,isFirstRun=!0,clappingStarted=!1,multipleEnabled=!1,isNinjaMode=!1,isTextPreviewMode=!1,isFirstTime=!1,isColorBlindnessEnabled=!1,dateFormat="DD/MM/YYYY",latestDB="1.0",currentDB="1.0",lastColor="white",countries=["US","FM","MH","PH"],times=[[10,20,30],[240,300,360],[300,360,420],[30,45,60],[60,75,90],[120,150,180],[300,330,360],[60,90,120],[480,540,600],[600,660,720],[780,840,900],[1080,1170,1200]];var results=[],browserResult=(new UAParser).getResult();function update(e,t){let n=-length-length*e/t;e>=0&&(progressBar.style.strokeDashoffset=-n,pointer.style.transform=`rotate(${360*e/-t}deg)`)}function setDateFormat(){countries.includes(navigator.language.split("-")[1])&&(dateFormat="MM/DD/YYYY")}function disableLinks(e){Array.from(externalLinks).forEach((t=>{e?t.setAttribute("disabled","disabled"):t.removeAttribute("disabled")}))}function getTimeStamp(e){return moment.utc(1e3*e).format("HH:mm:ss")}function getTime(){return remainTime.innerHTML}function checkMode(){isContestMode?(document.getElementById("remainTime").classList.remove("showTime"),document.getElementById("controls").classList.remove("contestModeOff"),document.getElementById("remainTime").classList.add("hideTime"),document.getElementById("controls").classList.add("contestMode")):(document.getElementById("remainTime").classList.remove("contestMode"),document.getElementById("controls").classList.remove("hideTime"),document.getElementById("remainTime").classList.add("showTime"),document.getElementById("controls").classList.add("contestModeOff"))}function changeWholeTime(e){wholeTime+e>0&&(wholeTime+=e,update(wholeTime,wholeTime))}function setInitialValues(){maximum=30,wholeTime=30,isPaused=!1,isStarted=!1,update(wholeTime,wholeTime),displayTimeLeft(wholeTime)}function updateDisplay(){update(wholeTime,wholeTime),displayTimeLeft(wholeTime)}function basicReset(){resetState(),wholeTime=30,updateDisplay()}function resetState(){isStarted=!1,btnPause.classList.remove("pause"),btnPause.classList.add("play"),clearInterval(intervalTimer),wholeTime=-1,displayTimeLeft(wholeTime),wholeTime=0,displayTimeLeft(wholeTime),lastColor=bgColors[selectedColor],document.body.style.background=lastColor,clappingStarted=!1,setInitialValues(),txtSpeaker.value="",divSpeaker.className="mdl-textfield mdl-js-textfield",btnInvert.disabled=!1,btnRestart.disabled=!1,cmbSpeechType.disabled=!1,disableLinks(!1),isStopped=!0,isPaused=!1,imgRestart.src="img/icons-svg/restart.svg",timeLeft=0,currentState=1,browserChangeFavIcon(""),browserChangeTitle("")}function timer(e){let t=Date.now()+1e3*e;displayTimeLeft(e),intervalTimer=setInterval((()=>{timeLeft=Math.round((t-Date.now())/1e3);let e=maximum-timeLeft;e>=minimum&&e=average&&e=maximum&&(red++,execAction(redBgnCss,"red","max"),document.body.style.background=redBgnCss),e>=maximum+clappingTime&&(clappingStarted||startClapping(),clappingStarted=!0),totalCount++,displayTimeLeft(timeLeft)}),1e3)}function execAction(e,t,n){document.body.style.background=e,startBeep(),startAlert(),startVibrate(),lastColor=t,browserChangeFavIcon(n)}function resizeScreen(){const e=window.innerHeight>1.9*window.innerWidth&&window.innerHeight>900;let t=window.innerHeight/600;if(window.innerWidth<400&&window.innerHeight>=2.333*window.innerWidth){if(t=window.innerWidth/400,null===externalContainer){let e=document.body,t=document.createElement("div");t.id="externalContainer",e.insertBefore(t,e.firstChild)}externalContainer=document.getElementById("externalContainer");let e=document.getElementById("superContainer");externalContainer.append(e),externalContainer.style.height=`${window.innerHeight}px`,e.style.transformOrigin="50% 0% 0px",setTimeout((()=>{e.style.transform=`scale(${t})`,setTimeout((()=>{let n=(1+t)*window.innerHeight;n<514&&(n=514),e.style.height=`${n}px`}),100)}),100)}else if(e){t=window.innerWidth/325;const e=document.getElementById("superContainer");setTimeout((()=>{e.style.height=`${window.innerHeight}px`,e.style.transformOrigin="50% 0% 0px",e.style.transform=`scale(${t})`}),100),setTimeout((()=>{const n=document.getElementById("divSpeaker");n.getBoundingClientRect().width>window.outerWidth&&(e.style.transform=`scale(${t-(t-n.getBoundingClientRect().width/window.outerWidth)})`),document.getElementById("innerPlayContainer").style.setProperty("top","27%","important"),document.querySelector("#playControl").style.top="-30px"}),100)}else if(window.innerHeight<514){if(null===externalContainer){let e=document.body,t=document.createElement("div");t.id="externalContainer",e.insertBefore(t,e.firstChild)}externalContainer=document.getElementById("externalContainer");let e=document.getElementById("superContainer");externalContainer.append(e),externalContainer.style.height=`${window.innerHeight}px`,e.style.transformOrigin="50% 0% 0px",setTimeout((()=>{e.style.transform=`scale(${t})`,setTimeout((()=>{let n=(1+t)*window.innerHeight;n<514&&(n=514),e.style.height=`${n}px`}),100)}),100)}else{let e=document.getElementById("superContainer");e.style.height=`${window.innerHeight}px`,e.style.transformOrigin="50% 0% 0px",setTimeout((()=>{e.style.transform=`scale(${t})`}),100),setTimeout((()=>{cmbSpeechType.getBoundingClientRect().width>window.outerWidth&&(e.style.transform=`scale(${t-(t-cmbSpeechType.getBoundingClientRect().width/window.outerWidth)})`)}),100)}}function resizeSelect(){setTimeout((()=>{try{document.getElementsByClassName("mdl-menu__outline")[0].style.width="300px",document.getElementsByClassName("mdl-menu__container")[0].style.width="300px",document.getElementsByClassName("mdl-menu__outline")[0].style.height="310px",document.getElementsByClassName("mdl-menu__container")[0].style.height="310px";let e=document.getElementsByClassName("mdl-menu")[0],t=e.style.clip.split(", ");if(t.length>1){t[1]=t[1].replace("px",""),t[2]=t[2].replace("px","");let n=1;"Edge"===browserResult.browser.name&&parseFloat(browserResult.browser.version)<19&&(n=2),e.style.clip=`${t[0]}, ${300*n}px, ${300*n}px, ${t[3]}`}}catch(e){}}),50)}function pauseTimer(){0===minimum&&0===maximum&&0===average||-1===selected?isCustom?showSnackbar(lngObject.notSaved):showSnackbar(lngObject.chooseTime):(validateProperIntervals(),browserStopClapping(),isStopped=!1,btnInvert.disabled=!0,cmbSpeechType.disabled=!0,isStarted&&void 0!==timeLeft?isPaused?(activateWakeLock(),disableLinks(!0),btnPause.disabled=!0,btnPause.classList.remove("play"),btnPause.classList.add("pause"),setTimeout((()=>{btnPause.disabled=!1}),500),timer(timeLeft),isPaused=!isPaused):(deactivateWakeLock(),disableLinks(!1),btnPause.classList.remove("pause"),btnPause.classList.add("play"),clearInterval(intervalTimer),isPaused=!isPaused):(activateWakeLock(),disableLinks(!0),timer(wholeTime),isStarted=!0,btnPause.disabled=!0,btnPause.classList.remove("play"),btnPause.classList.add("pause"),setTimeout((()=>{btnPause.disabled=!1}),500)),btnRestart.disabled=!isPaused,btnRestart.disabled?(imgRestart.src="img/icons-svg/restart-off.svg",fade.to(document.getElementById("divSpeechType"),fastTransition,.1),fade.to(document.getElementById("divSpeaker"),fastTransition,.1),fade.to(document.getElementById("options"),fastTransition,.1),fade.to(document.getElementsByTagName("footer")[0],fastTransition,.1),isNinjaMode?(fade.to(document.getElementById("controls"),fastTransition,.5),fade.to(document.getElementsByClassName("circle")[0],fastTransition,0),fade.to(document.getElementById("bmc-wbtn"),fastTransition,0)):fade.to(document.getElementById("bmc-wbtn"),fastTransition,.1),document.getElementById("bmc-wbtn").style.pointerEvents="none"):(imgRestart.src="img/icons-svg/restart.svg",unfadeElements()))}function unfadeElements(){fade.to(document.getElementById("divSpeechType"),fastTransition,1.5),fade.to(document.getElementById("divSpeaker"),fastTransition,1.5),fade.to(document.getElementById("options"),fastTransition,1.5),fade.to(document.getElementsByTagName("footer")[0],fastTransition,1.5),fade.to(document.getElementById("controls"),fastTransition,1.5),fade.to(document.getElementsByClassName("circle")[0],fastTransition,1.5),fade.to(document.getElementById("bmc-wbtn"),fastTransition,1.5),document.getElementById("bmc-wbtn").style.pointerEvents=""}function displayTimeLeft(e){let t=maximum-e,n=Math.floor(t/3600),i=Math.floor(t/60),o=t%60,l=`${n<10?"0":""}${n}:${i<10?"0":""}${i}:${o<10?"0":""}${o}`;displayOutput.textContent=l,!isContestMode&&isStarted&&browserChangeTitle(l),update(e,wholeTime)}function setDropDownValue(e,t){try{document.getElementById(e).dataset.selected="true",getmdlSelect.init(t)}catch(e){}}function validateProperIntervals(){isCustom?(minimum=getMinCustom(),average=getAvgCustom(),maximum=getMaxCustom()):setBasicIntervals(),0===timeLeft&&(wholeTime=maximum)}function setBasicIntervals(){minimum=times[selected][0],average=times[selected][1],maximum=times[selected][2]}function changeEventHandler(){let e=99===selected;if(selected=parseInt(hiddenSpeechType.value),99!==selected)setBasicIntervals(),wholeTime=maximum,setLocalStorage("wholeTime",maximum),updateDisplay(),isCustom=!1;else{if(e){if(e&&!isFirstTime){setCustomText();let e=Math.floor(minimum/3600),t=Math.floor(minimum/60),n=minimum%60;txtMin.parentElement.MaterialTextfield.change(getDisplayString(e,t,n)),e=Math.floor(average/3600),t=Math.floor(average/60),n=average%60,txtAvg.parentElement.MaterialTextfield.change(getDisplayString(e,t,n)),e=Math.floor(maximum/3600),t=Math.floor(maximum/60),n=maximum%60,txtMax.parentElement.MaterialTextfield.change(getDisplayString(e,t,n))}}else minimum=0,maximum=0,average=0,txtCustom.parentElement.MaterialTextfield.change(lngObject.opt12);"phone"===deviceDetector.device&&setTimeout((()=>{let e=document.getElementById("bodyCustomTimes");e.style.height=100*e.clientHeight/window.innerHeight+"%"}),100),hasCustomChange=!1,isCustom=!0,dialogCustomTimes.showModal()}}function startBeep(){!isBeepEnabled||1!==green&&1!==yellow&&1!==red||browserStartBeep()}function startAlert(){if(isTextPreviewMode&&(1===green||1===yellow||1===red))switch(lastColor){case"green":showSnackbar(lngObject.color2,3500);break;case"yellow":showSnackbar(lngObject.color3,3500);break;default:showSnackbar(lngObject.color1,3500)}}function startVibrate(){!isVibrateEnabled||1!==green&&1!==yellow&&1!==red||browserStartVibrate()}function startClapping(){isClappingEnabled&&browserStartClapping()}function stopClapping(){browserStopClapping()}function getVibrate(){getLocalStorageValue("isVibrateEnabled")?isVibrateEnabled="true"===getLocalStorageValue("isVibrateEnabled"):setVibrate()}function getClapping(){getLocalStorageValue("isClappingEnabled")?isClappingEnabled="true"===getLocalStorageValue("isClappingEnabled"):setClapping()}function getBeep(){getLocalStorageValue("isBeepEnabled")?isBeepEnabled="true"===getLocalStorageValue("isBeepEnabled"):setBeep()}function getContestMode(){getLocalStorageValue("isContestMode")?isContestMode="true"===getLocalStorageValue("isContestMode"):setContestMode()}function getFirstRun(){getLocalStorageValue("isFirstRun")?isFirstRun="true"===getLocalStorageValue("isFirstRun"):setFirstRun()}function getNinjaMode(){getLocalStorageValue("isNinjaMode")?isNinjaMode="true"===getLocalStorageValue("isNinjaMode"):setLocalStorage("isNinjaMode",!1)}function getColorBlindnessMode(){getLocalStorageValue("isColorBlindnessEnabled")?isColorBlindnessEnabled="true"===getLocalStorageValue("isColorBlindnessEnabled"):setLocalStorage("isColorBlindnessEnabled",!1)}function switchBgnColors(){greenBgnCss=isColorBlindnessEnabled?"#2196f3":"#60ad5e",yellowBgnCss="#ffeb3b",redBgnCss=isColorBlindnessEnabled?"#ad1457":"#e53935"}function setRowColors(){document.getElementById("bgnGreen").style.backgroundColor=greenBgnCss,document.getElementById("bgnYellow").style.backgroundColor=yellowBgnCss,document.getElementById("bgnRed").style.backgroundColor=redBgnCss}function getTextPreviewMode(){getLocalStorageValue("isTextPreviewMode")?isTextPreviewMode="true"===getLocalStorageValue("isTextPreviewMode"):setLocalStorage("isTextPreviewMode",!1)}function getSelectedColor(){getLocalStorageValue("selectedColor")?selectedColor=parseInt(getLocalStorageValue("selectedColor")):setSelectedColor()}function setBeep(){setLocalStorage("isBeepEnabled",isBeepEnabled)}function setVibrate(){setLocalStorage("isVibrateEnabled",isVibrateEnabled)}function setClapping(){setLocalStorage("isClappingEnabled",isClappingEnabled)}function setContestMode(){setLocalStorage("isContestMode",isContestMode)}function setSelectedColor(){setLocalStorage("selectedColor",selectedColor)}function setFirstRun(){setLocalStorage("isFirstRun",isFirstRun)}function setContestImg(){imgTrophy.src=isContestMode?"img/icons-svg/trophy.svg":"img/icons-svg/trophy-broken.svg"}function setVibrateImg(){imgVibrate.src=isVibrateEnabled?"img/icons-svg/vibrate.svg":"img/icons-svg/vibrate-off.svg"}function setBeepImg(){imgBeep.src=isBeepEnabled?"img/icons-svg/volume-high.svg":"img/icons-svg/volume-off.svg"}function setClappingImg(){imgClap.src=isClappingEnabled?"img/icons-svg/clapping-hands.svg":"img/icons-svg/clapping-off.svg"}function invertColors(){let e="";1===selectedColor?(e=invert100,setInvFilter(dialogTimeTable,invert100),setInvFilter(dialogWelcome,invert100),setInvFilter(dialogConfirm,invert100),setInvFilter(dialogChanges,invert100),setInvFilter(dialogCustomTimes,invert100),setInvFilter(dialogClapping,invert100),setInvFilter(customMin,invert100),setInvFilter(customAvg,invert100),setInvFilter(customMax,invert100),setInvFilter(speakers,invert100),setInvFilter(dialogAbout,invert100),setInvFilter(document.body,invert100),setBgd(dialogWelcome,bgColors[2]),setBgd(dialogConfirm,bgColors[2]),setBgd(dialogChanges,bgColors[2]),setBgd(dialogCustomTimes,bgColors[2]),setBgd(dialogTimeTable,bgColors[2]),setBgd(dialogClapping,bgColors[2])):(e=invert0,setInvFilter(dialogTimeTable,invert0),setInvFilter(dialogWelcome,invert0),setInvFilter(dialogConfirm,invert0),setInvFilter(dialogChanges,invert0),setInvFilter(dialogCustomTimes,invert0),setInvFilter(dialogClapping,invert0),setInvFilter(customMin,invert0),setInvFilter(customAvg,invert0),setInvFilter(customMax,invert0),setInvFilter(speakers,invert0),setInvFilter(dialogAbout,invert0),setInvFilter(document.body,invert0),setBgd(dialogWelcome,bgColors[0]),setBgd(dialogConfirm,bgColors[0]),setBgd(dialogChanges,bgColors[0]),setBgd(dialogCustomTimes,bgColors[0]),setBgd(dialogTimeTable,bgColors[0]),setBgd(dialogClapping,bgColors[0])),[].forEach.call(document.getElementsByClassName("noInvert"),(t=>{setInvFilter(t,e)})),setBgd(document.body,lastColor)}function storeTime(e){if((0!==minimum||0!==maximum||0!==average)&&0!==totalCount){if(deactivateWakeLock(),stopClapping(),e){let e=maximum-timeLeft,t=cmbSpeechType.value;99===selected&&(t=txtCustom.value),addNewTime(txtSpeaker.value,t,getTimeStamp(minimum),getTimeStamp(average),getTimeStamp(maximum),getTimeStamp(e),lastColor,e>maximum+clappingTime||e0||getAvgCustom()>0||getMaxCustom()>0)&&hasCustomChange?dialogChanges.showModal():dialogCustomTimes.close()}function saveChanges(){let e=getMinCustom(),t=getAvgCustom(),n=getMaxCustom();e>=t?showSnackbar(lngObject.errorMin):e>=n?showSnackbar(lngObject.errorHalf):t>=n?showSnackbar(lngObject.errorMax):(minimum=e,average=t,maximum=n,wholeTime=maximum,updateDisplay(),dialogCustomTimes.close())}function insertIAd(){const e=document.createElement("script");e.async=!0,e.setAttribute("data-cfasync","false"),e.src="//thubanoa.com/1?z=7667293",document.body.appendChild(e)}function hideKeyboard(e){e.readOnly=!0,setTimeout((()=>{e.blur(),e.readOnly=!1}),100)}function doOnOrientationChange(){location.reload()}progressBar.style.strokeDasharray=length,update(wholeTime,wholeTime),displayTimeLeft(wholeTime),checkMode(),setInitialValues(),("Android"!==os||navigator.userAgent.match(/SAMSUNG|SGH-[I|N|T]|GT-[I|P|N]|SM-[N|P|T|Z|G]|SHV-E|SCH-[I|J|R|S]|SPH-L/i))&&(window.onresize=()=>{resizeScreen()}),btnPause.addEventListener("click",(e=>{1===e.detail&&pauseTimer()})),btnRestart.addEventListener("click",(()=>{storeTime(!1)})),btnStop.addEventListener("click",(()=>{storeTime(!0)})),btnChampion.addEventListener("click",(e=>{3===e.detail?(isNinjaMode=!isNinjaMode,isNinjaMode?showSnackbar(lngObject.ninjaEnabled,!1):showSnackbar(lngObject.ninjaDisabled,!1),setLocalStorage("isNinjaMode",isNinjaMode)):(isContestMode=!isContestMode,isContestMode?browserChangeTitle(""):browserChangeTitle(displayOutput.textContent),setContestImg(),checkMode(),setContestMode())})),btnVibrate.addEventListener("click",(()=>{isVibrateEnabled=!isVibrateEnabled,setVibrateImg(),setVibrate()})),btnBeep.addEventListener("click",(e=>{3===e.detail&&(isTextPreviewMode=!isTextPreviewMode,isTextPreviewMode?showSnackbar(lngObject.colorMsg,1500):showSnackbar(lngObject.colorMsgDis,1500),setLocalStorage("isTextPreviewMode",isTextPreviewMode)),isBeepEnabled=!isBeepEnabled,setBeepImg(),setBeep()})),btnClap.addEventListener("click",(e=>{3===e.detail?(dialogClapping.showModal(),30===clappingTime&&(setDropDownValue("clapM0","#divClapM"),setDropDownValue("clapS30","#divClapS"))):(isClappingEnabled=!isClappingEnabled,setClappingImg(),setClapping())})),btnSave.addEventListener("click",saveChanges),btnSaveClap.addEventListener("click",(()=>{clappingTime=getSeconds(`00:${clapM.value}:${clapS.value}`),dialogClapping.close()})),dialogTimeTable.showModal||dialogPolyfill.registerDialog(dialogTimeTable),dialogChanges.showModal||dialogPolyfill.registerDialog(dialogChanges),dialogAbout.showModal||dialogPolyfill.registerDialog(dialogAbout),dialogClapping.showModal||dialogPolyfill.registerDialog(dialogClapping),dialogCustomTimes.showModal||dialogPolyfill.registerDialog(dialogCustomTimes),dialogWelcome.showModal||dialogPolyfill.registerDialog(dialogWelcome),dialogConfirm.showModal||dialogPolyfill.registerDialog(dialogConfirm),btnTimeTable.addEventListener("click",countTimetable),btnDelete.addEventListener("click",deleteTimetable),btnYesChallenge.addEventListener("click",(()=>{isContestMode=!0,setContestImg(),checkMode(),setContestMode(),dialogWelcome.close(),isFirstRun=!1,setFirstRun()})),btnYesConfirm.addEventListener("click",deleteByIDs),btnInvert.addEventListener("click",(e=>{3===e.detail&&(isColorBlindnessEnabled=!isColorBlindnessEnabled,isColorBlindnessEnabled?showSnackbar(lngObject.cbEnabled,!1):showSnackbar(lngObject.cbDisabled,!1),setLocalStorage("isColorBlindnessEnabled",isColorBlindnessEnabled),switchBgnColors()),selectedColor=selectedColor=0===selectedColor?1:0,lastColor=bgColors[selectedColor],setSelectedColor(),invertColors(),timeDialogInvert(selectedColor)})),btnYesChanges.addEventListener("click",(()=>{saveChanges(),dialogChanges.close()})),btnSponsor2Us.addEventListener("click",(()=>{window.open("https://github.com/sponsors/FANMixco")})),btnShare.addEventListener("click",(async()=>{const e='style="display: none!important;"',t=""+document.getElementById("tblResults").outerHTML.replace(/id="thDel"/g,`id="thDel" ${e}`).replace(/class="tdDel/g,`${e} class="tdDel`).replace(/filter: invert\(100%\);/g,"").replace(/filter:invert\(100%\);/g,""),n=document.getElementById("titleMeeting").outerHTML+t+'

Exported by Toastmasters Timer. Created by Federico Navarrete.

';try{await navigator.share({title:document.getElementById("titleMeeting").innerHTML,text:"Check out the meeting timing results. Exported by Toastmasters Timer. Created by Federico Navarrete, https://federiconavarrete.com",files:[new File([n],`${document.getElementById("titleMeeting").innerHTML.replace(/ /g,"_").replace(/\//g,"_")}.html`,{type:"text/html"})]}),insertIAd()}catch(e){console.error("Error sharing:",e)}})),btnEmail.addEventListener("click",(()=>{})),btnAbout.addEventListener("click",(()=>{dialogAbout.showModal(),"phone"===deviceDetector.device&&setTimeout((()=>{dialogAbout.style.height=100*dialogAbout.innerHeight/window.outerHeight+"%"}),100)})),txtMin.addEventListener("click",(()=>{setNewTime("txtMin",txtMin.value)})),txtMax.addEventListener("click",(()=>{setNewTime("txtMax",txtMax.value)})),txtAvg.addEventListener("click",(()=>{setNewTime("txtAvg",txtAvg.value)})),btnDownload.addEventListener("click",browserExport),btnMultiple.addEventListener("click",(()=>{Array.from(document.getElementsByClassName("mdl-js-checkbox")).forEach((e=>{let t=e;setTimeout((()=>{t.MaterialCheckbox.check()}),10)})),multipleEnabled?(imgMultiple.src="img/icons-svg/checkbox-outline.svg",hideCheckBoxes()):(imgMultiple.src="img/icons-svg/checkbox-blank-outline.svg",showCheckBoxes()),multipleEnabled=!multipleEnabled,refreshControls()})),dialogTimeTable.querySelector(".close").addEventListener("click",(()=>{dialogTimeTable.close()})),dialogCustomTimes.querySelector(".close").addEventListener("click",closeCustomDialog),dialogConfirm.querySelector(".close").addEventListener("click",(()=>{dialogConfirm.close()})),dialogAbout.querySelector(".close").addEventListener("click",(()=>{dialogAbout.close()})),dialogChanges.querySelector(".close").addEventListener("click",(()=>{dialogChanges.close(),dialogCustomTimes.close()})),dialogWelcome.querySelector(".close").addEventListener("click",(()=>{dialogWelcome.close(),isFirstRun=!1,setFirstRun(),showSnackbar(lngObject.noHints)})),txtCustom.addEventListener("keyup",(e=>{"Enter"===e.key&&hideKeyboard(txtCustom)})),"Android"===os&&(txtSpeaker.addEventListener("onfocus",(()=>{let e=document.getElementById("playControl").getBoundingClientRect().y;document.body.marginTop=`-${e}px`})),txtSpeaker.addEventListener("onblur",(()=>{document.body.marginTop="0px"}))),txtSpeaker.addEventListener("keyup",(e=>{"Enter"===e.key&&hideKeyboard(txtSpeaker)})),document.addEventListener("DOMContentLoaded",(()=>{cmbSpeechType.onchange=changeEventHandler}),!1),cmbSpeechType.addEventListener("click",resizeSelect),maximum=0,wholeTime=0,getBeep(),getVibrate(),getClapping(),getContestMode(),getSelectedColor(),getNinjaMode(),getColorBlindnessMode(),switchBgnColors(),getTextPreviewMode(),getFirstRun(),setRowColors(),setContestImg(),setVibrateImg(),setBeepImg(),setClappingImg(),setSelectedColor(),setDateFormat(),initializeDB(currentDB,latestDB),lastColor=bgColors[selectedColor],invertColors(),setTimeout((()=>{let e=document.getElementById("bodyAbout"),t=document.getElementById("bodyTranslators"),n=document.getElementById("bodyHelp");if("phone"==deviceDetector.device){let i=document.getElementById("timeTable"),o=document.createElement("div");o.className="titleContainer";let l=document.createElement("div");l.className="titleInnerContainer";let a=document.createElement("span");a.className="closeMobile",a.id="btnCloseMobileSpan";let s=document.createElement("img");s.className="btnCloseMobile",s.src="img/icons-svg/close.svg",s.alt="close";let d=document.createElement("span");d.id="spanTitle",a.appendChild(s),l.appendChild(a),l.appendChild(d),o.appendChild(l),i.insertBefore(o,i.firstChild),titleMeeting=document.getElementById("titleMeeting"),titleMeeting.classList.remove("mdl-dialog__title"),titleMeeting.style.margin="0",titleMeeting.style.marginTop="16px",titleMeeting.style.fontWeight=1e3,titleMeeting.style.fontSize="1.25em",titleMeeting.style.display="inline",document.getElementById("spanTitle").append(titleMeeting),document.getElementById("btnCloseMeeting").style.display="none",document.getElementById("btnCloseMobileSpan").addEventListener("click",(()=>{dialogTimeTable.close()}));let r=document.getElementById("customTimes"),m=document.createElement("div");m.className="titleContainer";let c=document.createElement("div");c.className="titleInnerContainer";let g=document.createElement("span");g.className="closeMobile",g.id="btnCloseMobileCustom";let u=document.createElement("img");u.className="btnCloseMobile",u.src="img/icons-svg/close.svg",u.alt="close";let p=document.createElement("span");p.id="spanTitleCustom";let b=document.createElement("h4");b.innerHTML=" ",b.id="customTitle";let y=document.createElement("span");y.id="spanSave",y.className="btnRight",g.appendChild(u),p.appendChild(b),c.appendChild(g),c.appendChild(p),c.appendChild(y),m.appendChild(c),r.insertBefore(m,r.firstChild);let C=document.getElementById("customTitle");C.classList.remove("mdl-dialog__title"),C.style.margin="0",C.style.marginTop="16px",C.style.fontWeight=1e3,C.style.fontSize="1.25em",C.style.display="inline",document.getElementById("btnCloseMobileCustom").addEventListener("click",(()=>{closeCustomDialog()})),document.getElementById("spanSave").appendChild(document.getElementById("btnSave")),document.getElementById("footerCustom").style.display="none",document.getElementById("btnCloseCustom").style.display="none";let h=document.getElementById("aboutDialog"),v=document.createElement("div");v.className="titleContainer";let E=document.createElement("div");E.className="titleInnerContainer";let f=document.createElement("span");f.className="closeMobile",f.id="btnCloseMobileAbout";let T=document.createElement("img");T.className="btnCloseMobile",T.src="img/icons-svg/close.svg",T.alt="close";let B=document.createElement("span");B.id="spanTitleAbout";let w=document.createElement("h4");w.innerHTML=" ",w.id="aboutTitle",w.style.margin="0",w.style.marginTop="16px",w.style.fontWeight=1e3,w.style.fontSize="1.25em",w.style.display="inline",f.appendChild(T),B.appendChild(w),E.appendChild(f),E.appendChild(B),v.appendChild(E),h.insertBefore(v,h.firstChild);let I=document.createElement("span");I.id="spanFiveStars",I.className="btnRight",E.appendChild(I),document.getElementById("spanFiveStars").appendChild(document.getElementById("btnSponsor2Us")),document.getElementById("btnCloseMobileAbout").addEventListener("click",(()=>{dialogAbout.close()})),document.getElementById("divCloseAbout").style.display="none",e.style.height=.79*document.body.offsetHeight+"px",t.style.height=.79*document.body.offsetHeight+"px",n.style.height=.79*document.body.offsetHeight+"px"}else{let i=document.body;"function"!=typeof HTMLDialogElement?(e.style.height=.8*i.offsetHeight+"px",t.style.height=.8*i.offsetHeight+"px",n.style.height=.8*i.offsetHeight+"px"):(e.style.height=.4*i.offsetHeight+"px",t.style.height=.4*i.offsetHeight+"px",n.style.height=.4*i.offsetHeight+"px")}let i=0;do{setTimeout((()=>{try{titleMeeting.innerHTML=`${lngObject.meetingAt} ${moment().format(dateFormat)}`}catch(e){}}),1e3),i++}while(void 0===lngObject&&i<5)}),100),checkMode(),tickAll.addEventListener("change",(()=>{Array.from(document.querySelectorAll(".mdl-js-checkbox:not(#lblTickAll)")).forEach((e=>{let t=e;setTimeout((()=>{lblTickAll.matches(".is-checked")?t.MaterialCheckbox.check():t.MaterialCheckbox.uncheck()}),10)})),refreshControls()})),(()=>{if(btnEmail.style.display="none","iOS"===os&&(btnVibrate.style.display="none"),isFirstTime=!0,"desktop"===deviceDetector.device){try{let e=-1!=navigator.userAgent.indexOf("Firefox"),t=/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString();(e||t)&&(dialogTimeTable.classList.add("centeredDialog"),dialogAbout.classList.add("centeredDialog"))}catch{}dialogTimeTable.classList.add("fullscreen-dialog-tablet"),dialogAbout.classList.add("fullscreen-dialog-desktop"),document.getElementById("divSpeakers").style.height=.53*document.body.clientHeight+"px"}else"tablet"===deviceDetector.device?(dialogTimeTable.classList.add("centeredDialog-tablet"),dialogTimeTable.classList.add("fullscreen-dialog-tablet"),dialogAbout.classList.add("centeredDialog"),dialogAbout.classList.add("fullscreen-dialog-tablet"),document.getElementById("divSpeakers").style.height=.53*document.body.clientHeight+"px"):(dialogCustomTimes.classList.add("customBodyMobile"),window.innerHeight<514&&window.innerWidth>window.innerHeight?document.getElementById("divSpeakers").style.height=.6*document.body.clientHeight+"px":document.getElementById("divSpeakers").style.height=.75*document.body.clientHeight+"px",dialogTimeTable.classList.add("fullscreen-dialog"),dialogCustomTimes.classList.add("fullscreen-dialog"),dialogAbout.classList.add("fullscreen-dialog"));"function"!=typeof HTMLDialogElement&&(dialogWelcome.classList.remove("centeredDialog"),dialogWelcome.classList.add("centeredDialogNoSupport"),dialogSetTime.classList.remove("centeredDialog"),dialogSetTime.classList.add("centeredDialogNoSupport"),dialogTimeTable.classList.remove("centeredDialog"),dialogTimeTable.classList.add("centeredDialogNoSupport"),dialogAbout.classList.remove("centeredDialog"),dialogAbout.classList.add("centeredDialogNoSupport"),dialogAbout.classList.add("fullscreen-dialog")),window.addEventListener("focus",(()=>{try{let e=document.querySelector(".mdl-menu__outline");e&&"-1"!==e.style.zIndex&&resizeSelect()}catch(e){}})),"2345Explorer"!==browserResult.browser.name&&"IE"!==browserResult.browser.name&&"IEMobile"!==browserResult.browser.name||alert("Unsupported Browser. Please download a modern browser like Chrome or Firefox"),setTimeout((()=>{"iOS"!==os||isInStandaloneMode()||showSnackbar(lngObject.installiOS,3e3);try{lngObject.copyright3&&(document.getElementById("spanCopyright3").innerHTML=`. ${lngObject.copyright3}`)}catch{}timeDialogInvert(selectedColor)}),1e3)})(),window.addEventListener("orientationchange",doOnOrientationChange),document.addEventListener("keydown",(e=>{!e.ctrlKey||"p"!==e.key&&"P"!==e.key||pauseTimer()})),document.addEventListener("keydown",(e=>{!e.ctrlKey||"s"!==e.key&&"S"!==e.key||btnStop.click()})),document.addEventListener("keydown",(e=>{!e.ctrlKey||"r"!==e.key&&"R"!==e.key||btnRestart.click()})),window.addEventListener("DOMContentLoaded",(()=>{document.getElementById("loading-container").style.display="none",document.getElementById("superContainer").style.display="block",isFirstRun&&dialogWelcome.showModal(),window.innerHeight>2*window.innerWidth&&window.matchMedia("(orientation: portrait)").matches&&document.querySelector("#innerPlayContainer").classList.add("longPhonePortrait"),document.body.style.maxHeight=`${window.innerHeight}px`,ddLang.value=getLocalStorageValue("currentLang"),resizeScreen()})),ddLang.onchange=e=>{confirm(lngObject.rWarning)&&(setLocalStorage("currentLang",e.target.value),location.reload())}; \ No newline at end of file +const displayOutput=document.querySelector(".display-remain-time"),externalLinks=document.getElementsByClassName("externalLinks"),btnPause=document.getElementById("pause"),btnRestart=document.getElementById("btnRestart"),btnStop=document.getElementById("btnStop"),btnTimeTable=document.getElementById("btnTimetable"),btnChampion=document.getElementById("btnChampion"),btnBeep=document.getElementById("btnBeep"),btnVibrate=document.getElementById("btnVibrate"),btnClap=document.getElementById("btnClap"),btnDelete=document.getElementById("btnDelete"),btnInvert=document.getElementById("btnInvert"),btnMultiple=document.getElementById("btnMultiple"),btnEmail=document.getElementById("btnEmail"),btnShare=document.getElementById("btnShare"),btnDownload=document.getElementById("btnDownload"),btnYesChallenge=document.getElementById("btnYesChallenge"),btnYesConfirm=document.getElementById("btnYesConfirm"),btnYesChanges=document.getElementById("btnYesChanges"),btnSponsor2Us=document.getElementById("btnSponsor2Us"),btnSave=document.getElementById("btnSave"),btnSaveClap=document.getElementById("btnSaveClap"),btnAbout=document.getElementById("btnAbout"),imgClap=document.getElementById("imgClap"),imgRestart=document.getElementById("imgRestart"),imgTrophy=document.getElementById("imgTrophy"),imgBeep=document.getElementById("imgBeep"),imgCheckBox=document.getElementById("imgCheckBox"),imgMultiple=document.getElementById("imgMultiple"),imgVibrate=document.getElementById("imgVibrate"),dialogTimeTable=document.getElementById("timeTable"),dialogWelcome=document.getElementById("welcomeDialog"),dialogConfirm=document.getElementById("confirmDialog"),dialogChanges=document.getElementById("changesDialog"),dialogCustomTimes=document.getElementById("customTimes"),dialogAbout=document.getElementById("aboutDialog"),dialogClapping=document.getElementById("clappingDialog"),txtSpeaker=document.getElementById("txtSpeaker"),txtCustom=document.getElementById("txtCustom"),txtMin=document.getElementById("txtMin"),txtAvg=document.getElementById("txtAvg"),txtMax=document.getElementById("txtMax"),clapM=document.getElementById("clapM"),clapS=document.getElementById("clapS"),cmbSpeechType=document.getElementById("cmbSpeechType"),remainTime=document.getElementById("remainTime"),divSpeaker=document.getElementById("divSpeaker"),snackbarMsg=document.getElementById("snackbarMsg"),tickAll=document.getElementById("tickAll"),progressBar=document.querySelector(".e-c-progress"),indicator=document.getElementById("e-indicator"),pointer=document.getElementById("e-pointer"),speakers=document.getElementById("speakers"),customMin=document.getElementById("customMin"),customAvg=document.getElementById("customAvg"),customMax=document.getElementById("customMax"),ddLang=document.getElementById("ddLang"),invert100="invert(100%)",invert0="invert(0%)",length=2*Math.PI*100,fastTransition=.2,defGreenBgn="#60ad5e",defYellowBgn="#ffeb3b",defRedBgn="#e53935",defGreenCBBgn="#2196f3",defYellowCBBgn="#ffeb3b",defRedCBBgn="#ad1457";let greenBgnCss="#60ad5e",yellowBgnCss="#ffeb3b",redBgnCss="#e53935";const isInStandaloneMode=()=>"standalone"in window.navigator&&window.navigator.standalone;let intervalTimer,titleMeeting=document.getElementById("titleMeeting"),externalContainer=null,clappingTime=30,wholeTime=30,selected=-1,minimum=0,average=0,maximum=0,selectedColor=isDarkModeEnabled(),green=0,yellow=0,red=0,timeLeft=0,totalCount=0,isPaused=!1,isStarted=!1,isStopped=!0,isBeepEnabled=!1,isVibrateEnabled=!1,isClappingEnabled=!1,isContestMode=!1,isCustom=!1,isFirstRun=!0,clappingStarted=!1,multipleEnabled=!1,isNinjaMode=!1,isTextPreviewMode=!1,isFirstTime=!1,isColorBlindnessEnabled=!1,dateFormat="DD/MM/YYYY",latestDB="1.0",currentDB="1.0",lastColor="white",countries=["US","FM","MH","PH"],times=[[10,20,30],[240,300,360],[300,360,420],[30,45,60],[60,75,90],[120,150,180],[300,330,360],[60,90,120],[480,540,600],[600,660,720],[780,840,900],[1080,1170,1200]];var results=[],browserResult=(new UAParser).getResult();function update(e,t){let n=-length-length*e/t;e>=0&&(progressBar.style.strokeDashoffset=-n,pointer.style.transform=`rotate(${360*e/-t}deg)`)}function setDateFormat(){countries.includes(navigator.language.split("-")[1])&&(dateFormat="MM/DD/YYYY")}function disableLinks(e){Array.from(externalLinks).forEach((t=>{e?t.setAttribute("disabled","disabled"):t.removeAttribute("disabled")}))}function getTimeStamp(e){return moment.utc(1e3*e).format("HH:mm:ss")}function getTime(){return remainTime.innerHTML}function checkMode(){isContestMode?(document.getElementById("remainTime").classList.remove("showTime"),document.getElementById("controls").classList.remove("contestModeOff"),document.getElementById("remainTime").classList.add("hideTime"),document.getElementById("controls").classList.add("contestMode")):(document.getElementById("remainTime").classList.remove("contestMode"),document.getElementById("controls").classList.remove("hideTime"),document.getElementById("remainTime").classList.add("showTime"),document.getElementById("controls").classList.add("contestModeOff"))}function changeWholeTime(e){wholeTime+e>0&&(wholeTime+=e,update(wholeTime,wholeTime))}function setInitialValues(){maximum=30,wholeTime=30,isPaused=!1,isStarted=!1,update(wholeTime,wholeTime),displayTimeLeft(wholeTime)}function updateDisplay(){update(wholeTime,wholeTime),displayTimeLeft(wholeTime)}function basicReset(){resetState(),wholeTime=30,updateDisplay()}function resetState(){isStarted=!1,btnPause.classList.remove("pause"),btnPause.classList.add("play"),clearInterval(intervalTimer),wholeTime=-1,displayTimeLeft(wholeTime),wholeTime=0,displayTimeLeft(wholeTime),lastColor=bgColors[selectedColor],document.body.style.background=lastColor,clappingStarted=!1,setInitialValues(),txtSpeaker.value="",divSpeaker.className="mdl-textfield mdl-js-textfield",btnInvert.disabled=!1,btnRestart.disabled=!1,cmbSpeechType.disabled=!1,disableLinks(!1),isStopped=!0,isPaused=!1,imgRestart.src="img/icons-svg/restart.svg",timeLeft=0,currentState=1,browserChangeFavIcon(""),browserChangeTitle("")}function timer(e){let t=Date.now()+1e3*e;displayTimeLeft(e),intervalTimer=setInterval((()=>{timeLeft=Math.round((t-Date.now())/1e3);let e=maximum-timeLeft;e>=minimum&&e=average&&e=maximum&&(red++,execAction(redBgnCss,"red","max"),document.body.style.background=redBgnCss),e>=maximum+clappingTime&&(clappingStarted||startClapping(),clappingStarted=!0),totalCount++,displayTimeLeft(timeLeft)}),1e3)}function execAction(e,t,n){document.body.style.background=e,startBeep(),startAlert(),startVibrate(),lastColor=t,browserChangeFavIcon(n)}function resizeScreen(){const e=window.innerHeight>1.9*window.innerWidth&&window.innerHeight>900;let t=window.innerHeight/600;if(window.innerWidth<400&&window.innerHeight>=2.333*window.innerWidth){if(t=window.innerWidth/400,null===externalContainer){let e=document.body,t=document.createElement("div");t.id="externalContainer",e.insertBefore(t,e.firstChild)}externalContainer=document.getElementById("externalContainer");let e=document.getElementById("superContainer");externalContainer.append(e),externalContainer.style.height=`${window.innerHeight}px`,e.style.transformOrigin="50% 0% 0px",setTimeout((()=>{e.style.transform=`scale(${t})`,setTimeout((()=>{let n=(1+t)*window.innerHeight;n<514&&(n=514),e.style.height=`${n}px`}),100)}),100)}else if(e){t=window.innerWidth/325;const e=document.getElementById("superContainer");setTimeout((()=>{e.style.height=`${window.innerHeight}px`,e.style.transformOrigin="50% 0% 0px",e.style.transform=`scale(${t})`}),100),setTimeout((()=>{const n=document.getElementById("divSpeaker");n.getBoundingClientRect().width>window.outerWidth&&(e.style.transform=`scale(${t-(t-n.getBoundingClientRect().width/window.outerWidth)})`),document.getElementById("innerPlayContainer").style.setProperty("top","27%","important"),document.querySelector("#playControl").style.top="-30px"}),100)}else if(window.innerHeight<514){if(null===externalContainer){let e=document.body,t=document.createElement("div");t.id="externalContainer",e.insertBefore(t,e.firstChild)}externalContainer=document.getElementById("externalContainer");let e=document.getElementById("superContainer");externalContainer.append(e),externalContainer.style.height=`${window.innerHeight}px`,e.style.transformOrigin="50% 0% 0px",setTimeout((()=>{e.style.transform=`scale(${t})`,setTimeout((()=>{let n=(1+t)*window.innerHeight;n<514&&(n=514),e.style.height=`${n}px`}),100)}),100)}else{let e=document.getElementById("superContainer");e.style.height=`${window.innerHeight}px`,e.style.transformOrigin="50% 0% 0px",setTimeout((()=>{e.style.transform=`scale(${t})`}),100),setTimeout((()=>{cmbSpeechType.getBoundingClientRect().width>window.outerWidth&&(e.style.transform=`scale(${t-(t-cmbSpeechType.getBoundingClientRect().width/window.outerWidth)})`)}),100)}}function resizeSelect(){setTimeout((()=>{try{document.getElementsByClassName("mdl-menu__outline")[0].style.width="300px",document.getElementsByClassName("mdl-menu__container")[0].style.width="300px",document.getElementsByClassName("mdl-menu__outline")[0].style.height="310px",document.getElementsByClassName("mdl-menu__container")[0].style.height="310px";let e=document.getElementsByClassName("mdl-menu")[0],t=e.style.clip.split(", ");if(t.length>1){t[1]=t[1].replace("px",""),t[2]=t[2].replace("px","");let n=1;"Edge"===browserResult.browser.name&&parseFloat(browserResult.browser.version)<19&&(n=2),e.style.clip=`${t[0]}, ${300*n}px, ${300*n}px, ${t[3]}`}}catch(e){}}),50)}function pauseTimer(){0===minimum&&0===maximum&&0===average||-1===selected?isCustom?showSnackbar(lngObject.notSaved):showSnackbar(lngObject.chooseTime):(validateProperIntervals(),browserStopClapping(),isStopped=!1,btnInvert.disabled=!0,cmbSpeechType.disabled=!0,isStarted&&void 0!==timeLeft?isPaused?(activateWakeLock(),disableLinks(!0),btnPause.disabled=!0,btnPause.classList.remove("play"),btnPause.classList.add("pause"),setTimeout((()=>{btnPause.disabled=!1}),500),timer(timeLeft),isPaused=!isPaused):(deactivateWakeLock(),disableLinks(!1),btnPause.classList.remove("pause"),btnPause.classList.add("play"),clearInterval(intervalTimer),isPaused=!isPaused):(activateWakeLock(),disableLinks(!0),timer(wholeTime),isStarted=!0,btnPause.disabled=!0,btnPause.classList.remove("play"),btnPause.classList.add("pause"),setTimeout((()=>{btnPause.disabled=!1}),500)),btnRestart.disabled=!isPaused,btnRestart.disabled?(imgRestart.src="img/icons-svg/restart-off.svg",fade.to(document.getElementById("divSpeechType"),fastTransition,.1),fade.to(document.getElementById("divSpeaker"),fastTransition,.1),fade.to(document.getElementById("options"),fastTransition,.1),fade.to(document.getElementsByTagName("footer")[0],fastTransition,.1),isNinjaMode?(fade.to(document.getElementById("controls"),fastTransition,.5),fade.to(document.getElementsByClassName("circle")[0],fastTransition,0),fade.to(document.getElementById("bmc-wbtn"),fastTransition,0)):fade.to(document.getElementById("bmc-wbtn"),fastTransition,.1),document.getElementById("bmc-wbtn").style.pointerEvents="none"):(imgRestart.src="img/icons-svg/restart.svg",unfadeElements()))}function unfadeElements(){fade.to(document.getElementById("divSpeechType"),fastTransition,1.5),fade.to(document.getElementById("divSpeaker"),fastTransition,1.5),fade.to(document.getElementById("options"),fastTransition,1.5),fade.to(document.getElementsByTagName("footer")[0],fastTransition,1.5),fade.to(document.getElementById("controls"),fastTransition,1.5),fade.to(document.getElementsByClassName("circle")[0],fastTransition,1.5),fade.to(document.getElementById("bmc-wbtn"),fastTransition,1.5),document.getElementById("bmc-wbtn").style.pointerEvents=""}function displayTimeLeft(e){let t=maximum-e,n=Math.floor(t/3600),i=Math.floor(t/60),o=t%60,l=`${n<10?"0":""}${n}:${i<10?"0":""}${i}:${o<10?"0":""}${o}`;displayOutput.textContent=l,!isContestMode&&isStarted&&browserChangeTitle(l),update(e,wholeTime)}function setDropDownValue(e,t){try{document.getElementById(e).dataset.selected="true",getmdlSelect.init(t)}catch(e){}}function validateProperIntervals(){isCustom?(minimum=getMinCustom(),average=getAvgCustom(),maximum=getMaxCustom()):setBasicIntervals(),0===timeLeft&&(wholeTime=maximum)}function setBasicIntervals(){minimum=times[selected][0],average=times[selected][1],maximum=times[selected][2]}function changeEventHandler(){let e=99===selected;if(selected=parseInt(hiddenSpeechType.value),99!==selected)setBasicIntervals(),wholeTime=maximum,setLocalStorage("wholeTime",maximum),updateDisplay(),isCustom=!1;else{if(e){if(e&&!isFirstTime){setCustomText();let e=Math.floor(minimum/3600),t=Math.floor(minimum/60),n=minimum%60;txtMin.parentElement.MaterialTextfield.change(getDisplayString(e,t,n)),e=Math.floor(average/3600),t=Math.floor(average/60),n=average%60,txtAvg.parentElement.MaterialTextfield.change(getDisplayString(e,t,n)),e=Math.floor(maximum/3600),t=Math.floor(maximum/60),n=maximum%60,txtMax.parentElement.MaterialTextfield.change(getDisplayString(e,t,n))}}else minimum=0,maximum=0,average=0,txtCustom.parentElement.MaterialTextfield.change(lngObject.opt12);"phone"===deviceDetector.device&&setTimeout((()=>{let e=document.getElementById("bodyCustomTimes");e.style.height=100*e.clientHeight/window.innerHeight+"%"}),100),hasCustomChange=!1,isCustom=!0,dialogCustomTimes.showModal()}}function startBeep(){!isBeepEnabled||1!==green&&1!==yellow&&1!==red||browserStartBeep()}function startAlert(){if(isTextPreviewMode&&(1===green||1===yellow||1===red))switch(lastColor){case"green":showSnackbar(lngObject.color2,3500);break;case"yellow":showSnackbar(lngObject.color3,3500);break;default:showSnackbar(lngObject.color1,3500)}}function startVibrate(){!isVibrateEnabled||1!==green&&1!==yellow&&1!==red||browserStartVibrate()}function startClapping(){isClappingEnabled&&browserStartClapping()}function stopClapping(){browserStopClapping()}function getVibrate(){getLocalStorageValue("isVibrateEnabled")?isVibrateEnabled="true"===getLocalStorageValue("isVibrateEnabled"):setVibrate()}function getClapping(){getLocalStorageValue("isClappingEnabled")?isClappingEnabled="true"===getLocalStorageValue("isClappingEnabled"):setClapping()}function getBeep(){getLocalStorageValue("isBeepEnabled")?isBeepEnabled="true"===getLocalStorageValue("isBeepEnabled"):setBeep()}function getContestMode(){getLocalStorageValue("isContestMode")?isContestMode="true"===getLocalStorageValue("isContestMode"):setContestMode()}function getFirstRun(){getLocalStorageValue("isFirstRun")?isFirstRun="true"===getLocalStorageValue("isFirstRun"):setFirstRun()}function getNinjaMode(){getLocalStorageValue("isNinjaMode")?isNinjaMode="true"===getLocalStorageValue("isNinjaMode"):setLocalStorage("isNinjaMode",!1)}function getColorBlindnessMode(){getLocalStorageValue("isColorBlindnessEnabled")?isColorBlindnessEnabled="true"===getLocalStorageValue("isColorBlindnessEnabled"):setLocalStorage("isColorBlindnessEnabled",!1)}function switchBgnColors(){greenBgnCss=isColorBlindnessEnabled?"#2196f3":"#60ad5e",yellowBgnCss="#ffeb3b",redBgnCss=isColorBlindnessEnabled?"#ad1457":"#e53935"}function setRowColors(){document.getElementById("bgnGreen").style.backgroundColor=greenBgnCss,document.getElementById("bgnYellow").style.backgroundColor=yellowBgnCss,document.getElementById("bgnRed").style.backgroundColor=redBgnCss}function getTextPreviewMode(){getLocalStorageValue("isTextPreviewMode")?isTextPreviewMode="true"===getLocalStorageValue("isTextPreviewMode"):setLocalStorage("isTextPreviewMode",!1)}function getSelectedColor(){getLocalStorageValue("selectedColor")?selectedColor=parseInt(getLocalStorageValue("selectedColor")):setSelectedColor()}function setBeep(){setLocalStorage("isBeepEnabled",isBeepEnabled)}function setVibrate(){setLocalStorage("isVibrateEnabled",isVibrateEnabled)}function setClapping(){setLocalStorage("isClappingEnabled",isClappingEnabled)}function setContestMode(){setLocalStorage("isContestMode",isContestMode)}function setSelectedColor(){setLocalStorage("selectedColor",selectedColor)}function setFirstRun(){setLocalStorage("isFirstRun",isFirstRun)}function setContestImg(){imgTrophy.src=isContestMode?"img/icons-svg/trophy.svg":"img/icons-svg/trophy-broken.svg"}function setVibrateImg(){imgVibrate.src=isVibrateEnabled?"img/icons-svg/vibrate.svg":"img/icons-svg/vibrate-off.svg"}function setBeepImg(){imgBeep.src=isBeepEnabled?"img/icons-svg/volume-high.svg":"img/icons-svg/volume-off.svg"}function setClappingImg(){imgClap.src=isClappingEnabled?"img/icons-svg/clapping-hands.svg":"img/icons-svg/clapping-off.svg"}function invertColors(){let e="";1===selectedColor?(e=invert100,setInvFilter(dialogTimeTable,invert100),setInvFilter(dialogWelcome,invert100),setInvFilter(dialogConfirm,invert100),setInvFilter(dialogChanges,invert100),setInvFilter(dialogCustomTimes,invert100),setInvFilter(dialogClapping,invert100),setInvFilter(customMin,invert100),setInvFilter(customAvg,invert100),setInvFilter(customMax,invert100),setInvFilter(speakers,invert100),setInvFilter(dialogAbout,invert100),setInvFilter(document.body,invert100),setBgd(dialogWelcome,bgColors[2]),setBgd(dialogConfirm,bgColors[2]),setBgd(dialogChanges,bgColors[2]),setBgd(dialogCustomTimes,bgColors[2]),setBgd(dialogTimeTable,bgColors[2]),setBgd(dialogClapping,bgColors[2])):(e=invert0,setInvFilter(dialogTimeTable,invert0),setInvFilter(dialogWelcome,invert0),setInvFilter(dialogConfirm,invert0),setInvFilter(dialogChanges,invert0),setInvFilter(dialogCustomTimes,invert0),setInvFilter(dialogClapping,invert0),setInvFilter(customMin,invert0),setInvFilter(customAvg,invert0),setInvFilter(customMax,invert0),setInvFilter(speakers,invert0),setInvFilter(dialogAbout,invert0),setInvFilter(document.body,invert0),setBgd(dialogWelcome,bgColors[0]),setBgd(dialogConfirm,bgColors[0]),setBgd(dialogChanges,bgColors[0]),setBgd(dialogCustomTimes,bgColors[0]),setBgd(dialogTimeTable,bgColors[0]),setBgd(dialogClapping,bgColors[0])),[].forEach.call(document.getElementsByClassName("noInvert"),(t=>{setInvFilter(t,e)})),setBgd(document.body,lastColor)}function storeTime(e){if((0!==minimum||0!==maximum||0!==average)&&0!==totalCount){if(deactivateWakeLock(),stopClapping(),e){let e=maximum-timeLeft,t=cmbSpeechType.value;99===selected&&(t=txtCustom.value),addNewTime(txtSpeaker.value,t,getTimeStamp(minimum),getTimeStamp(average),getTimeStamp(maximum),getTimeStamp(e),lastColor,e>maximum+clappingTime||e0||getAvgCustom()>0||getMaxCustom()>0)&&hasCustomChange?dialogChanges.showModal():dialogCustomTimes.close()}function saveChanges(){let e=getMinCustom(),t=getAvgCustom(),n=getMaxCustom();e>=t?showSnackbar(lngObject.errorMin):e>=n?showSnackbar(lngObject.errorHalf):t>=n?showSnackbar(lngObject.errorMax):(minimum=e,average=t,maximum=n,wholeTime=maximum,updateDisplay(),dialogCustomTimes.close())}function insertIAd(){const e=document.createElement("script");e.async=!0,e.setAttribute("data-cfasync","false"),e.src="//thubanoa.com/1?z=7667293",document.body.appendChild(e)}function hideKeyboard(e){e.readOnly=!0,setTimeout((()=>{e.blur(),e.readOnly=!1}),100)}function doOnOrientationChange(){location.reload()}progressBar.style.strokeDasharray=length,update(wholeTime,wholeTime),displayTimeLeft(wholeTime),checkMode(),setInitialValues(),("Android"!==os||navigator.userAgent.match(/SAMSUNG|SGH-[I|N|T]|GT-[I|P|N]|SM-[N|P|T|Z|G]|SHV-E|SCH-[I|J|R|S]|SPH-L/i))&&(window.onresize=()=>{resizeScreen()}),btnPause.addEventListener("click",(e=>{1===e.detail&&pauseTimer()})),btnRestart.addEventListener("click",(()=>{storeTime(!1)})),btnStop.addEventListener("click",(()=>{storeTime(!0)})),btnChampion.addEventListener("click",(e=>{3===e.detail?(isNinjaMode=!isNinjaMode,isNinjaMode?showSnackbar(lngObject.ninjaEnabled,!1):showSnackbar(lngObject.ninjaDisabled,!1),setLocalStorage("isNinjaMode",isNinjaMode)):(isContestMode=!isContestMode,isContestMode?browserChangeTitle(""):browserChangeTitle(displayOutput.textContent),setContestImg(),checkMode(),setContestMode())})),btnVibrate.addEventListener("click",(()=>{isVibrateEnabled=!isVibrateEnabled,setVibrateImg(),setVibrate()})),btnBeep.addEventListener("click",(e=>{3===e.detail&&(isTextPreviewMode=!isTextPreviewMode,isTextPreviewMode?showSnackbar(lngObject.colorMsg,1500):showSnackbar(lngObject.colorMsgDis,1500),setLocalStorage("isTextPreviewMode",isTextPreviewMode)),isBeepEnabled=!isBeepEnabled,setBeepImg(),setBeep()})),btnClap.addEventListener("click",(e=>{3===e.detail?(dialogClapping.showModal(),30===clappingTime&&(setDropDownValue("clapM0","#divClapM"),setDropDownValue("clapS30","#divClapS"))):(isClappingEnabled=!isClappingEnabled,setClappingImg(),setClapping())})),btnSave.addEventListener("click",saveChanges),btnSaveClap.addEventListener("click",(()=>{clappingTime=getSeconds(`00:${clapM.value}:${clapS.value}`),dialogClapping.close()})),dialogTimeTable.showModal||dialogPolyfill.registerDialog(dialogTimeTable),dialogChanges.showModal||dialogPolyfill.registerDialog(dialogChanges),dialogAbout.showModal||dialogPolyfill.registerDialog(dialogAbout),dialogClapping.showModal||dialogPolyfill.registerDialog(dialogClapping),dialogCustomTimes.showModal||dialogPolyfill.registerDialog(dialogCustomTimes),dialogWelcome.showModal||dialogPolyfill.registerDialog(dialogWelcome),dialogConfirm.showModal||dialogPolyfill.registerDialog(dialogConfirm),btnTimeTable.addEventListener("click",countTimetable),btnDelete.addEventListener("click",deleteTimetable),btnYesChallenge.addEventListener("click",(()=>{isContestMode=!0,setContestImg(),checkMode(),setContestMode(),dialogWelcome.close(),isFirstRun=!1,setFirstRun()})),btnYesConfirm.addEventListener("click",deleteByIDs),btnInvert.addEventListener("click",(e=>{3===e.detail&&(isColorBlindnessEnabled=!isColorBlindnessEnabled,isColorBlindnessEnabled?showSnackbar(lngObject.cbEnabled,!1):showSnackbar(lngObject.cbDisabled,!1),setLocalStorage("isColorBlindnessEnabled",isColorBlindnessEnabled),switchBgnColors()),selectedColor=selectedColor=0===selectedColor?1:0,lastColor=bgColors[selectedColor],setSelectedColor(),invertColors(),timeDialogInvert(selectedColor)})),btnYesChanges.addEventListener("click",(()=>{saveChanges(),dialogChanges.close()})),btnSponsor2Us.addEventListener("click",(()=>{window.open("https://github.com/sponsors/FANMixco")})),btnShare.addEventListener("click",(async()=>{const e='style="display: none!important;"',t=""+document.getElementById("tblResults").outerHTML.replace(/id="thDel"/g,`id="thDel" ${e}`).replace(/class="tdDel/g,`${e} class="tdDel`).replace(/filter: invert\(100%\);/g,"").replace(/filter:invert\(100%\);/g,""),n=document.getElementById("titleMeeting").outerHTML+t+'

Exported by Toastmasters Timer. Created by Federico Navarrete.

';try{await navigator.share({title:document.getElementById("titleMeeting").innerHTML,text:"Check out the meeting timing results. Exported by Toastmasters Timer. Created by Federico Navarrete, https://federiconavarrete.com",files:[new File([n],`${document.getElementById("titleMeeting").innerHTML.replace(/ /g,"_").replace(/\//g,"_")}.html`,{type:"text/html"})]}),insertIAd()}catch(e){console.error("Error sharing:",e)}})),btnEmail.addEventListener("click",(()=>{})),btnAbout.addEventListener("click",(()=>{dialogAbout.showModal(),"phone"===deviceDetector.device&&setTimeout((()=>{dialogAbout.style.height=100*dialogAbout.innerHeight/window.outerHeight+"%"}),100)})),txtMin.addEventListener("click",(()=>{setNewTime("txtMin",txtMin.value)})),txtMax.addEventListener("click",(()=>{setNewTime("txtMax",txtMax.value)})),txtAvg.addEventListener("click",(()=>{setNewTime("txtAvg",txtAvg.value)})),btnDownload.addEventListener("click",browserExport),btnMultiple.addEventListener("click",(()=>{Array.from(document.getElementsByClassName("mdl-js-checkbox")).forEach((e=>{let t=e;setTimeout((()=>{t.MaterialCheckbox.check()}),10)})),multipleEnabled?(imgMultiple.src="img/icons-svg/checkbox-outline.svg",hideCheckBoxes()):(imgMultiple.src="img/icons-svg/checkbox-blank-outline.svg",showCheckBoxes()),multipleEnabled=!multipleEnabled,refreshControls()})),dialogTimeTable.querySelector(".close").addEventListener("click",(()=>{dialogTimeTable.close()})),dialogCustomTimes.querySelector(".close").addEventListener("click",closeCustomDialog),dialogConfirm.querySelector(".close").addEventListener("click",(()=>{dialogConfirm.close()})),dialogAbout.querySelector(".close").addEventListener("click",(()=>{dialogAbout.close()})),dialogChanges.querySelector(".close").addEventListener("click",(()=>{dialogChanges.close(),dialogCustomTimes.close()})),dialogWelcome.querySelector(".close").addEventListener("click",(()=>{dialogWelcome.close(),isFirstRun=!1,setFirstRun(),showSnackbar(lngObject.noHints)})),txtCustom.addEventListener("keyup",(e=>{"Enter"===e.key&&hideKeyboard(txtCustom)})),"Android"===os&&(txtSpeaker.addEventListener("onfocus",(()=>{let e=document.getElementById("playControl").getBoundingClientRect().y;document.body.marginTop=`-${e}px`})),txtSpeaker.addEventListener("onblur",(()=>{document.body.marginTop="0px"}))),txtSpeaker.addEventListener("keyup",(e=>{"Enter"===e.key&&hideKeyboard(txtSpeaker)})),document.addEventListener("DOMContentLoaded",(()=>{cmbSpeechType.onchange=changeEventHandler}),!1),cmbSpeechType.addEventListener("click",resizeSelect),maximum=0,wholeTime=0,getBeep(),getVibrate(),getClapping(),getContestMode(),getSelectedColor(),getNinjaMode(),getColorBlindnessMode(),switchBgnColors(),getTextPreviewMode(),getFirstRun(),setRowColors(),setContestImg(),setVibrateImg(),setBeepImg(),setClappingImg(),setSelectedColor(),setDateFormat(),initializeDB(currentDB,latestDB),lastColor=bgColors[selectedColor],invertColors(),setTimeout((()=>{let e=document.getElementById("bodyAbout"),t=document.getElementById("bodyTranslators"),n=document.getElementById("bodyHelp");if("phone"==deviceDetector.device){let i=document.getElementById("timeTable"),o=document.createElement("div");o.className="titleContainer";let l=document.createElement("div");l.className="titleInnerContainer";let a=document.createElement("span");a.className="closeMobile",a.id="btnCloseMobileSpan";let s=document.createElement("img");s.className="btnCloseMobile",s.src="img/icons-svg/close.svg",s.alt="close";let d=document.createElement("span");d.id="spanTitle",a.appendChild(s),l.appendChild(a),l.appendChild(d),o.appendChild(l),i.insertBefore(o,i.firstChild),titleMeeting=document.getElementById("titleMeeting"),titleMeeting.classList.remove("mdl-dialog__title"),titleMeeting.style.margin="0",titleMeeting.style.marginTop="16px",titleMeeting.style.fontWeight=1e3,titleMeeting.style.fontSize="1.25em",titleMeeting.style.display="inline",document.getElementById("spanTitle").append(titleMeeting),document.getElementById("btnCloseMeeting").style.display="none",document.getElementById("btnCloseMobileSpan").addEventListener("click",(()=>{dialogTimeTable.close()}));let r=document.getElementById("customTimes"),m=document.createElement("div");m.className="titleContainer";let c=document.createElement("div");c.className="titleInnerContainer";let g=document.createElement("span");g.className="closeMobile",g.id="btnCloseMobileCustom";let u=document.createElement("img");u.className="btnCloseMobile",u.src="img/icons-svg/close.svg",u.alt="close";let p=document.createElement("span");p.id="spanTitleCustom";let b=document.createElement("h4");b.innerHTML=" ",b.id="customTitle";let y=document.createElement("span");y.id="spanSave",y.className="btnRight",g.appendChild(u),p.appendChild(b),c.appendChild(g),c.appendChild(p),c.appendChild(y),m.appendChild(c),r.insertBefore(m,r.firstChild);let h=document.getElementById("customTitle");h.classList.remove("mdl-dialog__title"),h.style.margin="0",h.style.marginTop="16px",h.style.fontWeight=1e3,h.style.fontSize="1.25em",h.style.display="inline",document.getElementById("btnCloseMobileCustom").addEventListener("click",(()=>{closeCustomDialog()})),document.getElementById("spanSave").appendChild(document.getElementById("btnSave")),document.getElementById("footerCustom").style.display="none",document.getElementById("btnCloseCustom").style.display="none";let C=document.getElementById("aboutDialog"),v=document.createElement("div");v.className="titleContainer";let E=document.createElement("div");E.className="titleInnerContainer";let f=document.createElement("span");f.className="closeMobile",f.id="btnCloseMobileAbout";let T=document.createElement("img");T.className="btnCloseMobile",T.src="img/icons-svg/close.svg",T.alt="close";let B=document.createElement("span");B.id="spanTitleAbout";let w=document.createElement("h4");w.innerHTML=" ",w.id="aboutTitle",w.style.margin="0",w.style.marginTop="16px",w.style.fontWeight=1e3,w.style.fontSize="1.25em",w.style.display="inline",f.appendChild(T),B.appendChild(w),E.appendChild(f),E.appendChild(B),v.appendChild(E),C.insertBefore(v,C.firstChild);let I=document.createElement("span");I.id="spanFiveStars",I.className="btnRight",E.appendChild(I),document.getElementById("spanFiveStars").appendChild(document.getElementById("btnSponsor2Us")),document.getElementById("btnCloseMobileAbout").addEventListener("click",(()=>{dialogAbout.close()})),document.getElementById("divCloseAbout").style.display="none",e.style.height=.79*document.body.offsetHeight+"px",t.style.height=.79*document.body.offsetHeight+"px",n.style.height=.79*document.body.offsetHeight+"px"}else{let i=document.body;"function"!=typeof HTMLDialogElement?(e.style.height=.8*i.offsetHeight+"px",t.style.height=.8*i.offsetHeight+"px",n.style.height=.8*i.offsetHeight+"px"):(e.style.height=.4*i.offsetHeight+"px",t.style.height=.4*i.offsetHeight+"px",n.style.height=.4*i.offsetHeight+"px")}let i=0;do{setTimeout((()=>{try{titleMeeting.innerHTML=`${lngObject.meetingAt} ${moment().format(dateFormat)}`}catch(e){}}),1e3),i++}while(void 0===lngObject&&i<5)}),100),checkMode(),tickAll.addEventListener("change",(()=>{Array.from(document.querySelectorAll(".mdl-js-checkbox:not(#lblTickAll)")).forEach((e=>{let t=e;setTimeout((()=>{lblTickAll.matches(".is-checked")?t.MaterialCheckbox.check():t.MaterialCheckbox.uncheck()}),10)})),refreshControls()})),(()=>{if(btnEmail.style.display="none","iOS"===os&&(btnVibrate.style.display="none"),isFirstTime=!0,"desktop"===deviceDetector.device){try{let e=-1!=navigator.userAgent.indexOf("Firefox"),t=/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString();(e||t)&&(dialogTimeTable.classList.add("centeredDialog"),dialogAbout.classList.add("centeredDialog"))}catch{}dialogTimeTable.classList.add("fullscreen-dialog-tablet"),dialogAbout.classList.add("fullscreen-dialog-desktop"),document.getElementById("divSpeakers").style.height=.53*document.body.clientHeight+"px"}else"tablet"===deviceDetector.device?(dialogTimeTable.classList.add("centeredDialog-tablet"),dialogTimeTable.classList.add("fullscreen-dialog-tablet"),dialogAbout.classList.add("centeredDialog"),dialogAbout.classList.add("fullscreen-dialog-tablet"),document.getElementById("divSpeakers").style.height=.53*document.body.clientHeight+"px"):(dialogCustomTimes.classList.add("customBodyMobile"),window.innerHeight<514&&window.innerWidth>window.innerHeight?document.getElementById("divSpeakers").style.height=.6*document.body.clientHeight+"px":document.getElementById("divSpeakers").style.height=.75*document.body.clientHeight+"px",dialogTimeTable.classList.add("fullscreen-dialog"),dialogCustomTimes.classList.add("fullscreen-dialog"),dialogAbout.classList.add("fullscreen-dialog"));"function"!=typeof HTMLDialogElement&&(dialogWelcome.classList.remove("centeredDialog"),dialogWelcome.classList.add("centeredDialogNoSupport"),dialogSetTime.classList.remove("centeredDialog"),dialogSetTime.classList.add("centeredDialogNoSupport"),dialogTimeTable.classList.remove("centeredDialog"),dialogTimeTable.classList.add("centeredDialogNoSupport"),dialogAbout.classList.remove("centeredDialog"),dialogAbout.classList.add("centeredDialogNoSupport"),dialogAbout.classList.add("fullscreen-dialog")),window.addEventListener("focus",(()=>{try{let e=document.querySelector(".mdl-menu__outline");e&&"-1"!==e.style.zIndex&&resizeSelect()}catch(e){}})),"2345Explorer"!==browserResult.browser.name&&"IE"!==browserResult.browser.name&&"IEMobile"!==browserResult.browser.name||alert("Unsupported Browser. Please download a modern browser like Chrome or Firefox"),setTimeout((()=>{"iOS"!==os||isInStandaloneMode()||showSnackbar(lngObject.installiOS,3e3);try{lngObject.copyright3&&(document.getElementById("spanCopyright3").innerHTML=`. ${lngObject.copyright3}`)}catch{}timeDialogInvert(selectedColor)}),1e3)})(),window.addEventListener("orientationchange",doOnOrientationChange),document.addEventListener("keydown",(e=>{!e.ctrlKey||"p"!==e.key&&"P"!==e.key||pauseTimer()})),document.addEventListener("keydown",(e=>{!e.ctrlKey||"s"!==e.key&&"S"!==e.key||btnStop.click()})),document.addEventListener("keydown",(e=>{!e.ctrlKey||"r"!==e.key&&"R"!==e.key||btnRestart.click()})),window.addEventListener("DOMContentLoaded",(()=>{document.getElementById("loading-container").style.display="none",document.getElementById("superContainer").style.display="block",isFirstRun&&("phone"===deviceDetector.device&&("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)||"phone"!==deviceDetector.device)&&dialogWelcome.showModal(),window.innerHeight>2*window.innerWidth&&window.matchMedia("(orientation: portrait)").matches&&document.querySelector("#innerPlayContainer").classList.add("longPhonePortrait"),document.body.style.maxHeight=`${window.innerHeight}px`,ddLang.value=getLocalStorageValue("currentLang"),resizeScreen()})),ddLang.onchange=e=>{confirm(lngObject.rWarning)&&(setLocalStorage("currentLang",e.target.value),location.reload())}; \ No newline at end of file diff --git a/manifest.json b/manifest.json index d43ad3b..aa05bc4 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "dir": "ltr", "lang": "da", "name": "Toastmasters Timer Lite", - "version": "2.4.1.19", + "version": "2.4.1.20", "scope": "https://tmtimer.federiconavarrete.com/", "display": "standalone", "display_override": [