PageSourceSearch

https://www.eutingen-im-gaeu.de/typo3conf/ext/cm_package/Resources…/JavaScript/Dist/scripts.js?1728561050

js eutingen-im-gaeu.de collected 2026-10-02 22:16:31 UTC 6,150 bytes, 172 lines download raw bytes

1let toggleHomeNewsArticleId = 0;
2
3document.addEventListener("DOMContentLoaded", function () {
4    prepareNewsSlider();
5    prepareFallbackImages();
6    prepareFallbackImagesHighlights();
7    translateCarouselButtons();
8    removePowermailLegend();
9    prepareSlider(1);
10});
11
12window.addEventListener("load", function () {
13    $("#carousel-highlightNews .carousel-indicators").prependTo("#carousel-highlightNews .carousel-inner .carousel-item .news .index-container-news");
14    showDetailsHeader();
15});
16
17function prepareFallbackImagesHighlights() {
18    $(".section-highlights .teaserPicture:not('.no-fallback') a, .section-highlights a.teaserPicture:not('.no-fallback')").each(function () {
19        $(this).empty();
20        $(this).append("<img class='fallback' src='" + PLACEHOLDER_IMAGE_PATH_HIGHLIGHTS + "'/>");
21    });
22}
23
24// Startpage newsslider
25PUBLISH_NEWS_CAROUSEL_CONFIG = [
26    {
27        id: "normalNews",
28        sm: 1,
29        md: 2,
30        lg: 2,
31        default: 4,
32        interval: 10000,
33        transition: "slide",
34    },
35    {
36        id: "highlightNews",
37        sm: 1,
38        md: 1,
39        lg: 1,
40        default: 1,
41        transition: "slide",
42        interval: 6000,
43    }
44]
45
46if (typeof PUBLISH_NEWS_HOME_AMOUNT === 'undefined') {
47    PUBLISH_NEWS_HOME_AMOUNT = 3
48}
49if (typeof PUBLISH_NEWS_HOME_AMOUNT_MD === "undefined") {
50    PUBLISH_NEWS_HOME_AMOUNT_MD = 2
51}
52if (typeof PUBLISH_NEWS_HOME_AMOUNT_SM === "undefined") {
53    PUBLISH_NEWS_HOME_AMOUNT_SM = 1
54}
55
56document.addEventListener("DOMContentLoaded", function () {
57    prepareNewsSlider(PUBLISH_NEWS_HOME_AMOUNT);
58});
59
60window.addEventListener('resize', function () {
61    prepareNewsSlider(PUBLISH_NEWS_HOME_AMOUNT);
62});
63
64function prepareNewsSlider() {
65    PUBLISH_NEWS_CAROUSEL_CONFIG.forEach(function (config) {
66
67        let displayCount = config.default;
68        if (window.innerWidth < breakpoint("xl")) {
69            displayCount = config.lg;
70        }
71
72        if (window.innerWidth < breakpoint("lg")) {
73            displayCount = config.md;
74        }
75
76        if (window.innerWidth < breakpoint("md")) {
77            displayCount = config.sm;
78        }
79
80        let carouselSelector = "#carousel-" + config.id;
81
82        if ($(carouselSelector).length == 0) {
83            //carousel does not exist yet
84            $("#".concat(config.id)).attr('id', carouselSelector.substr(1, carouselSelector.length));
85            $(carouselSelector).addClass("carousel slide");
86            if (config.transition) {
87                $(carouselSelector).addClass("carousel-" + config.transition);
88            }
89            $(carouselSelector).prepend('<ol class="carousel-indicators"></ol>');
90
91            $(carouselSelector).carousel({
92                interval: config.interval || false,
93            });
94        }
95
96        $(carouselSelector.concat(" .carousel-control-prev")).remove();
97        $(carouselSelector.concat(" .carousel-control-next")).remove();
98        $(carouselSelector.concat(" .carousel-indicators >")).remove();
99        $(carouselSelector.concat(" .carousel-item")).unwrap();
100        $(carouselSelector.concat(" .carousel-item li.news")).unwrap();
101
102        var allArticles = $(carouselSelector.concat(" li.news"));
103        for (var i = 0; i < allArticles.length; i += displayCount) {
104            allArticles.slice(i, i + displayCount).wrapAll("<div class='carousel-item'></div>");
105        }
106
107        $(carouselSelector.concat(" .carousel-item")).wrapAll("<div class='carousel-inner'></div>");
108        var allItems = $(carouselSelector.concat(" .carousel-item"));
109        for (var i = 0; i < allItems.length; i++) {
110            $(carouselSelector.concat(" .carousel-indicators")).append('<li data-target="' + carouselSelector + '" data-slide-to="' + i + '"></li>')
111        }
112
113        $(carouselSelector.concat(" .carousel-item:first-child()")).addClass("active");
114        $(carouselSelector.concat(" .carousel-indicators li:first-child()")).addClass("active");
115
116        if (allArticles.length > displayCount) {
117            var prevButton = '<a id="' + carouselSelector + 'Prev" class="carousel-control-prev" href="' + carouselSelector + '" role="button" data-sli
117de="prev"><span class="carousel-control-prev-icon" aria-hidden="true"></span><span class="sr-only">Previous</span></a>';
118            var nextButton = '<a id="' + carouselSelector + 'Next" class="carousel-control-next" href="' + carouselSelector + '" role="button" data-slide="next"><span class="carousel-control-next-icon" aria-hidden="true"></span><span class="sr-only">Next</span></a>';
119            $(carouselSelector).append(prevButton);
120            $(carouselSelector).append(nextButton);
121        }
122
123    })
124}
125
126/**
127 * Function to open and close the teaser text of a news article on the start page.
128 * @param newsID
129 */
130function toggleHomeNewsArticle(newsID) {
131    let newsArticle = $("#news_" + newsID);
132
133    if (newsArticle.hasClass("showTeaser")) {
134        newsArticle.removeClass("showTeaser");
135        toggleHomeNewsArticleId = 0;
136    } else {
137        if (toggleHomeNewsArticle != 0) {
138            $("#news_" + toggleHomeNewsArticleId).removeClass("showTeaser");
139        }
140
141        newsArticle.addClass("showTeaser");
142        toggleHomeNewsArticleId = newsID;
143    }
144}
145
146/**
147 * Function to translate the "Previous" and "Next" buttons for accessibility.
148 */
149function translateCarouselButtons() {
150    // Suche nach den Previous- und Next-Buttons anhand der entsprechenden Klassen
151    var prevButton = document.querySelector('.carousel-control-prev .sr-only');
152    var nextButton = document.querySelector('.carousel-control-next .sr-only');
153
154    // Überprüfen, ob die Elemente gefunden wurden und den Text ändern
155    if (prevButton) {
156        prevButton.textContent = 'Zurück';
157    }
158
159    if (nextButton) {
160        nextButton.textContent = 'Weiter';
161    }
162}
163
164function removePowermailLegend() {
165    // Wählt alle Legend-Elemente mit der Klasse "powermail_legend" aus
166    var legends = document.querySelectorAll('legend.powermail_legend');
167
168    // Durch die ausgewählten Elemente iterieren und jedes aus dem DOM entfernen
169    legends.forEach(function (legend) {
170        legend.remove();
171    });
172}

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.