From 5dbccbb0399f381046d2e068449e99303935ed85 Mon Sep 17 00:00:00 2001 From: Joe-Brady Date: Thu, 23 Mar 2017 13:46:56 +0000 Subject: [PATCH] Add comments to all main JS files --- dist/css/styles.css | 3 +- dist/css/styles.min.css | 2 +- dist/js/app.js | 211 +++++++++++++++++------------- dist/js/app.min.js | 2 +- installation.html | 2 +- src/js/0-global.js | 22 ++-- src/js/index.js | 51 ++++---- src/js/nightly.js | 62 +++++---- src/js/releases.js | 76 +++++++---- src/scss/styles-1-large-main.scss | 2 +- 10 files changed, 251 insertions(+), 182 deletions(-) diff --git a/dist/css/styles.css b/dist/css/styles.css index b3467f76..1bc0fb56 100644 --- a/dist/css/styles.css +++ b/dist/css/styles.css @@ -172,8 +172,7 @@ nav { html, body { max-width: 100%; - overflow-x: hidden; - height: 100%; } + overflow-x: hidden; } main { padding: 2rem 2rem 5rem 2rem; diff --git a/dist/css/styles.min.css b/dist/css/styles.min.css index 6b3eefdc..ea88e627 100644 --- a/dist/css/styles.min.css +++ b/dist/css/styles.min.css @@ -1 +1 @@ -code,pre{box-sizing:border-box;overflow:auto}#menu-content a,.a-button,.no-underline,main .intro a{text-decoration:none}#menu-content,#nightly-list,code,pre{overflow:auto}html{font:16px "Open Sans",helvetica,sans-serif;font-weight:100}button,h1,h2,h3,h4,input,optgroup,select,textarea{font-family:"Open Sans",helvetica,sans-serif;font-weight:100}@media all and (max-width:800px){html{font-size:15px}}@media all and (max-width:500px){html{font-size:14px}}.blue-bg{background-color:#152935!important;color:#F5F5F5!important}#menu-header,.grey-bg{background-color:#F5F5F5}.light-text{color:#F5F5F5}.grey-bg{color:#152935}.dark-link,.dark-link:visited,a,a:visited{color:#152935;cursor:pointer}.dark-link:hover,a:hover{color:#3D70B2}.light-link,.light-link:visited{color:#F5F5F5}#menu-close:hover,.light-link:hover{color:#3D70B2}.full-width{width:100%}.bold{font-weight:700}.hide{display:none!important}.invisible{visibility:hidden}.block{display:block}.inline-block{display:inline-block}.zero-margin{margin:0}.margin-auto{margin:0 auto}.margin-bottom{margin-bottom:4rem}.large-title{font-size:3rem;margin-top:0}.align-left{text-align:left}#error-container,#menu-close,#search-error,.align-center,footer,input,main{text-align:center}.vertical-align-top{vertical-align:top}.vertically-center-child{position:absolute;top:50%;transform:translateY(-50%)}.vertically-center-parent,nav{position:relative}input{padding:.5rem;min-width:12rem;margin-top:1rem}#logo{margin:2rem auto;font-size:1.4rem;display:table;cursor:pointer;color:#F5F5F5}#menu-button,#menu-close{font-size:2rem;cursor:pointer}#logo div{display:table-cell;vertical-align:middle}#logo img{width:2rem;margin-right:.6rem;transform:translateY(.1rem)}#menu-button{color:#F5F5F5;position:absolute;margin-left:2rem;line-height:1;padding:2rem 1rem;top:50%;transform:translateY(-50%)}#menu-button:hover{color:#dadada}#menu-container{position:fixed;background-color:#e6e6e6;z-index:100;width:90%;max-width:16rem;padding:0 2rem 2rem;top:0;left:0;height:100%;animation-duration:.25s}#menu-header{width:20rem;transform:translateX(-2rem)}#menu-close{padding:1.98rem;display:block}#menu-content{height:80%;margin:2rem 0}#menu-content a{display:block;padding:.8rem 0}#menu-content p{border-bottom:1px solid #dadada;margin:0}body,html{max-width:100%;overflow-x:hidden;height:100%}main{padding:2rem 2rem 5rem}.home-main{padding:3rem 2rem 5rem}.blue-button,.grey-button{border-radius:.2rem;padding:0 1.5rem;line-height:2rem;font-size:1rem;margin:.2rem;display:inline-block;cursor:pointer}#error-container{color:red}.grey-button{background-color:#dadada;color:#152935!important}.grey-button:hover{background-color:#e6e6e6;color:#152935!important}.blue-button{background-color:#3D70B2;color:#F5F5F5!important}.blue-button:hover{background-color:#447cc3;color:#F5F5F5!important}#search-error{margin-top:2rem}.github-logo{width:3rem;margin:0 auto}#installation-container{max-width:50rem;margin:auto;text-align:left}#installation-container li{margin-top:2rem}pre{background-color:#e8e8e8;border-radius:.5rem;box-shadow:#c3c3c3 0 2.5px 0 0;color:#585858;font-family:Consolas,monospace;padding:1rem;white-space:pre-wrap}code{white-space:pre}footer{padding:2rem;font-size:.7rem}footer p{max-width:20rem;margin:auto}main .intro{max-width:40rem;margin-bottom:1rem;margin-left:auto;margin-right:auto;width:80%;line-height:1.8rem}main .intro i{font-size:1.8rem;margin-right:.5rem;transform:translateY(.3rem)}main .intro a{color:#3D70B2}main .intro a:hover{text-decoration:underline;color:#3D70B2}#loading-index{position:absolute;left:50%;transform:translate(-50%,.1rem)}.dl-container{margin:0 auto}a.dl-button{background-color:#3D70B2;color:#F5F5F5;border-radius:.2rem;width:20rem;line-height:5rem;font-size:1.5rem;margin:1.2rem .6rem 0;cursor:pointer;display:inline-block}#dl-text{margin-top:2.5rem;margin-bottom:0}a.dl-button #dl-version{transform:translateY(-.6rem)}a.dl-button .dl-description{font-size:.8rem;position:absolute;left:50%;transform:translate(-50%,-3.8rem)}a.dl-button:hover{background-color:#447cc3;color:#F5F5F5}a.dl-thin-button{line-height:2rem;font-size:1rem;background-color:#dadada;color:#152935;display:block;margin:1rem auto}a.dl-thin-button:hover{background-color:#e6e6e6;color:#152935}.home-links{padding:0 1rem}.nightly-container>td,th{padding:.4rem 1rem}.divider{margin:0 .2rem}#table-parent{margin:0 auto}#nightly-list{width:90%;max-width:80rem;margin:2rem auto auto;text-align:left}.nightly-container{white-space:nowrap;color:#152935;border:.1rem solid #F5F5F5}.nightly-container div{display:inline-block}.nightly-container>td:nth-child(odd){background-color:#d0d0d0}.nightly-container>td:nth-child(even){background-color:#e2e2e2}th{white-space:nowrap;background-color:#152935;color:#F5F5F5}#nightly-table th:nth-child(3),#nightly-table tr td:nth-child(3){display:none}#latest-build-name{font-size:3rem;font-weight:700;margin:0}#latest-intro{margin:1rem 0}#latest-metadata-table{color:#F5F5F5;margin:0 auto}#latest-metadata-table td{padding:.5rem 1.5rem}#latest-metadata-table td:first-child{border-radius:.3rem 0 0 .3rem}#latest-metadata-table td:last-child{border-radius:0 .3rem .3rem 0}#latest-metadata-table td:nth-child(even){background-color:#1F2F4E}#latest-metadata-table td:nth-child(odd){background-color:#182336}.latest-block{display:inline-block;vertical-align:top;margin:3rem 2.5rem 1rem}.latest-platform{font-size:1.5rem}.latest-platform img{height:3.5rem}a.latest-download-button{background-color:#3D70B2;display:block;color:#F5F5F5;border-radius:.2rem;min-width:14rem;line-height:2.5rem;cursor:pointer;margin:1rem 0}a.latest-download-button:hover{background-color:#447cc3;color:#F5F5F5}.latest-details{font-size:.8rem}.small-dl-text{font-size:.7rem;line-height:1.2rem;transform:translateY(-.4rem);color:rgba(255,255,255,.64)}.archive-container{margin:3rem 0;height:14rem;font-size:.8rem}.archive-details,.archive-downloads,.archive-header{padding:0 2%;background-color:#fff;display:inline-block;vertical-align:top;height:100%;width:16rem;margin:0 .1rem}.archive-header{text-align:center;padding:0;width:18rem}.archive-header h1{margin-top:0}.archive-platform-block{margin:1rem 0}.archive-platform-block a,.archive-platform-block div{font-size:.8rem}.archive-platform-block .grey-button{margin-right:1rem;min-width:5rem}.archive-details div{padding:.5rem 0}@media all and (max-width:1100px){.latest-download-button{min-width:0}.archive-downloads{width:14rem}.archive-header{width:16rem}}@media all and (max-width:950px){.vertically-center-parent{position:initial}.vertically-center-child{position:initial;top:initial;transform:initial}.archive-container{height:initial}.archive-container>div{padding:1rem;display:block;margin:auto;width:80%}.archive-details,.archive-platform-block{text-align:center}.archive-platform-block>div:first-child{display:inline-block;margin-right:.5rem}.archive-container .archive-details,.archive-container .archive-downloads{padding:.1rem 1rem}}@media all and (max-width:800px){#latest-metadata-table td{display:inline-block;width:80%;border-radius:0!important}.latest-download-button{min-width:0}#latest-build-name,.large-title{font-size:2rem}}@media all and (max-width:650px){#latest-build-name,#menu-button{font-size:1.5rem}main{padding:2rem 1rem 5rem}main .intro{width:100%}a.dl-button{width:100%;margin:1.2rem auto 0}a.dl-button .dl-description{transform:translate(-50%,-3.8rem);left:50%}.home-links{display:block}#menu-button{margin-left:0;padding:2.2rem 1rem}.latest-block{display:inline-block;vertical-align:top;margin:2rem 0 1rem;width:85%}input{min-width:0;max-width:80%}.archive-container>div{width:90%}}main .support{max-width:40rem;margin:0 auto;width:80%} \ No newline at end of file +code,pre{box-sizing:border-box;overflow:auto}#menu-content a,.a-button,.no-underline,main .intro a{text-decoration:none}#menu-content,#nightly-list,code,pre{overflow:auto}html{font:16px "Open Sans",helvetica,sans-serif;font-weight:100}button,h1,h2,h3,h4,input,optgroup,select,textarea{font-family:"Open Sans",helvetica,sans-serif;font-weight:100}@media all and (max-width:800px){html{font-size:15px}}@media all and (max-width:500px){html{font-size:14px}}.blue-bg{background-color:#152935!important;color:#F5F5F5!important}#menu-header,.grey-bg{background-color:#F5F5F5}.light-text{color:#F5F5F5}.grey-bg{color:#152935}.dark-link,.dark-link:visited,a,a:visited{color:#152935;cursor:pointer}.dark-link:hover,a:hover{color:#3D70B2}.light-link,.light-link:visited{color:#F5F5F5}#menu-close:hover,.light-link:hover{color:#3D70B2}.full-width{width:100%}.bold{font-weight:700}.hide{display:none!important}.invisible{visibility:hidden}.block{display:block}.inline-block{display:inline-block}.zero-margin{margin:0}.margin-auto{margin:0 auto}.margin-bottom{margin-bottom:4rem}.large-title{font-size:3rem;margin-top:0}.align-left{text-align:left}#error-container,#menu-close,#search-error,.align-center,footer,input,main{text-align:center}.vertical-align-top{vertical-align:top}.vertically-center-child{position:absolute;top:50%;transform:translateY(-50%)}.vertically-center-parent,nav{position:relative}input{padding:.5rem;min-width:12rem;margin-top:1rem}#logo{margin:2rem auto;font-size:1.4rem;display:table;cursor:pointer;color:#F5F5F5}#menu-button,#menu-close{font-size:2rem;cursor:pointer}#logo div{display:table-cell;vertical-align:middle}#logo img{width:2rem;margin-right:.6rem;transform:translateY(.1rem)}#menu-button{color:#F5F5F5;position:absolute;margin-left:2rem;line-height:1;padding:2rem 1rem;top:50%;transform:translateY(-50%)}#menu-button:hover{color:#dadada}#menu-container{position:fixed;background-color:#e6e6e6;z-index:100;width:90%;max-width:16rem;padding:0 2rem 2rem;top:0;left:0;height:100%;animation-duration:.25s}#menu-header{width:20rem;transform:translateX(-2rem)}#menu-close{padding:1.98rem;display:block}#menu-content{height:80%;margin:2rem 0}#menu-content a{display:block;padding:.8rem 0}#menu-content p{border-bottom:1px solid #dadada;margin:0}body,html{max-width:100%;overflow-x:hidden}main{padding:2rem 2rem 5rem}.home-main{padding:3rem 2rem 5rem}.blue-button,.grey-button{border-radius:.2rem;padding:0 1.5rem;line-height:2rem;font-size:1rem;margin:.2rem;display:inline-block;cursor:pointer}#error-container{color:red}.grey-button{background-color:#dadada;color:#152935!important}.grey-button:hover{background-color:#e6e6e6;color:#152935!important}.blue-button{background-color:#3D70B2;color:#F5F5F5!important}.blue-button:hover{background-color:#447cc3;color:#F5F5F5!important}#search-error{margin-top:2rem}.github-logo{width:3rem;margin:0 auto}#installation-container{max-width:50rem;margin:auto;text-align:left}#installation-container li{margin-top:2rem}pre{background-color:#e8e8e8;border-radius:.5rem;box-shadow:#c3c3c3 0 2.5px 0 0;color:#585858;font-family:Consolas,monospace;padding:1rem;white-space:pre-wrap}code{white-space:pre}footer{padding:2rem;font-size:.7rem}footer p{max-width:20rem;margin:auto}main .intro{max-width:40rem;margin-bottom:1rem;margin-left:auto;margin-right:auto;width:80%;line-height:1.8rem}main .intro i{font-size:1.8rem;margin-right:.5rem;transform:translateY(.3rem)}main .intro a{color:#3D70B2}main .intro a:hover{text-decoration:underline;color:#3D70B2}#loading-index{position:absolute;left:50%;transform:translate(-50%,.1rem)}.dl-container{margin:0 auto}a.dl-button{background-color:#3D70B2;color:#F5F5F5;border-radius:.2rem;width:20rem;line-height:5rem;font-size:1.5rem;margin:1.2rem .6rem 0;cursor:pointer;display:inline-block}#dl-text{margin-top:2.5rem;margin-bottom:0}a.dl-button #dl-version{transform:translateY(-.6rem)}a.dl-button .dl-description{font-size:.8rem;position:absolute;left:50%;transform:translate(-50%,-3.8rem)}a.dl-button:hover{background-color:#447cc3;color:#F5F5F5}a.dl-thin-button{line-height:2rem;font-size:1rem;background-color:#dadada;color:#152935;display:block;margin:1rem auto}a.dl-thin-button:hover{background-color:#e6e6e6;color:#152935}.home-links{padding:0 1rem}.nightly-container>td,th{padding:.4rem 1rem}.divider{margin:0 .2rem}#table-parent{margin:0 auto}#nightly-list{width:90%;max-width:80rem;margin:2rem auto auto;text-align:left}.nightly-container{white-space:nowrap;color:#152935;border:.1rem solid #F5F5F5}.nightly-container div{display:inline-block}.nightly-container>td:nth-child(odd){background-color:#d0d0d0}.nightly-container>td:nth-child(even){background-color:#e2e2e2}th{white-space:nowrap;background-color:#152935;color:#F5F5F5}#nightly-table th:nth-child(3),#nightly-table tr td:nth-child(3){display:none}#latest-build-name{font-size:3rem;font-weight:700;margin:0}#latest-intro{margin:1rem 0}#latest-metadata-table{color:#F5F5F5;margin:0 auto}#latest-metadata-table td{padding:.5rem 1.5rem}#latest-metadata-table td:first-child{border-radius:.3rem 0 0 .3rem}#latest-metadata-table td:last-child{border-radius:0 .3rem .3rem 0}#latest-metadata-table td:nth-child(even){background-color:#1F2F4E}#latest-metadata-table td:nth-child(odd){background-color:#182336}.latest-block{display:inline-block;vertical-align:top;margin:3rem 2.5rem 1rem}.latest-platform{font-size:1.5rem}.latest-platform img{height:3.5rem}a.latest-download-button{background-color:#3D70B2;display:block;color:#F5F5F5;border-radius:.2rem;min-width:14rem;line-height:2.5rem;cursor:pointer;margin:1rem 0}a.latest-download-button:hover{background-color:#447cc3;color:#F5F5F5}.latest-details{font-size:.8rem}.small-dl-text{font-size:.7rem;line-height:1.2rem;transform:translateY(-.4rem);color:rgba(255,255,255,.64)}.archive-container{margin:3rem 0;height:14rem;font-size:.8rem}.archive-details,.archive-downloads,.archive-header{padding:0 2%;background-color:#fff;display:inline-block;vertical-align:top;height:100%;width:16rem;margin:0 .1rem}.archive-header{text-align:center;padding:0;width:18rem}.archive-header h1{margin-top:0}.archive-platform-block{margin:1rem 0}.archive-platform-block a,.archive-platform-block div{font-size:.8rem}.archive-platform-block .grey-button{margin-right:1rem;min-width:5rem}.archive-details div{padding:.5rem 0}@media all and (max-width:1100px){.latest-download-button{min-width:0}.archive-downloads{width:14rem}.archive-header{width:16rem}}@media all and (max-width:950px){.vertically-center-parent{position:initial}.vertically-center-child{position:initial;top:initial;transform:initial}.archive-container{height:initial}.archive-container>div{padding:1rem;display:block;margin:auto;width:80%}.archive-details,.archive-platform-block{text-align:center}.archive-platform-block>div:first-child{display:inline-block;margin-right:.5rem}.archive-container .archive-details,.archive-container .archive-downloads{padding:.1rem 1rem}}@media all and (max-width:800px){#latest-metadata-table td{display:inline-block;width:80%;border-radius:0!important}.latest-download-button{min-width:0}#latest-build-name,.large-title{font-size:2rem}}@media all and (max-width:650px){#latest-build-name,#menu-button{font-size:1.5rem}main{padding:2rem 1rem 5rem}main .intro{width:100%}a.dl-button{width:100%;margin:1.2rem auto 0}a.dl-button .dl-description{transform:translate(-50%,-3.8rem);left:50%}.home-links{display:block}#menu-button{margin-left:0;padding:2.2rem 1rem}.latest-block{display:inline-block;vertical-align:top;margin:2rem 0 1rem;width:85%}input{min-width:0;max-width:80%}.archive-container>div{width:90%}}main .support{max-width:40rem;margin:0 auto;width:80%} \ No newline at end of file diff --git a/dist/js/app.js b/dist/js/app.js index 6a1a8d55..bd33482e 100644 --- a/dist/js/app.js +++ b/dist/js/app.js @@ -3,20 +3,21 @@ var errorContainer = document.getElementById('error-container'); /* eslint-enable no-unused-vars */ +// set variable names for menu elements const menuOpen = document.getElementById('menu-button'); const menuClose = document.getElementById('menu-close'); const menu = document.getElementById('menu-container'); menuOpen.onclick = function() { - menu.className = menu.className.replace( /(?:^|\s)slideOutLeft(?!\S)/g , ' slideInLeft' ); - menu.className = menu.className.replace( /(?:^|\s)hide(?!\S)/g , ' animated' ); + menu.className = menu.className.replace( /(?:^|\s)slideOutLeft(?!\S)/g , ' slideInLeft' ); // slide in animation + menu.className = menu.className.replace( /(?:^|\s)hide(?!\S)/g , ' animated' ); // removes initial hidden property, activates animations } menuClose.onclick = function() { - menu.className = menu.className.replace( /(?:^|\s)slideInLeft(?!\S)/g , ' slideOutLeft' ); + menu.className = menu.className.replace( /(?:^|\s)slideInLeft(?!\S)/g , ' slideOutLeft' ); // slide out animation } -// returns the name of the user's OS. +// this function returns the name of the user's OS. // modify this list to change how other functions search for downloads that match an OS. /* eslint-disable no-unused-vars */ function detectOS() { @@ -30,33 +31,32 @@ function detectOS() { return OSName; } -// pass in the name of the repo (within this organisation only) +// when using this function, pass in the name of the repo (options: releases, nightly) /* eslint-disable no-unused-vars */ function loadReleasesJSON(repo, loading, callback) { /* eslint-enable no-unused-vars */ - if(msieversion() == true) { + if(msieversion() == true) { // if the browser is IE, display an error with advice, because important website features do not work in IE. loading.innerHTML = ""; document.getElementById("error-container").innerHTML = "

Internet Explorer is not supported. Please use another browser, or see the releases list on GitHub.

"; } else { - var url = ("https://raw.githubusercontent.com/AdoptOpenJDK/openjdk-" + repo + "/master/" + repo + ".json"); + var url = ("https://raw.githubusercontent.com/AdoptOpenJDK/openjdk-" + repo + "/master/" + repo + ".json"); // the URL of the JSON built in the website back-end var xobj = new XMLHttpRequest(); xobj.overrideMimeType("application/json"); xobj.open('GET', url, true); xobj.onreadystatechange = function() { - if (xobj.readyState == 4 && xobj.status == "200") { + if (xobj.readyState == 4 && xobj.status == "200") { // if the status is 'ok', run the callback function that has been passed in. callback(xobj.responseText); - } else { - if(xobj.status != "200") { + } else if(xobj.status != "200") { // if the status is NOT 'ok', remove the loading dots, and display an error: loading.innerHTML = ""; document.getElementById("error-container").innerHTML = "

Error... there's a problem fetching the releases. Please see the releases list on GitHub.

"; - } } }; xobj.send(null); } } +// check for IE browser function msieversion() { var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); @@ -69,13 +69,15 @@ function msieversion() { // When index page loads, run: /* eslint-disable no-unused-vars */ function onIndexLoad() { - setDownloadSection(); + setDownloadSection(); // on page load, populate the central download section. } /* eslint-enable no-unused-vars */ // INDEX PAGE FUNCTIONS +// function setDownloadSection() { + // set variables for all index page HTML elements that will be used by the JS const dlText = document.getElementById('dl-text'); const dlLatest = document.getElementById('dl-latest'); const dlArchive = document.getElementById('dl-archive'); @@ -83,20 +85,23 @@ function setDownloadSection() { const dlVersionText = document.getElementById('dl-version-text'); const loadingSpan = document.getElementById('loading-index'); - var OS = detectOS(); + var OS = detectOS(); // set a variable as the user's OS - var latestLink = ""; - var loading = loadingSpan; + var latestLink = ""; // reset the variable for the latest download button link to be empty. - loadReleasesJSON("releases", loading, function(response) { - function checkIfProduction(x) { + // call the XmlHttpRequest function in global.js, passing in 'releases' as the repo, and a long function as the callback. + loadReleasesJSON("releases", loadingSpan, function(response) { + function checkIfProduction(x) { // used by the array filter method below. return x.prerelease === false && x.assets[0]; } + // Step 1: create a JSON from the XmlHttpRequest response + // Step 2: filter out all releases from this JSON that are marked as 'pre-release' in GitHub. var releasesJson = JSON.parse(response).filter(checkIfProduction); - if (releasesJson && typeof releasesJson[0] !== 'undefined') { - var newHTML = ""; + // if there are releases... + if (typeof releasesJson[0] !== 'undefined') { + var newHTML = ""; // set the variable to be an empty string. // set the download button's version number to the latest release newHTML = (releasesJson[0].tag_name); @@ -105,6 +110,7 @@ function setDownloadSection() { // create an array of the details for each binary that is attached to a release var assetArray = []; var assetCounter = 0; + // create a new array that contains each 'asset' (binary) from the latest release: releasesJson[0].assets.forEach(function() { assetArray.push(releasesJson[0].assets[assetCounter]); assetCounter++; @@ -114,30 +120,31 @@ function setDownloadSection() { var assetCounter2 = 0; assetArray.forEach(function() { // iterate through the binaries attached to this release var nameOfFile = (assetArray[assetCounter2].name); + // convert the name of the binary file, and the user's OS, to be uppercase: var a = nameOfFile.toUpperCase(); var b = OS.toUpperCase(); - //console.log("Your OS: " + b + ". Checking for a match with this file: " + a); if(a.indexOf(b) >= 0) { // check if the user's OS string matches part of this binary's name (e.g. ...LINUX...) - latestLink = (assetArray[assetCounter2].browser_download_url); + latestLink = (assetArray[assetCounter2].browser_download_url); // set the link variable to be the download URL that matches the user's OS } assetCounter2++; }); - if(latestLink == "") { - dlOther.className += " hide"; - dlText.innerHTML = ("Downloads"); - latestLink = "./releases.html"; - } else { - var fullOSName = OS; + if(latestLink == "") { // if there is no matching binary for the user's OS: + dlOther.className += " hide"; // hide the 'Other platforms' button + dlText.innerHTML = ("Downloads"); // change the text to be generic: 'Downloads'. + latestLink = "./releases.html"; // change the main download button's link, now takes the user to the latest releases page for all platforms. + } + else { // if there IS a matching binary for the user's OS: + var fullOSName = OS; // defaults this variable to be the detected OS name if(OS == "Win") { - fullOSName = "Windows"; + fullOSName = "Windows"; // 'Win' is not user friendly - make it 'Windows'. } else if (OS == "Mac") { - fullOSName = "macOS"; + fullOSName = "macOS"; // 'macOS' is the official OS name. } - dlText.innerHTML = ("Download for " + fullOSName); + dlText.innerHTML = ("Download for " + fullOSName); // set the text to be OS-specific, using the full OS name. } - } else { + } else { // if there are no releases: errorContainer.innerHTML = "

Error... no releases have been found!

"; //dlVersionText.innerHTML = ""; } @@ -145,7 +152,7 @@ function setDownloadSection() { // set the download button to use the 'latestLink' variable dlLatest.href = latestLink; - // remove the loading dots, make the buttons visible, with animated fade-in + // remove the loading dots, and make all buttons visible, with animated fade-in loadingSpan.innerHTML = ""; dlLatest.className += " animated"; dlOther.className += " animated"; @@ -154,7 +161,7 @@ function setDownloadSection() { dlOther.className = dlOther.className.replace( /(?:^|\s)invisible(?!\S)/g , '' ); dlArchive.className = dlArchive.className.replace( /(?:^|\s)invisible(?!\S)/g , '' ); - // animate the main download button + // animate the main download button shortly after the initial animation has finished. setTimeout(function(){ dlLatest.className = "dl-button a-button animated pulse"; }, 1000); @@ -168,9 +175,10 @@ var assetCounter2 = 0; /* eslint-disable no-unused-vars */ function onNightlyLoad() { /* eslint-enable no-unused-vars */ - populateNightly(); - // realtime search box + populateNightly(); // run the function to populate the table on the Nightly page. + + // logic for the realtime search box: var search = document.getElementById("search"); var searchError = document.getElementById("search-error"); @@ -208,16 +216,18 @@ function onNightlyLoad() { // NIGHTLY PAGE FUNCTIONS - function populateNightly() { const nightlyList = document.getElementById("nightly-table"); var loading = document.getElementById("nightly-loading"); + // call the XmlHttpRequest function in global.js, passing in 'nightly' as the repo, and a long function as the callback. loadReleasesJSON("nightly", loading, function(response) { - function checkIfProduction(x) { + function checkIfProduction(x) { // used by the array filter method below. return x.prerelease === false && x.assets[0]; } + // Step 1: create a JSON from the XmlHttpRequest response + // Step 2: filter out all releases from this JSON that are marked as 'pre-release' in GitHub. var releasesJson = JSON.parse(response).filter(checkIfProduction); // if there are releases... @@ -232,19 +242,24 @@ function populateNightly() { // get the current content of the nightly list div var currentNightlyContent = nightlyList.innerHTML; - // add an empty, hidden entry to the nightly list, with the nightlyCounter suffixed to every ID + + // add an empty, hidden HTML template entry to the current nightly list, with the nightlyCounter suffixed to every ID + // to change the HTML of the nightly table rows/cells, you must change this template. var newNightlyContent = currentNightlyContent += ("
|
Changelog
|
Timestamp:
|
Build number:
|
Commit:
"); + + // update the HTML container element with this new content nightlyList.innerHTML = newNightlyContent; + // populate the new entry with that release's information var publishedAt = (releasesJson[nightlyCounter].published_at); - document.getElementById("nightly-release"+nightlyCounter).innerHTML = (releasesJson[nightlyCounter].name).slice(0, 12); - document.getElementById("nightly-release"+nightlyCounter).href = ("https://github.com/AdoptOpenJDK/nightly/releases/tag/" + releasesJson[nightlyCounter].name) - document.getElementById("nightly-date"+nightlyCounter).innerHTML = moment(publishedAt).format('Do MMMM YYYY'); - document.getElementById("nightly-changelog"+nightlyCounter).href = releasesJson[nightlyCounter].name; - document.getElementById("nightly-timestamp"+nightlyCounter).innerHTML = (releasesJson[nightlyCounter].name).slice(13, 25); - document.getElementById("nightly-buildnumber"+nightlyCounter).innerHTML = releasesJson[nightlyCounter].id; - document.getElementById("nightly-commitref"+nightlyCounter).innerHTML = releasesJson[nightlyCounter].name; - document.getElementById("nightly-commitref"+nightlyCounter).href = releasesJson[nightlyCounter].name; + document.getElementById("nightly-release"+nightlyCounter).innerHTML = (releasesJson[nightlyCounter].name).slice(0, 12); // the release name, minus the timestamp + document.getElementById("nightly-release"+nightlyCounter).href = ("https://github.com/AdoptOpenJDK/nightly/releases/tag/" + releasesJson[nightlyCounter].name) // the link to that release on GitHub + document.getElementById("nightly-date"+nightlyCounter).innerHTML = moment(publishedAt).format('Do MMMM YYYY'); // the timestamp converted into a readable date + document.getElementById("nightly-changelog"+nightlyCounter).href = releasesJson[nightlyCounter].name; // TO-DO: WAITING FOR THE LINKS TO BE AVAILABLE. the link to the release changelog + document.getElementById("nightly-timestamp"+nightlyCounter).innerHTML = (releasesJson[nightlyCounter].name).slice(13, 25); // the timestamp section of the build name + document.getElementById("nightly-buildnumber"+nightlyCounter).innerHTML = releasesJson[nightlyCounter].id; // currently this is the release ID + document.getElementById("nightly-commitref"+nightlyCounter).innerHTML = releasesJson[nightlyCounter].name; // TO-DO: WAITING FOR THE INFO TO BE AVAILABLE. + document.getElementById("nightly-commitref"+nightlyCounter).href = releasesJson[nightlyCounter].name; // TO-DO: WAITING FOR THE LINKS TO BE AVAILABLE. // set the download button links // create an array of the details for each binary that is attached to a release @@ -255,7 +270,7 @@ function populateNightly() { assetCounter++; }); - // build the download links section with these binaries + // set variables for HTML elements. var linuxDlButton = document.getElementById("nightly-linux-dl"+nightlyCounter); var windowsDlButton = document.getElementById("nightly-windows-dl"+nightlyCounter); var macDlButton = document.getElementById("nightly-mac-dl"+nightlyCounter); @@ -263,19 +278,21 @@ function populateNightly() { var windowsDlContent = document.getElementById("nightly-windows-dl-content"+nightlyCounter); var macDlContent = document.getElementById("nightly-mac-dl-content"+nightlyCounter); + // build the download links section with the array of binaries... + assetCounter2 = 0; - assetArray.forEach(function() { // iterate through the binaries attached to this release - //console.log(assetCounter2); + assetArray.forEach(function() { // for each binary attached to this release... var nameOfFile = (assetArray[assetCounter2].name); - var a = nameOfFile.toUpperCase(); + var a = nameOfFile.toUpperCase(); // make the name of the binary uppercase // set the download links for this release - if(a.indexOf("LINUX") >= 0) { - linuxDlButton.innerHTML = ("tar.gz (" + (Math.floor((assetArray[assetCounter2].size)/1024/1024)) + " MB)"); - document.getElementById("nightly-linux-checksum"+nightlyCounter).href = (assetArray[assetCounter2].browser_download_url).replace("tar.gz", "txt"); + if(a.indexOf("LINUX") >= 0) { // + linuxDlButton.innerHTML = ("tar.gz (" + (Math.floor((assetArray[assetCounter2].size)/1024/1024)) + " MB)"); // display the file type and the file size + document.getElementById("nightly-linux-checksum"+nightlyCounter).href = (assetArray[assetCounter2].browser_download_url).replace("tar.gz", "txt"); // set the checksum link (relies on the checksum having the same name as the binary, but .txt extension) var linuxLink = (assetArray[assetCounter2].browser_download_url); - linuxDlButton.href = linuxLink; - linuxDlContent.className = linuxDlContent.className.replace( /(?:^|\s)invisible(?!\S)/g , '' ); + linuxDlButton.href = linuxLink; // set the download link + linuxDlContent.className = linuxDlContent.className.replace( /(?:^|\s)invisible(?!\S)/g , '' ); // make this platform section visible (all platforms are invisible by default) + // repeated for Windows and Mac } else if(a.indexOf("WIN") >= 0) { windowsDlButton.innerHTML = (".zip (" + (Math.floor((assetArray[assetCounter2].size)/1024/1024)) + " MB)"); document.getElementById("nightly-windows-checksum"+nightlyCounter).href = (assetArray[assetCounter2].browser_download_url).replace("zip", "txt"); @@ -296,16 +313,16 @@ function populateNightly() { // show the new entry var container = document.getElementById(nightlyCounter); - container.className += " animated fadeIn"; - container.className = container.className.replace( /(?:^|\s)hide(?!\S)/g , '' ); + container.className += " animated fadeIn"; // add the fade animation + container.className = container.className.replace( /(?:^|\s)hide(?!\S)/g , '' ); // remove the 'hide' class immediately afterwards // iterate to the next nightly entry nightlyCounter++; }); - } else { + } else { // if there are no releases... // report an error errorContainer.innerHTML = "

Error... no releases have been found!

"; - document.getElementById("nightly-loading").innerHTML = ""; + document.getElementById("nightly-loading").innerHTML = ""; // remove the loading dots } }); } @@ -316,9 +333,11 @@ var assetCounter2 = 0; function onReleasesLoad() { /* eslint-enable no-unused-vars */ + // set variables for the two page sections contained within releases.html const archive = document.getElementById('archives-page'); const latest = document.getElementById('latest-page'); + // on load, check if it's the archive page, and run showArchive(); or hideArchive(); accordingly if(window.location.hash == "#archive") { showArchive(); } else { @@ -326,24 +345,26 @@ function onReleasesLoad() { } function showArchive() { - latest.className += " hide"; - archive.className = archive.className.replace( /(?:^|\s)hide(?!\S)/g , '' ); - populateArchive(); + latest.className += " hide"; // hide the 'Latest' page + archive.className = archive.className.replace( /(?:^|\s)hide(?!\S)/g , '' ); // show the 'Archive' page + populateArchive(); // populate the Archive page } function hideArchive() { - archive.className += " hide"; - latest.className = latest.className.replace( /(?:^|\s)hide(?!\S)/g , '' ); - populateLatest(); + archive.className += " hide"; // hide the 'Archive' page + latest.className = latest.className.replace( /(?:^|\s)hide(?!\S)/g , '' ); // show the 'Latest' page + populateLatest(); // populate the Latest page } + // If the hash changes in the URL while on the page, switch to the correct page accordingly. window.onhashchange = function(){ if(window.location.hash == "#archive") { + errorContainer.innerHTML = ""; // reset the error message showArchive(); } else { + errorContainer.innerHTML = ""; // reset the error message hideArchive(); } - errorContainer.innerHTML = ""; } } @@ -351,13 +372,16 @@ function onReleasesLoad() { function populateLatest() { - var loading = document.getElementById("latest-loading"); + var loading = document.getElementById("latest-loading"); // set variable for the loading dots + // call the XmlHttpRequest function in global.js, passing in 'releases' as the repo, and a long function as the callback. loadReleasesJSON("releases", loading, function(response) { function checkIfProduction(x) { - return x.prerelease === false && x.assets[0]; + return x.prerelease === false && x.assets[0]; // used by the array filter method below. } + // Step 1: create a JSON from the XmlHttpRequest response + // Step 2: filter out all releases from this JSON that are marked as 'pre-release' in GitHub. var releasesJson = JSON.parse(response).filter(checkIfProduction); // if there are releases... @@ -395,16 +419,19 @@ function populateLatest() { assetCounter2 = 0; assetArray.forEach(function() { // iterate through the binaries attached to this release var nameOfFile = (assetArray[assetCounter2].name); - var a = nameOfFile.toUpperCase(); - // set the download links for this release - if(a.indexOf("LINUX") >= 0) { - document.getElementById("latest-size-linux").innerHTML = Math.floor((assetArray[assetCounter2].size)/1024/1024); - document.getElementById("latest-checksum-linux").href = (assetArray[assetCounter2].browser_download_url).replace("tar.gz", "txt"); + var a = nameOfFile.toUpperCase(); // make the name of the binary uppercase + + // set the download links for this release... + + if(a.indexOf("LINUX") >= 0) { // if the binary name contains 'LINUX': + document.getElementById("latest-size-linux").innerHTML = Math.floor((assetArray[assetCounter2].size)/1024/1024); // display the binary size + document.getElementById("latest-checksum-linux").href = (assetArray[assetCounter2].browser_download_url).replace("tar.gz", "txt"); // set the checksum link (relies on the checksum having the same name as the binary, but .txt extension) var linuxLink = (assetArray[assetCounter2].browser_download_url); - linuxDlButton.href = linuxLink; - linuxPlatformBlock.className = linuxPlatformBlock.className.replace( /(?:^|\s)hide(?!\S)/g , '' ); + linuxDlButton.href = linuxLink; // set the download button link for this platform + linuxPlatformBlock.className = linuxPlatformBlock.className.replace( /(?:^|\s)hide(?!\S)/g , '' ); // make this platform section visible (all platforms are invisible by default) + // repeat for Windows and Mac } else if(a.indexOf("WIN") >= 0) { document.getElementById("latest-size-windows").innerHTML = Math.floor((assetArray[assetCounter2].size)/1024/1024); document.getElementById("latest-checksum-windows").href = (assetArray[assetCounter2].browser_download_url).replace("zip", "txt"); @@ -425,33 +452,38 @@ function populateLatest() { }); const latestContainer = document.getElementById("latest-container"); - latestContainer.className += " animated fadeIn"; - latestContainer.className = latestContainer.className.replace( /(?:^|\s)invisible(?!\S)/g , '' ); + latestContainer.className += " animated fadeIn"; // animate a fade-in of the entire 'latest page' section + latestContainer.className = latestContainer.className.replace( /(?:^|\s)invisible(?!\S)/g , '' ); // make this section visible (invisible by default) } else { // report an error errorContainer.innerHTML = "

Error... no releases have been found!

"; - document.getElementById("latest-loading").innerHTML = ""; + document.getElementById("latest-loading").innerHTML = ""; // remove the loading dots } }); } +// END OF LATEST PAGE FUNCTIONS // ARCHIVE PAGE FUNCTIONS function populateArchive() { + // set variables for HTML elements const archiveList = document.getElementById("archive-list"); var loading = document.getElementById("archive-loading"); + // call the XmlHttpRequest function in global.js, passing in 'releases' as the repo, and a long function as the callback. loadReleasesJSON("releases", loading, function(response) { - function checkIfProduction(x) { + function checkIfProduction(x) { // used by the array filter method below. return x.prerelease === false && x.assets[0]; } + // Step 1: create a JSON from the XmlHttpRequest response + // Step 2: filter out all releases from this JSON that are marked as 'pre-release' in GitHub. var releasesJson = JSON.parse(response).filter(checkIfProduction); - // if there are releases prior to the latest one... + // if there are releases prior to the 'latest' one (i.e. archived releases)... if (typeof releasesJson[1] !== 'undefined') { // remove the loading dots document.getElementById("archive-loading").innerHTML = ""; @@ -485,7 +517,7 @@ function populateArchive() { assetCounter++; }); - // build the download links section with these binaries + // set variables for the HTML elements var linuxDlButton = document.getElementById("archive-linux-dl"+archiveCounter); var windowsDlButton = document.getElementById("archive-windows-dl"+archiveCounter); var macDlButton = document.getElementById("archive-mac-dl"+archiveCounter); @@ -493,19 +525,22 @@ function populateArchive() { var windowsPlatformBlock = document.getElementById("windows-platform-block"+archiveCounter); var macPlatformBlock = document.getElementById("mac-platform-block"+archiveCounter); + // build the download links section with these binaries... + assetCounter2 = 0; assetArray.forEach(function() { // iterate through the binaries attached to this release var nameOfFile = (assetArray[assetCounter2].name); var a = nameOfFile.toUpperCase(); // set the download links for this release if(a.indexOf("LINUX") >= 0) { - document.getElementById("archive-linux-size"+archiveCounter).innerHTML = Math.floor((assetArray[assetCounter2].size)/1024/1024); - document.getElementById("archive-linux-checksum"+archiveCounter).href = (assetArray[assetCounter2].browser_download_url).replace("tar.gz", "txt"); + document.getElementById("archive-linux-size"+archiveCounter).innerHTML = Math.floor((assetArray[assetCounter2].size)/1024/1024);// display the file size + document.getElementById("archive-linux-checksum"+archiveCounter).href = (assetArray[assetCounter2].browser_download_url).replace("tar.gz", "txt"); // set the checksum link (relies on the checksum having the same name as the binary, but .txt extension) var linuxLink = (assetArray[assetCounter2].browser_download_url); - linuxDlButton.href = linuxLink; - linuxPlatformBlock.className = linuxPlatformBlock.className.replace( /(?:^|\s)hide(?!\S)/g , '' ); + linuxDlButton.href = linuxLink; // set the download link + linuxPlatformBlock.className = linuxPlatformBlock.className.replace( /(?:^|\s)hide(?!\S)/g , '' ); // make this platform section visible (all platforms are invisible by default) + // repeated for Windows and Mac } else if(a.indexOf("WIN") >= 0) { document.getElementById("archive-windows-size"+archiveCounter).innerHTML = Math.floor((assetArray[assetCounter2].size)/1024/1024); document.getElementById("archive-windows-checksum"+archiveCounter).href = (assetArray[assetCounter2].browser_download_url).replace("zip", "txt"); @@ -527,13 +562,13 @@ function populateArchive() { // show the new entry var container = document.getElementById(archiveCounter); - container.className += " animated fadeIn"; - container.className = container.className.replace( /(?:^|\s)hide(?!\S)/g , '' ); + container.className += " animated fadeIn"; // add the fade animation + container.className = container.className.replace( /(?:^|\s)hide(?!\S)/g , '' ); // remove the 'hide' class immediately afterwards // iterate to the next archive entry archiveCounter++; }); - } else { + } else { // if there are no releases (beyond the latest one)... // report an error errorContainer.innerHTML = "

There are no archived releases yet! See the Latest release page.

"; document.getElementById("archive-loading").innerHTML = ""; diff --git a/dist/js/app.min.js b/dist/js/app.min.js index dee7b0c2..9013b74b 100644 --- a/dist/js/app.min.js +++ b/dist/js/app.min.js @@ -1 +1 @@ -function detectOS(){var e="UnknownOS";return navigator.userAgent.indexOf("Win")!=-1&&(e="Win"),navigator.userAgent.indexOf("Mac")!=-1&&(e="Mac"),navigator.userAgent.indexOf("X11")!=-1&&(e="Linux"),navigator.userAgent.indexOf("Linux")!=-1&&(e="Linux"),navigator.userAgent.indexOf("obile")!=-1&&(e="UnknownOS"),e}function loadReleasesJSON(e,t,n){if(1==msieversion())t.innerHTML="",document.getElementById("error-container").innerHTML="

Internet Explorer is not supported. Please use another browser, or see the releases list on GitHub.

";else{var a="https://raw.githubusercontent.com/AdoptOpenJDK/openjdk-"+e+"/master/"+e+".json",s=new XMLHttpRequest;s.overrideMimeType("application/json"),s.open("GET",a,!0),s.onreadystatechange=function(){4==s.readyState&&"200"==s.status?n(s.responseText):"200"!=s.status&&(t.innerHTML="",document.getElementById("error-container").innerHTML="

Error... there's a problem fetching the releases. Please see the releases list on GitHub.

")},s.send(null)}}function msieversion(){return!!(window.navigator.userAgent.indexOf("MSIE ")>=0||navigator.userAgent.match(/Trident.*rv\:11\./))}function onIndexLoad(){setDownloadSection()}function setDownloadSection(){const e=document.getElementById("dl-text"),t=document.getElementById("dl-latest"),n=document.getElementById("dl-archive"),a=document.getElementById("dl-other"),s=document.getElementById("dl-version-text"),i=document.getElementById("loading-index");var l=detectOS(),r="";loadReleasesJSON("releases",i,function(d){function o(e){return e.prerelease===!1&&e.assets[0]}var c=JSON.parse(d).filter(o);if(c&&void 0!==c[0]){var m="";m=c[0].tag_name,s.innerHTML=m;var u=[],h=0;c[0].assets.forEach(function(){u.push(c[0].assets[h]),h++});var g=0;if(u.forEach(function(){var e=u[g].name,t=e.toUpperCase(),n=l.toUpperCase();t.indexOf(n)>=0&&(r=u[g].browser_download_url),g++}),""==r)a.className+=" hide",e.innerHTML="Downloads",r="./releases.html";else{var v=l;"Win"==l?v="Windows":"Mac"==l&&(v="macOS"),e.innerHTML="Download for "+v}}else errorContainer.innerHTML="

Error... no releases have been found!

";t.href=r,i.innerHTML="",t.className+=" animated",a.className+=" animated",n.className+=" animated",t.className=t.className.replace(/(?:^|\s)invisible(?!\S)/g,""),a.className=a.className.replace(/(?:^|\s)invisible(?!\S)/g,""),n.className=n.className.replace(/(?:^|\s)invisible(?!\S)/g,""),setTimeout(function(){t.className="dl-button a-button animated pulse"},1e3)})}function onNightlyLoad(){populateNightly();var e=document.getElementById("search"),t=document.getElementById("search-error");e.onkeyup=function(){var n,a,s,i,l,r,d;for(n=e.value.toUpperCase(),s=document.getElementById("nightly-table"),i=s.getElementsByTagName("tr"),r=0;r-1&&(a=!0);a?(i[r].style.display="",a=!1):"table-header"!=i[r].id&&(i[r].style.display="none")}document.getElementById("table-parent").offsetHeight<45?(s.style.visibility="hidden",t.className=""):(s.style.visibility="",t.className="hide")}}function populateNightly(){const e=document.getElementById("nightly-table");loadReleasesJSON("nightly",document.getElementById("nightly-loading"),function(t){function n(e){return e.prerelease===!1&&e.assets[0]}var a=JSON.parse(t).filter(n);if(void 0!==a[0]){document.getElementById("nightly-loading").innerHTML="";var s=0;e.innerHTML="ReleaseLinuxWindowsMacRelease details",a.forEach(function(){var t=e.innerHTML,n=t+="
|
Changelog
|
Timestamp:
|
Build number:
|
Commit:
";e.innerHTML=n;var i=a[s].published_at;document.getElementById("nightly-release"+s).innerHTML=a[s].name.slice(0,12),document.getElementById("nightly-release"+s).href="https://github.com/AdoptOpenJDK/nightly/releases/tag/"+a[s].name,document.getElementById("nightly-date"+s).innerHTML=moment(i).format("Do MMMM YYYY"),document.getElementById("nightly-changelog"+s).href=a[s].name,document.getElementById("nightly-timestamp"+s).innerHTML=a[s].name.slice(13,25),document.getElementById("nightly-buildnumber"+s).innerHTML=a[s].id,document.getElementById("nightly-commitref"+s).innerHTML=a[s].name,document.getElementById("nightly-commitref"+s).href=a[s].name;var l=[],r=0;a[s].assets.forEach(function(){l.push(a[s].assets[r]),r++});var d=document.getElementById("nightly-linux-dl"+s),o=document.getElementById("nightly-windows-dl"+s),c=document.getElementById("nightly-mac-dl"+s),m=document.getElementById("nightly-linux-dl-content"+s),u=document.getElementById("nightly-windows-dl-content"+s),h=document.getElementById("nightly-mac-dl-content"+s);assetCounter2=0,l.forEach(function(){var e=l[assetCounter2].name,t=e.toUpperCase();if(t.indexOf("LINUX")>=0){d.innerHTML="tar.gz ("+Math.floor(l[assetCounter2].size/1024/1024)+" MB)",document.getElementById("nightly-linux-checksum"+s).href=l[assetCounter2].browser_download_url.replace("tar.gz","txt");var n=l[assetCounter2].browser_download_url;d.href=n,m.className=m.className.replace(/(?:^|\s)invisible(?!\S)/g,"")}else if(t.indexOf("WIN")>=0){o.innerHTML=".zip ("+Math.floor(l[assetCounter2].size/1024/1024)+" MB)",document.getElementById("nightly-windows-checksum"+s).href=l[assetCounter2].browser_download_url.replace("zip","txt");var a=l[assetCounter2].browser_download_url;o.href=a,u.className=u.className.replace(/(?:^|\s)invisible(?!\S)/g,"")}else if(t.indexOf("MAC")>=0){c.innerHTML="tar.gz ("+Math.floor(l[assetCounter2].size/1024/1024)+" MB)",document.getElementById("nightly-mac-checksum"+s).href=l[assetCounter2].browser_download_url.replace("tar.gz","txt");var i=l[assetCounter2].browser_download_url;c.href=i,h.className=h.className.replace(/(?:^|\s)invisible(?!\S)/g,"")}assetCounter2++});var g=document.getElementById(s);g.className+=" animated fadeIn",g.className=g.className.replace(/(?:^|\s)hide(?!\S)/g,""),s++})}else errorContainer.innerHTML="

Error... no releases have been found!

",document.getElementById("nightly-loading").innerHTML=""})}function onReleasesLoad(){function e(){a.className+=" hide",n.className=n.className.replace(/(?:^|\s)hide(?!\S)/g,""),populateArchive()}function t(){n.className+=" hide",a.className=a.className.replace(/(?:^|\s)hide(?!\S)/g,""),populateLatest()}const n=document.getElementById("archives-page"),a=document.getElementById("latest-page");"#archive"==window.location.hash?e():t(),window.onhashchange=function(){"#archive"==window.location.hash?e():t(),errorContainer.innerHTML=""}}function populateLatest(){loadReleasesJSON("releases",document.getElementById("latest-loading"),function(e){function t(e){return e.prerelease===!1&&e.assets[0]}var n=JSON.parse(e).filter(t);if(void 0!==n[0]){document.getElementById("latest-loading").innerHTML="";var a=n[0].published_at;document.getElementById("latest-build-name").innerHTML=n[0].name,document.getElementById("latest-build-name").href="https://github.com/AdoptOpenJDK/openjdk-releases/releases/tag/"+n[0].name,document.getElementById("latest-date").innerHTML=moment(a).format("Do MMMM YYYY"),document.getElementById("latest-changelog").href=n[0].name,document.getElementById("latest-timestamp").innerHTML=a.slice(0,4)+a.slice(8,10)+a.slice(5,7)+a.slice(11,13)+a.slice(14,16),document.getElementById("latest-buildnumber").innerHTML=n[0].id,document.getElementById("latest-commitref").innerHTML=n[0].name,document.getElementById("latest-commitref").href=n[0].name;var s=[],i=0;n[0].assets.forEach(function(){s.push(n[0].assets[i]),i++});var l=document.getElementById("linux-dl-button"),r=document.getElementById("windows-dl-button"),d=document.getElementById("mac-dl-button"),o=document.getElementById("latest-linux"),c=document.getElementById("latest-windows"),m=document.getElementById("latest-mac");assetCounter2=0,s.forEach(function(){var e=s[assetCounter2].name,t=e.toUpperCase();if(t.indexOf("LINUX")>=0){document.getElementById("latest-size-linux").innerHTML=Math.floor(s[assetCounter2].size/1024/1024),document.getElementById("latest-checksum-linux").href=s[assetCounter2].browser_download_url.replace("tar.gz","txt");var n=s[assetCounter2].browser_download_url;l.href=n,o.className=o.className.replace(/(?:^|\s)hide(?!\S)/g,"")}else if(t.indexOf("WIN")>=0){document.getElementById("latest-size-windows").innerHTML=Math.floor(s[assetCounter2].size/1024/1024),document.getElementById("latest-checksum-windows").href=s[assetCounter2].browser_download_url.replace("zip","txt");var a=s[assetCounter2].browser_download_url;r.href=a,c.className=c.className.replace(/(?:^|\s)hide(?!\S)/g,"")}else if(t.indexOf("MAC")>=0){document.getElementById("latest-size-mac").innerHTML=Math.floor(s[assetCounter2].size/1024/1024),document.getElementById("latest-checksum-mac").href=s[assetCounter2].browser_download_url.replace("tar.gz","txt");var i=s[assetCounter2].browser_download_url;d.href=i,m.className=m.className.replace(/(?:^|\s)hide(?!\S)/g,"")}assetCounter2++});const u=document.getElementById("latest-container");u.className+=" animated fadeIn",u.className=u.className.replace(/(?:^|\s)invisible(?!\S)/g,"")}else errorContainer.innerHTML="

Error... no releases have been found!

",document.getElementById("latest-loading").innerHTML=""})}function populateArchive(){const e=document.getElementById("archive-list");loadReleasesJSON("releases",document.getElementById("archive-loading"),function(t){function n(e){return e.prerelease===!1&&e.assets[0]}var a=JSON.parse(t).filter(n);if(void 0!==a[1]){document.getElementById("archive-loading").innerHTML="";var s=0;a.forEach(function(){var t=e.innerHTML,n=t+="

Timestamp:
Build number:
Commit:
";e.innerHTML=n;var i=a[s].published_at;document.getElementById("archive-release"+s).innerHTML=a[s].name,document.getElementById("archive-release"+s).href="https://github.com/AdoptOpenJDK/openjdk-releases/releases/tag/"+a[s].name,document.getElementById("archive-date"+s).innerHTML=moment(i).format("Do MMMM YYYY"),document.getElementById("archive-changelog"+s).href=a[s].name,document.getElementById("archive-timestamp"+s).innerHTML=i.slice(0,4)+i.slice(8,10)+i.slice(5,7)+i.slice(11,13)+i.slice(14,16),document.getElementById("archive-buildnumber"+s).innerHTML=a[s].id,document.getElementById("archive-commitref"+s).innerHTML=a[s].name,document.getElementById("archive-commitref"+s).href=a[s].name;var l=[],r=0;a[s].assets.forEach(function(){l.push(a[s].assets[r]),r++});var d=document.getElementById("archive-linux-dl"+s),o=document.getElementById("archive-windows-dl"+s),c=document.getElementById("archive-mac-dl"+s),m=document.getElementById("linux-platform-block"+s),u=document.getElementById("windows-platform-block"+s),h=document.getElementById("mac-platform-block"+s);assetCounter2=0,l.forEach(function(){var e=l[assetCounter2].name,t=e.toUpperCase();if(t.indexOf("LINUX")>=0){document.getElementById("archive-linux-size"+s).innerHTML=Math.floor(l[assetCounter2].size/1024/1024),document.getElementById("archive-linux-checksum"+s).href=l[assetCounter2].browser_download_url.replace("tar.gz","txt");var n=l[assetCounter2].browser_download_url;d.href=n,m.className=m.className.replace(/(?:^|\s)hide(?!\S)/g,"")}else if(t.indexOf("WIN")>=0){document.getElementById("archive-windows-size"+s).innerHTML=Math.floor(l[assetCounter2].size/1024/1024),document.getElementById("archive-windows-checksum"+s).href=l[assetCounter2].browser_download_url.replace("zip","txt");var a=l[assetCounter2].browser_download_url;o.href=a,u.className=u.className.replace(/(?:^|\s)hide(?!\S)/g,"")}else if(t.indexOf("MAC")>=0){document.getElementById("archive-mac-size"+s).innerHTML=Math.floor(l[assetCounter2].size/1024/1024),document.getElementById("archive-mac-checksum"+s).href=l[assetCounter2].browser_download_url.replace("tar.gz","txt");var i=l[assetCounter2].browser_download_url;c.href=i,h.className=h.className.replace(/(?:^|\s)hide(?!\S)/g,"")}assetCounter2++});var g=document.getElementById(s);g.className+=" animated fadeIn",g.className=g.className.replace(/(?:^|\s)hide(?!\S)/g,""),s++})}else errorContainer.innerHTML="

There are no archived releases yet! See the Latest release page.

",document.getElementById("archive-loading").innerHTML=""})}var errorContainer=document.getElementById("error-container");const menuOpen=document.getElementById("menu-button"),menuClose=document.getElementById("menu-close"),menu=document.getElementById("menu-container");menuOpen.onclick=function(){menu.className=menu.className.replace(/(?:^|\s)slideOutLeft(?!\S)/g," slideInLeft"),menu.className=menu.className.replace(/(?:^|\s)hide(?!\S)/g," animated")},menuClose.onclick=function(){menu.className=menu.className.replace(/(?:^|\s)slideInLeft(?!\S)/g," slideOutLeft")};var assetCounter2=0,assetCounter2=0; \ No newline at end of file +function detectOS(){var e="UnknownOS";return navigator.userAgent.indexOf("Win")!=-1&&(e="Win"),navigator.userAgent.indexOf("Mac")!=-1&&(e="Mac"),navigator.userAgent.indexOf("X11")!=-1&&(e="Linux"),navigator.userAgent.indexOf("Linux")!=-1&&(e="Linux"),navigator.userAgent.indexOf("obile")!=-1&&(e="UnknownOS"),e}function loadReleasesJSON(e,t,n){if(1==msieversion())t.innerHTML="",document.getElementById("error-container").innerHTML="

Internet Explorer is not supported. Please use another browser, or see the releases list on GitHub.

";else{var a="https://raw.githubusercontent.com/AdoptOpenJDK/openjdk-"+e+"/master/"+e+".json",s=new XMLHttpRequest;s.overrideMimeType("application/json"),s.open("GET",a,!0),s.onreadystatechange=function(){4==s.readyState&&"200"==s.status?n(s.responseText):"200"!=s.status&&(t.innerHTML="",document.getElementById("error-container").innerHTML="

Error... there's a problem fetching the releases. Please see the releases list on GitHub.

")},s.send(null)}}function msieversion(){return!!(window.navigator.userAgent.indexOf("MSIE ")>=0||navigator.userAgent.match(/Trident.*rv\:11\./))}function onIndexLoad(){setDownloadSection()}function setDownloadSection(){const e=document.getElementById("dl-text"),t=document.getElementById("dl-latest"),n=document.getElementById("dl-archive"),a=document.getElementById("dl-other"),s=document.getElementById("dl-version-text"),i=document.getElementById("loading-index");var l=detectOS(),r="";loadReleasesJSON("releases",i,function(d){function o(e){return e.prerelease===!1&&e.assets[0]}var c=JSON.parse(d).filter(o);if(void 0!==c[0]){var m="";m=c[0].tag_name,s.innerHTML=m;var u=[],h=0;c[0].assets.forEach(function(){u.push(c[0].assets[h]),h++});var g=0;if(u.forEach(function(){var e=u[g].name,t=e.toUpperCase(),n=l.toUpperCase();t.indexOf(n)>=0&&(r=u[g].browser_download_url),g++}),""==r)a.className+=" hide",e.innerHTML="Downloads",r="./releases.html";else{var v=l;"Win"==l?v="Windows":"Mac"==l&&(v="macOS"),e.innerHTML="Download for "+v}}else errorContainer.innerHTML="

Error... no releases have been found!

";t.href=r,i.innerHTML="",t.className+=" animated",a.className+=" animated",n.className+=" animated",t.className=t.className.replace(/(?:^|\s)invisible(?!\S)/g,""),a.className=a.className.replace(/(?:^|\s)invisible(?!\S)/g,""),n.className=n.className.replace(/(?:^|\s)invisible(?!\S)/g,""),setTimeout(function(){t.className="dl-button a-button animated pulse"},1e3)})}function onNightlyLoad(){populateNightly();var e=document.getElementById("search"),t=document.getElementById("search-error");e.onkeyup=function(){var n,a,s,i,l,r,d;for(n=e.value.toUpperCase(),s=document.getElementById("nightly-table"),i=s.getElementsByTagName("tr"),r=0;r-1&&(a=!0);a?(i[r].style.display="",a=!1):"table-header"!=i[r].id&&(i[r].style.display="none")}document.getElementById("table-parent").offsetHeight<45?(s.style.visibility="hidden",t.className=""):(s.style.visibility="",t.className="hide")}}function populateNightly(){const e=document.getElementById("nightly-table");loadReleasesJSON("nightly",document.getElementById("nightly-loading"),function(t){function n(e){return e.prerelease===!1&&e.assets[0]}var a=JSON.parse(t).filter(n);if(void 0!==a[0]){document.getElementById("nightly-loading").innerHTML="";var s=0;e.innerHTML="ReleaseLinuxWindowsMacRelease details",a.forEach(function(){var t=e.innerHTML,n=t+="
|
Changelog
|
Timestamp:
|
Build number:
|
Commit:
";e.innerHTML=n;var i=a[s].published_at;document.getElementById("nightly-release"+s).innerHTML=a[s].name.slice(0,12),document.getElementById("nightly-release"+s).href="https://github.com/AdoptOpenJDK/nightly/releases/tag/"+a[s].name,document.getElementById("nightly-date"+s).innerHTML=moment(i).format("Do MMMM YYYY"),document.getElementById("nightly-changelog"+s).href=a[s].name,document.getElementById("nightly-timestamp"+s).innerHTML=a[s].name.slice(13,25),document.getElementById("nightly-buildnumber"+s).innerHTML=a[s].id,document.getElementById("nightly-commitref"+s).innerHTML=a[s].name,document.getElementById("nightly-commitref"+s).href=a[s].name;var l=[],r=0;a[s].assets.forEach(function(){l.push(a[s].assets[r]),r++});var d=document.getElementById("nightly-linux-dl"+s),o=document.getElementById("nightly-windows-dl"+s),c=document.getElementById("nightly-mac-dl"+s),m=document.getElementById("nightly-linux-dl-content"+s),u=document.getElementById("nightly-windows-dl-content"+s),h=document.getElementById("nightly-mac-dl-content"+s);assetCounter2=0,l.forEach(function(){var e=l[assetCounter2].name,t=e.toUpperCase();if(t.indexOf("LINUX")>=0){d.innerHTML="tar.gz ("+Math.floor(l[assetCounter2].size/1024/1024)+" MB)",document.getElementById("nightly-linux-checksum"+s).href=l[assetCounter2].browser_download_url.replace("tar.gz","txt");var n=l[assetCounter2].browser_download_url;d.href=n,m.className=m.className.replace(/(?:^|\s)invisible(?!\S)/g,"")}else if(t.indexOf("WIN")>=0){o.innerHTML=".zip ("+Math.floor(l[assetCounter2].size/1024/1024)+" MB)",document.getElementById("nightly-windows-checksum"+s).href=l[assetCounter2].browser_download_url.replace("zip","txt");var a=l[assetCounter2].browser_download_url;o.href=a,u.className=u.className.replace(/(?:^|\s)invisible(?!\S)/g,"")}else if(t.indexOf("MAC")>=0){c.innerHTML="tar.gz ("+Math.floor(l[assetCounter2].size/1024/1024)+" MB)",document.getElementById("nightly-mac-checksum"+s).href=l[assetCounter2].browser_download_url.replace("tar.gz","txt");var i=l[assetCounter2].browser_download_url;c.href=i,h.className=h.className.replace(/(?:^|\s)invisible(?!\S)/g,"")}assetCounter2++});var g=document.getElementById(s);g.className+=" animated fadeIn",g.className=g.className.replace(/(?:^|\s)hide(?!\S)/g,""),s++})}else errorContainer.innerHTML="

Error... no releases have been found!

",document.getElementById("nightly-loading").innerHTML=""})}function onReleasesLoad(){function e(){a.className+=" hide",n.className=n.className.replace(/(?:^|\s)hide(?!\S)/g,""),populateArchive()}function t(){n.className+=" hide",a.className=a.className.replace(/(?:^|\s)hide(?!\S)/g,""),populateLatest()}const n=document.getElementById("archives-page"),a=document.getElementById("latest-page");"#archive"==window.location.hash?e():t(),window.onhashchange=function(){"#archive"==window.location.hash?(errorContainer.innerHTML="",e()):(errorContainer.innerHTML="",t())}}function populateLatest(){loadReleasesJSON("releases",document.getElementById("latest-loading"),function(e){function t(e){return e.prerelease===!1&&e.assets[0]}var n=JSON.parse(e).filter(t);if(void 0!==n[0]){document.getElementById("latest-loading").innerHTML="";var a=n[0].published_at;document.getElementById("latest-build-name").innerHTML=n[0].name,document.getElementById("latest-build-name").href="https://github.com/AdoptOpenJDK/openjdk-releases/releases/tag/"+n[0].name,document.getElementById("latest-date").innerHTML=moment(a).format("Do MMMM YYYY"),document.getElementById("latest-changelog").href=n[0].name,document.getElementById("latest-timestamp").innerHTML=a.slice(0,4)+a.slice(8,10)+a.slice(5,7)+a.slice(11,13)+a.slice(14,16),document.getElementById("latest-buildnumber").innerHTML=n[0].id,document.getElementById("latest-commitref").innerHTML=n[0].name,document.getElementById("latest-commitref").href=n[0].name;var s=[],i=0;n[0].assets.forEach(function(){s.push(n[0].assets[i]),i++});var l=document.getElementById("linux-dl-button"),r=document.getElementById("windows-dl-button"),d=document.getElementById("mac-dl-button"),o=document.getElementById("latest-linux"),c=document.getElementById("latest-windows"),m=document.getElementById("latest-mac");assetCounter2=0,s.forEach(function(){var e=s[assetCounter2].name,t=e.toUpperCase();if(t.indexOf("LINUX")>=0){document.getElementById("latest-size-linux").innerHTML=Math.floor(s[assetCounter2].size/1024/1024),document.getElementById("latest-checksum-linux").href=s[assetCounter2].browser_download_url.replace("tar.gz","txt");var n=s[assetCounter2].browser_download_url;l.href=n,o.className=o.className.replace(/(?:^|\s)hide(?!\S)/g,"")}else if(t.indexOf("WIN")>=0){document.getElementById("latest-size-windows").innerHTML=Math.floor(s[assetCounter2].size/1024/1024),document.getElementById("latest-checksum-windows").href=s[assetCounter2].browser_download_url.replace("zip","txt");var a=s[assetCounter2].browser_download_url;r.href=a,c.className=c.className.replace(/(?:^|\s)hide(?!\S)/g,"")}else if(t.indexOf("MAC")>=0){document.getElementById("latest-size-mac").innerHTML=Math.floor(s[assetCounter2].size/1024/1024),document.getElementById("latest-checksum-mac").href=s[assetCounter2].browser_download_url.replace("tar.gz","txt");var i=s[assetCounter2].browser_download_url;d.href=i,m.className=m.className.replace(/(?:^|\s)hide(?!\S)/g,"")}assetCounter2++});const u=document.getElementById("latest-container");u.className+=" animated fadeIn",u.className=u.className.replace(/(?:^|\s)invisible(?!\S)/g,"")}else errorContainer.innerHTML="

Error... no releases have been found!

",document.getElementById("latest-loading").innerHTML=""})}function populateArchive(){const e=document.getElementById("archive-list");loadReleasesJSON("releases",document.getElementById("archive-loading"),function(t){function n(e){return e.prerelease===!1&&e.assets[0]}var a=JSON.parse(t).filter(n);if(void 0!==a[1]){document.getElementById("archive-loading").innerHTML="";var s=0;a.forEach(function(){var t=e.innerHTML,n=t+="

Timestamp:
Build number:
Commit:
";e.innerHTML=n;var i=a[s].published_at;document.getElementById("archive-release"+s).innerHTML=a[s].name,document.getElementById("archive-release"+s).href="https://github.com/AdoptOpenJDK/openjdk-releases/releases/tag/"+a[s].name,document.getElementById("archive-date"+s).innerHTML=moment(i).format("Do MMMM YYYY"),document.getElementById("archive-changelog"+s).href=a[s].name,document.getElementById("archive-timestamp"+s).innerHTML=i.slice(0,4)+i.slice(8,10)+i.slice(5,7)+i.slice(11,13)+i.slice(14,16),document.getElementById("archive-buildnumber"+s).innerHTML=a[s].id,document.getElementById("archive-commitref"+s).innerHTML=a[s].name,document.getElementById("archive-commitref"+s).href=a[s].name;var l=[],r=0;a[s].assets.forEach(function(){l.push(a[s].assets[r]),r++});var d=document.getElementById("archive-linux-dl"+s),o=document.getElementById("archive-windows-dl"+s),c=document.getElementById("archive-mac-dl"+s),m=document.getElementById("linux-platform-block"+s),u=document.getElementById("windows-platform-block"+s),h=document.getElementById("mac-platform-block"+s);assetCounter2=0,l.forEach(function(){var e=l[assetCounter2].name,t=e.toUpperCase();if(t.indexOf("LINUX")>=0){document.getElementById("archive-linux-size"+s).innerHTML=Math.floor(l[assetCounter2].size/1024/1024),document.getElementById("archive-linux-checksum"+s).href=l[assetCounter2].browser_download_url.replace("tar.gz","txt");var n=l[assetCounter2].browser_download_url;d.href=n,m.className=m.className.replace(/(?:^|\s)hide(?!\S)/g,"")}else if(t.indexOf("WIN")>=0){document.getElementById("archive-windows-size"+s).innerHTML=Math.floor(l[assetCounter2].size/1024/1024),document.getElementById("archive-windows-checksum"+s).href=l[assetCounter2].browser_download_url.replace("zip","txt");var a=l[assetCounter2].browser_download_url;o.href=a,u.className=u.className.replace(/(?:^|\s)hide(?!\S)/g,"")}else if(t.indexOf("MAC")>=0){document.getElementById("archive-mac-size"+s).innerHTML=Math.floor(l[assetCounter2].size/1024/1024),document.getElementById("archive-mac-checksum"+s).href=l[assetCounter2].browser_download_url.replace("tar.gz","txt");var i=l[assetCounter2].browser_download_url;c.href=i,h.className=h.className.replace(/(?:^|\s)hide(?!\S)/g,"")}assetCounter2++});var g=document.getElementById(s);g.className+=" animated fadeIn",g.className=g.className.replace(/(?:^|\s)hide(?!\S)/g,""),s++})}else errorContainer.innerHTML="

There are no archived releases yet! See the Latest release page.

",document.getElementById("archive-loading").innerHTML=""})}var errorContainer=document.getElementById("error-container");const menuOpen=document.getElementById("menu-button"),menuClose=document.getElementById("menu-close"),menu=document.getElementById("menu-container");menuOpen.onclick=function(){menu.className=menu.className.replace(/(?:^|\s)slideOutLeft(?!\S)/g," slideInLeft"),menu.className=menu.className.replace(/(?:^|\s)hide(?!\S)/g," animated")},menuClose.onclick=function(){menu.className=menu.className.replace(/(?:^|\s)slideInLeft(?!\S)/g," slideOutLeft")};var assetCounter2=0,assetCounter2=0; \ No newline at end of file diff --git a/installation.html b/installation.html index 4da859ca..bed27251 100644 --- a/installation.html +++ b/installation.html @@ -41,7 +41,7 @@
-

Installation

+

Installation