Wužiwar:Tlustulimu/monobook.js

z Kitakija

< Wužiwar:Tlustulimu(rozdźěl mjez wersijomaj)
Dźi do: Nawigacija, Pytać
S (dodawk)
(korektura)
 
(Přirunanje wersijow zapřija 28 mjez nimaj ležacych wersijow.)
Rjadka 1: Rjadka 1:
-
/* zdźěla wot mojeje němskeje strony */
+
/* zdźěla wot mojeje němskeje a zdźěla wot esperantorěčneje strony */
-
/* Füge Projektportal-Link hinzu */
+
/** Trovita ĉe Arno Lagrange
-
function addPortal()
+
* insertAfter : insérer un élément dans une page
-
{
+
*/
-
  quickbar = document.getElementById('quickbar');
+
function insertAfter(parent, node, referenceNode) {
-
  if (quickbar)
+
parent.insertBefore(node, referenceNode.nextSibling);  
-
  {
+
}
-
    neues = document.createElement('a')
+
-
    neues.href = '/wiki/Wikipedia:Portal'
+
/**
-
    neues.appendChild(document.createTextNode('Projektportal'))
+
* getElementsByClass : rechercher les éléments de la page dont le paramètre "class" est celui recherché
-
    quickbar.appendChild(neues)
+
*/
-
  }
+
function getElementsByClass(searchClass, node, tag) {
 +
if (node == null) node = document;
 +
if (tag == null) tag = '*';
 +
return getElementsByClassName(node, tag, searchClass);
 +
}
 +
 +
 +
// Ĝuste akiras la tekstan entenaon de nodo kaj de ties idaj nodoj
 +
// Kopirajto Harmen Christophe, http://openweb.eu.org/articles/validation_avancee, CC
 +
function getTextContent(oNode) {
 +
if (typeof(oNode.textContent)!="undefined") {return oNode.textContent;}
 +
switch (oNode.nodeType) {
 +
case 3: // TEXT_NODE
 +
case 4: // CDATA_SECTION_NODE
 +
return oNode.nodeValue;
 +
break;
 +
case 7: // PROCESSING_INSTRUCTION_NODE
 +
case 8: // COMMENT_NODE
 +
if (getTextContent.caller!=getTextContent) {
 +
return oNode.nodeValue;
 +
}
 +
break;
 +
case 9: // DOCUMENT_NODE
 +
case 10: // DOCUMENT_TYPE_NODE
 +
case 12: // NOTATION_NODE
 +
return null;
 +
break;
 +
}
 +
var _textContent = "";
 +
oNode = oNode.firstChild;
 +
while (oNode) {
 +
_textContent += getTextContent(oNode);
 +
oNode = oNode.nextSibling;
 +
}
 +
return _textContent;
}
}
-
 
-
addOnloadHook(addPortal);
 
/* Einige link-Tags hinzufügen */
/* Einige link-Tags hinzufügen */
Rjadka 30: Rjadka 62:
if (head) /* sollte immer true ergeben, aber sicher ist sicher */
if (head) /* sollte immer true ergeben, aber sicher ist sicher */
{
{
-
   verlinke('start', 'Hauptseite', 'Hauptseite')
+
   verlinke('start', 'Hłowna strona', 'Hłowna strona')
-
   verlinke('help', 'Wikipedia:Handbuch', 'Handbuch')
+
   verlinke('help', 'Wikipedija:Pomoc', 'Pomoc')
-
   verlinke('index', 'Spezial:Allpages', 'Index')
+
   verlinke('index', 'Special:Alle Seiten', 'Index')
}
}
Rjadka 87: Rjadka 119:
     + 'http://de.wikipedia.org/w/index.php?title=User:Dschwen/wikiminiatlas2.js'  
     + 'http://de.wikipedia.org/w/index.php?title=User:Dschwen/wikiminiatlas2.js'  
     + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
     + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
-
 
-
//Aus der englischen Wikipedia von User:Cacycle
 
-
// install [[User:Cacycle/wikEd]] in-browser text editor
 
-
document.write('<script type="text/javascript" src="'
 
-
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
 
-
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
-
 
//Po ideju w němskej Wikipediji [[:de:Wikipedia Diskussion:Skin#Freigeben rot]]
//Po ideju w němskej Wikipediji [[:de:Wikipedia Diskussion:Skin#Freigeben rot]]
Rjadka 102: Rjadka 127:
}
}
-
 
