@pimaonline/pimaonline-themepack 3.12.1 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +13 -26
- package/dist/css/main.css +1 -1
- package/dist/css/plugins/alt-icons.css +1 -1
- package/dist/css/plugins/dark-mode.css +1 -0
- package/dist/css/plugins/font-awesome.css +1 -1
- package/dist/css/routes.css +1 -1
- package/dist/css/themes/ait/styles.css +1 -1
- package/dist/css/themes/ajs/styles.css +1 -1
- package/dist/css/themes/ant/styles.css +1 -0
- package/dist/css/themes/art/styles.css +1 -1
- package/dist/css/themes/aviation/styles.css +1 -1
- package/dist/css/themes/bct/styles.css +1 -1
- package/dist/css/themes/bio/styles.css +1 -1
- package/dist/css/themes/blobs/styles.css +1 -0
- package/dist/css/themes/business/styles.css +1 -1
- package/dist/css/themes/cad/styles.css +1 -1
- package/dist/css/themes/cards/styles.css +1 -1
- package/dist/css/themes/cas/styles.css +1 -0
- package/dist/css/themes/cda/styles.css +1 -1
- package/dist/css/themes/chm/styles.css +1 -0
- package/dist/css/themes/cis/styles.css +1 -1
- package/dist/css/themes/communication/styles.css +1 -1
- package/dist/css/themes/computer-information-systems/styles.css +1 -1
- package/dist/css/themes/culinary/styles.css +1 -1
- package/dist/css/themes/culinary/versions/black-marble.css +1 -1
- package/dist/css/themes/culinary/versions/stainless.css +1 -1
- package/dist/css/themes/culinary/versions/wood.css +1 -1
- package/dist/css/themes/dental/styles.css +1 -1
- package/dist/css/themes/ece/styles.css +1 -1
- package/dist/css/themes/ecn/styles.css +1 -1
- package/dist/css/themes/eng/styles.css +1 -1
- package/dist/css/themes/fashion/styles.css +1 -1
- package/dist/css/themes/fitness/styles.css +1 -1
- package/dist/css/themes/fsc/styles.css +1 -1
- package/dist/css/themes/geography/styles.css +1 -1
- package/dist/css/themes/geology/styles.css +1 -1
- package/dist/css/themes/health-it/styles.css +1 -1
- package/dist/css/themes/history/styles.css +1 -1
- package/dist/css/themes/hrm/styles.css +1 -1
- package/dist/css/themes/hrs/styles.css +1 -1
- package/dist/css/themes/journalism/styles.css +1 -1
- package/dist/css/themes/lang/styles.css +1 -1
- package/dist/css/themes/lgm/styles.css +1 -1
- package/dist/css/themes/machine/styles.css +1 -1
- package/dist/css/themes/math/styles.css +1 -1
- package/dist/css/themes/mgt/styles.css +1 -1
- package/dist/css/themes/minimalist/styles.css +1 -1
- package/dist/css/themes/mkt/styles.css +1 -0
- package/dist/css/themes/music/styles.css +1 -1
- package/dist/css/themes/nursing/styles.css +1 -0
- package/dist/css/themes/philosophy/styles.css +1 -1
- package/dist/css/themes/pht/styles.css +1 -1
- package/dist/css/themes/phy/styles.css +1 -0
- package/dist/css/themes/pos/styles.css +1 -0
- package/dist/css/themes/psy/styles.css +1 -1
- package/dist/css/themes/reading/styles.css +1 -0
- package/dist/css/themes/resort/styles.css +1 -1
- package/dist/css/themes/soc/styles.css +1 -1
- package/dist/css/themes/ss/styles.css +1 -1
- package/dist/css/themes/tps/styles.css +1 -0
- package/dist/css/themes/university/styles.css +1 -1
- package/dist/css/themes/vet/styles.css +1 -1
- package/dist/css/themes/welding/styles.css +1 -1
- package/dist/css/themes/writing/styles.css +1 -1
- package/dist/img/general/arrow-right-black.svg +1 -0
- package/dist/img/general/arrow-right-primary-blue.svg +1 -0
- package/dist/img/general/arrow-right-white.svg +1 -0
- package/dist/img/general/eye-icon.svg +4 -0
- package/dist/img/general/gear-icon.svg +3 -0
- package/dist/img/general/moon-icon.svg +4 -0
- package/dist/img/general/sliders-icon.svg +1 -0
- package/dist/img/general/text-icon.svg +4 -0
- package/dist/img/general/width-icon.svg +4 -0
- package/dist/img/theme-images/ant/texture.png +0 -0
- package/dist/img/theme-images/cas/city-vector.svg +92 -0
- package/dist/img/theme-images/cas/farm-vector.svg +1 -0
- package/dist/img/theme-images/cas/ocean-vector.svg +1 -0
- package/dist/img/theme-images/cas/recycle-symbol.svg +1 -0
- package/dist/img/theme-images/chm/chem-letters/letter-a.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-b.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-c.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-d.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-e.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-f.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-g.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-h.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-i.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-j.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-k.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-l.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-m.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-n.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-o.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-p.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-q.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-r.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-s.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-t.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-u.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-v.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-w.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-x.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-y.png +0 -0
- package/dist/img/theme-images/chm/chem-letters/letter-z.png +0 -0
- package/dist/img/theme-images/mkt/blue/bluebars.svg +36 -0
- package/dist/img/theme-images/mkt/blue/blueheader.jpg +0 -0
- package/dist/img/theme-images/mkt/blue/bluepie.svg +42 -0
- package/dist/img/theme-images/mkt/green/greenbars.svg +36 -0
- package/dist/img/theme-images/mkt/green/greenheader.jpg +0 -0
- package/dist/img/theme-images/mkt/green/greenpie.svg +42 -0
- package/dist/img/theme-images/mkt/yellow/yellowbars.svg +36 -0
- package/dist/img/theme-images/mkt/yellow/yellowheader.jpg +0 -0
- package/dist/img/theme-images/mkt/yellow/yellowpie.svg +42 -0
- package/dist/img/theme-images/nursing/blue/bottomright-blue.svg +95 -0
- package/dist/img/theme-images/nursing/blue/topleft-blue.svg +111 -0
- package/dist/img/theme-images/nursing/green/bottomright-green.svg +95 -0
- package/dist/img/theme-images/nursing/green/topleft-green.svg +111 -0
- package/dist/img/theme-images/nursing/purple/bottomright-purple.svg +95 -0
- package/dist/img/theme-images/nursing/purple/topleft-purple.svg +111 -0
- package/dist/img/theme-images/nursing/teal/bottomright-teal.svg +95 -0
- package/dist/img/theme-images/nursing/teal/topleft-teal.svg +111 -0
- package/dist/img/theme-images/phy/background.svg +150 -0
- package/dist/img/theme-images/phy/tape-style1.svg +8 -0
- package/dist/img/theme-images/reading/bg10.jpg +0 -0
- package/dist/js/scripts2.js +1 -1552
- package/dist/js/themes/blobs.js +1 -0
- package/dist/js/themes/cas.js +1 -0
- package/dist/js/themes/chm.js +1 -0
- package/dist/js/themes/ecn.js +1 -13
- package/dist/js/themes/hrs.js +1 -19
- package/dist/plugins/fancybox/fancybox-example.html +1 -1
- package/dist/plugins/fancybox/helpers/jquery.fancybox-buttons.js +2 -122
- package/dist/plugins/fancybox/helpers/jquery.fancybox-media.js +2 -201
- package/dist/plugins/fancybox/helpers/jquery.fancybox-thumbs.js +2 -165
- package/dist/plugins/fancybox/jquery.fancybox.js +2 -2018
- package/dist/plugins/fancybox/jquery.fancybox.pack.js +2 -46
- package/dist/plugins/flashcards/flashcards-example.html +1 -1
- package/dist/plugins/flashcards/js/flash_cards.min.js +1 -12
- package/dist/plugins/flashcards/js/plugins/flash_cards.js +1 -62
- package/dist/plugins/flashcards/js/plugins/jquery.cycle.js +2 -1148
- package/dist/plugins/flashcards/js/vendor/jquery-1.7.2.js +2 -9404
- package/dist/plugins/flashcards/js/vendor/jquery-1.7.2.min.js +2 -4
- package/dist/plugins/flashcards/js/vendor/modernizr-2.5.3.min.js +1 -4
- package/dist/plugins/floating-particles/floating-particles.js +1 -68
- package/dist/plugins/global-homepage-overrides/global-homepage-overrides.js +1 -53
- package/dist/plugins/preview-banner/preview-banner.js +1 -57
- package/package.json +12 -16
- package/dist/js/jumpTo.js +0 -4
- package/dist/js/scripts-ts.js +0 -1
- package/dist/js/scripts.js +0 -327
- package/dist/js/themes/ss.js +0 -197
@@ -1,2018 +1,2 @@
|
|
1
|
-
/*!
|
2
|
-
* fancyBox - jQuery Plugin
|
3
|
-
* version: 2.1.7 (Tue, 28 Feb 2017)
|
4
|
-
* requires jQuery v1.6 or later
|
5
|
-
*
|
6
|
-
* Examples at http://fancyapps.com/fancybox/
|
7
|
-
* License: www.fancyapps.com/fancybox/#license
|
8
|
-
*
|
9
|
-
* Copyright 2017 fancyapps.com
|
10
|
-
*
|
11
|
-
*/
|
12
|
-
|
13
|
-
;(function (window, document, $, undefined) {
|
14
|
-
"use strict";
|
15
|
-
|
16
|
-
var H = $("html"),
|
17
|
-
W = $(window),
|
18
|
-
D = $(document),
|
19
|
-
F = $.fancybox = function () {
|
20
|
-
F.open.apply( this, arguments );
|
21
|
-
},
|
22
|
-
IE = navigator.userAgent.match(/msie/i),
|
23
|
-
didUpdate = null,
|
24
|
-
isTouch = document.createTouch !== undefined,
|
25
|
-
|
26
|
-
isQuery = function(obj) {
|
27
|
-
return obj && obj.hasOwnProperty && obj instanceof $;
|
28
|
-
},
|
29
|
-
isString = function(str) {
|
30
|
-
return str && $.type(str) === "string";
|
31
|
-
},
|
32
|
-
isPercentage = function(str) {
|
33
|
-
return isString(str) && str.indexOf('%') > 0;
|
34
|
-
},
|
35
|
-
isScrollable = function(el) {
|
36
|
-
return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight)));
|
37
|
-
},
|
38
|
-
getScalar = function(orig, dim) {
|
39
|
-
var value = parseInt(orig, 10) || 0;
|
40
|
-
|
41
|
-
if (dim && isPercentage(orig)) {
|
42
|
-
value = F.getViewport()[ dim ] / 100 * value;
|
43
|
-
}
|
44
|
-
|
45
|
-
return Math.ceil(value);
|
46
|
-
},
|
47
|
-
getValue = function(value, dim) {
|
48
|
-
return getScalar(value, dim) + 'px';
|
49
|
-
};
|
50
|
-
|
51
|
-
$.extend(F, {
|
52
|
-
// The current version of fancyBox
|
53
|
-
version: '2.1.7',
|
54
|
-
|
55
|
-
defaults: {
|
56
|
-
padding : 15,
|
57
|
-
margin : 20,
|
58
|
-
|
59
|
-
width : 800,
|
60
|
-
height : 600,
|
61
|
-
minWidth : 100,
|
62
|
-
minHeight : 100,
|
63
|
-
maxWidth : 9999,
|
64
|
-
maxHeight : 9999,
|
65
|
-
pixelRatio: 1, // Set to 2 for retina display support
|
66
|
-
|
67
|
-
autoSize : true,
|
68
|
-
autoHeight : false,
|
69
|
-
autoWidth : false,
|
70
|
-
|
71
|
-
autoResize : true,
|
72
|
-
autoCenter : !isTouch,
|
73
|
-
fitToView : true,
|
74
|
-
aspectRatio : false,
|
75
|
-
topRatio : 0.5,
|
76
|
-
leftRatio : 0.5,
|
77
|
-
|
78
|
-
scrolling : 'auto', // 'auto', 'yes' or 'no'
|
79
|
-
wrapCSS : '',
|
80
|
-
|
81
|
-
arrows : true,
|
82
|
-
closeBtn : true,
|
83
|
-
closeClick : false,
|
84
|
-
nextClick : false,
|
85
|
-
mouseWheel : true,
|
86
|
-
autoPlay : false,
|
87
|
-
playSpeed : 3000,
|
88
|
-
preload : 3,
|
89
|
-
modal : false,
|
90
|
-
loop : true,
|
91
|
-
|
92
|
-
ajax : {
|
93
|
-
dataType : 'html',
|
94
|
-
headers : { 'X-fancyBox': true }
|
95
|
-
},
|
96
|
-
iframe : {
|
97
|
-
scrolling : 'auto',
|
98
|
-
preload : true
|
99
|
-
},
|
100
|
-
swf : {
|
101
|
-
wmode: 'transparent',
|
102
|
-
allowfullscreen : 'true',
|
103
|
-
allowscriptaccess : 'always'
|
104
|
-
},
|
105
|
-
|
106
|
-
keys : {
|
107
|
-
next : {
|
108
|
-
13 : 'left', // enter
|
109
|
-
34 : 'up', // page down
|
110
|
-
39 : 'left', // right arrow
|
111
|
-
40 : 'up' // down arrow
|
112
|
-
},
|
113
|
-
prev : {
|
114
|
-
8 : 'right', // backspace
|
115
|
-
33 : 'down', // page up
|
116
|
-
37 : 'right', // left arrow
|
117
|
-
38 : 'down' // up arrow
|
118
|
-
},
|
119
|
-
close : [27], // escape key
|
120
|
-
play : [32], // space - start/stop slideshow
|
121
|
-
toggle : [70] // letter "f" - toggle fullscreen
|
122
|
-
},
|
123
|
-
|
124
|
-
direction : {
|
125
|
-
next : 'left',
|
126
|
-
prev : 'right'
|
127
|
-
},
|
128
|
-
|
129
|
-
scrollOutside : true,
|
130
|
-
|
131
|
-
// Override some properties
|
132
|
-
index : 0,
|
133
|
-
type : null,
|
134
|
-
href : null,
|
135
|
-
content : null,
|
136
|
-
title : null,
|
137
|
-
|
138
|
-
// HTML templates
|
139
|
-
tpl: {
|
140
|
-
wrap : '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
|
141
|
-
image : '<img class="fancybox-image" src="{href}" alt="" />',
|
142
|
-
iframe : '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (IE ? ' allowtransparency="true"' : '') + '></iframe>',
|
143
|
-
error : '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
|
144
|
-
closeBtn : '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',
|
145
|
-
next : '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
|
146
|
-
prev : '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>',
|
147
|
-
loading : '<div id="fancybox-loading"><div></div></div>'
|
148
|
-
},
|
149
|
-
|
150
|
-
// Properties for each animation type
|
151
|
-
// Opening fancyBox
|
152
|
-
openEffect : 'fade', // 'elastic', 'fade' or 'none'
|
153
|
-
openSpeed : 250,
|
154
|
-
openEasing : 'swing',
|
155
|
-
openOpacity : true,
|
156
|
-
openMethod : 'zoomIn',
|
157
|
-
|
158
|
-
// Closing fancyBox
|
159
|
-
closeEffect : 'fade', // 'elastic', 'fade' or 'none'
|
160
|
-
closeSpeed : 250,
|
161
|
-
closeEasing : 'swing',
|
162
|
-
closeOpacity : true,
|
163
|
-
closeMethod : 'zoomOut',
|
164
|
-
|
165
|
-
// Changing next gallery item
|
166
|
-
nextEffect : 'elastic', // 'elastic', 'fade' or 'none'
|
167
|
-
nextSpeed : 250,
|
168
|
-
nextEasing : 'swing',
|
169
|
-
nextMethod : 'changeIn',
|
170
|
-
|
171
|
-
// Changing previous gallery item
|
172
|
-
prevEffect : 'elastic', // 'elastic', 'fade' or 'none'
|
173
|
-
prevSpeed : 250,
|
174
|
-
prevEasing : 'swing',
|
175
|
-
prevMethod : 'changeOut',
|
176
|
-
|
177
|
-
// Enable default helpers
|
178
|
-
helpers : {
|
179
|
-
overlay : true,
|
180
|
-
title : true
|
181
|
-
},
|
182
|
-
|
183
|
-
// Callbacks
|
184
|
-
onCancel : $.noop, // If canceling
|
185
|
-
beforeLoad : $.noop, // Before loading
|
186
|
-
afterLoad : $.noop, // After loading
|
187
|
-
beforeShow : $.noop, // Before changing in current item
|
188
|
-
afterShow : $.noop, // After opening
|
189
|
-
beforeChange : $.noop, // Before changing gallery item
|
190
|
-
beforeClose : $.noop, // Before closing
|
191
|
-
afterClose : $.noop // After closing
|
192
|
-
},
|
193
|
-
|
194
|
-
//Current state
|
195
|
-
group : {}, // Selected group
|
196
|
-
opts : {}, // Group options
|
197
|
-
previous : null, // Previous element
|
198
|
-
coming : null, // Element being loaded
|
199
|
-
current : null, // Currently loaded element
|
200
|
-
isActive : false, // Is activated
|
201
|
-
isOpen : false, // Is currently open
|
202
|
-
isOpened : false, // Have been fully opened at least once
|
203
|
-
|
204
|
-
wrap : null,
|
205
|
-
skin : null,
|
206
|
-
outer : null,
|
207
|
-
inner : null,
|
208
|
-
|
209
|
-
player : {
|
210
|
-
timer : null,
|
211
|
-
isActive : false
|
212
|
-
},
|
213
|
-
|
214
|
-
// Loaders
|
215
|
-
ajaxLoad : null,
|
216
|
-
imgPreload : null,
|
217
|
-
|
218
|
-
// Some collections
|
219
|
-
transitions : {},
|
220
|
-
helpers : {},
|
221
|
-
|
222
|
-
/*
|
223
|
-
* Static methods
|
224
|
-
*/
|
225
|
-
|
226
|
-
open: function (group, opts) {
|
227
|
-
if (!group) {
|
228
|
-
return;
|
229
|
-
}
|
230
|
-
|
231
|
-
if (!$.isPlainObject(opts)) {
|
232
|
-
opts = {};
|
233
|
-
}
|
234
|
-
|
235
|
-
// Close if already active
|
236
|
-
if (false === F.close(true)) {
|
237
|
-
return;
|
238
|
-
}
|
239
|
-
|
240
|
-
// Normalize group
|
241
|
-
if (!$.isArray(group)) {
|
242
|
-
group = isQuery(group) ? $(group).get() : [group];
|
243
|
-
}
|
244
|
-
|
245
|
-
// Recheck if the type of each element is `object` and set content type (image, ajax, etc)
|
246
|
-
$.each(group, function(i, element) {
|
247
|
-
var obj = {},
|
248
|
-
href,
|
249
|
-
title,
|
250
|
-
content,
|
251
|
-
type,
|
252
|
-
rez,
|
253
|
-
hrefParts,
|
254
|
-
selector;
|
255
|
-
|
256
|
-
if ($.type(element) === "object") {
|
257
|
-
// Check if is DOM element
|
258
|
-
if (element.nodeType) {
|
259
|
-
element = $(element);
|
260
|
-
}
|
261
|
-
|
262
|
-
if (isQuery(element)) {
|
263
|
-
obj = {
|
264
|
-
href : element.data('fancybox-href') || element.attr('href'),
|
265
|
-
title : $('<div/>').text( element.data('fancybox-title') || element.attr('title') || '' ).html(),
|
266
|
-
isDom : true,
|
267
|
-
element : element
|
268
|
-
};
|
269
|
-
|
270
|
-
if ($.metadata) {
|
271
|
-
$.extend(true, obj, element.metadata());
|
272
|
-
}
|
273
|
-
|
274
|
-
} else {
|
275
|
-
obj = element;
|
276
|
-
}
|
277
|
-
}
|
278
|
-
|
279
|
-
href = opts.href || obj.href || (isString(element) ? element : null);
|
280
|
-
title = opts.title !== undefined ? opts.title : obj.title || '';
|
281
|
-
|
282
|
-
content = opts.content || obj.content;
|
283
|
-
type = content ? 'html' : (opts.type || obj.type);
|
284
|
-
|
285
|
-
if (!type && obj.isDom) {
|
286
|
-
type = element.data('fancybox-type');
|
287
|
-
|
288
|
-
if (!type) {
|
289
|
-
rez = element.prop('class').match(/fancybox\.(\w+)/);
|
290
|
-
type = rez ? rez[1] : null;
|
291
|
-
}
|
292
|
-
}
|
293
|
-
|
294
|
-
if (isString(href)) {
|
295
|
-
// Try to guess the content type
|
296
|
-
if (!type) {
|
297
|
-
if (F.isImage(href)) {
|
298
|
-
type = 'image';
|
299
|
-
|
300
|
-
} else if (F.isSWF(href)) {
|
301
|
-
type = 'swf';
|
302
|
-
|
303
|
-
} else if (href.charAt(0) === '#') {
|
304
|
-
type = 'inline';
|
305
|
-
|
306
|
-
} else if (isString(element)) {
|
307
|
-
type = 'html';
|
308
|
-
content = element;
|
309
|
-
}
|
310
|
-
}
|
311
|
-
|
312
|
-
// Split url into two pieces with source url and content selector, e.g,
|
313
|
-
// "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id"
|
314
|
-
if (type === 'ajax') {
|
315
|
-
hrefParts = href.split(/\s+/, 2);
|
316
|
-
href = hrefParts.shift();
|
317
|
-
selector = hrefParts.shift();
|
318
|
-
}
|
319
|
-
}
|
320
|
-
|
321
|
-
if (!content) {
|
322
|
-
if (type === 'inline') {
|
323
|
-
if (href) {
|
324
|
-
content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7
|
325
|
-
|
326
|
-
} else if (obj.isDom) {
|
327
|
-
content = element;
|
328
|
-
}
|
329
|
-
|
330
|
-
} else if (type === 'html') {
|
331
|
-
content = href;
|
332
|
-
|
333
|
-
} else if (!type && !href && obj.isDom) {
|
334
|
-
type = 'inline';
|
335
|
-
content = element;
|
336
|
-
}
|
337
|
-
}
|
338
|
-
|
339
|
-
$.extend(obj, {
|
340
|
-
href : href,
|
341
|
-
type : type,
|
342
|
-
content : content,
|
343
|
-
title : title,
|
344
|
-
selector : selector
|
345
|
-
});
|
346
|
-
|
347
|
-
group[ i ] = obj;
|
348
|
-
});
|
349
|
-
|
350
|
-
// Extend the defaults
|
351
|
-
F.opts = $.extend(true, {}, F.defaults, opts);
|
352
|
-
|
353
|
-
// All options are merged recursive except keys
|
354
|
-
if (opts.keys !== undefined) {
|
355
|
-
F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false;
|
356
|
-
}
|
357
|
-
|
358
|
-
F.group = group;
|
359
|
-
|
360
|
-
return F._start(F.opts.index);
|
361
|
-
},
|
362
|
-
|
363
|
-
// Cancel image loading or abort ajax request
|
364
|
-
cancel: function () {
|
365
|
-
var coming = F.coming;
|
366
|
-
|
367
|
-
if (coming && false === F.trigger('onCancel')) {
|
368
|
-
return;
|
369
|
-
}
|
370
|
-
|
371
|
-
F.hideLoading();
|
372
|
-
|
373
|
-
if (!coming) {
|
374
|
-
return;
|
375
|
-
}
|
376
|
-
|
377
|
-
if (F.ajaxLoad) {
|
378
|
-
F.ajaxLoad.abort();
|
379
|
-
}
|
380
|
-
|
381
|
-
F.ajaxLoad = null;
|
382
|
-
|
383
|
-
if (F.imgPreload) {
|
384
|
-
F.imgPreload.onload = F.imgPreload.onerror = null;
|
385
|
-
}
|
386
|
-
|
387
|
-
if (coming.wrap) {
|
388
|
-
coming.wrap.stop(true, true).trigger('onReset').remove();
|
389
|
-
}
|
390
|
-
|
391
|
-
F.coming = null;
|
392
|
-
|
393
|
-
// If the first item has been canceled, then clear everything
|
394
|
-
if (!F.current) {
|
395
|
-
F._afterZoomOut( coming );
|
396
|
-
}
|
397
|
-
},
|
398
|
-
|
399
|
-
// Start closing animation if is open; remove immediately if opening/closing
|
400
|
-
close: function (event) {
|
401
|
-
F.cancel();
|
402
|
-
|
403
|
-
if (false === F.trigger('beforeClose')) {
|
404
|
-
return;
|
405
|
-
}
|
406
|
-
|
407
|
-
F.unbindEvents();
|
408
|
-
|
409
|
-
if (!F.isActive) {
|
410
|
-
return;
|
411
|
-
}
|
412
|
-
|
413
|
-
if (!F.isOpen || event === true) {
|
414
|
-
$('.fancybox-wrap').stop(true).trigger('onReset').remove();
|
415
|
-
|
416
|
-
F._afterZoomOut();
|
417
|
-
|
418
|
-
} else {
|
419
|
-
F.isOpen = F.isOpened = false;
|
420
|
-
F.isClosing = true;
|
421
|
-
|
422
|
-
$('.fancybox-item, .fancybox-nav').remove();
|
423
|
-
|
424
|
-
F.wrap.stop(true, true).removeClass('fancybox-opened');
|
425
|
-
|
426
|
-
F.transitions[ F.current.closeMethod ]();
|
427
|
-
}
|
428
|
-
},
|
429
|
-
|
430
|
-
// Manage slideshow:
|
431
|
-
// $.fancybox.play(); - toggle slideshow
|
432
|
-
// $.fancybox.play( true ); - start
|
433
|
-
// $.fancybox.play( false ); - stop
|
434
|
-
play: function ( action ) {
|
435
|
-
var clear = function () {
|
436
|
-
clearTimeout(F.player.timer);
|
437
|
-
},
|
438
|
-
set = function () {
|
439
|
-
clear();
|
440
|
-
|
441
|
-
if (F.current && F.player.isActive) {
|
442
|
-
F.player.timer = setTimeout(F.next, F.current.playSpeed);
|
443
|
-
}
|
444
|
-
},
|
445
|
-
stop = function () {
|
446
|
-
clear();
|
447
|
-
|
448
|
-
D.unbind('.player');
|
449
|
-
|
450
|
-
F.player.isActive = false;
|
451
|
-
|
452
|
-
F.trigger('onPlayEnd');
|
453
|
-
},
|
454
|
-
start = function () {
|
455
|
-
if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) {
|
456
|
-
F.player.isActive = true;
|
457
|
-
|
458
|
-
D.bind({
|
459
|
-
'onCancel.player beforeClose.player' : stop,
|
460
|
-
'onUpdate.player' : set,
|
461
|
-
'beforeLoad.player' : clear
|
462
|
-
});
|
463
|
-
|
464
|
-
set();
|
465
|
-
|
466
|
-
F.trigger('onPlayStart');
|
467
|
-
}
|
468
|
-
};
|
469
|
-
|
470
|
-
if (action === true || (!F.player.isActive && action !== false)) {
|
471
|
-
start();
|
472
|
-
} else {
|
473
|
-
stop();
|
474
|
-
}
|
475
|
-
},
|
476
|
-
|
477
|
-
// Navigate to next gallery item
|
478
|
-
next: function ( direction ) {
|
479
|
-
var current = F.current;
|
480
|
-
|
481
|
-
if (current) {
|
482
|
-
if (!isString(direction)) {
|
483
|
-
direction = current.direction.next;
|
484
|
-
}
|
485
|
-
|
486
|
-
F.jumpto(current.index + 1, direction, 'next');
|
487
|
-
}
|
488
|
-
},
|
489
|
-
|
490
|
-
// Navigate to previous gallery item
|
491
|
-
prev: function ( direction ) {
|
492
|
-
var current = F.current;
|
493
|
-
|
494
|
-
if (current) {
|
495
|
-
if (!isString(direction)) {
|
496
|
-
direction = current.direction.prev;
|
497
|
-
}
|
498
|
-
|
499
|
-
F.jumpto(current.index - 1, direction, 'prev');
|
500
|
-
}
|
501
|
-
},
|
502
|
-
|
503
|
-
// Navigate to gallery item by index
|
504
|
-
jumpto: function ( index, direction, router ) {
|
505
|
-
var current = F.current;
|
506
|
-
|
507
|
-
if (!current) {
|
508
|
-
return;
|
509
|
-
}
|
510
|
-
|
511
|
-
index = getScalar(index);
|
512
|
-
|
513
|
-
F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ];
|
514
|
-
F.router = router || 'jumpto';
|
515
|
-
|
516
|
-
if (current.loop) {
|
517
|
-
if (index < 0) {
|
518
|
-
index = current.group.length + (index % current.group.length);
|
519
|
-
}
|
520
|
-
|
521
|
-
index = index % current.group.length;
|
522
|
-
}
|
523
|
-
|
524
|
-
if (current.group[ index ] !== undefined) {
|
525
|
-
F.cancel();
|
526
|
-
|
527
|
-
F._start(index);
|
528
|
-
}
|
529
|
-
},
|
530
|
-
|
531
|
-
// Center inside viewport and toggle position type to fixed or absolute if needed
|
532
|
-
reposition: function (e, onlyAbsolute) {
|
533
|
-
var current = F.current,
|
534
|
-
wrap = current ? current.wrap : null,
|
535
|
-
pos;
|
536
|
-
|
537
|
-
if (wrap) {
|
538
|
-
pos = F._getPosition(onlyAbsolute);
|
539
|
-
|
540
|
-
if (e && e.type === 'scroll') {
|
541
|
-
delete pos.position;
|
542
|
-
|
543
|
-
wrap.stop(true, true).animate(pos, 200);
|
544
|
-
|
545
|
-
} else {
|
546
|
-
wrap.css(pos);
|
547
|
-
|
548
|
-
current.pos = $.extend({}, current.dim, pos);
|
549
|
-
}
|
550
|
-
}
|
551
|
-
},
|
552
|
-
|
553
|
-
update: function (e) {
|
554
|
-
var type = (e && e.originalEvent && e.originalEvent.type),
|
555
|
-
anyway = !type || type === 'orientationchange';
|
556
|
-
|
557
|
-
if (anyway) {
|
558
|
-
clearTimeout(didUpdate);
|
559
|
-
|
560
|
-
didUpdate = null;
|
561
|
-
}
|
562
|
-
|
563
|
-
if (!F.isOpen || didUpdate) {
|
564
|
-
return;
|
565
|
-
}
|
566
|
-
|
567
|
-
didUpdate = setTimeout(function() {
|
568
|
-
var current = F.current;
|
569
|
-
|
570
|
-
if (!current || F.isClosing) {
|
571
|
-
return;
|
572
|
-
}
|
573
|
-
|
574
|
-
F.wrap.removeClass('fancybox-tmp');
|
575
|
-
|
576
|
-
if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) {
|
577
|
-
F._setDimension();
|
578
|
-
}
|
579
|
-
|
580
|
-
if (!(type === 'scroll' && current.canShrink)) {
|
581
|
-
F.reposition(e);
|
582
|
-
}
|
583
|
-
|
584
|
-
F.trigger('onUpdate');
|
585
|
-
|
586
|
-
didUpdate = null;
|
587
|
-
|
588
|
-
}, (anyway && !isTouch ? 0 : 300));
|
589
|
-
},
|
590
|
-
|
591
|
-
// Shrink content to fit inside viewport or restore if resized
|
592
|
-
toggle: function ( action ) {
|
593
|
-
if (F.isOpen) {
|
594
|
-
F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView;
|
595
|
-
|
596
|
-
// Help browser to restore document dimensions
|
597
|
-
if (isTouch) {
|
598
|
-
F.wrap.removeAttr('style').addClass('fancybox-tmp');
|
599
|
-
|
600
|
-
F.trigger('onUpdate');
|
601
|
-
}
|
602
|
-
|
603
|
-
F.update();
|
604
|
-
}
|
605
|
-
},
|
606
|
-
|
607
|
-
hideLoading: function () {
|
608
|
-
D.unbind('.loading');
|
609
|
-
|
610
|
-
$('#fancybox-loading').remove();
|
611
|
-
},
|
612
|
-
|
613
|
-
showLoading: function () {
|
614
|
-
var el, viewport;
|
615
|
-
|
616
|
-
F.hideLoading();
|
617
|
-
|
618
|
-
el = $(F.opts.tpl.loading).click(F.cancel).appendTo('body');
|
619
|
-
|
620
|
-
// If user will press the escape-button, the request will be canceled
|
621
|
-
D.bind('keydown.loading', function(e) {
|
622
|
-
if ((e.which || e.keyCode) === 27) {
|
623
|
-
e.preventDefault();
|
624
|
-
|
625
|
-
F.cancel();
|
626
|
-
}
|
627
|
-
});
|
628
|
-
|
629
|
-
if (!F.defaults.fixed) {
|
630
|
-
viewport = F.getViewport();
|
631
|
-
|
632
|
-
el.css({
|
633
|
-
position : 'absolute',
|
634
|
-
top : (viewport.h * 0.5) + viewport.y,
|
635
|
-
left : (viewport.w * 0.5) + viewport.x
|
636
|
-
});
|
637
|
-
}
|
638
|
-
|
639
|
-
F.trigger('onLoading');
|
640
|
-
},
|
641
|
-
|
642
|
-
getViewport: function () {
|
643
|
-
var locked = (F.current && F.current.locked) || false,
|
644
|
-
rez = {
|
645
|
-
x: W.scrollLeft(),
|
646
|
-
y: W.scrollTop()
|
647
|
-
};
|
648
|
-
|
649
|
-
if (locked && locked.length) {
|
650
|
-
rez.w = locked[0].clientWidth;
|
651
|
-
rez.h = locked[0].clientHeight;
|
652
|
-
|
653
|
-
} else {
|
654
|
-
// See http://bugs.jquery.com/ticket/6724
|
655
|
-
rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width();
|
656
|
-
rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height();
|
657
|
-
}
|
658
|
-
|
659
|
-
return rez;
|
660
|
-
},
|
661
|
-
|
662
|
-
// Unbind the keyboard / clicking actions
|
663
|
-
unbindEvents: function () {
|
664
|
-
if (F.wrap && isQuery(F.wrap)) {
|
665
|
-
F.wrap.unbind('.fb');
|
666
|
-
}
|
667
|
-
|
668
|
-
D.unbind('.fb');
|
669
|
-
W.unbind('.fb');
|
670
|
-
},
|
671
|
-
|
672
|
-
bindEvents: function () {
|
673
|
-
var current = F.current,
|
674
|
-
keys;
|
675
|
-
|
676
|
-
if (!current) {
|
677
|
-
return;
|
678
|
-
}
|
679
|
-
|
680
|
-
// Changing document height on iOS devices triggers a 'resize' event,
|
681
|
-
// that can change document height... repeating infinitely
|
682
|
-
W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update);
|
683
|
-
|
684
|
-
keys = current.keys;
|
685
|
-
|
686
|
-
if (keys) {
|
687
|
-
D.bind('keydown.fb', function (e) {
|
688
|
-
var code = e.which || e.keyCode,
|
689
|
-
target = e.target || e.srcElement;
|
690
|
-
|
691
|
-
// Skip esc key if loading, because showLoading will cancel preloading
|
692
|
-
if (code === 27 && F.coming) {
|
693
|
-
return false;
|
694
|
-
}
|
695
|
-
|
696
|
-
// Ignore key combinations and key events within form elements
|
697
|
-
if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
|
698
|
-
$.each(keys, function(i, val) {
|
699
|
-
if (current.group.length > 1 && val[ code ] !== undefined) {
|
700
|
-
F[ i ]( val[ code ] );
|
701
|
-
|
702
|
-
e.preventDefault();
|
703
|
-
return false;
|
704
|
-
}
|
705
|
-
|
706
|
-
if ($.inArray(code, val) > -1) {
|
707
|
-
F[ i ] ();
|
708
|
-
|
709
|
-
e.preventDefault();
|
710
|
-
return false;
|
711
|
-
}
|
712
|
-
});
|
713
|
-
}
|
714
|
-
});
|
715
|
-
}
|
716
|
-
|
717
|
-
if ($.fn.mousewheel && current.mouseWheel) {
|
718
|
-
F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) {
|
719
|
-
var target = e.target || null,
|
720
|
-
parent = $(target),
|
721
|
-
canScroll = false;
|
722
|
-
|
723
|
-
while (parent.length) {
|
724
|
-
if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) {
|
725
|
-
break;
|
726
|
-
}
|
727
|
-
|
728
|
-
canScroll = isScrollable( parent[0] );
|
729
|
-
parent = $(parent).parent();
|
730
|
-
}
|
731
|
-
|
732
|
-
if (delta !== 0 && !canScroll) {
|
733
|
-
if (F.group.length > 1 && !current.canShrink) {
|
734
|
-
if (deltaY > 0 || deltaX > 0) {
|
735
|
-
F.prev( deltaY > 0 ? 'down' : 'left' );
|
736
|
-
|
737
|
-
} else if (deltaY < 0 || deltaX < 0) {
|
738
|
-
F.next( deltaY < 0 ? 'up' : 'right' );
|
739
|
-
}
|
740
|
-
|
741
|
-
e.preventDefault();
|
742
|
-
}
|
743
|
-
}
|
744
|
-
});
|
745
|
-
}
|
746
|
-
},
|
747
|
-
|
748
|
-
trigger: function (event, o) {
|
749
|
-
var ret, obj = o || F.coming || F.current;
|
750
|
-
|
751
|
-
if (obj) {
|
752
|
-
if ($.isFunction( obj[event] )) {
|
753
|
-
ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1));
|
754
|
-
}
|
755
|
-
|
756
|
-
if (ret === false) {
|
757
|
-
return false;
|
758
|
-
}
|
759
|
-
|
760
|
-
if (obj.helpers) {
|
761
|
-
$.each(obj.helpers, function (helper, opts) {
|
762
|
-
if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) {
|
763
|
-
F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj);
|
764
|
-
}
|
765
|
-
});
|
766
|
-
}
|
767
|
-
}
|
768
|
-
|
769
|
-
D.trigger(event);
|
770
|
-
},
|
771
|
-
|
772
|
-
isImage: function (str) {
|
773
|
-
return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
|
774
|
-
},
|
775
|
-
|
776
|
-
isSWF: function (str) {
|
777
|
-
return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i);
|
778
|
-
},
|
779
|
-
|
780
|
-
_start: function (index) {
|
781
|
-
var coming = {},
|
782
|
-
obj,
|
783
|
-
href,
|
784
|
-
type,
|
785
|
-
margin,
|
786
|
-
padding;
|
787
|
-
|
788
|
-
index = getScalar( index );
|
789
|
-
obj = F.group[ index ] || null;
|
790
|
-
|
791
|
-
if (!obj) {
|
792
|
-
return false;
|
793
|
-
}
|
794
|
-
|
795
|
-
coming = $.extend(true, {}, F.opts, obj);
|
796
|
-
|
797
|
-
// Convert margin and padding properties to array - top, right, bottom, left
|
798
|
-
margin = coming.margin;
|
799
|
-
padding = coming.padding;
|
800
|
-
|
801
|
-
if ($.type(margin) === 'number') {
|
802
|
-
coming.margin = [margin, margin, margin, margin];
|
803
|
-
}
|
804
|
-
|
805
|
-
if ($.type(padding) === 'number') {
|
806
|
-
coming.padding = [padding, padding, padding, padding];
|
807
|
-
}
|
808
|
-
|
809
|
-
// 'modal' propery is just a shortcut
|
810
|
-
if (coming.modal) {
|
811
|
-
$.extend(true, coming, {
|
812
|
-
closeBtn : false,
|
813
|
-
closeClick : false,
|
814
|
-
nextClick : false,
|
815
|
-
arrows : false,
|
816
|
-
mouseWheel : false,
|
817
|
-
keys : null,
|
818
|
-
helpers: {
|
819
|
-
overlay : {
|
820
|
-
closeClick : false
|
821
|
-
}
|
822
|
-
}
|
823
|
-
});
|
824
|
-
}
|
825
|
-
|
826
|
-
// 'autoSize' property is a shortcut, too
|
827
|
-
if (coming.autoSize) {
|
828
|
-
coming.autoWidth = coming.autoHeight = true;
|
829
|
-
}
|
830
|
-
|
831
|
-
if (coming.width === 'auto') {
|
832
|
-
coming.autoWidth = true;
|
833
|
-
}
|
834
|
-
|
835
|
-
if (coming.height === 'auto') {
|
836
|
-
coming.autoHeight = true;
|
837
|
-
}
|
838
|
-
|
839
|
-
/*
|
840
|
-
* Add reference to the group, so it`s possible to access from callbacks, example:
|
841
|
-
* afterLoad : function() {
|
842
|
-
* this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
|
843
|
-
* }
|
844
|
-
*/
|
845
|
-
|
846
|
-
coming.group = F.group;
|
847
|
-
coming.index = index;
|
848
|
-
|
849
|
-
// Give a chance for callback or helpers to update coming item (type, title, etc)
|
850
|
-
F.coming = coming;
|
851
|
-
|
852
|
-
if (false === F.trigger('beforeLoad')) {
|
853
|
-
F.coming = null;
|
854
|
-
|
855
|
-
return;
|
856
|
-
}
|
857
|
-
|
858
|
-
type = coming.type;
|
859
|
-
href = coming.href;
|
860
|
-
|
861
|
-
if (!type) {
|
862
|
-
F.coming = null;
|
863
|
-
|
864
|
-
//If we can not determine content type then drop silently or display next/prev item if looping through gallery
|
865
|
-
if (F.current && F.router && F.router !== 'jumpto') {
|
866
|
-
F.current.index = index;
|
867
|
-
|
868
|
-
return F[ F.router ]( F.direction );
|
869
|
-
}
|
870
|
-
|
871
|
-
return false;
|
872
|
-
}
|
873
|
-
|
874
|
-
F.isActive = true;
|
875
|
-
|
876
|
-
if (type === 'image' || type === 'swf') {
|
877
|
-
coming.autoHeight = coming.autoWidth = false;
|
878
|
-
coming.scrolling = 'visible';
|
879
|
-
}
|
880
|
-
|
881
|
-
if (type === 'image') {
|
882
|
-
coming.aspectRatio = true;
|
883
|
-
}
|
884
|
-
|
885
|
-
if (type === 'iframe' && isTouch) {
|
886
|
-
coming.scrolling = 'scroll';
|
887
|
-
}
|
888
|
-
|
889
|
-
// Build the neccessary markup
|
890
|
-
coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' );
|
891
|
-
|
892
|
-
$.extend(coming, {
|
893
|
-
skin : $('.fancybox-skin', coming.wrap),
|
894
|
-
outer : $('.fancybox-outer', coming.wrap),
|
895
|
-
inner : $('.fancybox-inner', coming.wrap)
|
896
|
-
});
|
897
|
-
|
898
|
-
$.each(["Top", "Right", "Bottom", "Left"], function(i, v) {
|
899
|
-
coming.skin.css('padding' + v, getValue(coming.padding[ i ]));
|
900
|
-
});
|
901
|
-
|
902
|
-
F.trigger('onReady');
|
903
|
-
|
904
|
-
// Check before try to load; 'inline' and 'html' types need content, others - href
|
905
|
-
if (type === 'inline' || type === 'html') {
|
906
|
-
if (!coming.content || !coming.content.length) {
|
907
|
-
return F._error( 'content' );
|
908
|
-
}
|
909
|
-
|
910
|
-
} else if (!href) {
|
911
|
-
return F._error( 'href' );
|
912
|
-
}
|
913
|
-
|
914
|
-
if (type === 'image') {
|
915
|
-
F._loadImage();
|
916
|
-
|
917
|
-
} else if (type === 'ajax') {
|
918
|
-
F._loadAjax();
|
919
|
-
|
920
|
-
} else if (type === 'iframe') {
|
921
|
-
F._loadIframe();
|
922
|
-
|
923
|
-
} else {
|
924
|
-
F._afterLoad();
|
925
|
-
}
|
926
|
-
},
|
927
|
-
|
928
|
-
_error: function ( type ) {
|
929
|
-
$.extend(F.coming, {
|
930
|
-
type : 'html',
|
931
|
-
autoWidth : true,
|
932
|
-
autoHeight : true,
|
933
|
-
minWidth : 0,
|
934
|
-
minHeight : 0,
|
935
|
-
scrolling : 'no',
|
936
|
-
hasError : type,
|
937
|
-
content : F.coming.tpl.error
|
938
|
-
});
|
939
|
-
|
940
|
-
F._afterLoad();
|
941
|
-
},
|
942
|
-
|
943
|
-
_loadImage: function () {
|
944
|
-
// Reset preload image so it is later possible to check "complete" property
|
945
|
-
var img = F.imgPreload = new Image();
|
946
|
-
|
947
|
-
img.onload = function () {
|
948
|
-
this.onload = this.onerror = null;
|
949
|
-
|
950
|
-
F.coming.width = this.width / F.opts.pixelRatio;
|
951
|
-
F.coming.height = this.height / F.opts.pixelRatio;
|
952
|
-
|
953
|
-
F._afterLoad();
|
954
|
-
};
|
955
|
-
|
956
|
-
img.onerror = function () {
|
957
|
-
this.onload = this.onerror = null;
|
958
|
-
|
959
|
-
F._error( 'image' );
|
960
|
-
};
|
961
|
-
|
962
|
-
img.src = F.coming.href;
|
963
|
-
|
964
|
-
if (img.complete !== true) {
|
965
|
-
F.showLoading();
|
966
|
-
}
|
967
|
-
},
|
968
|
-
|
969
|
-
_loadAjax: function () {
|
970
|
-
var coming = F.coming;
|
971
|
-
|
972
|
-
F.showLoading();
|
973
|
-
|
974
|
-
F.ajaxLoad = $.ajax($.extend({}, coming.ajax, {
|
975
|
-
url: coming.href,
|
976
|
-
error: function (jqXHR, textStatus) {
|
977
|
-
if (F.coming && textStatus !== 'abort') {
|
978
|
-
F._error( 'ajax', jqXHR );
|
979
|
-
|
980
|
-
} else {
|
981
|
-
F.hideLoading();
|
982
|
-
}
|
983
|
-
},
|
984
|
-
success: function (data, textStatus) {
|
985
|
-
if (textStatus === 'success') {
|
986
|
-
coming.content = data;
|
987
|
-
|
988
|
-
F._afterLoad();
|
989
|
-
}
|
990
|
-
}
|
991
|
-
}));
|
992
|
-
},
|
993
|
-
|
994
|
-
_loadIframe: function() {
|
995
|
-
var coming = F.coming,
|
996
|
-
iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime()))
|
997
|
-
.attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling)
|
998
|
-
.attr('src', coming.href);
|
999
|
-
|
1000
|
-
// This helps IE
|
1001
|
-
$(coming.wrap).bind('onReset', function () {
|
1002
|
-
try {
|
1003
|
-
$(this).find('iframe').hide().attr('src', '//about:blank').end().empty();
|
1004
|
-
} catch (e) {}
|
1005
|
-
});
|
1006
|
-
|
1007
|
-
if (coming.iframe.preload) {
|
1008
|
-
F.showLoading();
|
1009
|
-
|
1010
|
-
iframe.one('load', function() {
|
1011
|
-
$(this).data('ready', 1);
|
1012
|
-
|
1013
|
-
// iOS will lose scrolling if we resize
|
1014
|
-
if (!isTouch) {
|
1015
|
-
$(this).bind('load.fb', F.update);
|
1016
|
-
}
|
1017
|
-
|
1018
|
-
// Without this trick:
|
1019
|
-
// - iframe won't scroll on iOS devices
|
1020
|
-
// - IE7 sometimes displays empty iframe
|
1021
|
-
$(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show();
|
1022
|
-
|
1023
|
-
F._afterLoad();
|
1024
|
-
});
|
1025
|
-
}
|
1026
|
-
|
1027
|
-
coming.content = iframe.appendTo( coming.inner );
|
1028
|
-
|
1029
|
-
if (!coming.iframe.preload) {
|
1030
|
-
F._afterLoad();
|
1031
|
-
}
|
1032
|
-
},
|
1033
|
-
|
1034
|
-
_preloadImages: function() {
|
1035
|
-
var group = F.group,
|
1036
|
-
current = F.current,
|
1037
|
-
len = group.length,
|
1038
|
-
cnt = current.preload ? Math.min(current.preload, len - 1) : 0,
|
1039
|
-
item,
|
1040
|
-
i;
|
1041
|
-
|
1042
|
-
for (i = 1; i <= cnt; i += 1) {
|
1043
|
-
item = group[ (current.index + i ) % len ];
|
1044
|
-
|
1045
|
-
if (item.type === 'image' && item.href) {
|
1046
|
-
new Image().src = item.href;
|
1047
|
-
}
|
1048
|
-
}
|
1049
|
-
},
|
1050
|
-
|
1051
|
-
_afterLoad: function () {
|
1052
|
-
var coming = F.coming,
|
1053
|
-
previous = F.current,
|
1054
|
-
placeholder = 'fancybox-placeholder',
|
1055
|
-
current,
|
1056
|
-
content,
|
1057
|
-
type,
|
1058
|
-
scrolling,
|
1059
|
-
href,
|
1060
|
-
embed;
|
1061
|
-
|
1062
|
-
F.hideLoading();
|
1063
|
-
|
1064
|
-
if (!coming || F.isActive === false) {
|
1065
|
-
return;
|
1066
|
-
}
|
1067
|
-
|
1068
|
-
if (false === F.trigger('afterLoad', coming, previous)) {
|
1069
|
-
coming.wrap.stop(true).trigger('onReset').remove();
|
1070
|
-
|
1071
|
-
F.coming = null;
|
1072
|
-
|
1073
|
-
return;
|
1074
|
-
}
|
1075
|
-
|
1076
|
-
if (previous) {
|
1077
|
-
F.trigger('beforeChange', previous);
|
1078
|
-
|
1079
|
-
previous.wrap.stop(true).removeClass('fancybox-opened')
|
1080
|
-
.find('.fancybox-item, .fancybox-nav')
|
1081
|
-
.remove();
|
1082
|
-
}
|
1083
|
-
|
1084
|
-
F.unbindEvents();
|
1085
|
-
|
1086
|
-
current = coming;
|
1087
|
-
content = coming.content;
|
1088
|
-
type = coming.type;
|
1089
|
-
scrolling = coming.scrolling;
|
1090
|
-
|
1091
|
-
$.extend(F, {
|
1092
|
-
wrap : current.wrap,
|
1093
|
-
skin : current.skin,
|
1094
|
-
outer : current.outer,
|
1095
|
-
inner : current.inner,
|
1096
|
-
current : current,
|
1097
|
-
previous : previous
|
1098
|
-
});
|
1099
|
-
|
1100
|
-
href = current.href;
|
1101
|
-
|
1102
|
-
switch (type) {
|
1103
|
-
case 'inline':
|
1104
|
-
case 'ajax':
|
1105
|
-
case 'html':
|
1106
|
-
if (current.selector) {
|
1107
|
-
content = $('<div>').html(content).find(current.selector);
|
1108
|
-
|
1109
|
-
} else if (isQuery(content)) {
|
1110
|
-
if (!content.data(placeholder)) {
|
1111
|
-
content.data(placeholder, $('<div class="' + placeholder + '"></div>').insertAfter( content ).hide() );
|
1112
|
-
}
|
1113
|
-
|
1114
|
-
content = content.show().detach();
|
1115
|
-
|
1116
|
-
current.wrap.bind('onReset', function () {
|
1117
|
-
if ($(this).find(content).length) {
|
1118
|
-
content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false);
|
1119
|
-
}
|
1120
|
-
});
|
1121
|
-
}
|
1122
|
-
break;
|
1123
|
-
|
1124
|
-
case 'image':
|
1125
|
-
content = current.tpl.image.replace(/\{href\}/g, href);
|
1126
|
-
break;
|
1127
|
-
|
1128
|
-
case 'swf':
|
1129
|
-
content = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="../../cards/source/' + href + '"></param>';
|
1130
|
-
embed = '';
|
1131
|
-
|
1132
|
-
$.each(current.swf, function(name, val) {
|
1133
|
-
content += '<param name="' + name + '" value="' + val + '"></param>';
|
1134
|
-
embed += ' ' + name + '="' + val + '"';
|
1135
|
-
});
|
1136
|
-
|
1137
|
-
content += '<embed src="' + href + '" type="application/x-shockwave-flash" width="100%" height="100%"' + embed + '></embed></object>';
|
1138
|
-
break;
|
1139
|
-
}
|
1140
|
-
|
1141
|
-
if (!(isQuery(content) && content.parent().is(current.inner))) {
|
1142
|
-
current.inner.append( content );
|
1143
|
-
}
|
1144
|
-
|
1145
|
-
// Give a chance for helpers or callbacks to update elements
|
1146
|
-
F.trigger('beforeShow');
|
1147
|
-
|
1148
|
-
// Set scrolling before calculating dimensions
|
1149
|
-
current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling));
|
1150
|
-
|
1151
|
-
// Set initial dimensions and start position
|
1152
|
-
F._setDimension();
|
1153
|
-
|
1154
|
-
F.reposition();
|
1155
|
-
|
1156
|
-
F.isOpen = false;
|
1157
|
-
F.coming = null;
|
1158
|
-
|
1159
|
-
F.bindEvents();
|
1160
|
-
|
1161
|
-
if (!F.isOpened) {
|
1162
|
-
$('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove();
|
1163
|
-
|
1164
|
-
} else if (previous.prevMethod) {
|
1165
|
-
F.transitions[ previous.prevMethod ]();
|
1166
|
-
}
|
1167
|
-
|
1168
|
-
F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ]();
|
1169
|
-
|
1170
|
-
F._preloadImages();
|
1171
|
-
},
|
1172
|
-
|
1173
|
-
_setDimension: function () {
|
1174
|
-
var viewport = F.getViewport(),
|
1175
|
-
steps = 0,
|
1176
|
-
canShrink = false,
|
1177
|
-
canExpand = false,
|
1178
|
-
wrap = F.wrap,
|
1179
|
-
skin = F.skin,
|
1180
|
-
inner = F.inner,
|
1181
|
-
current = F.current,
|
1182
|
-
width = current.width,
|
1183
|
-
height = current.height,
|
1184
|
-
minWidth = current.minWidth,
|
1185
|
-
minHeight = current.minHeight,
|
1186
|
-
maxWidth = current.maxWidth,
|
1187
|
-
maxHeight = current.maxHeight,
|
1188
|
-
scrolling = current.scrolling,
|
1189
|
-
scrollOut = current.scrollOutside ? current.scrollbarWidth : 0,
|
1190
|
-
margin = current.margin,
|
1191
|
-
wMargin = getScalar(margin[1] + margin[3]),
|
1192
|
-
hMargin = getScalar(margin[0] + margin[2]),
|
1193
|
-
wPadding,
|
1194
|
-
hPadding,
|
1195
|
-
wSpace,
|
1196
|
-
hSpace,
|
1197
|
-
origWidth,
|
1198
|
-
origHeight,
|
1199
|
-
origMaxWidth,
|
1200
|
-
origMaxHeight,
|
1201
|
-
ratio,
|
1202
|
-
width_,
|
1203
|
-
height_,
|
1204
|
-
maxWidth_,
|
1205
|
-
maxHeight_,
|
1206
|
-
iframe,
|
1207
|
-
body;
|
1208
|
-
|
1209
|
-
// Reset dimensions so we could re-check actual size
|
1210
|
-
wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp');
|
1211
|
-
|
1212
|
-
wPadding = getScalar(skin.outerWidth(true) - skin.width());
|
1213
|
-
hPadding = getScalar(skin.outerHeight(true) - skin.height());
|
1214
|
-
|
1215
|
-
// Any space between content and viewport (margin, padding, border, title)
|
1216
|
-
wSpace = wMargin + wPadding;
|
1217
|
-
hSpace = hMargin + hPadding;
|
1218
|
-
|
1219
|
-
origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width;
|
1220
|
-
origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height;
|
1221
|
-
|
1222
|
-
if (current.type === 'iframe') {
|
1223
|
-
iframe = current.content;
|
1224
|
-
|
1225
|
-
if (current.autoHeight && iframe && iframe.data('ready') === 1) {
|
1226
|
-
try {
|
1227
|
-
if (iframe[0].contentWindow.document.location) {
|
1228
|
-
inner.width( origWidth ).height(9999);
|
1229
|
-
|
1230
|
-
body = iframe.contents().find('body');
|
1231
|
-
|
1232
|
-
if (scrollOut) {
|
1233
|
-
body.css('overflow-x', 'hidden');
|
1234
|
-
}
|
1235
|
-
|
1236
|
-
origHeight = body.outerHeight(true);
|
1237
|
-
}
|
1238
|
-
|
1239
|
-
} catch (e) {}
|
1240
|
-
}
|
1241
|
-
|
1242
|
-
} else if (current.autoWidth || current.autoHeight) {
|
1243
|
-
inner.addClass( 'fancybox-tmp' );
|
1244
|
-
|
1245
|
-
// Set width or height in case we need to calculate only one dimension
|
1246
|
-
if (!current.autoWidth) {
|
1247
|
-
inner.width( origWidth );
|
1248
|
-
}
|
1249
|
-
|
1250
|
-
if (!current.autoHeight) {
|
1251
|
-
inner.height( origHeight );
|
1252
|
-
}
|
1253
|
-
|
1254
|
-
if (current.autoWidth) {
|
1255
|
-
origWidth = inner.width();
|
1256
|
-
}
|
1257
|
-
|
1258
|
-
if (current.autoHeight) {
|
1259
|
-
origHeight = inner.height();
|
1260
|
-
}
|
1261
|
-
|
1262
|
-
inner.removeClass( 'fancybox-tmp' );
|
1263
|
-
}
|
1264
|
-
|
1265
|
-
width = getScalar( origWidth );
|
1266
|
-
height = getScalar( origHeight );
|
1267
|
-
|
1268
|
-
ratio = origWidth / origHeight;
|
1269
|
-
|
1270
|
-
// Calculations for the content
|
1271
|
-
minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth);
|
1272
|
-
maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth);
|
1273
|
-
|
1274
|
-
minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight);
|
1275
|
-
maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight);
|
1276
|
-
|
1277
|
-
// These will be used to determine if wrap can fit in the viewport
|
1278
|
-
origMaxWidth = maxWidth;
|
1279
|
-
origMaxHeight = maxHeight;
|
1280
|
-
|
1281
|
-
if (current.fitToView) {
|
1282
|
-
maxWidth = Math.min(viewport.w - wSpace, maxWidth);
|
1283
|
-
maxHeight = Math.min(viewport.h - hSpace, maxHeight);
|
1284
|
-
}
|
1285
|
-
|
1286
|
-
maxWidth_ = viewport.w - wMargin;
|
1287
|
-
maxHeight_ = viewport.h - hMargin;
|
1288
|
-
|
1289
|
-
if (current.aspectRatio) {
|
1290
|
-
if (width > maxWidth) {
|
1291
|
-
width = maxWidth;
|
1292
|
-
height = getScalar(width / ratio);
|
1293
|
-
}
|
1294
|
-
|
1295
|
-
if (height > maxHeight) {
|
1296
|
-
height = maxHeight;
|
1297
|
-
width = getScalar(height * ratio);
|
1298
|
-
}
|
1299
|
-
|
1300
|
-
if (width < minWidth) {
|
1301
|
-
width = minWidth;
|
1302
|
-
height = getScalar(width / ratio);
|
1303
|
-
}
|
1304
|
-
|
1305
|
-
if (height < minHeight) {
|
1306
|
-
height = minHeight;
|
1307
|
-
width = getScalar(height * ratio);
|
1308
|
-
}
|
1309
|
-
|
1310
|
-
} else {
|
1311
|
-
width = Math.max(minWidth, Math.min(width, maxWidth));
|
1312
|
-
|
1313
|
-
if (current.autoHeight && current.type !== 'iframe') {
|
1314
|
-
inner.width( width );
|
1315
|
-
|
1316
|
-
height = inner.height();
|
1317
|
-
}
|
1318
|
-
|
1319
|
-
height = Math.max(minHeight, Math.min(height, maxHeight));
|
1320
|
-
}
|
1321
|
-
|
1322
|
-
// Try to fit inside viewport (including the title)
|
1323
|
-
if (current.fitToView) {
|
1324
|
-
inner.width( width ).height( height );
|
1325
|
-
|
1326
|
-
wrap.width( width + wPadding );
|
1327
|
-
|
1328
|
-
// Real wrap dimensions
|
1329
|
-
width_ = wrap.width();
|
1330
|
-
height_ = wrap.height();
|
1331
|
-
|
1332
|
-
if (current.aspectRatio) {
|
1333
|
-
while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) {
|
1334
|
-
if (steps++ > 19) {
|
1335
|
-
break;
|
1336
|
-
}
|
1337
|
-
|
1338
|
-
height = Math.max(minHeight, Math.min(maxHeight, height - 10));
|
1339
|
-
width = getScalar(height * ratio);
|
1340
|
-
|
1341
|
-
if (width < minWidth) {
|
1342
|
-
width = minWidth;
|
1343
|
-
height = getScalar(width / ratio);
|
1344
|
-
}
|
1345
|
-
|
1346
|
-
if (width > maxWidth) {
|
1347
|
-
width = maxWidth;
|
1348
|
-
height = getScalar(width / ratio);
|
1349
|
-
}
|
1350
|
-
|
1351
|
-
inner.width( width ).height( height );
|
1352
|
-
|
1353
|
-
wrap.width( width + wPadding );
|
1354
|
-
|
1355
|
-
width_ = wrap.width();
|
1356
|
-
height_ = wrap.height();
|
1357
|
-
}
|
1358
|
-
|
1359
|
-
} else {
|
1360
|
-
width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_)));
|
1361
|
-
height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_)));
|
1362
|
-
}
|
1363
|
-
}
|
1364
|
-
|
1365
|
-
if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) {
|
1366
|
-
width += scrollOut;
|
1367
|
-
}
|
1368
|
-
|
1369
|
-
inner.width( width ).height( height );
|
1370
|
-
|
1371
|
-
wrap.width( width + wPadding );
|
1372
|
-
|
1373
|
-
width_ = wrap.width();
|
1374
|
-
height_ = wrap.height();
|
1375
|
-
|
1376
|
-
canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight;
|
1377
|
-
canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight));
|
1378
|
-
|
1379
|
-
$.extend(current, {
|
1380
|
-
dim : {
|
1381
|
-
width : getValue( width_ ),
|
1382
|
-
height : getValue( height_ )
|
1383
|
-
},
|
1384
|
-
origWidth : origWidth,
|
1385
|
-
origHeight : origHeight,
|
1386
|
-
canShrink : canShrink,
|
1387
|
-
canExpand : canExpand,
|
1388
|
-
wPadding : wPadding,
|
1389
|
-
hPadding : hPadding,
|
1390
|
-
wrapSpace : height_ - skin.outerHeight(true),
|
1391
|
-
skinSpace : skin.height() - height
|
1392
|
-
});
|
1393
|
-
|
1394
|
-
if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) {
|
1395
|
-
inner.height('auto');
|
1396
|
-
}
|
1397
|
-
},
|
1398
|
-
|
1399
|
-
_getPosition: function (onlyAbsolute) {
|
1400
|
-
var current = F.current,
|
1401
|
-
viewport = F.getViewport(),
|
1402
|
-
margin = current.margin,
|
1403
|
-
width = F.wrap.width() + margin[1] + margin[3],
|
1404
|
-
height = F.wrap.height() + margin[0] + margin[2],
|
1405
|
-
rez = {
|
1406
|
-
position: 'absolute',
|
1407
|
-
top : margin[0],
|
1408
|
-
left : margin[3]
|
1409
|
-
};
|
1410
|
-
|
1411
|
-
if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {
|
1412
|
-
rez.position = 'fixed';
|
1413
|
-
|
1414
|
-
} else if (!current.locked) {
|
1415
|
-
rez.top += viewport.y;
|
1416
|
-
rez.left += viewport.x;
|
1417
|
-
}
|
1418
|
-
|
1419
|
-
rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio)));
|
1420
|
-
rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio)));
|
1421
|
-
|
1422
|
-
return rez;
|
1423
|
-
},
|
1424
|
-
|
1425
|
-
_afterZoomIn: function () {
|
1426
|
-
var current = F.current;
|
1427
|
-
|
1428
|
-
if (!current) {
|
1429
|
-
return;
|
1430
|
-
}
|
1431
|
-
|
1432
|
-
F.isOpen = F.isOpened = true;
|
1433
|
-
|
1434
|
-
F.wrap.css('overflow', 'visible').addClass('fancybox-opened').hide().show(0);
|
1435
|
-
|
1436
|
-
F.update();
|
1437
|
-
|
1438
|
-
// Assign a click event
|
1439
|
-
if ( current.closeClick || (current.nextClick && F.group.length > 1) ) {
|
1440
|
-
F.inner.css('cursor', 'pointer').bind('click.fb', function(e) {
|
1441
|
-
if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {
|
1442
|
-
e.preventDefault();
|
1443
|
-
|
1444
|
-
F[ current.closeClick ? 'close' : 'next' ]();
|
1445
|
-
}
|
1446
|
-
});
|
1447
|
-
}
|
1448
|
-
|
1449
|
-
// Create a close button
|
1450
|
-
if (current.closeBtn) {
|
1451
|
-
$(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) {
|
1452
|
-
e.preventDefault();
|
1453
|
-
|
1454
|
-
F.close();
|
1455
|
-
});
|
1456
|
-
}
|
1457
|
-
|
1458
|
-
// Create navigation arrows
|
1459
|
-
if (current.arrows && F.group.length > 1) {
|
1460
|
-
if (current.loop || current.index > 0) {
|
1461
|
-
$(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev);
|
1462
|
-
}
|
1463
|
-
|
1464
|
-
if (current.loop || current.index < F.group.length - 1) {
|
1465
|
-
$(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next);
|
1466
|
-
}
|
1467
|
-
}
|
1468
|
-
|
1469
|
-
F.trigger('afterShow');
|
1470
|
-
|
1471
|
-
// Stop the slideshow if this is the last item
|
1472
|
-
if (!current.loop && current.index === current.group.length - 1) {
|
1473
|
-
|
1474
|
-
F.play( false );
|
1475
|
-
|
1476
|
-
} else if (F.opts.autoPlay && !F.player.isActive) {
|
1477
|
-
F.opts.autoPlay = false;
|
1478
|
-
|
1479
|
-
F.play(true);
|
1480
|
-
}
|
1481
|
-
},
|
1482
|
-
|
1483
|
-
_afterZoomOut: function ( obj ) {
|
1484
|
-
obj = obj || F.current;
|
1485
|
-
|
1486
|
-
$('.fancybox-wrap').trigger('onReset').remove();
|
1487
|
-
|
1488
|
-
$.extend(F, {
|
1489
|
-
group : {},
|
1490
|
-
opts : {},
|
1491
|
-
router : false,
|
1492
|
-
current : null,
|
1493
|
-
isActive : false,
|
1494
|
-
isOpened : false,
|
1495
|
-
isOpen : false,
|
1496
|
-
isClosing : false,
|
1497
|
-
wrap : null,
|
1498
|
-
skin : null,
|
1499
|
-
outer : null,
|
1500
|
-
inner : null
|
1501
|
-
});
|
1502
|
-
|
1503
|
-
F.trigger('afterClose', obj);
|
1504
|
-
}
|
1505
|
-
});
|
1506
|
-
|
1507
|
-
/*
|
1508
|
-
* Default transitions
|
1509
|
-
*/
|
1510
|
-
|
1511
|
-
F.transitions = {
|
1512
|
-
getOrigPosition: function () {
|
1513
|
-
var current = F.current,
|
1514
|
-
element = current.element,
|
1515
|
-
orig = current.orig,
|
1516
|
-
pos = {},
|
1517
|
-
width = 50,
|
1518
|
-
height = 50,
|
1519
|
-
hPadding = current.hPadding,
|
1520
|
-
wPadding = current.wPadding,
|
1521
|
-
viewport = F.getViewport();
|
1522
|
-
|
1523
|
-
if (!orig && current.isDom && element.is(':visible')) {
|
1524
|
-
orig = element.find('img:first');
|
1525
|
-
|
1526
|
-
if (!orig.length) {
|
1527
|
-
orig = element;
|
1528
|
-
}
|
1529
|
-
}
|
1530
|
-
|
1531
|
-
if (isQuery(orig)) {
|
1532
|
-
pos = orig.offset();
|
1533
|
-
|
1534
|
-
if (orig.is('img')) {
|
1535
|
-
width = orig.outerWidth();
|
1536
|
-
height = orig.outerHeight();
|
1537
|
-
}
|
1538
|
-
|
1539
|
-
} else {
|
1540
|
-
pos.top = viewport.y + (viewport.h - height) * current.topRatio;
|
1541
|
-
pos.left = viewport.x + (viewport.w - width) * current.leftRatio;
|
1542
|
-
}
|
1543
|
-
|
1544
|
-
if (F.wrap.css('position') === 'fixed' || current.locked) {
|
1545
|
-
pos.top -= viewport.y;
|
1546
|
-
pos.left -= viewport.x;
|
1547
|
-
}
|
1548
|
-
|
1549
|
-
pos = {
|
1550
|
-
top : getValue(pos.top - hPadding * current.topRatio),
|
1551
|
-
left : getValue(pos.left - wPadding * current.leftRatio),
|
1552
|
-
width : getValue(width + wPadding),
|
1553
|
-
height : getValue(height + hPadding)
|
1554
|
-
};
|
1555
|
-
|
1556
|
-
return pos;
|
1557
|
-
},
|
1558
|
-
|
1559
|
-
step: function (now, fx) {
|
1560
|
-
var ratio,
|
1561
|
-
padding,
|
1562
|
-
value,
|
1563
|
-
prop = fx.prop,
|
1564
|
-
current = F.current,
|
1565
|
-
wrapSpace = current.wrapSpace,
|
1566
|
-
skinSpace = current.skinSpace;
|
1567
|
-
|
1568
|
-
if (prop === 'width' || prop === 'height') {
|
1569
|
-
ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start);
|
1570
|
-
|
1571
|
-
if (F.isClosing) {
|
1572
|
-
ratio = 1 - ratio;
|
1573
|
-
}
|
1574
|
-
|
1575
|
-
padding = prop === 'width' ? current.wPadding : current.hPadding;
|
1576
|
-
value = now - padding;
|
1577
|
-
|
1578
|
-
F.skin[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) ) );
|
1579
|
-
F.inner[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) );
|
1580
|
-
}
|
1581
|
-
},
|
1582
|
-
|
1583
|
-
zoomIn: function () {
|
1584
|
-
var current = F.current,
|
1585
|
-
startPos = current.pos,
|
1586
|
-
effect = current.openEffect,
|
1587
|
-
elastic = effect === 'elastic',
|
1588
|
-
endPos = $.extend({opacity : 1}, startPos);
|
1589
|
-
|
1590
|
-
// Remove "position" property that breaks older IE
|
1591
|
-
delete endPos.position;
|
1592
|
-
|
1593
|
-
if (elastic) {
|
1594
|
-
startPos = this.getOrigPosition();
|
1595
|
-
|
1596
|
-
if (current.openOpacity) {
|
1597
|
-
startPos.opacity = 0.1;
|
1598
|
-
}
|
1599
|
-
|
1600
|
-
} else if (effect === 'fade') {
|
1601
|
-
startPos.opacity = 0.1;
|
1602
|
-
}
|
1603
|
-
|
1604
|
-
F.wrap.css(startPos).animate(endPos, {
|
1605
|
-
duration : effect === 'none' ? 0 : current.openSpeed,
|
1606
|
-
easing : current.openEasing,
|
1607
|
-
step : elastic ? this.step : null,
|
1608
|
-
complete : F._afterZoomIn
|
1609
|
-
});
|
1610
|
-
},
|
1611
|
-
|
1612
|
-
zoomOut: function () {
|
1613
|
-
var current = F.current,
|
1614
|
-
effect = current.closeEffect,
|
1615
|
-
elastic = effect === 'elastic',
|
1616
|
-
endPos = {opacity : 0.1};
|
1617
|
-
|
1618
|
-
if (elastic) {
|
1619
|
-
endPos = this.getOrigPosition();
|
1620
|
-
|
1621
|
-
if (current.closeOpacity) {
|
1622
|
-
endPos.opacity = 0.1;
|
1623
|
-
}
|
1624
|
-
}
|
1625
|
-
|
1626
|
-
F.wrap.animate(endPos, {
|
1627
|
-
duration : effect === 'none' ? 0 : current.closeSpeed,
|
1628
|
-
easing : current.closeEasing,
|
1629
|
-
step : elastic ? this.step : null,
|
1630
|
-
complete : F._afterZoomOut
|
1631
|
-
});
|
1632
|
-
},
|
1633
|
-
|
1634
|
-
changeIn: function () {
|
1635
|
-
var current = F.current,
|
1636
|
-
effect = current.nextEffect,
|
1637
|
-
startPos = current.pos,
|
1638
|
-
endPos = { opacity : 1 },
|
1639
|
-
direction = F.direction,
|
1640
|
-
distance = 200,
|
1641
|
-
field;
|
1642
|
-
|
1643
|
-
startPos.opacity = 0.1;
|
1644
|
-
|
1645
|
-
if (effect === 'elastic') {
|
1646
|
-
field = direction === 'down' || direction === 'up' ? 'top' : 'left';
|
1647
|
-
|
1648
|
-
if (direction === 'down' || direction === 'right') {
|
1649
|
-
startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance);
|
1650
|
-
endPos[ field ] = '+=' + distance + 'px';
|
1651
|
-
|
1652
|
-
} else {
|
1653
|
-
startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);
|
1654
|
-
endPos[ field ] = '-=' + distance + 'px';
|
1655
|
-
}
|
1656
|
-
}
|
1657
|
-
|
1658
|
-
// Workaround for http://bugs.jquery.com/ticket/12273
|
1659
|
-
if (effect === 'none') {
|
1660
|
-
F._afterZoomIn();
|
1661
|
-
|
1662
|
-
} else {
|
1663
|
-
F.wrap.css(startPos).animate(endPos, {
|
1664
|
-
duration : current.nextSpeed,
|
1665
|
-
easing : current.nextEasing,
|
1666
|
-
complete : F._afterZoomIn
|
1667
|
-
});
|
1668
|
-
}
|
1669
|
-
},
|
1670
|
-
|
1671
|
-
changeOut: function () {
|
1672
|
-
var previous = F.previous,
|
1673
|
-
effect = previous.prevEffect,
|
1674
|
-
endPos = { opacity : 0.1 },
|
1675
|
-
direction = F.direction,
|
1676
|
-
distance = 200;
|
1677
|
-
|
1678
|
-
if (effect === 'elastic') {
|
1679
|
-
endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px';
|
1680
|
-
}
|
1681
|
-
|
1682
|
-
previous.wrap.animate(endPos, {
|
1683
|
-
duration : effect === 'none' ? 0 : previous.prevSpeed,
|
1684
|
-
easing : previous.prevEasing,
|
1685
|
-
complete : function () {
|
1686
|
-
$(this).trigger('onReset').remove();
|
1687
|
-
}
|
1688
|
-
});
|
1689
|
-
}
|
1690
|
-
};
|
1691
|
-
|
1692
|
-
/*
|
1693
|
-
* Overlay helper
|
1694
|
-
*/
|
1695
|
-
|
1696
|
-
F.helpers.overlay = {
|
1697
|
-
defaults : {
|
1698
|
-
closeClick : true, // if true, fancyBox will be closed when user clicks on the overlay
|
1699
|
-
speedOut : 200, // duration of fadeOut animation
|
1700
|
-
showEarly : true, // indicates if should be opened immediately or wait until the content is ready
|
1701
|
-
css : {}, // custom CSS properties
|
1702
|
-
locked : !isTouch, // if true, the content will be locked into overlay
|
1703
|
-
fixed : true // if false, the overlay CSS position property will not be set to "fixed"
|
1704
|
-
},
|
1705
|
-
|
1706
|
-
overlay : null, // current handle
|
1707
|
-
fixed : false, // indicates if the overlay has position "fixed"
|
1708
|
-
el : $('html'), // element that contains "the lock"
|
1709
|
-
|
1710
|
-
// Public methods
|
1711
|
-
create : function(opts) {
|
1712
|
-
var parent;
|
1713
|
-
|
1714
|
-
opts = $.extend({}, this.defaults, opts);
|
1715
|
-
|
1716
|
-
if (this.overlay) {
|
1717
|
-
this.close();
|
1718
|
-
}
|
1719
|
-
|
1720
|
-
parent = F.coming ? F.coming.parent : opts.parent;
|
1721
|
-
|
1722
|
-
this.overlay = $('<div class="fancybox-overlay"></div>').appendTo( parent && parent.length ? parent : 'body' );
|
1723
|
-
this.fixed = false;
|
1724
|
-
|
1725
|
-
if (opts.fixed && F.defaults.fixed) {
|
1726
|
-
this.overlay.addClass('fancybox-overlay-fixed');
|
1727
|
-
|
1728
|
-
this.fixed = true;
|
1729
|
-
}
|
1730
|
-
},
|
1731
|
-
|
1732
|
-
open : function(opts) {
|
1733
|
-
var that = this;
|
1734
|
-
|
1735
|
-
opts = $.extend({}, this.defaults, opts);
|
1736
|
-
|
1737
|
-
if (this.overlay) {
|
1738
|
-
this.overlay.unbind('.overlay').width('auto').height('auto');
|
1739
|
-
|
1740
|
-
} else {
|
1741
|
-
this.create(opts);
|
1742
|
-
}
|
1743
|
-
|
1744
|
-
if (!this.fixed) {
|
1745
|
-
W.bind('resize.overlay', $.proxy( this.update, this) );
|
1746
|
-
|
1747
|
-
this.update();
|
1748
|
-
}
|
1749
|
-
|
1750
|
-
if (opts.closeClick) {
|
1751
|
-
this.overlay.bind('click.overlay', function(e) {
|
1752
|
-
if ($(e.target).hasClass('fancybox-overlay')) {
|
1753
|
-
if (F.isActive) {
|
1754
|
-
F.close();
|
1755
|
-
} else {
|
1756
|
-
that.close();
|
1757
|
-
}
|
1758
|
-
|
1759
|
-
return false;
|
1760
|
-
}
|
1761
|
-
});
|
1762
|
-
}
|
1763
|
-
|
1764
|
-
this.overlay.css( opts.css ).show();
|
1765
|
-
},
|
1766
|
-
|
1767
|
-
close : function() {
|
1768
|
-
W.unbind('resize.overlay');
|
1769
|
-
|
1770
|
-
if (this.el.hasClass('fancybox-lock')) {
|
1771
|
-
$('.fancybox-margin').removeClass('fancybox-margin');
|
1772
|
-
|
1773
|
-
this.el.removeClass('fancybox-lock');
|
1774
|
-
|
1775
|
-
W.scrollTop( this.scrollV ).scrollLeft( this.scrollH );
|
1776
|
-
}
|
1777
|
-
|
1778
|
-
$('.fancybox-overlay').remove().hide();
|
1779
|
-
|
1780
|
-
$.extend(this, {
|
1781
|
-
overlay : null,
|
1782
|
-
fixed : false
|
1783
|
-
});
|
1784
|
-
},
|
1785
|
-
|
1786
|
-
// Private, callbacks
|
1787
|
-
|
1788
|
-
update : function () {
|
1789
|
-
var width = '100%', offsetWidth;
|
1790
|
-
|
1791
|
-
// Reset width/height so it will not mess
|
1792
|
-
this.overlay.width(width).height('100%');
|
1793
|
-
|
1794
|
-
// jQuery does not return reliable result for IE
|
1795
|
-
if (IE) {
|
1796
|
-
offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);
|
1797
|
-
|
1798
|
-
if (D.width() > offsetWidth) {
|
1799
|
-
width = D.width();
|
1800
|
-
}
|
1801
|
-
|
1802
|
-
} else if (D.width() > W.width()) {
|
1803
|
-
width = D.width();
|
1804
|
-
}
|
1805
|
-
|
1806
|
-
this.overlay.width(width).height(D.height());
|
1807
|
-
},
|
1808
|
-
|
1809
|
-
// This is where we can manipulate DOM, because later it would cause iframes to reload
|
1810
|
-
onReady : function (opts, obj) {
|
1811
|
-
var overlay = this.overlay;
|
1812
|
-
|
1813
|
-
$('.fancybox-overlay').stop(true, true);
|
1814
|
-
|
1815
|
-
if (!overlay) {
|
1816
|
-
this.create(opts);
|
1817
|
-
}
|
1818
|
-
|
1819
|
-
if (opts.locked && this.fixed && obj.fixed) {
|
1820
|
-
obj.locked = this.overlay.append( obj.wrap );
|
1821
|
-
obj.fixed = false;
|
1822
|
-
}
|
1823
|
-
|
1824
|
-
if (opts.showEarly === true) {
|
1825
|
-
this.beforeShow.apply(this, arguments);
|
1826
|
-
}
|
1827
|
-
},
|
1828
|
-
|
1829
|
-
beforeShow : function(opts, obj) {
|
1830
|
-
if (obj.locked && !this.el.hasClass('fancybox-lock')) {
|
1831
|
-
if (this.fixPosition !== false) {
|
1832
|
-
$('*:not(object)').filter(function(){
|
1833
|
-
return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") );
|
1834
|
-
}).addClass('fancybox-margin');
|
1835
|
-
}
|
1836
|
-
|
1837
|
-
this.el.addClass('fancybox-margin');
|
1838
|
-
|
1839
|
-
this.scrollV = W.scrollTop();
|
1840
|
-
this.scrollH = W.scrollLeft();
|
1841
|
-
|
1842
|
-
this.el.addClass('fancybox-lock');
|
1843
|
-
|
1844
|
-
W.scrollTop( this.scrollV ).scrollLeft( this.scrollH );
|
1845
|
-
}
|
1846
|
-
|
1847
|
-
this.open(opts);
|
1848
|
-
},
|
1849
|
-
|
1850
|
-
onUpdate : function() {
|
1851
|
-
if (!this.fixed) {
|
1852
|
-
this.update();
|
1853
|
-
}
|
1854
|
-
},
|
1855
|
-
|
1856
|
-
afterClose: function (opts) {
|
1857
|
-
// Remove overlay if exists and fancyBox is not opening
|
1858
|
-
// (e.g., it is not being open using afterClose callback)
|
1859
|
-
if (this.overlay && !F.coming) {
|
1860
|
-
this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this ));
|
1861
|
-
}
|
1862
|
-
}
|
1863
|
-
};
|
1864
|
-
|
1865
|
-
/*
|
1866
|
-
* Title helper
|
1867
|
-
*/
|
1868
|
-
|
1869
|
-
F.helpers.title = {
|
1870
|
-
defaults : {
|
1871
|
-
type : 'float', // 'float', 'inside', 'outside' or 'over',
|
1872
|
-
position : 'bottom' // 'top' or 'bottom'
|
1873
|
-
},
|
1874
|
-
|
1875
|
-
beforeShow: function (opts) {
|
1876
|
-
var current = F.current,
|
1877
|
-
text = current.title,
|
1878
|
-
type = opts.type,
|
1879
|
-
title,
|
1880
|
-
target;
|
1881
|
-
|
1882
|
-
if ($.isFunction(text)) {
|
1883
|
-
text = text.call(current.element, current);
|
1884
|
-
}
|
1885
|
-
|
1886
|
-
if (!isString(text) || $.trim(text) === '') {
|
1887
|
-
return;
|
1888
|
-
}
|
1889
|
-
|
1890
|
-
title = $('<div class="fancybox-title fancybox-title-' + type + '-wrap">' + text + '</div>');
|
1891
|
-
|
1892
|
-
switch (type) {
|
1893
|
-
case 'inside':
|
1894
|
-
target = F.skin;
|
1895
|
-
break;
|
1896
|
-
|
1897
|
-
case 'outside':
|
1898
|
-
target = F.wrap;
|
1899
|
-
break;
|
1900
|
-
|
1901
|
-
case 'over':
|
1902
|
-
target = F.inner;
|
1903
|
-
break;
|
1904
|
-
|
1905
|
-
default: // 'float'
|
1906
|
-
target = F.skin;
|
1907
|
-
|
1908
|
-
title.appendTo('body');
|
1909
|
-
|
1910
|
-
if (IE) {
|
1911
|
-
title.width( title.width() );
|
1912
|
-
}
|
1913
|
-
|
1914
|
-
title.wrapInner('<span class="child"></span>');
|
1915
|
-
|
1916
|
-
//Increase bottom margin so this title will also fit into viewport
|
1917
|
-
F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) );
|
1918
|
-
break;
|
1919
|
-
}
|
1920
|
-
|
1921
|
-
title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target);
|
1922
|
-
}
|
1923
|
-
};
|
1924
|
-
|
1925
|
-
// jQuery plugin initialization
|
1926
|
-
$.fn.fancybox = function (options) {
|
1927
|
-
var index,
|
1928
|
-
that = $(this),
|
1929
|
-
selector = this.selector || '',
|
1930
|
-
run = function(e) {
|
1931
|
-
var what = $(this).blur(), idx = index, relType, relVal;
|
1932
|
-
|
1933
|
-
if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
|
1934
|
-
relType = options.groupAttr || 'data-fancybox-group';
|
1935
|
-
relVal = what.attr(relType);
|
1936
|
-
|
1937
|
-
if (!relVal) {
|
1938
|
-
relType = 'rel';
|
1939
|
-
relVal = what.get(0)[ relType ];
|
1940
|
-
}
|
1941
|
-
|
1942
|
-
if (relVal && relVal !== '' && relVal !== 'nofollow') {
|
1943
|
-
what = selector.length ? $(selector) : that;
|
1944
|
-
what = what.filter('[' + relType + '="' + relVal + '"]');
|
1945
|
-
idx = what.index(this);
|
1946
|
-
}
|
1947
|
-
|
1948
|
-
options.index = idx;
|
1949
|
-
|
1950
|
-
// Stop an event from bubbling if everything is fine
|
1951
|
-
if (F.open(what, options) !== false) {
|
1952
|
-
e.preventDefault();
|
1953
|
-
}
|
1954
|
-
}
|
1955
|
-
};
|
1956
|
-
|
1957
|
-
options = options || {};
|
1958
|
-
index = options.index || 0;
|
1959
|
-
|
1960
|
-
if (!selector || options.live === false) {
|
1961
|
-
that.unbind('click.fb-start').bind('click.fb-start', run);
|
1962
|
-
|
1963
|
-
} else {
|
1964
|
-
D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run);
|
1965
|
-
}
|
1966
|
-
|
1967
|
-
this.filter('[data-fancybox-start=1]').trigger('click');
|
1968
|
-
|
1969
|
-
return this;
|
1970
|
-
};
|
1971
|
-
|
1972
|
-
// Tests that need a body at doc ready
|
1973
|
-
D.ready(function() {
|
1974
|
-
var w1, w2;
|
1975
|
-
|
1976
|
-
if ( $.scrollbarWidth === undefined ) {
|
1977
|
-
// http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth
|
1978
|
-
$.scrollbarWidth = function() {
|
1979
|
-
var parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body'),
|
1980
|
-
child = parent.children(),
|
1981
|
-
width = child.innerWidth() - child.height( 99 ).innerWidth();
|
1982
|
-
|
1983
|
-
parent.remove();
|
1984
|
-
|
1985
|
-
return width;
|
1986
|
-
};
|
1987
|
-
}
|
1988
|
-
|
1989
|
-
if ( $.support.fixedPosition === undefined ) {
|
1990
|
-
$.support.fixedPosition = (function() {
|
1991
|
-
var elem = $('<div style="position:fixed;top:20px;"></div>').appendTo('body'),
|
1992
|
-
fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 );
|
1993
|
-
|
1994
|
-
elem.remove();
|
1995
|
-
|
1996
|
-
return fixed;
|
1997
|
-
}());
|
1998
|
-
}
|
1999
|
-
|
2000
|
-
$.extend(F.defaults, {
|
2001
|
-
scrollbarWidth : $.scrollbarWidth(),
|
2002
|
-
fixed : $.support.fixedPosition,
|
2003
|
-
parent : $('body')
|
2004
|
-
});
|
2005
|
-
|
2006
|
-
//Get real width of page scroll-bar
|
2007
|
-
w1 = $(window).width();
|
2008
|
-
|
2009
|
-
H.addClass('fancybox-lock-test');
|
2010
|
-
|
2011
|
-
w2 = $(window).width();
|
2012
|
-
|
2013
|
-
H.removeClass('fancybox-lock-test');
|
2014
|
-
|
2015
|
-
$("<style type='text/css'>.fancybox-margin{margin-right:" + (w2 - w1) + "px;}</style>").appendTo("head");
|
2016
|
-
});
|
2017
|
-
|
2018
|
-
}(window, document, jQuery));
|
1
|
+
/*! For license information please see jquery.fancybox.js.LICENSE.txt */
|
2
|
+
!function(e,t,i,n){"use strict";var o=i("html"),a=i(e),r=i(t),s=i.fancybox=function(){s.open.apply(this,arguments)},l=navigator.userAgent.match(/msie/i),c=null,d=t.createTouch!==n,p=function(e){return e&&e.hasOwnProperty&&e instanceof i},h=function(e){return e&&"string"===i.type(e)},f=function(e){return h(e)&&e.indexOf("%")>0},u=function(e,t){var i=parseInt(e,10)||0;return t&&f(e)&&(i=s.getViewport()[t]/100*i),Math.ceil(i)},g=function(e,t){return u(e,t)+"px"};i.extend(s,{version:"2.1.7",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!d,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(l?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>',loading:'<div id="fancybox-loading"><div></div></div>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:i.noop,beforeLoad:i.noop,afterLoad:i.noop,beforeShow:i.noop,afterShow:i.noop,beforeChange:i.noop,beforeClose:i.noop,afterClose:i.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(e,t){if(e&&(i.isPlainObject(t)||(t={}),!1!==s.close(!0)))return i.isArray(e)||(e=p(e)?i(e).get():[e]),i.each(e,(function(o,a){var r,l,c,d,f,u,g,m={};"object"===i.type(a)&&(a.nodeType&&(a=i(a)),p(a)?(m={href:a.data("fancybox-href")||a.attr("href"),title:i("<div/>").text(a.data("fancybox-title")||a.attr("title")||"").html(),isDom:!0,element:a},i.metadata&&i.extend(!0,m,a.metadata())):m=a),r=t.href||m.href||(h(a)?a:null),l=t.title!==n?t.title:m.title||"",!(d=(c=t.content||m.content)?"html":t.type||m.type)&&m.isDom&&((d=a.data("fancybox-type"))||(d=(f=a.prop("class").match(/fancybox\.(\w+)/))?f[1]:null)),h(r)&&(d||(s.isImage(r)?d="image":s.isSWF(r)?d="swf":"#"===r.charAt(0)?d="inline":h(a)&&(d="html",c=a)),"ajax"===d&&(u=r.split(/\s+/,2),r=u.shift(),g=u.shift())),c||("inline"===d?r?c=i(h(r)?r.replace(/.*(?=#[^\s]+$)/,""):r):m.isDom&&(c=a):"html"===d?c=r:d||r||!m.isDom||(d="inline",c=a)),i.extend(m,{href:r,type:d,content:c,title:l,selector:g}),e[o]=m})),s.opts=i.extend(!0,{},s.defaults,t),t.keys!==n&&(s.opts.keys=!!t.keys&&i.extend({},s.defaults.keys,t.keys)),s.group=e,s._start(s.opts.index)},cancel:function(){var e=s.coming;e&&!1===s.trigger("onCancel")||(s.hideLoading(),e&&(s.ajaxLoad&&s.ajaxLoad.abort(),s.ajaxLoad=null,s.imgPreload&&(s.imgPreload.onload=s.imgPreload.onerror=null),e.wrap&&e.wrap.stop(!0,!0).trigger("onReset").remove(),s.coming=null,s.current||s._afterZoomOut(e)))},close:function(e){s.cancel(),!1!==s.trigger("beforeClose")&&(s.unbindEvents(),s.isActive&&(s.isOpen&&!0!==e?(s.isOpen=s.isOpened=!1,s.isClosing=!0,i(".fancybox-item, .fancybox-nav").remove(),s.wrap.stop(!0,!0).removeClass("fancybox-opened"),s.transitions[s.current.closeMethod]()):(i(".fancybox-wrap").stop(!0).trigger("onReset").remove(),s._afterZoomOut())))},play:function(e){var t=function(){clearTimeout(s.player.timer)},i=function(){t(),s.current&&s.player.isActive&&(s.player.timer=setTimeout(s.next,s.current.playSpeed))},n=function(){t(),r.unbind(".player"),s.player.isActive=!1,s.trigger("onPlayEnd")};!0===e||!s.player.isActive&&!1!==e?s.current&&(s.current.loop||s.current.index<s.group.length-1)&&(s.player.isActive=!0,r.bind({"onCancel.player beforeClose.player":n,"onUpdate.player":i,"beforeLoad.player":t}),i(),s.trigger("onPlayStart")):n()},next:function(e){var t=s.current;t&&(h(e)||(e=t.direction.next),s.jumpto(t.index+1,e,"next"))},prev:function(e){var t=s.current;t&&(h(e)||(e=t.direction.prev),s.jumpto(t.index-1,e,"prev"))},jumpto:function(e,t,i){var o=s.current;o&&(e=u(e),s.direction=t||o.direction[e>=o.index?"next":"prev"],s.router=i||"jumpto",o.loop&&(e<0&&(e=o.group.length+e%o.group.length),e%=o.group.length),o.group[e]!==n&&(s.cancel(),s._start(e)))},reposition:function(e,t){var n,o=s.current,a=o?o.wrap:null;a&&(n=s._getPosition(t),e&&"scroll"===e.type?(delete n.position,a.stop(!0,!0).animate(n,200)):(a.css(n),o.pos=i.extend({},o.dim,n)))},update:function(e){var t=e&&e.originalEvent&&e.originalEvent.type,i=!t||"orientationchange"===t;i&&(clearTimeout(c),c=null),s.isOpen&&!c&&(c=setTimeout((function(){var n=s.current;n&&!s.isClosing&&(s.wrap.removeClass("fancybox-tmp"),(i||"load"===t||"resize"===t&&n.autoResize)&&s._setDimension(),"scroll"===t&&n.canShrink||s.reposition(e),s.trigger("onUpdate"),c=null)}),i&&!d?0:300))},toggle:function(e){s.isOpen&&(s.current.fitToView="boolean"===i.type(e)?e:!s.current.fitToView,d&&(s.wrap.removeAttr("style").addClass("fancybox-tmp"),s.trigger("onUpdate")),s.update())},hideLoading:function(){r.unbind(".loading"),i("#fancybox-loading").remove()},showLoading:function(){var e,t;s.hideLoading(),e=i(s.opts.tpl.loading).click(s.cancel).appendTo("body"),r.bind("keydown.loading",(function(e){27===(e.which||e.keyCode)&&(e.preventDefault(),s.cancel())})),s.defaults.fixed||(t=s.getViewport(),e.css({position:"absolute",top:.5*t.h+t.y,left:.5*t.w+t.x})),s.trigger("onLoading")},getViewport:function(){var t=s.current&&s.current.locked||!1,i={x:a.scrollLeft(),y:a.scrollTop()};return t&&t.length?(i.w=t[0].clientWidth,i.h=t[0].clientHeight):(i.w=d&&e.innerWidth?e.innerWidth:a.width(),i.h=d&&e.innerHeight?e.innerHeight:a.height()),i},unbindEvents:function(){s.wrap&&p(s.wrap)&&s.wrap.unbind(".fb"),r.unbind(".fb"),a.unbind(".fb")},bindEvents:function(){var e,t=s.current;t&&(a.bind("orientationchange.fb"+(d?"":" resize.fb")+(t.autoCenter&&!t.locked?" scroll.fb":""),s.update),(e=t.keys)&&r.bind("keydown.fb",(function(o){var a=o.which||o.keyCode,r=o.target||o.srcElement;if(27===a&&s.coming)return!1;o.ctrlKey||o.altKey||o.shiftKey||o.metaKey||r&&(r.type||i(r).is("[contenteditable]"))||i.each(e,(function(e,r){return t.group.length>1&&r[a]!==n?(s[e](r[a]),o.preventDefault(),!1):i.inArray(a,r)>-1?(s[e](),o.preventDefault(),!1):void 0}))})),i.fn.mousewheel&&t.mouseWheel&&s.wrap.bind("mousewheel.fb",(function(e,n,o,a){for(var r,l=e.target||null,c=i(l),d=!1;c.length&&!(d||c.is(".fancybox-skin")||c.is(".fancybox-wrap"));)d=(r=c[0])&&!(r.style.overflow&&"hidden"===r.style.overflow)&&(r.clientWidth&&r.scrollWidth>r.clientWidth||r.clientHeight&&r.scrollHeight>r.clientHeight),c=i(c).parent();0===n||d||s.group.length>1&&!t.canShrink&&(a>0||o>0?s.prev(a>0?"down":"left"):(a<0||o<0)&&s.next(a<0?"up":"right"),e.preventDefault())})))},trigger:function(e,t){var n,o=t||s.coming||s.current;if(o){if(i.isFunction(o[e])&&(n=o[e].apply(o,Array.prototype.slice.call(arguments,1))),!1===n)return!1;o.helpers&&i.each(o.helpers,(function(t,n){n&&s.helpers[t]&&i.isFunction(s.helpers[t][e])&&s.helpers[t][e](i.extend(!0,{},s.helpers[t].defaults,n),o)}))}r.trigger(e)},isImage:function(e){return h(e)&&e.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(e){return h(e)&&e.match(/\.(swf)((\?|#).*)?$/i)},_start:function(e){var t,n,o,a,r,l={};if(e=u(e),!(t=s.group[e]||null))return!1;if(a=(l=i.extend(!0,{},s.opts,t)).margin,r=l.padding,"number"===i.type(a)&&(l.margin=[a,a,a,a]),"number"===i.type(r)&&(l.padding=[r,r,r,r]),l.modal&&i.extend(!0,l,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),l.autoSize&&(l.autoWidth=l.autoHeight=!0),"auto"===l.width&&(l.autoWidth=!0),"auto"===l.height&&(l.autoHeight=!0),l.group=s.group,l.index=e,s.coming=l,!1!==s.trigger("beforeLoad")){if(o=l.type,n=l.href,!o)return s.coming=null,!(!s.current||!s.router||"jumpto"===s.router)&&(s.current.index=e,s[s.router](s.direction));if(s.isActive=!0,"image"!==o&&"swf"!==o||(l.autoHeight=l.autoWidth=!1,l.scrolling="visible"),"image"===o&&(l.aspectRatio=!0),"iframe"===o&&d&&(l.scrolling="scroll"),l.wrap=i(l.tpl.wrap).addClass("fancybox-"+(d?"mobile":"desktop")+" fancybox-type-"+o+" fancybox-tmp "+l.wrapCSS).appendTo(l.parent||"body"),i.extend(l,{skin:i(".fancybox-skin",l.wrap),outer:i(".fancybox-outer",l.wrap),inner:i(".fancybox-inner",l.wrap)}),i.each(["Top","Right","Bottom","Left"],(function(e,t){l.skin.css("padding"+t,g(l.padding[e]))})),s.trigger("onReady"),"inline"===o||"html"===o){if(!l.content||!l.content.length)return s._error("content")}else if(!n)return s._error("href");"image"===o?s._loadImage():"ajax"===o?s._loadAjax():"iframe"===o?s._loadIframe():s._afterLoad()}else s.coming=null},_error:function(e){i.extend(s.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:e,content:s.coming.tpl.error}),s._afterLoad()},_loadImage:function(){var e=s.imgPreload=new Image;e.onload=function(){this.onload=this.onerror=null,s.coming.width=this.width/s.opts.pixelRatio,s.coming.height=this.height/s.opts.pixelRatio,s._afterLoad()},e.onerror=function(){this.onload=this.onerror=null,s._error("image")},e.src=s.coming.href,!0!==e.complete&&s.showLoading()},_loadAjax:function(){var e=s.coming;s.showLoading(),s.ajaxLoad=i.ajax(i.extend({},e.ajax,{url:e.href,error:function(e,t){s.coming&&"abort"!==t?s._error("ajax",e):s.hideLoading()},success:function(t,i){"success"===i&&(e.content=t,s._afterLoad())}}))},_loadIframe:function(){var e=s.coming,t=i(e.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",d?"auto":e.iframe.scrolling).attr("src",e.href);i(e.wrap).bind("onReset",(function(){try{i(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(e){}})),e.iframe.preload&&(s.showLoading(),t.one("load",(function(){i(this).data("ready",1),d||i(this).bind("load.fb",s.update),i(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),s._afterLoad()}))),e.content=t.appendTo(e.inner),e.iframe.preload||s._afterLoad()},_preloadImages:function(){var e,t,i=s.group,n=s.current,o=i.length,a=n.preload?Math.min(n.preload,o-1):0;for(t=1;t<=a;t+=1)"image"===(e=i[(n.index+t)%o]).type&&e.href&&((new Image).src=e.href)},_afterLoad:function(){var e,t,n,o,a,r,l=s.coming,c=s.current,d="fancybox-placeholder";if(s.hideLoading(),l&&!1!==s.isActive){if(!1===s.trigger("afterLoad",l,c))return l.wrap.stop(!0).trigger("onReset").remove(),void(s.coming=null);switch(c&&(s.trigger("beforeChange",c),c.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),s.unbindEvents(),e=l,t=l.content,n=l.type,o=l.scrolling,i.extend(s,{wrap:e.wrap,skin:e.skin,outer:e.outer,inner:e.inner,current:e,previous:c}),a=e.href,n){case"inline":case"ajax":case"html":e.selector?t=i("<div>").html(t).find(e.selector):p(t)&&(t.data(d)||t.data(d,i('<div class="'+d+'"></div>').insertAfter(t).hide()),t=t.show().detach(),e.wrap.bind("onReset",(function(){i(this).find(t).length&&t.hide().replaceAll(t.data(d)).data(d,!1)})));break;case"image":t=e.tpl.image.replace(/\{href\}/g,a);break;case"swf":t='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="../../cards/source/'+a+'"></param>',r="",i.each(e.swf,(function(e,i){t+='<param name="'+e+'" value="'+i+'"></param>',r+=" "+e+'="'+i+'"'})),t+='<embed src="'+a+'" type="application/x-shockwave-flash" width="100%" height="100%"'+r+"></embed></object>"}p(t)&&t.parent().is(e.inner)||e.inner.append(t),s.trigger("beforeShow"),e.inner.css("overflow","yes"===o?"scroll":"no"===o?"hidden":o),s._setDimension(),s.reposition(),s.isOpen=!1,s.coming=null,s.bindEvents(),s.isOpened?c.prevMethod&&s.transitions[c.prevMethod]():i(".fancybox-wrap").not(e.wrap).stop(!0).trigger("onReset").remove(),s.transitions[s.isOpened?e.nextMethod:e.openMethod](),s._preloadImages()}},_setDimension:function(){var e,t,n,o,a,r,l,c,d,p,h,m,y,x,v,w,b,k=s.getViewport(),C=0,O=s.wrap,W=s.skin,_=s.inner,S=s.current,T=S.width,E=S.height,L=S.minWidth,H=S.minHeight,j=S.maxWidth,P=S.maxHeight,R=S.scrolling,M=S.scrollOutside?S.scrollbarWidth:0,A=S.margin,I=u(A[1]+A[3]),D=u(A[0]+A[2]);if(O.add(W).add(_).width("auto").height("auto").removeClass("fancybox-tmp"),a=I+(n=u(W.outerWidth(!0)-W.width())),r=D+(o=u(W.outerHeight(!0)-W.height())),l=f(T)?(k.w-a)*u(T)/100:T,c=f(E)?(k.h-r)*u(E)/100:E,"iframe"===S.type){if(w=S.content,S.autoHeight&&w&&1===w.data("ready"))try{w[0].contentWindow.document.location&&(_.width(l).height(9999),b=w.contents().find("body"),M&&b.css("overflow-x","hidden"),c=b.outerHeight(!0))}catch(e){}}else(S.autoWidth||S.autoHeight)&&(_.addClass("fancybox-tmp"),S.autoWidth||_.width(l),S.autoHeight||_.height(c),S.autoWidth&&(l=_.width()),S.autoHeight&&(c=_.height()),_.removeClass("fancybox-tmp"));if(T=u(l),E=u(c),h=l/c,L=u(f(L)?u(L,"w")-a:L),j=u(f(j)?u(j,"w")-a:j),H=u(f(H)?u(H,"h")-r:H),d=j,p=P=u(f(P)?u(P,"h")-r:P),S.fitToView&&(j=Math.min(k.w-a,j),P=Math.min(k.h-r,P)),x=k.w-I,v=k.h-D,S.aspectRatio?(T>j&&(E=u((T=j)/h)),E>P&&(T=u((E=P)*h)),T<L&&(E=u((T=L)/h)),E<H&&(T=u((E=H)*h))):(T=Math.max(L,Math.min(T,j)),S.autoHeight&&"iframe"!==S.type&&(_.width(T),E=_.height()),E=Math.max(H,Math.min(E,P))),S.fitToView)if(_.width(T).height(E),O.width(T+n),m=O.width(),y=O.height(),S.aspectRatio)for(;(m>x||y>v)&&T>L&&E>H&&!(C++>19);)E=Math.max(H,Math.min(P,E-10)),(T=u(E*h))<L&&(E=u((T=L)/h)),T>j&&(E=u((T=j)/h)),_.width(T).height(E),O.width(T+n),m=O.width(),y=O.height();else T=Math.max(L,Math.min(T,T-(m-x))),E=Math.max(H,Math.min(E,E-(y-v)));M&&"auto"===R&&E<c&&T+n+M<x&&(T+=M),_.width(T).height(E),O.width(T+n),m=O.width(),y=O.height(),e=(m>x||y>v)&&T>L&&E>H,t=S.aspectRatio?T<d&&E<p&&T<l&&E<c:(T<d||E<p)&&(T<l||E<c),i.extend(S,{dim:{width:g(m),height:g(y)},origWidth:l,origHeight:c,canShrink:e,canExpand:t,wPadding:n,hPadding:o,wrapSpace:y-W.outerHeight(!0),skinSpace:W.height()-E}),!w&&S.autoHeight&&E>H&&E<P&&!t&&_.height("auto")},_getPosition:function(e){var t=s.current,i=s.getViewport(),n=t.margin,o=s.wrap.width()+n[1]+n[3],a=s.wrap.height()+n[0]+n[2],r={position:"absolute",top:n[0],left:n[3]};return t.autoCenter&&t.fixed&&!e&&a<=i.h&&o<=i.w?r.position="fixed":t.locked||(r.top+=i.y,r.left+=i.x),r.top=g(Math.max(r.top,r.top+(i.h-a)*t.topRatio)),r.left=g(Math.max(r.left,r.left+(i.w-o)*t.leftRatio)),r},_afterZoomIn:function(){var e=s.current;e&&(s.isOpen=s.isOpened=!0,s.wrap.css("overflow","visible").addClass("fancybox-opened").hide().show(0),s.update(),(e.closeClick||e.nextClick&&s.group.length>1)&&s.inner.css("cursor","pointer").bind("click.fb",(function(t){i(t.target).is("a")||i(t.target).parent().is("a")||(t.preventDefault(),s[e.closeClick?"close":"next"]())})),e.closeBtn&&i(e.tpl.closeBtn).appendTo(s.skin).bind("click.fb",(function(e){e.preventDefault(),s.close()})),e.arrows&&s.group.length>1&&((e.loop||e.index>0)&&i(e.tpl.prev).appendTo(s.outer).bind("click.fb",s.prev),(e.loop||e.index<s.group.length-1)&&i(e.tpl.next).appendTo(s.outer).bind("click.fb",s.next)),s.trigger("afterShow"),e.loop||e.index!==e.group.length-1?s.opts.autoPlay&&!s.player.isActive&&(s.opts.autoPlay=!1,s.play(!0)):s.play(!1))},_afterZoomOut:function(e){e=e||s.current,i(".fancybox-wrap").trigger("onReset").remove(),i.extend(s,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null}),s.trigger("afterClose",e)}}),s.transitions={getOrigPosition:function(){var e=s.current,t=e.element,i=e.orig,n={},o=50,a=50,r=e.hPadding,l=e.wPadding,c=s.getViewport();return!i&&e.isDom&&t.is(":visible")&&((i=t.find("img:first")).length||(i=t)),p(i)?(n=i.offset(),i.is("img")&&(o=i.outerWidth(),a=i.outerHeight())):(n.top=c.y+(c.h-a)*e.topRatio,n.left=c.x+(c.w-o)*e.leftRatio),("fixed"===s.wrap.css("position")||e.locked)&&(n.top-=c.y,n.left-=c.x),{top:g(n.top-r*e.topRatio),left:g(n.left-l*e.leftRatio),width:g(o+l),height:g(a+r)}},step:function(e,t){var i,n,o=t.prop,a=s.current,r=a.wrapSpace,l=a.skinSpace;"width"!==o&&"height"!==o||(i=t.end===t.start?1:(e-t.start)/(t.end-t.start),s.isClosing&&(i=1-i),n=e-("width"===o?a.wPadding:a.hPadding),s.skin[o](u("width"===o?n:n-r*i)),s.inner[o](u("width"===o?n:n-r*i-l*i)))},zoomIn:function(){var e=s.current,t=e.pos,n=e.openEffect,o="elastic"===n,a=i.extend({opacity:1},t);delete a.position,o?(t=this.getOrigPosition(),e.openOpacity&&(t.opacity=.1)):"fade"===n&&(t.opacity=.1),s.wrap.css(t).animate(a,{duration:"none"===n?0:e.openSpeed,easing:e.openEasing,step:o?this.step:null,complete:s._afterZoomIn})},zoomOut:function(){var e=s.current,t=e.closeEffect,i="elastic"===t,n={opacity:.1};i&&(n=this.getOrigPosition(),e.closeOpacity&&(n.opacity=.1)),s.wrap.animate(n,{duration:"none"===t?0:e.closeSpeed,easing:e.closeEasing,step:i?this.step:null,complete:s._afterZoomOut})},changeIn:function(){var e,t=s.current,i=t.nextEffect,n=t.pos,o={opacity:1},a=s.direction;n.opacity=.1,"elastic"===i&&(e="down"===a||"up"===a?"top":"left","down"===a||"right"===a?(n[e]=g(u(n[e])-200),o[e]="+=200px"):(n[e]=g(u(n[e])+200),o[e]="-=200px")),"none"===i?s._afterZoomIn():s.wrap.css(n).animate(o,{duration:t.nextSpeed,easing:t.nextEasing,complete:s._afterZoomIn})},changeOut:function(){var e=s.previous,t=e.prevEffect,n={opacity:.1},o=s.direction;"elastic"===t&&(n["down"===o||"up"===o?"top":"left"]=("up"===o||"left"===o?"-":"+")+"=200px"),e.wrap.animate(n,{duration:"none"===t?0:e.prevSpeed,easing:e.prevEasing,complete:function(){i(this).trigger("onReset").remove()}})}},s.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!d,fixed:!0},overlay:null,fixed:!1,el:i("html"),create:function(e){var t;e=i.extend({},this.defaults,e),this.overlay&&this.close(),t=s.coming?s.coming.parent:e.parent,this.overlay=i('<div class="fancybox-overlay"></div>').appendTo(t&&t.length?t:"body"),this.fixed=!1,e.fixed&&s.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(e){var t=this;e=i.extend({},this.defaults,e),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(e),this.fixed||(a.bind("resize.overlay",i.proxy(this.update,this)),this.update()),e.closeClick&&this.overlay.bind("click.overlay",(function(e){if(i(e.target).hasClass("fancybox-overlay"))return s.isActive?s.close():t.close(),!1})),this.overlay.css(e.css).show()},close:function(){a.unbind("resize.overlay"),this.el.hasClass("fancybox-lock")&&(i(".fancybox-margin").removeClass("fancybox-margin"),this.el.removeClass("fancybox-lock"),a.scrollTop(this.scrollV).scrollLeft(this.scrollH)),i(".fancybox-overlay").remove().hide(),i.extend(this,{overlay:null,fixed:!1})},update:function(){var e,i="100%";this.overlay.width(i).height("100%"),l?(e=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),r.width()>e&&(i=r.width())):r.width()>a.width()&&(i=r.width()),this.overlay.width(i).height(r.height())},onReady:function(e,t){var n=this.overlay;i(".fancybox-overlay").stop(!0,!0),n||this.create(e),e.locked&&this.fixed&&t.fixed&&(t.locked=this.overlay.append(t.wrap),t.fixed=!1),!0===e.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(e,t){t.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&i("*:not(object)").filter((function(){return"fixed"===i(this).css("position")&&!i(this).hasClass("fancybox-overlay")&&!i(this).hasClass("fancybox-wrap")})).addClass("fancybox-margin"),this.el.addClass("fancybox-margin"),this.scrollV=a.scrollTop(),this.scrollH=a.scrollLeft(),this.el.addClass("fancybox-lock"),a.scrollTop(this.scrollV).scrollLeft(this.scrollH)),this.open(e)},onUpdate:function(){this.fixed||this.update()},afterClose:function(e){this.overlay&&!s.coming&&this.overlay.fadeOut(e.speedOut,i.proxy(this.close,this))}},s.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(e){var t,n,o=s.current,a=o.title,r=e.type;if(i.isFunction(a)&&(a=a.call(o.element,o)),h(a)&&""!==i.trim(a)){switch(t=i('<div class="fancybox-title fancybox-title-'+r+'-wrap">'+a+"</div>"),r){case"inside":n=s.skin;break;case"outside":n=s.wrap;break;case"over":n=s.inner;break;default:n=s.skin,t.appendTo("body"),l&&t.width(t.width()),t.wrapInner('<span class="child"></span>'),s.current.margin[2]+=Math.abs(u(t.css("margin-bottom")))}t["top"===e.position?"prependTo":"appendTo"](n)}}},i.fn.fancybox=function(e){var t,n=i(this),o=this.selector||"",a=function(a){var r,l,c=i(this).blur(),d=t;a.ctrlKey||a.altKey||a.shiftKey||a.metaKey||c.is(".fancybox-wrap")||(r=e.groupAttr||"data-fancybox-group",(l=c.attr(r))||(r="rel",l=c.get(0)[r]),l&&""!==l&&"nofollow"!==l&&(d=(c=(c=o.length?i(o):n).filter("["+r+'="'+l+'"]')).index(this)),e.index=d,!1!==s.open(c,e)&&a.preventDefault())};return t=(e=e||{}).index||0,o&&!1!==e.live?r.undelegate(o,"click.fb-start").delegate(o+":not('.fancybox-item, .fancybox-nav')","click.fb-start",a):n.unbind("click.fb-start").bind("click.fb-start",a),this.filter("[data-fancybox-start=1]").trigger("click"),this},r.ready((function(){var t,a,r,l;i.scrollbarWidth===n&&(i.scrollbarWidth=function(){var e=i('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),t=e.children(),n=t.innerWidth()-t.height(99).innerWidth();return e.remove(),n}),i.support.fixedPosition===n&&(i.support.fixedPosition=(l=20===(r=i('<div style="position:fixed;top:20px;"></div>').appendTo("body"))[0].offsetTop||15===r[0].offsetTop,r.remove(),l)),i.extend(s.defaults,{scrollbarWidth:i.scrollbarWidth(),fixed:i.support.fixedPosition,parent:i("body")}),t=i(e).width(),o.addClass("fancybox-lock-test"),a=i(e).width(),o.removeClass("fancybox-lock-test"),i("<style type='text/css'>.fancybox-margin{margin-right:"+(a-t)+"px;}</style>").appendTo("head")}))}(window,document,jQuery);
|