PageSourceSearch

https://www.seeedstudio.com/blog/wp-content/plugins/cocobasic-shortcode/js/main.js?ver=7.1.2

js seeedstudio.com collected 2026-09-24 08:31:11 UTC 9,474 bytes, 248 lines download raw bytes

1(function ($) {
2    "use stict";
3    var count = 1;
4    var portfolioPostsPerPage = $(".grid-item").length;
5    var totalNumberOfPortfolioPages = Math.ceil(parseInt(ajax_var_portfolio.total) / portfolioPostsPerPage);
6    var currentPosition = $(window).scrollTop();
7
8    $(window).on('scroll', function () {
9        var scroll = $(window).scrollTop();
10        if (scroll > currentPosition) { //Load only on scroll down
11            loadMorePortfolioItemsOnScroll();
12        }
13        currentPosition = scroll;
14    });
15
16
17//Hide Portfolio Load More Button
18    showHidePortfolioLoadMoreButton();
19//Load more articles in Portfolio
20    loadMorePortfolioOnClick();
21//PrettyPhoto initial    
22    setPrettyPhoto();
23//Image slider
24    imageSliderSettings();
25//Text slider
26    textSliderSettings();
27
28    $(window).on('load', function () {
29        isotopeSetUp();
30    });
31
32    function isotopeSetUp() {
33        $('.grid').isotope({
34            itemSelector: '.grid-item',
35            transitionDuration: 0,
36            masonry: {
37                columnWidth: '.grid-sizer'
38            }
39        });
40        $('.grid').isotope('layout');
41    }
42
43    function showHidePortfolioLoadMoreButton() {
44        if (portfolioPostsPerPage < parseInt(ajax_var_portfolio.total)) {
45            $('.more-posts-portfolio').css('visibility', 'visible');
46            $('.more-posts-portfolio').animate({opacity: 1}, 1500);
47        } else {
48            $('.more-posts-portfolio').css('display', 'none');
49        }
50    }
51
52    function imageSliderSettings() {
53        $(".image-slider-wrapper").each(function () {
54            var id = $(this).attr('id');
55            var auto_value = window[id + '_auto'];
56            var speed_value = window[id + '_speed'];
57            var items_value = window[id + '_items'];
58            var gap = window[id + '_gap'];
59            auto_value = (auto_value === 'true') ? true : false;
60            if (auto_value === true)
61            {
62                var mySwiper = new Swiper('#' + id, {
63                    autoplay: {
64                        delay: speed_value
65                    },
66                    scrollbar: {
67                        el: '.swiper-scrollbar-' + id,
68                        hide: false,
69                        draggable: true,
70                        dragSize: '18px'
71                    },
72                    slidesPerView: items_value,
73                    spaceBetween: parseInt(gap),
74                    resistance: true,
75                    resistanceRatio: 0.5,
76                    breakpoints: {
77                        1024: {
78                            slidesPerView: 1,
79                            spaceBetween: 0
80                        }
81                    },
82                    pagination: {
83                        el: '.swiper-pagination-' + id,
84                        clickable: true
85                    }
86                });
87                $('#' + id).hover(function () {
88                    mySwiper.autoplay.stop();
89                }, function () {
90                    mySwiper.autoplay.start();
91                    ;
92                });
93            } else {
94                var mySwiper = new Swiper('#' + id, {
95                    scrollbar: {
96                        el: '.swiper-scrollbar-' + id,
97                        hide: false,
98                        draggable: true,
99                        dragSize: '18px'
100                    },
101                    slidesPerView: items_value,
102                    spaceBetween: parseInt(gap),
103                    resistance: true,
104                    resistanceRatio: 0.5,
105                    breakpoints: {
106                        1024: {
107                            slidesPerView: 1,
108                            spaceBetween: 0
109                        }
110                    },
111                    pagination: {
112                        el: '.swiper-pagination-' + id,
113                        clickable: true
114                    }
115                });
116            }
117        });
118    }
119
120    function textSliderSettings() {
121        $(".text-slider-wrapper").each(function () {
122            var id = $(this).attr('id');
123            var auto_value = window[id + '_auto'];
124            var speed_value = window[id + '_speed'];
125            auto_value = (auto_value === 'true') ? true : false;
126            if (auto_value === true)
127            {
128                var mySwiper = new Swiper('#' + id, {
129                    autoplay: {
130                        delay: speed_value
131                    },
132                    scrollbar: {
133                        el: '.swiper-scrollbar-' + id,
134                        hide: false,
135                        draggable: true,
136                        dragSize: '18px'
137                    },
138                    slidesPerView: "1",
139                    resistance: true,
140                    resistanceRatio: 0.5,
141                    pagination: {
142                        el: '.swiper-pagination-' + id,
143                        clickable: true
144                    }
145                });
146                $('#' + id).hover(function () {
147                    mySwiper.autoplay.stop();
148                }, function () {
149                    mySwiper.autoplay.start();
150                    ;
151                });
152            } else {
153                var mySwiper = new Swiper('#' + id, {
154                    scrollbar: {
155                        el: '.swiper-scrollbar-' + id,
156                        hide: false,
157                        draggable: true,
158                        dragSize: '18px'
159                    },
160                    slidesPerView: "1",
161                    resistance: true,
162                    resistanceRatio: 0.5,
163                    pagination: {
164                        el: '.swiper-pagination-' + id,
165                        clickable: true
166                    }
167                });
168            }
169        });
170    }
171
172    function setPrettyPhoto() {
173        $('a[data-rel]').each(function () {
174            $(this).attr('rel', $(this).data('rel'));
175        });
176        $("a[rel^='prettyPhoto']").prettyPhoto({
177            slideshow: false, /* false OR interval time in ms */
178            overlay_gallery: false, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
179            default_width: 1280,
180            default_height: 720,
181            deeplinking: false,
182            social_tools: false,
183            iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>'
184        });
185    }
186
187    function loadMorePortfolioOnClick() {
188        $('.more-posts-portfolio:visible').on('click', function () {
189            count++;
190            loadPortfolioMoreItems(count, portfolioPostsPerPage);
191            $('.more-posts-portfolio').css('display', 'none');
192            $('.more-posts-portfolio-loading').css('display', 'inline-block');
193        });
194    }
195
196    function loadPortfolioMoreItems(pageNumber, portfolioPostsPerPage) {
197        $.ajax({
198            url: ajax_var_portfolio.url,
199            type: 'POST',
200            data: "action=portfolio_ajax_load_more&portfolio_page_number=" + pageNumber + "&portfolio_posts_per_page=" + portfolioPostsPerPage + "&security=" + ajax_var_portfolio.nonce,
201            success: function (html) {
202                var $newItems = $(html);
203                $('.grid').append($newItems);
204                $('.grid').imagesLoaded(function () {
205                    $('.grid').isotope('appended', $newItems);
206                    animateElement();
207                    if (count == totalNumberOfPortfolioPages)
208                    {
209                        $('.more-posts-portfolio').css('display', 'none');
210                        $('.more-posts-portfolio-loading').css('display', 'none');
211                        $('.no-more-posts-portfolio').css('display', 'inline-block');
212                    } else
213                    {
214                        $('.more-posts-portfolio').css('display', 'inline-block');
215                        $('.more-posts-portfolio-loading').css('display', 'none');
216                        $(".more-posts-portfolio-holder").removeClass('stop-loading');
217                    }
218                });
219                setPrettyPhoto();
220            }
221        });
222        return false;
223    }
224
225    function loadMorePortfolioItemsOnScroll(e) {
226        $(".more-posts-portfolio-holder.scroll").not('.stop-loading').each(function (i) {
227            var top_of_object = $(this).offset().top;
228            var bottom_of_window = $(window).scrollTop() + $(window).height();
229            if ((bottom_of_window - 70) > top_of_object) {
230                $(this).addClass('stop-loading');
231                count++;
232                loadPortfolioMoreItems(count, portfolioPostsPerPage);
233                $('.more-posts-portfolio-loading').css('display', 'inline-block');
234            }
235        });
236    }
237	
238	function animateElement(e) {
239        $(".animate").each(function (i) {
240            var top_of_object = $(this).offset().top;
241            var bottom_of_window = $(window).scrollTop() + $(window).height();
242            if ((bottom_of_window - 70) > top_of_object) {
243                $(this).addClass('show-it');
244            }
245        });
246    }
247	
248})(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.