From 89b8c8a1f1f83a949709d8c5fbd157d3dc40798b Mon Sep 17 00:00:00 2001 From: Reem H <42309026+reemhamz@users.noreply.github.com> Date: Wed, 9 Oct 2024 20:31:26 +1100 Subject: [PATCH] Added ESR link and updated primary link in Moments Page (#15260) --- .../firefox/templates/firefox/welcome/page19.html | 12 +++++++++++- media/css/firefox/welcome19.scss | 10 ++++++++++ media/js/firefox/welcome/welcome19.js | 15 +++++++++++++++ media/static-bundles.json | 6 ++++++ 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 media/js/firefox/welcome/welcome19.js diff --git a/bedrock/firefox/templates/firefox/welcome/page19.html b/bedrock/firefox/templates/firefox/welcome/page19.html index ac23cb1cf9..acbebf9ab2 100644 --- a/bedrock/firefox/templates/firefox/welcome/page19.html +++ b/bedrock/firefox/templates/firefox/welcome/page19.html @@ -228,8 +228,13 @@

{{ main_title }}

{{ main_tagline }}

-

{{ cta_text }}

+ + {{ download_firefox_thanks(alt_copy=cta_text, button_class='mzp-t-xl', dom_id='update-firefox') }} + +

{{ cta_text }}

+ {{ update_time }} +
{% endblock %} @@ -292,3 +297,8 @@

{% endblock %} + +{% block js %} + {{ js_bundle('firefox_welcome_page19') }} +{% endblock %} + diff --git a/media/css/firefox/welcome19.scss b/media/css/firefox/welcome19.scss index 2facbfcf35..6af6d024a1 100644 --- a/media/css/firefox/welcome19.scss +++ b/media/css/firefox/welcome19.scss @@ -50,6 +50,16 @@ $image-path: '/media/protocol/img'; text-wrap: balance; } +// visible by default and used as a fallback, will be hidden via JS for ESR browsers +#update-firefox { + display: block; +} + +// not displayed by default, will be visible via JS for ESR browsers +#update-firefox-esr { + display: none; +} + .mzp-l-columns { padding-top: 0; diff --git a/media/js/firefox/welcome/welcome19.js b/media/js/firefox/welcome/welcome19.js new file mode 100644 index 0000000000..897d56decf --- /dev/null +++ b/media/js/firefox/welcome/welcome19.js @@ -0,0 +1,15 @@ +/* eslint-disable no-console */ + +(function () { + 'use strict'; + + const firefoxReleaseCTA = document.getElementById('update-firefox'); + const firefoxEsrCTA = document.getElementById('update-firefox-esr'); + + Mozilla.UITour.getConfiguration('appinfo', function (details) { + if (details.defaultUpdateChannel === 'esr') { + firefoxEsrCTA.style.display = 'block'; + firefoxReleaseCTA.style.display = 'none'; + } + }); +})(); diff --git a/media/static-bundles.json b/media/static-bundles.json index 5c180f5b37..ab5cfa2992 100644 --- a/media/static-bundles.json +++ b/media/static-bundles.json @@ -1297,6 +1297,12 @@ "js/firefox/welcome/welcome16.js" ], "name": "firefox_welcome_page16" + }, + { + "files": [ + "js/firefox/welcome/welcome19.js" + ], + "name": "firefox_welcome_page19" }, { "files": [