Responsive Lightbox & Gallery - Version 1.3.3

Version Description

  • New: Triggering lightbox on custom jquery events option
  • Tweak: UI imporovements for WP 3.8
Download this release

Release Info

Developer dfactory
Plugin Icon 128x128 Responsive Lightbox & Gallery
Version 1.3.3
Comparing to
See all releases

Code changes from version 1.3.2 to 1.3.3

assets/fancybox/jquery.fancybox-1.3.4.css CHANGED
@@ -1,359 +1,359 @@
1
- /*
2
- * FancyBox - jQuery Plugin
3
- * Simple and fancy lightbox alternative
4
- *
5
- * Examples and documentation at: http://fancybox.net
6
- *
7
- * Copyright (c) 2008 - 2010 Janis Skarnelis
8
- * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
- *
10
- * Version: 1.3.4 (11/11/2010)
11
- * Requires: jQuery v1.3+
12
- *
13
- * Dual licensed under the MIT and GPL licenses:
14
- * http://www.opensource.org/licenses/mit-license.php
15
- * http://www.gnu.org/licenses/gpl.html
16
- */
17
-
18
- #fancybox-loading {
19
- position: fixed;
20
- top: 50%;
21
- left: 50%;
22
- width: 40px;
23
- height: 40px;
24
- margin-top: -20px;
25
- margin-left: -20px;
26
- cursor: pointer;
27
- overflow: hidden;
28
- z-index: 1104;
29
- display: none;
30
- }
31
-
32
- #fancybox-loading div {
33
- position: absolute;
34
- top: 0;
35
- left: 0;
36
- width: 40px;
37
- height: 480px;
38
- background-image: url('fancybox.png');
39
- }
40
-
41
- #fancybox-overlay {
42
- position: absolute;
43
- top: 0;
44
- left: 0;
45
- width: 100%;
46
- z-index: 1100;
47
- display: none;
48
- }
49
-
50
- #fancybox-tmp {
51
- padding: 0;
52
- margin: 0;
53
- border: 0;
54
- overflow: auto;
55
- display: none;
56
- }
57
-
58
- #fancybox-wrap {
59
- position: absolute;
60
- top: 0;
61
- left: 0;
62
- padding: 20px;
63
- z-index: 1101;
64
- outline: none;
65
- display: none;
66
- }
67
-
68
- #fancybox-outer {
69
- position: relative;
70
- width: 100%;
71
- height: 100%;
72
- background: #fff;
73
- }
74
-
75
- #fancybox-content {
76
- width: 0;
77
- height: 0;
78
- padding: 0;
79
- outline: none;
80
- position: relative;
81
- overflow: hidden;
82
- z-index: 1102;
83
- border: 0px solid #fff;
84
- }
85
-
86
- #fancybox-hide-sel-frame {
87
- position: absolute;
88
- top: 0;
89
- left: 0;
90
- width: 100%;
91
- height: 100%;
92
- background: transparent;
93
- z-index: 1101;
94
- }
95
-
96
- #fancybox-close {
97
- position: absolute;
98
- top: -15px;
99
- right: -15px;
100
- width: 30px;
101
- height: 30px;
102
- background: transparent url('fancybox.png') -40px 0px;
103
- cursor: pointer;
104
- z-index: 1103;
105
- display: none;
106
- }
107
-
108
- #fancybox-error {
109
- color: #444;
110
- font: normal 12px/20px Arial;
111
- padding: 14px;
112
- margin: 0;
113
- }
114
-
115
- #fancybox-img {
116
- width: 100%;
117
- height: 100%;
118
- padding: 0;
119
- margin: 0;
120
- border: none;
121
- outline: none;
122
- line-height: 0;
123
- vertical-align: top;
124
- }
125
-
126
- #fancybox-frame {
127
- width: 100%;
128
- height: 100%;
129
- border: none;
130
- display: block;
131
- }
132
-
133
- #fancybox-left, #fancybox-right {
134
- position: absolute;
135
- bottom: 0px;
136
- height: 100%;
137
- width: 35%;
138
- cursor: pointer;
139
- outline: none;
140
- background: transparent url('blank.gif');
141
- z-index: 1102;
142
- display: none;
143
- }
144
-
145
- #fancybox-left {
146
- left: 0px;
147
- }
148
-
149
- #fancybox-right {
150
- right: 0px;
151
- }
152
-
153
- #fancybox-left-ico, #fancybox-right-ico {
154
- position: absolute;
155
- top: 50%;
156
- left: -9999px;
157
- width: 30px;
158
- height: 30px;
159
- margin-top: -15px;
160
- cursor: pointer;
161
- z-index: 1102;
162
- display: block;
163
- }
164
-
165
- #fancybox-left-ico {
166
- background-image: url('fancybox.png');
167
- background-position: -40px -30px;
168
- }
169
-
170
- #fancybox-right-ico {
171
- background-image: url('fancybox.png');
172
- background-position: -40px -60px;
173
- }
174
-
175
- #fancybox-left:hover, #fancybox-right:hover {
176
- visibility: visible; /* IE6 */
177
- }
178
-
179
- #fancybox-left:hover span {
180
- left: 20px;
181
- }
182
-
183
- #fancybox-right:hover span {
184
- left: auto;
185
- right: 20px;
186
- }
187
-
188
- .fancybox-bg {
189
- position: absolute;
190
- padding: 0;
191
- margin: 0;
192
- border: 0;
193
- width: 20px;
194
- height: 20px;
195
- z-index: 1001;
196
- }
197
-
198
- #fancybox-bg-n {
199
- top: -20px;
200
- left: 0;
201
- width: 100%;
202
- background-image: url('fancybox-x.png');
203
- }
204
-
205
- #fancybox-bg-ne {
206
- top: -20px;
207
- right: -20px;
208
- background-image: url('fancybox.png');
209
- background-position: -40px -162px;
210
- }
211
-
212
- #fancybox-bg-e {
213
- top: 0;
214
- right: -20px;
215
- height: 100%;
216
- background-image: url('fancybox-y.png');
217
- background-position: -20px 0px;
218
- }
219
-
220
- #fancybox-bg-se {
221
- bottom: -20px;
222
- right: -20px;
223
- background-image: url('fancybox.png');
224
- background-position: -40px -182px;
225
- }
226
-
227
- #fancybox-bg-s {
228
- bottom: -20px;
229
- left: 0;
230
- width: 100%;
231
- background-image: url('fancybox-x.png');
232
- background-position: 0px -20px;
233
- }
234
-
235
- #fancybox-bg-sw {
236
- bottom: -20px;
237
- left: -20px;
238
- background-image: url('fancybox.png');
239
- background-position: -40px -142px;
240
- }
241
-
242
- #fancybox-bg-w {
243
- top: 0;
244
- left: -20px;
245
- height: 100%;
246
- background-image: url('fancybox-y.png');
247
- }
248
-
249
- #fancybox-bg-nw {
250
- top: -20px;
251
- left: -20px;
252
- background-image: url('fancybox.png');
253
- background-position: -40px -122px;
254
- }
255
-
256
- #fancybox-title {
257
- font-family: Helvetica;
258
- font-size: 12px;
259
- z-index: 1102;
260
- }
261
-
262
- .fancybox-title-inside {
263
- padding-bottom: 10px;
264
- text-align: center;
265
- color: #333;
266
- background: #fff;
267
- position: relative;
268
- }
269
-
270
- .fancybox-title-outside {
271
- padding-top: 10px;
272
- color: #fff;
273
- }
274
-
275
- .fancybox-title-over {
276
- position: absolute;
277
- bottom: 0;
278
- left: 0;
279
- color: #FFF;
280
- text-align: left;
281
- }
282
-
283
- #fancybox-title-over {
284
- padding: 10px;
285
- background-image: url('fancy_title_over.png');
286
- display: block;
287
- }
288
-
289
- .fancybox-title-float {
290
- position: absolute;
291
- left: 0;
292
- bottom: -20px;
293
- height: 32px;
294
- }
295
-
296
- #fancybox-title-float-wrap {
297
- border: none;
298
- border-collapse: collapse;
299
- width: auto;
300
- }
301
-
302
- #fancybox-title-float-wrap td {
303
- border: none;
304
- white-space: nowrap;
305
- }
306
-
307
- #fancybox-title-float-left {
308
- padding: 0 0 0 15px;
309
- background: url('fancybox.png') -40px -90px no-repeat;
310
- }
311
-
312
- #fancybox-title-float-main {
313
- color: #FFF;
314
- line-height: 29px;
315
- font-weight: bold;
316
- padding: 0 0 3px 0;
317
- background: url('fancybox-x.png') 0px -40px;
318
- }
319
-
320
- #fancybox-title-float-right {
321
- padding: 0 0 0 15px;
322
- background: url('fancybox.png') -55px -90px no-repeat;
323
- }
324
-
325
- /* IE6 */
326
-
327
- .fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
328
-
329
- .fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
330
- .fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
331
-
332
- .fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
333
- .fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
334
- .fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
335
- .fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
336
-
337
- .fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
338
- height: expression(this.parentNode.clientHeight + "px");
339
- }
340
-
341
- #fancybox-loading.fancybox-ie6 {
342
- position: absolute; margin-top: 0;
343
- top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
344
- }
345
-
346
- #fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
347
-
348
- /* IE6, IE7, IE8 */
349
-
350
- .fancybox-ie .fancybox-bg { background: transparent !important; }
351
-
352
- .fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
353
- .fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
354
- .fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
355
- .fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
356
- .fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
357
- .fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
358
- .fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
359
.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
1
+ /*
2
+ * FancyBox - jQuery Plugin
3
+ * Simple and fancy lightbox alternative
4
+ *
5
+ * Examples and documentation at: http://fancybox.net
6
+ *
7
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
8
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Version: 1.3.4 (11/11/2010)
11
+ * Requires: jQuery v1.3+
12
+ *
13
+ * Dual licensed under the MIT and GPL licenses:
14
+ * http://www.opensource.org/licenses/mit-license.php
15
+ * http://www.gnu.org/licenses/gpl.html
16
+ */
17
+
18
+ #fancybox-loading {
19
+ position: fixed;
20
+ top: 50%;
21
+ left: 50%;
22
+ width: 40px;
23
+ height: 40px;
24
+ margin-top: -20px;
25
+ margin-left: -20px;
26
+ cursor: pointer;
27
+ overflow: hidden;
28
+ z-index: 1104;
29
+ display: none;
30
+ }
31
+
32
+ #fancybox-loading div {
33
+ position: absolute;
34
+ top: 0;
35
+ left: 0;
36
+ width: 40px;
37
+ height: 480px;
38
+ background-image: url('fancybox.png');
39
+ }
40
+
41
+ #fancybox-overlay {
42
+ position: absolute;
43
+ top: 0;
44
+ left: 0;
45
+ width: 100%;
46
+ z-index: 1100;
47
+ display: none;
48
+ }
49
+
50
+ #fancybox-tmp {
51
+ padding: 0;
52
+ margin: 0;
53
+ border: 0;
54
+ overflow: auto;
55
+ display: none;
56
+ }
57
+
58
+ #fancybox-wrap {
59
+ position: absolute;
60
+ top: 0;
61
+ left: 0;
62
+ padding: 20px;
63
+ z-index: 1101;
64
+ outline: none;
65
+ display: none;
66
+ }
67
+
68
+ #fancybox-outer {
69
+ position: relative;
70
+ width: 100%;
71
+ height: 100%;
72
+ background: #fff;
73
+ }
74
+
75
+ #fancybox-content {
76
+ width: 0;
77
+ height: 0;
78
+ padding: 0;
79
+ outline: none;
80
+ position: relative;
81
+ overflow: hidden;
82
+ z-index: 1102;
83
+ border: 0px solid #fff;
84
+ }
85
+
86
+ #fancybox-hide-sel-frame {
87
+ position: absolute;
88
+ top: 0;
89
+ left: 0;
90
+ width: 100%;
91
+ height: 100%;
92
+ background: transparent;
93
+ z-index: 1101;
94
+ }
95
+
96
+ #fancybox-close {
97
+ position: absolute;
98
+ top: -15px;
99
+ right: -15px;
100
+ width: 30px;
101
+ height: 30px;
102
+ background: transparent url('fancybox.png') -40px 0px;
103
+ cursor: pointer;
104
+ z-index: 1103;
105
+ display: none;
106
+ }
107
+
108
+ #fancybox-error {
109
+ color: #444;
110
+ font: normal 12px/20px Arial;
111
+ padding: 14px;
112
+ margin: 0;
113
+ }
114
+
115
+ #fancybox-img {
116
+ width: 100%;
117
+ height: 100%;
118
+ padding: 0;
119
+ margin: 0;
120
+ border: none;
121
+ outline: none;
122
+ line-height: 0;
123
+ vertical-align: top;
124
+ }
125
+
126
+ #fancybox-frame {
127
+ width: 100%;
128
+ height: 100%;
129
+ border: none;
130
+ display: block;
131
+ }
132
+
133
+ #fancybox-left, #fancybox-right {
134
+ position: absolute;
135
+ bottom: 0px;
136
+ height: 100%;
137
+ width: 35%;
138
+ cursor: pointer;
139
+ outline: none;
140
+ background: transparent url('blank.gif');
141
+ z-index: 1102;
142
+ display: none;
143
+ }
144
+
145
+ #fancybox-left {
146
+ left: 0px;
147
+ }
148
+
149
+ #fancybox-right {
150
+ right: 0px;
151
+ }
152
+
153
+ #fancybox-left-ico, #fancybox-right-ico {
154
+ position: absolute;
155
+ top: 50%;
156
+ left: -9999px;
157
+ width: 30px;
158
+ height: 30px;
159
+ margin-top: -15px;
160
+ cursor: pointer;
161
+ z-index: 1102;
162
+ display: block;
163
+ }
164
+
165
+ #fancybox-left-ico {
166
+ background-image: url('fancybox.png');
167
+ background-position: -40px -30px;
168
+ }
169
+
170
+ #fancybox-right-ico {
171
+ background-image: url('fancybox.png');
172
+ background-position: -40px -60px;
173
+ }
174
+
175
+ #fancybox-left:hover, #fancybox-right:hover {
176
+ visibility: visible; /* IE6 */
177
+ }
178
+
179
+ #fancybox-left:hover span {
180
+ left: 20px;
181
+ }
182
+
183
+ #fancybox-right:hover span {
184
+ left: auto;
185
+ right: 20px;
186
+ }
187
+
188
+ .fancybox-bg {
189
+ position: absolute;
190
+ padding: 0;
191
+ margin: 0;
192
+ border: 0;
193
+ width: 20px;
194
+ height: 20px;
195
+ z-index: 1001;
196
+ }
197
+
198
+ #fancybox-bg-n {
199
+ top: -20px;
200
+ left: 0;
201
+ width: 100%;
202
+ background-image: url('fancybox-x.png');
203
+ }
204
+
205
+ #fancybox-bg-ne {
206
+ top: -20px;
207
+ right: -20px;
208
+ background-image: url('fancybox.png');
209
+ background-position: -40px -162px;
210
+ }
211
+
212
+ #fancybox-bg-e {
213
+ top: 0;
214
+ right: -20px;
215
+ height: 100%;
216
+ background-image: url('fancybox-y.png');
217
+ background-position: -20px 0px;
218
+ }
219
+
220
+ #fancybox-bg-se {
221
+ bottom: -20px;
222
+ right: -20px;
223
+ background-image: url('fancybox.png');
224
+ background-position: -40px -182px;
225
+ }
226
+
227
+ #fancybox-bg-s {
228
+ bottom: -20px;
229
+ left: 0;
230
+ width: 100%;
231
+ background-image: url('fancybox-x.png');
232
+ background-position: 0px -20px;
233
+ }
234
+
235
+ #fancybox-bg-sw {
236
+ bottom: -20px;
237
+ left: -20px;
238
+ background-image: url('fancybox.png');
239
+ background-position: -40px -142px;
240
+ }
241
+
242
+ #fancybox-bg-w {
243
+ top: 0;
244
+ left: -20px;
245
+ height: 100%;
246
+ background-image: url('fancybox-y.png');
247
+ }
248
+
249
+ #fancybox-bg-nw {
250
+ top: -20px;
251
+ left: -20px;
252
+ background-image: url('fancybox.png');
253
+ background-position: -40px -122px;
254
+ }
255
+
256
+ #fancybox-title {
257
+ font-family: Helvetica;
258
+ font-size: 12px;
259
+ z-index: 1102;
260
+ }
261
+
262
+ .fancybox-title-inside {
263
+ padding-bottom: 10px;
264
+ text-align: center;
265
+ color: #333;
266
+ background: #fff;
267
+ position: relative;
268
+ }
269
+
270
+ .fancybox-title-outside {
271
+ padding-top: 10px;
272
+ color: #fff;
273
+ }
274
+
275
+ .fancybox-title-over {
276
+ position: absolute;
277
+ bottom: 0;
278
+ left: 0;
279
+ color: #FFF;
280
+ text-align: left;
281
+ }
282
+
283
+ #fancybox-title-over {
284
+ padding: 10px;
285
+ background-image: url('fancy_title_over.png');
286
+ display: block;
287
+ }
288
+
289
+ .fancybox-title-float {
290
+ position: absolute;
291
+ left: 0;
292
+ bottom: -20px;
293
+ height: 32px;
294
+ }
295
+
296
+ #fancybox-title-float-wrap {
297
+ border: none;
298
+ border-collapse: collapse;
299
+ width: auto;
300
+ }
301
+
302
+ #fancybox-title-float-wrap td {
303
+ border: none;
304
+ white-space: nowrap;
305
+ }
306
+
307
+ #fancybox-title-float-left {
308
+ padding: 0 0 0 15px;
309
+ background: url('fancybox.png') -40px -90px no-repeat;
310
+ }
311
+
312
+ #fancybox-title-float-main {
313
+ color: #FFF;
314
+ line-height: 29px;
315
+ font-weight: bold;
316
+ padding: 0 0 3px 0;
317
+ background: url('fancybox-x.png') 0px -40px;
318
+ }
319
+
320
+ #fancybox-title-float-right {
321
+ padding: 0 0 0 15px;
322
+ background: url('fancybox.png') -55px -90px no-repeat;
323
+ }
324
+
325
+ /* IE6 */
326
+
327
+ .fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
328
+
329
+ .fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
330
+ .fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
331
+
332
+ .fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
333
+ .fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
334
+ .fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
335
+ .fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
336
+
337
+ .fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
338
+ height: expression(this.parentNode.clientHeight + "px");
339
+ }
340
+
341
+ #fancybox-loading.fancybox-ie6 {
342
+ position: absolute; margin-top: 0;
343
+ top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
344
+ }
345
+
346
+ #fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
347
+
348
+ /* IE6, IE7, IE8 */
349
+
350
+ .fancybox-ie .fancybox-bg { background: transparent !important; }
351
+
352
+ .fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
353
+ .fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
354
+ .fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
355
+ .fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
356
+ .fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
357
+ .fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
358
+ .fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
359
.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
assets/fancybox/jquery.fancybox-1.3.4.js CHANGED
@@ -1,1177 +1,1177 @@
1
- /*
2
- * FancyBox - jQuery Plugin
3
- * Simple and fancy lightbox alternative
4
- *
5
- * Examples and documentation at: http://fancybox.net
6
- *
7
- * Copyright (c) 2008 - 2010 Janis Skarnelis
8
- * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
- *
10
- * Version: 1.3.4 (11/11/2010)
11
- * Requires: jQuery v1.3+
12
- *
13
- * Dual licensed under the MIT and GPL licenses:
14
- * http://www.opensource.org/licenses/mit-license.php
15
- * http://www.gnu.org/licenses/gpl.html
16
- */
17
-
18
- ;(function($) {
19
- var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
20
-
21
- videoToShow = '',
22
-
23
- selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
24
-
25
- ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?#x2F;i, swfRegExp = /[^\.]\.(swf)\s*#x2F;i,
26
-
27
- loadingTimer, loadingFrame = 1,
28
-
29
- titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
30
-
31
- isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
32
-
33
- /*
34
- * Private methods
35
- */
36
-
37
- _abort = function() {
38
- loading.hide();
39
-
40
- imgPreloader.onerror = imgPreloader.onload = null;
41
-
42
- if (ajaxLoader) {
43
- ajaxLoader.abort();
44
- }
45
-
46
- tmp.empty();
47
- },
48
-
49
- _error = function() {
50
- if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
51
- loading.hide();
52
- busy = false;
53
- return;
54
- }
55
-
56
- selectedOpts.titleShow = false;
57
-
58
- selectedOpts.width = 'auto';
59
- selectedOpts.height = 'auto';
60
-
61
- tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' );
62
-
63
- _process_inline();
64
- },
65
-
66
- _is_video = function(videoURL) {
67
- var matchesYoutube = videoURL.match(/(?:(?:http|https):\/\/)?(?:www\.)?youtube.com\/watch\?v=([a-zA-Z0-9\-_]+)/);
68
-
69
- if(matchesYoutube) {
70
- videoToShow = 'http://www.youtube.com/embed/'+matchesYoutube[1];
71
- return true;
72
- }
73
-
74
- var matchesVimeo = videoURL.match(/(?:(?:http|https):\/\/)?(?:www\.)?vimeo.com\/([0-9]+)/);
75
-
76
- if (matchesVimeo){
77
- videoToShow = 'http://player.vimeo.com/video/'+matchesVimeo[1];
78
- return true;
79
- }
80
-
81
- return false;
82
- },
83
-
84
- _start = function() {
85
- var obj = selectedArray[ selectedIndex ],
86
- href,
87
- type,
88
- title,
89
- str,
90
- emb,
91
- ret;
92
-
93
- _abort();
94
-
95
- selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
96
-
97
- ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
98
-
99
- if (ret === false) {
100
- busy = false;
101
- return;
102
- } else if (typeof ret == 'object') {
103
- selectedOpts = $.extend(selectedOpts, ret);
104
- }
105
-
106
- title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
107
-
108
- if (obj.nodeName && !selectedOpts.orig) {
109
- selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
110
- }
111
-
112
- if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
113
- title = selectedOpts.orig.attr('alt');
114
- }
115
-
116
- href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
117
-
118
- if ((/^(?:javascript)/i).test(href) || href == '#') {
119
- href = null;
120
- }
121
-
122
- if (selectedOpts.type) {
123
- type = selectedOpts.type;
124
-
125
- if (!href) {
126
- href = selectedOpts.content;
127
- }
128
-
129
- } else if (selectedOpts.content) {
130
- type = 'html';
131
-
132
- } else if (href) {
133
- if (href.match(imgRegExp)) {
134
- type = 'image';
135
-
136
- } else if (href.match(swfRegExp)) {
137
- type = 'swf';
138
-
139
- } else if ($(obj).hasClass('iframe') || _is_video($(obj).attr('href'))) {
140
- type = 'iframe';
141
-
142
- } else if (href.indexOf("#") === 0) {
143
- type = 'inline';
144
-
145
- } else {
146
- type = 'ajax';
147
- }
148
- }
149
-
150
- if (!type) {
151
- _error();
152
- return;
153
- }
154
-
155
- if (type == 'inline') {
156
- obj = href.substr(href.indexOf("#"));
157
- type = $(obj).length > 0 ? 'inline' : 'ajax';
158
- }
159
-
160
- selectedOpts.type = type;
161
- selectedOpts.href = href;
162
- selectedOpts.title = title;
163
-
164
- if (selectedOpts.autoDimensions) {
165
- if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
166
- selectedOpts.width = 'auto';
167
- selectedOpts.height = 'auto';
168
- } else {
169
- selectedOpts.autoDimensions = false;
170
- }
171
- }
172
-
173
- if (selectedOpts.modal) {
174
- selectedOpts.overlayShow = true;
175
- selectedOpts.hideOnOverlayClick = false;
176
- selectedOpts.hideOnContentClick = false;
177
- selectedOpts.enableEscapeButton = false;
178
- selectedOpts.showCloseButton = false;
179
- }
180
-
181
- selectedOpts.padding = parseInt(selectedOpts.padding, 10);
182
- selectedOpts.margin = parseInt(selectedOpts.margin, 10);
183
-
184
- tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
185
-
186
- $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
187
- $(this).replaceWith(content.children());
188
- });
189
-
190
- switch (type) {
191
- case 'html' :
192
- tmp.html( selectedOpts.content );
193
- _process_inline();
194
- break;
195
-
196
- case 'inline' :
197
- if ( $(obj).parent().is('#fancybox-content') === true) {
198
- busy = false;
199
- return;
200
- }
201
-
202
- $('<div class="fancybox-inline-tmp" />')
203
- .hide()
204
- .insertBefore( $(obj) )
205
- .bind('fancybox-cleanup', function() {
206
- $(this).replaceWith(content.children());
207
- }).bind('fancybox-cancel', function() {
208
- $(this).replaceWith(tmp.children());
209
- });
210
-
211
- $(obj).appendTo(tmp);
212
-
213
- _process_inline();
214
- break;
215
-
216
- case 'image':
217
- busy = false;
218
-
219
- $.fancybox.showActivity();
220
-
221
- imgPreloader = new Image();
222
-
223
- imgPreloader.onerror = function() {
224
- _error();
225
- };
226
-
227
- imgPreloader.onload = function() {
228
- busy = true;
229
-
230
- imgPreloader.onerror = imgPreloader.onload = null;
231
-
232
- _process_image();
233
- };
234
-
235
- imgPreloader.src = href;
236
- break;
237
-
238
- case 'swf':
239
- selectedOpts.scrolling = 'no';
240
-
241
- str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
242
- emb = '';
243
-
244
- $.each(selectedOpts.swf, function(name, val) {
245
- str += '<param name="' + name + '" value="' + val + '"></param>';
246
- emb += ' ' + name + '="' + val + '"';
247
- });
248
-
249
- str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';
250
-
251
- tmp.html(str);
252
-
253
- _process_inline();
254
- break;
255
-
256
- case 'ajax':
257
- busy = false;
258
-
259
- $.fancybox.showActivity();
260
-
261
- selectedOpts.ajax.win = selectedOpts.ajax.success;
262
-
263
- ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
264
- url : href,
265
- data : selectedOpts.ajax.data || {},
266
- error : function(XMLHttpRequest, textStatus, errorThrown) {
267
- if ( XMLHttpRequest.status > 0 ) {
268
- _error();
269
- }
270
- },
271
- success : function(data, textStatus, XMLHttpRequest) {
272
- var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
273
- if (o.status == 200) {
274
- if ( typeof selectedOpts.ajax.win == 'function' ) {
275
- ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
276
-
277
- if (ret === false) {
278
- loading.hide();
279
- return;
280
- } else if (typeof ret == 'string' || typeof ret == 'object') {
281
- data = ret;
282
- }
283
- }
284
-
285
- tmp.html( data );
286
- _process_inline();
287
- }
288
- }
289
- }));
290
-
291
- break;
292
-
293
- case 'iframe':
294
- _show();
295
- break;
296
- }
297
- },
298
-
299
- _process_inline = function() {
300
- var
301
- w = selectedOpts.width,
302
- h = selectedOpts.height;
303
-
304
- if (w.toString().indexOf('%') > -1) {
305
- w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
306
-
307
- } else {
308
- w = w == 'auto' ? 'auto' : w + 'px';
309
- }
310
-
311
- if (h.toString().indexOf('%') > -1) {
312
- h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
313
-
314
- } else {
315
- h = h == 'auto' ? 'auto' : h + 'px';
316
- }
317
-
318
- tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
319
-
320
- selectedOpts.width = tmp.width();
321
- selectedOpts.height = tmp.height();
322
-
323
- _show();
324
- },
325
-
326
- _process_image = function() {
327
- selectedOpts.width = imgPreloader.width;
328
- selectedOpts.height = imgPreloader.height;
329
-
330
- $("<img />").attr({
331
- 'id' : 'fancybox-img',
332
- 'src' : imgPreloader.src,
333
- 'alt' : selectedOpts.title
334
- }).appendTo( tmp );
335
-
336
- _show();
337
- },
338
-
339
- _show = function() {
340
- var pos, equal;
341
-
342
- loading.hide();
343
-
344
- if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
345
- $.event.trigger('fancybox-cancel');
346
-
347
- busy = false;
348
- return;
349
- }
350
-
351
- busy = true;
352
-
353
- $(content.add( overlay )).unbind();
354
-
355
- $(window).unbind("resize.fb scroll.fb");
356
- $(document).unbind('keydown.fb');
357
-
358
- if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
359
- wrap.css('height', wrap.height());
360
- }
361
-
362
- currentArray = selectedArray;
363
- currentIndex = selectedIndex;
364
- currentOpts = selectedOpts;
365
-
366
- if (currentOpts.overlayShow) {
367
- overlay.css({
368
- 'background-color' : currentOpts.overlayColor,
369
- 'opacity' : currentOpts.overlayOpacity,
370
- 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
371
- 'height' : $(document).height()
372
- });
373
-
374
- if (!overlay.is(':visible')) {
375
- if (isIE6) {
376
- $('select:not(#fancybox-tmp select)').filter(function() {
377
- return this.style.visibility !== 'hidden';
378
- }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
379
- this.style.visibility = 'inherit';
380
- });
381
- }
382
-
383
- overlay.show();
384
- }
385
- } else {
386
- overlay.hide();
387
- }
388
-
389
- final_pos = _get_zoom_to();
390
-
391
- _process_title();
392
-
393
- if (wrap.is(":visible")) {
394
- $( close.add( nav_left ).add( nav_right ) ).hide();
395
-
396
- pos = wrap.position(),
397
-
398
- start_pos = {
399
- top : pos.top,
400
- left : pos.left,
401
- width : wrap.width(),
402
- height : wrap.height()
403
- };
404
-
405
- equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);
406
-
407
- content.fadeTo(currentOpts.changeFade, 0.3, function() {
408
- var finish_resizing = function() {
409
- content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
410
- };
411
-
412
- $.event.trigger('fancybox-change');
413
-
414
- content
415
- .empty()
416
- .removeAttr('filter')
417
- .css({
418
- 'border-width' : currentOpts.padding,
419
- 'width' : final_pos.width - currentOpts.padding * 2,
420
- 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
421
- });
422
-
423
- if (equal) {
424
- finish_resizing();
425
-
426
- } else {
427
- fx.prop = 0;
428
-
429
- $(fx).animate({prop: 1}, {
430
- duration : currentOpts.changeSpeed,
431
- easing : currentOpts.easingChange,
432
- step : _draw,
433
- complete : finish_resizing
434
- });
435
- }
436
- });
437
-
438
- return;
439
- }
440
-
441
- wrap.removeAttr("style");
442
-
443
- content.css('border-width', currentOpts.padding);
444
-
445
- if (currentOpts.transitionIn == 'elastic') {
446
- start_pos = _get_zoom_from();
447
-
448
- content.html( tmp.contents() );
449
-
450
- wrap.show();
451
-
452
- if (currentOpts.opacity) {
453
- final_pos.opacity = 0;
454
- }
455
-
456
- fx.prop = 0;
457
-
458
- $(fx).animate({prop: 1}, {
459
- duration : currentOpts.speedIn,
460
- easing : currentOpts.easingIn,
461
- step : _draw,
462
- complete : _finish
463
- });
464
-
465
- return;
466
- }
467
-
468
- if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
469
- title.show();
470
- }
471
-
472
- content
473
- .css({
474
- 'width' : final_pos.width - currentOpts.padding * 2,
475
- 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
476
- })
477
- .html( tmp.contents() );
478
-
479
- wrap
480
- .css(final_pos)
481
- .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
482
- },
483
-
484
- _format_title = function(title) {
485
- if (title && title.length) {
486
- if (currentOpts.titlePosition == 'float') {
487
- return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
488
- }
489
-
490
- return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
491
- }
492
-
493
- return false;
494
- },
495
-
496
- _process_title = function() {
497
- titleStr = currentOpts.title || '';
498
- titleHeight = 0;
499
-
500
- title
501
- .empty()
502
- .removeAttr('style')
503
- .removeClass();
504
-
505
- if (currentOpts.titleShow === false) {
506
- title.hide();
507
- return;
508
- }
509
-
510
- titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
511
-
512
- if (!titleStr || titleStr === '') {
513
- title.hide();
514
- return;
515
- }
516
-
517
- title
518
- .addClass('fancybox-title-' + currentOpts.titlePosition)
519
- .html( titleStr )
520
- .appendTo( 'body' )
521
- .show();
522
-
523
- switch (currentOpts.titlePosition) {
524
- case 'inside':
525
- title
526
- .css({
527
- 'width' : final_pos.width - (currentOpts.padding * 2),
528
- 'marginLeft' : currentOpts.padding,
529
- 'marginRight' : currentOpts.padding
530
- });
531
-
532
- titleHeight = title.outerHeight(true);
533
-
534
- title.appendTo( outer );
535
-
536
- final_pos.height += titleHeight;
537
- break;
538
-
539
- case 'over':
540
- title
541
- .css({
542
- 'marginLeft' : currentOpts.padding,
543
- 'width' : final_pos.width - (currentOpts.padding * 2),
544
- 'bottom' : currentOpts.padding
545
- })
546
- .appendTo( outer );
547
- break;
548
-
549
- case 'float':
550
- title
551
- .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
552
- .appendTo( wrap );
553
- break;
554
-
555
- default:
556
- title
557
- .css({
558
- 'width' : final_pos.width - (currentOpts.padding * 2),
559
- 'paddingLeft' : currentOpts.padding,
560
- 'paddingRight' : currentOpts.padding
561
- })
562
- .appendTo( wrap );
563
- break;
564
- }
565
-
566
- title.hide();
567
- },
568
-
569
- _set_navigation = function() {
570
- if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
571
- $(document).bind('keydown.fb', function(e) {
572
- if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
573
- e.preventDefault();
574
- $.fancybox.close();
575
-
576
- } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
577
- e.preventDefault();
578
- $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
579
- }
580
- });
581
- }
582
-
583
- if (!currentOpts.showNavArrows) {
584
- nav_left.hide();
585
- nav_right.hide();
586
- return;
587
- }
588
-
589
- if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
590
- nav_left.show();
591
- }
592
-
593
- if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
594
- nav_right.show();
595
- }
596
- },
597
-
598
- _finish = function () {
599
- if (!$.support.opacity) {
600
- content.get(0).style.removeAttribute('filter');
601
- wrap.get(0).style.removeAttribute('filter');
602
- }
603
-
604
- if (selectedOpts.autoDimensions) {
605
- content.css('height', 'auto');
606
- }
607
-
608
- wrap.css('height', 'auto');
609
-
610
- if (titleStr && titleStr.length) {
611
- title.show();
612
- }
613
-
614
- if (currentOpts.showCloseButton) {
615
- close.show();
616
- }
617
-
618
- _set_navigation();
619
-
620
- if (currentOpts.hideOnContentClick) {
621
- content.bind('click', $.fancybox.close);
622
- }
623
-
624
- if (currentOpts.hideOnOverlayClick) {
625
- overlay.bind('click', $.fancybox.close);
626
- }
627
-
628
- $(window).bind("resize.fb", $.fancybox.resize);
629
-
630
- if (currentOpts.centerOnScroll) {
631
- $(window).bind("scroll.fb", $.fancybox.center);
632
- }
633
-
634
- if (currentOpts.type == 'iframe') {
635
- $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + (videoToShow !== '' ? videoToShow : currentOpts.href) + '"></iframe>').appendTo(content);
636
-
637
- videoToShow = ''
638
- }
639
-
640
- wrap.show();
641
-
642
- busy = false;
643
-
644
- $.fancybox.center();
645
-
646
- currentOpts.onComplete(currentArray, currentIndex, currentOpts);
647
-
648
- _preload_images();
649
- },
650
-
651
- _preload_images = function() {
652
- var href,
653
- objNext;
654
-
655
- if ((currentArray.length -1) > currentIndex) {
656
- href = currentArray[ currentIndex + 1 ].href;
657
-
658
- if (typeof href !== 'undefined' && href.match(imgRegExp)) {
659
- objNext = new Image();
660
- objNext.src = href;
661
- }
662
- }
663
-
664
- if (currentIndex > 0) {
665
- href = currentArray[ currentIndex - 1 ].href;
666
-
667
- if (typeof href !== 'undefined' && href.match(imgRegExp)) {
668
- objNext = new Image();
669
- objNext.src = href;
670
- }
671
- }
672
- },
673
-
674
- _draw = function(pos) {
675
- var dim = {
676
- width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
677
- height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),
678
-
679
- top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
680
- left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
681
- };
682
-
683
- if (typeof final_pos.opacity !== 'undefined') {
684
- dim.opacity = pos < 0.5 ? 0.5 : pos;
685
- }
686
-
687
- wrap.css(dim);
688
-
689
- content.css({
690
- 'width' : dim.width - currentOpts.padding * 2,
691
- 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
692
- });
693
- },
694
-
695
- _get_viewport = function() {
696
- return [
697
- $(window).width() - (currentOpts.margin * 2),
698
- $(window).height() - (currentOpts.margin * 2),
699
- $(document).scrollLeft() + currentOpts.margin,
700
- $(document).scrollTop() + currentOpts.margin
701
- ];
702
- },
703
-
704
- _get_zoom_to = function () {
705
- var view = _get_viewport(),
706
- to = {},
707
- resize = currentOpts.autoScale,
708
- double_padding = currentOpts.padding * 2,
709
- ratio;
710
-
711
- if (currentOpts.width.toString().indexOf('%') > -1) {
712
- to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
713
- } else {
714
- to.width = currentOpts.width + double_padding;
715
- }
716
-
717
- if (currentOpts.height.toString().indexOf('%') > -1) {
718
- to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
719
- } else {
720
- to.height = currentOpts.height + double_padding;
721
- }
722
-
723
- if (resize && (to.width > view[0] || to.height > view[1])) {
724
- if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
725
- ratio = (currentOpts.width ) / (currentOpts.height );
726
-
727
- if ((to.width ) > view[0]) {
728
- to.width = view[0];
729
- to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
730
- }
731
-
732
- if ((to.height) > view[1]) {
733
- to.height = view[1];
734
- to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
735
- }
736
-
737
- } else {
738
- to.width = Math.min(to.width, view[0]);
739
- to.height = Math.min(to.height, view[1]);
740
- }
741
- }
742
-
743
- to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
744
- to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);
745
-
746
- return to;
747
- },
748
-
749
- _get_obj_pos = function(obj) {
750
- var pos = obj.offset();
751
-
752
- pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
753
- pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;
754
-
755
- pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
756
- pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;
757
-
758
- pos.width = obj.width();
759
- pos.height = obj.height();
760
-
761
- return pos;
762
- },
763
-
764
- _get_zoom_from = function() {
765
- var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
766
- from = {},
767
- pos,
768
- view;
769
-
770
- if (orig && orig.length) {
771
- pos = _get_obj_pos(orig);
772
-
773
- from = {
774
- width : pos.width + (currentOpts.padding * 2),
775
- height : pos.height + (currentOpts.padding * 2),
776
- top : pos.top - currentOpts.padding - 20,
777
- left : pos.left - currentOpts.padding - 20
778
- };
779
-
780
- } else {
781
- view = _get_viewport();
782
-
783
- from = {
784
- width : currentOpts.padding * 2,
785
- height : currentOpts.padding * 2,
786
- top : parseInt(view[3] + view[1] * 0.5, 10),
787
- left : parseInt(view[2] + view[0] * 0.5, 10)
788
- };
789
- }
790
-
791
- return from;
792
- },
793
-
794
- _animate_loading = function() {
795
- if (!loading.is(':visible')){
796
- clearInterval(loadingTimer);
797
- return;
798
- }
799
-
800
- $('div', loading).css('top', (loadingFrame * -40) + 'px');
801
-
802
- loadingFrame = (loadingFrame + 1) % 12;
803
- };
804
-
805
- /*
806
- * Public methods
807
- */
808
-
809
- $.fn.fancybox = function(options) {
810
- if (!$(this).length) {
811
- return this;
812
- }
813
-
814
- $(this)
815
- .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
816
- .unbind('click.fb')
817
- .bind('click.fb', function(e) {
818
- e.preventDefault();
819
-
820
- if (busy) {
821
- return;
822
- }
823
-
824
- busy = true;
825
-
826
- $(this).blur();
827
-
828
- selectedArray = [];
829
- selectedIndex = 0;
830
-
831
- var rel = $(this).attr('rel') || '';
832
-
833
- if (!rel || rel == '' || rel === 'nofollow') {
834
- selectedArray.push(this);
835
- } else {
836
- selectedArray = $('a[rel="'+rel+'"], area[rel="'+rel+'"]');
837
- selectedIndex = selectedArray.index(this);
838
- }
839
-
840
- _start();
841
-
842
- return;
843
- });
844
-
845
- return this;
846
- };
847
-
848
- $.fancybox = function(obj) {
849
- var opts;
850
-
851
- if (busy) {
852
- return;
853
- }
854
-
855
- busy = true;
856
- opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
857
-
858
- selectedArray = [];
859
- selectedIndex = parseInt(opts.index, 10) || 0;
860
-
861
- if ($.isArray(obj)) {
862
- for (var i = 0, j = obj.length; i < j; i++) {
863
- if (typeof obj[i] == 'object') {
864
- $(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
865
- } else {
866
- obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
867
- }
868
- }
869
-
870
- selectedArray = jQuery.merge(selectedArray, obj);
871
-
872
- } else {
873
- if (typeof obj == 'object') {
874
- $(obj).data('fancybox', $.extend({}, opts, obj));
875
- } else {
876
- obj = $({}).data('fancybox', $.extend({content : obj}, opts));
877
- }
878
-
879
- selectedArray.push(obj);
880
- }
881
-
882
- if (selectedIndex > selectedArray.length || selectedIndex < 0) {
883
- selectedIndex = 0;
884
- }
885
-
886
- _start();
887
- };
888
-
889
- $.fancybox.showActivity = function() {
890
- clearInterval(loadingTimer);
891
-
892
- loading.show();
893
- loadingTimer = setInterval(_animate_loading, 66);
894
- };
895
-
896
- $.fancybox.hideActivity = function() {
897
- loading.hide();
898
- };
899
-
900
- $.fancybox.next = function() {
901
- return $.fancybox.pos( currentIndex + 1);
902
- };
903
-
904
- $.fancybox.prev = function() {
905
- return $.fancybox.pos( currentIndex - 1);
906
- };
907
-
908
- $.fancybox.pos = function(pos) {
909
- if (busy) {
910
- return;
911
- }
912
-
913
- pos = parseInt(pos);
914
-
915
- selectedArray = currentArray;
916
-
917
- if (pos > -1 && pos < currentArray.length) {
918
- selectedIndex = pos;
919
- _start();
920
-
921
- } else if (currentOpts.cyclic && currentArray.length > 1) {
922
- selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
923
- _start();
924
- }
925
-
926
- return;
927
- };
928
-
929
- $.fancybox.cancel = function() {
930
- if (busy) {
931
- return;
932
- }
933
-
934
- busy = true;
935
-
936
- $.event.trigger('fancybox-cancel');
937
-
938
- _abort();
939
-
940
- selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
941
-
942
- busy = false;
943
- };
944
-
945
- // Note: within an iframe use - parent.$.fancybox.close();
946
- $.fancybox.close = function() {
947
- if (busy || wrap.is(':hidden')) {
948
- return;
949
- }
950
-
951
- busy = true;
952
-
953
- if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
954
- busy = false;
955
- return;
956
- }
957
-
958
- _abort();
959
-
960
- $(close.add( nav_left ).add( nav_right )).hide();
961
-
962
- $(content.add( overlay )).unbind();
963
-
964
- $(window).unbind("resize.fb scroll.fb");
965
- $(document).unbind('keydown.fb');
966
-
967
- content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
968
-
969
- if (currentOpts.titlePosition !== 'inside') {
970
- title.empty();
971
- }
972
-
973
- wrap.stop();
974
-
975
- function _cleanup() {
976
- overlay.fadeOut('fast');
977
-
978
- title.empty().hide();
979
- wrap.hide();
980
-
981
- $.event.trigger('fancybox-cleanup');
982
-
983
- content.empty();
984
-
985
- currentOpts.onClosed(currentArray, currentIndex, currentOpts);
986
-
987
- currentArray = selectedOpts = [];
988
- currentIndex = selectedIndex = 0;
989
- currentOpts = selectedOpts = {};
990
-
991
- busy = false;
992
- }
993
-
994
- if (currentOpts.transitionOut == 'elastic') {
995
- start_pos = _get_zoom_from();
996
-
997
- var pos = wrap.position();
998
-
999
- final_pos = {
1000
- top : pos.top ,
1001
- left : pos.left,
1002
- width : wrap.width(),
1003
- height : wrap.height()
1004
- };
1005
-
1006
- if (currentOpts.opacity) {
1007
- final_pos.opacity = 1;
1008
- }
1009
-
1010
- title.empty().hide();
1011
-
1012
- fx.prop = 1;
1013
-
1014
- $(fx).animate({ prop: 0 }, {
1015
- duration : currentOpts.speedOut,
1016
- easing : currentOpts.easingOut,
1017
- step : _draw,
1018
- complete : _cleanup
1019
- });
1020
-
1021
- } else {
1022
- wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
1023
- }
1024
- };
1025
-
1026
- $.fancybox.resize = function() {
1027
- if (overlay.is(':visible')) {
1028
- overlay.css('height', $(document).height());
1029
- }
1030
-
1031
- $.fancybox.center(true);
1032
- };
1033
-
1034
- $.fancybox.center = function() {
1035
- var view, align;
1036
-
1037
- if (busy) {
1038
- return;
1039
- }
1040
-
1041
- align = arguments[0] === true ? 1 : 0;
1042
- view = _get_viewport();
1043
-
1044
- if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
1045
- return;
1046
- }
1047
-
1048
- wrap
1049
- .stop()
1050
- .animate({
1051
- 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
1052
- 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
1053
- }, typeof arguments[0] == 'number' ? arguments[0] : 200);
1054
- };
1055
-
1056
- $.fancybox.init = function() {
1057
- if ($("#fancybox-wrap").length) {
1058
- return;
1059
- }
1060
-
1061
- $('body').append(
1062
- tmp = $('<div id="fancybox-tmp"></div>'),
1063
- loading = $('<div id="fancybox-loading"><div></div></div>'),
1064
- overlay = $('<div id="fancybox-overlay"></div>'),
1065
- wrap = $('<div id="fancybox-wrap"></div>')
1066
- );
1067
-
1068
- outer = $('<div id="fancybox-outer"></div>')
1069
- .append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>')
1070
- .appendTo( wrap );
1071
-
1072
- outer.append(
1073
- content = $('<div id="fancybox-content"></div>'),
1074
- close = $('<a id="fancybox-close"></a>'),
1075
- title = $('<div id="fancybox-title"></div>'),
1076
-
1077
- nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
1078
- nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
1079
- );
1080
-
1081
- close.click($.fancybox.close);
1082
- loading.click($.fancybox.cancel);
1083
-
1084
- nav_left.click(function(e) {
1085
- e.preventDefault();
1086
- $.fancybox.prev();
1087
- });
1088
-
1089
- nav_right.click(function(e) {
1090
- e.preventDefault();
1091
- $.fancybox.next();
1092
- });
1093
-
1094
- if ($.fn.mousewheel) {
1095
- wrap.bind('mousewheel.fb', function(e, delta) {
1096
- if (busy) {
1097
- e.preventDefault();
1098
-
1099
- } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
1100
- e.preventDefault();
1101
- $.fancybox[ delta > 0 ? 'prev' : 'next']();
1102
- }
1103
- });
1104
- }
1105
-
1106
- if (!$.support.opacity) {
1107
- wrap.addClass('fancybox-ie');
1108
- }
1109
-
1110
- if (isIE6) {
1111
- loading.addClass('fancybox-ie6');
1112
- wrap.addClass('fancybox-ie6');
1113
-
1114
- $('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
1115
- }
1116
- };
1117
-
1118
- $.fn.fancybox.defaults = {
1119
- padding : 10,
1120
- margin : 40,
1121
- opacity : false,
1122
- modal : false,
1123
- cyclic : false,
1124
- scrolling : 'auto', // 'auto', 'yes' or 'no'
1125
-
1126
- width : 560,
1127
- height : 340,
1128
-
1129
- autoScale : true,
1130
- autoDimensions : true,
1131
- centerOnScroll : false,
1132
-
1133
- ajax : {},
1134
- swf : { wmode: 'transparent' },
1135
-
1136
- hideOnOverlayClick : true,
1137
- hideOnContentClick : false,
1138
-
1139
- overlayShow : true,
1140
- overlayOpacity : 0.7,
1141
- overlayColor : '#777',
1142
-
1143
- titleShow : true,
1144
- titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
1145
- titleFormat : null,
1146
- titleFromAlt : false,
1147
-
1148
- transitionIn : 'fade', // 'elastic', 'fade' or 'none'
1149
- transitionOut : 'fade', // 'elastic', 'fade' or 'none'
1150
-
1151
- speedIn : 300,
1152
- speedOut : 300,
1153
-
1154
- changeSpeed : 300,
1155
- changeFade : 'fast',
1156
-
1157
- easingIn : 'swing',
1158
- easingOut : 'swing',
1159
-
1160
- showCloseButton : true,
1161
- showNavArrows : true,
1162
- enableEscapeButton : true,
1163
- enableKeyboardNav : true,
1164
-
1165
- onStart : function(){},
1166
- onCancel : function(){},
1167
- onComplete : function(){},
1168
- onCleanup : function(){},
1169
- onClosed : function(){},
1170
- onError : function(){}
1171
- };
1172
-
1173
- $(document).ready(function() {
1174
- $.fancybox.init();
1175
- });
1176
-
1177
})(jQuery);
1
+ /*
2
+ * FancyBox - jQuery Plugin
3
+ * Simple and fancy lightbox alternative
4
+ *
5
+ * Examples and documentation at: http://fancybox.net
6
+ *
7
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
8
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Version: 1.3.4 (11/11/2010)
11
+ * Requires: jQuery v1.3+
12
+ *
13
+ * Dual licensed under the MIT and GPL licenses:
14
+ * http://www.opensource.org/licenses/mit-license.php
15
+ * http://www.gnu.org/licenses/gpl.html
16
+ */
17
+
18
+ ;(function($) {
19
+ var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
20
+
21
+ videoToShow = '',
22
+
23
+ selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
24
+
25
+ ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?#x2F;i, swfRegExp = /[^\.]\.(swf)\s*#x2F;i,
26
+
27
+ loadingTimer, loadingFrame = 1,
28
+
29
+ titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
30
+
31
+ isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
32
+
33
+ /*
34
+ * Private methods
35
+ */
36
+
37
+ _abort = function() {
38
+ loading.hide();
39
+
40
+ imgPreloader.onerror = imgPreloader.onload = null;
41
+
42
+ if (ajaxLoader) {
43
+ ajaxLoader.abort();
44
+ }
45
+
46
+ tmp.empty();
47
+ },
48
+
49
+ _error = function() {
50
+ if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
51
+ loading.hide();
52
+ busy = false;
53
+ return;
54
+ }
55
+
56
+ selectedOpts.titleShow = false;
57
+
58
+ selectedOpts.width = 'auto';
59
+ selectedOpts.height = 'auto';
60
+
61
+ tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' );
62
+
63
+ _process_inline();
64
+ },
65
+
66
+ _is_video = function(videoURL) {
67
+ var matchesYoutube = videoURL.match(/(?:(?:http|https):\/\/)?(?:www\.)?youtube.com\/watch\?v=([a-zA-Z0-9\-_]+)/);
68
+
69
+ if(matchesYoutube) {
70
+ videoToShow = 'http://www.youtube.com/embed/'+matchesYoutube[1];
71
+ return true;
72
+ }
73
+
74
+ var matchesVimeo = videoURL.match(/(?:(?:http|https):\/\/)?(?:www\.)?vimeo.com\/([0-9]+)/);
75
+
76
+ if (matchesVimeo){
77
+ videoToShow = 'http://player.vimeo.com/video/'+matchesVimeo[1];
78
+ return true;
79
+ }
80
+
81
+ return false;
82
+ },
83
+
84
+ _start = function() {
85
+ var obj = selectedArray[ selectedIndex ],
86
+ href,
87
+ type,
88
+ title,
89
+ str,
90
+ emb,
91
+ ret;
92
+
93
+ _abort();
94
+
95
+ selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
96
+
97
+ ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
98
+
99
+ if (ret === false) {
100
+ busy = false;
101
+ return;
102
+ } else if (typeof ret == 'object') {
103
+ selectedOpts = $.extend(selectedOpts, ret);
104
+ }
105
+
106
+ title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
107
+
108
+ if (obj.nodeName && !selectedOpts.orig) {
109
+ selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
110
+ }
111
+
112
+ if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
113
+ title = selectedOpts.orig.attr('alt');
114
+ }
115
+
116
+ href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
117
+
118
+ if ((/^(?:javascript)/i).test(href) || href == '#') {
119
+ href = null;
120
+ }
121
+
122
+ if (selectedOpts.type) {
123
+ type = selectedOpts.type;
124
+
125
+ if (!href) {
126
+ href = selectedOpts.content;
127
+ }
128
+
129
+ } else if (selectedOpts.content) {
130
+ type = 'html';
131
+
132
+ } else if (href) {
133
+ if (href.match(imgRegExp)) {
134
+ type = 'image';
135
+
136
+ } else if (href.match(swfRegExp)) {
137
+ type = 'swf';
138
+
139
+ } else if ($(obj).hasClass('iframe') || _is_video($(obj).attr('href'))) {
140
+ type = 'iframe';
141
+
142
+ } else if (href.indexOf("#") === 0) {
143
+ type = 'inline';
144
+
145
+ } else {
146
+ type = 'ajax';
147
+ }
148
+ }
149
+
150
+ if (!type) {
151
+ _error();
152
+ return;
153
+ }
154
+
155
+ if (type == 'inline') {
156
+ obj = href.substr(href.indexOf("#"));
157
+ type = $(obj).length > 0 ? 'inline' : 'ajax';
158
+ }
159
+
160
+ selectedOpts.type = type;
161
+ selectedOpts.href = href;
162
+ selectedOpts.title = title;
163
+
164
+ if (selectedOpts.autoDimensions) {
165
+ if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
166
+ selectedOpts.width = 'auto';
167
+ selectedOpts.height = 'auto';
168
+ } else {
169
+ selectedOpts.autoDimensions = false;
170
+ }
171
+ }
172
+
173
+ if (selectedOpts.modal) {
174
+ selectedOpts.overlayShow = true;
175
+ selectedOpts.hideOnOverlayClick = false;
176
+ selectedOpts.hideOnContentClick = false;
177
+ selectedOpts.enableEscapeButton = false;
178
+ selectedOpts.showCloseButton = false;
179
+ }
180
+
181
+ selectedOpts.padding = parseInt(selectedOpts.padding, 10);
182
+ selectedOpts.margin = parseInt(selectedOpts.margin, 10);
183
+
184
+ tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
185
+
186
+ $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
187
+ $(this).replaceWith(content.children());
188
+ });
189
+
190
+ switch (type) {
191
+ case 'html' :
192
+ tmp.html( selectedOpts.content );
193
+ _process_inline();
194
+ break;
195
+
196
+ case 'inline' :
197
+ if ( $(obj).parent().is('#fancybox-content') === true) {
198
+ busy = false;
199
+ return;
200
+ }
201
+
202
+ $('<div class="fancybox-inline-tmp" />')
203
+ .hide()
204
+ .insertBefore( $(obj) )
205
+ .bind('fancybox-cleanup', function() {
206
+ $(this).replaceWith(content.children());
207
+ }).bind('fancybox-cancel', function() {
208
+ $(this).replaceWith(tmp.children());
209
+ });
210
+
211
+ $(obj).appendTo(tmp);
212
+
213
+ _process_inline();
214
+ break;
215
+
216
+ case 'image':
217
+ busy = false;
218
+
219
+ $.fancybox.showActivity();
220
+
221
+ imgPreloader = new Image();
222
+
223
+ imgPreloader.onerror = function() {
224
+ _error();
225
+ };
226
+
227
+ imgPreloader.onload = function() {
228
+ busy = true;
229
+
230
+ imgPreloader.onerror = imgPreloader.onload = null;
231
+
232
+ _process_image();
233
+ };
234
+
235
+ imgPreloader.src = href;
236
+ break;
237
+
238
+ case 'swf':
239
+ selectedOpts.scrolling = 'no';
240
+
241
+ str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
242
+ emb = '';
243
+
244
+ $.each(selectedOpts.swf, function(name, val) {
245
+ str += '<param name="' + name + '" value="' + val + '"></param>';
246
+ emb += ' ' + name + '="' + val + '"';
247
+ });
248
+
249
+ str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';
250
+
251
+ tmp.html(str);
252
+
253
+ _process_inline();
254
+ break;
255
+
256
+ case 'ajax':
257
+ busy = false;
258
+
259
+ $.fancybox.showActivity();
260
+
261
+ selectedOpts.ajax.win = selectedOpts.ajax.success;
262
+
263
+ ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
264
+ url : href,
265
+ data : selectedOpts.ajax.data || {},
266
+ error : function(XMLHttpRequest, textStatus, errorThrown) {
267
+ if ( XMLHttpRequest.status > 0 ) {
268
+ _error();
269
+ }
270
+ },
271
+ success : function(data, textStatus, XMLHttpRequest) {
272
+ var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
273
+ if (o.status == 200) {
274
+ if ( typeof selectedOpts.ajax.win == 'function' ) {
275
+ ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
276
+
277
+ if (ret === false) {
278
+ loading.hide();
279
+ return;
280
+ } else if (typeof ret == 'string' || typeof ret == 'object') {
281
+ data = ret;
282
+ }
283
+ }
284
+
285
+ tmp.html( data );
286
+ _process_inline();
287
+ }
288
+ }
289
+ }));
290
+
291
+ break;
292
+
293
+ case 'iframe':
294
+ _show();
295
+ break;
296
+ }
297
+ },
298
+
299
+ _process_inline = function() {
300
+ var
301
+ w = selectedOpts.width,
302
+ h = selectedOpts.height;
303
+
304
+ if (w.toString().indexOf('%') > -1) {
305
+ w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
306
+
307
+ } else {
308
+ w = w == 'auto' ? 'auto' : w + 'px';
309
+ }
310
+
311
+ if (h.toString().indexOf('%') > -1) {
312
+ h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
313
+
314
+ } else {
315
+ h = h == 'auto' ? 'auto' : h + 'px';
316
+ }
317
+
318
+ tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
319
+
320
+ selectedOpts.width = tmp.width();
321
+ selectedOpts.height = tmp.height();
322
+
323
+ _show();
324
+ },
325
+
326
+ _process_image = function() {
327
+ selectedOpts.width = imgPreloader.width;
328
+ selectedOpts.height = imgPreloader.height;
329
+
330
+ $("<img />").attr({
331
+ 'id' : 'fancybox-img',
332
+ 'src' : imgPreloader.src,
333
+ 'alt' : selectedOpts.title
334
+ }).appendTo( tmp );
335
+
336
+ _show();
337
+ },
338
+
339
+ _show = function() {
340
+ var pos, equal;
341
+
342
+ loading.hide();
343
+
344
+ if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
345
+ $.event.trigger('fancybox-cancel');
346
+
347
+ busy = false;
348
+ return;
349
+ }
350
+
351
+ busy = true;
352
+
353
+ $(content.add( overlay )).unbind();
354
+
355
+ $(window).unbind("resize.fb scroll.fb");
356
+ $(document).unbind('keydown.fb');
357
+
358
+ if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
359
+ wrap.css('height', wrap.height());
360
+ }
361
+
362
+ currentArray = selectedArray;
363
+ currentIndex = selectedIndex;
364
+ currentOpts = selectedOpts;
365
+
366
+ if (currentOpts.overlayShow) {
367
+ overlay.css({
368
+ 'background-color' : currentOpts.overlayColor,
369
+ 'opacity' : currentOpts.overlayOpacity,
370
+ 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
371
+ 'height' : $(document).height()
372
+ });
373
+
374
+ if (!overlay.is(':visible')) {
375
+ if (isIE6) {
376
+ $('select:not(#fancybox-tmp select)').filter(function() {
377
+ return this.style.visibility !== 'hidden';
378
+ }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
379
+ this.style.visibility = 'inherit';
380
+ });
381
+ }
382
+
383
+ overlay.show();
384
+ }
385
+ } else {
386
+ overlay.hide();
387
+ }
388
+
389
+ final_pos = _get_zoom_to();
390
+
391
+ _process_title();
392
+
393
+ if (wrap.is(":visible")) {
394
+ $( close.add( nav_left ).add( nav_right ) ).hide();
395
+
396
+ pos = wrap.position(),
397
+
398
+ start_pos = {
399
+ top : pos.top,
400
+ left : pos.left,
401
+ width : wrap.width(),
402
+ height : wrap.height()
403
+ };
404
+
405
+ equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);
406
+
407
+ content.fadeTo(currentOpts.changeFade, 0.3, function() {
408
+ var finish_resizing = function() {
409
+ content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
410
+ };
411
+
412
+ $.event.trigger('fancybox-change');
413
+
414
+ content
415
+ .empty()
416
+ .removeAttr('filter')
417
+ .css({
418
+ 'border-width' : currentOpts.padding,
419
+ 'width' : final_pos.width - currentOpts.padding * 2,
420
+ 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
421
+ });
422
+
423
+ if (equal) {
424
+ finish_resizing();
425
+
426
+ } else {
427
+ fx.prop = 0;
428
+
429
+ $(fx).animate({prop: 1}, {
430
+ duration : currentOpts.changeSpeed,
431
+ easing : currentOpts.easingChange,
432
+ step : _draw,
433
+ complete : finish_resizing
434
+ });
435
+ }
436
+ });
437
+
438
+ return;
439
+ }
440
+
441
+ wrap.removeAttr("style");
442
+
443
+ content.css('border-width', currentOpts.padding);
444
+
445
+ if (currentOpts.transitionIn == 'elastic') {
446
+ start_pos = _get_zoom_from();
447
+
448
+ content.html( tmp.contents() );
449
+
450
+ wrap.show();
451
+
452
+ if (currentOpts.opacity) {
453
+ final_pos.opacity = 0;
454
+ }
455
+
456
+ fx.prop = 0;
457
+
458
+ $(fx).animate({prop: 1}, {
459
+ duration : currentOpts.speedIn,
460
+ easing : currentOpts.easingIn,
461
+ step : _draw,
462
+ complete : _finish
463
+ });
464
+
465
+ return;
466
+ }
467
+
468
+ if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
469
+ title.show();
470
+ }
471
+
472
+ content
473
+ .css({
474
+ 'width' : final_pos.width - currentOpts.padding * 2,
475
+ 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
476
+ })
477
+ .html( tmp.contents() );
478
+
479
+ wrap
480
+ .css(final_pos)
481
+ .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
482
+ },
483
+
484
+ _format_title = function(title) {
485
+ if (title && title.length) {
486
+ if (currentOpts.titlePosition == 'float') {
487
+ return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
488
+ }
489
+
490
+ return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
491
+ }
492
+
493
+ return false;
494
+ },
495
+
496
+ _process_title = function() {
497
+ titleStr = currentOpts.title || '';
498
+ titleHeight = 0;
499
+
500
+ title
501
+ .empty()
502
+ .removeAttr('style')
503
+ .removeClass();
504
+
505
+ if (currentOpts.titleShow === false) {
506
+ title.hide();
507
+ return;
508
+ }
509
+
510
+ titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
511
+
512
+ if (!titleStr || titleStr === '') {
513
+ title.hide();
514
+ return;
515
+ }
516
+
517
+ title
518
+ .addClass('fancybox-title-' + currentOpts.titlePosition)
519
+ .html( titleStr )
520
+ .appendTo( 'body' )
521
+ .show();
522
+
523
+ switch (currentOpts.titlePosition) {
524
+ case 'inside':
525
+ title
526
+ .css({
527
+ 'width' : final_pos.width - (currentOpts.padding * 2),
528
+ 'marginLeft' : currentOpts.padding,
529
+ 'marginRight' : currentOpts.padding
530
+ });
531
+
532
+ titleHeight = title.outerHeight(true);
533
+
534
+ title.appendTo( outer );
535
+
536
+ final_pos.height += titleHeight;
537
+ break;
538
+
539
+ case 'over':
540
+ title
541
+ .css({
542
+ 'marginLeft' : currentOpts.padding,
543
+ 'width' : final_pos.width - (currentOpts.padding * 2),
544
+ 'bottom' : currentOpts.padding
545
+ })
546
+ .appendTo( outer );
547
+ break;
548
+
549
+ case 'float':
550
+ title
551
+ .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
552
+ .appendTo( wrap );
553
+ break;
554
+
555
+ default:
556
+ title
557
+ .css({
558
+ 'width' : final_pos.width - (currentOpts.padding * 2),
559
+ 'paddingLeft' : currentOpts.padding,
560
+ 'paddingRight' : currentOpts.padding
561
+ })
562
+ .appendTo( wrap );
563
+ break;
564
+ }
565
+
566
+ title.hide();
567
+ },
568
+
569
+ _set_navigation = function() {
570
+ if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
571
+ $(document).bind('keydown.fb', function(e) {
572
+ if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
573
+ e.preventDefault();
574
+ $.fancybox.close();
575
+
576
+ } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
577
+ e.preventDefault();
578
+ $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
579
+ }
580
+ });
581
+ }
582
+
583
+ if (!currentOpts.showNavArrows) {
584
+ nav_left.hide();
585
+ nav_right.hide();
586
+ return;
587
+ }
588
+
589
+ if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
590
+ nav_left.show();
591
+ }
592
+
593
+ if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
594
+ nav_right.show();
595
+ }
596
+ },
597
+
598
+ _finish = function () {
599
+ if (!$.support.opacity) {
600
+ content.get(0).style.removeAttribute('filter');
601
+ wrap.get(0).style.removeAttribute('filter');
602
+ }
603
+
604
+ if (selectedOpts.autoDimensions) {
605
+ content.css('height', 'auto');
606
+ }
607
+
608
+ wrap.css('height', 'auto');
609
+
610
+ if (titleStr && titleStr.length) {
611
+ title.show();
612
+ }
613
+
614
+ if (currentOpts.showCloseButton) {
615
+ close.show();
616
+ }
617
+
618
+ _set_navigation();
619
+
620
+ if (currentOpts.hideOnContentClick) {
621
+ content.bind('click', $.fancybox.close);
622
+ }
623
+
624
+ if (currentOpts.hideOnOverlayClick) {
625
+ overlay.bind('click', $.fancybox.close);
626
+ }
627
+
628
+ $(window).bind("resize.fb", $.fancybox.resize);
629
+
630
+ if (currentOpts.centerOnScroll) {
631
+ $(window).bind("scroll.fb", $.fancybox.center);
632
+ }
633
+
634
+ if (currentOpts.type == 'iframe') {
635
+ $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + (videoToShow !== '' ? videoToShow : currentOpts.href) + '"></iframe>').appendTo(content);
636
+
637
+ videoToShow = ''
638
+ }
639
+
640
+ wrap.show();
641
+
642
+ busy = false;
643
+
644
+ $.fancybox.center();
645
+
646
+ currentOpts.onComplete(currentArray, currentIndex, currentOpts);
647
+
648
+ _preload_images();
649
+ },
650
+
651
+ _preload_images = function() {
652
+ var href,
653
+ objNext;
654
+
655
+ if ((currentArray.length -1) > currentIndex) {
656
+ href = currentArray[ currentIndex + 1 ].href;
657
+
658
+ if (typeof href !== 'undefined' && href.match(imgRegExp)) {
659
+ objNext = new Image();
660
+ objNext.src = href;
661
+ }
662
+ }
663
+
664
+ if (currentIndex > 0) {
665
+ href = currentArray[ currentIndex - 1 ].href;
666
+
667
+ if (typeof href !== 'undefined' && href.match(imgRegExp)) {
668
+ objNext = new Image();
669
+ objNext.src = href;
670
+ }
671
+ }
672
+ },
673
+
674
+ _draw = function(pos) {
675
+ var dim = {
676
+ width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
677
+ height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),
678
+
679
+ top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
680
+ left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
681
+ };
682
+
683
+ if (typeof final_pos.opacity !== 'undefined') {
684
+ dim.opacity = pos < 0.5 ? 0.5 : pos;
685
+ }
686
+
687
+ wrap.css(dim);
688
+
689
+ content.css({
690
+ 'width' : dim.width - currentOpts.padding * 2,
691
+ 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
692
+ });
693
+ },
694
+
695
+ _get_viewport = function() {
696
+ return [
697
+ $(window).width() - (currentOpts.margin * 2),
698
+ $(window).height() - (currentOpts.margin * 2),
699
+ $(document).scrollLeft() + currentOpts.margin,
700
+ $(document).scrollTop() + currentOpts.margin
701
+ ];
702
+ },
703
+
704
+ _get_zoom_to = function () {
705
+ var view = _get_viewport(),
706
+ to = {},
707
+ resize = currentOpts.autoScale,
708
+ double_padding = currentOpts.padding * 2,
709
+ ratio;
710
+
711
+ if (currentOpts.width.toString().indexOf('%') > -1) {
712
+ to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
713
+ } else {
714
+ to.width = currentOpts.width + double_padding;
715
+ }
716
+
717
+ if (currentOpts.height.toString().indexOf('%') > -1) {
718
+ to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
719
+ } else {
720
+ to.height = currentOpts.height + double_padding;
721
+ }
722
+
723
+ if (resize && (to.width > view[0] || to.height > view[1])) {
724
+ if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
725
+ ratio = (currentOpts.width ) / (currentOpts.height );
726
+
727
+ if ((to.width ) > view[0]) {
728
+ to.width = view[0];
729
+ to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
730
+ }
731
+
732
+ if ((to.height) > view[1]) {
733
+ to.height = view[1];
734
+ to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
735
+ }
736
+
737
+ } else {
738
+ to.width = Math.min(to.width, view[0]);
739
+ to.height = Math.min(to.height, view[1]);
740
+ }
741
+ }
742
+
743
+ to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
744
+ to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);
745
+
746
+ return to;
747
+ },
748
+
749
+ _get_obj_pos = function(obj) {
750
+ var pos = obj.offset();
751
+
752
+ pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
753
+ pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;
754
+
755
+ pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
756
+ pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;
757
+
758
+ pos.width = obj.width();
759
+ pos.height = obj.height();
760
+
761
+ return pos;
762
+ },
763
+
764
+ _get_zoom_from = function() {
765
+ var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
766
+ from = {},
767
+ pos,
768
+ view;
769
+
770
+ if (orig && orig.length) {
771
+ pos = _get_obj_pos(orig);
772
+
773
+ from = {
774
+ width : pos.width + (currentOpts.padding * 2),
775
+ height : pos.height + (currentOpts.padding * 2),
776
+ top : pos.top - currentOpts.padding - 20,
777
+ left : pos.left - currentOpts.padding - 20
778
+ };
779
+
780
+ } else {
781
+ view = _get_viewport();
782
+
783
+ from = {
784
+ width : currentOpts.padding * 2,
785
+ height : currentOpts.padding * 2,
786
+ top : parseInt(view[3] + view[1] * 0.5, 10),
787
+ left : parseInt(view[2] + view[0] * 0.5, 10)
788
+ };
789
+ }
790
+
791
+ return from;
792
+ },
793
+
794
+ _animate_loading = function() {
795
+ if (!loading.is(':visible')){
796
+ clearInterval(loadingTimer);
797
+ return;
798
+ }
799
+
800
+ $('div', loading).css('top', (loadingFrame * -40) + 'px');
801
+
802
+ loadingFrame = (loadingFrame + 1) % 12;
803
+ };
804
+
805
+ /*
806
+ * Public methods
807
+ */
808
+
809
+ $.fn.fancybox = function(options) {
810
+ if (!$(this).length) {
811
+ return this;
812
+ }
813
+
814
+ $(this)
815
+ .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
816
+ .unbind('click.fb')
817
+ .bind('click.fb', function(e) {
818
+ e.preventDefault();
819
+
820
+ if (busy) {
821
+ return;
822
+ }
823
+
824
+ busy = true;
825
+
826
+ $(this).blur();
827
+
828
+ selectedArray = [];
829
+ selectedIndex = 0;
830
+
831
+ var rel = $(this).attr('rel') || '';
832
+
833
+ if (!rel || rel == '' || rel === 'nofollow') {
834
+ selectedArray.push(this);
835
+ } else {
836
+ selectedArray = $('a[rel="'+rel+'"], area[rel="'+rel+'"]');
837
+ selectedIndex = selectedArray.index(this);
838
+ }
839
+
840
+ _start();
841
+
842
+ return;
843
+ });
844
+
845
+ return this;
846
+ };
847
+
848
+ $.fancybox = function(obj) {
849
+ var opts;
850
+
851
+ if (busy) {
852
+ return;
853
+ }
854
+
855
+ busy = true;
856
+ opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
857
+
858
+ selectedArray = [];
859
+ selectedIndex = parseInt(opts.index, 10) || 0;
860
+
861
+ if ($.isArray(obj)) {
862
+ for (var i = 0, j = obj.length; i < j; i++) {
863
+ if (typeof obj[i] == 'object') {
864
+ $(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
865
+ } else {
866
+ obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
867
+ }
868
+ }
869
+
870
+ selectedArray = jQuery.merge(selectedArray, obj);
871
+
872
+ } else {
873
+ if (typeof obj == 'object') {
874
+ $(obj).data('fancybox', $.extend({}, opts, obj));
875
+ } else {
876
+ obj = $({}).data('fancybox', $.extend({content : obj}, opts));
877
+ }
878
+
879
+ selectedArray.push(obj);
880
+ }
881
+
882
+ if (selectedIndex > selectedArray.length || selectedIndex < 0) {
883
+ selectedIndex = 0;
884
+ }
885
+
886
+ _start();
887
+ };
888
+
889
+ $.fancybox.showActivity = function() {
890
+ clearInterval(loadingTimer);
891
+
892
+ loading.show();
893
+ loadingTimer = setInterval(_animate_loading, 66);
894
+ };
895
+
896
+ $.fancybox.hideActivity = function() {
897
+ loading.hide();
898
+ };
899
+
900
+ $.fancybox.next = function() {
901
+ return $.fancybox.pos( currentIndex + 1);
902
+ };
903
+
904
+ $.fancybox.prev = function() {
905
+ return $.fancybox.pos( currentIndex - 1);
906
+ };
907
+
908
+ $.fancybox.pos = function(pos) {
909
+ if (busy) {
910
+ return;
911
+ }
912
+
913
+ pos = parseInt(pos);
914
+
915
+ selectedArray = currentArray;
916
+
917
+ if (pos > -1 && pos < currentArray.length) {
918
+ selectedIndex = pos;
919
+ _start();
920
+
921
+ } else if (currentOpts.cyclic && currentArray.length > 1) {
922
+ selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
923
+ _start();
924
+ }
925
+
926
+ return;
927
+ };
928
+
929
+ $.fancybox.cancel = function() {
930
+ if (busy) {
931
+ return;
932
+ }
933
+
934
+ busy = true;
935
+
936
+ $.event.trigger('fancybox-cancel');
937
+
938
+ _abort();
939
+
940
+ selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
941
+
942
+ busy = false;
943
+ };
944
+
945
+ // Note: within an iframe use - parent.$.fancybox.close();
946
+ $.fancybox.close = function() {
947
+ if (busy || wrap.is(':hidden')) {
948
+ return;
949
+ }
950
+
951
+ busy = true;
952
+
953
+ if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
954
+ busy = false;
955
+ return;
956
+ }
957
+
958
+ _abort();
959
+
960
+ $(close.add( nav_left ).add( nav_right )).hide();
961
+
962
+ $(content.add( overlay )).unbind();
963
+
964
+ $(window).unbind("resize.fb scroll.fb");
965
+ $(document).unbind('keydown.fb');
966
+
967
+ content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
968
+
969
+ if (currentOpts.titlePosition !== 'inside') {
970
+ title.empty();
971
+ }
972
+
973
+ wrap.stop();
974
+
975
+ function _cleanup() {
976
+ overlay.fadeOut('fast');
977
+
978
+ title.empty().hide();
979
+ wrap.hide();
980
+
981
+ $.event.trigger('fancybox-cleanup');
982
+
983
+ content.empty();
984
+
985
+ currentOpts.onClosed(currentArray, currentIndex, currentOpts);
986
+
987
+ currentArray = selectedOpts = [];
988
+ currentIndex = selectedIndex = 0;
989
+ currentOpts = selectedOpts = {};
990
+
991
+ busy = false;
992
+ }
993
+
994
+ if (currentOpts.transitionOut == 'elastic') {
995
+ start_pos = _get_zoom_from();
996
+
997
+ var pos = wrap.position();
998
+
999
+ final_pos = {
1000
+ top : pos.top ,
1001
+ left : pos.left,
1002
+ width : wrap.width(),
1003
+ height : wrap.height()
1004
+ };
1005
+
1006
+ if (currentOpts.opacity) {
1007
+ final_pos.opacity = 1;
1008
+ }
1009
+
1010
+ title.empty().hide();
1011
+
1012
+ fx.prop = 1;
1013
+
1014
+ $(fx).animate({ prop: 0 }, {
1015
+ duration : currentOpts.speedOut,
1016
+ easing : currentOpts.easingOut,
1017
+ step : _draw,
1018
+ complete : _cleanup
1019
+ });
1020
+
1021
+ } else {
1022
+ wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
1023
+ }
1024
+ };
1025
+
1026
+ $.fancybox.resize = function() {
1027
+ if (overlay.is(':visible')) {
1028
+ overlay.css('height', $(document).height());
1029
+ }
1030
+
1031
+ $.fancybox.center(true);
1032
+ };
1033
+
1034
+ $.fancybox.center = function() {
1035
+ var view, align;
1036
+
1037
+ if (busy) {
1038
+ return;
1039
+ }
1040
+
1041
+ align = arguments[0] === true ? 1 : 0;
1042
+ view = _get_viewport();
1043
+
1044
+ if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
1045
+ return;
1046
+ }
1047
+
1048
+ wrap
1049
+ .stop()
1050
+ .animate({
1051
+ 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
1052
+ 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
1053
+ }, typeof arguments[0] == 'number' ? arguments[0] : 200);
1054
+ };
1055
+
1056
+ $.fancybox.init = function() {
1057
+ if ($("#fancybox-wrap").length) {
1058
+ return;
1059
+ }
1060
+
1061
+ $('body').append(
1062
+ tmp = $('<div id="fancybox-tmp"></div>'),
1063
+ loading = $('<div id="fancybox-loading"><div></div></div>'),
1064
+ overlay = $('<div id="fancybox-overlay"></div>'),
1065
+ wrap = $('<div id="fancybox-wrap"></div>')
1066
+ );
1067
+
1068
+ outer = $('<div id="fancybox-outer"></div>')
1069
+ .append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>')
1070
+ .appendTo( wrap );
1071
+
1072
+ outer.append(
1073
+ content = $('<div id="fancybox-content"></div>'),
1074
+ close = $('<a id="fancybox-close"></a>'),
1075
+ title = $('<div id="fancybox-title"></div>'),
1076
+
1077
+ nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
1078
+ nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
1079
+ );
1080
+
1081
+ close.click($.fancybox.close);
1082
+ loading.click($.fancybox.cancel);
1083
+
1084
+ nav_left.click(function(e) {
1085
+ e.preventDefault();
1086
+ $.fancybox.prev();
1087
+ });
1088
+
1089
+ nav_right.click(function(e) {
1090
+ e.preventDefault();
1091
+ $.fancybox.next();
1092
+ });
1093
+
1094
+ if ($.fn.mousewheel) {
1095
+ wrap.bind('mousewheel.fb', function(e, delta) {
1096
+ if (busy) {
1097
+ e.preventDefault();
1098
+
1099
+ } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
1100
+ e.preventDefault();
1101
+ $.fancybox[ delta > 0 ? 'prev' : 'next']();
1102
+ }
1103
+ });
1104
+ }
1105
+
1106
+ if (!$.support.opacity) {
1107
+ wrap.addClass('fancybox-ie');
1108
+ }
1109
+
1110
+ if (isIE6) {
1111
+ loading.addClass('fancybox-ie6');
1112
+ wrap.addClass('fancybox-ie6');
1113
+
1114
+ $('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
1115
+ }
1116
+ };
1117
+
1118
+ $.fn.fancybox.defaults = {
1119
+ padding : 10,
1120
+ margin : 40,
1121
+ opacity : false,
1122
+ modal : false,
1123
+ cyclic : false,
1124
+ scrolling : 'auto', // 'auto', 'yes' or 'no'
1125
+
1126
+ width : 560,
1127
+ height : 340,
1128
+
1129
+ autoScale : true,
1130
+ autoDimensions : true,
1131
+ centerOnScroll : false,
1132
+
1133
+ ajax : {},
1134
+ swf : { wmode: 'transparent' },
1135
+
1136
+ hideOnOverlayClick : true,
1137
+ hideOnContentClick : false,
1138
+
1139
+ overlayShow : true,
1140
+ overlayOpacity : 0.7,
1141
+ overlayColor : '#777',
1142
+
1143
+ titleShow : true,
1144
+ titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
1145
+ titleFormat : null,
1146
+ titleFromAlt : false,
1147
+
1148
+ transitionIn : 'fade', // 'elastic', 'fade' or 'none'
1149
+ transitionOut : 'fade', // 'elastic', 'fade' or 'none'
1150
+
1151
+ speedIn : 300,
1152
+ speedOut : 300,
1153
+
1154
+ changeSpeed : 300,
1155
+ changeFade : 'fast',
1156
+
1157
+ easingIn : 'swing',
1158
+ easingOut : 'swing',
1159
+
1160
+ showCloseButton : true,
1161
+ showNavArrows : true,
1162
+ enableEscapeButton : true,
1163
+ enableKeyboardNav : true,
1164
+
1165
+ onStart : function(){},
1166
+ onCancel : function(){},
1167
+ onComplete : function(){},
1168
+ onCleanup : function(){},
1169
+ onClosed : function(){},
1170
+ onError : function(){}
1171
+ };
1172
+
1173
+ $(document).ready(function() {
1174
+ $.fancybox.init();
1175
+ });
1176
+
1177
})(jQuery);
assets/nivo/changelog.txt CHANGED
@@ -1,12 +1,12 @@
1
- *** Nivo Lightbox Changelog ***
2
-
3
- 2013.12.11 - version 1.1
4
- * [New] Added the clickOverlayToClose setting
5
- * [New] Uppercase image extensions are now supported
6
- * [Fixed] Can't click anywhere after opening video bug
7
- * [Fixed] Doesn't work in iOS bug
8
- * [Fixed] Youtube hyphen in URL bug
9
- * [Fixed] Inline content overflow bug
10
-
11
- 2013.08.01 - version 1.0
12
* Initial release
1
+ *** Nivo Lightbox Changelog ***
2
+
3
+ 2013.12.11 - version 1.1
4
+ * [New] Added the clickOverlayToClose setting
5
+ * [New] Uppercase image extensions are now supported
6
+ * [Fixed] Can't click anywhere after opening video bug
7
+ * [Fixed] Doesn't work in iOS bug
8
+ * [Fixed] Youtube hyphen in URL bug
9
+ * [Fixed] Inline content overflow bug
10
+
11
+ 2013.08.01 - version 1.0
12
* Initial release
assets/nivo/license.txt CHANGED
@@ -1,22 +1,22 @@
1
- Copyright (c) 2013 Dev7studios
2
-
3
- Permission is hereby granted, free of charge, to any person
4
- obtaining a copy of this software and associated documentation
5
- files (the "Software"), to deal in the Software without
6
- restriction, including without limitation the rights to use,
7
- copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the
9
- Software is furnished to do so, subject to the following
10
- conditions:
11
-
12
- The above copyright notice and this permission notice shall be
13
- included in all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2013 Dev7studios
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
assets/nivo/nivo-lightbox.js ADDED
@@ -0,0 +1,359 @@