PageSourceSearch

https://www.sonntag-sachsen.de/sites/all/themes/eva_ns/js/main.js?tgvefv

js sonntag-sachsen.de collected 2026-10-02 10:39:49 UTC 17,487 bytes, 487 lines download raw bytes

1(function($) {
2  $(document).ready(function() {
3    /* COOCKIE TEST */
4    var $url = window.location.href;
5    var $login_str = "user/login";
6    var $message = "Ihr Browser akzeptiert keine Cookies. Bitte beachten Sie, dass in diesem Fall die Anmeldung nicht korrekt funktioniert.";
7    if ($url.indexOf($login_str) >= 0) {
8      if (!areCookiesEnabled()) {
9        jQuery('.content_wrapper  > .content').prepend('<div class="drupal-messages"></div>');
10        jQuery(".drupal-messages").append('<div class="messages warning"><b>Achtung:</b> ' + $message + '</div>');
11      }
12    }
13
14    /** -----------------------------------------------------------------------------
15     EASY TABS
16     ----------------------------------------------------------------------------- */
17    // Aufruf der Funktion für die Artikel-Taps
18    // von http://os.alfajango.com/easytabs
19    // Meistgelesene Artikel / Meistkommentierte Artikel
20    $('#tab-container').easytabs({
21      cache: false
22    });
23
24    /** -----------------------------------------------------------------------------
25     MOBILE MENU
26     ----------------------------------------------------------------------------- */
27    $('.toggle').click(function() {
28      $('.toToggle').toggle();
29      return false;
30    });
31
32    /** -----------------------------------------------------------------------------
33     MAIN DROPDOWN MENU
34     ----------------------------------------------------------------------------- */
35    var mainNavigationLists = $('.main_menu ul li')
36    mainNavigationLists.each(function(index, value) {
37      var list = $(this)
38      var listLink = list.children('a')
39      var listMenu = list.children('ul')
40      if (listMenu.length > 0) {
41        listLink.click(function(event) {
42          event.preventDefault()
43          var targetElement = $(event.target)
44          mainNavigationLists.each(function(index, value) {
45            var list2 = $(this)
46            var listMenu2 = list2.children('ul')
47            if (listMenu2.get(0) !== targetElement.next().get(0)) {
48              listMenu2.removeClass('drop-active')
49            }
50          })
51          listMenu.toggleClass('drop-active')
52        })
53      }
54    })
55    var bodyDocument = $(document.body)
56    bodyDocument.click(function(event) {
57      var targetElement = $(event.target)
58      var allowClose = true
59      if (targetElement.hasClass('expanded')) {
60        allowClose = false
61      }
62      if (targetElement.hasClass('active')) {
63        allowClose = false
64      }
65      if (targetElement.hasClass('leaf')) {
66        allowClose = false
67      }
68      var targetParentElement = targetElement.parent()
69      if (targetParentElement.hasClass('expanded')) {
70        allowClose = false
71      }
72      if (allowClose === true) {
73        mainNavigationLists.each(function(index, value) {
74          var list = $(this)
75          var listMenu = list.children('ul')
76          listMenu.removeClass('drop-active')
77        })
78      }
79    })
80
81    /**
82     * OPEN ALL EXTERNAL LINKS IN NEW TAB
83     *
84     * DEPRECATED: This is only done, if the user role is not admin. If the user is
85     * not an admin, the user_role variable is unset.
86     * Code: Drupal.settings.user_role == undefined
87     *
88     * @see: http://css-tricks.com/snippets/jquery/open-external-links-in-new-window/
89     */
90    $('.span_8_of_12 a').each(function() {
91      var a = new RegExp('/' + window.location.host + '/');
92      if (!a.test(this.href) && (this.href.indexOf('javascript:') == -1)) {
93        $(this).click(function(event) {
94          event.preventDefault();
95          event.stopPropagation();
96          window.open(this.href, '_blank');
97        });
98      }
99    });
100
101    /** -----------------------------------------------------------------------------
102     SELECTRIC
103     ----------------------------------------------------------------------------- */
104    $('select').selectric();
105    //$('select').live('change', function () {
106    //console.log("klfkslkd");
107    //$(this).selectric();
108    //});
109
110    /** -----------------------------------------------------------------------------
111     FLEXSLIDER
112     ----------------------------------------------------------------------------- */
113    $('.flexslider').each(function() {
114      const el = $(this);
115      el.flexslider({
116        animation: "slide",
117        controlNav: el.data('control-nav-disable') ? false : true,
118        prevText: "",
119        nextText: ""
120      });
121    });
122
123    /** -----------------------------------------------------------------------------
124     PROMOAREA
125     ----------------------------------------------------------------------------- */
126    setTimeout(function() {
127      const promoHeight = $('.flexslider ul.slides li:not(".clone"):first img').height();
128      const promoImages = $('.promoarea').find('.promoarea__inner img:not(".promoarea_closeimg")')
129      promoImages.each(function() {
130        const el = $(this);
131        const basicHeight = el.height();
132        if (promoHeight < basicHeight) {
133          el.height(promoHeight + 'px');
134        }
135      });
136    }, 500);
137    $('.promoarea').find('.promoarea__close').click(function(event) {
138      event.preventDefault();
139      event.stopPropagation();
140      $(this).parent().parent('.promoarea').hide();
141      $(this).parent().parent().parent('.promofront').hide();
142    });
143
144    /** -----------------------------------------------------------------------------
145     PODCAST
146     ----------------------------------------------------------------------------- */
147    var podcast_title = Drupal.settings.podcast.latest.title + ' (' + Drupal.settings.podcast.latest.data + ')';
148    $('.jp-title ul li').html(podcast_title);
149    $("#jquery_jplayer_1").jPlayer({
150      ready: function() {
151        jQuery(this).jPlayer("setMedia", {
152          mp3: Drupal.settings.podcast.latest.url
153        });
154      },
155      swfPath: "/sites/all/libraries/jQuery.jPlayer/",
156      supplied: "mp3"
157    });
158
159    /** -----------------------------------------------------------------------------
160     IFRAME MANAGER
161     ----------------------------------------------------------------------------- */
162    const im = iframemanager();
163    im.run({
164      currLang: 'de',
165      autoLang: false,
166      services : {
167        // Youtube
168        youtube : {
169          embedUrl: 'https://www.youtube-nocookie.com/embed/{data-id}',
170          iframe: {
171            allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen;',
172          },
173          cookie: {
174            name: 'cc_youtube'
175          },
176          languages: {
177            de: {
178              notice: 'Diese Video wird von einem Drittanbieter gehostet. Durch das Anzeigen des externen Inhalts akzeptieren Sie die <a rel="noreferrer" href="https://www.youtube.com/t/terms" title="Nutzungsbedindungen" target="_blank">Nutzungsbedindungen</a> von Youtube.',
179              loadBtn: 'Video anzeigen',
180              loadAllBtn: 'Immer anzeigen'
181            }
182          }
183        },
184        // Youtube Serie
185        youtube_serie : {
186          embedUrl: 'https://www.youtube-nocookie.com/embed/videoserie?list={data-id}',
187          iframe: {
188            allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen;',
189          },
190          cookie: {
191            name: 'cc_youtube_serie'
192          },
193          languages: {
194            de: {
195              notice: 'Diese Video wird von einem Drittanbieter gehostet. Durch das Anzeigen des externen Inhalts akzeptieren Sie die <a rel="noreferrer" href="https://www.youtube.com/t/terms" title="Nutzungsbedindungen" target="_blank">Nutzungsbedindungen</a> von Youtube.',
196              loadBtn: 'Video anzeigen',
197              loadAllBtn: 'Immer anzeigen'
198            }
199          }
200        },
201        // Twitter
202        twitter : {
203          cookie: {
204            name: 'cc_twitter'
205          },
206          languages : {
207            de: {
208              notice: 'Dieser Inhalt wird von einem Drittanbieter gehostet. Durch das Anzeigen des externen Inhalts akzeptieren Sie die <a rel="noreferrer noopener" href="https://help.twitter.com/de/rules-and-policies/personal-information" title="Nutzungsbedindungen" target="_blank">Nutzungsbedindungen</a> von twitter.com.',
209              loadBtn: 'Feed anzeigen',
210              loadAllBtn: 'Immer anzeigen'
211            }
212          },
213          onAccept: async (div, setIframe) => {
214            await cc.loadScript('https://platform.twitter.com/widgets.js');
215            await im.childExists({childProperty: 'twttr'});
216            const tweet = await twttr.widgets.createTimeline({
217              sourceType: 'profile',
218              screenName: div.dataset.id
219            }, div.firstElementChild, {
220              height: '577',
221	      chrome: 'noheader, noborders'
222            });
223            tweet && setIframe(tweet.firstChild);
224          },
225          onReject: async (iframe, serviceDiv, showNotice) => {
226              await im.childExists({parent: serviceDiv});
227              showNotice();
228              serviceDiv.querySelector('.twitter-tweet')?.remove();
229          }
230        }
231      }
232    });
233
234    /** -----------------------------------------------------------------------------
235     COOKIE CONSENT
236     ----------------------------------------------------------------------------- */
237    const cc = initCookieConsent();
238    cc.run({
239      current_lang : 'de',
240      autoclear_cookies : false,
241      cookie_name: 'sonntage',
242      cookie_expiration : 182,
243      page_scripts: true,
244      gui_options: {
245          consent_modal: {
246              layout: 'box',
247              position: 'bottom right',
248              transition: 'slide'
249          },
250          settings_modal: {
251              layout: 'box',
252              transition: 'slide'
253          }
254      },
255      onAccept: function (cookie) {
256        if (cc.allowedCategory('thirdparty')) {
257          im.acceptService('all')
258        }
259      },
260      onChange: function (cookie, changed_preferences) {
261        if (!cc.allowedCategory('thirdparty')) {
262          im.rejectService('all')
263        }
264      },
265      languages: {
266        'de': {
267          consent_modal: {
268            title: 'Ihre Datenschutz-Einstellungen',
269            description: 'Wir verwenden Cookies für die Analyse der Webseitenzugriffe und zur Personalisierung der Webseiteninhalte.  <br/> <button type="button" data-cc="c-settings" class="cc-link">Individuelle Einstellungen</button>',
270            primary_btn: {
271              text: 'Alle akzeptieren',
272              role: 'accept_all'
273            },
274            secondary_btn: {
275              text: 'Alle ablehnen',
276              role: 'accept_necessary'
277            }
278          },
279          settings_modal: {
280            title: 'Individuelle Einstellungen',
281            save_settings_btn: 'Einstellungen speichern',
282            accept_all_btn: 'Alle akzeptieren',
283            reject_all_btn: 'Alle ablehnen',
284            close_btn_label: 'Schließen',
285            cookie_table_headers: [
286                {col1: 'Name'},
287                {col2: 'Domain'},
288                {col3: 'Laufzeit'},
289                {col4: 'Beschreibung'}
290            ],
291            blocks: [
292              {
293                title: 'Notwendige Cookies',
294                description: 'Diese Cookies sind für den ordnungsmäßigen Betrieb der Website notwendig.',
295                toggle: {
296                  value: 'necessary',
297                  enabled: true,
298                  readonly: true
299                }
300              },
301              {
302                title: 'Analytische Cookies',
303                description: 'Diese Cookies helfen uns, das Nutzungsverhalten besser zu verstehen.',
304                toggle: {
305                      value: 'analytics',
306                      enabled: false,
307                      readonly: false
308                },
309                cookie_table: [
310                  {
311                    col1: '^_ga',
312                    col2: 'google.com',
313                    col3: '2 Jahre',
314                    col4:
315                      'Wird von Google Analytics verwendet, um Daten darüber zu sammeln, wie oft ein Benutzer die Website besucht hat, sowie Daten für den ersten und den letzten Besuch.',
316                    is_regex: true
317                  },
318                  {
319                    col1: '_gat',
320                    col2: 'google.com',
321                    col3: '1 Tag',
322                    col4: 'Wird von Google Analytics verwendet, um die Anfragerate zu drosseln'
323                  },
324                  {
325                    col1: '_gid',
326                    col2: 'google.com',
327                    col3: '1 Tag',
328                    col4:
329                      'Registriert eine eindeutige ID, die verwendet wird, um statistische Daten darüber zu generieren, wie der Besucher die Website nutzt.'
330                  }
331                ]
332              },
333              {
334                title: 'Dienste von anderen Anbietern',
335                description:
336                  'Diese werden dazu verwendet, um Inhalte von diesen in unsere Webseite einzubinden. Bei diesen Inhalten halten sich um Videos, die in Eigenverantwortung des externen Anbieters liegen.',
337                toggle: {
338                  value: 'thirdparty',
339                  enabled: false,
340                  readonly: false
341                }
342              },
343              {
344                title: 'Mehr Informationen',
345                description: 'Weitere Informationen finden Sie in unserer <a class="cc-link" href="/erklaerung-zum-datenschutz">Datenschutzerklärung</a>.',
346              }
347            ]
348          }
349        }
350      }
351    });
352    const cookieLink = document.querySelectorAll('.js-cookieconsent')
353    if (cookieLink && cc) {
354      cookieLink.forEach((element) => {
355        element.addEventListener('click', (event) => {
356          event.preventDefault()
357          if (event.target) {
358            const target = event.currentTarget
359            if (target !== null) {
360              cc.showSettings()
361            }
362          }
363        })
364      })
365    }
366
367    /**
368     * Function - setColorBox.
369     *
370     */
371    $('a[rel=shadowbox]').each(function() {
372      var getEl = $(this);
373      getEl.colorbox({
374        href: getEl.attr('href'),
375        transition: 'fade',
376        iframe: true,
377        fixed: true,
378        arrowKey: false,
379        preloading: false,
380        scrolling: false,
381        rel: false,
382        width: "95%",
383        height: "95%",
384        onComplete: function() {
385          var getHeight = $("#cboxLoadedContent")[0].getBoundingClientRect().height;
386          $("#cboxLoadedContent iframe").attr('height', getHeight);
387        }
388      });
389    });
390
391    // When the user scrolls down 20px from the top of the document, show the button
392    window.onscroll = function() { scrollFunction() };
393
394    // set google ads to 100% width in order to display them fully visible
395    window.setTimeout(function() {
396      $('div#dfp-ad-content_bereich').find('iframe').contents().find("img").css({
397        'width': '100%',
398        'height': 'auto'
399      });
400    }, 2400);
401  });
402
403  /**
404   * Issue filter for archiv page.
405   * @type {{attach: attach}}
406   */
407  Drupal.behaviors.issueFilterSelectIssue = {
408    attach: function(context, settings) {
409      // Overwrite standard form submit and redirect to a new url which
410      // has the issue tid as parameter.
411      $('#issue-filter-form').submit(function(event) {
412        event.preventDefault();
413        var path = Drupal.settings.basePath + 'archiv',
414          issue_number = $('#edit-issue-number').val();
415
416        if (issue_number.length != 0) {
417          path += '/' + issue_number;
418        }
419
420        window.location = path;
421      });
422
423      // Reinitialize the selectric plugin after Drupal ajax callback.
424      $(document).ajaxComplete(function() {
425        if (window.location.pathname.indexOf("archiv") > -1) {
426          $('select').selectric();
427        }
428      });
429    }
430  }
431})(jQuery);
432
433// function createCookie(name, value, days) {
434//   var expires;
435//   if (days) {
436//     var date = new Date();
437//     date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
438//     expires = "; expires=" + date.toGMTString();
439//   } else expires = "";
440//   document.cookie = name + "=" + value + expires + "; path=/";
441// }
442
443// function readCookie(name) {
444//   var nameEQ = name + "=";
445//   var ca = document.cookie.split(';');
446//   for (var i = 0; i < ca.length; i++) {
447//     var c = ca[i];
448//     while (c.charAt(0) == ' ') c = c.substring(1, c.length);
449//     if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
450//   }
451//   return null;
452// }
453
454// function eraseCookie(name) {
455//   createCookie(name, "", -1);
456// }
457
458// function areCookiesEnabled() {
459//   var r = false;
460//   createCookie("testing", "Hello", 1);
461//   if (readCookie("testing") != null) {
462//     r = true;
463//     eraseCookie("testing");
464//   }
465//   return r;
466// }
467
468function scrollFunction() {
469  // To top Button
470  my2TopButton = document.getElementById("to-top-button");
471
472  if (!my2TopButton) {
473    return;
474  }
475
476  if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
477    my2TopButton.style.display = "block";
478  } else {
479    my2TopButton.style.display = "none";
480  }
481}
482
483// When the user clicks on the button, scroll to the top of the document
484function topFunction() {
485  document.body.scrollTop = 0; // For Safari
486  document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
487}

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.