MediaWiki:Vector.js
Megjegyzés: közzététel után frissítened kell a böngésződ gyorsítótárát, hogy lásd a változásokat.
- Firefox / Safari: tartsd lenyomva a Shift gombot és kattints a Frissítés gombra a címsorban, vagy használd a Ctrl–F5 vagy Ctrl–R (Macen ⌘–R) billentyűkombinációt
- Google Chrome: használd a Ctrl–Shift–R (Macen ⌘–Shift–R) billentyűkombinációt
- Internet Explorer / Edge: tartsd nyomva a Ctrl-t, és kattints a Frissítés gombra, vagy nyomj Ctrl–F5-öt
- Opera: Nyomj Ctrl–F5-öt
/* Az itt található JavaScript kód a Vector skin használóinak fog csak betöltődni */
/*
== Szerkesztőgombok a cím mögött ==
*/
function moveSectionEditLinks() {
if (window.oldEditsectionLinks) return;
mw.loader.using(['mediawiki.util']).then(function() {
var headings = mw.util.$content.find('h1,h2,h3,h4,h5,h6').find('span.mw-headline');
var sectioneditlinks = mw.util.$content.find('h1,h2,h3,h4,h5,h6').find('span.editsection');
/* move section edit links */
sectioneditlinks.each(function() {
$(this).removeClass('editsection').addClass('editsectionmoved');
$(this).parent().append(' ').append(this);
});
/* add lead section edit link */
var edit = $('#ca-edit');
if (headings.length && !sectioneditlinks.length) return; // if sections are not editable, don't add
else if (!headings.length) {
// try to guess whether sections would be editable; don't add if
// 1) article is protected or otherwise uneditable
// 2) user is viewing page history, edit/move/delete interface, etc.
// 3) user is viewing a special page
// 4) user is viewing a diff, unless it's a diff to the current revision
// 5) user is viewing a permalink to a revision, unless it's the current revision
if (!edit.length || mw.config.get('wgAction') != 'view' || document.location.href.match('/wiki/Speci%C3%A1lis:')) return;
var diffMatch = document.location.href.match(/diff=([^&]*)/),
oldidMatch = document.location.href.match(/oldid=([^&]*)/);
var diff = diffMatch ? diffMatch[1] : null,
oldid = oldidMatch ? oldidMatch[1] : null;
if (oldid && diff) {
if (diff != mw.config.get('wgCurRevisionId') && !(diff == "prev" && oldid == mw.config.get('wgCurRevisionId'))) return;
} else if (oldid) {
if (oldid != mw.config.get('wgCurRevisionId')) return;
}
// covers most cases, "diff=next&oldid=<last before current>" is impossible to catch
}
var href = edit.find('a').attr('href') + "§ion=0";
if (headings.length) href += "&editintro=MediaWiki:Editintro-section-0"; // no need to show info about how to edit the whole page if there are no sections
var edit0 = $('<span>').addClass('editsectionmoved');
edit0.html('[<a href="' + href + '">bevezető szerkesztése</a>]');
$('h1.firstHeading').append(' ').append(edit0);
});
}
$(moveSectionEditLinks);