forked from mozilla/bedrock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UK influencer campaign page (Fixes mozilla#15841)
- Loading branch information
1 parent
9db97b8
commit 008524e
Showing
8 changed files
with
369 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
bedrock/firefox/templates/firefox/landing/productivity.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{# | ||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
#} | ||
|
||
{% extends "firefox/new/desktop/download.html" %} | ||
|
||
{% block canonical_urls %}<meta name="robots" content="noindex,follow">{% endblock %} | ||
|
||
{% set win_smi_download_id = 'partner-firefox-release-smi-smi-001-stub' %} | ||
{% set mac_smi_download_id = 'partner-firefox-release-smi-smi-001' %} | ||
|
||
{% block string_data %} | ||
data-win-smi-id="{{ win_smi_download_id }}" | ||
data-mac-smi-id="{{ mac_smi_download_id }}" | ||
{% endblock %} | ||
|
||
{% block primary_cta %} | ||
{{ download_firefox(dom_id='download-primary', force_direct=True, download_location='primary cta') }} | ||
{% endblock %} | ||
|
||
{% block features_cta %} | ||
{{ download_firefox(dom_id='download-features', force_direct=True, download_location='features cta') }} | ||
{% endblock %} | ||
|
||
{% block discover_cta %} | ||
{{ download_firefox(dom_id='download-discover', force_direct=True, download_location='discover cta') }} | ||
{% endblock %} | ||
|
||
{% block js %} | ||
{{ super() }} | ||
{{ js_bundle('firefox_smi_download') }} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
import SMIDownload from './smi-download.es6'; | ||
|
||
SMIDownload.init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
const SMIDownload = {}; | ||
|
||
let winDownloadID; | ||
let macDownloadID; | ||
|
||
SMIDownload.createCustomDownloadURL = (link, id) => { | ||
const url = new URL(link.href); | ||
url.searchParams.set('product', id); | ||
link.href = url; | ||
}; | ||
|
||
SMIDownload.replaceWithCustomDownloadLinks = () => { | ||
const downloadLinksWin = Array.from( | ||
document.querySelectorAll( | ||
'.download-button .download-list .download-link[data-download-version="win"]' | ||
) | ||
); | ||
const downloadLinksMac = Array.from( | ||
document.querySelectorAll( | ||
'.download-button .download-list .download-link[data-download-version="osx"]' | ||
) | ||
); | ||
|
||
downloadLinksWin.every((link) => | ||
SMIDownload.createCustomDownloadURL(link, winDownloadID) | ||
); | ||
downloadLinksMac.every((link) => | ||
SMIDownload.createCustomDownloadURL(link, macDownloadID) | ||
); | ||
}; | ||
|
||
SMIDownload.init = () => { | ||
const strings = document.getElementById('strings'); | ||
winDownloadID = strings.getAttribute('data-win-smi-id'); | ||
macDownloadID = strings.getAttribute('data-mac-smi-id'); | ||
|
||
if (typeof window.URL === 'function' && winDownloadID && macDownloadID) { | ||
SMIDownload.replaceWithCustomDownloadLinks(); | ||
} | ||
}; | ||
|
||
export default SMIDownload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.