/* Bauhaus-Archiv Copyright (C) 2013 by Systemantics, Bureau for Informatics Systemantics GmbH Alte Poststr. 38 47877 Willich GERMANY Web: www.systemantics.net Email: hello@systemantics.net Permission granted to use the files associated with this website only on your webserver. Changes to these files are PROHIBITED due to license restrictions. */ var origUrl = location.href, currentState = History.getState(), languageSwitches = {}; var isTouch = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch, noTouch = !isTouch; // From https://github.com/jquery/jquery-ui/blob/1.8.23/ui/jquery.ui.core.js $.fn.disableSelection = function () { return this.bind(($.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function (event) { event.preventDefault(); }); }; function isMobile() { if (!$("#bp").length) { $("
").appendTo("body"); } return $('#bp').width() == 1; } function initCalendar(calendar) { var calendar = $(calendar); // Convert navigation lists into selects convertNavigationListToSelect(calendar); // Custom select input fields $("select", calendar).customSelect(); $(window) .on("resize", function () { var w = $(window).width(), footer = $(".footer"); if (w < parseInt(footer.css("min-width"))) { calendar.css("width", ""); } else { calendar.width(w - calendar.offset().left - 60); } }) .trigger("resize"); } function initOverlay(context) { // Stretch single words in logo $(".logo-line-spread-single", context).each(function () { var el = $(this).find("a"), letters = el.text().trim().split(""), out = ""; for (var i in letters) { out = out + letters[i] + " "; } el.html(out); }); // Resize calendar to pseudo-fullscreen view $(".calendar", context).each(function () { initCalendar(this); }); // Resize video players $(window) .on("resize", function () { $(".video", context).each(function () { var el = $(this); el.height(el.width() / el.data("ratio")); }); }) .trigger("resize"); } function initFooterMenu(context) { // Remove all (old) slants $(".footer-menu-slant-container, .footer-menu-slant-cover").remove(); // Add white slat to selected footer menu items $(".footer-menu-item.selected").each(function () { var el = $(this); el .append(' '); }); } function initStickyFooter(el) { $(el) .on("scroll", function () { if ($(this).scrollTop() > 155) { $("body").addClass("fixed-footer-menu"); if ($(".fixed-footer-menu-container").length == 0) { $(".footer-menu-container").clone().addClass("fixed-footer-menu-container").appendTo("body") } } else { $("body").removeClass("fixed-footer-menu"); $(".fixed-footer-menu-container").remove() } }); } function updateLanguageSwitch(html) { if (html) { // Update from specified HTML $(".footer-menu-margin").replaceWith(html.find(".footer-menu-margin")); } else { // Update from previously saved state, if any var state = History.getState(); if (languageSwitches[state.url]) { $(".footer-menu-margin").html(languageSwitches[state.url]); } } } function openCalendar(url) { // Get content of calendar $.ajax({ url: url }).done(function (htmlIn) { var html = $("").append(htmlIn.replace(/