PageSourceSearch

https://giubberossenews.it/wp-content/themes/newsup-pro/inc/elementor/assets/js/slider_custom.js?ver=7.1.2

js giubberossenews.it collected 2026-10-03 23:52:44 UTC 9,187 bytes, 303 lines download raw bytes

1const fn = function ($scope, $) {
2  const wId = $scope.data("id");
3  const wrapper = document.querySelector(`.elementor-element-${wId}`);
4  const outerWrapper = wrapper.querySelector(".newsup-outer-wrapper");
5
6  if (!outerWrapper) return;
7
8  const widgetId = outerWrapper.getAttribute("data-wid");
9
10  const sliderWrapper = document.querySelector(`#newsup_slider_${widgetId}`);
11
12  if (!sliderWrapper) return;
13
14  const slideToShow = parseInt(
15    sliderWrapper.getAttribute("data-slide-to-show")
16  );
17  const slideToShowMobile = parseInt(
18    sliderWrapper.getAttribute("data-slide-to-show-mobile")
19  );
20  const slideToShowTablet = parseInt(
21    sliderWrapper.getAttribute("data-slide-to-show-tablet")
22  );
23  const slideToScroll = parseInt(
24    sliderWrapper.getAttribute("data-slides-to-scroll")
25  );
26  const slideToScrollMobile = parseInt(
27    sliderWrapper.getAttribute("data-slides-to-scroll-mobile")
28  );
29  const slideToScrollTablet = parseInt(
30    sliderWrapper.getAttribute("data-slides-to-scroll-tablet")
31  );
32  const slideSpaceBetween = sliderWrapper.getAttribute(
33    "data-slides-space-between"
34  );
35  const slideSpaceBetweenMobile = sliderWrapper.getAttribute(
36    "data-slides-space-between-mobile"
37  );
38  const slideSpaceBetweenTablet = sliderWrapper.getAttribute(
39    "data-slides-space-between-tablet"
40  );
41  const autoplay = sliderWrapper.getAttribute("data-autoplay");
42  const autoplaySpeed = sliderWrapper.getAttribute("data-autoplay-speed");
43
44  const transitionBetweenSlides = parseInt(
45    sliderWrapper.getAttribute("data-transition_between_slides")
46  );
47  const loop = sliderWrapper.getAttribute("data-loop");
48  const mousewheel = sliderWrapper.getAttribute("data-mousewheel");
49  const keyboardControl = sliderWrapper.getAttribute("data-keyboard_control");
50  const clickable = sliderWrapper.getAttribute("data-clickable");
51
52  // const direction = sliderWrapper.getAttribute('data-direction');
53  // const directionMobile = sliderWrapper.getAttribute('data-direction-mobile');
54  // const directionTablet = sliderWrapper.getAttribute('data-direction-tablet');
55
56  const swiperClass = `.swiper-${widgetId}`;
57  //
58
59  const swiper = new Swiper(swiperClass, {
60    loop,
61    autoplay: autoplay
62      ? {
63          delay: autoplaySpeed,
64          disableOnInteraction: false,
65        }
66      : false,
67    mousewheel: mousewheel
68      ? {
69          enable: true,
70        }
71      : false,
72    keyboardControl,
73    speed: transitionBetweenSlides,
74    scrollbar: {
75      el: ".swiper-scrollbar",
76      draggable: true,
77      hide: true,
78      snapOnRelease: true,
79    },
80
81    // If we need pagination
82    pagination: {
83      el: ".swiper-pagination",
84      clickable,
85    },
86
87    // Navigation arrows
88    navigation: {
89      nextEl: ".swiper-button-next",
90      prevEl: ".swiper-button-prev",
91    },
92
93    breakpoints: {
94      // when window width is >= 320px
95      320: {
96        slidesPerView: slideToShowMobile,
97        spaceBetween: slideSpaceBetweenMobile,
98        slidesPerGroup: slideToScrollMobile,
99        // direction: directionMobile,
100      },
101      // when window width is >= 480px
102      767: {
103        slidesPerView: slideToShowTablet,
104        spaceBetween: slideSpaceBetweenTablet,
105        slidesPerGroup: slideToScrollTablet,
106        // direction: directionTablet,
107      },
108      // when window width is >= 640px
109      1024: {
110        slidesPerView: slideToShow,
111        spaceBetween: slideSpaceBetween,
112        slidesPerGroup: slideToScroll,
113        // direction: direction,
114      },
115    },
116  });
117};
118
119const tabs = ($scope, $) => {
120  const wId = $scope.data("id");
121  const wrapper = document.querySelector(`.elementor-element-${wId}`);
122  const outerWrapper = wrapper.querySelector(".newsup-outer-wrapper");
123
124  if (!outerWrapper) return;
125
126  const widgetId = outerWrapper.getAttribute("data-wid");
127
128  const sliderWrapper = document.querySelector(`#newsup_slider_${widgetId}`);
129
130  const swiperClass = `.swiper-${widgetId}`;
131  const tabs = $scope.find(".newsup-product-tabs-grid");
132
133  const change = (id) => {
134    if (!id) return;
135
136    if (sliderWrapper) swiper();
137  };
138
139  if (!sliderWrapper) {
140    const prodGrid = document.querySelector(".newsup-product-grid-wrapper");
141    change(prodGrid.getAttribute("data-first_tab_id"));
142  }
143
144  if (tabs.length > 0) {
145    tabs.each(function (index, tab) {
146      $(tab)
147        .find(".tabs li")
148        .click(function (e) {
149          e.preventDefault();
150          const id = $(this).data("id");
151          const sliders = document.querySelectorAll(
152            `.newsup_product_wrapper.newsup-${widgetId}`
153          );
154          const selectedTab = document.querySelector(
155            `.newsup_product_wrapper.${id}`
156          );
157          [...sliders].forEach((slider) => {
158            slider.classList.add("newsup_hide");
159          });
160          selectedTab.classList.remove("newsup_hide");
161          change(id);
162          $(this).siblings().removeClass("active");
163          $(this)
164            .parents(".newsup-product-tabs-grid")
165            .find(".products")
166            .removeClass("active");
167
168          $(this).addClass("active");
169          $(this)
170            .parents(".newsup-product-tabs-grid")
171            .find(`#${id}`)
172            .addClass("active");
173        });
174    });
175  }
176
177  if (!sliderWrapper) return;
178
179  const firstTabId = sliderWrapper.getAttribute("data-first_tab_id");
180
181  const slideToShow = parseInt(
182    sliderWrapper.getAttribute("data-slide-to-show")
183  );
184  const slideToShowMobile = parseInt(
185    sliderWrapper.getAttribute("data-slide-to-show-mobile")
186  );
187  const slideToShowTablet = parseInt(
188    sliderWrapper.getAttribute("data-slide-to-show-tablet")
189  );
190  const slideToScroll = parseInt(
191    sliderWrapper.getAttribute("data-slides-to-scroll")
192  );
193  const slideToScrollMobile = parseInt(
194    sliderWrapper.getAttribute("data-slides-to-scroll-mobile")
195  );
196  const slideToScrollTablet = parseInt(
197    sliderWrapper.getAttribute("data-slides-to-scroll-tablet")
198  );
199  const slideSpaceBetween = sliderWrapper.getAttribute(
200    "data-slides-space-between"
201  );
202  const slideSpaceBetweenMobile = sliderWrapper.getAttribute(
203    "data-slides-space-between-mobile"
204  );
205  const slideSpaceBetweenTablet = sliderWrapper.getAttribute(
206    "data-slides-space-between-tablet"
207  );
208  const autoplay = sliderWrapper.getAttribute("data-autoplay");
209  const autoplaySpeed = sliderWrapper.getAttribute("data-autoplay-speed");
210
211  const transitionBetweenSlides = parseInt(
212    sliderWrapper.getAttribute("data-transition_between_slides")
213  );
214  const loop = sliderWrapper.getAttribute("data-loop");
215  const mousewheel = sliderWrapper.getAttribute("data-mousewheel");
216  const keyboardControl = sliderWrapper.getAttribute("data-keyboard_control");
217  const clickable = sliderWrapper.getAttribute("data-clickable");
218
219  const swiper = () => {
220    const swiper = new Swiper(swiperClass, {
221      loop,
222      autoplay: autoplay
223        ? {
224            delay: autoplaySpeed,
225            disableOnInteraction: false,
226          }
227        : false,
228      mousewheel: mousewheel
229        ? {
230            enable: true,
231          }
232        : false,
233      keyboardControl,
234      speed: transitionBetweenSlides,
235      scrollbar: {
236        el: ".swiper-scrollbar",
237        draggable: true,
238        hide: true,
239        snapOnRelease: true,
240      },
241
242      // If we need pagination
243      pagination: {
244        el: ".swiper-pagination",
245        clickable,
246      },
247
248      // Navigation arrows
249      navigation: {
250        nextEl: ".swiper-button-next",
251        prevEl: ".swiper-button-prev",
252      },
253
254      breakpoints: {
255        // when window width is >= 320px
256        320: {
257          slidesPerView: slideToShowMobile,
258          spaceBetween: slideSpaceBetweenMobile,
259          slidesPerGroup: slideToScrollMobile,
260          // direction: directionMobile,
261        },
262        // when window width is >= 480px
263        767: {
264          slidesPerView: slideToShowTablet,
265          spaceBetween: slideSpaceBetweenTablet,
266          slidesPerGroup: slideToScrollTablet,
267          // direction: directionTablet,
268        },
269        // when window width is >= 640px
270        1024: {
271          slidesPerView: slideToShow,
272          spaceBetween: slideSpaceBetween,
273          slidesPerGroup: slideToScroll,
274          // direction: direction,
275        },
276      },
277    });
278  };
279
280  change(firstTabId);
281};
282
283window.addEventListener( 'elementor/frontend/init', function () {
284  elementorFrontend.hooks.addAction(
285    "frontend/element_ready/newsup-slider.default",
286    fn
287  );
288}); 
289window.addEventListener( 'elementor/frontend/init', function () {
290  elementorFrontend.hooks.addAction(
291    "frontend/element_ready/newsup-blog-carousel.default",
292    fn
293  );
294});
295window.addEventListener( 'elementor/frontend/init', function () {
296  elementorFrontend.hooks.addAction(
297    "frontend/element_ready/newsup-order-post-carousel.default",
298    fn
299  );
300});
301
302 
303

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.