mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 21:21:15 -07:00
Make the shutdown/restart/update screens pretty :)
This commit is contained in:
parent
dd90f2e375
commit
5b2d03f496
3 changed files with 101 additions and 8 deletions
|
@ -276,3 +276,27 @@ function millisecondsToMinutes(ms, roundToMinute) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Our countdown plugin takes a callback, a duration, and an optional message
|
||||
$.fn.countdown = function (callback, duration, message) {
|
||||
// If no message is provided, we use an empty string
|
||||
message = message || "";
|
||||
// Get reference to container, and set initial content
|
||||
var container = $(this[0]).html(duration + message);
|
||||
// Get reference to the interval doing the countdown
|
||||
var countdown = setInterval(function () {
|
||||
// If seconds remain
|
||||
if (--duration) {
|
||||
// Update our container's message
|
||||
container.html(duration + message);
|
||||
// Otherwise
|
||||
} else {
|
||||
// Clear the countdown interval
|
||||
clearInterval(countdown);
|
||||
// And fire the callback passing our container as `this`
|
||||
callback.call(container);
|
||||
}
|
||||
// Run interval every 1000ms (1 second)
|
||||
}, 1000);
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue