Our release is now fully ready, make sure everyone is on it!

New Minimum: 1.8.7 (8193)
New Recommended Release: 1.8.9 (8338)
New Recommended Alpha: 1.8.9 (8382)
Add Mac alpha release 1.8.9 (8709)
Go back to using dates in download widget
Clean up old code from the old login wrapper
Make all builds using the login wrapper report outdated.
This commit is contained in:
Liru Færs
2020-05-07 10:13:27 -04:00
parent 95de43f5b6
commit a0e1f69b91
3 changed files with 37 additions and 133 deletions

View File

@@ -3,26 +3,26 @@
"url":"http://www.singularityviewer.org/", "url":"http://www.singularityviewer.org/",
"recommended":{ "recommended":{
"windows":"1.8.9 (8338)", "windows":"1.8.9 (8338)",
"apple":"1.8.6 (6157)", "apple":"1.8.9 (8709)",
"linux":"1.8.9 (8338)" "linux":"1.8.9 (8338)"
}, },
"minimum":{ "minimum":{
"windows":"1.8.9 (8338)", "windows":"1.8.9 (8338)",
"apple":"1.8.6 (6157)", "apple":"1.8.9 (8709)",
"linux":"1.8.9 (8338)" "linux":"1.8.9 (8338)"
} }
}, },
"alpha":{ "alpha":{
"url":"http://www.singularityviewer.org/kb/nightly-builds", "url":"http://www.singularityviewer.org/kb/nightly-builds",
"recommended":{ "recommended":{
"windows":"1.8.9 (8363)", "windows":"1.8.9 (8382)",
"apple":"1.8.7 (8482)", "apple":"1.8.9 (8709)",
"linux":"1.8.7 (8193)" "linux":"1.8.9 (8382)"
}, },
"minimum":{ "minimum":{
"windows":"1.8.7 (8185)", "windows":"1.8.7 (8193)",
"apple":"1.8.7 (8243)", "apple":"1.8.9 (8709)",
"linux":"1.8.7 (8185)" "linux":"1.8.7 (8193)"
} }
} }
} }

View File

@@ -73,13 +73,13 @@ span{
<a id="windows" <a id="windows"
href="https://github.com/singularity-viewer/SingularityViewer/releases/download/sv-1.8.9.8338-release/Singularity_1_8_9_8338_i686_Setup.exe"><span> href="https://github.com/singularity-viewer/SingularityViewer/releases/download/sv-1.8.9.8338-release/Singularity_1_8_9_8338_i686_Setup.exe"><span>
Singularity 1.8.9 (8338)<br/> Singularity 1.8.9 (8338)<br/>
Latest Builds 1 Apr 2020
for Windows for Windows
</span></a> </span></a>
<a id="windows64" <a id="windows64"
href="https://github.com/singularity-viewer/SingularityViewer/releases/download/sv-1.8.9.8338-release/Singularity_1_8_9_8338_x86_64_Setup.exe"><span> href="https://github.com/singularity-viewer/SingularityViewer/releases/download/sv-1.8.9.8338-release/Singularity_1_8_9_8338_x86_64_Setup.exe"><span>
Singularity 1.8.9 (8338)<br/> Singularity 1.8.9 (8338)<br/>
Latest Builds 1 Apr 2020
for Windows for Windows
</span></a> </span></a>
<a id="windows_chrome" <a id="windows_chrome"
@@ -89,15 +89,15 @@ Latest Builds
for Windows for Windows
</span></a> </span></a>
<a id="mac" <a id="mac"
href="https://bitbucket.org/SingularityViewer/singularityviewer/downloads/Singularity_1_8_6_6156.dmg"><span> href="https://bitbucket.org/router_gray/singularityviewer/downloads/Singularity_Alpha_1_8_9_8709_x86_64.dmg"><span>
Singularity 1.8.6(6156)<br/> Singularity 1.8.9 (8709)<br/>
4 Sep 2014 7 May 2020
for OS X for OS X
</span></a> </span></a>
<a id="linux64" <a id="linux64"
href="https://github.com/singularity-viewer/SingularityViewer/releases/download/sv-1.8.9.8338-release/Singularity_1_8_9_8338_x86_64.tar.xz"><span> href="https://github.com/singularity-viewer/SingularityViewer/releases/download/sv-1.8.9.8338-release/Singularity_1_8_9_8338_x86_64.tar.xz"><span>
Singularity 1.8.9 (8338)<br/> Singularity 1.8.9 (8338)<br/>
Latest Builds 1 Apr 2020
for Linux64 for Linux64
</span></a> </span></a>
<a id="linux" <a id="linux"

View File

@@ -7,31 +7,17 @@
//<![CDATA[ //<![CDATA[
/* /*
* Source: https://github.com/singularity-viewer/login-page * Source: https://github.com/singularity-viewer/login-page
*
* Paramaters
* CURRENT VERSION GOES HERE
*/ */
var toolbarShown = true;
var urlParams = {};
var current_version = "1.8.9 (8338)"; // Replace addition symbols with space
// Minimum recommended alpha version
var min_alpha = "1.8.7 (8185)";
/*
* Main functionality (no need to edit anything below to udpate the version)
*/
var toolbarShown = false;
var urlParams;
function parseUrlParams() { function parseUrlParams() {
var match, function decode(s) { return decodeURIComponent(s.replace(/\+/g, " ")); }
pl = /\+/g, // Regex for replacing addition symbol with a space const search = /([^&=]+)=?([^&]*)/g;
search = /([^&=]+)=?([^&]*)/g, const query = window.location.search.substring(1);
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); }, let match = undefined;
query = window.location.search.substring(1);
urlParams = {};
while (match = search.exec(query)) while (match = search.exec(query))
urlParams[decode(match[1])] = decode(match[2]); urlParams[decode(match[1])] = decode(match[2]);
} }
@@ -43,10 +29,11 @@ function pageY(elem)
function resizeIframe() function resizeIframe()
{ {
var height = document.documentElement.clientHeight; let height = document.documentElement.clientHeight;
height -= pageY(document.getElementById('origpage')); let orig = document.getElementById('origpage');
height -= pageY(orig);
height = (height < 0) ? 0 : height; height = (height < 0) ? 0 : height;
document.getElementById('origpage').style.height = height + 'px'; orig.style.height = height + 'px';
} }
function setVisible(e, visible) function setVisible(e, visible)
@@ -54,14 +41,7 @@ function setVisible(e, visible)
var elem = document.getElementById(e); var elem = document.getElementById(e);
if (!elem) return; if (!elem) return;
if (visible) elem.style.display = visible ? "block" : "none";
{
elem.style.display = "block";
}
else
{
elem.style.display = "none";
}
} }
function updateVisibility(visible) function updateVisibility(visible)
@@ -77,100 +57,25 @@ function toggleToolbar()
updateVisibility(toolbarShown); updateVisibility(toolbarShown);
} }
function cleanVersion(v)
{
return v.toString()
.replace(/^.*?(\d)/g, "$1") // Get rid of everything before the first digit
.replace(/(.*\d).*/g, "$1") // Get rid of everything after the lst digit
.replace(/[^\d]+/g, ".") // Convert all non-digits to dots
}
function compareVersion(a, b)
{
if (a === b)
{
return 0;
}
var a_components = cleanVersion(a).split(".");
var b_components = cleanVersion(b).split(".");
var len = Math.min(a_components.length, b_components.length);
// loop while the components are equal
for (var i = 0; i < len; i++)
{
// A bigger than B
if (parseInt(a_components[i]) > parseInt(b_components[i]))
{
return 1;
}
// B bigger than A
if (parseInt(a_components[i]) < parseInt(b_components[i]))
{
return -1;
}
}
// If one's a prefix of the other, the longer one is greater.
if (a_components.length > b_components.length)
{
return 1;
}
if (a_components.length < b_components.length)
{
return -1;
}
// Otherwise they are the same.
return 0;
}
// Main // Main
window.onload = function() window.onload = function()
{ {
parseUrlParams(); parseUrlParams();
if (!urlParams["original_page"] || !urlParams["version"]) return; if (!urlParams["original_page"] || !urlParams["channel"]) return;
window.onresize = resizeIframe; window.onresize = resizeIframe;
document.getElementById('origpage').onload = resizeIframe; let orig = document.getElementById('origpage');
document.getElementById('origpage').setAttribute("src", urlParams["original_page"]); orig.onload = resizeIframe;
orig.setAttribute("src", urlParams["original_page"]);
document.getElementById('closetoolbar').onclick = toggleToolbar; document.getElementById('closetoolbar').onclick = toggleToolbar;
document.getElementById('opentoolbar').onclick = toggleToolbar; document.getElementById('opentoolbar').onclick = toggleToolbar;
var cur_ver = current_version;
// Current version is newer that user's // Customize message per channel
if (compareVersion(cur_ver, urlParams["version"]) > 0) const channel = urlParams["channel"];
{ setVisible(
if(urlParams["os"].indexOf("Mac OS X") > -1) channel == "Singularity Alpha" ? "alpha_updateavail" :
{ channel == "Singularity Zero" ? urlParams["lang"] == "fr" ? "zero_updatetoalpha_fr" : "zero_updatetoalpha" :
if(clearVersion(cur_ver) == "1.8.6.6157" && clearVersion(urlParams["version"]) == "1.8.6.6156") "updateavail",
return; true);
}
toolbarShown = true;
setVisible("updateavail", true);
}
// User is on Singularity Alpha older than minimum recommended
else if (urlParams["channel"] == "Singularity Alpha" && compareVersion(min_alpha, urlParams["version"]) > 0)
{
toolbarShown = true;
setVisible("alpha_updateavail", true);
}
else if (urlParams["channel"] == "Singularity Zero" && compareVersion(min_alpha, urlParams["version"]) > 0)
{
toolbarShown = true;
if (urlParams["lang"] == "fr")
setVisible("zero_updatetoalpha_fr", true);
else
setVisible("zero_updatetoalpha", true);
}
else
{
toolbarShown = false;
setVisible("uptodate", true);
}
updateVisibility(toolbarShown); updateVisibility(toolbarShown);
} }
@@ -235,7 +140,6 @@ window.onload = function()
<div id="singtoolbar"> <div id="singtoolbar">
<div id="closetoolbar"><img src="x.png"/></div> <div id="closetoolbar"><img src="x.png"/></div>
<div id="toolbarcontent" style="margin: 0px 4px 10px 12px;"> <div id="toolbarcontent" style="margin: 0px 4px 10px 12px;">
<div id="uptodate" style="display: none;">Your Singularity is up to date.</div>
<div id="updateavail" style="display: none;"> <div id="updateavail" style="display: none;">
<img src="alert.png" style="vertical-align: bottom;" /> <img src="alert.png" style="vertical-align: bottom;" />
An updated version of Singularity is available. Please visit the An updated version of Singularity is available. Please visit the