사용자:Robin Hood/monobook.js

위키백과 ― 우리 모두의 백과사전.

참고: 설정을 저장한 후에 바뀐 점을 확인하기 위해서는 브라우저의 캐시를 갱신해야 합니다. 모질라 / 파이어폭스 / 사파리: ‘시프트’ 키를 누르면서 ‘새로 고침’을 클릭하거나, Ctrl-F5를 입력; 컨커러: 단순히 '새로고침'을 클릭하거나 F5를 입력; 오페라 사용자는 ‘도구→설정’에서 캐시를 완전히 비워야 합니다.

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/사용자: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/사용자: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/사용자: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="위키백과:대사관" '
        +        'href="/w/index.php?title=위키백과:대사관&action=purge">'
        +              'Ambassade</a></li>'
        + '<li><a style="display: inline" title="Suivis" '
        +        'href="http://ko.wikipedia.org/w/wiki.phtml?title=Special:Watchlist&days=0">'
        +              'Tous les suivis</a>'
        +     '<a style="display: inline" title="Suivis" '
        +        'href="http://ko.wikipedia.org/w/wiki.phtml?title=Special:Watchlist&days=3">'
        +              '3 jours</a>'
        +     '<a style="display: inline" title="Suivis" '
        +        'href="http://ko.wikipedia.org/w/wiki.phtml?title=Special:Watchlist&days=1">'
        +              '1 jour</a></li>'
      }
    }
}
 
addLoadEvent(ajoutLiens);
if ( wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk" ) {
  addLoadEvent(ajoutOngletJS);
  addLoadEvent(ajoutOngletStructure);
  addLoadEvent(ajoutOngletCSS);
}
 
// AJOUTE LES LIENS DANS LA BOÎTE À OUTILS
 
addOnloadHook(function () {
 
  if ( wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk" ) {
    url = wgServer 
          + "/w/index.php?title=Special:Log&user=" 
          + wgTitle.split("/")[0];
  } 
  else if ( wgCanonicalNamespace == "Special" ) {
               return;
       } 
       else {
         url = wgServer 
               + "/w/index.php?title=Special:Log&page=" 
               + wgPageName;
       }
 
addPortletLink("p-tb", "http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user=Robin+Hood&dbname=kowiki_p", "Compteur d'éditions", "ca-editcount");
addPortletLink("p-cactions", url, "Journal", "pt-logs");
});