1/** 2 * Theme functions file 3 */ 4(function ($) { 5 'use strict'; 6 7 var $document = $(document); 8 var $window = $(window); 9 10 11 /** 12 * Document ready (jQuery) 13 */ 14 $(function () { 15 16 17 /** 18 * Activate superfish menu. 19 */ 20 $('.sf-menu').superfish({ 21 'speed': 'fast', 22 'delay' : 0, 23 'animation': { 24 'height': 'show' 25 } 26 }); 27 28 29 /** 30 * Activate jQuery.mmenu. 31 */ 32 $("#menu-top-slide").mmenu({ 33 "slidingSubmenus": false, 34 "extensions": [ 35 "theme-dark", 36 "pageshadow", 37 "border-full" 38 ] 39 }); 40 41 $("#menu-main-slide").mmenu({ 42 "slidingSubmenus": false, 43 "extensions": [ 44 "theme-dark", 45 "pageshadow", 46 "border-full" 47 ] 48 }); 49 50 51 $(".sb-search").sbSearch(); 52 53 54 /** 55 * Activate FitVids. 56 */ 57 $(".entry-content, .video_cover").fitVids(); 58 59 60 /** 61 * News ticker. 62 */ 63 $('#ticker').ticker(); 64 65 66 }); 67 68 69 $.fn.ticker = function() { 70 return this.each(function () { 71 var $this = $(this); 72 73 var _scroll = { 74 delay: 1000, 75 easing: 'linear', 76 items: 1, 77 duration: 0.05, 78 timeoutDuration: 0, 79 pauseOnHover: 'immediate' 80 }; 81 82 $this.carouFredSel({ 83 width: 1000, 84 align: false, 85 items: { 86 width: 'variable', 87 height: 35, 88 visible: 1 89 }, 90 scroll: _scroll 91 }); 92 93 $this.parent('.caroufredsel_wrapper').css('width', '100%'); 94 }) ; 95 }; 96 97 98 $.fn.sbSearch = function() { 99 return this.each(function() { 100 new UISearch( this ); 101 }); 102 }; 103 104 105 106})(jQuery); 107 108 109 110/** 111 * Homepage Slider & Video API Integration 112 */ 113 114var fp_vimeoPlayers = [],fp_youtubeIDs = [], fp_youtubePlayers = []; 115var vimeoPlayers = [], youtubeIDs = [], youtubePlayers = []; 116 117function onYouTubePlayerAPIReady() { 118 jQuery(document).ready(function($) { 119 $.fn.fp_youtubeStateChange = function(event) { 120 if (typeof featured_flex === 'undefined') return; 121 122 if (event.data === 1) { 123 featured_flex.flexslider('stop'); 124 } 125 } 126 127 $(youtubeIDs).each(function(index, value) { 128 youtubePlayers.push(new YT.Player(value)); 129 }); 130 131 $(fp_youtubeIDs).each(function(index, value) { 132 fp_youtubePlayers.push(new YT.Player(value, { 133 events: { 134 'onStateChange' : $.fn.fp_youtubeStateChange 135 } 136 })); 137 }); 138 }); 139} 140 141(function($) { 142 $.fn.stopDontMove = function() { 143 $(vimeoPlayers).each(function(i, el) { 144 if ($(el).attr('src') != '') { 145 $f(el).api('pause'); 146 } 147 }); 148 149 $(youtubePlayers).each(function() { 150 if (typeof this.stopVideo === 'function') { 151 this.stopVideo(); 152 } 153 }); 154 } 155 156 157 $.fn.fp_vimeoReady = function(playerID) { 158 if (featured_flex === undefined) return; 159 160 $f(playerID).addEvent('play', function() { 161 featured_flex.flexslider('stop'); 162 }); 163 } 164})(jQuery); 165 166jQuery(document).ready(function($) { 167 var selectors = [ 168 "iframe[src*='player.vimeo.com']", 169 "iframe[src*='youtube.com']", 170 "iframe[src*='youtube-nocookie.com']" 171 ]; 172 173 174 $('#slider').find(selectors.join(',')).each(function() { 175 var $this = $(this); 176 var src = $this.prop('src'); 177 178 if (!$this.attr('id')) { 179 $this.attr('id', 'ai' + Math.floor(Math.random() * 999999)); 180 } 181 182 if (src.indexOf('vimeo') !== -1) { 183 $(this).prop('src', src + '&api=1&player_id=' + $(this).prop('id')); 184 fp_vimeoPlayers.push($this.get(0)); 185 $f(this).addEvent('ready', $.fn.fp_vimeoReady); 186 } 187 188 if (src.indexOf('youtube') !== -1) { 189 $(this).prop('src', src + '&enablejsapi=1'); 190 fp_youtubeIDs.push($this.prop('id')); 191 } 192 }); 193});
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.