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.
(Restore to version 4157 by Matt)
m (How's about this.)
Line 3: Line 3:
jQuery( document ).ready( function() {
jQuery( document ).ready( function() {
     var ns = mw.config.get( 'wgNamespaceNumber' );
     var ns = mw.config.get( 'wgNamespaceNumber' );
if ( ns !== 2 && ns !== 3 ) {
if (( ns !== 2 && ns !== 3 )&&
    !/\//.test(wgTitle)) {
return;  // restrict to User and User talk
return;  // restrict to User and User talk
}
}

Revision as of 01:46, October 27, 2011

$( function() {
  if ( wgUserGroups.toString().indexOf('sysop') != -1 ) {
jQuery( document ).ready( function() {
    var ns = mw.config.get( 'wgNamespaceNumber' );
	if (( ns !== 2 && ns !== 3 )&&
    !/\//.test(wgTitle)) {
		return;  // restrict to User and User talk
	}
 
	var title = mw.config.get( 'wgTitle' );
 
	// @todo: Use mw.msg when Gadgets 2.0 is out and messages can be loaded
	mw.util.addPortletLink(
		'p-cactions',
		mw.util.wikiGetlink( 'Special:Block/' + title ),
		'Block', 't-blockip', 'Block "' + title + '"'
	);
 
});
  }
});