PageSourceSearch

https://alpindustria-tour.ru/js/jquery/fancybox/helpers/jquery.fancybox-media.js

js alpindustria-tour.ru collected 2026-10-02 06:47:23 UTC 5,492 bytes, 208 lines download raw bytes

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