MediaWiki:Common.js: Difference between revisions
From Artifacts of Capitalism
No edit summary |
No edit summary |
||
| Line 8: | Line 8: | ||
} | } | ||
})(); | })(); | ||
mw.hook('wikipage.content').add(function ($c) { | |||
var groups = mw.config.get('wgUserGroups') || []; | |||
if (groups.indexOf('approver') !== -1) return; // approvers keep the checkbox | |||
// Hide the Draft namespace checkbox in the advanced search pane | |||
$c.find('input[name="ns' + 3000 + '"]').closest('label, .mw-advancedSearch-ns_option').hide(); | |||
}); | |||
Revision as of 21:19, 6 October 2025
// Ensure viewport meta exists (iOS layout fix)
(function () {
if (!document.querySelector('meta[name="viewport"]')) {
var m = document.createElement('meta');
m.name = 'viewport';
m.content = 'width=device-width, initial-scale=1, shrink-to-fit=no';
document.head.appendChild(m);
}
})();
mw.hook('wikipage.content').add(function ($c) {
var groups = mw.config.get('wgUserGroups') || [];
if (groups.indexOf('approver') !== -1) return; // approvers keep the checkbox
// Hide the Draft namespace checkbox in the advanced search pane
$c.find('input[name="ns' + 3000 + '"]').closest('label, .mw-advancedSearch-ns_option').hide();
});