User:~riley/userRightsManager.js

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// <nowiki>
// Gadget-ified, see [[MediaWiki:Gadget-userRightsManager.js]]

// This code block stolen from [[:w:en:User:AzaToth/twinkle.js]] 
// This will automatically enable the gadget in the user's preferences.
mw.loader.using(['user.options', 'mediawiki.api']).then(function() {
    if (!mw.user.options.get('gadget-userRightsManager')) {
        new mw.Api().saveOption('gadget-userRightsManager', 1);
    }
});

// </nowiki>