Benutzer:Loki/monobook.js
Zur Navigation springen
Zur Suche springen
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
- Internet Explorer/Edge: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
- Opera: Strg+F5
/* Ergänzung der Editierzeile mit zusätzlichen Buttons */ if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://shadowhelix.de/images/b/b9/Button_E.png", "speedTip": "Artikelende", "tagOpen": "<!-- Ende des Artikelinhalts - Metainformationen -->", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://shadowhelix.de/images/b/b0/Button_trash.png", "speedTip": "Löschantrag", "tagOpen": "{{Löschantrag||}}", "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://shadowhelix.de/images/3/3e/Button_STD.png", "speedTip": "Standardartikel", "tagOpen": '{{stub}}\n{{+quelle}}\n\'\'\'\'\'\'\n<ref></ref>\n<ref group=\"E\"></ref>\n<ref group=\"W\"></ref>\n\n<!-- Ende des Artikelinhalts - Metainformationen -->\n\n==Erläuterungen==\n<references group=\"E\"/>\n\n==Widersprüche==\n<references group=\"W\"/>\n\n==Quellenindex==\n*[[ (Quelle, englisch)| ]] {{+idx}}\n*[[ (Quelle)| ]] {{+idx}}\n*{{Quelle||{{+idx}}}}\n*[[Romane#|Roman:]] {{+idx}}\n*{{Romanquelle||{{+idx}}}}\n\n==Quellenangabe==\n<references/>\n\n==Weblinks==\n*[[wp:|Wikipedia: ]]\n\n{{DEFAULTSORT:}}\n{{KatSchema|schema=}}\n{{KatSort|cat=|}}\n[[Kategorie:]]', "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://shadowhelix.de/images/b/ba/Button_Stub.png", "speedTip": "Stubartikel", "tagOpen": '{{stub}}\n\'\'\'\'\'\'\n\n<!-- Ende des Artikelinhalts - Metainformationen -->\n\n==Quellenindex==\n*{{Quelle||{{+idx}}}}\n\n==Weblinks==\n*[[wp:|Wikipedia: ]]\n\n{{DEFAULTSORT:}}\n{{KatSchema|schema=}}\n{{KatSort|cat=|}}\n[[Kategorie:]]', "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://shadowhelix.de/images/8/84/Button_Redirect.png", "speedTip": "Redirect", "tagOpen": '#REDIRECT [[', "tagClose": "]]", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://shadowhelix.de/images/9/9d/Button_Person.png", "speedTip": "Vorlage:Person", "tagOpen": '{{Person\n|GESCHLECHT=\n|METATYP=\n|MAGISCH=\n}}', "tagClose": "", "sampleText": ""}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://shadowhelix.de/images/8/8e/Button_Stadt.png", "speedTip": "Vorlage:Stadt", "tagOpen": '{{Stadt\n|STAND=?\n|STATUS=\n|KOORD={{Koord||kbs=1|z=}} {{KoordTransform|}}\n}}', "tagClose": "", "sampleText": ""}; } /* Countdown */ function pause(delay) { var start = new Date(); while ((new Date()) - start <= delay) {} } function updateCountdown () { var Countdown = document.getElementsByTagName( "div" ); for ( var i = 0; i < Countdown.length; i++ ) { // div mit class="countdown" raussuchen if ( hasClass( Countdown[i], "countdown" ) ) { // div wird geleert while(Countdown[i].hasChildNodes()){ Countdown[i].removeChild(Countdown[i].lastChild); } var targetTime = new Date("December 24, 2011 00:00:00"); var currentTime = new Date (); var differenceTime = new Date(targetTime - currentTime); var Brk = document.createElement( "br" ); if (differenceTime < 0) { var days = (Math.floor(differenceTime/(86400*1000))).toString(); var hours = (Math.floor(differenceTime/(3600*1000)) % 24).toString(); if (hours < 10) {hours = "0"+hours} var minutes = (Math.floor(differenceTime/(60*1000)) % 60).toString(); if (minutes < 10) {minutes = "0"+minutes} var seconds = (Math.floor(differenceTime/1000) % 60).toString(); if (seconds < 10) {seconds = "0"+seconds} var centiseconds = (Math.floor(differenceTime/10) % 100).toString(); if (centiseconds < 10) {centiseconds = "0"+centiseconds} var CountdownText1 = document.createTextNode( "Countdown to the Sixth World"); var CountdownText2 = document.createTextNode( days+" Tage "+hours+":"+minutes+":"+seconds+":"+centiseconds ); // einfügen in div Countdown[i].insertBefore( CountdownText2, Countdown[i].childNodes[0] ); Countdown[i].insertBefore( Brk, Countdown[i].childNodes[0] ); Countdown[i].insertBefore( CountdownText1, Countdown[i].childNodes[0] ); // reset der lineHeight notwendig Countdown[i].style.lineHeight = "1.5em"; // nächster aufruf von updateCountdown() nach 100ms setTimeout('updateCountdown();',10); } else { var str = "Teststring"; for (var j=1;j<=str.length;j++) { while(Countdown[i].hasChildNodes()){ Countdown[i].removeChild(Countdown[i].lastChild); } Countdown[i].insertBefore( document.createTextNode( str.substring(0,j) ), Countdown[i].childNodes[0] ); Countdown[i].style.lineHeight = "1.5em"; pause(500); } } } } } addOnloadHook( updateCountdown ); /* Uhr */ function updateClock () { var Clock = document.getElementsByTagName( "div" ); for ( var i = 0; i < Clock.length; i++ ) { // div mit class="clock" raussuchen if ( hasClass( Clock[i], "clock" ) ) { // div wird geleert while(Clock[i].hasChildNodes()){ Clock[i].removeChild(Clock[i].lastChild); } var currentTime = new Date (); var currentHours = currentTime.getHours(); var currentMinutes = currentTime.getMinutes(); var currentSeconds = currentTime.getSeconds(); // ergänzung einer null, wenn sec, min, std nur eine ziffer haben if ( currentHours < 10) { currentHours = "0"+currentHours} if (currentMinutes < 10) {currentMinutes = "0"+currentMinutes} if (currentSeconds < 10) {currentSeconds = "0"+currentSeconds} // text + aktuelle uhrzeit var ClockText2 = document.createTextNode( "Do You Know Where Your " +"Meat Body Is?" ); var ClockText1 = document.createTextNode( "Its "+currentHours+":" +currentMinutes+":" +currentSeconds ); var Brk = document.createElement( "br" ); // einfügen in div Clock[i].insertBefore( ClockText2, Clock[i].childNodes[0] ); Clock[i].insertBefore( Brk, Clock[i].childNodes[0] ); Clock[i].insertBefore( ClockText1, Clock[i].childNodes[0] ); // reset der lineHeight notwendig Clock[i].style.lineHeight = "1.5em"; // nächster aufruf von updateClock() nach 1000ms setTimeout('updateClock();',1000); } } } addOnloadHook( updateClock ); /* Buttons für Jahresartikel-Selektion * * Einschalten der opacity-Modifikation (Alternative zum Ausblenden): * var customJahresartikel = 'opac'; */ var customJahresartikel = ''; function createSelectButtons() { var Selection = document.getElementsByTagName( "div" ); for ( var i = 0; i < Selection.length; i++ ) { if ( hasClass( Selection[i], "jahresartikel" ) ) { var umbruch = 5; var buttonID = new Array(15); buttonID[0] = "Wissenschaft"; buttonID[1] = "Unterwelt"; buttonID[2] = "Technologie"; buttonID[3] = "Sport"; buttonID[4] = "Religion"; buttonID[5] = "Raumfahrt"; buttonID[6] = "Politik"; buttonID[7] = "Metamenschen"; buttonID[8] = "Matrix"; buttonID[9] = "Magie"; buttonID[10] = "Kriege"; buttonID[11] = "Konzerne"; buttonID[12] = "Kultur"; buttonID[13] = "Katastrophen"; buttonID[14] = "Drachen"; buttonID[15] = "Alles"; for ( var j = 0; j < buttonID.length; j++ ) { var Button = document.createElement( "span" ); Button.style.styleFloat = "left"; Button.style.cssFloat = "left"; Button.style.fontWeight = "normal"; Button.style.textAlign = "center"; Button.style.width = "12em"; if (j == (buttonID.length - 1)) { Button.style.styleFloat = "right"; Button.style.cssFloat = "right"; Button.style.position = "relative"; Button.style.top = "1.5em"; } var ButtonLink = document.createElement( "a" ); ButtonLink.style.color = Selection[i].style.color; ButtonLink.setAttribute( "id", buttonID[j] ); var ButtonText = document.createTextNode( buttonID[j] ); if (j == (buttonID.length - 1) ) { ButtonLink.setAttribute( "href", "javascript:displayAll()" ); } else { ButtonLink.setAttribute( "href", "javascript:displayTheme('" +buttonID[j].toLowerCase()+"')" ); } ButtonLink.appendChild( ButtonText ); Button.appendChild( document.createTextNode( "[" ) ); Button.appendChild( ButtonLink ); Button.appendChild( document.createTextNode( "]" ) ); Selection[i].insertBefore( Button, Selection[i].childNodes[0] ); if (((j+1) % umbruch) == 0 && j != (buttonID.length - 1)) { var Brk = document.createElement( "br" ); Selection[i].insertBefore( Brk, Selection[i].childNodes[0] ); } } } } } addOnloadHook( createSelectButtons ); function createButtons() { var Selection = document.getElementsByTagName( "div" ); for ( var i = 0; i < Selection.length; i++ ) { if ( hasClass( Selection[i], "button" ) ) { var input = Selection[i].id.split("_"); var name = input[0]; var val = input[1]; var func = input[2]; var fntSize = input[3]; var Button = document.createElement( "span" ); Button.style.fontWeight = "normal"; Button.style.fontSize = fntSize+"%"; Button.style.textAlign = "center"; Button.style.width = "12em"; var ButtonLink = document.createElement( "a" ); ButtonLink.style.color = Selection[i].style.color; ButtonLink.setAttribute( "id", name ); var ButtonText = document.createTextNode( name ); ButtonLink.setAttribute( "href", "javascript:"+func+"('" +val.toLowerCase()+"')" ); ButtonLink.appendChild( ButtonText ); Button.appendChild( document.createTextNode( "[" ) ); Button.appendChild( ButtonLink ); Button.appendChild( document.createTextNode( "]" ) ); Selection[i].insertBefore( Button, Selection[i].childNodes[0] ); } } } addOnloadHook( createButtons ); function firstUpperCase( stringVar ) { stringVar = stringVar.toUpperCase().charAt(0) + stringVar.substring(1); return stringVar; } /* function googleTranslateTab() { addPortletLink('p-cactions', 'http://translate.google.com/translate?hl=en&sl=de&u=http://www.shadowhelix.de/' + wgPageName, 'Google Translate!', 'ca-last', 'Übersetzung der Seite'); } addOnloadHook( googleTranslateTab ); */ /* Ausblendfunktionen */ function displayAll() { var objects = document.getElementsByTagName('tr'); for (var i=0; i < objects.length; i++) { if (customJahresartikel == 'opac') { objects[i].style.opacity = ''; objects[i].style.filter = ''; } else { objects[i].style.display = '' } } } function displayTheme( theme ) { displayAll(); var objects = document.getElementsByTagName('tr'); for (var i=0; i < objects.length; i++) { var keys = String(objects[i].getAttribute('id')); if (keys.search(theme) != -1) {} else { if (customJahresartikel == 'opac') { objects[i].style.opacity = '0.3'; objects[i].style.filter = 'alpha(opacity=30)'; } else { objects[i].style.display = 'none' } } } } /* Test if an element has a certain class * * Copied from Wikipedia */ var hasClass = (function () { var reCache = {}; return function (element, className) { return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className); }; })();