/*! * FitVids 1.1 * * Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ * Released under the WTFPL license - http://sam.zoy.org/wtfpl/ * */(function(a){'use strict';a.fn.fitVids=function(c){var b={customSelector:null,ignore:null},e,f,d;return document.getElementById('fit-vids-style')||(e=document.head||document.getElementsByTagName('head')[0],f='.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%;}',d=document.createElement("div"),d.innerHTML='

x

',e.appendChild(d.childNodes[1])),c&&a.extend(b,c),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]','object','embed'],d,c;b.customSelector&&e.push(b.customSelector),d='.fitvidsignore',b.ignore&&(d=d+', '+b.ignore),c=a(this).find(e.join(',')),c=c.not('object object'),c=c.not(d),c.each(function(){var b=a(this),c,e,f,g;if(b.parents(d).length>0)return;if(this.tagName.toLowerCase()==='embed'&&b.parent('object').length||b.parent('.fluid-width-video-wrapper').length)return;typeof b.attr('height')!='undefined'&&typeof b.attr('width')!='undefined'?(c=b.attr('height'),e=b.attr('width'),f=c/e):b.closest('.flexslider').length>0?(b.closest('ul').find('li > img').length>0?c=b.closest('ul').height():b.closest('ul').find('video-wrap').length>0?c=b.closest('ul').find('video-wrap').height():c=500,e=isNaN(parseInt(b.closest('li').attr('width'),10))?b.closest('li').width():parseInt(b.closest('li').attr('width'),10),f=c/e):b.closest('.portfolio_images').length>0?(e=$j('.portfolio_images').width(),b.next('img').length>0?c=b.next('img').height():c=500,f=c/e):b.closest('.post_image').length?(c=this.tagName.toLowerCase()==='object'||b.attr('height')&&!isNaN(parseInt(b.attr('height'),10))?parseInt(b.attr('height'),10):b.height(),e=isNaN(parseInt(b.attr('width'),10))?b.width():parseInt(b.attr('width'),10),f=c/e):b.closest('.q_masonry_blog_post_image').length?(c=this.tagName.toLowerCase()==='object'||b.attr('height')&&!isNaN(parseInt(b.attr('height'),10))?parseInt(b.attr('height'),10):b.height(),e=isNaN(parseInt(b.attr('width'),10))?b.width():parseInt(b.attr('width'),10),f=c/e):(c=this.tagName.toLowerCase()==='object'||b.attr('height')&&!isNaN(parseInt(b.attr('height'),10))?parseInt(b.attr('height'),10):b.height(),e=isNaN(parseInt(b.attr('width'),10))?b.parent().width():parseInt(b.attr('width'),10),f=c/e),b.attr('id')||(g='fitvid'+Math.floor(Math.random()*999999),b.attr('id',g)),b.wrap('
'),a('.fluid-width-video-wrapper').css('padding-top',f*100+"%")})})},a.fn.fitVids._count=0})(window.jQuery||window.Zepto)