„MediaWiki:Vector.js” változatai közötti eltérés
Tartalom törölve Tartalom hozzáadva
Dani (vitalap | szerkesztései) Nincs szerkesztési összefoglaló |
Dani (vitalap | szerkesztései) Nincs szerkesztési összefoglaló |
||
89. sor: | 89. sor: | ||
addOnloadHook( LinkFA ); |
addOnloadHook( LinkFA ); |
||
/* |
|||
== Szerkesztőgombok a cím mögött == |
|||
*/ |
|||
if(document.getElementById && document.createElement) { |
|||
function moveSectionEditLinks() { |
|||
if(typeof oldEditsectionLinks != 'undefined' && oldEditsectionLinks == true) return; |
|||
var headings = false; // no need to show info about how to edit the whole page if there are no sections |
|||
var sectioneditlinks = false; // if there are section edit links, we can safely show the lead section edit link |
|||
/* move section edit links */ |
|||
var body = document.getElementById("bodyContent"); |
|||
// we iterate through headers until we find a section header |
|||
for(var i=1; i<=6; i++) { |
|||
var h = body.getElementsByTagName('h'+i); |
|||
for(var j=0; j<h.length; j++) { |
|||
var span = h[j].getElementsByTagName('span'); |
|||
for(var k=0; k<span.length; k++) { |
|||
if(span[k].className == "mw-headline") headings = true; |
|||
else if(span[k].className == "editsection") { |
|||
headings = true; |
|||
sectioneditlinks = true; |
|||
if(is_opera) { // Opera doesn't seem to like the class being changed on the fly |
|||
span[k].style.fontSize = "x-small"; |
|||
span[k].style.fontWeight = "normal"; |
|||
span[k].style.cssFloat = span[k].style.styleFloat = "none"; |
|||
span[k].style.marginLeft = "0.5em"; |
|||
span[k].style.verticalAlign = "baseline"; |
|||
span[k].style.lineHeight = "1em"; |
|||
} |
|||
span[k].className = "editsectionmoved"; |
|||
span[k].parentNode.appendChild(document.createTextNode(" ")); |
|||
span[k].parentNode.appendChild(span[k]); // move behind the heading title |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
addOnloadHook(moveSectionEditLinks); |
|||
} |
A lap 2009. december 27., 12:46-kori változata
/* Az itt található JavaScript kód a Vector skin használóinak fog csak betöltődni */
/*
== FlaggedRevs doboz abszolút pozicionálása ==
*/
function positionHeaderNotice() {
var content = document.getElementById('content');
var h1 = document.getElementsByTagName('h1');
var i, firstHeading = null;
for (i = 0; i < h1.length; i++) {
if (hasClass(h1[i], 'firstHeading')) {
firstHeading = h1[i];
}
}
if (firstHeading == null) 'return';
var box = document.getElementById('mw-revisiontag');
if (box == null) return;
if (!hasClass(box, 'flaggedrevs_short')) 'return';
firstHeading.appendChild(box);
box.className += ' firstHeading-notice';
firstHeading.style.paddingRight = box.offsetWidth + 'px';
}
addOnloadHook(positionHeaderNotice);
/*
== Koordináták igazítása ==
*/
function alignCoord() {
if(!document.getElementById) return;
var bodyContent = document.getElementById('bodyContent');
var coordinates = document.getElementById('coordinates');
if(!coordinates || !bodyContent) return;
bodyContent.insertBefore(coordinates, bodyContent.firstChild);
coordinates.style.top = 'auto';
}
addOnloadHook(alignCoord);
/*
== Kiemeltcsillag/lakat igazítása ==
*/
function titleIcons() {
var title = document.getElementById('firstHeading');
var protected_icon = document.getElementById('protected-icon');
var featured_icon = document.getElementById('featured-star');
var icon_list = [protected_icon, featured_icon];
for (i=0; i<icon_list.length; i++) {
if (!icon_list[i]) continue;
title.insertBefore(icon_list[i], title.firstChild);
/* ideiglenes kód cache szívások ellen 2009.01, idővel át kell tenni CSS-be*/
icon_list[i].className = 'metadata';
icon_list[i].style.display = 'inline';
icon_list[i].style.position = 'static';
icon_list[i].style.margin = '0 5px 0 0';
/* ideiglenes kód vége */
icon_list[i].className += ' titleIcon';
}
}
addOnloadHook(titleIcons);
/*
== Jelzés a kiemelt/jó cikkek interwikije mellé ==
*/
function LinkFA()
{
if ( document.getElementById( "p-lang" ) ) {
var InterwikiLinks = document.getElementById( "p-lang" ).getElementsByTagName( "li" );
for ( var i = 0; i < InterwikiLinks.length; i++ ) {
if ( document.getElementById( InterwikiLinks[i].className + "-fa" ) ) {
InterwikiLinks[i].className += " FA";
InterwikiLinks[i].title = "Ez a cikk „kiemelt” státuszt kapott egy más nyelvű Wikipédiában.";
}
else if ( document.getElementById( InterwikiLinks[i].className + "-ga" ) ) {
InterwikiLinks[i].className += " GA";
InterwikiLinks[i].title = "Ez a cikk „jó” státuszt kapott egy más nyelvű Wikipédiában.";
}
}
}
}
addOnloadHook( LinkFA );
/*
== Szerkesztőgombok a cím mögött ==
*/
if(document.getElementById && document.createElement) {
function moveSectionEditLinks() {
if(typeof oldEditsectionLinks != 'undefined' && oldEditsectionLinks == true) return;
var headings = false; // no need to show info about how to edit the whole page if there are no sections
var sectioneditlinks = false; // if there are section edit links, we can safely show the lead section edit link
/* move section edit links */
var body = document.getElementById("bodyContent");
// we iterate through headers until we find a section header
for(var i=1; i<=6; i++) {
var h = body.getElementsByTagName('h'+i);
for(var j=0; j<h.length; j++) {
var span = h[j].getElementsByTagName('span');
for(var k=0; k<span.length; k++) {
if(span[k].className == "mw-headline") headings = true;
else if(span[k].className == "editsection") {
headings = true;
sectioneditlinks = true;
if(is_opera) { // Opera doesn't seem to like the class being changed on the fly
span[k].style.fontSize = "x-small";
span[k].style.fontWeight = "normal";
span[k].style.cssFloat = span[k].style.styleFloat = "none";
span[k].style.marginLeft = "0.5em";
span[k].style.verticalAlign = "baseline";
span[k].style.lineHeight = "1em";
}
span[k].className = "editsectionmoved";
span[k].parentNode.appendChild(document.createTextNode(" "));
span[k].parentNode.appendChild(span[k]); // move behind the heading title
}
}
}
}
}
addOnloadHook(moveSectionEditLinks);
}