Difference between revisions 239795 and 239797 on ptwikibooks/** * Add icons linking to the current page (or [[Special:Watchlist]]) in other wikis of the same language * @author: [[User:Helder.wiki]] * @tracking: [[Special:GlobalUsage/User:Helder.wiki/Tools/InterProjectIcons.js]] ([[File:User:Helder.wiki/Tools/InterProjectIcons.js]]) */ /*jslint browser: true, white: true, plusplus: true*/ /*global mediaWiki, jQuery */ ( function ( mw, $ ) { 'use strict'; var i, wikis, canonicalPageName = 'Special:Watchlist', lang = mw.config.get('wgContentLanguage'), $spanul = $('<spanul id="imgs-projetos" style="display: inline; margin-left: 1em; "></span></ul>'); wikis = [ { name: 'Wikipédia', url: '//' + lang + '.wikipedia.org/wiki/', img: '8/8b/Wikipedia-logo-35px.png/22px-Wikipedia-logo-35px.png' }, { (contracted; show full) }, { name: 'MediaWiki', url: '//www.mediawiki.org/wiki/', img: 'b/bb/MediaWiki-notext.svg/22px-MediaWiki-notext.svg.png' }, { name: ' Wikimedia Commons', url: '//commons.wikimedia.org/wiki/', img: '4/4a/Commons-logo.svg/16px-Commons-logo.svg.png' }, { name: 'Wikispecies', url: '//species.wikimedia.org/wiki/', img: 'd/df/Wikispecies-logo.svg/19px-Wikispecies-logo.svg.png' }, { name: 'Translatewiki', url: '//translatewiki.net/wiki/', img: 'a/a5/N_write.svg/22px-N_write.svg.png' } ]; if ($.inArray(mw.config.get('wgNamespaceNumber'), [-1, 2, 3, 8, 9]) !== -1) { canonicalPageName = mw.config.get('wgCanonicalNamespace') + ':' + ( mw.config.get('wgCanonicalSpecialPageName') || mw.config.get('wgTitle').replace(' ', '_') ); } for(i=0; i<wikis.length; i++){ $span.append( '<a href="' + wikis[i].url + canonicalPageName + '" title="' + wikis[i].name + '">' + '<img src="//upload.wikimedia.org/wikipedia/commons/thumb/' + wikis[i].img + '"></a> 'ul.append( $( '<li>' ).append( $( '<a>' ).attr( { href: wikis[i].url + canonicalPageName, title: wikis[i].name } ).addClass( wikis[i].name ) ) ); } $(function(){ $('#firstHeading').append( $spanul ); }); }( 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=239797.
![]() ![]() 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.
|