PageSourceSearch

https://inhispania.com/core/modules/a8e2a155bb/assets/js/frontend.js?rnd=81605

js inhispania.com collected 2026-09-24 19:58:05 UTC 19,335 bytes, 452 lines download raw bytes

1/* 
2 * The Team Frontend js 
3 * global totalteam_frontend_colorbox_params 
4 * 
5 */
6
7(function ($) {
8    $(function () {
9        $('.ttp-content-skill-list').find(".ttp-bar-skill-title").each(function () {
10            $this = $(this);
11            var progressBarColor = $(this).data('bar-rated-fill');
12            progressBarColor = (progressBarColor !== '') ? progressBarColor : '#F39C12';
13
14            $(this).simpleSkillbar({
15
16            });
17        });
18
19        //$(window).load(function () {
20        $('.ttp-carousal-grid-content').each(function () {
21            var element_per_row = $(this).data('element-per-row');
22
23            var speed = $(this).data('speed');
24
25            var nextprev_control = $(this).attr('data-show-hide-nextprev');
26
27            if (nextprev_control === 'true') {
28                nextprev_control_val = true;
29            } else {
30                nextprev_control_val = false;
31            }
32
33            var auto = $(this).attr('data-auto');
34            if (auto === 'true') {
35                auto_val = true;
36            } else {
37                auto_val = false;
38            }
39            var autoplay_pause_duration = $(this).data('pause-duration');
40
41            $(this).owlCarousel({
42                addClassActive: true,
43                smartSpeed: 450,
44                loop: true,
45                rewind: false,
46                margin: 10,
47                items: element_per_row,
48                nav: true,
49                dots: nextprev_control_val,
50
51                autoplay: auto_val,
52                autoplaySpeed: speed,
53                autoplayTimeout: autoplay_pause_duration,
54                autoplayHoverPause: false,
55                navText: ['<i class="fa fa-long-arrow-left" aria-hidden="true"></i>', '<i class="fa fa-long-arrow-right" aria-hidden="true"></i>'],
56                animateOut: 'slideOutDown',
57                animateIn: 'flipInX',
58                responsive: true,
59                responsiveClass: true,
60                responsive: {
61                    500: {
62                        items: 1,
63                    },
64                    '780': {
65                        items: 2,
66                    },
67                    '935': {
68                        items: element_per_row,
69                    }
70                }
71            });
72        });
73        //});
74
75        $('body').on("click", ".ttp-expand-popup-click-action, .ttp-expand-slide-out-click-action", function (e) {
76            //e.preventDefault();
77            var disp_type = $(this).attr('data-disp-type');
78            var disp_pos = $(this).attr('data-disp-pos');
79            var disp_id = $(this).attr('data-id');
80            var oself = $(this);
81            if (disp_type == 'popup') {
82                $(this).parents('.ttp-wrapper').find('.ttp-popup-content-overlay').fadeIn();
83                if (disp_pos == 'left') {
84                    $(this).parents('.ttp-team-content-outer-wrap').find('#ttp-inner-content-' + disp_id).fadeIn().addClass('ttp-visible');
85                    $(this).parents('.ttp-team-content-outer-wrap').find('#ttp-inner-content-' + disp_id + ' .mCustomScrollBox').show();
86                } else if (disp_pos == 'right') {
87                    $(this).parents('.ttp-team-content-outer-wrap').find('#ttp-inner-content-' + disp_id).fadeIn().addClass('ttp-visible');
88                    $(this).parents('.ttp-team-content-outer-wrap').find('#ttp-inner-content-' + disp_id + ' .mCustomScrollBox').show();
89                } else {
90                    $(this).parents('.ttp-team-content-outer-wrap').find('#ttp-inner-content-' + disp_id).fadeIn().addClass('ttp-visible');
91                    $(this).parents('.ttp-team-content-outer-wrap').find('#ttp-inner-content-' + disp_id + ' .mCustomScrollBox').show();
92                }
93            } else if (disp_type == 'slide-out') {
94                e.preventDefault();
95                var alldispin = $(".team-info-block");
96                var dispin = oself.parents('.grid-row-wrapper').find('.team-info-block');
97                oself.parents('.ttp-layout-contents').find('.ttp-primary-content').removeClass('active');
98                dispin.parents('.ttp-layout-contents').find('.team-info-block').html('').hide();
99                var teaminfo = oself.parents('.ttp-inner-whole-wrapper').find('.ttp-team-inner-hidden').html();
100                //$.scrollTo('#team-infos-block', 800);
101
102                //alldispin.slideUp(1500);
103                //$(".team-all-members .team-member").removeClass('active');
104                oself.parents('.ttp-layout-contents').find('.ttp-primary-content').toggleClass('active inactive');
105//                oself.siblings('.ttp-primary-content').toggleClass('inactive');
106//                oself.parents('.team-list-block').siblings('.team-list-block').find('.team-member').toggleClass('inactive');
107//                oself.parents('.letter-group').siblings('.letter-group').find('.team-member').toggleClass('inactive');
108                if (oself.parents('.ttp-layout-contents').find('.ttp-primary-content').hasClass('inactive')) {
109                    dispin.html(teaminfo).slideDown(300); //.addClass('active');
110                    dispin.find('.ttp-team-member-slide-content-left').mCustomScrollbar({
111                        theme: 'dark-3',
112                        mouseWheel: {
113                            enable: true
114                        },
115                        axis: 'yx',
116                        setHeight: '300px',
117                        advanced: {
118
119                            updateOnBrowserResize: false,
120
121                            updateOnContentResize: false,
122
123                            autoExpandHorizontalScroll: false,
124
125                            autoScrollOnFocus: false
126
127                        },
128                    });
129                    dispin.find('.ttp-team-member-slide-content-left').each(function () {
130                        $(this).find('.gallery a[href$=".jpg"], .gallery a[href$=".jpeg"], .gallery a[href$=".png"], .gallery a[href$=".gif"]').colorbox(cbSettings);
131                    });
132                    var offset = dispin.parents('.grid-row-wrapper').find('.team-info-block').offset();
133                    $('html, body').animate({
134                        scrollTop: offset.top
135                    }, 1000);
136                } else {
137                    //dispin.children('.ttp-team-member-slide-content-left').mCustomScrollbar("destroy");
138                    dispin.html(teaminfo).slideUp(300);
139                }
140            } else {
141
142            }
143        });
144
145        $('body').on("click", "span.ttp-additional-detail-close", function () {
146            var disp_type = $(this).attr('data-disp-type');
147            $(this).parents('.ttp-team-inner-hidden').hide();
148            if (disp_type == 'popup') {
149                $(this).parents('.ttp-wrapper').find('.ttp-popup-content-overlay').fadeOut();
150                $(this).parents('.ttp-wrapper').find('.mCustomScrollBox').fadeOut();
151            } else if (disp_type == 'slide-out') {
152                $(this).parents('.ttp-wrapper').find('.team-info-block').slideUp();
153            }
154        });
155
156        $('body').on("click", ".ttp-popup-content-overlay", function () {
157            var disp_type = $(this).attr('data-disp-type');
158            $(this).fadeOut();
159            if (disp_type == 'popup' || (e.keyCode == 27)) {
160                $(this).parents('.ttp-wrapper').find('.ttp-team-inner-hidden').hide();
161                $(this).parents('.ttp-wrapper').find('.mCustomScrollBox').fadeOut();
162            }
163        });
164
165        $(document).keyup(function (e) {
166            if (e.keyCode == 27) {
167                $('body').find('.ttp-team-inner-hidden').hide();
168                //$('body').find('.mCustomScrollBox').fadeOut();
169                $('body').find('.ttp-popup-content-overlay').fadeOut();
170                $('body').find('.team-info-block').slideUp();
171            }
172        });
173
174        var ttpWindowWidth = $(window).width();
175        $(window).resize(function () {
176            ttpWindowWidth = $(window).width();
177            $('.ttp-grid-layout-content').each(function () {
178                var per_row = $(this).data('per-row');
179                var per_row_id = $(this).attr("id");
180                var per_row_id_arr = per_row_id.split('-');
181                if (ttpWindowWidth <= 480) {
182                    $(this).attr("id", "ttp-column-1");
183                } else if (ttpWindowWidth > 480 && ttpWindowWidth <= 768 && per_row >= per_row_id_arr[2]) {
184                    $(this).attr("id", "ttp-column-2");
185                } else if (ttpWindowWidth > 768 && ttpWindowWidth <= 934 && per_row >= per_row_id_arr[2]) {
186                    $(this).attr("id", "ttp-column-3");
187                } else {
188                    $(this).attr("id", "ttp-column-" + per_row);
189                }
190            });
191            $('.ttp-thumbnail-layout-content').each(function () {
192                var per_row = $(this).data('per-row');
193                var per_row_id = $(this).attr("id");
194                var per_row_id_arr = per_row_id.split('-');
195                if (ttpWindowWidth <= 480) {
196                    $(this).attr("id", "ttp-column-1");
197                } else if (ttpWindowWidth > 480 && ttpWindowWidth <= 580 && per_row >= per_row_id_arr[2]) {
198                    $(this).attr("id", "ttp-column-2");
199                } else if (ttpWindowWidth > 580 && ttpWindowWidth <= 768 && per_row >= per_row_id_arr[2]) {
200                    $(this).attr("id", "ttp-column-4");
201                } else if (ttpWindowWidth > 768 && ttpWindowWidth <= 934 && per_row >= per_row_id_arr[2]) {
202                    $(this).attr("id", "ttp-column-6");
203                } else {
204                    $(this).attr("id", "ttp-column-" + per_row);
205                }
206            });
207        }).resize();
208
209//        $('.ttp-filter-layout-content').each(function () {
210//            if (ttpWindowWidth <= 740) {
211//                $('.ttp-inner-whole-wrapper').css('width', '230');
212//                $('.ttp-inner-whole-wrapper').css('height', '230');
213//            } else if (ttpWindowWidth > 740 && ttpWindowWidth <= 1024) {
214//                $('.ttp-inner-whole-wrapper').css('width', '350');
215//                $('.ttp-inner-whole-wrapper').css('height', '350');
216//            } else {
217//                $('.ttp-inner-whole-wrapper').css('width', '350');
218//                $('.ttp-inner-whole-wrapper').css('height', '350');
219//            }
220//        });
221
222
223
224//        $('.ttp-filter-layout-content').each(function () {
225//            var selector = $(this);
226//            // init Isotope
227//            var $grid = $(this).isotope({
228//
229//            });
230//            // filter items on button click
231//           selector.parent().find('.ttp-filter-header').on('click', 'button', function () {
232//                var filterValue = $(this).attr('data-filter');
233//                $grid.isotope({
234//                    filter: filterValue,
235//                    masonry: {
236//                        //columnWidth: 250,
237//                        hiddenStyle: {
238//                            opacity: 0
239//                        },
240//                        visibleStyle: {
241//                            opacity: 1
242//                        }
243//                    }
244//                });
245//
246//            });
247//        });
248
249        $('.ttp-filter-layout-content').each(function () {
250            var main_selector = $(this);
251            // init Isotope
252            var iso = function () {
253                var $container = main_selector,
254                        qsRegex,
255                        filters = {};
256
257                $container.isotope({
258                    itemSelector: '.element',
259                    masonry: {
260                        //columnWidth: 120
261                    },
262//                getSortData: {
263//                name: function ($elem) {
264//                console.log($elem);
265//                return $elem.find('.ttp-content-header').text();
266//                }
267//                },
268                    filter: function () {
269                        return qsRegex ? $(this).text().match(qsRegex) : true;
270                    }
271                });
272
273                function searchFilter() {
274                    qsRegex = new RegExp($quicksearch.val(), 'gi');
275                    $container.isotope();
276                }
277
278                // use value of search field to filter
279                var $quicksearch = main_selector.parent().find('#ttp-filter-quicksearch').keyup(debounce(searchFilter));
280
281                main_selector.parent().find('#ttp-filter-reset').on('click', function (e) {
282                    e.preventDefault();
283                    $quicksearch.val('');
284                    searchFilter();
285                });
286
287                main_selector.parent().find('.ttp-filter-header').on('click', 'button', function () {
288                    var $this = $(this);
289                    // get group key
290                    var $buttonGroup = $this.parents('.ttp-filter-header');
291                    var filterGroup = $buttonGroup.attr('data-filter-group');
292                    // set filter for group
293                    filters[filterGroup] = $this.attr('data-filter');
294                    // combine filters
295                    var filterValue = '';
296                    for (var prop in filters) {
297                        filterValue += filters[prop];
298                    }
299
300                    // convert object into array
301                    var isoFilters = [];
302                    for (prop in filters) {
303                        isoFilters.push(filters[prop]);
304                    }
305                    // set filter for Isotope
306                    $container.isotope({
307                        filter: filterValue
308                    });
309                    var selector = isoFilters.join('');
310                    $container.isotope({
311                        filter: selector
312                    }, function noResultsCheck() {
313                        var noItems = $('<div class="element no-results large"><p class="type">Oops!</p><p class="strain-info">We do not show a strain of this combination. Please try another combination.</p></div>');
314//                        var yesItems = $('.no-results');
315//                        var numItems = $('.element:not(.isotope-hidden)').length;
316//                        if (numItems === 0) {
317//                        $container.append(noItems).isotope('appended', noItems);
318//                        } else {
319//                        $container.isotope('remove', yesItems);
320//                        }
321                    });
322                });
323
324                // change is-checked class on buttons
325                main_selector.parent().find('.ttp-filter-header').each(function (i, buttonGroup) {
326                    var $buttonGroup = $(buttonGroup);
327                    $buttonGroup.on('click', '.button', function () {
328                        $buttonGroup.find('.active').removeClass('active');
329                        $(this).addClass('active');
330                    });
331                });
332
333                function debounce(fn, threshold) {
334                    var timeout;
335                    return function debounced() {
336                        if (timeout) {
337                            clearTimeout(timeout);
338                        }
339
340                        function delayed() {
341                            fn();
342                            timeout = null;
343                        }
344                        setTimeout(delayed, threshold || 100);
345                    };
346                }
347            };
348            $(function () {
349                iso();
350                $('.iso').click(function () {
351                    setTimeout(iso, 500);
352                });
353            });
354        });
355
356
357        $('.ttp-flipster-grid-content').each(function () {
358            var speed = $(this).attr('data-speed');
359
360            var style = $(this).attr('data-style');
361
362            var nextprev_control = $(this).attr('data-show-hide-nextprev');
363
364            if (nextprev_control == 'true') {
365                nextprev_control_val = true;
366            } else {
367                nextprev_control_val = false;
368            }
369
370            var paginate = $(this).attr('data-paginate');
371            if (paginate && paginate != 'false') {
372                var paginate_val = paginate;
373            } else {
374                var paginate_val = false;
375            }
376            var flat = $(this).flipster({
377                buttons: true,
378                loop: true,
379                scrollwheel: false,
380                style: style,
381                click: true,
382                autoplay: false,
383                fadeIn: speed,
384                nav: paginate_val,
385                buttons: true,
386                pauseOnHover: true,
387                buttonPrev: 'Previous',
388                buttonNext: 'Next',
389            });
390        });
391
392        $(window).on("load", function () {
393            // If left or right popup 
394            $('body').find('.ttp-popup-content-right, .ttp-popup-content-left, .ttp-popup-content-center').each(function () {
395                var scroll = $('.ttp-popup-content-right, .ttp-popup-content-left, .ttp-popup-content-center');
396                scroll.mCustomScrollbar({
397                    theme: 'dark-3',
398                    mouseWheel: {
399                        enable: true
400                    },
401                    axis: 'y',
402                    scrollbarPosition: 'inside'
403                });
404            });
405
406//            // If center popup
407//            $('body').find('.ttp-popup-content-center .ttp-team-member-content').each(function () {
408//                var scroll = $(this);
409//                console.log(scroll);
410//                scroll.mCustomScrollbar({
411//                    theme: 'dark-1',
412//                    mouseWheel: {
413//                        enable: true
414//                    },
415//                    axis: 'y',
416//                    scrollbarPosition: 'inside'
417//                });
418//            });
419
420        });
421
422        //CBS setting for gallery
423        var cbSettings = {
424            rel: 'cboxElement',
425            width: '95%',
426            height: 'auto',
427            maxWidth: '550',
428            maxHeight: '550',
429            title: function () {
430                return $(this).find('img').attr('alt');
431            },
432            current: totalteam_frontend_colorbox_params.current,
433            previous: totalteam_frontend_colorbox_params.previous,
434            next: totalteam_frontend_colorbox_params.next,
435            close: totalteam_frontend_colorbox_params.close,
436            xhrError: totalteam_frontend_colorbox_params.xhrError,
437            imgError: totalteam_frontend_colorbox_params.imgError
438        };
439
440        $('.ttp-popup-content-right,.ttp-popup-content-left, .ttp-popup-content-center').each(function () {
441            $(this).find('.gallery a[href$=".jpg"], .gallery a[href$=".jpeg"], .gallery a[href$=".png"], .gallery a[href$=".gif"]').colorbox(cbSettings);
442        });
443
444        if ($('.gallery').parents('body').hasClass('totalteam-template-default')) {
445            $('.gallery').each(function () {
446                $(this).find('a[href$=".jpg"], a[href$=".jpeg"], a[href$=".png"], a[href$=".gif"]').colorbox(cbSettings);
447            });
448        }
449
450    }); /** Function ends */
451
452}(jQuery));

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.