MediaWiki:Gadget-blocktab.js: Difference between revisions

From Zelda Dungeon Wiki
Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
mNo edit summary
(load mediawiki.util)
Line 8: Line 8:
   
   
// @todo: Use mw.msg when Gadgets 2.0 is out and messages can be loaded
// @todo: Use mw.msg when Gadgets 2.0 is out and messages can be loaded
mw.util.addPortletLink(
mw.loader.using(['mediawiki.util']).then(function() {
'p-cactions',
mw.util.addPortletLink(
mw.util.wikiGetlink( 'Special:Block/' + title ),
'p-cactions',
'Block', 't-blockip', 'Block "' + title + '"'
mw.util.wikiGetlink( 'Special:Block/' + title ),
);
'Block', 't-blockip', 'Block "' + title + '"'
);
});
   
   
});
});

Revision as of 00:35, June 21, 2020

jQuery( document ).ready( function() {
    var ns = mw.config.get( 'wgNamespaceNumber' );
	if ( ns !== 2 && ns !== 3 ) {
		return;  // restrict to User and User talk
	}
 
	var title = mw.config.get( 'wgTitle' ).split('/')[0];
 
	// @todo: Use mw.msg when Gadgets 2.0 is out and messages can be loaded
	mw.loader.using(['mediawiki.util']).then(function() {
		mw.util.addPortletLink(
			'p-cactions',
			mw.util.wikiGetlink( 'Special:Block/' + title ),
			'Block', 't-blockip', 'Block "' + title + '"'
		);
	});
 
});