MediaWiki:Gadget-blocktab.js: Difference between revisions
Want an adless experience? Log in or Create an account.
(Restore to version 4157 by Matt) |
m (wikiGetlink -> getUrl) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
jQuery( document ).ready( function() { | jQuery( document ).ready( function() { | ||
var ns = mw.config.get( 'wgNamespaceNumber' ); | var ns = mw.config.get( 'wgNamespaceNumber' ); | ||
Line 7: | Line 5: | ||
} | } | ||
var title = mw.config.get( 'wgTitle' ); | var title = mw.config.get( 'wgTitle' ).split('/')[0]; | ||
// @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() { | ||
mw.util.addPortletLink( | |||
'p-cactions', | |||
mw.util.getUrl( 'Special:Block/' + title ), | |||
); | 'Block', 't-blockip', 'Block "' + title + '"' | ||
); | |||
}); | |||
}); | }); |
Latest revision as of 01:13, 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.getUrl( 'Special:Block/' + title ), 'Block', 't-blockip', 'Block "' + title + '"' ); }); });