1/****************************** 2 Mantra Theme 3 custom scripting 4 (c) Cryout Creations 5 www.cryoutcreations.eu 6*******************************/ 7 8 9jQuery(document).ready(function() { 10 11// standard menu touch support for tablets 12 var isTouch = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; // check touch support 13 jQuery('#access .menu > ul > li a').click(function(e){ 14 var $link_id = jQuery(this).attr('href'); 15 if (jQuery(this).parent().data('clicked') == $link_id) { // second touch 16 jQuery(this).parent().data('clicked', null); 17 return true; 18 } 19 else { // first touch 20 if (isTouch && (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 52jQuery("#access ul ul").css({display: "none"}); // Opera Fix 53jQuery("#access").removeClass("jssafe"); // JS failsafe 54jQuery("#access .menu ul li").hoverIntent({ 55 over: function(){jQuery(this).children("ul").show(400);}, 56 out: function(){ jQuery(this).children('ul').hide();}, 57 timeout:400} 58); 59 60 61// Social Icons Animation 62jQuery(".socialicons").hover( 63 function(){ jQuery(this).animate({"top": "-3px" },{ queue: false, duration:125}); }, 64 function(){ jQuery(this).animate({ "top": "0px" }, { queue: false, duration:125 }); 65}); 66 67 68/*! http://tinynav.viljamis.com v1.03 by @viljamis 69 mod 0.1.1 by cryout creations */ 70(function ($, window, i) { 71 $.fn.tinyNav = function (options) { 72 73 // Default settings 74 var settings = $.extend({ 75 'active' : 'selected', // String: Set the "active" class 76 'header' : '' // Show header instead of the active item 77 }, options); 78 79 return this.each(function () { 80 81 i++; // Used for namespacing 82 83 var $nav = $(this), 84 // Namespacing 85 namespace = 'tinynav', 86 namespace_i = namespace + i, 87 l_namespace_i = '.l_' + namespace_i, 88 $select = $('<select/>').addClass(namespace + ' ' + namespace_i); 89 90 if ($nav.is('ul,ol')) { 91 92 if (settings.header) { 93 $select.append( $('<option/>').text(settings.header) ); 94 } 95 96 // Build options 97 var options = ''; 98 var indent = 0; 99 var indented = [" "]; 100 for ( var i = 0; i < 10; i++) { indented.push(indented[indented.length-1]+'- '); } 101 indented[0] = ""; 102 $nav 103 .addClass('l_' + namespace_i) 104 .children('li') 105 .each(buildNavTree=function () { 106 var a = $(this).children('a').first(); 107 108 options += '<option value="' + a.attr('href') + '">' + indented[indent] + a.text() + '</option>'; 109 indent++; 110 $(this).children('ul,ol').children('li').each(buildNavTree); 111 indent--; 112 }); 113 114 // Append options into a select 115 $select.append(options); 116 117 // Select the active item 118 if (!settings.header) { 119 $select 120 .find(':eq(' + $(l_namespace_i + ' li') 121 .index($(l_namespace_i + ' li.' + settings.active)) + ')') 122 .attr('selected', true); 123 } 124 125 // Change window location 126 $select.change(function () { 127 var loc = $(this).val(); loc = loc.replace(/[\s\t]/gi,''); 128 var menu = settings.header; menu = menu.replace(/[\s\t]/gi,''); 129 if ((loc!==menu)) { window.location.href = $(this).val(); } else return false; 130 }); 131 132 // Inject select 133 $(l_namespace_i).after($select); 134 135 } 136 137 var current_url = location.protocol + '//' + location.host + location.pathname; 138 $('option[value="'+current_url+'"]').attr("selected","selected"); 139 140 }); 141 142 }; 143})(jQuery, this, 0); 144// end tinynav 145 146 147// detect and apply custom class for safari 148if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { 149 jQuery('body').addClass('safari'); 150} 151 152 153}); 154// end document.ready 155 156 157// Columns equalizer, used if at least one sidebar has a bg color 158function equalizeHeights(){ 159 var h1 = jQuery("#primary").height(); 160 var h2 = jQuery("#secondary").height(); 161 var h3 = jQuery("#content").height(); 162 var max = Math.max(h1,h2,h3); 163 if (h1<max) { jQuery("#primary").height(max); }; 164 if (h2<max) { jQuery("#secondary").height(max); }; 165 166} 167 168/*! 169* FitVids 1.0 170*
171* Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com 172* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ 173* Released under the WTFPL license - http://sam.zoy.org/wtfpl/ 174* 175* Date: Thu Sept 01 18:00:00 2011 -0500 176*/ 177 178(function( $ ){ 179 180 $.fn.fitVids = function( options ) { 181 var settings = { 182 customSelector: null 183 } 184 185 var div = document.createElement('div'), 186 ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0]; 187 188 div.className = 'fit-vids-style'; 189 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>'; 190 191 ref.parentNode.insertBefore(div,ref); 192 193 if ( options ) { 194 $.extend( settings, options ); 195 } 196 197 return this.each(function(){ 198 var selectors = [ 199 "iframe[src*='player.vimeo.com']", 200 "iframe[src*='www.youtube.com']", 201 "iframe[src*='www.kickstarter.com']", 202 "object", 203 "embed" 204 ]; 205 206 if (settings.customSelector) { 207 selectors.push(settings.customSelector); 208 } 209 210 var $allVideos = $(this).find(selectors.join(',')); 211 212 $allVideos.each(function(){ 213 var $this = $(this); 214 if (this.tagName.toLowerCase() == 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; } 215 var height = this.tagName.toLowerCase() == 'object' ? $this.attr('height') : $this.height(), 216 aspectRatio = height / $this.width(); 217 if(!$this.attr('id')){ 218 var videoID = 'fitvid' + Math.floor(Math.random()*999999); 219 $this.attr('id', videoID); 220 } 221 $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%"); 222 $this.removeAttr('height').removeAttr('width'); 223 }); 224 }); 225 226 } 227})( jQuery ); 228 229 230/*! 231 * hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+ 232 * http://cherne.net/brian/resources/jquery.hoverIntent.html 233 * 234 * You may use hoverIntent under the terms of the MIT license. 235 * Copyright 2007, 2013 Brian Cherne 236 */ 237(function(e){e.fn.hoverIntent=function(t,n,r){var i={interval:100,sensitivity:7,timeout:0};if(typeof t==="object"){i=e.extend(i,t)}else if(e.isFunction(n)){i=e.extend(i,{over:t,out:n,selector:r})}else{i=e.extend(i,{over:t,out:t,selector:n})}var s,o,u,a;var f=function(e){s=e.pageX;o=e.pageY};var l=function(t,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);if(Math.abs(u-s)+Math.abs(a-o)<i.sensitivity){e(n).off("mousemove.hoverIntent",f);n.hoverIntent_s=1;return i.over.apply(n,[t])}else{u=s;a=o;n.hoverIntent_t=setTimeout(function(){l(t,n)},i.interval)}};var c=function(e,t){t.hoverIntent_t=clearTimeout(t.hoverIntent_t);t.hoverIntent_s=0;return i.out.apply(t,[e])};var h=function(t){var n=jQuery.extend({},t);var r=this;if(r.hoverIntent_t){r.hoverIntent_t=clearTimeout(r.hoverIntent_t)}if(t.type=="mouseenter"){u=n.pageX;a=n.pageY;e(r).on("mousemove.hoverIntent",f);if(r.hoverIntent_s!=1){r.hoverIntent_t=setTimeout(function(){l(n,r)},i.interval)}}else{e(r).off("mousemove.hoverIntent",f);if(r.hoverIntent_s==1){r.hoverIntent_t=setTimeout(function(){c(n,r)},i.timeout)}}};return this.on({"mouseenter.hoverIntent":h,"mouseleave.hoverIntent":h},i.selector)}})(jQuery) 238 239 240// Returns the version of Internet Explorer or a -1 241// (indicating the use of another browser). 242function getInternetExplorerVersion() 243{ 244 var rv = -1; // Return value assumes failure. 245 if (navigator.appName == 'Microsoft Internet Explorer') 246 { 247 var ua = navigator.userAgent; 248 var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); 249 if (re.exec(ua) != null) 250 rv = parseFloat( RegExp.$1 ); 251 } 252 return rv; 253}
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.