1class EditorPlusCountdown { 2 constructor(wrapper) { 3 this.container = wrapper; 4 this.days = this.container.querySelector(".ep_cd_days"); 5 this.hours = this.container.querySelector(".ep_cd_hours"); 6 this.minutes = this.container.querySelector(".ep_cd_minutes"); 7 this.seconds = this.container.querySelector(".ep_cd_seconds"); 8 9 this.date = this.container.dataset.date; 10 11 this.initialize(); 12 } 13 14 initialize() { 15 this.startCountdown(); 16 } 17 18 startCountdown() { 19 let countDownTime = new Date(this.date).getTime(); 20 21 let interval = setInterval(() => { 22 let currentTime = new Date().getTime(); 23 let distance = countDownTime - currentTime; 24 if (distance < 0) { 25 clearInterval(interval); 26 return; 27 } 28 // Time calculations for days, hours, minutes and seconds 29 let getDays = Math.floor(distance / (1000 * 60 * 60 * 24)); 30 let getHours = Math.floor( 31 (distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60) 32 ); 33 let getMinutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 34 let getSeconds = Math.floor((distance % (1000 * 60)) / 1000); 35 36 this.days.innerHTML = getDays < 10 ? "0" + getDays : getDays; 37 this.hours.innerHTML = getHours < 10 ? "0" + getHours : getHours; 38 this.minutes.innerHTML = getMinutes < 10 ? "0" + getMinutes : getMinutes; 39 this.seconds.innerHTML = getSeconds < 10 ? "0" + getSeconds : getSeconds; 40 }, 1000); 41 } 42} 43 44window.addEventListener("load", () => { 45 const wrappers = document.querySelectorAll(".ep_countdown_wrapper"); 46 wrappers.forEach((wrapper) => new EditorPlusCountdown(wrapper)); 47});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.