Utilisateur:DeirdreAnne/common.js

La bibliothèque libre.

Note : après avoir enregistré vos modifications, il se peut que vous deviez forcer le rechargement complet du cache de votre navigateur pour voir les changements.

  • Firefox / Safari : Maintenez la touche Maj (Shift) en cliquant sur le bouton Actualiser ou pressez Ctrl-F5 ou Ctrl-R (⌘-R sur un Mac) ;
  • Google Chrome : Appuyez sur Ctrl-Maj-R (⌘-Shift-R sur un Mac) ;
  • Internet Explorer : Maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl-F5 ;
  • Opera : Allez dans Menu → Settings (Opera → Préférences sur un Mac) et ensuite à Confidentialité & sécurité → Effacer les données d'exploration → Images et fichiers en cache.
//makes every link to oldwikisource, in the form of [[oldwikisource:Foo]], look like a regular interwiki link
$(document).ready(function() {
 
  //if there are links to oldwikisource, but there isn't an "other languages" section in the sidebar, first create it
  if ($('div#p-lang div.body ul').length == 0 && $('a.extiw[title^="oldwikisource:"]').length > 0) {
    $('div#mw-panel').append(
      '<div class="portal expanded" id="p-lang"><h5 tabindex="10">In other languages</h5><div class="body" style="display: block; "><ul></ul></div></div>')
  }
 
  //loop through every oldwiki link and move them to the sidebar
  $($('a.extiw[title^="oldwikisource:"]').get().reverse()).each(function(i) {
    title = $(this).attr('title').replace('oldwikisource:', '')
    $(this).prependTo($('div#p-lang div.body ul'))
      .wrapAll('<li class="interwiki-oldwikisource" />')
      .removeClass('extiw')
      .attr('title', title)
      .html("Old Wikisource")
  }) 
})