1/* 2Joints Scripts File 3 4This file should contain any js scripts you want to add to the site. 5Instead of calling it in the header or throwing it inside wp_head() 6this file will be called automatically in the footer so as not to 7slow the page load. 8 9*/ 10 11// IE8 ployfill for GetComputed Style (for Responsive Script below) 12if (!window.getComputedStyle) { 13 window.getComputedStyle = function(el, pseudo) { 14 this.el = el; 15 this.getPropertyValue = function(prop) { 16 var re = /(\-([a-z]){1})/g; 17 if (prop == 'float') prop = 'styleFloat'; 18 if (re.test(prop)) { 19 prop = prop.replace(re, function () { 20 return arguments[2].toUpperCase(); 21 }); 22 } 23 return el.currentStyle[prop] ? el.currentStyle[prop] : null; 24 } 25 return this; 26 } 27} 28 29// as the page loads, call these scripts 30jQuery(document).ready(function($) { 31 32 /* 33 Responsive jQuery is a tricky thing. 34 There's a bunch of different ways to handle 35 it, so be sure to research and find the one 36 that works for you best. 37 */ 38 39 /* getting viewport width */ 40 var responsive_viewport = $(window).width(); 41 42 /* if is below 481px */ 43 if (responsive_viewport < 481) { 44 45 } /* end smallest screen */ 46 47 /* if is larger than 481px */ 48 if (responsive_viewport > 481) { 49 50 } /* end larger than 481px */ 51 52 /* if is above or equal to 768px */ 53 if (responsive_viewport >= 768) { 54 55 /* load gravatars */ 56 $('.comment img[data-gravatar]').each(function(){ 57 $(this).attr('src',$(this).attr('data-gravatar')); 58 }); 59 60 } 61 62 /* off the bat large screen actions */ 63 if (responsive_viewport > 1030) { 64 65 } 66 67 68 // add all your scripts here 69 70 71}); /* end of as page load scripts */ 72 73 74/*! A fix for the iOS orientationchange zoom bug. 75 Script by @scottjehl, rebound by @wilto. 76 MIT License. 77*/ 78(function(w){ 79 // This fix addresses an iOS bug, so return early if the UA claims it's something else. 80 if( !( /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1 ) ){ return; } 81 var doc = w.document; 82 if( !doc.querySelector ){ return; } 83 var meta = doc.querySelector( "meta[name=viewport]" ), 84 initialContent = meta && meta.getAttribute( "content" ), 85 disabledZoom = initialContent + ",maximum-scale=1", 86 enabledZoom = initialContent + ",maximum-scale=10", 87 enabled = true, 88 x, y, z, aig; 89 if( !meta ){ return; } 90 function restoreZoom(){ 91 meta.setAttribute( "content", enabledZoom ); 92 enabled = true; } 93 function disableZoom(){ 94 meta.setAttribute( "content", disabledZoom ); 95 enabled = false; } 96 function checkTilt( e ){ 97 aig = e.accelerationIncludingGravity; 98 x = Math.abs( aig.x ); 99 y = Math.abs( aig.y ); 100 z = Math.abs( aig.z ); 101 // If portrait orientation and in one of the danger zones 102 if( !w.orientation && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ){ 103 if( enabled ){ disableZoom(); } } 104 else if( !enabled ){ restoreZoom(); } } 105 w.addEventListener( "orientationchange", restoreZoom, false ); 106 w.addEventListener( "devicemotion", checkTilt, false ); 107})( this ); 108 109/* 110 * Load up Foundation 111 */ 112(function(jQuery) { 113 jQuery(document).foundation(); 114})(jQuery);
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.