PageSourceSearch

https://atlaspress.co.uk/wp-content/plugins/load-more-products-for-woocommerce/js/load_products.js?ver=3.2.3

js atlaspress.co.uk collected 2026-10-02 07:11:27 UTC 34,579 bytes, 625 lines download raw bytes

1var lmp_update_state, load_next_page, lmp_ajax_instance = false, lmp_update_lazyload, lmp_init, lmp_init_buttons, lmp_products_elements;
2(function ($){
3    lmp_products_elements = function(selector) {
4        var elements = $(selector);
5        elements = elements.filter(function() {
6            return $(this).closest('.br-brands-product-list').length === 0;
7        });
8        return elements;
9    }
10    $('body').append( $( '<div class="berocket_load_more_preload">'
11    + the_lmp_js_data.load_image
12    + the_lmp_js_data.br_lmp_button_settings_load_image 
13    + the_lmp_js_data.br_lmp_button_settings_use_image 
14    + the_lmp_js_data.br_lmp_prev_settings_load_image 
15    + the_lmp_js_data.br_lmp_prev_settings_use_image 
16    + '</div>' ) );
17    $(document).ready( function () {
18        var lmp_is_loading = false, lmp_loading_style;
19        var lmp_count_start = 0, lmp_count_end = 0, lmp_count_laststart = 0, lmp_count_lastend = 0, lmp_count_text = '';
20        lmp_init = function() {
21            lmp_is_loading = false, lmp_loading_style, lmp_count_start = 0, lmp_count_end = 0, lmp_count_laststart = 0, lmp_count_lastend = 0, lmp_count_text = '';
22            $( '.berocket_load_more_preload' ).remove();
23            var products_elements = lmp_products_elements(the_lmp_js_data.products);
24            if( products_elements.find( the_lmp_js_data.item ).first().length ) {
25                products_elements.find( the_lmp_js_data.item ).first().addClass('berocket_lmp_first_on_page').attr('data-url', decodeURIComponent(location.href));
26            }
27            if( products_elements.find( '.berocket_lgv_additional_data' ).first().length ) {
28                products_elements.find( '.berocket_lgv_additional_data' ).first().addClass('berocket_lmp_first_on_page').attr('data-url', decodeURIComponent(location.href));
29            }
30            if( $('.br_product_result_count').length ) {
31                lmp_count_start = $('.br_product_result_count').data('start');
32                lmp_count_end = $('.br_product_result_count').data('end');
33                lmp_count_text = $('.br_product_result_count').data('text');
34                lmp_count_laststart = lmp_count_start;
35                lmp_count_lastend = lmp_count_end;
36            }
37        }
38        lmp_init_buttons = function() {
39            var products_elements = lmp_products_elements(the_lmp_js_data.products);
40            if ( products_elements.length <= 0 ) {
41                return;
42            }
43            products_elements.after( $( the_lmp_js_data.load_more ) );
44            if( the_lmp_js_data.use_prev_btn ) {
45                products_elements.before( $( the_lmp_js_data.load_prev ) );
46            }
47        }
48        $(window).resize( function () {
49            current_style();
50        });
51        lmp_init();
52        lmp_init_buttons();
53        current_style();
54        window.addEventListener("popstate", function (event) {
55            if ( lmp_loading_style != 'none' && typeof the_lmp_js_data.update_url != "undefined" && the_lmp_js_data.update_url == 1 ) {
56                var state = event.state;
57                if( typeof(state) != 'undefined' && state != null && typeof(state.blmp) != 'undefined' && state.blmp == 'br_lmp_popstate' ) {
58                    if(lmp_loading_style !== 'pagination') {
59                        if( ! lmp_is_loading ) {
60                            lmp_is_loading = true;
61                            if( $('.berocket_lmp_first_on_page[data-url="'+decodeURIComponent(location.href)+'"]').length ) {
62                                $('html, body').stop().animate({
63                                    scrollTop: $('.berocket_lmp_first_on_page[data-url="'+decodeURIComponent(location.href)+'"]').offset().top
64                                }, 500, function(){lmp_is_loading = false;});
65                            } else {
66                                location.reload();
67                            }
68                        }
69                    } else {
70                        if( lmp_ajax_instance != false ) {
71                            lmp_ajax_instance.abort();
72                            end_ajax_loading();
73                        }
74                        load_next_page(true, decodeURIComponent(location.href));
75                    }
76                }
77            }
78        });
79        var br_load_more_html5_wait;
80        function br_load_more_html5() {
81            clearTimeout(br_load_more_html5_wait);
82            br_load_more_html5_wait = setTimeout(function() {
83                if ( typeof the_lmp_js_data.update_url != "undefined" && the_lmp_js_data.update_url == 1 ) {
84                    if( ! lmp_is_loading ) {
85                        if(lmp_loading_style !== 'pagination') {
86                            var next_page = '';
87                            $('.berocket_lmp_first_on_page').each(function(i, o) {
88                                if( ! $(o).is(':visible') ) {
89                                    return true;
90                                }
91                                if( $(o).offset().top > $(window).scrollTop()+(window.innerHeight/2) ) {
92                                    return false;
93                                }
94                                next_page = $(o).attr('data-url');
95                            });
96                            if( ! next_page ) {
97                                next_page = $('.berocket_lmp_first_on_page').first().attr('data-url');
98                            }
99                            var current_state = history.state;
100                            if( next_page && decodeURIComponent(location.href) != next_page && ( current_state == null || typeof(current_state.link) == 'undefined' || current_state.link != next_page ) ) {
101                                var history_data = {blmp:'br_lmp_popstate'};
102                                history.replaceState(history_data, "");
103                                var history_data = {blmp:'br_lmp_popstate', link:next_page};
104                                history.pushState(history_data, "", next_page);
105                                history.pathname = next_page;
106                            }
107                        }
108                    }
109                }
110            }, 50);
111        }
112        $(document).on('berocket_ajax_filtering_start', function() {
113            lmp_is_loading = true;
114        });
115        $(document).on('berocket_ajax_filtering_end', function() {
116            lmp_is_loading = false;
117        });
118        $(document).on( 'click', '.br_lmp_button_settings .lmp_button', function (event) {
119            event.preventDefault();
120            load_next_page();
121        });
122        $(document).on( 'click', '.br_lmp_prev_settings .lmp_button', function (event) {
123            event.preventDefault();
124            load_next_page(2, $(this).attr('href'));
125        });
126        if ( lmp_loading_style !== 'pagination' ) {
127            $(window).scroll ( function () {
128                var products_elements = lmp_products_elements(the_lmp_js_data.products);
129                if( products_elements.length > 0 && ! lmp_is_loading ) {
130                    br_load_more_html5();
131                    if ( lmp_loading_style == 'infinity_scroll' ) {
132                        var products_bottom = products_elements.offset().top + products_elements.height() - the_lmp_js_data.buffer;
133                        var bottom_position = $(window).scrollTop() + window.innerHeight;
134                        if ( products_bottom < bottom_position && ! lmp_is_loading ) {
135                            lmp_update_state();
136                            load_next_page();
137                        }
138                    }
139                }
140            });
141        }
142        if ( lmp_loading_style != 'none' && (! the_lmp_js_data.is_AAPF || typeof the_ajax_script == 'undefined') ) {
143            $(document).on( 'click', the_lmp_js_data.pagination+' a', function (event) {
144                if( lmp_products_elements( the_lmp_js_data.products ).length > 0 ) {
145                    event.preventDefault();
146                    var next_page = $(this).attr('href');
147                    if ( typeof the_lmp_js_data.update_url != "undefined" && the_lmp_js_data.update_url == 1 ) {
148                        var history_data = {blmp:'br_lmp_popstate'};
149                        history.replaceState(history_data, "");
150                        var history_data = {blmp:'br_lmp_popstate', link: next_page};
151                        history.pushState(history_data, "", next_page);
152                        history.pathname = next_page;
153                    }
154                    load_next_page( true, next_page );
155                }
156            });
157        }
158
159        load_next_page = function ( replace, user_next_page ) {
160            if( ! lmp_is_loading ) {
161                if ( typeof( replace ) == 'undefined' ) {
162                    user_next_page = false;
163                }
164                if ( typeof( user_next_page ) == 'undefined' ) {
165                    user_next_page = false;
166                }
167                var $next_page = jquery_get_next_page();
168                if ( $next_page.length > 0 || user_next_page !== false ) {
169                    start_ajax_loading(replace);
170                    var next_page;
171                    if( user_next_page !== false ) {
172                        next_page = user_next_page;
173                    } else {
174                        next_page = $next_page.attr('href');
175                    }
176                    lmp_ajax_instance = $.ajax({method:"GET", url: next_page, beforeSend: function(xhr) {
177                            xhr.setRequestHeader('X-Braapfdisable', '1');
178                        }, success: function( data ) {
179                        lmp_ajax_instance = false;
180                        var $data = $('<div>'+data+'</div>');
181                        if( the_lmp_js_data.lazy_load_m && $(window).width() <= the_lmp_js_data.mobile_width || the_lmp_js_data.lazy_load && $(window).width() > the_lmp_js_data.mobile_width ) {
182                            $data.find( the_lmp_js_data.products+' .lazy,'+the_lmp_js_data.item+', .berocket_lgv_additional_data' ).find( 'img' ).each( function ( i, o ) {
183                                $(o).attr( 'data-src', $(o).attr( 'src' ) ).removeAttr( 'src' );
184                                $(o).attr( 'data-srcset', $(o).attr( 'srcset' ) ).removeAttr( 'srcset' );
185                            });
186                            $data.find(the_lmp_js_data.item+', .berocket_lgv_additional_data').addClass('lazy');
187                        }
188                        if( $data.find( the_lmp_js_data.products ).find(the_lmp_js_data.item).first().length ) {
189                            $data.find( the_lmp_js_data.products ).find(the_lmp_js_data.item).first().addClass('berocket_lmp_first_on_page').attr('data-url', decodeURIComponent(next_page));
190                        }
191                        if( $data.find( the_lmp_js_data.products ).find('.berocket_lgv_additional_data').first().length ) {
192                            $data.find( the_lmp_js_data.products ).find('.berocket_lgv_additional_data').first().addClass('berocket_lmp_first_on_page').attr('data-url', decodeURIComponent(next_page));
193                        }
194                        var $products = $data.find( the_lmp_js_data.products ).html();
195                        if ( replace == 1 ) {
196                            lmp_products_elements( the_lmp_js_data.products ).html( $products );
197                        } else if( replace == 2 ) {
198                            $products = $data.find( the_lmp_js_data.products );
199                            $products.find(the_lmp_js_data.item).addClass('berocket_lmp_hidden');
200                            var count_images = $products.find(the_lmp_js_data.item).find('img').length;
201                            $products = $products.html();
202                            lmp_products_elements( the_lmp_js_data.products ).prepend( $products );
203                            berocket_show_berocket_lmp_hidden_executed = false;
204                            function berocket_show_berocket_lmp_hidden() {
205                                if( ! berocket_show_berocket_lmp_hidden_executed ) {
206                                    berocket_show_berocket_lmp_hidden_executed = true;
207                                    var object = lmp_products_elements( the_lmp_js_data.products ).find(the_lmp_js_data.item+':not(".berocket_lmp_hidden")').first();
208                                    var positionOld = object.offset().top;
209                                    var scrollTop = $(window).scrollTop();
210                                    $('.berocket_lmp_hidden').removeClass('berocket_lmp_hidden');
211                                    end_ajax_loading();
212                                    var positionNew = object.offset().top;
213                                    $(window).scrollTop(positionNew - (positionOld - scrollTop));
214                                }
215                            }
216                            $( the_lmp_js_data.products ).find('.berocket_lmp_hidden').find('img').on('load error', function() {
217                                count_images--;
218                                if( count_images <= 1 ) {
219                                    berocket_show_berocket_lmp_hidden();
220                                }
221                            });
222                            setTimeout(berocket_show_berocket_lmp_hidden, 2500);
223                        } else {
224                            lmp_products_elements( the_lmp_js_data.products ).append( $products );
225                        }
226                        lmp_update_lazyload();
227                        if(lmp_loading_style !== 'pagination')
228                        {
229                            if( $data.find('.br_product_result_count').length && (lmp_count_start || lmp_count_end) ) {
230                                lmp_count_text = $data.find('.br_product_result_count').data('text');
231                                if( replace == 2 ) {
232                                    lmp_count_start = $data.find('.br_product_result_count').data('start');
233                                } else {
234                                    lmp_count_end = $data.find('.br_product_result_count').data('end');
235                                }
236                                lmp_count_lastend = $data.find('.br_product_result_count').data('end');
237                                lmp_count_laststart = $data.find('.br_product_result_count').data('start');
238                                text_count = lmp_count_text;
239                                text_count = text_count.replace('-1', lmp_count_start);
240                                text_count = text_count.replace('-2', lmp_count_end);
241                                $('.woocommerce-result-count').text(text_count);
242                            } else {
243                                $('.woocommerce-result-count').text($data.find('.woocommerce-result-count:first').text());
244                            }
245                        }
246                        else
247                        {
248                            $('.woocommerce-result-count').text($data.find('.woocommerce-result-count:first').text());
249                        }
250                                                
251                        var $pagination = $data.find( the_lmp_js_data.pagination );
252                        if( replace == 1 ) {
253                            $( the_lmp_js_data.pagination ).html( $pagination.html() );
254                        } else if( the_lmp_js_data.type == 'more_pagination' ) {
255                            pagination_replace_partial($data, replace);
256                        } else if( replace == 2 ) {
257                            var $prev_page = jquery_get_prev_page(
257);
258                            var $new_prev_page = jquery_get_prev_page($data);
259                            if( $new_prev_page.length ) {
260                                $prev_page.replaceWith($new_prev_page);
261                            } else {
262                                $prev_page.remove();
263                            }
264                        } else {
265                            var $next_page = jquery_get_next_page();
266                            var $new_next_page = jquery_get_next_page($data);
267                            if( $new_next_page.length ) {
268                                $next_page.replaceWith($new_next_page);
269                            } else {
270                                $next_page.remove();
271                            }
272                        }
273                        current_style();
274                        brloadmore_universal_theme_compatibility();
275                        if( replace != 2 ) {
276                            end_ajax_loading();
277                        }
278                    }});
279                }
280            }
281        }
282        function pagination_replace_partial($data, replace) {
283            var $pagination = $( the_lmp_js_data.pagination );
284            var $new_pagination = $data.find( the_lmp_js_data.pagination );
285            var $prev_page = jquery_get_prev_page();
286            var $new_prev_page = jquery_get_prev_page($data);
287            var $next_page = jquery_get_next_page();
288            var $new_next_page = jquery_get_next_page($data);
289            var easy_way = true;
290            if( ($pagination.find(the_lmp_js_data.next_page).length || $pagination.find(the_lmp_js_data.prev_page).length) && $pagination.find('.current').length ) {
291                if( replace == 2 ) {
292                    var $current = $pagination.find('.current').last();
293                    var $new_current = $new_pagination.find('.current').last();
294                } else {
295                    var $current = $pagination.find('.current').first();
296                    var $new_current = $new_pagination.find('.current').first();
297                }
298                var $current_block = get_current_page_last_block($current);
299                var $new_current_block = get_current_page_last_block($new_current);
300                var html_between_current = '';
301                if( the_lmp_js_data.html_between_current ) {
302                    html_between_current = the_lmp_js_data.html_between_current;
303                }
304                if( $current_block !== false && $new_current_block !== false ) {
305                    easy_way = false;
306                    if( replace == 2 ) {
307                        $current_block.prevAll().remove();
308                        while($new_current_block.prevAll().length) {
309                            $current_block.before($new_current_block.prevAll().last());
310                        }
311                        $current_block.before($new_current_block);
312                        if( html_between_current ) {
313                            $current_block.before($(html_between_current));
314                        }
315                    } else {
316                        $current_block.nextAll().remove();
317                        $current_block.after($new_current_block.nextAll());
318                        $current_block.after($new_current_block);
319                        if( html_between_current ) {
320                            $current_block.after($(html_between_current));
321                        }
322                    }
323                }
324            }
325            if(easy_way) {
326                if( replace == 2 ) {
327                    if( $next_page.length ) {
328                        $new_next_page.replaceWith($next_page.first());
329                    } else {
330                        $new_next_page.remove();
331                    }
332                } else {
333                    if( $prev_page.length ) {
334                        $new_prev_page.replaceWith($prev_page.first());
335                    } else {
336                        $new_prev_page.remove();
337                    }
338                }
339                $pagination.html( $new_pagination.html() );
340            }
341        }
342        function get_current_page_last_block($current) {
343            var $i = 10;
344            var $needed_block
345            do {
346                $i--;
347                $needed_block = $current;
348                $current = $current.parent();
349            } while( $i > 0 && !(($current.find(the_lmp_js_data.next_page).length || $current.find(the_lmp_js_data.prev_page).length) && $current.find('.current').length) );
350            if( $i <= 0 ) {
351                return false;
352            } else {
353                return $needed_block;
354            }
355        }
356        function woocommerce_result_count_update() {
357            if(lmp_loading_style !== 'pagination') {
358                if( $('.br_product_result_count').length ) {
359                    lmp_count_start = $('.br_product_result_count').data('start');
360                    lmp_count_end = $('.br_product_result_count').data('end');
361                    lmp_count_text = $('.br_product_result_count').data('text');
362                    lmp_count_lastend = lmp_count_end;
363                    lmp_count_laststart = lmp_count_start;
364                    text_count = lmp_count_text;
365                    text_count = text_count.replace('-1', lmp_count_start);
366                    text_count = text_count.replace('-2', lmp_count_end);
367                    $('.woocommerce-result-count').text(text_count);
368                }
369            }
370        }
371        function start_ajax_loading(replace) {
372            lmp_is_loading = true;
373            jQuery('body').addClass('berocket_lmp_ajax_loading');
374            lmp_execute_func( the_lmp_js_data.javascript.before_update );
375            $(document).trigger('berocket_lmp_start');
376            if( replace == 2 ) {
377                lmp_products_elements( the_lmp_js_data.products ).before( $( the_lmp_js_data.load_image ) );
378                $(document).trigger('berocket_lmp_start_prev');
379            } else {
380                lmp_products_elements( the_lmp_js_data.products ).after( $( the_lmp_js_data.load_image ) );
381                $(document).trigger('berocket_lmp_start_next');
382            }
383        }
384        function end_ajax_loading() {
385            var products_elements = lmp_products_elements(the_lmp_js_data.products);
386            if( typeof(products_elements.isotope) == 'function' && products_elements.data('isotope') ) {
387                products_elements.isotope( 'reloadItems' );
388                products_elements.isotope();
389            }
390            $( the_lmp_js_data.load_img_class ).remove();
391            $(document).trigger('berocket_ajax_products_infinite_loaded');
392            $(document).trigger('berocket_lmp_end');
393            lmp_execute_func( the_lmp_js_data.javascript.after_update );
394            jQuery('body').removeClass('berocket_lmp_ajax_loading');
395            lmp_is_loading = false;
396            var $next_page = jquery_get_next_page();
397            if( ( lmp_loading_style == 'infinity_scroll' || lmp_loading_style == 'more_button' ) && $next_page.length <= 0 ) {
398                products_elements.append( $( the_lmp_js_data.end_text ) );
399            }
400            br_load_more_html5();
401        }
402        function current_style() {
403            if ( lmp_products_elements( the_lmp_js_data.products ).length <= 0 ) {
404                return;
405            }
406            var $next_page = jquery_get_next_page();
407            if( $next_page.length > 0 ) {
408                $('.br_lmp_button_settings .lmp_button').attr('href', $next_page.attr('href'));
409            }
410            var $prev_page = jquery_get_prev_page();
411            if( $prev_page.length > 0 ) {
412                $('.br_lmp_prev_settings .lmp_button').attr('href', $prev_page.attr('href'));
413            }
414            if ( the_lmp_js_data.use_mobile && $(window).width() <= the_lmp_js_data.mobile_width ) {
415                set_style( the_lmp_js_data.mobile_type );
416            } else {
417                set_style( the_lmp_js_data.type );
418            }
419        }
420        var Timeout_test_prev_page = false;
421        function set_style( style ) {
422            $( '.lmp_load_more_button' ).hide();
423            if( style != 'none' ) {
424                var $next_page = jquery_get_next_page();
425                $( the_lmp_js_data.pagination ).hide();
426                if ( style == 'more_button' ) {
427                    if ( $next_page.length > 0 ) {
428                        $( '.lmp_load_more_button.br_lmp_button_settings' ).show();
429                    } else {
430                        setTimeout( test_next_page, 4000 );
431                    }
432                } else if ( style == 'pagination' ) {
433                    $( the_lmp_js_data.pagination ).show();
434                } else if ( style == 'more_pagination' ) {
435                    $( the_lmp_js_data.pagination ).show();
436                    if ( $next_page.length > 0 ) {
437                        $( '.lmp_load_more_button.br_lmp_button_settings' ).show();
438                    } else {
439                        setTimeout( test_next_page, 4000 );
440                    }
441                }
442                var $prev_page = jquery_get_prev_page();
443                if ( $prev_page.length > 0 ) {
444                    $( '.lmp_load_more_button.br_lmp_prev_settings' ).show();
445                } else {
446                    if( Timeout_test_prev_page != false ) {
447                        clearTimeout(Timeout_test_prev_page);
448                    }
449                    Timeout_test_prev_page = setTimeout( test_prev_page, 4000 );
450                }
451            }
452            lmp_loading_style = style;
453        }
454        function test_next_page() {
455            var $next_page = jquery_get_next_page();
456            if ( $next_page.length > 0 ) {
457                current_style();
458            } else {
459                setTimeout( test_next_page, 4000 );
460            }
461        }
462        function test_prev_page() {
463            var $prev_page = jquery_get_prev_page();
464            if ( $prev_page.length > 0 ) {
465                current_style();
466            } else {
467                if( Timeout_test_prev_page != false ) {
468                    clearTimeout(Timeout_test_prev_page);
469                }
470                Timeout_test_prev_page = setTimeout( test_prev_page, 4000 );
471            }
472        }
473        function jquery_get_next_page($parent) {
474            if( typeof($parent) == 'undefined' ) {
475                $parent = $(document);
476            }
477            var $pagination = $parent.find(the_lmp_js_data.pagination);
478            if( $pagination.find(the_lmp_js_data.next_page).length > 0 ) {
479                $next_page = $pagination.find(the_lmp_js_data.next_page);
480            } else {
481                $next_page = $parent.find( the_lmp_js_data.next_page );
482            }
483            return $next_page;
484        }
485        function jquery_get_prev_page($parent) {
486            if( typeof($parent) == 'undefined' ) {
487                $parent = $(document);
488            }
489            var $pagination = $parent.find(the_lmp_js_data.pagination);
490            if( $pagination.find(the_lmp_js_data.prev_page).length > 0 ) {
491                $prev_page = $pagination.find(the_lmp_js_data.prev_page);
492            } else {
493                $prev_page = $parent.find( the_lmp_js_data.prev_page );
494            }
495            return $prev_page;
496        }
497        lmp_update_state = function(reset_count) {
498            if( typeof reset_count == 'undefined' ) {
499                reset_count = false;
500            }
501            if( ! lmp_products_elements( the_lmp_js_data.products ).find( the_lmp_js_data.item ).first().is('.berocket_lmp_first_on_page') ) {
502                lmp_products_elements( the_lmp_js_data.products ).find( the_lmp_js_data.item ).first().addClass('berocket_lmp_first_on_page').attr('data-url', decodeURIComponent(location.href));
503            }
504            current_style();
505            if( reset_count ) {
506                woocommerce_result_count_update();
507            }
508        }
509        $(document).on('berocket_ajax_products_loaded', function(){
510            lmp_update_state(true);
511            if( typeof $(window).lazyLoadXT != 'undefined' ) {
512                if( the_lmp_js_data.lazy_load_m && $(window).width() <= the_lmp_js_data.mobile_width || the_lmp_js_data.lazy_load && $(window).width() > the_lmp_js_data.mobile_width ) {
513                    jQuery(the_lmp_js_data.item+', .berocket_lgv_additional_data').addClass('lazy').find( 'img' ).each( 
514                        function ( i, o ) {
515                            jQuery(o)
516                                .attr( 'data-src', jQuery(o).attr( 'src' ) ).removeAttr( 'src' )
517                                .attr( 'data-srcset', jQuery(o).attr( 'srcset' ) ).removeAttr( 'srcset' );
518                        }
519                    ).lazyLoadXT();
520                }
521            }
522            lmp_update_lazyload();
523        });
524        $(document).on('berocket_lgv_after_style_set', function() {
525            jQuery(window).scrollTop(jQuery(window).scrollTop() + 1).scrollTop(jQuery(window).scrollTop() - 1);
526            jQuery( the_lmp_js_data.item+'.animated').trigger('lazyshow');
527        });
528        lmp_update_lazyload = function() {
529            if( typeof $(window).lazyLoadXT != 'undefined' ) {
530                if( the_lmp_js_data.lazy_load_m && $(window).width() <= the_lmp_js_data.mobile_width || the_lmp_js_data.lazy_load && $(window).width() > the_lmp_js_data.mobile_width ) {
531                    lmp_products_elements( the_lmp_js_data.products+' .lazy' ).find( 'img' ).lazyLoadXT();
532                    lmp_products_elements( the_lmp_js_data.products ).find('.lazy').on( 'lazyshow', function () {
533                        $(this).removeClass('lazy').addClass('animated').addClass(the_lmp_js_data.LLanimation);
534                        if( $(this).is('img') ) {
535                            $(this).attr('srcset', $(this).data('srcset'));
536                        } else {
537                            $(this).find('img').each( function ( i, o ) {
538                                $(o).attr('srcset', $(o).data('srcset'));
539                            });
540                        }
541                        if( ! $(this).is('.berocket_lgv_additional_data') ) {
542                            $(this).next( '.berocket_lgv_additional_data' ).removeClass('lazy').addClass('animated').addClass(the_lmp_js_data.LLanimation);
543                        }
544                    });
545                }
546            }
547        }
548        brloadmore_universal_theme_compatibility = function() {
549            $(window).trigger('resize');
550            //UNCODE theme
551            try {if( berocket_apply_filters('uncode_theme_compatibility', (typeof(UNCODE) == 'object' && typeof(UNCODE.init) == 'function' ) ) ) {
552                UNCODE.init();
553            }} catch (e) {}
554            //Flatsome theme
555            try {if( berocket_apply_filters('flatsome_theme_compatibility', (typeof(Flatsome) == 'object' && typeof(Flatsome.attach) == 'function' && lmp_products_elements(the_lmp_js_data.products).length ) ) ) {
556                Flatsome.attach(lmp_products_elements(the_lmp_js_data.products));
557            }} catch (e) {}
558            //Woodmart theme
559            try {if( berocket_apply_filters('woodmart_theme_compatibility', (typeof(woodmartThemeModule) == 'object' && typeof(woodmartThemeModule.init) == 'function' ) ) ) {
560                woodmartThemeModule.wooInit();
561                woodmartThemeModule.lazyLoading();
562                woodmartThemeModule.productsLoadMore();
563            }} catch (e) {}
564            //Divi theme
565            try {if( berocket_apply_filters('divi_theme_compatibility', (typeof(et_reinit_waypoint_modules) == 'function' ) ) ) {
566                et_reinit_waypoint_modules();
567            }} catch (e) {}
568            //reyTheme theme
569            try {if( berocket_apply_filters('rey_theme_compatibility', (typeof(jQuery.reyTheme) == 'object' && typeof(jQuery.reyTheme.init) == 'function' ) ) ) {
570                jQuery.reyTheme.init();
571            }} catch (e) {}
572            //layzyLoadImage script
573            try {if( berocket_apply_filters('layzyloadimage_script_compatibility', (typeof(layzyLoadImage) == 'function' ) ) ) {
574                layzyLoadImage();
575            }} catch (e) {}
576            //jetpackLazyImagesModule script
577            try {if( berocket_apply_filters('jetpacklazyimages_script_compatibility', (typeof(jetpackLazyImagesModule) == 'function' ) ) ) {
578                jetpackLazyImagesModule();
579            }} catch (e) {}
580            try {
581            jQuery('img.jetpack-lazy-image').each(function() {
582                jQuery(this).removeClass('jetpack-lazy-image').attr('src', jQuery(this).data('lazy-src'));
583                jQuery(this).removeClass('jetpack-lazy-image').attr('srcset', '');
584            });
585            } catch (e) {}
586            //SWIFT script
587            try {if( berocket_apply_filters('swift_script_compatibility', (typeof(SWIFT) == 'object' && typeof(SWIFT.woocommerce) == 'object' && typeof(SWIFT.woocommerce.init) == 'function' ) ) ) {
588                SWIFT.woocommerce.init();
589            }} catch (e) {}
590            try {if( typeof(baapfGet_wprocketInstance) != 'undefined' ) {
591                baapfGet_wprocketInstance.update();
592            }} catch (e) {}
593            try {
594                jQuery(document).trigger('facetwp-loaded');
595            } catch (e) {}
596            try {if( berocket_apply_filters('etTheme_compatibility', (typeof(etTheme) == 'object' && typeof(etTheme.global_image_lazy) == 'function' ) ) ) {
597                etTheme.global_image_lazy();
598            }} catch (e) {}
599            try { if( typeof(InfiniteScroll) == 'function' ) {
600                var infScroll = InfiniteScroll.data( '.shop-container .products' );
601                if( typeof(infScroll) == 'object' && infScroll.options ) {
602                    var infOptionsStore = infScroll.options;
603                    infScroll.destroy();
604                    jQuery('.shop-container .products').data('infiniteScroll', '').infiniteScroll(infOptionsStore);
605                }
606            }} catch (e) {}
607            try { if( jQuery('.shop-container .products').length && typeof(jQuery('.shop-container .products').data('packery')) == 'object' ) {
608                jQuery('.shop-container .products').packery('reloadItems').packery('layout');
609            }} catch (e) {}
610        }
611    });
612})(jQuery);
613function lmp_execute_func ( func ) {
614    if( the_lmp_js_data.javascript != 'undefined'
615        && the_lmp_js_data.javascript != null
616        && typeof func != 'undefined' 
617        && func.length > 0 ) {
618        try{
619            eval( func );
620        } catch(err){
621            alert('You have some incorrect JavaScript code (Load More Products)');
622        }
623    }
624}
625

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.