Skip to content

Commit

Permalink
Add scripts creating contact button; #258
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-sas-on committed Jun 28, 2021
1 parent 6c552a9 commit d80272f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions onboarding/static/js/mail_button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
(function(n, d){
let mainLang = n.languages ? n.languages[0] : (n.language || n.userLanguage), mail = "", text = "C";
let arr = ['t', 'c', 'a', 't', 'n', 'o', 'c'], i = arr.length - 1, isNext = false;

if(/pl/i.test(mainLang) ){
arr[1] = arr[i] = 'k';
text = "K";
}
for(; i >= 0; i--){
mail += arr[i];
if(isNext){
text += arr[i];
}
isNext = true;
}

mail += "@";
mail += "onboardingstep.com";// location.hostname (www);
let containers = document.querySelectorAll(".js-mail"), a = "mail";
i = containers.length - 1;
mail = a + "to:" + mail;

for(; i >= 0; i--){
a = d.createElement("a");
a.href = mail;
a.rel = "nofollow";

a.appendChild(d.createTextNode(text) );
a.className = "nav-link";
containers[i].appendChild(a);
}
})(navigator, document);
1 change: 1 addition & 0 deletions onboarding/static/js/mail_button.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d80272f

Please sign in to comment.