MediaWiki:CustomDrilldown.js
Aus Joachim Camerarius (1500-1574)
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
function drilldownswitcher() { $('#drilldown-switch:contains("Alle Filter ausklappen")').length ? ($(".drilldown-filter-values:has(a)").css("display", "block"), $(".drilldown-values-toggle").each(function() { $("img").each(function() { $(this).attr("src", $(this).attr("src").replace("right-arrow.png", "down-arrow.png")) }) }), document.getElementById("drilldown-switch").innerHTML = 'Alle Filter einklappen <span class="fa fa-minus"></span>') : $('#drilldown-switch:contains("Alle Filter einklappen")').length && ($(".drilldown-filter-values:has(a)").css("display", "none"), $(".drilldown-values-toggle").each(function() { $("img").each(function() { $(this).attr("src", $(this).attr("src").replace("down-arrow.png", "right-arrow.png")) }) }), document.getElementById("drilldown-switch").innerHTML = 'Alle Filter ausklappen <span class="fa fa-plus"></span>') } $(document).ready(function () { /** Add custom elements to Drilldown **/ $('<h3 class="drilldown-pre-filters">2. Verfügbare Filteroptionen</h3>').insertBefore("#drilldown-applicable-filters"), $('<h3 class="drilldown-post-filters">3. Anwendung der Filter</h3>').insertAfter("#drilldown-applicable-filters"), $('<html><div class="drilldown-btn-wrapper"><a class="btn primary-btn" href="javascript:;" onclick="drilldownswitcher()" id="drilldown-switch">Show all filters <i class="fa fa-plus"></i></a></div></html>').insertBefore("#drilldown-filters"); $(".drilldown-values-toggle").each(function () { $("img").each(function () { $(this).attr("src", $(this).attr("src").replace("down-arrow.png", "right-arrow.png")); }); }); /** Unblur Drilldown content after custom elements were added **/ $(".drilldown-results").css({ "-webkit-filter": "blur(0)", "-moz-filter": "blur(0)", "-o-filter": "blur(0)", "-ms-filter": "blur(0)", filter: "blur(0)" }) $(".drilldown-filter-values:has(a)").css("display", "none") /** Drilldown Toggle **/ $(".drilldown-values-toggle").each(function () { $("img").each(function () { $(this).attr("src", $(this).attr("src").replace("down-arrow.png", "right-arrow.png")) }) }) })