summaryrefslogtreecommitdiffstats
path: root/assets/js/main.js
blob: 1faa8fead7350188c4a99658edf99a2163180c82 (plain) (blame)
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
if (document.location.protocol != "https:"
	&& (
		window.location.hostname.endsWith("sijanec.eu")
		|| window.location.hostname.endsWith("šijanec.eu")
		|| window.location.hostname.endsWith("xn--ijanec-9jb.eu")
		|| window.location.hostname.endsWith("sijanec.org")
		|| window.location.hostname.endsWith("šijanec.org")
		|| window.location.hostname.endsWith("xn--ijanec-9jb.org")
		|| window.location.hostname.endsWith("sijanec.net")
		|| window.location.hostname.endsWith("šijanec.net")
		|| window.location.hostname.endsWith("xn--ijanec-9jb.net")
		|| window.location.hostname.endsWith("šijanec.com")
		|| window.location.hostname.endsWith("xn--ijanec-9jb.com")
		|| window.location.hostname.endsWith("šijanec.si")
		|| window.location.hostname.endsWith("xn--ijanec-9jb.si")
		|| window.location.hostname.endsWith("xn--ijanec-9jb.eu"))) {
	fetch("/?preveri-https").then((response)=>{
		document.getElementById("ponudi-https").hidden = false;
	}).catch((error)=>{
		console.log("ne bom predlagal HTTPS, ker HTTPS ne deluje, ker: "+error);
	});
}
document.querySelectorAll(".commentform").forEach((c)=>{c.parentElement.previousElementSibling.checked=false}); // enovrstičnica, ki skrije komentar-forme, če checkbox statusi ostanejo po reloadu. (firefox)
document.querySelectorAll(".yesscript").forEach((c)=>{c.style.display="block"}); /* enovrstičnica, ki s classom naredi alt noscri */
document.querySelectorAll(".noscript").forEach((c)=>{c.hidden=true}); /* enovrstičnica, ki z atributom naredi alternativ noscript */
if (window.isSecureContext) { /* večvrstičnica, ki bodisi skrije bodisi pokaže yessecurecontext in nosecurecontext elemente */
	document.querySelectorAll(".yessecurecontext").forEach((c)=>{c.hidden=false});
	document.querySelectorAll(".nosecurecontext").forEach((c)=>{c.hidden=true});
} else {
	document.querySelectorAll(".nosecurecontext").forEach((c)=>{c.hidden=false});
	document.querySelectorAll(".yessecurecontext").forEach((c)=>{c.hidden=true});
}