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AS2E,KAAKC,UAAY,IAAM5E,SAAS6E,gBAAgBD,UAAY,GACvE5E,SAASyE,uBAAuB,cAAc,GAAGK,MAAMC,QAAU,QAEjE/E,SAASyE,uBAAuB,cAAc,GAAGK,MAAMC,QAAU,MAPjB,EACpD,IAWA1D,OAAO2D,YAAc,WACnBhF,SAAS2E,KAAKC,UAAY,EAC1B5E,SAAS6E,gBAAgBD,UAAY,CACvC,C,iBCdIK,UAAUC,eACVD,UAAUC,cAAcC,mBAAmBC,MAAK,SAAUC,GACtD,IAAK,IAAIC,KAAgBD,EACrBC,EAAaC,YAErB,G,iBCTJvF,SAASG,iBAAiB,oBAAoB,WAG1CH,SAASuD,cAAc,kBAAkBpD,iBAAiB,SAAS,KAC/DH,SAAS2E,KAAKvC,UAAUrB,IAAI,aAAa,IAE7Cf,SAASuD,cAAc,mBAAmBpD,iBAAiB,SAAS,KAChEH,SAAS2E,KAAKvC,UAAUC,OAAO,aAAa,IAKhDhB,OAAOmE,cAAgB,SAASC,GAC5BA,EAAQC,cAActD,UAAUuD,OAAO,UACvC3F,SAASuD,cAAc,cAAcqC,OAAOC,kBAChD,CACJ,G","sources":["webpack://app/./app/javascript/application/javascripts/artists_filter.js","webpack://app/./app/javascript/application/javascripts/swiper.js","webpack://app/./app/javascript/packs/application.js","webpack://app/./app/javascript/application/javascripts/scroll_top.js","webpack://app/./app/javascript/application/javascripts/remove_serviceworkers.js","webpack://app/./app/javascript/application/javascripts/nav_toggle.js"],"sourcesContent":["/**\n * Filtert Elemente, die ein Attribut 'data-xxx' haben, wenn ein Button mit Attribut 'filter-xxx'\n * aktiv ist. Aktive Filter werden als URL-Parameter \"persistiert\".\n */\nclass ArtistListFilter {\n constructor(filterAttributes) {\n this.filterAttributes = new Set(filterAttributes);\n this.filterValues = new Map();\n\n this.parseUrl();\n this.addFilterButtonEventListeners();\n }\n\n logState() {\n this.log(\"filterAttributes: \", this.filterAttributes);\n this.log(\"filterValues: \", this.filterValues);\n }\n\n log(...args) {\n //console.log(...args);\n }\n\n addFilterButtonEventListeners() {\n this.filterAttributes.forEach(name => {\n const filterName = \"filter-\" + name;\n\n const btns = document.querySelectorAll(\"[\" + filterName + \"]\");\n this.log(\"Enable toggling on \", btns);\n btns.forEach(btn => {\n btn.addEventListener('click', () => {\n const criteria = btn.attributes[filterName].value;\n this.toggleFilterEnabled(name, criteria);\n });\n });\n });\n }\n\n isFilterEnabled(filter, value) {\n return this.filterValues[filter].has(value);\n }\n\n showItemForFilter(filter, value) {\n // Sonderfall: wenn kein Filter aktiv, alle Einträge anzeigen\n return this.filterValues[filter].size == 0 || this.isFilterEnabled(filter, value)\n }\n\n setFilterEnabled(filter, value, enabled) {\n if (enabled) {\n this.filterValues[filter].add(value);\n } else {\n this.filterValues[filter].delete(value);\n }\n\n this.updateUrl()\n this.updateDocumentElements();\n this.logState();\n }\n\n toggleFilterEnabled(filterName, value) {\n this.log(\"toggleFilterEnabled\", filterName, value);\n this.setFilterEnabled(filterName, value, !this.isFilterEnabled(filterName, value));\n }\n\n parseUrl() {\n const url = new URL(window.location);\n this.filterAttributes.forEach(attr => {\n const value = url.searchParams.get(\"filter-\" + attr);\n if (value) {\n this.filterValues[attr] = new Set(value.split(\"-\"));\n } else {\n this.filterValues[attr] = new Set();\n }\n });\n\n this.logState();\n this.updateDocumentElements();\n }\n\n updateUrl() {\n const url = new URL(window.location);\n this.filterAttributes.forEach(attr => {\n const values = this.filterValues[attr];\n const filterAttrName = \"filter-\" + attr;\n if (values.size == 0) {\n url.searchParams.delete(filterAttrName);\n } else {\n url.searchParams.set(filterAttrName, Array.from(values).sort().join(\"-\"));\n }\n });\n window.history.replaceState({}, '', url);\n }\n\n updateDocumentElements() {\n // Filter-Buttons aktualisieren\n this.filterAttributes.forEach(filterName => {\n const btns = document.querySelectorAll('[filter-' + filterName + ']')\n btns.forEach(btn => {\n const value = btn.attributes['filter-' + filterName].value;\n const active = this.isFilterEnabled(filterName, value);\n if (active) {\n btn.classList.add('active');\n } else {\n btn.classList.remove('active');\n }\n });\n });\n\n // data-Elemente ein-/ausblenden\n // 1) Alle Elemente die irgendein 'data-[filter]' Attribut haben finden\n const allFilteredRowsSelector = Array.from(this.filterAttributes).map(e => {\n return '[data-' + e + ']'\n }).join(\", \")\n const rows = document.querySelectorAll(allFilteredRowsSelector)\n\n // 2) Sichtbarkeit setzen\n this.log(\"updating \" + rows.length + \" rows\");\n rows.forEach(row => {\n let visible = true\n // Show element except one filter says no\n this.filterAttributes.forEach(attr => {\n const value = row.attributes['data-' + attr].value;\n visible = visible && this.showItemForFilter(attr, value);\n })\n if (visible) {\n row.classList.remove('filtered-invisible');\n } else {\n row.classList.add('filtered-invisible');\n }\n });\n }\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n const filter = new ArtistListFilter([\"category\", \"gender\"]);\n});\n","import Swiper from 'swiper';\nimport {Pagination, Keyboard, Manipulation} from 'swiper/modules';\nimport Rails from '@rails/ujs';\n\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n\n new Swiper('.eventlist', {\n autoHeight: true,\n modules: [Pagination, Keyboard, Manipulation],\n on: {\n afterInit: function () {\n if (window.sliderPreloadContent != null) {\n window.sliderPreloadContent();\n window.sliderPreloadContent = null;\n }\n },\n slideChange: function () {\n document.querySelector('.header .date').innerHTML = this.slides[this.activeIndex].attributes[\"formatted_date\"].value;\n\n // sliderPreloadContent löst durch das hinzufügen von Slides diese Events aus\n // dadurch kein Nachladen / aktualisieren der URL\n if (window.sliderPreloadContent == null) {\n let offset = null;\n if (this.activeIndex == 0) {\n offset = -1;\n } else if (this.activeIndex == (this.slides.length - 1)) {\n offset = 1;\n }\n\n if (offset != null) {\n const date = this.slides[this.activeIndex].attributes[\"date\"].value;\n Rails.ajax({\n type: \"GET\",\n url: \"/event_slider\",\n data: new URLSearchParams({\n date: date,\n offset: offset\n }).toString()\n });\n }\n\n const url = new URL(window.location);\n url.searchParams.set('date', this.slides[this.activeIndex].attributes[\"date\"].value);\n window.history.replaceState({}, '', url);\n }\n\n }\n },\n keyboard: {\n enabled: true,\n onlyInViewport: false,\n },\n });\n\n new Swiper('.attachment-gallery', {\n autoHeight: true,\n modules: [Pagination],\n pagination: {\n el: \".swiper-pagination\",\n },\n });\n\n});\n","import Rails from '@rails/ujs';\nimport * as ActiveStorage from '@rails/activestorage';\n\nRails.start();\nActiveStorage.start();\n\nimport '../application/javascripts/scroll_top'\nimport '../application/javascripts/swiper'\nimport '../application/javascripts/nav_toggle'\nimport '../application/javascripts/artists_filter'\nimport '../application/javascripts/remove_serviceworkers'\n\n","// When the user scrolls down 20px from the top of the document, show the button\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n if(document.getElementsByClassName(\"scroll_top\").length > 0)\n window.onscroll = function() { scrollFunction() };\n});\n\nfunction scrollFunction() {\n if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {\n document.getElementsByClassName(\"scroll_top\")[0].style.display = \"block\";\n } else {\n document.getElementsByClassName(\"scroll_top\")[0].style.display = \"none\";\n }\n}\n\n// When the user clicks on the button, scroll to the top of the document\nwindow.topFunction = function() {\n document.body.scrollTop = 0; // For Safari\n document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera\n}\n","// Alle serviceWorker der Seite entfernen\n// Wir hatten mal einen serviceworker.js ohne davon Gebrauch zu machen => wurde entfernt Oktober 2021.\n// Der Ordnung halber werden die Service-Worker mit diesem Skript soweit bei Usern schon vorhanden\n// wieder deregistriert. Dieses Skript sollte nach einigen Monaten entfernt werden.\nif (navigator.serviceWorker) {\n navigator.serviceWorker.getRegistrations().then(function (registrations) {\n for (let registration of registrations) {\n registration.unregister()\n }\n });\n}","document.addEventListener(\"DOMContentLoaded\", function() {\n\n // Navigation\n document.querySelector('#btn_show_menu').addEventListener('click', () => {\n document.body.classList.add('nav-active');\n });\n document.querySelector('#btn_close_menu').addEventListener('click', () => {\n document.body.classList.remove('nav-active');\n });\n\n // Klipp-Klapp beim Veranstaltungskalender - wird per Ajax nachgeladen (Aufruf über globale Funktion\n // gestaltet sich da einfacher)\n window.togglePreview = function(element) {\n element.parentElement.classList.toggle('active');\n document.querySelector('.eventlist').swiper.updateAutoHeight();\n }\n});\n"],"names":["ArtistListFilter","constructor","filterAttributes","this","Set","filterValues","Map","parseUrl","addFilterButtonEventListeners","logState","log","args","forEach","name","filterName","btns","document","querySelectorAll","btn","addEventListener","criteria","attributes","value","toggleFilterEnabled","isFilterEnabled","filter","has","showItemForFilter","size","setFilterEnabled","enabled","add","delete","updateUrl","updateDocumentElements","url","URL","window","location","attr","searchParams","get","split","values","filterAttrName","set","Array","from","sort","join","history","replaceState","classList","remove","allFilteredRowsSelector","map","e","rows","length","row","visible","Swiper","autoHeight","modules","Pagination","Keyboard","Manipulation","on","afterInit","sliderPreloadContent","slideChange","querySelector","innerHTML","slides","activeIndex","offset","date","Rails","ajax","type","data","URLSearchParams","toString","keyboard","onlyInViewport","pagination","el","start","ActiveStorage","getElementsByClassName","onscroll","body","scrollTop","documentElement","style","display","topFunction","navigator","serviceWorker","getRegistrations","then","registrations","registration","unregister","togglePreview","element","parentElement","toggle","swiper","updateAutoHeight"],"sourceRoot":""}