Jump to content

User:Dragoniez/MarkBLockedGlobal.js

From Meta, a Wikimedia project coordination wiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
//<nowiki>
/* global mw */
(() => {
	const moduleName = 'ext.gadget.MarkBLocked-core';
	const loadModule = () => {
		mw.loader.using(moduleName)
			.then((req) => {
				const MarkBLocked = req(moduleName);
				MarkBLocked.init({
					defaultOptions: {
						g_locks: true,
						g_blocks: true
					},
					optionKey: 'userjs-markblockedglobal-config',
					globalize: true
				});
			})
			.catch(console.error);
	};
	if (!mw.loader.getState(moduleName)) { // Module doesn't exist locally
		mw.loader.getScript('https://ja.wikipedia.org/w/load.php?modules=' + moduleName) // Import the module
			.then(loadModule)
			.catch(console.error);
	} else {
		loadModule();
	}
})();
//</nowiki>