Permalink
Browse files

🚀 travis

  • Loading branch information...
lacymorrow committed Feb 5, 2018
1 parent 914b680 commit 059da75421442c80d1c0b480b11879e0ae54edf5
Showing with 11 additions and 11 deletions.
  1. +1 −1 js/main.js
  2. +3 −5 src/js/casper.js
  3. +7 −5 src/js/jquery.fitvids.js

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -17,7 +17,7 @@
var e = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
t = document.getElementsByTagName( 'body' )[0].getElementsByTagName( 'img' ),
r = window.devicePixelRatio ? window.devicePixelRatio >= 1.2 ? 1 : 0 : 0,
a, b, c, d, g, f, h, i, l, m, n, o, p, s, u, v, w, y, E;
a, b, c, d, g, f, h, i, l, m, n, o, p, s, u, v, w, y, E, S;
if ( 0 === t.length ) {
return;
}
@@ -42,8 +42,7 @@
for ( c = 0; c < l.length; c++ ) {
h = l[c].replace( ':', '||' ).split( '||' ),
p = h[0],
d = h[1],
v, m;
d = h[1];
if ( p.indexOf( '<' ) !== -1 ) {
v = p.split( '<' );
if ( l[c - 1] ) {
@@ -64,8 +63,7 @@
}
}
if ( m ) {
E = d.indexOf( '//' ) !== -1 ? 1 : 0,
S;
E = d.indexOf( '//' ) !== -1 ? 1 : 0;
1 === E ? S = d : S = a + d;
s.src !== S && s.setAttribute( 'src', S );
break;
@@ -11,6 +11,8 @@
'use strict';
var height, width, aspectRatio, videoID;
$.fn.fitVids = function( options ) {
var settings = {
customSelector: null
@@ -54,14 +56,14 @@
$allVideos.each(function() {
var $this = $( this );
if ( this.tagName.toLowerCase() === 'embed' && $this.parent( 'object' ).length || $this.parent( '.fluid-width-video-wrapper' ).length ) {
if ( 'embed' === this.tagName.toLowerCase() && $this.parent( 'object' ).length || $this.parent( '.fluid-width-video-wrapper' ).length ) {
return;
}
var height = ( this.tagName.toLowerCase() === 'object' || ( $this.attr( 'height' ) && ! isNaN( parseInt( $this.attr( 'height' ), 10 ) ) ) ) ? parseInt( $this.attr( 'height' ), 10 ) : $this.height(),
width = ! isNaN( parseInt( $this.attr( 'width' ), 10 ) ) ? parseInt( $this.attr( 'width' ), 10 ) : $this.width(),
aspectRatio = height / width;
height = ( this.tagName.toLowerCase() === 'object' || ( $this.attr( 'height' ) && ! isNaN( parseInt( $this.attr( 'height' ), 10 ) ) ) ) ? parseInt( $this.attr( 'height' ), 10 ) : $this.height(),
width = ! isNaN( parseInt( $this.attr( 'width' ), 10 ) ) ? parseInt( $this.attr( 'width' ), 10 ) : $this.width(),
aspectRatio = height / width;
if ( ! $this.attr( 'id' ) ) {
var videoID = 'fitvid' + Math.floor( Math.random() * 999999 );
videoID = 'fitvid' + Math.floor( Math.random() * 999999 );
$this.attr( 'id', videoID );
}
$this.wrap( '<div class="fluid-width-video-wrapper"></div>' ).parent( '.fluid-width-video-wrapper' ).css( 'padding-top', ( aspectRatio * 100 ) + '%' );

0 comments on commit 059da75

Please sign in to comment.