Änderungen

Aus WIKI LAUER-FISCHER GmbH
Wechseln zu: Navigation, Suche

MediaWiki:Common.js

80 Bytes hinzugefügt, 14:59, 13. Apr. 2018
keine Bearbeitungszusammenfassung
var cookieName = "sectionVisible"
 
jQuery(document).ready(function () {
"use strict"
// Register slideToggle() on each category.
var makeOnClick = generateMakeOnClick();
 
jQuery("div.generated-sidebar.portlet").each(makeOnClick);
makeOnClick.defaultExpanded = false;
// Registers the slideToggle() function on this and sets up the cookie
function makeOnClickgenerateMakeOnClick(n) {
"use strict";
if (makeOnClick.defaultExpanded === undefined) {
makeOnClick.defaultExpanded = true;
}
if (makeOnClick.var n =0; var makeOnClick == undefinedfunction m() { makeOnClickif (jQuery(this).children("h3").n = 0is(":hidden")) { return; }
if (makeOnClick.n > n) { n = makeOnClick.n + 1; makeOnClick.n++; } else { makeOnClick.n var k = n; }
jQuery(this).attr({ "role": "button", "type": "button" }); n++
var expanded = makeOnClick jQuery(this).defaultExpandedattr({ "role": "button", "type": "button" });
var cookie expanded = getCookie("showSection" + n);m.defaultExpanded
if ( var cookie === nullgetCookie(cookieName + k.toString() { setStateCookie(n, expanded); } else { expanded = cookie === "1"; }
jQuery if (thiscookie === null).children{ setStateCookie("h3").attr("aria-pressed"k, expanded ? "true" : "false"); jQuery(this).children("h3").addClass(expanded ? "nav-expanded" : "nav-collapsed"); } else { if ( expanded = cookie === false) { jQuery(this).children("div1").hide(); }
jQuery(this).children("h3").click(function attr("aria-pressed", expanded ? "true" : "false") {; var newExpanded = jQuery(this).attrchildren("h3").addClass(expanded ? "arianav-pressedexpanded") !== : "truenav-collapsed"; setStateCookie(n, newExpanded);
if (newExpanded) { jQuery(this).removeClass("nav-collapsed"); jQuery(this).addClass("nav-expanded"== false); } else { jQuery(this).removeClasschildren("nav-expandeddiv"); jQuery(this).addClasshide("nav-collapsed");
}
jQuery(this).children("h3").click(function () { var newExpanded = jQuery(this).attr("aria-pressed", newExpanded ? ) !== "true" : "false"; setStateCookie(k, newExpanded);
if (newExpanded) { jQuery(this).parentremoveClass("nav-collapsed"); jQuery(this).childrenaddClass("divnav-expanded"); } else { jQuery(this).pBody:first-ofremoveClass("nav-typeexpanded"); jQuery(this).slideToggleaddClass('fast'"nav-collapsed"); })
function getCookie jQuery(keythis) { .attr("use strictaria-pressed"; var cookieQuery = document.cookie.match('(, newExpanded ?"true" :^|;)\\s*' + key + '\\s*=\\s*([^;]+)'"false");
return cookieQuery === null ? null jQuery(this).parent().children("div.pBody: cookieQueryfirst-of-type").popslideToggle('fast'); })
}
// Writes the state of the k-th section into a cookiemakeOnClick. function setStateCookie(k, expanded) { "use strict"; var now defaultExpanded = new Date(); now.setFullYear(now.getFullYear() + 3);true
return makeOnClick}function getCookie(key) { "use strict"; var expirationDate cookieQuery = nowdocument.toUTCStringcookie.match('(?:^|;)\\s*' + key + '\\s*=\\s*([^;]+)');
var cookie return cookieQuery == "showSection" + k.toString() + "=" + (expanded null ? "1" null : "0"cookieQuery.pop() + "; Expires=" + expirationDate + "; path=/";}
// Writes the state of the k-th section into a cookie.function setStateCookie(k, expanded) { "use strict"; var now = new Date(); now.setFullYear(now.getFullYear() + 3);  var expirationDate = now.toUTCString();  var cookie = cookieName + k.toString() + "=" + (expanded ? "1" : "0") + "; Expires=" + expirationDate + "; path=/";  document.cookie = cookie; }
}

Navigationsmenü