Added search bar to header.

This commit is contained in:
2018-06-15 23:41:25 +02:00
committed by Stefan Rohde-Enslin
parent 916eddc099
commit 2ae4196546
5 changed files with 61 additions and 14 deletions

View File

@@ -148,10 +148,22 @@ document.addEventListener("DOMContentLoaded", function() {
}
}
/**
* Set placeholder for all input element of type="search".
*/
(function() {
let toTranslate = document.getElementsByTagName("input");
for (let i = 0, max = toTranslate.length; i < max; i++) {
console.log(toTranslate[i].type);
if (toTranslate[i].type !== "search") continue;
toTranslate[i].placeholder = getTranslation(translations, "Search");
}
})();
(function() {
let toTranslate = document.getElementsByClassName("toTranslate");
for (let i = 0, max = toTranslate.length; i < max; i++) {
console.log(toTranslate[i].getAttribute("data-content"));
if (debugging === true) console.log(toTranslate[i].getAttribute("data-content"));
toTranslate[i].textContent = getTranslation(translations, toTranslate[i].getAttribute("data-content"));
}
})();