diff --git a/js/timer.js b/js/timer.js index 2437986..895f92c 100644 --- a/js/timer.js +++ b/js/timer.js @@ -955,12 +955,15 @@ setTimeout(function() { $("#divCloseAbout").hide(); } let exit = 0; - while (lngObject.meetingAt === undefined && exit < 5) { + do { setTimeout(function() { - titleMeeting.innerHTML = `${lngObject.meetingAt} ${moment().format(dateFormat)}`; + try { + titleMeeting.innerHTML = `${lngObject.meetingAt} ${moment().format(dateFormat)}`; + } + catch (e) {} }, 1000); exit++; - } + } while (lngObject === undefined && exit < 5); }, 100); if (isFirstRun) { diff --git a/js/timer.min.js b/js/timer.min.js index 9427a91..987dbb7 100644 --- a/js/timer.min.js +++ b/js/timer.min.js @@ -1 +1 @@ -const displayOutput=document.querySelector(".display-remain-time"),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"),btnSave=document.getElementById("btnSave"),btnSaveClap=document.getElementById("btnSaveClap"),btnAbout=document.getElementById("btnAbout"),btnUpH=document.getElementById("btnUpH"),btnUpM=document.getElementById("btnUpM"),btnUpS=document.getElementById("btnUpS"),btnDownH=document.getElementById("btnDownH"),btnDownM=document.getElementById("btnDownM"),btnDownS=document.getElementById("btnDownS"),imgClap=document.getElementById("imgClap"),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"),titleMeeting=document.getElementById("titleMeeting"),divSpeaker=document.getElementById("divSpeaker"),snackbarMsg=document.getElementById("snackbarMsg"),length=100*(2*Math.PI);let intervalTimer,clappingTime=30,wholeTime=30,selected=-1,minimum=0,average=0,maximum=0,selectedColor=0,green=0,yellow=0,red=0,timeLeft=0,elements=new Map,isPaused=!1,isStarted=!1,isStopped=!0,isBeepEnabled=!1,isVibrateEnabled=!1,isClappingEnabled=!1,isContestMode=!1,isCustom=!1,isFirstRun=!0,clappingStarted=!1,multipleEnabled=!1,isNinjaMode=!1,isFirstTime=!1,dateFormat="DD/MM/YYYY",latestDB="1.0",currentDB="1.0",lastColor="white",countries=["US","FM","MH","PH"],bgColors=["white","black"],times=[[10,20,30],[240,300,360],[300,360,420],[480,540,600],[60,75,90],[120,150,180],[300,330,360],[60,90,120],[600,660,720],[780,840,900],[1080,1170,1200],[30,45,60]],progressBar=document.querySelector(".e-c-progress"),indicator=document.getElementById("e-indicator"),pointer=document.getElementById("e-pointer");var results=[];progressBar.style.strokeDasharray=length;function update(a,b){0<=a&&(progressBar.style.strokeDashoffset=-(-length-length*a/b),pointer.style.transform=`rotate(${360*a/-b}deg)`)}update(wholeTime,wholeTime),displayTimeLeft(wholeTime),checkMode();function setDateFormat(){countries.includes(navigator.language.split("-")[1])&&(dateFormat="MM/DD/YYYY")}function getTimeStamp(a){return moment.utc(1e3*a).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(a){0",timeLeft=0,currentState=1}function timer(a){let b=Date.now()+1e3*a;displayTimeLeft(a),intervalTimer=setInterval(function(){timeLeft=Math.round((b-Date.now())/1e3);let a=maximum-timeLeft;a>=minimum&&a=average&&a=maximum&&(red++,document.body.style.background="#e53935",startBeep(),startVibrate(),lastColor="red"),a>=maximum+clappingTime&&(!clappingStarted&&startClapping(),clappingStarted=!0),displayTimeLeft(timeLeft)},1e3)}window.onresize=function(){resizeScreen()};function resizeScreen(){let a=window.innerHeight/600;514>window.innerHeight?($("body").prepend($("
")),$("#externalContainer").append($("#superContainer")),$("#externalContainer").css("height",`${window.innerHeight}px`),$("#superContainer").css("transform-origin","50% 0% 0px"),setTimeout(function(){$("#superContainer").css("transform",`scale(${a}`),setTimeout(function(){let b=(1+a)*window.innerHeight;514>b&&(b=514),$("#superContainer").css("height",`${b}px`)},100)},100)):($("#superContainer").css("height",`${window.innerHeight}px`),$("#superContainer").css("transform-origin","50% 0% 0px"),setTimeout(function(){$("#superContainer").css("transform",`scale(${a}`)},100),setTimeout(function(){$(".mdl-textfield__input")[0].getBoundingClientRect().width>$("body").outerWidth()&&$("#superContainer").css("transform",`scale(${a-(a-$(".mdl-textfield__input")[0].getBoundingClientRect().width/$("body").outerWidth())}`)},100))}function resizeSelect(){setTimeout(function(){$(".mdl-menu__outline").first().width(300),$(".mdl-menu__container").first().width(300),$(".mdl-menu__outline").first().height(310),$(".mdl-menu__container").first().height(310);var a=$(".mdl-menu").first().css("clip").split(", ");a[1]=a[1].replace("px",""),a[2]=a[2].replace("px",""),$(".mdl-menu").first().css("clip",`${a[0]}, 300px, 300px, ${a[3]}`)},50)}function pauseTimer(){return 0===minimum&&0===maximum&&0===average||-1===selected?void(isCustom?showSnackbar(lngObject.notSaved):showSnackbar(lngObject.chooseTime)):void(validateProperIntervals(),browserStopClapping(),isStopped=!1,btnInvert.disabled=!0,cmbSpeechType.disabled=!0,isStarted&&timeLeft!==void 0?isPaused?(btnPause.classList.remove("play"),btnPause.classList.add("pause"),timer(timeLeft),isPaused=!isPaused):(btnPause.classList.remove("pause"),btnPause.classList.add("play"),clearInterval(intervalTimer),isPaused=!isPaused):(timer(wholeTime),isStarted=!0,btnPause.classList.remove("play"),btnPause.classList.add("pause")),btnRestart.disabled=!isPaused,btnRestart.disabled?(btnRestart.innerHTML="",$("footer,#divSpeechType,#options,#divSpeaker").fadeTo("fast","0.1"),isNinjaMode&&($(".circle").fadeTo("fast","0"),$("#controls").fadeTo("fast","0.5"))):(btnRestart.innerHTML="",$("footer,#divSpeechType,#options,#divSpeaker,.circle,#controls").fadeTo("fast","1")))}function displayTimeLeft(a){let b=maximum-a,c=Math.floor(b/3600),d=Math.floor(b/60),e=b%60,f=`${10>c?"0":""}${c}:${10>d?"0":""}${d}:${10>e?"0":""}${e}`;displayOutput.textContent=f,update(a,wholeTime)}function setDropDownValue(a,b){try{$(a).attr("data-selected","true"),getmdlSelect.init(b)}catch(a){}}function validateProperIntervals(){isCustom?(minimum=getMinCustom(),average=getAvgCustom(),maximum=getMaxCustom()):setBasicIntervals(),0===timeLeft&&(wholeTime=maximum)}function setBasicIntervals(){let a=selected;11":""}function setVibrateImg(){btnVibrate.innerHTML=isVibrateEnabled?"":""}function setBeepImg(){btnBeep.innerHTML=isBeepEnabled?"":""}function setClappingImg(){imgClap.src=isClappingEnabled?"img/clapping-hands.svg":"img/clapping-off.svg"}function invertColors(){1===selectedColor?$("body").css("filter","invert(100%)"):$("body").css("filter","invert(0%)"),document.body.style.background=lastColor}function storeTime(a){if(0!==minimum||0!==maximum||0!==average){if(stopClapping(),a){let a=maximum-timeLeft,b=cmbSpeechType.value;11===selected&&(b=txtCustom.value),addNewTime(txtSpeaker.value,b,getTimeStamp(minimum),getTimeStamp(average),getTimeStamp(maximum),getTimeStamp(a),lastColor,a>maximum+clappingTime||a=b?showSnackbar(lngObject.errorMin):a>=c?showSnackbar(lngObject.errorHalf):b>=c?showSnackbar(lngObject.errorMax):(minimum=a,average=b,maximum=c,wholeTime=maximum,updateDisplay(),dialogCustomTimes.close())}btnPause.addEventListener("click",function(a){1===a.detail&&pauseTimer()}),btnRestart.addEventListener("click",()=>{storeTime(!1)}),btnStop.addEventListener("click",()=>{storeTime(!0)}),btnChampion.addEventListener("click",function(a){3===a.detail?(isNinjaMode=!isNinjaMode,isNinjaMode?showSnackbar(lngObject.ninjaEnabled,!1):showSnackbar(lngObject.ninjaDisabled,!1),setLocalStorage("isNinjaMode",isNinjaMode)):(isContestMode=!isContestMode,setContestImg(),checkMode(),setContestMode())}),btnVibrate.addEventListener("click",()=>{isVibrateEnabled=!isVibrateEnabled,setVibrateImg(),setVibrate()}),btnBeep.addEventListener("click",()=>{isBeepEnabled=!isBeepEnabled,setBeepImg(),setBeep()}),btnClap.addEventListener("click",function(a){3===a.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",function(){isContestMode=!0,setContestImg(),checkMode(),setContestMode(),dialogWelcome.close(),isFirstRun=!1,setFirstRun()}),btnYesConfirm.addEventListener("click",deleteByIDs),btnInvert.addEventListener("click",function(){selectedColor=0===selectedColor?1:0,lastColor=bgColors[selectedColor],setSelectedColor(),invertColors()}),btnYesChanges.addEventListener("click",function(){saveChanges(),dialogChanges.close()}),btnShare.addEventListener("click",function(){}),btnEmail.addEventListener("click",function(){}),btnAbout.addEventListener("click",function(){dialogAbout.showModal(),"phone"===deviceDetector.device&&setTimeout(function(){$("#bodyAbout").css({height:`${100*$("#bodyAbout").height()/$("html").height()}%`})},100)}),txtMin.addEventListener("click",function(){setNewTime("txtMin",txtMin.value)}),txtMax.addEventListener("click",function(){setNewTime("txtMax",txtMax.value)}),txtAvg.addEventListener("click",function(){setNewTime("txtAvg",txtAvg.value)}),btnDownload.addEventListener("click",browserExport),btnMultiple.addEventListener("click",function(){$(".mdl-js-checkbox").each(function(){let a=this;setTimeout(function(){a.MaterialCheckbox.check()},10)}),multipleEnabled?(btnMultiple.innerHTML="",$(".tdDel,#thDel").hide()):(btnMultiple.innerHTML="",$(".tdDel,#thDel").show()),multipleEnabled=!multipleEnabled,refreshControls()}),dialogTimeTable.querySelector(".close").addEventListener("click",function(){dialogTimeTable.close()}),dialogCustomTimes.querySelector(".close").addEventListener("click",closeCustomDialog),dialogConfirm.querySelector(".close").addEventListener("click",function(){dialogConfirm.close()}),dialogAbout.querySelector(".close").addEventListener("click",function(){dialogAbout.close()}),dialogChanges.querySelector(".close").addEventListener("click",function(){dialogChanges.close(),dialogCustomTimes.close()}),dialogWelcome.querySelector(".close").addEventListener("click",function(){dialogWelcome.close(),isFirstRun=!1,setFirstRun(),showSnackbar(lngObject.noHints)}),txtCustom.addEventListener("keyup",function(a){13===a.keyCode&&$("#txtCustom").hideKeyboard()}),txtSpeaker.addEventListener("keyup",function(a){13===a.keyCode&&$("#txtSpeaker").hideKeyboard()}),document.addEventListener("DOMContentLoaded",function(){cmbSpeechType.onchange=changeEventHandler},!1),cmbSpeechType.addEventListener("click",resizeSelect),maximum=0,wholeTime=0,getBeep(),getVibrate(),getClapping(),getContestMode(),getSelectedColor(),getNinjaMode(),getFirstRun(),setContestImg(),setVibrateImg(),setBeepImg(),setClappingImg(),setSelectedColor(),setDateFormat(),initializeDB(currentDB,latestDB),lastColor=bgColors[selectedColor],invertColors(),setTimeout(function(){"phone"==deviceDetector.device&&($("#timeTable").prepend(`
`),$("#titleMeeting").removeClass("mdl-dialog__title"),$("#titleMeeting").css({margin:"0","margin-top":"16px","font-weight":"1000","font-size":"1.25em",display:"inline"}),$("#spanTitle").append($("#titleMeeting")),$("#btnCloseMeeting").hide(),$("#btnCloseMobile").click(function(){dialogTimeTable.close()}),$("#customTimes").prepend(`

 

`),$("#customTitle").css({margin:"0","margin-top":"16px","font-weight":"1000","font-size":"1.25em",display:"inline"}),$("#btnCloseMobileCustom").click(function(){closeCustomDialog()}),$("#spanSave").append($("#btnSave")),$("#btnCloseCustom,#footerCustom").hide(),$("#aboutDialog").prepend(`
`),$("#titleAbout").removeClass("mdl-dialog__title"),$("#titleAbout").css({margin:"0","margin-top":"16px","font-weight":"1000","font-size":"1.25em",display:"inline"}),$("#spanTitleAbout").append($("#titleAbout")),$("#btnCloseMobileAbout").click(function(){dialogAbout.close()}),$("#divCloseAbout").hide());for(let a=0;lngObject.meetingAt===void 0&&4>a;)setTimeout(function(){titleMeeting.innerHTML=`${lngObject.meetingAt} ${moment().format(dateFormat)}`},1e3),a++},100),isFirstRun&&dialogWelcome.showModal(),checkMode(),$(function(){$("#tickAll").change(function(){$(".mdl-js-checkbox").not("#lblTickAll").each(function(){let a=this;setTimeout(function(){$("#lblTickAll").is(".is-checked")?a.MaterialCheckbox.check():a.MaterialCheckbox.uncheck()},10)}),refreshControls()}),"iOS"===os?$("#btnShare,#btnEmail").hide():(btnShare.style.visibility="hidden",btnEmail.style.visibility="hidden"),isFirstTime=!0,"desktop"===deviceDetector.device?($("#timeTable").addClass("centeredDialog"),$("#timeTable").addClass("fullscreen-dialog-tablet"),$("#aboutDialog").addClass("fullscreen-dialog-desktop"),document.getElementById("divSpeakers").style.height=`${.53*document.body.clientHeight}px`):"tablet"===deviceDetector.device?($("#timeTable").addClass("centeredDialog"),$("#timeTable").addClass("fullscreen-dialog-tablet"),$("#aboutDialog").addClass("fullscreen-dialog-tablet"),document.getElementById("divSpeakers").style.height=`${.53*document.body.clientHeight}px`):($("#bodyCustomTimes").addClass("customBodyMobile"),document.getElementById("divSpeakers").style.height=514>window.innerHeight&&window.innerWidth>window.innerHeight?`${.6*document.body.clientHeight}px`:`${.75*document.body.clientHeight}px`,$("#timeTable").addClass("fullscreen-dialog"),$("#customTimes").addClass("fullscreen-dialog"),$("#aboutDialog").addClass("fullscreen-dialog")),"function"!=typeof HTMLDialogElement&&($("#welcomeDialog").removeClass("centeredDialog"),$("#welcomeDialog").addClass("centeredDialogNoSupport"),$("#setTimeDialog").removeClass("centeredDialog"),$("#setTimeDialog").addClass("centeredDialogNoSupport")),$("body").focus(function(){"-1"!==$(".mdl-menu__outline").eq(0).css("z-index")&&resizeSelect()})}),resizeScreen(),$.fn.hideKeyboard=function(){var a=this.filter("input").attr("readonly","readonly");return setTimeout(function(){a.blur().removeAttr("readonly")},100),this},window.addEventListener("orientationchange",doOnOrientationChange);function doOnOrientationChange(){location.reload()} \ No newline at end of file +const displayOutput=document.querySelector(".display-remain-time"),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"),btnSave=document.getElementById("btnSave"),btnSaveClap=document.getElementById("btnSaveClap"),btnAbout=document.getElementById("btnAbout"),btnUpH=document.getElementById("btnUpH"),btnUpM=document.getElementById("btnUpM"),btnUpS=document.getElementById("btnUpS"),btnDownH=document.getElementById("btnDownH"),btnDownM=document.getElementById("btnDownM"),btnDownS=document.getElementById("btnDownS"),imgClap=document.getElementById("imgClap"),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"),titleMeeting=document.getElementById("titleMeeting"),divSpeaker=document.getElementById("divSpeaker"),snackbarMsg=document.getElementById("snackbarMsg"),length=100*(2*Math.PI);let intervalTimer,clappingTime=30,wholeTime=30,selected=-1,minimum=0,average=0,maximum=0,selectedColor=0,green=0,yellow=0,red=0,timeLeft=0,elements=new Map,isPaused=!1,isStarted=!1,isStopped=!0,isBeepEnabled=!1,isVibrateEnabled=!1,isClappingEnabled=!1,isContestMode=!1,isCustom=!1,isFirstRun=!0,clappingStarted=!1,multipleEnabled=!1,isNinjaMode=!1,isFirstTime=!1,dateFormat="DD/MM/YYYY",latestDB="1.0",currentDB="1.0",lastColor="white",countries=["US","FM","MH","PH"],bgColors=["white","black"],times=[[10,20,30],[240,300,360],[300,360,420],[480,540,600],[60,75,90],[120,150,180],[300,330,360],[60,90,120],[600,660,720],[780,840,900],[1080,1170,1200],[30,45,60]],progressBar=document.querySelector(".e-c-progress"),indicator=document.getElementById("e-indicator"),pointer=document.getElementById("e-pointer");var results=[];progressBar.style.strokeDasharray=length;function update(a,b){0<=a&&(progressBar.style.strokeDashoffset=-(-length-length*a/b),pointer.style.transform=`rotate(${360*a/-b}deg)`)}update(wholeTime,wholeTime),displayTimeLeft(wholeTime),checkMode();function setDateFormat(){countries.includes(navigator.language.split("-")[1])&&(dateFormat="MM/DD/YYYY")}function getTimeStamp(a){return moment.utc(1e3*a).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(a){0",timeLeft=0,currentState=1}function timer(a){let b=Date.now()+1e3*a;displayTimeLeft(a),intervalTimer=setInterval(function(){timeLeft=Math.round((b-Date.now())/1e3);let a=maximum-timeLeft;a>=minimum&&a=average&&a=maximum&&(red++,document.body.style.background="#e53935",startBeep(),startVibrate(),lastColor="red"),a>=maximum+clappingTime&&(!clappingStarted&&startClapping(),clappingStarted=!0),displayTimeLeft(timeLeft)},1e3)}window.onresize=function(){resizeScreen()};function resizeScreen(){let a=window.innerHeight/600;514>window.innerHeight?($("body").prepend($("
")),$("#externalContainer").append($("#superContainer")),$("#externalContainer").css("height",`${window.innerHeight}px`),$("#superContainer").css("transform-origin","50% 0% 0px"),setTimeout(function(){$("#superContainer").css("transform",`scale(${a}`),setTimeout(function(){let b=(1+a)*window.innerHeight;514>b&&(b=514),$("#superContainer").css("height",`${b}px`)},100)},100)):($("#superContainer").css("height",`${window.innerHeight}px`),$("#superContainer").css("transform-origin","50% 0% 0px"),setTimeout(function(){$("#superContainer").css("transform",`scale(${a}`)},100),setTimeout(function(){$(".mdl-textfield__input")[0].getBoundingClientRect().width>$("body").outerWidth()&&$("#superContainer").css("transform",`scale(${a-(a-$(".mdl-textfield__input")[0].getBoundingClientRect().width/$("body").outerWidth())}`)},100))}function resizeSelect(){setTimeout(function(){$(".mdl-menu__outline").first().width(300),$(".mdl-menu__container").first().width(300),$(".mdl-menu__outline").first().height(310),$(".mdl-menu__container").first().height(310);var a=$(".mdl-menu").first().css("clip").split(", ");a[1]=a[1].replace("px",""),a[2]=a[2].replace("px",""),$(".mdl-menu").first().css("clip",`${a[0]}, 300px, 300px, ${a[3]}`)},50)}function pauseTimer(){return 0===minimum&&0===maximum&&0===average||-1===selected?void(isCustom?showSnackbar(lngObject.notSaved):showSnackbar(lngObject.chooseTime)):void(validateProperIntervals(),browserStopClapping(),isStopped=!1,btnInvert.disabled=!0,cmbSpeechType.disabled=!0,isStarted&&timeLeft!==void 0?isPaused?(btnPause.classList.remove("play"),btnPause.classList.add("pause"),timer(timeLeft),isPaused=!isPaused):(btnPause.classList.remove("pause"),btnPause.classList.add("play"),clearInterval(intervalTimer),isPaused=!isPaused):(timer(wholeTime),isStarted=!0,btnPause.classList.remove("play"),btnPause.classList.add("pause")),btnRestart.disabled=!isPaused,btnRestart.disabled?(btnRestart.innerHTML="",$("footer,#divSpeechType,#options,#divSpeaker").fadeTo("fast","0.1"),isNinjaMode&&($(".circle").fadeTo("fast","0"),$("#controls").fadeTo("fast","0.5"))):(btnRestart.innerHTML="",$("footer,#divSpeechType,#options,#divSpeaker,.circle,#controls").fadeTo("fast","1")))}function displayTimeLeft(a){let b=maximum-a,c=Math.floor(b/3600),d=Math.floor(b/60),e=b%60,f=`${10>c?"0":""}${c}:${10>d?"0":""}${d}:${10>e?"0":""}${e}`;displayOutput.textContent=f,update(a,wholeTime)}function setDropDownValue(a,b){try{$(a).attr("data-selected","true"),getmdlSelect.init(b)}catch(a){}}function validateProperIntervals(){isCustom?(minimum=getMinCustom(),average=getAvgCustom(),maximum=getMaxCustom()):setBasicIntervals(),0===timeLeft&&(wholeTime=maximum)}function setBasicIntervals(){let a=selected;11":""}function setVibrateImg(){btnVibrate.innerHTML=isVibrateEnabled?"":""}function setBeepImg(){btnBeep.innerHTML=isBeepEnabled?"":""}function setClappingImg(){imgClap.src=isClappingEnabled?"img/clapping-hands.svg":"img/clapping-off.svg"}function invertColors(){1===selectedColor?$("body").css("filter","invert(100%)"):$("body").css("filter","invert(0%)"),document.body.style.background=lastColor}function storeTime(a){if(0!==minimum||0!==maximum||0!==average){if(stopClapping(),a){let a=maximum-timeLeft,b=cmbSpeechType.value;11===selected&&(b=txtCustom.value),addNewTime(txtSpeaker.value,b,getTimeStamp(minimum),getTimeStamp(average),getTimeStamp(maximum),getTimeStamp(a),lastColor,a>maximum+clappingTime||a=b?showSnackbar(lngObject.errorMin):a>=c?showSnackbar(lngObject.errorHalf):b>=c?showSnackbar(lngObject.errorMax):(minimum=a,average=b,maximum=c,wholeTime=maximum,updateDisplay(),dialogCustomTimes.close())}btnPause.addEventListener("click",function(a){1===a.detail&&pauseTimer()}),btnRestart.addEventListener("click",()=>{storeTime(!1)}),btnStop.addEventListener("click",()=>{storeTime(!0)}),btnChampion.addEventListener("click",function(a){3===a.detail?(isNinjaMode=!isNinjaMode,isNinjaMode?showSnackbar(lngObject.ninjaEnabled,!1):showSnackbar(lngObject.ninjaDisabled,!1),setLocalStorage("isNinjaMode",isNinjaMode)):(isContestMode=!isContestMode,setContestImg(),checkMode(),setContestMode())}),btnVibrate.addEventListener("click",()=>{isVibrateEnabled=!isVibrateEnabled,setVibrateImg(),setVibrate()}),btnBeep.addEventListener("click",()=>{isBeepEnabled=!isBeepEnabled,setBeepImg(),setBeep()}),btnClap.addEventListener("click",function(a){3===a.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",function(){isContestMode=!0,setContestImg(),checkMode(),setContestMode(),dialogWelcome.close(),isFirstRun=!1,setFirstRun()}),btnYesConfirm.addEventListener("click",deleteByIDs),btnInvert.addEventListener("click",function(){selectedColor=0===selectedColor?1:0,lastColor=bgColors[selectedColor],setSelectedColor(),invertColors()}),btnYesChanges.addEventListener("click",function(){saveChanges(),dialogChanges.close()}),btnShare.addEventListener("click",function(){}),btnEmail.addEventListener("click",function(){}),btnAbout.addEventListener("click",function(){dialogAbout.showModal(),"phone"===deviceDetector.device&&setTimeout(function(){$("#bodyAbout").css({height:`${100*$("#bodyAbout").height()/$("html").height()}%`})},100)}),txtMin.addEventListener("click",function(){setNewTime("txtMin",txtMin.value)}),txtMax.addEventListener("click",function(){setNewTime("txtMax",txtMax.value)}),txtAvg.addEventListener("click",function(){setNewTime("txtAvg",txtAvg.value)}),btnDownload.addEventListener("click",browserExport),btnMultiple.addEventListener("click",function(){$(".mdl-js-checkbox").each(function(){let a=this;setTimeout(function(){a.MaterialCheckbox.check()},10)}),multipleEnabled?(btnMultiple.innerHTML="",$(".tdDel,#thDel").hide()):(btnMultiple.innerHTML="",$(".tdDel,#thDel").show()),multipleEnabled=!multipleEnabled,refreshControls()}),dialogTimeTable.querySelector(".close").addEventListener("click",function(){dialogTimeTable.close()}),dialogCustomTimes.querySelector(".close").addEventListener("click",closeCustomDialog),dialogConfirm.querySelector(".close").addEventListener("click",function(){dialogConfirm.close()}),dialogAbout.querySelector(".close").addEventListener("click",function(){dialogAbout.close()}),dialogChanges.querySelector(".close").addEventListener("click",function(){dialogChanges.close(),dialogCustomTimes.close()}),dialogWelcome.querySelector(".close").addEventListener("click",function(){dialogWelcome.close(),isFirstRun=!1,setFirstRun(),showSnackbar(lngObject.noHints)}),txtCustom.addEventListener("keyup",function(a){13===a.keyCode&&$("#txtCustom").hideKeyboard()}),txtSpeaker.addEventListener("keyup",function(a){13===a.keyCode&&$("#txtSpeaker").hideKeyboard()}),document.addEventListener("DOMContentLoaded",function(){cmbSpeechType.onchange=changeEventHandler},!1),cmbSpeechType.addEventListener("click",resizeSelect),maximum=0,wholeTime=0,getBeep(),getVibrate(),getClapping(),getContestMode(),getSelectedColor(),getNinjaMode(),getFirstRun(),setContestImg(),setVibrateImg(),setBeepImg(),setClappingImg(),setSelectedColor(),setDateFormat(),initializeDB(currentDB,latestDB),lastColor=bgColors[selectedColor],invertColors(),setTimeout(function(){"phone"==deviceDetector.device&&($("#timeTable").prepend(`
`),$("#titleMeeting").removeClass("mdl-dialog__title"),$("#titleMeeting").css({margin:"0","margin-top":"16px","font-weight":"1000","font-size":"1.25em",display:"inline"}),$("#spanTitle").append($("#titleMeeting")),$("#btnCloseMeeting").hide(),$("#btnCloseMobile").click(function(){dialogTimeTable.close()}),$("#customTimes").prepend(`

 

`),$("#customTitle").css({margin:"0","margin-top":"16px","font-weight":"1000","font-size":"1.25em",display:"inline"}),$("#btnCloseMobileCustom").click(function(){closeCustomDialog()}),$("#spanSave").append($("#btnSave")),$("#btnCloseCustom,#footerCustom").hide(),$("#aboutDialog").prepend(`
`),$("#titleAbout").removeClass("mdl-dialog__title"),$("#titleAbout").css({margin:"0","margin-top":"16px","font-weight":"1000","font-size":"1.25em",display:"inline"}),$("#spanTitleAbout").append($("#titleAbout")),$("#btnCloseMobileAbout").click(function(){dialogAbout.close()}),$("#divCloseAbout").hide());let a=0;do setTimeout(function(){try{titleMeeting.innerHTML=`${lngObject.meetingAt} ${moment().format(dateFormat)}`}catch(a){}},1e3),a++;while(lngObject===void 0&&5>a)},100),isFirstRun&&dialogWelcome.showModal(),checkMode(),$(function(){$("#tickAll").change(function(){$(".mdl-js-checkbox").not("#lblTickAll").each(function(){let a=this;setTimeout(function(){$("#lblTickAll").is(".is-checked")?a.MaterialCheckbox.check():a.MaterialCheckbox.uncheck()},10)}),refreshControls()}),"iOS"===os?$("#btnShare,#btnEmail").hide():(btnShare.style.visibility="hidden",btnEmail.style.visibility="hidden"),isFirstTime=!0,"desktop"===deviceDetector.device?($("#timeTable").addClass("centeredDialog"),$("#timeTable").addClass("fullscreen-dialog-tablet"),$("#aboutDialog").addClass("fullscreen-dialog-desktop"),document.getElementById("divSpeakers").style.height=`${.53*document.body.clientHeight}px`):"tablet"===deviceDetector.device?($("#timeTable").addClass("centeredDialog"),$("#timeTable").addClass("fullscreen-dialog-tablet"),$("#aboutDialog").addClass("fullscreen-dialog-tablet"),document.getElementById("divSpeakers").style.height=`${.53*document.body.clientHeight}px`):($("#bodyCustomTimes").addClass("customBodyMobile"),document.getElementById("divSpeakers").style.height=514>window.innerHeight&&window.innerWidth>window.innerHeight?`${.6*document.body.clientHeight}px`:`${.75*document.body.clientHeight}px`,$("#timeTable").addClass("fullscreen-dialog"),$("#customTimes").addClass("fullscreen-dialog"),$("#aboutDialog").addClass("fullscreen-dialog")),"function"!=typeof HTMLDialogElement&&($("#welcomeDialog").removeClass("centeredDialog"),$("#welcomeDialog").addClass("centeredDialogNoSupport"),$("#setTimeDialog").removeClass("centeredDialog"),$("#setTimeDialog").addClass("centeredDialogNoSupport")),$("body").focus(function(){"-1"!==$(".mdl-menu__outline").eq(0).css("z-index")&&resizeSelect()})}),resizeScreen(),$.fn.hideKeyboard=function(){var a=this.filter("input").attr("readonly","readonly");return setTimeout(function(){a.blur().removeAttr("readonly")},100),this},window.addEventListener("orientationchange",doOnOrientationChange);function doOnOrientationChange(){location.reload()} \ No newline at end of file