PageSourceSearch

https://www.ondacerojaen.es/Portals/_default/skins/ondacerojaen/js/common.js?cdv=125

js ondacerojaen.es collected 2026-10-03 20:49:20 UTC 9,226 bytes, 257 lines download raw bytes

1$.fn.isInsideTheView = function () {
2    var win = $(window);
3    obj = $(this);
4
5    var visible_start = win.scrollTop();
6    var visible_end = win.scrollTop() + win.height();
7
8    var obj_start = obj.position().top; // - visible_start;
9    var obj_end = obj_start + obj.outerHeight(true);
10
11    return obj_start >= visible_start && obj_end < visible_end;
12};
13
14function readyHorizontalTabs() {
15    $(".horizontal-tabs").each(function () {
16        var $container = $(this);
17        var $titles = $container.find('.tab-titles li');
18        $($titles[0]).addClass('active');
19
20        var $contents = $container.find('.tab-contents > div');
21        $($contents[0]).show();
22    });
23
24    $(".horizontal-tabs .tab-titles li").on("click", function () {
25        var $title = $(this);
26        var $titles = $title.closest('.horizontal-tabs').find('.tab-titles li');
27
28        var index = $titles.index(this);
29
30        $titles.each(function (ix) {
31            if (ix == index) $(this).addClass('active');
32            else $(this).removeClass('active');
33        });
34
35        $title.closest('.horizontal-tabs').find('.tab-contents > div').each(function (ix) {
36            if (ix == index) $(this).show();
37            else $(this).hide();
38        });
39    });
40}
41
42function readyHorizontalCollapsables() {
43    $(".horizontal-collapsable .collapsable-title").each(function () {
44        var $title = $(this);
45        $title.append($('<span class="fa fa-angle-right"></span>'));
46    });
47
48    $(".horizontal-collapsable .collapsable-title").on("click", function () {
49        var $title = $(this);
50        var $collapsable = $title.closest('.horizontal-collapsable');
51        var $accordion = $collapsable.closest('.horizontal-accordion');
52        if ($accordion) {
53            $accordion.find('.horizontal-collapsable').each(function () {
54                $(this).find('.collapsable-title').removeClass('on');
55                $(this).find('.collapsable-content').slideUp(200);
56            });
57        }
58        var $content = $title.closest('.horizontal-collapsable').find('.collapsable-content');
59
60        if ($content.is(':visible')) {
61            $("#footer").css('position', 'fixed');
62            $("#footer").css('width', '100%');
63            $("#footer").css('bottom', '0px');
64            $("#footer").css('left', '0px');
65            $content.slideUp(200);
66        } else {
67            $title.addClass('on');
68            $("#footer").removeAttr('style');
69            $content.slideDown(200);
70        }
71    });
72}
73
74function readyFlipBoxes() {
75    $(".flip-box-horizontal, .flip-box-vertical, .flip-box-fade").each(function () {
76        var $front = $(this).find('.front');
77        var $back = $(this).find('.back');
78
79        var max = $front.outerHeight(true);
80        var back_height = $back.outerHeight(true);
81        if (back_height > max) max = back;
82
83        $front.css('height', max + 'px');
84        $back.css('height', max + 'px');
85    });
86
87    $(".flip-boxes").each(function () {
88        if ($(window).width() > 680) {
89            var boxes = $(this).find(".flip-box-horizontal, .flip-box-vertical, .flip-box-fade");
90
91            var max = 0;
92
93            boxes.each(function () {
94                let tmp = $(this).find('.front').outerHeight(true);
95                if (tmp > max) max = tmp;
96            });
97
98            boxes.each(function () {
99                $(this).find('.front').css('height', max + 'px');
100                $(this).find('.back').css('height', max + 'px');
101            });
102        }
103    });
104}
105
106function carouselPrevSlide(carousel, pause) {
107    if (pause == true && carousel.attr('data-autoplay-id')) {
108        carousel.attr('data-autoplay-pause', Date.now());
109    }
110
111    if (carousel.attr('data-working') == 'prev') return;
112
113    let slides = carousel.find('.carousel-slide');
114
115    let active_index = carousel.find('.active').index();
116
117    if (slides.length > 1 && active_index == 0) {
118        var moved_slide = $(slides[slides.length - 1]);
119        if (!moved_slide.hasClass('inactive-prev'))
120            moved_slide.removeClass('inactive-next').removeClass('inactive-prev').addClass('no-transition').addClass('inactive-prev');
121        moved_slide.insertBefore(slides[0]);
122        window.getComputedStyle(moved_slide[0]).opacity; // Force animation to work
123        slides = carousel.find('.carousel-slide');
124    }
125
126    for (i = slides.length - 1; i > 0; i--) {
127        let slide = $(slides[i]);
128        if (slide.hasClass('active') && i > 0) {
129            slide.removeClass('active');
130
131            if (!slide.hasClass('inactive-next')) slide.addClass('inactive-next');
132            if (i > 0) {
133                $(slides[i - 1]).removeClass('no-transition').removeClass('inactive-next').removeClass('inactive-prev').addClass('active');
134                carousel.attr('data-working', 'prev');
135                i--;
136            }
137        }
138    }
139}
140
141function carouselNextSlide(carousel, pause) {
142    if (pause == true && carousel.attr('data-autoplay-id')) {
143        carousel.attr('data-autoplay-pause', Date.now());
144    }
145
146    if (carousel.attr('data-working') == 'next') return;
147    let slides = carousel.find('.carousel-slide');
148    let active_index = carousel.find('.active').index();
149
150    if (slides.length > 1 && active_index == slides.length - 1) {
151        var moved_slide = $(slides[0]);
152        if (!moved_slide.hasClass('inactive-next'))
153            moved_slide.removeClass('inactive-next').removeClass('inactive-prev').addClass('no-transition').addClass('inactive-next');
154        moved_slide.insertAfter(slides[slides.length - 1]);
155        window.getComputedStyle(moved_slide[0]).opacity; // Force animation to work
156        slides = carousel.find('.carousel-slide');
157    }
158
159    for (i = 0; i < slides.length; i++) {
160        let slide = $(slides[i]);
161        if (slide.hasClass('active') && i < slides.length - 1) {
162            slide.removeClass('active');
163
164            if (!slide.hasClass('inactive-prev')) slide.addClass('inactive-prev');
165
166            if (i < slides.length - 1) {
167                let new_active = $(slides[i + 1]);
168                new_active.removeClass('no-transition').removeClass('inactive-next').removeClass('inactive-prev').addClass('active');
169                carousel.attr('data-working', 'next');
170                i++;
171            }
172        }
173    }
174}
175
176function readyCarousels() {
177    $(".carousel").each(function () {
178        let carousel = $(this);
179        let slides = $(this).find('.carousel-slide');
180        carousel.attr('data-working', 'false');
181
182        var hammertime = new Hammer(carousel[0]);
183        hammertime.on('swiperight', function (ev) {
184            carouselPrevSlide(carousel, true);
185        });
186        hammertime.on('swipeleft', function (ev) {
187            carouselNextSlide(carousel, true);
188        });
189
190        var max = 0;
191        slides.each(function (i) {
192            let slide = $(this);
193
194            if (i == 0) {
195                slide.addClass('active');
196            }
197            else slide.addClass('no-transition').addClass('inactive-next');
198
199            let tmp = slide.outerHeight(true);
200            if (tmp > max) max = tmp;
201        });
202
203        carousel.css('height', max + 'px');
204        slides.each(function () {
205            let slide = $(this);
206            slide.on('transitionend', function () {
207                $(this).closest('.carousel').attr('data-working', 'false');
208            });
209            slide.css('height', max + 'px');
210        });
211
212        carousel.append($('<div class="carousel-prev"><span class="fa fa-chevron-left"></span></div><div class="carousel-next"><span class="fa fa-chevron-right"></span></div>'));
213
214        if (carousel.data('autoplay')) {
215            let id = setInterval(function () {
216                if (carousel.attr('data-autoplay-pause') == undefined || (Date.now() > parseInt(carousel.attr('data-autoplay-pause')) + 10000)) {
217                    carouselNextSlide(carousel);
218                }
219            },
220                parseInt(carousel.data('autoplay') * 1000)
221            );
222            carousel.attr('data-autoplay-id', id);
223        }
224
225        $(".carousel .carousel-prev").on("click", function () {
226            let carousel = $(this).closest('.carousel');
227
228            carouselPrevSlide(carousel, true);
229        });
230
231        $(".carousel .carousel-next").on("click", function () {
232            let carousel = $(this).closest('.carousel');
233            if (carousel.attr('data-autoplay-id') != '') carousel.attr('data-autoplay-pause', Date.now());
234
235            carouselNextSlide(carousel, true);
236        });
237    });
238    $(".anx-slider-podcasts .carousel").removeAttr('style');
239}
240
241$(document).ready(function () {
242    readyHorizontalTabs();
243    readyHorizontalCollapsables();
244    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {
245        readyHorizontalCollapsables();
246        
247    });
248
249    AOS.init({
250        easing: 'ease-in-out-sine'
251    });
252});
253
254$(window).on('load', function () {
255    readyCarousels();
256    readyFlipBoxes();
257});

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.