send/app/templates/footer/index.js

89 lines
2.7 KiB
JavaScript
Raw Normal View History

const html = require('choo/html');
const assets = require('../../../common/assets');
module.exports = function(state) {
const footer = html`<footer class="footer">
2018-08-03 19:24:41 +00:00
<div class="legalSection"
onmouseover=${showDropDown}
onmouseout=${hideDropDown}>
<div class="legalSection__menu">
2018-09-28 14:54:23 +00:00
<img class="dropDownArrow" src="${assets.get('dropdown-arrow.svg')}"/>
2018-08-03 19:24:41 +00:00
<a class="legalSection__link"
href="https://www.mozilla.org/about/legal">
${state.translate('footerLinkLegal')}
</a>
</div>
<a
href="https://testpilot.firefox.com/about"
2018-08-03 19:24:41 +00:00
class="legalSection__link footer__dropdown footer__noDisplay">
${state.translate('footerLinkAbout')}
</a>
<a
href="/legal"
2018-08-03 19:24:41 +00:00
class="legalSection__link footer__dropdown footer__noDisplay">
${state.translate('footerLinkTerms')}
</a>
<a
href="https://www.mozilla.org/privacy/websites/#cookies"
2018-08-03 19:24:41 +00:00
class="legalSection__link footer__dropdown footer__noDisplay">
${state.translate('footerLinkCookies')}
</a>
<a
href="https://www.mozilla.org/about/legal/report-infringement/"
2018-08-03 19:24:41 +00:00
class="legalSection__link footer__dropdown footer__noDisplay">
${state.translate('reportIPInfringement')}
</a>
<a
href="https://github.com/mozilla/send"
2018-08-03 19:24:41 +00:00
class="legalSection__link footer__dropdown dropdown__only footer__noDisplay">
Github
</a>
<a
href="https://twitter.com/FxTestPilot"
2018-08-03 19:24:41 +00:00
class="legalSection__link footer__dropdown dropdown__only footer__noDisplay">
Twitter
</a>
</div>
2018-08-03 19:24:41 +00:00
<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>
2018-02-20 07:10:03 +00:00
</footer>`;
// 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 19:24:41 +00: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');
});
}
};