{{ ftl('firefox-all-choose-which-firefox') }}
+{{ self.page_desc() }}
+ {% if product %} + {% if product.slug == "desktop-release" %} +diff --git a/media/js/firefox/all/all-init.es6.js b/media/js/firefox/all/all-init.es6.js
index 845cfa74d..8f52040b5 100644
--- a/media/js/firefox/all/all-init.es6.js
+++ b/media/js/firefox/all/all-init.es6.js
@@ -8,12 +8,7 @@ import TrackProductDownload from '../../base/datalayer-productdownload.es6';
import MzpModal from '@mozilla-protocol/core/protocol/js/modal';
(function (Mozilla) {
- // Getter function since outerHTML replacement in fetchContent breaks existing references
- function getPartialTargetElement() {
- return document.getElementById('partial-target');
- }
-
- function setUpPartialContentListeners() {
+ function onLoad() {
const browserHelpContent = document.getElementById('browser-help');
const browserHelpIcon = document.getElementById('icon-browser-help');
const installerHelpContent = document.getElementById('installer-help');
@@ -86,74 +81,6 @@ import MzpModal from '@mozilla-protocol/core/protocol/js/modal';
);
}
}
-
- // Override click events for drill-down links.
- getPartialTargetElement().addEventListener('click', function (event) {
- const anchor = event.target.closest('a');
- if (anchor && anchor.matches('.load-content-partial')) {
- event.preventDefault();
- fetchContent(anchor.href, true);
- }
- });
- }
-
- // A fetch helper since we use this in both the on click and popstate.
- // pushState is a boolean so we avoid pushing state if triggered from popstate.
- function fetchContent(url, pushState = false) {
- fetch(url, {
- // Signifies to backend to return partial HTML.
- headers: { 'X-Requested-With': 'XMLHttpRequest' },
- // Ignore what's cached and also don't cache this response.
- // This is so we don't get full html pages when we expect partial html, or vice versa.
- cache: 'no-store'
- })
- .then((response) => {
- if (!response.ok) {
- throw new Error('Network response was not ok');
- }
- return response.text();
- })
- .then((html) => {
- const partialTarget = getPartialTargetElement();
- partialTarget.outerHTML = html;
-
- // Re-attach listeners as we just replaced partialTarget
- setUpPartialContentListeners();
-
- if (pushState) {
- history.pushState({ path: url }, '', url);
- }
-
- const activeHeaders = document.querySelectorAll(
- '.c-step-name:not(.t-step-disabled)'
- );
- const targetHeader = activeHeaders[activeHeaders.length - 1];
- targetHeader.focus({ preventScroll: true });
- })
- .catch((error) => {
- throw new Error(
- 'There was a problem with the fetch operation:',
- error
- );
- });
- }
-
- function onLoad() {
- setUpPartialContentListeners();
-
- // Add popstate listener so we return partial HTML with browser back button.
- window.addEventListener('popstate', function (event) {
- if (!event.state) {
- return;
- }
- fetchContent(event.state.path, false);
- });
-
- // Ensure initial state is set up when the page loads so root page is in popstate.
- window.addEventListener('DOMContentLoaded', () => {
- const url = window.location.href;
- history.replaceState({ path: url }, '', url);
- });
}
Mozilla.run(onLoad);
diff --git a/springfield/firefox/templates/firefox/all/base.html b/springfield/firefox/templates/firefox/all/base.html
index 829268804..b62659585 100644
--- a/springfield/firefox/templates/firefox/all/base.html
+++ b/springfield/firefox/templates/firefox/all/base.html
@@ -10,6 +10,10 @@
{{ ftl('firefox-all-download-the-firefox-v2') }}
{%- endblock -%}
+{%- block page_desc -%}
+ {{ ftl('firefox-all-everyone-deserves-access-v2') }}
+{%- endblock -%}
+
{% block page_css %}
{{ css_bundle('firefox_all') }}
{% endblock %}
@@ -42,7 +46,95 @@
{% endif %}
{% block content %}
- {% include 'firefox/all/includes/main.html' %}
+ {{ self.page_desc() }}{{ ftl('firefox-all-choose-which-firefox') }}
+
{{ ftl('firefox-all-everyone-deserves-access-v2') }}
- {% if product %} - {% if product.slug == "desktop-release" %} -