PageSourceSearch

https://corporateunplugged.com/wp-content/themes/corporateunplugged/js/corpsite.js

js corporateunplugged.com collected 2026-10-02 05:50:02 UTC 21,400 bytes, 603 lines download raw bytes

1jQuery(window).load(function () {
2    jQuery(".pageloader").fadeOut(); //css( "display","none");
3
4    loadStart();
5    redesignVimeo();
6    function loadStart() {
7        jQuery(".main-title").addClass("animated fadeIn");
8    }
9
10    if (jQuery(".podcast-links-container").length > 0) {
11        jQuery(".podcast-links-container").removeClass("hide");
12        fixStickyPodcast("start");
13    }
14});
15
16jQuery(document).ready(function () {
17    var speed = 5000;
18    var container = jQuery("#slides ul");
19    var item_width = container.width();
20    var elm = container.find(":first-child").prop("tagName");
21    var run = setInterval(rotate, speed);
22
23    podcastLinks();
24    loadAnimations();
25    initializeSlide();
26
27    function initializeSlide() {
28        run = setInterval(rotate, speed);
29        var slides = jQuery(".slide");
30        container = jQuery("#slides ul");
31        elm = container.find(":first-child").prop("tagName");
32        item_width = container.width();
33        slides.width(item_width); //set the slides to the correct pixel width
34        container.parent().width(item_width);
35        container.width(slides.length * item_width); //set the slides container to the correct total width
36        container.find(elm + ":first").before(container.find(elm + ":last"));
37        resetSlides();
38    }
39
40    container
41        .parent()
42        .mouseenter(function () {
43            clearInterval(run);
44        })
45        .mouseleave(function () {
46            run = setInterval(rotate, speed);
47        });
48
49    function resetSlides() {
50        //and adjust the container so current is in the frame
51        container.css({
52            left: -1 * item_width,
53        });
54    }
55
56    function rotate() {
57        if (container.is(":animated")) {
58            return false;
59        }
60
61        container.stop().animate(
62            {
63                left: item_width * -2,
64            },
65            1500,
66            function () {
67                container
68                    .find(elm + ":last")
69                    .after(container.find(elm + ":first"));
70                resetSlides();
71            }
72        );
73    }
74
75    if (localStorage.getItem("setCloseBanner") === "set") {
76        jQuery(".footer-ribbon").hide();
77    } else {
78        jQuery(".footer-ribbon").fadeIn(250);
79    }
80
81    jQuery(".ribbon-close-btn").on("click", function () {
82        jQuery(".footer-ribbon").fadeOut(250);
83        localStorage.setItem("setCloseBanner", "set");
84    });
85
86    if (jQuery(".home-container").length > 0) {
87        var scrollRelative =
88            jQuery(".main-container").attr("rel-scroll-section");
89        var menuH = jQuery(".menu-container").height();
90        if (scrollRelative != "") {
91            var scrollTopValue = jQuery("#" + scrollRelative).offset().top;
92
93            jQuery("html, body").animate(
94                {
95                    scrollTop: scrollTopValue - menuH,
96                },
97                500
98            );
99        }
100    }
101
102    jQuery(".hamburger").on("click", function () {
103        var windowScroll = jQuery(window).scrollTop();
104        if (jQuery(this).hasClass("is-active")) {
105            jQuery(this).removeClass("is-active");
106            jQuery(".menu-container").removeClass("is-active");
107            if (windowScroll == 0) {
108                jQuery(".menu-container").removeClass("fixed");
109            }
110        } else {
111            jQuery(this).addClass("is-active");
112            jQuery(".menu-container").addClass("is-active");
113
114            // if (windowScroll > 0) {
115            jQuery(".menu-container").addClass("fixed");
116            // }
117        }
118    });
119
120    jQuery(".menu-link").on("click", function (e) {
121        e.preventDefault();
122
123        var menuH = jQuery(".menu-container").height();
124        if (jQuery(".home-container").length > 0) {
125            if (jQuery(".hamburger").hasClass("is-active")) {
126                jQuery(".hamburger").removeClass("is-active");
127                jQuery(".menu-container").removeClass("is-active");
128            }
129
130            var section = jQuery(this).attr("rel-section");
131            var scrollTopValue = jQuery("#" + section).offset().top;
132            jQuery("html, body").animate(
133                {
134                    scrollTop: scrollTopValue - menuH,
135                },
136                500,
137                function () {}
138            );
139        } else {
140            var link = jQuery(this).attr("href");
141            var section = jQuery(this).attr("rel-section");
142            window.location.href = link + "/?section=" + section;
143        }
144    });
145
146    jQuery(".podcast-btn:not(.extra-btn)").on("click", function (e) {
147        e.preventDefault();
148        let btnVal = jQuery(this).html();
149        var menuH = jQuery(".menu-container").height();
150        var wW = jQuery(window).width();
151        var section = jQuery(this).attr("rel-section");
152
153        if (section == "listen" && wW >= 1100) {
154            if (jQuery(".podcast-links-container").hasClass("hide")) {
155                jQuery(".podcast-links-container").removeClass("hide");
156                jQuery(".podcast-arrow i").attr("class", "fas fa-chevron-down");
157                if (!jQuery(".footer-ribbon").hasClass("moved")) {
158                    var ribbonBottom = parseFloat(
159                        jQuery(".footer-ribbon").css("bottom")
160                    );
161                    var podcastStickyH = jQuery(
162                        ".podcast-links-container"
163                    ).outerHeight();
164                    jQuery(".footer-ribbon").css(
165                        "bottom",
166                        ribbonBottom + podcastStickyH + "px"
167                    );
168                    jQuery(".footer-ribbon").addClass("moved");
169                }
170            } else {
171                jQuery(".podcast-links-container")
172                    .addClass("highlight")
173                    .delay(1000)
174                    .queue(function (n) {
175                        jQuery(".podcast-links-container").removeClass(
176                            "highlight"
177                        );
178                        n();
179                    });
180            }
181        } else {
182            var scrollTopValue = jQuery("#" + section).offset().top;
183            jQuery("html, body").animate(
184                {
185                    scrollTop: scrollTopValue - menuH,
186                },
187                500,
188                function () {}
189            );
190        }
191
192        gtag("event", btnVal, {
193            event_category: "Podcast page (product page)",
194            // 'event_label': info
195        });
196    });
197
198    jQuery(".podcast-wrapper").on("click", function (e) {
199        let title = jQuery(this).find(".podcast-info-wrap h3").html();
200        let person = jQuery(this)
201            .find(".podcast-info-wrap .podcast-person")
202            .html();
203
204        let eventLabel = title + " by " + person;
205        let eventAction = jQuery(".episode-wrapper h2").html(); // All Episodes
206
207        if (jQuery(this).closest(".featured-content").length > 0) {
208            eventAction = jQuery(".featured-wrapper h2").html(); // Featured Episodes
209        }
210
211        gtag("event", eventAction, {
212            event_category: "Episodes",
213            event_label: eventLabel,
214        });
215    });
216
217    jQuery(".footer-listen a").on("click", function (e) {
218        let eventAction = jQuery(this).html();
219        gtag("event", eventAction, {
220            event_category: "Subscribe",
221        });
222    });
223
224    jQuery(".footer-connect a").on("click", function (e) {
225        let eventAction = jQuery(this).html();
226        gtag("event", eventAction, {
227            event_category: "Social",
228        });
229    });
230
231    jQuery(
232        ".podcast-summary a, .social-share-icons a, .podcast-subs-links a"
233    ).on("click", function (e) {
234        let link = jQuery(this).attr("href");
235
236        gtag("event", "Outbound links", {
237            event_category: "Podcast page (product page)",
238            event_label: link,
239        });
240    });
241
242    jQuery("#backtotop").on("click", function (e) {
243        e.preventDefault();
244        jQuery("html, body").animate(
245            {
246                scrollTop: 0,
247            },
248            500,
249            function () {}
250        );
251    });
252
253    jQuery(".podcast-arrow").on("click", function (e) {
254        if (jQuery(".podcast-links-container").hasClass("hide")) {
255            jQuery(".podcast-links-container").removeClass("hide");
256            jQuery(".podcast-arrow i").attr("class", "fas fa-chevron-down");
257            if (!jQuery(".footer-ribbon").hasClass("moved")) {
258                var ribbonBottom = parseFloat(
259                    jQuery(".footer-ribbon").css("bottom")
260                );
261                var podcastStickyH = jQuery(
262                    ".podcast-links-container"
263                ).outerHeight();
264                jQuery(".footer-ribbon").css(
265                    "bottom",
266                    ribbonBottom + podcastStickyH + "px"
267                );
268                jQuery(".footer-ribbon").addClass("moved");
269            }
270        } else {
271            jQuery(".podcast-links-container").addClass("hide");
272            jQuery(".podcast-arrow i").attr("class", "fas fa-chevron-up");
273            if (jQuery(".footer-ribbon").hasClass("moved")) {
274                jQuery(".footer-ribbon").css("bottom", "");
275                jQuery(".footer-ribbon").removeClass("moved");
276            }
277        }
278    });
279
280    function podcastLinks() {
281        if (jQuery(".podcast-summary").length > 0) {
282            var podcastList = jQuery(".podcast-summary ul li");
283            podcastList.each(function (i) {
284                var podcastListHtml = jQuery(this).html();
285                podcastListHtml =
286                    "<i class='fas fa-check'></i>  " + podcastListHtml;
287                jQuery(this).html(podcastListHtml);
288            });
289        }
290
291        // if(jQuery(".podcast-subs-links").length > 0 ) {
292
293        // 	var podcastLink = jQuery(".podcast-subs-links a");
294        // 	podcastLink.each(function(i) {
295        // 		var str = jQuery(this).attr("href");
296        // 		if (str.toLowerCase().indexOf("itunes") >= 0) {
297        // 			jQuery(this).addClass("podcast-itunes");
298        // 			jQuery(this).text("iTunes");
299        // 		} else if (str.toLowerCase().indexOf("stitcher") >= 0) {
300        // 			jQuery(this).addClass("podcast-stitcher");
301        // 			jQuery(this).text("Stitcher");
302        // 		} else if (str.toLowerCase().indexOf("www.acast") >= 0) {
303        // 			jQuery(this).addClass("podcast-acast");
304        // 			jQuery(this).text("Acast");
305        // 		} else if (str.toLowerCase().indexOf("spotify") >= 0) {
306        // 			jQuery(this).addClass("podcast-spotify");
307        // 			jQuery(this).text("Spotify");
308        // 		}  else if (str.toLowerCase().indexOf("rss.acast") >= 0) {
309        // 			jQuery(this).addClass("podcast-rss");
310        // 			jQuery(this).text("RSS");
311        // 		}
312        // 	});
313        // }
314    }
315
316    var lastScrollTop = 0;
317    var lastDownscrollTop = 0;
318    var docOffset = jQuery(document).height() - 120;
319
320    var wH = jQuery(window).height();
321
322    jQuery(window).on("scroll", function () {
323        var wW = jQuery(window).width();
324        var menu;
325        menu = jQuery(".menu-container");
326
327        if (wW > 900) {
328            menu = jQuery(".menu-container");
329        } else {
330            // menu = jQuery(".mobile-header");
331            // if (jQuery(".hamburger").hasClass("is-active")) {
332            // 	menu = jQuery("");
333            // }
334        }
335
336        var st = jQuery(this).scrollTop();
337        var windowScroll = jQuery(window).scrollTop();
338
339        if (windowScroll > 90) {
340            jQuery("#backtotop").addClass("fixed");
341        } else {
342            jQuery("#backtotop").removeClass("fixed");
343        }
344
345        if (!jQuery(".menu-container").hasClass("is-active")) {
346            if (st == 90) {
347                menu.css("max-height", 0);
348            }
349
350            if (st == 0) {
351                menu.css("max-height", "");
352                menu.removeClass("fixed");
353                if (wW <= 900) {
354                    // menu.css("padding", "");
355                }
356            }
357
358            if (st > lastScrollTop) {
359                // && !jQuery(".menu-dropdown-wrapper").hasClass("show-this-onsnap")){
360                // downscroll code
361                if (menu.hasClass("fixed")) {
362                    menu.css("max-height", "0");
363                    menu.removeClass("fixed");
364
365                    if (wW <= 900) {
366                        // menu.css("padding", "0 20px");
367                    }
368                }
369
370                lastDownscrollTop = st;
371            } else {
372                if (st < lastDownscrollTop - 10) {
373                    //200
374                    if (!menu.hasClass("fixed")) {
375                        menu.css("max-height", "");
376                        menu.addClass("fixed");
377
378                        if (wW <= 900) {
379                            // menu.css("padding", "");
380                        }
381                    }
382                }
383            }
384            lastScrollTop = st;
385
386            if (st == 0) {
387                menu.removeClass("fixed");
388            }
389        }
390
391        loadAnimations();
392        if (wW >= 1100) {
393            if (jQuery(".podcast-links-container").length > 0) {
394                if (!jQuery(".podcast-links-container").hasClass("hide")) {
395                    jQuery(".podcast-links-container").addClass("hide");
396                    jQuery(".podcast-arrow i").attr(
397                        "class",
398                        "fas fa-chevron-up"
399                    );
400                    if (jQuery(".footer-ribbon").hasClass("moved")) {
401                        jQuery(".footer-ribbon").css("bottom", "");
402                        jQuery(".footer-ribbon").removeClass("moved");
403                    }
404                }
405            }
406        }
407    });
408
409    function loadAnimations() {
410        var contentContainer = jQuery(".content-container");
411        var batchEpisode = jQuery(".batch-episode");
412        var wW = jQuery(window).width();
413        if (wW > 767) {
414            // fixStickyPodcast();
415            // if (wW > 900 && jQuery(".podcast-links-container").length > 0) {
416            // 	if(jQuery(window).scrollTop() + jQuery(window).height() >= docOffset) {
417            // 	// if(jQuery(window).scrollTop() + jQuery(window).height() > jQuery(document).height() - 100) {
418            // 		if (!jQuery(".podcast-links-container").hasClass("topFooter")) {
419            // 			jQuery(".podcast-links-container").addClass("topFooter");
420            // 			if (jQuery(".footer-ribbon").hasClass("moved")) {
421            // 				jQuery(".footer-ribbon").css("bottom", "");
422            // 				jQuery(".footer-ribbon").removeClass("moved");
423            // 			}
424            // 		}
425            // 	} else {
426            // 		if (jQuery(".podcast-links-container").hasClass("topFooter")) {
427            // 			jQuery(".podcast-links-container").removeClass("topFooter");
428            // 			if (!jQuery(".footer-ribbon").hasClass("moved")) {
429            // 				var ribbonBottom = parseFloat(jQuery(".footer-ribbon").css("bottom"));
430            // 				var podcastStickyH = jQuery(".podcast-links-container").outerHeight();
431            // 				jQuery(".footer-ribbon").css("bottom", ribbonBottom + podcastStickyH +"px");
432            // 				jQuery(".footer-ribbon").addClass("moved");
433            // 			}
434            // 		}
435            // 	}
436
437            // }
438
439            contentContainer.each(function (i) {
440                var a =
441                    jQuery(this).offset().top + jQuery(this).outerHeight() / 2;
442                var b = jQuery(window).scrollTop() + wH;
443                if (b > a) {
444                    if (jQuery(this).has(".about-content")) {
445                        jQuery(".about-content").addClass("show");
446                        jQuery(".about-txt").addClass("animated fadeIn");
447                        jQuery(".about-image").addClass("animated fadeIn");
448                    }
449
450                    if (jQuery(this).hasClass("featured-wrapper")) {
451                        jQuery(".featured-content").addClass("show");
452
453                        jQuery(".podcast-wrapper:eq(0)").addClass(
454                            "animated fadeInUp delay-0"
455                        );
456                        jQuery(".podcast-wrapper:eq(1)").addClass(
457                            "animated fadeInUp delay-1"
458                        );
459                        jQuery(".podcast-wrapper:eq(2)").addClass(
460                            "animated fadeInUp delay-2"
461                        );
462                    }
463                }
464            });
465
466            batchEpisode.each(function (i) {
467                var a =
468                    jQuery(this).offset().top + jQuery(this).outerHeight() / 2;
469                var b = jQuery(window).scrollTop() + wH;
470                if (b > a) {
471                    jQuery(this).addClass("show");
472                }
473            });
474        } else {
475            jQuery(".about-content").addClass("show");
476            jQuery(".featured-content").addClass("show");
477            jQuery(".batch-episode").addClass("show");
478        }
479    }
480
481    jQuery(window).resize(function () {
482        var wW = jQuery(window).width();
483        redesignVimeo();
484        fixStickyPodcast("");
485        if (jQuery(".home-container").length > 0) {
486            containerTest = jQuery(".testimonial-wrapper .content-wrapper");
487            item_width = containerTest.width();
488            jQuery(".slide").width(item_width); //set the slides to the correct pixel width
489            container.parent().width(item_width);
490            container.width(jQuery(".slide").length * item_width);
491            container
492                .find(elm + ":first")
493                .before(container.find(elm + ":last"));
494            resetSlides();
495        }
496    });
497});
498
499function fixStickyPodcast(status) {
500    var wW = jQuery(window).width();
501
502    if (jQuery(".podcast-links-container").length > 0) {
503        if (wW >= 1100) {
504            if (!jQuery(".podcast-links-container").hasClass("hide")) {
505                jQuery(".footer-ribbon").css("bottom", "215px");
506                jQuery(".footer-ribbon").addClass("moved");
507            }
508
509            if (status == "start") {
510                var ribbonBottom = parseFloat(
511                    jQuery(".footer-ribbon").css("bottom")
512                );
513                var podcastStickyH = jQuery(
514                    ".podcast-links-container"
515                ).outerHeight();
516                jQuery(".footer-ribbon").css(
517                    "bottom",
518                    ribbonBottom + podcastStickyH + "px"
519                );
520                jQuery(".footer-ribbon").addClass("moved");
521                jQuery(this)
522                    .addClass("delay")
523                    .delay(1800)
524                    .queue(function (n) {
525                        jQuery(".podcast-arrow i").attr(
526                            "class",
527                            "fas fa-chevron-up"
528                        );
529                        jQuery(".podcast-links-container").addClass("hide");
530                        if (jQuery(".footer-ribbon").hasClass("moved")) {
531                            jQuery(".footer-ribbon").css("bottom", "");
532                            jQuery(".footer-ribbon").removeClass("moved");
533                        }
534                        n();
535                    });
536            }
537        } else {
538            if (jQuery(".footer-ribbon").hasClass("moved")) {
539                jQuery(".footer-ribbon").css("bottom", "");
540                jQuery(".footer-ribbon").removeClass("moved");
541            }
542            jQuery(".podcast-links-container").removeClass("hide");
543            jQuery(".podcast-links-container").addClass("mobile-sticky");
544        }
545    }
546}
547
548function redesignVimeo() {
549    var $iframe = jQuery("#videoplayer");
550    var $poster = jQuery(".poster-img");
551    var ratio = 0.562;
552    var posterRel = $poster.attr("rel");
553
554    var width = jQuery(".video-wrapper").width();
555    var calcHeight = jQuery(".video-wrapper").width() * ratio;
556    var calcWidth = jQuery(".video-wrapper").height() / ratio + 1;
557    if (jQuery(".video-wrapper").width() > calcWidth) {
558        var windWidth = jQuery(window).width() + 1;
559        $poster.attr(
560            "style",
561            posterRel + "width:" + windWidth + "px;height:" + calcHeight + "px;"
562        );
563        $iframe.attr(
564            "style",
565            "width:" + windWidth + "px;height:" + calcHeight + "px;"
566        );
567    } else {
568        $poster.attr(
569            "style",
570            posterRel +
571                "width:" +
572                calcWidth +
573                "px;height:" +
574                jQuery(window).height() +
575                "px;"
576        );
577        $iframe.attr(
578            "style",
579            "width:" +
580                calcWidth +
581                "px;height:" +
582                jQuery(window).height() +
583                "px;"
584        );
585    }
586}
587
588var acc = document.querySelectorAll(".accordion-wrapper h3");
589
590if (acc) {
591    acc.forEach((element) => {
592        element.addEventListener("click", function () {
593            this.classList.toggle("active");
594
595            var panel = this.nextElementSibling;
596            if (panel.style.maxHeight) {
597                panel.style.maxHeight = null;
598            } else {
599                panel.style.maxHeight = panel.scrollHeight + "px";
600            }
601        });
602    });
603}

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.