PageSourceSearch

https://couponsinthenews.com/wp-content/themes/alpha/js/functions.js?ver=2.1.9

js couponsinthenews.com collected 2026-10-03 20:16:05 UTC 5,028 bytes, 209 lines download raw bytes

1/**
2 * Theme functions file
3 */
4
5jQuery(function( $ ) {
6
7    /**
8     * Activate FitVids.
9     */
10    $(".entry, .slides, .video_cover").fitVids();
11
12
13    $(function() {
14        var _scroll = {
15            delay: 1000,
16            easing: 'linear',
17            items: 1,
18            duration: 0.07,
19            timeoutDuration: 0,
20            pauseOnHover: 'immediate'
21        };
22        $('#ticker').carouFredSel({
23            width: 1000,
24            align: false,
25            items: {
26                width: 'variable',
27                height: 35,
28                visible: 1
29            },
30            scroll: _scroll
31        });
32
33        $('.caroufredsel_wrapper').css('width', '100%');
34
35
36    });
37
38
39    $('#toggle-top').click(function() {
40        $('#topmenu-wrap').slideToggle(400);
41        $(this).toggleClass("active");
42
43        return false;
44
45    });
46
47    $('#toggle-main').click(function() {
48        $('#menu-wrap').slideToggle(400);
49        $(this).toggleClass("active");
50
51        return false;
52
53    });
54
55
56    function mobileadjust() {
57
58        var windowWidth = $(window).width();
59
60        if( typeof window.orientation === 'undefined' ) {
61            $('#menu-wrap').removeAttr('style');
62            $('#topmenu-wrap').removeAttr('style');
63        }
64
65        if( windowWidth < 769 ) {
66            $('#menu-wrap').addClass('mobile-menu');
67            $('#topmenu-wrap').addClass('mobile-menu');
68        }
69
70    }
71
72    mobileadjust();
73
74    $(window).resize(function() {
75        mobileadjust();
76    });
77
78
79
80    if ( $('#respond input, #respond textarea').length > 0 && 'placeholder' in $('#respond input, #respond textarea')[0] ) {
81        $('#respond').find('#commentform p label').hide();
82    }
83
84
85});
86
87
88
89/**
90 * Homepage Slider & Video API Integration
91 */
92
93var fp_vimeoPlayers = [],fp_youtubeIDs = [], fp_youtubePlayers = [];
94var vimeoPlayers = [], youtubeIDs = [], youtubePlayers = [];
95jQuery(document).ready(function($) {
96
97    $('#recent-videos').flexslider({
98        animation: "slide",
99        controlNav: true,
100        directionNav: true,
101        animationLoop: false,
102        useCSS: false,
103        video: true,
104        smoothHeight: true,
105        slideshow: false,
106        before: $.fn.stopDontMove
107    });
108
109    $("h3.title:empty").remove();
110
111    $('input, textarea').placeholder();
112
113});
114
115function onYouTubePlayerAPIReady() {
116    jQuery(document).ready(function($) {
117        $.fn.fp_youtubeStateChange = function(event) {
118            if (featured_flex === undefined) return;
119
120            if (event.data === 1) {
121                featured_flex.flexslider('stop');
122            }
123        }
124
125        $(youtubeIDs).each(function(index, value) {
126            youtubePlayers.push(new YT.Player(value));
127        });
128
129        $(fp_youtubeIDs).each(function(index, value) {
130            fp_youtubePlayers.push(new YT.Player(value, {
131                events: {
132                    'onStateChange' : $.fn.fp_youtubeStateChange
133                }
134            }));
135        });
136    });
137}
138
139(function($) {
140    $.fn.stopDontMove = function() {
141        $(vimeoPlayers).each(function(i, el) {
142            if ($(el).attr('src') != '') {
143                $f(el).api('pause');
144            }
145        });
146
147        $(youtubePlayers).each(function() {
148            if ($.isFunction(this.stopVideo)) {
149                this.stopVideo();
150            }
151        });
152    }
153
154
155    $.fn.fp_vimeoReady = function(playerID) {
156        if (featured_flex === undefined) return;
157
158        $f(playerID).addEvent('play', function() {
159            featured_flex.flexslider('stop');
160        });
161    }
162})(jQuery);
163
164jQuery(document).ready(function($) {
165    var selectors = [
166        "iframe[src*='player.vimeo.com']",
167        "iframe[src*='youtube.com']",
168        "iframe[src*='youtube-nocookie.com']"
169    ];
170
171    $('#recent-videos').find(selectors.join(',')).each(function() {
172        var $this = $(this);
173        var src = $this.prop('src');
174
175        if (!$this.attr('id')) {
176            $this.attr('id', 'ai' + Math.floor(Math.random() * 999999));
177        }
178
179        if (src.indexOf('vimeo') !== -1) {
180            $(this).prop('src', src + '&api=1&player_id=' + $(this).prop('id'));
181            vimeoPlayers.push($this.get(0));
182        }
183
184        if (src.indexOf('youtube') !== -1) {
185            $(this).prop('src', src + '&enablejsapi=1');
186            youtubeIDs.push($this.prop('id'));
187        }
188    });
189
190    $('#slider').find(selectors.join(',')).each(function() {
191        var $this = $(this);
192        var src = $this.prop('src');
193
194        if (!$this.attr('id')) {
195            $this.attr('id', 'ai' + Math.floor(Math.random() * 999999));
196        }
197
198        if (src.indexOf('vimeo') !== -1) {
199            $(this).prop('src', src + '&api=1&player_id=' + $(this).prop('id'));
200            fp_vimeoPlayers.push($this.get(0));
201            $f(this).addEvent('ready', $.fn.fp_vimeoReady);
202        }
203
204        if (src.indexOf('youtube') !== -1) {
205            $(this).prop('src', src + '&enablejsapi=1');
206            fp_youtubeIDs.push($this.prop('id'));
207        }
208    });
209});

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.