1/* 2 * Parabola Theme custom frontend scripting 3 * http://www.cryoutcreations.eu/ 4 * 5 * Copyright 2013-14, Cryout Creations 6 * Free to use and abuse under the GPL v3 license. 7 */ 8 9jQuery(document).ready(function() { 10 11 /* Standard menu touch support for tablets */ 12 var custom_event = ('ontouchstart' in window) ? 'touchstart' : 'click'; // check touch support 13 var ios = /iPhone|iPad|iPod/i.test(navigator.userAgent); 14 jQuery('#access .menu > ul > li a').on('click', function(e){ 15 var $link_id = jQuery(this).attr('href'); 16 if (jQuery(this).parent().data('clicked') == $link_id) { // second touch 17 jQuery(this).parent().data('clicked', null); 18 } 19 else { // first touch 20 if (custom_event != 'click' && !ios && (jQuery(this).parent().children('.sub-menu').length >0)) {e.preventDefault();} 21 jQuery(this).parent().data('clicked', $link_id); 22 } 23 }); 24 25/* Back to top button animation */ 26jQuery(function() { 27 jQuery(window).scroll(function() { 28 var x=jQuery(this).scrollTop(); 29 var ver = getInternetExplorerVersion(); 30 /* no fade animation (transparency) if IE8 or below */ 31 if ( ver > -1 && ver <= 8 ) { 32 if(x != 0) { 33 jQuery('#toTop').show(); 34 } else { 35 jQuery('#toTop').hide(); 36 } 37 } 38 /* fade animation if not IE8 or below */ 39 else { 40 if(x != 0) { 41 jQuery('#toTop').fadeIn(3000); 42 } else { 43 jQuery('#toTop').fadeOut(); 44 } 45 } 46 }); 47 jQuery('#toTop').click(function() { jQuery('body,html').animate({scrollTop:0},800); }); 48}); 49 50 51/* Menu animation */ 52 53jQuery("#access > div > ul > li").hover(function(){ 54 if (jQuery(this).find('ul').length > 0) 55 jQuery("#access > div > ul > li > ul").hide(); 56 }); 57 58jQuery("#access ul ul").css({display: "none"}); /* Opera Fix */ 59jQuery("#access > .menu ul li > a:not(:only-child)").attr("aria-haspopup","true");/* IE10 mobile Fix */ 60 61jQuery("#access li").hover(function(){ 62 jQuery(this).find('ul:first').stop(); 63 jQuery(this).find('ul:first').css({opacity: "0.5"}).css({visibility: "visible",display: "none",overflow:"visible"}).slideDown({duration:200}).animate({"opacity":"1"},{queue:false}); 64 },function(){ 65 jQuery(this).find('ul:first').css({visibility: "visible",display: "block",overflow:"visible"}).slideUp(150); 66 }); 67 68/* Social Icons Animation */ 69jQuery(".socialicons").append('<div class="socials-hover"></div>'); 70jQuery(".socialicons").hover(function(){ 71 jQuery(this).find(".socials-hover").animate({"bottom":"0px"},{queue:false,duration:150}); 72 },function() { 73 jQuery(this).find(".socials-hover").animate({"bottom":"30px"},{queue:false,duration:150, complete: function() { 74 jQuery(this).css({bottom:"-30px"}); 75 } 76 }); 77 } 78); 79 80/* Detect and apply custom class for Safari */ 81if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { 82 jQuery('body').addClass('safari'); 83} 84 85}); 86/* end document.ready */ 87 88 89/* Mobile Menu v2 */ 90function parabola_mobilemenu_init() { 91 var state = false; 92 jQuery("#nav-toggle").click(function(){ 93 jQuery("#access").slideToggle(function(){ if (state) {jQuery(this).removeAttr( 'style' )}; state = ! state; } ); 94 }); 95} 96 97/* Columns equalizer, used if at least one sidebar has a bg color */ 98function equalizeHeights(){ 99 var h1 = jQuery("#primary").height(); 100 var h2 = jQuery("#secondary").height(); 101 var h3 = jQuery("#content").height(); 102 var max = Math.max(h1,h2,h3); 103 if (h1<max) { jQuery("#primary").height(max); }; 104 if (h2<max) { jQuery("#secondary").height(max); }; 105 106} 107 108/*! 109* FitVids 1.0 110* 111* Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com 112* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ 113* Released under the WTFPL license - http://sam.zoy.org/wtfpl/ 114* 115* Date: Thu Sept 01 18:00:00 2011 -0500 116*/ 117 118(function( $ ){ 119 "use strict"; 120 $.fn.fitVids = function( options ) { 121 var settings = { 122 customSelector: null 123 }; 124 125 if(!document.getElementById('fit-vids-style')) { 126 var div = document.createElement('div'), 127 ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0]; 128 div.className = 'fit-vids-style'; 129 div.id = 'fit-vids-style'; 130 div.style.display = 'none'; 131 div.innerHTML = '­<style> .fluid-width-video-wrapper { width: 100%; position: relative; padding: 0; } .fluid-width-video-wrapper iframe, .fluid-width-video-wrapper object, .fluid-width-video-wrapper embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } </style>'; 132 ref.parentNode.insertBefore(div,ref); 133 } 134 135 if ( options ) { 136 $.extend( settings, options ); 137 } 138 139 return this.each(function(){ 140 var selectors = [ 141 "iframe[src*='player.vimeo.com']", 142 "iframe[src*='youtube.com']", 143 "iframe[src*='youtube-nocookie.com']", 144 "iframe[src*='kickstarter.com'][src*='video.html']", 145 "object", 146 "embed" 147 ]; 148 149 if (settings.customSelector) { 150 selectors.push(settings.customSelector); 151 } 152 153 var $allVideos = $(this).find(selectors.join(',')); 154 $allVideos = $allVideos.not("object object");
154 /* SwfObj conflict patch */ 155 156 $allVideos.each(function(){ 157 var $this = $(this); 158 if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; } 159 var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(), 160 width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(), 161 aspectRatio = height / width; 162 if ( width<cryout_global_content_width ) { return; } /* hack to not resize small objects */ 163 if(!$this.attr('id')){ 164 var videoID = 'fitvid' + Math.floor(Math.random()*999999); 165 $this.attr('id', videoID); 166 } 167 $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%"); 168 $this.removeAttr('height').removeAttr('width'); 169 }); 170 }); 171 }; 172})( jQuery ); 173 174 175/* Returns the version of Internet Explorer or a -1 176 (indicating the use of another browser). */ 177function getInternetExplorerVersion() 178{ 179 var rv = -1; /* assume not IE. */ 180 if (navigator.appName == 'Microsoft Internet Explorer') 181 { 182 var ua = navigator.userAgent; 183 var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); 184 if (re.exec(ua) != null) 185 rv = parseFloat( RegExp.$1 ); 186 } 187 return rv; 188}
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.