PageSourceSearch

https://www.cpc-nyc.org/sites/all/modules/contrib/fitvids/fitvids.js?tl45io

js cpc-nyc.org collected 2026-10-02 03:29:19 UTC 2,315 bytes, 58 lines download raw bytes

1(function ($) {
2  Drupal.behaviors.fitvids = {
3    attach: function (context, settings) {
4      try
5      {
6        // Check that fitvids exists
7        if (typeof $.fn.fitVids !== 'undefined') {
8        
9          // Check that the settings object exists
10          if (typeof settings.fitvids !== 'undefined') {
11            
12            // Default settings values
13            var selectors = ['body'];
14            var simplifymarkup = true;
15            var custom_domains = null;
16            
17            // Get settings for this behaviour
18            if (typeof settings.fitvids.selectors !== 'undefined') {
19              selectors = settings.fitvids.selectors;
20            }
21            if (typeof settings.fitvids.simplifymarkup !== 'undefined') {
22              simplifymarkup = settings.fitvids.simplifymarkup;
23            }
24            if (settings.fitvids.custom_domains.length > 0) {
25              custom_domains = settings.fitvids.custom_domains;
26            }
27                
28            // Remove media wrappers
29            if (simplifymarkup) {
30              if ($(".media-youtube-outer-wrapper").length) {
31                $(".media-youtube-outer-wrapper").removeAttr("style");
32                $(".media-youtube-preview-wrapper").removeAttr("style");
33                $(".media-youtube-outer-wrapper").removeClass("media-youtube-outer-wrapper");
34                $(".media-youtube-preview-wrapper").removeClass("media-youtube-preview-wrapper");
35              }
36              if ($(".media-vimeo-outer-wrapper").length) {
37                $(".media-vimeo-outer-wrapper").removeAttr("style");
38                $(".media-vimeo-preview-wrapper").removeAttr("style");
39                $(".media-vimeo-outer-wrapper").removeClass("media-vimeo-outer-wrapper");
40                $(".media-vimeo-preview-wrapper").removeClass("media-vimeo-preview-wrapper");
41              }
42            }
43            
44            // Fitvids!
45            for (var x = 0; x < selectors.length; x ++) {
46              $(selectors[x]).fitVids({customSelector: custom_domains});
47            }
48          }
49        }
50      }
51      catch (e) {
52        // catch any fitvids errors
53        window.console && console.warn('Fitvids stopped with the following exception');
54        window.console && console.error(e);
55      }
56    }
57  };
58}(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.