PageSourceSearch

https://www.irionline.org/wp-content/plugins/facetwp-beaver-builder/js/front.js?ver=1.5

js irionline.org collected 2026-09-24 21:33:31 UTC 7,883 bytes, 240 lines download raw bytes

1var FWPBB = FWPBB || {};
2
3(function($) {
4
5    // Prevent BB scroll
6    FLBuilderLayout._scrollToElement = function(el, callback) {
7        var config  = FLBuilderLayoutConfig.anchorLinkAnimations;
8
9        if (el.length > 0) {
10
11            // See _initAnchorLink() within bb-plugin/js/fl-builder-layout.js
12            if ( el.hasClass( 'fl-scroll-link' ) || el.hasClass( 'fl-row' ) || el.hasClass( 'fl-col' ) || el.hasClass( 'fl-module' ) ) {
13                var ot = el.offset().top,
14                    dh = $(document).height(),
15                    wh = $(window).height();
16
17                var dest = (ot > dh - wh) ? (dh - wh) : (ot - config.offset);
18
19                $('html, body').animate({ scrollTop: dest }, config.duration, config.easing, function() {
20                    if ('undefined' != typeof callback) {
21                        callback();
22                    }
23                });
24            }
25        }
26    }
27
28    // Grids
29    FWPBB.init_grids = function() {
30        $.each(FWPBB.modules, function(id, obj) {
31
32            // Posts module
33            if ( 'post-grid' === obj.type ) {
34
35                // Layout Columns
36                if ( 'columns' === obj.layout ) {
37
38                    new FLBuilderPostGrid(obj);
39
40                }
41                // Layout Masonry
42                else if ( 'grid' === obj.layout ) {
43
44                    new FLBuilderPostGrid(obj);
45                    $('.fl-node-' + id + ' .fl-post-grid').masonry('reloadItems');
46
47                }
48                // Layout Gallery
49                else if ( 'gallery' === obj.layout ) {
50
51                    new FLBuilderPostGrid(obj);
52
53                    $('.fl-post-gallery-img').each(function() {
54                        $(this)[0].style.setProperty('max-width', '100%', 'important');
55                    });
56
57                }
58
59            }
60            // Ultimate Addons Advanced Posts module
61            else if ( 'blog-posts' === obj.type ) {
62                if ( 'grid' === obj.is_carousel ) {
63
64                    var grid = new UABBBlogPosts(obj);
65                    var wrap = $('.fl-node-' + id + ' .uabb-blog-posts-grid');
66
67                    wrap.imagesLoaded( $.proxy(function() {
68
69                        if ( obj.equal_height_box == 'yes' ) {
70                            grid._uabbBlogPostMesonryHeight();
71                            setTimeout(() => {
72                                wrap.isotope('reloadItems').isotope(); // reapply isotope after refresh or load more
73                            }, 350); // needs some delay else overlaps
74                        }
75                        else {
76                            wrap.isotope('reloadItems').isotope(); // reapply isotope after refresh or load more
77                        }
78
79                    }, grid) );
80
81                }
82                else if ( 'masonary' === obj.is_carousel ) {
83
84                    var grid = new UABBBlogPosts(obj);
85                    var wrap = $('.fl-node-' + id + ' .uabb-blog-posts-masonary');
86
87                    wrap.imagesLoaded( $.proxy(function() {
88
89                        if ( obj.mesonry_equal_height == 'yes' ) {
90                            grid._uabbBlogPostMesonryHeight();
91                            setTimeout(() => {
92                                wrap.isotope('reloadItems').isotope(); // reapply isotope after refresh or load more
93                            }, 350); // needs some delay else overlaps
94                        }
95                        else {
96                            wrap.isotope('reloadItems').isotope(); // reapply isotope after refresh or load more
97                        }
98
99                    }, grid) );
100
101                }
102                else if ( 'carousel' === obj.is_carousel ) {
103
104                    var grid = new UABBBlogPosts(obj);
105                    var wrap = $('.fl-node-' + id + ' .uabb-blog-posts-carousel');
106                    wrap.uabbslick('unslick');
107                    $(window).trigger('resize');
108
109                    if ( obj.equal_height_box == 'yes' ) {
110                        setTimeout(() => {
111                            $(window).trigger('resize');
112                        }, 350); // needs some delay
113                    }
114
115                }
116            }
117            // Ultimate Addons Woo Products module
118            // Grid and Carousel layout
119            else if ( 'uabb-woo-products' === obj.type ) {
120
121                new UABBWooProducts(obj);
122
123            }
124
125        });
126        clean_pager();
127    }
128
129    function clean_pager() {
130        $('.facetwp-bb-module a.page-numbers').attr('href', '').each(function() {
131            $(this).trigger('init');
132        });
133    }
134
135    $(document).on('click init', '.facetwp-bb-module a.page-numbers', function(e) {
136        e.preventDefault();
137
138        if ( $(this).parents().hasClass('pp-ajax-pagination') ) {
139            return;
140        }
141
142        var $link = $(this);
143        var page = $link.text();
144
145        if ($link.hasClass('prev')) { // previous
146            page = FWP.settings.pager.page - 1;
147        }
148
149        if ($link.hasClass('next')) { // next
150            page = FWP.settings.pager.page + 1;
151        }
152
153        if (e.type === 'click') {
154            FWP.paged = page;
155            FWP.soft_refresh = true;
156            FWP.refresh();
157        }
158        else {
159            FWP.facets['paged'] = page;
160            $link.attr('href', '?' + FWP.buildQueryString());
161        }
162    });
163
164    $(document).on('facetwp-loaded', function() {
165        if (FWP.loaded || FWP.is_bfcache) {
166            FWPBB.init_grids();
167        }
168    });
169
170    $(document).on('facetwp-refresh', function() {
171        if ($('.facetwp-template:first').hasClass('facetwp-bb-module')) {
172            FWP.template = 'wp';
173        }
174    });
175
176
177    FWP.hooks.addFilter('facetwp/template_html', function(resp, params) {
178        if (FWP.is_load_more) {
179            let html = $(params.html);
180
181            let element = '.fl-post-grid';
182            let tpl = html.find(element);
183            if (tpl.length > 0) {
184                FWP.is_load_more = false;
185                $( '.facetwp-template '+element).append(tpl.html());
186                return true;
187            }
188
189            element = '.fl-post-gallery';
190            tpl = html.find(element);
191            if (tpl.length > 0) {
192                FWP.is_load_more = false;
193                $( '.facetwp-template '+element).append(tpl.html());
194                return true;
195            }
196
197            element = '.fl-post-feed';
198            tpl = html.find(element);
199            if (tpl.length > 0) {
200                FWP.is_load_more = false;
201                $( '.facetwp-template '+element).append(tpl.html());
202                return true;
203            }
204
205            element = '.pp-content-post-grid';
206            tpl = html.find(element);
207            if (tpl.length > 0) {
208                FWP.is_load_more = false;
209                $( '.facetwp-template '+element).append(tpl.html());
210                return true;
211            }
212
213            element = '.uabb-blog-posts';
214            tpl = html.find(element);
215            if (tpl.length > 0) {
216                FWP.is_load_more = false;
217                $( '.facetwp-template '+element).append(tpl.html());
218                return true;
219            }
220
221            element = 'fl-loop-grid';
222            if ( html.hasClass( element )) { // different check because .fl-loop-grid child class of .facetwp-template
223                FWP.is_load_more = false;
224                $( '.facetwp-template .'+element).append(html.html());
225                return true;
226            }
227
228            element = '.products'
229            tpl = html.find(element);
230            if (tpl.length > 0) {
231                FWP.is_load_more = false;
232                $( '.facetwp-template '+element).append(tpl.html());
233                return true;
234            }
235
236        }        
237        return resp;
238    }, 1 );
239
240})(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.