User:EN-Jungwon/markAdmin.js

( function ( mw, $ ) {	function markAdmins( $content ) {

// static list var admins = [ 'Aphaia', 'BD2412', 'DannyS712', 'Ferien', 'GreenMeansGo', 'Illegitimate_Barrister', 'Jni', 'Jusjih', 'Kalki', 'Koavf', 'Mdd', 'Miszatomic', 'Ningauble', 'Pmlineditor', 'UDScott' ]; var admins_str = '|' + admins.join( '|' ) + '|';

var botadmins = [ ]; var botadmins_str = '|' + botadmins.join( '|' ) + '|';

var bureaucrats = [ 'BD2412', 'GreenMeansGo', 'UDScott' ]; var bureaucrats_str = '|' + bureaucrats.join( '|' ) + '|';

var interfaceadmins = [ 'Koavf' ]; var interfaceadmins_str = '|' + interfaceadmins.join( '|' ) + '|';

var checkusers = [ ]; var checkusers_str = '|' + checkusers.join( '|' ) + '|';

var oversights = [ ]; var oversights_str = '|' + oversights.join( '|' ) + '|';

var importers = [ ]; var importers_str = '|' + importers.join( '|' ) + '|';

// Stewards var stewards = [ '-revi', 'AmandaNP', 'AntiCompositeNumber', 'Base', 'BRPever', 'Bsadowski1', 'Cromium', 'Defender', 'DerHexer', 'HakanIST', 'Hasley', 'Hoo_man', 'Jon_Kolbert', 'Linedwell', 'MarcGarver', 'MarcoAurelio', 'Martin_Urbanec', 'Masti', 'Matanya', 'MusikAnimal', 'Operator873', 'RadiX', 'Ruslik0', 'Sakretsu', 'Schniggendiller', 'Sotiale', 'Stanglavine', 'Stryn', 'Tegel', 'Teles', 'TheresNoTime', 'Tks4Fish', 'Trijnstel', 'Vermont', 'Vituzzu', 'Wiki13', 'Wim_b', '%D8%B9%D9%84%D8%A7%D8%A1' ]; var stewards_str = '|' + stewards.join( '|' ) + '|';

// Global sysops var globalsysop = [ 'Amire80', 'Atcovi', 'Billinghurst', 'Biplab_Anand', 'CptViraj', 'DARIO_SEVERI', 'Daniuu', 'DannyS712', 'Iluvatar', 'Infinite0694', 'MF-Warburg', 'Minorax', 'Mtarch11', 'NahidSultan', 'Praxidicae', 'Samuele2002', 'Savh', 'Shanmugamp7', 'Superpes15', 'Turkmen', 'Uncitoyen', 'WhitePhosphorus', 'WikiBayer' ]; var globalsysop_str = '|' + globalsysop.join( '|' ) + '|';

// Global rollbackers var globalrollback = [ '-akko', '.snoopy.', '1997kB', '20041027_tatsu', '94rain', 'Ah3kal', 'Ajraddatz', 'Aldnonymous', 'Alison', 'Atcovi', 'Avicennasis', 'Az1568', 'Baiji', 'Beetstra', 'Bencemac', 'Bencmq', 'Billinghurst', 'Biplab_Anand', 'Bridget', 'Camouflaged_Mirage', 'Church_of_emacs', 'Courcelles', 'CptViraj', 'DARIO_SEVERI', 'Daniuu', 'DannyS712', 'Deu', 'DutchTina', 'Eihel', 'Esteban16', 'Eurodyne', 'Ezarate', 'Fabexplosive', 'Ferien', 'Hamish', 'Hazard-SJ', 'Holder', 'Hydriz', 'Iluvatar', 'Infinite0694', 'J_ansari', 'Jafeluv', 'Jamesofur', 'Jan_Myšák', 'Janbery', 'Jasper_Deng', 'JavaHurricane', 'Jeff_G.', 'Jianhui67', 'Juliancolton', 'Kanjy', 'Kirito', 'Kostas20142', 'Krinkle', 'Leyo', 'LlamaAl', 'Lofty_abyss', 'MF-Warburg', 'Maximillion_Pegasus', 'MdsShakil', 'Mercy', 'Minorax', 'Mirinano', 'MoiraMoira', 'Mr._Fulano', 'MrJaroslavik', 'Mtarch11', 'Mykola7', 'Nadzik', 'Neriah', 'NguoiDungKhongDinhDanh', 'NuclearWarfare', 'PiRSquared17', 'PlyrStar93', 'Praxidicae', 'QueerEcofeminist', 'Randykitty', 'Renvoy', 'Rschen7754', 'Rzuwig', 'SCP-2000', 'Samuele2002', 'Savh', 'Seewolf', 'Shanmugamp7', 'Streetdeck', 'Styyx', 'Stïnger', 'Superpes15', 'Synoman_Barris', 'Syum90', 'Techman224', 'Ts12rAc', 'Turkmen', 'Uncitoyen', 'Vogone', 'Waihorace', 'WhitePhosphorus', 'WikiBayer', 'XXBlackburnXx', 'Xqt', 'Yahya', 'Ymblanter', 'YourEyesOnly', 'Zabe', 'Zetud', '~riley' ]; var globalrollback_str = '|' + globalrollback.join( '|' ) + '|';

// Global renamers var globalrename = [ '*Youngjin', '1997kB', '331dot', 'Acagastya', 'Acalamari', 'Adavyd', 'Ahonc', 'Albertoleoncio', 'Alphama', 'Avraham', 'Bencemac', 'Cabayi', 'Civvì', 'CptViraj', 'Céréales_Killer', 'DarwIn', 'Deepfriedokra', 'DejaVu', 'Dr-Taher', 'Editor_D.S', 'Ejs-80', 'Euphydryas', 'Faris_knight', 'Fitindia', 'GeneralizationsAreBad', 'Geonuch', 'Hamish', 'Itti', 'JAn_Dudík', 'JBW', 'Jeff_G.', 'Jianhui67', 'Jimmy_Xu', 'Justlettersandnumbers', 'K6ka', 'Ladsgroup', 'Levg', 'Litlok', 'LuchoCR', 'MBq', 'Maire', 'Maxim', 'MemicznyJanusz', 'Moheen', 'Murbaut', 'Mykola7', 'Mys_721tx', 'Nadzik', 'NahidSultan', 'NhacNy2412', 'Nosebagbear', 'Ontzak', 'Oshwah', 'PhilKnight', 'Rachmat04', 'Rubin16', 'Samat', 'SilkTork', 'SimmeD', 'Squasher', 'Steinsplitter', 'Superpes15', 'Taketa', 'Tcho%C5%99', 'Ternarius', 'TheSandDoctor', 'TonyBallioni', 'Track13', 'Tr%E1%BA%A7n_Nguy%E1%BB%85n_Minh_Huy', 'Turkmen', 'Ulubatli_Hasan', 'Uncitoyen', 'Vincent_Vega', 'Vladimir_Solovjev', 'Waggers', 'WikiFer', 'Xaosflux', 'Xeno', 'Yamla', 'Yerpo', '%C3%89rico', '%D8%B4%D9%8A%D9%85%D8%A7%D8%A1', '%D9%81%D9%8A%D8%B5%D9%84', '%E3%83%8D%E3%82%A4' ]; var globalrename_str = '|' + globalrename.join( '|' ) + '|';

// VRT permissions agents var vrt = [ '*Youngjin', '-revi', '-sasha-', '.avgas', 'AFBorchert', 'Adamt', 'Ahmad252', 'Ahonc', 'Aka', 'Albertoleoncio', 'Alex_Noble', 'Alraunenstern', 'AlvaroMolina', 'AmandaNP', 'Anachronist', 'Andrei_Stroe', 'Andriy.v', 'AntiCompositeNumber', 'Atsme', 'Avicenno', 'Bachounda', 'Base', 'Bastenbas', 'Bencemac', 'Bluerasberry', 'Captain-tucker', 'Carn', 'Caulfield', 'Chenzw', 'Chicocvenancio', 'Ciell', 'Civvì', 'Coffee', 'Count_Count', 'Cromium', 'DCB', 'DaB.', 'Dajasj', 'Daniel', 'Daniuu', 'DarwIn', 'DejaVu', 'DerHexer', 'Didym', 'Doc_Taxon', 'Dungodung', 'Dyolf77', 'Effeietsanders', 'Elcobbola', 'Elli', 'Ellywa', 'Elmacenderesi', 'Emha', 'Emufarmers', 'EniPort', 'Ezarate', 'Fastily', 'Firefly', 'FlightTime', 'Fluffernutter', 'FormalDude', 'Frakir', 'Ganímedes', 'Geagea', 'Geraki', 'Gianfranco', 'Glane23', 'Gnangarra', 'Gnom', 'GorillaWarfare', 'Gratus', 'Grin', 'Gryllida', 'Htm', 'H%C3%A9g%C3%A9sippe_Cormier', 'Ibrahim.ID', 'Ijon', 'Iluvatar', 'Itti', 'Ivi104', 'JJMC89', 'Jack_Frost', 'Jan_Kov%C3%A1%C5%99_BK', 'Janbery', 'Jarekt', 'Jayantanth', 'Jcb', 'Jeff_G.', 'Jimmy_Xu', 'Jivee_Blau', 'Jon_Harald_S%C3%B8by', 'Jon_Kolbert', 'Josve05a', 'Justlettersandnumbers', 'KCVelaga', 'Kandy_Talbot', 'Killiondude', 'King_of_Hearts', 'Kiran_Gopi', 'KrakatoaKatie', 'Krd', 'Krdbot', 'Kropotkine_113', 'Kruusamägi', 'Kvardek_du', 'Lechatjaune', 'Linedwell', 'Lofty_abyss', 'Lomita', 'MARKELLOS', 'MGA73', 'MONUMENTA', 'Marcus_Cyron', 'Martin_Urbanec', 'Masti', 'Matanya', 'Matthewrb', 'Mbch331', 'MdsShakil', 'Mehman97', 'Mido', 'Millbart', 'Miya', 'Moonriddengirl', 'Morgankevinj', 'Mussklprozz', 'Mys_721tx', 'Nagy', 'NahidSultan', 'Natuur12', 'Nihonjoe', 'Niklitov', 'Ninjastrikers', 'NoFWDaddress', 'Nolispanmo', 'Nosebagbear', 'Nsaa', 'Nthep', 'O.Koslowski', 'OhanaUnited', 'Palnatoke', 'Platonides', 'Podzemnik', 'Polimerek', 'Primefac', 'Ra%27ike', 'Rachmat04', 'RacoonyRE', 'RadiX', 'Raymond', 'Redlinux', 'Regasterios', 'Reinhard_Kraasch', 'Riggwelter', 'RomaineBot', 'RonaldB', 'RonnieV', 'Ruthven', 'Sannita', 'Sargoth', 'Satdeep_Gill', 'Sebastian_Wallroth', 'Seewolf', 'Sir_Lestaty_de_Lioncourt', 'Stang', 'Steinsplitter', 'Stepro', 'Strainu', 'SuperHamster', 'Superbass', 'Superzerocool', 'Tarawneh', 'TaronjaSatsuma', 'Tgr', 'TheresNoTime', 'Thibaut120094', 'Tiven2240', 'Tks4Fish', 'Tohaomg', 'TonyBallioni', 'Trijnstel', 'Tr%E1%BA%A7n_Nguy%E1%BB%85n_Minh_Huy', 'Turbojet', 'Tzafrir', 'Uncitoyen', 'Utcursch', 'Varnent', 'Vermont', 'Vituzzu', 'Vladimir_Solovjev', 'Wdwd', 'Whym', 'Wnme', 'Wong128hk', 'Ww2censor', 'XenonX3', 'Xiplus', 'Yahya', 'Yerpo', 'Zetud', '%D7%93%D7%95%D7%92%27%D7%A8%D7%99%D7%AA', '%D8%B9%D9%84%D8%A7%D8%A1', '%D9%81%D9%8A%D8%B5%D9%84', '%E9%9D%92%E5%AD%90%E5%AE%88%E6%AD%8C' ]; var vrt_str = '|' + vrt.join( '|' ) + '|';

// System administrators var sysadmin = [ 'Aaron Schulz (WMF)', 'Bartosz Dziewoński (WMF)', 'Jdforrester (WMF)', 'Jon (WMF)', 'Legoktm', 'Majavah', 'Martin Urbanec', 'Martin Urbanec (WMF)', 'Reedy (WMF)', 'Roan Kattouw (WMF)', 'Tim Starling (WMF)' ]; var sysadmin_str = '|' + sysadmin.join( '|' ) + '|';

// Ombudsmen var ombudsmen = [ 'Ameisenigel', '%C3%89rico' , 'Faendalimas' , 'Galahad' , 'Infinite0694', 'JJMC89' , 'Mykola7' , 'Olugold' , 'Udehb' , 'Zabe' ]; var ombudsmen_str = '|' + ombudsmen.join( '|' ) + '|';

if (			mw.config.get( 'wgCanonicalNamespace' ) === 'Special' ||			mw.config.get( 'wgAction' ) === 'history' ||			mw.config.get( 'wgNamespaceNumber' ) % 2 === 1 ||			mw.config.get( 'wgCanonicalNamespace' ) === 'User' ||			mw.config.get( 'wgCanonicalNamespace' ) === 'Project' ||			mw.config.get( 'wgCanonicalNamespace' ) === 'Help' ||			mw.util.getParamValue( 'diff' ) !== null		) { var i;			var aNode; var allanchors = $content.get( 0 ).getElementsByTagName( 'A' ); var searchExp = /.wiki.User.(.+)/; var trenn = mw.config.get( 'wgArticlePath' ).replace( '$1', mw.config.get( 'wgFormattedNamespaces' )[ 2 ] ); var marker; var mainpageanchor; var href;

mw.util.addCSS( 'span.adminMark { font-weight: bold; }' ); for ( i = 0; i < allanchors.length; i++ ) { aNode = allanchors[ i ]; mainpageanchor = true; // if it's a link to a user if ( ( href = aNode.getAttribute( 'href' ) ) && ( href.indexOf( trenn ) !== -1 ) ) { var exec = searchExp.exec( href ); if(!exec) { continue; }					var currUser = exec[ 1 ]; var currUserClean = currUser.replace( /\/.*/, '' ); if ( currUserClean !== currUser ) { mainpageanchor = false; }					currUser= '|' + currUserClean + '|'; marker = [];

// is this user an admin? if ( admins_str.indexOf( currUser ) !== -1 ) { marker.push( 'A' ); }					// is this user an adminbot? if ( botadmins_str.indexOf( currUser ) !== -1 ) { marker.push( 'A-Bot' ); }					// is this user a bureaucrat? if ( bureaucrats_str.indexOf( currUser ) !== -1 ) { marker.push( 'B' ); }					// is this user an interface administrator? if ( interfaceadmins_str.indexOf( currUser ) !== -1 ) { marker.push( 'IA' ); }					// is this user a checkuser? if ( checkusers_str.indexOf( currUser ) !== -1 ) { marker.push( 'CU' ); }					// is this user an oversighter? if ( oversights_str.indexOf( currUser ) !== -1 ) { marker.push( 'OS' ); }					// is this user an importer? if ( importers_str.indexOf( currUser ) !== -1 ) { marker.push( 'IMP' ); }					// is this user a steward? if ( stewards_str.indexOf( currUser ) !== -1 ) { marker.push( 'S' ); }					// is this user a global sysop? if ( globalsysop_str.indexOf( currUser ) !== -1 ) { marker.push( 'GS' ); }					// is this user a global rollbacker? if ( globalrollback_str.indexOf( currUser ) !== -1 ) { marker.push( 'GR' ); }					// is this user a global renamer? if ( globalrename_str.indexOf( currUser ) !== -1 ) { marker.push( 'GRN' ); }					// is this user a vrt permissions agent? if ( vrt_str.indexOf( currUser ) !== -1 ) { marker.push( 'VRT' ); }					// is this user a system administrator? if ( sysadmin_str.indexOf( currUser ) !== -1 ) { marker.push( 'SA' ); }					// is this user an ombudsman? if ( ombudsmen_str.indexOf( currUser ) !== -1 ) { marker.push( 'OMB' ); }

// don't mark certain pages, except link to user main page if ( mainpageanchor &&						// check finished, now append node						marker.length > 0					) { // Variante 1 (traditionell) // var aMark = document.createElement( 'b' ); // Variante 2 (vom Erzbschof) var aMark = document.createElement( 'span' ); aMark.className = 'adminMark';

var aMarkText = document.createTextNode( ' (' + marker.join( '/' ) + ')' ); aMark.appendChild( aMarkText ); aNode.appendChild( aMark ); }				}			}		}	}

mw.hook( 'wikipage.content' ).add( markAdmins );

}( mediaWiki, jQuery ) );