MediaWiki:Gadget-butMommyILoveItMyAutosight.js

try { // containerize gadget, to protect other gadgets if this one goes wrong

//but mommy, I love it my auto-sight

//slightly fragile as it relies on the editCheckboxes having a single class. $(function { if (mw.config.get('wgAction') !== 'edit' && mw.config.get('wgAction') !== 'submit' ) return; if (document.getElementById('wpReviewEdit')) return;

if (mw.config.get('wgNamespaceNumber') !== 14 && mw.config.get('wgNamespaceNumber') !== 100 && mw.config.get('wgNamespaceNumber') !== 0 && mw.config.get('wgNamespaceNumber') !== 10) return;

if (mw.config.get('wgUserGroups').join.indexOf('editor') === -1) return;

var edit = document.getElementById('editform'); if (!edit) return; var divs = edit.getElementsByTagName('div');

for (var i = 0; i < divs.length; i++) { if (divs[i].className === 'editCheckboxes') { divs[i].innerHTML += ' (Auto)-sight this revision '; } } });

} catch (e) { // containerize gadget, to protect other gadgets if this one goes wrong // ignore }