Jump to content

User:Beria/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 JS loaded on every wiki
// <nowiki>

/*****************************
** On all wikis
*****************************/
// Provides several usefull 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/smart_rollback.js>
// [[File:Hoo man/smart_rollback.js]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/smart_rollback.js&action=raw&ctype=text/javascript');

// Gives some usefull links on user, user talk and user contribution pages
// by [[m:user:Hoo man]] <http://meta.wikimedia.org/wiki/User:Hoo_man/useful_links.js>
// [[File:Hoo man/useful_links.js]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/useful_links.js&action=raw&ctype=text/javascript');

// Tagger (example, speedy deletions)
// By [[m:User:Hoo man]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/tagger.js&action=raw&ctype=text/javascript');

taggerConfig = taggerConfig || {};
taggerConfig.tags = {};
taggerConfig.editSummary = {};
taggerConfig.tags[1] = '{{delete|No meaningful content}}~~~~';
taggerConfig.editSummary[taggerConfig.tags[1]] = 'delete — no meaningful content';
taggerConfig.tags[2] = '{{delete|Off-topic per [[Meta:Inclusion policy]]}}';
taggerConfig.editSummary[taggerConfig.tags[2]] = 'Tagging for deletion - offtopic page, delete per [[Meta:Inclusion policy]].';
taggerConfig.tags[3] = '{{delete|Not an article}}~~~~';
taggerConfig.editSummary[taggerConfig.tags[3]] = 'delete — not an article';
taggerConfig.tags[4] = '{{delete|Tiny create}}~~~~';
taggerConfig.editSummary[taggerConfig.tags[4]] = 'delete — tiny create';
taggerConfig.tags[5] = '{{delete|Copyright violation}}~~~~';
taggerConfig.editSummary[taggerConfig.tags[5]] = 'delete — copyright violation';
taggerConfig.tags[6] = '{{delete|Local page of a Commons file}}~~~~';
taggerConfig.editSummary[taggerConfig.tags[6]] = 'delete — this file exists on Commons';
taggerConfig.tags[7] = '{{delete|Blanked by author}}~~~~';
taggerConfig.editSummary[taggerConfig.tags[7]] = 'delete — blanked by author';
taggerConfig.tags.other = 'Others (edit summary is mandatory)';
taggerConfig.customTagDefault = '{{delete|';

//Mark users who are blocked as blocked.
// [[File:Krinkle_CVNSimpleOverlay_wiki.js]]
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/CVNSimpleOverlay_wiki.js&action=raw&ctype=text/javascript');