+
// z wužiwarja Zacke w němskej wikipediji
-
//Cookie helpers
+
// vom Benutzer:Zacke in dewp
-
function setCookie(cookieName, cookieValue) {
+
function addlilink(tabs, url, name, id) {
-
var today = new Date();
+
    var na = document.createElement('a');
-
var expire = new Date();
+
    na.href = url;
-
var nDays = 30;
+
    na.id = id;
-
expire.setTime( today.getTime() + (3600000 * 24 * nDays) );
+
    na.appendChild(document.createTextNode(name));
-
document.cookie = cookieName + "=" + escape(cookieValue)
+
    var li = document.createElement('li');
-
                + ";path=/w"
+
    li.appendChild(na);
-
                + ";expires="+expire.toGMTString();
+
    tabs.appendChild(li);
-
document.cookie = cookieName + "=" + escape(cookieValue)
+
    return li;
-
                + ";path=/wiki"
+
-
                + ";expires="+expire.toGMTString();
+
}
}
-
 
+
function addtoolboxlinks() {
-
function getCookie(cookieName) {
+
var tb = document.getElementById('p-navigation').getElementsByTagName('ul')[0];
-
  var start = document.cookie.indexOf( cookieName + "=" );
+
addlilink(tb, '/w/index.php?title=Wikipedija:Projekt_za_předłohi', 'Projekt za předłohi', '');
-
  if ( start == -1 ) return "";
+
addlilink(tb, '/w/index.php?title=Wikipedija:Infokašćik', 'Projekt za infokašćiki', '');
-
  var len = start + cookieName.length + 1;
+
addlilink(tb, '/w/index.php?title=Wikipedija:Požadane_přełožki', 'Požadane přełožki', '');
-
  if ( ( !start ) &&
+
addlilink(tb, '/w/index.php?title=Kategorija:Strony_k_spěšnemu_wušmórnjenju', 'SW', '');
-
    ( cookieName != document.cookie.substring( 0, cookieName.length ) ) )
+
addlilink(tb, '/w/index.php?title=Kategorija:Kandidaty_za_šmórnjenje', 'Kat. Kand. šm.', '');
-
      {
+
addlilink(tb, '/w/index.php?title=Wikipedija:Kandidaty_za_šmórnjenje', 'Wik. Kand. šm.', '');
-
        return "";
+
addlilink(tb, '/w/index.php?title=Specialnje:Prefiksindeks', 'Strony', '');
-
      }
+
addlilink(tb, '/w/index.php?title=Wužiwar:Tlustulimu/Nawi', 'Nawi', '');
-
  var end = document.cookie.indexOf( ";", len );
+
addlilink(tb, '/w/index.php?title=Wužiwar:Tlustulimu/Nawi2', 'Nawi2', '');
-
  if ( end == -1 ) end = document.cookie.length;
+
addlilink(tb, '/w/index.php?title=Wužiwar:Tlustulimu/Babel', 'Babel', '');
-
  return unescape( document.cookie.substring( len, end ) );
+
addlilink(tb, '/w/index.php?title=MediaWiki:Gadgets-definition', 'Gadgets', '');
 +
addlilink(tb, 'irc://irc.freenode.net/#wikipedia-hsb', 'IRC', '');
}
}
 +
if (window.addEventListener) window.addEventListener("load", addtoolboxlinks, false);
 +
