Zum Inhalt springen

Benutzer:Kazkaskazkasako/vector.js

aus Wikipedia, der freien Enzyklopädie
Dies ist eine alte Version dieser Seite, zuletzt bearbeitet am 6. März 2014 um 22:45 Uhr durch Kazkaskazkasako (Diskussion | Beiträge). Sie kann sich erheblich von der aktuellen Version unterscheiden.

Hinweis: Leere nach dem Veröffentlichen den Browser-Cache, um die Änderungen sehen zu können.

  • Firefox/Safari: Umschalttaste drücken und gleichzeitig Aktualisieren anklicken oder entweder Strg+F5 oder Strg+R (⌘+R auf dem Mac) drücken
  • Google Chrome: Umschalttaste+Strg+R (⌘+Umschalttaste+R auf dem Mac) drücken
  • Edge: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
/*
	For more scripts look here:
	http://en.wikipedia.org/wiki/Wikipedia:Customisation
	http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts/Scripts
*/
// http://en.wikipedia.org/wiki/Wikipedia:Tools/Navigation_popups
// [[User:Lupin/popups.js]] - please include this line 
//importScript('User:Lupin/popups.js');
// Navigation popup Options:
//popupThumbAction = "linkfull";
//popupImageLinks = false;
//popupPreviewFirstParOnly = false;
//popupLazyDownloads = 
//popupLazyPreviews = false;


//importScript(":en:User:PleaseStand/hide-vector-sidebar.js");
/* hide-vector-sidebar.js: Adds a button to toggle visibility of the Vector sidebar.
   Written by PleaseStand. Public domain; all copyright claims waived as described
   in http://en.wikipedia.org/wiki/Template:PD-self */
 
/*global document, window, addOnloadHook, addPortletLink, skin*/

var sidebarSwitch;
 
function sidebarHide() {
	document.getElementById("mw-panel").style.visibility = "hidden";
	document.getElementById("mw-head-base").style.marginLeft = "0";
	document.getElementById("content").style.marginLeft = "0";
	document.getElementById("left-navigation").style.left = "0";
	document.getElementById("footer").style.marginLeft = "0";
	if(typeof sidebarSwitch == "object") {
		sidebarSwitch.parentNode.removeChild(sidebarSwitch);
	}
	sidebarSwitch = addPortletLink("p-cactions", "javascript:sidebarShow()", "Show sidebar", "ca-sidebar", "Show the navigation links", "a");
}
 
function sidebarShow() {
	document.getElementById("mw-panel").style.visibility = "";
	document.getElementById("mw-head-base").style.marginLeft = "";
	document.getElementById("content").style.marginLeft = "";
	document.getElementById("left-navigation").style.left = "";
	document.getElementById("footer").style.marginLeft = "";
	if(typeof sidebarSwitch == "object") {
		sidebarSwitch.parentNode.removeChild(sidebarSwitch);
	}
	sidebarSwitch = addPortletLink("p-cactions", "javascript:sidebarHide()", "Hide sidebar", "ca-sidebar", "Hide the navigation links", "a");
}
 
// Only activate on Vector skin
if(skin == "vector") {
	addOnloadHook(function() {
		// Change this if you want to show the sidebar by default
		sidebarHide();
	});
}



