User:Brochon99/common.js
Jump to navigation
Jump to search
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
// Créé un onglet à côté de la page de discussion, renvoyant vers WP:FR
var WikiLink = $('.wb-sitelinks-link-fr a').text();
if (WikiLink !== '') {mw.util.addPortletLink( 'p-namespaces', "//fr.wikipedia.org/wiki/" + WikiLink, 'Wikipédia', 'ca-frlink', 'Voir cet article sur Wikipédia')};
/*
* Ajoute des liens du menu de gauche
*/
function Bistro_Oracle() {
var a = document.getElementById("p-navigation");
if (a) {
b = a.getElementsByTagName("ul");
if(b.length > 0) {
b[0].innerHTML = b[0].innerHTML + '<li><a style="display: inline" id="n-wlm" title="wlm" href="http://www.wikidata.org/wiki/Wikidata:Cultural_heritage_task_force">Cultural heritage</a></li>' + '<li><a style="display: inline" id="n-del" title="Requests for deletions" href="http://www.wikidata.org/w/index.php?title=Special%3AUserRights&user=Benoit+Rochon">Flood flag</a></li>' + '<li><a style="display: inline" id="n-properties" title="Liste des propriétés" href="http://www.wikidata.org/wiki/Wikidata:List_of_properties/fr">Liste des propriétés</a></li>'
}
}
}
$(Bistro_Oracle);
//////////// Fin des liens des espaces de discussion /////////////////
/*
* Turning the regular pages into talk pages with Indent Color
*/
function TalkPageIndentColor() {
if( (wgPageName.search('Wikidata:Bistro') != -1)
|| document.getElementById('TalkPageIndentColor')) {
removeClass(document.body, 'ns-subject');
addClass(document.body, 'ns-talk');
}
}
$(TalkPageIndentColor);
// Mise en valeur du français
if( mw.config.get( 'wgNamespaceNumber' ) === 0) {
$( function(){
var $tool = $( 'table.wb-sitelinks' );
$tool.find( '.wb-sitelinks-fr' )
.prependTo( $tool.find( 'tbody' ) )
.find( 'td' )
.css( 'background-color', '#CFC' );
} );
}