Skip to content

Commit

Permalink
Update webpage.html
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba6000 committed Feb 12, 2025
1 parent c17fe14 commit e99ef2a
Showing 1 changed file with 70 additions and 5 deletions.
75 changes: 70 additions & 5 deletions src/main/resources/assets/webpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,27 @@
-ms-transform: translate(-50%,-50%);
}

#topMessages{
position: fixed;
width: 100%;
text-align: center;
background-color: #929292;
transition: 0.2s;
}

#topMessages > *{
display: block;
text-align: center;
margin: 10px 0;
font-size: 130%;
}

#topMessages > * > button{
float: right;
margin-right: 10px;
}


footer {
position: fixed;
Width: 100%;
Expand Down Expand Up @@ -404,14 +425,17 @@
<title>AE2</title>
</head>
<body>
<h1>UNIVERSAL WEB TERMINAL</h1>
<section id="topMessagesContainer">
<section id="topMessages">

</section>
</section>
<h1>UNIVERSAL WEB TERMINAL</h1>
<section id="overlay">
<section id="overlaytext">
LOADING...
</section>
</section>

<section id="terminalcontainer">
<section id="terminaltypes">
<section id='terminalOptions'>
Expand Down Expand Up @@ -1443,9 +1467,50 @@ <h1>UNIVERSAL WEB TERMINAL</h1>
getItemList();

function showAlertIfOutdated() {
if (isOutdated) alert("New version detected! Consider updating at https://github.com/kuba6000/AE2-Web-Integration/releases/latest");
if (isOutdated){
if (getCookie("DoNotShowUpdateMessage") == 1) return;
pushTopMessage("<span>New version detected! Consider updating from <a href='https://github.com/kuba6000/AE2-Web-Integration/releases/'>github</a></span> <button onclick='closeTopMessage(this.parentElement);'>Close</button><button onclick='updateDoNotShowAgain(this.parentElement);'>Hide for 7 days</button><br style='clear: both;'/>");
}
else
{
setCookie("DoNotShowUpdateMessage", 0, 0);
}
}
setTimeout(showAlertIfOutdated, 100);

function updateDoNotShowAgain(el){
setCookie("DoNotShowUpdateMessage", 1, 7);
closeTopMessage(el);
}

topMessages = [];
function pushTopMessage(message){
topMessages.push(message);
updateTopMessages();
}

function popTopMessage(i){
topMessages.splice(i, 1);
updateTopMessages();
}

function closeTopMessage(el){
let message = el.getAttribute('topMessageID');
popTopMessage(message);
}
setTimeout(showAlertIfOutdated, 1000);

function updateTopMessages(){
let html = "";
let i = 0;
for(let message of topMessages){
html += '<section topMessageID=' + i + '>' + message + '</section>';
i++;
}
document.getElementById('topMessages').innerHTML = html;

$("#topMessagesContainer").height($("#topMessages").height());
}


// make collapsible work
let coll = document.getElementsByClassName("collapsible");
Expand All @@ -1465,7 +1530,7 @@ <h1>UNIVERSAL WEB TERMINAL</h1>
</script>
<br><br>
<footer>
This service is hosted by <a href="https://github.com/kuba6000/AE2-Web-Integration">AE2 Web Integration</a> Made by <a href="https://github.com/kuba6000">@kuba6000</a>
This service is hosted using <a href="https://github.com/kuba6000/AE2-Web-Integration">AE2 Web Integration</a> Made by <a href="https://github.com/kuba6000">@kuba6000</a>
</footer>
</body>
</html>

0 comments on commit e99ef2a

Please sign in to comment.