Difference between revisions 242002 and 246988 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' ); } / ** * Special:WhatLinksHere edit, history and delete links * * Adds "edit", "hist" and "delete" link to [[Special:WhatLinksHere]] * * @source: [[mw:Snippets/Special:WhatLinksHere action links]] * @rev: 2 * TODO: Add chekboxes to show/hide each extra button */ $( '#mw-whatlinkshere-list li, #editform .templatesUsed li' ).each( function() { var url = mw.config.get( 'wgScript' ) + '?title=' + encodeURIComponent( $( 'a:first', this ).text() ) + '&action=', sel = 'Whatlinkshere' === mw.config.get( 'wgCanonicalSpecialPageName' ) ? '.mw-whatlinkshere-tools a:last' : 'a:last'; $( sel, this ) .after( $( '<a>' ).attr( 'href', url + 'delete' ).text( 'delete' ) ).after( ' | ' ) .after( $( '<a>' ).attr( 'href', url + 'history' ).text( 'hist' ) ).after( ' | ' ) //TODO: Não inserir se for o '.templatesUsed' .after( $( '<a>' ).attr( 'href', url + 'edit' ).text( 'edit' ) ).after( ' | ' ); }); // 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 = [ (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=246988.
![]() ![]() 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.
|