Benutzer:Totto/common.js: Unterschied zwischen den Versionen

Zur Navigation springen Zur Suche springen
K
online counter improved
K (Männo Es6 :()
K (online counter improved)
Zeile 133:
var cont=document.getElementById("TottoOnlineCounter").getElementsByTagName("a")[0];
var c=doc.getElementById("mw-content-text");
numvar t=c.getElementsByTagName("ul")[0].getElementsByTagName("li").length;
num=t.length;
cont.innerHTML=num;
window["users"]=[]
window["nums"]={}
for(var i=0;i<t.length;i++){
var r=t[i].getElementsByTagName("a")[0]
//console.log(r.innerHTML)
var u=window.getComputedStyle(r,null).color
window["users"].push(u);
var key=u.split(" ").join("")
if(window["nums"][key]){
window["nums"][key]=window["nums"][key]+1
}else{
window["nums"][key]=1
}
}
cont.innerHTML=Object.entries(window["nums"]).map(function (a){return "<a style='color:"+a[0]+";margin-left:10px;'>"+a[1]+"</a>"}).join("")
//console.log(num);
}catch(err) {
1.060

Bearbeitungen

Navigationsmenü