else if (window.attachEvent) window.attachEvent("onload", addtoolboxlinks);
-
function deleteCookie(cookieName) {
+
// install [[Wužiwar:Tlustulimu/test2.js]] correction for older gecko browsers (until rv:1.8.x)
-
  if ( getCookie(cookieName) ) {
+
document.write('<script type="text/javascript" src="'
-
    document.cookie = cookieName + "=" + ";path=/w" +
+
    + 'http://hsb.wikipedia.org/w/index.php?title=Wu%C5%BEiwar:Tlustulimu/test.js'
-
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
+
    + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
-
    document.cookie = cookieName + "=" + ";path=/wiki" +
+
-
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
+
-
  }
+
-
}
+
-
 
+
/** Trovita ĉe Arno Lagrange
-
/* add menu for selecting subsets of secial characters */
+
* El franclingva Vikipedio :
-
/***** must match MediaWiki:Edittools *****/
+
* Laŭ decido de [[:fr:Wikipédia:Prise de décision/Lien interprojet]]
-
function addCharSubsetMenu() {
+
* Kopias la interprojektajn ligilojn el la ŝablono {{Projekto}}
-
  var edittools = document.getElementById('specialchars');
+
* en la maldekstran strion
-
 
+
* remove_other_projects = true; en persona monobook.css por krome ne plu aperigi
-
  if (edittools) {
+
* la ŝablonon en la paĝo
-
    var menu = "<select id=\"charSubsetControl\" style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">";
+
* no_other_projects = true; en persona monobook.css por malebligi ke tiu skripto funkciu
-
    menu += "<option>standard</option>";
+
*/
-
    menu += "<option>WikiSyntax</option>";
+
-
    menu += "<option>templates</option>";
+
function aliajProjektoj() {
-
    menu += "<option>IPA</option>";
+
if ((typeof no_other_projects != "undefined") && (no_other_projects)) return;
-
    menu += "<option>lat</option>";
+
if(!(wgNamespaceNumber==0)) return;
-
    menu += "<option>arab</option>";
+
if(!(wgAction=="view")) return;
-
    menu += "<option>czech</option>";
+
var div = document.getElementById('druhe_projekty');
-
    menu += "<option>esperanto</option>";
+
if(!div) return;
-
    menu += "<option>eston</option>";
+
var list = div.getElementsByTagName('LI');
-
    menu += "<option>franc</option>";
+
var newlist = document.createElement("UL");
-
    menu += "<option>galic</option>";
+
for (var i = 0; i < list.length ; i++) {
-
    menu += "<option>grjek</option>";
+
list.link = list[i].getElementsByTagName('A')[0];
-
    menu += "<option>hawai</option>";
+
list.text = list.link.getElementsByTagName('SPAN')[0];
-
    menu += "<option>island</option>";
+
var newlistitem = document.createElement("LI");
-
    menu += "<option>ital</option>";
+
var newlink = document.createElement("A");
-
    menu += "<option>jid</option>";
+
var newlinktext = document.createTextNode(getTextContent(list.text));
-
    menu += "<option>jug</option>";
+
newlink.appendChild(newlinktext);
-
    menu += "<option>katal</option>";
+
newlink.title=getTextContent(list.link);
-
    menu += "<option>kyril</option>";
+
newlink.href=list.link.href;
-
    menu += "<option>let</option>";
+
newlistitem.appendChild(newlink);
-
    menu += "<option>lit</option>";
+
newlist.appendChild(newlistitem);
-
    menu += "<option>mad</option>";
+
}
-
    menu += "<option>malt</option>";
+
var interProject = document.createElement("DIV");
-
    menu += "<option>de</option>";
+
interProject.className = 'portlet';
-
    menu += "<option>pinyin</option>";
+
interProject.innerHTML = '<h5>Druhe projekty<\/h5><div class="pBody"><ul>'+newlist.innerHTML+'</ul></div>';
-
    menu += "<option>pol</option>";
+
insertAfter(document.getElementById('column-one'),interProject,document.getElementById('p-tb'));
-
    menu += "<option>port</option>";
+
if ((typeof remove_other_projects != "undefined") && (remove_other_projects)) {
-
    menu += "<option>roman</option>";
+
document=document.getElementById('bodyContent').removeChild(div);
-
    menu += "<option>rumun</option>";
+
-
    menu += "<option>serb</option>";
+
-
    menu += "<option>skand</option>";
+
-
    menu += "<option>slowak</option>";
+
-
    menu += "<option>str_gjek</option>";
+
-
    menu += "<option>span</option>";
+
-
    menu += "<option>turk</option>";
+
-
    menu += "<option>viet</option>";
+
-
    menu += "</select>";
+
-
    edittools.innerHTML = menu + edittools.innerHTML;
+
-
 
+
-
    /* default subset from cookie */
+
-
    var s = parseInt( getCookie('edittoolscharsubset') );
+
-
    if ( isNaN(s) ) s = 0;
+
-
 
+
-
    /* update dropdown control to value of cookie */
+
-
    document.getElementById('charSubsetControl').selectedIndex = s;
+
-
 
+
-
    /* display the subset indicated by the cookie */
+
-
    chooseCharSubset( s );
+
-
  }
+
}
}
-
 
-
/* select subsection of special characters */
 
-
function chooseCharSubset(s) {
 
-
  var l = document.getElementById('specialchars').getElementsByTagName('p');
 
-
  for (var i = 0; i < l.length ; i++) {
 
-
    l[i].style.display = i == s ? 'inline' : 'none';
 
-
  // l[i].style.visibility = i == s ? 'visible' : 'hidden';
 
-
  }
 
-
  setCookie('edittoolscharsubset', s);
 
}
}
 +
 +
addOnloadHook(aliajProjektoj);

Aktualna wersija wot 14:06, 29. jun 2011

/* zdźěla wot mojeje němskeje a zdźěla wot esperantorěčneje strony */
 
/** Trovita ĉe Arno Lagrange
* insertAfter : insérer un élément dans une page
*/
function insertAfter(parent, node, referenceNode) {
parent.insertBefore(node, referenceNode.nextSibling); 
}
 
/**
* getElementsByClass : rechercher les éléments de la page dont le paramètre "class" est celui recherché
*/
function getElementsByClass(searchClass, node, tag) {
if (node == null) node = document;
if (tag == null) tag = '*';
return getElementsByClassName(node, tag, searchClass);
}
 
 
// Ĝuste akiras la tekstan entenaon de nodo kaj de ties idaj nodoj
// Kopirajto Harmen Christophe, http://openweb.eu.org/articles/validation_avancee, CC
function getTextContent(oNode) {
if (typeof(oNode.textContent)!="undefined") {return oNode.textContent;}
switch (oNode.nodeType) {
case 3: // TEXT_NODE
case 4: // CDATA_SECTION_NODE
return oNode.nodeValue;
break;
case 7: // PROCESSING_INSTRUCTION_NODE
case 8: // COMMENT_NODE
if (getTextContent.caller!=getTextContent) {
return oNode.nodeValue;
}
break;
case 9: // DOCUMENT_NODE
case 10: // DOCUMENT_TYPE_NODE
case 12: // NOTATION_NODE
return null;
break;
}
var _textContent = "";
oNode = oNode.firstChild;
while (oNode) {
_textContent += getTextContent(oNode);
oNode = oNode.nextSibling;
}
return _textContent;
}
 
/* Einige link-Tags hinzufügen */
head = document.getElementsByTagName('head')[0]
 
function verlinke(rel, href, title)
{
  link = document.createElement('link')
  link.rel = rel
  link.href = '/wiki/' + href
  link.title = title
  head.appendChild(link)
}
 
if (head) /* sollte immer true ergeben, aber sicher ist sicher */
{
  verlinke('start', 'Hłowna strona', 'Hłowna strona')
  verlinke('help', 'Wikipedija:Pomoc', 'Pomoc')
  verlinke('index', 'Special:Alle Seiten', 'Index')
}
 
/* decodiere UTF8 (aus Selfhtml) */
function decode_utf8(utftext) {
     var plaintext = ""; var i=0; var c=c1=c2=0;
     // while-Schleife, weil einige Zeichen uebersprungen werden
     while(i<utftext.length)
         {
         c = utftext.charCodeAt(i);
         if (c<128) {
             plaintext += String.fromCharCode(c);
             i++;}
         else if((c>191) && (c<224)) {
             c2 = utftext.charCodeAt(i+1);
             plaintext += String.fromCharCode(((c&31)<<6) | (c2&63));
             i+=2;}
         else {
             c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2);
             plaintext += String.fromCharCode(((c&15)<<12) | ((c2&63)<<6) | (c3&63));
             i+=3;}
         }
     return plaintext;
}
 
