PageSourceSearch

https://rccpc.org/_assets/js/monk/layouts/mcms_newhere_3.js

js rccpc.org collected 2026-10-04 15:44:24 UTC 11,567 bytes, 332 lines download raw bytes

1jQuery((function($) {
2    //sticky nav
3    $(".scroll-to-item").click((function() {
4        var sepLoc = $(this).attr("href"), 
5        //sepWidth = Math.max( $(window).width(), window.innerWidth),
6        sepNavHeight = $("#stickysub").height();
7        $("html, body").stop().animate({
8            scrollTop: $(sepLoc).offset().top - (sepNavHeight - 5)
9        }, 550);
10        return false;
11    }));
12    if ($("body").hasClass("substicky")) {
13        var csect = $(".stickysub-section"), cnav = $("#stickysub-nav"), nav_height = cnav.outerHeight();
14        $(window).on("scroll", (function() {
15            var cur_pos = $(this).scrollTop();
16            csect.each((function() {
17                var top = $(this).offset().top - nav_height, bottom = top + $(this).outerHeight();
18                if (cur_pos >= top && cur_pos <= bottom) {
19                    cnav.find("a").removeClass("active");
20                    csect.removeClass("active");
21                    $(this).addClass("active");
22                    cnav.find('a[href="#' + $(this).attr("id") + '"]').addClass("active");
23                } else {
24                    $(this).removeClass("active");
25                    cnav.find('a[href="#' + $(this).attr("id") + '"]').removeClass("active");
26                }
27            }));
28        }));
29    }
30    $("select.nav-dropdown").change((function(e) {
31        e.preventDefault();
32        e.stopPropagation();
33        // location.href = this.value;
34        // scroll to the selected section
35                var obj = cumulativeOffset(document.getElementById(this.value.replace("#", "")));
36        setTimeout((function() {
37            // console.log("THIS.value", obj.top);
38            // window.scrollTo(0, obj.top);
39            $("html,body").animate({
40                scrollTop: obj.top
41            }, 500);
42        }), 100);
43    }));
44    //featured grid links
45        $(".nh3-monklet-section-grid").makeNhRow({
46        childElem: "article",
47        sets: 3,
48        wrapper: '<div class="nh3-row" />'
49    });
50    $(".nh3-monklet-section-grid article > a").on("click", (function(event) {
51        event.preventDefault();
52        var thisGrid = $(this).parents(".nh3-monklet-section-grid");
53        var thisRow = $(this).parents(".nh3-row");
54        var thisArticle = $(this).parent("article");
55        var SetTimeout = 125;
56        if (thisRow.hasClass("active")) {
57            thisGrid.find(".nh3-desktop").hide();
58            var SetTimeout = 0;
59        } else {
60            thisGrid.find(".nh3-desktop").slideUp(SetTimeout);
61        }
62        setTimeout((function() {
63            thisGrid.find(".nh3-desktop").remove();
64        }), SetTimeout);
65        thisGrid.find(".nh3-row").removeClass("active");
66        thisGrid.find("article").removeClass("inactive");
67        thisGrid.find("article").not(thisArticle).removeClass("active");
68        thisRow.addClass("active");
69        thisArticle.toggleClass("active");
70        if (thisArticle.hasClass("active")) {
71            setTimeout((function() {
72                thisGrid.find("article").not(thisArticle).addClass("inactive");
73                var thisClone = thisArticle.find(".info-wrap").html();
74                $('<div class="nh3-desktop">' + thisClone + "</div>").insertAfter(thisRow);
75                if (thisRow.hasClass("active")) {
76                    $(".nh3-desktop").show();
77                } else {
78                    $(".nh3-desktop").slideDown(SetTimeout);
79                }
80            }), SetTimeout);
81        } else {}
82    }));
83    //map
84        if ($(".nh3-location-map").length) {
85        $("#nh3-location-map").addClass("loading");
86        var mapData = [];
87        $(".nh3-location-map").each((function() {
88            var nh3Data = $(this).data();
89            if (nh3Data.address) {
90                mapData.push(nh3Data);
91            }
92        }));
93        loadNh3Map(mapData);
94    }
95}));
96
97function loadNh3Map(data) {
98    var pageColor = $("body").data("pagecolor");
99    if (typeof pageColor !== "undefined") {
100        var iconColor = pageColor;
101    } else {
102        var iconColor = "#000000";
103    }
104    icon = {
105        path: "M16.1,31C16.1,31,16.1,31,16.1,31c0,0,10.9-14.5,10.9-19.3c0-7-5.5-10.1-10.9-10.1c-5.4,0-10.9,3.1-10.9,10.1,C5.2,16.5,16.1,31,16.1,31L16.1,31z M12.4,11.3C12.4,9.5,14,8,16.1,8s3.8,1.5,3.8,3.3s-1.7,3.3-3.8,3.3C14,14.6,12.4,13.1,12.4,11.3z",
106        fillColor: iconColor,
107        fillOpacity: 1,
108        anchor: new google.maps.Point(0, 0),
109        strokeWeight: 0,
110        scale: 1
111    };
112    var infoBox = new InfoBox;
113    infowindow = new google.maps.InfoWindow({
114        content: "loading..."
115    });
116    var infoBoxOptions = {
117        disableAutoPan: false,
118        maxWidth: 260,
119        alignBottom: true,
120        pixelOffset: new google.maps.Size(-112, -16),
121        zIndex: null,
122        boxStyle: {
123            width: "260px"
124        },
125        closeBoxMargin: "6px 6px 0px 0px",
126        closeBoxURL: "/_assets/img/maps/square_delete_dark.svg",
127        infoBoxClearance: new google.maps.Size(20, 20),
128        isHidden: false,
129        pane: "floatPane",
130        disableAutoPan: true,
131        enableEventPropagation: false
132    };
133    var map = new google.maps.Map(document.getElementById("nh3-location-map"), {
134        zoom: 13,
135        //scrollwheel: false,
136        //mapTypeControl: false,
137        //draggable: false,
138        //keyboardShortcuts: true,
139        //disableDefaultUI: false,
140        styles: [ {
141            featureType: "administrative",
142            elementType: "all",
143            stylers: [ {
144                visibility: "on"
145            }, {
146                saturation: -100
147            }, {
148                lightness: 20
149            } ]
150        }, {
151            featureType: "road",
152            elementType: "all",
153            stylers: [ {
154                visibility: "on"
155            }, {
156                saturation: -100
157            }, {
158                lightness: 40
159            } ]
160        }, {
161            featureType: "water",
162            elementType: "all",
163            stylers: [ {
164                visibility: "on"
165            }, {
166                saturation: -10
167            }, {
168                lightness: 30
169            } ]
170        }, {
171            featureType: "landscape.man_made",
172            elementType: "all",
173            stylers: [ {
174                visibility: "simplified"
175            }, {
176                saturation: -60
177            }, {
178                lightness: 10
179            } ]
180        }, {
181            featureType: "landscape.natural",
182            elementType: "all",
183            stylers: [ {
184                visibility: "simplified"
185            }, {
186                saturation: -60
187            }, {
188                lightness: 60
189            } ]
190        }, {
191            featureType: "poi",
192            elementType: "all",
193            stylers: [ {
194                visibility: "off"
195            }, {
196                saturation: -100
197            }, {
198                lightness: 60
199            } ]
200        }, {
201            featureType: "transit",
202            elementType: "all",
203            stylers: [ {
204                visibility: "off"
205            }, {
206                saturation: -100
207            }, {
208                lightness: 60
209            } ]
210        } ]
211    });
212    var max = calculateMaxBounds(data), center = max.getCenter();
213    map.fitBounds(max);
214    //markers
215        for (var i = 0; i < data.length; i++) {
216        var coords = {
217            lat: parseFloat(data[i].latitude),
218            lng: parseFloat(data[i].longitude)
219        };
220        var infoContent = '<div class="infowindow">';
221        infoContent += '<div class="info">';
222        infoContent += '<div class="text">';
223        infoContent += '<div class="inner">';
224        infoContent += '<h4 class="mb-2">' + data[i].name + "</h4>";
225        infoContent += '<h6 class="mb-1"><i class="icon icon-location"></i> ' + data[i].address + "</h6>";
226        infoContent += '<p class="mb-0 mt-4">';
227        infoContent += '<a href="http://maps.google.com/maps?q=' + data[i].address + '" target="_blank" class="btn btn-primary btn-xs ">Directions</a>';
228        if (data[i].website) {
229            infoContent += ' <a href="' + data[i].website + '" class="btn btn-primary btn-xs">Info</a>';
230        }
231        infoContent += "</p>";
232        infoContent += "</div>";
233        infoContent += "</div>";
234        infoContent += "</div>";
235        infoContent += "</div>";
236        var marker = new google.maps.Marker({
237            position: coords,
238            map: map,
239            icon: icon,
240            desc: infoContent
241        });
242    }
243    google.maps.event.addListener(marker, "click", (function() {
244        infoBox.close();
245        infoBox.setOptions(infoBoxOptions);
246        infoBox.setContent(marker.desc);
247        infoBox.open(map, marker);
248    }));
249    google.maps.event.addListener(map, "click", (function() {
250        infoBox.close();
251    }));
252    google.maps.event.addListenerOnce(map, "idle", (function() {
253        $("#nh3-location-map").addClass("active").removeClass("loading");
254    }));
255}
256
257function extendViewport(degrees, latLngBounds) {
258    var ne = new google.maps.LatLng(latLngBounds.getNorthEast().lat() + degrees, latLngBounds.getNorthEast().lng() + degrees);
259    sw = new google.maps.LatLng(latLngBounds.getSouthWest().lat() - degrees, latLngBounds.getSouthWest().lng() - degrees);
260    return new google.maps.LatLngBounds(sw, ne);
261}
262
263function calculateMaxBounds(objects) {
264    if (!objects || !objects.length) {
265        return false;
266    } else {
267        var max, degrees, latLngs = [];
268        // Build collection of LatLngBounds
269                objects.forEach((function(object, index, array) {
270            if (object.latitude && object.longitude) {
271                latLngs.push(new google.maps.LatLng(object.latitude, object.longitude));
272            }
273        }));
274        // Compare each location and get the maximum bounds
275                latLngs.forEach((function(latLng, index, array) {
276            if (index === 0) {
277                max = new google.maps.LatLngBounds(latLng, latLng);
278            } else {
279                max.extend(latLng);
280            }
281        }));
282        degrees = latLngs.length === 1 ? .1 : .03;
283        return extendViewport(degrees, max);
284    }
285}
286
287(function($) {
288    $.fn.makeNhRow = function makeNhRow(options) {
289        var options = $.extend({
290            childElem: undefined,
291            sets: 1,
292            wrapper: "div"
293        }, options || {});
294        if (options.childElem === undefined) return this;
295        return this.each((function() {
296            var elems = $(this).children(options.childElem);
297            var arr = [];
298            elems.each((function(i, value) {
299                arr.push(value);
300                if ((i + 1) % options.sets === 0 || i === elems.length - 1) {
301                    var set = $(arr);
302                    arr = [];
303                    set.wrapAll(options.wrapper);
304                }
305            }));
306        }));
307    };
308})(jQuery);
309
310var cumulativeOffset = function(element) {
311    var top = 0, left = 0;
312    do {
313        top += element.offsetTop || 0;
314        left += element.offsetLeft || 0;
315        element = element.offsetParent;
316    } while (element);
317    return {
318        top: top,
319        left: left
320    };
321};
322
323function getmUrlParameter(param, url) {
324    var sPageURL = url.split("?")[1];
325    var sURLVariables = sPageURL.split("&");
326    for (var i = 0; i < sURLVariables.length; i++) {
327        var sParameterName = sURLVariables[i].split("=");
328        if (sParameterName[0] == param) {
329            return sParameterName[1];
330        }
331    }
332}

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.