-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.js.js
60 lines (50 loc) · 1.55 KB
/
.js.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*** language switch functions ***/
(function(){
var prev= window.load;
window.onload = function(){
if(prev) prev();
var t = document.getElementsByTagName("h1")[0];
var switcher = document.createElement("p");
switcher.appendChild(document.createTextNode("Lingua / Language"));
switcher.classList.add("noprint");
switcher.style.textAlign="center";
switcher.style.backgroundColor="salmon"
var itBt = document.createElement("button");
var enBt = document.createElement("button");
itBt.setAttribute("type","button")
enBt.setAttribute("type","button")
//itBt.setAttribute("id","Italian")
//enBt.setAttribute("id","English")
itBt.appendChild(document.createTextNode("Italiano"));
enBt.appendChild(document.createTextNode("English"));
switcher.append(itBt);
switcher.append(enBt);
t.parentNode.insertBefore(switcher,t.nextSibling);
//var itBt = document.getElementById("Italian");
//var enBt = document.getElementById("English");
var it = document.getElementsByClassName("it");
var en = document.getElementsByClassName("en");
var toggle = function(enter,out){
var i;
for(i=0; i < enter.length; ++i){
enter[i].style.display="initial";
}
for(i=0; i < out.length; ++i){
out[i].style.display="none";
}
}
itBt.onclick = function(){
document.title = "Requisiti";
itBt.disabled=true
enBt.disabled=false
toggle(it,en);
}
enBt.onclick = function(){
document.title = "Requirements";
itBt.disabled=false
enBt.disabled=true
toggle(en,it);
}
itBt.onclick();
}
})()