MediaWiki: CustomDrilldown.js: Unterschied zwischen den Versionen

Aus Joachim Camerarius (1500-1574)
Wechseln zu: Navigation, Suche
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 12: Zeile 12:


$(document).ready(function () {
$(document).ready(function () {
/** Blur Drilldown page on load to hide the adding of custom elements **/
    $(".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")
/** Add custom elements to Drilldown **/
/** Add custom elements to Drilldown **/
    $(".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");
     $('<h3 class="drilldown-pre-filters">2. Verfügbare Filteroptionen</h3>').insertBefore("#drilldown-applicable-filters"),
     $('<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"),
     $('<h3 class="drilldown-post-filters">3. Anwendung der Filter</h3>').insertAfter("#drilldown-applicable-filters"),
Zeile 31: Zeile 21:
     });
     });
     });
     });
    /** 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 Toggle **/
     $(".drilldown-values-toggle").each(function () {
     $(".drilldown-values-toggle").each(function () {

Version vom 3. Dezember 2024, 12:29 Uhr

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"))
      })
   })
})