PageSourceSearch

https://www.rollingstone.de/wp-content/themes/RS-Theme-2023/main.js?ver=1790680314

js rollingstone.de collected 2026-10-02 03:02:32 UTC 12,293 bytes, 377 lines download raw bytes

1$(document).ready(function () {
2  // Add mobile class to navigation and header
3  //   $(window).on('load resize', function () {
4  //     if ($(window).width() < 1025) {
5  //       $(".asmb-navbar").addClass("is-mobile");
6  //     } else {
7  //       $(".asmb-navbar").removeClass("is-mobile");
8  //     }
9  //   });
10
11  setTimeout(function() {
12    var $header = $('.asmb-iqd-sticky-header');
13    var $helper = $('.asmb-header-container-helper');
14    var $navigation = $('.asmb-header-container');
15    var $adContainerHelper = $('.asmb-sticker-header-ad-helper');
16    
17    if ($header.length && $helper.length) {
18      
19      var scrollTop = $(window).scrollTop();
20      
21      $navigation.animate({
22        'padding-top': '0'
23      }, 400, 'swing');
24      
25      $header.css({
26          'position': 'relative',
27          'top': '62px',
28          'height': '0'
29      });
30
31      $adContainerHelper.css({
32          'height': '121px'
33      });
34      
35      if (scrollTop >= 121) {
36        $helper.css({
37            'height': '62px'
38        });
39      } else {
40        $helper.css({
41            'height': '62px'
42        });
43      }
44    }
45  }, 15000);
46
47  // SLIDERS //
48
49  // GLOBAL SLIDER SETTINGS //
50
51  // Add aria-label to sliders
52  var sliders = ['.asmb-video-slider-mega-container', '.asmb-issue-slider', '.asmb-video-slider-container'];
53  var sliderCounters = {};
54
55  sliders.forEach(function(sliderSelector) {
56      $(sliderSelector).on('init', function(event, slick) {
57          var screenWidth = $(window).width();
58          var breakpoint = 992;
59          var shouldAddAria = true;
60
61          if (sliderSelector === '.asmb-video-slider-container' && screenWidth < breakpoint) {
62              shouldAddAria = false;
63          }
64
65          if (shouldAddAria) {
66              // Initialize counter
67              if (!sliderCounters[sliderSelector]) {
68                  sliderCounters[sliderSelector] = 0;
69              }
70              sliderCounters[sliderSelector]++;
71              
72              var currentSliderNumber = sliderCounters[sliderSelector];
73              
74              slick.$slides.not('.slick-clone').each(function(index) {
75
76                  var $slide = $(this);
77                  var title = $slide.attr('data-title');
78                  
79                  if (title) {
80                      var sliderType = '';
81                      if (sliderSelector === '.asmb-video-slider-mega-container') {
82                          sliderType = 'Hauptvideo';
83                      } else if (sliderSelector === '.asmb-video-slider-container') {
84                          sliderType = 'Video Slider ' + currentSliderNumber;
85                      } else if (sliderSelector === '.asmb-issue-slider') {
86                          sliderType = 'Ausgabe';
87                      }
88                      
89                      $slide.attr('aria-label', title + ' - ' + sliderType + ' ' + (index + 1) + ' von ' + slick.$slides.not('.slick-clone').length);
90                  } else {
91                      $slide.attr('aria-label', (index + 1) + ' von ' + slick.$slides.not('.slick-clone').length);
92                  }
93              });
94          }
95      });
96  });
97
98  // Remove role tabpanel from sliders
99  $(window).on('load', function() {
100    setTimeout(function() {
101        $('.slick-slide[role="tabpanel"]').removeAttr('role');
102    }, 100);
103  });
104
105  // VIDEO SLIDER MEGA //
106
107  $(".asmb-video-slider-mega-container").slick({
108    dots: true,
109    infinite: true,
110    mobileFirst: true,
111    slidesToShow: 1,
112    slidesToScroll: 1,
113    speed: 400,
114    prevArrow: $(".arrow-container-left"),
115    nextArrow: $(".arrow-container-right"),
116    appendDots: $(".slick-dots"),
117  });
118
119  // END VIDEO SLIDER MEGA //
120
121  // VIDEO SLIDER SMALL //
122
123  function initSlider() {
124    $(".asmb-video-slider-container").slick({
125      infinite: true,
126      mobileFirst: true,
127      slidesToShow: 4,
128      slidesToScroll: 1,
129      speed: 400,
130      prevArrow:
131        "<div class='arrow-container-left'><i class='icon-chevron-left'></i></div>",
132      nextArrow:
133        "<div class='arrow-container-right'><i class='icon-chevron-right'></i></div>",
134    });
135  }
136
137  // Destroy slick slider
138  function destroySlider() {
139    $(".asmb-video-slider-container").slick("unslick");
140  }
141
142  function handleSlider() {
143    var screenWidth = $(window).width();
144    var breakpoint = 992;
145    if (screenWidth < breakpoint) {
146      destroySlider();
147    } else {
148      initSlider();
149    }
150  }
151
152  $(document).ready(function () {
153    handleSlider();
154    $(window).resize(handleSlider);
155  });
156
157  // END VIDEO SLIDER SMALL //
158
159  // ISSUE SLIDER //
160
161  $(".asmb-issue-slider").slick({
162    infinite: true,
163    slidesToShow: 1,
164    slidesToScroll: 1,
165    variableWidth: false,
166    prevArrow: "<button type='button' class='arrow-container-left slick-arrow' aria-label='Vorheriges Bild anzeigen'><i class='icon-chevron-left'></i></button>",
167    nextArrow: "<button type='button' class='arrow-container-right slick-arrow' aria-label='Nächstes Bild anzeigen'><i class='icon-chevron-right'></i></button>",
168    speed: 400,
169  });
170
171  $(".next-slide-area").on("click", function () {
172    $(".asmb-issue-slider").slick("slickNext");
173  });
174
175  $(window).on("load resize", function () {
176    var maxSlideHeight = 0;
177    $(".asmb-issue-slider-container").each(function () {
178      var slideHeight = $(this).height();
179      if (slideHeight > maxSlideHeight) {
180        maxSlideHeight = slideHeight;
181      }
182    });
183    $(".asmb-issue-slider").height(maxSlideHeight);
184  });
185
186  // END ISSUE SLIDER //
187
188  // Change position of sidebar after second paragraph
189  if ($(window).width() < 1025) {
190    $(".asmb-article-sidebar-content-container").insertAfter(
191      ".asmb-article-copy-text > p:nth-of-type(2)"
192    );
193  } else {
194    $(".asmb-article-sidebar-content-container").appendTo(
195      ".asmb-article-sidebar-container"
196    );
197  }
198
199  $(window).on("resize", function () {
200    if ($(window).width() < 1025) {
201      $(".asmb-article-sidebar-content-container").insertAfter(
202        ".asmb-article-copy-text > p:nth-of-type(2)"
203      );
204    } else {
205      $(".asmb-article-sidebar-content-container").appendTo(
206        ".asmb-article-sidebar-container"
207      );
208    }
209  });
210
211  // Add portrait class for articles
212  if ($(".asmb-article-teaser-image-content img").hasClass("portrait")) {
213    $(".asmb-article-teaser-image-content").addClass("portrait");
214  }
215
216  //Make newsletter button clickable when activating the checkbox
217  $(".asmb-newsletter-checkbox").click(function () {
218    if ($(this).is(":checked")) {
219        $(".asmb-newsletter-button").removeAttr("disabled"); // Enable the button
220    } else {
221        $(".asmb-newsletter-button").attr("disabled", "disabled"); // Disable the button
222    }
223  });
224
225  $(".asmb-newsletter-checkbox-footer").click(function () {
226    if ($(this).is(":checked")) {
227      $(".asmb-newsletter-button-footer").removeAttr("disabled");
228    } else {
229      $(".asmb-newsletter-button-footer").attr("disabled", "disabled");
230    }
231  });
232
233  // $(window).on("load", function() {
234  // if ($(window).width() > 1200) {
235  //   var contentAreaHeight = $(".asmb-article-content-container").height();
236  //   if (contentAreaHeight < 550) {
237  //     $(".asmb-article-sidebar-content-container").hide();
238  //   } else if (contentAreaHeight < 720) {
239  //     $(".asmb-article-sidebar-content-container .asmb-sidebar-item:nth-last-child(-n+3)").hide();
240  //   } else if (contentAreaHeight < 1047) {
241  //     $(".asmb-article-sidebar-content-container .asmb-sidebar-item:nth-last-child(-n+2)").hide();
242  //   } else if (contentAreaHeight < 1700) {
243  //     $(".asmb-article-sidebar-content-container .asmb-sidebar-item:last-child").hide();
244  //   }
245  // }
246  // });
247
248  // if ($(window).width() > 1200) {
249  //   var contentAreaHeight = $(".asmb-article-content-container").height();
250  //   if (contentAreaHeight < 700) {
251  //       $(".asmb-article-sidebar-content-container").hide();
252  //   } else {
253  //       $(".asmb-article-sidebar-content-container").show();
254  //   }
255  // }
256
257  $(document).scroll(function () {
258    var scrollPosition = $(this).scrollTop();
259    if (scrollPosition > 50) {
260      $(".asmb-navbar-mobile-container .asmb-welt-logo-container").addClass(
261        "not-visible"
262      );
263    } else {
264      $(".asmb-navbar-mobile-container .asmb-welt-logo-container").removeClass(
265        "not-visible"
266      );
267    }
268  });
269
270  // Hide and show navigation
271
272  $(window).scroll(function () {
273    let billboardHeight = $("#billboardWrapper").height();
274    if (!billboardHeight) {
275      billboardHeight = 0;
276    }
277    let negativeValue = "-" + (billboardHeight + 300) + "px";
278    let positiveValue = billboardHeight + 300 + "px";
279    if ($(window).width() > 1279) {
280      let scrollPosition = $(window).scrollTop();
281      if (scrollPosition >
281= 135 + billboardHeight) {
282        // Hide navbar mega
283        $(".asmb-navbar-mega").css("top", negativeValue);
284        $(".asmb-navbar-small").css("bottom", "0");
285        $(".asmb-navbar-small").css("display", "block");
286        // Make container element sticky
287        $(".asmb-header-container").css("position", "sticky");
288        $(".asmb-header-container").css("top", "-123px");
289        $(".asmb-search-bar-container").addClass("is-scrolled");
290      } else {
291        // Show navbar mega
292        $(".asmb-navbar-mega").css("top", "0");
293        // Hide navbar small
294        $(".asmb-navbar-small").css("bottom", positiveValue);
295        $(".asmb-navbar-small").css("display", "none");
296        // Make container element relative
297        $(".asmb-header-container").css("position", "relative");
298        $(".asmb-header-container").css("top", "0");
299        // Remove small burger menu when scrolling to top
300        $(".asmb-navbar-main-menu").removeClass("is-visible");
301        $(".asmb-navbar-icon-container .icon-bars").removeClass("is-hidden");
302        $(".asmb-search-bar-container").removeClass("is-scrolled");
303        $(".asmb-navbar-icon-container .icon-xmark").addClass("is-hidden");
304      }
305    }
306  });
307
308  // Add arrows to small navigation
309  $(".asmb-navbar-small .menu-item-has-children, .asmb-navbar-simple-small .menu-item-has-children").each(function () {
310    $(this).children("a").after('<button type="button" class="asmb-navbar-arrows" aria-label="Subnavigation öffnen"><i class="icon-chevron-down"></i></button>');
311  });
312
313  // Toggle visibility of sub-menu
314  $(".menu-item .asmb-navbar-arrows").click(function () {
315    $(this).parent().find(".sub-menu").toggleClass("is-visible");
316    $(this).toggleClass("is-active");
317  });
318
319  $(".asmb-burger-button").click(function () {
320    $(this).find(".icon-bars").toggleClass("is-hidden");
321    $(this).find(".icon-xmark").toggleClass("is-hidden");
322    $(".asmb-navbar-main-menu").toggleClass("is-visible");
323  });
324
325  $(".icon-chevron-down").click(function () {
326    $(this).toggleClass("is-active");
327  });
328
329  $(".asmb-modal-helper").click(function () {
330    $(".asmb-navbar-main-menu").toggleClass("is-visible");
331    $(".asmb-burger-button .icon-bars").toggleClass("is-hidden");
332    $(".asmb-burger-button .icon-xmark").toggleClass("is-hidden");
333  });
334
335  // Search bar
336  $(".asmb-search-bar-icon").click(function () {
337    $(".asmb-search-bar-container").toggleClass("is-hidden");
338  });
339
340  $(".asmb-search-bar-close").click(function () {
341    $(".asmb-search-bar-container").toggleClass("is-hidden");
342  });
343
344  // Change position of sidebar after second paragraph
345  function moveRecommendations() {
346    if ($(window).width() < 1280) {
347      $(".asmb-article-recommendation-container").insertAfter(
348        ".asmb-article-copy-text > p:nth-of-type(1)"
349      );
350    } else {
351      $(".asmb-article-recommendation-container").insertBefore(
352        ".asmb-article-copy-text > p:nth-of-type(1)"
353      );
354    }
355  }
356
357  moveRecommendations();
358  $(window).on("resize", moveRecommendations);
359
360  // Remove sticky ad container
361
362  // $(window).on('load', function() {
363  //   var $adContainer = $('.asmb-iqd-sticky-header');
364    
365  //   if ($adContainer.length > 0) {
366  //     setTimeout(function() {
367  //       // Remove Banner
368  //       $('.asmb-iqd-sticky-header').slideUp(300);
369        
370  //       // Change helper height
371  //       $('.asmb-header-container-helper').animate({
372  //         height: '62px'
373  //       }, 300);
374  //     }, 15000);
375  //   }
376  // });
377});

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.