MediaWiki:Gadget-butMommyILoveItMyAutosight.js

Note: After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac); IE: hold Ctrl while clicking Refresh, or press Ctrl-F5; Konqueror: simply click the Reload button, or press F5; Opera users may need to completely clear their cache in Tools→Preferences. — More skins

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 += '<input type="checkbox" id="wpReviewEdit" tabindex="5" value="1" name="wpReviewEdit" checked="checked"/> <label title="Sight this revision. Use only if you have not made significant content changes" for="wpReviewEdit">(Auto)-sight this revision</label>';
  }
 }
});

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