MediaWiki:Common.js: Difference between revisions
From EQOA Sandstorm Wiki
Jump to navigationJump to search
RenodorDev (talk | contribs) No edit summary |
RenodorDev (talk | contribs) No edit summary |
||
| Line 19: | Line 19: | ||
}); | }); | ||
$('body').addClass('ready'); | |||
Revision as of 11:26, 25 November 2025
/* Any JavaScript here will be loaded for all users on every page load. */
$(function () {
// Make sure p-search exists
var original = $('#p-search form');
if (original.length) {
// Clone only the search form, not the whole portlet
var searchClone = original.clone(true);
// Create top search bar
var topBar = $('<div id="top-search-bar"></div>');
topBar.append(searchClone);
// Insert into body top
$('body').prepend(topBar);
}
});
$('body').addClass('ready');