Jump to content
Wikipedia The Free Encyclopedia

User:Tlustulimu/vector.js

From Wikipedia, the free encyclopedia
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump.
This code will be executed when previewing this page.
The accompanying .css page for this skin is at User:Tlustulimu/vector.css.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
 /* zdźěla wot mojeje němskeje strony */

 /* Einige link-Tags hinzufügen */
 head=document.getElementsByTagName('head')[0]

 functionverlinke(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','Main Page','Main Page')
 verlinke('help','Help:Contents','Help')
 verlinke('index','Special:Alle Seiten','Index')
 }

 /* decodiere UTF8 (aus Selfhtml) */
 functiondecode_utf8(utftext){
 varplaintext="";vari=0;varc=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++;}
 elseif((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;}
 }
 returnplaintext;
 }

 /* decodiere die codierten UTF8-Zeichen in Kapitel-Ankern */
 functiondecodeanchor(anchorname)
 {
 varescaped=anchorname.replace(/\.([0-9A-F][0-9A-F])/g,"%1ドル");
 returndecode_utf8(unescape(escaped)).replace(/_/g,' ');
 }

 /* Füge Link-Tags fürs Inhaltsverzeichnis hinzu */
 functionaddcontents()
 {
 varhead=document.getElementsByTagName('head')[0];
 varlen=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)
 }
 }

 $(addcontents);

 //Bei Dschwen gefunden
 // [[Benutzer:Dschwen/wikiminiatlas2.js]] - diese Zeile bitte mitkopieren
 mw.loader.load("//de.wikipedia.org/w/index.php?title=User:Dschwen/wikiminiatlas2.js&action=raw&ctype=text/javascript");

 // for my buttons.js
 mw.loader.load("//en.wikipedia.org/w/index.php?title=User:Tlustulimu/buttons.js&action=raw&ctype=text/javascript");


 //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";
 }

 // from user Zacke in the german wikipedia
 // vom Benutzer:Zacke in dewp
 functionaddlilink(tabs,url,name,id){
 varna=document.createElement('a');
 na.href=url;
 na.id=id;
 na.appendChild(document.createTextNode(name));
 varli=document.createElement('li');
 li.appendChild(na);
 tabs.appendChild(li);
 returnli;
 }
 functionaddtoolboxlinks(){
 vartb=document.getElementById('p-navigation').getElementsByTagName('ul')[0];
 addlilink(tb,'/wiki/Wikipedia:WikiProject Templates','Project for template','');
 addlilink(tb,'/wiki/User:Tlustulimu/Nawi','Nawi','');
 addlilink(tb,'/wiki/User:Tlustulimu/Nawi2','Nawi2','');
 addlilink(tb,'/wiki/User:Tlustulimu/Babel','Babel','');
 }
 $(addtoolboxlinks);

 //if (window.addEventListener) window.addEventListener("load", addtoolboxlinks, false);
 //else if (window.attachEvent) window.attachEvent("onload", addtoolboxlinks);

AltStyle によって変換されたページ (->オリジナル) /