/* decodiere die codierten UTF8-Zeichen in Kapitel-Ankern */
function decodeanchor(anchorname)
{
  var escaped = anchorname.replace(/\.([0-9A-F][0-9A-F])/g,"%$1");
  return decode_utf8(unescape(escaped)).replace(/_/g,' ');
}
 
/* Füge Link-Tags fürs Inhaltsverzeichnis hinzu */
function addcontents()
{
  var head = document.getElementsByTagName('head')[0];
  var len = document.anchors.length
  for (i = 0; i <  len; ++i)
  {
    anchor = document.anchors[i];
    link = document.createElement('link')
    link.rel = 'chapter'
    link.href = '#' + anchor.name;
    link.title = decodeanchor(anchor.name);
    head.appendChild(link)
  }
}
 
addOnloadHook(addcontents);
 
//Bei Dschwen gefunden
// [[Benutzer:Dschwen/wikiminiatlas2.js]] - diese Zeile bitte mitkopieren
document.write('<script type="text/javascript" src="' 
     + 'http://de.wikipedia.org/w/index.php?title=User:Dschwen/wikiminiatlas2.js' 
     + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
//Po ideju w němskej Wikipediji [[:de:Wikipedia Diskussion:Skin#Freigeben rot]]
 
if (document.getElementById("ca-unprotect")) 
{  document.getElementById("ca-unprotect").style.borderColor = "#FF0000";
document.getElementById("ca-unprotect").style.borderWidth = "4px";
}
 
// z wužiwarja Zacke w němskej wikipediji
// vom Benutzer:Zacke in dewp
function addlilink(tabs, url, name, id) {
    var na = document.createElement('a');
    na.href = url;
    na.id = id;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    li.appendChild(na);
    tabs.appendChild(li);
    return li;
}
function addtoolboxlinks() {
var tb = document.getElementById('p-navigation').getElementsByTagName('ul')[0];
addlilink(tb, '/w/index.php?title=Wikipedija:Projekt_za_předłohi', 'Projekt za předłohi', '');
addlilink(tb, '/w/index.php?title=Wikipedija:Infokašćik', 'Projekt za infokašćiki', '');
addlilink(tb, '/w/index.php?title=Wikipedija:Požadane_přełožki', 'Požadane přełožki', '');
addlilink(tb, '/w/index.php?title=Kategorija:Strony_k_spěšnemu_wušmórnjenju', 'SW', '');
addlilink(tb, '/w/index.php?title=Kategorija:Kandidaty_za_šmórnjenje', 'Kat. Kand. šm.', '');
addlilink(tb, '/w/index.php?title=Wikipedija:Kandidaty_za_šmórnjenje', 'Wik. Kand. šm.', '');
addlilink(tb, '/w/index.php?title=Specialnje:Prefiksindeks', 'Strony', '');
addlilink(tb, '/w/index.php?title=Wužiwar:Tlustulimu/Nawi', 'Nawi', '');
addlilink(tb, '/w/index.php?title=Wužiwar:Tlustulimu/Nawi2', 'Nawi2', '');
addlilink(tb, '/w/index.php?title=Wužiwar:Tlustulimu/Babel', 'Babel', '');
addlilink(tb, '/w/index.php?title=MediaWiki:Gadgets-definition', 'Gadgets', '');
addlilink(tb, 'irc://irc.freenode.net/#wikipedia-hsb', 'IRC', '');
}
if (window.addEventListener) window.addEventListener("load", addtoolboxlinks, false);
else if (window.attachEvent) window.attachEvent("onload", addtoolboxlinks);
 
// install [[Wužiwar:Tlustulimu/test2.js]] correction for older gecko browsers (until rv:1.8.x)
document.write('<script type="text/javascript" src="'
     + 'http://hsb.wikipedia.org/w/index.php?title=Wu%C5%BEiwar:Tlustulimu/test.js'
     + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
/** Trovita ĉe Arno Lagrange
* El franclingva Vikipedio : 
* Laŭ decido de [[:fr:Wikipédia:Prise de décision/Lien interprojet]]
* Kopias la interprojektajn ligilojn el la ŝablono {{Projekto}}
* en la maldekstran strion 
* remove_other_projects = true; en persona monobook.css por krome ne plu aperigi 
* la ŝablonon en la paĝo 
* no_other_projects = true; en persona monobook.css por malebligi ke tiu skripto funkciu
*/
 
function aliajProjektoj() {
if ((typeof no_other_projects != "undefined") && (no_other_projects)) return;
if(!(wgNamespaceNumber==0)) return;
if(!(wgAction=="view")) return;
var div = document.getElementById('druhe_projekty');
if(!div) return;
var list = div.getElementsByTagName('LI');
var newlist = document.createElement("UL");
for (var i = 0; i < list.length ; i++) {
list.link = list[i].getElementsByTagName('A')[0];
list.text = list.link.getElementsByTagName('SPAN')[0];
var newlistitem = document.createElement("LI");
var newlink = document.createElement("A");
var newlinktext = document.createTextNode(getTextContent(list.text));
newlink.appendChild(newlinktext);
newlink.title=getTextContent(list.link);
newlink.href=list.link.href;
newlistitem.appendChild(newlink);
newlist.appendChild(newlistitem);
}
var interProject = document.createElement("DIV");
interProject.className = 'portlet';
interProject.innerHTML = '<h5>Druhe projekty<\/h5><div class="pBody"><ul>'+newlist.innerHTML+'</ul></div>';
insertAfter(document.getElementById('column-one'),interProject,document.getElementById('p-tb'));
if ((typeof remove_other_projects != "undefined") && (remove_other_projects)) {
document=document.getElementById('bodyContent').removeChild(div);
}
}
 
addOnloadHook(aliajProjektoj);
Wosobinske nastroje