Skip to content

Commit

Permalink
Add version information
Browse files Browse the repository at this point in the history
  • Loading branch information
lbussy committed Apr 4, 2020
1 parent b58873b commit 80bc598
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions data/about.htm
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ <h1>About</h1>

<!-- About Brew Bubbles Information -->
<div class="card-header">
<h4 class="card-title">Brew Bubbles Information</h4>
<h4 class="card-title">Brew Bubbles <span id="thisVersion">v0.0.0</span></h4>
</div>
<div class="card-body">
<p><a href="https://www.brewbubbles.com/">Brew Bubbles</a> is a project by Lee
Bussy and <a href="/license.htm">is licensed under
The MIT License</a>. Inquiries may be directed to
The MIT License</a>. Inquiries may be directed to
<a href="https://www.homebrewtalk.com/forum/members/lbussy.144719/">LBussy</a> on the
HomeBrewTalk Forums (free registration required).
</p>
Expand All @@ -121,6 +121,41 @@ <h4 class="card-title">Brew Bubbles Information</h4>
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
</script>

<script type="text/javascript">
// Attach the event after the page loads
if (window.addEventListener)
window.addEventListener("load", loadPage, false);
else if (window.attachEvent)
window.attachEvent("onload", loadPage);
else window.onload = loadPage;

function loadPage() { // Load the page's JS elements
loadThisVersion(); // Populate form with controller settings
}

function loadThisVersion() { // Get current parameters
var thisVersionJson = "/thisVersion/";
var thisVersion = $.getJSON(thisVersionJson, function () {
})
.done(function (thisVersion) {
try {
$('#thisVersion').text("v" + thisVersion.version);
}
catch {
alert("Unable to parse current version from controller.");
$('#thisVersion').text("(Error loading version.)");
}
})
.fail(function () {
alert("Failed getting current version from controller.");
$('#thisVersion').text("(Error loading version.)");
})
.always(function () {
// Can post-process here
});
}
</script>

</body>

</html>

0 comments on commit 80bc598

Please sign in to comment.