Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
(3 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
* @rev: 1 | * @rev: 1 | ||
*/ | */ | ||
− | |||
− | + | jQuery( document ).ready( function( $ ) { | |
− | + | function nav_top_test() { | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | function nav_top_test() { | ||
var a = window.location.href; | var a = window.location.href; | ||
var c = document.getElementById("seite_aktuell"); | var c = document.getElementById("seite_aktuell"); | ||
Line 113: | Line 102: | ||
} | } | ||
window.onload = nav_top_test; | window.onload = nav_top_test; | ||
+ | } ); |
Latest revision as of 11:13, 30 November 2012
/* 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;
} );