PageSourceSearch

https://www.eldoraspeedway.com/wp-content/themes/eldora/lib/custom.js

js eldoraspeedway.com collected 2026-09-24 18:23:19 UTC 12,924 bytes, 431 lines download raw bytes

1"use strict";
2var subMenuHeightToTransition = 300;
3
4(function ($) {
5    var hasSubmenu = $("body .content-area nav.menu").length > 0;
6    var hasJumpmenu = $("body .content-area select.jump-menu").length > 0;
7
8    // mmenu
9    var navMenu = $("nav#menu");
10    if (navMenu.length) {
11        navMenu.show();
12
13        navMenu.mmenu({
14            extensions: ["effect-slide-menu", "pageshadow", "theme-dark"],
15            searchfield: false,
16            counters: false,
17            offCanvas: {
18                position: "right"
19            },
20            navbar: {
21                title: "Menu"
22            },
23            navbars: [
24                {
25                    position: "top",
26                    content: ["prev", "title", "close"]
27                }
28            ]
29        });
30
31        navMenu.find(".mm-prev").html("<span class=\"back-btn\">BACK</span>");
32
33        $("#menu").find(".mm-next").each(function () {
34            var href = $(this).attr("href");
35            var next = $(this).next("a");
36
37            next.attr("href", href);
38            next.attr("data-target", href);
39
40            //$(this).hide();
41        });
42    }
43
44    // toggle mmenu
45    $(".navbar-header .navbar-toggle").click(function () {
46        //$('#page').toggleClass('slid');
47        $("#toggleMenu").click();
48        return false;
49    });
50
51    $(".top-links").on("click", function (e) {
52
53        e.preventDefault();
54
55        if ( e.target.localName == 'a'){
56
57            var href = $(e.target).attr('href');
58
59            $('.top-content').removeClass('top-content-active');
60            $(href).addClass('top-content-active');
61
62            if (href == '.event_coverage'){
63                slickifyTopContent(href);
64            }
65
66            $(".top-links-list").fadeOut('fast');
67            $(this).removeClass("expanded");
68        } else {
69
70            if ($(this).hasClass("expanded")) {
71                $(".top-links-list").fadeOut();
72            } else {
73                $(".top-links-list").fadeIn();
74            }
75
76            $(this).toggleClass("expanded");
77        }
78    });
79
80    var masthead = $("#masthead");
81    var searchForm = masthead.find(".form-search");
82    var searchInput = searchForm.find(".search-query");
83    var clicked = false;
84    $("#searchsubmit").on("click", function (e) {
85
86        if (!clicked) {
87            clicked = true;
88            e.preventDefault();
89            searchForm.addClass("opened");
90            searchInput.focus();
91        }
92
93    });
94    searchInput.on("focusout", function () {
95        searchForm.removeClass("opened");
96    });
97
98    function slickifyTopContent( selector ){
99
100        var slider = $(selector);
101
102        if (slider.hasClass('slick-slider')){
103            return;
104        }
105        slider.slick({
106            dots: false,
107            infinite: true,
108            speed: 300,
109            slidesToShow: 1,
110            slidesToScroll: 1,
111            mobileFirst: true,
112            nextArrow: "<button type=\"button\" data-role=\"none\" class=\"slick-next slick-arrow\" aria-label=\"Next\" role=\"button\"" +
113            " style=\"display: block;\"><i class=\"fa fa-angle-right\"></i>Next</button>",
114            responsive: [
115                {
116                    breakpoint: 1025,
117                    settings: {
118                        slidesToShow: 5,
119                        slidesToScroll: 1
120                    }
121                },
122                {
123                    breakpoint: 769,
124                    settings: {
125                        slidesToShow: 4,
126                        slidesToScroll: 4
127                    }
128                },
129                {
130                    breakpoint: 361,
131                    settings: {
132                        slidesToShow: 2,
133                        slidesToScroll: 2
134                    }
135                }
136            ]
137        });
138    }
139
140    var upcomingEvents = $(".upcoming_events");
141
142    if (upcomingEvents.length) {
143        $(".upcoming_events").on("init", function () {
144            $(".top-bar").addClass("open");
145        });
146        upcomingEvents.slick({
147            dots: false,
148            infinite: true,
149            speed: 300,
150            slidesToShow: 1,
151            slidesToScroll: 1,
152            mobileFirst: true,
153            nextArrow: "<button type=\"button\" data-role=\"none\" class=\"slick-next slick-arrow\" aria-label=\"Next\" role=\"button\"" +
154                " style=\"display: block;\"><i class=\"fa fa-angle-right\"></i>Next</button>",
155            responsive: [
156                {
157                    breakpoint: 1025,
158                    settings: {
159                        slidesToShow: 5,
160                        slidesToScroll: 1
161                    }
162                },
163                {
164                    breakpoint: 769,
165                    settings: {
166                        slidesToShow: 4,
167                        slidesToScroll: 4
168                    }
169                },
170                {
171                    breakpoint: 361,
172                    settings: {
173                        slidesToShow: 2,
174                        slidesToScroll: 2
175                    }
176                }
177            ]
178        });
179
180    }
181
182    var slicklider = $(".slicklider");
183
184    if (slicklider.length) {
185        slicklider.show().slick({
186            dots: false,
187            infinite: true,
188            speed: 300,
189            centerMode: true,
190            variableWidth: false
191        });
192    }
193
194    var siteUpdates = $(".site-updates .slider");
195
196    if (siteUpdates.length) {
197
198        siteUpdates.show().slick({
199            dots: false,
200            infinite: false,
201            speed: 300,
202            slidesToShow: 1,
203            slidesToScroll: 1,
204            mobileFirst: true,
205            prevArrow: ".site-updates .paging .prev",
206            nextArrow: ".site-updates .paging .next",
207            responsive: [
208                {
209                    breakpoint: 1281,
210                    settings: {
211                        slidesToShow: 6,
212                        slidesToScroll: 1
213                    }
214                },
215                {
216                    breakpoint: 1025,
217                    settings: {
218                        slidesToShow: 4,
219                        slidesToScroll: 1
220                    }
221                },
222                {
223                    breakpoint: 769,
224                    settings: {
225                        slidesToShow: 3,
226                        slidesToScroll: 1
227                    }
228                },
229                {
230                    breakpoint: 361,
231                    settings: {
232                        slidesToShow: 2,
233                        slidesToScroll: 1
234                    }
235                }
236            ]
237        });
238    }
239
240    function loadSocialFeedSlider() {
241        var socialUpdates = $(".social-feed");
242
243        if (socialUpdates.length) {
244
245            socialUpdates.show().slick({
246                dots: false,
247                infinite: false,
248                speed: 300,
249                slidesToShow: 3,
250                slidesToScroll: 1,
251                mobileFirst: false,
252                responsive: [
253                    {
254                        breakpoint: 1025,
255                        settings: {
256                            slidesToShow: 2,
257                            slidesToScroll: 1
258                        }
259                    },
260                    {
261                        breakpoint: 480,
262                        settings: {
263                            slidesToShow: 1,
264                            slidesToScroll: 1
265                        }
266                    }
267                ]
268            });
269        }
270    }
271
272    $(".social-feed").socialfeed({
273        //facebook     : {
274        //	accounts    : ['@eldoraspeedway'],  //Array: Specify a list of accounts from which to pull wall posts
275        //	limit       : 5,                                   //Integer: max number of posts to load
276        //	access_token: '1630809173849128|Hqt-lZnE05PfhOKgOSYL6v192BA'  //String: "APP_ID|APP_SECRET"
277        //},
278        twitter: {
279            accounts: ["@eldoraspeedway"],
280            limit: 3,
281            consumer_key: "QAPZN5QOgKXKRnJWRk9dAqnrB",
282            consumer_secret: "uNUgIq1bafLYVxepCsMiOf774ezMPUSFepQIL9xmEYugTA7pQ4"
283        },
284        callback: function () {
285            loadSocialFeedSlider();
286        },
287        // GENERAL SETTINGS
288        length: 95,                                      //Integer: For posts with text longer than this length, show an ellipsis.
289        template_html: "<div class=\"col-md-4 col-sm-4 col-xs-12\">\
290			<div class=\"fb-container\">\
291				<p class=\"fb-title\">{{=it.time_ago }}</p>\
292				<p class=\"fb-body\">{{=it.text}} <a href=\"{{=it.link}}\" target=\"_blank\">read more</a></p>\
293				</div>\
294			</div>"
295    });
296
297    $(".sidebar-twitter-feed").socialfeed({
298        twitter: {
299            accounts: ["@eldoraspeedway"],
300            limit: 3,
301            consumer_key: "QAPZN5QOgKXKRnJWRk9dAqnrB",
302            consumer_secret: "uNUgIq1bafLYVxepCsMiOf774ezMPUSFepQIL9xmEYugTA7pQ4"
303        },
304        // GENERAL SETTINGS
305        length: 95,
306        template_html: "<div class=\"social-item\">\
307				<p class=\"social-time\">{{=it.time_ago }}</p>\
308				<p class=\"social-body\">{{=it.text}} <a href=\"{{=it.link}}\" target=\"_blank\">read more</a></p>\
309			</div>"
310    });
311
312    $(".list-collapsible").each(function () {
313        var el = $(this);
314        el.next("ul").not(".active").hide().find(".list-collapsible-close").click(function (e) {
315            if ($.smoothScroll) {
316                $.smoothScroll({
317                    scrollElement: $("body"),
318                    scrollTarget: el
319                });
320            }
321            var parent = $(this).parent();
322            parent.slideUp(function () {
323                parent.removeClass("active");
324            });
325        });
326        el.click(function (e) {
327            var elmt = $(this);
328            var next = elmt.next("ul");
329            if (next.hasClass("active")) {
330                next.slideUp(function () {
331                    next.removeClass("active");
332                });
333            } else {
334                next.slideDown(function () {
335                    next.addClass("active");
336                });
337            }
338        });
339    });
340
341    function makeNavFixed() {
342        var positionTop = 0;
343        var navHeight = 210;
344
345        if ($(window).scrollTop() > (positionTop + navHeight)) {
346            $("#nav-wrapper").addClass("slim");
347        } else {
348            $("#nav-wrapper").removeClass("slim");
349        }
350    }
351
352    function makeSubMenuFixed() {
353        if ($(window).scrollTop() > subMenuHeightToTransition) {
354            var menu = $("nav.menu >.nav");
355            if (menu.length > 0) {
356                menu.css("width", menu.width() + "px").addClass("sticky");
357            }
358        } else {
359            var menu = $("nav.menu >.nav");
360            if (menu.length > 0) {
361                $("nav.menu li.active").removeClass("active");
362                menu.removeClass("sticky").css("width", "auto").find("li:first-child").addClass("active");
363            }
364        }
365    }
366
367    if ($("body.home").length > 0) {
368        $(".homepage-slider .left-col .result-item .trigger-menu
368-open").click(function (e) {
369            e.preventDefault();
370            $(this).next(".dropdown").addClass("open");
371        });
372        $(".homepage-slider .left-col .result-item .trigger-menu-close a").click(function (e) {
373            e.preventDefault();
374            $(this).parent().parent().removeClass("open");
375        });
376    }
377
378    if ($("body.single-event").length > 0 || $("body.single-event_coverage").length > 0) {
379        $(".event-menu-slider").slick({
380            dots: false,
381            infinite: false,
382            speed: 300,
383            slidesToShow: 1,
384            variableWidth: true
385        });
386
387        $(".event-menu-slider a").smoothScroll();
388    }
389
390    if (hasSubmenu) {
391        $("nav.menu a").smoothScroll({
392            //offset     : -210,
393            afterScroll: function (opts) {
394                $("nav.menu li.active").removeClass("active");
395                $(this).parent().addClass("active");
396            }
397        });
398    }
399
400    //FAQ nav
401    var alphaNav = $(".alphabet a");
402    if (alphaNav.length > 0) {
403        alphaNav.smoothScroll({
404            offset: -190,
405            afterScroll: function (opts) {
406                $(".alphabet a.active").removeClass("active");
407                $(this).addClass("active");
408            }
409        });
410    }
411
412    if (hasJumpmenu) {
413        $("select.jump-menu").on("change", function () {
414            var el = $(this);
415            document.location.href = el.val();
416            el.val("");
417        });
418    }
419
420    $(window).scroll(function () {
421        makeNavFixed();
422        if (hasSubmenu) {
423            makeSubMenuFixed();
424        }
425    });
426    makeNavFixed();
427    if (hasSubmenu) {
428        makeSubMenuFixed();
429    }
430})(jQuery);
431

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.