PageSourceSearch

https://somethingturquoise.com/wp-content/plugins/video-embeds/js/1.0.3/jquery.fitvids.js?ver=0.1.1

js somethingturquoise.com collected 2026-10-03 21:37:21 UTC 2,379 bytes, 66 lines download raw bytes

vendor: 2,379 bytes, lines 1-66
1/*
2 * FitVids 1.0.3
3 * http://fitvidsj.com
4 */
5
6(function($){
7
8  "use strict";
9
10  $.fn.fitVids = function( options ) {
11    var settings = {
12      customSelector: null
13    };
14
15    if(!document.getElementById('fit-vids-style')) {
16
17      var div = document.createElement('div'),
18          ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0],
19          cssStyles = '&shy;<style>.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%;}</style>';
20
21      div.className = 'fit-vids-style';
22      div.id = 'fit-vids-style';
23      div.style.display = 'none';
24      div.innerHTML = cssStyles;
25
26      ref.parentNode.insertBefore(div,ref);
27
28    }
29
30    if ( options ) {
31      $.extend( settings, options );
32    }
33
34    return this.each(function(){
35      var selectors = [
36        "iframe[src*='player.vimeo.com']",
37        "iframe[src*='youtube.com']",
38        "iframe[src*='youtube-nocookie.com']",
39        "iframe[src*='kickstarter.com'][src*='video.html']",
40        "object",
41        "embed"
42      ];
43
44      if (settings.customSelector) {
45        selectors.push(settings.customSelector);
46      }
47
48      var $allVideos = $(this).find(selectors.join(','));
49      $allVideos = $allVideos.not("object object"); // SwfObj conflict patch
50
51      $allVideos.each(function(){
52        var $this = $(this);
53        if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
54        var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
55            width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
56            aspectRatio = height / width;
57        if(!$this.attr('id')){
58          var videoID = 'fitvid' + Math.floor(Math.random()*999999);
59          $this.attr('id', videoID);
60        }
61        $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
62        $this.removeAttr('height').removeAttr('width');
63      });
64    });
65  };
66})(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.