MediaWiki:Common.js

From wiki_ttni_en
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* Das folgende JavaScript wird für alle Benutzer geladen. */

/**
 * Füge eigene Buttons zur Symbolleiste hinzu
 *
 * @source: http://www.mediawiki.org/wiki/Snippets/Custom_buttons_in_the_toolbar
 * @rev: 1
 */

jQuery( document ).ready( function( $ ) {
       function nav_top_test() {
    var a = window.location.href;
    var c = document.getElementById("seite_aktuell");
    var d = document.getElementById("top_nav_link1");
    var e = document.getElementById("top_nav_link2");
    var f = document.getElementById("top_nav_link3");
    switch (true) {
    case /vis_ttni_de/.test(a):
	c.innerHTML = "Visuell";
	d.href = "http://www.thinktanknetworkresearch.net/wiki_ttni_de/index.php?title=Hauptseite";
	d.innerHTML = "Wiki";
	e.href = "http://www.thinktanknetworkresearch.net/blog_ttni_de/";
	e.innerHTML = "Blog";
	f.href = "http://www.thinktanknetworkresearch.net/strt_ttni_de/index.html";
	f.innerHTML = "Startseite";
	break;
    case /vis_ttni_en/.test(a):
	c.innerHTML = "visual";
	d.href = "http://www.thinktanknetworkresearch.net/wiki_ttni_en/index.php?title=Main_Page";
	d.innerHTML = "Wiki";
	e.href = "http://www.thinktanknetworkresearch.net/blog_ttni_en/";
	e.innerHTML = "Blog";
	f.href = "http://www.thinktanknetworkresearch.net/strt_ttni_en/index.html";
	f.innerHTML = "Main Page";
	break;
    case /wiki_ttni_de/.test(a):
	c.innerHTML = "Wiki";
	d.href = "http://www.thinktanknetworkresearch.net/vis_ttni_de/";
	d.innerHTML = "Visuell";
	e.href = "http://www.thinktanknetworkresearch.net/blog_ttni_de/";
	e.innerHTML = "Blog";
	f.href = "http://www.thinktanknetworkresearch.net/strt_ttni_de/index.html";
	f.innerHTML = "Startseite";
	break;
    case /wiki_ttni_en/.test(a):
	c.innerHTML = "Wiki";
	d.href = "http://www.thinktanknetworkresearch.net/vis_ttni_en/";
	d.innerHTML = "visual";
	e.href = "http://www.thinktanknetworkresearch.net/blog_ttni_en/";
	e.innerHTML = "Blog";
	f.href = "http://www.thinktanknetworkresearch.net/strt_ttni_en/index.html";
	f.innerHTML = "Main Page";
	break;
    case /blog_ttni_de/.test(a):
	c.innerHTML = "Blog";
	d.href = "http://www.thinktanknetworkresearch.net/wiki_ttni_de/index.php?title=Hauptseite";
	d.innerHTML = "Wiki";
	e.href = "http://www.thinktanknetworkresearch.net/vis_ttni_de/";
	e.innerHTML = "Visuell";
	f.href = "http://www.thinktanknetworkresearch.net/strt_ttni_de/index.html";
	f.innerHTML = "Startseite";
	break;
    case /strt_ttni_de/.test(a):
	c.innerHTML = "Startseite";
	d.href = "http://www.thinktanknetworkresearch.net/wiki_ttni_de/index.php?title=Hauptseite";
	d.innerHTML = "Wiki";
	e.href = "http://www.thinktanknetworkresearch.net/vis_ttni_de/";
	e.innerHTML = "Visuell";
	f.href = "http://www.thinktanknetworkresearch.net/blog_ttni_de/";
	f.innerHTML = "Blog";
	break;
    case /strt_ttni_en/.test(a):
	c.innerHTML = "Main Page";
	d.href = "http://www.thinktanknetworkresearch.net/wiki_ttni_en/index.php?title=Main_Page";
	d.innerHTML = "Wiki";
	e.href = "http://www.thinktanknetworkresearch.net/vis_ttni_en/";
	e.innerHTML = "visual";
	f.href = "http://www.thinktanknetworkresearch.net/blog_ttni_en/";
	f.innerHTML = "Blog";
	break;
    default:
	c.innerHTML = "Startseite";
	break;
    }
    var b = /_ttni_en/;
    if (b.test(a)) {
	document.getElementById("spr_en").style.textDecoration = "underline";
	document.getElementById("spr_de").style.textDecoration = "none";}
    else {
	document.getElementById("spr_en").style.textDecoration = "none";
	document.getElementById("spr_de").style.textDecoration = "underline";}
}

function deutsch() {
    var haddr = window.location.host;
    location.href = "http://" + haddr + "/wiki_ttni_de/index.php";
}

function english() {
    var haddr = window.location.host;
    location.href = "http://" + haddr + "/wiki_ttni_en/index.php";
}
window.onload = nav_top_test;
} );