Edit File by line
/home/barbar84/public_h.../wp-conte.../maintena.../assets
File: timer.js
// Copyright 1999-2017. Plesk IP Holdings GmbH. All Rights Reserved.
[0] Fix | Delete
var startTimer = function(days, hours, minutes, startTime, timeShift) {
[1] Fix | Delete
var currentDateInSeconds = Math.floor(Date.now() / 1000);
[2] Fix | Delete
var endTime = startTime + (days * 86400) + (hours * 3600) + (minutes * 60);
[3] Fix | Delete
var diff = Math.max(0, endTime - currentDateInSeconds - timeShift);
[4] Fix | Delete
[5] Fix | Delete
displayTimerValues(diff);
[6] Fix | Delete
[7] Fix | Delete
if (0 < diff) {
[8] Fix | Delete
setTimeout(function() {
[9] Fix | Delete
startTimer(days, hours, minutes, startTime, timeShift);
[10] Fix | Delete
}, 1000);
[11] Fix | Delete
}
[12] Fix | Delete
};
[13] Fix | Delete
[14] Fix | Delete
var displayTimerValues = function (diff) {
[15] Fix | Delete
var currentDays = Math.floor(diff / 86400);
[16] Fix | Delete
diff -= currentDays * 86400;
[17] Fix | Delete
[18] Fix | Delete
var currentHours = Math.floor(diff / 3600) % 24;
[19] Fix | Delete
diff -= currentHours * 3600;
[20] Fix | Delete
[21] Fix | Delete
var currentMinutes = Math.floor(diff / 60) % 60;
[22] Fix | Delete
diff -= currentMinutes * 60;
[23] Fix | Delete
[24] Fix | Delete
var seconds = diff % 60;
[25] Fix | Delete
fillTimerValue("timerResultDays", currentDays);
[26] Fix | Delete
fillTimerValue("timerResultHours", currentHours);
[27] Fix | Delete
fillTimerValue("timerResultMinutes", currentMinutes);
[28] Fix | Delete
fillTimerValue("timerResultSeconds", seconds);
[29] Fix | Delete
};
[30] Fix | Delete
[31] Fix | Delete
var fillTimerValue = function(elementName, value) {
[32] Fix | Delete
var element = document.getElementById(elementName);
[33] Fix | Delete
if (element) {
[34] Fix | Delete
element.innerHTML = (value < 10) ? "0" + value : value;
[35] Fix | Delete
}
[36] Fix | Delete
};
[37] Fix | Delete
[38] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function