-
Notifications
You must be signed in to change notification settings - Fork 932
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
fa7a13e
commit 215a951
Showing
14 changed files
with
438 additions
and
20 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
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,57 @@ | ||
{# | ||
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_custom_download_id = 'partner-firefox-release-smi-smi-001-stub' %} | ||
{% set mac_custom_download_id = 'partner-firefox-release-smi-smi-001-latest' %} | ||
|
||
{% set android_campaign_url = play_store_url('firefox', 'custom-001') %} | ||
{% set ios_campaign_url = app_store_url('firefox', 'custom-001') %} | ||
|
||
{% block string_data %} | ||
data-win-custom-id="{{ win_custom_download_id }}" | ||
data-mac-custom-id="{{ mac_custom_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 mobile_primary_cta %} | ||
<div class="show-android"> | ||
{{ google_play_button(href=android_campaign_url) }} | ||
</div> | ||
<div class="show-ios"> | ||
{{ apple_app_store_button(href=ios_campaign_url) }} | ||
</div> | ||
{% endblock %} | ||
|
||
{% block mobile_secondary_cta %} | ||
<ul class="mobile-download-buttons"> | ||
<li class="android"> | ||
{{ google_play_button(href=android_campaign_url) }} | ||
</li> | ||
<li class="ios"> | ||
{{ apple_app_store_button(href=ios_campaign_url) }} | ||
</li> | ||
</ul> | ||
{% endblock %} | ||
|
||
{% block js %} | ||
{{ super() }} | ||
{{ js_bundle('firefox_partner_build_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
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 PartnerBuildDownload from './partner-build-download.es6'; | ||
|
||
PartnerBuildDownload.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,56 @@ | ||
/* | ||
* 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 PartnerBuildDownload = {}; | ||
|
||
let winDownloadID; | ||
let macDownloadID; | ||
|
||
PartnerBuildDownload.createCustomDownloadURL = (link, id) => { | ||
const url = new URL(link.href); | ||
|
||
// update product to custom build ID. | ||
url.searchParams.set('product', id); | ||
|
||
link.href = url; | ||
}; | ||
|
||
PartnerBuildDownload.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.forEach((link) => | ||
PartnerBuildDownload.createCustomDownloadURL(link, winDownloadID) | ||
); | ||
downloadLinksMac.forEach((link) => | ||
PartnerBuildDownload.createCustomDownloadURL(link, macDownloadID) | ||
); | ||
}; | ||
|
||
PartnerBuildDownload.init = () => { | ||
const strings = document.getElementById('strings'); | ||
winDownloadID = strings.getAttribute('data-win-custom-id'); | ||
macDownloadID = strings.getAttribute('data-mac-custom-id'); | ||
|
||
if ( | ||
typeof window.URL === 'function' && | ||
typeof Array.from === 'function' && | ||
winDownloadID && | ||
macDownloadID | ||
) { | ||
PartnerBuildDownload.replaceWithCustomDownloadLinks(); | ||
} | ||
}; | ||
|
||
export default PartnerBuildDownload; |
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
Oops, something went wrong.