MediaWiki:Common.js: Difference between revisions
From Artifacts of Capitalism
No edit summary Tag: Reverted |
No edit summary Tag: Reverted |
||
| Line 10: | Line 10: | ||
if ( btn ) { | if ( btn ) { | ||
btn.textContent = 'Go'; // your new label, if you like | btn.textContent = 'Go'; // your new label, if you like | ||
} | |||
}); | |||
// Tag login + create-account pages so CSS can target reliably | |||
mw.loader.using([]).then(function () { | |||
var sp = mw.config.get('wgCanonicalSpecialPageName'); | |||
if (sp === 'Userlogin' || sp === 'CreateAccount') { | |||
document.documentElement.classList.add('aoc-auth'); | |||
document.body.classList.add('aoc-auth'); | |||
} | } | ||
}); | }); | ||
Revision as of 18:54, 23 August 2025
// Replace the Chameleon search-box placeholder and button text
$(function() {
// input field
var inp = document.querySelector('#searchInput, input[name="search"]');
if ( inp ) {
inp.placeholder = 'Find an artifact…'; // your new placeholder
}
// submit button (magnifying-glass)
var btn = document.querySelector('#searchButton, button[type="submit"].mw-searchButton');
if ( btn ) {
btn.textContent = 'Go'; // your new label, if you like
}
});
// Tag login + create-account pages so CSS can target reliably
mw.loader.using([]).then(function () {
var sp = mw.config.get('wgCanonicalSpecialPageName');
if (sp === 'Userlogin' || sp === 'CreateAccount') {
document.documentElement.classList.add('aoc-auth');
document.body.classList.add('aoc-auth');
}
});