Jump to content

User:Rxy/global.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.
//Global Javascript

// Redirect to meta if access to local CentralAuth page
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) == 'CentralAuth' &&  mw.config.get('wgDBname') != 'metawiki' ){
	location.href = '//meta.wikimedia.org/wiki/Special:CentralAuth/' + mw.util.wikiUrlencode( mw.config.get( 'wgRelevantUserName' ) );
}

// Shows the number of active sysops (up to seven or as configured), uses data from the toolserver
// by [[m:user:Hoo man]] <http://meta.wikimedia.org/wiki/User:Hoo_man/Scripts/Active_sysops>
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/active_sysops.js&action=raw&ctype=text/javascript');
if(typeof(activeSysopsConfig) == 'undefined') activeSysopsConfig = {};
activeSysopsConfig.markWikisGS = true;
//一部のウィキで無効化 ( http://meta.wikimedia.org/w/index.php?diff=2341121&diffonly=1 )
if(
	mw.config.get('wgDBname') in {
		commonswiki:1,
		dewiki:1,
		enwiki:1,
		eswiki:1,
		ptwiki:1,
		nlwiki:1,
		ruwiki:1,
		frwiki:1,
		plwiki:1,
		itwiki:1,
		jawiki:1,
		svwiki:1,
		zhwiki:1,
		metawiki:1,
		wikidatawiki:1
	}
) {
	disable_activeSysops = true;
}

// Provides several useful functions for rollback (custom edit summary, mark as bot edits and mass revert)
// by [[m:user:Hoo man]] <http://meta.wikimedia.org/wiki/User:Hoo_man/Scripts/Smart_rollback>
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/smart_rollback.js&action=raw&ctype=text/javascript');
if( typeof( smartRollbackConfig ) === 'undefined' ) smartRollbackConfig = {};
smartRollbackConfig.lang = 'ja';
smartRollbackConfig.editSummaries = {};
jaProjects = {
	jawiki:1,
	jawikibooks:1,
	jawikinews:1,
	jawikiquote:1,
	jawikisource:1,
	jawiktionary:1,
	jawikiversity:1
};
if( mw.config.get('wgWikiName') == 'ja' ) {
//日本語版プロジェクトのみ要約を翻訳
	smartRollbackConfig.editSummaries[0] = '荒らしの巻き戻し';
	smartRollbackConfig.editSummaries[1] = 'テスト編集を巻き戻し';
	smartRollbackConfig.editSummaries[2] = '巻き戻し';
} else {
	smartRollbackConfig.editSummaries[0] = 'revert (vandalism)';
	smartRollbackConfig.editSummaries[1] = 'revert (test edit)';
	smartRollbackConfig.editSummaries[2] = 'revert';
}
// This tool can tag pages with a few clicks (which is much faster than editing the whole page per Hand).
// by [[m:user:Hoo man]] <http://meta.wikimedia.org/wiki/User:Hoo_man/Scripts/Tagger>
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/tagger.js&action=raw&ctype=text/javascript');
//<nowiki>
if(typeof(taggerConfig) == 'undefined') taggerConfig = {};
if( mw.config.get('wgDBname') == 'jawiki' ) {
taggerConfig.tags = [];
taggerConfig.editSummary = [];
taggerConfig.tags[1] = '{{即時削除|全般3}}';
taggerConfig.editSummary[taggerConfig.tags[1]] = '+ {{即時削除|全般3}}';
} else {
taggerConfig.tags = [];
taggerConfig.editSummary = [];
taggerConfig.tags[1] = '{{delete|nonsense - ~~~~}}';
taggerConfig.editSummary[taggerConfig.tags[1]] = '+ delete';
taggerConfig.tags[2] = '{{delete|no article - ~~~~}}';
taggerConfig.editSummary[taggerConfig.tags[2]] = '+ delete';
taggerConfig.tags[3] = '{{delete|Vandalism - ~~~~}}';
taggerConfig.editSummary[taggerConfig.tags[3]] = '+ delete';
taggerConfig.tags[4] = '{{delete|spam - ~~~~}}';
taggerConfig.editSummary[taggerConfig.tags[4]] = '+ delete';
taggerConfig.tags[5] = '{{delete|nonsense (local page for a commons file) - ~~~~}}';
taggerConfig.editSummary[taggerConfig.tags[5]] = '+ delete';
taggerConfig.tags[6] = '{{delete|Blanked by author - ~~~~}}';
taggerConfig.editSummary[taggerConfig.tags[6]] = '+ delete';
taggerConfig.tags[7] = '{{delete|Test edit - ~~~~}}';
taggerConfig.editSummary[taggerConfig.tags[7]] = '+ delete';
taggerConfig.tags[8] = '{{delete|No useful content - ~~~~}}';
taggerConfig.editSummary[taggerConfig.tags[8]] = '+ delete';
taggerConfig.tags[9] = '{{delete|No meaningful content - ~~~~}}';
taggerConfig.editSummary[taggerConfig.tags[9]] = '+ delete';
}
//</nowiki>
// Tagger 無効化 : ja projects
if(
	mw.config.get('wgWikiName') == 'ja' ||
	mw.config.get( 'wgDBname' ) == 'wikidatawiki'
) {
	var disable_tagger = true;
}