Notandi:Robin Hood~iswiki/monobook.js

Úr Wikipediu, frjálsa alfræðiritinu

Athugaðu: Eftir útgáfu kann að vera að þú þurfir að komast hjá skyndiminni vafrans þíns til að sjá breytingarnar.

  • Firefox / Safari: Haltu Shift samtímis og þú smellir á Endurhlaða (Reload), eða ýttu á annaðhvort Ctrl-F5 eða Ctrl-R (⌘-R á Mac)
  • Google Chrome: Ýttu á Ctrl-Shift-R (⌘-Shift-R á Mac)
  • Internet Explorer / Edge: Haltu Ctrl samtímis og þú smellir á Endurnýja (Refresh), eða ýttu á Ctrl-F5
  • Opera: Farðu í Verkfæri (Tools) → Stillingar (Preferences) og svo Friðhelgi og öryggi (Privacy & security) → Hreinsa vafragögn (Clear browsing data) → Myndir og skrár í skyndiminni (Chached images and files)
function addLoadEvent(func) {
  if (window.addEventListener) {
    window.addEventListener("load", func, false);
  }
  else if (window.attachEvent) {
         window.attachEvent("onload", func);
       }
}

// AJOUTE DEUX ONGLETS MONOBOOK

function ajoutOngletJS() {
  var a = document.getElementById("p-cactions");
    if (a) {
      b = a.getElementsByTagName("ul");
      if(b.length > 0) {
        b[0].innerHTML = b[0].innerHTML
        + '<li id="ca-nstab-user">'
        + '<a href="/wiki/Notandi:Robin_Hood/monobook.js">'
        + 'js</a></li>';
      }
    }
}

function ajoutOngletCSS() {
  var a = document.getElementById("p-cactions");
    if (a) {
      b = a.getElementsByTagName("ul");
      if(b.length > 0) {
        b[0].innerHTML = b[0].innerHTML
        + '<li id="ca-nstab-user">'
        + '<a href="/wiki/Notandi:Robin_Hood/monobook.css">'
        + 'css</a></li>';
      }
    }
}

// AJOUTE UN ONGLET STRUCTURE

function ajoutOngletStructure() {
  var a = document.getElementById("p-cactions");
    if (a) {
      b = a.getElementsByTagName("ul");
      if(b.length > 0) {
        b[0].innerHTML = b[0].innerHTML
        + '<li id="ca-nstab-user">'
        + '<a href="/wiki/Notandi:Robin_Hood/Structure">'
        + 'Structure</a></li>';
      }
    }
}

// AJOUTE LES LIENS DANS LA BOÎTE DE NAVIGATION

function ajoutLiens() {
  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" title="Wikipedia:Sendiráðið" '
        +        'href="/w/index.php?title=Wikipedia:Sendiráðið&action=purge">'
        +              'Ambassade</a></li>'
        + '<li><a style="display: inline" title="Suivis" '
        +        'href="http://is.wikipedia.org/w/index.php?title=Kerfissíða:Watchlist&days=0">'
        +              'Tous les suivis</a>'
        +     '<a style="display: inline" title="Suivis" '
        +        'href="http://is.wikipedia.org/w/index.php?title=Kerfissíða:Watchlist&days=3">'
        +              '3 jours</a>'
        +     '<a style="display: inline" title="Suivis" '
        +        'href="http://is.wikipedia.org/w/index.php?title=Kerfissíða:Watchlist&days=1">'
        +              '1 jour</a></li>'
      }
    }
}

addLoadEvent(ajoutLiens);
if ( mw.config.get("wgCanonicalNamespace") == "User" || mw.config.get("wgCanonicalNamespace") == "User_talk" ) {
  addLoadEvent(ajoutOngletJS);
  addLoadEvent(ajoutOngletStructure);
  addLoadEvent(ajoutOngletCSS);
}

// AJOUTE LES LIENS DANS LA BOÎTE À OUTILS

$(function () {
 
  if ( mw.config.get("wgCanonicalNamespace") == "User" || mw.config.get("wgCanonicalNamespace") == "User_talk" ) {
    mwTitle = mw.config.get("wgTitle")
    url = mw.config.get("wgServer") 
          + "/w/index.php?title=Special:Log&user=" 
          + mwTitle.split("/")[0];
  } 
  else if ( mw.config.get("wgCanonicalNamespace") == "Special" ) {
               return;
       } 
       else {
         url = wgServer 
               + "/w/index.php?title=Special:Log&page=" 
               + mw.config.get("wgPageName");
       }
 
mw.util.addPortletLink("p-tb", "http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user=Robin+Hood&dbname=iswiki_p", "Compteur d'éditions", "ca-editcount");
mw.util.addPortletLink("p-cactions", url, "Journal", "pt-logs");
});