Aller au contenu

Utilisateur:OwenBlacker/vector-2022.js

Une page de Wikipédia, l'encyclopédie libre.
Note : après avoir enregistré la page, vous devrez forcer le rechargement complet du cache de votre navigateur pour voir les changements.

Mozilla / Firefox / Konqueror / Safari : maintenez la touche Majuscule (Shift) en cliquant sur le bouton Actualiser (Reload) ou pressez Maj-Ctrl-R (Cmd-R sur Apple Mac) ;

Chrome / Internet Explorer / Opera : maintenez la touche Ctrl en cliquant sur le bouton Actualiser ou pressez Ctrl-F5.
mw.loader.using('mediawiki.util', function () {

function moreLinks() {
  var tabs = document.getElementById('p-cactions').cloneNode(true);
  // don't use the same ids twice- replace the p-cactions id and prepend 'mytabs-' to the li's
  tabs.id = 'mytabs';
  // needs this to be set from js, it ignores the css width for some reason
  tabs.style.width = '100%';
  var listitems = tabs.getElementsByTagName('LI');
  for (i = 0; i < listitems.length; i++) {
    if (listitems[i].id) listitems[i].id = 'mytabs-' + listitems[i].id;
    if (listitems[i].accesskey) listitems[i].accesskey = "";
  }
  // drop them at the bottom of the content area
  document.getElementById('column-content').appendChild(tabs);
}

function externISBN() {
   for (var i = 0; i < document.links.length; i++) 
   {
      if (mw.config.get('wgPageName') != "Special:BookSources"
         && !(mw.config.get('wgTitle') == "Book sources" && mw.config.get('wgCanonicalNamespace') == "Project"))
      {
         if (document.links[i].href.match(/Special:BookSources\/(.{10,13})$/i))
         {
           document.links[i].href = "http://www.amazon.co.uk/o/ASIN/" + RegExp.$1 + "/bookaid";
         }
      }
   }
}

function fixBadSearches()
{
   var elems = document.getElementsByClassName("noarticletext");
   var url = String(document.location) + '';
 
   if (
      elems != null && elems.length > 0
      && (url.indexOf('+') > 0 || url.indexOf('%2B') > 0)
      && url.indexOf("autoredirect=true") < 0
      && url.indexOf("monobook.js") < 0
   )
   {
      document.location.replace(url.replace(/\+|(%2B)/gi, '_') + "?autoredirect=true");
   }
}

function AddCommonsTab()
{
   if (document.getElementsByClassName("sharedUploadNotice") != null)
   {
      mw.util.addPortletLink("p-cactions", "http://commons.wikimedia.org/wiki/" + mw.config.get('wgPageName'), "Commons", '', "this image on the Commons");
   }
}
 
function AddPurgeTab()
{
   if (mw.config.get('wgCanonicalNamespace') != "Special")
   {
      mw.util.addPortletLink("p-cactions", "/w/index.php?title=" + mw.config.get('wgPageName') + "&action=purge", "Purge", '', "purge the cache");
   }
}

$(externISBN);
// addOnloadHook(moreLinks);
$(fixBadSearches);
$(AddCommonsLink);
$(AddPurgeTab);

importScript('User:Dr pda/persondata.js'); //[[User:Dr pda/persondata.js]]

popupDelay = 2;
popupFixDabs = true;
popupWatchDisambiggedPages = false;
popupMaxWidth = 500;

});