Pipeline copy changes, notes and todos. G2 templates for their launch. Scripting work.
This commit is contained in:
@ -1,3 +1,77 @@
|
||||
{% include "spanish_lang" %}
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
let npLangCookie = getCookie("npLang")
|
||||
let currentLang = 'en';
|
||||
|
||||
if (!npLangCookie) {
|
||||
setCookie('npLang', 'en', 365)
|
||||
currentLang = 'en'
|
||||
} else {
|
||||
if (npLangCookie == 'es') {
|
||||
currentLang = 'es'
|
||||
}
|
||||
}
|
||||
|
||||
console.log("currentLang: ", currentLang)
|
||||
|
||||
if (currentLang == 'es') {
|
||||
document.body.classList.add('lang-es')
|
||||
$(".nav-item-about").attr('href', 'https://www.northpass.com/')
|
||||
$(".btn-additional-content").attr('href', "https://www.northpass.com/")
|
||||
$('.np-footer-support-link').attr('href', 'mailto:support@northpas.com')
|
||||
$('.np-footer-support-link').text('support@northpass.com')
|
||||
} else if (currentLang == "en") {
|
||||
document.body.classList.remove('lang-es')
|
||||
document.body.classList.add('lang-en')
|
||||
$('.np-footer-support-link').attr('href', 'mailto:support@northpass.com')
|
||||
$('.np-footer-support-link').text('support@northpass.com')
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function getCookie(name) {
|
||||
var dc = document.cookie;
|
||||
var prefix = name + "=";
|
||||
var begin = dc.indexOf("; " + prefix);
|
||||
if (begin == -1) {
|
||||
begin = dc.indexOf(prefix);
|
||||
if (begin != 0) return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
begin += 2;
|
||||
var end = document.cookie.indexOf(";", begin);
|
||||
if (end == -1) {
|
||||
end = dc.length;
|
||||
}
|
||||
}
|
||||
return decodeURI(dc.substring(begin + prefix.length, end));
|
||||
}
|
||||
|
||||
function setCookie(name,value,days) {
|
||||
var expires = "";
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (days*24*60*60*1000));
|
||||
expires = "; expires=" + date.toUTCString();
|
||||
}
|
||||
document.cookie = name + "=" + (value || "") + expires + "; path=/";
|
||||
}
|
||||
|
||||
function setLanguage(lang) {
|
||||
console.log("setting language as: ", lang)
|
||||
|
||||
if (lang == "es") {
|
||||
setCookie("npLang", "es", 365)
|
||||
setTimeout(location.reload.bind(location), 700);
|
||||
} else {
|
||||
setCookie("npLang", "en", 365)
|
||||
setTimeout(location.reload.bind(location), 700);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<header class="np-header np-header-color" >
|
||||
<div class="np-header-content">
|
||||
<div class="np-hidden-desktop np-header-mobile-menu-nav">
|
||||
@ -55,13 +129,14 @@
|
||||
{% if current_person.signed_in? %}
|
||||
{% if current_person.properties.language_test == true %}
|
||||
<div class="dropdown">
|
||||
<div onclick="myFunction()" class="dropbtn">Language<i onclick="myFunction()" class="far fa-angle-down" style="padding-left:5px;"></i></div>
|
||||
<div class="dropbtn" onclick="myFunction()"><i class="fal fa-language" style="pointer-events: none;font-size:2rem;margin-top: -7px;"></i></div>
|
||||
<div id="myDropdown" class="dropdown-content">
|
||||
<a onclick="setLang('Spanish')">ES</a>
|
||||
<a onclick="setLanguage('es')" class="spanish-lang-option">Español</a>
|
||||
<hr class="divider">
|
||||
<a onclick="setLang('English')">EN</a>
|
||||
<a onclick="setLanguage('en')" class="spanish-lang-option">English</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include "spanish_lang" %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@ -209,7 +284,6 @@
|
||||
*/
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
@ -291,4 +365,4 @@ window.onclick = function(event) {
|
||||
}
|
||||
|
||||
.show {display: block;}
|
||||
</style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user