MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus Geoportal-Landau
Zur Navigation springenZur Suche springen
Zeile 9: Zeile 9:
 
anonymus = true;
 
anonymus = true;
 
//document.getElementById('mw-related-navigation').style.display = "none";
 
//document.getElementById('mw-related-navigation').style.display = "none";
var style = document.createElement('style');
+
var style = document.createElement('style');
style.innerHTML = `
+
style.innerHTML = `
#mw-related-navigation {
+
#mw-related-navigation {
display: "none";
+
color: blueviolet;
}
+
}
`;
+
`;
 
document.head.appendChild(style);
 
document.head.appendChild(style);
 
}else{
 
}else{

Version vom 5. Dezember 2019, 12:34 Uhr

/* Das folgende JavaScript wird für alle Benutzer geladen. */

function checkAnonymus() {

var anonymus = document.getElementById("p-personal").firstElementChild.innerHTML;
var is_anonymus = anonymus.match(/Anonym/g);

if (is_anonymus){
    anonymus = true;
    //document.getElementById('mw-related-navigation').style.display = "none";
  var style = document.createElement('style');
  style.innerHTML = `
  #mw-related-navigation {
  color: blueviolet;
  }
  `;
  document.head.appendChild(style);
}else{

anonymus = false;
}
console.log(anonymus);
}
checkAnonymus();