ויקיציטוט:סקריפטים/4

מתוך ויקיציטוט, מאגר הציטוטים החופשי.

/* סקריפט 4: נכתב ע"י משתמש:Mikimik, מבוסס על w:ויקיפדיה:סקריפטים/4 */ /* יוצר תיבה בסרגל הצד לפני תיבת הכלים. התיבה נותנת קישורים לדפים המקבילים במיזמי האחות. */

function OtherWikisProjects() {

 var bbox = document.getElementById("p-tb");
 if ( bbox == null ) return;
 var ulNode = document.createElement("ul");
 var otherwikislist = new Array();
 otherwikislist[0] = "wikipedia";
 otherwikislist[1] = "ויקיפדיה";
 otherwikislist[2] = "wiktionary";
 otherwikislist[3] = "ויקימילון";
 otherwikislist[4] = "wikibooks";
 otherwikislist[5] = "ויקיספר";
 otherwikislist[6] = "wikisource";
 otherwikislist[7] = "ויקיטקסט";
 visualPageName = wgPageName.replace(/_/g, " ");
 for (var i = 0 ; i * 2 < otherwikislist.length ; i++)
   {
     var url = "http://he.wikiquote.org/wiki/" + wgPageName;
     url = url.replace ("wikiquote", otherwikislist[i * 2]);
     url = url.replace ("ויקיציטוט:", otherwikislist[i * 2 + 1] + ":");
     var aNode = document.createElement("a");
     aNode.appendChild (document.createTextNode(otherwikislist[i * 2 + 1]));
     aNode.setAttribute ("href", url);
     aNode.setAttribute ("title", visualPageName + " בו" + otherwikislist[i * 2 + 1]);
     var liNode = document.createElement("li");
     liNode.id = "ow-" + otherwikislist[i*2];
     liNode.appendChild (aNode);
     ulNode.appendChild (liNode);
   }
 
 var innerbox = document.createElement("div");
 innerbox.className = "pBody";
 innerbox.appendChild (ulNode);
 var h5 = document.createElement("h5");
 h5.appendChild (document.createTextNode("מיזמי אחות"));
 var box = document.createElement("div");
 box.id="p-otherwikis";
 box.className="portlet";
 box.appendChild (h5);
 box.appendChild (innerbox);
 
 bbox.parentNode.insertBefore (box, bbox);

}

addOnloadHook (OtherWikisProjects);