User:Doc Taxon/monobook.js

From Wikipedia

Note: After publishing, 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: Press Ctrl-F5.
// Dieses Skript fügt eine kleine Wikipe-tan unten links auf dem Bildschirm hinzu.
// Zur Einbindung einfach 
// importScript('Benutzer:MGChecker/wikipe-tan.js'); // [[Benutzer:MGChecker/wikipe-tan.js]]
// in die common.js/vector.js/monobook.js ergänzen.

var picTan = "https://upload.wikimedia.org/wikipedia/commons/2/2a/Wikipe-tan_full_length_(reversed).svg";
var picButton = "https://upload.wikimedia.org/wikipedia/commons/9/98/Blank_button.svg";
// var picButton = "https://upload.wikimedia.org/wikipedia/commons/3/30/Button_Wikimedia.png";

if (mw.config.get("skin") == "monobook") {
    leftTan = "2px";
	leftButton1 = "29px"; bottomButton1 = "112px";
	leftButton2 = "105px"; bottomButton2 = "111px";
	leftButton3 = "77px"; bottomButton3 = "35px";
} else {
    leftTan = "10px";
	leftButton1 = "37px"; bottomButton1 = "120px";
	leftButton2 = "113px"; bottomButton2 = "119px";
	leftButton3 = "85px"; bottomButton3 = "43px";
}

//var leftTan = "10px";
//if (mw.config.get("skin") == "monobook") {
//	leftTan = "2px";
//}
//var leftButton1 = "29px"; var bottomButton1 = "112px";
//var leftButton2 = "105px"; var bottomButton2 = "111px";
//var leftButton3 = "77px"; var bottomButton3 = "35px";

$wikipeTan = jQuery('<div id="wikipeTanOuter" style="position:fixed; left:' + leftTan + '; bottom:0; display:block; height:150px; width:150px; z-index:3;" />');
$wikipeTan.html('<img src="' + picTan + '" width="150px" onclick="wikipeTanHide();" />');
$("body").append($wikipeTan);

$button1 = jQuery('<div id="buttonOuter1" style="position:fixed; left:' + leftButton1 + '; bottom:' + bottomButton1 + '; display:block; height:30px; width:30px; z-index:4;" />');
$button1.html('<img src="' + picButton + '" width="30px" onclick="button1();" />');
$("body").append($button1);

$button2 = jQuery('<div id="buttonOuter2" style="position:fixed; left:' + leftButton2 + '; bottom:' + bottomButton2 + '; display:block; height:30px; width:30px; z-index:4;" />');
$button2.html('<img src="' + picButton + '" width="30px" onclick="button2();" />');
$("body").append($button2);

$button3 = jQuery('<div id="buttonOuter3" style="position:fixed; left:' + leftButton3 + '; bottom:' + bottomButton3 + '; display:block; height:30px; width:30px; z-index:4;" />');
$button3.html('<img src="' + picButton + '" width="30px" onclick="button3();" />');
$("body").append($button3);

function wikipeTanHide() {
	document.getElementById("wikipeTanOuter").style.display = "none";
}

$button1.click(function() {
	window.location='https://de.wikipedia.org/wiki/Spezial:Beitr%C3%A4ge/TaxonBot';
});

$button2.click(function() {
	window.location='https://de.wikipedia.org/wiki/Spezial:Beitr%C3%A4ge/TaxonKatBot';
});

$button3.click(function() {
	window.location='https://de.wikipedia.org/wiki/Spezial:Beitr%C3%A4ge/TaxonBota';
});