1"use strict"; 2 3function isOldIE() { 4 const ua = window.navigator.userAgent; //Check the userAgent property of the window.navigator object 5 const msie = ua.indexOf("MSIE "); // IE 10 or older 6 const trident = ua.indexOf("Trident/"); //IE 11 7 8 return msie > 0 || trident > 0; 9} 10 11//function to show alert if it's IE 12function ShowIEAlert() { 13 if (isOldIE()) { 14 document.body.innerHTML += 15 "<div style='position: fixed;bottom: 0;left: 0;right: 0;height: max-content;z-index: 100;background: transparent;'> <div class='container' style='text-align: center;padding: 8px;font-size: 1.125rem;color: red;background: yellow;'>Sie verwenden den Internet Explorer. <br> Dieser Browser ist veraltet und wird von dieser Website nicht mehr unterstützt! <br> Die Seite kann deshalb nicht korrekt dargestellt werden.<br> Bitte benutzen Sie einen aktuellen Browser.</div><div>"; 16 } 17 return isOldIE(); 18} 19 20ShowIEAlert(); 21 22Dropzone.autoDiscover = false; 23 24$(document).ready(function () { 25 // Geobonus mapmodul.js loads jQuery 3.7.1 as a module and leaves window.jQuery 26 // pointing at that copy ($map), while $ remains our 3.4.1 with plugins. 27 // Re-bind jQuery so plugin code (validator, etc.) keeps working. 28 if (typeof window.$ === "function" && window.jQuery !== window.$) { 29 window.jQuery = window.$; 30 } 31 32 /* ScrollTop */ 33 $("body").materialScrollTop({ 34 revealElement: $("script"), 35 revealPosition: "bottom", 36 }); 37 38 if (window.location.href.includes("infoscreen")) { 39 if (document.getElementById("klaro") != null && document.getElementById("klaro") != undefined) { 40 document.getElementById("klaro").style.display = "none"; 41 } 42 let cookieBanner = document.getElementsByClassName("klaro we_cookie_consent"); 43 if (cookieBanner[0] != null && cookieBanner[0] != undefined) { 44 cookieBanner[0].style.display = "none"; 45 } 46 } 47 48 $(".gizaccordion") 49 .find(".searchfilter-searchbox") 50 .on("input", function () { 51 var filterText = $(".gizaccordion").find(".searchfilter-searchbox")[0].value; 52 $.each($(".gizaccordion * .accordion"), function (i, accordion) { 53 //if ($(".gizaccordion * .accordion:nth-child(" + (i + 1) + ") > .card > .card-header > .acctitle").html().toLowerCase().includes(filterText.toLowerCase())) { 54 if ( 55 $(".gizaccordion * .accordion:nth-child(" + (i + 1))[0] 56 .innerText.toLowerCase() 57 .includes(filterText.toLowerCase()) 58 ) { 59 $(".gizaccordion * .accordion:nth-child(" + (i + 1) + ")").css("display", "inherit"); 60 } else { 61 $(".gizaccordion * .accordion:nth-child(" + (i + 1) + ")").css("display", "none"); 62 } 63 }); 64 }); 65 66 $("select.category").select2({ 67 placeholder: "Kategorie", 68 closeOnSelect: true, 69 }); 70 $("select.year").select2({ 71 placeholder: "Jahr", 72 closeOnSelect: true, 73 }); 74 $("select.topic").select2({ 75 placeholder: "Thema", 76 closeOnSelect: true, 77 }); 78 $("select.committees").select2({ 79 placeholder: "Ausschüsse", 80 closeOnSelect: true, 81 }); 82 $("select.section").select2({ 83 placeholder: "Parteien", 84 closeOnSelect: true, 85 }); 86 87 $("div[data-slick]").each(function () { 88 var $el = $(this); 89 if (!$el.children().length || $el.hasClass("slick-initialized")) { 90 return; 91 } 92 $el.slick(); 93 }); 94 95 //slick fix cloned on infinite // 96 Array.from(document.querySelectorAll(".slick-cloned a.lightbox")).forEach(function (element) { 97 let gid = element.getAttribute("rel"); 98 element.removeAttribute("rel"); 99 element.addEventListener("click", (e) => { 100 e.preventDefault(); 101 e.stopPropagation(); 102 let href = element.getAttribute("href"); 103 document.querySelector("a.lightbox[rel=" + gid + '][href="' + href + '"]').click(); 104 }); 105 }); 106 107 var $magicLine = $("#magic-line"); 108 let activeItem = "#navbar li.active"; 109 let magicLineTopAdder = 45; 110 111 function setMagicLine() { 112 if ($("#magic-line").length && $(activeItem).length) { 113 $magicLine 114 .width($(activeItem).width()) 115 .css("left", $(activeItem).position().left) 116 .css("top", $(activeItem).position().top + magicLineTopAdder) 117 .data("origWidth", $(activeItem).width()) 118 .data("origLeft", $(activeItem).position().left) 119 .data("origTop", $(activeItem).position().top + magicLineTopAdder); 120 } else { 121 $magicLine.width(0).css("left", 0).css("top", 0); 122 } 123 } 124 125 setMagicLine(); 126 $(window).resize(function () { 127 setMagicLine(); 128 }); 129 $("nav.sticky-top .nav-item").hover( 130 function () { 131 if ($("#magic-line").length && $(activeItem).length) { 132 $magicLine.stop().animate({ 133 left: $(this).position().left, 134 width: $(this).width(), 135 top: $(this).position().top + magicLineTopAdder, 136 }); 137 } else { 138 if ($magicLine.hasClass("magicline-first")) { 139 $magicLine.stop().animate({ 140 left: $(this).position().left, 141 width: $(this).width(), 142 top: $(this).position().top + magicLineTopAdder, 143 }); 144 } else { 145 $magicLine 146 .width($(this).width()) 147 .css("left", $(this).position().left) 148 .css("top", $(this).position().top + magicLineTopAdder); 149 $magicLine.addClass("magicline-first"); 150 } 151 } 152 }, 153 function () { 154 if ($magicLine.data("origWidth") != null) 155 $magicLine.stop().animate({ 156 width: $magicLine.data("origWidth"), 157 left: $magicLine.data("origLeft"), 158 top: $magicLine.data("origTop"), 159 }); 160 } 161 ); 162 163 function scrollToElement(element, duration) { 164 $("html, body").animate( 165 { 166 scrollTop: $(element).offset().top, 167 }, 168 duration 169 ); 170 } 171 172 function getUrlVars() { 173 var vars = {}; 174 var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) { 175 vars[key] = value; 176 }); 177 return vars; 178 } 179 180 function openAccordionPerId(id) { 181 if (id != undefined && id != "" && id != null) { 182 $(id).collapse("show"); 183 $(id).one("shown.bs.collapse", function (event) { 184 scrollToElement($(event.target).parent().find(".card-header")[0]); 185 }); 186 if (typeof slickAccGallery !== "undefined") slickAccGallery($(id).find(".dot-slider-small")); 187 } 188 } //Open accordion per link hash 189 openAccordionPerId(window.location.hash); 190 openAccordionPerId("#" + getUrlVars()["open_acc"]); 191 192 $(".main-nav-submenu .dropdown-item").on("click", function () { 193 openAccordionPerId(this.hash); 194 }); // Gallery for Accordion 195 196 // Download 197 $(".download .progress").hide(); 198 $(".download").click(function () { 199 var progressBar = $(this).find(".progress-bar")[0]; 200 $($(this).find(".progress")[0]).show(); 201 var ele = this; 202 var page_url = $(ele).data("filepath"); 203 $(progressBar).attr("aria-valuenow", 0); 204 $(progressBar).css({ 205 width: 0, 206 }); 207 var req = new XMLHttpRequest(); 208 req.open("POST", page_url, true); 209 req.addEventListener( 210 "progress", 211 function (evt) { 212 if (evt.lengthComputable) { 213 var percentComplete = evt.loaded / evt.total; 214 $(progressBar).attr("aria-valuenow", percentComplete); 215 $(progressBar).css({ 216 width: percentComplete * 100 + "%", 217 }); 218 } 219 }, 220 false 221 ); 222 req.responseType = "blob"; 223 224 req.onreadystatechange = function () { 225 if (req.readyState === 4 && req.status === 200) { 226 var filename = $(ele).data("filename"); 227 228 if (typeof window.chrome !== "undefined") { 229 // Chrome version 230 var link = document.createElement("a"); 231 link.href = window.URL.createObjectURL(req.response); 232 link.download = filename; 233 link.click(); 234 } else if (typeof window.navigator.msSaveBlob !== "undefined") { 235 // IE version 236 var blob = new Blob([req.response], { 237 type: "application/force-download", 238 }); 239 window.navigator.msSaveBlob(blob, filename); 240 } else { 241 // Firefox version 242 var file = new File([req.response], filename, { 243 type: "application/force-download", 244 }); 245 window.open(URL.createObjectURL(file)); 246 } 247 } 248 }; 249 250 req.send(); 251 }); // Politik - Suchfilter Focus 252 $(".searchfilter-searchbox").on("focus focusout", function () { 253 $(".form-control-feedback").toggleClass("active-search"); 254 }); 255 256 // PDF Reader 257 // Lazy PDF Reader 258 259 $(document).on("shown.bs.collapse", ".collapse", function (event) { 260 var collapseEl = event.target; 261 var $collapse = $(collapseEl); 262
263 var $readers = $collapse.find(".pdf-reader").filter(function () { 264 return $(this).closest(".collapse")[0] === collapseEl; 265 }); 266 267 if (!$readers.length) return; 268 269 $readers.each(function () { 270 var $reader = $(this); 271 272 if ($reader.data("pdf-loaded")) return; 273 274 initPdfReader($reader); 275 $reader.data("pdf-loaded", true); 276 }); 277 }); 278 279 280 function initPdfReader($reader) { 281 //console.log("init Pdf reader"); 282 var input = $reader.find(".pdf-input-viewer")[0]; 283 if (!input) return; 284 285 var pdfUrl = input.value; 286 var pdfID = input.id; 287 288 var pdfDoc = null; 289 var pageNum = 1; 290 var pageIsRendering = false; 291 var pageNumIsPending = null; 292 var scale = 2; 293 294 var canvas = $reader.find("canvas")[0]; 295 var ctx = canvas.getContext("2d"); 296 297 var $loader = $reader.find(".pdf-loader"); 298 var $pageNum = $reader.find(".page-num"); 299 var $pageCount = $reader.find(".page-count"); 300 301 function renderPage(num) { 302 pageIsRendering = true; 303 304 pdfDoc.getPage(num).then(function (page) { 305 var viewport = page.getViewport({ 306 scale: scale 307 }); 308 309 canvas.height = viewport.height; 310 canvas.width = viewport.width; 311 312 var renderCTX = { 313 canvasContext: ctx, 314 viewport: viewport 315 }; 316 317 page.render(renderCTX).promise.then(function () { 318 pageIsRendering = false; 319 320 if (pageNumIsPending !== null) { 321 renderPage(pageNumIsPending); 322 pageNumIsPending = null; 323 } 324 }); 325 326 $pageNum.text(num); 327 }); 328 } 329 330 function queueRenderPage(num) { 331 if (pageIsRendering) { 332 pageNumIsPending = num; 333 } else { 334 renderPage(num); 335 } 336 } 337 338 function showPrevPage() { 339 if (pageNum <= 1) return; 340 341 pageNum--; 342 queueRenderPage(pageNum); 343 } 344 345 function showNextPage() { 346 if (pageNum >= pdfDoc.numPages) return; 347 348 pageNum++; 349 queueRenderPage(pageNum); 350 } 351 352 $loader.show(); 353 354 pdfjsLib.getDocument(pdfUrl).promise.then(function (pdfDoc_) { 355 pdfDoc = pdfDoc_; 356 357 $pageCount.text(pdfDoc.numPages); 358 359 renderPage(pageNum); 360 initSwipe(pdfID, showPrevPage, showNextPage); 361 }).finally(function () { 362 $loader.hide(); 363 }); 364 365 $reader.find(".prev-page").on("click", showPrevPage); 366 $reader.find(".next-page").on("click", showNextPage); 367 } 368 369 370 function initSwipe(pdfID, showPrevPage, showNextPage) { 371 var touchsurface = document.getElementById("touchsurface-" + pdfID); 372 if (!touchsurface) return; 373 374 var startX = 0; 375 376 touchsurface.addEventListener("touchstart", function (e) { 377 startX = e.changedTouches[0].pageX; 378 }, false); 379 380 touchsurface.addEventListener("touchend", function (e) { 381 var dist = e.changedTouches[0].pageX - startX; 382 383 if (Math.abs(dist) < 30) return; 384 385 if (dist > 0) { 386 showPrevPage(); 387 } else { 388 showNextPage(); 389 } 390 }, false); 391 } 392 393 /* ##### SCHME WEBWERK ##### */ 394 395 // Prevent Errors 396 (function () { 397 if (typeof EventTarget !== "undefined") { 398 const originalAddEventListener = EventTarget.prototype.addEventListener; 399 400 const overrideTypes = ["touchstart", "touchmove", "wheel"]; 401 402 EventTarget.prototype.addEventListener = function (type, fn, options) { 403 if (!overrideTypes.includes(type)) { 404 return originalAddEventListener.call(this, type, fn, options); 405 } 406 407 let newOptions; 408 if (typeof options === "object" && options !== null) { 409 newOptions = Object.assign({}, options, { passive: false }); 410 } else if (typeof options === "boolean" || options === undefined) { 411 newOptions = { passive: false }; 412 } 413 414 return originalAddEventListener.call(this, type, fn, newOptions); 415 }; 416 } 417 })(); 418 419 //Dropzone error viewer 420 function addErrorsToDropzone(dropzone) { 421 let errorText = ""; 422 423 $(dropzone) 424 .find(".dz-error") 425 .each(function () { 426 let text = $(this).find(".dz-error-message span").text(); 427 if (!errorText.includes(text)) errorText += "<p>" + text + "</p>"; 428 }); 429 $(dropzone).find(".error-text").html(errorText); 430 if (errorText != "") $(dropzone).addClass("dz-error-in"); 431 else $(dropzone).removeClass("dz-error-in"); 432 } 433 434 // Dropzone Events 435 $(".dropzone").each(function () { 436 let ele = this; 437 //Add existing files into dropzone 438 $(this).dropzone({ 439 url: $(ele).attr("data-url"), 440 // url: window.location.pathname, 441 // autoProcessQueue: false, 442 addRemoveLinks: true, 443 uploadMultiple: true, 444 acceptedFiles: $(this).data("allowedTypes"), 445 maxFiles: $(this).data("maxFiles"), 446 maxFilesize: $(this).data("maxFileSize"), 447 dictFileTooBig: "Datei zu groÃ.", 448 dictInvalidFileType: "Falscher Datentyp", 449 dictRemoveFile: "Entfernen", 450 dictMaxFilesExceeded: "Maximal " + $(this).data("maxFiles") + " Dateien!", 451 success: function (file, responseText) { 452 // var response = JSON.parse(responseText); 453 // console.log(responseText); 454 }, 455 init: function () { 456 // for (let i = 0; i < existingFiles.length; i++) {
457 // this.emit("addedfile", existingFiles[i]); 458 // this.emit("thumbnail", existingFiles[i], "img/buerger.jpg"); 459 // this.emit("complete", existingFiles[i]); 460 // } 461 this.on("removedfile", function (file) { 462 addErrorsToDropzone(ele); 463 }); 464 this.on("addedfile", function (file) { 465 var ext = file.name.split(".").pop(); 466 if (ext.indexOf("pdf") != -1) { 467 $(file.previewElement).find(".dz-image img").attr("src", "img/pdf.png"); 468 } else if (ext.indexOf("doc") != -1) { 469 $(file.previewElement).find(".dz-image img").attr("src", "img/word.png"); 470 } else if (ext.indexOf("xls") != -1 || ext.indexOf("csv") != -1) { 471 $(file.previewElement).find(".dz-image img").attr("src", "img/excel.png"); 472 } 473 if (this.files.length >= $(ele).data("maxFiles")) { 474 $(".dz-hidden-input").prop("disabled", true); 475 } 476 addErrorsToDropzone(ele); 477 }); 478 this.on("error", function (file, error, xhr) { 479 addErrorsToDropzone(ele); 480 }); 481 }, 482 }); 483 }); 484 485 // FUCKING IE 11 BUG FIX 486 // $("button[data-submit-form]").click(function() { 487 // $($(this).data("submitForm")).submit(); 488 // }); 489 490 // jquery-validation is optional â only register when the plugin is loaded 491 if ($.validator && typeof $.validator.addMethod === "function") { 492 $.validator.addMethod( 493 "passwordChecker", 494 function (value, element) { 495 if ($(this).prop("required") || value != "") { 496 let parent = $(element).parent(); 497 var ucase = new RegExp("[A-Z]+"); 498 var lcase = new RegExp("[a-z]+"); 499 var num = new RegExp("[0-9]+"); 500 let bool = true; 501 if (parent.find(".password-validation").length > 0) { 502 let resetTooltip = function (object, boolean) { 503 if (boolean) { 504 object.removeClass("invalid"); 505 object.addClass("valid"); 506 } else { 507 object.removeClass("valid"); 508 object.addClass("invalid"); 509 bool = false;
510 } 511 }; 512 resetTooltip(parent.find("[data-ruleid='min-chars']"), $(element).val().length >= 8); 513 resetTooltip(parent.find("[data-ruleid='uppercase']"), ucase.test($(element).val())); 514 resetTooltip(parent.find("[data-ruleid='lowercase']"), lcase.test($(element).val())); 515 resetTooltip(parent.find("[data-ruleid='number']"), num.test($(element).val())); 516 } 517 return bool; 518 } 519 return true; 520 }, 521 "Dein Passwort muss Folgendes enthalten:" 522 ); 523 524 $.extend($.validator.messages, { 525 url: "Bitte einen gültigen Link eingeben.", 526 date: "Bitte ein gültiges Datum eintragen.", 527 }); 528 } 529 530 // Zeigt den Versteckten inhalt sobald die richtige Option ausgewählt wird 531 // läuft alles über "data-show-content" 532 $("select").change(function () { 533 let idToShow = $($("option:selected", this)).data("showContent"); 534 if (idToShow != null && idToShow != undefined) { 535 $(idToShow).addClass("d-block d-sm-block d-md-block d-lg-block"); 536 $(idToShow).removeClass("d-none d-sm-none d-md-none d-lg-none"); 537 } 538 $(this) 539 .find("option") 540 .each(function () { 541 let idToHide = $(this).data("showContent"); 542 if (idToHide != null && idToHide != undefined && idToShow != idToHide) { 543 $(idToHide).addClass("d-none d-sm-none d-md-none d-lg-none"); 544 $(idToHide).removeClass("d-block d-sm-block d-md-block d-lg-block"); 545 } 546 }); 547 }); 548 549 // DatePicker / DateTimePicker / RangePicker / StartDate / EndDate 550 551 const daysOfWeek = ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"]; 552 const monthNames = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"]; 553 554 $('input[name="dateTimePicker"]').daterangepicker({ 555 singleDatePicker: true, 556 showDropdowns: true, 557 showWeekNumbers: true, 558 timePicker: true, 559 timePicker24Hour: true, 560 locale: { 561 format: "DD.MM.YYYY HH:mm", 562 separator: " - ", 563 applyLabel: "Bestätigen", 564 cancelLabel: "Abbrechen", 565 fromLabel: "Von", 566 toLabel: "Bis", 567 weekLabel: "W", 568 daysOfWeek: daysOfWeek, 569 monthNames: monthNames, 570 }, 571 opens: "center", 572 applyButtonClasses: "btn-inline-primary", 573 cancelClass: "btn-outline-primary", 574 }); 575 $('input[name="datePicker"]').daterangepicker({ 576 singleDatePicker: true, 577 showDropdowns: true, 578 showWeekNumbers: true, 579 locale: { 580 format: "DD.MM.YYYY", 581 separator: " - ", 582 applyLabel: "Bestätigen", 583 cancelLabel: "Abbrechen", 584 fromLabel: "Von", 585 toLabel: "Bis", 586 weekLabel: "W", 587 daysOfWeek: daysOfWeek, 588 monthNames: monthNames, 589 }, 590 opens: "center", 591 applyButtonClasses: "btn-inline-primary", 592 cancelClass: "btn-outline-primary", 593 }); 594 595 const initialStartDate = moment().subtract(1, "year"); 596 const initialEndDate = moment(); 597 const initialFuturStartDate = moment(); 598 const initialFuturEndDate = moment().add(1, "year"); 599 600 $('input[name="dateRangePicker"]').daterangepicker({ 601 showDropdowns: true, 602 showWeekNumbers: true, 603 locale: { 604 format: "DD.MM.YYYY", 605 separator: " - ", 606 applyLabel: "Bestätigen", 607 cancelLabel: "Zurücksetzen", 608 fromLabel: "Von", 609 toLabel: "Bis", 610 weekLabel: "W", 611 daysOfWeek: daysOfWeek, 612 monthNames: monthNames, 613 }, 614 autoApply: false, 615 autoUpdateInput: false, 616 opens: "center", 617 applyButtonClasses: "btn-inline-primary", 618 cancelClass: "btn-outline-primary", 619 }); 620 621 $('input[name="dateRangePicker"]').on("apply.daterangepicker", function (ev, picker) { 622 $(this).val(picker.startDate.format("DD.MM.YYYY") + " - " + picker.endDate.format("DD.MM.YYYY")); 623 }); 624 625 $('input[name="dateRangePickerFutur"]').daterangepicker({ 626 showDropdowns: true, 627 showWeekNumbers: true, 628 /*startDate: initialFuturStartDate, 629 endDate: initialFuturEndDate, 630 minDate: initialFuturStartDate, 631 maxDate: initialFuturEndDate,*/ 632 locale: { 633 format: "DD.MM.YYYY", 634 separator: " - ", 635 applyLabel: "Bestätigen", 636 cancelLabel: "Zurücksetzen", 637 fromLabel: "Von", 638 toLabel: "Bis", 639 weekLabel: "W", 640 daysOfWeek: daysOfWeek, 641 monthNames: monthNames, 642 }, 643 autoApply: false, 644 autoUpdateInput: false, 645 opens: "center", 646 applyButtonClasses: "btn-inline-primary", 647 cancelClass: "btn-outline-primary", 648 }); 649 $('input[name="startDate"]').daterangepicker({ 650 singleDatePicker: true, 651 showDropdowns: true, 652 showWeekNumbers: true, 653 timePicker: true, 654 timePicker24Hour: true, 655 locale: { 656 format: "DD.MM.YYYY HH:mm", 657 separator: " - ", 658 applyLabel: "Bestätigen", 659 cancelLabel: "Abbrechen", 660 fromLabel: "Von", 661 toLabel: "Bis", 662 weekLabel: "W", 663 daysOfWeek: daysOfWeek, 664 monthNames: monthNames, 665 }, 666 opens: "center", 667 startDate: moment().add(3, "days").startOf("day"),
668 applyButtonClasses: "btn-inline-primary", 669 cancelClass: "btn-outline-primary", 670 }); 671 $('input[name="endDate"]').daterangepicker({ 672 singleDatePicker: true, 673 showDropdowns: true, 674 showWeekNumbers: true, 675 timePicker: true, 676 timePicker24Hour: true, 677 locale: { 678 format: "DD.MM.YYYY HH:mm", 679 separator: " - ", 680 applyLabel: "Bestätigen", 681 cancelLabel: "Abbrechen", 682 fromLabel: "Von", 683 toLabel: "Bis", 684 weekLabel: "W", 685 daysOfWeek: daysOfWeek, 686 monthNames: monthNames, 687 }, 688 opens: "center", 689 startDate: moment().add(3, "days").endOf("day"), 690 applyButtonClasses: "btn-inline-primary", 691 cancelClass: "btn-outline-primary", 692 }); 693 694 // DELETE ALL DUPLICATE ENTRYS IN A SELECT 695 if ($(".no-duplicate-select").length) { 696 var seen = {}; 697 $(".no-duplicate-select > option").each(function () { 698 var txt = this.text; 699 if (seen[txt]) $(this).remove(); 700 else seen[txt] = true; 701 }); 702 } 703 704 // FILTER ANNOUNCEMENT 705 if ($("#announcement").length) { 706 $("#announcement .no_elements").hide(); 707 708 var annList = new List("announcement", { 709 valueNames: ["announcement-element"], 710 }); 711 712 annList.on("updated", function (list) { 713 if (list.matchingItems.length > 0) { 714 $("#announcement .no_elements").hide(); 715 } else { 716 $("#announcement .no_elements").show(); 717 } 718 }); 719 720 annList.update(); 721 } 722 723 // FILTER ACTS 724 725 $('div[id^="act"]').each(function () { 726 //console.log(this.id.slice(3)); 727 let act_id = this.id; 728 if ($("#" + act_id).length) { 729 $("#no-elements-" + act_id).hide(); 730 731 var actList = new List(act_id, { 732 valueNames: [ 733 "act-search", 734 { 735 name: "accordion", 736 attr: "data-date", 737 }, 738 ], 739 }); 740 741 function updateActList() { 742 let startDate = moment($("#selectedDate").data("daterangepicker").startDate).unix(); 743 let endDate = moment($("#selectedDate").data("daterangepicker").endDate).unix(); 744 actList.filter(function (item) { 745 let filterer = moment(item.values().accordion, "DD.MM.YYYY").unix(); //.unix(); 746 //console.log(actList); 747 var partyaffiliationFilter = true; 748 749 if (startDate != "undefined" && startDate != undefined && startDate != null) partyaffiliationFilter = (startDate < filterer) & (endDate > filterer); 750 return partyaffiliationFilter; 751 }); 752 actList.update(); 753 } 754 755 $("#selectedDate").change(updateActList); 756 actList.on("updated", function (list) { 757 if (list.matchingItems.length > 0) { 758 $("#no-elements-" + act_id).hide(); 759 } else { 760 $("#no-elements-" + act_id).show(); 761 } 762 }); 763 764 actList.update(); 765 } 766 }); 767 /*if ($("#act").length) { 768 $("#act .no_elements").hide(); 769 console.log('Test 734'); 770 console.log($("#act")); 771 772 var actList = new List("act", { 773 valueNames: ["act-search", { 774 name: "accordion", 775 attr: "data-date" 776 }] 777 }); 778 console.log(actList); 779 function updateActList() { 780 console.log('Test 745'); 781 let startDate = moment( 782 $("#selectedDate").data("daterangepicker").startDate 783 ).unix(); 784 let endDate = moment( 785 $("#selectedDate").data("daterangepicker").endDate 786 ).unix(); 787 actList.filter(function(item) { 788 let filterer = moment(item.values().accordion, "DD.MM.YYYY").unix(); //.unix(); 789 //console.log(actList); 790 var partyaffiliationFilter = true; 791 792 if ( 793 startDate != "undefined" && 794 startDate != undefined && 795 startDate != null 796 ) 797 partyaffiliationFilter = 798 (startDate < filterer) & (endDate > filterer); 799 return partyaffiliationFilter; 800 }); 801 actList.update(); 802 } 803 console.log('Test 768'); 804 console.log(actList); 805 806 $("#selectedDate").change(updateActList); 807 actList.on("updated", function(list) { 808 if (list.matchingItems.length > 0) { 809 $("#act .no_elements").hide(); 810 } else { 811 $("#act .no_elements").show(); 812 } 813 }); 814 console.log('Test 778'); 815 actList.update(); 816 }*/ 817 818 // Filter NEWS AND TERMS 819 820 if ($("#news").length) { 821 $("#news .no_elements").hide(); 822 var newsList = new List("news", { 823 valueNames: [ 824 "news-element", 825 { 826 name: "news_category", 827 attr: "data-category", 828 }, 829 { 830 name: "news_box", 831 attr: "data-date", 832 }, 833 { 834 name: "news_box", 835 attr: "data-title", 836 }, 837 ], 838 }); 839 840 const initialCategory = $("#selectCategory").val(); 841 const initialDateRange = $("#selectedDate").data("daterangepicker"); 842 843 function updateNewsList() { 844 /*let startDate = moment( 845 $("#selectedDate").data("daterangepicker").startDate 846 ).unix(); 847 let endDate = moment( 848 $("#selectedDate").data("daterangepicker").endDate 849 ).unix();*/ 850 newsList.filter(function (item) { 851 /* let dateFilter = moment(item.values().news_box, "DD.MM.YYYY").unix(); //.unix(); 852 var dateFilterBoolean = true; 853 let review = $("#selectedDate").val(); 854 855 if ( 856 review != "undefined" && 857 review != undefined && 858 review != null && 859 review != "" 860 ) 861 dateFilterBoolean = (startDate < dateFilter) & (endDate > dateFilter); 862 */ 863 let categoryFilter = $("#selectCategory").val(); 864 var categoryFilterBoolean = true; 865 866 if (categoryFilter != "undefined" && categoryFilter != undefined && categoryFilter != null) categoryFilterBoolean = item.values().news_category.includes(categoryFilter); 867 return categoryFilterBoolean; 868 });
869 newsList.update(); 870 } 871 872 if ($("#selectedDate").length > 0) { 873 updateNewsList(); 874 } 875 876 var beforeStartDate = initialStartDate, 877 beforeEndDate = initialEndDate; 878 879 /*$('#selectedDate').on('hide.daterangepicker', function(ev, picker) { 880 //do something, like clearing an input 881 //$("#selectedDate").data('daterangepicker').setStartDate(moment(beforeStartDate)); 882 //$("#selectedDate").data('daterangepicker').setEndDate(moment(beforeEndDate)); 883 }); 884 885 $('#selectedDate').on('cancel.daterangepicker', function(ev, picker) { 886 //do something, like clearing an input 887 $("#selectedDate").data('daterangepicker').setStartDate(moment(initialStartDate)); 888 $("#selectedDate").data('daterangepicker').setEndDate(moment(initialEndDate)); 889 updateNewsList(); 890 }); 891 892 $('#selectedDate').on('apply.daterangepicker', function(ev, picker) { 893 //do something, like clearing an input 894 beforeStartDate = $("#selectedDate").data('daterangepicker').startDate; 895 beforeEndDate = $("#selectedDate").data('daterangepicker').endDate; 896 updateNewsList(); 897 });*/ 898 899 //$("#selectedDate").change(updateNewsList); 900 $("#selectCategory").change(updateNewsList); 901 newsList.on("updated", function (list) { 902 if (list.matchingItems.length > 0) { 903 $("#news .no_elements").hide(); 904 } else { 905 $("#news .no_elements").show(); 906 } 907 }); 908 newsList.update(); 909 } 910 911 if ($("#term").length) { 912 $("#term .no_elements").hide(); 913 914 var terminList = new List("term", { 915 valueNames: [ 916 "termin-search", 917 { 918 name: "termine", 919 attr: "data-date", 920 }, 921 { 922 name: "term_category", 923 attr: "data-category", 924 }, 925 { 926 name: "termine", 927 attr: "data-title", 928 }, 929 ], 930 }); 931 932 function updateTerminList() { 933 /*let startDate = moment( 934 $("#selectedDate").data("daterangepicker").startDate 935 ).unix(); 936 let endDate = moment( 937 $("#selectedDate").data("daterangepicker").endDate 938 ).unix();*/ 939 terminList.filter(function (item) { 940 /*let filterer = moment(item.values().termine, "DD.MM.YYYY").unix(); //.unix(); 941 942 var partyaffiliationFilter = true; 943 944 if ( 945 startDate != "undefined" && 946 startDate != undefined && 947 startDate != null 948 ) 949 partyaffiliationFilter = (startDate < filterer) & (endDate > filterer); 950 */ 951 let categoryFilter = $("#selectCategory").val(); 952 var categoryFilterBoolean = true; 953 954 if (categoryFilter != "undefined" && categoryFilter != undefined && categoryFilter != null) categoryFilterBoolean = item.values().term_category.includes(categoryFilter); 955 //console.log(categoryFilterBoolean); 956 957 return categoryFilterBoolean; 958 }); 959 terminList.update(); 960 } 961 962 //$("#selectedDate").change(updateTerminList); 963 $("#selectCategory").change(updateTerminList); 964 965 terminList.on("updated", function (list) { 966 if (list.matchingItems.length > 0) { 967 $("#term .no_elements").hide(); 968 } else { 969 $("#term .no_elements").show(); 970 } 971 }); 972 terminList.update(); 973 } 974 975 //if ($("#selectedDate").length > 0) { 976 // updateTerminList(); 977 //} 978 979 //only click without drag 980 var isDragging = false; 981 $("a[target].slick-slide") 982 .on("click", function (e) { 983 e.preventDefault(); 984 if (!isDragging) { 985 var tab = window.open($(this).attr("href"), $(this).attr("target")); 986 tab.focus(); 987 } 988 }) 989 .mousedown(function () { 990 isDragging = false; 991 }) 992 .mousemove(function () { 993 isDragging = true; 994 }); 995 996 $(".slick-slide") 997 .find("a[target]") 998 .on("click", function (e) { 999 e.preventDefault(); 1000 if (!isDragging) { 1001 var tab = window.open($(this).attr("href"), $(this).attr("target")); 1002 tab.focus(); 1003 } 1004 }) 1005 .mousedown(function () { 1006 isDragging = false; 1007 }) 1008 .mousemove(function () { 1009 isDragging = true; 1010 }); 1011 1012 var storageService = function () { 1013 var STORAGE_KEY = "bookmarkitems"; 1014 var bookmarkitems = {}; 1015 1016 var init = function () { 1017 bookmarkitems = localStorage.getItem(STORAGE_KEY); 1018 if (bookmarkitems) { 1019 bookmarkitems = JSON.parse(bookmarkitems); 1020 } else { 1021 bookmarkitems = {}; 1022 } 1023 }; 1024 1025 var set = function (key, value) { 1026 bookmarkitems[key] = value; 1027 updateStorage(); 1028 }; 1029 1030 var get = function (key) { 1031 return bookmarkitems[key]; 1032 }; 1033 1034 var updateStorage = function () { 1035 localStorage.setItem(STORAGE_KEY, JSON.stringify(bookmarkitems)); 1036 }; 1037 1038 return { 1039 init: init, 1040 set: set, 1041 get: get, 1042 updateStorage: updateStorage, 1043 }; 1044 }; 1045 1046 function removeMarkerItem(arrayPos, markerKey, marker) { 1047 marker.init(); 1048 let items = marker.get(markerKey); 1049 items.splice(arrayPos, 1); 1050 marker.set(markerKey, items); 1051 location.reload(); 1052 } 1053 1054 // Bookmark functions for Sites 1055 1056 $(".bookmarkme").on("click", function () { 1057 var marker = storageService(); 1058 let markerKey = "sites"; 1059 let url = window.location.href; 1060 1061 let pathnames = window.location.pathname.split("/"); 1062 let dateToday = moment().format("D.MM.YYYY"); 1063 pathnames.shift(); 1064 let siteLink = { 1065 url: url, 1066 pathnames: pathnames, 1067 date: dateToday, 1068 }; 1069 1070 marker.init(); 1071 if (marker.get(markerKey) === undefined) { 1072 marker.set(markerKey, [siteLink]); 1073 } else { 1074 let sites = marker.get(markerKey); 1075 sites.push(siteLink); 1076 marker.set(markerKey, sites); 1077 } 1078 }); 1079 1080 if ($("#markedSites").length > 0) { 1081 var marker = storageService(); 1082 let markerKey = "sites"; 1083 1084 marker.init(); 1085 if (marker.get(markerKey) === undefined || marker.get(markerKey).length <= 0) { 1086 $("#markedSites").html("<p>Keine gemerkte Inhalte gefunden.</p>"); 1087 } else { 1088 let sites = marker.get(markerKey); 1089 $("#markedSites").append('<div class="container"></div>');
1090 sites.forEach((site, index) => { 1091 var fullPath = ""; 1092 site.pathnames.forEach((path) => { 1093 fullPath += "<span class='markerBreadcrumb'>" + path + "</span> "; 1094 }); 1095 1096 $("#markedSites .container").append( 1097 '<div class="row">' + 1098 '<div class="col-12 col-sm-12 col-md-12 col-lg-10">' + 1099 "<p>Gemerkt am: " + 1100 site.date + 1101 "<br>" + 1102 '<a href="' + 1103 site.url + 1104 '">' + 1105 fullPath + 1106 "</a>" + 1107 "</div>" + 1108 '<div class="col-12 col-sm-12 col-md-12 col-lg-2">' + 1109 '<button type="button" class="btn btn-outline-primary merken-btn w-100 w-sm-100 remove-marker" data-position="' + 1110 index + 1111 '">' + 1112 '<svg class="merken-svg-wrapper" xmlns="http://www.w3.org/2000/svg" viewBox="-4 -2 35 35">' + 1113 "<g>" + 1114 "<g>" + 1115 '<polygon class="icon-top-merken" points="23.51 28.35 4.91 28.35 3.18 4.42 25.24 4.42 23.51 28.35"></polygon>' + 1116 '<line class="icon-top-merken" x1="0.6" y1="4.42" x2="27.82" y2="4.42"></line>' + 1117 '<polygon class="icon-top-merken" points="16.98 0.6 11.35 0.6 10.15 4.42 18.27 4.42 16.98 0.6"></polygon>' + 1118 '<line class="icon-top-merken" x1="14.22" y1="8.27" x2="14.22" y2="24.42"></line>' + 1119 '<line class="icon-top-merken" x1="19.95" y1="8.27" x2="18.88" y2="24.42"></line>' + 1120 '<line class="icon-top-merken" x1="8.49" y1="8.27" x2="9.56" y2="24.42"></line>' + 1121 "</g>" + 1122 "</g>" + 1123 "</svg>" + 1124 "</button>" + 1125 "</div>" + 1126 "</div>" 1127 ); 1128 }); 1129 } 1130 } 1131 1132 $(".remove-marker").on("click", function () { 1133 let arrayPos = $(this).data().position; 1134 let markerKey = "sites"; 1135 var marker = storageService(); 1136 removeMarkerItem(arrayPos, markerKey, marker); 1137 }); 1138 1139 // Bookmark functions for News 1140 1141 $(".bookmarknews").on("click", function () { 1142 var marker = storageService(); 1143 let markerKey = "news"; 1144 let url = window.location.href; 1145 let title = $("#page-title").text().trim(); 1146 let dateToday = moment().format("D.MM.YYYY"); 1147 1148 let siteLink = { 1149 url: url, 1150 date: dateToday, 1151 title: title, 1152 }; 1153 1154 marker.init(); 1155 if (marker.get(markerKey) === undefined) { 1156 marker.set(markerKey, [siteLink]); 1157 } else { 1158 let sites = marker.get(markerKey); 1159 sites.push(siteLink); 1160 marker.set(markerKey, sites); 1161 } 1162 }); 1163 1164 if ($("#markedNews").length > 0) { 1165 var marker = storageService(); 1166 let markerKey = "news"; 1167 1168 marker.init(); 1169 if (marker.get(markerKey) === undefined || marker.get(markerKey).length <= 0) { 1170 $("#markedNews").html("<p>Keine gemerkte Inhalte gefunden.</p>"); 1171 } else { 1172 let sites = marker.get(markerKey); 1173 let type = ""; 1174 $("#markedNews").append('<div class="container"></div>'); 1175 sites.forEach((site, index) => { 1176 switch (site.type) { 1177 case "announcement": 1178 type = "Kundmachung"; 1179 break; 1180 case "act": 1181 type = "Verordnung"; 1182 break; 1183 default: 1184 type = "Neuigkeit"; 1185 break; 1186 } 1187 1188 $("#markedNews .container").append( 1189 '<div class="row">' + 1190 '<div class="col-12 col-sm-12 col-md-12 col-lg-10">' + 1191 "<p>Gemerkt am: " + 1192 site.date + 1193 " [" + 1194 type + 1195 "]<br>" + 1196 '<a href="' + 1197 site.url + 1198 '">' + 1199 site.title + 1200 "</a>" + 1201 "</div>" + 1202 '<div class="col-12 col-sm-12 col-md-12 col-lg-2">' + 1203 '<button type="button" class="btn btn-outline-primary merken-btn w-100 w-sm-100 remove-marker-news" data-position="' + 1204 index + 1205 '">' + 1206 '<svg class="merken-svg-wrapper" xmlns="http://www.w3.org/2000/svg" viewBox="-4 -2 35 35">' + 1207 "<g>" + 1208 "<g>" + 1209 '<polygon class="icon-top-merken" points="23.51 28.35 4.91 28.35 3.18 4.42 25.24 4.42 23.51 28.35"></polygon>' + 1210 '<line class="icon-top-merken" x1="0.6" y1="4.42" x2="27.82" y2="4.42"></line>' + 1211 '<polygon class="icon-top-merken" points="16.98 0.6 11.35 0.6 10.15 4.42 18.27 4.42 16.98 0.6"></polygon>' + 1212 '<line class="icon-top-merken" x1="14.22" y1="8.27" x2="14.22" y2="24.42"></line>' + 1213 '<line class="icon-top-merken" x1="19.95" y1="8.27" x2="18.88" y2="24.42"></line>' + 1214 '<line class="icon-top-merken" x1="8.49" y1="8.27" x2="9.56" y2="24.42"></line>' + 1215 "</g>" + 1216 "</g>" + 1217 "</svg>" + 1218 "</button>" + 1219 "</div>" + 1220 "</div>" 1221 ); 1222 }); 1223 } 1224 } 1225 1226 $(".remove-marker-news").on("click", function () { 1227 let arrayPos = $(this).data().position; 1228 let markerKey = "news"; 1229 var marker = storageService(); 1230 removeMarkerItem(arrayPos, markerKey, marker); 1231 }); 1232 1233 // Bookmark functions for Term 1234 1235 $(".bookmarkterm").on("click", function () { 1236 var marker = storageService(); 1237 let markerKey = "term"; 1238 let url = window.location.href; 1239 let title = $("#page-title").text().trim(); 1240 let dateToday = moment().format("D.MM.YYYY"); 1241 1242 let siteLink = { 1243 url: url, 1244 date: dateToday, 1245 title: title, 1246 }; 1247 1248 marker.init(); 1249 if (marker.get(markerKey) === undefined) { 1250 marker.set(markerKey, [siteLink]); 1251 } else { 1252 let sites = marker.get(markerKey); 1253 sites.push(siteLink); 1254 marker.set(markerKey, sites); 1255 } 1256 }); 1257 1258 if ($("#markedTerm").length > 0) { 1259 var marker = storageService(); 1260 let markerKey = "term"; 1261 1262 marker.init(); 1263 if (marker.get(markerKey) === undefined || marker.get(markerKey).length <= 0) { 1264 $("#markedTerm").html("<p>Keine gemerkte Inhalte gefunden.</p>"); 1265 } else { 1266 let terms = marker.get(markerKey); 1267 $("#markedTerm").append('<div class="container"></div>');
1268 terms.forEach((site, index) => { 1269 $("#markedTerm .container").append( 1270 '<div class="row">' + 1271 '<div class="col-12 col-sm-12 col-md-12 col-lg-10">' + 1272 "<p>Gemerkt am: " + 1273 site.date + 1274 "<br>" + 1275 '<a href="' + 1276 site.url + 1277 '">' + 1278 site.title + 1279 "</a>" + 1280 "</div>" + 1281 '<div class="col-12 col-sm-12 col-md-12 col-lg-2">' + 1282 '<button type="button" class="btn btn-outline-primary merken-btn w-100 w-sm-100 remove-marker-term" data-position="' + 1283 index + 1284 '">' + 1285 '<svg class="merken-svg-wrapper" xmlns="http://www.w3.org/2000/svg" viewBox="-4 -2 35 35">' + 1286 "<g>" + 1287 "<g>" + 1288 '<polygon class="icon-top-merken" points="23.51 28.35 4.91 28.35 3.18 4.42 25.24 4.42 23.51 28.35"></polygon>' + 1289 '<line class="icon-top-merken" x1="0.6" y1="4.42" x2="27.82" y2="4.42"></line>' + 1290 '<polygon class="icon-top-merken" points="16.98 0.6 11.35 0.6 10.15 4.42 18.27 4.42 16.98 0.6"></polygon>' + 1291 '<line class="icon-top-merken" x1="14.22" y1="8.27" x2="14.22" y2="24.42"></line>' + 1292 '<line class="icon-top-merken" x1="19.95" y1="8.27" x2="18.88" y2="24.42"></line>' + 1293 '<line class="icon-top-merken" x1="8.49" y1="8.27" x2="9.56" y2="24.42"></line>' + 1294 "</g>" + 1295 "</g>" + 1296 "</svg>" + 1297 "</button>" + 1298 "</div>" + 1299 "</div>" 1300 ); 1301 }); 1302 } 1303 } 1304 1305 $(".remove-marker-term").on("click", function () { 1306 let arrayPos = $(this).data().position; 1307 let markerKey = "term"; 1308 var marker = storageService(); 1309 removeMarkerItem(arrayPos, markerKey, marker); 1310 }); 1311 1312 $(".marker-act").on("click", function () { 1313 var marker = storageService(); 1314 let markerKey = "news"; 1315 let acc = $(this).data().acc; 1316 let url = window.location.href.split("?")[0] + "?open_acc=" + acc; 1317 let title = $('.card-header[data-target="#' + acc + '"]') 1318 .text() 1319 .trim(); 1320 let dateToday = moment().format("D.MM.YYYY"); 1321 1322 let siteLink = { 1323 url: url, 1324 date: dateToday, 1325 title: title, 1326 type: "act", 1327 }; 1328 1329 marker.init(); 1330 if (marker.get(markerKey) === undefined) { 1331 marker.set(markerKey, [siteLink]); 1332 } else { 1333 let sites = marker.get(markerKey); 1334 sites.push(siteLink); 1335 marker.set(markerKey, sites); 1336 } 1337 }); 1338 1339 // Bookmark functions for Busineesscard 1340 1341 $(".card-marker").on("click", function () { 1342 var marker = storageService(); 1343 let markerKey = "cards"; 1344 let card = $(this).data().card; 1345 let type = $(this).data().type; 1346 let url = window.location.href.split("?")[0] + "?card=" + card; 1347 let name = $("#" + card + " .name") 1348 .text() 1349 .trim(); 1350 let dateToday = moment().format("D.MM.YYYY"); 1351 1352 let siteLink = { 1353 url: url, 1354 date: dateToday, 1355 name: name, 1356 type: type, 1357 }; 1358 1359 marker.init(); 1360 if (marker.get(markerKey) === undefined) { 1361 marker.set(markerKey, [siteLink]); 1362 } else { 1363 let cards = marker.get(markerKey); 1364 cards.push(siteLink); 1365 marker.set(markerKey, cards); 1366 } 1367 }); 1368 1369 if ($("#markedCards").length > 0) { 1370 var marker = storageService(); 1371 let markerKey = "cards"; 1372 1373 marker.init(); 1374 if (marker.get(markerKey) === undefined || marker.get(markerKey).length <= 0) { 1375 $("#markedCards").html("<p>Keine gemerkte Inhalte gefunden.</p>"); 1376 } else { 1377 let cards = marker.get(markerKey); 1378 let type = ""; 1379 $("#markedCards").append('<div class="container"></div>'); 1380 cards.forEach((card, index) => { 1381 switch (card.type) { 1382 case "politician": 1383 type = "Politiker"; 1384 break; 1385 case "employee": 1386 type = "Mitarbeiter"; 1387 break; 1388 } 1389 1390 $("#markedCards .container").append( 1391 '<div class="row">' + 1392 '<div class="col-12 col-sm-12 col-md-12 col-lg-10">' + 1393 "<p>Gemerkt am: " + 1394 card.date + 1395 " [" + 1396 type + 1397 "]<br>" + 1398 '<a href="' + 1399 card.url + 1400 '">' + 1401 card.name + 1402 "</a>" + 1403 "</div>" + 1404 '<div class="col-12 col-sm-12 col-md-12 col-lg-2">' + 1405 '<button type="button" class="btn btn-outline-primary merken-btn w-100 w-sm-100 remove-marker-card" data-position="' + 1406 index + 1407 '">' + 1408 '<svg class="merken-svg-wrapper" xmlns="http://www.w3.org/2000/svg" viewBox="-4 -2 35 35">' + 1409 "<g>" + 1410 "<g>" + 1411 '<polygon class="icon-top-merken" points="23.51 28.35 4.91 28.35 3.18 4.42 25.24 4.42 23.51 28.35"></polygon>' + 1412 '<line class="icon-top-merken" x1="0.6" y1="4.42" x2="27.82" y2="4.42"></line>' + 1413 '<polygon class="icon-top-merken" points="16.98 0.6 11.35 0.6 10.15 4.42 18.27 4.42 16.98 0.6"></polygon>' + 1414 '<line class="icon-top-merken" x1="14.22" y1="8.27" x2="14.22" y2="24.42"></line>' + 1415 '<line class="icon-top-merken" x1="19.95" y1="8.27" x2="18.88" y2="24.42"></line>' + 1416 '<line class="icon-top-merken" x1="8.49" y1="8.27" x2="9.56" y2="24.42"></line>' + 1417 "</g>" + 1418 "</g>" + 1419 "</svg>" + 1420 "</button>" + 1421 "</div>" + 1422 "</div>" 1423 ); 1424 }); 1425 } 1426 } 1427 1428 $(".remove-marker-card").on("click", function () { 1429 let arrayPos = $(this).data().position; 1430 let markerKey = "cards"; 1431 var marker = storageService(); 1432 removeMarkerItem(arrayPos, markerKey, marker); 1433 }); 1434 1435 /**revert accordian Header wrap**/ 1436 /** accordion header wrap in tag a */ 1437 1438 /*$(".accordion .card-header").wrap('<a href="#" rel="nofollow" class="card-header-wrap-a"/>'); 1439 1440 $(document).on('keydown', '.card-header-wrap-a', function (e) { 1441 var key = e.which; 1442 if(key == 13) { 1443 $(this).find(".card-header").trigger("click"); 1444 return false;
1445 } 1446}); 1447 1448 $(document).on("click", ".card-header-wrap-a",function(event){ 1449 event.preventDefault(); 1450 1451 $(this).find(".card-header").trigger("click"); 1452 1453 });*/ 1454 1455 /**revert download link**/ 1456 /** add attribute href for tag a in download link for focus */ 1457 1458 /* $(".download").each(function(){ 1459 var linkDownload = $(this); 1460 linkDownload.attr("href","#"); 1461 1462 }); 1463 1464 $(".download").click(function(event){ 1465 event.preventDefault(); 1466 })*/ 1467 1468 //alt + 0 --- Startseite 1469 //alt + 1 --- Inhalt 1470 //alt + 2 --- Suche 1471 //alt + 3 --- Kontakt 1472 document.onkeyup = function (e) { 1473 if (e.altKey && e.which == 48) { 1474 //alt + 0 --- Startseite 1475 window.location = "/"; 1476 } else if (e.altKey && e.which == 49) { 1477 //alt + 1 --- Inhalt 1478 window.location.hash = "#page-content"; 1479 } else if (e.altKey && e.which == 50) { 1480 //alt + 2 --- Suche 1481 focusSearchField(); 1482 } else if (e.altKey && e.which == 51) { 1483 //alt + 3 --- Kontakt 1484 window.location.hash = "#page-footer"; 1485 } 1486 }; 1487 1488 $(".skiplink.content").click(function () { 1489 window.location.hash = "#page-content"; 1490 }); 1491 1492 $(".skiplink.contact").click(function () { 1493 window.location.hash = "#page-footer"; 1494 }); 1495 1496 $("a.skiplink.search").click(function () { 1497 focusSearchField(); 1498 }); 1499 1500 /* menu items accessibility 1501 var menus = document.querySelectorAll('.dropdown'); 1502 var navlinks = document.querySelectorAll('.nav-link'); 1503 const event = new Event('mouseover',{ bubbles: true, cancelable: false }) 1504 1505 console.log('menu => ', menus); 1506 menus.forEach(menu => { 1507 menu.addEventListener( 'mouseover', function(e) { 1508 //e.target.style.background = "pink"; 1509 console.log('item'); 1510 //this.querySelector('.nav-link').classList.add('show'); 1511 //this.lastElementChild.classList.add('show'); 1512 }); 1513 menu.addEventListener( 'focus', function(e) { 1514 this.querySelector('.nav-link').classList.remove('show'); 1515 this.lastElementChild.classList.remove('show'); 1516 }); 1517 });*/ 1518 1519 /* navlinks.forEach(link => { 1520 link.addEventListener('focus', function(e) { 1521 //e.target.style.background = "pink"; 1522 //console.log('item'+e); 1523 //link.classList.add('activeFocus'); 1524 //has focus open dropdown menu 1525 link.parentElement.style.background = "pink"; 1526 var parent = link.parentNode.parentNode; 1527 console.log(parent) 1528 //parent.children[1].style.display = "block"; 1529 parent.dispatchEvent(event); 1530 }); 1531 link.addEventListener('blur', function(e) { 1532 //link.classList.remove('activeFocus'); 1533 }); 1534 }); */ 1535}); 1536 1537window.addEventListener("load", activateStickyFooter); 1538 1539function activateStickyFooter() { 1540 adjustFooterCssTopToSticky(); 1541 window.addEventListener("resize", adjustFooterCssTopToSticky); 1542} 1543 1544function adjustFooterCssTopToSticky() { 1545 const footer = document.querySelector(".section-footer"); 1546 const bounding_box = footer.getBoundingClientRect(); 1547 const footer_height = bounding_box.height; 1548 const window_height = window.innerHeight; 1549 const above_footer_height = bounding_box.top - getCssTopAttribute(footer); 1550 if (above_footer_height + footer_height <= window_height) { 1551 const new_footer_top = window_height - (above_footer_height + footer_height); 1552 footer.style.top = new_footer_top + "px"; 1553 document.querySelector("#content-footer").style.top = new_footer_top + "px"; 1554 document.querySelector("#content-footer").style.position = "relative"; 1555 document.querySelector("#content-footer").style.borderTop = "1px solid #dedede"; 1556 } else if (above_footer_height + footer_height > window_height) { 1557 footer.style.top = null; 1558 } 1559} 1560 1561function getCssTopAttribute(htmlElement) { 1562 const top_string = htmlElement.style.top; 1563 if (top_string === null || top_string.length === 0) { 1564 return 0; 1565 } 1566 const extracted_top_pixels = top_string.substring(0, top_string.length - 2); 1567 return parseFloat(extracted_top_pixels); 1568} 1569 1570//scroll to accordion and open all parents 1571if (location.href.indexOf("#") != -1) { 1572 //console.log(location.hash); 1573 var elementHash = location.hash; 1574 var accCardHeader = $(elementHash).children(".card-header"); 1575 var accCardContent = $(elementHash).children(".card-content"); 1576 accCardHeader.removeClass("collapsed"); 1577 accCardHeader.attr("aria-expanded", "true"); 1578 accCardContent.addClass("show"); 1579 var parentAcc = $(elementHash).parent().parent().parent().parent().parent().parent(); 1580 while (parentAcc.hasClass("acc-gemeinde")) { 1581 parentAcc = $(elementHash).parent().parent().parent().parent().parent().parent(); 1582 elementHash = "#" + parentAcc.attr("id"); 1583 1584 var accCardHeader = $(elementHash).children(".card-header"); 1585 var accCardContent = $(elementHash).children(".card-content"); 1586 accCardHeader.removeClass("collapsed"); 1587 accCardHeader.attr("aria-expanded", "true"); 1588 accCardContent.addClass("show"); 1589 } 1590 window.scrollTo(window.scrollX, window.scrollY - 100); 1591} 1592 1593function focusSearchField() { 1594 $(".header-search-front:visible input:first").focus(); 1595}
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.