Usuário:JMagalhães/common.js

Origem: Wikipédia, a enciclopédia livre.

Nota: Depois de publicar, poderá ter de contornar a cache do seu navegador para ver as alterações.

  • Firefox / Safari: Pressione Shift enquanto clica Recarregar, ou pressione Ctrl-F5 ou Ctrl-R (⌘-R no Mac)
  • Google Chrome: Pressione Ctrl-Shift-R (⌘-Shift-R no Mac)
  • Internet Explorer / Edge: Pressione Ctrl enquanto clica Recarregar, ou pressione Ctrl-F5
  • Opera: Pressione Ctrl-F5.
// Lista personalizada para conversão de predefs e meses
// User: Polyehtylen
var userConf = { userRulesVersion: '0.1' };
userConf.userRules = [ {
        name: 'conversaocite',
        sub: [ {
                name: 'citeweb',
                find: /cite web/g,
                replace: 'citar web'
        }, {
                name: 'cite book',
                find: /cite book/g,
                replace: 'citar livro'
        }, {
                name: 'cite journal',
                find: /cite journal/g,
                replace: 'citar periódico'
        }, {
                name: 'janeiro',
                find: /January/g,
                replace: 'janeiro'
        }, {
                name: 'fevereiro',
                find: /February/g,
                replace: 'fevereiro'
        }, {
                name: 'março',
                find: /March/g,
                replace: 'março'
        }, {
                name: 'abril',
                find: /April/g,
                replace: 'abril'
        }, {
                name: 'maio',
                find: /May/g,
                replace: 'maio'
        }, {
                name: 'junho',
                find: /June/g,
                replace: 'junho'
        }, {
                name: 'julho',
                find: /July/g,
                replace: 'julho'
        }, {
                name: 'agosto',
                find: /August/g,
                replace: 'agosto'
        }, {
                name: 'setembro',
                find: /September/g,
                replace: 'setembro'
        }, {
                name: 'outubro',
                find: /October/g,
                replace: 'outubro'
        }, {
                name: 'novembro',
                find: /November/g,
                replace: 'novembro'
        }, {
                name: 'dezembro',
                find: /December/g,
                replace: 'dezembro'
        }, {
                name: 'titulo',
                find: /title=/g,
                replace: 'título='
        }, {
                name: 'ultimo',
                find: /last=/g,
                replace: 'ultimo='
        }, {
                name: 'nome',
                find: /first=/g,
                replace: 'primeiro='
        }, {
                name: 'autor',
                find: /author=/g,
                replace: 'autor='
        }, {
                name: 'coauthors',
                find: /coauthors=/g,
                replace: 'coautores='
        }, {
                name: 'autorlink',
                find: /authorlink/g,
                replace: 'autorlink'
        }, {
                name: 'accessdate',
                find: /accessdate/g,
                replace: 'acessodata'
        }, {
                name: 'editora',
                find: /publisher=/g,
                replace: 'editora='
        }, {
                name: 'lingua',
                find: /language=/g,
                replace: 'lingua='
        }, {
                name: 'edição',
                find: /edition=/g,
                replace: 'edição='
        }, {
                name: 'local',
                find: /location=/g,
                replace: 'local='
        }, {
                name: 'ano',
                find: /year=/g,
                replace: 'ano='
        }, {
                name: 'pagina',
                find: /page=/g,
                replace: 'página='
        }, {
                name: 'paginas',
                find: /pages=/g,
                replace: 'páginas='
        }, {
                name: 'capitulo',
                find: /chapter=/g,
                replace: 'capítulo='
        }, {
                name: 'data',
                find: /date=/g,
                replace: 'data='
        }, {
                name: 'mes',
                find: /month=/g,
                replace: 'mes='
        }, {
                name: 'arquivourl',
                find: /archiveurl/g,
                replace: 'arquivourl'
        }, {
                name: 'arqivodata',
                find: /archivedate/g,
                replace: 'arquivodata'
        }, {
                name: 'formato',
                find: /format=/g,
                replace: 'formato='
        }, {
                name: 'quote',
                find: /quote=/g,
                replace: 'citacao='
        }, {
                name: 'obra',
                find: /work=/g,
                replace: 'obra='
        }, {
                name: 'issue',
                find: /issue=/g,
                replace: 'numero='
        }, {
                name: 'journal=',
                find: /journal=/g,
                replace: 'jornal='
        } ]
} ];
window.APC = $.extend( {}, window.APC, userConf );
// [[File:User:He7d3r/Tools/APC.js]] (workaround for [[phab:T35355]])
mw.loader.load( 'https://meta.wikimedia.org/w/index.php?title=User:He7d3r/Tools/APC-Loader.js&action=raw&ctype=text/javascript' );

// @tracking: [[Special:GlobalUsage/User:Antero de Quintal/arquivarPEs.js]] ([[File:User:Antero de Quintal/arquivarPEs.js]])
importScript("Usuário:JMagalhães/arquivarPEs.js");
 
//Mass rollback function
//Written by John254 and modified/rewritten by Writ Keeper; original is at https://en.wikipedia.org/wiki/User:John254/mass_rollback.js
//Adapted from User:Mr.Z-man/rollbackSummary.js
//Instructions: Selecting the "rollback all" tab when viewing a user's contributions history
//will open all rollback links displayed there. (Use with caution)
 
function rollbackEverythingWKMR() {
	$("a[href*='action=rollback']").each(function(ind, el)
	{
		window.open(el.href, "_blank");
	});
}
$(document).ready(function()
	{
		if(mw.config.get("wgCanonicalSpecialPageName") === "Contributions" && $("span.mw-rollback-link").length > 0)
		{
			mw.util.addPortletLink('p-cactions', 'javascript:rollbackEverythingWKMR()', "rollback all", "ca-rollbackeverything", "rollback all edits displayed here");
  		}
	});

// Provides several usefull functions for rollback (custom edit summary, mark as bot edits and mass revert)
// by [[m:user:Hoo man]] <https://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');