PageSourceSearch

https://www.newenglishartclub.co.uk/lib/g/2.0/scripts/artlogic_mod…/galleries_js/pageload.js

js newenglishartclub.co.uk collected 2026-09-25 00:20:03 UTC 13,631 bytes, 302 lines download raw bytes

1import pageload_plugin from '../plugins/pageload.js'
2import layout from './layout.js';
3import image_gallery from './image_gallery.js';
4import image_popup from './image_popup.js';
5import responsive from './responsive.js';
6import misc from './misc.js';
7import artworks from './artworks.js';
8import contact_form_popup from './contact_form_popup.js';
9import sharing from './sharing.js';
10
11async function asyncCall() {
12    try {
13        var global_analytics = await Artlogic.import('galleries_js/global_a.js');
14        window.galleries.global_analytics.track_popup();
15
16    } catch (e) {
17        console.warn(e);
18    }
19}
20
21
22import mailinglist_signup_form_popup from './mailinglist_signup_form_popup.js';
23import cycle from '../plugins/jquery.cycle2.min.js';
24import ar_artworks from './ar_artworks.js';
25
26var pageload = {
27
28    init: function() {
29        if ($('body').hasClass('pageload-splash-active') || $('body').hasClass('pageload-ajax-navigation-active')) {
30
31            var site_name = '';
32            //if ($('meta[property="og:site_name"]').length) {
33            //    if ($('meta[property="og:site_name"]').attr('content') && typeof $('meta[property="og:site_name"]').attr('content') != 'undefined') {
34            //        var site_name = $('meta[property="og:site_name"]').attr('content');
35            //    }
36            //}
37            var ajax_navigation_active = $('body').hasClass('pageload-ajax-navigation-active');
38            //if (site_name != 'London Original Print Fair') {
39            //    var ajax_navigation_active = false;
40            //}
41
42            $.pageload({
43                'splash_screen_enabled': $('body').hasClass('pageload-splash-active'),
44                'splash_screen_always_enabled': ($('body').hasClass('pageload-ajax-navigation-active') && $('body').hasClass('pageload-splash-active') ? true : false),
45                
46                //'development_mode': true,
47                //'development_mode_pause_splash_screen': true,
48
49                'disable_ajax_param' : true,
50                'popup_content_enabled': true,
51                'popup_content_force_open': true,
52                'body_classes_to_retain': '',
53                'page_scroll_history': true,
54                'ajax_navigation_enabled': $('body').hasClass('pageload-ajax-navigation-active'), 
55                'splash_screen_primary_preload_images_selector': '#home_splash .content',
56                'splash_screen_secondary_preload_images_selector': '#home_splash #home_splash_image_container',
57                'splash_screen_click_to_close': $('body').hasClass('pageload-splash-pause') ? true : false,
58                'content_area_selector': '#container',
59                'preload_images_selector': '#slideshow li img, .parallax-image .parallax-image-inner .image, .feature_list .image, .header, #sidebar .image, .sidebar .image, #detail-slideshow .image, .svg, .fullscreen_slideshow .image',
60                'splash_screen_delay_after_complete': (typeof $('#home_splash').attr('data-timeout') != 'undefined' ? $('#home_splash').attr('data-timeout') : 1500),
61                'destroy_after_load': function() {
62                    if (typeof $(window).parallax != 'undefined') {
63                        $(window).parallax.destroy();
64                    }
65                    $('.parallax-mirror, #protected_path_login').remove();
66                    
67                    $('#slideshow ul, #mirror-slideshow ul, #ig_slideshow_thumbnails, #ig_slideshow, .image_gallery_multiple, #artist_list_slideshow ul, #list_preview_slideshow, #cover_page_slideshow ul').cycle('destroy');
68                        
69                    $('video').remove();
70                    
71                    window.galleries.layout.inview.destroy();
72                    
73                    if ($('body').hasClass('page-popup-active')) {
74                        // A popup is open, close it
75                        $.pageload.popup_close(true);
76                    }
77                    if (typeof fullpage_api != 'undefined') {
78                        fullpage_api.destroy('all');
79                    }
80                    
81                    window.galleries.pageload.destroy_after_load_callback();
82                },
83                'popup_after': function(original_click_element) {
84                    $('#popup_content').scrollTop(0);
85                    
86                    $('#container').removeClass('scrolling-down scrolling-up');
87                    if (typeof window.cart != 'undefined') {
88                        window.cart.init();
89                        // This should only be done if you are already interacting with the cart
90                        window.cart.cart_summary.get_summary(false);
91                    }
92                            
93                    if (h.element_exists('.image_gallery_multiple') && h.element_exists('#secondary_image_thumbnails')) {
94                        window.galleries.image_gallery.standard();
95                    }
96                    if ($('#image_gallery.image_gallery_no_caption').length > 0) {
97                        $('#popup_box').addClass('image_gallery_no_caption');
98                    } else {
99                        $('#popup_box').removeClass('image_gallery_no_caption');
100                    }
101                    
102                    if (!$('#popup_container .records_list.tile_list .t
102ile_list_formatted').length) {
103                        window.galleries.responsive.tile_list_setup($('#popup_container'));
104                    }
105                    
106                    if (!$('#popup_container .records_list.flow_list .flow_list_formatted').length) {
107                        window.galleries.responsive.flow_list_setup($('#popup_container'));
108                    }
109                    
110                    if ($('#popup_container .extended_click_area').length > 0) {
111                        window.galleries.misc.extended_click_area();
112                    }
113                    
114                    if ($("#popup_content").fitVids) {
115                        $("#popup_content").fitVids({ ignore: '.video_inline'});
116                    }
117                    
118                    if($('#popup_content #map_basic').length > 0) { 
119                        $('#popup_content #map_basic').attr("id","map_basic_popup");
120                        window.galleries.google_maps.init();
121                    }
122                    
123                    
124                    // Trigger AR quick look mode on hidden link
125                    $('.view-in-ar').click(function() {
126                        $(".ar-quick-look-wrapper a").get(0).click();
127                    });
128                    
129                    $(window).resize(function() {
130                        if ($('#popup_content #image_gallery.image_gallery_no_caption #image_container_wrapper').length) {
131                            var screen_height = $(window).height();
132                            $('#popup_content #image_gallery.image_gallery_no_caption #image_container_wrapper').css('min-height', screen_height);
133                        }
134                    });
135                    
136                    window.modules.sharing.init(true);
137                    window.galleries.artworks.init();
138                    window.galleries.contact_form_popup.init();
139                    window.galleries.image_popup.init();
140                    window.galleries.misc.loaders();
141                    window.galleries.pageload.popup_after_callback();
142                    
143                    window.galleries.ar_artworks.init();
144                    
145                    if ($('.convelio-widget-button').length) {
146                        Artlogic.import('galleries_js/shipping_widget.js')
147                        .then(function(){
148                            window.galleries.shipping_widget.init();
149                        })
150                        .catch(function(e){ console.error('Could not load shipping widget') });
151                    }
152                    // window.galleries.shipping_widget.init();
153
154                    //window.galleries.global_analytics.track_popup();
155                    asyncCall();
156                    
157                    $.pageload.refresh('#popup_box');
158                    
159                    $(window).trigger('resize');
160                    
161                    window.galleries.layout.inview.init(); // must come after resize!
162                    
163                    Artlogic.import('plugins/inview.js')
164                    .then(function(inview){
165                        if (typeof $.fn.lazyload.fire === "function") { 
166                            $.fn.lazyload.fire($('#popup_content .lazyload_wrapper'));
167                        }
168                    })
169                    
170                    
171                    if (typeof window.dynamicAR == "function") {
172                        window.dynamicAR();
173                    }
174
175                    window.archimedes.archimedes_core.rewrite_proxy_dir_urls();
176
177                },
178                'popup_after_close': function() {
179                    $('body').removeClass('popup-hidable-content user-distraction-free');
180                    $('body').removeClass('content-reversed content-not-reversed');
181                    $('.image_gallery_multiple').cycle('destroy');
182                    
183                    if (typeof fullpage_api != 'undefined') {
184                        fullpage_api.destroy('all');
185                    }
186
187                    if (window.galleries.artworks.favourites !== undefined
188                            && window.galleries.artworks.favourites.init !== undefined) {
189                        window.galleries.artworks.favourites.init();
190                    }
191                    
192                    // remove keyboard pagination listener
193                    $(window).off('keydown.popup_pagination');
194
195                    window.galleries.pageload.popup_after_close_callback();
196                    
197                },
198                'before_load': function () {
199                    $(document).off('mouseover.exitintent');
200                    $(document).off('mouseout.exitintent');
201                    if (typeof exit_intent_timeout != 'undefined') {
202                        clearTimeout(exit_intent_timeout);
203                    }
204                    $('body.slide-nav-open').removeClass('slide-nav-open');
205                    
206                    $('#responsive_slide_nav_wrapper .navigation ul li.item-visible').removeClass('item-visible');
207                    // remove instances of AR slider
208                    if ($('#popup_slider_container').length) {
209                        $('#popup_slider_container').ar_slider_destroy();
210                    }
211                    // remove instances of AR links
212                    if ($('#view-in-ar-link').length) {
213                        $('#view-in-ar-link').ar_slider_destroy();
214                    }
215                    // Close any open fancybox overlays
216                    if (typeof $.fancybox == 'function' && $('body').hasClass('fancybox-lock')) {
217                        $.fancybox.close();
218                    }
219                    window.galleries.pageload.before_load_callback();
220
221                    return Promise.resolve().then(() => {
222                        $('body').removeClass('slide-nav-active');
223                    });
224                },
225                'after_load_complete': function() {
226                    $('.jsSubmit').css('display','block');
227                    $('.nojsSubmit').css('display','none');
228                    
229                    if ($('.formRow.form_row.captchaFormRow').length) {
230                        location.reload(true);
231                    }
232
233                    window.galleries.pageload.after_load_complete_callback();
234
235                    window.galleries.pageload.language();
236                    return Promise.resolve().then(() => {
237                        if ($('.hero_section.parallax-element').length){
238                            $(window).trigger('resize');
239                        } 
240                    });
241                },
242                'on_page_transition': function() {
243                    window.galleries.pageload.on_page_transition_callback();
244                    return Promise.resolve().then(() => {
245                        $('body').removeClass('type-fullscreen layout-hero-header');
246                    });
247                },
248                'splash_screen_out': function() {
249                    window.galleries.mailinglist_signup_form_popup.auto_popup();
250                },
251                'pageview': function() {
252                    window.galleries.pageload.pageview_callback();
253                }
254                
255            });
256        }
257    },
258    
259    pageview_callback: function() {
260        
261    },
262    
263    popup_after_callback: function() {
264        
265    },
266    
267    popup_after_callback: function() {
268        
269    },
270    
271    popup_after_close_callback: function() {
272                
273    },
274    
275    destroy_after_load_callback: function() {
276        
277    },
278    
279    before_load_callback: function() {
280        
281    },
282    
283    after_load_complete_callback: function() {
284
285    },
286    
287    on_page_transition_callback: function() {
288        
289    },
290    language: function () {
291        const html_language = document.documentElement.lang
292        const active_language = document.querySelector("#translations_nav ul li.active")?.getAttribute("data-language");
293        if(active_language != html_language){
294            document.documentElement.lang = active_language;
295        }
296    }
297
298}
299
300window.galleries = window.galleries || {};
301window.galleries.pageload = pageload
302export default pageload

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.