Difference between revisions 246988 and 246992 on ptwikibooks/** * Add some extra links * @author: [[User:Helder.wiki]] * @tracking: [[Special:GlobalUsage/User:Helder.wiki/Tools/Ligações extras.js]] ([[File:User:Helder.wiki/Tools/Ligações extras.js]]) */ /*jslint browser: true, white: true, regexp: true, todo: true */ /*global mediaWiki, jQuery */ ( function ( mw, $ ) { (contracted; show full) ( mw.config.get( 'wgPageName' ).indexOf( '/' ) === -1 ? '/pt' : '' ), 'Translatewiki', 'ca-trans', 'Ver a mesma mensagem no Translatewiki.net' ); } // Adiciona ligações editar, links e hist à tela exibida depois de mover uma página if ( 'Movepage' === mw.config.get( 'wgCanonicalSpecialPageName' ) ) { if ( 'Página movida com sucesso' === $( '#firstHeading' ).text() ){ // Ficará obsoleto se e quando for possível usar [[MediaWiki:Movepage-page-moved]] com $3 e $4 (ver translatewiki) $( '#bodyContent ul:eq(1) li' ).each( function() { var $mov = $(this).find( 'a' ), url = [ mw.config.get( 'wgScript' ) + '?title=' + encodeURIComponent( $mov.eq(0).text() ) + '&action=', mw.config.get( 'wgScript' ) + '?title=' + encodeURIComponent( $mov.eq(1).text() ) + '&action=' ]; $mov.each(function( index ) { $(this).after( ' ) ' ) .after( $( '<a>' ).attr( 'href', url[ index ] + 'delete' ).text( 'delete' ) ).after( ' | ' ) .after( $( '<a>' ).attr( 'href', url[ index ] + 'history' ).text( 'hist' ) ).after( ' | ' ) .after( $( '<a>' ).attr( 'href', mw.util.wikiGetlink( 'Special:WhatLinksHere/' + $(this).text() ) ).text( 'links' ) ).after( ' | ' ) .after( $( '<a>' ).attr( 'href', url[ index ] + 'edit' ).text( 'edit' ) ).after( ' ( ' ); }); }); } }⏎ ⏎ //Adiciona uma ligação na barra lateral para mostrar as estatísticas sobre a visualização da página exibida proj = mw.config.get( 'wgDBname' ).replace( /^.+(wiki.*)$/g, '$1' ); code = { 'wiki': '', 'wikibooks': '.b', 'wiktionary': '.d', 'wikiquote': '.q', 'wikinews': '.n', (contracted; show full)if ( $link.size() ) { $link.after( $( '<a>' ) .attr( 'href', $link.attr( 'href' ).replace( /title=[^&]*&/, '' ) ) .text( 'Link curto' ) ).after( ' / ' ); } }( mediaWiki, jQuery ) ); All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://pt.wikibooks.org/w/index.php?diff=prev&oldid=246992.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|