Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save last downloaded URL & display it in post download page #953

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions _includes/legal-script.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
`post_download.html?version=${pkgVers}&type=${params.get('type')}`;
document.getElementById('download_button').onclick = function () {
ga && ga('send', 'event', 'download', componentName, artifact);
window.open(`https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/${pkgVers}/${artifact}`,
windowOpenAndSaveURL(`https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/${pkgVers}/${artifact}`,
'_blank');
}
}
Expand All @@ -23,7 +23,7 @@
document.getElementById('download_button').onclick = function () {
ga && ga('send', 'event', 'download', 'Zowe CLI ' + params.get('version'), 'zowe-cli-package-' +
(params.get('preview') ? 'next-' + params.get('preview') : params.get('version')) + '.zip');
window.open("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" +
windowOpenAndSaveURL("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" +
(params.get('preview') ? 'next' : params.get('version')) + '/zowe-cli-package-' +
(params.get('preview') ? 'next-' + params.get('preview') : params.get('version')) + '.zip',
'_blank');
Expand All @@ -37,7 +37,7 @@
ga && ga('send', 'event', 'download', 'Zowe CLI Plugins ' + params.get('version'),
'zowe-cli-plugins-' +
(params.get('preview') ? 'next-' + params.get('preview') : params.get('version')) + '.zip');
window.open("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" +
windowOpenAndSaveURL("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" +
(params.get('preview') ? 'next' : params.get('version')) + '/zowe-cli-plugins-' +
(params.get('preview') ? 'next-' + params.get('preview') : params.get('version')) + '.zip',
'_blank');
Expand All @@ -51,7 +51,7 @@
ga && ga('send', 'event', 'download', 'Zowe SMPE ' + params.get('version'), 'zowe-smpe-package-' +
params.get(
'version') + '.zip');
window.open("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" + params.get('version') +
windowOpenAndSaveURL("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" + params.get('version') +
'/zowe-smpe-package-' + params.get('version') + '.zip', '_blank');
}
document.getElementById('download_file_message').innerHTML = 'You are downloading zowe-smpe-package-' +
Expand All @@ -65,7 +65,7 @@
ga && ga('send', 'event', 'download', 'Zowe Containerization ' + params.get('version'),
'zowe-containerization-' +
params.get('version') + '.zip');
window.open("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" + params.get('version') +
windowOpenAndSaveURL("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" + params.get('version') +
'/zowe-containerization-' + params.get('version') + '.zip', '_blank');
}
document.getElementById('download_file_message').innerHTML = 'You are downloading zowe-containerization-' +
Expand All @@ -83,7 +83,7 @@
ga && ga('send', 'event', 'download', 'Zowe PSWI ' + params.get('version'), 'zowe-PSWI-' +
params.get(
'version') + '.pax.Z');
window.open(pswiUrl, '_blank');
windowOpenAndSaveURL(pswiUrl, '_blank');
}
document.getElementById('download_file_message').innerHTML = 'You are downloading zowe-PSWI-' +
params
Expand All @@ -96,7 +96,7 @@
ga && ga('send', 'event', 'download', 'Zowe Chat ' + params.get('version'),
'zowe-chat-' +
params.get('version') + '.tar.gz');
window.open("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/chat/" + params.get('version') +
windowOpenAndSaveURL("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/chat/" + params.get('version') +
'/zowe-chat-' + 'tech-preview-1.tar.gz', '_blank'); // + params.get('version') + '.tar.gz', '_blank');
}
document.getElementById('download_file_message').innerHTML = 'You are downloading zowe-chat-' +
Expand All @@ -107,7 +107,7 @@
document.getElementById('download_button').onclick = function () {
ga && ga('send', 'event', 'download', 'Zowe SMPE ' + params.get('version'), 'zowe-python-sdk-' +
(params.get('preview') ? 'next-' + params.get('preview') : params.get('version')) + '.zip');
window.open("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" +
windowOpenAndSaveURL("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" +
(params.get('preview') ? 'next' : params.get('version')) + '/zowe-python-sdk-' +
(params.get('preview') ? 'next-' + params.get('preview') : params.get('version')) + '.zip',
'_blank');
Expand All @@ -120,7 +120,7 @@
document.getElementById('download_button').onclick = function () {
ga && ga('send', 'event', 'download', 'Zowe SMPE ' + params.get('version'), 'zowe-nodejs-sdk-' +
(params.get('preview') ? 'next-' + params.get('preview') : params.get('version')) + '.zip');
window.open("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" +
windowOpenAndSaveURL("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" +
(params.get('preview') ? 'next' : params.get('version')) + '/zowe-nodejs-sdk-' +
(params.get('preview') ? 'next-' + params.get('preview') : params.get('version')) + '.zip',
'_blank');
Expand All @@ -133,7 +133,7 @@
document.getElementById('download_button').onclick = function () {
ga && ga('send', 'event', 'download', 'Zowe CLI Active Development ' + params.get('version'),
'zowe-cli-package-' + params.get('package') + '.zip');
window.open("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" + params.get('version') +
windowOpenAndSaveURL("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" + params.get('version') +
'-active-development-cli/zowe-cli-package-' + params.get('package') + '.zip', '_blank');
}
document.getElementById('download_file_message').innerHTML = 'You are downloading zowe-cli-package-' +
Expand Down Expand Up @@ -171,7 +171,7 @@
ga && ga('send', 'event', 'download',
params.get('type') + ' ' + params.get('version'), // e.g. zen-windows 1.0.0, zen-deb 1.1.0
zenFile);
window.open("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/zen/" + zenRtPath, '_blank');
windowOpenAndSaveURL("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/zen/" + zenRtPath, '_blank');
}
document.getElementById('download_file_message').innerHTML =
`You are downloading the Zowe Server Install Wizard for ${zenDistro} version ${params.get('version')}`;
Expand All @@ -181,7 +181,7 @@
document.getElementById('download_button').onclick = function () {
ga && ga('send', 'event', 'download', 'Zowe Binary ' + params.get('version'), 'zowe-' + params.get(
'version') + '.pax');
window.open("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" + params.get('version') +
windowOpenAndSaveURL("https://zowe.jfrog.io/zowe/list/libs-release-local/org/zowe/" + params.get('version') +
'/zowe-' + params.get('version') + '.pax', '_blank');
}
document.getElementById('download_file_message').innerHTML = 'You are downloading zowe-' + params.get(
Expand All @@ -190,4 +190,8 @@
}

}
function windowOpenAndSaveURL(url) {
localStorage.setItem('zowe-last-download-url', url);
window.open(url, '_blank');
}
</script>
11 changes: 10 additions & 1 deletion post_download.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@ extraJs: [common.html, post-download-script.html]
<h1 class="title" id="page_title">Thank you for downloading the Zowe binary</h1>
<p>
If you had an issue or your download did not start, please <strong><a id="download_link" href="/download">click
here</a></strong> to try again.
here</a></strong> to try again or copy the following URL to your browser:
<span id="download_url_display"></span>
</p>
<script>
// Retrieve the download URL from localStorage
const lastDownloadURL = localStorage.getItem('zowe-last-download-url') || 'No download started yet.';
const urlDisplay = document.getElementById('download_url_display');
if (urlDisplay) {
urlDisplay.textContent = lastDownloadURL; // Display the URL
}
</script>
<details>
<summary id='verify_drop'><b>How to verify binaries with digital signatures</b></summary>
<br />
Expand Down
11 changes: 10 additions & 1 deletion post_download_legacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@ extraJs: post-download-script-legacy.html
<h1 class="title" id="page_title">Thank you for downloading the Zowe binary</h1>
<p>
If you had an issue or your download did not start, please <strong><a id="download_link" href="legal.html">click
here</a></strong> to try again.
here</a></strong> to try again or copy the following URL to your browser:
<span id="download_url_display"></span>
</p>
<script>
// Retrieve the download URL from localStorage
const lastDownloadURL = localStorage.getItem('zowe-last-download-url') || 'No download started yet.';
const urlDisplay = document.getElementById('download_url_display');
if (urlDisplay) {
urlDisplay.textContent = lastDownloadURL; // Display the URL
}
</script>
<details>
<summary id='verify_drop'><b>Verify Hash and Signature of Zowe Binary</b></summary>
<p>These commands are tested on both <strong>Mac OS X v10.13.6</strong> and <strong>Ubuntu v17.11.</strong></p>
Expand Down
Loading