PageSourceSearch

https://michaelmedved.com/wp-content/themes/the-michael-medved-show/js/myScripts.js?ver=241

js michaelmedved.com collected 2026-10-02 08:02:00 UTC 8,105 bytes, 182 lines download raw bytes

1jQuery(document).ready(function($)
2{
3    // centering function for takeovers/popups ===============================================================
4    $.fn.center = function () {
5        this.css("position","absolute");
6        if (this.height() >= $(window).height()){
7            this.css("top", $(document).scrollTop());
8        } else {
9            this.css("top", (( $(window).height() - this.height() ) / 2 ) + $(document).scrollTop() + "px");
10        }
11        this.css("left", ( $(window).width() - this.width() ) / 2 + "px");
12        return this;
13    };
14    
15    // User Popup ===============================================================================
16    function all_popup(){
17        var appendthis =  ("<div class='popup_overlay js_popup_close'></div>");
18        $('a[data-popup-id]').click(function(e) {
19            e.preventDefault();
20            $("body").append(appendthis);
21            $(".popup_overlay").fadeIn('fast');
22            var modalBox = $(this).attr('data-popup-id');
23            $('#'+modalBox).center().fadeIn($(this).data());
24            $(".js_popup_close").click(function(f) {
25                f.preventDefault();
26                $(".popup_overlay, .popup_wrap").fadeOut(500, function() {
27                    $(".popup_overlay").remove();
28                });
29            });
30        });
31        $(window).resize(function() {
32          $(".popup_wrap").center();
33        });
34    }
35    
36    // Ad Takeover ===============================================================================
37    function ad_takeover(){
38        setTimeout(function(){
39            if(Cookies.get('ad-MEDVED') == null){
40                var appendthis =  ('<div class="popup_overlay js_popup_close"></div>');
41                $('body').append(appendthis);
42                $('.ad_takeover').center();
43                $('.popup_overlay, .ad_takeover').fadeIn('fast', function(){
44                    Cookies.set('ad-MEDVED', 'seen', { expires: 1, path: '/' });
45                });
46                $('.js_popup_close').click(function(f) {
47                    f.preventDefault();
48                    $('.popup_overlay, .ad_takeover').fadeOut(500, function() {
49                        $('.popup_overlay').remove();
50                        $('.ad_takeover').remove();
51                    });
52                });
53                $(window).resize(function() {
54                    $('.ad_takeover').center();
55                });
56            }
57        }, 5000);
58    }
59    
60    /* Listen Now Offer Takeover / Player Popup =================================================
61    function listen_now_takeover(){
62        var appendthis =  ("<div class='popup_overlay js_popup_close'></div>");
63        $('.open_player').click(function(d){
64            d.preventDefault();
65            if(Cookies.get('Medhead-ListenNow-Offer') == null){
66                $('body').append(appendthis);
67                $('.listen_now_takeover').center();
68                $('.popup_overlay, .listen_now_takeover').fadeIn('fast', function(){
69                    Cookies.set('Medhead-ListenNow-Offer', 'seen', { expires: 7, path: '/' });
70                    ga('send', 'event', 'Takeovers', 'Displayed', 'Medhead 99 Cent Listen Now Takeover');
71                });
72                $('.js_popup_close').click(function(f) {
73                    f.preventDefault();
74                    $('.popup_overlay, .listen_now_takeover').fadeOut(500, function() {
75                        $('.popup_overlay').remove();
76                    });
77                    window.open('http://player.listenlive.co/57181');
78                });
79                $('.listen_with_commercials').click(function(f) {
80                    f.preventDefault();
81                    ga('send', 'event', 'Takeovers', 'Click', 'Listen with commercials');
82                    $('.popup_overlay, .listen_now_takeover').fadeOut(500, function() {
83                        $('.popup_overlay').remove();
84                    });
85                    window.open('http://player.listenlive.co/57181');
86                });
87                $(window).resize(function() {
88                    $('.listen_now_takeover').center();
89                });
90            } else {
91                 window.open('http://player.listenlive.co/57181'); 
92            }
93        });
94    }*/
95	$('.open_player').click(function(d){
96       d.preventDefault();
97       window.open('http://player.listenlive.co/57181'); 
98    });
99    
100    /* Special Announcement =============================================================*/
101    function announcement(){
102        if(Cookies.get('announcement-MEDVED') == null){
103            $('.announcement_wrap').slideDown('fast', function(){
104                Cookies.set('announcement-MEDVED', 'seen', { expires: 1, path: '/' });
105                $('.announcement_close').click(function(a) {
106                    a.preventDefault();
107                    $('.announcement_wrap').slideUp('fast');
108                });
109            });
110        }
111    }
112    
113    // Switch to small star rating =========================================================
114    function smallStar(){
115        if ($( window ).width() < 736){
116            $('#star_rating').addClass('star_rating_small');
117            $('#star_rating').removeClass('star_rating_large');
118        } else if ($( window ).width() > 737){
119            $('#star_rating').removeClass('star_rating_small');
120            $('#star_rating').addClass('star_rating_large');
121        }
122    }
123    smallStar();
124    $(window).resize(function() { smallStar(); });
125    
126    /* Mobile Nav Btns =============================================================*/
127    // menu
128    $('.open_mobile_menu').click(function(e){
129        e.preventDefault();
130        $('.mobile_drop_nav').not(':animated').slideToggle();
131    });
132    // search
133    $('.open_mobile_search').click(function(y){
134        y.preventDefault();
135        $('.mobile_search_wrap').not(':animated').slideToggle(); 
136     });
137    
138    /* Header Ad Dropdown (video) =======================================================================*/
139    $('#trailer').click(function(g){
140        g.preventDefault();
141        $('.special_header_ad_video_wrap').not(':animated').slideToggle();
142        $(this).html($(this).html() == 'Close the Trailer' ? 'View the Trailer' : 'Close the Trailer');
143        return false;
144    });
145    
146    /* Contact Form Box Wrappers (Hides and displays form) ==================================================*/
147    $('.form_content_wrap h4 a').each(function(){
148      var $content = $(this).closest('.form_content_wrap').find('.contact_form_container');
149      $(this).click(function(e){
150        e.preventDefault();
151        $content.not(':animated').slideToggle();
152      });
153    });
154    
155    /* jquery script for Pagination dropdown autosubmit =========================================================*/
156    $('#paginationpageselectcontrol').change(function(){
157        window.location = $('#paginationpageselectcontrol').val();
158    });
159    
160    /* Player and Social Button pop up ============================================================*/
161    $('.fb_social_link').click(function(){
162        var url = $(this).attr("data-url");
163        window.open("https://www.facebook.com/sharer/sharer.php?u="+url, "", "toolbar=0, status=0, width=650, height=360");
164        return false;
165     });
166    $('.tw_social_link').click(function(){
167        var text = $(this).attr("data-title");
168        var url = $(this).attr("data-url");
169        window.open("https://twitter.com/intent/tweet?text="+text+"&url="+url, "", "toolbar=0, status=0, width=650, height=360");
170        return false;
171     });
172    
173    /* Takeovers and Popups =========================================================*/
174    all_popup();
175    //listen_now_takeover();
176    if ( $( '#ad_takeover' ).length ) { ad_takeover(); }
177    if ( $( '#announcement_wrap' ).length ) { announcement(); }
178    
179    /* Home Page Rotator =============================================================*/
180    $('.home_rotator_container').slick({ autoplay: true, autoplaySpeed: 5000, arrows: false, dots: true, infinite: true, pauseOnHover: true }).fadeIn();
181    
182});

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.