fitvidsjs_rails 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/app/assets/javascripts/fitvids.js +15 -10
- data/lib/fitvidsjs_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eec309f4238e1c396f97c5f2ab013f82db17737e
|
|
4
|
+
data.tar.gz: b08ca01fdce432aec699b2d09a5b910cc13a5c4a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5e80140df5f71f11ad2bf655b31dc7d4629f4e08059018e4ed9a2224b558d5f554945d65965a7ac53f36c566be2b7063d4d7210eaa26ef9b8530b74b3afe6d0c
|
|
7
|
+
data.tar.gz: 748aab0bf0645fc85d3f72ecf34514a3af55bc6708a7f4b7bcbad55c1c172623e7917deb820fd770534b61584c793c92849306503514897d7cf7948fde011445
|
data/.gitignore
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*global jQuery */
|
|
2
2
|
/*jshint browser:true */
|
|
3
3
|
/*!
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
* FitVids 1.1
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
|
|
7
|
+
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
|
|
8
|
+
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
11
|
|
|
12
12
|
(function( $ ){
|
|
13
13
|
|
|
@@ -51,9 +51,14 @@
|
|
|
51
51
|
$allVideos.each(function(){
|
|
52
52
|
var $this = $(this);
|
|
53
53
|
if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
|
|
54
|
+
if (isNaN($this.attr('height')) || isNaN($this.attr('width')))
|
|
55
|
+
{
|
|
56
|
+
$this.attr('height', 9);
|
|
57
|
+
$this.attr('width', 16);
|
|
58
|
+
}
|
|
54
59
|
var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
|
|
61
|
+
aspectRatio = height / width;
|
|
57
62
|
if(!$this.attr('id')){
|
|
58
63
|
var videoID = 'fitvid' + Math.floor(Math.random()*999999);
|
|
59
64
|
$this.attr('id', videoID);
|
|
@@ -64,4 +69,4 @@
|
|
|
64
69
|
});
|
|
65
70
|
};
|
|
66
71
|
// Works with either jQuery or Zepto
|
|
67
|
-
})( window.jQuery || window.Zepto );
|
|
72
|
+
})( window.jQuery || window.Zepto );
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fitvidsjs_rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Guy Israeli
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-04-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|