PageSourceSearch

https://www.tringjonction.qc.ca/includes/scripts/all.js?v=43

js tringjonction.qc.ca collected 2026-10-02 22:45:55 UTC 3,101 bytes, 108 lines download raw bytes

1var page = {};
2
3page.showRightNav = true;
4
5// ------------------------------------------------------------
6// Prototype
7// ------------------------------------------------------------
8
9if (typeof String.prototype.startsWith != 'function') {
10    String.prototype.startsWith = function (str){
11        return this.indexOf(str) == 0;
12    };
13}
14
15if (typeof String.prototype.contains != 'function') {
16    String.prototype.contains = function() {
17        return String.prototype.indexOf.apply( this, arguments ) !== -1;
18    };
19}
20
21// ------------------------------------------------------------
22// URL methods
23// ------------------------------------------------------------
24
25page.getCurrentUrl = function(){
26    return page.cleanUrl(window.location.href);
27};
28
29page.cleanUrl = function(url){
30    if (url != undefined)
31        return url.split("?")[0].split("#")[0];
32    return "";
33};
34
35page.isRootUrl = function(){
36    return page.isUrl("");
37};
38
39page.isUrl = function(url){
40    return page.cleanUrl(location.pathname) == "/" + url || page.cleanUrl(location.pathname) == url;
41};
42
43page.getDomain = function(url){
44    var a = document.createElement('a');
45    a.href = page.cleanUrl(url);
46    return a.hostname;
47};
48
49page.isExternalLink = function(url){
50    return page.getDomain(page.getCurrentUrl()) != page.getDomain(url);
51};
52
53// ------------------------------------------------------------
54// Page methods
55// ------------------------------------------------------------
56
57page.changeBullets = function(){
58    $('.carousel-bullets span').html(' ');
59};
60
61page.updateNewsletterButton = function(){
62    var btn = $('.uts-newsletter').find('input[type=submit]');
63    $(btn).addClass('btn');
64    $(btn).val("M'abonner");
65};
66
67page.changeExternalLinkTarget = function(){
68    $('ul.menu li a').each(function(){
69        if (page.isExternalLink($(this).attr('href')))
70            $(this).attr('target', 'blank');
71    });
72};
73
74page.showCorrectHeader = function(){
75    if (!$('.headerResponsive').is(':visible')) {
76        if (page.isRootUrl()) {
77            $('#headerCarousel').show();
78        } else {
79            if (overrideBackgroundImageUrl != "")
80                $('#headerAutres').css("background-image", "url('" + overrideBackgroundImageUrl + "')");
81            $('#headerAutres').show();
82            $('#headerAutres .container div').delay(1000).animate({left: "0"}, 1000, "swing");
83        }
84    }
85};
86
87/*page.activateTooltipster = function(){
88    $('.tooltip2').tooltipster({
89        content: $('<span>Page Facebook "Loisirs Saint-Vallier"</span>'),
90        theme: "tooltipster-theme"
91    });
92    $('.tooltip3').tooltipster({
93        content: $('<span>Page Facebook "Tourisme Saint-Vallier"</span>'),
94        theme: "tooltipster-theme"
95    });
96};*/
97
98// ------------------------------------------------------------
99// Entry point: Page Load
100// ------------------------------------------------------------
101
102$(document).ready(function(){
103    page.updateNewsletterButton();
104    page.changeExternalLinkTarget();
105    page.showCorrectHeader();
106    page.changeBullets();
107    uts.apps.directory.topScrollOffset = -170;
108})

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.