Διαφορά μεταξύ των αναθεωρήσεων του «MediaWiki:Common.js»

αφαίρεση Quality indicators
(αφαίρεση tabber)
(αφαίρεση Quality indicators)
}
$(interwikiExtra);
 
 
/**********************
*** Quality indicators on "article" tab
*** by [[user:ThomasV]]
**********************/
// return src for icon given percentage
function icon_src(t){
var src='//upload.wikimedia.org/wikipedia/commons/';
switch(t){
case '0%': src+='8/8f/00'; break;
case '25%': src+='5/5b/25'; break;
case '50%': src+='3/3a/50'; break;
case '75%': src+='c/cd/75'; break;
case '100%': src+='6/64/100'; break;
}
return src + '%25.png';
}
 
// add indicator
function pageQuality() {
var a = document.getElementById('ca-nstab-main');
if(!a) return;
 
var pr_index = document.getElementById('pr_index');
if(pr_index) return;
 
var q = document.getElementById('textquality');
if(q) {
var new_img = document.createElement('img');
new_img.setAttribute('src', icon_src(q.className));
a.firstChild.appendChild(new_img);
}
 
for(var i=0; spanElem = document.getElementsByTagName('span')[i]; i++) {
if (spanElem.className == 'pagequality') {
var new_img = document.createElement('img');
new_img.setAttribute('src', icon_src(spanElem.title));
if(mw.config.get('wgCanonicalNamespace') == 'Page') {
a.firstChild.appendChild(new_img);
}
else {
s1 = spanElem.parentNode.previousSibling;
opttext = s1.firstChild.firstChild;
img = opttext.firstChild.nextSibling.nextSibling.nextSibling;
next = img.nextSibling;
opttext.removeChild(img);
opttext.insertBefore(new_img,next);
}
}
}
}
$(pageQuality);