MediaWiki:Common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Änderung 383476 von Nachteule (Diskussion) wurde rückgängig gemacht.) |
(einmal zur kontrolle zwischenspeichern ...) |
||
| Zeile 15: | Zeile 15: | ||
encodeURIComponent(title) + '&action=raw&ctype=text/javascript"></script>'); | encodeURIComponent(title) + '&action=raw&ctype=text/javascript"></script>'); | ||
} | } | ||
| − | |||
| − | + | //================================================================================ | |
| − | + | // dragobject wird z.B. in [[Projekt:Gummistiefel]] verwendet | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | // dragobject wird in [[Projekt:Gummistiefel]] verwendet | ||
// alles mit class='jstest' ist dragbar | // alles mit class='jstest' ist dragbar | ||
| Zeile 82: | Zeile 59: | ||
dragobject.initialize(); | dragobject.initialize(); | ||
| + | |||
| + | //== ENDE hilfsfunktionen ===================================== | ||
| − | + | /* Seiten mit eigenen Skins */ | |
| − | + | var skinnedArticles = { | |
| − | + | "Kamelopedia:Bildsuche": "MediaWiki:Skin/Kamelopedia:Bildsuche.css", | |
| + | "Pseudolink": "MediaWiki:Skin/Pseudolink.css", | ||
| + | "Spezial:Hochladen": "MediaWiki:Skin/Spezial:Hochladen.css" | ||
| + | }; | ||
| + | var articleCSS = skinnedArticles[wgPageName.replace(/_/g, " ")]; | ||
| + | if (articleCSS) addCSS(articleCSS); | ||
| + | |||
| + | |||
| + | /* Seiten mit eigenen Skripts */ | ||
| + | var scriptedArticles = { | ||
| + | "Spezial:Hochladen": "MediaWiki:Skin/Spezial:Hochladen.js", | ||
| + | "Kamelopedia:Bildsuche": "MediaWiki:Skin/Kamelopedia:Bildsuche.js", | ||
| + | "Kamelopedia:Chat": "Hilfe:Javachat.js" | ||
| + | }; | ||
| + | |||
| + | var articleJS = scriptedArticles[wgPageName.replace(/_/g, " ")]; | ||
| + | if (articleJS) { | ||
| + | // Prototype nur laden, wenn's was zu scripten gibt | ||
| + | addJS("MediaWiki:Prototype.js"); | ||
| + | addJS(articleJS); | ||
| + | } | ||
| + | |||
//================================================================================ | //================================================================================ | ||
| − | // | + | // Bild-Box-Lizenz-Gedöns für Datei-Seitenbearbeitung |
| − | if ( (wgAction == 'edit' || wgAction == 'submit' | + | if (wgNamespaceNumber == 6 ) && (wgAction == 'edit' || wgAction == 'submit') { |
addCSS("MediaWiki:Skin/Spezial:Hochladen.css"); | addCSS("MediaWiki:Skin/Spezial:Hochladen.css"); | ||
| + | // benötigt auch Prototype ... | ||
| + | addJS("MediaWiki:Prototype.js"); | ||
addJS("MediaWiki:Skin/Spezial:Hochladen.js"); | addJS("MediaWiki:Skin/Spezial:Hochladen.js"); | ||
} | } | ||
| + | |||
| + | // lade [[Hilfe:Edittools.js]], wenn Seite bearbeitet wird | ||
if (wgAction == 'edit' || wgAction == 'submit') { | if (wgAction == 'edit' || wgAction == 'submit') { | ||
addJS("Hilfe:Edittools.js"); | addJS("Hilfe:Edittools.js"); | ||
} | } | ||
| − | + | ||
| − | |||
// Tausche [[Special:Specialpages]] gegen [[Kamelopedia:Spezialseiten]] | // Tausche [[Special:Specialpages]] gegen [[Kamelopedia:Spezialseiten]] | ||
| − | |||
addOnloadHook(function() { | addOnloadHook(function() { | ||
document.getElementById("t-specialpages").innerHTML = '<a href="/index.php/Kamelopedia:Spezialseiten">Spezialitäten</a>'; | document.getElementById("t-specialpages").innerHTML = '<a href="/index.php/Kamelopedia:Spezialseiten">Spezialitäten</a>'; | ||
}); | }); | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
//Gedudel auf [[Aufzug]] und [[Gedudel]] und [[WiKa-Sekte]] | //Gedudel auf [[Aufzug]] und [[Gedudel]] und [[WiKa-Sekte]] | ||
| − | |||
if (wgPageName == 'Aufzug' || wgPageName == 'Gedudel' || wgPageName == 'WiKa-Sekte' ) { | if (wgPageName == 'Aufzug' || wgPageName == 'Gedudel' || wgPageName == 'WiKa-Sekte' ) { | ||
document.write('<embed src="http://kamelopedia.mormo.org/images/c/cb/Aufzug.mid" autostart="true" type="audio/midi" loop="true" hidden="true" height="0" width="0">'); | document.write('<embed src="http://kamelopedia.mormo.org/images/c/cb/Aufzug.mid" autostart="true" type="audio/midi" loop="true" hidden="true" height="0" width="0">'); | ||
} | } | ||
| − | |||
//[[Popupblocker]] | //[[Popupblocker]] | ||
| − | |||
if (wgPageName == 'Popupblocker') { | if (wgPageName == 'Popupblocker') { | ||
alert("Ihr Popupblocker ist aktiviert"); | alert("Ihr Popupblocker ist aktiviert"); | ||
} | } | ||
| − | |||
// Bilder bekommen einen "ähnliche Bilder"-Link und auch die Tagwolke | // Bilder bekommen einen "ähnliche Bilder"-Link und auch die Tagwolke | ||
| − | if ( | + | if ( wgNamespaceNumber == 6 || wgPageName == "Kamelopedia:Bildtagwolke") |
addJS("MediaWiki:Skin/Kamelopedia:Bildsuche/bild.js"); | addJS("MediaWiki:Skin/Kamelopedia:Bildsuche/bild.js"); | ||
| − | |||
// Skin für Forum | // Skin für Forum | ||
| − | + | if (wgNamespaceNumber == 102) { | |
| − | |||
addCSS("MediaWiki:Skin/Forum.css"); | addCSS("MediaWiki:Skin/Forum.css"); | ||
} | } | ||
| − | |||
// Skin für Archiv | // Skin für Archiv | ||
| − | |||
if (wgNamespaceNumber == 104 || wgNamespaceNumber == 105) { | if (wgNamespaceNumber == 104 || wgNamespaceNumber == 105) { | ||
addCSS("MediaWiki:Skin/Archiv.css"); | addCSS("MediaWiki:Skin/Archiv.css"); | ||
} | } | ||
| − | |||
// Skin und script für Kamelionary | // Skin und script für Kamelionary | ||
| − | |||
if (wgNamespaceNumber == 106 || wgNamespaceNumber == 107) { | if (wgNamespaceNumber == 106 || wgNamespaceNumber == 107) { | ||
addCSS("MediaWiki:Skin/Kamelionary.css"); | addCSS("MediaWiki:Skin/Kamelionary.css"); | ||
| Zeile 279: | Zeile 265: | ||
// Nach dem Laden des Fensters folgendes Ausführen: | // Nach dem Laden des Fensters folgendes Ausführen: | ||
addOnloadHook(makeAusklapp); | addOnloadHook(makeAusklapp); | ||
| − | |||
| − | / | + | // TEST WiMus GaGA-Automatismus |
| + | if (wgPageName == 'Forum:Unendliche_GaGA-Wahlen_/_neue_Wahl-Statuten_/_neue_Vorlagen' || | ||
| + | wgPageName == 'Kamel:WiMu/GaGA-Wahl-Test/2' || | ||
| + | wgPageName == 'Datei:Gaga-Test.gif' || | ||
| + | wgPageName == 'Datei:Gaga-Test.png' || | ||
| + | wgPageName == 'WiMu/GaGA-Wahl-Test/1' || | ||
| + | wgPageName == 'Vorlage:GaGA' || | ||
| + | wgPageName == 'Heiland_Sellarrie') { | ||
| + | addJS("MediaWiki:Prototype.js"); | ||
| + | addJS("MediaWiki:Skin/Test_zirkelklapp.js"); | ||
| + | } | ||
| − | + | // ================================================================================ | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | // ================================================================================ | ||
// username template | // username template | ||
| Zeile 378: | Zeile 330: | ||
// sitenotice | // sitenotice | ||
| − | // Die sitenotice per Klick verstecken | + | // Die sitenotice per Klick verstecken (wenn eine wegklick-notice vorhanden) |
| − | + | ||
| − | + | if (document.getElementById("siteNoticeSub")) { | |
| − | var siteNoticeTs; // DPL-Timestamp des letzten Edits | + | var siteNoticeTs; // DPL-Timestamp des letzten Edits |
| − | + | function hideSitenotice() { | |
| − | |||
| − | function hideSitenotice() { | ||
if (document.getElementById("siteNoticeSub")) { | if (document.getElementById("siteNoticeSub")) { | ||
if (document.getElementById("siteNoticeTime") != null) { | if (document.getElementById("siteNoticeTime") != null) { | ||
| Zeile 390: | Zeile 340: | ||
} | } | ||
| − | + | if (document.cookie.search(new RegExp("dontshowsitenotice="+siteNoticeTs) ) != -1) { | |
| − | + | document.getElementById("siteNoticeInner").style.display = "none"; | |
machdiesiteNoticewegduSau() | machdiesiteNoticewegduSau() | ||
| − | + | } else { | |
| − | + | document.getElementById("siteNoticeSub").innerHTML = '<a href="javascript:machdiesiteNoticewegduSau()" style="position:absolute; right:0; top:9px; font-size:0.8em;">[Sitenotice verbergen]</a>'; | |
| − | + | } | |
| − | + | } | |
| − | + | } | |
| − | |||
| − | function machdiesiteNoticewegduSau() { | + | function machdiesiteNoticewegduSau() { |
document.getElementById("siteNoticeSub").innerHTML = '<a href="javascript:gabsdanichtmalnesiteNotice()" style="position:absolute; right:0; top:9px; font-size:0.8em;">[Sitenotice anzeigen]</a>'; | document.getElementById("siteNoticeSub").innerHTML = '<a href="javascript:gabsdanichtmalnesiteNotice()" style="position:absolute; right:0; top:9px; font-size:0.8em;">[Sitenotice anzeigen]</a>'; | ||
| − | + | document.getElementById("siteNoticeInner").style.display = "none"; | |
var datum = new Date(); | var datum = new Date(); | ||
var ablauf = datum.getTime() + (265 * 24 * 60 * 60 * 1000); | var ablauf = datum.getTime() + (265 * 24 * 60 * 60 * 1000); | ||
datum.setTime(ablauf); | datum.setTime(ablauf); | ||
| − | + | document.cookie = "dontshowsitenotice="+siteNoticeTs+"; path=/; expires="+datum.toGMTString(); | |
} | } | ||
| − | function gabsdanichtmalnesiteNotice() { | + | function gabsdanichtmalnesiteNotice() { |
document.getElementById("siteNoticeSub").innerHTML = '<a href="javascript:machdiesiteNoticewegduSau()" style="position:absolute; right:0; top:9px; font-size:0.8em;">[Sitenotice verbergen]</a>' | document.getElementById("siteNoticeSub").innerHTML = '<a href="javascript:machdiesiteNoticewegduSau()" style="position:absolute; right:0; top:9px; font-size:0.8em;">[Sitenotice verbergen]</a>' | ||
| − | + | document.getElementById("siteNoticeInner").style.display = "block"; | |
| − | + | document.cookie = "dontshowsitenotice=never; path=/; expires=Thu, 01-Jan-1970 00:00:01 GMT"; | |
| − | + | } | |
| + | addOnloadHook(hideSitenotice); | ||
| + | } | ||
| + | |||
// Der doofe server stürzt dauernd ab, wenn das script da unten läuft ... | // Der doofe server stürzt dauernd ab, wenn das script da unten läuft ... | ||
Version vom 26. Februar 2010, 16:53 Uhr
//============================================================
// hilfsfunktionen
/** CSS einbinden */
function addCSS(title) {
document.write(
'<style type="text/css">/*<![CDATA[*/ @import "/index.php?title=' +
encodeURIComponent(title) + '&action=raw&ctype=text/css"; /*]]>*/</style>');
}
/** JS einbinden */
function addJS(title) {
document.write(
'<script type="text/javascript" src="/index.php?title=' +
encodeURIComponent(title) + '&action=raw&ctype=text/javascript"></script>');
}
//================================================================================
// dragobject wird z.B. in [[Projekt:Gummistiefel]] verwendet
// alles mit class='jstest' ist dragbar
/***********************************************
* Drag and Drop Script: © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
var dragobject={
z: 0, x: 0, y: 0, offsetx : null, offsety : null, targetobj : null, dragapproved : 0,
initialize:function(){
document.onmousedown=this.drag
document.onmouseup=function(){this.dragapproved=0}
},
drag:function(e){
var evtobj=window.event? window.event : e
this.targetobj=window.event? event.srcElement : e.target
if (this.targetobj.className=="jstest"){
this.dragapproved=1
if (isNaN(parseInt(this.targetobj.style.left))){this.targetobj.style.left=0}
if (isNaN(parseInt(this.targetobj.style.top))){this.targetobj.style.top=0}
this.offsetx=parseInt(this.targetobj.style.left)
this.offsety=parseInt(this.targetobj.style.top)
this.x=evtobj.clientX
this.y=evtobj.clientY
if (evtobj.preventDefault)
evtobj.preventDefault()
document.onmousemove=dragobject.moveit
}
},
moveit:function(e){
var evtobj=window.event? window.event : e
if (this.dragapproved==1){
this.targetobj.style.left=this.offsetx+evtobj.clientX-this.x+"px"
this.targetobj.style.top=this.offsety+evtobj.clientY-this.y+"px"
return false
}
}
}
dragobject.initialize();
//== ENDE hilfsfunktionen =====================================
/* Seiten mit eigenen Skins */
var skinnedArticles = {
"Kamelopedia:Bildsuche": "MediaWiki:Skin/Kamelopedia:Bildsuche.css",
"Pseudolink": "MediaWiki:Skin/Pseudolink.css",
"Spezial:Hochladen": "MediaWiki:Skin/Spezial:Hochladen.css"
};
var articleCSS = skinnedArticles[wgPageName.replace(/_/g, " ")];
if (articleCSS) addCSS(articleCSS);
/* Seiten mit eigenen Skripts */
var scriptedArticles = {
"Spezial:Hochladen": "MediaWiki:Skin/Spezial:Hochladen.js",
"Kamelopedia:Bildsuche": "MediaWiki:Skin/Kamelopedia:Bildsuche.js",
"Kamelopedia:Chat": "Hilfe:Javachat.js"
};
var articleJS = scriptedArticles[wgPageName.replace(/_/g, " ")];
if (articleJS) {
// Prototype nur laden, wenn's was zu scripten gibt
addJS("MediaWiki:Prototype.js");
addJS(articleJS);
}
//================================================================================
// Bild-Box-Lizenz-Gedöns für Datei-Seitenbearbeitung
if (wgNamespaceNumber == 6 ) && (wgAction == 'edit' || wgAction == 'submit') {
addCSS("MediaWiki:Skin/Spezial:Hochladen.css");
// benötigt auch Prototype ...
addJS("MediaWiki:Prototype.js");
addJS("MediaWiki:Skin/Spezial:Hochladen.js");
}
// lade [[Hilfe:Edittools.js]], wenn Seite bearbeitet wird
if (wgAction == 'edit' || wgAction == 'submit') {
addJS("Hilfe:Edittools.js");
}
// Tausche [[Special:Specialpages]] gegen [[Kamelopedia:Spezialseiten]]
addOnloadHook(function() {
document.getElementById("t-specialpages").innerHTML = '<a href="/index.php/Kamelopedia:Spezialseiten">Spezialitäten</a>';
});
//Gedudel auf [[Aufzug]] und [[Gedudel]] und [[WiKa-Sekte]]
if (wgPageName == 'Aufzug' || wgPageName == 'Gedudel' || wgPageName == 'WiKa-Sekte' ) {
document.write('<embed src="http://kamelopedia.mormo.org/images/c/cb/Aufzug.mid" autostart="true" type="audio/midi" loop="true" hidden="true" height="0" width="0">');
}
//[[Popupblocker]]
if (wgPageName == 'Popupblocker') {
alert("Ihr Popupblocker ist aktiviert");
}
// Bilder bekommen einen "ähnliche Bilder"-Link und auch die Tagwolke
if ( wgNamespaceNumber == 6 || wgPageName == "Kamelopedia:Bildtagwolke")
addJS("MediaWiki:Skin/Kamelopedia:Bildsuche/bild.js");
// Skin für Forum
if (wgNamespaceNumber == 102) {
addCSS("MediaWiki:Skin/Forum.css");
}
// Skin für Archiv
if (wgNamespaceNumber == 104 || wgNamespaceNumber == 105) {
addCSS("MediaWiki:Skin/Archiv.css");
}
// Skin und script für Kamelionary
if (wgNamespaceNumber == 106 || wgNamespaceNumber == 107) {
addCSS("MediaWiki:Skin/Kamelionary.css");
addJS("MediaWiki:Skin/Kamelionary.js");
}
// ================================================================================
// Ein- und Ausblenden per Javascript
// mit den folgenden Funktionen lässt sich ein div-Konstrukt in ein Einblende-Ausblende-Ding verwandeln
//
// Variante 1 (Klick irgendwo blendet ein oder aus):
// <div class="klapp">
// <div class="klapp_t">Titel im ausgeblendeten Zustand</div>
// <div class="klapp_e">Titel im ausgeblendeten Zustand</div>
// <div class="klapp_i">Einzublendender Inhalt</div>
// </div>
//
// Variante 2 (ein- und ausblenden nur mit Links):
// <div class="klapp_x">
// <div class="klapp_t">Titel im ausgeblendeten Zustand mit <span class="klapp">Einblendelink</span></div>
// <div class="klapp_e">Titel im ausgeblendeten Zustand mit <span class="klapp">Ausblendelink</span></div>
// <div class="klapp_i">Einzublendender Inhalt</div>
// </div>
function ausklapp( element )
{
var klapp_i = null;
var klapp_e = null;
var klapp_t = null;
for (i=0; i<element.childNodes.length; i++)
{
if( element.childNodes[i].nodeType == 1 )
{
if ( element.childNodes[i].className == "klapp_i" )
klapp_i = element.childNodes[i];
else if ( element.childNodes[i].className == "klapp_t" )
klapp_t = element.childNodes[i];
else if ( element.childNodes[i].className == "klapp_e" )
klapp_e = element.childNodes[i];
}
if ( klapp_i && klapp_t && klapp_e )
break;
}
if( klapp_i.style.display != "none")
{
klapp_i.style.display = "none";
klapp_e.style.display = "none";
klapp_t.style.display = "block";
}
else
{
klapp_i.style.display = "block";
klapp_e.style.display = "block";
klapp_t.style.display = "none";
}
}
function getKlappDiv( obj )
{
while ( obj && obj.parentNode && obj.className != "klapp_x" )
obj = obj.parentNode;
return obj;
}
// Event-Handler für alle class="klapp"-Objekte zuweisen
function makeAusklapp()
{
// klapp-div-Rahmen
var a = document.getElementsByTagName("div");
for ( div=0; div<a.length; div++ )
{
if ( a[div].className == "klapp" )
{
//Leider nicht IE-Kompatibel:
//var f = function () { ausklapp(this) };
//addEvent( a[div], "click", f , false );
//stattdessen:
a[div].onclick = function () { ausklapp(this);}
}
}
// klapp-spans-Rahmen als Link-Ersatz
var a = document.getElementsByTagName("span");
for ( span=0; span<a.length; span++ )
{
if ( a[span].className == "klapp" )
{
a[span].onclick = function () { ausklapp(getKlappDiv( this ));}
}
}
urlKlapp();
}
/*
* liest aus der URL aus, ob ein bestimmtes Objekt ausgeklappt werden soll.
* angegeben werden kann eine oder mehrere Objekt-Id:
* index.php?title=Hauptseite&klapp=id1/id2/id3
*/
function urlKlapp()
{
var arg = location.href;
var reg = new RegExp(/[?&]klapp=(.*?)($|[?&])/);
arg = arg.match(reg);
if( arg == null )
return;
arg = arg[0].replace(reg,"$1");
if( arg == "" )
return;
arg = arg.split("/");
for(var i=0; i<arg.length; i++)
{
try
{
ausklapp(document.getElementById(arg[i]));
}
catch(e)
{
}
}
}
// Nach dem Laden des Fensters folgendes Ausführen:
addOnloadHook(makeAusklapp);
// TEST WiMus GaGA-Automatismus
if (wgPageName == 'Forum:Unendliche_GaGA-Wahlen_/_neue_Wahl-Statuten_/_neue_Vorlagen' ||
wgPageName == 'Kamel:WiMu/GaGA-Wahl-Test/2' ||
wgPageName == 'Datei:Gaga-Test.gif' ||
wgPageName == 'Datei:Gaga-Test.png' ||
wgPageName == 'WiMu/GaGA-Wahl-Test/1' ||
wgPageName == 'Vorlage:GaGA' ||
wgPageName == 'Heiland_Sellarrie') {
addJS("MediaWiki:Prototype.js");
addJS("MediaWiki:Skin/Test_zirkelklapp.js");
}
// ================================================================================
// username template
/**
* Username replace function ([[Vorlage:USERNAME]])
* Inserts user name into <span id="insertusername"></span>
* By [[wikia:User:Splarka|Splarka]]
*/
addOnloadHook(function() {
if (typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace) return;
if (!document.getElementById('pt-userpage')) return;
var spans = document.getElementsByTagName("span");
for (var i=0; i<spans.length; i++) {
var span = spans[i];
if (span.getAttribute('id') == "insertusername") {
span.innerHTML = wgUserName;
}
}
});
// ================================================================================
// FDP-Version & Zitierhilfe, nur mal so zum Spass...
if (wgNamespaceNumber == 0 || wgNamespaceNumber == 106) {
addOnloadHook(function addFDPVersion(){
var aZit = document.createElement("a");
aZit.title = "Seite zitieren";
aZit.href = wgServer + "/index.php/" + "Hilfe:Zitierhilfe";
aZit.appendChild(document.createTextNode("Seite zitieren"));
var aPDF = document.createElement("a");
aPDF.title = "FDP-Version";
aPDF.href = wgServer + "/index.php/" + "PDF?klapp=pdfgen";
aPDF.appendChild(document.createTextNode("FDP-Version"));
var LiZit = document.createElement("li");
LiZit.style.whiteSpace = "nowrap";
LiZit.appendChild(aZit);
var LiPDF = document.createElement("li");
LiPDF.style.whiteSpace = "nowrap";
LiPDF.appendChild(aPDF);
var ToolboxUl = document.getElementById("p-tb").getElementsByTagName("ul");
ToolboxUl[0].appendChild(LiPDF);
ToolboxUl[0].appendChild(LiZit);
})
};
// ================================================================================
// sitenotice
// Die sitenotice per Klick verstecken (wenn eine wegklick-notice vorhanden)
if (document.getElementById("siteNoticeSub")) {
var siteNoticeTs; // DPL-Timestamp des letzten Edits
function hideSitenotice() {
if (document.getElementById("siteNoticeSub")) {
if (document.getElementById("siteNoticeTime") != null) {
siteNoticeTs = escape( document.getElementById("siteNoticeTime").innerHTML );
}
if (document.cookie.search(new RegExp("dontshowsitenotice="+siteNoticeTs) ) != -1) {
document.getElementById("siteNoticeInner").style.display = "none";
machdiesiteNoticewegduSau()
} else {
document.getElementById("siteNoticeSub").innerHTML = '<a href="javascript:machdiesiteNoticewegduSau()" style="position:absolute; right:0; top:9px; font-size:0.8em;">[Sitenotice verbergen]</a>';
}
}
}
function machdiesiteNoticewegduSau() {
document.getElementById("siteNoticeSub").innerHTML = '<a href="javascript:gabsdanichtmalnesiteNotice()" style="position:absolute; right:0; top:9px; font-size:0.8em;">[Sitenotice anzeigen]</a>';
document.getElementById("siteNoticeInner").style.display = "none";
var datum = new Date();
var ablauf = datum.getTime() + (265 * 24 * 60 * 60 * 1000);
datum.setTime(ablauf);
document.cookie = "dontshowsitenotice="+siteNoticeTs+"; path=/; expires="+datum.toGMTString();
}
function gabsdanichtmalnesiteNotice() {
document.getElementById("siteNoticeSub").innerHTML = '<a href="javascript:machdiesiteNoticewegduSau()" style="position:absolute; right:0; top:9px; font-size:0.8em;">[Sitenotice verbergen]</a>'
document.getElementById("siteNoticeInner").style.display = "block";
document.cookie = "dontshowsitenotice=never; path=/; expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
addOnloadHook(hideSitenotice);
}
// Der doofe server stürzt dauernd ab, wenn das script da unten läuft ...
window.onload = function()
{
if (document.getElementById("ServerError")) {
document.getElementsByTagName("body")[0].style.backgroundColor = "#ffffff";
document.getElementsByTagName("body")[0].style.backgroundImage = "none";
document.getElementsByTagName("body")[0].style.fontSize = "12px";
document.getElementsByTagName("body")[0].style.padding = "10px";
document.getElementsByTagName("body")[0].innerHTML = document.getElementById("ServerError").innerHTML;
}
}
/* Artikel-Review-Autovervollständigungs-script */
if(wgAction == 'edit' && window.location.href.split('&')[2] == 'articlereview=true') {
var hoecker = '~~';
templateCode = '{{Artikeltest\r'
+ '| Humor/pkt =\r'
+ '| Humor/txt =\r'
+ '| Konzept/pkt =\r'
+ '| Konzept/txt =\r'
+ '| Formatierung/pkt =\r'
+ '| Formatierung/txt =\r'
+ '| Bilder/pkt =\r'
+ '| Bilder/txt =\r'
+ '| Gesamt/txt =\r'
+ '| ' + hoecker + hoecker + '\r'
+ '}}'
window.onload = function() {
originalSource = document.getElementById('wpTextbox1').value;
newSource = originalSource.replace(/\{\{Artikeltest\}\}/g, templateCode);
document.getElementById('wpTextbox1').value = newSource;
}
}