/*****************************
** On specific wikis
*****************************/
switch(mw.config.get('wgDBname')) {
	/* commons.wikimedia.org */
	case 'commonswiki':
		// [[File:Krinkle_RTRC.js]]
		mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Krinkle/RTRC.js&action=raw&ctype=text/javascript');
		
		window.installOldLinks = true;
		
		mw.util.addPortletLink('p-tb', 'javascript:importScript("MediaWiki:VisualFileChange.js");', 'Perform batch task', 't-AjaxQuickDeleteOnDemand');
		
		 // install [[Wikipedia:User:Cacycle/wikEd]] in-browser text editor
		mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js&action=raw&ctype=text/javascript');
		
		// install [[User:Lupin/popups.js]]
		mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Lupin/popups.js');
		
		// Cropbot
		$(function() {
			if(mw.config.get('wgNamespaceNumber') == 6) {
				var title = mw.config.get('wgTitle');
				if(title.match(/(.*)\.(jpg|jpeg)/gi)) {
					var croplink = "http://toolserver.org/~luxo/cropbot/cropbot.php?img="+title;
					mw.util.addPortletLink("p-tb", croplink, "Crop", "p-crop", "Crop this image", "o", false);
				}
			}
		});
		break;
		 
	/* en.wikipedia.org */
	case 'enwiki':
		importScript('User:EDUCA33E/LiveRC.js');
		importScript('User:AzaToth/twinkle.js');
		importScript('Wikipedia:WikiProject User scripts/Scripts/Revert tools');
		importScript('User:Lupin/popups.js');
		importScript('User:Alison/CH2.js');
		importScript('User:Omegatron/monobook.js/addlink.js');
		importScript('User:Gimmetrow/fixRefs.js');
		importScript('User:Lupin/recent2.js');
		importScript('User:John254/mass rollback.js');
		importScript('User:Ancient Apparition/wikilove2.js');
		break;
		
	/* it.wikiquote.org */
	case 'itwikiquote':
		mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Beria/common.js&action=raw&ctype=text/javascript');
		break;
		
	/* meta.wikimedia.org */
	case 'metawiki':
		// install [[Wikipedia:User:Cacycle/wikEd]] in-browser text editor
		mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js&action=raw&ctype=text/javascript');
		
		/** AutoEd ***********************************************************************
		  *    Origem: [[en:Wikipedia:AutoEd/complete.js]]
		  *     Ajuda: [[en:Wikipedia:AutoEd]]
		  * Descrição: helps to automatically make certain changes in articles.
		  *     Autor: [[:en:User:Drilnoth]] e [[:en:User:Plastikspork]]
		  ********************************************************************************************/
		mw.loader.load('//en.wikipedia.org/w/index.php?title=Wikipedia:AutoEd/complete.js&action=raw&ctype=text/javascript');
		 
		// install [[User:Lupin/popups.js]]
		mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Lupin/popups.js&action=raw&ctype=text/javascript');
		
		/***** Histórico nas novas mensagens ****************************************
		  Adiciona um link para o "histórico" quando você recebe uma nova mensagem. 
		*/
		$(function() {
			var messdiv = document.getElementById("contentSub").nextSibling;
			if(messdiv.className != "usermessage") {
				messdiv = messdiv.nextSibling;  /* Skip the Firefox text node. */
			}
			if(messdiv.className == "usermessage") {
				var link = document.createElement("a");
				link.appendChild(document.createTextNode("see history"));
				link.href = mw.config.get('wgScript') + "?title=User_talk:" + mw.config.get('wgUserName') + "&action=history";
				
				messdiv.insertBefore(document.createTextNode(", "), messdiv.lastChild);
				messdiv.insertBefore(link, messdiv.lastChild);
			}
		});
		
		/** Atalhos *********************************************************************************
		  *     Ajuda: [[Wikipedia:Software/Scripts/Atalhos]]
		  * Descrição: Acrescenta ligações personalizadas num menu lateral
		  *     Autor: [[:en:User:Jsimlo]]
		  ********************************************************************************************/
		mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Jsimlo/shortcuts.js&action=raw&ctype=text/javascript&dontcountme=s');
		window.shortcutsInit = function() {
			shortcutsStartSection('Wikis');
			  shortcutsAddLink('en.wiki',   ':en:Main page');
			  shortcutsAddLink('pt.wiki',   ':pt:Página principal');
			  shortcutsAddLink('commons',   ':commons:Main page');
			  shortcutsAddLink('meta',      ':m:Main page');
			
			shortcutsStartSection('Steward requests');
			  shortcutsAddLink('CheckUser',    ':m:Steward requests/Checkuser');
			  shortcutsAddLink('Permissions',  ':m:Steward requests/Permissions');
			  shortcutsAddLink('Block/Lock',   ':m:Steward_requests/Global');
			  shortcutsAddLink('Bot status',   ':m:Steward_requests/Bot_status');
			  shortcutsAddLink('Global',       ':m:Steward_requests/Global_permissions');
			  shortcutsAddLink('SUL',          ':m:Steward_requests/SUL_requests');
			
			shortcutsStartSection('Commons');
			  shortcutsAddLink('Rename',         ':commoms:Category:Media requiring renaming');
			  shortcutsAddLink('Copyvio',        ':commoms:Category:Copyright_violations');
			  shortcutsAddLink('Deletion',       ':commoms:Category:Deletion_requests');
			  shortcutsAddLink('No permission',  ':commoms:Category:Media_missing_permission');
			  shortcutsAddLink('Licence Rewien', ':commoms:Category:License review needed');
			  shortcutsAddLink('Block/Protect',  ':commoms:Commons:Administrators%27_noticeboard/Blocks_and_protections');
			  shortcutsAddLink('R Rights',       ':commoms:Commons:Requests for rights');
			  shortcutsAddLink('Featured pict',  ':commoms:Commons:Featured picture candidates/candidate list');
			
			shortcutsStartSection('PA - pt.wiki');
			  shortcutsAddLink('Bloqueio',    ':pt:Wikipedia:Pedidos a administradores/Pedidos de bloqueio');
			  shortcutsAddLink('Desbloqueio', ':pt:Wikipedia:Pedidos a administradores/Discussão de bloqueio');
			  shortcutsAddLink('Proteção',    ':pt:Wikipedia:Pedidos a administradores/Proteção de páginas');
			  shortcutsAddLink('Desproteção', ':pt:Wikipedia:Pedidos a administradores/Desproteção de páginas');
			  shortcutsAddLink('Editar PP',   ':pt:Wikipedia:Pedidos a administradores/Páginas protegidas');
			  shortcutsAddLink('Restauro',    ':pt:Wikipedia:Pedidos a administradores/Restauro de páginas');
			  shortcutsAddLink('Históricos',  ':pt:Wikipedia:Pedidos a administradores/Histórico');
			  shortcutsAddLink('Edit War',    ':pt:Wikipedia:Pedidos a administradores/Guerras de edição');
			  shortcutsAddLink('Outros',      ':pt:Wikipedia:Pedidos a administradores/Outros pedidos');
		};
		
		//import global css
		mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Beria/common.css&action=raw&ctype=text/css', 'text/css');
		break;
	
	/* mwl.wikipedia.org */
	case 'mwlwiki':
		/** HotCat *****************************************************************
		  *    Origem: [[Wikipedia:Software/Scripts/HotCat.js]]
		  *     Ajuda: [[Wikipedia:Software/Scripts/HotCat]]
		  * Descrição: Adiciona, altera e remove as categorias.
		  *     Autor: [[commons:user:Magnus Manske]]
		  ********************************************************************************************/
		importScript('Outelizador:Alchimista/hotcat.js');
		break;
}

// </nowiki>