// From < http://en.wikipedia.org/wiki/User:Gary_King/highlight_nearby_links.js >
/*
	HIGHLIGHT NEARBY LINKS
	Description: If two links are next to each other so it's hard to tell if they are one link or two separate ones (such as [[New York]] [[City]]),
		both links will be underlined so that it is clear that they are separate.
	Link: [[User:Gary King/highlight nearby links.js]]
*/
/* 
if (typeof(unsafeWindow) != 'undefined')
{
	appendCSS = unsafeWindow.appendCSS;
	wgAction = unsafeWindow.wgAction;
	wgCanonicalNamespace = unsafeWindow.wgCanonicalNamespace;
	wgPageName = unsafeWindow.wgPageName;
}
 
function highlightNearbyLinks()
{
	if (!(wgAction == 'view' || (wgPageName == 'Wikipedia:Sandbox' && wgAction == 'submit')))
		return;
 
	appendCSS('a.highlight-nearby { text-decoration: underline; }');
	appendCSS('a.highlight-nearby:hover { text-decoration: none; }');
 
	links = document.getElementById((wgPageName == 'Wikipedia:Sandbox' && wgAction == 'submit' ? 'wikiPreview' : 'bodyContent')).getElementsByTagName('a');
 
	// loop through links in page body
	for (var i = 0; i < links.length; i++)
	{
		l = links[i];
		next = l.nextSibling;
 
		// next node is a text node with only spaces, followed by a link
		if (!next || !next.nextSibling || !(next.nodeType == 3 && next.nodeValue.replace(/ /g, '') == '' && next.nextSibling.nodeName == 'A'))
			continue;
 
		// current and next link are not images
		if ((l.className && l.className.indexOf('image') != -1) || (next.className && next.className.indexOf('image') != -1))
			continue;
 
		// this is a refname
		if ((l.firstChild && l.firstChild.nodeName == 'SUP') || (next.firstChild && next.firstChild.nodeName == 'SUP'))
			continue;
 
		l.className += ' highlight-nearby';
		next.nextSibling.className += ' highlight-nearby';
	}
}
 
if (typeof(unsafeWindow) == 'undefined')
	addOnloadHook(highlightNearbyLinks);
else
	highlightNearbyLinks();


// [[User:Dschwen/highlightredirects.js]] - please include this line 
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Dschwen/highlightredirects.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');



// From < http://en.wikipedia.org/wiki/User:TheDJ/Folded_references >
//importScript('User:TheDJ/foldrefs.js');
//<pre><nowiki>
 
function fold_refs() {
var ref_list_list = getElementsByClassName(document, "OL", "references");
 
  if( ref_list_list && ref_list_list[0] )
  {
    var ref_list = ref_list_list[0];
    if( hasClass( ref_list.parentNode, "references-small" ) )
        ref_list = ref_list.parentNode;
 
    var refdiv = document.createElement( "DIV" );
    refdiv.className = "references-folded NavFrame collapsed"
    refdiv.style.border = "none";
    refdiv.style.margin = 0;
    refdiv.style.padding = 0;
    refdiv.style.fontSize = "100%";
    refdiv.innerHTML = '<div class="NavHead" style="background:transparent;">Folded references<div></div></div><div class="NavContent" style="text-align:left;"></div>';
 
    ref_list.parentNode.insertBefore( refdiv, ref_list );
    var last = refdiv.lastChild
    if( last ) last.appendChild( ref_list );
  }
  createNavigationBarToggleButton();
}
 
addOnloadHook( fold_refs );
//</pre></nowiki>



// From < http://en.wikipedia.org/wiki/User:Lampak/MyLanguages >
//importScript('User:Lampak/MyLanguages.js');
function myLanguages()
{
    if (typeof(mylangsArray) == "undefined") //user didn't define array of languages
        return;
 
    var first; //element to insert before
 
    for (var i = 0; i < mylangsArray.length; i++)
    {
        var els = getElementsByClassName(document, "*", "interwiki-"+mylangsArray[i]); 
 
        if (els.length == 0) //interwiki not found
            continue; 
 
        var parent = els[0].parentNode; 
 
        if (!first) //first loop run
            first = parent.firstChild;
 
        for (var n = 0; n < els.length; n++)
        {
            els[n].style.fontWeight = "bold"; 
 
            if (first == els[n]) //don't move element before itself
                first = first.nextSibling; 
            else
                parent.insertBefore(els[n], first); 
        }
    }
}
 
hookEvent("load", myLanguages);

var mylangsArray = ["en", "ru", "lt", "bat-smg"];


// [[User:Ais523/topcontrib.js]]
// This script color-codes lines according to who has the top contribution for a page.
addOnloadHook(function () {
  if((location.href.indexOf("Special:Contributions")!=-1||
      location.href.indexOf("Special%3AContributions")!=-1)
     &&location.href.indexOf("&ais523")==-1&&location.href.indexOf("?ais523")==-1)
     // the ais523 in the line above is meant to be ais523, not your username; it's
     // to avoid a clash with a couple of other scripts I've written. Feel free to
     // expand it to avoid clashes with other contribs-manipulating scripts, though.
  {
    var i,li,a;
    li=document.getElementById("bodyContent");
    li=li.getElementsByTagName("li");
    i=-1;
    a=new Array();
    while(++i<li.length)
    {
      var s,t;
      var html = li[i].innerHTML;
      var match = html.match(/"\/wiki\/([^"]*)"/);
      if (!match)
        match = html.match(/"\/w\/index.php\?title=([^"]*)&amp;redirect=no"/);
      t = match[1];
      var spans = li[i].getElementsByTagName("span");
      var topspanfound = false;
      for (var j = 0; j < spans.length; j++)
      {
        if (spans[j].className == "mw-uctop")
        {
           topspanfound = true;
           break;
        }
      }
      s = topspanfound ? "#CCCCFF" : "#FFCCCC";
      if(a[t]!=undefined) s=(a[t]=="#CCCCFF"?"#CCFFFF":"#FFFFCC"); else a[t]=s;
      var span = document.createElement( "SPAN" );
      span.style.background = s;
 
      while( li[i].firstChild ) {
        span.appendChild( li[i].firstChild );
      }
      li[i].appendChild( span );
    }
  }
});
//Doesn't work [1/3/2011 3:17:48 PM]
*/