Version Description
Many FancyBox improvements. New options: Google Docs Viewer for PDF, Youtube privacy-enhanced embed, theme and plugins compatibility options. Pre WP 4.5 compatibility.
=
Download this release
Release Info
Developer | deployer |
Plugin | Easy FancyBox |
Version | 1.8 |
Comparing to | |
See all releases |
Code changes from version 1.7 to 1.8
- easy-fancybox.php +6 -6
- fancybox/jquery.fancybox-ie.css +74 -0
- fancybox/jquery.fancybox-ie.min.css +1 -0
- fancybox/jquery.fancybox.css +1 -5
- fancybox/jquery.fancybox.js +129 -55
- fancybox/jquery.fancybox.min.css +1 -1
- fancybox/jquery.fancybox.min.js +1 -1
- inc/class-easyfancybox-options.php +64 -39
- inc/class-easyfancybox.php +139 -97
- js/jquery.easing.js +4 -2
- js/jquery.easing.min.js +1 -1
- readme.txt +96 -32
easy-fancybox.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://status301.net/wordpress-plugins/easy-fancybox/
|
|
5 |
Description: Easily enable the <a href="http://fancybox.net/">FancyBox jQuery extension</a> on all image, SWF, PDF, YouTube, Dailymotion and Vimeo links. Also supports iFrame and inline content.
|
6 |
Text Domain: easy-fancybox
|
7 |
Domain Path: languages
|
8 |
-
Version: 1.
|
9 |
Author: RavanH
|
10 |
Author URI: http://status301.net/
|
11 |
*/
|
@@ -37,20 +37,20 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
37 |
* CONSTANTS
|
38 |
**************/
|
39 |
|
40 |
-
define( 'EASY_FANCYBOX_VERSION', '1.
|
41 |
-
define( 'FANCYBOX_VERSION', '1.3.
|
42 |
define( 'MOUSEWHEEL_VERSION', '3.1.13' );
|
43 |
-
define( 'EASING_VERSION', '1.4.
|
44 |
define( 'METADATA_VERSION', '2.22.1' );
|
45 |
|
46 |
/**************
|
47 |
* CLASSES
|
48 |
**************/
|
49 |
|
50 |
-
require_once dirname(__FILE__) . '/inc/class-easyfancybox.php';
|
51 |
$efb = new easyFancyBox( __FILE__ );
|
52 |
|
53 |
if ( is_admin() ) {
|
54 |
-
require_once dirname(__FILE__) . '/inc/class-easyfancybox-admin.php';
|
55 |
$efb_admin = new easyFancyBox_Admin();
|
56 |
}
|
5 |
Description: Easily enable the <a href="http://fancybox.net/">FancyBox jQuery extension</a> on all image, SWF, PDF, YouTube, Dailymotion and Vimeo links. Also supports iFrame and inline content.
|
6 |
Text Domain: easy-fancybox
|
7 |
Domain Path: languages
|
8 |
+
Version: 1.8
|
9 |
Author: RavanH
|
10 |
Author URI: http://status301.net/
|
11 |
*/
|
37 |
* CONSTANTS
|
38 |
**************/
|
39 |
|
40 |
+
define( 'EASY_FANCYBOX_VERSION', '1.8' );
|
41 |
+
define( 'FANCYBOX_VERSION', '1.3.14' );
|
42 |
define( 'MOUSEWHEEL_VERSION', '3.1.13' );
|
43 |
+
define( 'EASING_VERSION', '1.4.1' );
|
44 |
define( 'METADATA_VERSION', '2.22.1' );
|
45 |
|
46 |
/**************
|
47 |
* CLASSES
|
48 |
**************/
|
49 |
|
50 |
+
require_once dirname( __FILE__ ) . '/inc/class-easyfancybox.php';
|
51 |
$efb = new easyFancyBox( __FILE__ );
|
52 |
|
53 |
if ( is_admin() ) {
|
54 |
+
require_once dirname( __FILE__ ) . '/inc/class-easyfancybox-admin.php';
|
55 |
$efb_admin = new easyFancyBox_Admin();
|
56 |
}
|
fancybox/jquery.fancybox-ie.css
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/* IE6 */
|
3 |
+
|
4 |
+
#fancybox-left:hover,
|
5 |
+
#fancybox-right:hover {
|
6 |
+
visibility:visible;
|
7 |
+
}
|
8 |
+
|
9 |
+
.fancybox-ie6 #fancybox-bg-w,
|
10 |
+
.fancybox-ie6 #fancybox-bg-e,
|
11 |
+
.fancybox-ie6 #fancybox-left,
|
12 |
+
.fancybox-ie6 #fancybox-right,
|
13 |
+
#fancybox-hide-sel-frame {
|
14 |
+
height: expression( this.parentNode.clientHeight + "px" );
|
15 |
+
}
|
16 |
+
|
17 |
+
#fancybox-loading.fancybox-ie6 {
|
18 |
+
position: absolute;
|
19 |
+
margin-top: 0;
|
20 |
+
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" );
|
21 |
+
}
|
22 |
+
|
23 |
+
/* IE6, IE7, IE8 */
|
24 |
+
|
25 |
+
.fancybox-bg {
|
26 |
+
position: absolute;
|
27 |
+
padding: 0;
|
28 |
+
margin: 0;
|
29 |
+
border: 0;
|
30 |
+
width: 20px;
|
31 |
+
height: 20px;
|
32 |
+
z-index: 111001
|
33 |
+
}
|
34 |
+
|
35 |
+
#fancybox-bg-n {
|
36 |
+
top: -20px;
|
37 |
+
left: 0;
|
38 |
+
width: 100%;
|
39 |
+
}
|
40 |
+
#fancybox-bg-ne {
|
41 |
+
top: -20px;
|
42 |
+
right: -20px;
|
43 |
+
}
|
44 |
+
#fancybox-bg-e {
|
45 |
+
top: 0;
|
46 |
+
right: -20px;
|
47 |
+
height: 100%;
|
48 |
+
}
|
49 |
+
#fancybox-bg-se {
|
50 |
+
bottom: -20px;
|
51 |
+
right: -20px;
|
52 |
+
}
|
53 |
+
#fancybox-bg-s {
|
54 |
+
bottom: -20px;
|
55 |
+
left: 0;
|
56 |
+
width: 100%;
|
57 |
+
}
|
58 |
+
#fancybox-bg-sw {
|
59 |
+
bottom: -20px;
|
60 |
+
left: -20px;
|
61 |
+
}
|
62 |
+
#fancybox-bg-w {
|
63 |
+
top: 0;
|
64 |
+
left: -20px;
|
65 |
+
height: 100%;
|
66 |
+
}
|
67 |
+
#fancybox-bg-nw {
|
68 |
+
top: -20px;
|
69 |
+
left:-20px;
|
70 |
+
}
|
71 |
+
|
72 |
+
.fancybox-ie .fancybox-bg {
|
73 |
+
background: transparent !important;
|
74 |
+
}
|
fancybox/jquery.fancybox-ie.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
#fancybox-left:hover,#fancybox-right:hover{visibility:visible}.fancybox-ie6 #fancybox-bg-w,.fancybox-ie6 #fancybox-bg-e,.fancybox-ie6 #fancybox-left,.fancybox-ie6 #fancybox-right,#fancybox-hide-sel-frame{height:expression(this.parentNode.clientHeight+"px")}#fancybox-loading.fancybox-ie6{position:absolute;margin-top:0;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")}.fancybox-bg{position:absolute;padding:0;margin:0;border:0;width:20px;height:20px;z-index:111001}#fancybox-bg-n{top:-20px;left:0;width:100%}#fancybox-bg-ne{top:-20px;right:-20px}#fancybox-bg-e{top:0;right:-20px;height:100%}#fancybox-bg-se{bottom:-20px;right:-20px}#fancybox-bg-s{bottom:-20px;left:0;width:100%}#fancybox-bg-sw{bottom:-20px;left:-20px}#fancybox-bg-w{top:0;left:-20px;height:100%}#fancybox-bg-nw{top:-20px;left:-20px}.fancybox-ie .fancybox-bg{background:transparent!important}
|
fancybox/jquery.fancybox.css
CHANGED
@@ -7,7 +7,7 @@
|
|
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.
|
11 |
*
|
12 |
* Dual licensed under the MIT and GPL licenses:
|
13 |
* http://www.opensource.org/licenses/mit-license.php
|
@@ -75,7 +75,6 @@
|
|
75 |
left: 0;
|
76 |
padding: 20px;
|
77 |
z-index: 111101;
|
78 |
-
outline: none;
|
79 |
display: none;
|
80 |
}
|
81 |
|
@@ -93,7 +92,6 @@
|
|
93 |
width: 0;
|
94 |
height: 0;
|
95 |
padding: 0;
|
96 |
-
outline: none;
|
97 |
position: relative;
|
98 |
/*overflow: hidden;*/
|
99 |
-webkit-overflow-scrolling:touch;
|
@@ -148,7 +146,6 @@
|
|
148 |
#fancybox-img {
|
149 |
padding: 0;
|
150 |
margin: 0;
|
151 |
-
outline: none;
|
152 |
line-height: 0;
|
153 |
vertical-align: top;
|
154 |
max-width:none !important;
|
@@ -172,7 +169,6 @@
|
|
172 |
width: 35%;
|
173 |
cursor: pointer;
|
174 |
background: initial;
|
175 |
-
outline: none;
|
176 |
z-index: 111102;
|
177 |
display: none;
|
178 |
}
|
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.14 (23/04/2018)
|
11 |
*
|
12 |
* Dual licensed under the MIT and GPL licenses:
|
13 |
* http://www.opensource.org/licenses/mit-license.php
|
75 |
left: 0;
|
76 |
padding: 20px;
|
77 |
z-index: 111101;
|
|
|
78 |
display: none;
|
79 |
}
|
80 |
|
92 |
width: 0;
|
93 |
height: 0;
|
94 |
padding: 0;
|
|
|
95 |
position: relative;
|
96 |
/*overflow: hidden;*/
|
97 |
-webkit-overflow-scrolling:touch;
|
146 |
#fancybox-img {
|
147 |
padding: 0;
|
148 |
margin: 0;
|
|
|
149 |
line-height: 0;
|
150 |
vertical-align: top;
|
151 |
max-width:none !important;
|
169 |
width: 35%;
|
170 |
cursor: pointer;
|
171 |
background: initial;
|
|
|
172 |
z-index: 111102;
|
173 |
display: none;
|
174 |
}
|
fancybox/jquery.fancybox.js
CHANGED
@@ -7,36 +7,21 @@
|
|
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.
|
11 |
* Requires: jQuery v1.7+
|
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 |
-
* Patches applied:
|
18 |
-
* Removed/replaced non-HTML5 attributes
|
19 |
-
* Added parameter allowfullscreen for iframe, RavanH ravanhagen@gmail.com
|
20 |
-
* Line 309, 714: patches for better centering on ipad etc.
|
21 |
-
* Line 588: added support for tab key gallery browsing
|
22 |
-
* Line 645: Check type = image for mousewheel
|
23 |
-
* Line 820: qouted attribute selector, RavanH ravanhagen@gmail.com
|
24 |
-
* Line 41, 622 and 1125: added isTouch variable and autoResize parameter, RavanH ravanhagen@gmail.com
|
25 |
-
* Line 34: WebP image support, RavanH ravanhagen@gmail.com
|
26 |
-
* Line 126, 677, 686: 'image' class forces image type, RavanH ravanhagen@gmail.com
|
27 |
-
* Put focus on iframe at _finish
|
28 |
-
* Patched for jQuery 1.9+ compat by Sabel http://sabel.bluegfx.de/wordpress/wp-content/uploads/2013/03/jquery.fancybox-1.3.4.js
|
29 |
-
* Line 858: exclude more rel attribute values
|
30 |
-
* Added SVG support by Simon Maillard simon@ogesta.fr
|
31 |
-
* iframe content with fixed width/height settings respect aspect ratio on small screens
|
32 |
-
* true frame resizing on screen reorientation, added recenter public method
|
33 |
*/
|
34 |
(function($) {
|
35 |
var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, resize_timeout,
|
36 |
|
37 |
selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
|
38 |
|
39 |
-
ajaxLoader = null, imgPreloader = new Image(),
|
|
|
|
|
40 |
|
41 |
loadingTimer, loadingFrame = 1,
|
42 |
|
@@ -62,19 +47,23 @@
|
|
62 |
tmp.empty();
|
63 |
},
|
64 |
|
65 |
-
_error = function() {
|
66 |
if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
|
67 |
$.fancybox.hideActivity();
|
68 |
busy = false;
|
69 |
return;
|
70 |
}
|
71 |
|
|
|
|
|
|
|
|
|
72 |
selectedOpts.titleShow = false;
|
73 |
|
74 |
selectedOpts.width = 'auto';
|
75 |
selectedOpts.height = 'auto';
|
76 |
|
77 |
-
tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />
|
78 |
|
79 |
_process_inline();
|
80 |
},
|
@@ -145,6 +134,9 @@
|
|
145 |
} else if (href.match(svgRegExp)) {
|
146 |
type = 'svg';
|
147 |
|
|
|
|
|
|
|
148 |
} else if (href.indexOf("#") === 0) {
|
149 |
type = 'inline';
|
150 |
|
@@ -154,7 +146,7 @@
|
|
154 |
}
|
155 |
|
156 |
if (!type) {
|
157 |
-
_error();
|
158 |
return;
|
159 |
}
|
160 |
|
@@ -213,9 +205,9 @@
|
|
213 |
.hide()
|
214 |
.insertBefore( $(obj) )
|
215 |
.on('fancybox-cleanup', function() {
|
216 |
-
$(this).replaceWith(content.children());
|
217 |
}).on('fancybox-cancel', function() {
|
218 |
-
$(this).replaceWith(tmp.children());
|
219 |
});
|
220 |
|
221 |
$(obj).appendTo(tmp);
|
@@ -233,7 +225,7 @@
|
|
233 |
imgPreloader = new Image();
|
234 |
|
235 |
imgPreloader.onerror = function() {
|
236 |
-
_error();
|
237 |
};
|
238 |
|
239 |
imgPreloader.onload = function() {
|
@@ -251,7 +243,7 @@
|
|
251 |
selectedOpts.scrolling = 'no';
|
252 |
selectedOpts.keepRatio = true;
|
253 |
|
254 |
-
str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
|
255 |
emb = '';
|
256 |
|
257 |
$.each(selectedOpts.swf, function(name, val) {
|
@@ -270,7 +262,17 @@
|
|
270 |
selectedOpts.scrolling = 'no';
|
271 |
selectedOpts.keepRatio = true;
|
272 |
|
273 |
-
str = '<object width="' + selectedOpts.width + '" height="' + selectedOpts.height + '" data="' + href + '"></object>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
|
275 |
tmp.html(str);
|
276 |
|
@@ -289,7 +291,7 @@
|
|
289 |
data : selectedOpts.ajax.data || {},
|
290 |
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
291 |
if ( XMLHttpRequest.status > 0 ) {
|
292 |
-
_error();
|
293 |
}
|
294 |
},
|
295 |
success : function(data, textStatus, XMLHttpRequest) {
|
@@ -306,12 +308,15 @@
|
|
306 |
}
|
307 |
}
|
308 |
|
309 |
-
|
310 |
-
|
|
|
|
|
|
|
|
|
311 |
}
|
312 |
}
|
313 |
}));
|
314 |
-
|
315 |
break;
|
316 |
|
317 |
case 'iframe':
|
@@ -658,7 +663,7 @@
|
|
658 |
$(window).on("resize.fb", $.fancybox.resize);
|
659 |
}
|
660 |
|
661 |
-
if (currentOpts.centerOnScroll) {
|
662 |
$(window).on("scroll.fb", $.fancybox.center);
|
663 |
}
|
664 |
|
@@ -690,29 +695,58 @@
|
|
690 |
|
691 |
currentOpts.onComplete(currentArray, currentIndex, currentOpts);
|
692 |
|
693 |
-
|
|
|
|
|
|
|
694 |
},
|
695 |
|
696 |
-
|
697 |
-
var
|
698 |
-
|
699 |
-
if ((currentArray.length -1) > currentIndex) {
|
700 |
-
obj = currentArray[ currentIndex + 1 ];
|
701 |
|
702 |
-
|
703 |
-
|
704 |
-
|
|
|
|
|
705 |
}
|
706 |
}
|
707 |
|
708 |
-
if (
|
709 |
-
|
|
|
|
|
|
|
|
|
710 |
|
711 |
-
|
712 |
-
|
713 |
-
|
|
|
|
|
|
|
|
|
|
|
714 |
}
|
715 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
716 |
},
|
717 |
|
718 |
_draw = function(pos) {
|
@@ -737,9 +771,16 @@
|
|
737 |
},
|
738 |
|
739 |
_get_viewport = function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
740 |
return [
|
741 |
-
|
742 |
-
|
743 |
$(document).scrollLeft() + currentOpts.margin,
|
744 |
$(document).scrollTop() + currentOpts.margin
|
745 |
];
|
@@ -879,7 +920,7 @@
|
|
879 |
selectedIndex = selectedArray.index( this );
|
880 |
}
|
881 |
|
882 |
-
_start(
|
883 |
|
884 |
return;
|
885 |
});
|
@@ -940,11 +981,47 @@
|
|
940 |
};
|
941 |
|
942 |
$.fancybox.next = function() {
|
943 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
944 |
};
|
945 |
|
946 |
$.fancybox.prev = function() {
|
947 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
948 |
};
|
949 |
|
950 |
$.fancybox.pos = function(pos) {
|
@@ -959,9 +1036,6 @@
|
|
959 |
if (pos > -1 && pos < currentArray.length) {
|
960 |
selectedIndex = pos;
|
961 |
_start();
|
962 |
-
} else if (currentOpts.cyclic && currentArray.length > 1) {
|
963 |
-
selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
|
964 |
-
_start();
|
965 |
}
|
966 |
|
967 |
return;
|
@@ -1203,7 +1277,7 @@
|
|
1203 |
|
1204 |
autoScale : true,
|
1205 |
autoDimensions : true,
|
1206 |
-
centerOnScroll :
|
1207 |
autoResize : true,
|
1208 |
keepRatio : false,
|
1209 |
minViewportWidth : 0,
|
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.14 (23/04/2018)
|
11 |
* Requires: jQuery v1.7+
|
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 |
(function($) {
|
18 |
var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, resize_timeout,
|
19 |
|
20 |
selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
|
21 |
|
22 |
+
ajaxLoader = null, imgPreloader = new Image(),
|
23 |
+
|
24 |
+
imgRegExp = /\.(jpg|gif|png|bmp|jpeg|webp)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i, svgRegExp = /[^\.]\.(svg)\s*$/i, pdfRegExp = /[^\.]\.(pdf)\s*$/i,
|
25 |
|
26 |
loadingTimer, loadingFrame = 1,
|
27 |
|
47 |
tmp.empty();
|
48 |
},
|
49 |
|
50 |
+
_error = function(msg) {
|
51 |
if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
|
52 |
$.fancybox.hideActivity();
|
53 |
busy = false;
|
54 |
return;
|
55 |
}
|
56 |
|
57 |
+
if ( typeof msg === 'undefined' ) {
|
58 |
+
msg = 'Please try again later.';
|
59 |
+
}
|
60 |
+
|
61 |
selectedOpts.titleShow = false;
|
62 |
|
63 |
selectedOpts.width = 'auto';
|
64 |
selectedOpts.height = 'auto';
|
65 |
|
66 |
+
tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />' + msg + '</p>' );
|
67 |
|
68 |
_process_inline();
|
69 |
},
|
134 |
} else if (href.match(svgRegExp)) {
|
135 |
type = 'svg';
|
136 |
|
137 |
+
} else if (href.match(pdfRegExp)) {
|
138 |
+
type = 'pdf';
|
139 |
+
|
140 |
} else if (href.indexOf("#") === 0) {
|
141 |
type = 'inline';
|
142 |
|
146 |
}
|
147 |
|
148 |
if (!type) {
|
149 |
+
_error('No content type found.');
|
150 |
return;
|
151 |
}
|
152 |
|
205 |
.hide()
|
206 |
.insertBefore( $(obj) )
|
207 |
.on('fancybox-cleanup', function() {
|
208 |
+
$(this).replaceWith(content.children('div:first'));
|
209 |
}).on('fancybox-cancel', function() {
|
210 |
+
$(this).replaceWith(tmp.children('div:first'));
|
211 |
});
|
212 |
|
213 |
$(obj).appendTo(tmp);
|
225 |
imgPreloader = new Image();
|
226 |
|
227 |
imgPreloader.onerror = function() {
|
228 |
+
_error('No image found.');
|
229 |
};
|
230 |
|
231 |
imgPreloader.onload = function() {
|
243 |
selectedOpts.scrolling = 'no';
|
244 |
selectedOpts.keepRatio = true;
|
245 |
|
246 |
+
str = '<object type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
|
247 |
emb = '';
|
248 |
|
249 |
$.each(selectedOpts.swf, function(name, val) {
|
262 |
selectedOpts.scrolling = 'no';
|
263 |
selectedOpts.keepRatio = true;
|
264 |
|
265 |
+
str = '<object type="image/svg+xml" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '" data="' + href + '"></object>';
|
266 |
+
|
267 |
+
tmp.html(str);
|
268 |
+
|
269 |
+
_process_inline();
|
270 |
+
break;
|
271 |
+
|
272 |
+
case 'pdf':
|
273 |
+
selectedOpts.scrolling = 'no';
|
274 |
+
|
275 |
+
str = '<object type="application/pdf" width="100%" height="100%" data="' + href + '"><a href="' + href + '" style="display:block;position:absolute;top:48%;width:100%;text-align:center">' + $(obj).html() + '</a></object>';
|
276 |
|
277 |
tmp.html(str);
|
278 |
|
291 |
data : selectedOpts.ajax.data || {},
|
292 |
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
293 |
if ( XMLHttpRequest.status > 0 ) {
|
294 |
+
_error(errorThrown);
|
295 |
}
|
296 |
},
|
297 |
success : function(data, textStatus, XMLHttpRequest) {
|
308 |
}
|
309 |
}
|
310 |
|
311 |
+
if ( data.indexOf("<!DOCTYPE") > -1 || data.indexOf("<html") > -1 || data.indexOf("<body") > -1 ) {
|
312 |
+
_error('Unexpected response.');
|
313 |
+
} else {
|
314 |
+
tmp.html( data );
|
315 |
+
_process_inline();
|
316 |
+
}
|
317 |
}
|
318 |
}
|
319 |
}));
|
|
|
320 |
break;
|
321 |
|
322 |
case 'iframe':
|
663 |
$(window).on("resize.fb", $.fancybox.resize);
|
664 |
}
|
665 |
|
666 |
+
if (currentOpts.centerOnScroll && !isTouch) {
|
667 |
$(window).on("scroll.fb", $.fancybox.center);
|
668 |
}
|
669 |
|
695 |
|
696 |
currentOpts.onComplete(currentArray, currentIndex, currentOpts);
|
697 |
|
698 |
+
if (currentArray.length > 1) {
|
699 |
+
_preload_next();
|
700 |
+
_preload_prev();
|
701 |
+
}
|
702 |
},
|
703 |
|
704 |
+
_preload_next = function() {
|
705 |
+
var pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex + 1;
|
|
|
|
|
|
|
706 |
|
707 |
+
if (pos >= currentArray.length) {
|
708 |
+
if (currentOpts.cyclic) {
|
709 |
+
pos = 0;
|
710 |
+
} else {
|
711 |
+
return;
|
712 |
}
|
713 |
}
|
714 |
|
715 |
+
if ( _preload_image( pos ) ) {
|
716 |
+
return;
|
717 |
+
} else {
|
718 |
+
_preload_next( pos + 1 );
|
719 |
+
}
|
720 |
+
},
|
721 |
|
722 |
+
_preload_prev = function() {
|
723 |
+
var pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex - 1;
|
724 |
+
|
725 |
+
if (pos < 0) {
|
726 |
+
if (currentOpts.cyclic) {
|
727 |
+
pos = currentArray.length - 1;
|
728 |
+
} else {
|
729 |
+
return;
|
730 |
}
|
731 |
}
|
732 |
+
|
733 |
+
if ( _preload_image( pos ) ) {
|
734 |
+
return;
|
735 |
+
} else {
|
736 |
+
_preload_prev( pos - 1 );
|
737 |
+
}
|
738 |
+
},
|
739 |
+
|
740 |
+
_preload_image = function(pos) {
|
741 |
+
var objNext, obj = currentArray[ pos ];
|
742 |
+
|
743 |
+
if ( typeof obj !== 'undefined' && typeof obj.href !== 'undefined' && obj.href !== currentOpts.href && (obj.href.match(imgRegExp) || $(obj).hasClass("image")) ) {
|
744 |
+
objNext = new Image();
|
745 |
+
objNext.src = obj.href;
|
746 |
+
return true;
|
747 |
+
} else {
|
748 |
+
return false;
|
749 |
+
}
|
750 |
},
|
751 |
|
752 |
_draw = function(pos) {
|
771 |
},
|
772 |
|
773 |
_get_viewport = function() {
|
774 |
+
var w = !isTouch && window.innerWidth && document.documentElement.clientWidth ?
|
775 |
+
Math.min(window.innerWidth, document.documentElement.clientWidth) :
|
776 |
+
window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth,
|
777 |
+
h = !isTouch && window.innerHeight && document.documentElement.clientHeight ?
|
778 |
+
Math.min(window.innerHeight, document.documentElement.clientHeight) :
|
779 |
+
window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
|
780 |
+
|
781 |
return [
|
782 |
+
w - (currentOpts.margin * 2),
|
783 |
+
h - (currentOpts.margin * 2),
|
784 |
$(document).scrollLeft() + currentOpts.margin,
|
785 |
$(document).scrollTop() + currentOpts.margin
|
786 |
];
|
920 |
selectedIndex = selectedArray.index( this );
|
921 |
}
|
922 |
|
923 |
+
_start();
|
924 |
|
925 |
return;
|
926 |
});
|
981 |
};
|
982 |
|
983 |
$.fancybox.next = function() {
|
984 |
+
var obj, pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex + 1;
|
985 |
+
|
986 |
+
if (pos >= currentArray.length) {
|
987 |
+
if (currentOpts.cyclic) {
|
988 |
+
pos = 0;
|
989 |
+
} else {
|
990 |
+
return;
|
991 |
+
}
|
992 |
+
}
|
993 |
+
|
994 |
+
obj = currentArray[pos];
|
995 |
+
|
996 |
+
if ( typeof obj !== 'undefined' && typeof obj.href !== 'undefined' && obj.href === currentOpts.href ) {
|
997 |
+
$.fancybox.next( pos + 1 );
|
998 |
+
} else {
|
999 |
+
$.fancybox.pos( pos );
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
return;
|
1003 |
};
|
1004 |
|
1005 |
$.fancybox.prev = function() {
|
1006 |
+
var obj, pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex - 1;
|
1007 |
+
|
1008 |
+
if (pos < 0) {
|
1009 |
+
if (currentOpts.cyclic) {
|
1010 |
+
pos = currentArray.length - 1;
|
1011 |
+
} else {
|
1012 |
+
return;
|
1013 |
+
}
|
1014 |
+
}
|
1015 |
+
|
1016 |
+
obj = currentArray[pos];
|
1017 |
+
|
1018 |
+
if ( typeof obj !== 'undefined' && typeof obj.href !== 'undefined' && obj.href === currentOpts.href ) {
|
1019 |
+
$.fancybox.prev( pos - 1 );
|
1020 |
+
} else {
|
1021 |
+
$.fancybox.pos( pos );
|
1022 |
+
}
|
1023 |
+
|
1024 |
+
return;
|
1025 |
};
|
1026 |
|
1027 |
$.fancybox.pos = function(pos) {
|
1036 |
if (pos > -1 && pos < currentArray.length) {
|
1037 |
selectedIndex = pos;
|
1038 |
_start();
|
|
|
|
|
|
|
1039 |
}
|
1040 |
|
1041 |
return;
|
1277 |
|
1278 |
autoScale : true,
|
1279 |
autoDimensions : true,
|
1280 |
+
centerOnScroll : false,
|
1281 |
autoResize : true,
|
1282 |
keepRatio : false,
|
1283 |
minViewportWidth : 0,
|
fancybox/jquery.fancybox.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#fancybox-loading,#fancybox-loading div,#fancybox-overlay,#fancybox-wrap,.fancybox-bg,#fancybox-outer,#fancybox-content,#fancybox-content>div,#fancybox-content>div>div,#fancybox-frame,#fancybox-close,#fancybox-title,#fancybox-title div,#fancybox-left,#fancybox-right,.fancy-ico{box-sizing:content-box;-moz-box-sizing:content-box}#fancybox-loading{position:fixed;top:50%;left:50%;width:40px;height:40px;margin-top:-20px;margin-left:-20px;cursor:pointer;overflow:hidden;z-index:111104;display:none}#fancybox-loading div{position:absolute;top:0;left:0;width:40px;height:480px;background-image:url('fancybox.png')}#fancybox-overlay{position:absolute;top:0;left:0;width:100%;z-index:111100;display:none}#fancybox-tmp{padding:0;margin:0;border:0;overflow:auto;display:none}#fancybox-wrap{position:absolute;top:0;left:0;padding:20px;z-index:111101;
|
1 |
+
#fancybox-loading,#fancybox-loading div,#fancybox-overlay,#fancybox-wrap,.fancybox-bg,#fancybox-outer,#fancybox-content,#fancybox-content>div,#fancybox-content>div>div,#fancybox-frame,#fancybox-close,#fancybox-title,#fancybox-title div,#fancybox-left,#fancybox-right,.fancy-ico{box-sizing:content-box;-moz-box-sizing:content-box}#fancybox-loading{position:fixed;top:50%;left:50%;width:40px;height:40px;margin-top:-20px;margin-left:-20px;cursor:pointer;overflow:hidden;z-index:111104;display:none}#fancybox-loading div{position:absolute;top:0;left:0;width:40px;height:480px;background-image:url('fancybox.png')}#fancybox-overlay{position:absolute;top:0;left:0;width:100%;z-index:111100;display:none}#fancybox-tmp{padding:0;margin:0;border:0;overflow:auto;display:none}#fancybox-wrap{position:absolute;top:0;left:0;padding:20px;z-index:111101;display:none}#fancybox-outer{position:relative;width:100%;height:100%;background:#fff;box-shadow:0 0 20px #111;-moz-box-shadow:0 0 20px #111;-webkit-box-shadow:0 0 20px #111}#fancybox-content{width:0;height:0;padding:0;position:relative;-webkit-overflow-scrolling:touch;overflow-y:auto;z-index:111102;border:0 solid #fff;background:#fff;-moz-background-clip:padding;-webkit-background-clip:padding;background-clip:padding-box}#fancybox-content>div{max-width:100%;max-height:100%}#fancybox-hide-sel-frame{position:absolute;top:0;left:0;width:100%;height:100%;background:transparent;z-index:111101}#fancybox-close{position:absolute;top:-15px;right:-15px;width:30px;height:30px;background:transparent url('fancybox.png') -40px 0;cursor:pointer;z-index:111103;display:none}#fancybox-error{color:#444;padding:14px;margin:0}#fancybox-frame,#fancybox-img{width:100%;height:100%;border:0}#fancybox-img{padding:0;margin:0;line-height:0;vertical-align:top;max-width:none!important;max-height:none!important}#fancybox-frame{display:block;width:100%;height:100%;z-index:0;-webkit-transform:translateZ(0px);-webkit-transform:translate3d(0,0,0);-webkit-perspective:1000}#fancybox-left,#fancybox-right{position:absolute;bottom:0;height:100%;width:35%;cursor:pointer;background:initial;z-index:111102;display:none}#fancybox-left{left:0}.rtl #fancybox-left{left:auto;right:0}#fancybox-right{right:0}.rtl #fancybox-right{left:0;right:auto}#fancybox-left-ico,#fancybox-right-ico{position:absolute;top:50%;left:-9999px;width:30px;height:30px;margin-top:-15px;cursor:pointer;z-index:111102;display:block}#fancybox-left-ico{background-image:url('fancybox.png');background-position:-40px -30px}.rtl #fancybox-left-ico{background-position:-40px -60px;right:-9999px}#fancybox-right-ico{background-image:url('fancybox.png');background-position:-40px -60px}.rtl #fancybox-right-ico{background-position:-40px -30px;right:-9999px}#fancybox-left:hover span{left:20px}.rtl #fancybox-left:hover span{right:20px}#fancybox-right:hover span{left:auto;right:20px}.rtl #fancybox-right:hover span{right:auto;left:20px}#fancybox-title{z-index:111102}.fancybox-title-inside{padding-bottom:10px;text-align:center;color:#333;position:relative}.fancybox-title-outside{padding-top:10px;color:#fff;font-weight:600}.fancybox-title-over{position:absolute;bottom:0;left:0;color:#FFF;text-align:left}.rtl .fancybox-title-over{text-align:right}#fancybox-title-over{padding:10px;background:rgba(0,0,0,.64);display:block}.fancybox-title-float{position:absolute;left:0;bottom:-20px;height:32px}#fancybox-title-float-wrap{border:0;border-collapse:collapse;width:auto}#fancybox-title-float-wrap tr,#fancybox-title-float-wrap td{border:0;white-space:nowrap}#fancybox-title-float-left{padding:0 0 0 15px;background:url('fancybox.png') -40px -90px no-repeat}#fancybox-title-float-main{color:#fff;line-height:29px;font-weight:600;font-size:14px;padding:0 0 3px 0;background:url('fancybox-x.png') 0 -40px}#fancybox-title-float-right{padding:0 0 0 15px;background:url('fancybox.png') -55px -90px no-repeat}.fancybox-hidden{display:none}
|
fancybox/jquery.fancybox.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(l){var D,j,B,r,c,z,w,G,v,i,F,g=0,y={},h=[],d=0,a={},e=[],k=null,E=new Image(),u=/\.(jpg|gif|png|bmp|jpeg|webp)(.*)?$/i,p=/[^\.]\.(swf)\s*$/i,A=/[^\.]\.(svg)\s*$/i,m,o=1,q=0,b="",t,n,C=false,f=l.extend(l("<div/>")[0],{prop:0}),x=navigator.userAgent.match(/msie [6]/i)&&!window.XMLHttpRequest,s=document.createTouch!==undefined;_abort=function(){l.fancybox.hideActivity();E.onerror=E.onload=null;if(k){k.abort()}D.empty()},_error=function(){if(false===y.onError(h,g,y)){l.fancybox.hideActivity();C=false;return}y.titleShow=false;y.width="auto";y.height="auto";D.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');_process_inline()},_start=function(){var L=h[g],I,K,N,M,H,J;_abort();y=l.extend({},l.fn.fancybox.defaults,(typeof l(L).data("fancybox")=="undefined"?y:l(L).data("fancybox")));if(document.documentElement.clientWidth<y.minViewportWidth){C=false;return}J=y.onStart(h,g,y);if(J===false){C=false;return}else{if(typeof J=="object"){y=l.extend(y,J)}}N=y.title||(L.nodeName?l(L).attr("title"):L.title)||"";if(L.nodeName&&!y.orig){y.orig=l(L).find("img:first").length?l(L).find("img:first"):l(L)}if(N===""&&y.orig){N=y.orig.attr("title")||(y.titleFromAlt?y.orig.attr("alt"):"")}I=y.href||(L.nodeName?l(L).attr("href"):L.href)||null;if((/^(?:javascript)/i).test(I)||I=="#"){I=null}if(y.type){K=y.type;if(!I){I=y.content}}else{if(y.content){K="html"}else{if(l(L).hasClass("iframe")){K="iframe"}else{if(I){if(I.match(u)||l(L).hasClass("image")){K="image"}else{if(I.match(p)){K="swf"}else{if(I.match(A)){K="svg"}else{if(I.indexOf("#")===0){K="inline"}else{K="ajax"}}}}}}}}if(!K){_error();return}if(l(L).hasClass("modal")){y.modal=true}if(K=="inline"){L=I.substr(I.indexOf("#"));K=l(L).length>0?"inline":"ajax"}y.type=K;y.href=I;y.title=N;if(y.autoDimensions){if(y.type=="html"||y.type=="inline"||y.type=="ajax"){y.width="auto";y.height="auto"}else{y.autoDimensions=false}}if(y.modal){y.overlayShow=true;y.hideOnOverlayClick=false;y.hideOnContentClick=false;y.enableEscapeButton=false;y.showCloseButton=false}y.padding=parseInt(y.padding,10);y.margin=parseInt(y.margin,10);D.css("padding",(y.padding+y.margin));l(".fancybox-inline-tmp").off("fancybox-cancel").on("fancybox-change",function(){l(this).replaceWith(z.children())});switch(K){case"html":D.html(y.content);_process_inline();break;case"inline":if(l(L).parent().is("#fancybox-content")===true){C=false;return}l('<div class="fancybox-inline-tmp" />').hide().insertBefore(l(L)).on("fancybox-cleanup",function(){l(this).replaceWith(z.children())}).on("fancybox-cancel",function(){l(this).replaceWith(D.children())});l(L).appendTo(D);_process_inline();break;case"image":y.keepRatio=true;C=false;l.fancybox.showActivity();E=new Image();E.onerror=function(){_error()};E.onload=function(){C=true;E.onerror=E.onload=null;_process_image()};E.src=I;break;case"swf":y.scrolling="no";y.keepRatio=true;M='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+y.width+'" height="'+y.height+'"><param name="movie" value="'+I+'"></param>';H="";l.each(y.swf,function(O,P){M+='<param name="'+O+'" value="'+P+'"></param>';H+=" "+O+'="'+P+'"'});M+='<embed src="'+I+'" type="application/x-shockwave-flash" width="'+y.width+'" height="'+y.height+'"'+H+"></embed></object>";D.html(M);_process_inline();break;case"svg":y.scrolling="no";y.keepRatio=true;M='<object width="'+y.width+'" height="'+y.height+'" data="'+I+'"></object>';D.html(M);_process_inline();break;case"ajax":C=false;l.fancybox.showActivity();y.ajax.win=y.ajax.success;k=l.ajax(l.extend({},y.ajax,{url:I,data:y.ajax.data||{},error:function(O,Q,P){if(O.status>0){_error()}},success:function(P,R,O){var Q=typeof O=="object"?O:k;if(Q.status==200){if(typeof y.ajax.win=="function"){J=y.ajax.win(I,P,R,O);if(J===false){l.fancybox.hideActivity();return}else{if(typeof J=="string"||typeof J=="object"){P=J}}}D.html(P);_process_inline()}}}));break;case"iframe":l.fancybox.showActivity();_show();break}},_process_inline=function(){var I=y.width,J=y.height,K=l(window).width()==0?window.innerWidth:l(window).width(),H=l(window).height()==0?window.innerHeight:l(window).height();if(I.toString().indexOf("%")>-1){I=parseInt((K-(y.margin*2))*parseFloat(I)/100,10)+"px"}else{I=I=="auto"?"auto":I+"px"}if(J.toString().indexOf("%")>-1){J=parseInt((H-(y.margin*2))*parseFloat(J)/100,10)+"px"}else{J=J=="auto"?"auto":J+"px"}D.wrapInner('<div style="width:'+I+";height:"+J+";overflow: "+(y.scrolling=="auto"?"auto":(y.scrolling=="yes"?"scroll":"hidden"))+';position:relative;"></div>');y.width=D.width();y.height=D.height();_show()},_process_image=function(){y.width=E.width;y.height=E.height;l("<img />").attr({id:"fancybox-img",src:E.src,alt:y.title}).appendTo(D);_show()},_show=function(){var I,H;if(y.type!=="iframe"){l.fancybox.hideActivity()}if(r.is(":visible")&&false===a.onCleanup(e,d,a)){l(".fancybox-inline-tmp").trigger("fancybox-cancel");C=false;return}C=true;l(z.add(B)).off();l(window).off("orientationchange.fb resize.fb scroll.fb");l(document).off("keydown.fb");if(r.is(":visible")&&a.titlePosition!=="outside"){r.css("height",r.height())}e=h;d=g;a=y;if(a.overlayShow){B.css({"background-color":a.overlayColor,opacity:a.overlayOpacity,cursor:a.hideOnOverlayClick?"pointer":"auto",height:l(document).height()});if(!B.is(":visible")){if(x){l("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"})}B.show()}}else{B.hide()}n=_get_zoom_to();_process_title();if(r.is(":visible")){l(w.add(v).add(i)).hide();I=r.position(),t={top:I.top,left:I.left,width:r.width(),height:r.height()};H=(t.width==n.width&&t.height==n.height);z.fadeTo(a.changeFade,0.3,function(){var J=function(){z.html(D.contents()).fadeTo(a.changeFade,1,_finish)};l(".fancybox-inline-tmp").trigger("fancybox-change");z.empty().removeAttr("filter").css({"border-width":a.padding,width:n.width-a.padding*2,height:y.autoDimensions?"auto":n.height-q-a.padding*2});if(H){J()}else{f.prop=0;l(f).animate({prop:1},{duration:a.changeSpeed,easing:a.easingChange,step:_draw,complete:J})}});return}r.removeAttr("style");z.css("border-width",a.padding);if(a.transitionIn=="elastic"){t=_get_zoom_from();z.html(D.contents());r.show();if(a.opacity){n.opacity=0}f.prop=0;l(f).animate({prop:1},{duration:a.speedIn,easing:a.easingIn,step:_draw,complete:_finish});return}if(a.titlePosition=="inside"&&q>0){G.show()}z.css({width:n.width-a.padding*2,height:y.autoDimensions?"auto":n.height-q-a.padding*2}).html(D.contents());r.css(n).fadeIn(a.transitionIn=="none"?0:a.speedIn,_finish)},_format_title=function(H){if(H&&H.length){if(a.titlePosition=="float"){return'<table id="fancybox-title-float-wrap" style="border-spacing:0;border-collapse:collapse"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+H+'</td><td id="fancybox-title-float-right"></td></tr></table>'}return'<div id="fancybox-title-'+a.titlePosition+'">'+H+"</div>"}return false},_process_title=function(){b=a.title||"";q=0;G.empty().removeAttr("style").removeClass();if(a.titleShow===false){G.hide();return}b=l.isFunction(a.titleFormat)?a.titleFormat(b,e,d,a):_format_title(b);if(!b||b===""){G.hide();return}G.addClass("fancybox-title-"+a.titlePosition).html(b).appendTo("body").show();switch(a.titlePosition){case"inside":G.css({width:n.width-(a.padding*2),marginLeft:a.padding,marginRight:a.padding}).appendTo(c);q=G.outerHeight(true);n.height+=q;break;case"over":G.css({marginLeft:a.padding,width:n.width-(a.padding*2),bottom:a.padding}).appendTo(c);break;case"float":G.css("left",parseInt((G.width()-n.width)/2,10)*-1).appendTo(c);break;default:G.css({width:n.width-(a.padding*2),paddingLeft:a.padding,paddingRight:a.padding}).appendTo(r);break}G.hide()},_set_navigation=function(){if(a.enableEscapeButton||a.enableKeyboardNav){l(document).on("keydown.fb",function(H){if(H.keyCode==27&&a.enableEscapeButton){H.preventDefault();l.fancybox.close()}else{if((H.keyCode==37||H.keyCode==39)&&a.enableKeyboardNav&&H.target.tagName!=="INPUT"&&H.target.tagName!=="TEXTAREA"&&H.target.tagName!=="SELECT"){H.preventDefault();l.fancybox[H.keyCode==37?"prev":"next"]()}else{if((H.keyCode==9)&&a.enableKeyboardNav&&H.target.tagName!=="INPUT"&&H.target.tagName!=="TEXTAREA"&&H.target.tagName!=="SELECT"){H.preventDefault();l.fancybox[H.shiftKey?"prev":"next"]()}}}})}if(!a.showNavArrows){v.hide();i.hide();return}if((a.cyclic&&e.length>1)||d!==0){v.show()}if((a.cyclic&&e.length>1)||d!=(e.length-1)){i.show()}},_finish=function(){if(!l.support.opacity){z.css("filter",0);r.css("filter",0)}if(y.autoDimensions){z.css("height","auto")}r.css("height","auto");if(b&&b.length){G.show()}if(a.showCloseButton){w.show()}_set_navigation();if(a.hideOnContentClick){z.on("click",l.fancybox.close)}if(a.hideOnOverlayClick){B.on("click",l.fancybox.close)}if(a.autoResize){l(window).on("resize.fb",l.fancybox.resize)}if(a.centerOnScroll){l(window).on("scroll.fb",l.fancybox.center)}if(l.fn.mousewheel){r.on("mousewheel.fb",function(H,I){if(C){H.preventDefault()}else{if(a.type=="image"&&(l(H.target).outerHeight()==0||l(H.target).prop("scrollHeight")===l(H.target).outerHeight())){H.preventDefault();l.fancybox[I>0?"prev":"next"]()}}})}if(a.type=="iframe"){l('<iframe id="fancybox-frame" name="fancybox-frame'+new Date().getTime()+'"'+(navigator.userAgent.match(/msie [6]/i)?' allowtransparency="true""':"")+' style="border:0;margin:0;overflow:'+(y.scrolling=="auto"?"auto":(y.scrolling=="yes"?"scroll":"hidden"))+'" src="'+a.href+'"'+(false===a.allowfullscreen?"":" allowfullscreen")+' tabindex="999"></iframe>').appendTo(z).load(function(){l.fancybox.hideActivity()}).focus()}r.show();C=false;l.fancybox.center();a.onComplete(e,d,a);_preload_images()},_preload_images=function(){var H,I;if((e.length-1)>d){H=e[d+1];if(typeof H!=="undefined"&&typeof H.href!=="undefined"&&(H.href.match(u)||l(H).hasClass("image"))){I=new Image();I.src=H.href}}if(d>0){H=e[d-1];if(typeof H!=="undefined"&&typeof H.href!=="undefined"&&(H.href.match(u)||l(H).hasClass("image"))){I=new Image();I.src=H.href}}},_draw=function(I){var H={width:parseInt(t.width+(n.width-t.width)*I,10),height:parseInt(t.height+(n.height-t.height)*I,10),top:parseInt(t.top+(n.top-t.top)*I,10),left:parseInt(t.left+(n.left-t.left)*I,10)};if(typeof n.opacity!=="undefined"){H.opacity=I<0.5?0.5:I}r.css(H);z.css({width:H.width-a.padding*2,height:H.height-(q*I)-a.padding*2})},_get_viewport=function(){return[document.documentElement.clientWidth-(a.margin*2),document.documentElement.clientHeight-(a.margin*2),l(document).scrollLeft()+a.margin,l(document).scrollTop()+a.margin]},_get_zoom_to=function(){var H=_get_viewport(),K={},I=a.padding*2,J;if(a.width.toString().indexOf("%")>-1){K.width=parseInt((H[0]*parseFloat(a.width))/100,10)}else{K.width=a.width+I}if(a.height.toString().indexOf("%")>-1){K.height=parseInt((H[1]*parseFloat(a.height))/100,10)}else{K.height=a.height+I}if(a.autoScale&&(K.width>H[0]||K.height>H[1])){if(a.keepRatio){J=a.width/a.height;if((K.width)>H[0]){K.width=H[0];K.height=parseInt(((K.width-I)/J)+I,10)}if((K.height)>H[1]){K.height=H[1];K.width=parseInt(((K.height-I)*J)+I,10)}}else{K.width=Math.min(K.width,H[0]);K.height=Math.min(K.height,H[1])}}K.top=parseInt(Math.max(H[3]-20,H[3]+((H[1]-K.height-40)*0.5)),10);K.left=parseInt(Math.max(H[2]-20,H[2]+((H[0]-K.width-40)*0.5)),10);return K},_get_obj_pos=function(H){var I=H.offset();I.top+=parseInt(H.css("paddingTop"),10)||0;I.left+=parseInt(H.css("paddingLeft"),10)||0;I.top+=parseInt(H.css("border-top-width"),10)||0;I.left+=parseInt(H.css("border-left-width"),10)||0;I.width=H.width();I.height=H.height();return I},_get_zoom_from=function(){var K=y.orig?l(y.orig):false,J={},I,H;if(K&&K.length){I=_get_obj_pos(K);J={width:I.width+(a.padding*2),height:I.height+(a.padding*2),top:I.top-a.padding-20,left:I.left-a.padding-20}}else{H=_get_viewport();J={width:a.padding*2,height:a.padding*2,top:parseInt((H[3]+H[1])*0.5,10),left:parseInt((H[2]+H[0])*0.5,10)}}return J},_animate_loading=function(){if(!j.is(":visible")){clearInterval(m);return}l("div",j).css("top",(o*-40)+"px");o=(o+1)%12};l.fn.fancybox=function(H){if(!l(this).length){return this}l(this).data("fancybox",l.extend({},H,(l.metadata?l(this).metadata():{}))).off("click.fb").on("click.fb",function(J){J.preventDefault();if(C){return}C=true;l(this).blur();h=[];g=0;var I=l(this).attr("rel")||"";if(I==""||I.replace(/alternate|external|help|license|nofollow|noreferrer|noopener|\s+/gi,"")==""){h.push(this)}else{h=l('a[rel="'+I+'"], area[rel="'+I+'"]');g=h.index(this)}_start(J);return});return this};l.fancybox=function(K){var J;if(C){return}C=true;J=typeof arguments[1]!=="undefined"?arguments[1]:{};h=[];g=parseInt(J.index,10)||0;if(l.isArray(K)){for(var I=0,H=K.length;I<H;I++){if(typeof K[I]=="object"){l(K[I]).data("fancybox",l.extend({},J,K[I]))}else{K[I]=l({}).data("fancybox",l.extend({content:K[I]},J))}}h=jQuery.merge(h,K)}else{if(typeof K=="object"){l(K).data("fancybox",l.extend({},J,K))}else{K=l({}).data("fancybox",l.extend({content:K},J))}h.push(K)}if(g>h.length||g<0){g=0}_start()};l.fancybox.showActivity=function(){clearInterval(m);j.show();m=setInterval(_animate_loading,66)};l.fancybox.hideActivity=function(){j.hide()};l.fancybox.next=function(){return l.fancybox.pos(d+1)};l.fancybox.prev=function(){return l.fancybox.pos(d-1)};l.fancybox.pos=function(H){if(C){return}H=parseInt(H);h=e;if(H>-1&&H<e.length){g=H;_start()}else{if(a.cyclic&&e.length>1){g=H>=e.length?0:e.length-1;_start()}}return};l.fancybox.cancel=function(){if(C){return}C=true;l(".fancybox-inline-tmp").trigger("fancybox-cancel");_abort();y.onCancel(h,g,y);C=false};l.fancybox.close=function(){if(C||r.is(":hidden")){return}C=true;if(a&&false===a.onCleanup(e,d,a)){C=false;return}_abort();l(w.add(v).add(i)).hide();l(z.add(B)).off();l(window).off("orientationchange.fb resize.fb scroll.fb mousewheel.fb");l(document).off("keydown.fb");z.find("iframe#fancybox-frame").attr("src",x&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");if(a.titlePosition!=="inside"){G.empty()}r.stop();function H(){B.fadeOut("fast");G.empty().hide();r.hide();l(".fancybox-inline-tmp").trigger("fancybox-cleanup");z.empty();a.onClosed(e,d,a);e=y=[];d=g=0;a=y={};C=false}if(a.transitionOut=="elastic"){t=_get_zoom_from();var I=r.position();n={top:I.top,left:I.left,width:r.width(),height:r.height()};if(a.opacity){n.opacity=1}G.empty().hide();f.prop=1;l(f).animate({prop:0},{duration:a.speedOut,easing:a.easingOut,step:_draw,complete:H})}else{r.fadeOut(a.transitionOut=="none"?0:a.speedOut,H)}};l.fancybox.resize=function(){var H;clearTimeout(F);F=setTimeout(function(){var I=function(){if(y.autoDimensions){z.css("height","auto")}r.css("height","auto");if(b&&b.length){G.show()}C=false;l.fancybox.center(true)};if(B.is(":visible")){B.css("height",l(document).height())}H=r.position(),t={top:H.top,left:H.left,width:r.width(),height:r.height()};n=_get_zoom_to();C=true;_process_title();f.prop=0;l(f).animate({prop:1},{duration:a.changeSpeed,easing:a.easingChange,step:_draw,complete:I})},500)};l.fancybox.center=function(){var H,I;if(C){return}I=arguments[0]===true?1:0;H=_get_viewport();if(!I&&(r.width()>H[0]||r.height()>H[1])){return}r.stop().animate({top:parseInt(Math.max(H[3]-20,H[3]+((H[1]-z.height()-40)*0.5)-a.padding)),left:parseInt(Math.max(H[2]-20,H[2]+((H[0]-z.width()-40)*0.5)-a.padding))},typeof arguments[0]=="number"?arguments[0]:300)};l.fancybox.init=function(){if(l("#fancybox-wrap").length){return}l("body").append(D=l('<div id="fancybox-tmp"></div>'),j=l('<div id="fancybox-loading"><div></div></div>'),B=l('<div id="fancybox-overlay"></div>'),r=l('<div id="fancybox-wrap"></div>'));c=l('<div id="fancybox-outer"></div>').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>').appendTo(r);c.append(z=l('<div id="fancybox-content"></div>'),w=l('<a id="fancybox-close"></a>'),G=l('<div id="fancybox-title"></div>'),v=l('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),i=l('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));w.click(l.fancybox.close);j.click(l.fancybox.cancel);v.click(function(H){H.preventDefault();l.fancybox.prev()});i.click(function(H){H.preventDefault();l.fancybox.next()});if(!l.support.opacity){r.addClass("fancybox-ie")}if(x){j.addClass("fancybox-ie6");r.addClass("fancybox-ie6");l('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" style="overflow:hidden;border:0" tabindex="-1"></iframe>').prependTo(c)}};l.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,allowfullscreen:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:!s,autoResize:true,keepRatio:false,minViewportWidth:0,ajax:{},swf:{wmode:"opaque"},svg:{wmode:"opaque"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:true,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};l(document).ready(function(){l.fancybox.init()})})(jQuery);
|
1 |
+
(function(l){var D,j,B,r,c,z,w,H,v,i,F,g=0,y={},h=[],d=0,a={},e=[],k=null,E=new Image(),u=/\.(jpg|gif|png|bmp|jpeg|webp)(.*)?$/i,p=/[^\.]\.(swf)\s*$/i,A=/[^\.]\.(svg)\s*$/i,G=/[^\.]\.(pdf)\s*$/i,m,o=1,q=0,b="",t,n,C=false,f=l.extend(l("<div/>")[0],{prop:0}),x=navigator.userAgent.match(/msie [6]/i)&&!window.XMLHttpRequest,s=document.createTouch!==undefined;_abort=function(){l.fancybox.hideActivity();E.onerror=E.onload=null;if(k){k.abort()}D.empty()},_error=function(I){if(false===y.onError(h,g,y)){l.fancybox.hideActivity();C=false;return}if(typeof I==="undefined"){I="Please try again later."}y.titleShow=false;y.width="auto";y.height="auto";D.html('<p id="fancybox-error">The requested content cannot be loaded.<br />'+I+"</p>");_process_inline()},_start=function(){var M=h[g],J,L,O,N,I,K;_abort();y=l.extend({},l.fn.fancybox.defaults,(typeof l(M).data("fancybox")=="undefined"?y:l(M).data("fancybox")));if(document.documentElement.clientWidth<y.minViewportWidth){C=false;return}K=y.onStart(h,g,y);if(K===false){C=false;return}else{if(typeof K=="object"){y=l.extend(y,K)}}O=y.title||(M.nodeName?l(M).attr("title"):M.title)||"";if(M.nodeName&&!y.orig){y.orig=l(M).find("img:first").length?l(M).find("img:first"):l(M)}if(O===""&&y.orig){O=y.orig.attr("title")||(y.titleFromAlt?y.orig.attr("alt"):"")}J=y.href||(M.nodeName?l(M).attr("href"):M.href)||null;if((/^(?:javascript)/i).test(J)||J=="#"){J=null}if(y.type){L=y.type;if(!J){J=y.content}}else{if(y.content){L="html"}else{if(l(M).hasClass("iframe")){L="iframe"}else{if(J){if(J.match(u)||l(M).hasClass("image")){L="image"}else{if(J.match(p)){L="swf"}else{if(J.match(A)){L="svg"}else{if(J.match(G)){L="pdf"}else{if(J.indexOf("#")===0){L="inline"}else{L="ajax"}}}}}}}}}if(!L){_error("No content type found.");return}if(l(M).hasClass("modal")){y.modal=true}if(L=="inline"){M=J.substr(J.indexOf("#"));L=l(M).length>0?"inline":"ajax"}y.type=L;y.href=J;y.title=O;if(y.autoDimensions){if(y.type=="html"||y.type=="inline"||y.type=="ajax"){y.width="auto";y.height="auto"}else{y.autoDimensions=false}}if(y.modal){y.overlayShow=true;y.hideOnOverlayClick=false;y.hideOnContentClick=false;y.enableEscapeButton=false;y.showCloseButton=false}y.padding=parseInt(y.padding,10);y.margin=parseInt(y.margin,10);D.css("padding",(y.padding+y.margin));l(".fancybox-inline-tmp").off("fancybox-cancel").on("fancybox-change",function(){l(this).replaceWith(z.children())});switch(L){case"html":D.html(y.content);_process_inline();break;case"inline":if(l(M).parent().is("#fancybox-content")===true){C=false;return}l('<div class="fancybox-inline-tmp" />').hide().insertBefore(l(M)).on("fancybox-cleanup",function(){l(this).replaceWith(z.children("div:first"))}).on("fancybox-cancel",function(){l(this).replaceWith(D.children("div:first"))});l(M).appendTo(D);_process_inline();break;case"image":y.keepRatio=true;C=false;l.fancybox.showActivity();E=new Image();E.onerror=function(){_error("No image found.")};E.onload=function(){C=true;E.onerror=E.onload=null;_process_image()};E.src=J;break;case"swf":y.scrolling="no";y.keepRatio=true;N='<object type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+y.width+'" height="'+y.height+'"><param name="movie" value="'+J+'"></param>';I="";l.each(y.swf,function(P,Q){N+='<param name="'+P+'" value="'+Q+'"></param>';I+=" "+P+'="'+Q+'"'});N+='<embed src="'+J+'" type="application/x-shockwave-flash" width="'+y.width+'" height="'+y.height+'"'+I+"></embed></object>";D.html(N);_process_inline();break;case"svg":y.scrolling="no";y.keepRatio=true;N='<object type="image/svg+xml" width="'+y.width+'" height="'+y.height+'" data="'+J+'"></object>';D.html(N);_process_inline();break;case"pdf":y.scrolling="no";N='<object type="application/pdf" width="100%" height="100%" data="'+J+'"><a href="'+J+'" style="display:block;position:absolute;top:48%;width:100%;text-align:center">'+l(M).html()+"</a></object>";D.html(N);_process_inline();break;case"ajax":C=false;l.fancybox.showActivity();y.ajax.win=y.ajax.success;k=l.ajax(l.extend({},y.ajax,{url:J,data:y.ajax.data||{},error:function(P,R,Q){if(P.status>0){_error(Q)}},success:function(Q,S,P){var R=typeof P=="object"?P:k;if(R.status==200){if(typeof y.ajax.win=="function"){K=y.ajax.win(J,Q,S,P);if(K===false){l.fancybox.hideActivity();return}else{if(typeof K=="string"||typeof K=="object"){Q=K}}}if(Q.indexOf("<!DOCTYPE")>-1||Q.indexOf("<html")>-1||Q.indexOf("<body")>-1){_error("Unexpected response.")}else{D.html(Q);_process_inline()}}}}));break;case"iframe":l.fancybox.showActivity();_show();break}},_process_inline=function(){var J=y.width,K=y.height,L=l(window).width()==0?window.innerWidth:l(window).width(),I=l(window).height()==0?window.innerHeight:l(window).height();if(J.toString().indexOf("%")>-1){J=parseInt((L-(y.margin*2))*parseFloat(J)/100,10)+"px"}else{J=J=="auto"?"auto":J+"px"}if(K.toString().indexOf("%")>-1){K=parseInt((I-(y.margin*2))*parseFloat(K)/100,10)+"px"}else{K=K=="auto"?"auto":K+"px"}D.wrapInner('<div style="width:'+J+";height:"+K+";overflow: "+(y.scrolling=="auto"?"auto":(y.scrolling=="yes"?"scroll":"hidden"))+';position:relative;"></div>');y.width=D.width();y.height=D.height();_show()},_process_image=function(){y.width=E.width;y.height=E.height;l("<img />").attr({id:"fancybox-img",src:E.src,alt:y.title}).appendTo(D);_show()},_show=function(){var J,I;if(y.type!=="iframe"){l.fancybox.hideActivity()}if(r.is(":visible")&&false===a.onCleanup(e,d,a)){l(".fancybox-inline-tmp").trigger("fancybox-cancel");C=false;return}C=true;l(z.add(B)).off();l(window).off("orientationchange.fb resize.fb scroll.fb");l(document).off("keydown.fb");if(r.is(":visible")&&a.titlePosition!=="outside"){r.css("height",r.height())}e=h;d=g;a=y;if(a.overlayShow){B.css({"background-color":a.overlayColor,opacity:a.overlayOpacity,cursor:a.hideOnOverlayClick?"pointer":"auto",height:l(document).height()});if(!B.is(":visible")){if(x){l("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"})}B.show()}}else{B.hide()}n=_get_zoom_to();_process_title();if(r.is(":visible")){l(w.add(v).add(i)).hide();J=r.position(),t={top:J.top,left:J.left,width:r.width(),height:r.height()};I=(t.width==n.width&&t.height==n.height);z.fadeTo(a.changeFade,0.3,function(){var K=function(){z.html(D.contents()).fadeTo(a.changeFade,1,_finish)};l(".fancybox-inline-tmp").trigger("fancybox-change");z.empty().removeAttr("filter").css({"border-width":a.padding,width:n.width-a.padding*2,height:y.autoDimensions?"auto":n.height-q-a.padding*2});if(I){K()}else{f.prop=0;l(f).animate({prop:1},{duration:a.changeSpeed,easing:a.easingChange,step:_draw,complete:K})}});return}r.removeAttr("style");z.css("border-width",a.padding);if(a.transitionIn=="elastic"){t=_get_zoom_from();z.html(D.contents());r.show();if(a.opacity){n.opacity=0}f.prop=0;l(f).animate({prop:1},{duration:a.speedIn,easing:a.easingIn,step:_draw,complete:_finish});return}if(a.titlePosition=="inside"&&q>0){H.show()}z.css({width:n.width-a.padding*2,height:y.autoDimensions?"auto":n.height-q-a.padding*2}).html(D.contents());r.css(n).fadeIn(a.transitionIn=="none"?0:a.speedIn,_finish)},_format_title=function(I){if(I&&I.length){if(a.titlePosition=="float"){return'<table id="fancybox-title-float-wrap" style="border-spacing:0;border-collapse:collapse"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+I+'</td><td id="fancybox-title-float-right"></td></tr></table>'}return'<div id="fancybox-title-'+a.titlePosition+'">'+I+"</div>"}return false},_process_title=function(){b=a.title||"";q=0;H.empty().removeAttr("style").removeClass();if(a.titleShow===false){H.hide();return}b=l.isFunction(a.titleFormat)?a.titleFormat(b,e,d,a):_format_title(b);if(!b||b===""){H.hide();return}H.addClass("fancybox-title-"+a.titlePosition).html(b).appendTo("body").show();switch(a.titlePosition){case"inside":H.css({width:n.width-(a.padding*2),marginLeft:a.padding,marginRight:a.padding}).appendTo(c);q=H.outerHeight(true);n.height+=q;break;case"over":H.css({marginLeft:a.padding,width:n.width-(a.padding*2),bottom:a.padding}).appendTo(c);break;case"float":H.css("left",parseInt((H.width()-n.width)/2,10)*-1).appendTo(c);break;default:H.css({width:n.width-(a.padding*2),paddingLeft:a.padding,paddingRight:a.padding}).appendTo(r);break}H.hide()},_set_navigation=function(){if(a.enableEscapeButton||a.enableKeyboardNav){l(document).on("keydown.fb",function(I){if(I.keyCode==27&&a.enableEscapeButton){I.preventDefault();l.fancybox.close()}else{if((I.keyCode==37||I.keyCode==39)&&a.enableKeyboardNav&&I.target.tagName!=="INPUT"&&I.target.tagName!=="TEXTAREA"&&I.target.tagName!=="SELECT"){I.preventDefault();l.fancybox[I.keyCode==37?"prev":"next"]()}else{if((I.keyCode==9)&&a.enableKeyboardNav&&I.target.tagName!=="INPUT"&&I.target.tagName!=="TEXTAREA"&&I.target.tagName!=="SELECT"){I.preventDefault();l.fancybox[I.shiftKey?"prev":"next"]()}}}})}if(!a.showNavArrows){v.hide();i.hide();return}if((a.cyclic&&e.length>1)||d!==0){v.show()}if((a.cyclic&&e.length>1)||d!=(e.length-1)){i.show()}},_finish=function(){if(!l.support.opacity){z.css("filter",0);r.css("filter",0)}if(y.autoDimensions){z.css("height","auto")}r.css("height","auto");if(b&&b.length){H.show()}if(a.showCloseButton){w.show()}_set_navigation();if(a.hideOnContentClick){z.on("click",l.fancybox.close)}if(a.hideOnOverlayClick){B.on("click",l.fancybox.close)}if(a.autoResize){l(window).on("resize.fb",l.fancybox.resize)}if(a.centerOnScroll&&!s){l(window).on("scroll.fb",l.fancybox.center)}if(l.fn.mousewheel){r.on("mousewheel.fb",function(I,J){if(C){I.preventDefault()}else{if(a.type=="image"&&(l(I.target).outerHeight()==0||l(I.target).prop("scrollHeight")===l(I.target).outerHeight())){I.preventDefault();l.fancybox[J>0?"prev":"next"]()}}})}if(a.type=="iframe"){l('<iframe id="fancybox-frame" name="fancybox-frame'+new Date().getTime()+'"'+(navigator.userAgent.match(/msie [6]/i)?' allowtransparency="true""':"")+' style="border:0;margin:0;overflow:'+(y.scrolling=="auto"?"auto":(y.scrolling=="yes"?"scroll":"hidden"))+'" src="'+a.href+'"'+(false===a.allowfullscreen?"":" allowfullscreen")+' tabindex="999"></iframe>').appendTo(z).load(function(){l.fancybox.hideActivity()}).focus()}r.show();C=false;l.fancybox.center();a.onComplete(e,d,a);if(e.length>1){_preload_next();_preload_prev()}},_preload_next=function(){var I=typeof arguments[0]=="number"?arguments[0]:d+1;if(I>=e.length){if(a.cyclic){I=0}else{return}}if(_preload_image(I)){return}else{_preload_next(I+1)}},_preload_prev=function(){var I=typeof arguments[0]=="number"?arguments[0]:d-1;if(I<0){if(a.cyclic){I=e.length-1}else{return}}if(_preload_image(I)){return}else{_preload_prev(I-1)}},_preload_image=function(K){var J,I=e[K];if(typeof I!=="undefined"&&typeof I.href!=="undefined"&&I.href!==a.href&&(I.href.match(u)||l(I).hasClass("image"))){J=new Image();J.src=I.href;return true}else{return false}},_draw=function(J){var I={width:parseInt(t.width+(n.width-t.width)*J,10),height:parseInt(t.height+(n.height-t.height)*J,10),top:parseInt(t.top+(n.top-t.top)*J,10),left:parseInt(t.left+(n.left-t.left)*J,10)};if(typeof n.opacity!=="undefined"){I.opacity=J<0.5?0.5:J}r.css(I);z.css({width:I.width-a.padding*2,height:I.height-(q*J)-a.padding*2})},_get_viewport=function(){var I=!s&&window.innerWidth&&document.documentElement.clientWidth?Math.min(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,J=!s&&window.innerHeight&&document.documentElement.clientHeight?Math.min(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight;return[I-(a.margin*2),J-(a.margin*2),l(document).scrollLeft()+a.margin,l(document).scrollTop()+a.margin]},_get_zoom_to=function(){var I=_get_viewport(),L={},J=a.padding*2,K;if(a.width.toString().indexOf("%")>-1){L.width=parseInt((I[0]*parseFloat(a.width))/100,10)}else{L.width=a.width+J}if(a.height.toString().indexOf("%")>-1){L.height=parseInt((I[1]*parseFloat(a.height))/100,10)}else{L.height=a.height+J}if(a.autoScale&&(L.width>I[0]||L.height>I[1])){if(a.keepRatio){K=a.width/a.height;if((L.width)>I[0]){L.width=I[0];L.height=parseInt(((L.width-J)/K)+J,10)}if((L.height)>I[1]){L.height=I[1];L.width=parseInt(((L.height-J)*K)+J,10)}}else{L.width=Math.min(L.width,I[0]);L.height=Math.min(L.height,I[1])}}L.top=parseInt(Math.max(I[3]-20,I[3]+((I[1]-L.height-40)*0.5)),10);L.left=parseInt(Math.max(I[2]-20,I[2]+((I[0]-L.width-40)*0.5)),10);return L},_get_obj_pos=function(I){var J=I.offset();J.top+=parseInt(I.css("paddingTop"),10)||0;J.left+=parseInt(I.css("paddingLeft"),10)||0;J.top+=parseInt(I.css("border-top-width"),10)||0;J.left+=parseInt(I.css("border-left-width"),10)||0;J.width=I.width();J.height=I.height();return J},_get_zoom_from=function(){var L=y.orig?l(y.orig):false,K={},J,I;if(L&&L.length){J=_get_obj_pos(L);K={width:J.width+(a.padding*2),height:J.height+(a.padding*2),top:J.top-a.padding-20,left:J.left-a.padding-20}}else{I=_get_viewport();K={width:a.padding*2,height:a.padding*2,top:parseInt((I[3]+I[1])*0.5,10),left:parseInt((I[2]+I[0])*0.5,10)}}return K},_animate_loading=function(){if(!j.is(":visible")){clearInterval(m);return}l("div",j).css("top",(o*-40)+"px");o=(o+1)%12};l.fn.fancybox=function(I){if(!l(this).length){return this}l(this).data("fancybox",l.extend({},I,(l.metadata?l(this).metadata():{}))).off("click.fb").on("click.fb",function(K){K.preventDefault();if(C){return}C=true;l(this).blur();h=[];g=0;var J=l(this).attr("rel")||"";if(J==""||J.replace(/alternate|external|help|license|nofollow|noreferrer|noopener|\s+/gi,"")==""){h.push(this)}else{h=l('a[rel="'+J+'"], area[rel="'+J+'"]');g=h.index(this)}_start();return});return this};l.fancybox=function(L){var K;if(C){return}C=true;K=typeof arguments[1]!=="undefined"?arguments[1]:{};h=[];g=parseInt(K.index,10)||0;if(l.isArray(L)){for(var J=0,I=L.length;J<I;J++){if(typeof L[J]=="object"){l(L[J]).data("fancybox",l.extend({},K,L[J]))}else{L[J]=l({}).data("fancybox",l.extend({content:L[J]},K))}}h=jQuery.merge(h,L)}else{if(typeof L=="object"){l(L).data("fancybox",l.extend({},K,L))}else{L=l({}).data("fancybox",l.extend({content:L},K))}h.push(L)}if(g>h.length||g<0){g=0}_start()};l.fancybox.showActivity=function(){clearInterval(m);j.show();m=setInterval(_animate_loading,66)};l.fancybox.hideActivity=function(){j.hide()};l.fancybox.next=function(){var I,J=typeof arguments[0]=="number"?arguments[0]:d+1;if(J>=e.length){if(a.cyclic){J=0}else{return}}I=e[J];if(typeof I!=="undefined"&&typeof I.href!=="undefined"&&I.href===a.href){l.fancybox.next(J+1)}else{l.fancybox.pos(J)}return};l.fancybox.prev=function(){var I,J=typeof arguments[0]=="number"?arguments[0]:d-1;if(J<0){if(a.cyclic){J=e.length-1}else{return}}I=e[J];if(typeof I!=="undefined"&&typeof I.href!=="undefined"&&I.href===a.href){l.fancybox.prev(J-1)}else{l.fancybox.pos(J)}return};l.fancybox.pos=function(I){if(C){return}I=parseInt(I);h=e;if(I>-1&&I<e.length){g=I;_start()}return};l.fancybox.cancel=function(){if(C){return}C=true;l(".fancybox-inline-tmp").trigger("fancybox-cancel");_abort();y.onCancel(h,g,y);C=false};l.fancybox.close=function(){if(C||r.is(":hidden")){return}C=true;if(a&&false===a.onCleanup(e,d,a)){C=false;return}_abort();l(w.add(v).add(i)).hide();l(z.add(B)).off();l(window).off("orientationchange.fb resize.fb scroll.fb mousewheel.fb");l(document).off("keydown.fb");z.find("iframe#fancybox-frame").attr("src",x&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");if(a.titlePosition!=="inside"){H.empty()}r.stop();function I(){B.fadeOut("fast");H.empty().hide();r.hide();l(".fancybox-inline-tmp").trigger("fancybox-cleanup");z.empty();a.onClosed(e,d,a);e=y=[];d=g=0;a=y={};C=false}if(a.transitionOut=="elastic"){t=_get_zoom_from();var J=r.position();n={top:J.top,left:J.left,width:r.width(),height:r.height()};if(a.opacity){n.opacity=1}H.empty().hide();f.prop=1;l(f).animate({prop:0},{duration:a.speedOut,easing:a.easingOut,step:_draw,complete:I})}else{r.fadeOut(a.transitionOut=="none"?0:a.speedOut,I)}};l.fancybox.resize=function(){var I;clearTimeout(F);F=setTimeout(function(){var J=function(){if(y.autoDimensions){z.css("height","auto")}r.css("height","auto");if(b&&b.length){H.show()}C=false;l.fancybox.center(true)};if(B.is(":visible")){B.css("height",l(document).height())}I=r.position(),t={top:I.top,left:I.left,width:r.width(),height:r.height()};n=_get_zoom_to();C=true;_process_title();f.prop=0;l(f).animate({prop:1},{duration:a.changeSpeed,easing:a.easingChange,step:_draw,complete:J})},500)};l.fancybox.center=function(){var I,J;if(C){return}J=arguments[0]===true?1:0;I=_get_viewport();if(!J&&(r.width()>I[0]||r.height()>I[1])){return}r.stop().animate({top:parseInt(Math.max(I[3]-20,I[3]+((I[1]-z.height()-40)*0.5)-a.padding)),left:parseInt(Math.max(I[2]-20,I[2]+((I[0]-z.width()-40)*0.5)-a.padding))},typeof arguments[0]=="number"?arguments[0]:300)};l.fancybox.init=function(){if(l("#fancybox-wrap").length){return}l("body").append(D=l('<div id="fancybox-tmp"></div>'),j=l('<div id="fancybox-loading"><div></div></div>'),B=l('<div id="fancybox-overlay"></div>'),r=l('<div id="fancybox-wrap"></div>'));c=l('<div id="fancybox-outer"></div>').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>').appendTo(r);c.append(z=l('<div id="fancybox-content"></div>'),w=l('<a id="fancybox-close"></a>'),H=l('<div id="fancybox-title"></div>'),v=l('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),i=l('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));w.click(l.fancybox.close);j.click(l.fancybox.cancel);v.click(function(I){I.preventDefault();l.fancybox.prev()});i.click(function(I){I.preventDefault();l.fancybox.next()});if(!l.support.opacity){r.addClass("fancybox-ie")}if(x){j.addClass("fancybox-ie6");r.addClass("fancybox-ie6");l('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" style="overflow:hidden;border:0" tabindex="-1"></iframe>').prependTo(c)}};l.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,allowfullscreen:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,autoResize:true,keepRatio:false,minViewportWidth:0,ajax:{},swf:{wmode:"opaque"},svg:{wmode:"opaque"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:true,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};l(document).ready(function(){l.fancybox.init()})})(jQuery);
|
inc/class-easyfancybox-options.php
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
/**
|
3 |
* Easy FancyBox Options Class
|
4 |
*/
|
|
|
5 |
class easyFancyBox_Options extends easyFancyBox {
|
6 |
|
7 |
public static function load_defaults() {
|
@@ -28,7 +29,7 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
28 |
'id' => 'fancybox_enableImg',
|
29 |
'input' => 'checkbox',
|
30 |
'hide' => true,
|
31 |
-
'default' => ( function_exists('is_plugin_active_for_network') && is_plugin_active_for_network( plugin_basename
|
32 |
'description' => '<strong>' . __('Images','easy-fancybox') . '</strong>'
|
33 |
),
|
34 |
'Inline' => array (
|
@@ -137,7 +138,7 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
137 |
'hide' => true,
|
138 |
'status' => get_option('fancybox_overlaySpotlight') ? '' : 'disabled',
|
139 |
'default' => '',
|
140 |
-
'description' =>
|
141 |
)
|
142 |
)
|
143 |
),
|
@@ -274,13 +275,13 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
274 |
'hide' => true,
|
275 |
'description' => '<br /><strong>' . __('Behavior','easy-fancybox') . '</strong><br />'
|
276 |
),
|
277 |
-
|
278 |
'id' => 'fancybox_centerOnScroll',
|
279 |
'input' => 'checkbox',
|
280 |
'noquotes' => true,
|
281 |
-
'default' => '
|
282 |
-
'description' => __('Center while scrolling','easy-fancybox')
|
283 |
-
)
|
284 |
'enableEscapeButton' => array (
|
285 |
'id' => 'fancybox_enableEscapeButton',
|
286 |
'input' => 'checkbox',
|
@@ -312,6 +313,13 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
312 |
'class' => 'small-text',
|
313 |
'default' => '',
|
314 |
'description' => '<br />' . __('Duration in milliseconds. Higher is slower.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' 300</em><br />'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
315 |
)
|
316 |
)
|
317 |
),
|
@@ -378,7 +386,7 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
378 |
'hide' => true,
|
379 |
'description' => '<br /><strong>' . __('Browser & device compatibility','easy-fancybox') . '</strong><br />'
|
380 |
),
|
381 |
-
|
382 |
'id' => 'fancybox_minViewportWidth',
|
383 |
'title' => __('Minimum browser/device viewport width','easy-fancybox'),
|
384 |
'label_for' => 'fancybox_minViewportWidth',
|
@@ -407,32 +415,45 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
407 |
'description' => __('Include IE 8 compatibility style rules','easy-fancybox')
|
408 |
),
|
409 |
|
410 |
-
|
411 |
'hide' => true,
|
412 |
'description' => '<br /><strong>' . __('Theme & plugins compatibility','easy-fancybox') . '</strong><br />'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
),
|
414 |
'noFooter' => array (
|
415 |
'id' => 'fancybox_noFooter',
|
416 |
'input' => 'checkbox',
|
417 |
'hide' => true,
|
418 |
'default' => '',
|
419 |
-
'description' => __('Move scripts from footer to theme head section','easy-fancybox')
|
420 |
),
|
421 |
'nojQuery' => array (
|
422 |
'id' => 'fancybox_nojQuery',
|
423 |
'input' => 'checkbox',
|
424 |
'hide' => true,
|
425 |
'default' => '',
|
426 |
-
'description' => __('Do not include standard WordPress jQuery library','easy-fancybox')
|
427 |
),
|
428 |
-
'
|
429 |
-
'id' => '
|
430 |
'input' => 'checkbox',
|
431 |
'hide' => true,
|
432 |
-
'default' => '',
|
433 |
-
'description' => __('
|
434 |
),
|
435 |
-
*/
|
436 |
'p3' => array (
|
437 |
'hide' => true,
|
438 |
'description' => '<br /><strong>' . __('Advanced','easy-fancybox') . '</strong><br />'
|
@@ -443,7 +464,7 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
443 |
'input' => 'checkbox',
|
444 |
'status' => get_option('fancybox_metaData') ? '' : 'disabled',
|
445 |
'default' => '',
|
446 |
-
'description' =>
|
447 |
)
|
448 |
)
|
449 |
)
|
@@ -648,13 +669,6 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
648 |
'default' => '1',
|
649 |
'description' => __('Arrow key strokes browse the gallery','easy-fancybox')
|
650 |
),
|
651 |
-
'mouseWheel' => array (
|
652 |
-
'id' => 'fancybox_mouseWheel',
|
653 |
-
'hide' => true,
|
654 |
-
'input' => 'checkbox',
|
655 |
-
'default' => '1',
|
656 |
-
'description' => __('Include the Mousewheel jQuery extension script to allow gallery browsing by mousewheel action.','easy-fancybox')
|
657 |
-
),
|
658 |
'cyclic' => array (
|
659 |
'id' => 'fancybox_cyclic',
|
660 |
'input' => 'checkbox',
|
@@ -691,7 +705,7 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
691 |
'id' => 'fancybox_autoSelector',
|
692 |
'hide' => true,
|
693 |
'input' => 'hidden',
|
694 |
-
'default' => 'div.gallery
|
695 |
),
|
696 |
'onComplete' => array (
|
697 |
'id' => '',
|
@@ -856,16 +870,24 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
856 |
'default' => 'fancybox-pdf'
|
857 |
),
|
858 |
'type' => array (
|
859 |
-
'
|
|
|
|
|
|
|
|
|
860 |
'title' => __('Embed with','easy-fancybox'),
|
861 |
-
'label_for' => '
|
862 |
'input' => 'select',
|
863 |
'options' => array(
|
864 |
-
'
|
865 |
-
'
|
|
|
|
|
866 |
),
|
867 |
-
'default' => '
|
868 |
-
|
|
|
|
|
869 |
),
|
870 |
'width' => array (
|
871 |
'id' => 'fancybox_PDFwidth',
|
@@ -933,12 +955,6 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
933 |
'scrolling' => array (
|
934 |
'default' => 'no',
|
935 |
),
|
936 |
-
'onStart' => array (
|
937 |
-
'noquotes' => true,
|
938 |
-
// 'default' => 'function(selectedArray, selectedIndex, selectedOpts) { selectedOpts.content = \'<embed src="\' + selectedArray[selectedIndex].href + \'#toolbar=1&navpanes=0&nameddest=self&page=1&view=FitH,0&zoom=80,0,0" type="application/pdf" height="100%" width="100%" />\' }'
|
939 |
-
'default' => get_option('fancybox_PDFclassType','html') == 'iframe' ? '' : 'function(selectedArray,selectedIndex,selectedOpts){selectedOpts.content=\'<object data="\'+selectedArray[selectedIndex].href+\'" type="application/pdf" height="100%" width="100%"><a href="\'+selectedArray[selectedIndex].href+\'" style="display:block;position:absolute;top:48%;width:100%;text-align:center">\'+jQuery(selectedArray[selectedIndex]).html()+\'</a></object>\'}'
|
940 |
-
// 'default' => 'function(selectedArray, selectedIndex, selectedOpts) { selectedOpts.content = \'<embed src="\' + selectedArray[selectedIndex].href + \'" type="application/pdf" height="100%" width="100%" />\' }'
|
941 |
-
),
|
942 |
)
|
943 |
),
|
944 |
|
@@ -1160,6 +1176,13 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
1160 |
'type' => array(
|
1161 |
'default' => 'iframe'
|
1162 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1163 |
'width' => array (
|
1164 |
'id' => 'fancybox_YoutubeWidth',
|
1165 |
'title' => translate('Width'),
|
@@ -1231,7 +1254,9 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
1231 |
),
|
1232 |
'onStart' => array (
|
1233 |
'noquotes' => true,
|
1234 |
-
'default' =>
|
|
|
|
|
1235 |
)
|
1236 |
)
|
1237 |
),
|
@@ -1334,7 +1359,7 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
1334 |
),
|
1335 |
'onStart' => array (
|
1336 |
'noquotes' => true,
|
1337 |
-
'default' => 'function(
|
1338 |
)
|
1339 |
)
|
1340 |
),
|
@@ -1437,7 +1462,7 @@ class easyFancyBox_Options extends easyFancyBox {
|
|
1437 |
),
|
1438 |
'onStart' => array (
|
1439 |
'noquotes' => true,
|
1440 |
-
'default' => 'function(
|
1441 |
)
|
1442 |
)
|
1443 |
),
|
2 |
/**
|
3 |
* Easy FancyBox Options Class
|
4 |
*/
|
5 |
+
|
6 |
class easyFancyBox_Options extends easyFancyBox {
|
7 |
|
8 |
public static function load_defaults() {
|
29 |
'id' => 'fancybox_enableImg',
|
30 |
'input' => 'checkbox',
|
31 |
'hide' => true,
|
32 |
+
'default' => ( function_exists('is_plugin_active_for_network') && is_plugin_active_for_network( parent::$plugin_basename ) ) ? '' : '1',
|
33 |
'description' => '<strong>' . __('Images','easy-fancybox') . '</strong>'
|
34 |
),
|
35 |
'Inline' => array (
|
138 |
'hide' => true,
|
139 |
'status' => get_option('fancybox_overlaySpotlight') ? '' : 'disabled',
|
140 |
'default' => '',
|
141 |
+
'description' => __('Spotlight effect','easy-fancybox') . ( get_option('fancybox_overlaySpotlight') ? '' : '. <em><a href="'.$url.'">' . __('Make available »','easy-fancybox') ) . '</a></em>'
|
142 |
)
|
143 |
)
|
144 |
),
|
275 |
'hide' => true,
|
276 |
'description' => '<br /><strong>' . __('Behavior','easy-fancybox') . '</strong><br />'
|
277 |
),
|
278 |
+
'centerOnScroll' => array (
|
279 |
'id' => 'fancybox_centerOnScroll',
|
280 |
'input' => 'checkbox',
|
281 |
'noquotes' => true,
|
282 |
+
'default' => '',
|
283 |
+
'description' => __('Center while scrolling (disabled on touch devices)','easy-fancybox')
|
284 |
+
),
|
285 |
'enableEscapeButton' => array (
|
286 |
'id' => 'fancybox_enableEscapeButton',
|
287 |
'input' => 'checkbox',
|
313 |
'class' => 'small-text',
|
314 |
'default' => '',
|
315 |
'description' => '<br />' . __('Duration in milliseconds. Higher is slower.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' 300</em><br />'
|
316 |
+
),
|
317 |
+
'mouseWheel' => array (
|
318 |
+
'id' => 'fancybox_mouseWheel',
|
319 |
+
'hide' => true,
|
320 |
+
'input' => 'checkbox',
|
321 |
+
'default' => '1',
|
322 |
+
'description' => __('Include the Mousewheel jQuery extension script to allow gallery browsing by mousewheel action.','easy-fancybox')
|
323 |
)
|
324 |
)
|
325 |
),
|
386 |
'hide' => true,
|
387 |
'description' => '<br /><strong>' . __('Browser & device compatibility','easy-fancybox') . '</strong><br />'
|
388 |
),
|
389 |
+
'minViewportWidth' => array (
|
390 |
'id' => 'fancybox_minViewportWidth',
|
391 |
'title' => __('Minimum browser/device viewport width','easy-fancybox'),
|
392 |
'label_for' => 'fancybox_minViewportWidth',
|
415 |
'description' => __('Include IE 8 compatibility style rules','easy-fancybox')
|
416 |
),
|
417 |
|
418 |
+
'p2' => array (
|
419 |
'hide' => true,
|
420 |
'description' => '<br /><strong>' . __('Theme & plugins compatibility','easy-fancybox') . '</strong><br />'
|
421 |
+
. __('Try to deactivate all conflicting light box scripts in your theme or other plugins. If this is not possible, try a higher script priority number which means scripts are added later, wich may allow them to override conflicting scripts. A lower priority number, excluding WordPress standard jQuery, or even moving the plugin scripts to the header may work in cases where there are blocking errors occuring in other script.','easy-fancybox') . '<br /><br />'
|
422 |
+
),
|
423 |
+
'scriptPriority' => array (
|
424 |
+
'id' => 'fancybox_scriptPriority',
|
425 |
+
'title' => __('FancyBox script priority','easy-fancybox'),
|
426 |
+
'label_for' => 'fancybox_scriptPriority',
|
427 |
+
'input' => 'number',
|
428 |
+
'step' => '1',
|
429 |
+
'min' => '1',
|
430 |
+
'max' => '999',
|
431 |
+
'sanitize_callback' => 'intval',
|
432 |
+
'class' => 'small-text',
|
433 |
+
'default' => '10',
|
434 |
+
'description' => __('Default priority is 10.','easy-fancybox') . ' ' . __('Higher is later.','easy-fancybox') . '<br/>'
|
435 |
),
|
436 |
'noFooter' => array (
|
437 |
'id' => 'fancybox_noFooter',
|
438 |
'input' => 'checkbox',
|
439 |
'hide' => true,
|
440 |
'default' => '',
|
441 |
+
'description' => __('Move scripts from footer to theme head section (not recommended for site load times!)','easy-fancybox')
|
442 |
),
|
443 |
'nojQuery' => array (
|
444 |
'id' => 'fancybox_nojQuery',
|
445 |
'input' => 'checkbox',
|
446 |
'hide' => true,
|
447 |
'default' => '',
|
448 |
+
'description' => __('Do not include standard WordPress jQuery library (do this only if you are sure jQuery is included from another source!)','easy-fancybox')
|
449 |
),
|
450 |
+
'pre45Compat' => array (
|
451 |
+
'id' => 'fancybox_pre45Compat',
|
452 |
'input' => 'checkbox',
|
453 |
'hide' => true,
|
454 |
+
'default' => function_exists( 'wp_add_inline_script' ) ? '' : '1',
|
455 |
+
'description' => __('Do not use wp_add_inline_script/style functions (may solve issues with older script minification plugins)','easy-fancybox')
|
456 |
),
|
|
|
457 |
'p3' => array (
|
458 |
'hide' => true,
|
459 |
'description' => '<br /><strong>' . __('Advanced','easy-fancybox') . '</strong><br />'
|
464 |
'input' => 'checkbox',
|
465 |
'status' => get_option('fancybox_metaData') ? '' : 'disabled',
|
466 |
'default' => '',
|
467 |
+
'description' => __('Include the Metadata jQuery extension script to allow passing custom parameters via link class.','easy-fancybox') . ( get_option('fancybox_metaData') ? '' : '. <em><a href="'.$url.'">' . __('Make available »','easy-fancybox') ) . '</a></em>'
|
468 |
)
|
469 |
)
|
470 |
)
|
669 |
'default' => '1',
|
670 |
'description' => __('Arrow key strokes browse the gallery','easy-fancybox')
|
671 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
672 |
'cyclic' => array (
|
673 |
'id' => 'fancybox_cyclic',
|
674 |
'input' => 'checkbox',
|
705 |
'id' => 'fancybox_autoSelector',
|
706 |
'hide' => true,
|
707 |
'input' => 'hidden',
|
708 |
+
'default' => 'div.gallery,div.wp-block-gallery,div.tiled-gallery' // add div.tiled-gallery for Tiled Galleries support
|
709 |
),
|
710 |
'onComplete' => array (
|
711 |
'id' => '',
|
870 |
'default' => 'fancybox-pdf'
|
871 |
),
|
872 |
'type' => array (
|
873 |
+
'default' => 'iframe'
|
874 |
+
),
|
875 |
+
'onStart' => array (
|
876 |
+
'id' => 'fancybox_PDFonStart',
|
877 |
+
'noquotes' => true,
|
878 |
'title' => __('Embed with','easy-fancybox'),
|
879 |
+
'label_for' => 'fancybox_PDFtitlePosition',
|
880 |
'input' => 'select',
|
881 |
'options' => array(
|
882 |
+
'function(a,i,o){o.type=\'pdf\';}' => __('Object tag (plus fall-back link)','easy-fancybox'),
|
883 |
+
'function(a,i,o){o.content=\'<embed src="\'+a[i].href+\'" type="application/pdf" height="100%" width="100%" />\'}' => __('Embed tag','easy-fancybox'),
|
884 |
+
'' => __('iFrame tag (let browser decide)','easy-fancybox'),
|
885 |
+
'function(a,i,o){o.href=\'https://docs.google.com/viewer?embedded=true&url=\'+a[i].href;}' => __('Google Docs Viewer (external)','easy-fancybox')
|
886 |
),
|
887 |
+
'default' => '',
|
888 |
+
// 'function(a,i,o){o.content=\'<object data="\'+a[i].href+\'" type="application/pdf" height="100%" width="100%"><a href="\'+a[i].href+\'" style="display:block;position:absolute;top:48%;width:100%;text-align:center">\'+jQuery(a[i]).html()+\'</a></object>\'}'
|
889 |
+
// 'function(a, i, o) { o.content = \'<embed src="\' + a[i].href + \'#toolbar=1&navpanes=0&nameddest=self&page=1&view=FitH,0&zoom=80,0,0" type="application/pdf" height="100%" width="100%" />\' }'
|
890 |
+
'description' => __('Note:','easy-fancybox') . ' ' . __('External viewers have bandwidth, usage rate and and file size limits.','easy-fancybox') . '<br /><br />' //' <em><a href="'.$url.'">' . __('More options »','easy-fancybox') . '</a></em><br /><br />'
|
891 |
),
|
892 |
'width' => array (
|
893 |
'id' => 'fancybox_PDFwidth',
|
955 |
'scrolling' => array (
|
956 |
'default' => 'no',
|
957 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
958 |
)
|
959 |
),
|
960 |
|
1176 |
'type' => array(
|
1177 |
'default' => 'iframe'
|
1178 |
),
|
1179 |
+
'noCookie' => array (
|
1180 |
+
'id' => 'fancybox_YoutubenoCookie',
|
1181 |
+
'input' => 'checkbox',
|
1182 |
+
'hide' => true,
|
1183 |
+
'default' => '',
|
1184 |
+
'description' => __('Enable privacy-enhanced mode','easy-fancybox') . '<br />'
|
1185 |
+
),
|
1186 |
'width' => array (
|
1187 |
'id' => 'fancybox_YoutubeWidth',
|
1188 |
'title' => translate('Width'),
|
1254 |
),
|
1255 |
'onStart' => array (
|
1256 |
'noquotes' => true,
|
1257 |
+
'default' => get_option( 'fancybox_YoutubenoCookie' ) ?
|
1258 |
+
'function(a,i,o){o.href=a[i].href.replace(new RegExp(\'youtu.be\',\'i\'),\'www.youtube-nocookie.com/embed\').replace(new RegExp(\'youtube.com/watch\\\?(.*)v=([a-z0-9\_\-]+)(&|&|\\\?)?(.*)\',\'i\'),\'youtube-nocookie.com/embed/$2?$1$4\');var splitOn=o.href.indexOf(\'?\');var urlParms=(splitOn>-1)?o.href.substring(splitOn):"";o.allowfullscreen=(urlParms.indexOf(\'fs=0\')>-1)?false:true}' :
|
1259 |
+
'function(a,i,o){o.href=a[i].href.replace(new RegExp(\'youtu.be\',\'i\'),\'www.youtube.com/embed\').replace(new RegExp(\'watch\\\?(.*)v=([a-z0-9\_\-]+)(&|&|\\\?)?(.*)\',\'i\'),\'embed/$2?$1$4\');var splitOn=o.href.indexOf(\'?\');var urlParms=(splitOn>-1)?o.href.substring(splitOn):"";o.allowfullscreen=(urlParms.indexOf(\'fs=0\')>-1)?false:true}'
|
1260 |
)
|
1261 |
)
|
1262 |
),
|
1359 |
),
|
1360 |
'onStart' => array (
|
1361 |
'noquotes' => true,
|
1362 |
+
'default' => 'function(a,i,o){o.href=a[i].href.replace(new RegExp(\'//(www\\.)?vimeo\\.com/([0-9]+)(&|\\\?)?(.*)\',\'i\'),\'//player.vimeo.com/video/$2?$4\');var splitOn=o.href.indexOf(\'?\');var urlParms=(splitOn>-1)?o.href.substring(splitOn):"";o.allowfullscreen=(urlParms.indexOf(\'fullscreen=0\')>-1)?false:true}'
|
1363 |
)
|
1364 |
)
|
1365 |
),
|
1462 |
),
|
1463 |
'onStart' => array (
|
1464 |
'noquotes' => true,
|
1465 |
+
'default' => 'function(a,i,o){o.href=a[i].href.replace(new RegExp(\'/video/(.*)\',\'i\'),\'/embed/video/$1\');var splitOn=o.href.indexOf(\'?\');var urlParms=(splitOn>-1)?o.href.substring(splitOn):"";o.allowfullscreen=(urlParms.indexOf(\'fullscreen=0\')>-1)?false:true}'
|
1466 |
)
|
1467 |
)
|
1468 |
),
|
inc/class-easyfancybox.php
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
/**
|
3 |
* Easy FancyBox Class
|
4 |
*/
|
|
|
5 |
class easyFancyBox {
|
6 |
|
7 |
private static $plugin_url;
|
@@ -12,7 +13,7 @@ class easyFancyBox {
|
|
12 |
|
13 |
private static $inline_style;
|
14 |
|
15 |
-
private static $
|
16 |
|
17 |
public static $onready_auto = false;
|
18 |
|
@@ -43,15 +44,12 @@ class easyFancyBox {
|
|
43 |
return;
|
44 |
|
45 |
// begin building output FancyBox settings
|
46 |
-
$script = '
|
47 |
-
var fb_timeout=null;';
|
48 |
|
49 |
/*
|
50 |
* Global settings routine
|
51 |
*/
|
52 |
$more = 0;
|
53 |
-
$script .= '
|
54 |
-
var fb_opts={';
|
55 |
foreach (self::$options['Global']['options'] as $globals) {
|
56 |
foreach ($globals['options'] as $_key => $_value) {
|
57 |
if ( isset($_value['id']) )
|
@@ -105,7 +103,7 @@ jQuery(\''.$value['options']['autoAttribute']['selector'].'\').not(\'.nolightbox
|
|
105 |
} else {
|
106 |
// set selectors
|
107 |
$file_types = array_filter( explode( ' ', str_replace( ',', ' ', $autoAttribute ) ) );
|
108 |
-
$more=0;
|
109 |
$script .= '
|
110 |
var fb_'.$key.'_select=\'';
|
111 |
foreach ( $file_types as $type ) {
|
@@ -128,13 +126,16 @@ fb_'.$key.'_sections.each(function(){jQuery(this).find(fb_'.$key.'_select).addCl
|
|
128 |
switch( get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
|
129 |
case '':
|
130 |
default :
|
131 |
-
$script .= ';
|
132 |
break;
|
|
|
133 |
case '1':
|
134 |
$script .= '.attr(\'rel\',\'gallery-\'+fb_'.$key.'_sections.index(this));});';
|
135 |
break;
|
|
|
136 |
case '2':
|
137 |
$script .= '.attr(\'rel\',\'gallery\');});';
|
|
|
138 |
}
|
139 |
} else {
|
140 |
// add class
|
@@ -146,13 +147,16 @@ jQuery(fb_'.$key.'_select).addClass(\''.$value['options']['class']['default'].'\
|
|
146 |
default :
|
147 |
$script .= ';';
|
148 |
break;
|
|
|
149 |
case '1':
|
150 |
$script .= ';
|
151 |
var fb_'.$key.'_sections = jQuery(\''.get_option($value['options']['autoSelector']['id'],$value['options']['autoSelector']['default']).'\');
|
152 |
fb_'.$key.'_sections.each(function(){jQuery(this).find(fb_'.$key.'_select).attr(\'rel\',\'gallery-\'+fb_'.$key.'_sections.index(this));});';
|
153 |
break;
|
|
|
154 |
case '2':
|
155 |
$script .= '.attr(\'rel\',\'gallery\');';
|
|
|
156 |
}
|
157 |
}
|
158 |
}
|
@@ -197,9 +201,6 @@ jQuery(\'' . $value['options']['tag']['default'] . '\')';
|
|
197 |
|
198 |
$script .= apply_filters( 'easy_fancybox_bind', $bind );
|
199 |
|
200 |
-
// if ( '1' == get_option(self::$options['Global']['options']['Miscellaneous']['options']['metaData']['id'],self::$options['Global']['options']['Miscellaneous']['options']['metaData']['default']) )
|
201 |
-
// $script .= '});}';
|
202 |
-
|
203 |
$script .= '});';
|
204 |
}
|
205 |
|
@@ -211,25 +212,25 @@ jQuery(\'a.fancybox-close\').on(\'click\',function(e){e.preventDefault();jQuery.
|
|
211 |
|
212 |
switch ( $autoClick ) {
|
213 |
case '':
|
214 |
-
|
215 |
|
216 |
case '1':
|
217 |
$script .= '
|
218 |
var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'#fancybox-auto\').trigger(\'click\')},'.$delayClick.');};';
|
219 |
self::$onready_auto = true;
|
220 |
-
|
221 |
|
222 |
case '2':
|
223 |
$script .= '
|
224 |
var easy_fancybox_auto=function(){setTimeout(function(){if(location.hash){jQuery(location.hash).trigger(\'click\');}},'.$delayClick.');};';
|
225 |
self::$onready_auto = true;
|
226 |
-
|
227 |
|
228 |
case '99':
|
229 |
$script .= '
|
230 |
var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class|="fancybox"]\').filter(\':first\').trigger(\'click\')},'.$delayClick.');};';
|
231 |
self::$onready_auto = true;
|
232 |
-
|
233 |
|
234 |
default :
|
235 |
if ( !empty($trigger) ) {
|
@@ -237,7 +238,6 @@ var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class|="fancy
|
|
237 |
var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class*="'.$trigger.'"]\').filter(\':first\').trigger(\'click\')},'.$delayClick.');};';
|
238 |
self::$onready_auto = true;
|
239 |
}
|
240 |
-
break;
|
241 |
}
|
242 |
|
243 |
$script .= PHP_EOL;
|
@@ -248,76 +248,62 @@ var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class*="'.$tr
|
|
248 |
|
249 |
// customized styles
|
250 |
$styles = '';
|
251 |
-
if ( isset($overlaySpotlight) && 'true' == $overlaySpotlight )
|
252 |
-
$styles .= '
|
253 |
-
|
254 |
-
if ( !empty($borderRadius) )
|
255 |
-
$styles .= '
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
|
|
|
|
|
|
|
|
270 |
if ( !empty($styles) ) {
|
271 |
self::$inline_style = $styles;
|
272 |
}
|
273 |
|
274 |
// running our IE alphaimageloader relative path styles here
|
275 |
if ( isset($compatIE8) && 'true' == $compatIE8 ) {
|
276 |
-
self::$
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
.fancybox-ie6 #fancybox-
|
281 |
-
.fancybox-ie6 #fancybox-left
|
282 |
-
.fancybox-ie6 #fancybox-
|
283 |
-
.fancybox-ie6 #fancybox-title-
|
284 |
-
.fancybox-ie6
|
285 |
-
.fancybox-ie6 #fancybox-title-float-main{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_title_main.png",sizingMethod="scale");}
|
286 |
-
.fancybox-ie6 #fancybox-title-float-right{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_title_right.png",sizingMethod="scale");}
|
287 |
-
.fancybox-ie6 #fancybox-bg-w,.fancybox-ie6 #fancybox-bg-e,.fancybox-ie6 #fancybox-left,.fancybox-ie6 #fancybox-right,#fancybox-hide-sel-frame{height: expression(this.parentNode.clientHeight + "px");}
|
288 |
-
#fancybox-loading.fancybox-ie6{position:absolute;margin-top:0;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");}
|
289 |
-
#fancybox-loading.fancybox-ie6 div{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_loading.png",sizingMethod="scale");}
|
290 |
/* IE6, IE7, IE8 */
|
291 |
-
.fancybox-ie #fancybox-title-over{background-image:url('
|
292 |
-
.fancybox-bg{
|
293 |
-
|
294 |
-
.fancybox-ie
|
295 |
-
.fancybox-ie #fancybox-bg-
|
296 |
-
.fancybox-ie #fancybox-bg-
|
297 |
-
.fancybox-ie #fancybox-bg-
|
298 |
-
.fancybox-ie #fancybox-bg-
|
299 |
-
.fancybox-ie #fancybox-bg-
|
300 |
-
.fancybox-ie #fancybox-bg-sw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_shadow_sw.png",sizingMethod="scale");}
|
301 |
-
.fancybox-ie #fancybox-bg-w{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_shadow_w.png",sizingMethod="scale");}
|
302 |
-
.fancybox-ie #fancybox-bg-nw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_shadow_nw.png",sizingMethod="scale");}';
|
303 |
|
304 |
if ( isset($overlaySpotlight) && 'true' == $overlaySpotlight )
|
305 |
-
self::$
|
306 |
-
#fancybox-overlay{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/light-mask.png",sizingMethod="scale")
|
307 |
|
308 |
-
self::$inline_style_ie8 .= '</style>
|
309 |
-
<![endif]-->
|
310 |
-
';
|
311 |
}
|
312 |
}
|
313 |
|
314 |
-
public static function print_ie_inline_style() {
|
315 |
-
if ( !self::$add_scripts || empty(self::$inline_style_ie8) )
|
316 |
-
return;
|
317 |
-
|
318 |
-
print( self::$inline_style_ie8 );
|
319 |
-
}
|
320 |
-
|
321 |
/***********************
|
322 |
ACTIONS & FILTERS
|
323 |
***********************/
|
@@ -327,56 +313,94 @@ var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class*="'.$tr
|
|
327 |
if ( !self::$add_scripts )
|
328 |
return;
|
329 |
|
|
|
330 |
$min = ( defined('WP_DEBUG') && true == WP_DEBUG ) ? '' : '.min';
|
331 |
|
332 |
// ENQUEUE STYLE
|
333 |
wp_enqueue_style( 'fancybox', self::$plugin_url.'fancybox/jquery.fancybox'.$min.'.css', false, FANCYBOX_VERSION, 'screen' );
|
334 |
-
|
|
|
|
|
|
|
335 |
|
336 |
// ENQUEUE SCRIPTS
|
|
|
|
|
|
|
337 |
// register main fancybox script
|
338 |
-
wp_enqueue_script( 'jquery-fancybox', self::$plugin_url.'fancybox/jquery.fancybox'.$min.'.js',
|
339 |
-
wp_add_inline_script( 'jquery-fancybox', self::$inline_script );
|
340 |
|
341 |
// jQuery Easing, which is ot needed if jQueryUI Core Effects are loaded
|
342 |
if ( !wp_script_is( 'jquery-effects-core', 'enqueued' ) ) {
|
343 |
$add_easing = false;
|
344 |
// test for easing in IMG settings
|
345 |
-
if ( get_option(
|
346 |
-
&& ( 'elastic'
|
347 |
-
|| 'elastic'
|
348 |
$add_easing = true;
|
349 |
// test for easing in Inline settings
|
350 |
-
if ( get_option(
|
351 |
-
&& ( 'elastic'
|
352 |
-
|| 'elastic'
|
353 |
$add_easing = true;
|
354 |
// enqueue easing?
|
355 |
if ( $add_easing ) {
|
356 |
-
wp_enqueue_script('jquery-easing', self::$plugin_url.'js/jquery.easing'.$min.'.js',
|
357 |
}
|
358 |
}
|
359 |
|
360 |
// jQuery Mousewheel, which is not needed if jQueryUI Mouse is loaded
|
361 |
-
if (
|
362 |
-
wp_enqueue_script('jquery-mousewheel', self::$plugin_url.'js/jquery.mousewheel'.$min.'.js',
|
363 |
}
|
364 |
|
365 |
// metadata in Miscellaneous settings?
|
366 |
-
if (
|
367 |
-
wp_enqueue_script('jquery-metadata',self::$plugin_url.'js/jquery.metadata'.$min.'.js',
|
368 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
}
|
370 |
|
371 |
// Hack to fix missing wmode in Youtube oEmbed code based on David C's code in the comments on
|
372 |
// http://www.mehigh.biz/wordpress/adding-wmode-transparent-to-wordpress-3-media-embeds.html
|
|
|
373 |
public static function add_video_wmode_opaque($html, $url, $attr) {
|
374 |
if ( strpos($html, "<embed src=" ) !== false ) {
|
375 |
$html = str_replace('</param><embed', '</param><param name="wmode" value="opaque"></param><embed wmode="opaque"', $html);
|
376 |
} elseif ( strpos($html, 'youtube' ) !== false && strpos($html, 'wmode' ) == false ) {
|
377 |
-
$html = str_replace('feature=oembed', 'feature=oembed&wmode=opaque', $html);
|
378 |
} elseif ( strpos($html, "vimeo" ) !== false && strpos($html, 'wmode' ) == false ) {
|
379 |
-
$html = str_replace('" width', '?theme=none&wmode=opaque" width', $html);
|
380 |
} elseif ( strpos($html, "dailymotion" ) !== false && strpos($html, 'wmode' ) == false ) {
|
381 |
$html = str_replace('" width', '?wmode=opaque" width', $html);
|
382 |
}
|
@@ -393,8 +417,34 @@ var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class*="'.$tr
|
|
393 |
return $content;
|
394 |
}
|
395 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
public static function init() {
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
easyFancyBox_Options::load_defaults();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
398 |
}
|
399 |
|
400 |
/**********************
|
@@ -408,14 +458,6 @@ var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class*="'.$tr
|
|
408 |
|
409 |
require_once dirname(__FILE__) . '/class-easyfancybox-options.php';
|
410 |
|
411 |
-
|
412 |
-
add_action( 'init', array(__CLASS__, 'init') );
|
413 |
-
add_action( 'wp_loaded', array(__CLASS__, 'main') );
|
414 |
-
add_action( 'wp_enqueue_scripts', array(__CLASS__, 'enqueue_scripts') );
|
415 |
-
add_action( 'wp_head', array(__CLASS__, 'print_ie_inline_style'), 11 );
|
416 |
-
|
417 |
-
// FILTERS
|
418 |
-
add_filter( 'embed_oembed_html', array(__CLASS__,'add_video_wmode_opaque'), 10, 3 );
|
419 |
-
add_filter( 'easy_fancybox_inline_script', array(__CLASS__,'onready_callback') );
|
420 |
}
|
421 |
}
|
2 |
/**
|
3 |
* Easy FancyBox Class
|
4 |
*/
|
5 |
+
|
6 |
class easyFancyBox {
|
7 |
|
8 |
private static $plugin_url;
|
13 |
|
14 |
private static $inline_style;
|
15 |
|
16 |
+
private static $inline_style_ie;
|
17 |
|
18 |
public static $onready_auto = false;
|
19 |
|
44 |
return;
|
45 |
|
46 |
// begin building output FancyBox settings
|
47 |
+
$script = 'var fb_timeout, fb_opts={';
|
|
|
48 |
|
49 |
/*
|
50 |
* Global settings routine
|
51 |
*/
|
52 |
$more = 0;
|
|
|
|
|
53 |
foreach (self::$options['Global']['options'] as $globals) {
|
54 |
foreach ($globals['options'] as $_key => $_value) {
|
55 |
if ( isset($_value['id']) )
|
103 |
} else {
|
104 |
// set selectors
|
105 |
$file_types = array_filter( explode( ' ', str_replace( ',', ' ', $autoAttribute ) ) );
|
106 |
+
$more = 0;
|
107 |
$script .= '
|
108 |
var fb_'.$key.'_select=\'';
|
109 |
foreach ( $file_types as $type ) {
|
126 |
switch( get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
|
127 |
case '':
|
128 |
default :
|
129 |
+
$script .= ';});';
|
130 |
break;
|
131 |
+
|
132 |
case '1':
|
133 |
$script .= '.attr(\'rel\',\'gallery-\'+fb_'.$key.'_sections.index(this));});';
|
134 |
break;
|
135 |
+
|
136 |
case '2':
|
137 |
$script .= '.attr(\'rel\',\'gallery\');});';
|
138 |
+
break;
|
139 |
}
|
140 |
} else {
|
141 |
// add class
|
147 |
default :
|
148 |
$script .= ';';
|
149 |
break;
|
150 |
+
|
151 |
case '1':
|
152 |
$script .= ';
|
153 |
var fb_'.$key.'_sections = jQuery(\''.get_option($value['options']['autoSelector']['id'],$value['options']['autoSelector']['default']).'\');
|
154 |
fb_'.$key.'_sections.each(function(){jQuery(this).find(fb_'.$key.'_select).attr(\'rel\',\'gallery-\'+fb_'.$key.'_sections.index(this));});';
|
155 |
break;
|
156 |
+
|
157 |
case '2':
|
158 |
$script .= '.attr(\'rel\',\'gallery\');';
|
159 |
+
break;
|
160 |
}
|
161 |
}
|
162 |
}
|
201 |
|
202 |
$script .= apply_filters( 'easy_fancybox_bind', $bind );
|
203 |
|
|
|
|
|
|
|
204 |
$script .= '});';
|
205 |
}
|
206 |
|
212 |
|
213 |
switch ( $autoClick ) {
|
214 |
case '':
|
215 |
+
break;
|
216 |
|
217 |
case '1':
|
218 |
$script .= '
|
219 |
var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'#fancybox-auto\').trigger(\'click\')},'.$delayClick.');};';
|
220 |
self::$onready_auto = true;
|
221 |
+
break;
|
222 |
|
223 |
case '2':
|
224 |
$script .= '
|
225 |
var easy_fancybox_auto=function(){setTimeout(function(){if(location.hash){jQuery(location.hash).trigger(\'click\');}},'.$delayClick.');};';
|
226 |
self::$onready_auto = true;
|
227 |
+
break;
|
228 |
|
229 |
case '99':
|
230 |
$script .= '
|
231 |
var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class|="fancybox"]\').filter(\':first\').trigger(\'click\')},'.$delayClick.');};';
|
232 |
self::$onready_auto = true;
|
233 |
+
break;
|
234 |
|
235 |
default :
|
236 |
if ( !empty($trigger) ) {
|
238 |
var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class*="'.$trigger.'"]\').filter(\':first\').trigger(\'click\')},'.$delayClick.');};';
|
239 |
self::$onready_auto = true;
|
240 |
}
|
|
|
241 |
}
|
242 |
|
243 |
$script .= PHP_EOL;
|
248 |
|
249 |
// customized styles
|
250 |
$styles = '';
|
251 |
+
if ( isset($overlaySpotlight) && 'true' == $overlaySpotlight ) {
|
252 |
+
$styles .= '#fancybox-overlay{background-attachment:fixed;background-image:url("' . self::$plugin_url . 'images/light-mask.png");background-position:center;background-repeat:no-repeat;background-size:100% 100%}';
|
253 |
+
}
|
254 |
+
if ( !empty($borderRadius) ) {
|
255 |
+
$styles .= '#fancybox-outer,#fancybox-content{border-radius:'.$borderRadius.'px}.fancybox-title-inside{padding-top:'.$borderRadius.'px;margin-top:-'.$borderRadius.'px !important;border-radius: 0 0 '.$borderRadius.'px '.$borderRadius.'px}';
|
256 |
+
}
|
257 |
+
$content_style = '';
|
258 |
+
if ( !empty($backgroundColor) ) {
|
259 |
+
$content_style .= 'background:'.$backgroundColor.';';
|
260 |
+
}
|
261 |
+
if ( !empty($paddingColor) ) {
|
262 |
+
$content_style .= 'border-color:'.$paddingColor.';';
|
263 |
+
}
|
264 |
+
if ( !empty($textColor) ) {
|
265 |
+
$content_style .= 'color:'.$textColor.';';
|
266 |
+
$styles .= '#fancybox-outer{background:'.$paddingColor.'}'; //.fancybox-title-inside{background-color:'.$paddingColor.';margin-left:0 !important;margin-right:0 !important;width:100% !important;}
|
267 |
+
}
|
268 |
+
if ( !empty($content_style) ) {
|
269 |
+
$styles .= '#fancybox-content{'.$content_style.'}';
|
270 |
+
}
|
271 |
+
if ( !empty($titleColor) ) {
|
272 |
+
$styles .= '#fancybox-title,#fancybox-title-float-main{color:'.$titleColor.'}';
|
273 |
+
}
|
274 |
if ( !empty($styles) ) {
|
275 |
self::$inline_style = $styles;
|
276 |
}
|
277 |
|
278 |
// running our IE alphaimageloader relative path styles here
|
279 |
if ( isset($compatIE8) && 'true' == $compatIE8 ) {
|
280 |
+
self::$inline_style_ie = '/* IE6 */
|
281 |
+
.fancybox-ie6 #fancybox-close{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_close.png",sizingMethod="scale")}
|
282 |
+
.fancybox-ie6 #fancybox-left-ico{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_nav_left.png",sizingMethod="scale")}
|
283 |
+
.fancybox-ie6 #fancybox-right-ico{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_nav_right.png",sizingMethod="scale")}
|
284 |
+
.fancybox-ie6 #fancybox-title-over{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_title_over.png",sizingMethod="scale");zoom:1}
|
285 |
+
.fancybox-ie6 #fancybox-title-float-left{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_title_left.png",sizingMethod="scale")}
|
286 |
+
.fancybox-ie6 #fancybox-title-float-main{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_title_main.png",sizingMethod="scale")}
|
287 |
+
.fancybox-ie6 #fancybox-title-float-right{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_title_right.png",sizingMethod="scale")}
|
288 |
+
#fancybox-loading.fancybox-ie6 div{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_loading.png",sizingMethod="scale")}
|
|
|
|
|
|
|
|
|
|
|
289 |
/* IE6, IE7, IE8 */
|
290 |
+
.fancybox-ie #fancybox-title-over{background-image:url('.self::$plugin_url.'fancybox/fancy_title_over.png)}
|
291 |
+
.fancybox-ie #fancybox-bg-n{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_shadow_n.png",sizingMethod="scale")}
|
292 |
+
.fancybox-ie #fancybox-bg-ne{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_shadow_ne.png",sizingMethod="scale")}
|
293 |
+
.fancybox-ie #fancybox-bg-e{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_shadow_e.png",sizingMethod="scale")}
|
294 |
+
.fancybox-ie #fancybox-bg-se{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_shadow_se.png",sizingMethod="scale")}
|
295 |
+
.fancybox-ie #fancybox-bg-s{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_shadow_s.png",sizingMethod="scale")}
|
296 |
+
.fancybox-ie #fancybox-bg-sw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_shadow_sw.png",sizingMethod="scale")}
|
297 |
+
.fancybox-ie #fancybox-bg-w{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_shadow_w.png",sizingMethod="scale")}
|
298 |
+
.fancybox-ie #fancybox-bg-nw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'fancybox/fancy_shadow_nw.png",sizingMethod="scale")}';
|
|
|
|
|
|
|
299 |
|
300 |
if ( isset($overlaySpotlight) && 'true' == $overlaySpotlight )
|
301 |
+
self::$inline_style_ie .= '
|
302 |
+
#fancybox-overlay{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/light-mask.png",sizingMethod="scale")}';
|
303 |
|
|
|
|
|
|
|
304 |
}
|
305 |
}
|
306 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
/***********************
|
308 |
ACTIONS & FILTERS
|
309 |
***********************/
|
313 |
if ( !self::$add_scripts )
|
314 |
return;
|
315 |
|
316 |
+
global $wp_styles;
|
317 |
$min = ( defined('WP_DEBUG') && true == WP_DEBUG ) ? '' : '.min';
|
318 |
|
319 |
// ENQUEUE STYLE
|
320 |
wp_enqueue_style( 'fancybox', self::$plugin_url.'fancybox/jquery.fancybox'.$min.'.css', false, FANCYBOX_VERSION, 'screen' );
|
321 |
+
if ( !empty(self::$inline_style_ie) ) {
|
322 |
+
wp_enqueue_style( 'fancybox-ie', self::$plugin_url.'fancybox/jquery.fancybox-ie'.$min.'.css', false, FANCYBOX_VERSION, 'screen' );
|
323 |
+
$wp_styles->add_data( 'fancybox-ie', 'conditional', 'lt IE 9' );
|
324 |
+
}
|
325 |
|
326 |
// ENQUEUE SCRIPTS
|
327 |
+
$footer = get_option( 'fancybox_noFooter', false ) ? false : true;
|
328 |
+
$dep = get_option( 'fancybox_nojQuery', false ) ? array() : array('jquery');
|
329 |
+
|
330 |
// register main fancybox script
|
331 |
+
wp_enqueue_script( 'jquery-fancybox', self::$plugin_url.'fancybox/jquery.fancybox'.$min.'.js', $dep, FANCYBOX_VERSION, $footer );
|
|
|
332 |
|
333 |
// jQuery Easing, which is ot needed if jQueryUI Core Effects are loaded
|
334 |
if ( !wp_script_is( 'jquery-effects-core', 'enqueued' ) ) {
|
335 |
$add_easing = false;
|
336 |
// test for easing in IMG settings
|
337 |
+
if ( get_option( 'fancybox_enableImg', self::$options['Global']['options']['Enable']['options']['IMG']['default'] )
|
338 |
+
&& ( 'elastic' === get_option( 'fancybox_transitionIn', 'elastic' )
|
339 |
+
|| 'elastic' === get_option( 'fancybox_transitionOut', 'elastic' ) ) )
|
340 |
$add_easing = true;
|
341 |
// test for easing in Inline settings
|
342 |
+
if ( get_option( 'fancybox_enableInline', false )
|
343 |
+
&& ( 'elastic' === get_option( 'fancybox_transitionInInline' )
|
344 |
+
|| 'elastic' === get_option( 'fancybox_transitionOutInline' ) ) )
|
345 |
$add_easing = true;
|
346 |
// enqueue easing?
|
347 |
if ( $add_easing ) {
|
348 |
+
wp_enqueue_script( 'jquery-easing', self::$plugin_url.'js/jquery.easing'.$min.'.js', $dep, EASING_VERSION, $footer );
|
349 |
}
|
350 |
}
|
351 |
|
352 |
// jQuery Mousewheel, which is not needed if jQueryUI Mouse is loaded
|
353 |
+
if ( get_option( 'fancybox_mouseWheel', true ) && !wp_script_is( 'jquery-ui-mouse', 'enqueued' ) ) {
|
354 |
+
wp_enqueue_script( 'jquery-mousewheel', self::$plugin_url.'js/jquery.mousewheel'.$min.'.js', $dep, MOUSEWHEEL_VERSION, $footer );
|
355 |
}
|
356 |
|
357 |
// metadata in Miscellaneous settings?
|
358 |
+
if ( get_option( 'fancybox_metaData' ) ) {
|
359 |
+
wp_enqueue_script( 'jquery-metadata',self::$plugin_url.'js/jquery.metadata'.$min.'.js', $dep, METADATA_VERSION, $footer );
|
360 |
}
|
361 |
+
|
362 |
+
if ( get_option( 'fancybox_pre45Compat', false ) || !function_exists( 'wp_add_inline_script' ) ) {
|
363 |
+
// do it the old way
|
364 |
+
$priority = intval( get_option( 'fancybox_scriptPriority', 10 ) ) + 1;
|
365 |
+
if ( !empty(self::$inline_style) )
|
366 |
+
add_action( 'wp_head', array(__CLASS__, 'print_inline_style'), 11 );
|
367 |
+
if ( !empty(self::$inline_style_ie) )
|
368 |
+
add_action( 'wp_head', array(__CLASS__, 'print_inline_style_ie'), 12 );
|
369 |
+
if ( !empty(self::$inline_script) )
|
370 |
+
add_action( $footer ? 'wp_footer' : 'wp_head', array(__CLASS__, 'print_inline_script'), $priority );
|
371 |
+
} else {
|
372 |
+
if ( !empty(self::$inline_style) )
|
373 |
+
wp_add_inline_style( 'fancybox', self::$inline_style );
|
374 |
+
if ( !empty(self::$inline_style_ie) )
|
375 |
+
wp_add_inline_style( 'fancybox-ie', self::$inline_style_ie );
|
376 |
+
if ( !empty(self::$inline_script) )
|
377 |
+
wp_add_inline_script( 'jquery-fancybox', self::$inline_script );
|
378 |
+
}
|
379 |
+
}
|
380 |
+
|
381 |
+
// fallback methods for WordPress pre-4.5
|
382 |
+
public static function print_inline_script() {
|
383 |
+
print( '<script type="text/javascript">' . self::$inline_script . '</script>' );
|
384 |
+
}
|
385 |
+
|
386 |
+
public static function print_inline_style() {
|
387 |
+
print( '<style id="fancybox-inline-css" type="text/css">' . self::$inline_style . '</style>' );
|
388 |
+
}
|
389 |
+
|
390 |
+
public static function print_inline_style_ie() {
|
391 |
+
print( '<!--[if lt IE 9]><style id="fancybox-inline-css-ie" type="text/css">' . self::$inline_style_ie . '</style><![endif]-->' );
|
392 |
}
|
393 |
|
394 |
// Hack to fix missing wmode in Youtube oEmbed code based on David C's code in the comments on
|
395 |
// http://www.mehigh.biz/wordpress/adding-wmode-transparent-to-wordpress-3-media-embeds.html
|
396 |
+
// without the wmode, videos will float over the light box no matter what z-index is set.
|
397 |
public static function add_video_wmode_opaque($html, $url, $attr) {
|
398 |
if ( strpos($html, "<embed src=" ) !== false ) {
|
399 |
$html = str_replace('</param><embed', '</param><param name="wmode" value="opaque"></param><embed wmode="opaque"', $html);
|
400 |
} elseif ( strpos($html, 'youtube' ) !== false && strpos($html, 'wmode' ) == false ) {
|
401 |
+
$html = str_replace('feature=oembed', 'feature=oembed&wmode=opaque', $html);
|
402 |
} elseif ( strpos($html, "vimeo" ) !== false && strpos($html, 'wmode' ) == false ) {
|
403 |
+
$html = str_replace('" width', '?theme=none&wmode=opaque" width', $html);
|
404 |
} elseif ( strpos($html, "dailymotion" ) !== false && strpos($html, 'wmode' ) == false ) {
|
405 |
$html = str_replace('" width', '?wmode=opaque" width', $html);
|
406 |
}
|
417 |
return $content;
|
418 |
}
|
419 |
|
420 |
+
public static function upgrade( $old_version ) {
|
421 |
+
if ( !$old_version ) { // upgrade from 1.7 or older
|
422 |
+
if ( 'html' === get_option('fancybox_PDFclassType') ) {
|
423 |
+
update_option('fancybox_PDFonStart', 'function(selectedArray,selectedIndex,selectedOpts){selectedOpts.type=\'pdf\';}');
|
424 |
+
delete_option('fancybox_PDFclassType');
|
425 |
+
}
|
426 |
+
}
|
427 |
+
update_option('easy_fancybox_version', EASY_FANCYBOX_VERSION);
|
428 |
+
}
|
429 |
+
|
430 |
public static function init() {
|
431 |
+
$version = get_option('easy_fancybox_version', 0);
|
432 |
+
|
433 |
+
if ( version_compare( EASY_FANCYBOX_VERSION, $version, '>' ) ) {
|
434 |
+
self::upgrade($version);
|
435 |
+
}
|
436 |
+
|
437 |
easyFancyBox_Options::load_defaults();
|
438 |
+
|
439 |
+
$priority = intval( get_option( 'fancybox_scriptPriority', 11 ) );
|
440 |
+
|
441 |
+
// HOOKS
|
442 |
+
add_action( 'wp_loaded', array(__CLASS__, 'main') );
|
443 |
+
add_action( 'wp_enqueue_scripts', array(__CLASS__, 'enqueue_scripts'), $priority );
|
444 |
+
|
445 |
+
// FILTERS
|
446 |
+
add_filter( 'embed_oembed_html', array(__CLASS__,'add_video_wmode_opaque'), 10, 3 );
|
447 |
+
add_filter( 'easy_fancybox_inline_script', array(__CLASS__,'onready_callback') );
|
448 |
}
|
449 |
|
450 |
/**********************
|
458 |
|
459 |
require_once dirname(__FILE__) . '/class-easyfancybox-options.php';
|
460 |
|
461 |
+
add_action( 'plugins_loaded', array(__CLASS__, 'init') );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
462 |
}
|
463 |
}
|
js/jquery.easing.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/*
|
2 |
-
* jQuery Easing v1.4.
|
3 |
* Open source under the BSD License.
|
4 |
* Copyright © 2008 George McGinley Smith
|
5 |
* All rights reserved.
|
@@ -19,7 +19,9 @@
|
|
19 |
})(function($){
|
20 |
|
21 |
// Preserve the original jQuery "swing" easing as "jswing"
|
22 |
-
$.easing
|
|
|
|
|
23 |
|
24 |
var pow = Math.pow,
|
25 |
sqrt = Math.sqrt,
|
1 |
/*
|
2 |
+
* jQuery Easing v1.4.1 - http://gsgd.co.uk/sandbox/jquery/easing/
|
3 |
* Open source under the BSD License.
|
4 |
* Copyright © 2008 George McGinley Smith
|
5 |
* All rights reserved.
|
19 |
})(function($){
|
20 |
|
21 |
// Preserve the original jQuery "swing" easing as "jswing"
|
22 |
+
if (typeof $.easing !== 'undefined') {
|
23 |
+
$.easing['jswing'] = $.easing['swing'];
|
24 |
+
}
|
25 |
|
26 |
var pow = Math.pow,
|
27 |
sqrt = Math.sqrt,
|
js/jquery.easing.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(n){"function"==typeof define&&define.amd?define(["jquery"],function(e){return n(e)}):"object"==typeof module&&"object"==typeof module.exports?exports=n(require("jquery")):n(jQuery)}(function(n){function e(n){var e=7.5625,t=2.75;return n<1/t?e*n*n:n<2/t?e*(n-=1.5/t)*n+.75:n<2.5/t?e*(n-=2.25/t)*n+.9375:e*(n-=2.625/t)*n+.984375}n.easing.jswing=n.easing.swing;var t=Math.pow,u=Math.sqrt,r=Math.sin,i=Math.cos,a=Math.PI,c=1.70158,o=1.525*c,s=2*a/3,f=2*a/4.5;n.extend(n.easing,{def:"easeOutQuad",swing:function(e){return n.easing[n.easing.def](e)},easeInQuad:function(n){return n*n},easeOutQuad:function(n){return 1-(1-n)*(1-n)},easeInOutQuad:function(n){return n<.5?2*n*n:1-t(-2*n+2,2)/2},easeInCubic:function(n){return n*n*n},easeOutCubic:function(n){return 1-t(1-n,3)},easeInOutCubic:function(n){return n<.5?4*n*n*n:1-t(-2*n+2,3)/2},easeInQuart:function(n){return n*n*n*n},easeOutQuart:function(n){return 1-t(1-n,4)},easeInOutQuart:function(n){return n<.5?8*n*n*n*n:1-t(-2*n+2,4)/2},easeInQuint:function(n){return n*n*n*n*n},easeOutQuint:function(n){return 1-t(1-n,5)},easeInOutQuint:function(n){return n<.5?16*n*n*n*n*n:1-t(-2*n+2,5)/2},easeInSine:function(n){return 1-i(n*a/2)},easeOutSine:function(n){return r(n*a/2)},easeInOutSine:function(n){return-(i(a*n)-1)/2},easeInExpo:function(n){return 0===n?0:t(2,10*n-10)},easeOutExpo:function(n){return 1===n?1:1-t(2,-10*n)},easeInOutExpo:function(n){return 0===n?0:1===n?1:n<.5?t(2,20*n-10)/2:(2-t(2,-20*n+10))/2},easeInCirc:function(n){return 1-u(1-t(n,2))},easeOutCirc:function(n){return u(1-t(n-1,2))},easeInOutCirc:function(n){return n<.5?(1-u(1-t(2*n,2)))/2:(u(1-t(-2*n+2,2))+1)/2},easeInElastic:function(n){return 0===n?0:1===n?1:-t(2,10*n-10)*r((10*n-10.75)*s)},easeOutElastic:function(n){return 0===n?0:1===n?1:t(2,-10*n)*r((10*n-.75)*s)+1},easeInOutElastic:function(n){return 0===n?0:1===n?1:n<.5?-(t(2,20*n-10)*r((20*n-11.125)*f))/2:t(2,-20*n+10)*r((20*n-11.125)*f)/2+1},easeInBack:function(n){return(c+1)*n*n*n-c*n*n},easeOutBack:function(n){return 1+(c+1)*t(n-1,3)+c*t(n-1,2)},easeInOutBack:function(n){return n<.5?t(2*n,2)*(7.189819*n-o)/2:(t(2*n-2,2)*((o+1)*(2*n-2)+o)+2)/2},easeInBounce:function(n){return 1-e(1-n)},easeOutBounce:e,easeInOutBounce:function(n){return n<.5?(1-e(1-2*n))/2:(1+e(2*n-1))/2}})});
|
1 |
+
!function(n){"function"==typeof define&&define.amd?define(["jquery"],function(e){return n(e)}):"object"==typeof module&&"object"==typeof module.exports?exports=n(require("jquery")):n(jQuery)}(function(n){function e(n){var e=7.5625,t=2.75;return n<1/t?e*n*n:n<2/t?e*(n-=1.5/t)*n+.75:n<2.5/t?e*(n-=2.25/t)*n+.9375:e*(n-=2.625/t)*n+.984375}void 0!==n.easing&&(n.easing.jswing=n.easing.swing);var t=Math.pow,u=Math.sqrt,r=Math.sin,i=Math.cos,a=Math.PI,c=1.70158,o=1.525*c,s=2*a/3,f=2*a/4.5;n.extend(n.easing,{def:"easeOutQuad",swing:function(e){return n.easing[n.easing.def](e)},easeInQuad:function(n){return n*n},easeOutQuad:function(n){return 1-(1-n)*(1-n)},easeInOutQuad:function(n){return n<.5?2*n*n:1-t(-2*n+2,2)/2},easeInCubic:function(n){return n*n*n},easeOutCubic:function(n){return 1-t(1-n,3)},easeInOutCubic:function(n){return n<.5?4*n*n*n:1-t(-2*n+2,3)/2},easeInQuart:function(n){return n*n*n*n},easeOutQuart:function(n){return 1-t(1-n,4)},easeInOutQuart:function(n){return n<.5?8*n*n*n*n:1-t(-2*n+2,4)/2},easeInQuint:function(n){return n*n*n*n*n},easeOutQuint:function(n){return 1-t(1-n,5)},easeInOutQuint:function(n){return n<.5?16*n*n*n*n*n:1-t(-2*n+2,5)/2},easeInSine:function(n){return 1-i(n*a/2)},easeOutSine:function(n){return r(n*a/2)},easeInOutSine:function(n){return-(i(a*n)-1)/2},easeInExpo:function(n){return 0===n?0:t(2,10*n-10)},easeOutExpo:function(n){return 1===n?1:1-t(2,-10*n)},easeInOutExpo:function(n){return 0===n?0:1===n?1:n<.5?t(2,20*n-10)/2:(2-t(2,-20*n+10))/2},easeInCirc:function(n){return 1-u(1-t(n,2))},easeOutCirc:function(n){return u(1-t(n-1,2))},easeInOutCirc:function(n){return n<.5?(1-u(1-t(2*n,2)))/2:(u(1-t(-2*n+2,2))+1)/2},easeInElastic:function(n){return 0===n?0:1===n?1:-t(2,10*n-10)*r((10*n-10.75)*s)},easeOutElastic:function(n){return 0===n?0:1===n?1:t(2,-10*n)*r((10*n-.75)*s)+1},easeInOutElastic:function(n){return 0===n?0:1===n?1:n<.5?-(t(2,20*n-10)*r((20*n-11.125)*f))/2:t(2,-20*n+10)*r((20*n-11.125)*f)/2+1},easeInBack:function(n){return(c+1)*n*n*n-c*n*n},easeOutBack:function(n){return 1+(c+1)*t(n-1,3)+c*t(n-1,2)},easeInOutBack:function(n){return n<.5?t(2*n,2)*(7.189819*n-o)/2:(t(2*n-2,2)*((o+1)*(2*n-2)+o)+2)/2},easeInBounce:function(n){return 1-e(1-n)},easeOutBounce:e,easeInOutBounce:function(n){return n<.5?(1-e(1-2*n))/2:(1+e(2*n-1))/2}})});
|
readme.txt
CHANGED
@@ -2,46 +2,76 @@
|
|
2 |
Contributors: RavanH
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Easy%20FancyBox
|
4 |
Tags: fancybox, lightbox, gallery, image, photo, video, flash, overlay, youtube, vimeo, dailymotion, pdf, svg, iframe, swf, jquery, webp
|
5 |
-
Requires at least:
|
6 |
Tested up to: 4.9
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
Easily enable the FancyBox jQuery extension on just about all media links. Multi-Site compatible. Supports iFrame and Flash movies.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
-
Easy FancyBox plugin for WordPress websites gives you a flexible and aesthetic light box solution for just about all media links on your website. Easy FancyBox uses the
|
14 |
|
15 |
-
After activation, all links to **JPG, GIF and PNG images** are automatically opened in the [FancyBox](http://fancybox.net/) Mac/Gnome-style lightbox that floats over the web page.
|
16 |
|
17 |
-
**
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
-
|
22 |
-
-
|
23 |
-
-
|
|
|
24 |
- SVG media images (thanks to Simon Maillard)
|
25 |
-
-
|
26 |
-
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
-
|
|
|
|
|
34 |
|
35 |
Get support on the [Easy FancyBox web page](https://status301.net/wordpress-plugins/easy-fancybox/) or [WordPress forum](https://wordpress.org/support/plugin/easy-fancybox).
|
36 |
|
37 |
Visit [FancyBox](http://fancybox.net/) for more information and examples.
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
= Contribute =
|
41 |
|
42 |
If you're happy with this plugin as it is, please consider writing a quick [rating](https://wordpress.org/support/plugin/easy-fancybox/reviews/#new-post) or helping other users out on the [support forum](https://wordpress.org/support/plugin/easy-fancybox).
|
43 |
|
44 |
-
If you wish to help build this plugin, you're very welcome to [translate Easy FancyBox into your language](https://translate.wordpress.org/projects/wp-plugins/easy-fancybox/) or contribute code on [Github](https://github.com/RavanH/easy-fancybox/).
|
45 |
|
46 |
|
47 |
== Installation ==
|
@@ -84,7 +114,8 @@ Basically, it is a fancy way of presenting images, movies, portable documents an
|
|
84 |
|
85 |
= Which version of FancyBox does this plugin use? =
|
86 |
|
87 |
-
|
|
|
88 |
|
89 |
= I installed the plugin. What now? =
|
90 |
|
@@ -92,25 +123,28 @@ First, make sure that image thumbnails in your posts and pages are linked to th
|
|
92 |
|
93 |
The same thing goes for WordPress Galleries. Choose **Link To: Media File** when inserting a gallery tag.
|
94 |
|
95 |
-
= I want to change something. Where is the settings page? =
|
96 |
|
97 |
-
|
|
|
|
|
|
|
98 |
|
99 |
= Help! It does not work... =
|
100 |
|
101 |
-
Please follow the trouble shooting steps
|
102 |
-
|
103 |
|
104 |
|
105 |
= ADVANCED =
|
106 |
|
107 |
-
= Will a WordPress
|
108 |
|
109 |
Yes, but _only_ if you used the option **Link To: Media File** when inserting the gallery! The gallery quicktag/shortcode should look something like `[ gallery link="file" ]`.
|
110 |
|
|
|
111 |
= The lightbox does not look good on mobile devices. What can I do about that? =
|
112 |
|
113 |
-
The FancyBox 1.3.4 script
|
|
|
114 |
|
115 |
= Can I make a slideshow from my gallery? =
|
116 |
|
@@ -126,16 +160,17 @@ Yes. All links with class **nolightbox** that would normally get auto-enabled, w
|
|
126 |
|
127 |
= Can NextGEN Gallery work with Easy FancyBox ? =
|
128 |
|
129 |
-
NetxGEN has its own built in FancyBox version along with a choice of other
|
130 |
|
131 |
1. Go to your Settings > Media admin page and switch OFF the FancyBox "Auto-gallery" option in the Images section;
|
132 |
-
1. Go to Gallery > Other Options and set the Lightbox Effects option to "Custom" and click on Show Advanced Settings
|
133 |
1. fill the Code field with
|
134 |
`
|
135 |
class="fancybox" rel="%GALLERY_NAME%"
|
136 |
`
|
137 |
1. Leave the other fields empty and save your settings.
|
138 |
|
|
|
139 |
= Can I use ONE thumbnail to open a complete gallery ? =
|
140 |
|
141 |
It can be done manually (using the internal WordPress gallery feature, or not) _or_ in combination with NextGen Gallery.
|
@@ -205,7 +240,7 @@ User Mark Szoldan shared a neat trick how to do this:
|
|
205 |
|
206 |
1. Follow the instructions to make Easy FancyBox work smoothly with NextGEN above and make sure it all works correctly for normal thumbnails linked to their full-size version.
|
207 |
1. Then give the image that you want to link to a Youtube movie the URL to the Youtube page as title.
|
208 |
-
1. Finally paste the code below into a
|
209 |
|
210 |
`
|
211 |
<script type="text/javascript">
|
@@ -336,6 +371,7 @@ Yes. There are several methods imaginable but the easiest would be to use the In
|
|
336 |
`
|
337 |
Where you replace the shortcode (between the [ and ] characters) with the one given by the plugin. It can also work with shortcode by other plugins like Jetpack's Contact Form module. Change the class attribute to reflect the class used for the div that wraps your post content to have any form CSS style rules that are limited to post content, be applied to the inline content inside FancyBox.
|
338 |
|
|
|
339 |
= Can I make an image or hidden content to pop up in FancyBox on page load? =
|
340 |
|
341 |
Yes. A link that has the ID **fancybox-auto** (Note: there can be only ONE link like that on a page!) will be triggered automatically on page load.
|
@@ -344,16 +380,18 @@ Use the instructions above for inline content but this time give the link also `
|
|
344 |
|
345 |
Same can be done with an image, flash movie, PDF or iframe link! But please remember there can be only **one** item using the ID fancybox-auto per page...
|
346 |
|
|
|
347 |
= Can I have a modal window ? =
|
348 |
|
349 |
Yes, just create a hidden inline content light box (can be auto-popup) as described above and give the link an extra class "modal". This will remove all options to close the light box, like the close button, an overlay click or escape key.
|
350 |
|
351 |
-
This means there is NO option to close the light box, unless you create a link like this:
|
352 |
|
353 |
`
|
354 |
-
<a href="
|
355 |
`
|
356 |
|
|
|
357 |
= Can I make a menu item open in a FancyBox overlay ? =
|
358 |
|
359 |
Yes. But it depends on you theme what you need to do to make it work. If you are on WordPress 3+ and your theme supports the new internal Custom Menu feature or if you are using a custom menu in a sidebar widget, it's easy:
|
@@ -366,6 +404,19 @@ Yes. But it depends on you theme what you need to do to make it work. If you are
|
|
366 |
If you are on an older version of WordPress or if you cannot use WP's Menus, you will need to do some heavy theme hacking to get it to work. Basically, what you need to achieve is that the menu item you want opened in a lightbox overlay, should get a class="fancybox-iframe" tag.
|
367 |
|
368 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
= Is Easy FancyBox multi-site compatible? =
|
370 |
|
371 |
Yes. Designed to work with **Network Activate** and does not require manual activation on each site in your network.
|
@@ -442,13 +493,26 @@ If you still do not get to see your images in FancyBox, ask on the [Easy FancyBo
|
|
442 |
|
443 |
2. Example of a YouTube movie in overlay.
|
444 |
|
|
|
445 |
== Upgrade Notice ==
|
446 |
|
447 |
-
= 1.
|
448 |
-
|
|
|
449 |
|
450 |
== Changelog ==
|
451 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
452 |
= 1.7 =
|
453 |
* NEW: Aspect ratio for video frames on smaller screens
|
454 |
* NEW: Global minimum screen size
|
2 |
Contributors: RavanH
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Easy%20FancyBox
|
4 |
Tags: fancybox, lightbox, gallery, image, photo, video, flash, overlay, youtube, vimeo, dailymotion, pdf, svg, iframe, swf, jquery, webp
|
5 |
+
Requires at least: 3.3
|
6 |
Tested up to: 4.9
|
7 |
+
Stable tag: 1.8
|
8 |
|
9 |
Easily enable the FancyBox jQuery extension on just about all media links. Multi-Site compatible. Supports iFrame and Flash movies.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
+
Easy FancyBox plugin for WordPress websites gives you a flexible and aesthetic light box solution for just about all media links on your website. Easy FancyBox uses an updated version of the traditional FancyBox jQuery extension and is WP 3+ Multi-Site compatible. After activation you can find a new section **FancyBox** on your **Settings > Media** admin page where you can manage the media light box options.
|
14 |
|
15 |
+
After activation, all links to **JPG, GIF and PNG images** are automatically opened in the [FancyBox](http://fancybox.net/) Mac/Gnome-style lightbox that floats over the web page.
|
16 |
|
17 |
+
**FEATURES**
|
18 |
|
19 |
+
Supported media and content types:
|
20 |
+
|
21 |
+
- All common image formats _including_ webp
|
22 |
+
- Hosted video on **Youtube**, **Vimeo** _and_ **Dailmotion**
|
23 |
+
- PDF files (embed with object tag, in iframe or in external Google Docs Viewer)
|
24 |
+
- SWF (Flash) files
|
25 |
- SVG media images (thanks to Simon Maillard)
|
26 |
+
- Inline HTML content (see [instructions in the FAQs](https://wordpress.org/plugins/easy-fancybox#how%20can%20i%20display%20inline%20content%20in%20a%20fancybox%20overlay%20%3F))
|
27 |
+
- External web pages (see [instructions in the FAQs](https://wordpress.org/plugins/easy-fancybox#can%20i%20display%20web%20pages%20or%20html%20files%20in%20a%20fancybox%20overlay%3F))
|
28 |
+
|
29 |
+
Also supports:
|
30 |
+
|
31 |
+
- WordPress Galleries (option "Link to" must be set to "Media File")
|
32 |
+
- NextGEN galleries (see [instructions in the FAQs](https://wordpress.org/plugins/easy-fancybox#can%20nextgen%20gallery%20work%20with%20easy%20fancybox%20%3F))
|
33 |
+
- Image maps
|
34 |
+
- WordPress menu items (see [instructions in the FAQs](https://wordpress.org/plugins/easy-fancybox#can%20i%20make%20a%20menu%20item%20open%20in%20a%20fancybox%20overlay%20%3F))
|
35 |
+
- Jetpack Infinite Scroll
|
36 |
+
|
37 |
+
Additional features:
|
38 |
|
39 |
+
- Modal window option (see [instructions in the FAQs](https://wordpress.org/plugins/easy-fancybox#can%20i%20have%20a%20modal%20window%20%3F))
|
40 |
+
- Automatic detection of media file links
|
41 |
+
- Automatic detection of galleries
|
42 |
+
- Popup on page load optional (see [instructions in the FAQs](https://wordpress.org/plugins/easy-fancybox#can%20i%20make%20an%20image%20or%20hidden%20content%20to%20pop%20up%20in%20fancybox%20on%20page%20load%3F))
|
43 |
+
- Fade or Elastic popup effects
|
44 |
+
- Styling options for light box overlay (color and opacity) and window (border size and color)
|
45 |
|
46 |
+
For **advanced options** and **priority support**, there is a **[Pro extension](https://premium.status301.net/downloads/easy-fancybox-pro/)** available. See Pro features below.
|
47 |
+
|
48 |
+
See [FAQ's](https://wordpress.org/plugins/easy-fancybox/#faq) for instructions to manage YouTube, Dailymotion and Vimeo movies (and similar services) and tips to make inline content display in a FancyBox overlay.
|
49 |
|
50 |
Get support on the [Easy FancyBox web page](https://status301.net/wordpress-plugins/easy-fancybox/) or [WordPress forum](https://wordpress.org/support/plugin/easy-fancybox).
|
51 |
|
52 |
Visit [FancyBox](http://fancybox.net/) for more information and examples.
|
53 |
|
54 |
+
**PRO FEATURES**
|
55 |
+
|
56 |
+
- Priority support on dedicated forum
|
57 |
+
- Slideshow effect for galleries (autorotation)
|
58 |
+
- Spotlight effect for the light box overlay
|
59 |
+
- Gforms and TablePress compatibility
|
60 |
+
- More styling options: rounded corners, inline content background and text colors
|
61 |
+
- More automatic popup options: triggered by URL hash, first link by media type, hide popup after first visit
|
62 |
+
- Pass dedicated light box setting per media link via link class (see [Metadata instructions in the FAQs](https://wordpress.org/plugins/easy-fancybox#how%20do%20i%20show%20content%20with%20different%20sizes%3F))
|
63 |
+
- More elastic (easing) popup effects on open and close
|
64 |
+
- Show/hide image title on mouse hover
|
65 |
+
- Fine-tune media link and gallery autodetection to match your theme source markup to allow galleries per post for example
|
66 |
+
|
67 |
+
For these additional features, you need to install the **[Pro extension](https://premium.status301.net/downloads/easy-fancybox-pro/)** alongside this free plugin.
|
68 |
+
|
69 |
|
70 |
= Contribute =
|
71 |
|
72 |
If you're happy with this plugin as it is, please consider writing a quick [rating](https://wordpress.org/support/plugin/easy-fancybox/reviews/#new-post) or helping other users out on the [support forum](https://wordpress.org/support/plugin/easy-fancybox).
|
73 |
|
74 |
+
If you wish to help build this plugin, you're very welcome to [translate Easy FancyBox into your language](https://translate.wordpress.org/projects/wp-plugins/easy-fancybox/) or contribute bug reports, feature suggestions and/or code on [Github](https://github.com/RavanH/easy-fancybox/).
|
75 |
|
76 |
|
77 |
== Installation ==
|
114 |
|
115 |
= Which version of FancyBox does this plugin use? =
|
116 |
|
117 |
+
This plugin uses an **updated version** of the original [FancyBox 1.3.4](http://fancybox.net), better adapted to the mobile era.
|
118 |
+
|
119 |
|
120 |
= I installed the plugin. What now? =
|
121 |
|
123 |
|
124 |
The same thing goes for WordPress Galleries. Choose **Link To: Media File** when inserting a gallery tag.
|
125 |
|
|
|
126 |
|
127 |
+
= Where is the settings page? =
|
128 |
+
|
129 |
+
There is no new settings page but there are many options you can change. You will find a new **FancyBox** section on **Settings > Media**. To see the default, check out the example under [Screenshots](http://wordpress.org/plugins/easy-fancybox/screenshots/) ...
|
130 |
+
|
131 |
|
132 |
= Help! It does not work... =
|
133 |
|
134 |
+
Please follow the trouble shooting steps near the end of the plugin description above to determine the cause. If that fails, ask for support on the [Easy FancyBox WordPress forum](http://wordpress.org/tags/easy-fancybox) or go to the [development site](http://status301.net/wordpress-plugins/easy-fancybox/)
|
|
|
135 |
|
136 |
|
137 |
= ADVANCED =
|
138 |
|
139 |
+
= Will a WordPress gallery be displayed in a FancyBox overlay? =
|
140 |
|
141 |
Yes, but _only_ if you used the option **Link To: Media File** when inserting the gallery! The gallery quicktag/shortcode should look something like `[ gallery link="file" ]`.
|
142 |
|
143 |
+
|
144 |
= The lightbox does not look good on mobile devices. What can I do about that? =
|
145 |
|
146 |
+
The original FancyBox 1.3.4 script was not developed with mobile devices in mind and although the version used in this plugin has some adaptations for mobile devices, it might still be less optimal for very small screens. The only way around this issue is currently to disable FancyBox for small screen sizes on **Settings > Media** in the section **Miscellaneous > Browser & device compatibility**.
|
147 |
+
|
148 |
|
149 |
= Can I make a slideshow from my gallery? =
|
150 |
|
160 |
|
161 |
= Can NextGEN Gallery work with Easy FancyBox ? =
|
162 |
|
163 |
+
NetxGEN has its own built in FancyBox version along with a choice of other light box scripts but if you prefer to use Easy FancyBox (because of better customizability and other media support) then you need to take some steps to make the two plugins compatible.
|
164 |
|
165 |
1. Go to your Settings > Media admin page and switch OFF the FancyBox "Auto-gallery" option in the Images section;
|
166 |
+
1. Go to Gallery > Other Options and set the Lightbox Effects option to "Custom" and click on **Show Advanced Settings**;
|
167 |
1. fill the Code field with
|
168 |
`
|
169 |
class="fancybox" rel="%GALLERY_NAME%"
|
170 |
`
|
171 |
1. Leave the other fields empty and save your settings.
|
172 |
|
173 |
+
|
174 |
= Can I use ONE thumbnail to open a complete gallery ? =
|
175 |
|
176 |
It can be done manually (using the internal WordPress gallery feature, or not) _or_ in combination with NextGen Gallery.
|
240 |
|
241 |
1. Follow the instructions to make Easy FancyBox work smoothly with NextGEN above and make sure it all works correctly for normal thumbnails linked to their full-size version.
|
242 |
1. Then give the image that you want to link to a Youtube movie the URL to the Youtube page as title.
|
243 |
+
1. Finally paste the code below into a Custom HTML widget that will live in your sidebar or footer bar, or you can hard-code it into your theme but make sure it come before the `wp_footer()` call...
|
244 |
|
245 |
`
|
246 |
<script type="text/javascript">
|
371 |
`
|
372 |
Where you replace the shortcode (between the [ and ] characters) with the one given by the plugin. It can also work with shortcode by other plugins like Jetpack's Contact Form module. Change the class attribute to reflect the class used for the div that wraps your post content to have any form CSS style rules that are limited to post content, be applied to the inline content inside FancyBox.
|
373 |
|
374 |
+
|
375 |
= Can I make an image or hidden content to pop up in FancyBox on page load? =
|
376 |
|
377 |
Yes. A link that has the ID **fancybox-auto** (Note: there can be only ONE link like that on a page!) will be triggered automatically on page load.
|
380 |
|
381 |
Same can be done with an image, flash movie, PDF or iframe link! But please remember there can be only **one** item using the ID fancybox-auto per page...
|
382 |
|
383 |
+
|
384 |
= Can I have a modal window ? =
|
385 |
|
386 |
Yes, just create a hidden inline content light box (can be auto-popup) as described above and give the link an extra class "modal". This will remove all options to close the light box, like the close button, an overlay click or escape key.
|
387 |
|
388 |
+
This means there is NO option to close the light box, unless you create a link like this inside the hidden inline content div:
|
389 |
|
390 |
`
|
391 |
+
<a href="" class="fancybox-close">Accept</a>
|
392 |
`
|
393 |
|
394 |
+
|
395 |
= Can I make a menu item open in a FancyBox overlay ? =
|
396 |
|
397 |
Yes. But it depends on you theme what you need to do to make it work. If you are on WordPress 3+ and your theme supports the new internal Custom Menu feature or if you are using a custom menu in a sidebar widget, it's easy:
|
404 |
If you are on an older version of WordPress or if you cannot use WP's Menus, you will need to do some heavy theme hacking to get it to work. Basically, what you need to achieve is that the menu item you want opened in a lightbox overlay, should get a class="fancybox-iframe" tag.
|
405 |
|
406 |
|
407 |
+
= How can I make AJAX loaded content be seen by FancyBox ? =
|
408 |
+
|
409 |
+
Easy FancyBox initially scans the page source for media links on the "Document Loaded" event. This means right after the page source has become available to and read by the browser. When content is added or modified through AJAX (meaning after initial page load) by your theme or another plugin, then FancyBox will not be aware of any media links in that new content.
|
410 |
+
|
411 |
+
To make Easy FancyBox rescan the updated page source after content has been modified though AJAX, there is an event listener available. This event is also triggered by the Jetpack Infinite Scroll module. To use this event, you'll need to modify the theme or other plugin script that handles the AJAX calls.
|
412 |
+
|
413 |
+
You can trigger the event like this:
|
414 |
+
`
|
415 |
+
jQuery(document.body).trigger('post-load');
|
416 |
+
`
|
417 |
+
Note: It completely depends on the AJAX script where this code snippet should be placed. Optimally, right _after_ the DOM modification where content is added or modified. In most cases at the end of the AJAX Success handler.
|
418 |
+
|
419 |
+
|
420 |
= Is Easy FancyBox multi-site compatible? =
|
421 |
|
422 |
Yes. Designed to work with **Network Activate** and does not require manual activation on each site in your network.
|
493 |
|
494 |
2. Example of a YouTube movie in overlay.
|
495 |
|
496 |
+
|
497 |
== Upgrade Notice ==
|
498 |
|
499 |
+
= 1.8 =
|
500 |
+
Many FancyBox improvements. New options: Google Docs Viewer for PDF, Youtube privacy-enhanced embed, theme and plugins compatibility options. Pre WP 4.5 compatibility.
|
501 |
+
|
502 |
|
503 |
== Changelog ==
|
504 |
|
505 |
+
= 1.8 =
|
506 |
+
* NEW: Google Docs Viewer for PDF
|
507 |
+
* NEW: Youtube privacy-enhanced embed
|
508 |
+
* NEW: Compatibility options: late script inclusion, jquery exclusion, no wp_add_inline_script
|
509 |
+
* FancyBox: Improved mobile viewport height detection
|
510 |
+
* FancyBox: now skips subsequent double links in gallery
|
511 |
+
* FancyBox: new PDF content type
|
512 |
+
* FancyBox: improved error messages
|
513 |
+
* Dedicated IE8 stylesheet
|
514 |
+
* jQuery Easing update to 1.4.1
|
515 |
+
|
516 |
= 1.7 =
|
517 |
* NEW: Aspect ratio for video frames on smaller screens
|
518 |
* NEW: Global minimum screen size
|