vendor: 5,001 bytes, lines 1-183
1/*! 2 * Media helper for fancyBox 3 * version: 1.0.3 (Mon, 13 Aug 2012) 4 * @requires fancyBox v2.0 or later 5 * 6 * Usage: 7 * $(".fancybox").fancybox({ 8 * helpers : { 9 * media: true 10 * } 11 * }); 12 * 13 * Set custom URL parameters: 14 * $(".fancybox").fancybox({ 15 * helpers : { 16 * media: { 17 * youtube : { 18 * params : { 19 * autoplay : 0 20 * } 21 * } 22 * } 23 * } 24 * }); 25 * 26 * Or: 27 * $(".fancybox").fancybox({, 28 * helpers : { 29 * media: true 30 * }, 31 * youtube : { 32 * autoplay: 0 33 * } 34 * }); 35 * 36 * Supports: 37 * 38 * Youtube 39 * http://www.youtube.com/watch?v=opj24KnzrWo 40 * http://youtu.be/opj24KnzrWo 41 * Vimeo 42 * http://vimeo.com/40648169 43 * http://vimeo.com/channels/staffpicks/38843628 44 * http://vimeo.com/groups/surrealism/videos/36516384 45 * http://player.vimeo.com/video/45074303 46 * Metacafe 47 * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/ 48 * http://www.metacafe.com/watch/7635964/ 49 * Dailymotion 50 * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people 51 * Twitvid 52 * http://twitvid.com/QY7MD 53 * Twitpic 54 * http://twitpic.com/7p93st 55 * Instagram 56 * http://instagr.am/p/IejkuUGxQn/ 57 * http://instagram.com/p/IejkuUGxQn/ 58 * Google maps 59 * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17 60 * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16 61 * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56 62 */ 63(function ($) { 64 "use strict"; 65 66 //Shortcut for fancyBox object 67 var F = $.fancybox, 68 format = function( url, rez, params ) { 69 params = params || ''; 70 71 if ( $.type( params ) === "object" ) { 72 params = $.param(params, true); 73 } 74 75 $.each(rez, function(key, value) { 76 url = url.replace( '$' + key, value || '' ); 77 }); 78 79 if (params.length) { 80 url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params; 81 } 82 83 return url; 84 }; 85 86 //Add helper object 87 F.helpers.media = { 88 types : { 89 youtube : { 90 matcher : /(youtube\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed)?([\w-]{11}|\?listType=(.*)&list=(.*)).*/i, 91 params : { 92 autoplay : 1, 93 autohide : 1, 94 fs : 1, 95 rel : 0, 96 hd : 1, 97 wmode : 'opaque', 98 enablejsapi : 1 99 }, 100 type : 'iframe', 101 url : '//www.youtube.com/embed/$3' 102 }, 103 vimeo : { 104 matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/, 105 params : { 106 autoplay : 1, 107 hd : 1, 108 show_title : 1, 109 show_byline : 1, 110 show_portrait : 0, 111 color : '', 112 fullscreen : 1 113 }, 114 type : 'iframe', 115 url : '//player.vimeo.com/video/$1' 116 }, 117 metacafe : { 118 matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/, 119 params : { 120 autoPlay : 'yes' 121 }, 122 type : 'swf', 123 url : function( rez, params, obj ) { 124 obj.swf.flashVars = 'playerVars=' + $.param( params, true ); 125 126 return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf'; 127 } 128 }, 129 dailymotion : { 130 matcher : /dailymotion.com\/video\/(.*)\/?(.*)/, 131 params : { 132 additionalInfos : 0, 133 autoStart : 1 134 }, 135 type : 'swf', 136 url : '//www.dailymotion.com/swf/video/$1' 137 }, 138 twitvid : { 139 matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i, 140 params : { 141 autoplay : 0 142 }, 143 type : 'iframe', 144 url : '//www.twitvid.com/embed.php?guid=$1' 145 }, 146 twitpic : { 147 matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i, 148 type : 'image', 149 url : '//twitpic.com/show/full/$1/' 150 }, 151 instagram : { 152 matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, 153 type : 'image', 154 url : '//$1/p/$2/media/' 155 }, 156 google_maps : { 157 matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i, 158 type : 'iframe', 159 url : function( rez ) { 160 return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed'); 161 } 162 } 163 }, 164 165 beforeLoad : function(opts, obj) { 166 var url = obj.href || '', 167 type = false, 168 what, 169 item, 170 rez, 171 params; 172 173 for (what in this.types) { 174 item = this.types[ what ]; 175 rez = url.match( item.matcher ); 176 177 if (rez) { 178 type = item.type; 179 params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null)); 180 181 url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params ); 182 183 break;
vendor: 123 bytes, lines 183-196
183 184 } 185 } 186 187 if (type) { 188 obj.href = url; 189 obj.type = type; 190 191 obj.autoHeight = false; 192 } 193 } 194 }; 195 196}(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.