User:EduardoFP7/common.js

/* ORES. */ importScript("User:EpochFail/ArticleQuality.js");

/** * Warning on unsigned comments * @author: Helder (https://github.com/he7d3r) * @license: CC BY-SA 3.0  */ ( function ( mw, $ ) {	'use strict';

function validateComments { $( '#wpSave' ).on( 'click', function ( e ) {			var $textBox = $( '#wpTextbox1' ),				curText = $textBox.val,				signRequired = mw.config.get( 'wgNamespaceNumber' ) % 2 === 1					|| curText.indexOf( ' (' + 'UTC)' ) !== -1,				hasSignature = /~{4}(?!<\/nowiki>)/.test( curText ),				unsignedText = 'Parece que esqueceu de colocar "' + '" no final da mensagem para assinar o seu comentário. Deseja salvar mesmo assim?';			if ( signRequired && !hasSignature && !confirm( unsignedText ) ) {				$textBox.focus;				e.preventDefault;				mw.log( 'Não salvar' );			}		} ); }	if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) { $( validateComments ); }

}( mediaWiki, jQuery ) );

var userConf = { userRulesVersion: '0.1' }; userConf.userRules = [ { name: 'Minhas correções', sub: [ // https://regex101.com/r/CJjYd4/1 { name: 'Simplifica ligações internas', find: /\[\[(.+?)\|\1\]\]/g, replace: '$1' }, // https://regex101.com/r/32MAsQ/1 { name: 'Remove protocolo duplicado', find: /https?:\/\/(https?:\/\/)/g, replace: '$1' } ] } ]; window.APC = $.extend( {}, window.APC, userConf ); // (workaround for T35355) mw.loader.load( 'https://meta.wikimedia.org/w/index.php?title=User:He7d3r/Tools/APC-Loader.js&action=raw&ctype=text/javascript' );

//FastButtons 1.0 importScript('User:Macy/FastButtons.js'); importScript('User:Svick/HarvErrors.js'); // Backlink: User:Svick/HarvErrors.js