Keine Bearbeitungszusammenfassung |
KKeine Bearbeitungszusammenfassung |
||
Zeile 57: | Zeile 57: | ||
else if ($("body").hasClass("cat-Ampel-blau")) { var color = 'blau'; var ainfohtml = "<h2>Farbe: Blau</h2><h3>Wird in Kampagne genutzt</h3>"; var ahandyinfohtml = "<p>Farbe: Blau</p>";} | else if ($("body").hasClass("cat-Ampel-blau")) { var color = 'blau'; var ainfohtml = "<h2>Farbe: Blau</h2><h3>Wird in Kampagne genutzt</h3>"; var ahandyinfohtml = "<p>Farbe: Blau</p>";} | ||
else { var color = 'none';} | else { var color = 'none';} | ||
//var ampelhtml = "<div class='tright ampel-box'><a href='https://wiki. | //var ampelhtml = "<div class='tright ampel-box'><a href='https://wiki.athyria.de/index.php/Ampelsystem' title='Details zum Athyria Ampelsystem'><img src='https://wiki.athyria.de/resources/assets/Ampel-" + color + ".png' alt='Ampel " + color + "'></a></div>"; | ||
var ampelhtml = "<div class='tright ampel-box'><div class='ampel-box-info'><h1><a href='https://wiki. | var ampelhtml = "<div class='tright ampel-box'><div class='ampel-box-info'><h1><a href='https://wiki.athyria.de/index.php/Ampelsystem' title='Details zum Ampelsystem'>Ampelsystem</a></h1>" + ainfohtml + "</div><a class='ampel-link' href='https://wiki.athyria.de/index.php/Ampelsystem' title='Details zum Athyria Ampelsystem'><img src='https://wiki.athyria.de/resources/assets/Ampel-" + color + ".png' alt='Ampel " + color + "'></a><div class='ampel-box-handy'>" + ahandyinfohtml +"</div></div>"; | ||
if (color == 'none') {} | if (color == 'none') {} | ||
Zeile 75: | Zeile 75: | ||
jQuery(document).ready(function($) { | jQuery(document).ready(function($) { | ||
if ($("body").hasClass("rootpage-Hauptseite")) { | if ($("body").hasClass("rootpage-Hauptseite")) { | ||
$('<img />',{ src: 'https://wiki. | $('<img />',{ src: 'https://wiki.athyria.de/images/6/6f/Mythopedia-Logo-animated.gif'}); | ||
$(".category-container-logo-img").hover( | $(".category-container-logo-img").hover( | ||
function() { | function() { | ||
var image = new Image(); | var image = new Image(); | ||
image.src = "https://wiki. | image.src = "https://wiki.athyria.de/images/6/6f/Mythopedia-Logo-animated.gif"+"?a="+Math.random(); | ||
$(this).attr("srcset", ""); | $(this).attr("srcset", ""); | ||
$(this).attr("src", image.src); | $(this).attr("src", image.src); | ||
}, | }, | ||
function() { | function() { | ||
$(this).attr("src", "https://wiki. | $(this).attr("src", "https://wiki.athyria.de/images/a/a6/Mythopedia-Logo-static.png"); | ||
} | } | ||
); | ); | ||
} | } | ||
}); | }); |
Aktuelle Version vom 13. September 2021, 19:44 Uhr
/* Das folgende JavaScript wird für alle Benutzer geladen. */ /** * Adds CSS classes to the body tag based on the categories this page belongs to * * @source https://www.mediawiki.org/wiki/Snippets/Style_pages_based_on_categories * @revision 2016-01-18 */ //Script für die Kategorie-Symbole auf den Seiten (function($, mw) { var fn = function() { var cats = mw.config.get('wgCategories'), newClasses; if (cats) { newClasses = $.map(cats, function(el) { return 'cat-' + encodeURIComponent(el.replace(/[ .]/g, '_')).replace(/%/g, '_'); }).join(' '); $(document.body).addClass(newClasses); } }; if (document.body) { fn(); } else { $(fn); } })(jQuery, mw); //Script um Kategorie-Symbole einzusetzen jQuery(document).ready(function($) { var htmlcatoutput = "<span class='category-box'>"; //Check Wiki or Mitraspera a.v. if ($("body").hasClass("cat-Mitraspera_e_V_")) { var htmlcatoutput = htmlcatoutput + "<span class='category-box-mitrasperaev' title='Mitraspera e.V.'></span>";} else if ($("body").hasClass("cat-Wiki")) { var htmlcatoutput = htmlcatoutput + "<span class='category-box-mitrasperaev' title='Mitraspera e.V.'></span>";} else { } //Check Athyria if ($("body").hasClass("cat-Athyria")) { var htmlcatoutput = htmlcatoutput + "<span class='category-box-athyria' title='Athyria'></span>";} else if ($("body").hasClass("cat-IT-Texte_Athyrias")) { var htmlcatoutput = htmlcatoutput + "<span class='category-box-athyria' title='Athyria'></span>";} else { } //Check Mitraspera if ($("body").hasClass("cat-Mitraspera")) { var htmlcatoutput = htmlcatoutput + "<span class='category-box-mitraspera' title='Mitraspera'></span>";} else if ($("body").hasClass("cat-IT-Texte_Mitraspera")) { var htmlcatoutput = htmlcatoutput + "<span class='category-box-mitraspera' title='Mitraspera'></span>";} else if ($("body").hasClass("cat-Liedgut_Mitraspera")) { var htmlcatoutput = htmlcatoutput + "<span class='category-box-mitraspera' title='Mitraspera'></span>";} else { } //output //var categoryhtml = "<span class='category-box'><span class='category-box-athyria' title='Athyria'></span> <span class='category-box-mitraspera' title='Mitraspera'></span> <span class='category-box-mitrasperaev' title='Mitraspera e.V.'></span></span>"; var htmlcatoutput = htmlcatoutput + "</span>"; $( "div.firstHeading-container h1#firstHeading:first" ).prepend(htmlcatoutput); }); //Script für die Symbole des Ampelsystems jQuery(document).ready(function($) { if ($("body").hasClass("cat-Ampel-rot")) { var color = 'rot'; var ainfohtml = "<h2>Farbe: Rot</h2><h3>Derzeit keine Bearbeitung</h3>"; var ahandyinfohtml = "<p>Farbe: Rot</p>";} else if ($("body").hasClass("cat-Ampel-gelb")) { var color = 'gelb'; var ainfohtml = "<h2>Farbe: Gelb</h2><h3>Bearbeitung nach Rücksprache</h3>"; var ahandyinfohtml = "<p>Farbe: Gelb</p>";} else if ($("body").hasClass("cat-Ampel-gruen")) { var color = 'gruen'; var ainfohtml = "<h2>Farbe: Grün</h2><h3>Bearbeitung möglich</h3>"; var ahandyinfohtml = "<p>Farbe: Grün</p>";} else if ($("body").hasClass("cat-Ampel-blau")) { var color = 'blau'; var ainfohtml = "<h2>Farbe: Blau</h2><h3>Wird in Kampagne genutzt</h3>"; var ahandyinfohtml = "<p>Farbe: Blau</p>";} else { var color = 'none';} //var ampelhtml = "<div class='tright ampel-box'><a href='https://wiki.athyria.de/index.php/Ampelsystem' title='Details zum Athyria Ampelsystem'><img src='https://wiki.athyria.de/resources/assets/Ampel-" + color + ".png' alt='Ampel " + color + "'></a></div>"; var ampelhtml = "<div class='tright ampel-box'><div class='ampel-box-info'><h1><a href='https://wiki.athyria.de/index.php/Ampelsystem' title='Details zum Ampelsystem'>Ampelsystem</a></h1>" + ainfohtml + "</div><a class='ampel-link' href='https://wiki.athyria.de/index.php/Ampelsystem' title='Details zum Athyria Ampelsystem'><img src='https://wiki.athyria.de/resources/assets/Ampel-" + color + ".png' alt='Ampel " + color + "'></a><div class='ampel-box-handy'>" + ahandyinfohtml +"</div></div>"; if (color == 'none') {} else { if ($( "div.inhalt-box" ).length > 0) { $( "div.inhalt-box:first" ).after( ampelhtml ); } else { $( ".mw-parser-output section:first" ).prepend( ampelhtml ); } } }); //Script für die Animation des Mythopedia-Logos nur auf der Startseite jQuery(document).ready(function($) { if ($("body").hasClass("rootpage-Hauptseite")) { $('<img />',{ src: 'https://wiki.athyria.de/images/6/6f/Mythopedia-Logo-animated.gif'}); $(".category-container-logo-img").hover( function() { var image = new Image(); image.src = "https://wiki.athyria.de/images/6/6f/Mythopedia-Logo-animated.gif"+"?a="+Math.random(); $(this).attr("srcset", ""); $(this).attr("src", image.src); }, function() { $(this).attr("src", "https://wiki.athyria.de/images/a/a6/Mythopedia-Logo-static.png"); } ); } });