mirror of
https://github.com/unraid/webgui.git
synced 2026-02-15 13:38:56 -06:00
Revert "Use timers variable for banner warnings"
This reverts commit 8b8a9d3ea6.
This commit is contained in:
@@ -234,7 +234,7 @@ function escapeQuotes(form) {
|
||||
|
||||
var bannerWarnings = [];
|
||||
var currentBannerWarning = 0;
|
||||
var timers.bannerWarning = null;
|
||||
var bannerWarningInterval = null;
|
||||
var osUpgradeWarning = false;
|
||||
|
||||
function addBannerWarning(text,warning=true,noDismiss=false) {
|
||||
@@ -246,7 +246,11 @@ function addBannerWarning(text,warning=true,noDismiss=false) {
|
||||
if (!noDismiss) text += "<a class='bannerDismiss' onclick='dismissBannerWarning("+arrayEntry+",""+cookieText+"")'></a>";
|
||||
bannerWarnings[arrayEntry] = text;
|
||||
} else return bannerWarnings.indexOf(text);
|
||||
if (timers.bannerWarning==null) showBannerWarnings();
|
||||
|
||||
if (!bannerWarningInterval) {
|
||||
showBannerWarnings();
|
||||
bannerWarningInterval = setInterval(showBannerWarnings,10000);
|
||||
}
|
||||
return arrayEntry;
|
||||
}
|
||||
|
||||
@@ -257,7 +261,6 @@ function dismissBannerWarning(entry,cookieText) {
|
||||
|
||||
function removeBannerWarning(entry) {
|
||||
bannerWarnings[entry] = false;
|
||||
clearTimeout(timers.bannerWarning);
|
||||
showBannerWarnings();
|
||||
}
|
||||
|
||||
@@ -273,13 +276,12 @@ function showBannerWarnings() {
|
||||
var allWarnings = bannerFilterArray(Object.values(bannerWarnings));
|
||||
if (allWarnings.length == 0) {
|
||||
$(".upgrade_notice").hide();
|
||||
timers.bannerWarning = null;
|
||||
clearInterval(bannerWarningInterval);
|
||||
return;
|
||||
}
|
||||
if (currentBannerWarning >= allWarnings.length) currentBannerWarning = 0;
|
||||
$(".upgrade_notice").show().html(allWarnings[currentBannerWarning]);
|
||||
currentBannerWarning++;
|
||||
timers.bannerWarning = setTimeout(showBannerWarnings,10000);
|
||||
}
|
||||
|
||||
function addRebootNotice(message="<?=_('You must reboot for changes to take effect')?>") {
|
||||
|
||||
Reference in New Issue
Block a user