Saltar para o conteúdo

Usuário:Guga1248/BVAutomático.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)
  • Edge: Pressione Ctrl enquanto clica Recarregar, ou pressione Ctrl-F5.
/**
 * Personal scripts
 *
 * @author [[w:pt:User:!Silent]]
 * @date 18/jun/2012
 * @update 21/apr/2017  */
/* jshint laxbreak:true, expr:true */
/* global mediaWiki, jQuery */ ( function( mw, $ ) { 'use strict'; // Automated welcome to open a nonexistent user talk
page function automated_welcome() { var user = /:(.+)/.exec ( mw.util.getParamValue( 'title' ) )[ 1 ], template = '{{subst:bv' + ( ( mw.util.isIPv4Address( user ) || mw.util.isIPv6Address( user ) )? '-ip' : '' ) + '}} ~~' + '~~'; $( '#wpTextbox1' ).val( template ); $( '#wpWatchthis' ).attr( 'checked', false ); $( '#wpSummary' ).val( 'Dando mensagem de boas-vindas com um [[Usuário:!Silent/scripts.js|
script]]' ); $( '#editform' ).submit(); } if ( mw.config.get( 'wgNamespaceNumber' ) === 3 && !!mw.util.getParamValue( 'redlink' ) ) $( automated_welcome ); // Adds links to view 1000, 2000, 3000, 4000 and
5000 results on lists function add_more_numlink() { var i, $target = $( '.mw-numlink' ).eq( 4 ) ; for ( i = 5; i > 0; i-- ) { $target.after( ' | ', $( '.mw-numlink' ).eq ( 4 ).clone() .text( 1000 * i ) .attr( 'href', $ ( '.mw-numlink' ).eq( 4 ).attr( 'href' ).replace( /(limit=) \d+/, '$1' + ( 1000 * i ) ) ) ); } } if ( !!$( '.mw-numlink' ).length ) add_more_numlink(); // Check all boxes in undelete page function checkAll_restore() { $( '.deleterevision-log-submit' ).after( ' <a id="check_all">Marcar tudo</a>' ); $( '#check_all' ).click( function() { $( 'ul input[type="checkbox"]' ) .each( function() { $( this ).prop( 'checked', true ); } ); } ); } if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Undelete' ) $( checkAll_restore ); // Check all diff links automatically with &unhide=1 function unhide_bypass() { if ( !!$( '.mw-changeslist-diff' ).length ) { $( '.mw-changeslist-diff' ).each ( function() { $( this )[ 0 ].href += '&unhide=1'; } ); } else { $( 'a' ).each( function() { if ( $( this ).text().search ( /\b(dif|ant|atu)\b/ ) !== -1 ) $( this )[ 0 ] .href += '&unhide=1';
} ); } } if ( mw.config.get( 'wgNamespaceNumber') === -1 || mw.config.get( 'wgAction' ) !== 'view' ) $( unhide_bypass ); // Marks all undo edit as minor edit if ( !!( mw.util.getParamValue( 'undo' ) && mw.util.getParamValue( 'undoafter' ) ) ) $( function() { $( '#wpMinoredit' ).attr( 'checked', true ); } ); }( mediaWiki, jQuery ) );