PageSourceSearch

https://www.resourcelabel.com/wp-content/themes/resourcelabelgroup/assets/js/custom-ada-script.js?ver=1.0.0

js resourcelabel.com collected 2026-10-09 22:11:54 UTC 24,119 bytes, 591 lines download raw bytes

1jQuery(document).ready(function ($) {
2//     jQuery("nav > ul.menu.menu--main > li.menu-item-has-children > a").each(function () {
3//         const $span = jQuery(this);
4//         try {
5//             const $button = jQuery(
6//                 '<button class="menu-toggle-btn dropdown_available" aria-expanded="false">' +
7//                     '<svg class="arrow-down" xmlns="http://www.w3.org/2000/svg" width="12" height="14" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round">' +
8//                     '<path d="M6 9l6 6 6-6"/>' +
9//                     "</svg>" +
10//                     '<svg class="arrow-up" xmlns="http://www.w3.org/2000/svg" width="12" height="14" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round">' +
11//                     '<path d="M18 15l-6-6-6 6"/>' +
12//                     "</svg>" +
13//                     "</button>"
14//             );
15//             $span.append($button);
16//         } catch (error) {}
17//     });
18//     jQuery(document).on("keydown", function (e) {
19//         const $target = jQuery(e.target);
20
21//         try {
22//             if (e.key === "Enter") {
23//                 if ($target.is("nav > ul.menu.menu--main >li.menu-item-has-children > a button")) {
24//                     const isExpanded = $target.attr("aria-expanded") === "true";
25//                     $target.attr("aria-expanded", !isExpanded);
26//                     $target.closest("li").toggleClass("is-focused-active", !isExpanded);
27//                     e.preventDefault();
28//                 } else if ($target.is("ul#main >li.menu-item-has-children > a button") && !$target.find("button").length) {
29//                     window.location.href = $target.attr("href");
30//                 }
31//             } else if (e.key === "Escape") {
32//                 if ($target.is("nav > ul.menu.menu--main >li.menu-item-has-children ul li a")) {
33//                     const $parentDropdown = $target.closest("nav > ul.menu.menu--main >li.menu-item-has-children");
34//                     if ($parentDropdown.length) {
35//                         $parentDropdown.removeClass("is-focused-active");
36//                         jQuery("nav > ul.menu.menu--main >li.menu-item-has-children").removeClass("is-focused-active");
37//                         const $button = $parentDropdown.find("button");
38//                         if ($button.length) {
39//                             $button.focus().attr("aria-expanded", "false");
40//                         }
41//                     }
42//                 }
43//             }
44//         } catch (error) {}
45//     });
46
47//     jQuery("nav > ul.menu.menu--main >li.menu-item-has-children").hover(
48//         function () {
49//             try {
50//                 const $button = jQuery(this).find("> a > button");
51//                 if ($button.length) {
52//                     $button.attr("aria-expanded", "true");
53//                 }
54//             } catch (error) {}
55//         },
56//         function () {
57//             try {
58//                 const $button = jQuery(this).find("> a > button");
59//                 if ($button.length) {
60//                     $button.attr("aria-expanded", "false");
61//                 }
62//             } catch (error) {}
63//         }
64//     );
65//     jQuery(document).on("keyup", function (e) {
66//         const $target = jQuery(e.target);
67//         try {
68//             if (e.key === "Tab") {
69//                 if ($target.is("nav > ul.menu.menu--main >li.menu-item-has-children > a")) {
70//                     $target.addClass("is-focused-active");
71//                     jQuery("nav > ul.menu.menu--main >li.menu-item-has-children").each(function () {
72//                         const $sibling = jQuery(this);
73//                         if (!$target.closest("li").is($sibling)) {
74//                             $sibling.removeClass("is-focused-active");
75//                             const $button = $sibling.find("> a > button");
76//                             if ($button.length) {
77//                                 $button.attr("aria-expanded", "false");
78//                             }
79//                         }
80//                     });
81//                 }
82//             }
83//         } catch (error) {}
84//     });
85
86    function closeAllMenus() {
87        const $allMenus = jQuery("nav > ul.menu.menu--main >li.menu-item-has-children");
88        $allMenus.each(function () {
89            const $menu = jQuery(this);
90            $menu.removeClass("is-focused-active");
91            const $button = $menu.find("> a > button");
92            if ($button.length) {
93                $button.attr("aria-expanded", "false");
94            }
95        });
96    }
97
98    jQuery("nav > ul.menu.menu--main >li.menu-item-has-children > a").on("keydown", function (event) {
99        try {
100            if (event.shiftKey) {
101                closeAllMenus();
102            }
103        } catch (error) {}
104    });
105
106    jQuery("nav > ul.menu.menu--main >li.menu-item-has-children > a button").on("keydown", function (event) {
107        try {
108            if (event.key === "Escape") {
109                closeAllMenus();
110            }
111        } catch (error) {}
112    });
113    jQuery("nav > ul.menu.menu--main > li.menu-item-has-children > a").each(function () {
114        const menuTxt = jQuery(this).find("span").text();
115        jQuery(this)
116            .find("button")
117            .attr("aria-label", menuTxt + " menu");
118    });
119    jQuery(".utility--desktop .menu-utility-container ul#utility a").each(function () {
120        const linkText = jQuery(this).text().trim();
121        let ariaLabel;
122        if (jQuery(this).attr("href").startsWith("tel:")) {
123            ariaLabel = "telephone 1-888-526-8177";
124        } else {
125            ariaLabel = linkText;
126        }
127        jQuery(this).attr("aria-label", ariaLabel);
128    });
129    jQuery(".yoast-breadcrumbs a, .yoast-breadcrumbs span").each(function () {
130        const elementText = jQuery(this).text().trim();
131        jQuery(this).attr("aria-label", elementText);
132    });
133    // jQuery("a.wp-block-button__link.button--no-arrow:contains('Download now')")
134    //     .attr("aria-label", "Download Now The brand owner’s guide to shrink sleeves");
135    jQuery("hr").attr("role", "presentation");
136    jQuery(".sharethis-inline-share-buttons img").each(function () {
137        const altText = jQuery(this).attr("alt");
138        const updatedAltText = altText.replace("sharing button", "").trim();
139        jQuery(this).attr("alt", updatedAltText);
140    });
141    jQuery("button.accordion__trigger").on("click", function () {
142        const $button = jQuery(this);
143        const isExpanded = $button.attr("aria-expanded") === "true";
144		setTimeout(function(){
145        $button.attr("aria-expanded", !isExpanded);
146		},250);
147    });
148    jQuery("button.accordion__trigger").on("keydown", function (event) {
149        if (event.key === "Enter" || event.key === " ") {
150            event.preventDefault();
151            jQuery(this).trigger("click");
152        }
153    });
154    jQuery(".free-guide__download img, img[src*='label-black-1.svg'], ul li .capabilities__image img").attr("alt", "");
155    jQuery('img[src*="RLG_Badge.svg"]').attr("alt", "Resource Label Group National Reach. Local Touch");
156    jQuery('img[src*="BeerAssociation-1.png"]').attr("alt", "Brewers Association - Associate Member");
157    setTimeout(function () {
158        jQuery(".custom-select div.select-selected, .custom-select div.select-items").remove();
159
160        jQuery(".nav .menu--main > .menu-item > .sub-menu >
160 .sub-menu-wrapper > li.menu-item").each(function () {
161            let $li = jQuery(this);
162            let existingClass = $li.attr("class") || "";
163            let $div = jQuery("<div>", {
164                class: existingClass + " sub-menu-head",
165                id: $li.attr("id"),
166                style: $li.attr("style"),
167            }).html($li.html());
168
169            jQuery.each($li[0].attributes, function (index, attr) {
170                if (attr.name !== "class" && attr.name !== "id" && attr.name !== "style") {
171                    $div.attr(attr.name, attr.value);
172                }
173            });
174
175            $li.replaceWith($div);
176        });
177
178        jQuery(".nav .menu--main > .menu-item > ul.sub-menu").each(function () {
179            let $ul = jQuery(this);
180            let newElement = jQuery("<div>", {
181                class: $ul.attr("class") || "", 
182                id: $ul.attr("id") || "",
183            }).html($ul.html());
184
185            jQuery.each($ul[0].attributes, function (index, attr) {
186                if (attr.name !== "class" && attr.name !== "id") {
187                    newElement.attr(attr.name, attr.value);
188                }
189            });
190
191            $ul.replaceWith(newElement);
192        });
193
194        jQuery(".custom-search-section").before('<a name="content-main" id="content-main"></a>');
195        jQuery(".nav .menu--main > .menu-item > .sub-menu > .sub-menu-wrapper > .menu-item.sub-menu-head > a").each(function () {
196            let $a = jQuery(this);
197            let $h2 = jQuery("<h2>").append($a.clone()); 
198            $a.replaceWith($h2); 
199        });
200    }, 2000);
201    jQuery("h2.gform_submission_error").replaceWith(function () {
202        return $("<p>", {
203            class: jQuery(this).attr("class"),
204            html: jQuery(this).html(),
205        });
206    });
207    jQuery(".vertical-slider__v2-image img").attr("alt", "");
208    jQuery("ol.wrapper--wide span").each(function () {
209        var content = jQuery(this).html();
210        jQuery(this).replaceWith(jQuery("<li>").html(content));
211    });
212
213    jQuery("ol.wrapper--wide li").not(":last-child").not(':contains("»")').after(jQuery("<li>").html('<span aria-hidden="true">»</span>'));
214    jQuery("ol.wrapper--wide")
215        .contents()
216        .filter(function () {
217            return this.nodeType === 3 && this.nodeValue.includes("»");
218        })
219        .remove();
220
221    setInterval(function () {
222        let $track = jQuery("#splide01-track");
223        if ($track.length) {
224            $track.removeAttr("aria-atomic").removeAttr("aria-busy");
225        }
226    }, 10);
227});
228
229jQuery(document).ready(function ($) {
230    jQuery(".pts__slider").on("init", function () {
231        jQuery(".slick-track").attr("role", "list");
232        jQuery(".slick-slide").attr("role", "listitem");
233    });
234
235    $(".navigation.pagination .nav-links").each(function () {
236        var $nav = $(this);
237        var $ul = $("<ul>", { class: "nav-links" });
238        $nav.children("a, span").each(function () {
239            var $li = $("<li>").append($(this).clone());
240            $ul.append($li);
241        });
242        $nav.replaceWith($ul);
243    });
244
245    $(".kt-modal-content").each(function () {
246        var iframeTitle = $(this).find("h2").text();
247        $(this).find("iframe").attr("title", iframeTitle);
248    });
249
250    $('.nav-links .page-numbers').each(function() {
251        var pageText = $(this).text().trim();
252        if ($.isNumeric(pageText)) {
253            $(this).attr('aria-label', 'Page ' + pageText);
254        }
255    });
256    setTimeout(function () {
257        jQuery(".post-card.slick-slide.slick-active").removeAttr("tabindex");
258        jQuery(".post-card.slick-slide.slick-active img").attr("alt","");
259        jQuery(".wp-block-post-featured-image img.wp-post-image").attr("alt","");
260    }, 2000);
261});
262
263jQuery(document).ready(function ($) {
264    let currentPageUrl = window.location.href;
265    if (currentPageUrl.includes("markets/custom-beer-labels/")) {
266        var $carousel = $(".splide");
267        var splide;
268        var isPlaying = true;
269
270        function initCarousel() {
271            splide = new Splide(".splide", {
272                type: "fade",
273                rewind: true,
274                autoplay: true,
275                interval: 3000,
276                pauseOnHover: false,
277                pauseOnFocus: false,
278            }).mount();
279
280            var $playPauseBtn = $("<button>", {
281                class: "play-pause-btn",
282                html: getPlayPauseIcon(isPlaying),
283                "aria-label": isPlaying ? "Pause Carousel" : "Play Carousel",
284            });
285
286            var $tooltip = $("<span>", {
287                class: "tooltip-text",
288                text: isPlaying ? "Pause" : "Play",
289            });
290
291            var $buttonWrapper = $("<div>", { class: "play-pause-wrapper" }).append($playPauseBtn).append($tooltip).appendTo($carousel);
292
293            $(".play-pause-wrapper").css({
294                position: "absolute",
295                bottom: "10px",
296                right: "45%",
297                zIndex: 1000,
298                display: "flex",
299                alignItems: "center",
300                flexDirection: "column",
301            });
302
303            $playPauseBtn.css({
304                backgroundColor: "rgba(255, 255, 255, 0.5)",
305                border: "none",
306                padding: "5px 8px",
307                borderRadius: "5px",
308                cursor: "pointer",
309                fontSize: "18px",
310            });
311
312            $(".tooltip-text").css({
313                visibility: "hidden",
314                backgroundColor: "black",
315                color: "#fff",
316                textAlign: "center",
317                padding: "5px",
318                borderRadius: "5px",
319                position: "absolute",
320                bottom: "35px",
321                whiteSpace: "nowrap",
322                fontSize: "12px",
323                opacity: 0,
324                transition: "opacity 0.3s",
325            });
326
327            $playPauseBtn.on("mouseenter", function () {
328                $tooltip.css({ visibility: "visible", opacity: 1 });
329            });
330
331            $playPauseBtn.on("mouseleave", function () {
332                $tooltip.css({ visibility: "hidden", opacity: 0 });
333            });
334
335            $playPauseBtn.on("click", function (event) {
336                event.stopPropagation();
337                isPlaying ? pauseCarousel() : playCarousel();
338            });
339
340            $(document).on("click", function (event) {
341                if (!$(event.target).closest(".play-pause-btn").length) {
342                    playCarousel();
343                }
344            });
345            $(document).on("keydown", function (event) {
346                if (event.keyCode === 9 || event.shiftKey) {
347                    playCarousel();
348                }
349            });
350        }
351
352        function playCarousel() {
353            splide.Components.Autoplay.play();
354            isPlaying = true;
355            updateButton();
356        }
357
358        function pauseCarousel() {
359            splide.Components.Autoplay.pause();
360            isPlaying = false;
361            updateButton();
362        }
363
364        function updateButton() {
365            $(".play-pause-btn")
366                .html(getPlayPauseIcon(isPlaying))
367                .attr("aria-label", isPlaying ? "Pause Carousel" : "Play Carousel");
368            $(".tooltip-text").text(isPlaying ? "Pause" : "Play");
369        }
370
371        function getPlayPauseIcon(isPlaying) {
372            return isPlaying
373                ? `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
374            <rect x="6" y="4" width="4" height="16" fill="black"/>
375            <rect x="14" y="4" width="4" height="16" fill="black"/>
376         </svg>`
377                : `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
378            <polygon points="5,3 19,12 5,21" fill="black"/>
379         </svg>`;
380        }
381
382        initCarousel();
383    }
384});
385jQuery(document).ready(function ($) {
386    let currentPagePath = window.location.pathname;
387    let splideInstances = {}; 
388    if (currentPagePath === "/" || currentPagePath === "/index.html") {
389        jQuery(".splide").each(function (index) {
390            let sliderId = "splide-slider-" + (index + 1);
391            jQuery(this).attr("id", sliderId);
392            initCarousel(sliderId);
393        });
394    }
395    function initCarousel(sliderId) {
396        let $carousel = $("#" + sliderId);
397        let splide = new Splide("#" + sliderId, {
398            type: "fade",
399            rewind: true,
400            autoplay: true,
401            interval: 3000,
402            pauseOnHover: false,
403            pauseOnFocus: false,
404        }).mount();
405        splideInstances[sliderId] = splide; 
406        let buttonId = "play-pause-btn-" + sliderId;
407        let $playPauseBtn = $("<button>", {
408            id: buttonId,
409            html: getPlayPauseIcon(true),
410            "aria-label": "Pause Carousel",
411            "data-slider-id": sliderId,
412        });
413
414        // let $tooltip = $("<span>", {
415        //     class: "tooltip-text",
416        //     text: "Pause",
417        // });
418
419        $("<div>", { class: "play-pause-wrapper" })
420            .append($playPauseBtn)
421            // .append($tooltip)
422            .appendTo($carousel);
423         $(".play-pause-wrapper").css({
424                position: "absolute",
425                bottom: "10%",
426                left: "50%",
427                zIndex: 1000,
428                transform: "translateX(-50%)",
429         });
430        $playPauseBtn.css({
431            backgroundColor: "rgba(255, 255, 255, 0.5)",
432            border: "none",
433            padding: "5px 8px",
434            borderRadius: "5px",
435            cursor: "pointer",
436            fontSize: "18px",
437        });
438
439        //     $(".tooltip-text").css({
440        //         visibility: "hidden",
441        //         backgroundColor: "black",
442        //         color: "#fff",
443        //         textAlign: "center",
444        //         padding: "5px",
445        //         borderRadius: "5px",
446        //         position: "absolute",
447        //         bottom: "35px",
448        //         whiteSpace: "nowrap",
449        //         fontSize: "12px",
450        //         opacity: 0,
451        //         transition: "opacity 0.3s",
452        //     });
453
454        // $playPauseBtn.on("mouseenter", function () {
455        //     $tooltip.css({ visibility: "visible", opacity: 1 });
456        // });
457
458        // $playPauseBtn.on("mouseleave", function () {
459        //     $tooltip.css({ visibility: "hidden", opacity: 0 });
460        // });
461
462        // Play/Pause Button Click Event
463        $playPauseBtn.on("click", function (event) {
464            event.stopPropagation();
465            let sliderId = $(this).data("slider-id");
466            if (!sliderId || !splideInstances[sliderId]) return;
467            let splide = splideInstances[sliderId];
468            let isPlaying = $(this).attr("aria-label") === "Pause Carousel";
469            $("button[id^='play-pause-btn-']").each(function () {
470                let otherSliderId = $(this).data("slider-id");
471                if (otherSliderId !== sliderId && splideInstances[otherSliderId]) {
472                    splideInstances[otherSliderId].Components.Autoplay.pause();
473                    $(this).attr("aria-label", "Pause Carousel").html(getPlayPauseIcon(true));
474
475                }
476            });
477            if (isPlaying) {
478                splide.Components.Autoplay.pause();
479                $(this).attr("aria-label", "Play Carousel").html(getPlayPauseIcon(false));
480                // $tooltip.text("Play");
481            } else {
482                splide.Components.Autoplay.play();
483                $(this).attr("aria-label", "Pause Carousel").html(getPlayPauseIcon(true));
484                // $tooltip.text("Pause");
485            }
486        });
487        $(document).on("click keydown", function (event) {
488            if (!$(event.target).closest("button[id^='play-pause-btn-]").length || event.keyCode === 9) {
489                $("button[id^='play-pause-btn-'][aria-label='Play Carousel']").trigger("click");
490            } 
491        });
492    }
493    function getPlayPauseIcon(isPlaying) {
494        return isPlaying
495            ? `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
496                <rect x="6" y="4" width="4" height="16" fill="black"/>
497                <rect x="14" y="4" width="4" height="16" fill="black"/>
498               </svg>`
499            : `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
500                <polygon points="5,3 19,12 5,21" fill="black"/>
501               </svg>`;
502    }
503	
504});
505
506jQuery(document).ready(function ($) {
507    let currentPageUrl = window.location.href;
508    if (currentPageUrl.includes("labeling-equipment/automatic-label-applicator-machines/")) {
509		jQuery('section.accordion .flex-between .accordion__title:has(h3) .accordion__panel').each(function(){
510			let $button = jQuery(this);
511			$button.closest('.accordion__item').append($button.clone());
512			$button.remove();
513		});
514	}
515});
516
517//ADA Code Start
518jQuery(document).ready(function ($) {
519	// duplicate adjacent card links
520	jQuery('.post-card .post-card__container > a.post-card__container-link').each(function(){
521    let $a = jQuery(this);
522    let newElement = jQuery("<div>", {
523                class: $a.attr("class") || "", 
524                id: $a.attr("id") || "",
525            }).html($a.html());
526    $a.prev('a.post-card__parentlink').append(newElement);
527    $a.remove();
528	});
529	
530	
531	$('#main-content .yoast-breadcrumbs').attr({'aria-label':'breadcrumb', 'role':'navigation'});
532	$('footer nav.footer__menu').attr('aria-label', 'Footer Menu');
533	$('#menu-footer-bottom').closest('nav').attr('aria-label', 'Legal Links');
534	
535	$('#main-content').closest('main.main').attr('role', 'presentation');
536	
537	$('a[href="https://resourcelabstg.wpenginepowered.com/products-overview/"]').attr('aria-label', 'Learn more about Products');
538	
539	$('h2').filter(':contains(Contact)').attr('role', 'presentation');
540	$('h2 div').filter(':contains(Contact)').attr({'role':'heading', 'aria-level':'1'});
541	$('h2 div').filter(':contains(Work with a label partner)').attr({'role':'heading', 'aria-level':'2'});
542	
543	$('#resource_list_container .post-card__parentlink h3.post-card__container-title').attr('role', 'presentation');
544	$('input#resources_search').attr('aria-label','Search Resources');
545	$('.beer-label-col h6.kt-blocks-info-box-title').attr({'role':'presentation'});
546	
547	$('.sharethis-inline-share-buttons .st-btn').each(function(){
548		if($(this).attr('data-network') === 'sharethis' || $(this).attr('data-network') === 'email'){
549			$(this).attr({'role':'button', 'tabindex':'0'});
550		}
551		else{
552			$(this).attr({'role':'link', 'tabindex':'0'});
553		}
554	});
555	$('img[src="https://platform-cdn.sharethis.com/img/facebook.svg"]').attr('alt', 'Facebook');
556	$('img[src="https://platform-cdn.sharethis.com/img/twitter.svg"]').attr('alt', 'Twitter');
557	$('img[src="https://platform-cdn.sharethis.com/img/email.svg"]').attr('alt', 'Email');
558	$('img[src="https://platform-cdn.sharethis.com/img/linkedin.svg"]').attr('alt', 'LinkedIn');
559	$('img[src="https://platform-cdn.sharethis.com/img/sharethis.svg"]').attr('alt', 'Share This');
560	
561	$('strong').filter(':contains(Tags)').closest('p').attr({'role':'heading', 'aria-level':'2'});
562	$('strong').filter(':contains(Share via:)').attr({'role':'heading', 'aria-level':'2'});
563	
564	$('.search-results__pagination .nav-links .next').append(' Page');
565	$('.search-results__pagination .nav-links .prev').attr('aria-label', 'previous page');
566	
567	// upload modal
568	$('.kt-modal-container').removeAttr('role aria-modal').closest('.kt-modal-overlay').attr({'role':'dialog','aria-modal'
568:'true'});
569	// Duplicate adjacent card image links
570	setTimeout(function(){
571	$('.post-card > a.post-card__parentlink').attr({'aria-hidden':'true','tabindex':'-1','role':'presentation'});
572	$('.kt-inside-inner-col').filter(':contains(Popular Labels & Services)').find('.pts .pts__slide a').has('img').attr({'role':'presentation', 'tabindex':'-1', 'aria-hidden':'true'});
573	},1000);
574
575
576});
577
578
579
580
581// duplicate adjacent image link in slider
582jQuery(document).ready(function ($) {
583	jQuery(document).on("click", function (e) {
584		const $target = jQuery(e.target);
585		if ($target.is(".kt-inside-inner-col:contains(Popular Labels & Services) .pts .slick-arrow")) {
586			setTimeout(function(){
587				$target.closest('.pts').find('.pts__slide a').has('img').attr({'role':'presentation', 'tabindex':'-1', 'aria-hidden':'true'});
588			},1000);
589		}
590	});
591});

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.