From 9dc703c3121996f56e5bf338ab2e4fa269f03d9d Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Mon, 12 Jul 2021 10:14:39 +0100 Subject: [PATCH] Doc: Progressive enhancements on download page --- Assets/WebsiteAssets/css/site.css | 4 ++++ Assets/WebsiteAssets/js/script.js | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Assets/WebsiteAssets/css/site.css b/Assets/WebsiteAssets/css/site.css index a0b49a1c7..ef2a4a014 100644 --- a/Assets/WebsiteAssets/css/site.css +++ b/Assets/WebsiteAssets/css/site.css @@ -509,6 +509,10 @@ p, text-align: center; } +.page-download .downloaded-filename { + font-weight: bold; +} + @media (min-width: 767px) { .content-wrapper{ display: flex; diff --git a/Assets/WebsiteAssets/js/script.js b/Assets/WebsiteAssets/js/script.js index e74c39bae..973a57aa6 100644 --- a/Assets/WebsiteAssets/js/script.js +++ b/Assets/WebsiteAssets/js/script.js @@ -6,6 +6,12 @@ function getOs() { return null; } +function getFilename(path) { + if (!path) return ''; + const s = path.split('/'); + return s.pop(); +} + function getMobileOs() { var userAgent = navigator.userAgent || navigator.vendor || window.opera; @@ -72,7 +78,9 @@ function setupDownloadPage() { window.location = 'https://joplinapp.org/help/#desktop-applications'; } else { // Otherwise, start the download - window.location = downloadLinks[os]; + const downloadLink = downloadLinks[os]; + $('.downloaded-filename').text(getFilename(downloadLink)); + window.location = downloadLink; } } }