PageSourceSearch

https://greatlakes-seaway.com/wp-content/themes/slsmc/js/slsmc.js?ver=7.0.5

js greatlakes-seaway.com collected 2026-10-02 05:10:05 UTC 4,138 bytes, 92 lines download raw bytes

1/* JS for SLSMC site */
2
3jQuery( document ).ready(function() {
4
5
6    // Translate GDPR message (cookie notice) for French site
7    if (jQuery('.site').hasClass('fr')) {
8        jQuery('#cn-notice-text').html('Nous utilisons des témoins de connexion pour pouvoir vous offrir la meilleure expérience possible sur ce site Web. Si vous continuez d’utiliser ce site Web, nous conclurons que vous acceptez cette pratique.');
9    }
10
11
12
13    // Force WPML language switcher link to show correct “root” URL:
14    var bad_langswitch_url = jQuery('.wpml-ls-item .nav-link').attr('href');
15
16    if (bad_langswitch_url.indexOf('greatlakes-seaway.com/fr/') >= 0) {
17        var good_langswitch_url = bad_langswitch_url.replace("greatlakes-seaway.com/fr/", "grandslacs-voiemaritime.com/fr/");
18        jQuery('.wpml-ls-item .nav-link').attr('href',good_langswitch_url);
19    }
20    if (bad_langswitch_url.indexOf('grandslacs-voiemaritime.com/en/') >= 0) {
21        var good_langswitch_url = bad_langswitch_url.replace("grandslacs-voiemaritime.com/en/", "greatlakes-seaway.com/en/");
22        jQuery('.wpml-ls-item .nav-link').attr('href',good_langswitch_url);
23    }  jQuery('.wpml-ls-item .nav-link').attr('href',good_langswitch_url);
24
25
26    // Force WPML language switcher link to add query string to language switch link, if one exists for the current page/current language:
27    var url_full = location.href; 
28    var query_to_add = url_full.substring(url_full.indexOf("?")+1);
29    var check_if_had_query = query_to_add.indexOf("http") == 0  // output here will contain the WHOLE URL (e.g. 'http://whatever...') if there is NO query string in the URL. So only tack on the query string if one exists
30
31    if (check_if_had_query == false) { // no 'http' found? That means there IS query string, so let's tack it onto the language switcher URL:
32        var current_switcher_url = jQuery('.wpml-ls-menu-item a').attr('href');
33        var new_switcher_url = current_switcher_url+'?'+query_to_add;
34        jQuery('.wpml-ls-menu-item a').attr('href',new_switcher_url);
35    }
36    
37    
38    //Insert Seaway map icon before 'Seaway Map' link in utility menu
39    jQuery('.seawaymap-menuitem a').wrapInner('<span></span>');
40    jQuery('.seawaymap-menuitem a').prepend('<img class="seawaymap-icon" src="https://greatlakes-seaway.com/wp-content/themes/slsmc/images/300x300-seawaymap-icon.png" alt="Seaway Map icon">');
41
42
43    // Activate modal pop-up for site search tool
44    jQuery('.search-popuplink-modal').magnificPopup({
45        type: 'inline',
46
47        fixedContentPos: false,
48        fixedBgPos: true,
49
50        overflowY: 'auto',
51
52        closeBtnInside: true,
53        preloader: false,
54        
55        midClick: true,
56        removalDelay: 300,
57        mainClass: 'my-mfp-zoom-in'
58    });
59
60
61    // Highlight News link if you're on a news single post
62    if (jQuery('body').hasClass('single-news') || jQuery('body').hasClass('archive')) { // will probably need to adjust this later, since all archives might not live under 'News & Information'
63        jQuery('.main-menu-newslink > a.mega-menu-link').addClass('force-yellow-bottom-border');
64    }
65
66
67    // Force Breadcrumb link for 'News & Information' to go to special News & Info landing page. The breadcrumb sometimes wants to link to the default News & Information archive page instead.
68    jQuery('a.post-news-archive').each(function() { 
69        var currentlink = this.href;
70
71        if (currentlink.indexOf("/news") > -1) {
72            currentlink = currentlink.replace('/news', '/news-information');
73            jQuery(this).attr('href',currentlink);
74        }
75    });
76
77    // Force French Breadcrumb to display "Accueil" instead of "Home" for the Home link
78    if (jQuery('.site').hasClass('fr')) {
79        jQuery('#breadcrumbs-and-share-container span').each(function() {
80            var span_html = jQuery(this).html();
81
82            console.log(span_html);
83            if (span_html == 'Home') {
84                jQuery(this).html('Accueil');
85            }
86            if (span_html == 'News &amp; Information') {
87                jQuery(this).html('Nouvelles');
88            }
89        });
90    }
91   
92});

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.