PageSourceSearch

https://theaterkonstanz.de/site/Theater/resourceCached/10.3.4.1a/js/functions.js

js theaterkonstanz.de collected 2026-09-24 10:03:48 UTC 11,522 bytes, 350 lines download raw bytes

1$(document).ready(function(){
2	
3	jQuery( ".col-3.datum-filter" ).click(function(e) {
4		var target = jQuery(e.target);
5		if (! target.is('.gtk')) {
6			if (jQuery( ".datumfilter.gtk.current" ).length)
7			{
8				jQuery( ".col-3.datum-filter .wrapper-datumfilter .datumfilter" ).slideToggle(300);
9			}
10			else
11			{
12				jQuery( ".col-3.datum-filter .wrapper-datumfilter .datumfilter:not(:first-child)" ).slideToggle(300);
13			}
14		}
15	});
16	jQuery( ".col-4.kategorie-filter" ).click(function(e) {
17		var target = jQuery(e.target);
18		if (! target.is('.katfilter')) {
19			jQuery( ".col-4 .wrapper-katfilter .katfilter:not(:first-child)" ).slideToggle(300);
20		}
21	});
22
23	if (jQuery( ".pm-topnews .pm-meldung .pm-head" ).length) {
24		setTimeout(function() {
25			//alert('timeout');
26			gleicheHoehe(".pm-head");
27	    }, 2000);
28	}
29	if (jQuery(".body_search").length != 0) {
30		setTimeout(function() {
31			jQuery('html, body').animate({
32				scrollTop: jQuery("#l-main").offset().top
33			}, 1);
34		}, 1000);
35	}
36	$(".modal-link-suche-wrapper *").click(function() {
37		setTimeout(function() {
38			$("input.c-quicksearch__input").focus();
39		}, 500);
40	});
41	
42	
43	
44	if (jQuery( ".fade.modal" ).length) {
45		jQuery('.fade.modal').each(function(i, obj) {
46			var className = jQuery(this).attr('class');
47			if (this.className.indexOf("modal-open") > -1) {
48				var matches		= this.className.match(/\bmodal-open[^\s]+\b/);
49				var klasse		= matches.toString();
50				var part		= klasse.split('modal-open')[1];
51				var linkclass	= '.modal-link'+part;
52				var classnames	= "modal fade cms-modal ";
53				if (this.className.indexOf("short") > -1) {
54					var classnames = "modal fade cms-modal short ";
55				}
56				jQuery(linkclass).wrapAll('<button type="button" data-toggle="modal" data-target=".'+klasse+'" style="border:none;background:none;"></button>');
57				var linktitel = '<span class="small">'+jQuery('h3', linkclass).text()+'</span>';
58				jQuery('h3', linkclass).hide();
59				jQuery('figcaption', linkclass).append( linktitel );
60				jQuery(this).wrapAll('<div class="'+classnames+klasse+'" tabindex="-1" aria-labelledby="'+klasse+'Label" aria-hidden="true"><div class="modal-dialog"><div class="modal-content" id="modal-content'+part+'"></div></div></div>');
61				jQuery('#modal-content'+part).prepend( '<div class="modal-header"><button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button></div>' );
62				jQuery(this).removeClass(className);
63				jQuery(this).addClass("modal-body");
64			}
65		});
66	}
67	
68});
69
70function gleicheHoehe(klasse){
71	var heights = jQuery(klasse).map(function() {
72		return jQuery(this).height();
73	}).get(),
74	maxHeight = Math.max.apply(null, heights);
75	//alert(maxHeight);
76	jQuery(klasse).height(maxHeight).css;
77}
78
79// functions.js
80function resizeGridItem(item){
81    grid = document.getElementsByClassName("grid")[0];
82    rowHeight = parseInt(window.getComputedStyle(grid).getPropertyValue('grid-auto-rows'));
83    rowGap = parseInt(window.getComputedStyle(grid).getPropertyValue('grid-row-gap'));
84    rowSpan = Math.ceil((item.querySelector('.content').getBoundingClientRect().height+rowGap)/(rowHeight+rowGap));
85    item.style.gridRowEnd = "span "+rowSpan;
86 }
87 
88 function resizeAllGridItems(){
89    allItems = document.getElementsByClassName("item");
90    for(x=0;x<allItems.length;x++){
91       resizeGridItem(allItems[x]);
92    }
93 }
94 
95 window.onload = resizeAllGridItems();
96 
97 window.addEventListener("resize", resizeAllGridItems);
98 
99 allItems = document.getElementsByClassName("item");
100 for(x=0;x<allItems.length;x++){
101    imagesLoaded( allItems[x], resizeInstance);
102 }
103 
104 function resizeInstance(instance){
105    item = instance.elements[0];
106    resizeGridItem(item);
107 }
108 
109 function on() {
110  document.getElementByClass("detail-cast").style.display = "block";
111}
112
113function off() {
114  document.getElementByClass("detail-cast").style.display = "none";
115}
116
117/***** Nachladefunktion für Content ********/
118// Klick auf bottom More-Link blendet ausgeblendete Inhalte ein.
119$(document).ready(function(){
120    $("p.link-more a").click(function() {
121        $(".v-row.row.subcolumns.hide").removeClass("hide").fadeIn();
122        $(this).fadeOut();
123        //console.log('Show Me More :-)');
124    });
125});
126
127/***** Smooth Scroll ********/
128// Klick auf eien Link, der eine Raute (# = Anker) enthält
129$(document).ready(function(){
130    $("#scrolldown").click(function(){
131        //console.log('Slide me 2 the Moon');    
132        $('html, body').animate({
133            scrollTop: $('#l-main').offset().top -125
134        }, 1000);
135    });
136});
137
138
139/***** Startseite gleiche Höhe  ********/
140// Die ersten beiden Kacheln brauchen die identische Höhe
141/*
142$(document).ready(function(){
143	var hoehe1 = $('.kacheln > .col-lg-4:first-child > .v-col > div:first-child article').outerHeight();
144	var hoehe2 = $('.kacheln > .col-lg-4:nth-child(2) .v-col > div:first-child article').outerHeight();
145	var numArray = [hoehe1, hoehe2];
146	var hoehe = maxNum(numArray);
147	$('.kacheln > .col-lg-4:first-child > .v-col > div:first-child article').height(hoehe);
148	$('.kacheln > .col-lg-4:nth-child(2) .v-col > div:first-child article').height(hoehe);
149	
150
151	var hoehe1 = $('.kacheln > .col-lg-4:nth-child(1) .v-col:nth-child(1)').outerHeight();
152	var hoehe2 = $('.kacheln > .col-lg-4:nth-child(2) .v-col:nth-child(1)').outerHeight();
153	var hoehe3 = $('.kacheln > .col-lg-4:nth-child(3) .v-col:nth-child(1)').outerHeight();
154	var numArray2 = [hoehe1, hoehe2, hoehe3];
155	var hoehe = maxNum(numArray2);
156	$('.kacheln > .col-lg-4:nth-child(1) .v-col:nth-child(1)').height(hoehe);
157	$('.kacheln > .col-lg-4:nth-child(2) .v-col:nth-child(1)').height(hoehe);
158	$('.kacheln > .col-lg-4:nth-child(3) .v-col:nth-child(1)').height(hoehe);
159});
160*/
161function maxNum(numArray){
162    return numArray.sort(function (a, b) { return b - a })[0];
163}
164
165// Kacheln UNterseiten Grid //kt
166
167jQuery(document).ready(function() {
168  // CSS Klasse zwei obendran hinzufügen
169 jQuery('.kacheln-erweitert .zweizeilig').parent().addClass('zweizeilig');
170 jQuery('.kacheln-erweitert .dreizeilig').parent().addClass('dreizeilig');
171
172
173 jQuery('.kacheln-erweitert .zweispaltig').parent().addClass('zweispaltig');
174 jQuery('.kacheln-erweitert .dreispaltig').parent().addClass('dreispaltig');
175
176 // Anzahl berechnen (falls gebraucht)
177 jQuery('.kacheln-erweitert').each(function ($) { 
178   var countKachelboxen = jQuery("> div", this).children().length;
179   console.log(countKachelboxen);
180   jQuery(this).addClass('anzahl-'+ countKachelboxen);
181 });
182
183});
184
185/* =======================================*/
186/* ============  MMenu (Main) ============*/
187/* =======================================*/
188document.addEventListener("DOMContentLoaded", () => {
189
190  //var logoBrand = document.querySelector(".l-footer img");
191  var logoBrand = document.querySelector(".l-header__brand .brand img");
192  var logoBrandClone = logoBrand.cloneNode(true);
193
194  //var footerAdress = document.querySelector(".l-footer .adresse");
195  //var footerAdressDiv = footerAdress.cloneNode(true);
196
197
198  const menu = new Mmenu("#mobile-menu", {    
199    
200    //options      
201      setSelected: true,
202      "slidingSubmenus": false,
203      "autoHeight": true,
204    
205    // navbars
206    "navbars": [{
207      "position": "top",
208      "content": [/*logoBrandClone,*/"<div class='logo-mm'><a class='logo-img-mm' href='/startseite'></a></div>"]
209    }, /*{
210      "position": "bottom",
211      "content": ["<div class='mobile-footer'><ul class='mobile-footer__navi'></ul></div>"]
212    },*/],
213
214    //Configuration
215      classNames: {
216      Selected: "mm-listitem_selected" //Change this class to match the default li you want
217    },
218    
219    // extensions
220    "extensions": [
221      //"border-full",
222      //"pagedim-black",
223      "position-back",
224      "position-top",
225      //"theme-white",
226      //"shadow-page"
227        "border-none",
228    ],
229    
230    setSelected: {
231      //"hover": true,
232      //"parent": true,
233      //"current": "detect"
234    },
235
236    backButton: {
237      // back button options
238    }
239  }, {
240      classNames: {
241      selected: "current" //Change this class to match the default li you want
242    },
243      // configuration
244      offCanvas: {
245      clone: false,
246      pageNodetype: "mm-wrap",
247      classNames: {
248      selected: 'current'
249        }
250      }
251    }, {
252    backButton: {
253      // back button configuration
254    },
255
256  });
257  const api = menu.API;
258
259  // MMenu (Hamburger Clickfunktion)
260  document.querySelector("#mobile-nav-button").addEventListener(
261    "click", (evnt) => {
262      evnt.preventDefault();
263      api.open();
264    }
265  );
266   
267  // Öffnet das Submenu bei MouseOver     
268
269    if ($(window).width() > 768) {
270      $('li.mm-listitem_vertical').hover(function(){
271        $(this).addClass("mm-listitem_opened");
272        $('.mm-panel',this).removeClass("mm-hidden");
273        //$('ul',this).slideDown();
274      },function(){
275        //$('ul',this).slideUp();
276        $(this).removeClass("mm-listitem_opened");
277        $('#mm-2').addClass("mm-hidden");
278      });
279    };
280
281  // MMenu (Hamburger Clickfunktion)
282  document.querySelector("#mobile-nav-button").addEventListener(
283    "click", (evnt) => {
284      evnt.preventDefault();
285      api.close();
286    }
287  );
288
289/*
290  // MMenu (Hamburger Clickfunktion)
291  document.querySelector("#search-mm").addEventListener(
292    "click", (evnt) => {
293      evnt.preventDefault();
294      api.close();
295    }
296  );*/
297
298
299
300  // Find the panel and listview.
301  var panel = document.querySelector(".mb-menu");
302  var listview = document.querySelector(".mobile-footer__navi");
303
304
305  // Newsletter.
306  var listitemNewsletter = document.createElement("li");
307  //console.log(listitemNewsletter);
308  listitemNewsletter.className = "mm-listitem secondlist";
309  listitemNewsletter.innerHTML = '<a class="mm-listitem__text" href="/newsletter">Newsletter</a>';
310
311  // Impressum
312  var listitemImpressum = document.createElement("li");
313  //console.log(listitemImpressum);
314  listitemImpressum.className = "mm-listitem secondlist";
315  listitemImpressum.innerHTML = '<a class="mm-listitem__text" href="/impressum">Impressum</a>';
316
317  // Datenschutz
318  var listitemDatenschutz = document.createElement("li");
319  //console.log(listitemDatenschutz);
320  listitemDatenschutz.className = "mm-listitem secondlist";
321  listitemDatenschutz.innerHTML = '<a class="mm-listitem__text" href="/datenschutz">Datenschutz</a>';
322
323  // Kontakte
324  var listitemKontakt = document.createElement("li");
325  //console.log(listitemKontakt);
326  listitemKontakt.className = "mm-listitem secondlist cl-kontakt";
327  listitemKontakt.innerHTML = '<a class="mm-listitem__text" href="/kontakt">Kontakt</a>';
328
329
330  // Barrierefreiheit
331  var listitemBarrierefreiheit = document.createElement("li");
332  //console.log(listitemBarrierefreiheit);
333  listitemBarrierefreiheit.className = "mm-listitem secondlist";
334  listitemBarrierefreiheit.innerHTML = '<a class="mm-listitem__text" href="/barrierefreiheit">Barrierefreiheit</a>';
335
336
337
338  // Add the listitem to the listview.
339  //listview.append(listitemNewsletter);
340  //listview.append(listitemImpressum);
341  //listview.append(listitemDatenschutz);
342  //listview.append(listitemKontakt);
343  //listview.append(listitemBarrierefreiheit);
344
345
346
347  // Update the listview.
348 // api.initListview(listview);
349
350})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.