PageSourceSearch

https://leotunapika.com/wp-content/themes/foodica/assets/js/foodica-functions.js?ver=1.3.3

js leotunapika.com collected 2026-10-08 11:43:16 UTC 3,782 bytes, 146 lines download raw bytes

1/**
2 * Theme functions file
3 */
4(function ($) {
5    'use strict';
6
7    var $window = $(window);
8
9
10    /**
11    * Document ready (jQuery)
12    */
13    $(function () {
14
15        var wpzoomLazyLoadImagesInitEvent = function () {
16
17            var event = document.createEvent('Event');
18            var bodyEl = document.querySelector('body');
19
20            event.initEvent('jetpack-lazy-images-load', true, true);
21            bodyEl.dispatchEvent(event);
22
23        };
24
25        /**
26         * Activate superfish menu.
27         */
28        $('.sf-menu').superfish({
29            'speed': 'fast',
30            'delay' : 0,
31            'animation': {
32                'height': 'show'
33            }
34        });
35
36       /**
37        * SlickNav
38        */
39
40       $('#menu-main-slide').slicknav({
41           prependTo:'.navbar-header-main',
42           allowParentLinks: true,
43           closedSymbol: "",
44           openedSymbol: ""
45           }
46       );
47
48       /* Tag Cloud fix */
49       $('.tag-cloud-link:has(.post_count)').addClass('has_sub');
50
51
52        /**
53         * FitVids - Responsive Videos in posts
54         */
55        $(".entry-content, .cover").fitVids();
56
57
58        /**
59         * Search form in header.
60         */
61        $(".sb-search").sbSearch();
62
63
64        /**
65         * Recipe Index infinite loading support.
66         */
67        var $folioitems = $('.foodica-index');
68        if (typeof wpz_currPage != 'undefined' && wpz_currPage < wpz_maxPages) {
69            $('.navigation').empty().append('<a class="btn btn-primary" id="load-more" href="#">' + zoomOptions.index_infinite_load_txt + '</a>');
70
71            $('#load-more').on('click', function (e) {
72                e.preventDefault();
73                if (wpz_currPage < wpz_maxPages) {
74                    $(this).text(zoomOptions.index_infinite_loading_txt);
75                    wpz_currPage++;
76
77                    $.get(wpz_pagingURL + wpz_currPage + '/', function (data) {
78                        var $newItems = $('.foodica-index article', data);
79
80                        $newItems.addClass('hidden').hide();
81                        $folioitems.append($newItems);
82                        $folioitems.find('article.hidden').fadeIn().removeClass('hidden');
83
84                        if ((wpz_currPage + 1) <= wpz_maxPages) {
85                            $('#load-more').text(zoomOptions.index_infinite_load_txt);
86                        } else {
87                            $('#load-more').animate({height: 'hide', opacity: 'hide'}, 'slow', function () {
88                                $(this).remove();
89                            });
90                        }
91
92                        //trigger jetpack lazy images event
93                        $( 'body' ).trigger( 'jetpack-lazy-images-load');
94                        wpzoomLazyLoadImagesInitEvent();
95                    });
96                }
97            });
98        }
99
100
101
102    });
103
104    $window.on('load', function() {
105
106        /**
107         * Activate main slider.
108         */
109        $('#slider').sllider();
110
111
112    });
113
114
115    $.fn.sllider = function() {
116        return this.each(function () {
117            var $this = $(this);
118
119            var $slides = $this.find('.slide');
120
121            if ($slides.length <= 1) {
122                $slides.addClass('is-selected');
123
124                return;
125            }
126
127            var flky = new Flickity('.slides', {
128                cellAlign: 'center',
129                contain: true,
130                percentPosition: false,
131                //prevNextButtons: false,
132                pageDots: true,
133                wrapAround: true,
134                accessibility: false
135            });
136        });
137    };
138
139
140    $.fn.sbSearch = function() {
141       return this.each(function() {
142           new UISearch( this );
143       });
144    };
145
146})(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.