2018-02-13 20:32:59 +01:00
|
|
|
const html = require('choo/html');
|
2018-08-03 21:24:41 +02:00
|
|
|
const version = require('../../../package.json').version;
|
2018-02-13 20:32:59 +01:00
|
|
|
const assets = require('../../../common/assets');
|
2018-08-03 21:24:41 +02:00
|
|
|
const { browserName } = require('../../utils');
|
2018-02-13 20:32:59 +01:00
|
|
|
|
|
|
|
module.exports = function(state) {
|
2018-08-03 21:24:41 +02:00
|
|
|
const browser = browserName();
|
|
|
|
const feedbackUrl = `https://qsurvey.mozilla.com/s3/txp-firefox-send?ver=${version}&browser=${browser}`;
|
|
|
|
|
2018-03-12 18:15:11 +01:00
|
|
|
const footer = html`<footer class="footer">
|
2018-08-03 21:24:41 +02:00
|
|
|
<div class="legalSection"
|
|
|
|
onmouseover=${showDropDown}
|
|
|
|
onmouseout=${hideDropDown}>
|
|
|
|
|
|
|
|
<div class="legalSection__menu">
|
|
|
|
<img class="dropDownArrow" src="${assets.get('dropdown-arrow.svg')}"/>
|
|
|
|
<a class="legalSection__link"
|
|
|
|
href="https://www.mozilla.org/about/legal">
|
|
|
|
${state.translate('footerLinkLegal')}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
2018-02-13 20:32:59 +01:00
|
|
|
<a
|
|
|
|
href="https://testpilot.firefox.com/about"
|
2018-08-03 21:24:41 +02:00
|
|
|
class="legalSection__link footer__dropdown footer__noDisplay">
|
2018-02-13 20:32:59 +01:00
|
|
|
${state.translate('footerLinkAbout')}
|
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
href="/legal"
|
2018-08-03 21:24:41 +02:00
|
|
|
class="legalSection__link footer__dropdown footer__noDisplay">
|
|
|
|
${state.translate('footerLinkTerms')}
|
|
|
|
</a>
|
2018-02-13 20:32:59 +01:00
|
|
|
<a
|
|
|
|
href="https://www.mozilla.org/privacy/websites/#cookies"
|
2018-08-03 21:24:41 +02:00
|
|
|
class="legalSection__link footer__dropdown footer__noDisplay">
|
2018-02-13 20:32:59 +01:00
|
|
|
${state.translate('footerLinkCookies')}
|
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
href="https://www.mozilla.org/about/legal/report-infringement/"
|
2018-08-03 21:24:41 +02:00
|
|
|
class="legalSection__link footer__dropdown footer__noDisplay">
|
2018-02-13 20:32:59 +01:00
|
|
|
${state.translate('reportIPInfringement')}
|
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
href="https://github.com/mozilla/send"
|
2018-08-03 21:24:41 +02:00
|
|
|
class="legalSection__link footer__dropdown dropdown__only footer__noDisplay">
|
|
|
|
Github
|
2018-02-13 20:32:59 +01:00
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
href="https://twitter.com/FxTestPilot"
|
2018-08-03 21:24:41 +02:00
|
|
|
class="legalSection__link footer__dropdown dropdown__only footer__noDisplay">
|
|
|
|
Twitter
|
2018-02-13 20:32:59 +01:00
|
|
|
</a>
|
|
|
|
</div>
|
2018-08-03 21:24:41 +02:00
|
|
|
|
|
|
|
<a href="${feedbackUrl}"
|
|
|
|
rel="noreferrer noopener"
|
|
|
|
class="feedback"
|
|
|
|
alt="Feedback"
|
|
|
|
target="_blank">${state.translate('siteFeedback')}
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<a
|
|
|
|
href="https://github.com/mozilla/send"
|
|
|
|
class="socialSection__link footer_hiddenIcon">
|
|
|
|
<img
|
|
|
|
class="socialSection__icon"
|
|
|
|
src="${assets.get('github-icon.svg')}"
|
|
|
|
alt="Github"/>
|
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
href="https://twitter.com/FxTestPilot"
|
|
|
|
class="socialSection__link footer_hiddenIcon">
|
|
|
|
<img
|
|
|
|
class="socialSection__icon"
|
|
|
|
src="${assets.get('twitter-icon.svg')}"
|
|
|
|
alt="Twitter"/>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<a
|
|
|
|
href="https://www.mozilla.org"
|
|
|
|
class="socialSection__link">
|
|
|
|
<img
|
|
|
|
class="footer__mozLogo"
|
|
|
|
src="${assets.get('mozilla-logo.svg')}"
|
|
|
|
alt="mozilla"/>
|
|
|
|
</a>
|
2018-02-20 08:10:03 +01:00
|
|
|
</footer>`;
|
2018-03-12 18:15:11 +01:00
|
|
|
// HACK
|
|
|
|
// We only want to render this once because we
|
|
|
|
// toggle the targets of the links with utils/openLinksInNewTab
|
|
|
|
footer.isSameNode = function(target) {
|
|
|
|
return target && target.nodeName && target.nodeName === 'FOOTER';
|
|
|
|
};
|
|
|
|
return footer;
|
2018-08-03 21:24:41 +02:00
|
|
|
|
|
|
|
function showDropDown() {
|
|
|
|
const menus = document.querySelectorAll('.footer__dropdown');
|
|
|
|
menus.forEach(element => {
|
|
|
|
element.classList.remove('footer__noDisplay');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function hideDropDown() {
|
|
|
|
const menus = document.querySelectorAll('.footer__dropdown');
|
|
|
|
menus.forEach(element => {
|
|
|
|
element.classList.add('footer__noDisplay');
|
|
|
|
});
|
|
|
|
}
|
2018-02-13 20:32:59 +01:00
|
|
|
};
|