MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
layout/expansions |
header/premiere thumbs |
||
| Line 1: | Line 1: | ||
/* | /* Wikipedia-style: logo top-left, search immediately to its right. Account links stay far right. */ | ||
(function () { | (function () { | ||
function ready(fn) { | function ready(fn) { | ||
| Line 11: | Line 11: | ||
var logo = document.getElementById('p-logo'); | var logo = document.getElementById('p-logo'); | ||
var head = document.getElementById('mw-head'); | var head = document.getElementById('mw-head'); | ||
var search = document.getElementById('p-search'); | |||
if (logo && head && logo.parentNode !== head) { | if (logo && head && logo.parentNode !== head) { | ||
head.insertBefore(logo, head.firstChild); | head.insertBefore(logo, head.firstChild); | ||
} | } | ||
if (search && logo && logo.parentNode) { | |||
if (search.previousElementSibling !== logo) { | |||
if (search && | logo.parentNode.insertBefore(search, logo.nextSibling); | ||
} | |||
} | } | ||
}); | }); | ||
})(); | })(); | ||
Revision as of 00:00, 21 September 2026
/* Wikipedia-style: logo top-left, search immediately to its right. Account links stay far right. */
(function () {
function ready(fn) {
if (document.readyState !== 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
ready(function () {
var logo = document.getElementById('p-logo');
var head = document.getElementById('mw-head');
var search = document.getElementById('p-search');
if (logo && head && logo.parentNode !== head) {
head.insertBefore(logo, head.firstChild);
}
if (search && logo && logo.parentNode) {
if (search.previousElementSibling !== logo) {
logo.parentNode.insertBefore(search, logo.nextSibling);
}
}
});
})();