From fece8193eac8d68609c54288cc3322c03930f76e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20H=C3=B6reth?= Date: Mon, 7 Sep 2015 22:45:15 +0200 Subject: [PATCH] Update fitvids to latest master. --- js/jquery.fitvids.js | 29 ++++++++++++++--------------- php/class-frontend.php | 2 +- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/js/jquery.fitvids.js b/js/jquery.fitvids.js index 05e24cc..4eef91d 100644 --- a/js/jquery.fitvids.js +++ b/js/jquery.fitvids.js @@ -1,7 +1,6 @@ -/*global jQuery */ /*jshint browser:true */ /*! -* FitVids 1.1 +* FitVids master-2015-08 * * 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/ @@ -9,9 +8,9 @@ * */ -(function( $ ){ +;(function( $ ){ - "use strict"; + 'use strict'; $.fn.fitVids = function( options ) { var settings = { @@ -23,7 +22,7 @@ // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js var head = document.head || document.getElementsByTagName('head')[0]; var css = '.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%;}'; - var div = document.createElement('div'); + var div = document.createElement("div"); div.innerHTML = '

x

'; head.appendChild(div.childNodes[1]); } @@ -34,12 +33,12 @@ return this.each(function(){ var selectors = [ - "iframe[src*='player.vimeo.com']", - "iframe[src*='youtube.com']", - "iframe[src*='youtube-nocookie.com']", - "iframe[src*='kickstarter.com'][src*='video.html']", - "object", - "embed" + 'iframe[src*="player.vimeo.com"]', + 'iframe[src*="youtube.com"]', + 'iframe[src*="youtube-nocookie.com"]', + 'iframe[src*="kickstarter.com"][src*="video.html"]', + 'object', + 'embed' ]; if (settings.customSelector) { @@ -53,10 +52,10 @@ } var $allVideos = $(this).find(selectors.join(',')); - $allVideos = $allVideos.not("object object"); // SwfObj conflict patch + $allVideos = $allVideos.not('object object'); // SwfObj conflict patch $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video. - $allVideos.each(function(){ + $allVideos.each(function(count){ var $this = $(this); if($this.parents(ignoreList).length > 0) { return; // Disable FitVids on this video. @@ -71,10 +70,10 @@ 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); + var videoID = 'fitvid' + count; $this.attr('id', videoID); } - $this.wrap('
').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%"); + $this.wrap('
').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%'); $this.removeAttr('height').removeAttr('width'); }); }); diff --git a/php/class-frontend.php b/php/class-frontend.php index 75c39a4..cb31707 100644 --- a/php/class-frontend.php +++ b/php/class-frontend.php @@ -46,7 +46,7 @@ public function enqueue() { 'jquery.fitvids', FVP_URL . "js/jquery.fitvids$min.js", array( 'jquery' ), - '1.1', + 'master-2015-08', false );