Easy FancyBox - Version 1.9

Version Description

Swipe support, fixed background and accessibility improvements.

=

Download this release

Release Info

Developer RavanH
Plugin Icon 128x128 Easy FancyBox
Version 1.9
Comparing to
See all releases

Code changes from version 1.8.19 to 1.9

Files changed (112) hide show
  1. css/jquery.fancybox-ie.min.css +0 -1
  2. css/jquery.fancybox.min.css +0 -1
  3. easy-fancybox.php +57 -56
  4. {images → fancybox/1.3.26}/blank.gif +0 -0
  5. {images → fancybox/1.3.26}/fancy_close.png +0 -0
  6. {images → fancybox/1.3.26}/fancy_loading.png +0 -0
  7. {images → fancybox/1.3.26}/fancy_nav_left.png +0 -0
  8. {images → fancybox/1.3.26}/fancy_nav_right.png +0 -0
  9. {images → fancybox/1.3.26}/fancy_shadow_e.png +0 -0
  10. {images → fancybox/1.3.26}/fancy_shadow_n.png +0 -0
  11. {images → fancybox/1.3.26}/fancy_shadow_ne.png +0 -0
  12. {images → fancybox/1.3.26}/fancy_shadow_nw.png +0 -0
  13. {images → fancybox/1.3.26}/fancy_shadow_s.png +0 -0
  14. {images → fancybox/1.3.26}/fancy_shadow_se.png +0 -0
  15. {images → fancybox/1.3.26}/fancy_shadow_sw.png +0 -0
  16. {images → fancybox/1.3.26}/fancy_shadow_w.png +0 -0
  17. {images → fancybox/1.3.26}/fancy_title_left.png +0 -0
  18. {images → fancybox/1.3.26}/fancy_title_main.png +0 -0
  19. {images → fancybox/1.3.26}/fancy_title_over.png +0 -0
  20. {images → fancybox/1.3.26}/fancy_title_right.png +0 -0
  21. {images → fancybox/1.3.26}/fancybox-x.png +0 -0
  22. {images → fancybox/1.3.26}/fancybox-y.png +0 -0
  23. {images → fancybox/1.3.26}/fancybox.png +0 -0
  24. {css → fancybox/1.3.26}/jquery.fancybox-ie.css +0 -0
  25. fancybox/1.3.26/jquery.fancybox-ie.min.css +1 -0
  26. {css → fancybox/1.3.26}/jquery.fancybox.css +316 -323
  27. fancybox/1.3.26/jquery.fancybox.js +1346 -0
  28. fancybox/1.3.26/jquery.fancybox.min.css +1 -0
  29. fancybox/1.3.26/jquery.fancybox.min.js +1 -0
  30. fancybox/1.5.0/jquery.fancybox.css +367 -0
  31. fancybox/1.5.0/jquery.fancybox.js +1195 -0
  32. fancybox/1.5.0/jquery.fancybox.min.css +1 -0
  33. fancybox/1.5.0/jquery.fancybox.min.js +1 -0
  34. fancybox/2.2.0/fancybox_loading.gif +0 -0
  35. fancybox/2.2.0/fancybox_loading@2x.gif +0 -0
  36. fancybox/2.2.0/fancybox_sprite.png +0 -0
  37. fancybox/2.2.0/fancybox_sprite@2x.png +0 -0
  38. fancybox/2.2.0/helpers/fancybox_buttons.png +0 -0
  39. fancybox/2.2.0/helpers/jquery.fancybox-buttons.css +91 -0
  40. fancybox/2.2.0/helpers/jquery.fancybox-buttons.js +122 -0
  41. fancybox/2.2.0/helpers/jquery.fancybox-buttons.min.css +1 -0
  42. fancybox/2.2.0/helpers/jquery.fancybox-buttons.min.js +16 -0
  43. fancybox/2.2.0/helpers/jquery.fancybox-media.js +161 -0
  44. fancybox/2.2.0/helpers/jquery.fancybox-media.min.js +2 -0
  45. fancybox/2.2.0/helpers/jquery.fancybox-thumbs.css +55 -0
  46. fancybox/2.2.0/helpers/jquery.fancybox-thumbs.js +165 -0
  47. fancybox/2.2.0/helpers/jquery.fancybox-thumbs.min.css +1 -0
  48. fancybox/2.2.0/helpers/jquery.fancybox-thumbs.min.js +17 -0
  49. fancybox/2.2.0/jquery.fancybox.css +295 -0
  50. fancybox/2.2.0/jquery.fancybox.js +2113 -0
  51. fancybox/2.2.0/jquery.fancybox.min.css +1 -0
  52. fancybox/2.2.0/jquery.fancybox.min.js +1 -0
  53. fancybox/3.5.7/jquery.fancybox.css +895 -0
  54. fancybox/3.5.7/jquery.fancybox.js +5632 -0
  55. fancybox/3.5.7/jquery.fancybox.min.css +1 -0
  56. fancybox/3.5.7/jquery.fancybox.min.js +1 -0
  57. inc/class-easyfancybox-admin.php +198 -68
  58. inc/class-easyfancybox.php +233 -405
  59. inc/fancybox-2-options.php +1485 -0
  60. inc/fancybox-2.php +503 -0
  61. inc/fancybox-classic-options.php +1479 -0
  62. inc/fancybox-classic.php +343 -0
  63. inc/{easyfancybox-options.php → fancybox-legacy-options.php} +238 -253
  64. inc/fancybox-legacy.php +341 -0
  65. js/jquery.fancybox.min.js +0 -1
  66. readme.txt +737 -760
  67. uninstall.php +222 -0
  68. vendor/fancybox-1.3.4/blank.gif +0 -0
  69. vendor/fancybox-1.3.4/fancy_close.png +0 -0
  70. vendor/fancybox-1.3.4/fancy_loading.png +0 -0
  71. vendor/fancybox-1.3.4/fancy_nav_left.png +0 -0
  72. vendor/fancybox-1.3.4/fancy_nav_right.png +0 -0
  73. vendor/fancybox-1.3.4/fancy_shadow_e.png +0 -0
  74. vendor/fancybox-1.3.4/fancy_shadow_n.png +0 -0
  75. vendor/fancybox-1.3.4/fancy_shadow_ne.png +0 -0
  76. vendor/fancybox-1.3.4/fancy_shadow_nw.png +0 -0
  77. vendor/fancybox-1.3.4/fancy_shadow_s.png +0 -0
  78. vendor/fancybox-1.3.4/fancy_shadow_se.png +0 -0
  79. vendor/fancybox-1.3.4/fancy_shadow_sw.png +0 -0
  80. vendor/fancybox-1.3.4/fancy_shadow_w.png +0 -0
  81. vendor/fancybox-1.3.4/fancy_title_left.png +0 -0
  82. vendor/fancybox-1.3.4/fancy_title_main.png +0 -0
  83. vendor/fancybox-1.3.4/fancy_title_over.png +0 -0
  84. vendor/fancybox-1.3.4/fancy_title_right.png +0 -0
  85. vendor/fancybox-1.3.4/fancybox-x.png +0 -0
  86. vendor/fancybox-1.3.4/fancybox-y.png +0 -0
  87. vendor/fancybox-1.3.4/fancybox.png +0 -0
  88. vendor/fancybox-1.3.4/jquery.fancybox-1.3.4.css +359 -0
  89. js/jquery.fancybox.js → vendor/fancybox-1.3.4/jquery.fancybox-1.3.4.js +155 -355
  90. vendor/fancybox-1.3.4/jquery.fancybox-1.3.4.pack.js +46 -0
  91. vendor/fancybox-2.1.7/.gitattributes +7 -0
  92. vendor/fancybox-2.1.7/.gitignore +3 -0
  93. vendor/fancybox-2.1.7/CHANGELOG.md +125 -0
  94. vendor/fancybox-2.1.7/README.md +244 -0
  95. vendor/fancybox-2.1.7/bower.json +35 -0
  96. vendor/fancybox-2.1.7/composer.json +14 -0
  97. vendor/fancybox-2.1.7/demo/1_b.jpg +0 -0
  98. vendor/fancybox-2.1.7/demo/1_s.jpg +0 -0
  99. vendor/fancybox-2.1.7/demo/2_b.jpg +0 -0
  100. vendor/fancybox-2.1.7/demo/2_s.jpg +0 -0
  101. vendor/fancybox-2.1.7/demo/3_b.jpg +0 -0
  102. vendor/fancybox-2.1.7/demo/3_s.jpg +0 -0
  103. vendor/fancybox-2.1.7/demo/4_b.jpg +0 -0
  104. vendor/fancybox-2.1.7/demo/4_s.jpg +0 -0
  105. vendor/fancybox-2.1.7/demo/5_b.jpg +0 -0
  106. vendor/fancybox-2.1.7/demo/5_s.jpg +0 -0
  107. vendor/fancybox-2.1.7/demo/ajax.txt +15 -0
  108. vendor/fancybox-2.1.7/demo/iframe.html +26 -0
  109. vendor/fancybox-2.1.7/demo/index.html +312 -0
  110. vendor/fancybox-2.1.7/fancybox.jquery.json +31 -0
  111. vendor/fancybox-2.1.7/gulpfile.js +76 -0
  112. vendor/fancybox-2.1.7/lib/jquery-1.10.2.min.js +6 -0
css/jquery.fancybox-ie.min.css DELETED
@@ -1 +0,0 @@
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}
 
css/jquery.fancybox.min.css DELETED
@@ -1 +0,0 @@
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('../images/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('../images/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('../images/fancybox.png');background-position:-40px -30px}.rtl #fancybox-left-ico{background-position:-40px -60px;right:-9999px}#fancybox-right-ico{background-image:url('../images/fancybox.png');background-position:-40px -60px}.rtl #fancybox-right-ico{background-position:-40px -30px;right:-9999px}#fancybox-left:focus,#fancybox-right:focus{outline:0;background:initial}#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('../images/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('../images/fancybox-x.png') 0 -40px}#fancybox-title-float-right{padding:0 0 0 15px;background:url('../images/fancybox.png') -55px -90px no-repeat}.fancybox-hidden{display:none}
 
easy-fancybox.php CHANGED
@@ -1,56 +1,57 @@
1
- <?php
2
- /*
3
- Plugin Name: Easy FancyBox
4
- 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.8.19
9
- Author: RavanH
10
- Author URI: http://status301.net/
11
- */
12
-
13
- /* Copyright 2022 RavanH (email : ravanhagen@gmail.com)
14
-
15
- This program is free software; you can redistribute it and/or modify
16
- it under the terms of the GNU General Public License as published by
17
- the Free Software Foundation; either version 2 of the License, or
18
- (at your option) any later version.
19
-
20
- This program is distributed in the hope that it will be useful,
21
- but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- GNU General Public License for more details.
24
-
25
- You should have received a copy of the GNU General Public License
26
- along with this program; if not, write to the Free Software
27
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
- */
29
-
30
- /*
31
- For Installation instructions, usage, revision history and other info: see readme.txt included in this package
32
- */
33
-
34
- if ( ! defined( 'ABSPATH' ) ) exit;
35
-
36
- /**************
37
- * CONSTANTS
38
- **************/
39
-
40
- define( 'EASY_FANCYBOX_VERSION', '1.8.19' );
41
- define( 'FANCYBOX_VERSION', '1.3.24' );
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
- new easyFancyBox( __FILE__ );
52
-
53
- if ( is_admin() ) {
54
- require_once dirname( __FILE__ ) . '/inc/class-easyfancybox-admin.php';
55
- new easyFancyBox_Admin();
56
- }
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Easy FancyBox
4
+ Plugin URI: http://status301.net/wordpress-plugins/easy-fancybox/
5
+ Description: Easily enable the FancyBox jQuery light box on all media file links. Also supports iframe, inline content and well known video hosts.
6
+ Text Domain: easy-fancybox
7
+ Domain Path: languages
8
+ Version: 1.9
9
+ Author: RavanH
10
+ Author URI: http://status301.net/
11
+ */
12
+
13
+ /**
14
+ * Copyright 2022 RavanH
15
+ * https://status301.net/
16
+ * mailto: ravanhagen@gmail.com
17
+
18
+ * This program is free software; you can redistribute it and/or modify
19
+ * it under the terms of the GNU General Public License version 3 as
20
+ * published by the Free Software Foundation.
21
+
22
+ * This program is distributed in the hope that it will be useful,
23
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ * GNU General Public License for more details.
26
+ */
27
+
28
+ if ( ! defined( 'ABSPATH' ) ) exit;
29
+
30
+ /**************
31
+ * CONSTANTS
32
+ **************/
33
+
34
+ define( 'EASY_FANCYBOX_VERSION', '1.9' );
35
+ define( 'FANCYBOX_VERSIONS', array(
36
+ 'legacy' => '1.3.26',
37
+ 'classic' => '1.5.0',
38
+ 'fancyBox2' => '2.2.0',
39
+ //'fancyBox3' => '3.5.7'
40
+ ) );
41
+ define( 'MOUSEWHEEL_VERSION', '3.1.13' );
42
+ define( 'EASING_VERSION', '1.4.1' );
43
+ define( 'METADATA_VERSION', '2.22.1' );
44
+ define( 'EASY_FANCYBOX_DIR', dirname( __FILE__ ) );
45
+ define( 'EASY_FANCYBOX_BASENAME', plugin_basename(__FILE__) );
46
+
47
+ /**************
48
+ * CLASSES
49
+ **************/
50
+
51
+ require_once EASY_FANCYBOX_DIR . '/inc/class-easyfancybox.php';
52
+ new easyFancyBox();
53
+
54
+ if ( is_admin() ) {
55
+ require_once EASY_FANCYBOX_DIR . '/inc/class-easyfancybox-admin.php';
56
+ new easyFancyBox_Admin();
57
+ }
{images → fancybox/1.3.26}/blank.gif RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_close.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_loading.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_nav_left.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_nav_right.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_shadow_e.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_shadow_n.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_shadow_ne.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_shadow_nw.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_shadow_s.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_shadow_se.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_shadow_sw.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_shadow_w.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_title_left.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_title_main.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_title_over.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancy_title_right.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancybox-x.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancybox-y.png RENAMED
File without changes
{images → fancybox/1.3.26}/fancybox.png RENAMED
File without changes
{css → fancybox/1.3.26}/jquery.fancybox-ie.css RENAMED
File without changes
fancybox/1.3.26/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;}
{css → fancybox/1.3.26}/jquery.fancybox.css RENAMED
@@ -1,323 +1,316 @@
1
- /*
2
- * FancyBox - jQuery Plugin
3
- * Simple and fancy lightbox alternative
4
- *
5
- * Examples and documentation at: http://fancybox.net
6
- *
7
- * Copyright (c) 2008 - 2010 Janis Skarnelis
8
- * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
- *
10
- * Version: 1.3.23 (2018/10/01)
11
- *
12
- * Dual licensed under the MIT and GPL licenses:
13
- * http://www.opensource.org/licenses/mit-license.php
14
- * http://www.gnu.org/licenses/gpl.html
15
- */
16
-
17
- #fancybox-loading, #fancybox-loading div,
18
- #fancybox-overlay,
19
- #fancybox-wrap, .fancybox-bg,
20
- #fancybox-outer,
21
- #fancybox-content,
22
- #fancybox-content > div,
23
- #fancybox-content > div > div,
24
- #fancybox-frame,
25
- #fancybox-close,
26
- #fancybox-title, #fancybox-title div,
27
- #fancybox-left, #fancybox-right, .fancy-ico {
28
- box-sizing: content-box;
29
- -moz-box-sizing: content-box;
30
- }
31
-
32
- #fancybox-loading {
33
- position: fixed;
34
- top: 50%;
35
- left: 50%;
36
- width: 40px;
37
- height: 40px;
38
- margin-top: -20px;
39
- margin-left: -20px;
40
- cursor: pointer;
41
- overflow: hidden;
42
- z-index: 111104;
43
- display: none;
44
- }
45
-
46
- #fancybox-loading div {
47
- position: absolute;
48
- top: 0;
49
- left: 0;
50
- width: 40px;
51
- height: 480px;
52
- background-image: url('../images/fancybox.png');
53
- }
54
-
55
- #fancybox-overlay {
56
- position: absolute;
57
- top: 0;
58
- left: 0;
59
- width: 100%;
60
- z-index: 111100;
61
- display: none;
62
- }
63
-
64
- #fancybox-tmp {
65
- padding: 0;
66
- margin: 0;
67
- border: 0;
68
- overflow: auto;
69
- display: none;
70
- }
71
-
72
- #fancybox-wrap {
73
- position: absolute;
74
- top: 0;
75
- left: 0;
76
- padding: 20px;
77
- z-index: 111101;
78
- display: none;
79
- }
80
-
81
- #fancybox-outer {
82
- position: relative;
83
- width: 100%;
84
- height: 100%;
85
- background: #fff;
86
- box-shadow:0 0 20px #111;
87
- -moz-box-shadow:0 0 20px #111;
88
- -webkit-box-shadow:0 0 20px #111;
89
- }
90
-
91
- #fancybox-content {
92
- width: 0;
93
- height: 0;
94
- padding: 0;
95
- position: relative;
96
- /*overflow: hidden;*/
97
- -webkit-overflow-scrolling:touch;
98
- overflow-y:auto;
99
- z-index: 111102;
100
- border: 0px solid #fff;
101
- background: #fff;
102
- -moz-background-clip: padding; /* Firefox 3.6 */
103
- -webkit-background-clip: padding; /* Safari 4? Chrome 6? */
104
- background-clip: padding-box; /* IE9+, Firefox 4+, Opera, Chrome */
105
- }
106
-
107
- #fancybox-content > div {
108
- max-width: 100%;
109
- max-height: 100%;
110
- }
111
-
112
- #fancybox-hide-sel-frame {
113
- position: absolute;
114
- top: 0;
115
- left: 0;
116
- width: 100%;
117
- height: 100%;
118
- background: transparent;
119
- z-index: 111101;
120
- }
121
-
122
- #fancybox-close {
123
- position: absolute;
124
- top: -15px;
125
- right: -15px;
126
- width: 30px;
127
- height: 30px;
128
- background: transparent url('../images/fancybox.png') -40px 0px;
129
- cursor: pointer;
130
- z-index: 111103;
131
- display: none;
132
- }
133
-
134
- #fancybox-error {
135
- color: #444;
136
- padding: 14px;
137
- margin: 0;
138
- }
139
-
140
- #fancybox-frame, #fancybox-img {
141
- width: 100%;
142
- height: 100%;
143
- border: none;
144
- }
145
-
146
- #fancybox-img {
147
- padding: 0;
148
- margin: 0;
149
- line-height: 0;
150
- vertical-align: top;
151
- max-width:none !important;
152
- max-height:none !important
153
- }
154
-
155
- #fancybox-frame {
156
- display: block;
157
- width: 100%;
158
- height: 100%;
159
- z-index: 0; /* z-index bug with -webkit-overflow-scrolling */
160
- -webkit-transform: translateZ(0px);
161
- -webkit-transform: translate3d(0,0,0);
162
- -webkit-perspective: 1000;
163
- }
164
-
165
- #fancybox-left, #fancybox-right {
166
- position: absolute;
167
- bottom: 0px;
168
- height: 100%;
169
- width: 35%;
170
- cursor: pointer;
171
- background: initial;
172
- z-index: 111102;
173
- display: none;
174
- }
175
-
176
- #fancybox-left {
177
- left: 0px;
178
- }
179
-
180
- .rtl #fancybox-left {
181
- left:auto;
182
- right:0px
183
- }
184
-
185
- #fancybox-right {
186
- right: 0px;
187
- }
188
-
189
- .rtl #fancybox-right {
190
- left:0px;
191
- right:auto
192
- }
193
-
194
- #fancybox-left-ico, #fancybox-right-ico {
195
- position: absolute;
196
- top: 50%;
197
- left: -9999px;
198
- width: 30px;
199
- height: 30px;
200
- margin-top: -15px;
201
- cursor: pointer;
202
- z-index: 111102;
203
- display: block;
204
- }
205
-
206
- #fancybox-left-ico {
207
- background-image: url('../images/fancybox.png');
208
- background-position: -40px -30px;
209
- }
210
-
211
- .rtl #fancybox-left-ico{
212
- background-position:-40px -60px;
213
- right:-9999px
214
- }
215
-
216
- #fancybox-right-ico {
217
- background-image: url('../images/fancybox.png');
218
- background-position: -40px -60px;
219
- }
220
-
221
- .rtl #fancybox-right-ico{
222
- background-position:-40px -30px;
223
- right:-9999px
224
- }
225
-
226
- #fancybox-left:focus, #fancybox-right:focus {
227
- outline: none;
228
- background: initial;
229
- }
230
-
231
- #fancybox-left:hover span {
232
- left: 20px;
233
- }
234
-
235
- .rtl #fancybox-left:hover span {
236
- right:20px
237
- }
238
-
239
- #fancybox-right:hover span {
240
- left: auto;
241
- right: 20px;
242
- }
243
-
244
- .rtl #fancybox-right:hover span {
245
- right:auto;
246
- left:20px
247
- }
248
-
249
- #fancybox-title {
250
- z-index: 111102;
251
- }
252
-
253
- .fancybox-title-inside {
254
- padding-bottom: 10px;
255
- text-align: center;
256
- color: #333;
257
- position: relative;
258
- }
259
-
260
- .fancybox-title-outside {
261
- padding-top: 10px;
262
- color: #fff;
263
- font-weight: 600;
264
- }
265
-
266
- .fancybox-title-over {
267
- position: absolute;
268
- bottom: 0;
269
- left: 0;
270
- color: #FFF;
271
- text-align: left;
272
- }
273
-
274
- .rtl .fancybox-title-over {
275
- text-align:right
276
- }
277
-
278
- #fancybox-title-over {
279
- padding: 10px;
280
- background: rgba(0,0,0,.64);
281
- display: block;
282
- }
283
-
284
- .fancybox-title-float {
285
- position: absolute;
286
- left: 0;
287
- bottom: -20px;
288
- height: 32px;
289
- }
290
-
291
- #fancybox-title-float-wrap {
292
- border: none;
293
- border-collapse: collapse;
294
- width: auto;
295
- }
296
-
297
- #fancybox-title-float-wrap tr,#fancybox-title-float-wrap td {
298
- border: none;
299
- white-space: nowrap;
300
- }
301
-
302
- #fancybox-title-float-left {
303
- padding: 0 0 0 15px;
304
- background: url('../images/fancybox.png') -40px -90px no-repeat;
305
- }
306
-
307
- #fancybox-title-float-main {
308
- color: #fff;
309
- line-height: 29px;
310
- font-weight: 600;
311
- font-size: 14px;
312
- padding: 0 0 3px 0;
313
- background: url('../images/fancybox-x.png') 0px -40px;
314
- }
315
-
316
- #fancybox-title-float-right {
317
- padding: 0 0 0 15px;
318
- background: url('../images/fancybox.png') -55px -90px no-repeat;
319
- }
320
-
321
- .fancybox-hidden {
322
- display:none
323
- }
1
+ /**
2
+ * FancyBox - jQuery Plugin
3
+ * Simple and fancy lightbox alternative
4
+ *
5
+ * Examples and documentation at: http://fancybox.net
6
+ *
7
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
8
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Version: 1.3.26 (2018/10/01)
11
+ *
12
+ * Dual licensed under the MIT and GPL licenses:
13
+ * http://www.opensource.org/licenses/mit-license.php
14
+ * http://www.gnu.org/licenses/gpl.html
15
+ */
16
+
17
+ #fancybox-loading, #fancybox-loading div,
18
+ #fancybox-overlay,
19
+ #fancybox-wrap, .fancybox-bg,
20
+ #fancybox-outer,
21
+ #fancybox-content,
22
+ #fancybox-content > div,
23
+ #fancybox-content > div > div,
24
+ #fancybox-frame,
25
+ #fancybox-close,
26
+ #fancybox-title, #fancybox-title div,
27
+ #fancybox-left, #fancybox-right, .fancy-ico {
28
+ box-sizing: content-box;
29
+ -moz-box-sizing: content-box;
30
+ }
31
+
32
+ #fancybox-loading {
33
+ position: fixed;
34
+ top: 50%;
35
+ left: 50%;
36
+ width: 40px;
37
+ height: 40px;
38
+ margin-top: -20px;
39
+ margin-left: -20px;
40
+ cursor: pointer;
41
+ overflow: hidden;
42
+ z-index: 111104;
43
+ display: none;
44
+ }
45
+
46
+ #fancybox-loading div {
47
+ position: absolute;
48
+ top: 0;
49
+ left: 0;
50
+ width: 40px;
51
+ height: 480px;
52
+ background-image: url('fancybox.png');
53
+ }
54
+
55
+ #fancybox-overlay {
56
+ position: absolute;
57
+ top: 0;
58
+ left: 0;
59
+ width: 100%;
60
+ z-index: 111100;
61
+ display: none;
62
+ }
63
+
64
+ #fancybox-tmp {
65
+ padding: 0;
66
+ margin: 0;
67
+ border: 0;
68
+ overflow: auto;
69
+ display: none;
70
+ }
71
+
72
+ #fancybox-wrap {
73
+ position: absolute;
74
+ top: 0;
75
+ left: 0;
76
+ padding: 20px;
77
+ z-index: 111101;
78
+ display: none;
79
+ }
80
+
81
+ #fancybox-outer {
82
+ position: relative;
83
+ width: 100%;
84
+ height: 100%;
85
+ background: #fff;
86
+ box-shadow:0 0 20px #111;
87
+ -moz-box-shadow:0 0 20px #111;
88
+ -webkit-box-shadow:0 0 20px #111;
89
+ }
90
+
91
+ #fancybox-content {
92
+ width: 0;
93
+ height: 0;
94
+ padding: 0;
95
+ position: relative;
96
+ /*overflow: hidden;*/
97
+ -webkit-overflow-scrolling:touch;
98
+ overflow-y:auto;
99
+ z-index: 111102;
100
+ border: 0px solid #fff;
101
+ background: #fff;
102
+ -moz-background-clip: padding; /* Firefox 3.6 */
103
+ -webkit-background-clip: padding; /* Safari 4? Chrome 6? */
104
+ background-clip: padding-box; /* IE9+, Firefox 4+, Opera, Chrome */
105
+ }
106
+
107
+ #fancybox-content > div {
108
+ max-width: 100%;
109
+ max-height: 100%;
110
+ }
111
+
112
+ #fancybox-hide-sel-frame {
113
+ position: absolute;
114
+ top: 0;
115
+ left: 0;
116
+ width: 100%;
117
+ height: 100%;
118
+ background: transparent;
119
+ z-index: 111101;
120
+ }
121
+
122
+ #fancybox-close {
123
+ position: absolute;
124
+ top: -15px;
125
+ right: -15px;
126
+ width: 30px;
127
+ height: 30px;
128
+ background: transparent url('fancybox.png') -40px 0px;
129
+ cursor: pointer;
130
+ z-index: 111103;
131
+ display: none;
132
+ }
133
+
134
+ #fancybox-error {
135
+ color: #444;
136
+ padding: 14px;
137
+ margin: 0;
138
+ }
139
+
140
+ #fancybox-frame, #fancybox-img {
141
+ width: 100%;
142
+ height: 100%;
143
+ border: none;
144
+ }
145
+
146
+ #fancybox-img {
147
+ padding: 0;
148
+ margin: 0;
149
+ line-height: 0;
150
+ vertical-align: top;
151
+ max-width:none !important;
152
+ max-height:none !important
153
+ }
154
+
155
+ #fancybox-frame {
156
+ display: block;
157
+ width: 100%;
158
+ height: 100%;
159
+ z-index: 0; /* z-index bug with -webkit-overflow-scrolling */
160
+ }
161
+
162
+ #fancybox-left, #fancybox-right {
163
+ position: absolute;
164
+ bottom: 0px;
165
+ height: 100%;
166
+ width: 35%;
167
+ cursor: pointer;
168
+ background: initial;
169
+ z-index: 111102;
170
+ display: none;
171
+ }
172
+
173
+ #fancybox-left {
174
+ left: 0px;
175
+ }
176
+
177
+ .rtl #fancybox-left {
178
+ left:auto;
179
+ right:0px
180
+ }
181
+
182
+ #fancybox-right {
183
+ right: 0px;
184
+ }
185
+
186
+ .rtl #fancybox-right {
187
+ left:0px;
188
+ right:auto
189
+ }
190
+
191
+ #fancybox-left-ico, #fancybox-right-ico {
192
+ position: absolute;
193
+ top: 50%;
194
+ left: -9999px;
195
+ width: 30px;
196
+ height: 30px;
197
+ margin-top: -15px;
198
+ cursor: pointer;
199
+ z-index: 111102;
200
+ display: block;
201
+ }
202
+
203
+ #fancybox-left-ico {
204
+ background-image: url('fancybox.png');
205
+ background-position: -40px -30px;
206
+ }
207
+
208
+ .rtl #fancybox-left-ico{
209
+ background-position:-40px -60px;
210
+ right:-9999px
211
+ }
212
+
213
+ #fancybox-right-ico {
214
+ background-image: url('fancybox.png');
215
+ background-position: -40px -60px;
216
+ }
217
+
218
+ .rtl #fancybox-right-ico{
219
+ background-position:-40px -30px;
220
+ right:-9999px
221
+ }
222
+
223
+ #fancybox-left:focus, #fancybox-right:focus {
224
+ outline: none;
225
+ background: initial;
226
+ }
227
+
228
+ #fancybox-left:hover span {
229
+ left: 20px;
230
+ }
231
+
232
+ .rtl #fancybox-left:hover span {
233
+ right:20px
234
+ }
235
+
236
+ #fancybox-right:hover span {
237
+ left: auto;
238
+ right: 20px;
239
+ }
240
+
241
+ .rtl #fancybox-right:hover span {
242
+ right:auto;
243
+ left:20px
244
+ }
245
+
246
+ #fancybox-title {
247
+ z-index: 111102;
248
+ }
249
+
250
+ .fancybox-title-inside {
251
+ padding-bottom: 10px;
252
+ text-align: center;
253
+ color: #333;
254
+ position: relative;
255
+ }
256
+
257
+ .fancybox-title-outside {
258
+ padding-top: 10px;
259
+ color: #fff;
260
+ font-weight: 600;
261
+ }
262
+
263
+ .fancybox-title-over {
264
+ position: absolute;
265
+ bottom: 0;
266
+ left: 0;
267
+ color: #FFF;
268
+ text-align: left;
269
+ }
270
+
271
+ .rtl .fancybox-title-over {
272
+ text-align:right
273
+ }
274
+
275
+ #fancybox-title-over {
276
+ padding: 10px;
277
+ background: rgba(0,0,0,.64);
278
+ display: block;
279
+ }
280
+
281
+ .fancybox-title-float {
282
+ position: absolute;
283
+ left: 0;
284
+ bottom: -20px;
285
+ height: 32px;
286
+ }
287
+
288
+ #fancybox-title-float-wrap {
289
+ border: none;
290
+ border-collapse: collapse;
291
+ width: auto;
292
+ }
293
+
294
+ #fancybox-title-float-wrap tr,#fancybox-title-float-wrap td {
295
+ border: none;
296
+ white-space: nowrap;
297
+ }
298
+
299
+ #fancybox-title-float-left {
300
+ padding: 0 0 0 15px;
301
+ background: url('fancybox.png') -40px -90px no-repeat;
302
+ }
303
+
304
+ #fancybox-title-float-main {
305
+ color: #fff;
306
+ line-height: 29px;
307
+ font-weight: 600;
308
+ font-size: 14px;
309
+ padding: 0 0 3px 0;
310
+ background: url('fancybox-x.png') 0px -40px;
311
+ }
312
+
313
+ #fancybox-title-float-right {
314
+ padding: 0 0 0 15px;
315
+ background: url('fancybox.png') -55px -90px no-repeat;
316
+ }
 
 
 
 
 
 
 
fancybox/1.3.26/jquery.fancybox.js ADDED
@@ -0,0 +1,1346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * FancyBox - jQuery Plugin
3
+ * Simple and fancy lightbox alternative
4
+ *
5
+ * Examples and documentation at: http://fancybox.net
6
+ *
7
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
8
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Version: 1.3.26 (2019/04/07)
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
+
18
+ (function($) {
19
+ var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, resize_timeout,
20
+ selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
21
+ ajaxLoader = null, imgPreloader = new Image(),
22
+ imgRegExp = /\.(jpg|gif|png|bmp|jpeg|webp)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i, svgRegExp = /[^\.]\.(svg)\s*$/i, pdfRegExp = /[^\.]\.(pdf)\s*$/i,
23
+ loadingTimer, loadingFrame = 1,
24
+ titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
25
+ isIE = /MSIE|Trident/.test(window.navigator.userAgent), isIE6 = isIE && !window.XMLHttpRequest,
26
+ isTouch = document.createTouch !== undefined;
27
+
28
+ /*
29
+ * Private methods
30
+ */
31
+
32
+ _abort = function() {
33
+ $.fancybox.hideActivity();
34
+
35
+ imgPreloader.onerror = imgPreloader.onload = null;
36
+
37
+ if (ajaxLoader) {
38
+ ajaxLoader.abort();
39
+ }
40
+
41
+ tmp.empty();
42
+ },
43
+
44
+ _error = function(msg) {
45
+ if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
46
+ $.fancybox.hideActivity();
47
+ busy = false;
48
+ return;
49
+ }
50
+
51
+ if ( typeof msg === 'undefined' ) {
52
+ msg = 'Please try again later.';
53
+ }
54
+
55
+ selectedOpts.titleShow = false;
56
+
57
+ selectedOpts.width = 'auto';
58
+ selectedOpts.height = 'auto';
59
+
60
+ tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />' + msg + '</p>' );
61
+
62
+ _process_inline();
63
+ },
64
+
65
+ _start = function() {
66
+ var obj = selectedArray[ selectedIndex ],
67
+ href,
68
+ type,
69
+ title,
70
+ str,
71
+ emb,
72
+ ret;
73
+
74
+ _abort();
75
+
76
+ selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
77
+
78
+ if ( document.documentElement.clientWidth < selectedOpts.minViewportWidth ) {
79
+ busy = false;
80
+ return;
81
+ }
82
+
83
+ ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
84
+
85
+ if (ret === false) {
86
+ busy = false;
87
+ return;
88
+ } else if (typeof ret == 'object') {
89
+ selectedOpts = $.extend(selectedOpts, ret);
90
+ }
91
+
92
+ title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
93
+
94
+ if (obj.nodeName && !selectedOpts.orig) {
95
+ selectedOpts.orig = $(obj).find("img:first").length ? $(obj).find("img:first") : $(obj);
96
+ }
97
+
98
+ if (title === '' && selectedOpts.orig) {
99
+ title = selectedOpts.orig.attr('title') || (selectedOpts.titleFromAlt ? selectedOpts.orig.attr('alt') : '');
100
+ }
101
+
102
+ href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
103
+
104
+ if ((/^(?:javascript)/i).test(href) || href == '#') {
105
+ href = null;
106
+ }
107
+
108
+ if (selectedOpts.type) {
109
+ type = selectedOpts.type;
110
+
111
+ if (!href) {
112
+ href = selectedOpts.content;
113
+ }
114
+
115
+ } else if (selectedOpts.content) {
116
+ type = 'html';
117
+
118
+ } else if ( $(obj).hasClass('iframe') ) {
119
+ type = 'iframe';
120
+
121
+ } else if (href) {
122
+ if (href.match(imgRegExp) || $(obj).hasClass("image")) {
123
+ type = 'image';
124
+
125
+ } else if (href.match(swfRegExp)) {
126
+ type = 'swf';
127
+
128
+ } else if (href.match(svgRegExp)) {
129
+ type = 'svg';
130
+
131
+ } else if (href.match(pdfRegExp)) {
132
+ type = 'pdf';
133
+
134
+ } else if (href.indexOf("#") === 0) {
135
+ type = 'inline';
136
+
137
+ } else {
138
+ type = 'ajax';
139
+ }
140
+ }
141
+
142
+ if (!type) {
143
+ _error('No content type found.');
144
+ return;
145
+ }
146
+
147
+ if ($(obj).hasClass('modal')) {
148
+ selectedOpts.modal = true;
149
+ }
150
+
151
+ if (type == 'inline') {
152
+ obj = href.substr(href.indexOf("#"));
153
+ type = $(obj).length > 0 ? 'inline' : 'ajax';
154
+ }
155
+
156
+ selectedOpts.type = type;
157
+ selectedOpts.href = href;
158
+ selectedOpts.title = title;
159
+
160
+ if (selectedOpts.autoDimensions) {
161
+ if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
162
+ selectedOpts.width = 'auto';
163
+ selectedOpts.height = 'auto';
164
+ } else {
165
+ selectedOpts.autoDimensions = false;
166
+ }
167
+ }
168
+
169
+ if (selectedOpts.modal) {
170
+ selectedOpts.overlayShow = true;
171
+ selectedOpts.hideOnOverlayClick = false;
172
+ selectedOpts.hideOnContentClick = false;
173
+ selectedOpts.enableEscapeButton = false;
174
+ selectedOpts.showCloseButton = false;
175
+ }
176
+
177
+ selectedOpts.padding = parseInt(selectedOpts.padding, 10);
178
+ selectedOpts.margin = parseInt(selectedOpts.margin, 10);
179
+
180
+ tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
181
+
182
+ $('.fancybox-inline-tmp').off('fancybox-cancel').on('fancybox-change', function() {
183
+ $(this).replaceWith(content.children());
184
+ });
185
+
186
+ switch (type) {
187
+ case 'html' :
188
+ tmp.html( selectedOpts.content );
189
+ _process_inline();
190
+ break;
191
+
192
+ case 'inline' :
193
+ if ( $(obj).parent().is('#fancybox-content') === true) {
194
+ busy = false;
195
+ return;
196
+ }
197
+
198
+ $('<div class="fancybox-inline-tmp" />')
199
+ .hide()
200
+ .insertBefore( $(obj) )
201
+ .on('fancybox-cleanup', function() {
202
+ $(this).replaceWith(content.find(obj));
203
+ }).on('fancybox-cancel', function() {
204
+ $(this).replaceWith(tmp.find(obj));
205
+ });
206
+
207
+ $(obj).appendTo(tmp);
208
+
209
+ _process_inline();
210
+ break;
211
+
212
+ case 'image':
213
+ selectedOpts.keepRatio = true;
214
+
215
+ busy = false;
216
+
217
+ $.fancybox.showActivity();
218
+
219
+ imgPreloader = new Image();
220
+
221
+ imgPreloader.onerror = function() {
222
+ _error('No image found.');
223
+ };
224
+
225
+ imgPreloader.onload = function() {
226
+ busy = true;
227
+
228
+ imgPreloader.onerror = imgPreloader.onload = null;
229
+
230
+ _process_image();
231
+ };
232
+
233
+ imgPreloader.src = href;
234
+ break;
235
+
236
+ case 'swf':
237
+ selectedOpts.scrolling = 'no';
238
+ selectedOpts.keepRatio = true;
239
+
240
+ 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>';
241
+ emb = '';
242
+
243
+ $.each(selectedOpts.swf, function(name, val) {
244
+ str += '<param name="' + name + '" value="' + val + '"></param>';
245
+ emb += ' ' + name + '="' + val + '"';
246
+ });
247
+
248
+ str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';
249
+
250
+ tmp.html(str);
251
+
252
+ _process_inline();
253
+ break;
254
+
255
+ case 'svg':
256
+ selectedOpts.scrolling = 'no';
257
+ selectedOpts.keepRatio = true;
258
+
259
+ str = '<object type="image/svg+xml" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '" data="' + href + '"></object>';
260
+
261
+ tmp.html(str);
262
+
263
+ _process_inline();
264
+ break;
265
+
266
+ case 'pdf':
267
+ selectedOpts.scrolling = 'no';
268
+ selectedOpts.enableKeyboardNav = false;
269
+ selectedOpts.showNavArrows = false;
270
+
271
+ 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>';
272
+
273
+ tmp.html(str);
274
+
275
+ _process_inline();
276
+ break;
277
+
278
+ case 'ajax':
279
+ busy = false;
280
+
281
+ $.fancybox.showActivity();
282
+
283
+ selectedOpts.ajax.win = selectedOpts.ajax.success;
284
+
285
+ ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
286
+ url : href,
287
+ data : selectedOpts.ajax.data || {},
288
+ error : function(XMLHttpRequest, textStatus, errorThrown) {
289
+ if ( XMLHttpRequest.status > 0 ) {
290
+ _error(errorThrown);
291
+ }
292
+ },
293
+ success : function(data, textStatus, XMLHttpRequest) {
294
+ var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
295
+ if (o.status == 200) {
296
+ if ( typeof selectedOpts.ajax.win == 'function' ) {
297
+ ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
298
+
299
+ if (ret === false) {
300
+ $.fancybox.hideActivity();
301
+ return;
302
+ } else if (typeof ret == 'string' || typeof ret == 'object') {
303
+ data = ret;
304
+ }
305
+ }
306
+
307
+ if ( data.indexOf("<!DOCTYPE") > -1 || data.indexOf("<html") > -1 || data.indexOf("<body") > -1 ) {
308
+ _error('Unexpected response.');
309
+ } else {
310
+ tmp.html( data );
311
+ _process_inline();
312
+ }
313
+ }
314
+ }
315
+ }));
316
+ break;
317
+
318
+ case 'iframe':
319
+ selectedOpts.enableKeyboardNav = false;
320
+ selectedOpts.showNavArrows = false;
321
+
322
+ $.fancybox.showActivity();
323
+
324
+ _show();
325
+ break;
326
+ }
327
+ },
328
+
329
+ _process_inline = function() {
330
+ var w = selectedOpts.width,
331
+ h = selectedOpts.height,
332
+ ww = $(window).width() == 0 ? window.innerWidth : $(window).width(),
333
+ wh = $(window).height() == 0 ? window.innerHeight : $(window).height();
334
+
335
+ if (w.toString().indexOf('%') > -1) {
336
+ w = parseInt( (ww - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
337
+
338
+ } else {
339
+ w = w == 'auto' ? 'auto' : w + 'px';
340
+ }
341
+
342
+ if (h.toString().indexOf('%') > -1) {
343
+ h = parseInt( (wh - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
344
+
345
+ } else {
346
+ h = h == 'auto' ? 'auto' : h + 'px';
347
+ }
348
+
349
+ tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow:' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
350
+
351
+ selectedOpts.width = tmp.width();
352
+ selectedOpts.height = tmp.height();
353
+
354
+ _show();
355
+ },
356
+
357
+ _process_image = function() {
358
+ selectedOpts.width = imgPreloader.width;
359
+ selectedOpts.height = imgPreloader.height;
360
+
361
+ $("<img />").attr({
362
+ 'id' : 'fancybox-img',
363
+ 'src' : imgPreloader.src,
364
+ 'alt' : selectedOpts.title
365
+ }).appendTo( tmp );
366
+
367
+ _show();
368
+ },
369
+
370
+ _show = function() {
371
+ var pos, equal;
372
+
373
+ if (selectedOpts.type !== 'iframe') {
374
+ $.fancybox.hideActivity();
375
+ }
376
+
377
+ if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
378
+ $('.fancybox-inline-tmp').trigger('fancybox-cancel');
379
+
380
+ busy = false;
381
+ return;
382
+ }
383
+
384
+ busy = true;
385
+
386
+ $(content.add( overlay )).off();
387
+
388
+ $(window).off("orientationchange.fb resize.fb scroll.fb");
389
+ $(document).off('keydown.fb');
390
+
391
+ if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
392
+ wrap.css('height', wrap.height());
393
+ }
394
+
395
+ currentArray = selectedArray;
396
+ currentIndex = selectedIndex;
397
+ currentOpts = selectedOpts;
398
+
399
+ if (currentOpts.overlayShow) {
400
+ overlay.css({
401
+ 'background-color' : currentOpts.overlayColor,
402
+ 'opacity' : currentOpts.overlayOpacity,
403
+ 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
404
+ 'height' : $(document).height()
405
+ });
406
+
407
+ if (!overlay.is(':visible')) {
408
+ if (isIE6) {
409
+ $('select:not(#fancybox-tmp select)').filter(function() {
410
+ return this.style.visibility !== 'hidden';
411
+ }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
412
+ this.style.visibility = 'inherit';
413
+ });
414
+ }
415
+ overlay.show();
416
+ }
417
+ } else {
418
+ overlay.hide();
419
+ }
420
+
421
+ final_pos = _get_zoom_to();
422
+
423
+ _process_title();
424
+
425
+ if (wrap.is(":visible")) {
426
+ $( close.add( nav_left ).add( nav_right ) ).hide();
427
+
428
+ pos = wrap.position(),
429
+
430
+ start_pos = {
431
+ top : pos.top,
432
+ left : pos.left,
433
+ width : wrap.width(),
434
+ height : wrap.height()
435
+ };
436
+
437
+ equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);
438
+
439
+ content.fadeTo(currentOpts.changeFade, 0.3, function() {
440
+ var finish_resizing = function() {
441
+ content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
442
+ };
443
+
444
+ $('.fancybox-inline-tmp').trigger('fancybox-change');
445
+
446
+ content
447
+ .empty()
448
+ .removeAttr('filter')
449
+ .css({
450
+ 'border-width' : currentOpts.padding,
451
+ 'width' : final_pos.width - currentOpts.padding * 2,
452
+ 'height' : currentOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
453
+ });
454
+
455
+ if (equal) {
456
+ finish_resizing();
457
+ } else {
458
+ fx.prop = 0;
459
+
460
+ $(fx).animate({prop: 1}, {
461
+ duration : currentOpts.changeSpeed,
462
+ easing : currentOpts.easingChange,
463
+ step : _draw,
464
+ complete : finish_resizing
465
+ });
466
+ }
467
+ });
468
+
469
+ return;
470
+ }
471
+
472
+ wrap.removeAttr("style");
473
+
474
+ content.css('border-width', currentOpts.padding);
475
+
476
+ if (currentOpts.transitionIn == 'elastic') {
477
+ start_pos = _get_zoom_from();
478
+
479
+ content.html( tmp.contents() );
480
+
481
+ wrap.show();
482
+
483
+ if (currentOpts.opacity) {
484
+ final_pos.opacity = 0;
485
+ }
486
+
487
+ fx.prop = 0;
488
+
489
+ $(fx).animate({prop: 1}, {
490
+ duration : currentOpts.speedIn,
491
+ easing : currentOpts.easingIn,
492
+ step : _draw,
493
+ complete : _finish
494
+ });
495
+
496
+ return;
497
+ }
498
+
499
+ if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
500
+ title.show();
501
+ }
502
+
503
+ content
504
+ .css({
505
+ 'width' : final_pos.width - currentOpts.padding * 2,
506
+ 'height' : currentOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
507
+ })
508
+ .html( tmp.contents() );
509
+
510
+ wrap
511
+ .css(final_pos)
512
+ .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
513
+ },
514
+
515
+ _format_title = function(title) {
516
+ if (title && title.length) {
517
+ if (currentOpts.titlePosition == 'float') {
518
+ 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">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
519
+ }
520
+
521
+ return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
522
+ }
523
+
524
+ return false;
525
+ },
526
+
527
+ _process_title = function() {
528
+ titleStr = currentOpts.title || '';
529
+ titleHeight = 0;
530
+
531
+ title
532
+ .empty()
533
+ .removeAttr('style')
534
+ .removeClass();
535
+
536
+ if (currentOpts.titleShow === false) {
537
+ title.hide();
538
+ return;
539
+ }
540
+
541
+ titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
542
+
543
+ if (!titleStr || titleStr === '') {
544
+ title.hide();
545
+ return;
546
+ }
547
+
548
+ title
549
+ .addClass('fancybox-title-' + currentOpts.titlePosition)
550
+ .html( titleStr )
551
+ .appendTo( 'body' )
552
+ .show();
553
+
554
+ switch (currentOpts.titlePosition) {
555
+ case 'inside':
556
+ title
557
+ .css({
558
+ 'width' : final_pos.width - (currentOpts.padding * 2),
559
+ 'marginLeft' : currentOpts.padding,
560
+ 'marginRight' : currentOpts.padding
561
+ }).appendTo( outer );
562
+
563
+ titleHeight = title.outerHeight(true);
564
+
565
+ final_pos.height += titleHeight;
566
+ break;
567
+
568
+ case 'over':
569
+ title
570
+ .css({
571
+ 'marginLeft' : currentOpts.padding,
572
+ 'width' : final_pos.width - (currentOpts.padding * 2),
573
+ 'bottom' : currentOpts.padding
574
+ })
575
+ .appendTo( outer );
576
+ break;
577
+
578
+ case 'float':
579
+ title
580
+ .css('left', parseInt( ( title.width() - final_pos.width ) / 2, 10 ) * -1 )
581
+ .appendTo( outer );
582
+ break;
583
+
584
+ default:
585
+ title
586
+ .css({
587
+ 'width' : final_pos.width - (currentOpts.padding * 2),
588
+ 'paddingLeft' : currentOpts.padding,
589
+ 'paddingRight' : currentOpts.padding
590
+ })
591
+ .appendTo( wrap );
592
+ break;
593
+ }
594
+
595
+ title.hide();
596
+ },
597
+
598
+ _set_navigation = function() {
599
+ if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
600
+ $(document).on('keydown.fb', function(e) {
601
+ if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
602
+ e.preventDefault();
603
+ $.fancybox.close();
604
+ } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
605
+ e.preventDefault();
606
+ $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
607
+ } else if ((e.keyCode == 9) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
608
+ e.preventDefault();
609
+ $.fancybox[ e.shiftKey ? 'prev' : 'next']();
610
+ }
611
+ });
612
+ }
613
+
614
+ if (!currentOpts.showNavArrows) {
615
+ nav_left.hide();
616
+ nav_right.hide();
617
+ return;
618
+ }
619
+
620
+ if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
621
+ nav_left.show();
622
+ }
623
+
624
+ if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
625
+ nav_right.show();
626
+ }
627
+ },
628
+
629
+ _finish = function () {
630
+ if (isIE) {
631
+ content.css('filter', 0);
632
+ wrap.css('filter', 0);
633
+ }
634
+
635
+ if (currentOpts.autoDimensions) {
636
+ content.css('height','auto');
637
+ }
638
+
639
+ wrap.css('height', 'auto');
640
+
641
+ if (titleStr && titleStr.length) {
642
+ title.show();
643
+ }
644
+
645
+ if (currentOpts.showCloseButton) {
646
+ close.show();
647
+ }
648
+
649
+ _set_navigation();
650
+
651
+ if (currentOpts.hideOnContentClick) {
652
+ content.on('click', $.fancybox.close);
653
+ }
654
+
655
+ if (currentOpts.hideOnOverlayClick) {
656
+ overlay.on('click', $.fancybox.close);
657
+ }
658
+
659
+ if (currentOpts.autoResize) {
660
+ $(window).on("resize.fb", $.fancybox.resize);
661
+ }
662
+
663
+ if (currentOpts.centerOnScroll && !isTouch) {
664
+ $(window).on("scroll.fb", $.fancybox.center);
665
+ }
666
+
667
+ if ($.fn.mousewheel) {
668
+ wrap.on('mousewheel.fb', function(e, delta) {
669
+ if (busy) {
670
+ e.preventDefault();
671
+ } else if ( currentOpts.type == 'image' && ( $(e.target).outerHeight() == 0 || $(e.target).prop('scrollHeight') === $(e.target).outerHeight() ) ) {
672
+ e.preventDefault();
673
+ $.fancybox[ delta > 0 ? 'prev' : 'next' ]();
674
+ }
675
+ });
676
+ }
677
+
678
+ if (currentOpts.type == 'iframe') {
679
+ $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '"' + (navigator.userAgent.match(/msie [6]/i) ? ' allowtransparency="true""' : '')
680
+ + ' style="border:0;margin:0;overflow:' + (currentOpts.scrolling == 'auto' ? 'auto' : (currentOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + '" src="'
681
+ + currentOpts.href + '"' + (false === currentOpts.allowfullscreen ? '' : ' allowfullscreen') + ' allow="autoplay; encrypted-media" tabindex="999"></iframe>')
682
+ .appendTo(content).on('load',function() {
683
+ $.fancybox.hideActivity();
684
+ }).focus();
685
+ }
686
+
687
+ wrap.show();
688
+
689
+ busy = false;
690
+
691
+ $.fancybox.center();
692
+
693
+ currentOpts.onComplete(currentArray, currentIndex, currentOpts);
694
+
695
+ if (currentArray.length > 1) {
696
+ _preload_next();
697
+ _preload_prev();
698
+ }
699
+ },
700
+
701
+ _preload_next = function() {
702
+ var pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex + 1;
703
+
704
+ if ( pos >= currentArray.length ) {
705
+ if (currentOpts.cyclic) {
706
+ pos = 0;
707
+ } else {
708
+ return;
709
+ }
710
+ }
711
+
712
+ if ( pos == currentIndex ) {
713
+ currentOpts.enableKeyboardNav = false;
714
+ wrap.off('mousewheel.fb');
715
+ nav_right.hide();
716
+ return;
717
+ }
718
+
719
+ if ( _preload_image( pos ) ) {
720
+ return;
721
+ } else {
722
+ _preload_next( pos + 1 );
723
+ }
724
+ },
725
+
726
+ _preload_prev = function() {
727
+ var pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex - 1;
728
+
729
+ if ( pos < 0 ) {
730
+ if (currentOpts.cyclic) {
731
+ pos = currentArray.length - 1;
732
+ } else {
733
+ return;
734
+ }
735
+ }
736
+
737
+ if ( pos == currentIndex ) {
738
+ currentOpts.enableKeyboardNav = false;
739
+ wrap.off('mousewheel.fb');
740
+ nav_left.hide();
741
+ return;
742
+ }
743
+
744
+ if ( _preload_image( pos ) ) {
745
+ return;
746
+ } else {
747
+ _preload_prev( pos - 1 );
748
+ }
749
+ },
750
+
751
+ _preload_image = function(pos) {
752
+ var objNext, obj = currentArray[ pos ];
753
+
754
+ if ( typeof obj !== 'undefined' && typeof obj.href !== 'undefined' && obj.href !== currentOpts.href && (obj.href.match(imgRegExp) || $(obj).hasClass("image")) ) {
755
+ objNext = new Image();
756
+ objNext.src = obj.href;
757
+ return true;
758
+ } else {
759
+ return false;
760
+ }
761
+ },
762
+
763
+ _draw = function(pos) {
764
+ var dim = {
765
+ width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
766
+ height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),
767
+
768
+ top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
769
+ left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
770
+ };
771
+
772
+ if (typeof final_pos.opacity !== 'undefined') {
773
+ dim.opacity = pos < 0.5 ? 0.5 : pos;
774
+ }
775
+
776
+ wrap.css(dim);
777
+
778
+ content.css({
779
+ 'width' : dim.width - currentOpts.padding * 2,
780
+ 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
781
+ });
782
+ },
783
+
784
+ _get_viewport = function() {
785
+ var w = !isTouch && window.innerWidth && document.documentElement.clientWidth ?
786
+ Math.min(window.innerWidth, document.documentElement.clientWidth) :
787
+ window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth,
788
+ h = !isTouch && window.innerHeight && document.documentElement.clientHeight ?
789
+ Math.min(window.innerHeight, document.documentElement.clientHeight) :
790
+ window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight,
791
+ margin;
792
+
793
+ margin = arguments[0] === true ? 0 : currentOpts.margin;
794
+
795
+ return [
796
+ w - (margin * 2),
797
+ h - (margin * 2),
798
+ $(document).scrollLeft() + margin,
799
+ $(document).scrollTop() + margin
800
+ ];
801
+ },
802
+
803
+ _get_zoom_to = function () {
804
+ var view = _get_viewport(),
805
+ to = {},
806
+ double_padding = currentOpts.padding * 2,
807
+ ratio;
808
+
809
+ if (currentOpts.width.toString().indexOf('%') > -1) {
810
+ to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
811
+ } else {
812
+ to.width = currentOpts.width + double_padding;
813
+ }
814
+
815
+ if (currentOpts.height.toString().indexOf('%') > -1) {
816
+ to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
817
+ } else {
818
+ to.height = currentOpts.height + double_padding;
819
+ }
820
+
821
+ if (currentOpts.autoScale && (to.width > view[0] || to.height > view[1])) {
822
+ if (currentOpts.keepRatio) {
823
+ ratio = currentOpts.width / currentOpts.height;
824
+
825
+ if ((to.width ) > view[0]) {
826
+ to.width = view[0];
827
+ to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
828
+ }
829
+
830
+ if ((to.height) > view[1]) {
831
+ to.height = view[1];
832
+ to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
833
+ }
834
+ } else {
835
+ to.width = Math.min(to.width, view[0]);
836
+ to.height = Math.min(to.height, view[1]);
837
+ }
838
+ }
839
+
840
+ to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
841
+ to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);
842
+
843
+ return to;
844
+ },
845
+
846
+ _get_obj_pos = function(obj) {
847
+ var pos = obj.offset();
848
+
849
+ pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
850
+ pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;
851
+
852
+ pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
853
+ pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;
854
+
855
+ pos.width = obj.width();
856
+ pos.height = obj.height();
857
+
858
+ return pos;
859
+ },
860
+
861
+ _get_zoom_from = function() {
862
+ var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
863
+ from = {},
864
+ pos,
865
+ view;
866
+
867
+ if (orig && orig.length) {
868
+ pos = _get_obj_pos(orig);
869
+
870
+ from = {
871
+ width : pos.width + (currentOpts.padding * 2),
872
+ height : pos.height + (currentOpts.padding * 2),
873
+ top : pos.top - currentOpts.padding - 20,
874
+ left : pos.left - currentOpts.padding - 20
875
+ };
876
+
877
+ } else {
878
+ view = _get_viewport();
879
+
880
+ from = {
881
+ width : currentOpts.padding * 2,
882
+ height : currentOpts.padding * 2,
883
+ top : parseInt((view[3] + view[1]) * 0.5, 10),
884
+ left : parseInt((view[2] + view[0]) * 0.5, 10)
885
+ };
886
+ }
887
+
888
+ return from;
889
+ },
890
+
891
+ _animate_loading = function() {
892
+ if (!loading.is(':visible')){
893
+ clearInterval(loadingTimer);
894
+ return;
895
+ }
896
+
897
+ $('div', loading).css('top', (loadingFrame * - 40 ) + 'px');
898
+
899
+ loadingFrame = (loadingFrame + 1) % 12;
900
+ };
901
+
902
+ /*
903
+ * Public methods
904
+ */
905
+
906
+ $.fn.fancybox = function(options) {
907
+ if (!$(this).length) {
908
+ return this;
909
+ }
910
+
911
+ $(this)
912
+ .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
913
+ .off('click.fb')
914
+ .on('click.fb', function(e) {
915
+ e.preventDefault();
916
+
917
+ if (busy) {
918
+ return;
919
+ }
920
+
921
+ busy = true;
922
+
923
+ $(this).blur();
924
+
925
+ selectedArray = [];
926
+ selectedIndex = 0;
927
+
928
+ var rel = $(this).attr('rel') || '';
929
+
930
+ if (rel == '' || rel.replace(/alternate|external|help|license|nofollow|noreferrer|noopener|\s+/gi,'') == '') {
931
+ selectedArray.push(this);
932
+ } else {
933
+ selectedArray = $('a[rel="' + rel + '"], area[rel="' + rel + '"]');
934
+ selectedIndex = selectedArray.index( this );
935
+ }
936
+
937
+ _start();
938
+
939
+ return false;
940
+ });
941
+
942
+ return this;
943
+ };
944
+
945
+ $.fancybox = function(obj) {
946
+ var opts;
947
+
948
+ if (busy) {
949
+ return;
950
+ }
951
+
952
+ busy = true;
953
+ opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
954
+
955
+ selectedArray = [];
956
+ selectedIndex = parseInt(opts.index, 10) || 0;
957
+
958
+ if ( $.isArray(obj) ) {
959
+ for (var i = 0, j = obj.length; i < j; i++) {
960
+ if (typeof obj[i] == 'object') {
961
+ $(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
962
+ } else {
963
+ obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
964
+ }
965
+ }
966
+
967
+ selectedArray = jQuery.merge(selectedArray, obj);
968
+
969
+ } else {
970
+ if ( typeof obj == 'object' ) {
971
+ $(obj).data('fancybox', $.extend({}, opts, obj));
972
+ } else {
973
+ obj = $({}).data('fancybox', $.extend({content : obj}, opts));
974
+ }
975
+
976
+ selectedArray.push(obj);
977
+ }
978
+
979
+ if (selectedIndex > selectedArray.length || selectedIndex < 0) {
980
+ selectedIndex = 0;
981
+ }
982
+
983
+ _start();
984
+ };
985
+
986
+ $.fancybox.showActivity = function() {
987
+ clearInterval(loadingTimer);
988
+
989
+ loading.show();
990
+ loadingTimer = setInterval( _animate_loading, 66 );
991
+ };
992
+
993
+ $.fancybox.hideActivity = function() {
994
+ loading.hide();
995
+ };
996
+
997
+ $.fancybox.next = function() {
998
+ var obj, pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex + 1;
999
+
1000
+ if (pos >= currentArray.length) {
1001
+ if (currentOpts.cyclic) {
1002
+ pos = 0;
1003
+ } else {
1004
+ return;
1005
+ }
1006
+ }
1007
+
1008
+ obj = currentArray[pos];
1009
+
1010
+ if ( pos != currentIndex && typeof obj !== 'undefined' && typeof obj.href !== 'undefined' && obj.href === currentOpts.href ) {
1011
+ $.fancybox.next( pos + 1 );
1012
+ } else {
1013
+ $.fancybox.pos( pos );
1014
+ }
1015
+
1016
+ return;
1017
+ };
1018
+
1019
+ $.fancybox.prev = function() {
1020
+ var obj, pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex - 1;
1021
+
1022
+ if (pos < 0) {
1023
+ if (currentOpts.cyclic) {
1024
+ pos = currentArray.length - 1;
1025
+ } else {
1026
+ return;
1027
+ }
1028
+ }
1029
+
1030
+ obj = currentArray[pos];
1031
+
1032
+ if ( pos != currentIndex && typeof obj !== 'undefined' && typeof obj.href !== 'undefined' && obj.href === currentOpts.href ) {
1033
+ $.fancybox.prev( pos - 1 );
1034
+ } else {
1035
+ $.fancybox.pos( pos );
1036
+ }
1037
+
1038
+ return;
1039
+ };
1040
+
1041
+ $.fancybox.pos = function(pos) {
1042
+ if (busy) {
1043
+ return;
1044
+ }
1045
+
1046
+ pos = parseInt(pos);
1047
+
1048
+ selectedArray = currentArray;
1049
+
1050
+ if (pos > -1 && pos < currentArray.length) {
1051
+ selectedIndex = pos;
1052
+ _start();
1053
+ }
1054
+
1055
+ return;
1056
+ };
1057
+
1058
+ $.fancybox.cancel = function() {
1059
+ if (busy) {
1060
+ return;
1061
+ }
1062
+
1063
+ busy = true;
1064
+
1065
+ $('.fancybox-inline-tmp').trigger('fancybox-cancel');
1066
+
1067
+ _abort();
1068
+
1069
+ selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
1070
+
1071
+ busy = false;
1072
+ };
1073
+
1074
+ // Note: within an iframe use - parent.$.fancybox.close();
1075
+ $.fancybox.close = function() {
1076
+ if (busy || wrap.is(':hidden')) {
1077
+ return;
1078
+ }
1079
+
1080
+ busy = true;
1081
+
1082
+ if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
1083
+ busy = false;
1084
+ return;
1085
+ }
1086
+
1087
+ _abort();
1088
+
1089
+ $(close.add( nav_left ).add( nav_right )).hide();
1090
+
1091
+ $(content.add( overlay )).off();
1092
+
1093
+ $(window).off("orientationchange.fb resize.fb scroll.fb mousewheel.fb");
1094
+ $(document).off('keydown.fb');
1095
+
1096
+ // This helps IE
1097
+ if (isIE) {
1098
+ content.find('iframe#fancybox-frame').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : '//about:blank');
1099
+ }
1100
+
1101
+ if (currentOpts.titlePosition !== 'inside') {
1102
+ title.empty();
1103
+ }
1104
+
1105
+ wrap.stop();
1106
+
1107
+ function _cleanup() {
1108
+ overlay.fadeOut('fast');
1109
+
1110
+ title.empty().hide();
1111
+ wrap.hide();
1112
+
1113
+ $('.fancybox-inline-tmp').trigger('fancybox-cleanup');
1114
+
1115
+ content.empty();
1116
+
1117
+ currentOpts.onClosed(currentArray, currentIndex, currentOpts);
1118
+
1119
+ currentArray = selectedOpts = [];
1120
+ currentIndex = selectedIndex = 0;
1121
+ currentOpts = selectedOpts = {};
1122
+
1123
+ busy = false;
1124
+ }
1125
+
1126
+ if (currentOpts.transitionOut == 'elastic') {
1127
+ start_pos = _get_zoom_from();
1128
+
1129
+ var pos = wrap.position();
1130
+
1131
+ final_pos = {
1132
+ top : pos.top ,
1133
+ left : pos.left,
1134
+ width : wrap.width(),
1135
+ height : wrap.height()
1136
+ };
1137
+
1138
+ if (currentOpts.opacity) {
1139
+ final_pos.opacity = 1;
1140
+ }
1141
+
1142
+ title.empty().hide();
1143
+
1144
+ fx.prop = 1;
1145
+
1146
+ $(fx).animate({ prop: 0 }, {
1147
+ duration : currentOpts.speedOut,
1148
+ easing : currentOpts.easingOut,
1149
+ step : _draw,
1150
+ complete : _cleanup
1151
+ });
1152
+
1153
+ } else {
1154
+ wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
1155
+ }
1156
+ };
1157
+
1158
+ $.fancybox.resize = function() {
1159
+ var pos;
1160
+
1161
+ clearTimeout( resize_timeout );
1162
+
1163
+ resize_timeout = setTimeout( function() {
1164
+ var finish_resizing = function() {
1165
+ if (selectedOpts.autoDimensions) {
1166
+ content.css('height','auto');
1167
+ }
1168
+
1169
+ wrap.css('height', 'auto');
1170
+
1171
+ if (titleStr && titleStr.length) {
1172
+ title.show();
1173
+ }
1174
+
1175
+ busy = false;
1176
+
1177
+ $.fancybox.center(true);
1178
+ };
1179
+
1180
+ if (overlay.is(':visible')) {
1181
+ overlay.css('height', $(document).height());
1182
+ }
1183
+
1184
+ pos = wrap.position(),
1185
+
1186
+ start_pos = {
1187
+ top : pos.top,
1188
+ left : pos.left,
1189
+ width : wrap.width(),
1190
+ height : wrap.height()
1191
+ };
1192
+
1193
+ final_pos = _get_zoom_to();
1194
+
1195
+ busy = true;
1196
+
1197
+ _process_title();
1198
+
1199
+ fx.prop = 0;
1200
+
1201
+ $(fx).animate({prop: 1}, {
1202
+ duration : currentOpts.changeSpeed,
1203
+ easing : currentOpts.easingChange,
1204
+ step : _draw,
1205
+ complete : finish_resizing
1206
+ });
1207
+ }, 500 );
1208
+ };
1209
+
1210
+ $.fancybox.center = function() {
1211
+ var view, align;
1212
+
1213
+ if (busy) {
1214
+ return;
1215
+ }
1216
+
1217
+ align = arguments[0] === true ? 1 : 0;
1218
+ view = _get_viewport(true);
1219
+
1220
+ if (!align && ((wrap.width() + 40) > view[0] || (wrap.height() + 40) > view[1])) {
1221
+ return;
1222
+ }
1223
+
1224
+ wrap
1225
+ .stop()
1226
+ .animate({
1227
+ 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
1228
+ 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
1229
+ }, typeof arguments[0] == 'number' ? arguments[0] : 300);
1230
+ };
1231
+
1232
+ $.fancybox.init = function() {
1233
+ if ($("#fancybox-wrap").length) {
1234
+ return;
1235
+ }
1236
+
1237
+ $('body').append(
1238
+ tmp = $('<div id="fancybox-tmp"></div>'),
1239
+ loading = $('<div id="fancybox-loading"><div></div></div>'),
1240
+ overlay = $('<div id="fancybox-overlay"></div>'),
1241
+ wrap = $('<div id="fancybox-wrap"></div>')
1242
+ );
1243
+
1244
+ outer = $('<div id="fancybox-outer"></div>')
1245
+ .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>')
1246
+ .appendTo( wrap );
1247
+
1248
+ outer.append(
1249
+ content = $('<div id="fancybox-content"></div>'),
1250
+ close = $('<a id="fancybox-close" title="Close" class="fancy-ico" href="javascript:;"></a>'),
1251
+ title = $('<div id="fancybox-title"></div>'),
1252
+
1253
+ nav_left = $('<a id="fancybox-left" title="Previous" href="javascript:;"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
1254
+ nav_right = $('<a id="fancybox-right" title="Next" href="javascript:;"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
1255
+ );
1256
+
1257
+ close.click($.fancybox.close);
1258
+ loading.click($.fancybox.cancel);
1259
+
1260
+ nav_left.click(function(e) {
1261
+ e.preventDefault();
1262
+ $.fancybox.prev();
1263
+ });
1264
+
1265
+ nav_right.click(function(e) {
1266
+ e.preventDefault();
1267
+ $.fancybox.next();
1268
+ });
1269
+
1270
+ if (isIE) {
1271
+ wrap.addClass('fancybox-ie');
1272
+ }
1273
+
1274
+ if (isIE6) {
1275
+ loading.addClass('fancybox-ie6');
1276
+ wrap.addClass('fancybox-ie6');
1277
+
1278
+ $('<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(outer);
1279
+ }
1280
+ };
1281
+
1282
+ $.fn.fancybox.defaults = {
1283
+ padding : 10,
1284
+ margin : 40,
1285
+ opacity : false,
1286
+ modal : false,
1287
+ cyclic : false,
1288
+ allowfullscreen : false,
1289
+ scrolling : 'auto', // 'auto', 'yes' or 'no'
1290
+
1291
+ width : 560,
1292
+ height : 340,
1293
+
1294
+ autoScale : true,
1295
+ autoDimensions : true,
1296
+ centerOnScroll : false,
1297
+ autoResize : true,
1298
+ keepRatio : false,
1299
+ minViewportWidth : 0,
1300
+
1301
+ ajax : {},
1302
+ swf : { wmode: 'opaque' },
1303
+ svg : { wmode: 'opaque' },
1304
+
1305
+ hideOnOverlayClick : true,
1306
+ hideOnContentClick : false,
1307
+
1308
+ overlayShow : true,
1309
+ overlayOpacity : 0.7,
1310
+ overlayColor : '#777',
1311
+
1312
+ titleShow : true,
1313
+ titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
1314
+ titleFormat : null,
1315
+ titleFromAlt : true,
1316
+
1317
+ transitionIn : 'fade', // 'elastic', 'fade' or 'none'
1318
+ transitionOut : 'fade', // 'elastic', 'fade' or 'none'
1319
+
1320
+ speedIn : 300,
1321
+ speedOut : 300,
1322
+
1323
+ changeSpeed : 300,
1324
+ changeFade : 'fast',
1325
+
1326
+ easingIn : 'swing',
1327
+ easingOut : 'swing',
1328
+
1329
+ showCloseButton : true,
1330
+ showNavArrows : true,
1331
+ enableEscapeButton : true,
1332
+ enableKeyboardNav : true,
1333
+
1334
+ onStart : function(){},
1335
+ onCancel : function(){},
1336
+ onComplete : function(){},
1337
+ onCleanup : function(){},
1338
+ onClosed : function(){},
1339
+ onError : function(){}
1340
+ };
1341
+
1342
+ $(document).ready(function() {
1343
+ $.fancybox.init();
1344
+ });
1345
+
1346
+ })(jQuery);
fancybox/1.3.26/jquery.fancybox.min.css ADDED
@@ -0,0 +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;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:none;}#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}#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:focus,#fancybox-right:focus{outline:none;background:initial;}#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:none;border-collapse:collapse;width:auto;}#fancybox-title-float-wrap tr,#fancybox-title-float-wrap td{border:none;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') 0px -40px;}#fancybox-title-float-right{padding:0 0 0 15px;background:url('fancybox.png') -55px -90px no-repeat;}
fancybox/1.3.26/jquery.fancybox.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t,i,n,o,a,d,r,c,s,l,h,f,p,g,b=0,u={},y=[],m=0,w={},v=[],x=null,_=new Image,k=/\.(jpg|gif|png|bmp|jpeg|webp)(.*)?$/i,C=/[^\.]\.(swf)\s*$/i,I=/[^\.]\.(svg)\s*$/i,j=/[^\.]\.(pdf)\s*$/i,O=1,T=0,N="",A=!1,E=e.extend(e("<div/>")[0],{prop:0}),S=/MSIE|Trident/.test(window.navigator.userAgent),D=S&&!window.XMLHttpRequest,W=void 0!==document.createTouch;_abort=function(){e.fancybox.hideActivity(),_.onerror=_.onload=null,x&&x.abort(),t.empty()},_error=function(i){if(!1===u.onError(y,b,u))return e.fancybox.hideActivity(),void(A=!1);void 0===i&&(i="Please try again later."),u.titleShow=!1,u.width="auto",u.height="auto",t.html('<p id="fancybox-error">The requested content cannot be loaded.<br />'+i+"</p>"),_process_inline()},_start=function(){var i,n,o,a,r,c,s=y[b];if(_abort(),u=e.extend({},e.fn.fancybox.defaults,void 0===e(s).data("fancybox")?u:e(s).data("fancybox")),document.documentElement.clientWidth<u.minViewportWidth)A=!1;else if(!1!==(c=u.onStart(y,b,u)))if("object"==typeof c&&(u=e.extend(u,c)),o=u.title||(s.nodeName?e(s).attr("title"):s.title)||"",s.nodeName&&!u.orig&&(u.orig=e(s).find("img:first").length?e(s).find("img:first"):e(s)),""===o&&u.orig&&(o=u.orig.attr("title")||(u.titleFromAlt?u.orig.attr("alt"):"")),i=u.href||(s.nodeName?e(s).attr("href"):s.href)||null,(/^(?:javascript)/i.test(i)||"#"==i)&&(i=null),u.type?(n=u.type,i||(i=u.content)):u.content?n="html":e(s).hasClass("iframe")?n="iframe":i&&(n=i.match(k)||e(s).hasClass("image")?"image":i.match(C)?"swf":i.match(I)?"svg":i.match(j)?"pdf":0===i.indexOf("#")?"inline":"ajax"),n)switch(e(s).hasClass("modal")&&(u.modal=!0),"inline"==n&&(s=i.substr(i.indexOf("#")),n=e(s).length>0?"inline":"ajax"),u.type=n,u.href=i,u.title=o,u.autoDimensions&&("html"==u.type||"inline"==u.type||"ajax"==u.type?(u.width="auto",u.height="auto"):u.autoDimensions=!1),u.modal&&(u.overlayShow=!0,u.hideOnOverlayClick=!1,u.hideOnContentClick=!1,u.enableEscapeButton=!1,u.showCloseButton=!1),u.padding=parseInt(u.padding,10),u.margin=parseInt(u.margin,10),t.css("padding",u.padding+u.margin),e(".fancybox-inline-tmp").off("fancybox-cancel").on("fancybox-change",(function(){e(this).replaceWith(d.children())})),n){case"html":t.html(u.content),_process_inline();break;case"inline":if(!0===e(s).parent().is("#fancybox-content"))return void(A=!1);e('<div class="fancybox-inline-tmp" />').hide().insertBefore(e(s)).on("fancybox-cleanup",(function(){e(this).replaceWith(d.find(s))})).on("fancybox-cancel",(function(){e(this).replaceWith(t.find(s))})),e(s).appendTo(t),_process_inline();break;case"image":u.keepRatio=!0,A=!1,e.fancybox.showActivity(),(_=new Image).onerror=function(){_error("No image found.")},_.onload=function(){A=!0,_.onerror=_.onload=null,_process_image()},_.src=i;break;case"swf":u.scrolling="no",u.keepRatio=!0,a='<object type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+u.width+'" height="'+u.height+'"><param name="movie" value="'+i+'"></param>',r="",e.each(u.swf,(function(e,t){a+='<param name="'+e+'" value="'+t+'"></param>',r+=" "+e+'="'+t+'"'})),a+='<embed src="'+i+'" type="application/x-shockwave-flash" width="'+u.width+'" height="'+u.height+'"'+r+"></embed></object>",t.html(a),_process_inline();break;case"svg":u.scrolling="no",u.keepRatio=!0,a='<object type="image/svg+xml" width="'+u.width+'" height="'+u.height+'" data="'+i+'"></object>',t.html(a),_process_inline();break;case"pdf":u.scrolling="no",u.enableKeyboardNav=!1,u.showNavArrows=!1,a='<object type="application/pdf" width="100%" height="100%" data="'+i+'"><a href="'+i+'" style="display:block;position:absolute;top:48%;width:100%;text-align:center">'+e(s).html()+"</a></object>",t.html(a),_process_inline();break;case"ajax":A=!1,e.fancybox.showActivity(),u.ajax.win=u.ajax.success,x=e.ajax(e.extend({},u.ajax,{url:i,data:u.ajax.data||{},error:function(e,t,i){e.status>0&&_error(i)},success:function(n,o,a){if(200==("object"==typeof a?a:x).status){if("function"==typeof u.ajax.win){if(!1===(c=u.ajax.win(i,n,o,a)))return void e.fancybox.hideActivity();"string"!=typeof c&&"object"!=typeof c||(n=c)}n.indexOf("<!DOCTYPE")>-1||n.indexOf("<html")>-1||n.indexOf("<body")>-1?_error("Unexpected response."):(t.html(n),_process_inline())}}}));break;case"iframe":u.enableKeyboardNav=!1,u.showNavArrows=!1,e.fancybox.showActivity(),_show();break}else _error("No content type found.");else A=!1},_process_inline=function(){var i=u.width,n=u.height,o=0==e(window).width()?window.innerWidth:e(window).width(),a=0==e(window).height()?window.innerHeight:e(window).height();i=i.toString().indexOf("%")>-1?parseInt((o-2*u.margin)*parseFloat(i)/100,10)+"px":"auto"==i?"auto":i+"px",n=n.toString().indexOf("%")>-1?parseInt((a-2*u.margin)*parseFloat(n)/100,10)+"px":"auto"==n?"auto":n+"px",t.wrapInner('<div style="width:'+i+";height:"+n+";overflow:"+("auto"==u.scrolling?"auto":"yes"==u.scrolling?"scroll":"hidden")+';position:relative;"></div>'),u.width=t.width(),u.height=t.height(),_show()},_process_image=function(){u.width=_.width,u.height=_.height,e("<img />").attr({id:"fancybox-img",src:_.src,alt:u.title}).appendTo(t),_show()},_show=function(){var i,a;return"iframe"!==u.type&&e.fancybox.hideActivity(),o.is(":visible")&&!1===w.onCleanup(v,m,w)?(e(".fancybox-inline-tmp").trigger("fancybox-cancel"),void(A=!1)):(A=!0,e(d.add(n)).off(),e(window).off("orientationchange.fb resize.fb scroll.fb"),e(document).off("keydown.fb"),o.is(":visible")&&"outside"!==w.titlePosition&&o.css("height",o.height()),v=y,m=b,(w=u).overlayShow?(n.css({"background-color":w.overlayColor,opacity:w.overlayOpacity,cursor:w.hideOnOverlayClick?"pointer":"auto",height:e(document).height()}),n.is(":visible")||(D&&e("select:not(#fancybox-tmp select)").filter((function(){return"hidden"!==this.style.visibility})).css({visibility:"hidden"}).one("fancybox-cleanup",(function(){this.style.visibility="inherit"})),n.show())):n.hide(),g=_get_zoom_to(),_process_title(),o.is(":visible")?(e(r.add(s).add(l)).hide(),i=o.position(),p={top:i.top,left:i.left,width:o.width(),height:o.height()},a=p.width==g.width&&p.height==g.height,void d.fadeTo(w.changeFade,.3,(function(){var i=function(){d.html(t.contents()).fadeTo(w.changeFade,1,_finish)};e(".fancybox-inline-tmp").trigger("fancybox-change"),d.empty().removeAttr("filter").css({"border-width":w.padding,width:g.width-2*w.padding,height:w.autoDimensions?"auto":g.height-T-2*w.padding}),a?i():(E.prop=0,e(E).animate({prop:1},{duration:w.changeSpeed,easing:w.easingChange,step:_draw,complete:i}))}))):(o.removeAttr("style"),d.css("border-width",w.padding),"elastic"==w.transitionIn?(p=_get_zoom_from(),d.html(t.contents()),o.show(),w.opacity&&(g.opacity=0),E.prop=0,void e(E).animate({prop:1},{duration:w.speedIn,easing:w.easingIn,step:_draw,complete:_finish})):("inside"==w.titlePosition&&T>0&&c.show(),d.css({width:g.width-2*w.padding,height:w.autoDimensions?"auto":g.height-T-2*w.padding}).html(t.contents()),void o.css(g).fadeIn("none"==w.transitionIn?0:w.speedIn,_finish))))},_format_title=function(e){return!(!e||!e.length)&&("float"==w.titlePosition?'<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">'+e+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+w.titlePosition+'">'+e+"</div>")},_process_title=function(){if(N=w.title||"",T=0,c.empty().removeAttr("style").removeClass(),!1!==w.titleShow)if((N=e.isFunction(w.titleFormat)?w.titleFormat(N,v,m,w):_format_title(N))&&""!==N){switch(c.addClass("fancybox-title-"+w.titlePosition).html(N).appendTo("body").show(),w.titlePosition){case"inside":c.css({width:g.width-2*w.padding,marginLeft:w.padding,marginRight:w.padding}).appendTo(a),T=c.outerHeight(!0),g.height+=T;break;case"over":c.css({marginLeft:w.padding,width:g.width-2*w.padding,bottom:w.padding}).appendTo(a);break;case"float":c.css("left",-1*parseInt((c.width()-g.width)/2,10)).appendTo(a);break;default:c.css({width:g.width-2*w.padding,paddingLeft:w.padding,paddingRight:w.padding}).appendTo(o);break}c.hide()}else c.hide();else c.hide()},_set_navigation=function(){if((w.enableEscapeButton||w.enableKeyboardNav)&&e(document).on("keydown.fb",(function(t){27==t.keyCode&&w.enableEscapeButton?(t.preventDefault(),e.fancybox.close()):37!=t.keyCode&&39!=t.keyCode||!w.enableKeyboardNav||"INPUT"===t.target.tagName||"TEXTAREA"===t.target.tagName||"SELECT"===t.target.tagName?9==t.keyCode&&w.enableKeyboardNav&&"INPUT"!==t.target.tagName&&"TEXTAREA"!==t.target.tagName&&"SELECT"!==t.target.tagName&&(t.preventDefault(),e.fancybox[t.shiftKey?"prev":"next"]()):(t.preventDefault(),e.fancybox[37==t.keyCode?"prev":"next"]())})),!w.showNavArrows)return s.hide(),void l.hide();(w.cyclic&&v.length>1||0!==m)&&s.show(),(w.cyclic&&v.length>1||m!=v.length-1)&&l.show()},_finish=function(){S&&(d.css("filter",0),o.css("filter",0)),w.autoDimensions&&d.css("height","auto"),o.css("height","auto"),N&&N.length&&c.show(),w.showCloseButton&&r.show(),_set_navigation(),w.hideOnContentClick&&d.on("click",e.fancybox.close),w.hideOnOverlayClick&&n.on("click",e.fancybox.close),w.autoResize&&e(window).on("resize.fb",e.fancybox.resize),w.centerOnScroll&&!W&&e(window).on("scroll.fb",e.fancybox.center),e.fn.mousewheel&&o.on("mousewheel.fb",(function(t,i){A?t.preventDefault():"image"!=w.type||0!=e(t.target).outerHeight()&&e(t.target).prop("scrollHeight")!==e(t.target).outerHeight()||(t.preventDefault(),e.fancybox[i>0?"prev":"next"]())})),"iframe"==w.type&&e('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'"'+(navigator.userAgent.match(/msie [6]/i)?' allowtransparency="true""':"")+' style="border:0;margin:0;overflow:'+("auto"==w.scrolling?"auto":"yes"==w.scrolling?"scroll":"hidden")+'" src="'+w.href+'"'+(!1===w.allowfullscreen?"":" allowfullscreen")+' allow="autoplay; encrypted-media" tabindex="999"></iframe>').appendTo(d).on("load",(function(){e.fancybox.hideActivity()})).focus(),o.show(),A=!1,e.fancybox.center(),w.onComplete(v,m,w),v.length>1&&(_preload_next(),_preload_prev())},_preload_next=function(){var e="number"==typeof arguments[0]?arguments[0]:m+1;if(e>=v.length){if(!w.cyclic)return;e=0}if(e==m)return w.enableKeyboardNav=!1,o.off("mousewheel.fb"),void l.hide();_preload_image(e)||_preload_next(e+1)},_preload_prev=function(){var e="number"==typeof arguments[0]?arguments[0]:m-1;if(e<0){if(!w.cyclic)return;e=v.length-1}if(e==m)return w.enableKeyboardNav=!1,o.off("mousewheel.fb"),void s.hide();_preload_image(e)||_preload_prev(e-1)},_preload_image=function(t){var i=v[t];return!(void 0===i||void 0===i.href||i.href===w.href||!i.href.match(k)&&!e(i).hasClass("image"))&&((new Image).src=i.href,!0)},_draw=function(e){var t={width:parseInt(p.width+(g.width-p.width)*e,10),height:parseInt(p.height+(g.height-p.height)*e,10),top:parseInt(p.top+(g.top-p.top)*e,10),left:parseInt(p.left+(g.left-p.left)*e,10)};void 0!==g.opacity&&(t.opacity=e<.5?.5:e),o.css(t),d.css({width:t.width-2*w.padding,height:t.height-T*e-2*w.padding})},_get_viewport=function(){var t,i=!W&&window.innerWidth&&document.documentElement.clientWidth?Math.min(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,n=!W&&window.innerHeight&&document.documentElement.clientHeight?Math.min(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight;return[i-2*(t=!0===arguments[0]?0:w.margin),n-2*t,e(document).scrollLeft()+t,e(document).scrollTop()+t]},_get_zoom_to=function(){var e,t=_get_viewport(),i={},n=2*w.padding;return w.width.toString().indexOf("%")>-1?i.width=parseInt(t[0]*parseFloat(w.width)/100,10):i.width=w.width+n,w.height.toString().indexOf("%")>-1?i.height=parseInt(t[1]*parseFloat(w.height)/100,10):i.height=w.height+n,w.autoScale&&(i.width>t[0]||i.height>t[1])&&(w.keepRatio?(e=w.width/w.height,i.width>t[0]&&(i.width=t[0],i.height=parseInt((i.width-n)/e+n,10)),i.height>t[1]&&(i.height=t[1],i.width=parseInt((i.height-n)*e+n,10))):(i.width=Math.min(i.width,t[0]),i.height=Math.min(i.height,t[1]))),i.top=parseInt(Math.max(t[3]-20,t[3]+.5*(t[1]-i.height-40)),10),i.left=parseInt(Math.max(t[2]-20,t[2]+.5*(t[0]-i.width-40)),10),i},_get_obj_pos=function(e){var t=e.offset();return t.top+=parseInt(e.css("paddingTop"),10)||0,t.left+=parseInt(e.css("paddingLeft"),10)||0,t.top+=parseInt(e.css("border-top-width"),10)||0,t.left+=parseInt(e.css("border-left-width"),10)||0,t.width=e.width(),t.height=e.height(),t},_get_zoom_from=function(){var t,i,n=!!u.orig&&e(u.orig),o={};return n&&n.length?o={width:(t=_get_obj_pos(n)).width+2*w.padding,height:t.height+2*w.padding,top:t.top-w.padding-20,left:t.left-w.padding-20}:(i=_get_viewport(),o={width:2*w.padding,height:2*w.padding,top:parseInt(.5*(i[3]+i[1]),10),left:parseInt(.5*(i[2]+i[0]),10)}),o},_animate_loading=function(){i.is(":visible")?(e("div",i).css("top",-40*O+"px"),O=(O+1)%12):clearInterval(f)},e.fn.fancybox=function(t){return e(this).length?(e(this).data("fancybox",e.extend({},t,e.metadata?e(this).metadata():{})).off("click.fb").on("click.fb",(function(t){if(t.preventDefault(),!A){A=!0,e(this).blur(),y=[],b=0;var i=e(this).attr("rel")||"";return""==i||""==i.replace(/alternate|external|help|license|nofollow|noreferrer|noopener|\s+/gi,"")?y.push(this):(y=e('a[rel="'+i+'"], area[rel="'+i+'"]'),b=y.index(this)),_start(),!1}})),this):this},e.fancybox=function(t){var i;if(!A){if(A=!0,i=void 0!==arguments[1]?arguments[1]:{},y=[],b=parseInt(i.index,10)||0,e.isArray(t)){for(var n=0,o=t.length;n<o;n++)"object"==typeof t[n]?e(t[n]).data("fancybox",e.extend({},i,t[n])):t[n]=e({}).data("fancybox",e.extend({content:t[n]},i));y=jQuery.merge(y,t)}else"object"==typeof t?e(t).data("fancybox",e.extend({},i,t)):t=e({}).data("fancybox",e.extend({content:t},i)),y.push(t);(b>y.length||b<0)&&(b=0),_start()}},e.fancybox.showActivity=function(){clearInterval(f),i.show(),f=setInterval(_animate_loading,66)},e.fancybox.hideActivity=function(){i.hide()},e.fancybox.next=function(){var t,i="number"==typeof arguments[0]?arguments[0]:m+1;if(i>=v.length){if(!w.cyclic)return;i=0}t=v[i],i!=m&&void 0!==t&&void 0!==t.href&&t.href===w.href?e.fancybox.next(i+1):e.fancybox.pos(i)},e.fancybox.prev=function(){var t,i="number"==typeof arguments[0]?arguments[0]:m-1;if(i<0){if(!w.cyclic)return;i=v.length-1}t=v[i],i!=m&&void 0!==t&&void 0!==t.href&&t.href===w.href?e.fancybox.prev(i-1):e.fancybox.pos(i)},e.fancybox.pos=function(e){A||(e=parseInt(e),y=v,e>-1&&e<v.length&&(b=e,_start()))},e.fancybox.cancel=function(){A||(A=!0,e(".fancybox-inline-tmp").trigger("fancybox-cancel"),_abort(),u.onCancel(y,b,u),A=!1)},e.fancybox.close=function(){if(!A&&!o.is(":hidden"))if(A=!0,w&&!1===w.onCleanup(v,m,w))A=!1;else if(_abort(),e(r.add(s).add(l)).hide(),e(d.add(n)).off(),e(window).off("orientationchange.fb resize.fb scroll.fb mousewheel.fb"),e(document).off("keydown.fb"),S&&d.find("iframe#fancybox-frame").attr("src",D&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"//about:blank"),"inside"!==w.titlePosition&&c.empty(),o.stop(),"elastic"==w.transitionOut){p=_get_zoom_from();var t=o.position();g={top:t.top,left:t.left,width:o.width(),height:o.height()},w.opacity&&(g.opacity=1),c.empty().hide(),E.prop=1,e(E).animate({prop:0},{duration:w.speedOut,easing:w.easingOut,step:_draw,complete:i})}else o.fadeOut("none"==w.transitionOut?0:w.speedOut,i);function i(){n.fadeOut("fast"),c.empty().hide(),o.hide(),e(".fancybox-inline-tmp").trigger("fancybox-cleanup"),d.empty(),w.onClosed(v,m,w),v=u=[],m=b=0,w=u={},A=!1}},e.fancybox.resize=function(){var t;clearTimeout(h),h=setTimeout((function(){n.is(":visible")&&n.css("height",e(document).height()),t=o.position(),p={top:t.top,left:t.left,width:o.width(),height:o.height()},g=_get_zoom_to(),A=!0,_process_title(),E.prop=0,e(E).animate({prop:1},{duration:w.changeSpeed,easing:w.easingChange,step:_draw,complete:function(){u.autoDimensions&&d.css("height","auto"),o.css("height","auto"),N&&N.length&&c.show(),A=!1,e.fancybox.center(!0)}})}),500)},e.fancybox.center=function(){var e,t;A||(t=!0===arguments[0]?1:0,e=_get_viewport(!0),!t&&(o.width()+40>e[0]||o.height()+40>e[1])||o.stop().animate({top:parseInt(Math.max(e[3]-20,e[3]+.5*(e[1]-d.height()-40)-w.padding)),left:parseInt(Math.max(e[2]-20,e[2]+.5*(e[0]-d.width()-40)-w.padding))},"number"==typeof arguments[0]?arguments[0]:300))},e.fancybox.init=function(){e("#fancybox-wrap").length||(e("body").append(t=e('<div id="fancybox-tmp"></div>'),i=e('<div id="fancybox-loading"><div></div></div>'),n=e('<div id="fancybox-overlay"></div>'),o=e('<div id="fancybox-wrap"></div>')),(a=e('<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(o)).append(d=e('<div id="fancybox-content"></div>'),r=e('<a id="fancybox-close" title="Close" class="fancy-ico" href="javascript:;"></a>'),c=e('<div id="fancybox-title"></div>'),s=e('<a id="fancybox-left" title="Previous" href="javascript:;"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),l=e('<a id="fancybox-right" title="Next" href="javascript:;"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')),r.click(e.fancybox.close),i.click(e.fancybox.cancel),s.click((function(t){t.preventDefault(),e.fancybox.prev()})),l.click((function(t){t.preventDefault(),e.fancybox.next()})),S&&o.addClass("fancybox-ie"),D&&(i.addClass("fancybox-ie6"),o.addClass("fancybox-ie6"),e('<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(a)))},e.fn.fancybox.defaults={padding:10,margin:40,opacity:!1,modal:!1,cyclic:!1,allowfullscreen:!1,scrolling:"auto",width:560,height:340,autoScale:!0,autoDimensions:!0,centerOnScroll:!1,autoResize:!0,keepRatio:!1,minViewportWidth:0,ajax:{},swf:{wmode:"opaque"},svg:{wmode:"opaque"},hideOnOverlayClick:!0,hideOnContentClick:!1,overlayShow:!0,overlayOpacity:.7,overlayColor:"#777",titleShow:!0,titlePosition:"float",titleFormat:null,titleFromAlt:!0,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:!0,showNavArrows:!0,enableEscapeButton:!0,enableKeyboardNav:!0,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}},e(document).ready((function(){e.fancybox.init()}))}(jQuery);
fancybox/1.5.0/jquery.fancybox.css ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * FancyBox - jQuery Plugin
3
+ * Simple and fancy lightbox alternative
4
+ *
5
+ * Examples and documentation at: http://fancybox.net
6
+ *
7
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
8
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Copyright (c) 2020 - RavanH
11
+ * Version: 1.5.0 (2020/11/09)
12
+ *
13
+ * Dual licensed under the MIT and GPL licenses:
14
+ * http://www.opensource.org/licenses/mit-license.php
15
+ * http://www.gnu.org/licenses/gpl.html
16
+ */
17
+
18
+ html.fancybox-active, html.fancybox-active body {
19
+ touch-action: none;
20
+ overscroll-behavior: none;
21
+ -webkit-overflow-scrolling: auto;
22
+ overflow: hidden;
23
+ }
24
+ html.fancybox-active body {
25
+ margin-right: var(--vertical-scrollbar);
26
+ margin-bottom: var(--horizontal-scrollbar);
27
+ }
28
+ html.fancybox-active body.rtl {
29
+ margin-right: 0;
30
+ margin-left: var(--vertical-scrollbar);
31
+ }
32
+
33
+ #fancybox-loading, #fancybox-loading div,
34
+ #fancybox-overlay,
35
+ #fancybox-wrap *,
36
+ #fancybox-wrap *::before, #fancybox-wrap *::after {
37
+ -webkit-box-sizing: border-box;
38
+ -moz-box-sizing: border-box;
39
+ box-sizing: border-box;
40
+ }
41
+
42
+ /* light box framework */
43
+
44
+ #fancybox-overlay {
45
+ position: fixed;
46
+ top: 0;
47
+ left: 0;
48
+ width: 100%;
49
+ height: 100%;
50
+ background-color: rgba(0,0,0,.7);
51
+ z-index: 111100;
52
+ display: none;
53
+ }
54
+
55
+ #fancybox-tmp {
56
+ padding: 0;
57
+ margin: 0;
58
+ border: 0;
59
+ overflow: auto;
60
+ display: none;
61
+ }
62
+
63
+ #fancybox-wrap {
64
+ position: absolute;
65
+ top: 0;
66
+ left: 0;
67
+ z-index: 111101;
68
+ display: none;
69
+ outline: none !important;
70
+ }
71
+
72
+ #fancybox-outer {
73
+ position: relative;
74
+ width: 100%;
75
+ height: 100%;
76
+ box-shadow:0 0 20px #111;
77
+ -moz-box-shadow:0 0 20px #111;
78
+ -webkit-box-shadow:0 0 20px #111;
79
+ }
80
+
81
+ #fancybox-content {
82
+ position: relative;
83
+ width: 100%;
84
+ height: 100%;
85
+ -webkit-overflow-scrolling: touch;
86
+ overflow-y: auto;
87
+ z-index: 111102;
88
+ border: 0px solid #fff;
89
+ background: #fff;
90
+ background-clip: padding-box;
91
+ }
92
+
93
+ #fancybox-content > div {
94
+ max-width: 100%;
95
+ max-height: 100%;
96
+ }
97
+
98
+ #fancybox-error {
99
+ color: #444;
100
+ padding: 14px;
101
+ margin: 0;
102
+ }
103
+
104
+ #fancybox-frame, #fancybox-img {
105
+ width: 100%;
106
+ height: 100%;
107
+ border: none;
108
+ }
109
+
110
+ #fancybox-img {
111
+ position: absolute;
112
+ padding: 0;
113
+ margin: 0;
114
+ line-height: 0;
115
+ vertical-align: top;
116
+ max-width:none !important;
117
+ max-height:none !important
118
+ }
119
+
120
+ #fancybox-frame {
121
+ display: block;
122
+ z-index: 0; /* z-index bug with -webkit-overflow-scrolling */
123
+ }
124
+ /* buttons */
125
+ .fancy-ico {
126
+ position: absolute;
127
+ width: 48px;
128
+ height: 48px;
129
+ border-radius: 50%;
130
+ }
131
+ .fancy-ico span {
132
+ display: block;
133
+ position: relative;
134
+ left: 12px;
135
+ top: 12px;
136
+ width: 24px;
137
+ height: 24px;
138
+ border-radius: 50%;
139
+ background: #000;
140
+ border: 2px solid white;
141
+ box-shadow: 0 0 4px #000;
142
+ transition: transform .25s ease-in-out;
143
+ }
144
+ #fancybox-close:hover span, #fancybox-next:hover span, body.rtl #fancybox-prev:hover span {
145
+ transform: rotate(360deg);
146
+ }
147
+ #fancybox-prev:hover span, body.rtl #fancybox-next:hover span {
148
+ transform: rotate(-360deg);
149
+ }
150
+ /* close button */
151
+ #fancybox-close {
152
+ top: -24px;
153
+ right: -24px;
154
+ cursor: pointer;
155
+ z-index: 111105;
156
+ display: none;
157
+ }
158
+ #fancybox-close span::after, #fancybox-close span::before {
159
+ content: '';
160
+ position: absolute;
161
+ top: 9px;
162
+ left: 4px;
163
+ width: 12px;
164
+ height: 2px;
165
+ background-color: #fff;
166
+ }
167
+ #fancybox-close span::before {
168
+ transform: rotate(45deg);
169
+ }
170
+ #fancybox-close span::after {
171
+ transform: rotate(-45deg);
172
+ }
173
+
174
+ /* navigation elements */
175
+ #fancybox-prev, #fancybox-next {
176
+ top: 50%;
177
+ margin-top: -24px;
178
+ cursor: pointer;
179
+ z-index: 111102;
180
+ display: none;
181
+ }
182
+
183
+ #fancybox-next,
184
+ body.rtl #fancybox-prev {
185
+ left: auto;
186
+ right: -24px;
187
+ }
188
+
189
+ #fancybox-prev,
190
+ body.rtl #fancybox-next {
191
+ left: -24px;
192
+ right: auto;
193
+ }
194
+ #fancybox-prev span::after, #fancybox-next span::after {
195
+ content: '';
196
+ position: absolute;
197
+ top: 6px;
198
+ width: 8px;
199
+ height: 8px;
200
+ border-top: 2px solid #fff;
201
+ border-right: 2px solid #fff;
202
+ }
203
+ #fancybox-prev span::after, body.rtl #fancybox-next span::after {
204
+ transform: rotate(-135deg);
205
+ left: 7px;
206
+ }
207
+ #fancybox-next span::after, body.rtl #fancybox-prev span::after {
208
+ transform: rotate(45deg);
209
+ left: initial;
210
+ right: 7px;
211
+ }
212
+
213
+ /* title elements */
214
+
215
+ #fancybox-title-wrap {
216
+ z-index: 111104;
217
+ }
218
+
219
+ .fancybox-title-inside {
220
+ padding-bottom: 10px;
221
+ text-align: center;
222
+ color: #333;
223
+ background-color: #fff;
224
+ position: relative;
225
+ }
226
+
227
+ .fancybox-title-outside {
228
+ padding-top: 10px;
229
+ color: #fff;
230
+ font-weight: 600;
231
+ }
232
+
233
+ .fancybox-title-over {
234
+ position: absolute;
235
+ width: 100%;
236
+ bottom: 0;
237
+ left: 0;
238
+ color: #fff;
239
+ text-align: left;
240
+ }
241
+
242
+ body.rtl .fancybox-title-over {
243
+ text-align:right
244
+ }
245
+
246
+ .fancybox-title-over #fancybox-title {
247
+ padding: 10px;
248
+ background: rgba(0,0,0,.6);
249
+ display: block;
250
+ }
251
+
252
+ .fancybox-title-float {
253
+ text-align: center;
254
+ }
255
+
256
+ .fancybox-title-float #fancybox-title {
257
+ display: table;
258
+ margin: -12px auto;
259
+ height: 24px;
260
+ padding: 0 15px;
261
+ line-height: 20px;
262
+ font-size: 16px;
263
+ color: #fff;
264
+ background: #000;
265
+ border: 2px solid #fff;
266
+ border-radius: 12px;
267
+ box-shadow: 0 0 4px #000;
268
+ position: relative;
269
+ z-index: 111104;
270
+ }
271
+
272
+ /* loader animation */
273
+ #fancybox-loading {
274
+ position: fixed;
275
+ top: 50%;
276
+ left: 50%;
277
+ width: 40px;
278
+ height: 40px;
279
+ margin-top: -20px;
280
+ margin-left: -20px;
281
+ background-color: rgba(0,0,0,.9);
282
+ border-radius: 5px;
283
+ cursor: pointer;
284
+ overflow: hidden;
285
+ z-index: 111104;
286
+ display: none;
287
+ }
288
+ #fancybox-loading div {
289
+ transform-origin: 20px 20px;
290
+ animation: fancybox-loading 1.2s linear infinite;
291
+ }
292
+ #fancybox-loading div::after {
293
+ content: '';
294
+ display: block;
295
+ position: absolute;
296
+ top: 7px;
297
+ left: 19px;
298
+ width: 2px;
299
+ height: 7px;
300
+ border-radius: 20%;
301
+ background: #fff;
302
+ }
303
+ #fancybox-loading div:nth-child(1) {
304
+ transform: rotate(0deg);
305
+ animation-delay: -1.1s;
306
+ }
307
+ #fancybox-loading div:nth-child(2) {
308
+ transform: rotate(30deg);
309
+ animation-delay: -1s;
310
+ }
311
+ #fancybox-loading div:nth-child(3) {
312
+ transform: rotate(60deg);
313
+ animation-delay: -0.9s;
314
+ }
315
+ #fancybox-loading div:nth-child(4) {
316
+ transform: rotate(90deg);
317
+ animation-delay: -0.8s;
318
+ }
319
+ #fancybox-loading div:nth-child(5) {
320
+ transform: rotate(120deg);
321
+ animation-delay: -0.7s;
322
+ }
323
+ #fancybox-loading div:nth-child(6) {
324
+ transform: rotate(150deg);
325
+ animation-delay: -0.6s;
326
+ }
327
+ #fancybox-loading div:nth-child(7) {
328
+ transform: rotate(180deg);
329
+ animation-delay: -0.5s;
330
+ }
331
+ #fancybox-loading div:nth-child(8) {
332
+ transform: rotate(210deg);
333
+ animation-delay: -0.4s;
334
+ }
335
+ #fancybox-loading div:nth-child(9) {
336
+ transform: rotate(240deg);
337
+ animation-delay: -0.3s;
338
+ }
339
+ #fancybox-loading div:nth-child(10) {
340
+ transform: rotate(270deg);
341
+ animation-delay: -0.2s;
342
+ }
343
+ #fancybox-loading div:nth-child(11) {
344
+ transform: rotate(300deg);
345
+ animation-delay: -0.1s;
346
+ }
347
+ #fancybox-loading div:nth-child(12) {
348
+ transform: rotate(330deg);
349
+ animation-delay: 0s;
350
+ }
351
+ @keyframes fancybox-loading {
352
+ 0% {
353
+ opacity: 1;
354
+ }
355
+ 100% {
356
+ opacity: 0;
357
+ }
358
+ }
359
+
360
+ /* other */
361
+ .fancybox-hidden {
362
+ display: none;
363
+ }
364
+ #fancybox-content .fancybox-hidden,
365
+ #fancybox-tmp .fancybox-hidden {
366
+ display: revert;
367
+ }
fancybox/1.5.0/jquery.fancybox.js ADDED
@@ -0,0 +1,1195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * FancyBox Classic - jQuery Plugin
3
+ * Simple but fancy lightbox, based on the original FancyBox by Janis Skarnelis, modernized.
4
+ *
5
+ * Examples and original documentation at: http://fancybox.net
6
+ *
7
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
8
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Copyright (c) 2020 - RavanH
11
+ * Version: 1.5.0 (2020/11/09)
12
+ * Requires: jQuery v1.7+
13
+ *
14
+ * Dual licensed under the MIT and GPL licenses:
15
+ * http://www.opensource.org/licenses/mit-license.php
16
+ * http://www.gnu.org/licenses/gpl.html
17
+ */
18
+
19
+ (function($) {
20
+ var tmp, loading, overlay, wrap, outer, content, close, title, nav_prev, nav_next, resize_timeout, previousType, clone, final_pos,
21
+ selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [], ajaxLoader = null,
22
+ imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg|webp)(.*)?$/i, svgRegExp = /[^\.]\.(svg)\s*$/i,
23
+ pdfRegExp = /[^\.]\.(pdf)\s*$/i, titleHeight = 0, titleStr = '', busy = false, swipe_busy = false, move_startX, move_endX, pixel_ratio = window.devicePixelRatio || 1,
24
+ isTouch = 'ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
25
+
26
+ /*
27
+ * Private methods
28
+ */
29
+
30
+ _abort = function() {
31
+ $.fancybox.hideActivity();
32
+
33
+ imgPreloader.onerror = imgPreloader.onload = null;
34
+
35
+ if (ajaxLoader) {
36
+ ajaxLoader.abort();
37
+ }
38
+
39
+ tmp.empty();
40
+ };
41
+
42
+ _error = function(msg) {
43
+ if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
44
+ $.fancybox.hideActivity();
45
+ busy = false;
46
+ return;
47
+ }
48
+
49
+ if ( typeof msg === 'undefined' ) {
50
+ msg = selectedOpts.txt.error.later;
51
+ }
52
+
53
+ selectedOpts.type = 'html';
54
+ selectedOpts.enableSwipeNav = false;
55
+ selectedOpts.titleShow = false;
56
+ selectedOpts.width = 'auto';
57
+ selectedOpts.height = 'auto';
58
+
59
+ tmp.html('<p id="fancybox-error">' + selectedOpts.txt.error.content + '<br />' + msg + '</p>');
60
+
61
+ _process_inline();
62
+ };
63
+
64
+ _start = function() {
65
+ var obj = selectedArray[ selectedIndex ],
66
+ href, type, title, ret;
67
+
68
+ _abort();
69
+
70
+ selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
71
+
72
+ $('html').addClass('fancybox-active');
73
+
74
+ $(document).trigger('fancybox-start', selectedArray, selectedIndex, selectedOpts);
75
+
76
+ ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
77
+
78
+ if (ret === false) {
79
+ busy = false;
80
+ return;
81
+ } else if (typeof ret == 'object') {
82
+ selectedOpts = $.extend(selectedOpts, ret);
83
+ }
84
+
85
+ title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
86
+
87
+ if (obj.nodeName && !selectedOpts.orig) {
88
+ selectedOpts.orig = $(obj).find("img:first").length ? $(obj).find("img:first") : $(obj);
89
+ }
90
+
91
+ if (title === '' && selectedOpts.orig) {
92
+ title = selectedOpts.orig.attr('title') || (selectedOpts.titleFromAlt ? selectedOpts.orig.attr('alt') : '');
93
+ }
94
+
95
+ href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
96
+
97
+ if ((/^(?:javascript)/i).test(href) || href == '#') {
98
+ href = null;
99
+ }
100
+
101
+ if (selectedOpts.type) {
102
+ type = selectedOpts.type;
103
+ if (!href) {
104
+ href = selectedOpts.content;
105
+ }
106
+ } else if (selectedOpts.content) {
107
+ type = 'html';
108
+ } else if ( $(obj).hasClass('iframe') ) {
109
+ type = 'iframe';
110
+ } else if (href) {
111
+ if (href.match(imgRegExp) || $(obj).hasClass("image")) {
112
+ type = 'image';
113
+ } else if (href.match(svgRegExp)) {
114
+ type = 'svg';
115
+ } else if (href.match(pdfRegExp)) {
116
+ type = 'pdf';
117
+ } else if (href.indexOf("#") === 0) {
118
+ type = 'inline';
119
+ } else {
120
+ type = 'ajax';
121
+ }
122
+ }
123
+
124
+ if (!type) {
125
+ _error(selectedOpts.txt.error.type);
126
+ return;
127
+ }
128
+
129
+ if ($(obj).hasClass('modal')) {
130
+ selectedOpts.modal = true;
131
+ }
132
+
133
+ if (type == 'inline') {
134
+ obj = href.substr(href.indexOf("#"));
135
+ type = $(obj).length > 0 ? 'inline' : 'ajax';
136
+ }
137
+
138
+ selectedOpts.type = type;
139
+ selectedOpts.href = href;
140
+ selectedOpts.title = title;
141
+
142
+ if (selectedOpts.autoDimensions) {
143
+ if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
144
+ selectedOpts.width = 'auto';
145
+ selectedOpts.height = 'auto';
146
+ } else {
147
+ selectedOpts.autoDimensions = false;
148
+ }
149
+ }
150
+
151
+ if (selectedOpts.modal) {
152
+ selectedOpts.overlayShow = true;
153
+ selectedOpts.hideOnOverlayClick = false;
154
+ selectedOpts.hideOnContentClick = false;
155
+ selectedOpts.enableEscapeButton = false;
156
+ selectedOpts.showCloseButton = false;
157
+ }
158
+
159
+ selectedOpts.padding = parseInt(selectedOpts.padding, 10);
160
+ selectedOpts.margin = parseInt(selectedOpts.margin, 10);
161
+
162
+ tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
163
+
164
+ if (selectedOpts.enableEscapeButton) {
165
+ $(document).on('keydown.fb', function(e) {
166
+ if (e.keyCode == 27) {
167
+ e.preventDefault();
168
+ $.fancybox.cancel();
169
+ return false;
170
+ }
171
+ });
172
+ }
173
+
174
+ switch (type) {
175
+ case 'html' :
176
+ tmp.html( selectedOpts.content );
177
+ selectedOpts.enableSwipeNav = false;
178
+
179
+ _process_inline();
180
+ break;
181
+
182
+ case 'inline' :
183
+ if ( $(obj).parent().is('#fancybox-content') === true) {
184
+ busy = false;
185
+ return;
186
+ }
187
+
188
+ selectedOpts.enableSwipeNav = false;
189
+
190
+ $(obj).clone()
191
+ .attr('id', $(obj).attr('id')+'-tmp')
192
+ .insertBefore( $(obj) );
193
+
194
+ $(document).on('fancybox-cleanup fancybox-change', function() {
195
+ let theObj = content.children().children();
196
+ $('#'+theObj.attr('id')+'-tmp').replaceWith(theObj);
197
+ }).on('fancybox-cancel', function() {
198
+ let theObj = tmp.children();
199
+ if (!theObj.length) {
200
+ theObj = content.children().children();
201
+ }
202
+ $('#'+theObj.attr('id')+'-tmp').replaceWith(theObj);
203
+ });
204
+
205
+ $(obj).appendTo(tmp);
206
+
207
+ _process_inline();
208
+ break;
209
+
210
+ case 'image':
211
+ selectedOpts.keepRatio = true;
212
+
213
+ busy = false;
214
+
215
+ imgPreloader = new Image();
216
+
217
+ imgPreloader.onerror = function() {
218
+ _error(selectedOpts.txt.error.image);
219
+ };
220
+
221
+ imgPreloader.onload = function() {
222
+ busy = true;
223
+
224
+ $.fancybox.hideActivity();
225
+
226
+ imgPreloader.onerror = imgPreloader.onload = null;
227
+
228
+ selectedOpts.width = imgPreloader.width;
229
+ selectedOpts.height = imgPreloader.height;
230
+
231
+ $("<img />").attr({
232
+ 'id' : 'fancybox-img',
233
+ 'src' : imgPreloader.src,
234
+ 'alt' : selectedOpts.title
235
+ }).appendTo(tmp);
236
+
237
+ _show();
238
+ };
239
+
240
+ imgPreloader.src = href;
241
+
242
+ $.fancybox.showActivity();
243
+ break;
244
+
245
+ case 'svg':
246
+ selectedOpts.scrolling = 'no';
247
+ selectedOpts.keepRatio = true;
248
+
249
+ var str = '<object type="image/svg+xml" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '" data="' + href + '"></object>';
250
+
251
+ tmp.html(str);
252
+
253
+ _process_inline();
254
+ break;
255
+
256
+ case 'pdf':
257
+ selectedOpts.scrolling = 'no';
258
+ selectedOpts.enableSwipeNav = false;
259
+
260
+ var 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>';
261
+
262
+ tmp.html(str);
263
+
264
+ _process_inline();
265
+ break;
266
+
267
+ case 'ajax':
268
+ selectedOpts.enableKeyboardNav = false;
269
+ selectedOpts.showNavArrows = false;
270
+ selectedOpts.enableSwipeNav = false;
271
+
272
+ busy = false;
273
+
274
+ $.fancybox.showActivity();
275
+
276
+ selectedOpts.ajax.win = selectedOpts.ajax.success;
277
+
278
+ ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
279
+ url : href,
280
+ data : selectedOpts.ajax.data || {},
281
+ error : function() {
282
+ if ( arguments[0].status > 0 ) { // XMLHttpRequest
283
+ _error(arguments[2]); // errorThrown
284
+ }
285
+ },
286
+ success : function(data, textStatus, XMLHttpRequest) {
287
+ var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
288
+ if (o.status == 200) {
289
+ if ( typeof selectedOpts.ajax.win == 'function' ) {
290
+ ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
291
+
292
+ if (ret === false) {
293
+ $.fancybox.hideActivity();
294
+ return;
295
+ } else if (typeof ret == 'string' || typeof ret == 'object') {
296
+ data = ret;
297
+ }
298
+ }
299
+
300
+ if ( data.indexOf("<!DOCTYPE") > -1 || data.indexOf("<html") > -1 || data.indexOf("<body") > -1 ) {
301
+ _error(selectedOpts.txt.error.unexpected);
302
+ } else {
303
+ tmp.html(data);
304
+ _process_inline();
305
+ }
306
+ }
307
+ }
308
+ }));
309
+ break;
310
+
311
+ case 'iframe':
312
+ selectedOpts.enableSwipeNav = false;
313
+
314
+ $.fancybox.showActivity();
315
+
316
+ _show();
317
+ break;
318
+ }
319
+ };
320
+
321
+ _process_inline = function() {
322
+ var w = selectedOpts.width,
323
+ h = selectedOpts.height;
324
+
325
+ $.fancybox.hideActivity();
326
+
327
+ if (w.toString().indexOf('%') > -1) {
328
+ w = parseInt((window.innerWidth - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
329
+ } else {
330
+ w = w == 'auto' ? 'auto' : w + 'px';
331
+ }
332
+
333
+ if (h.toString().indexOf('%') > -1) {
334
+ h = parseInt((window.innerHeight - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
335
+ } else {
336
+ h = h == 'auto' ? 'auto' : h + 'px';
337
+ }
338
+
339
+ tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow:hidden;position:relative;"></div>');
340
+
341
+ selectedOpts.width = tmp.width();
342
+ selectedOpts.height = tmp.height();
343
+
344
+ _show();
345
+ };
346
+
347
+ _show = function() {
348
+ busy = true;
349
+
350
+ $(content.add( overlay )).off();
351
+
352
+ $(window).off('resize.fb');
353
+
354
+ previousType = currentOpts.type;
355
+
356
+ currentArray = selectedArray;
357
+ currentIndex = selectedIndex;
358
+ currentOpts = selectedOpts;
359
+
360
+ if (currentOpts.overlayShow) {
361
+ if (currentOpts.overlayColor)
362
+ overlay.css('background-color',currentOpts.overlayColor);
363
+
364
+ if (currentOpts.hideOnOverlayClick)
365
+ overlay.css('cursor','pointer');
366
+
367
+ if (!overlay.is(':visible')) {
368
+ overlay.fadeIn('fast');
369
+ }
370
+ } else {
371
+ overlay.hide();
372
+ }
373
+
374
+ _process_title();
375
+
376
+ final_pos = _get_zoom_to();
377
+
378
+ if (wrap.is(':visible')) {
379
+ $( close.add( nav_prev ).add( nav_next ) ).hide();
380
+
381
+ // if both images
382
+ if (previousType === 'image' && currentOpts.type === 'image') {
383
+ // crossfade
384
+ content.prepend( tmp.contents() );
385
+ content
386
+ .children()
387
+ .first()
388
+ .next().fadeOut(currentOpts.changeSpeed, function(){ $( this ).remove(); } );
389
+
390
+ content.css('border-width', currentOpts.padding);
391
+
392
+ wrap.animate(final_pos, {
393
+ duration : currentOpts.changeSpeed,
394
+ easing : currentOpts.easingChange,
395
+ complete : _finish
396
+ });
397
+ } else {
398
+ content.fadeTo(currentOpts.changeFade, 0.3, function() {
399
+
400
+ content.css('border-width', currentOpts.padding);
401
+
402
+ wrap.animate(final_pos, {
403
+ duration : currentOpts.changeSpeed,
404
+ easing : currentOpts.easingChange,
405
+ complete : function() {
406
+ content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
407
+ }
408
+ });
409
+ });
410
+ }
411
+
412
+ return;
413
+ }
414
+
415
+ wrap.removeAttr("style");
416
+
417
+ content.css('border-width', currentOpts.padding);
418
+
419
+ content.html( tmp.contents() );
420
+
421
+ if (currentOpts.transitionIn == 'elastic') {
422
+ wrap.css(_get_orig_pos()).show();
423
+
424
+ final_pos.opacity = 1;
425
+
426
+ wrap
427
+ .attr('aria-hidden','false')
428
+ .animate(final_pos, {
429
+ duration : currentOpts.speedIn,
430
+ easing : currentOpts.easingIn,
431
+ complete : _finish
432
+ });
433
+ } else {
434
+ wrap
435
+ .css(final_pos)
436
+ .attr('aria-hidden','false')
437
+ .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
438
+ }
439
+ };
440
+
441
+ _format_title = function(title) {
442
+ if (title && title.length) {
443
+ return '<div id="fancybox-title">' + title + '</div>';
444
+ }
445
+
446
+ return false;
447
+ };
448
+
449
+ _process_title = function() {
450
+ titleStr = currentOpts.title || '';
451
+ titleHeight = 0;
452
+
453
+ title
454
+ .empty()
455
+ .removeAttr('style')
456
+ .removeClass();
457
+
458
+ if (currentOpts.titleShow === false) {
459
+ title.hide();
460
+ return;
461
+ }
462
+
463
+ titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
464
+
465
+ if (!titleStr || titleStr === '') {
466
+ title.hide();
467
+ return;
468
+ }
469
+
470
+ title
471
+ .addClass('fancybox-title-' + currentOpts.titlePosition)
472
+ .html( titleStr )
473
+ .appendTo( 'body' )
474
+ .show();
475
+
476
+ switch (currentOpts.titlePosition) {
477
+ case 'outside':
478
+ case 'inside':
479
+ titleHeight = title.outerHeight(true);
480
+ title.appendTo( outer );
481
+ break;
482
+
483
+ case 'over':
484
+ if (content.is(':visible')) {
485
+ title.appendTo( content );
486
+ } else {
487
+ title.appendTo( tmp );
488
+ }
489
+ break;
490
+
491
+ default:
492
+ title
493
+ .css({
494
+ 'paddingLeft' : currentOpts.padding,
495
+ 'paddingRight' : currentOpts.padding
496
+ })
497
+ .appendTo( wrap );
498
+ }
499
+
500
+ title.hide();
501
+ };
502
+
503
+ _swipe = function() {
504
+ let dx = move_startX - move_endX;
505
+
506
+ move_startX = move_endX = 0;
507
+
508
+ if (Math.abs(dx) < currentOpts.swipeThreshold) return;
509
+
510
+ if ( dx < 0 ) {
511
+ $.fancybox.prev();
512
+ } else {
513
+ $.fancybox.next();
514
+ }
515
+ };
516
+
517
+ _set_navigation = function() {
518
+ if (currentArray.length === 1) return;
519
+
520
+ if (currentOpts.enableSwipeNav) {
521
+ wrap.css('cursor','move');
522
+
523
+ wrap.on('mousedown.fb', function(e) {
524
+ e.preventDefault();
525
+ move_startX = move_endX = typeof e.clientX !== 'undefined' ? e.clientX : e.originalEvent.clientX;
526
+ wrap.on('mousemove.fb', function(e) {
527
+ move_endX = typeof e.clientX !== 'undefined' ? e.clientX : e.originalEvent.clientX;
528
+ });
529
+ });
530
+ wrap.on('mouseup.fb', function() {
531
+ wrap.off('mousemove.fb');
532
+ _swipe();
533
+ });
534
+ if (isTouch) {
535
+ wrap.on('touchstart.fb', function(e) {
536
+ swipe_busy = e.touches.length === 1;
537
+ move_startX = move_endX = typeof e.touches !== 'undefined' ? e.touches[0].clientX : e.originalEvent.touches[0].clientX;
538
+ wrap.on('touchmove.fb', function(e) {
539
+ if (e.touches.length === 1) {
540
+ move_endX = typeof e.touches !== 'undefined' ? e.touches[0].clientX : e.originalEvent.touches[0].clientX;
541
+ } else { // more than one touch, probably pinch or zoom
542
+ swipe_busy = false;
543
+ wrap.off('touchmove.fb');
544
+ }
545
+ });
546
+ });
547
+ wrap.on('touchend.fb', function() {
548
+ wrap.off('touchmove.fb');
549
+ if (swipe_busy) {
550
+ swipe_busy = false;
551
+ _swipe();
552
+ }
553
+ });
554
+ }
555
+ }
556
+
557
+ if ($.fn.mousewheel) {
558
+ wrap.on('mousewheel.fb', function(e, delta) {
559
+ if (busy) {
560
+ e.preventDefault();
561
+ } else if ( currentOpts.type == 'image' && ( $(e.target).outerHeight() == 0 || $(e.target).prop('scrollHeight') === $(e.target).outerHeight() ) ) {
562
+ e.preventDefault();
563
+ $.fancybox[ delta > 0 ? 'prev' : 'next' ]();
564
+ }
565
+ });
566
+ }
567
+
568
+ $(document).off('keydown.fb');
569
+ if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
570
+ $(document).on('keydown.fb', function(e) {
571
+ if (currentOpts.enableEscapeButton && e.keyCode == 27) {
572
+ e.preventDefault();
573
+ $.fancybox.close();
574
+ return false;
575
+ } else if (currentOpts.enableKeyboardNav && (e.keyCode == 37 || e.keyCode == 39) && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
576
+ e.preventDefault();
577
+ $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
578
+ } else if (currentOpts.enableKeyboardNav && (e.keyCode == 9) && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
579
+ e.preventDefault();
580
+ $.fancybox[ e.shiftKey ? 'prev' : 'next']();
581
+ }
582
+ });
583
+ }
584
+
585
+ if (currentOpts.showNavArrows) {
586
+ if (currentOpts.cyclic || currentIndex !== 0) {
587
+ nav_prev.attr('title',currentOpts.txt.prev).show();
588
+ }
589
+
590
+ if (currentOpts.cyclic || currentIndex != currentArray.length-1) {
591
+ nav_next.attr('title',currentOpts.txt.next).show();
592
+ }
593
+ }
594
+ };
595
+
596
+ _finish = function () {
597
+ if (titleStr && titleStr.length) {
598
+ title.fadeIn();
599
+ }
600
+
601
+ if (currentOpts.showCloseButton) {
602
+ close.attr('title',currentOpts.txt.close).show();
603
+ }
604
+
605
+ _set_navigation();
606
+
607
+ if (currentOpts.hideOnContentClick) {
608
+ content.on('click', $.fancybox.close).css('cursor','pointer');;
609
+ }
610
+
611
+ if (currentOpts.hideOnOverlayClick) {
612
+ overlay.on('click', $.fancybox.close);
613
+ }
614
+
615
+ if (currentOpts.autoResize) {
616
+ $(window).on("resize.fb", $.fancybox.resize);
617
+ }
618
+
619
+ if (currentOpts.type == 'iframe') {
620
+ $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '"'
621
+ + ' style="border:0;margin:0;overflow:' + (currentOpts.scrolling == 'auto' ? 'auto' : (currentOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + '" src="'
622
+ + currentOpts.href + '"' + (false === currentOpts.allowfullscreen ? '' : ' allowfullscreen') + ' allow="autoplay; encrypted-media" tabindex="999"></iframe>')
623
+ .appendTo(content).on('load',function() {
624
+ $.fancybox.hideActivity();
625
+ });
626
+ }
627
+
628
+ if (currentOpts.type == 'inline' || currentOpts.type == 'html') {
629
+ $(content).children().css('overflow', currentOpts.scrolling == 'auto' ? 'auto' : (currentOpts.scrolling == 'yes' ? 'scroll' : 'hidden') );
630
+ }
631
+
632
+ wrap.show().focus();
633
+
634
+ busy = false;
635
+
636
+ $(document).trigger('fancybox-complete', currentArray, currentIndex, currentOpts);
637
+
638
+ currentOpts.onComplete(currentArray, currentIndex, currentOpts);
639
+
640
+ if (currentArray.length > 1) {
641
+ _preload_next();
642
+ _preload_prev();
643
+ }
644
+ };
645
+
646
+ _preload_next = function() {
647
+ var pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex + 1;
648
+
649
+ if ( pos >= currentArray.length ) {
650
+ if (currentOpts.cyclic) {
651
+ pos = 0;
652
+ } else {
653
+ return;
654
+ }
655
+ }
656
+
657
+ if ( pos == currentIndex ) {
658
+ currentOpts.enableKeyboardNav = false;
659
+ currentOpts.enableSwipeNav = false;
660
+ wrap.off('mousewheel.fb touchstart.fb touchmove.fb touchend.fb mousedown.fb mousemove.fb mouseup.fb');
661
+ nav_next.hide();
662
+ return;
663
+ }
664
+
665
+ if ( _preload_image( pos ) ) {
666
+ return;
667
+ } else {
668
+ _preload_next( pos + 1 );
669
+ }
670
+ };
671
+
672
+ _preload_prev = function() {
673
+ var pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex - 1;
674
+
675
+ if ( pos < 0 ) {
676
+ if (currentOpts.cyclic) {
677
+ pos = currentArray.length - 1;
678
+ } else {
679
+ return;
680
+ }
681
+ }
682
+
683
+ if ( pos == currentIndex ) {
684
+ currentOpts.enableKeyboardNav = false;
685
+ currentOpts.enableSwipeNav = false;
686
+ wrap.off('mousewheel.fb touchstart.fb touchmove.fb touchend.fb mousedown.fb mousemove.fb mouseup.fb');
687
+ nav_prev.hide();
688
+ return;
689
+ }
690
+
691
+ if ( _preload_image( pos ) ) {
692
+ return;
693
+ } else {
694
+ _preload_prev( pos - 1 );
695
+ }
696
+ };
697
+
698
+ _preload_image = function(pos) {
699
+ var objNext, obj = currentArray[ pos ];
700
+
701
+ if ( typeof obj !== 'undefined' && typeof obj.href !== 'undefined' && obj.href !== currentOpts.href && (obj.href.match(imgRegExp) || $(obj).hasClass("image")) ) {
702
+ objNext = new Image();
703
+ objNext.src = obj.href;
704
+ return true;
705
+ } else {
706
+ return false;
707
+ }
708
+ };
709
+
710
+ _get_zoom_to = function () {
711
+ var view = [
712
+ window.innerWidth - (currentOpts.margin * 2),
713
+ window.innerHeight - (currentOpts.margin * 2) - titleHeight,
714
+ $(document).scrollLeft() + currentOpts.margin,
715
+ $(document).scrollTop() + currentOpts.margin
716
+ ],
717
+ to = {},
718
+ ratio = currentOpts.keepRatio && currentOpts.height ? currentOpts.width / currentOpts.height : 1;
719
+
720
+ if (currentOpts.width.toString().indexOf('%') > -1) {
721
+ to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
722
+ } else {
723
+ to.width = currentOpts.width + (currentOpts.padding * 2);
724
+ }
725
+
726
+ if (currentOpts.height.toString().indexOf('%') > -1) {
727
+ to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
728
+ } else {
729
+ to.height = currentOpts.height + (currentOpts.padding * 2);
730
+ }
731
+
732
+ // scale down to fit viewport, recalculate by ratio based on width and height without border and title
733
+ if (currentOpts.autoScale && to.width > view[0]) {
734
+ to.width = view[0] - (currentOpts.padding * 2);
735
+ to.height = parseInt(to.width / ratio, 10);
736
+ }
737
+ if (currentOpts.autoScale && to.height > view[1]) {
738
+ to.height = view[1] - (currentOpts.padding * 2);
739
+ to.width = parseInt(to.height * ratio, 10);
740
+ }
741
+
742
+ // calculate position
743
+ to.left = parseInt(Math.max(view[2], view[2] + (view[0] - to.width ) / 2), 10);
744
+ to.top = parseInt(Math.max(view[3], view[3] + (view[1] - to.height) / 2), 10);
745
+
746
+ return to;
747
+ };
748
+
749
+ _get_orig_pos = function() {
750
+ if ( !selectedOpts.orig ) return false;
751
+
752
+ var orig = $(selectedOpts.orig);
753
+
754
+ if ( !orig.length ) return false;
755
+
756
+ var pos = orig.offset();
757
+
758
+ pos.top += parseInt( orig.css('paddingTop'), 10 ) || parseInt( orig.css('border-top-width'), 10 ) || 0;
759
+ pos.left += parseInt( orig.css('paddingLeft'), 10 ) || parseInt( orig.css('border-left-width'), 10 ) || 0;
760
+
761
+ return {
762
+ width : orig.width() + (currentOpts.padding * 2),
763
+ height : orig.height() + (currentOpts.padding * 2),
764
+ top : pos.top - currentOpts.padding,
765
+ left : pos.left - currentOpts.padding,
766
+ opacity : 0
767
+ };
768
+ };
769
+
770
+ _closed = function() {
771
+ overlay.fadeOut('fast');
772
+
773
+ $(document).trigger('fancybox-closed', currentArray, currentIndex, currentOpts);
774
+
775
+ currentOpts.onClosed(currentArray, currentIndex, currentOpts);
776
+
777
+ _cleanup();
778
+ };
779
+
780
+ _cleanup = function() {
781
+ overlay.hide();
782
+
783
+ title.empty().hide();
784
+ wrap.hide().attr('aria-hidden','true');;
785
+
786
+ content.empty();
787
+
788
+ currentArray = selectedArray = [];
789
+ currentIndex = selectedIndex = 0;
790
+ currentOpts = selectedOpts = {};
791
+
792
+ $('html').css( { '--vertical-scrollbar' : '', '--horizontal-scrollbar' : '' } );
793
+ $('html').removeClass('fancybox-active');
794
+
795
+ $(document).off('fancybox-cancel fancybox-change fancybox-cleanup fancybox-closed');
796
+
797
+ busy = false;
798
+ };
799
+
800
+ /*
801
+ * Public methods
802
+ */
803
+
804
+ $.fn.fancybox = function(options) {
805
+ if (!$(this).length) {
806
+ return this;
807
+ }
808
+
809
+ let objOpts = $.extend({}, options, ($.metadata ? $(this).metadata() : {}));
810
+
811
+ if ( ! objOpts.minViewportWidth || document.documentElement.clientWidth >= objOpts.minViewportWidth ) {
812
+ $(this)
813
+ .data('fancybox', objOpts)
814
+ .attr({'aria-controls':'fancybox','aria-haspopup':'dialog'})
815
+ .off('click.fb')
816
+ .on('click.fb', function(e) {
817
+ e.preventDefault();
818
+
819
+ if (busy) {
820
+ return false;
821
+ }
822
+
823
+ busy = true;
824
+
825
+ $(this).blur();
826
+
827
+ selectedArray = [];
828
+ selectedIndex = 0;
829
+
830
+ var rel = $(this).attr('rel') || '';
831
+
832
+ if (rel == '' || rel.replace(/alternate|external|help|license|nofollow|noreferrer|noopener|\s+/gi,'') == '') {
833
+ selectedArray.push(this);
834
+ } else {
835
+ selectedArray = $('a[rel="' + rel + '"], area[rel="' + rel + '"]');
836
+ selectedIndex = selectedArray.index( this );
837
+ }
838
+
839
+ $('html').css( { '--vertical-scrollbar' : window.innerWidth-$(window).width() + 'px', '--horizontal-scrollbar' : window.innerHeight-$(window).height() + 'px' } );
840
+
841
+ _start();
842
+
843
+ return false;
844
+ });
845
+ };
846
+
847
+ return this;
848
+ };
849
+
850
+ $.fancybox = function(obj) {
851
+ var opts;
852
+
853
+ if (busy) {
854
+ return;
855
+ }
856
+
857
+ busy = true;
858
+ opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
859
+
860
+ selectedArray = [];
861
+ selectedIndex = parseInt(opts.index, 10) || 0;
862
+
863
+ if ( $.isArray(obj) ) {
864
+ for (var i = 0, j = obj.length; i < j; i++) {
865
+ if (typeof obj[i] == 'object') {
866
+ $(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
867
+ } else {
868
+ obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
869
+ }
870
+ }
871
+
872
+ selectedArray = jQuery.merge(selectedArray, obj);
873
+ } else {
874
+ if ( typeof obj == 'object' ) {
875
+ $(obj).data('fancybox', $.extend({}, opts, obj));
876
+ } else {
877
+ obj = $({}).data('fancybox', $.extend({content : obj}, opts));
878
+ }
879
+
880
+ selectedArray.push(obj);
881
+ }
882
+
883
+ if (selectedIndex > selectedArray.length || selectedIndex < 0) {
884
+ selectedIndex = 0;
885
+ }
886
+
887
+ $('html').css( { '--vertical-scrollbar' : window.innerWidth-$(window).width() + 'px', '--horizontal-scrollbar' : window.innerHeight-$(window).height() + 'px' } );
888
+
889
+ _start();
890
+ };
891
+
892
+ $.fancybox.showActivity = function() {
893
+ loading.attr('title',selectedOpts.txt.loading).show();
894
+ };
895
+
896
+ $.fancybox.hideActivity = function() {
897
+ loading.hide();
898
+ };
899
+
900
+ $.fancybox.next = function() {
901
+ var obj, pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex + 1;
902
+
903
+ if (pos >= currentArray.length) {
904
+ if (currentOpts.cyclic) {
905
+ pos = 0;
906
+ } else {
907
+ return;
908
+ }
909
+ }
910
+
911
+ obj = currentArray[pos];
912
+
913
+ if ( pos != currentIndex && typeof obj !== 'undefined' && typeof obj.href !== 'undefined' && obj.href === currentOpts.href ) {
914
+ $.fancybox.next( pos + 1 );
915
+ } else {
916
+ $.fancybox.pos( pos );
917
+ }
918
+
919
+ return;
920
+ };
921
+
922
+ $.fancybox.prev = function() {
923
+ var obj, pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex - 1;
924
+
925
+ if (pos < 0) {
926
+ if (currentOpts.cyclic) {
927
+ pos = currentArray.length - 1;
928
+ } else {
929
+ return;
930
+ }
931
+ }
932
+
933
+ obj = currentArray[pos];
934
+
935
+ if ( pos != currentIndex && typeof obj !== 'undefined' && typeof obj.href !== 'undefined' && obj.href === currentOpts.href ) {
936
+ $.fancybox.prev( pos - 1 );
937
+ } else {
938
+ $.fancybox.pos( pos );
939
+ }
940
+
941
+ return;
942
+ };
943
+
944
+ $.fancybox.pos = function(pos) {
945
+ if (busy) {
946
+ return;
947
+ }
948
+
949
+ pos = parseInt(pos);
950
+
951
+ if (currentArray.length > 1 && pos != currentIndex && pos > -1 && pos < currentArray.length) {
952
+ $(document).trigger('fancybox-change');
953
+
954
+ selectedArray = currentArray;
955
+ selectedIndex = pos;
956
+
957
+ wrap.off('mousewheel.fb touchstart.fb touchmove.fb touchend.fb mousedown.fb mousemove.fb mouseup.fb').css('cursor','initial');
958
+ content.off('click');
959
+
960
+ _start();
961
+ }
962
+
963
+ return;
964
+ };
965
+
966
+ $.fancybox.cancel = function() {
967
+ busy = true;
968
+
969
+ _abort();
970
+
971
+ $(document).trigger('fancybox-cancel', selectedArray, selectedIndex, selectedOpts);
972
+
973
+ if (selectedOpts && false === selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts) ) {
974
+ busy = false;
975
+ return;
976
+ };
977
+
978
+ $(selectedArray[ selectedIndex ]).focus();
979
+
980
+ $(close.add( nav_prev ).add( nav_next )).hide();
981
+
982
+ $(content.add( overlay )).off();
983
+
984
+ $(window).off('resize.fb');
985
+ $(wrap).off('mousewheel.fb touchstart.fb touchmove.fb touchend.fb mousedown.fb mousemove.fb mouseup.fb');
986
+ $(document).off('keydown.fb');
987
+
988
+ // This helps IE
989
+ if (/MSIE|Trident/.test(window.navigator.userAgent)) {
990
+ content.find('iframe#fancybox-frame').attr('src', '//about:blank');
991
+ }
992
+
993
+ wrap.stop();
994
+
995
+ _cleanup();
996
+ };
997
+
998
+ // Note: within an iframe use - parent.$.fancybox.close();
999
+ $.fancybox.close = function() {
1000
+ if (busy || wrap.is(':hidden')) {
1001
+ return;
1002
+ }
1003
+
1004
+ busy = true;
1005
+
1006
+ _abort();
1007
+
1008
+ $(document).trigger('fancybox-cleanup', currentArray, currentIndex, currentOpts);
1009
+
1010
+ if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
1011
+ busy = false;
1012
+ return;
1013
+ }
1014
+
1015
+ $(currentArray[ currentIndex ]).focus();
1016
+
1017
+ $(close.add( nav_prev ).add( nav_next )).hide();
1018
+
1019
+ $(content.add( overlay )).off();
1020
+
1021
+ $(window).off('resize.fb');
1022
+ $(wrap).off('mousewheel.fb touchstart.fb touchmove.fb touchend.fb mousedown.fb mousemove.fb mouseup.fb');
1023
+ $(document).off('keydown.fb');
1024
+
1025
+ // This helps IE
1026
+ if (/MSIE|Trident/.test(window.navigator.userAgent)) {
1027
+ content.find('iframe#fancybox-frame').attr('src', '//about:blank');
1028
+ }
1029
+
1030
+ if (currentOpts.titlePosition !== 'inside') {
1031
+ title.empty();
1032
+ }
1033
+
1034
+ wrap.stop();
1035
+
1036
+ if (currentOpts.transitionOut == 'elastic') {
1037
+ title.empty().hide();
1038
+
1039
+ wrap.animate(_get_orig_pos(), {
1040
+ duration : currentOpts.speedOut,
1041
+ easing : currentOpts.easingOut,
1042
+ complete : _closed
1043
+ });
1044
+
1045
+ } else {
1046
+ wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _closed);
1047
+ }
1048
+ };
1049
+
1050
+ $.fancybox.resize = function() {
1051
+ clearTimeout( resize_timeout );
1052
+
1053
+ resize_timeout = setTimeout( function() {
1054
+ var restore = [];
1055
+
1056
+ busy = true;
1057
+
1058
+ _process_title();
1059
+
1060
+ final_pos = _get_zoom_to();
1061
+
1062
+ close.is(':visible') && restore.push(close) && close.hide();
1063
+ nav_prev.is(':visible') && restore.push(nav_prev) && nav_prev.hide();
1064
+ nav_next.is(':visible') && restore.push(nav_next) && nav_next.hide();
1065
+
1066
+ wrap.animate(final_pos, {
1067
+ duration : currentOpts.changeSpeed,
1068
+ easing : currentOpts.easingChange,
1069
+ complete : function() {
1070
+ if (titleStr && titleStr.length) {
1071
+ title.fadeIn();
1072
+ }
1073
+ restore.forEach( function(el){ el.show(); } );
1074
+ busy = false;
1075
+ }
1076
+ });
1077
+ }, 500 );
1078
+ };
1079
+
1080
+ $.fancybox.init = function() {
1081
+ if ($("#fancybox-wrap").length) {
1082
+ return;
1083
+ }
1084
+
1085
+ $('body').append(
1086
+ tmp = $('<div id="fancybox-tmp"></div>'),
1087
+ loading = $('<div id="fancybox-loading" title="Cancel"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>'),
1088
+ overlay = $('<div id="fancybox-overlay"></div>'),
1089
+ wrap = $('<div id="fancybox-wrap" role="dialog" aria-hidden="true" aria-labelledby="fancybox-title" tabindex="-1"></div>')
1090
+ );
1091
+
1092
+ wrap.append(
1093
+ outer = $('<div id="fancybox-outer"></div>')
1094
+ );
1095
+
1096
+ outer.append(
1097
+ content = $('<div id="fancybox-content"></div>'),
1098
+ close = $('<a id="fancybox-close" href="javascript:;" title="Close" class="fancy-ico" tabindex="1"><span></span></a>'),
1099
+ nav_next = $('<a id="fancybox-next" href="javascript:;" title="Next" class="fancy-ico" tabindex="2"><span></span></a>'),
1100
+ nav_prev = $('<a id="fancybox-prev" href="javascript:;" title="Previous" class="fancy-ico" tabindex="3"><span></span></a>'),
1101
+ title = $('<div id="fancybox-title-wrap"></div>')
1102
+ );
1103
+
1104
+ close.click($.fancybox.close);
1105
+ loading.click($.fancybox.cancel);
1106
+
1107
+ nav_prev.click(function(e) {
1108
+ e.preventDefault();
1109
+ $.fancybox.prev();
1110
+ });
1111
+
1112
+ nav_next.click(function(e) {
1113
+ e.preventDefault();
1114
+ $.fancybox.next();
1115
+ });
1116
+ };
1117
+
1118
+ $.fn.fancybox.defaults = {
1119
+ padding : 10,
1120
+ margin : 40,
1121
+ modal : false,
1122
+ cyclic : false,
1123
+ allowfullscreen : false,
1124
+ scrolling : 'auto', // 'auto', 'yes' or 'no'
1125
+
1126
+ width : 560,
1127
+ height : 340,
1128
+
1129
+ autoScale : true,
1130
+ autoDimensions : true,
1131
+ autoResize : true,
1132
+ keepRatio : false,
1133
+ minViewportWidth : 0,
1134
+
1135
+ swipeThreshold: 80,
1136
+
1137
+ ajax : {},
1138
+ svg : { wmode: 'opaque' },
1139
+
1140
+ hideOnOverlayClick : true,
1141
+ hideOnContentClick : false,
1142
+
1143
+ overlayShow : true,
1144
+ overlayColor : '',
1145
+
1146
+ titleShow : true,
1147
+ titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
1148
+ titleFormat : null,
1149
+ titleFromAlt : true,
1150
+
1151
+ transitionIn : 'fade', // 'elastic', 'fade' or 'none'
1152
+ transitionOut : 'fade', // 'elastic', 'fade' or 'none'
1153
+
1154
+ speedIn : 400,
1155
+ speedOut : 400,
1156
+
1157
+ changeSpeed : 200,
1158
+ changeFade : 200,
1159
+
1160
+ easingIn : 'swing',
1161
+ easingOut : 'swing',
1162
+
1163
+ showCloseButton : true,
1164
+ showNavArrows : true,
1165
+ enableEscapeButton : true,
1166
+ enableKeyboardNav : true,
1167
+ enableSwipeNav : true,
1168
+
1169
+ txt: {
1170
+ error : {
1171
+ content : 'The requested content cannot be loaded.',
1172
+ later : 'Please try again later.',
1173
+ type : 'No content type found.',
1174
+ image : 'No image found.',
1175
+ unexpected : 'Unexpected response.'
1176
+ },
1177
+ loading : 'Cancel',
1178
+ close : 'Close',
1179
+ next : 'Next',
1180
+ prev : 'Previous'
1181
+ },
1182
+
1183
+ onStart : function(){},
1184
+ onCancel : function(){},
1185
+ onComplete : function(){},
1186
+ onCleanup : function(){},
1187
+ onClosed : function(){},
1188
+ onError : function(){}
1189
+ };
1190
+
1191
+ $(document).ready(function() {
1192
+ $.fancybox.init();
1193
+ });
1194
+
1195
+ })(jQuery);
fancybox/1.5.0/jquery.fancybox.min.css ADDED
@@ -0,0 +1 @@
 
1
+ html.fancybox-active,html.fancybox-active body{touch-action:none;overscroll-behavior:none;-webkit-overflow-scrolling:auto;overflow:hidden;}html.fancybox-active body{margin-right:var(--vertical-scrollbar);margin-bottom:var(--horizontal-scrollbar);}html.fancybox-active body.rtl{margin-right:0;margin-left:var(--vertical-scrollbar);}#fancybox-loading,#fancybox-loading div,#fancybox-overlay,#fancybox-wrap *,#fancybox-wrap *::before,#fancybox-wrap *::after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}#fancybox-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.7);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;z-index:111101;display:none;outline:none!important;}#fancybox-outer{position:relative;width:100%;height:100%;box-shadow:0 0 20px #111;-moz-box-shadow:0 0 20px #111;-webkit-box-shadow:0 0 20px #111;}#fancybox-content{position:relative;width:100%;height:100%;-webkit-overflow-scrolling:touch;overflow-y:auto;z-index:111102;border:0 solid #fff;background:#fff;background-clip:padding-box;}#fancybox-content>div{max-width:100%;max-height:100%;}#fancybox-error{color:#444;padding:14px;margin:0;}#fancybox-frame,#fancybox-img{width:100%;height:100%;border:none;}#fancybox-img{position:absolute;padding:0;margin:0;line-height:0;vertical-align:top;max-width:none!important;max-height:none!important}#fancybox-frame{display:block;z-index:0}.fancy-ico{position:absolute;width:48px;height:48px;border-radius:50%;}.fancy-ico span{display:block;position:relative;left:12px;top:12px;width:24px;height:24px;border-radius:50%;background:#000;border:2px solid white;box-shadow:0 0 4px #000;transition:transform .25s ease-in-out;}#fancybox-close:hover span,#fancybox-next:hover span,body.rtl #fancybox-prev:hover span{transform:rotate(360deg);}#fancybox-prev:hover span,body.rtl #fancybox-next:hover span{transform:rotate(-360deg);}#fancybox-close{top:-24px;right:-24px;cursor:pointer;z-index:111105;display:none;}#fancybox-close span::after,#fancybox-close span::before{content:'';position:absolute;top:9px;left:4px;width:12px;height:2px;background-color:#fff;}#fancybox-close span::before{transform:rotate(45deg);}#fancybox-close span::after{transform:rotate(-45deg);}#fancybox-prev,#fancybox-next{top:50%;margin-top:-24px;cursor:pointer;z-index:111102;display:none;}#fancybox-next,body.rtl #fancybox-prev{left:auto;right:-24px;}#fancybox-prev,body.rtl #fancybox-next{left:-24px;right:auto;}#fancybox-prev span::after,#fancybox-next span::after{content:'';position:absolute;top:6px;width:8px;height:8px;border-top:2px solid #fff;border-right:2px solid #fff;}#fancybox-prev span::after,body.rtl #fancybox-next span::after{transform:rotate(-135deg);left:7px;}#fancybox-next span::after,body.rtl #fancybox-prev span::after{transform:rotate(45deg);left:initial;right:7px;}#fancybox-title-wrap{z-index:111104;}.fancybox-title-inside{padding-bottom:10px;text-align:center;color:#333;background-color:#fff;position:relative;}.fancybox-title-outside{padding-top:10px;color:#fff;font-weight:600;}.fancybox-title-over{position:absolute;width:100%;bottom:0;left:0;color:#fff;text-align:left;}body.rtl .fancybox-title-over{text-align:right}.fancybox-title-over #fancybox-title{padding:10px;background:rgba(0,0,0,.6);display:block;}.fancybox-title-float{text-align:center;}.fancybox-title-float #fancybox-title{display:table;margin:-12px auto;height:24px;padding:0 15px;line-height:20px;font-size:16px;color:#fff;background:#000;border:2px solid #fff;border-radius:12px;box-shadow:0 0 4px #000;position:relative;z-index:111104;}#fancybox-loading{position:fixed;top:50%;left:50%;width:40px;height:40px;margin-top:-20px;margin-left:-20px;background-color:rgba(0,0,0,.9);border-radius:5px;cursor:pointer;overflow:hidden;z-index:111104;display:none;}#fancybox-loading div{transform-origin:20px 20px;animation:fancybox-loading 1.2s linear infinite;}#fancybox-loading div::after{content:'';display:block;position:absolute;top:7px;left:19px;width:2px;height:7px;border-radius:20%;background:#fff;}#fancybox-loading div:nth-child(1){transform:rotate(0deg);animation-delay:-1.1s;}#fancybox-loading div:nth-child(2){transform:rotate(30deg);animation-delay:-1s;}#fancybox-loading div:nth-child(3){transform:rotate(60deg);animation-delay:-.9s;}#fancybox-loading div:nth-child(4){transform:rotate(90deg);animation-delay:-.8s;}#fancybox-loading div:nth-child(5){transform:rotate(120deg);animation-delay:-.7s;}#fancybox-loading div:nth-child(6){transform:rotate(150deg);animation-delay:-.6s;}#fancybox-loading div:nth-child(7){transform:rotate(180deg);animation-delay:-.5s;}#fancybox-loading div:nth-child(8){transform:rotate(210deg);animation-delay:-.4s;}#fancybox-loading div:nth-child(9){transform:rotate(240deg);animation-delay:-.3s;}#fancybox-loading div:nth-child(10){transform:rotate(270deg);animation-delay:-.2s;}#fancybox-loading div:nth-child(11){transform:rotate(300deg);animation-delay:-.1s;}#fancybox-loading div:nth-child(12){transform:rotate(330deg);animation-delay:0s;}@keyframes fancybox-loading{0%{opacity:1}100%{opacity:0}}.fancybox-hidden{display:none;}#fancybox-content .fancybox-hidden,#fancybox-tmp .fancybox-hidden{display:revert;}
fancybox/1.5.0/jquery.fancybox.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t,n,o,i,a,r,c,d,s,l,f,h,u,p,b,g=0,m={},v=[],y=0,w={},x=[],_=null,C=new Image,k=/\.(jpg|gif|png|bmp|jpeg|webp)(.*)?$/i,I=/[^\.]\.(svg)\s*$/i,N=/[^\.]\.(pdf)\s*$/i,S=0,T="",O=!1,j=!1,A=(window.devicePixelRatio,"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);_abort=function(){e.fancybox.hideActivity(),C.onerror=C.onload=null,_&&_.abort(),t.empty()},_error=function(n){if(!1===m.onError(v,g,m))return e.fancybox.hideActivity(),void(O=!1);void 0===n&&(n=m.txt.error.later),m.type="html",m.enableSwipeNav=!1,m.titleShow=!1,m.width="auto",m.height="auto",t.html('<p id="fancybox-error">'+m.txt.error.content+"<br />"+n+"</p>"),_process_inline()},_start=function(){var n,o,i,a,c=v[g];if(_abort(),m=e.extend({},e.fn.fancybox.defaults,void 0===e(c).data("fancybox")?m:e(c).data("fancybox")),e("html").addClass("fancybox-active"),e(document).trigger("fancybox-start",v,g,m),!1!==(a=m.onStart(v,g,m)))if("object"==typeof a&&(m=e.extend(m,a)),i=m.title||(c.nodeName?e(c).attr("title"):c.title)||"",c.nodeName&&!m.orig&&(m.orig=e(c).find("img:first").length?e(c).find("img:first"):e(c)),""===i&&m.orig&&(i=m.orig.attr("title")||(m.titleFromAlt?m.orig.attr("alt"):"")),n=m.href||(c.nodeName?e(c).attr("href"):c.href)||null,(/^(?:javascript)/i.test(n)||"#"==n)&&(n=null),m.type?(o=m.type,n||(n=m.content)):m.content?o="html":e(c).hasClass("iframe")?o="iframe":n&&(o=n.match(k)||e(c).hasClass("image")?"image":n.match(I)?"svg":n.match(N)?"pdf":0===n.indexOf("#")?"inline":"ajax"),o)switch(e(c).hasClass("modal")&&(m.modal=!0),"inline"==o&&(c=n.substr(n.indexOf("#")),o=e(c).length>0?"inline":"ajax"),m.type=o,m.href=n,m.title=i,m.autoDimensions&&("html"==m.type||"inline"==m.type||"ajax"==m.type?(m.width="auto",m.height="auto"):m.autoDimensions=!1),m.modal&&(m.overlayShow=!0,m.hideOnOverlayClick=!1,m.hideOnContentClick=!1,m.enableEscapeButton=!1,m.showCloseButton=!1),m.padding=parseInt(m.padding,10),m.margin=parseInt(m.margin,10),t.css("padding",m.padding+m.margin),m.enableEscapeButton&&e(document).on("keydown.fb",(function(t){if(27==t.keyCode)return t.preventDefault(),e.fancybox.cancel(),!1})),o){case"html":t.html(m.content),m.enableSwipeNav=!1,_process_inline();break;case"inline":if(!0===e(c).parent().is("#fancybox-content"))return void(O=!1);m.enableSwipeNav=!1,e(c).clone().attr("id",e(c).attr("id")+"-tmp").insertBefore(e(c)),e(document).on("fancybox-cleanup fancybox-change",(function(){let t=r.children().children();e("#"+t.attr("id")+"-tmp").replaceWith(t)})).on("fancybox-cancel",(function(){let n=t.children();n.length||(n=r.children().children()),e("#"+n.attr("id")+"-tmp").replaceWith(n)})),e(c).appendTo(t),_process_inline();break;case"image":m.keepRatio=!0,O=!1,(C=new Image).onerror=function(){_error(m.txt.error.image)},C.onload=function(){O=!0,e.fancybox.hideActivity(),C.onerror=C.onload=null,m.width=C.width,m.height=C.height,e("<img />").attr({id:"fancybox-img",src:C.src,alt:m.title}).appendTo(t),_show()},C.src=n,e.fancybox.showActivity();break;case"svg":m.scrolling="no",m.keepRatio=!0;var d='<object type="image/svg+xml" width="'+m.width+'" height="'+m.height+'" data="'+n+'"></object>';t.html(d),_process_inline();break;case"pdf":m.scrolling="no",m.enableSwipeNav=!1;d='<object type="application/pdf" width="100%" height="100%" data="'+n+'"><a href="'+n+'" style="display:block;position:absolute;top:48%;width:100%;text-align:center">'+e(c).html()+"</a></object>";t.html(d),_process_inline();break;case"ajax":m.enableKeyboardNav=!1,m.showNavArrows=!1,m.enableSwipeNav=!1,O=!1,e.fancybox.showActivity(),m.ajax.win=m.ajax.success,_=e.ajax(e.extend({},m.ajax,{url:n,data:m.ajax.data||{},error:function(){arguments[0].status>0&&_error(arguments[2])},success:function(o,i,r){if(200==("object"==typeof r?r:_).status){if("function"==typeof m.ajax.win){if(!1===(a=m.ajax.win(n,o,i,r)))return void e.fancybox.hideActivity();"string"!=typeof a&&"object"!=typeof a||(o=a)}o.indexOf("<!DOCTYPE")>-1||o.indexOf("<html")>-1||o.indexOf("<body")>-1?_error(m.txt.error.unexpected):(t.html(o),_process_inline())}}}));break;case"iframe":m.enableSwipeNav=!1,e.fancybox.showActivity(),_show();break}else _error(m.txt.error.type);else O=!1},_process_inline=function(){var n=m.width,o=m.height;e.fancybox.hideActivity(),n=n.toString().indexOf("%")>-1?parseInt((window.innerWidth-2*m.margin)*parseFloat(n)/100,10)+"px":"auto"==n?"auto":n+"px",o=o.toString().indexOf("%")>-1?parseInt((window.innerHeight-2*m.margin)*parseFloat(o)/100,10)+"px":"auto"==o?"auto":o+"px",t.wrapInner('<div style="width:'+n+";height:"+o+';overflow:hidden;position:relative;"></div>'),m.width=t.width(),m.height=t.height(),_show()},_show=function(){if(O=!0,e(r.add(o)).off(),e(window).off("resize.fb"),h=w.type,x=v,y=g,(w=m).overlayShow?(w.overlayColor&&o.css("background-color",w.overlayColor),w.hideOnOverlayClick&&o.css("cursor","pointer"),o.is(":visible")||o.fadeIn("fast")):o.hide(),_process_title(),u=_get_zoom_to(),i.is(":visible"))return e(c.add(s).add(l)).hide(),void("image"===h&&"image"===w.type?(r.prepend(t.contents()),r.children().first().next().fadeOut(w.changeSpeed,(function(){e(this).remove()})),r.css("border-width",w.padding),i.animate(u,{duration:w.changeSpeed,easing:w.easingChange,complete:_finish})):r.fadeTo(w.changeFade,.3,(function(){r.css("border-width",w.padding),i.animate(u,{duration:w.changeSpeed,easing:w.easingChange,complete:function(){r.html(t.contents()).fadeTo(w.changeFade,1,_finish)}})})));i.removeAttr("style"),r.css("border-width",w.padding),r.html(t.contents()),"elastic"==w.transitionIn?(i.css(_get_orig_pos()).show(),u.opacity=1,i.attr("aria-hidden","false").animate(u,{duration:w.speedIn,easing:w.easingIn,complete:_finish})):i.css(u).attr("aria-hidden","false").fadeIn("none"==w.transitionIn?0:w.speedIn,_finish)},_format_title=function(e){return!(!e||!e.length)&&'<div id="fancybox-title">'+e+"</div>"},_process_title=function(){if(T=w.title||"",S=0,d.empty().removeAttr("style").removeClass(),!1!==w.titleShow)if((T=e.isFunction(w.titleFormat)?w.titleFormat(T,x,y,w):_format_title(T))&&""!==T){switch(d.addClass("fancybox-title-"+w.titlePosition).html(T).appendTo("body").show(),w.titlePosition){case"outside":case"inside":S=d.outerHeight(!0),d.appendTo(a);break;case"over":r.is(":visible")?d.appendTo(r):d.appendTo(t);break;default:d.css({paddingLeft:w.padding,paddingRight:w.padding}).appendTo(i)}d.hide()}else d.hide();else d.hide()},_swipe=function(){let t=p-b;p=b=0,Math.abs(t)<w.swipeThreshold||(t<0?e.fancybox.prev():e.fancybox.next())},_set_navigation=function(){1!==x.length&&(w.enableSwipeNav&&(i.css("cursor","move"),i.on("mousedown.fb",(function(e){e.preventDefault(),p=b=void 0!==e.clientX?e.clientX:e.originalEvent.clientX,i.on("mousemove.fb",(function(e){b=void 0!==e.clientX?e.clientX:e.originalEvent.clientX}))})),i.on("mouseup.fb",(function(){i.off("mousemove.fb"),_swipe()})),A&&(i.on("touchstart.fb",(function(e){j=1===e.touches.length,p=b=void 0!==e.touches?e.touches[0].clientX:e.originalEvent.touches[0].clientX,i.on("touchmove.fb",(function(e){1===e.touches.length?b=void 0!==e.touches?e.touches[0].clientX:e.originalEvent.touches[0].clientX:(j=!1,i.off("touchmove.fb"))}))})),i.on("touchend.fb",(function(){i.off("touchmove.fb"),j&&(j=!1,_swipe())})))),e.fn.mousewheel&&i.on("mousewheel.fb",(function(t,n){O?t.preventDefault():"image"!=w.type||0!=e(t.target).outerHeight()&&e(t.target).prop("scrollHeight")!==e(t.target).outerHeight()||(t.preventDefault(),e.fancybox[n>0?"prev":"next"]())})),e(document).off("keydown.fb"),(w.enableEscapeButton||w.enableKeyboardNav)&&e(document).on("keydown.fb",(function(t){if(w.enableEscapeButton&&27==t.keyCode)return t.preventDefault(),e.fancybox.close(),!1;!w.enableKeyboardNav||37!=t.keyCode&&39!=t.keyCode||"INPUT"===t.target.tagName||"TEXTAREA"===t.target.tagName||"SELECT"===t.target.tagName?w.enableKeyboardNav&&9==t.keyCode&&"INPUT"!==t.target.tagName&&"TEXTAREA"!==t.target.tagName&&"SELECT"!==t.target.tagName&&(t.preventDefault(),e.fancybox[t.shiftKey?"prev":"next"]()):(t.preventDefault(),e.fancybox[37==t.keyCode?"prev":"next"]())})),w.showNavArrows&&((w.cyclic||0!==y)&&s.attr("title",w.txt.prev).show(),(w.cyclic||y!=x.length-1)&&l.attr("title",w.txt.next).show()))},_finish=function(){T&&T.length&&d.fadeIn(),w.showCloseButton&&c.attr("title",w.txt.close).show(),_set_navigation(),w.hideOnContentClick&&r.on("click",e.fancybox.close).css("cursor","pointer"),w.hideOnOverlayClick&&o.on("click",e.fancybox.close),w.autoResize&&e(window).on("resize.fb",e.fancybox.resize),"iframe"==w.type&&e('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" style="border:0;margin:0;overflow:'+("auto"==w.scrolling?"auto":"yes"==w.scrolling?"scroll":"hidden")+'" src="'+w.href+'"'+(!1===w.allowfullscreen?"":" allowfullscreen")+' allow="autoplay; encrypted-media" tabindex="999"></iframe>').appendTo(r).on("load",(function(){e.fancybox.hideActivity()})),"inline"!=w.type&&"html"!=w.type||e(r).children().css("overflow","auto"==w.scrolling?"auto":"yes"==w.scrolling?"scroll":"hidden"),i.show().focus(),O=!1,e(document).trigger("fancybox-complete",x,y,w),w.onComplete(x,y,w),x.length>1&&(_preload_next(),_preload_prev())},_preload_next=function(){var e="number"==typeof arguments[0]?arguments[0]:y+1;if(e>=x.length){if(!w.cyclic)return;e=0}if(e==y)return w.enableKeyboardNav=!1,w.enableSwipeNav=!1,i.off("mousewheel.fb touchstart.fb touchmove.fb touchend.fb mousedown.fb mousemove.fb mouseup.fb"),void l.hide();_preload_image(e)||_preload_next(e+1)},_preload_prev=function(){var e="number"==typeof arguments[0]?arguments[0]:y-1;if(e<0){if(!w.cyclic)return;e=x.length-1}if(e==y)return w.enableKeyboardNav=!1,w.enableSwipeNav=!1,i.off("mousewheel.fb touchstart.fb touchmove.fb touchend.fb mousedown.fb mousemove.fb mouseup.fb"),void s.hide();_preload_image(e)||_preload_prev(e-1)},_preload_image=function(t){var n=x[t];return!(void 0===n||void 0===n.href||n.href===w.href||!n.href.match(k)&&!e(n).hasClass("image"))&&((new Image).src=n.href,!0)},_get_zoom_to=function(){var t=[window.innerWidth-2*w.margin,window.innerHeight-2*w.margin-S,e(document).scrollLeft()+w.margin,e(document).scrollTop()+w.margin],n={},o=w.keepRatio&&w.height?w.width/w.height:1;return w.width.toString().indexOf("%")>-1?n.width=parseInt(t[0]*parseFloat(w.width)/100,10):n.width=w.width+2*w.padding,w.height.toString().indexOf("%")>-1?n.height=parseInt(t[1]*parseFloat(w.height)/100,10):n.height=w.height+2*w.padding,w.autoScale&&n.width>t[0]&&(n.width=t[0]-2*w.padding,n.height=parseInt(n.width/o,10)),w.autoScale&&n.height>t[1]&&(n.height=t[1]-2*w.padding,n.width=parseInt(n.height*o,10)),n.left=parseInt(Math.max(t[2],t[2]+(t[0]-n.width)/2),10),n.top=parseInt(Math.max(t[3],t[3]+(t[1]-n.height)/2),10),n},_get_orig_pos=function(){if(!m.orig)return!1;var t=e(m.orig);if(!t.length)return!1;var n=t.offset();return n.top+=parseInt(t.css("paddingTop"),10)||parseInt(t.css("border-top-width"),10)||0,n.left+=parseInt(t.css("paddingLeft"),10)||parseInt(t.css("border-left-width"),10)||0,{width:t.width()+2*w.padding,height:t.height()+2*w.padding,top:n.top-w.padding,left:n.left-w.padding,opacity:0}},_closed=function(){o.fadeOut("fast"),e(document).trigger("fancybox-closed",x,y,w),w.onClosed(x,y,w),_cleanup()},_cleanup=function(){o.hide(),d.empty().hide(),i.hide().attr("aria-hidden","true"),r.empty(),x=v=[],y=g=0,w=m={},e("html").css({"--vertical-scrollbar":"","--horizontal-scrollbar":""}),e("html").removeClass("fancybox-active"),e(document).off("fancybox-cancel fancybox-change fancybox-cleanup fancybox-closed"),O=!1},e.fn.fancybox=function(t){if(!e(this).length)return this;let n=e.extend({},t,e.metadata?e(this).metadata():{});return(!n.minViewportWidth||document.documentElement.clientWidth>=n.minViewportWidth)&&e(this).data("fancybox",n).attr({"aria-controls":"fancybox","aria-haspopup":"dialog"}).off("click.fb").on("click.fb",(function(t){if(t.preventDefault(),O)return!1;O=!0,e(this).blur(),v=[],g=0;var n=e(this).attr("rel")||"";return""==n||""==n.replace(/alternate|external|help|license|nofollow|noreferrer|noopener|\s+/gi,"")?v.push(this):(v=e('a[rel="'+n+'"], area[rel="'+n+'"]'),g=v.index(this)),e("html").css({"--vertical-scrollbar":window.innerWidth-e(window).width()+"px","--horizontal-scrollbar":window.innerHeight-e(window).height()+"px"}),_start(),!1})),this},e.fancybox=function(t){var n;if(!O){if(O=!0,n=void 0!==arguments[1]?arguments[1]:{},v=[],g=parseInt(n.index,10)||0,e.isArray(t)){for(var o=0,i=t.length;o<i;o++)"object"==typeof t[o]?e(t[o]).data("fancybox",e.extend({},n,t[o])):t[o]=e({}).data("fancybox",e.extend({content:t[o]},n));v=jQuery.merge(v,t)}else"object"==typeof t?e(t).data("fancybox",e.extend({},n,t)):t=e({}).data("fancybox",e.extend({content:t},n)),v.push(t);(g>v.length||g<0)&&(g=0),e("html").css({"--vertical-scrollbar":window.innerWidth-e(window).width()+"px","--horizontal-scrollbar":window.innerHeight-e(window).height()+"px"}),_start()}},e.fancybox.showActivity=function(){n.attr("title",m.txt.loading).show()},e.fancybox.hideActivity=function(){n.hide()},e.fancybox.next=function(){var t,n="number"==typeof arguments[0]?arguments[0]:y+1;if(n>=x.length){if(!w.cyclic)return;n=0}t=x[n],n!=y&&void 0!==t&&void 0!==t.href&&t.href===w.href?e.fancybox.next(n+1):e.fancybox.pos(n)},e.fancybox.prev=function(){var t,n="number"==typeof arguments[0]?arguments[0]:y-1;if(n<0){if(!w.cyclic)return;n=x.length-1}t=x[n],n!=y&&void 0!==t&&void 0!==t.href&&t.href===w.href?e.fancybox.prev(n-1):e.fancybox.pos(n)},e.fancybox.pos=function(t){O||(t=parseInt(t),x.length>1&&t!=y&&t>-1&&t<x.length&&(e(document).trigger("fancybox-change"),v=x,g=t,i.off("mousewheel.fb touchstart.fb touchmove.fb touchend.fb mousedown.fb mousemove.fb mouseup.fb").css("cursor","initial"),r.off("click"),_start()))},e.fancybox.cancel=function(){O=!0,_abort(),e(document).trigger("fancybox-cancel",v,g,m),m&&!1===m.onCancel(v,g,m)?O=!1:(e(v[g]).focus(),e(c.add(s).add(l)).hide(),e(r.add(o)).off(),e(window).off("resize.fb"),e(i).off("mousewheel.fb touchstart.fb touchmove.fb touchend.fb mousedown.fb mousemove.fb mouseup.fb"),e(document).off("keydown.fb"),/MSIE|Trident/.test(window.navigator.userAgent)&&r.find("iframe#fancybox-frame").attr("src","//about:blank"),i.stop(),_cleanup())},e.fancybox.close=function(){O||i.is(":hidden")||(O=!0,_abort(),e(document).trigger("fancybox-cleanup",x,y,w),w&&!1===w.onCleanup(x,y,w)?O=!1:(e(x[y]).focus(),e(c.add(s).add(l)).hide(),e(r.add(o)).off(),e(window).off("resize.fb"),e(i).off("mousewheel.fb touchstart.fb touchmove.fb touchend.fb mousedown.fb mousemove.fb mouseup.fb"),e(document).off("keydown.fb"),/MSIE|Trident/.test(window.navigator.userAgent)&&r.find("iframe#fancybox-frame").attr("src","//about:blank"),"inside"!==w.titlePosition&&d.empty(),i.stop(),"elastic"==w.transitionOut?(d.empty().hide(),i.animate(_get_orig_pos(),{duration:w.speedOut,easing:w.easingOut,complete:_closed})):i.fadeOut("none"==w.transitionOut?0:w.speedOut,_closed)))},e.fancybox.resize=function(){clearTimeout(f),f=setTimeout((function(){var e=[];O=!0,_process_title(),u=_get_zoom_to(),c.is(":visible")&&e.push(c)&&c.hide(),s.is(":visible")&&e.push(s)&&s.hide(),l.is(":visible")&&e.push(l)&&l.hide(),i.animate(u,{duration:w.changeSpeed,easing:w.easingChange,complete:function(){T&&T.length&&d.fadeIn(),e.forEach((function(e){e.show()})),O=!1}})}),500)},e.fancybox.init=function(){e("#fancybox-wrap").length||(e("body").append(t=e('<div id="fancybox-tmp"></div>'),n=e('<div id="fancybox-loading" title="Cancel"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>'),o=e('<div id="fancybox-overlay"></div>'),i=e('<div id="fancybox-wrap" role="dialog" aria-hidden="true" aria-labelledby="fancybox-title" tabindex="-1"></div>')),i.append(a=e('<div id="fancybox-outer"></div>')),a.append(r=e('<div id="fancybox-content"></div>'),c=e('<a id="fancybox-close" href="javascript:;" title="Close" class="fancy-ico" tabindex="1"><span></span></a>'),l=e('<a id="fancybox-next" href="javascript:;" title="Next" class="fancy-ico" tabindex="2"><span></span></a>'),s=e('<a id="fancybox-prev" href="javascript:;" title="Previous" class="fancy-ico" tabindex="3"><span></span></a>'),d=e('<div id="fancybox-title-wrap"></div>')),c.click(e.fancybox.close),n.click(e.fancybox.cancel),s.click((function(t){t.preventDefault(),e.fancybox.prev()})),l.click((function(t){t.preventDefault(),e.fancybox.next()})))},e.fn.fancybox.defaults={padding:10,margin:40,modal:!1,cyclic:!1,allowfullscreen:!1,scrolling:"auto",width:560,height:340,autoScale:!0,autoDimensions:!0,autoResize:!0,keepRatio:!1,minViewportWidth:0,swipeThreshold:80,ajax:{},svg:{wmode:"opaque"},hideOnOverlayClick:!0,hideOnContentClick:!1,overlayShow:!0,overlayColor:"",titleShow:!0,titlePosition:"float",titleFormat:null,titleFromAlt:!0,transitionIn:"fade",transitionOut:"fade",speedIn:400,speedOut:400,changeSpeed:200,changeFade:200,easingIn:"swing",easingOut:"swing",showCloseButton:!0,showNavArrows:!0,enableEscapeButton:!0,enableKeyboardNav:!0,enableSwipeNav:!0,txt:{error:{content:"The requested content cannot be loaded.",later:"Please try again later.",type:"No content type found.",image:"No image found.",unexpected:"Unexpected response."},loading:"Cancel",close:"Close",next:"Next",prev:"Previous"},onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}},e(document).ready((function(){e.fancybox.init()}))}(jQuery);
fancybox/2.2.0/fancybox_loading.gif ADDED
Binary file
fancybox/2.2.0/fancybox_loading@2x.gif ADDED
Binary file
fancybox/2.2.0/fancybox_sprite.png ADDED
Binary file
fancybox/2.2.0/fancybox_sprite@2x.png ADDED
Binary file
fancybox/2.2.0/helpers/fancybox_buttons.png ADDED
Binary file
fancybox/2.2.0/helpers/jquery.fancybox-buttons.css ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #fancybox-buttons {
2
+ position: fixed;
3
+ left: 0;
4
+ width: 100%;
5
+ z-index: 8050;
6
+ }
7
+
8
+ #fancybox-buttons.top {
9
+ top: 10px;
10
+ }
11
+
12
+ #fancybox-buttons.bottom {
13
+ bottom: 10px;
14
+ }
15
+
16
+ #fancybox-buttons ul {
17
+ display: block;
18
+ width: 166px;
19
+ height: 30px;
20
+ margin: 0 auto;
21
+ padding: 0;
22
+ list-style: none;
23
+ border: 1px solid #111;
24
+ border-radius: 3px;
25
+ box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
26
+ background: rgb(50,50,50);
27
+ background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
28
+ background: linear-gradient(to bottom, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
29
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 );
30
+ }
31
+
32
+ #fancybox-buttons ul li {
33
+ float: left;
34
+ margin: 0;
35
+ padding: 0;
36
+ }
37
+
38
+ #fancybox-buttons a {
39
+ display: block;
40
+ width: 30px;
41
+ height: 30px;
42
+ text-indent: -9999px;
43
+ background-color: transparent;
44
+ background-image: url('fancybox_buttons.png');
45
+ background-repeat: no-repeat;
46
+ outline: none;
47
+ opacity: 0.8;
48
+ }
49
+
50
+ #fancybox-buttons a:hover {
51
+ opacity: 1;
52
+ }
53
+
54
+ #fancybox-buttons a.btnPrev {
55
+ background-position: 5px 0;
56
+ }
57
+
58
+ #fancybox-buttons a.btnNext {
59
+ background-position: -33px 0;
60
+ border-right: 1px solid #3e3e3e;
61
+ }
62
+
63
+ #fancybox-buttons a.btnPlay {
64
+ background-position: 0 -30px;
65
+ }
66
+
67
+ #fancybox-buttons a.btnPlayOn {
68
+ background-position: -30px -30px;
69
+ }
70
+
71
+ #fancybox-buttons a.btnToggle {
72
+ background-position: 3px -60px;
73
+ border-left: 1px solid #111;
74
+ border-right: 1px solid #3e3e3e;
75
+ width: 35px
76
+ }
77
+
78
+ #fancybox-buttons a.btnToggleOn {
79
+ background-position: -27px -60px;
80
+ }
81
+
82
+ #fancybox-buttons a.btnClose {
83
+ border-left: 1px solid #111;
84
+ width: 35px;
85
+ background-position: -56px 0px;
86
+ }
87
+
88
+ #fancybox-buttons a.btnDisabled {
89
+ opacity : 0.4;
90
+ cursor: default;
91
+ }
fancybox/2.2.0/helpers/jquery.fancybox-buttons.js ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Buttons helper for fancyBox
3
+ * version: 1.0.5 (Mon, 15 Oct 2012)
4
+ * @requires fancyBox v2.0 or later
5
+ *
6
+ * Usage:
7
+ * $(".fancybox").fancybox({
8
+ * helpers : {
9
+ * buttons: {
10
+ * position : 'top'
11
+ * }
12
+ * }
13
+ * });
14
+ *
15
+ */
16
+ ;(function ($) {
17
+ //Shortcut for fancyBox object
18
+ var F = $.fancybox;
19
+
20
+ //Add helper object
21
+ F.helpers.buttons = {
22
+ defaults : {
23
+ skipSingle : false, // disables if gallery contains single image
24
+ position : 'top', // 'top' or 'bottom'
25
+ tpl : '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:;"></a></li></ul></div>'
26
+ },
27
+
28
+ list : null,
29
+ buttons: null,
30
+
31
+ beforeLoad: function (opts, obj) {
32
+ //Remove self if gallery do not have at least two items
33
+
34
+ if (opts.skipSingle && obj.group.length < 2) {
35
+ obj.helpers.buttons = false;
36
+ obj.closeBtn = true;
37
+
38
+ return;
39
+ }
40
+
41
+ //Increase top margin to give space for buttons
42
+ obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30;
43
+ },
44
+
45
+ onPlayStart: function () {
46
+ if (this.buttons) {
47
+ this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn');
48
+ }
49
+ },
50
+
51
+ onPlayEnd: function () {
52
+ if (this.buttons) {
53
+ this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn');
54
+ }
55
+ },
56
+
57
+ afterShow: function (opts, obj) {
58
+ var buttons = this.buttons;
59
+
60
+ if (!buttons) {
61
+ this.list = $(opts.tpl).addClass(opts.position).appendTo('body');
62
+
63
+ buttons = {
64
+ prev : this.list.find('.btnPrev').click( F.prev ),
65
+ next : this.list.find('.btnNext').click( F.next ),
66
+ play : this.list.find('.btnPlay').click( F.play ),
67
+ toggle : this.list.find('.btnToggle').click( F.toggle ),
68
+ close : this.list.find('.btnClose').click( F.close )
69
+ }
70
+ }
71
+
72
+ //Prev
73
+ if (obj.index > 0 || obj.loop) {
74
+ buttons.prev.removeClass('btnDisabled');
75
+ } else {
76
+ buttons.prev.addClass('btnDisabled');
77
+ }
78
+
79
+ //Next / Play
80
+ if (obj.loop || obj.index < obj.group.length - 1) {
81
+ buttons.next.removeClass('btnDisabled');
82
+ buttons.play.removeClass('btnDisabled');
83
+
84
+ } else {
85
+ buttons.next.addClass('btnDisabled');
86
+ buttons.play.addClass('btnDisabled');
87
+ }
88
+
89
+ this.buttons = buttons;
90
+
91
+ this.onUpdate(opts, obj);
92
+ },
93
+
94
+ onUpdate: function (opts, obj) {
95
+ var toggle;
96
+
97
+ if (!this.buttons) {
98
+ return;
99
+ }
100
+
101
+ toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn');
102
+
103
+ //Size toggle button
104
+ if (obj.canShrink) {
105
+ toggle.addClass('btnToggleOn');
106
+
107
+ } else if (!obj.canExpand) {
108
+ toggle.addClass('btnDisabled');
109
+ }
110
+ },
111
+
112
+ beforeClose: function () {
113
+ if (this.list) {
114
+ this.list.remove();
115
+ }
116
+
117
+ this.list = null;
118
+ this.buttons = null;
119
+ }
120
+ };
121
+
122
+ }(jQuery));
fancybox/2.2.0/helpers/jquery.fancybox-buttons.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #fancybox-buttons{position:fixed;left:0;width:100%;z-index:8050;}#fancybox-buttons.top{top:10px;}#fancybox-buttons.bottom{bottom:10px;}#fancybox-buttons ul{display:block;width:166px;height:30px;margin:0 auto;padding:0;list-style:none;border:1px solid #111;border-radius:3px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.05);background:rgb(50,50,50);background:-ms-linear-gradient(top,rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);background:linear-gradient(to bottom,rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444',endColorstr='#222222',GradientType=0);}#fancybox-buttons ul li{float:left;margin:0;padding:0;}#fancybox-buttons a{display:block;width:30px;height:30px;text-indent:-9999px;background-color:transparent;background-image:url('fancybox_buttons.png');background-repeat:no-repeat;outline:none;opacity:.8;}#fancybox-buttons a:hover{opacity:1;}#fancybox-buttons a.btnPrev{background-position:5px 0;}#fancybox-buttons a.btnNext{background-position:-33px 0;border-right:1px solid #3e3e3e;}#fancybox-buttons a.btnPlay{background-position:0 -30px;}#fancybox-buttons a.btnPlayOn{background-position:-30px -30px;}#fancybox-buttons a.btnToggle{background-position:3px -60px;border-left:1px solid #111;border-right:1px solid #3e3e3e;width:35px}#fancybox-buttons a.btnToggleOn{background-position:-27px -60px;}#fancybox-buttons a.btnClose{border-left:1px solid #111;width:35px;background-position:-56px 0;}#fancybox-buttons a.btnDisabled{opacity:.4;cursor:default;}
fancybox/2.2.0/helpers/jquery.fancybox-buttons.min.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Buttons helper for fancyBox
3
+ * version: 1.0.5 (Mon, 15 Oct 2012)
4
+ * @requires fancyBox v2.0 or later
5
+ *
6
+ * Usage:
7
+ * $(".fancybox").fancybox({
8
+ * helpers : {
9
+ * buttons: {
10
+ * position : 'top'
11
+ * }
12
+ * }
13
+ * });
14
+ *
15
+ */
16
+ !function(t){var s=t.fancybox;s.helpers.buttons={defaults:{skipSingle:!1,position:"top",tpl:'<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:;"></a></li></ul></div>'},list:null,buttons:null,beforeLoad:function(t,s){if(t.skipSingle&&s.group.length<2)return s.helpers.buttons=!1,void(s.closeBtn=!0);s.margin["bottom"===t.position?2:0]+=30},onPlayStart:function(){this.buttons&&this.buttons.play.attr("title","Pause slideshow").addClass("btnPlayOn")},onPlayEnd:function(){this.buttons&&this.buttons.play.attr("title","Start slideshow").removeClass("btnPlayOn")},afterShow:function(l,i){var n=this.buttons;n||(this.list=t(l.tpl).addClass(l.position).appendTo("body"),n={prev:this.list.find(".btnPrev").click(s.prev),next:this.list.find(".btnNext").click(s.next),play:this.list.find(".btnPlay").click(s.play),toggle:this.list.find(".btnToggle").click(s.toggle),close:this.list.find(".btnClose").click(s.close)}),i.index>0||i.loop?n.prev.removeClass("btnDisabled"):n.prev.addClass("btnDisabled"),i.loop||i.index<i.group.length-1?(n.next.removeClass("btnDisabled"),n.play.removeClass("btnDisabled")):(n.next.addClass("btnDisabled"),n.play.addClass("btnDisabled")),this.buttons=n,this.onUpdate(l,i)},onUpdate:function(t,s){var l;this.buttons&&(l=this.buttons.toggle.removeClass("btnDisabled btnToggleOn"),s.canShrink?l.addClass("btnToggleOn"):s.canExpand||l.addClass("btnDisabled"))},beforeClose:function(){this.list&&this.list.remove(),this.list=null,this.buttons=null}}}(jQuery);
fancybox/2.2.0/helpers/jquery.fancybox-media.js ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! Media helper for fancyBox */
2
+ /**
3
+ * version: 1.1.1 (Fri, 14 Sep 2022)
4
+ * @requires fancyBox v2.0 or later
5
+ *
6
+ * Usage:
7
+ * $(".fancybox").fancybox({
8
+ * helpers : {
9
+ * media: true
10
+ * }
11
+ * });
12
+ *
13
+ * Set custom URL parameters:
14
+ * $(".fancybox").fancybox({
15
+ * helpers : {
16
+ * media: {
17
+ * youtube : {
18
+ * params : {
19
+ * autoplay : 0
20
+ * }
21
+ * }
22
+ * }
23
+ * }
24
+ * });
25
+ *
26
+ * Or:
27
+ * $(".fancybox").fancybox({,
28
+ * helpers : {
29
+ * media: true
30
+ * },
31
+ * youtube : {
32
+ * autoplay: 0
33
+ * }
34
+ * });
35
+ *
36
+ * Supports:
37
+ *
38
+ * Youtube
39
+ * http://www.youtube.com/watch?v=opj24KnzrWo
40
+ * http://www.youtube.com/embed/opj24KnzrWo
41
+ * http://youtu.be/opj24KnzrWo
42
+ * http://www.youtube-nocookie.com/embed/opj24KnzrWo
43
+ * Vimeo
44
+ * http://vimeo.com/40648169
45
+ * http://vimeo.com/channels/staffpicks/38843628
46
+ * http://vimeo.com/groups/surrealism/videos/36516384
47
+ * http://player.vimeo.com/video/45074303
48
+ * Dailymotion
49
+ * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
50
+ * Instagram
51
+ * http://instagr.am/p/IejkuUGxQn/
52
+ * http://instagram.com/p/IejkuUGxQn/
53
+ * Google maps
54
+ * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
55
+ * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
56
+ * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
57
+ */
58
+ ;(function ($) {
59
+ "use strict";
60
+
61
+ //Shortcut for fancyBox object
62
+ var F = $.fancybox,
63
+ format = function( url, rez, params ) {
64
+ params = params || '';
65
+
66
+ if ( $.type( params ) === "object" ) {
67
+ params = $.param(params, true);
68
+ }
69
+
70
+ $.each(rez, function(key, value) {
71
+ url = url.replace( '$' + key, value || '' );
72
+ });
73
+
74
+ if (params.length) {
75
+ url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params;
76
+ }
77
+
78
+ return url;
79
+ };
80
+
81
+ //Add helper object
82
+ F.helpers.media = {
83
+ defaults : {
84
+ youtube : {
85
+ matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
86
+ params : {
87
+ autoplay : 1,
88
+ fs : 1,
89
+ rel : 0,
90
+ modestbranding : 1
91
+ },
92
+ type : 'iframe',
93
+ url : '//www.youtube.com/embed/$3'
94
+ },
95
+ vimeo : {
96
+ matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
97
+ params : {
98
+ autoplay : 1,
99
+ title : 1,
100
+ byline : 1,
101
+ portrait : 0
102
+ },
103
+ type : 'iframe',
104
+ url : '//player.vimeo.com/video/$1'
105
+ },
106
+ dailymotion : {
107
+ matcher : /dailymotion.com\/video\/(.*)\/?(.*)/,
108
+ params : {
109
+ autoplay : 1
110
+ },
111
+ type : 'iframe',
112
+ url : '//www.dailymotion.com/embed/video/$1'
113
+ },
114
+ instagram : {
115
+ matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
116
+ type : 'image',
117
+ url : '//$1/p/$2/media/?size=l'
118
+ },
119
+ google_maps : {
120
+ matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,
121
+ type : 'iframe',
122
+ url : function( rez ) {
123
+ return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed');
124
+ }
125
+ }
126
+ },
127
+
128
+ beforeLoad : function(opts, obj) {
129
+ var url = obj.href || '',
130
+ type = false,
131
+ what,
132
+ item,
133
+ rez,
134
+ params;
135
+
136
+ for (what in opts) {
137
+ if (opts.hasOwnProperty(what)) {
138
+ item = opts[ what ];
139
+ rez = item && item.matcher ? url.match( item.matcher ) : false;
140
+
141
+ if (rez) {
142
+ type = item.type;
143
+ params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null));
144
+
145
+ url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params );
146
+
147
+ break;
148
+ }
149
+ }
150
+ }
151
+
152
+ if (type) {
153
+ obj.href = url;
154
+ obj.type = type;
155
+
156
+ obj.autoHeight = false;
157
+ }
158
+ }
159
+ };
160
+
161
+ }(jQuery));
fancybox/2.2.0/helpers/jquery.fancybox-media.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /*! Media helper for fancyBox */
2
+ !function(e){"use strict";var a=e.fancybox,o=function(a,o,t){return t=t||"","object"===e.type(t)&&(t=e.param(t,!0)),e.each(o,(function(e,o){a=a.replace("$"+e,o||"")})),t.length&&(a+=(a.indexOf("?")>0?"&":"?")+t),a};a.helpers.media={defaults:{youtube:{matcher:/(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"opaque",enablejsapi:1,ps:"docs",controls:1},type:"iframe",url:"//www.youtube.com/embed/$3"},vimeo:{matcher:/(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},type:"iframe",url:"//player.vimeo.com/video/$1"},dailymotion:{matcher:/dailymotion.com\/video\/(.*)\/?(.*)/,params:{additionalInfos:0,autoStart:1},type:"iframe",url:"//www.dailymotion.com/embed/video/$1"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},google_maps:{matcher:/maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,type:"iframe",url:function(e){return"//maps.google."+e[1]+"/"+e[3]+e[4]+"&output="+(e[4].indexOf("layer=c")>0?"svembed":"embed")}}},beforeLoad:function(a,t){var r,i,m,l,u=t.href||"",n=!1;for(r in a)if(a.hasOwnProperty(r)&&(m=!(!(i=a[r])||!i.matcher)&&u.match(i.matcher))){n=i.type,l=e.extend(!0,{},i.params,t[r]||(e.isPlainObject(a[r])?a[r].params:null)),u="function"===e.type(i.url)?i.url.call(this,m,l,t):o(i.url,m,l);break}n&&(t.href=u,t.type=n,t.autoHeight=!1)}}}(jQuery);
fancybox/2.2.0/helpers/jquery.fancybox-thumbs.css ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #fancybox-thumbs {
2
+ position: fixed;
3
+ left: 0;
4
+ width: 100%;
5
+ overflow: hidden;
6
+ z-index: 8050;
7
+ }
8
+
9
+ #fancybox-thumbs.bottom {
10
+ bottom: 2px;
11
+ }
12
+
13
+ #fancybox-thumbs.top {
14
+ top: 2px;
15
+ }
16
+
17
+ #fancybox-thumbs ul {
18
+ position: relative;
19
+ list-style: none;
20
+ margin: 0;
21
+ padding: 0;
22
+ }
23
+
24
+ #fancybox-thumbs ul li {
25
+ float: left;
26
+ padding: 1px;
27
+ opacity: 0.5;
28
+ }
29
+
30
+ #fancybox-thumbs ul li.active {
31
+ opacity: 0.75;
32
+ padding: 0;
33
+ border: 1px solid #fff;
34
+ }
35
+
36
+ #fancybox-thumbs ul li:hover {
37
+ opacity: 1;
38
+ }
39
+
40
+ #fancybox-thumbs ul li a {
41
+ display: block;
42
+ position: relative;
43
+ overflow: hidden;
44
+ border: 1px solid #222;
45
+ background: #111;
46
+ outline: none;
47
+ }
48
+
49
+ #fancybox-thumbs ul li img {
50
+ display: block;
51
+ position: relative;
52
+ border: 0;
53
+ padding: 0;
54
+ max-width: none;
55
+ }
fancybox/2.2.0/helpers/jquery.fancybox-thumbs.js ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Thumbnail helper for fancyBox
3
+ * version: 1.0.7 (Mon, 01 Oct 2012)
4
+ * @requires fancyBox v2.0 or later
5
+ *
6
+ * Usage:
7
+ * $(".fancybox").fancybox({
8
+ * helpers : {
9
+ * thumbs: {
10
+ * width : 50,
11
+ * height : 50
12
+ * }
13
+ * }
14
+ * });
15
+ *
16
+ */
17
+ ;(function ($) {
18
+ //Shortcut for fancyBox object
19
+ var F = $.fancybox;
20
+
21
+ //Add helper object
22
+ F.helpers.thumbs = {
23
+ defaults : {
24
+ width : 50, // thumbnail width
25
+ height : 50, // thumbnail height
26
+ position : 'bottom', // 'top' or 'bottom'
27
+ source : function ( item ) { // function to obtain the URL of the thumbnail image
28
+ var href;
29
+
30
+ if (item.element) {
31
+ href = $(item.element).find('img').attr('src');
32
+ }
33
+
34
+ if (!href && item.type === 'image' && item.href) {
35
+ href = item.href;
36
+ }
37
+
38
+ return href;
39
+ }
40
+ },
41
+
42
+ wrap : null,
43
+ list : null,
44
+ width : 0,
45
+
46
+ init: function (opts, obj) {
47
+ var that = this,
48
+ list,
49
+ thumbWidth = opts.width,
50
+ thumbHeight = opts.height,
51
+ thumbSource = opts.source;
52
+
53
+ //Build list structure
54
+ list = '';
55
+
56
+ for (var n = 0; n < obj.group.length; n++) {
57
+ list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>';
58
+ }
59
+
60
+ this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position).appendTo('body');
61
+ this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap);
62
+
63
+ //Load each thumbnail
64
+ $.each(obj.group, function (i) {
65
+ var el = obj.group[ i ],
66
+ href = thumbSource( el );
67
+
68
+ if (!href) {
69
+ return;
70
+ }
71
+
72
+ $("<img />").on("load", function () {
73
+ var width = this.width,
74
+ height = this.height,
75
+ widthRatio, heightRatio, parent;
76
+
77
+ if (!that.list || !width || !height) {
78
+ return;
79
+ }
80
+
81
+ //Calculate thumbnail width/height and center it
82
+ widthRatio = width / thumbWidth;
83
+ heightRatio = height / thumbHeight;
84
+
85
+ parent = that.list.children().eq(i).find('a');
86
+
87
+ if (widthRatio >= 1 && heightRatio >= 1) {
88
+ if (widthRatio > heightRatio) {
89
+ width = Math.floor(width / heightRatio);
90
+ height = thumbHeight;
91
+
92
+ } else {
93
+ width = thumbWidth;
94
+ height = Math.floor(height / widthRatio);
95
+ }
96
+ }
97
+
98
+ $(this).css({
99
+ width : width,
100
+ height : height,
101
+ top : Math.floor(thumbHeight / 2 - height / 2),
102
+ left : Math.floor(thumbWidth / 2 - width / 2)
103
+ });
104
+
105
+ parent.width(thumbWidth).height(thumbHeight);
106
+
107
+ $(this).hide().appendTo(parent).fadeIn(300);
108
+
109
+ })
110
+ .attr('src', href)
111
+ .attr('title', el.title);
112
+ });
113
+
114
+ //Set initial width
115
+ this.width = this.list.children().eq(0).outerWidth(true);
116
+
117
+ this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)));
118
+ },
119
+
120
+ beforeLoad: function (opts, obj) {
121
+ //Remove self if gallery do not have at least two items
122
+ if (obj.group.length < 2) {
123
+ obj.helpers.thumbs = false;
124
+
125
+ return;
126
+ }
127
+
128
+ //Increase bottom margin to give space for thumbs
129
+ obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15);
130
+ },
131
+
132
+ afterShow: function (opts, obj) {
133
+ //Check if exists and create or update list
134
+ if (this.list) {
135
+ this.onUpdate(opts, obj);
136
+
137
+ } else {
138
+ this.init(opts, obj);
139
+ }
140
+
141
+ //Set active element
142
+ this.list.children().removeClass('active').eq(obj.index).addClass('active');
143
+ },
144
+
145
+ //Center list
146
+ onUpdate: function (opts, obj) {
147
+ if (this.list) {
148
+ this.list.stop(true).animate({
149
+ 'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))
150
+ }, 150);
151
+ }
152
+ },
153
+
154
+ beforeClose: function () {
155
+ if (this.wrap) {
156
+ this.wrap.remove();
157
+ }
158
+
159
+ this.wrap = null;
160
+ this.list = null;
161
+ this.width = 0;
162
+ }
163
+ }
164
+
165
+ }(jQuery));
fancybox/2.2.0/helpers/jquery.fancybox-thumbs.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #fancybox-thumbs{position:fixed;left:0;width:100%;overflow:hidden;z-index:8050;}#fancybox-thumbs.bottom{bottom:2px;}#fancybox-thumbs.top{top:2px;}#fancybox-thumbs ul{position:relative;list-style:none;margin:0;padding:0;}#fancybox-thumbs ul li{float:left;padding:1px;opacity:.5;}#fancybox-thumbs ul li.active{opacity:.75;padding:0;border:1px solid #fff;}#fancybox-thumbs ul li:hover{opacity:1;}#fancybox-thumbs ul li a{display:block;position:relative;overflow:hidden;border:1px solid #222;background:#111;outline:none;}#fancybox-thumbs ul li img{display:block;position:relative;border:0;padding:0;max-width:none;}
fancybox/2.2.0/helpers/jquery.fancybox-thumbs.min.js ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Thumbnail helper for fancyBox
3
+ * version: 1.0.7 (Mon, 01 Oct 2012)
4
+ * @requires fancyBox v2.0 or later
5
+ *
6
+ * Usage:
7
+ * $(".fancybox").fancybox({
8
+ * helpers : {
9
+ * thumbs: {
10
+ * width : 50,
11
+ * height : 50
12
+ * }
13
+ * }
14
+ * });
15
+ *
16
+ */
17
+ !function(t){t.fancybox.helpers.thumbs={defaults:{width:50,height:50,position:"bottom",source:function(i){var h;return i.element&&(h=t(i.element).find("img").attr("src")),!h&&"image"===i.type&&i.href&&(h=i.href),h}},wrap:null,list:null,width:0,init:function(i,h){var e,s=this,o=i.width,n=i.height,l=i.source;e="";for(var a=0;a<h.group.length;a++)e+='<li><a style="width:'+o+"px;height:"+n+'px;" href="javascript:jQuery.fancybox.jumpto('+a+');"></a></li>';this.wrap=t('<div id="fancybox-thumbs"></div>').addClass(i.position).appendTo("body"),this.list=t("<ul>"+e+"</ul>").appendTo(this.wrap),t.each(h.group,(function(i){var e=h.group[i],a=l(e);a&&t("<img />").on("load",(function(){var h,e,l,a=this.width,r=this.height;s.list&&a&&r&&(h=a/o,e=r/n,l=s.list.children().eq(i).find("a"),h>=1&&e>=1&&(h>e?(a=Math.floor(a/e),r=n):(a=o,r=Math.floor(r/h))),t(this).css({width:a,height:r,top:Math.floor(n/2-r/2),left:Math.floor(o/2-a/2)}),l.width(o).height(n),t(this).hide().appendTo(l).fadeIn(300))})).attr("src",a).attr("title",e.title)})),this.width=this.list.children().eq(0).outerWidth(!0),this.list.width(this.width*(h.group.length+1)).css("left",Math.floor(.5*t(window).width()-(h.index*this.width+.5*this.width)))},beforeLoad:function(t,i){i.group.length<2?i.helpers.thumbs=!1:i.margin["top"===t.position?0:2]+=t.height+15},afterShow:function(t,i){this.list?this.onUpdate(t,i):this.init(t,i),this.list.children().removeClass("active").eq(i.index).addClass("active")},onUpdate:function(i,h){this.list&&this.list.stop(!0).animate({left:Math.floor(.5*t(window).width()-(h.index*this.width+.5*this.width))},150)},beforeClose:function(){this.wrap&&this.wrap.remove(),this.wrap=null,this.list=null,this.width=0}}}(jQuery);
fancybox/2.2.0/jquery.fancybox.css ADDED
@@ -0,0 +1,295 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * fancyBox - jQuery Plugin
3
+ * version: 2.2.0 (Tue, 16 Sep 2022)
4
+ * requires jQuery v1.6 or later
5
+ *
6
+ * Licensed GPLv3 for open source use
7
+ * or fancyBox Commercial License for commercial use
8
+ * Examples at http://fancyapps.com/fancybox/
9
+ * License: www.fancyapps.com/fancybox/#license
10
+ *
11
+ * Copyright 2017 fancyapps.com
12
+ */
13
+
14
+ .fancybox-wrap,
15
+ .fancybox-skin,
16
+ .fancybox-outer,
17
+ .fancybox-inner,
18
+ .fancybox-wrap img,
19
+ .fancybox-wrap iframe,
20
+ .fancybox-wrap object,
21
+ .fancybox-nav,
22
+ .fancybox-nav span,
23
+ .fancybox-tmp
24
+ {
25
+ padding: 0;
26
+ margin: 0;
27
+ border: 0;
28
+ outline: none;
29
+ vertical-align: top;
30
+ }
31
+
32
+ .fancybox-wrap {
33
+ position: absolute;
34
+ top: 0;
35
+ left: 0;
36
+ transform: translate3d(0, 0, 0);
37
+ z-index: 100020;
38
+ }
39
+
40
+ .fancybox-skin {
41
+ position: relative;
42
+ background: #f9f9f9;
43
+ color: #444;
44
+ text-shadow: none;
45
+ }
46
+
47
+ .fancybox-opened {
48
+ z-index: 100030;
49
+ }
50
+
51
+ .fancybox-opened .fancybox-skin {
52
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
53
+ }
54
+
55
+ .fancybox-outer, .fancybox-inner {
56
+ position: relative;
57
+ }
58
+
59
+ .fancybox-inner {
60
+ overflow: hidden;
61
+ }
62
+
63
+ .fancybox-type-iframe .fancybox-inner {
64
+ -webkit-overflow-scrolling: touch;
65
+ }
66
+
67
+ .fancybox-error {
68
+ color: #444;
69
+ font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
70
+ margin: 0;
71
+ padding: 15px;
72
+ white-space: nowrap;
73
+ }
74
+
75
+ .fancybox-wrap .fancybox-image, .fancybox-wrap .fancybox-iframe {
76
+ display: block;
77
+ width: 100%;
78
+ height: 100%;
79
+ }
80
+
81
+ .fancybox-wrap .fancybox-image {
82
+ max-width: 100%;
83
+ max-height: 100%;
84
+ }
85
+
86
+ #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
87
+ background-image: url(fancybox_sprite.png);
88
+ }
89
+
90
+ #fancybox-loading {
91
+ position: fixed;
92
+ top: 50%;
93
+ left: 50%;
94
+ margin-top: -22px;
95
+ margin-left: -22px;
96
+ background-position: 0 -108px;
97
+ opacity: 0.8;
98
+ cursor: pointer;
99
+ z-index: 100060;
100
+ }
101
+
102
+ #fancybox-loading div {
103
+ width: 44px;
104
+ height: 44px;
105
+ background: url(fancybox_loading.gif) center center no-repeat;
106
+ }
107
+
108
+ .fancybox-close {
109
+ position: absolute;
110
+ top: -18px;
111
+ right: -18px;
112
+ width: 36px;
113
+ height: 36px;
114
+ cursor: pointer;
115
+ z-index: 100040;
116
+ }
117
+
118
+ .fancybox-nav {
119
+ position: absolute;
120
+ top: 0;
121
+ width: 40%;
122
+ height: 100%;
123
+ cursor: pointer;
124
+ text-decoration: none;
125
+ background: transparent;
126
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
127
+ z-index: 100040;
128
+ }
129
+
130
+ .fancybox-prev {
131
+ left: 0;
132
+ }
133
+
134
+ .fancybox-next {
135
+ right: 0;
136
+ }
137
+
138
+ .fancybox-nav span {
139
+ position: absolute;
140
+ top: 50%;
141
+ width: 36px;
142
+ height: 34px;
143
+ margin-top: -18px;
144
+ cursor: pointer;
145
+ z-index: 100040;
146
+ visibility: hidden;
147
+ }
148
+
149
+ .fancybox-prev span {
150
+ left: 10px;
151
+ background-position: 0 -36px;
152
+ }
153
+
154
+ .fancybox-next span {
155
+ right: 10px;
156
+ background-position: 0 -72px;
157
+ }
158
+
159
+ .fancybox-nav:hover span {
160
+ visibility: visible;
161
+ }
162
+
163
+ .fancybox-tmp {
164
+ position: absolute;
165
+ top: -99999px;
166
+ left: -99999px;
167
+ max-width: 99999px;
168
+ max-height: 99999px;
169
+ overflow: visible !important;
170
+ }
171
+
172
+ /* Overlay helper */
173
+
174
+ .fancybox-lock {
175
+ overflow: visible !important;
176
+ width: auto;
177
+ }
178
+
179
+ .fancybox-lock body {
180
+ overflow: hidden !important;
181
+ }
182
+
183
+ .fancybox-lock-test {
184
+ overflow-y: hidden !important;
185
+ }
186
+
187
+ .fancybox-overlay {
188
+ position: absolute;
189
+ top: 0;
190
+ left: 0;
191
+ overflow: hidden;
192
+ display: none;
193
+ z-index: 100010;
194
+ background-color: rgba(0,0,0,.7);
195
+ }
196
+
197
+ .fancybox-overlay-fixed {
198
+ position: fixed;
199
+ bottom: 0;
200
+ right: 0;
201
+ }
202
+
203
+ .fancybox-lock .fancybox-overlay {
204
+ overflow: auto;
205
+ overflow-y: scroll;
206
+ }
207
+
208
+ /* Title helper */
209
+
210
+ .fancybox-title {
211
+ visibility: hidden;
212
+ font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
213
+ position: relative;
214
+ text-shadow: none;
215
+ z-index: 100050;
216
+ }
217
+
218
+ .fancybox-opened .fancybox-title {
219
+ visibility: visible;
220
+ }
221
+
222
+ .fancybox-title-float-wrap {
223
+ position: absolute;
224
+ bottom: 0;
225
+ right: 50%;
226
+ margin-bottom: -37px;
227
+ z-index: 100050;
228
+ text-align: center;
229
+ }
230
+
231
+ .fancybox-title-float-wrap .child {
232
+ display: inline-block;
233
+ margin-right: -100%;
234
+ padding: 2px 20px;
235
+ background: black;
236
+ border: 2px solid white;
237
+ border-radius: 15px;
238
+ color: #FFF;
239
+ font-weight: bold;
240
+ line-height: 22px;
241
+ white-space: nowrap;
242
+ }
243
+
244
+ .fancybox-title-outside-wrap {
245
+ position: relative;
246
+ margin-top: 10px;
247
+ color: #fff;
248
+ }
249
+ .fancybox-title-outside-wrap:first-child {
250
+ margin-top: 0;
251
+ margin-bottom: 10px;
252
+ }
253
+
254
+ .fancybox-title-inside-wrap {
255
+ padding-top: 10px;
256
+ }
257
+ .fancybox-title-inside-wrap:first-child {
258
+ padding-top: 0;
259
+ padding-bottom: 10px;
260
+ }
261
+
262
+ .fancybox-title-over-wrap {
263
+ position: absolute;
264
+ bottom: 0;
265
+ left: 0;
266
+ right: 0;
267
+ color: #fff;
268
+ padding: 10px;
269
+ background: #000;
270
+ background: rgba(0, 0, 0, .8);
271
+ }
272
+
273
+ /* Other */
274
+ .fancybox-hidden {
275
+ display: none;
276
+ }
277
+ .fancybox-inner .fancybox-hidden {
278
+ display: revert;
279
+ }
280
+
281
+ /*Retina graphics!*/
282
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
283
+ only screen and (min--moz-device-pixel-ratio: 1.5),
284
+ only screen and (min-device-pixel-ratio: 1.5){
285
+
286
+ #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
287
+ background-image: url(fancybox_sprite@2x.png);
288
+ background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/
289
+ }
290
+
291
+ #fancybox-loading div {
292
+ background-image: url(fancybox_loading@2x.gif);
293
+ background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/
294
+ }
295
+ }
fancybox/2.2.0/jquery.fancybox.js ADDED
@@ -0,0 +1,2113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * fancyBox - jQuery Plugin
3
+ * version: 2.2.0 (Tue, 16 Sep 2022)
4
+ * requires jQuery v1.6 or later
5
+ *
6
+ * Licensed GPLv3 for open source use
7
+ * or fancyBox Commercial License for commercial use
8
+ *
9
+ * Examples at http://fancyapps.com/fancybox/
10
+ * License: www.fancyapps.com/fancybox/#license
11
+ *
12
+ * Copyright 2017 fancyapps.com
13
+ */
14
+
15
+ ;(function (window, document, $, undefined) {
16
+ "use strict";
17
+
18
+ var H = $("html"),
19
+ W = $(window),
20
+ D = $(document),
21
+ F = $.fancybox = function () {
22
+ F.open.apply( this, arguments );
23
+ },
24
+ IE = navigator.userAgent.match(/msie/i),
25
+ didUpdate = null,
26
+ isTouch = 'ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0,
27
+
28
+ isQuery = function(obj) {
29
+ return obj && obj.hasOwnProperty && obj instanceof $;
30
+ },
31
+ isString = function(str) {
32
+ return str && $.type(str) === "string";
33
+ },
34
+ isPercentage = function(str) {
35
+ return isString(str) && str.indexOf('%') > 0;
36
+ },
37
+ isScrollable = function(el) {
38
+ return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight)));
39
+ },
40
+ getScalar = function(orig, dim) {
41
+ var value = parseInt(orig, 10) || 0;
42
+
43
+ if (dim && isPercentage(orig)) {
44
+ value = F.getViewport()[ dim ] / 100 * value;
45
+ }
46
+
47
+ return Math.ceil(value);
48
+ },
49
+ getValue = function(value, dim) {
50
+ return getScalar(value, dim) + 'px';
51
+ };
52
+
53
+ $.extend(F, {
54
+ // The current version of fancyBox
55
+ version: '2.2.0',
56
+
57
+ defaults: {
58
+ padding : 15,
59
+ margin : 20,
60
+
61
+ width : 800,
62
+ height : 600,
63
+ minWidth : 100,
64
+ minHeight : 100,
65
+ maxWidth : 9999,
66
+ maxHeight : 9999,
67
+ pixelRatio: window.devicePixelRatio || 1, // Set to 2 for retina display support
68
+
69
+ autoSize : true,
70
+ autoHeight : false,
71
+ autoWidth : false,
72
+
73
+ autoResize : true,
74
+ autoCenter : !isTouch,
75
+ fitToView : true,
76
+ aspectRatio : false,
77
+ topRatio : 0.5,
78
+ leftRatio : 0.5,
79
+ minVpWidth : 320,
80
+ minVpHeight : 320,
81
+
82
+ scrolling : 'auto', // 'auto', 'yes' or 'no'
83
+ wrapCSS : '',
84
+
85
+ arrows : true,
86
+ closeBtn : true,
87
+ closeClick : false,
88
+ nextClick : false,
89
+ zoomClick : false,
90
+ mouseWheel : true,
91
+ swipe : isTouch,
92
+ autoPlay : false,
93
+ playSpeed : 3000,
94
+ preload : 3,
95
+ modal : false,
96
+ loop : true,
97
+
98
+ ajax : {
99
+ dataType : 'html',
100
+ headers : { 'X-fancyBox': true }
101
+ },
102
+ iframe : {
103
+ scrolling : 'auto',
104
+ allowfullscreen : true,
105
+ preload : true
106
+ },
107
+ svg : {},
108
+
109
+ keys : {
110
+ next : {
111
+ 13 : 'left', // enter
112
+ 34 : 'up', // page down
113
+ 39 : 'left', // right arrow
114
+ 40 : 'up' // down arrow
115
+ },
116
+ prev : {
117
+ 8 : 'right', // backspace
118
+ 33 : 'down', // page up
119
+ 37 : 'right', // left arrow
120
+ 38 : 'down' // up arrow
121
+ },
122
+ close : [27], // escape key
123
+ play : [32], // space - start/stop slideshow
124
+ toggle : [70] // letter "f" - toggle fullscreen
125
+ },
126
+
127
+ direction : {
128
+ next : 'left',
129
+ prev : 'right'
130
+ },
131
+
132
+ scrollOutside : true,
133
+
134
+ // Override some properties
135
+ index : 0,
136
+ type : null,
137
+ href : null,
138
+ content : null,
139
+ title : null,
140
+
141
+ // HTML templates
142
+ tpl: {
143
+ wrap : '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
144
+ image : '<img class="fancybox-image" src="{href}" alt="" />',
145
+ iframe : '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" allow="autoplay"' + (IE ? ' allowtransparency="true"' : '') + '></iframe>',
146
+ error : '<p class="fancybox-error">{error}</p>',
147
+ close : '<a title="{close}" class="fancybox-item fancybox-close" href="javascript:;"></a>',
148
+ next : '<a title="{next}" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
149
+ prev : '<a title="{prev}" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>',
150
+ loading : '<div id="fancybox-loading"><div></div></div>'
151
+ },
152
+
153
+ // Texts
154
+ txt: {
155
+ error : {
156
+ content : 'The requested content cannot be loaded.<br/>Please try again later.',
157
+ image : 'The requested image cannot be loaded.<br/>Please try again later.',
158
+ ajax : 'An AJAX error occurred.<br/>Please contact the site administrator.',
159
+ href : 'Missing media target URL.<br/>Please contact the site administrator.',
160
+ },
161
+ close : 'Close',
162
+ next : 'Next',
163
+ prev : 'Previous'
164
+ },
165
+
166
+ // Properties for each animation type
167
+ // Opening fancyBox
168
+ openEffect : 'fade', // 'elastic', 'fade' or 'none'
169
+ openSpeed : 250,
170
+ openEasing : 'swing',
171
+ openOpacity : true,
172
+ openMethod : 'zoomIn',
173
+
174
+ // Closing fancyBox
175
+ closeEffect : 'fade', // 'elastic', 'fade' or 'none'
176
+ closeSpeed : 250,
177
+ closeEasing : 'swing',
178
+ closeOpacity : true,
179
+ closeMethod : 'zoomOut',
180
+
181
+ // Changing next gallery item
182
+ nextEffect : 'elastic', // 'elastic', 'fade' or 'none'
183
+ nextSpeed : 250,
184
+ nextEasing : 'swing',
185
+ nextMethod : 'changeIn',
186
+
187
+ // Changing previous gallery item
188
+ prevEffect : 'elastic', // 'elastic', 'fade' or 'none'
189
+ prevSpeed : 250,
190
+ prevEasing : 'swing',
191
+ prevMethod : 'changeOut',
192
+
193
+ // Enable default helpers
194
+ helpers : {
195
+ overlay : true,
196
+ title : true
197
+ },
198
+
199
+ // Callbacks
200
+ onCancel : $.noop, // If canceling
201
+ beforeLoad : $.noop, // Before loading
202
+ afterLoad : $.noop, // After loading
203
+ beforeShow : $.noop, // Before changing in current item
204
+ afterShow : $.noop, // After opening
205
+ beforeChange : $.noop, // Before changing gallery item
206
+ beforeClose : $.noop, // Before closing
207
+ afterClose : $.noop // After closing
208
+ },
209
+
210
+ //Current state
211
+ group : {}, // Selected group
212
+ opts : {}, // Group options
213
+ previous : null, // Previous element
214
+ coming : null, // Element being loaded
215
+ current : null, // Currently loaded element
216
+ isActive : false, // Is activated
217
+ isOpen : false, // Is currently open
218
+ isOpened : false, // Have been fully opened at least once
219
+
220
+ wrap : null,
221
+ skin : null,
222
+ outer : null,
223
+ inner : null,
224
+
225
+ player : {
226
+ timer : null,
227
+ isActive : false
228
+ },
229
+
230
+ // Loaders
231
+ ajaxLoad : null,
232
+ imgPreload : null,
233
+
234
+ // Some collections
235
+ transitions : {},
236
+ helpers : {},
237
+
238
+ /*
239
+ * Static methods
240
+ */
241
+
242
+ open: function (group, opts) {
243
+ if (!group) {
244
+ return;
245
+ }
246
+
247
+ if (!$.isPlainObject(opts)) {
248
+ opts = {};
249
+ }
250
+
251
+ // Close if already active
252
+ if (false === F.close(true)) {
253
+ return;
254
+ }
255
+
256
+ // Normalize group
257
+ if (!$.isArray(group)) {
258
+ group = isQuery(group) ? $(group).get() : [group];
259
+ }
260
+
261
+ // Recheck if the type of each element is `object` and set content type (image, ajax, etc)
262
+ $.each(group, function(i, element) {
263
+ var obj = {},
264
+ href,
265
+ title,
266
+ content,
267
+ type,
268
+ rez,
269
+ hrefParts,
270
+ selector;
271
+
272
+ if ($.type(element) === "object") {
273
+ // Check if is DOM element
274
+ if (element.nodeType) {
275
+ element = $(element);
276
+ }
277
+
278
+ if (isQuery(element)) {
279
+ obj = {
280
+ href : element.data('fancybox-href') || element.attr('href'),
281
+ title : $('<div/>').text( element.data('fancybox-title') || element.attr('title') || '' ).html(),
282
+ isDom : true,
283
+ element : element
284
+ };
285
+
286
+ if ($.metadata) {
287
+ $.extend(true, obj, element.metadata());
288
+ }
289
+ }
290
+ else {
291
+ obj = element;
292
+ }
293
+ }
294
+
295
+ href = opts.href || obj.href || (isString(element) ? element : null);
296
+ title = opts.title !== undefined ? opts.title : obj.title || '';
297
+
298
+ content = opts.content || obj.content;
299
+ type = content ? 'html' : (opts.type || obj.type);
300
+
301
+ if (!type && obj.isDom) {
302
+ type = element.data('fancybox-type');
303
+
304
+ if (!type) {
305
+ rez = element.prop('class').match(/fancybox\.(\w+)/);
306
+ type = rez ? rez[1] : null;
307
+ }
308
+ }
309
+
310
+ if (isString(href)) {
311
+ // Try to guess the content type
312
+ if (!type) {
313
+ if (F.isImage(href)) {
314
+ type = 'image';
315
+ }
316
+ else if (F.isSVG(href)) {
317
+ type = 'svg';
318
+ }
319
+ else if (href.charAt(0) === '#') {
320
+ type = 'inline';
321
+ }
322
+ else if (isString(element)) {
323
+ type = 'html';
324
+ content = element;
325
+ }
326
+ }
327
+
328
+ // Split url into two pieces with source url and content selector, e.g,
329
+ // "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id"
330
+ if (type === 'ajax') {
331
+ hrefParts = href.split(/\s+/, 2);
332
+ href = hrefParts.shift();
333
+ selector = hrefParts.shift();
334
+ }
335
+ }
336
+
337
+ if (!content) {
338
+ if (type === 'inline') {
339
+ if (href) {
340
+ content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7
341
+ }
342
+ else if (obj.isDom) {
343
+ content = element;
344
+ }
345
+ }
346
+ else if (type === 'html') {
347
+ content = href;
348
+ }
349
+ else if (!type && !href && obj.isDom) {
350
+ type = 'inline';
351
+ content = element;
352
+ }
353
+ }
354
+
355
+ $.extend(obj, {
356
+ href : href,
357
+ type : type,
358
+ content : content,
359
+ title : title,
360
+ selector : selector
361
+ });
362
+
363
+ group[ i ] = obj;
364
+ });
365
+
366
+ // Extend the defaults
367
+ F.opts = $.extend(true, {}, F.defaults, opts);
368
+
369
+ // All options are merged recursive except keys
370
+ if (opts.keys !== undefined) {
371
+ F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false;
372
+ }
373
+
374
+ F.group = group;
375
+
376
+ return F._start(F.opts.index);
377
+ },
378
+
379
+ // Cancel image loading or abort ajax request
380
+ cancel: function () {
381
+ var coming = F.coming;
382
+
383
+ if (coming && false === F.trigger('onCancel')) {
384
+ return;
385
+ }
386
+
387
+ F.hideLoading();
388
+
389
+ if (!coming) {
390
+ return;
391
+ }
392
+
393
+ if (F.ajaxLoad) {
394
+ F.ajaxLoad.abort();
395
+ }
396
+
397
+ F.ajaxLoad = null;
398
+
399
+ if (F.imgPreload) {
400
+ F.imgPreload.onload = F.imgPreload.onerror = null;
401
+ }
402
+
403
+ if (coming.wrap) {
404
+ coming.wrap.stop(true, true).trigger('onReset').remove();
405
+ }
406
+
407
+ F.coming = null;
408
+
409
+ // If the first item has been canceled, then clear everything
410
+ if (!F.current) {
411
+ F._afterZoomOut( coming );
412
+ }
413
+ },
414
+
415
+ // Start closing animation if is open; remove immediately if opening/closing
416
+ close: function (event) {
417
+ F.cancel();
418
+
419
+ if (false === F.trigger('beforeClose')) {
420
+ return;
421
+ }
422
+
423
+ F.unbindEvents();
424
+
425
+ if (!F.isActive) {
426
+ return;
427
+ }
428
+
429
+ if (!F.isOpen || event === true) {
430
+ $('.fancybox-wrap').stop(true).trigger('onReset').remove();
431
+
432
+ F._afterZoomOut();
433
+ }
434
+ else {
435
+ F.isOpen = F.isOpened = false;
436
+ F.isClosing = true;
437
+
438
+ $('.fancybox-item, .fancybox-nav').remove();
439
+
440
+ F.wrap.stop(true, true).removeClass('fancybox-opened');
441
+
442
+ F.transitions[ F.current.closeMethod ]();
443
+ }
444
+ },
445
+
446
+ // Manage slideshow:
447
+ // $.fancybox.play(); - toggle slideshow
448
+ // $.fancybox.play( true ); - start
449
+ // $.fancybox.play( false ); - stop
450
+ play: function ( action ) {
451
+ var clear = function () {
452
+ clearTimeout(F.player.timer);
453
+ },
454
+ set = function () {
455
+ clear();
456
+
457
+ if (F.current && F.player.isActive) {
458
+ F.player.timer = setTimeout(F.next, F.current.playSpeed);
459
+ }
460
+ },
461
+ stop = function () {
462
+ clear();
463
+
464
+ D.off('.player');
465
+
466
+ F.player.isActive = false;
467
+
468
+ F.trigger('onPlayEnd');
469
+ },
470
+ start = function () {
471
+ if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) {
472
+ F.player.isActive = true;
473
+
474
+ D.on({
475
+ 'onCancel.player beforeClose.player' : stop,
476
+ 'onUpdate.player' : set,
477
+ 'beforeLoad.player' : clear
478
+ });
479
+
480
+ set();
481
+
482
+ F.trigger('onPlayStart');
483
+ }
484
+ };
485
+
486
+ if (action === true || (!F.player.isActive && action !== false)) {
487
+ start();
488
+ }
489
+ else {
490
+ stop();
491
+ }
492
+ },
493
+
494
+ // Navigate on mousewheel, swipe or drag
495
+ swipe: function ( deltaX, deltaY, threshold ) {
496
+ if ( deltaX > threshold || deltaY > threshold ) {
497
+ F.wrap.off('touchstart.fb touchmove.fb touchend.fb mouseup.fb mousedown.fb mousemove.fb mousewheel.fb');
498
+ F.next( deltaY > threshold ? 'up' : 'left' );
499
+ }
500
+ else if ( deltaX < -threshold || deltaY < -threshold ) {
501
+ F.wrap.off('touchstart.fb touchmove.fb touchend.fb mouseup.fb mousedown.fb mousemove.fb mousewheel.fb');
502
+ F.prev( deltaY < -threshold ? 'down' : 'right' );
503
+ }
504
+ },
505
+
506
+ // Navigate to next gallery item
507
+ next: function ( direction ) {
508
+ var current = F.current;
509
+
510
+ if (current) {
511
+ if (!isString(direction)) {
512
+ direction = current.direction.next;
513
+ }
514
+
515
+ F.jumpto(current.index + 1, direction, 'next');
516
+ }
517
+ },
518
+
519
+ // Navigate to previous gallery item
520
+ prev: function ( direction ) {
521
+ var current = F.current;
522
+
523
+ if (current) {
524
+ if (!isString(direction)) {
525
+ direction = current.direction.prev;
526
+ }
527
+
528
+ F.jumpto(current.index - 1, direction, 'prev');
529
+ }
530
+ },
531
+
532
+ // Navigate to gallery item by index
533
+ jumpto: function ( index, direction, router ) {
534
+ var current = F.current;
535
+
536
+ if (!current) {
537
+ return;
538
+ }
539
+
540
+ index = getScalar(index);
541
+
542
+ F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ];
543
+ F.router = router || 'jumpto';
544
+
545
+ if (current.loop) {
546
+ if (index < 0) {
547
+ index = current.group.length + (index % current.group.length);
548
+ }
549
+
550
+ index = index % current.group.length;
551
+ }
552
+
553
+ if (current.group[ index ] !== undefined) {
554
+ F.cancel();
555
+ F.isJumping = true;
556
+ F._start(index);
557
+ }
558
+ },
559
+
560
+ canScroll: function ( target ) {
561
+ let canScroll = false,
562
+ parent = $(target);
563
+
564
+ while (parent.length) {
565
+ if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) {
566
+ break;
567
+ }
568
+ canScroll = isScrollable( parent[0] );
569
+ parent = $(parent).parent();
570
+ }
571
+
572
+ return canScroll;
573
+ },
574
+
575
+ // Center inside viewport and toggle position type to fixed or absolute if needed
576
+ reposition: function (e, onlyAbsolute) {
577
+ var current = F.current,
578
+ wrap = current ? current.wrap : null,
579
+ pos;
580
+
581
+ if (wrap) {
582
+ pos = F._getPosition(onlyAbsolute);
583
+
584
+ if (e && e.type === 'scroll') {
585
+ delete pos.position;
586
+
587
+ wrap.stop(true, true).animate(pos, 200);
588
+ }
589
+ else {
590
+ wrap.css(pos);
591
+
592
+ current.pos = $.extend({}, current.dim, pos);
593
+ }
594
+ }
595
+ },
596
+
597
+ update: function (e) {
598
+ var type = (e && e.originalEvent && e.originalEvent.type),
599
+ anyway = !type || type === 'orientationchange';
600
+
601
+ if (anyway) {
602
+ clearTimeout(didUpdate);
603
+
604
+ didUpdate = null;
605
+ }
606
+
607
+ if (!F.isOpen || didUpdate) {
608
+ return;
609
+ }
610
+
611
+ didUpdate = setTimeout(function() {
612
+ var current = F.current;
613
+
614
+ if (!current || F.isClosing) {
615
+ return;
616
+ }
617
+
618
+ F.wrap.removeClass('fancybox-tmp');
619
+
620
+ if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) {
621
+ F._setDimension();
622
+ }
623
+
624
+ if (!(type === 'scroll' && current.canShrink)) {
625
+ F.reposition(e);
626
+ }
627
+
628
+ if (current.zoomClick) {
629
+ F.inner.css('cursor', current.canExpand ? 'zoom-in' : 'zoom-out');
630
+ }
631
+
632
+ F.trigger('onUpdate');
633
+
634
+ didUpdate = null;
635
+
636
+ }, (anyway && !isTouch ? 0 : 300));
637
+ },
638
+
639
+ // Shrink content to fit inside viewport or restore if resized
640
+ toggle: function ( action ) {
641
+ if (F.isOpen) {
642
+ F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView;
643
+
644
+ // Help browser to restore document dimensions
645
+ if (isTouch) {
646
+ F.wrap.removeAttr('style').addClass('fancybox-tmp');
647
+
648
+ F.trigger('onUpdate');
649
+ }
650
+
651
+ F.update();
652
+ }
653
+ },
654
+
655
+ hideLoading: function () {
656
+ D.off('.loading');
657
+
658
+ $('#fancybox-loading').remove();
659
+ },
660
+
661
+ showLoading: function () {
662
+ var el, viewport;
663
+
664
+ F.hideLoading();
665
+
666
+ el = $(F.opts.tpl.loading).click(F.cancel).appendTo('body');
667
+
668
+ // If user will press the escape-button, the request will be canceled
669
+ D.on('keydown.loading', function(e) {
670
+ if ((e.which || e.keyCode) === 27) {
671
+ F.cancel();
672
+
673
+ e.preventDefault();
674
+ return false;
675
+ }
676
+ });
677
+
678
+ if (!F.defaults.fixed) {
679
+ viewport = F.getViewport();
680
+
681
+ el.css({
682
+ position : 'absolute',
683
+ top : (viewport.h * 0.5) + viewport.y,
684
+ left : (viewport.w * 0.5) + viewport.x
685
+ });
686
+ }
687
+
688
+ F.trigger('onLoading');
689
+ },
690
+
691
+ getViewport: function () {
692
+ var locked = (F.current && F.current.locked) || false,
693
+ rez = {
694
+ x: W.scrollLeft(),
695
+ y: W.scrollTop()
696
+ };
697
+
698
+ if (locked && locked.length) {
699
+ rez.w = locked[0].clientWidth;
700
+ rez.h = locked[0].clientHeight;
701
+ }
702
+ else {
703
+ // See http://bugs.jquery.com/ticket/6724
704
+ rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width();
705
+ rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height();
706
+ }
707
+
708
+ return rez;
709
+ },
710
+
711
+ // Unbind the keyboard / clicking actions
712
+ unbindEvents: function () {
713
+ if (F.wrap && isQuery(F.wrap)) {
714
+ F.wrap.off('.fb');
715
+ }
716
+
717
+ D.off('.fb');
718
+ W.off('.fb');
719
+ },
720
+
721
+ bindEvents: function () {
722
+ var current = F.current,
723
+ keys;
724
+
725
+ if (!current) {
726
+ return;
727
+ }
728
+
729
+ // Changing document height on iOS devices triggers a 'resize' event,
730
+ // that can change document height... repeating infinitely
731
+ W.on('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update);
732
+
733
+ keys = current.keys;
734
+
735
+ if (keys) {
736
+ D.on('keydown.fb', function (e) {
737
+ var code = e.which || e.keyCode,
738
+ target = e.target || e.srcElement;
739
+
740
+ // Skip esc key if loading, because showLoading will cancel preloading
741
+ if (code === 27 && F.coming) {
742
+ return false;
743
+ }
744
+
745
+ // Ignore key combinations and key events within form elements
746
+ if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
747
+ $.each(keys, function(i, val) {
748
+ if (current.group.length > 1 && val[ code ] !== undefined) {
749
+ F[ i ]( val[ code ] );
750
+
751
+ e.preventDefault();
752
+ return false;
753
+ }
754
+
755
+ if ($.inArray(code, val) > -1) {
756
+ F[ i ] ();
757
+
758
+ e.preventDefault();
759
+ return false;
760
+ }
761
+ });
762
+ }
763
+ });
764
+ }
765
+
766
+ if (current.group.length > 1) {
767
+ F.wrap.css('cursor','move');
768
+ F.wrap.on('mousedown.fb', function(e){
769
+ let drag = {};
770
+
771
+ e.preventDefault();
772
+
773
+ drag.startX = typeof e.clientX !== 'undefined' ? e.clientX : e.originalEvent.clientX;
774
+ drag.startY = typeof e.clientY !== 'undefined' ? e.clientY : e.originalEvent.clientY;
775
+
776
+ F.wrap.on('mousemove.fb',function(e) {
777
+ e.preventDefault();
778
+
779
+ drag.endX = typeof e.clientX !== 'undefined' ? e.clientX : e.originalEvent.clientX;
780
+ drag.endY = typeof e.clientY !== 'undefined' ? e.clientY : e.originalEvent.clientY;
781
+ });
782
+
783
+ F.wrap.on('mouseup.fb', function(){
784
+ F.wrap.off('mousemove.fb');
785
+ F.swipe(drag.startX - drag.endX, drag.startY - drag.endY, 100);
786
+ });
787
+ });
788
+
789
+ if (current.swipe) {
790
+ F.wrap.on('touchstart.fb', function(e){
791
+ let target = e.target || null,
792
+ touch = {},
793
+ fingers = typeof e.touches !== 'undefined' ? e.touches.length : e.originalEvent.touches.length;
794
+
795
+ if ( current.canShrink || fingers > 1 || F.canScroll( target ) ) {
796
+ return;
797
+ }
798
+
799
+ e.preventDefault();
800
+
801
+ touch.startX = typeof e.touches !== 'undefined' ? e.touches[0].clientX : e.originalEvent.touches[0].clientX;
802
+ touch.startY = typeof e.touches !== 'undefined' ? e.touches[0].clientY : e.originalEvent.touches[0].clientY;
803
+
804
+ F.wrap.on('touchmove.fb',function(e) {
805
+ fingers = typeof e.touches !== 'undefined' ? e.touches.length : e.originalEvent.touches.length;
806
+ if ( fingers > 1 ) {
807
+ return;
808
+ }
809
+ e.preventDefault();
810
+
811
+ let x = typeof e.touches !== 'undefined' ? e.touches[0].clientX : e.originalEvent.touches[0].clientX,
812
+ y = typeof e.touches !== 'undefined' ? e.touches[0].clientY : e.originalEvent.touches[0].clientY;
813
+
814
+ F.swipe(touch.startX - x, touch.startY - y, 100);
815
+ });
816
+ });
817
+ F.wrap.on('touchend.fb', function(){
818
+ F.wrap.off('touchmove.fb');
819
+ });
820
+ }
821
+
822
+ if ($.fn.mousewheel && current.mouseWheel) {
823
+ F.wrap.on('mousewheel.fb', function (e, delta, deltaX, deltaY) {
824
+ let target = e.target || null;
825
+
826
+ if (current.canShrink || delta === 0 || F.canScroll(target)) {
827
+ return;
828
+ }
829
+
830
+ e.preventDefault();
831
+
832
+ F.swipe(-deltaX, -deltaY, 0);
833
+ });
834
+ }
835
+ }
836
+ },
837
+
838
+ trigger: function (event, o) {
839
+ var ret, obj = o || F.coming || F.current;
840
+
841
+ if (obj) {
842
+ if ($.isFunction( obj[event] )) {
843
+ ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1));
844
+ }
845
+
846
+ if (ret === false) {
847
+ return false;
848
+ }
849
+
850
+ if (obj.helpers) {
851
+ $.each(obj.helpers, function (helper, opts) {
852
+ if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) {
853
+ F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj);
854
+ }
855
+ });
856
+ }
857
+ }
858
+
859
+ D.trigger(event);
860
+ },
861
+
862
+ isImage: function (str) {
863
+ return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
864
+ },
865
+
866
+ isSVG: function (str) {
867
+ return isString(str) && str.match(/\.(svg)((\?|#).*)?$/i);
868
+ },
869
+
870
+ _start: function (index) {
871
+ var coming = {},
872
+ obj,
873
+ href,
874
+ type,
875
+ margin,
876
+ padding;
877
+
878
+ index = getScalar( index );
879
+ obj = F.group[ index ] || null;
880
+
881
+ if (!obj) {
882
+ return false;
883
+ }
884
+
885
+ coming = $.extend(true, {}, F.opts, obj);
886
+
887
+ // Convert margin and padding properties to array - top, right, bottom, left
888
+ margin = coming.margin;
889
+ padding = coming.padding;
890
+
891
+ if ($.type(margin) === 'number') {
892
+ coming.margin = [margin, margin, margin, margin];
893
+ }
894
+
895
+ if ($.type(padding) === 'number') {
896
+ coming.padding = [padding, padding, padding, padding];
897
+ }
898
+
899
+ // 'modal' propery is just a shortcut
900
+ if (coming.modal) {
901
+ $.extend(true, coming, {
902
+ closeBtn : false,
903
+ closeClick : false,
904
+ nextClick : false,
905
+ zoomClick : false,
906
+ arrows : false,
907
+ mouseWheel : false,
908
+ keys : null,
909
+ helpers: {
910
+ overlay : {
911
+ closeClick : false
912
+ }
913
+ }
914
+ });
915
+ }
916
+
917
+ // 'autoSize' property is a shortcut, too
918
+ if (coming.autoSize) {
919
+ coming.autoWidth = coming.autoHeight = true;
920
+ }
921
+
922
+ if (coming.width === 'auto') {
923
+ coming.autoWidth = true;
924
+ }
925
+
926
+ if (coming.height === 'auto') {
927
+ coming.autoHeight = true;
928
+ }
929
+
930
+ /*
931
+ * Add reference to the group, so it`s possible to access from callbacks, example:
932
+ * afterLoad : function() {
933
+ * this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
934
+ * }
935
+ */
936
+
937
+ coming.group = F.group;
938
+ coming.index = index;
939
+
940
+ // Give a chance for callback or helpers to update coming item (type, title, etc)
941
+ F.coming = coming;
942
+
943
+ if (false === F.trigger('beforeLoad')) {
944
+ F.coming = null;
945
+
946
+ return;
947
+ }
948
+
949
+ type = coming.type;
950
+ href = coming.href;
951
+
952
+ if (!type) {
953
+ F.coming = null;
954
+
955
+ //If we can not determine content type then drop silently or display next/prev item if looping through gallery
956
+ if (F.current && F.router && F.router !== 'jumpto') {
957
+ F.current.index = index;
958
+
959
+ return F[ F.router ]( F.direction );
960
+ }
961
+
962
+ return false;
963
+ }
964
+
965
+ F.isActive = true;
966
+
967
+ if (type === 'image' || type === 'svg') {
968
+ coming.autoHeight = coming.autoWidth = false;
969
+ coming.scrolling = 'visible';
970
+ coming.aspectRatio = true;
971
+ }
972
+
973
+ if (type === 'iframe' && isTouch) {
974
+ coming.scrolling = 'scroll';
975
+ }
976
+
977
+ // Build the neccessary markup
978
+ coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' );
979
+
980
+ $.extend(coming, {
981
+ skin : $('.fancybox-skin', coming.wrap),
982
+ outer : $('.fancybox-outer', coming.wrap),
983
+ inner : $('.fancybox-inner', coming.wrap)
984
+ });
985
+
986
+ $.each(["Top", "Right", "Bottom", "Left"], function(i, v) {
987
+ coming.skin.css('padding' + v, getValue(coming.padding[ i ]));
988
+ });
989
+
990
+ F.trigger('onReady');
991
+
992
+ // Check before try to load; 'inline' and 'html' types need content, others - href
993
+ if (type === 'inline' || type === 'html') {
994
+ if (!coming.content || !coming.content.length) {
995
+ return F._error( 'content' );
996
+ }
997
+ }
998
+ else if (!href) {
999
+ return F._error( 'href' );
1000
+ }
1001
+
1002
+ if (type === 'image') {
1003
+ F._loadImage();
1004
+ }
1005
+ else if (type === 'ajax') {
1006
+ F._loadAjax();
1007
+ }
1008
+ else if (type === 'iframe') {
1009
+ F._loadIframe();
1010
+ }
1011
+ else {
1012
+ F._afterLoad();
1013
+ }
1014
+ },
1015
+
1016
+ _error: function ( type ) {
1017
+ let msg = F.coming.txt.error[type] || F.coming.txt.error['content'];
1018
+ if( arguments.length > 1 ) {
1019
+ msg = msg + '<br/><br/>' + arguments[1];
1020
+ }
1021
+ $.extend(F.coming, {
1022
+ type : 'html',
1023
+ autoWidth : true,
1024
+ autoHeight : true,
1025
+ minWidth : 0,
1026
+ minHeight : 0,
1027
+ scrolling : 'no',
1028
+ content : F.coming.tpl.error.replace(/\{error\}/g, msg)
1029
+ });
1030
+
1031
+ F._afterLoad();
1032
+ },
1033
+
1034
+ _loadImage: function () {
1035
+ // Reset preload image so it is later possible to check "complete" property
1036
+ var img = F.imgPreload = new Image();
1037
+
1038
+ img.onload = function () {
1039
+ this.onload = this.onerror = null;
1040
+
1041
+ F.coming.width = this.width / F.opts.pixelRatio;
1042
+ F.coming.height = this.height / F.opts.pixelRatio;
1043
+
1044
+ F._afterLoad();
1045
+ };
1046
+
1047
+ img.onerror = function () {
1048
+ this.onload = this.onerror = null;
1049
+
1050
+ F._error( 'image' );
1051
+ };
1052
+
1053
+ img.src = F.coming.href;
1054
+
1055
+ if (img.complete !== true) {
1056
+ F.showLoading();
1057
+ }
1058
+ },
1059
+
1060
+ _loadAjax: function () {
1061
+ var coming = F.coming;
1062
+
1063
+ F.showLoading();
1064
+
1065
+ F.ajaxLoad = $.ajax($.extend({}, coming.ajax, {
1066
+ url: coming.href,
1067
+ error: function (jqXHR, textStatus) {
1068
+ if (F.coming && textStatus !== 'abort') {
1069
+ F._error( 'ajax', jqXHR );
1070
+ }
1071
+ else {
1072
+ F.hideLoading();
1073
+ }
1074
+ },
1075
+ success: function (data, textStatus) {
1076
+ if (textStatus === 'success') {
1077
+ coming.content = data;
1078
+
1079
+ F._afterLoad();
1080
+ }
1081
+ }
1082
+ }));
1083
+ },
1084
+
1085
+ _loadIframe: function() {
1086
+ var coming = F.coming,
1087
+ iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime()))
1088
+ .attr({
1089
+ 'scrolling' : (isTouch ? 'auto' : coming.iframe.scrolling),
1090
+ 'src' : coming.href,
1091
+ 'webkitallowfullscreen' : coming.iframe.allowfullscreen,
1092
+ 'mozallowfullscreen' : coming.iframe.allowfullscreen,
1093
+ 'allowfullscreen' : coming.iframe.allowfullscreen
1094
+ });
1095
+
1096
+ // This helps IE
1097
+ $(coming.wrap).on('onReset', function () {
1098
+ try {
1099
+ $(this).find('iframe').hide().attr('src', '//about:blank').end().empty();
1100
+ } catch (e) {}
1101
+ });
1102
+
1103
+ if (coming.iframe.preload) {
1104
+ F.showLoading();
1105
+
1106
+ iframe.one('load', function() {
1107
+ $(this).data('ready', 1);
1108
+
1109
+ // iOS will lose scrolling if we resize
1110
+ if (!isTouch) {
1111
+ $(this).on('load.fb', F.update);
1112
+ }
1113
+
1114
+ // Without this trick:
1115
+ // - iframe won't scroll on iOS devices
1116
+ // - IE7 sometimes displays empty iframe
1117
+ $(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show();
1118
+
1119
+ F._afterLoad();
1120
+ });
1121
+ }
1122
+
1123
+ coming.content = iframe.appendTo( coming.inner );
1124
+
1125
+ if (!coming.iframe.preload) {
1126
+ F._afterLoad();
1127
+ }
1128
+ },
1129
+
1130
+ _preloadImages: function() {
1131
+ var group = F.group,
1132
+ current = F.current,
1133
+ len = group.length,
1134
+ cnt = current.preload ? Math.min(current.preload, len - 1) : 0,
1135
+ item,
1136
+ i;
1137
+
1138
+ for (i = 1; i <= cnt; i += 1) {
1139
+ item = group[ (current.index + i ) % len ];
1140
+
1141
+ if (item.type === 'image' && item.href) {
1142
+ new Image().src = item.href;
1143
+ }
1144
+ }
1145
+ },
1146
+
1147
+ _afterLoad: function () {
1148
+ var coming = F.coming,
1149
+ previous = F.current,
1150
+ placeholder = 'fancybox-placeholder',
1151
+ current,
1152
+ content,
1153
+ type,
1154
+ scrolling,
1155
+ href,
1156
+ embed;
1157
+
1158
+ F.hideLoading();
1159
+
1160
+ if (!coming || F.isActive === false) {
1161
+ return;
1162
+ }
1163
+
1164
+ if (false === F.trigger('afterLoad', coming, previous)) {
1165
+ coming.wrap.stop(true).trigger('onReset').remove();
1166
+
1167
+ F.coming = null;
1168
+
1169
+ return;
1170
+ }
1171
+
1172
+ if (previous) {
1173
+ F.trigger('beforeChange', previous);
1174
+
1175
+ previous.wrap.stop(true).removeClass('fancybox-opened')
1176
+ .find('.fancybox-item, .fancybox-nav')
1177
+ .remove();
1178
+ }
1179
+
1180
+ F.unbindEvents();
1181
+
1182
+ current = coming;
1183
+ content = coming.content;
1184
+ type = coming.type;
1185
+ scrolling = coming.scrolling;
1186
+
1187
+ $.extend(F, {
1188
+ wrap : current.wrap,
1189
+ skin : current.skin,
1190
+ outer : current.outer,
1191
+ inner : current.inner,
1192
+ current : current,
1193
+ previous : previous
1194
+ });
1195
+
1196
+ href = current.href;
1197
+
1198
+ switch (type) {
1199
+ case 'image':
1200
+ content = current.tpl.image.replace(/\{href\}/g, href);
1201
+ break;
1202
+
1203
+ case 'svg':
1204
+ content = '<object type="image/svg+xml" width="100%" height="100%" data="' + href + '"></object>';
1205
+ break;
1206
+
1207
+ case 'inline':
1208
+ case 'ajax':
1209
+ case 'html':
1210
+ if (current.selector) {
1211
+ content = $('<div>').html(content).find(current.selector);
1212
+ }
1213
+ else if (isQuery(content)) {
1214
+ if (!content.data(placeholder)) {
1215
+ content.data(placeholder, content.clone().removeAttr('id').addClass(placeholder).insertAfter( content ) );
1216
+ }
1217
+
1218
+ content = content.detach();
1219
+
1220
+ current.wrap.on('onReset', function () {
1221
+ if ($(this).find(content).length) {
1222
+ content.replaceAll( content.data(placeholder) ).data(placeholder, false);
1223
+ }
1224
+ });
1225
+ }
1226
+ break;
1227
+ }
1228
+
1229
+ if (!(isQuery(content) && content.parent().is(current.inner))) {
1230
+ current.inner.append( content );
1231
+ }
1232
+
1233
+ // Give a chance for helpers or callbacks to update elements
1234
+ F.trigger('beforeShow');
1235
+
1236
+ // Set scrolling before calculating dimensions
1237
+ current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling));
1238
+
1239
+ // Set initial dimensions and start position
1240
+ F._setDimension();
1241
+
1242
+ F.reposition();
1243
+
1244
+ F.isOpen = false;
1245
+ F.coming = null;
1246
+
1247
+ F.bindEvents();
1248
+
1249
+ if (!F.isOpened) {
1250
+ $('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove();
1251
+ }
1252
+ else if (previous.prevMethod) {
1253
+ F.transitions[ previous.prevMethod ]();
1254
+ }
1255
+
1256
+ F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ]();
1257
+
1258
+ F._preloadImages();
1259
+ },
1260
+
1261
+ _setDimension: function () {
1262
+ var viewport = F.getViewport(),
1263
+ steps = 0,
1264
+ canShrink = false,
1265
+ canExpand = false,
1266
+ wrap = F.wrap,
1267
+ skin = F.skin,
1268
+ inner = F.inner,
1269
+ current = F.current,
1270
+ width = current.width,
1271
+ height = current.height,
1272
+ minWidth = current.minWidth,
1273
+ minHeight = current.minHeight,
1274
+ maxWidth = current.maxWidth,
1275
+ maxHeight = current.maxHeight,
1276
+ scrolling = current.scrolling,
1277
+ scrollOut = current.scrollOutside ? current.scrollbarWidth : 0,
1278
+ margin = current.margin,
1279
+ wMargin = getScalar(margin[1] + margin[3]),
1280
+ hMargin = getScalar(margin[0] + margin[2]),
1281
+ wPadding,
1282
+ hPadding,
1283
+ wSpace,
1284
+ hSpace,
1285
+ origWidth,
1286
+ origHeight,
1287
+ origMaxWidth,
1288
+ origMaxHeight,
1289
+ ratio,
1290
+ width_,
1291
+ height_,
1292
+ maxWidth_,
1293
+ maxHeight_,
1294
+ iframe,
1295
+ body;
1296
+
1297
+ // Reset dimensions so we could re-check actual size
1298
+ wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp');
1299
+
1300
+ wPadding = getScalar(skin.outerWidth(true) - skin.width());
1301
+ hPadding = getScalar(skin.outerHeight(true) - skin.height());
1302
+
1303
+ // Any space between content and viewport (margin, padding, border, title)
1304
+ wSpace = wMargin + wPadding;
1305
+ hSpace = hMargin + hPadding;
1306
+
1307
+ origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width;
1308
+ origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height;
1309
+
1310
+ if (current.type === 'iframe') {
1311
+ iframe = current.content;
1312
+
1313
+ if (current.autoHeight && iframe && iframe.data('ready') === 1) {
1314
+ try {
1315
+ if (iframe[0].contentWindow.document.location) {
1316
+ inner.width( origWidth ).height(9999);
1317
+
1318
+ body = iframe.contents().find('body');
1319
+
1320
+ if (scrollOut) {
1321
+ body.css('overflow-x', 'hidden');
1322
+ }
1323
+
1324
+ origHeight = body.outerHeight(true);
1325
+ }
1326
+
1327
+ } catch (e) {}
1328
+ }
1329
+ }
1330
+ else if (current.autoWidth || current.autoHeight) {
1331
+ inner.addClass( 'fancybox-tmp' );
1332
+
1333
+ // Set width or height in case we need to calculate only one dimension
1334
+ if (!current.autoWidth) {
1335
+ inner.width( origWidth );
1336
+ }
1337
+
1338
+ if (!current.autoHeight) {
1339
+ inner.height( origHeight );
1340
+ }
1341
+
1342
+ if (current.autoWidth) {
1343
+ origWidth = inner.width();
1344
+ }
1345
+
1346
+ if (current.autoHeight) {
1347
+ origHeight = inner.height();
1348
+ }
1349
+
1350
+ inner.removeClass( 'fancybox-tmp' );
1351
+ }
1352
+
1353
+ width = getScalar( origWidth );
1354
+ height = getScalar( origHeight );
1355
+
1356
+ ratio = origWidth / origHeight;
1357
+
1358
+ // Calculations for the content
1359
+ minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth);
1360
+ maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth);
1361
+
1362
+ minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight);
1363
+ maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight);
1364
+
1365
+ // These will be used to determine if wrap can fit in the viewport
1366
+ origMaxWidth = maxWidth;
1367
+ origMaxHeight = maxHeight;
1368
+
1369
+ if (current.fitToView) {
1370
+ maxWidth = Math.min(viewport.w - wSpace, maxWidth);
1371
+ maxHeight = Math.min(viewport.h - hSpace, maxHeight);
1372
+ }
1373
+
1374
+ maxWidth_ = viewport.w - wMargin;
1375
+ maxHeight_ = viewport.h - hMargin;
1376
+
1377
+ if (current.aspectRatio) {
1378
+ if (width > maxWidth) {
1379
+ width = maxWidth;
1380
+ height = getScalar(width / ratio);
1381
+ }
1382
+
1383
+ if (height > maxHeight) {
1384
+ height = maxHeight;
1385
+ width = getScalar(height * ratio);
1386
+ }
1387
+
1388
+ if (width < minWidth) {
1389
+ width = minWidth;
1390
+ height = getScalar(width / ratio);
1391
+ }
1392
+
1393
+ if (height < minHeight) {
1394
+ height = minHeight;
1395
+ width = getScalar(height * ratio);
1396
+ }
1397
+ }
1398
+ else {
1399
+ width = Math.max(minWidth, Math.min(width, maxWidth));
1400
+
1401
+ if (current.autoHeight && current.type !== 'iframe') {
1402
+ inner.width( width );
1403
+
1404
+ height = inner.height();
1405
+ }
1406
+
1407
+ height = Math.max(minHeight, Math.min(height, maxHeight));
1408
+ }
1409
+
1410
+ // Try to fit inside viewport (including the title)
1411
+ if (current.fitToView) {
1412
+ inner.width( width ).height( height );
1413
+
1414
+ wrap.width( width + wPadding );
1415
+
1416
+ // Real wrap dimensions
1417
+ width_ = wrap.width();
1418
+ height_ = wrap.height();
1419
+
1420
+ if (current.aspectRatio) {
1421
+ while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) {
1422
+ if (steps++ > 19) {
1423
+ break;
1424
+ }
1425
+
1426
+ height = Math.max(minHeight, Math.min(maxHeight, height - 10));
1427
+ width = getScalar(height * ratio);
1428
+
1429
+ if (width < minWidth) {
1430
+ width = minWidth;
1431
+ height = getScalar(width / ratio);
1432
+ }
1433
+
1434
+ if (width > maxWidth) {
1435
+ width = maxWidth;
1436
+ height = getScalar(width / ratio);
1437
+ }
1438
+
1439
+ inner.width( width ).height( height );
1440
+
1441
+ wrap.width( width + wPadding );
1442
+
1443
+ width_ = wrap.width();
1444
+ height_ = wrap.height();
1445
+ }
1446
+ }
1447
+ else {
1448
+ width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_)));
1449
+ height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_)));
1450
+ }
1451
+ }
1452
+
1453
+ if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) {
1454
+ width += scrollOut;
1455
+ }
1456
+
1457
+ inner.width( width ).height( height );
1458
+
1459
+ wrap.width( width + wPadding );
1460
+
1461
+ width_ = wrap.width();
1462
+ height_ = wrap.height();
1463
+
1464
+ canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight;
1465
+ canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight));
1466
+
1467
+ $.extend(current, {
1468
+ dim : {
1469
+ width : getValue( width_ ),
1470
+ height : getValue( height_ )
1471
+ },
1472
+ origWidth : origWidth,
1473
+ origHeight : origHeight,
1474
+ canShrink : canShrink,
1475
+ canExpand : canExpand,
1476
+ wPadding : wPadding,
1477
+ hPadding : hPadding,
1478
+ wrapSpace : height_ - skin.outerHeight(true),
1479
+ skinSpace : skin.height() - height
1480
+ });
1481
+
1482
+ if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) {
1483
+ inner.height('auto');
1484
+ }
1485
+ },
1486
+
1487
+ _getPosition: function (onlyAbsolute) {
1488
+ var current = F.current,
1489
+ viewport = F.getViewport(),
1490
+ margin = current.margin,
1491
+ width = F.wrap.width() + margin[1] + margin[3],
1492
+ height = F.wrap.height() + margin[0] + margin[2],
1493
+ rez = {
1494
+ position: 'absolute',
1495
+ top : margin[0],
1496
+ left : margin[3]
1497
+ };
1498
+
1499
+ if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {
1500
+ rez.position = 'fixed';
1501
+ }
1502
+ else if (!current.locked) {
1503
+ rez.top += viewport.y;
1504
+ rez.left += viewport.x;
1505
+ }
1506
+
1507
+ rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio)));
1508
+ rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio)));
1509
+
1510
+ return rez;
1511
+ },
1512
+
1513
+ _afterZoomIn: function () {
1514
+ var current = F.current;
1515
+
1516
+ if (!current) {
1517
+ return;
1518
+ }
1519
+
1520
+ F.isOpen = F.isOpened = true;
1521
+
1522
+ F.wrap.css('overflow', 'visible').addClass('fancybox-opened').hide().show(0);
1523
+
1524
+ F.update();
1525
+
1526
+ // Assign a click event
1527
+ if ( current.zoomClick || current.closeClick || (current.nextClick && F.group.length > 1) ) {
1528
+ F.inner.css('cursor', !current.zoomClick ? 'pointer' : (current.canExpand ? 'zoom-in' : 'zoom-out')).on('click.fb', function(e) {
1529
+ if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {
1530
+ e.preventDefault();
1531
+
1532
+ F[ current.zoomClick && (current.canExpand || current.canShrink) ? 'toggle' : ( current.closeClick ? 'close' : 'next' ) ]();
1533
+ }
1534
+ });
1535
+ }
1536
+
1537
+ // Create a close button
1538
+ if (current.closeBtn) {
1539
+ $(current.tpl.close.replace(/\{close\}/g, current.txt.close)).appendTo(F.skin).on('click.fb', function(e) {
1540
+ e.preventDefault();
1541
+
1542
+ F.close();
1543
+ });
1544
+ }
1545
+
1546
+ // Create navigation arrows
1547
+ if (current.arrows && F.group.length > 1) {
1548
+ if (current.loop || current.index > 0) {
1549
+ $(current.tpl.prev.replace(/\{prev\}/g, current.txt.prev)).appendTo(F.outer).on('click.fb', F.prev);
1550
+ }
1551
+
1552
+ if (current.loop || current.index < F.group.length - 1) {
1553
+ $(current.tpl.next.replace(/\{next\}/g, current.txt.next)).appendTo(F.outer).on('click.fb', F.next);
1554
+ }
1555
+ }
1556
+
1557
+ F.trigger('afterShow');
1558
+
1559
+ // Stop the slideshow if this is the last item
1560
+ if (!current.loop && current.index === current.group.length - 1) {
1561
+
1562
+ F.play( false );
1563
+ }
1564
+ else if (F.opts.autoPlay && !F.player.isActive) {
1565
+ F.opts.autoPlay = false;
1566
+
1567
+ F.play(true);
1568
+ }
1569
+ },
1570
+
1571
+ _afterZoomOut: function ( obj ) {
1572
+ obj = obj || F.current;
1573
+
1574
+ $('.fancybox-wrap').trigger('onReset').remove();
1575
+
1576
+ $.extend(F, {
1577
+ group : {},
1578
+ opts : {},
1579
+ router : false,
1580
+ current : null,
1581
+ isActive : false,
1582
+ isOpened : false,
1583
+ isOpen : false,
1584
+ isClosing : false,
1585
+ wrap : null,
1586
+ skin : null,
1587
+ outer : null,
1588
+ inner : null
1589
+ });
1590
+
1591
+ F.trigger('afterClose', obj);
1592
+ }
1593
+ });
1594
+
1595
+ /*
1596
+ * Default transitions
1597
+ */
1598
+
1599
+ F.transitions = {
1600
+ getOrigPosition: function () {
1601
+ var current = F.current,
1602
+ element = current.element,
1603
+ orig = current.orig,
1604
+ pos = {},
1605
+ width = 50,
1606
+ height = 50,
1607
+ hPadding = current.hPadding,
1608
+ wPadding = current.wPadding,
1609
+ viewport = F.getViewport();
1610
+
1611
+ if (!orig && current.isDom && element.is(':visible')) {
1612
+ orig = element.find('img:first');
1613
+
1614
+ if (!orig.length) {
1615
+ orig = element;
1616
+ }
1617
+ }
1618
+
1619
+ if (isQuery(orig)) {
1620
+ pos = orig.offset();
1621
+
1622
+ if (orig.is('img')) {
1623
+ width = orig.outerWidth();
1624
+ height = orig.outerHeight();
1625
+ }
1626
+ }
1627
+ else {
1628
+ pos.top = viewport.y + (viewport.h - height) * current.topRatio;
1629
+ pos.left = viewport.x + (viewport.w - width) * current.leftRatio;
1630
+ }
1631
+
1632
+ if (F.wrap.css('position') === 'fixed' || current.locked) {
1633
+ pos.top -= viewport.y;
1634
+ pos.left -= viewport.x;
1635
+ }
1636
+
1637
+ pos = {
1638
+ top : getValue(pos.top - hPadding * current.topRatio),
1639
+ left : getValue(pos.left - wPadding * current.leftRatio),
1640
+ width : getValue(width + wPadding),
1641
+ height : getValue(height + hPadding)
1642
+ };
1643
+
1644
+ return pos;
1645
+ },
1646
+
1647
+ step: function (now, fx) {
1648
+ var ratio,
1649
+ padding,
1650
+ value,
1651
+ prop = fx.prop,
1652
+ current = F.current,
1653
+ wrapSpace = current.wrapSpace,
1654
+ skinSpace = current.skinSpace;
1655
+
1656
+ if (prop === 'width' || prop === 'height') {
1657
+ ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start);
1658
+
1659
+ if (F.isClosing) {
1660
+ ratio = 1 - ratio;
1661
+ }
1662
+
1663
+ padding = prop === 'width' ? current.wPadding : current.hPadding;
1664
+ value = now - padding;
1665
+
1666
+ F.skin[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) ) );
1667
+ F.inner[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) );
1668
+ }
1669
+ },
1670
+
1671
+ zoomIn: function () {
1672
+ var current = F.current,
1673
+ startPos = current.pos,
1674
+ effect = current.openEffect,
1675
+ elastic = effect === 'elastic',
1676
+ endPos = $.extend({opacity : 1}, startPos);
1677
+
1678
+ // Remove "position" property that breaks older IE
1679
+ delete endPos.position;
1680
+
1681
+ if (elastic) {
1682
+ startPos = this.getOrigPosition();
1683
+
1684
+ if (current.openOpacity) {
1685
+ startPos.opacity = 0.1;
1686
+ }
1687
+ }
1688
+ else if (effect === 'fade') {
1689
+ startPos.opacity = 0.1;
1690
+ }
1691
+
1692
+ F.wrap.css(startPos).animate(endPos, {
1693
+ duration : effect === 'none' ? 0 : current.openSpeed,
1694
+ easing : current.openEasing,
1695
+ step : elastic ? this.step : null,
1696
+ complete : F._afterZoomIn
1697
+ });
1698
+ },
1699
+
1700
+ zoomOut: function () {
1701
+ var current = F.current,
1702
+ effect = current.closeEffect,
1703
+ elastic = effect === 'elastic',
1704
+ endPos = {opacity : 0.1};
1705
+
1706
+ if (elastic) {
1707
+ endPos = this.getOrigPosition();
1708
+
1709
+ if (current.closeOpacity) {
1710
+ endPos.opacity = 0.1;
1711
+ }
1712
+ }
1713
+
1714
+ F.wrap.animate(endPos, {
1715
+ duration : effect === 'none' ? 0 : current.closeSpeed,
1716
+ easing : current.closeEasing,
1717
+ step : elastic ? this.step : null,
1718
+ complete : F._afterZoomOut
1719
+ });
1720
+ },
1721
+
1722
+ changeIn: function () {
1723
+ var current = F.current,
1724
+ effect = current.nextEffect,
1725
+ startPos = current.pos,
1726
+ endPos = { opacity : 1 },
1727
+ direction = F.direction,
1728
+ distance = 200,
1729
+ field;
1730
+
1731
+ startPos.opacity = 0.1;
1732
+
1733
+ if (effect === 'elastic') {
1734
+ field = direction === 'down' || direction === 'up' ? 'top' : 'left';
1735
+
1736
+ if (direction === 'down' || direction === 'right') {
1737
+ startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance);
1738
+ endPos[ field ] = '+=' + distance + 'px';
1739
+ }
1740
+ else {
1741
+ startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);
1742
+ endPos[ field ] = '-=' + distance + 'px';
1743
+ }
1744
+ }
1745
+
1746
+ // Workaround for http://bugs.jquery.com/ticket/12273
1747
+ if (effect === 'none') {
1748
+ F._afterZoomIn();
1749
+ }
1750
+ else {
1751
+ F.wrap.css(startPos).animate(endPos, {
1752
+ duration : current.nextSpeed,
1753
+ easing : current.nextEasing,
1754
+ complete : F._afterZoomIn
1755
+ });
1756
+ }
1757
+ },
1758
+
1759
+ changeOut: function () {
1760
+ var previous = F.previous,
1761
+ effect = previous.prevEffect,
1762
+ endPos = { opacity : 0.1 },
1763
+ direction = F.direction,
1764
+ distance = 200;
1765
+
1766
+ if (effect === 'elastic') {
1767
+ endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px';
1768
+ }
1769
+
1770
+ previous.wrap.animate(endPos, {
1771
+ duration : effect === 'none' ? 0 : previous.prevSpeed,
1772
+ easing : previous.prevEasing,
1773
+ complete : function () {
1774
+ $(this).trigger('onReset').remove();
1775
+ }
1776
+ });
1777
+ }
1778
+ };
1779
+
1780
+ /*
1781
+ * Overlay helper
1782
+ */
1783
+
1784
+ F.helpers.overlay = {
1785
+ defaults : {
1786
+ closeClick : true, // if true, fancyBox will be closed when user clicks on the overlay
1787
+ speedOut : 200, // duration of fadeOut animation
1788
+ showEarly : true, // indicates if should be opened immediately or wait until the content is ready
1789
+ css : {}, // custom CSS properties
1790
+ locked : !isTouch, // if true, the content will be locked into overlay
1791
+ fixed : true // if false, the overlay CSS position property will not be set to "fixed"
1792
+ },
1793
+
1794
+ overlay : null, // current handle
1795
+ fixed : false, // indicates if the overlay has position "fixed"
1796
+ el : $('html'), // element that contains "the lock"
1797
+
1798
+ // Public methods
1799
+ create : function(opts) {
1800
+ var parent;
1801
+
1802
+ opts = $.extend({}, this.defaults, opts);
1803
+
1804
+ if (this.overlay) {
1805
+ this.close();
1806
+ }
1807
+
1808
+ parent = F.coming ? F.coming.parent : opts.parent;
1809
+
1810
+ this.overlay = $('<div class="fancybox-overlay"></div>').appendTo( parent && parent.length ? parent : 'body' );
1811
+ this.fixed = false;
1812
+
1813
+ if (opts.fixed && F.defaults.fixed) {
1814
+ this.overlay.addClass('fancybox-overlay-fixed');
1815
+
1816
+ this.fixed = true;
1817
+ }
1818
+ },
1819
+
1820
+ open : function(opts) {
1821
+ var that = this;
1822
+
1823
+ opts = $.extend({}, this.defaults, opts);
1824
+
1825
+ if (this.overlay) {
1826
+ this.overlay.off('.overlay').width('auto').height('auto');
1827
+ }
1828
+ else {
1829
+ this.create(opts);
1830
+ }
1831
+
1832
+ if (!this.fixed) {
1833
+ W.on('resize.overlay', $.proxy( this.update, this) );
1834
+
1835
+ this.update();
1836
+ }
1837
+
1838
+ if (opts.closeClick) {
1839
+ this.overlay.on('click.overlay', function(e) {
1840
+ if ($(e.target).hasClass('fancybox-overlay')) {
1841
+ if (F.isActive) {
1842
+ F.close();
1843
+ }
1844
+ else {
1845
+ that.close();
1846
+ }
1847
+ return false;
1848
+ }
1849
+ });
1850
+ }
1851
+
1852
+ this.overlay.css( opts.css ).show();
1853
+ },
1854
+
1855
+ close : function() {
1856
+ W.off('resize.overlay');
1857
+
1858
+ if (this.el.hasClass('fancybox-lock')) {
1859
+ $('.fancybox-margin').removeClass('fancybox-margin');
1860
+
1861
+ this.el.removeClass('fancybox-lock');
1862
+
1863
+ W.scrollTop( this.scrollV ).scrollLeft( this.scrollH );
1864
+ }
1865
+
1866
+ $('.fancybox-overlay').remove().hide();
1867
+
1868
+ $.extend(this, {
1869
+ overlay : null,
1870
+ fixed : false
1871
+ });
1872
+ },
1873
+
1874
+ // Private, callbacks
1875
+
1876
+ update : function () {
1877
+ var width = '100%', offsetWidth;
1878
+
1879
+ // Reset width/height so it will not mess
1880
+ this.overlay.width(width).height('100%');
1881
+
1882
+ // jQuery does not return reliable result for IE
1883
+ if (IE) {
1884
+ offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);
1885
+
1886
+ if (D.width() > offsetWidth) {
1887
+ width = D.width();
1888
+ }
1889
+ }
1890
+ else if (D.width() > W.width()) {
1891
+ width = D.width();
1892
+ }
1893
+
1894
+ this.overlay.width(width).height(D.height());
1895
+ },
1896
+
1897
+ // This is where we can manipulate DOM, because later it would cause iframes to reload
1898
+ onReady : function (opts, obj) {
1899
+ var overlay = this.overlay;
1900
+
1901
+ $('.fancybox-overlay').stop(true, true);
1902
+
1903
+ if (!overlay) {
1904
+ this.create(opts);
1905
+ }
1906
+
1907
+ if (opts.locked && this.fixed && obj.fixed) {
1908
+ obj.locked = this.overlay.append( obj.wrap );
1909
+ obj.fixed = false;
1910
+ }
1911
+
1912
+ if (opts.showEarly === true) {
1913
+ this.beforeShow.apply(this, arguments);
1914
+ }
1915
+ },
1916
+
1917
+ beforeShow : function(opts, obj) {
1918
+ if (obj.locked && !this.el.hasClass('fancybox-lock')) {
1919
+ if (this.fixPosition !== false) {
1920
+ $('*:not(object)').filter(function(){
1921
+ return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") );
1922
+ }).addClass('fancybox-margin');
1923
+ }
1924
+
1925
+ this.el.addClass('fancybox-margin');
1926
+
1927
+ this.scrollV = W.scrollTop();
1928
+ this.scrollH = W.scrollLeft();
1929
+
1930
+ this.el.addClass('fancybox-lock');
1931
+
1932
+ W.scrollTop( this.scrollV ).scrollLeft( this.scrollH );
1933
+ }
1934
+
1935
+ this.open(opts);
1936
+ },
1937
+
1938
+ onUpdate : function() {
1939
+ if (!this.fixed) {
1940
+ this.update();
1941
+ }
1942
+ },
1943
+
1944
+ afterClose: function (opts) {
1945
+ // Remove overlay if exists and fancyBox is not opening
1946
+ // (e.g., it is not being open using afterClose callback)
1947
+ if (this.overlay && !F.coming) {
1948
+ this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this ));
1949
+ }
1950
+ }
1951
+ };
1952
+
1953
+ /*
1954
+ * Title helper
1955
+ */
1956
+
1957
+ F.helpers.title = {
1958
+ defaults : {
1959
+ type : 'float', // 'float', 'inside', 'outside' or 'over',
1960
+ position : 'bottom' // 'top' or 'bottom'
1961
+ },
1962
+
1963
+ beforeShow: function (opts) {
1964
+ var current = F.current,
1965
+ text = current.title,
1966
+ type = opts.type,
1967
+ title,
1968
+ target;
1969
+
1970
+ if ($.isFunction(text)) {
1971
+ text = text.call(current.element, current);
1972
+ }
1973
+
1974
+ if (!isString(text) || $.trim(text) === '') {
1975
+ return;
1976
+ }
1977
+
1978
+ title = $('<div class="fancybox-title fancybox-title-' + type + '-wrap">' + text + '</div>');
1979
+
1980
+ switch (type) {
1981
+ case 'inside':
1982
+ target = F.skin;
1983
+ break;
1984
+
1985
+ case 'outside':
1986
+ target = F.wrap;
1987
+ break;
1988
+
1989
+ case 'over':
1990
+ target = F.inner;
1991
+ break;
1992
+
1993
+ default: // 'float'
1994
+ target = F.skin;
1995
+
1996
+ title.appendTo('body');
1997
+
1998
+ if (IE) {
1999
+ title.width( title.width() );
2000
+ }
2001
+
2002
+ title.wrapInner('<span class="child"></span>');
2003
+
2004
+ //Increase bottom margin so this title will also fit into viewport
2005
+ F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) );
2006
+ break;
2007
+ }
2008
+
2009
+ title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target);
2010
+ }
2011
+ };
2012
+
2013
+ // jQuery plugin initialization
2014
+ $.fn.fancybox = function (options) {
2015
+ var index,
2016
+ that = $(this),
2017
+ selector = this.selector || '',
2018
+ run = function(e) {
2019
+ var what = $(this).blur(), idx = index, relType, relVal;
2020
+
2021
+ if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
2022
+ relType = options.groupAttr || 'data-fancybox-group';
2023
+ relVal = what.attr(relType);
2024
+
2025
+ if (!relVal) {
2026
+ relType = 'rel';
2027
+ relVal = what.get(0)[ relType ];
2028
+ }
2029
+
2030
+ if (relVal && relVal !== '' && relVal !== 'nofollow') {
2031
+ what = selector.length ? $(selector) : that;
2032
+ what = what.filter('[' + relType + '="' + relVal + '"]');
2033
+ idx = what.index(this);
2034
+ }
2035
+
2036
+ options.index = idx;
2037
+
2038
+ // Abort if not enough screen space
2039
+ var viewport = F.getViewport();
2040
+ if ( (options.minVpWidth && viewport.w < options.minVpWidth) || (options.minVpHeight && viewport.h < options.minVpHeight) ) {
2041
+ return;
2042
+ }
2043
+
2044
+ // Stop an event from bubbling if everything is fine
2045
+ if (F.open(what, options) !== false) {
2046
+ e.preventDefault();
2047
+ return false;
2048
+ }
2049
+ }
2050
+ };
2051
+
2052
+ options = options || {};
2053
+ index = options.index || 0;
2054
+
2055
+ if (!selector || options.live === false) {
2056
+ that.off('click.fb-start').on('click.fb-start', run);
2057
+ }
2058
+ else {
2059
+ D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run);
2060
+ }
2061
+
2062
+ this.filter('[data-fancybox-start=1]').trigger('click');
2063
+
2064
+ return this;
2065
+ };
2066
+
2067
+ // Tests that need a body at doc ready
2068
+ D.ready(function() {
2069
+ var w1, w2;
2070
+
2071
+ if ( $.scrollbarWidth === undefined ) {
2072
+ // http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth
2073
+ $.scrollbarWidth = function() {
2074
+ var parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body'),
2075
+ child = parent.children(),
2076
+ width = child.innerWidth() - child.height( 99 ).innerWidth();
2077
+
2078
+ parent.remove();
2079
+
2080
+ return width;
2081
+ };
2082
+ }
2083
+
2084
+ if ( $.support.fixedPosition === undefined ) {
2085
+ $.support.fixedPosition = (function() {
2086
+ var elem = $('<div style="position:fixed;top:20px;"></div>').appendTo('body'),
2087
+ fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 );
2088
+
2089
+ elem.remove();
2090
+
2091
+ return fixed;
2092
+ }());
2093
+ }
2094
+
2095
+ $.extend(F.defaults, {
2096
+ scrollbarWidth : $.scrollbarWidth(),
2097
+ fixed : $.support.fixedPosition,
2098
+ parent : $('body')
2099
+ });
2100
+
2101
+ //Get real width of page scroll-bar
2102
+ w1 = $(window).width();
2103
+
2104
+ H.addClass('fancybox-lock-test');
2105
+
2106
+ w2 = $(window).width();
2107
+
2108
+ H.removeClass('fancybox-lock-test');
2109
+
2110
+ $("<style type='text/css'>.fancybox-margin{margin-right:" + (w2 - w1) + "px;}</style>").appendTo("head");
2111
+ });
2112
+
2113
+ }(window, document, jQuery));
fancybox/2.2.0/jquery.fancybox.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .fancybox-wrap,.fancybox-skin,.fancybox-outer,.fancybox-inner,.fancybox-wrap img,.fancybox-wrap iframe,.fancybox-wrap object,.fancybox-nav,.fancybox-nav span,.fancybox-tmp{padding:0;margin:0;border:0;outline:none;vertical-align:top;}.fancybox-wrap{position:absolute;top:0;left:0;transform:translate3d(0,0,0);z-index:100020;}.fancybox-skin{position:relative;background:#f9f9f9;color:#444;text-shadow:none;}.fancybox-opened{z-index:100030;}.fancybox-opened .fancybox-skin{box-shadow:0 10px 25px rgba(0,0,0,.5);}.fancybox-outer,.fancybox-inner{position:relative;}.fancybox-inner{overflow:hidden;}.fancybox-type-iframe .fancybox-inner{-webkit-overflow-scrolling:touch;}.fancybox-error{color:#444;font:14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;margin:0;padding:15px;white-space:nowrap;}.fancybox-wrap .fancybox-image,.fancybox-wrap .fancybox-iframe{display:block;width:100%;height:100%;}.fancybox-wrap .fancybox-image{max-width:100%;max-height:100%;}#fancybox-loading,.fancybox-close,.fancybox-prev span,.fancybox-next span{background-image:url(fancybox_sprite.png);}#fancybox-loading{position:fixed;top:50%;left:50%;margin-top:-22px;margin-left:-22px;background-position:0 -108px;opacity:.8;cursor:pointer;z-index:100060;}#fancybox-loading div{width:44px;height:44px;background:url(fancybox_loading.gif) center center no-repeat;}.fancybox-close{position:absolute;top:-18px;right:-18px;width:36px;height:36px;cursor:pointer;z-index:100040;}.fancybox-nav{position:absolute;top:0;width:40%;height:100%;cursor:pointer;text-decoration:none;background:transparent;-webkit-tap-highlight-color:rgba(0,0,0,0);z-index:100040;}.fancybox-prev{left:0;}.fancybox-next{right:0;}.fancybox-nav span{position:absolute;top:50%;width:36px;height:34px;margin-top:-18px;cursor:pointer;z-index:100040;visibility:hidden;}.fancybox-prev span{left:10px;background-position:0 -36px;}.fancybox-next span{right:10px;background-position:0 -72px;}.fancybox-nav:hover span{visibility:visible;}.fancybox-tmp{position:absolute;top:-99999px;left:-99999px;max-width:99999px;max-height:99999px;overflow:visible!important;}.fancybox-lock{overflow:visible!important;width:auto;}.fancybox-lock body{overflow:hidden!important;}.fancybox-lock-test{overflow-y:hidden!important;}.fancybox-overlay{position:absolute;top:0;left:0;overflow:hidden;display:none;z-index:100010;background-color:rgba(0,0,0,.7);}.fancybox-overlay-fixed{position:fixed;bottom:0;right:0;}.fancybox-lock .fancybox-overlay{overflow:auto;overflow-y:scroll;}.fancybox-title{visibility:hidden;font:normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;position:relative;text-shadow:none;z-index:100050;}.fancybox-opened .fancybox-title{visibility:visible;}.fancybox-title-float-wrap{position:absolute;bottom:0;right:50%;margin-bottom:-37px;z-index:100050;text-align:center;}.fancybox-title-float-wrap .child{display:inline-block;margin-right:-100%;padding:2px 20px;background:black;border:2px solid white;border-radius:15px;color:#FFF;font-weight:bold;line-height:22px;white-space:nowrap;}.fancybox-title-outside-wrap{position:relative;margin-top:10px;color:#fff;}.fancybox-title-outside-wrap:first-child{margin-top:0;margin-bottom:10px;}.fancybox-title-inside-wrap{padding-top:10px;}.fancybox-title-inside-wrap:first-child{padding-top:0;padding-bottom:10px;}.fancybox-title-over-wrap{position:absolute;bottom:0;left:0;right:0;color:#fff;padding:10px;background:#000;background:rgba(0,0,0,.8);}.fancybox-hidden{display:none;}.fancybox-inner .fancybox-hidden{display:revert;}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min--moz-device-pixel-ratio:1.5),only screen and (min-device-pixel-ratio:1.5){#fancybox-loading,.fancybox-close,.fancybox-prev span,.fancybox-next span{background-image:url(fancybox_sprite@2x.png);background-size:44px 152px}#fancybox-loading div{background-image:url(fancybox_loading@2x.gif);background-size:24px 24px}}
fancybox/2.2.0/jquery.fancybox.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e,t,o,n){"use strict";var i=o("html"),a=o(e),r=o(t),l=o.fancybox=function(){l.open.apply(this,arguments)},s=navigator.userAgent.match(/msie/i),c=null,p="ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,d=function(e){return e&&e.hasOwnProperty&&e instanceof o},h=function(e){return e&&"string"===o.type(e)},f=function(e){return h(e)&&e.indexOf("%")>0},u=function(e,t){var o=parseInt(e,10)||0;return t&&f(e)&&(o=l.getViewport()[t]/100*o),Math.ceil(o)},g=function(e,t){return u(e,t)+"px"};o.extend(l,{version:"2.2.0",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:e.devicePixelRatio||1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!p,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,minVpWidth:320,minVpHeight:320,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,zoomClick:!1,mouseWheel:!0,swipe:p,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",allowfullscreen:!0,preload:!0},svg:{},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" allow="autoplay"'+(s?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">{error}</p>',close:'<a title="{close}" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="{next}" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="{prev}" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>',loading:'<div id="fancybox-loading"><div></div></div>'},txt:{error:{content:"The requested content cannot be loaded.<br/>Please try again later.",image:"The requested image cannot be loaded.<br/>Please try again later.",ajax:"An AJAX error occurred.<br/>Please contact the site administrator.",href:"Missing media target URL.<br/>Please contact the site administrator."},close:"Close",next:"Next",prev:"Previous"},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:o.noop,beforeLoad:o.noop,afterLoad:o.noop,beforeShow:o.noop,afterShow:o.noop,beforeChange:o.noop,beforeClose:o.noop,afterClose:o.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(e,t){if(e&&(o.isPlainObject(t)||(t={}),!1!==l.close(!0)))return o.isArray(e)||(e=d(e)?o(e).get():[e]),o.each(e,(function(i,a){var r,s,c,p,f,u,g,m={};"object"===o.type(a)&&(a.nodeType&&(a=o(a)),d(a)?(m={href:a.data("fancybox-href")||a.attr("href"),title:o("<div/>").text(a.data("fancybox-title")||a.attr("title")||"").html(),isDom:!0,element:a},o.metadata&&o.extend(!0,m,a.metadata())):m=a),r=t.href||m.href||(h(a)?a:null),s=t.title!==n?t.title:m.title||"",!(p=(c=t.content||m.content)?"html":t.type||m.type)&&m.isDom&&((p=a.data("fancybox-type"))||(p=(f=a.prop("class").match(/fancybox\.(\w+)/))?f[1]:null)),h(r)&&(p||(l.isImage(r)?p="image":l.isSVG(r)?p="svg":"#"===r.charAt(0)?p="inline":h(a)&&(p="html",c=a)),"ajax"===p&&(u=r.split(/\s+/,2),r=u.shift(),g=u.shift())),c||("inline"===p?r?c=o(h(r)?r.replace(/.*(?=#[^\s]+$)/,""):r):m.isDom&&(c=a):"html"===p?c=r:p||r||!m.isDom||(p="inline",c=a)),o.extend(m,{href:r,type:p,content:c,title:s,selector:g}),e[i]=m})),l.opts=o.extend(!0,{},l.defaults,t),t.keys!==n&&(l.opts.keys=!!t.keys&&o.extend({},l.defaults.keys,t.keys)),l.group=e,l._start(l.opts.index)},cancel:function(){var e=l.coming;e&&!1===l.trigger("onCancel")||(l.hideLoading(),e&&(l.ajaxLoad&&l.ajaxLoad.abort(),l.ajaxLoad=null,l.imgPreload&&(l.imgPreload.onload=l.imgPreload.onerror=null),e.wrap&&e.wrap.stop(!0,!0).trigger("onReset").remove(),l.coming=null,l.current||l._afterZoomOut(e)))},close:function(e){l.cancel(),!1!==l.trigger("beforeClose")&&(l.unbindEvents(),l.isActive&&(l.isOpen&&!0!==e?(l.isOpen=l.isOpened=!1,l.isClosing=!0,o(".fancybox-item, .fancybox-nav").remove(),l.wrap.stop(!0,!0).removeClass("fancybox-opened"),l.transitions[l.current.closeMethod]()):(o(".fancybox-wrap").stop(!0).trigger("onReset").remove(),l._afterZoomOut())))},play:function(e){var t=function(){clearTimeout(l.player.timer)},o=function(){t(),l.current&&l.player.isActive&&(l.player.timer=setTimeout(l.next,l.current.playSpeed))},n=function(){t(),r.off(".player"),l.player.isActive=!1,l.trigger("onPlayEnd")};!0===e||!l.player.isActive&&!1!==e?l.current&&(l.current.loop||l.current.index<l.group.length-1)&&(l.player.isActive=!0,r.on({"onCancel.player beforeClose.player":n,"onUpdate.player":o,"beforeLoad.player":t}),o(),l.trigger("onPlayStart")):n()},swipe:function(e,t,o){e>o||t>o?(l.wrap.off("touchstart.fb touchmove.fb touchend.fb mouseup.fb mousedown.fb mousemove.fb mousewheel.fb"),l.next(t>o?"up":"left")):(e<-o||t<-o)&&(l.wrap.off("touchstart.fb touchmove.fb touchend.fb mouseup.fb mousedown.fb mousemove.fb mousewheel.fb"),l.prev(t<-o?"down":"right"))},next:function(e){var t=l.current;t&&(h(e)||(e=t.direction.next),l.jumpto(t.index+1,e,"next"))},prev:function(e){var t=l.current;t&&(h(e)||(e=t.direction.prev),l.jumpto(t.index-1,e,"prev"))},jumpto:function(e,t,o){var i=l.current;i&&(e=u(e),l.direction=t||i.direction[e>=i.index?"next":"prev"],l.router=o||"jumpto",i.loop&&(e<0&&(e=i.group.length+e%i.group.length),e%=i.group.length),i.group[e]!==n&&(l.cancel(),l.isJumping=!0,l._start(e)))},canScroll:function(e){let t=!1,n=o(e);for(;n.length&&!(t||n.is(".fancybox-skin")||n.is(".fancybox-wrap"));)t=(i=n[0])&&!(i.style.overflow&&"hidden"===i.style.overflow)&&(i.clientWidth&&i.scrollWidth>i.clientWidth||i.clientHeight&&i.scrollHeight>i.clientHeight),n=o(n).parent();var i;return t},reposition:function(e,t){var n,i=l.current,a=i?i.wrap:null;a&&(n=l._getPosition(t),e&&"scroll"===e.type?(delete n.position,a.stop(!0,!0).animate(n,200)):(a.css(n),i.pos=o.extend({},i.dim,n)))},update:function(e){var t=e&&e.originalEvent&&e.originalEvent.type,o=!t||"orientationchange"===t;o&&(clearTimeout(c),c=null),l.isOpen&&!c&&(c=setTimeout((function(){var n=l.current;n&&!l.isClosing&&(l.wrap.removeClass("fancybox-tmp"),(o||"load"===t||"resize"===t&&n.autoResize)&&l._setDimension(),"scroll"===t&&n.canShrink||l.reposition(e),n.zoomClick&&l.inner.css("cursor",n.canExpand?"zoom-in":"zoom-out"),l.trigger("onUpdate"),c=null)}),o&&!p?0:300))},toggle:function(e){l.isOpen&&(l.current.fitToView="boolean"===o.type(e)?e:!l.current.fitToView,p&&(l.wrap.removeAttr("style").addClass("fancybox-tmp"),l.trigger("onUpdate")),l.update())},hideLoading:function(){r.off(".loading"),o("#fancybox-loading").remove()},showLoading:function(){var e,t;l.hideLoading(),e=o(l.opts.tpl.loading).click(l.cancel).appendTo("body"),r.on("keydown.loading",(function(e){if(27===(e.which||e.keyCode))return l.cancel(),e.preventDefault(),!1})),l.defaults.fixed||(t=l.getViewport(),e.css({position:"absolute",top:.5*t.h+t.y,left:.5*t.w+t.x})),l.trigger("onLoading")},getViewport:function(){var t=l.current&&l.current.locked||!1,o={x:a.scrollLeft(),y:a.scrollTop()};return t&&t.length?(o.w=t[0].clientWidth,o.h=t[0].clientHeight):(o.w=p&&e.innerWidth?e.innerWidth:a.width(),o.h=p&&e.innerHeight?e.innerHeight:a.height()),o},unbindEvents:function(){l.wrap&&d(l.wrap)&&l.wrap.off(".fb"),r.off(".fb"),a.off(".fb")},bindEvents:function(){var e,t=l.current;t&&(a.on("orientationchange.fb"+(p?"":" resize.fb")+(t.autoCenter&&!t.locked?" scroll.fb":""),l.update),(e=t.keys)&&r.on("keydown.fb",(function(i){var a=i.which||i.keyCode,r=i.target||i.srcElement;if(27===a&&l.coming)return!1;i.ctrlKey||i.altKey||i.shiftKey||i.metaKey||r&&(r.type||o(r).is("[contenteditable]"))||o.each(e,(function(e,r){return t.group.length>1&&r[a]!==n?(l[e](r[a]),i.preventDefault(),!1):o.inArray(a,r)>-1?(l[e](),i.preventDefault(),!1):void 0}))})),t.group.length>1&&(l.wrap.css("cursor","move"),l.wrap.on("mousedown.fb",(function(e){let t={};e.preventDefault(),t.startX=void 0!==e.clientX?e.clientX:e.originalEvent.clientX,t.startY=void 0!==e.clientY?e.clientY:e.originalEvent.clientY,l.wrap.on("mousemove.fb",(function(e){e.preventDefault(),t.endX=void 0!==e.clientX?e.clientX:e.originalEvent.clientX,t.endY=void 0!==e.clientY?e.clientY:e.originalEvent.clientY})),l.wrap.on("mouseup.fb",(function(){l.wrap.off("mousemove.fb"),l.swipe(t.startX-t.endX,t.startY-t.endY,100)}))})),t.swipe&&(l.wrap.on("touchstart.fb",(function(e){let o=e.target||null,n={},i=void 0!==e.touches?e.touches.length:e.originalEvent.touches.length;t.canShrink||i>1||l.canScroll(o)||(e.preventDefault(),n.startX=void 0!==e.touches?e.touches[0].clientX:e.originalEvent.touches[0].clientX,n.startY=void 0!==e.touches?e.touches[0].clientY:e.originalEvent.touches[0].clientY,l.wrap.on("touchmove.fb",(function(e){if(i=void 0!==e.touches?e.touches.length:e.originalEvent.touches.length,i>1)return;e.preventDefault();let t=void 0!==e.touches?e.touches[0].clientX:e.originalEvent.touches[0].clientX,o=void 0!==e.touches?e.touches[0].clientY:e.originalEvent.touches[0].clientY;l.swipe(n.startX-t,n.startY-o,100)})))})),l.wrap.on("touchend.fb",(function(){l.wrap.off("touchmove.fb")}))),o.fn.mousewheel&&t.mouseWheel&&l.wrap.on("mousewheel.fb",(function(e,o,n,i){let a=e.target||null;t.canShrink||0===o||l.canScroll(a)||(e.preventDefault(),l.swipe(-n,-i,0))}))))},trigger:function(e,t){var n,i=t||l.coming||l.current;if(i){if(o.isFunction(i[e])&&(n=i[e].apply(i,Array.prototype.slice.call(arguments,1))),!1===n)return!1;i.helpers&&o.each(i.helpers,(function(t,n){n&&l.helpers[t]&&o.isFunction(l.helpers[t][e])&&l.helpers[t][e](o.extend(!0,{},l.helpers[t].defaults,n),i)}))}r.trigger(e)},isImage:function(e){return h(e)&&e.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSVG:function(e){return h(e)&&e.match(/\.(svg)((\?|#).*)?$/i)},_start:function(e){var t,n,i,a,r,s={};if(e=u(e),!(t=l.group[e]||null))return!1;if(a=(s=o.extend(!0,{},l.opts,t)).margin,r=s.padding,"number"===o.type(a)&&(s.margin=[a,a,a,a]),"number"===o.type(r)&&(s.padding=[r,r,r,r]),s.modal&&o.extend(!0,s,{closeBtn:!1,closeClick:!1,nextClick:!1,zoomClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),s.autoSize&&(s.autoWidth=s.autoHeight=!0),"auto"===s.width&&(s.autoWidth=!0),"auto"===s.height&&(s.autoHeight=!0),s.group=l.group,s.index=e,l.coming=s,!1!==l.trigger("beforeLoad")){if(i=s.type,n=s.href,!i)return l.coming=null,!(!l.current||!l.router||"jumpto"===l.router)&&(l.current.index=e,l[l.router](l.direction));if(l.isActive=!0,"image"!==i&&"svg"!==i||(s.autoHeight=s.autoWidth=!1,s.scrolling="visible",s.aspectRatio=!0),"iframe"===i&&p&&(s.scrolling="scroll"),s.wrap=o(s.tpl.wrap).addClass("fancybox-"+(p?"mobile":"desktop")+" fancybox-type-"+i+" fancybox-tmp "+s.wrapCSS).appendTo(s.parent||"body"),o.extend(s,{skin:o(".fancybox-skin",s.wrap),outer:o(".fancybox-outer",s.wrap),inner:o(".fancybox-inner",s.wrap)}),o.each(["Top","Right","Bottom","Left"],(function(e,t){s.skin.css("padding"+t,g(s.padding[e]))})),l.trigger("onReady"),"inline"===i||"html"===i){if(!s.content||!s.content.length)return l._error("content")}else if(!n)return l._error("href");"image"===i?l._loadImage():"ajax"===i?l._loadAjax():"iframe"===i?l._loadIframe():l._afterLoad()}else l.coming=null},_error:function(e){let t=l.coming.txt.error[e]||l.coming.txt.error.content;arguments.length>1&&(t=t+"<br/><br/>"+arguments[1]),o.extend(l.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",content:l.coming.tpl.error.replace(/\{error\}/g,t)}),l._afterLoad()},_loadImage:function(){var e=l.imgPreload=new Image;e.onload=function(){this.onload=this.onerror=null,l.coming.width=this.width/l.opts.pixelRatio,l.coming.height=this.height/l.opts.pixelRatio,l._afterLoad()},e.onerror=function(){this.onload=this.onerror=null,l._error("image")},e.src=l.coming.href,!0!==e.complete&&l.showLoading()},_loadAjax:function(){var e=l.coming;l.showLoading(),l.ajaxLoad=o.ajax(o.extend({},e.ajax,{url:e.href,error:function(e,t){l.coming&&"abort"!==t?l._error("ajax",e):l.hideLoading()},success:function(t,o){"success"===o&&(e.content=t,l._afterLoad())}}))},_loadIframe:function(){var e=l.coming,t=o(e.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr({scrolling:p?"auto":e.iframe.scrolling,src:e.href,webkitallowfullscreen:e.iframe.allowfullscreen,mozallowfullscreen:e.iframe.allowfullscreen,allowfullscreen:e.iframe.allowfullscreen});o(e.wrap).on("onReset",(function(){try{o(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(e){}})),e.iframe.preload&&(l.showLoading(),t.one("load",(function(){o(this).data("ready",1),p||o(this).on("load.fb",l.update),o(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),l._afterLoad()}))),e.content=t.appendTo(e.inner),e.iframe.preload||l._afterLoad()},_preloadImages:function(){var e,t,o=l.group,n=l.current,i=o.length,a=n.preload?Math.min(n.preload,i-1):0;for(t=1;t<=a;t+=1)"image"===(e=o[(n.index+t)%i]).type&&e.href&&((new Image).src=e.href)},_afterLoad:function(){var e,t,n,i,a,r=l.coming,s=l.current,c="fancybox-placeholder";if(l.hideLoading(),r&&!1!==l.isActive){if(!1===l.trigger("afterLoad",r,s))return r.wrap.stop(!0).trigger("onReset").remove(),void(l.coming=null);switch(s&&(l.trigger("beforeChange",s),s.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),l.unbindEvents(),e=r,t=r.content,n=r.type,i=r.scrolling,o.extend(l,{wrap:e.wrap,skin:e.skin,outer:e.outer,inner:e.inner,current:e,previous:s}),a=e.href,n){case"image":t=e.tpl.image.replace(/\{href\}/g,a);break;case"svg":t='<object type="image/svg+xml" width="100%" height="100%" data="'+a+'"></object>';break;case"inline":case"ajax":case"html":e.selector?t=o("<div>").html(t).find(e.selector):d(t)&&(t.data(c)||t.data(c,t.clone().removeAttr("id").addClass(c).insertAfter(t)),t=t.detach(),e.wrap.on("onReset",(function(){o(this).find(t).length&&t.replaceAll(t.data(c)).data(c,!1)})));break}d(t)&&t.parent().is(e.inner)||e.inner.append(t),l.trigger("beforeShow"),e.inner.css("overflow","yes"===i?"scroll":"no"===i?"hidden":i),l._setDimension(),l.reposition(),l.isOpen=!1,l.coming=null,l.bindEvents(),l.isOpened?s.prevMethod&&l.transitions[s.prevMethod]():o(".fancybox-wrap").not(e.wrap).stop(!0).trigger("onReset").remove(),l.transitions[l.isOpened?e.nextMethod:e.openMethod](),l._preloadImages()}},_setDimension:function(){var e,t,n,i,a,r,s,c,p,d,h,m,v,y,x,w,b,k=l.getViewport(),C=0,E=l.wrap,S=l.skin,T=l.inner,W=l.current,O=W.width,_=W.height,P=W.minWidth,H=W.minHeight,L=W.maxWidth,R=W.maxHeight,j=W.scrolling,M=W.scrollOutside?W.scrollbarWidth:0,A=W.margin,z=u(A[1]+A[3]),V=u(A[0]+A[2]);if(E.add(S).add(T).width("auto").height("auto").removeClass("fancybox-tmp"),a=z+(n=u(S.outerWidth(!0)-S.width())),r=V+(i=u(S.outerHeight(!0)-S.height())),s=f(O)?(k.w-a)*u(O)/100:O,c=f(_)?(k.h-r)*u(_)/100:_,"iframe"===W.type){if(w=W.content,W.autoHeight&&w&&1===w.data("ready"))try{w[0].contentWindow.document.location&&(T.width(s).height(9999),b=w.contents().find("body"),M&&b.css("overflow-x","hidden"),c=b.outerHeight(!0))}catch(e){}}else(W.autoWidth||W.autoHeight)&&(T.addClass("fancybox-tmp"),W.autoWidth||T.width(s),W.autoHeight||T.height(c),W.autoWidth&&(s=T.width()),W.autoHeight&&(c=T.height()),T.removeClass("fancybox-tmp"));if(O=u(s),_=u(c),h=s/c,P=u(f(P)?u(P,"w")-a:P),L=u(f(L)?u(L,"w")-a:L),H=u(f(H)?u(H,"h")-r:H),p=L,d=R=u(f(R)?u(R,"h")-r:R),W.fitToView&&(L=Math.min(k.w-a,L),R=Math.min(k.h-r,R)),y=k.w-z,x=k.h-V,W.aspectRatio?(O>L&&(_=u((O=L)/h)),_>R&&(O=u((_=R)*h)),O<P&&(_=u((O=P)/h)),_<H&&(O=u((_=H)*h))):(O=Math.max(P,Math.min(O,L)),W.autoHeight&&"iframe"!==W.type&&(T.width(O),_=T.height()),_=Math.max(H,Math.min(_,R))),W.fitToView)if(T.width(O).height(_),E.width(O+n),m=E.width(),v=E.height(),W.aspectRatio)for(;(m>y||v>x)&&O>P&&_>H&&!(C++>19);)_=Math.max(H,Math.min(R,_-10)),(O=u(_*h))<P&&(_=u((O=P)/h)),O>L&&(_=u((O=L)/h)),T.width(O).height(_),E.width(O+n),m=E.width(),v=E.height();else O=Math.max(P,Math.min(O,O-(m-y))),_=Math.max(H,Math.min(_,_-(v-x)));M&&"auto"===j&&_<c&&O+n+M<y&&(O+=M),T.width(O).height(_),E.width(O+n),m=E.width(),v=E.height(),e=(m>y||v>x)&&O>P&&_>H,t=W.aspectRatio?O<p&&_<d&&O<s&&_<c:(O<p||_<d)&&(O<s||_<c),o.extend(W,{dim:{width:g(m),height:g(v)},origWidth:s,origHeight:c,canShrink:e,canExpand:t,wPadding:n,hPadding:i,wrapSpace:v-S.outerHeight(!0),skinSpace:S.height()-_}),!w&&W.autoHeight&&_>H&&_<R&&!t&&T.height("auto")},_getPosition:function(e){var t=l.current,o=l.getViewport(),n=t.margin,i=l.wrap.width()+n[1]+n[3],a=l.wrap.height()+n[0]+n[2],r={position:"absolute",top:n[0],left:n[3]};return t.autoCenter&&t.fixed&&!e&&a<=o.h&&i<=o.w?r.position="fixed":t.locked||(r.top+=o.y,r.left+=o.x),r.top=g(Math.max(r.top,r.top+(o.h-a)*t.topRatio)),r.left=g(Math.max(r.left,r.left+(o.w-i)*t.leftRatio)),r},_afterZoomIn:function(){var e=l.current;e&&(l.isOpen=l.isOpened=!0,l.wrap.css("overflow","visible").addClass("fancybox-opened").hide().show(0),l.update(),(e.zoomClick||e.closeClick||e.nextClick&&l.group.length>1)&&l.inner.css("cursor",e.zoomClick?e.canExpand?"zoom-in":"zoom-out":"pointer").on("click.fb",(function(t){o(t.target).is("a")||o(t.target).parent().is("a")||(t.preventDefault(),l[e.zoomClick&&(e.canExpand||e.canShrink)?"toggle":e.closeClick?"close":"next"]())})),e.closeBtn&&o(e.tpl.close.replace(/\{close\}/g,e.txt.close)).appendTo(l.skin).on("click.fb",(function(e){e.preventDefault(),l.close()})),e.arrows&&l.group.length>1&&((e.loop||e.index>0)&&o(e.tpl.prev.replace(/\{prev\}/g,e.txt.prev)).appendTo(l.outer).on("click.fb",l.prev),(e.loop||e.index<l.group.length-1)&&o(e.tpl.next.replace(/\{next\}/g,e.txt.next)).appendTo(l.outer).on("click.fb",l.next)),l.trigger("afterShow"),e.loop||e.index!==e.group.length-1?l.opts.autoPlay&&!l.player.isActive&&(l.opts.autoPlay=!1,l.play(!0)):l.play(!1))},_afterZoomOut:function(e){e=e||l.current,o(".fancybox-wrap").trigger("onReset").remove(),o.extend(l,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null}),l.trigger("afterClose",e)}}),l.transitions={getOrigPosition:function(){var e=l.current,t=e.element,o=e.orig,n={},i=50,a=50,r=e.hPadding,s=e.wPadding,c=l.getViewport();return!o&&e.isDom&&t.is(":visible")&&((o=t.find("img:first")).length||(o=t)),d(o)?(n=o.offset(),o.is("img")&&(i=o.outerWidth(),a=o.outerHeight())):(n.top=c.y+(c.h-a)*e.topRatio,n.left=c.x+(c.w-i)*e.leftRatio),("fixed"===l.wrap.css("position")||e.locked)&&(n.top-=c.y,n.left-=c.x),n={top:g(n.top-r*e.topRatio),left:g(n.left-s*e.leftRatio),width:g(i+s),height:g(a+r)}},step:function(e,t){var o,n,i=t.prop,a=l.current,r=a.wrapSpace,s=a.skinSpace;"width"!==i&&"height"!==i||(o=t.end===t.start?1:(e-t.start)/(t.end-t.start),l.isClosing&&(o=1-o),n=e-("width"===i?a.wPadding:a.hPadding),l.skin[i](u("width"===i?n:n-r*o)),l.inner[i](u("width"===i?n:n-r*o-s*o)))},zoomIn:function(){var e=l.current,t=e.pos,n=e.openEffect,i="elastic"===n,a=o.extend({opacity:1},t);delete a.position,i?(t=this.getOrigPosition(),e.openOpacity&&(t.opacity=.1)):"fade"===n&&(t.opacity=.1),l.wrap.css(t).animate(a,{duration:"none"===n?0:e.openSpeed,easing:e.openEasing,step:i?this.step:null,complete:l._afterZoomIn})},zoomOut:function(){var e=l.current,t=e.closeEffect,o="elastic"===t,n={opacity:.1};o&&(n=this.getOrigPosition(),e.closeOpacity&&(n.opacity=.1)),l.wrap.animate(n,{duration:"none"===t?0:e.closeSpeed,easing:e.closeEasing,step:o?this.step:null,complete:l._afterZoomOut})},changeIn:function(){var e,t=l.current,o=t.nextEffect,n=t.pos,i={opacity:1},a=l.direction,r=200;n.opacity=.1,"elastic"===o&&(e="down"===a||"up"===a?"top":"left","down"===a||"right"===a?(n[e]=g(u(n[e])-r),i[e]="+=200px"):(n[e]=g(u(n[e])+r),i[e]="-=200px")),"none"===o?l._afterZoomIn():l.wrap.css(n).animate(i,{duration:t.nextSpeed,easing:t.nextEasing,complete:l._afterZoomIn})},changeOut:function(){var e=l.previous,t=e.prevEffect,n={opacity:.1},i=l.direction;"elastic"===t&&(n["down"===i||"up"===i?"top":"left"]=("up"===i||"left"===i?"-":"+")+"=200px"),e.wrap.animate(n,{duration:"none"===t?0:e.prevSpeed,easing:e.prevEasing,complete:function(){o(this).trigger("onReset").remove()}})}},l.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!p,fixed:!0},overlay:null,fixed:!1,el:o("html"),create:function(e){var t;e=o.extend({},this.defaults,e),this.overlay&&this.close(),t=l.coming?l.coming.parent:e.parent,this.overlay=o('<div class="fancybox-overlay"></div>').appendTo(t&&t.length?t:"body"),this.fixed=!1,e.fixed&&l.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(e){var t=this;e=o.extend({},this.defaults,e),this.overlay?this.overlay.off(".overlay").width("auto").height("auto"):this.create(e),this.fixed||(a.on("resize.overlay",o.proxy(this.update,this)),this.update()),e.closeClick&&this.overlay.on("click.overlay",(function(e){if(o(e.target).hasClass("fancybox-overlay"))return l.isActive?l.close():t.close(),!1})),this.overlay.css(e.css).show()},close:function(){a.off("resize.overlay"),this.el.hasClass("fancybox-lock")&&(o(".fancybox-margin").removeClass("fancybox-margin"),this.el.removeClass("fancybox-lock"),a.scrollTop(this.scrollV).scrollLeft(this.scrollH)),o(".fancybox-overlay").remove().hide(),o.extend(this,{overlay:null,fixed:!1})},update:function(){var e,o="100%";this.overlay.width(o).height("100%"),s?(e=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),r.width()>e&&(o=r.width())):r.width()>a.width()&&(o=r.width()),this.overlay.width(o).height(r.height())},onReady:function(e,t){var n=this.overlay;o(".fancybox-overlay").stop(!0,!0),n||this.create(e),e.locked&&this.fixed&&t.fixed&&(t.locked=this.overlay.append(t.wrap),t.fixed=!1),!0===e.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(e,t){t.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&o("*:not(object)").filter((function(){return"fixed"===o(this).css("position")&&!o(this).hasClass("fancybox-overlay")&&!o(this).hasClass("fancybox-wrap")})).addClass("fancybox-margin"),this.el.addClass("fancybox-margin"),this.scrollV=a.scrollTop(),this.scrollH=a.scrollLeft(),this.el.addClass("fancybox-lock"),a.scrollTop(this.scrollV).scrollLeft(this.scrollH)),this.open(e)},onUpdate:function(){this.fixed||this.update()},afterClose:function(e){this.overlay&&!l.coming&&this.overlay.fadeOut(e.speedOut,o.proxy(this.close,this))}},l.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(e){var t,n,i=l.current,a=i.title,r=e.type;if(o.isFunction(a)&&(a=a.call(i.element,i)),h(a)&&""!==o.trim(a)){switch(t=o('<div class="fancybox-title fancybox-title-'+r+'-wrap">'+a+"</div>"),r){case"inside":n=l.skin;break;case"outside":n=l.wrap;break;case"over":n=l.inner;break;default:n=l.skin,t.appendTo("body"),s&&t.width(t.width()),t.wrapInner('<span class="child"></span>'),l.current.margin[2]+=Math.abs(u(t.css("margin-bottom")));break}t["top"===e.position?"prependTo":"appendTo"](n)}}},o.fn.fancybox=function(e){var t,n=o(this),i=this.selector||"",a=function(a){var r,s,c=o(this).blur(),p=t;if(!(a.ctrlKey||a.altKey||a.shiftKey||a.metaKey||c.is(".fancybox-wrap"))){r=e.groupAttr||"data-fancybox-group",(s=c.attr(r))||(r="rel",s=c.get(0)[r]),s&&""!==s&&"nofollow"!==s&&(p=(c=(c=i.length?o(i):n).filter("["+r+'="'+s+'"]')).index(this)),e.index=p;var d=l.getViewport();if(e.minVpWidth&&d.w<e.minVpWidth||e.minVpHeight&&d.h<e.minVpHeight)return;if(!1!==l.open(c,e))return a.preventDefault(),!1}};return t=(e=e||{}).index||0,i&&!1!==e.live?r.undelegate(i,"click.fb-start").delegate(i+":not('.fancybox-item, .fancybox-nav')","click.fb-start",a):n.off("click.fb-start").on("click.fb-start",a),this.filter("[data-fancybox-start=1]").trigger("click"),this},r.ready((function(){var t,a,r,s;o.scrollbarWidth===n&&(o.scrollbarWidth=function(){var e=o('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),t=e.children(),n=t.innerWidth()-t.height(99).innerWidth();return e.remove(),n}),o.support.fixedPosition===n&&(o.support.fixedPosition=(r=o('<div style="position:fixed;top:20px;"></div>').appendTo("body"),s=20===r[0].offsetTop||15===r[0].offsetTop,r.remove(),s)),o.extend(l.defaults,{scrollbarWidth:o.scrollbarWidth(),fixed:o.support.fixedPosition,parent:o("body")}),t=o(e).width(),i.addClass("fancybox-lock-test"),a=o(e).width(),i.removeClass("fancybox-lock-test"),o("<style type='text/css'>.fancybox-margin{margin-right:"+(a-t)+"px;}</style>").appendTo("head")}))}(window,document,jQuery);
fancybox/3.5.7/jquery.fancybox.css ADDED
@@ -0,0 +1,895 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body.compensate-for-scrollbar {
2
+ overflow: hidden;
3
+ }
4
+
5
+ .fancybox-active {
6
+ height: auto;
7
+ }
8
+
9
+ .fancybox-is-hidden {
10
+ left: -9999px;
11
+ margin: 0;
12
+ position: absolute !important;
13
+ top: -9999px;
14
+ visibility: hidden;
15
+ }
16
+
17
+ .fancybox-container {
18
+ -webkit-backface-visibility: hidden;
19
+ height: 100%;
20
+ left: 0;
21
+ outline: none;
22
+ position: fixed;
23
+ -webkit-tap-highlight-color: transparent;
24
+ top: 0;
25
+ -ms-touch-action: manipulation;
26
+ touch-action: manipulation;
27
+ transform: translateZ(0);
28
+ width: 100%;
29
+ z-index: 99992;
30
+ }
31
+
32
+ .fancybox-container * {
33
+ box-sizing: border-box;
34
+ }
35
+
36
+ .fancybox-outer,
37
+ .fancybox-inner,
38
+ .fancybox-bg,
39
+ .fancybox-stage {
40
+ bottom: 0;
41
+ left: 0;
42
+ position: absolute;
43
+ right: 0;
44
+ top: 0;
45
+ }
46
+
47
+ .fancybox-outer {
48
+ -webkit-overflow-scrolling: touch;
49
+ overflow-y: auto;
50
+ }
51
+
52
+ .fancybox-bg {
53
+ background: rgb(30, 30, 30);
54
+ opacity: 0;
55
+ transition-duration: inherit;
56
+ transition-property: opacity;
57
+ transition-timing-function: cubic-bezier(.47, 0, .74, .71);
58
+ }
59
+
60
+ .fancybox-is-open .fancybox-bg {
61
+ opacity: .9;
62
+ transition-timing-function: cubic-bezier(.22, .61, .36, 1);
63
+ }
64
+
65
+ .fancybox-infobar,
66
+ .fancybox-toolbar,
67
+ .fancybox-caption,
68
+ .fancybox-navigation .fancybox-button {
69
+ direction: ltr;
70
+ opacity: 0;
71
+ position: absolute;
72
+ transition: opacity .25s ease, visibility 0s ease .25s;
73
+ visibility: hidden;
74
+ z-index: 99997;
75
+ }
76
+
77
+ .fancybox-show-infobar .fancybox-infobar,
78
+ .fancybox-show-toolbar .fancybox-toolbar,
79
+ .fancybox-show-caption .fancybox-caption,
80
+ .fancybox-show-nav .fancybox-navigation .fancybox-button {
81
+ opacity: 1;
82
+ transition: opacity .25s ease 0s, visibility 0s ease 0s;
83
+ visibility: visible;
84
+ }
85
+
86
+ .fancybox-infobar {
87
+ color: #ccc;
88
+ font-size: 13px;
89
+ -webkit-font-smoothing: subpixel-antialiased;
90
+ height: 44px;
91
+ left: 0;
92
+ line-height: 44px;
93
+ min-width: 44px;
94
+ mix-blend-mode: difference;
95
+ padding: 0 10px;
96
+ pointer-events: none;
97
+ top: 0;
98
+ -webkit-touch-callout: none;
99
+ -webkit-user-select: none;
100
+ -moz-user-select: none;
101
+ -ms-user-select: none;
102
+ user-select: none;
103
+ }
104
+
105
+ .fancybox-toolbar {
106
+ right: 0;
107
+ top: 0;
108
+ }
109
+
110
+ .fancybox-stage {
111
+ direction: ltr;
112
+ overflow: visible;
113
+ transform: translateZ(0);
114
+ z-index: 99994;
115
+ }
116
+
117
+ .fancybox-is-open .fancybox-stage {
118
+ overflow: hidden;
119
+ }
120
+
121
+ .fancybox-slide {
122
+ -webkit-backface-visibility: hidden;
123
+ /* Using without prefix would break IE11 */
124
+ display: none;
125
+ height: 100%;
126
+ left: 0;
127
+ outline: none;
128
+ overflow: auto;
129
+ -webkit-overflow-scrolling: touch;
130
+ padding: 44px;
131
+ position: absolute;
132
+ text-align: center;
133
+ top: 0;
134
+ transition-property: transform, opacity;
135
+ white-space: normal;
136
+ width: 100%;
137
+ z-index: 99994;
138
+ }
139
+
140
+ .fancybox-slide::before {
141
+ content: '';
142
+ display: inline-block;
143
+ font-size: 0;
144
+ height: 100%;
145
+ vertical-align: middle;
146
+ width: 0;
147
+ }
148
+
149
+ .fancybox-is-sliding .fancybox-slide,
150
+ .fancybox-slide--previous,
151
+ .fancybox-slide--current,
152
+ .fancybox-slide--next {
153
+ display: block;
154
+ }
155
+
156
+ .fancybox-slide--image {
157
+ overflow: hidden;
158
+ padding: 44px 0;
159
+ }
160
+
161
+ .fancybox-slide--image::before {
162
+ display: none;
163
+ }
164
+
165
+ .fancybox-slide--html {
166
+ padding: 6px;
167
+ }
168
+
169
+ .fancybox-content {
170
+ background: #fff;
171
+ display: inline-block;
172
+ margin: 0;
173
+ max-width: 100%;
174
+ overflow: auto;
175
+ -webkit-overflow-scrolling: touch;
176
+ padding: 44px;
177
+ position: relative;
178
+ text-align: left;
179
+ vertical-align: middle;
180
+ }
181
+
182
+ .fancybox-slide--image .fancybox-content {
183
+ animation-timing-function: cubic-bezier(.5, 0, .14, 1);
184
+ -webkit-backface-visibility: hidden;
185
+ background: transparent;
186
+ background-repeat: no-repeat;
187
+ background-size: 100% 100%;
188
+ left: 0;
189
+ max-width: none;
190
+ overflow: visible;
191
+ padding: 0;
192
+ position: absolute;
193
+ top: 0;
194
+ -ms-transform-origin: top left;
195
+ transform-origin: top left;
196
+ transition-property: transform, opacity;
197
+ -webkit-user-select: none;
198
+ -moz-user-select: none;
199
+ -ms-user-select: none;
200
+ user-select: none;
201
+ z-index: 99995;
202
+ }
203
+
204
+ .fancybox-can-zoomOut .fancybox-content {
205
+ cursor: zoom-out;
206
+ }
207
+
208
+ .fancybox-can-zoomIn .fancybox-content {
209
+ cursor: zoom-in;
210
+ }
211
+
212
+ .fancybox-can-swipe .fancybox-content,
213
+ .fancybox-can-pan .fancybox-content {
214
+ cursor: -webkit-grab;
215
+ cursor: grab;
216
+ }
217
+
218
+ .fancybox-is-grabbing .fancybox-content {
219
+ cursor: -webkit-grabbing;
220
+ cursor: grabbing;
221
+ }
222
+
223
+ .fancybox-container [data-selectable='true'] {
224
+ cursor: text;
225
+ }
226
+
227
+ .fancybox-image,
228
+ .fancybox-spaceball {
229
+ background: transparent;
230
+ border: 0;
231
+ height: 100%;
232
+ left: 0;
233
+ margin: 0;
234
+ max-height: none;
235
+ max-width: none;
236
+ padding: 0;
237
+ position: absolute;
238
+ top: 0;
239
+ -webkit-user-select: none;
240
+ -moz-user-select: none;
241
+ -ms-user-select: none;
242
+ user-select: none;
243
+ width: 100%;
244
+ }
245
+
246
+ .fancybox-spaceball {
247
+ z-index: 1;
248
+ }
249
+
250
+ .fancybox-slide--video .fancybox-content,
251
+ .fancybox-slide--map .fancybox-content,
252
+ .fancybox-slide--pdf .fancybox-content,
253
+ .fancybox-slide--iframe .fancybox-content {
254
+ height: 100%;
255
+ overflow: visible;
256
+ padding: 0;
257
+ width: 100%;
258
+ }
259
+
260
+ .fancybox-slide--video .fancybox-content {
261
+ background: #000;
262
+ }
263
+
264
+ .fancybox-slide--map .fancybox-content {
265
+ background: #e5e3df;
266
+ }
267
+
268
+ .fancybox-slide--iframe .fancybox-content {
269
+ background: #fff;
270
+ }
271
+
272
+ .fancybox-video,
273
+ .fancybox-iframe {
274
+ background: transparent;
275
+ border: 0;
276
+ display: block;
277
+ height: 100%;
278
+ margin: 0;
279
+ overflow: hidden;
280
+ padding: 0;
281
+ width: 100%;
282
+ }
283
+
284
+ /* Fix iOS */
285
+ .fancybox-iframe {
286
+ left: 0;
287
+ position: absolute;
288
+ top: 0;
289
+ }
290
+
291
+ .fancybox-error {
292
+ background: #fff;
293
+ cursor: default;
294
+ max-width: 400px;
295
+ padding: 40px;
296
+ width: 100%;
297
+ }
298
+
299
+ .fancybox-error p {
300
+ color: #444;
301
+ font-size: 16px;
302
+ line-height: 20px;
303
+ margin: 0;
304
+ padding: 0;
305
+ }
306
+
307
+ /* Buttons */
308
+
309
+ .fancybox-button {
310
+ background: rgba(30, 30, 30, .6);
311
+ border: 0;
312
+ border-radius: 0;
313
+ box-shadow: none;
314
+ cursor: pointer;
315
+ display: inline-block;
316
+ height: 44px;
317
+ margin: 0;
318
+ padding: 10px;
319
+ position: relative;
320
+ transition: color .2s;
321
+ vertical-align: top;
322
+ visibility: inherit;
323
+ width: 44px;
324
+ }
325
+
326
+ .fancybox-button,
327
+ .fancybox-button:visited,
328
+ .fancybox-button:link {
329
+ color: #ccc;
330
+ }
331
+
332
+ .fancybox-button:hover {
333
+ color: #fff;
334
+ }
335
+
336
+ .fancybox-button:focus {
337
+ outline: none;
338
+ }
339
+
340
+ .fancybox-button.fancybox-focus {
341
+ outline: 1px dotted;
342
+ }
343
+
344
+ .fancybox-button[disabled],
345
+ .fancybox-button[disabled]:hover {
346
+ color: #888;
347
+ cursor: default;
348
+ outline: none;
349
+ }
350
+
351
+ /* Fix IE11 */
352
+ .fancybox-button div {
353
+ height: 100%;
354
+ }
355
+
356
+ .fancybox-button svg {
357
+ display: block;
358
+ height: 100%;
359
+ overflow: visible;
360
+ position: relative;
361
+ width: 100%;
362
+ }
363
+
364
+ .fancybox-button svg path {
365
+ fill: currentColor;
366
+ stroke-width: 0;
367
+ }
368
+
369
+ .fancybox-button--play svg:nth-child(2),
370
+ .fancybox-button--fsenter svg:nth-child(2) {
371
+ display: none;
372
+ }
373
+
374
+ .fancybox-button--pause svg:nth-child(1),
375
+ .fancybox-button--fsexit svg:nth-child(1) {
376
+ display: none;
377
+ }
378
+
379
+ .fancybox-progress {
380
+ background: #ff5268;
381
+ height: 2px;
382
+ left: 0;
383
+ position: absolute;
384
+ right: 0;
385
+ top: 0;
386
+ -ms-transform: scaleX(0);
387
+ transform: scaleX(0);
388
+ -ms-transform-origin: 0;
389
+ transform-origin: 0;
390
+ transition-property: transform;
391
+ transition-timing-function: linear;
392
+ z-index: 99998;
393
+ }
394
+
395
+ /* Close button on the top right corner of html content */
396
+
397
+ .fancybox-close-small {
398
+ background: transparent;
399
+ border: 0;
400
+ border-radius: 0;
401
+ color: #ccc;
402
+ cursor: pointer;
403
+ opacity: .8;
404
+ padding: 8px;
405
+ position: absolute;
406
+ right: -12px;
407
+ top: -44px;
408
+ z-index: 401;
409
+ }
410
+
411
+ .fancybox-close-small:hover {
412
+ color: #fff;
413
+ opacity: 1;
414
+ }
415
+
416
+ .fancybox-slide--html .fancybox-close-small {
417
+ color: currentColor;
418
+ padding: 10px;
419
+ right: 0;
420
+ top: 0;
421
+ }
422
+
423
+ .fancybox-slide--image.fancybox-is-scaling .fancybox-content {
424
+ overflow: hidden;
425
+ }
426
+
427
+ .fancybox-is-scaling .fancybox-close-small,
428
+ .fancybox-is-zoomable.fancybox-can-pan .fancybox-close-small {
429
+ display: none;
430
+ }
431
+
432
+ /* Navigation arrows */
433
+
434
+ .fancybox-navigation .fancybox-button {
435
+ background-clip: content-box;
436
+ height: 100px;
437
+ opacity: 0;
438
+ position: absolute;
439
+ top: calc(50% - 50px);
440
+ width: 70px;
441
+ }
442
+
443
+ .fancybox-navigation .fancybox-button div {
444
+ padding: 7px;
445
+ }
446
+
447
+ .fancybox-navigation .fancybox-button--arrow_left {
448
+ left: 0;
449
+ left: env(safe-area-inset-left);
450
+ padding: 31px 26px 31px 6px;
451
+ }
452
+
453
+ .fancybox-navigation .fancybox-button--arrow_right {
454
+ padding: 31px 6px 31px 26px;
455
+ right: 0;
456
+ right: env(safe-area-inset-right);
457
+ }
458
+
459
+ /* Caption */
460
+
461
+ .fancybox-caption {
462
+ background: linear-gradient(to top,
463
+ rgba(0, 0, 0, .85) 0%,
464
+ rgba(0, 0, 0, .3) 50%,
465
+ rgba(0, 0, 0, .15) 65%,
466
+ rgba(0, 0, 0, .075) 75.5%,
467
+ rgba(0, 0, 0, .037) 82.85%,
468
+ rgba(0, 0, 0, .019) 88%,
469
+ rgba(0, 0, 0, 0) 100%);
470
+ bottom: 0;
471
+ color: #eee;
472
+ font-size: 14px;
473
+ font-weight: 400;
474
+ left: 0;
475
+ line-height: 1.5;
476
+ padding: 75px 44px 25px 44px;
477
+ pointer-events: none;
478
+ right: 0;
479
+ text-align: center;
480
+ z-index: 99996;
481
+ }
482
+
483
+ @supports (padding: max(0px)) {
484
+ .fancybox-caption {
485
+ padding: 75px max(44px, env(safe-area-inset-right)) max(25px, env(safe-area-inset-bottom)) max(44px, env(safe-area-inset-left));
486
+ }
487
+ }
488
+
489
+ .fancybox-caption--separate {
490
+ margin-top: -50px;
491
+ }
492
+
493
+ .fancybox-caption__body {
494
+ max-height: 50vh;
495
+ overflow: auto;
496
+ pointer-events: all;
497
+ }
498
+
499
+ .fancybox-caption a,
500
+ .fancybox-caption a:link,
501
+ .fancybox-caption a:visited {
502
+ color: #ccc;
503
+ text-decoration: none;
504
+ }
505
+
506
+ .fancybox-caption a:hover {
507
+ color: #fff;
508
+ text-decoration: underline;
509
+ }
510
+
511
+ /* Loading indicator */
512
+
513
+ .fancybox-loading {
514
+ animation: fancybox-rotate 1s linear infinite;
515
+ background: transparent;
516
+ border: 4px solid #888;
517
+ border-bottom-color: #fff;
518
+ border-radius: 50%;
519
+ height: 50px;
520
+ left: 50%;
521
+ margin: -25px 0 0 -25px;
522
+ opacity: .7;
523
+ padding: 0;
524
+ position: absolute;
525
+ top: 50%;
526
+ width: 50px;
527
+ z-index: 99999;
528
+ }
529
+
530
+ @keyframes fancybox-rotate {
531
+ 100% {
532
+ transform: rotate(360deg);
533
+ }
534
+ }
535
+
536
+ /* Transition effects */
537
+
538
+ .fancybox-animated {
539
+ transition-timing-function: cubic-bezier(0, 0, .25, 1);
540
+ }
541
+
542
+ /* transitionEffect: slide */
543
+
544
+ .fancybox-fx-slide.fancybox-slide--previous {
545
+ opacity: 0;
546
+ transform: translate3d(-100%, 0, 0);
547
+ }
548
+
549
+ .fancybox-fx-slide.fancybox-slide--next {
550
+ opacity: 0;
551
+ transform: translate3d(100%, 0, 0);
552
+ }
553
+
554
+ .fancybox-fx-slide.fancybox-slide--current {
555
+ opacity: 1;
556
+ transform: translate3d(0, 0, 0);
557
+ }
558
+
559
+ /* transitionEffect: fade */
560
+
561
+ .fancybox-fx-fade.fancybox-slide--previous,
562
+ .fancybox-fx-fade.fancybox-slide--next {
563
+ opacity: 0;
564
+ transition-timing-function: cubic-bezier(.19, 1, .22, 1);
565
+ }
566
+
567
+ .fancybox-fx-fade.fancybox-slide--current {
568
+ opacity: 1;
569
+ }
570
+
571
+ /* transitionEffect: zoom-in-out */
572
+
573
+ .fancybox-fx-zoom-in-out.fancybox-slide--previous {
574
+ opacity: 0;
575
+ transform: scale3d(1.5, 1.5, 1.5);
576
+ }
577
+
578
+ .fancybox-fx-zoom-in-out.fancybox-slide--next {
579
+ opacity: 0;
580
+ transform: scale3d(.5, .5, .5);
581
+ }
582
+
583
+ .fancybox-fx-zoom-in-out.fancybox-slide--current {
584
+ opacity: 1;
585
+ transform: scale3d(1, 1, 1);
586
+ }
587
+
588
+ /* transitionEffect: rotate */
589
+
590
+ .fancybox-fx-rotate.fancybox-slide--previous {
591
+ opacity: 0;
592
+ -ms-transform: rotate(-360deg);
593
+ transform: rotate(-360deg);
594
+ }
595
+
596
+ .fancybox-fx-rotate.fancybox-slide--next {
597
+ opacity: 0;
598
+ -ms-transform: rotate(360deg);
599
+ transform: rotate(360deg);
600
+ }
601
+
602
+ .fancybox-fx-rotate.fancybox-slide--current {
603
+ opacity: 1;
604
+ -ms-transform: rotate(0deg);
605
+ transform: rotate(0deg);
606
+ }
607
+
608
+ /* transitionEffect: circular */
609
+
610
+ .fancybox-fx-circular.fancybox-slide--previous {
611
+ opacity: 0;
612
+ transform: scale3d(0, 0, 0) translate3d(-100%, 0, 0);
613
+ }
614
+
615
+ .fancybox-fx-circular.fancybox-slide--next {
616
+ opacity: 0;
617
+ transform: scale3d(0, 0, 0) translate3d(100%, 0, 0);
618
+ }
619
+
620
+ .fancybox-fx-circular.fancybox-slide--current {
621
+ opacity: 1;
622
+ transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
623
+ }
624
+
625
+ /* transitionEffect: tube */
626
+
627
+ .fancybox-fx-tube.fancybox-slide--previous {
628
+ transform: translate3d(-100%, 0, 0) scale(.1) skew(-10deg);
629
+ }
630
+
631
+ .fancybox-fx-tube.fancybox-slide--next {
632
+ transform: translate3d(100%, 0, 0) scale(.1) skew(10deg);
633
+ }
634
+
635
+ .fancybox-fx-tube.fancybox-slide--current {
636
+ transform: translate3d(0, 0, 0) scale(1);
637
+ }
638
+
639
+ /* Styling for Small-Screen Devices */
640
+ @media all and (max-height: 576px) {
641
+ .fancybox-slide {
642
+ padding-left: 6px;
643
+ padding-right: 6px;
644
+ }
645
+
646
+ .fancybox-slide--image {
647
+ padding: 6px 0;
648
+ }
649
+
650
+ .fancybox-close-small {
651
+ right: -6px;
652
+ }
653
+
654
+ .fancybox-slide--image .fancybox-close-small {
655
+ background: #4e4e4e;
656
+ color: #f2f4f6;
657
+ height: 36px;
658
+ opacity: 1;
659
+ padding: 6px;
660
+ right: 0;
661
+ top: 0;
662
+ width: 36px;
663
+ }
664
+
665
+ .fancybox-caption {
666
+ padding-left: 12px;
667
+ padding-right: 12px;
668
+ }
669
+
670
+ @supports (padding: max(0px)) {
671
+ .fancybox-caption {
672
+ padding-left: max(12px, env(safe-area-inset-left));
673
+ padding-right: max(12px, env(safe-area-inset-right));
674
+ }
675
+ }
676
+ }
677
+ /* Share */
678
+
679
+ .fancybox-share {
680
+ background: #f4f4f4;
681
+ border-radius: 3px;
682
+ max-width: 90%;
683
+ padding: 30px;
684
+ text-align: center;
685
+ }
686
+
687
+ .fancybox-share h1 {
688
+ color: #222;
689
+ font-size: 35px;
690
+ font-weight: 700;
691
+ margin: 0 0 20px 0;
692
+ }
693
+
694
+ .fancybox-share p {
695
+ margin: 0;
696
+ padding: 0;
697
+ }
698
+
699
+ .fancybox-share__button {
700
+ border: 0;
701
+ border-radius: 3px;
702
+ display: inline-block;
703
+ font-size: 14px;
704
+ font-weight: 700;
705
+ line-height: 40px;
706
+ margin: 0 5px 10px 5px;
707
+ min-width: 130px;
708
+ padding: 0 15px;
709
+ text-decoration: none;
710
+ transition: all .2s;
711
+ -webkit-user-select: none;
712
+ -moz-user-select: none;
713
+ -ms-user-select: none;
714
+ user-select: none;
715
+ white-space: nowrap;
716
+ }
717
+
718
+ .fancybox-share__button:visited,
719
+ .fancybox-share__button:link {
720
+ color: #fff;
721
+ }
722
+
723
+ .fancybox-share__button:hover {
724
+ text-decoration: none;
725
+ }
726
+
727
+ .fancybox-share__button--fb {
728
+ background: #3b5998;
729
+ }
730
+
731
+ .fancybox-share__button--fb:hover {
732
+ background: #344e86;
733
+ }
734
+
735
+ .fancybox-share__button--pt {
736
+ background: #bd081d;
737
+ }
738
+
739
+ .fancybox-share__button--pt:hover {
740
+ background: #aa0719;
741
+ }
742
+
743
+ .fancybox-share__button--tw {
744
+ background: #1da1f2;
745
+ }
746
+
747
+ .fancybox-share__button--tw:hover {
748
+ background: #0d95e8;
749
+ }
750
+
751
+ .fancybox-share__button svg {
752
+ height: 25px;
753
+ margin-right: 7px;
754
+ position: relative;
755
+ top: -1px;
756
+ vertical-align: middle;
757
+ width: 25px;
758
+ }
759
+
760
+ .fancybox-share__button svg path {
761
+ fill: #fff;
762
+ }
763
+
764
+ .fancybox-share__input {
765
+ background: transparent;
766
+ border: 0;
767
+ border-bottom: 1px solid #d7d7d7;
768
+ border-radius: 0;
769
+ color: #5d5b5b;
770
+ font-size: 14px;
771
+ margin: 10px 0 0 0;
772
+ outline: none;
773
+ padding: 10px 15px;
774
+ width: 100%;
775
+ }
776
+ /* Thumbs */
777
+
778
+ .fancybox-thumbs {
779
+ background: #ddd;
780
+ bottom: 0;
781
+ display: none;
782
+ margin: 0;
783
+ -webkit-overflow-scrolling: touch;
784
+ -ms-overflow-style: -ms-autohiding-scrollbar;
785
+ padding: 2px 2px 4px 2px;
786
+ position: absolute;
787
+ right: 0;
788
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
789
+ top: 0;
790
+ width: 212px;
791
+ z-index: 99995;
792
+ }
793
+
794
+ .fancybox-thumbs-x {
795
+ overflow-x: auto;
796
+ overflow-y: hidden;
797
+ }
798
+
799
+ .fancybox-show-thumbs .fancybox-thumbs {
800
+ display: block;
801
+ }
802
+
803
+ .fancybox-show-thumbs .fancybox-inner {
804
+ right: 212px;
805
+ }
806
+
807
+ .fancybox-thumbs__list {
808
+ font-size: 0;
809
+ height: 100%;
810
+ list-style: none;
811
+ margin: 0;
812
+ overflow-x: hidden;
813
+ overflow-y: auto;
814
+ padding: 0;
815
+ position: absolute;
816
+ position: relative;
817
+ white-space: nowrap;
818
+ width: 100%;
819
+ }
820
+
821
+ .fancybox-thumbs-x .fancybox-thumbs__list {
822
+ overflow: hidden;
823
+ }
824
+
825
+ .fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar {
826
+ width: 7px;
827
+ }
828
+
829
+ .fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-track {
830
+ background: #fff;
831
+ border-radius: 10px;
832
+ box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
833
+ }
834
+
835
+ .fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-thumb {
836
+ background: #2a2a2a;
837
+ border-radius: 10px;
838
+ }
839
+
840
+ .fancybox-thumbs__list a {
841
+ -webkit-backface-visibility: hidden;
842
+ backface-visibility: hidden;
843
+ background-color: rgba(0, 0, 0, .1);
844
+ background-position: center center;
845
+ background-repeat: no-repeat;
846
+ background-size: cover;
847
+ cursor: pointer;
848
+ float: left;
849
+ height: 75px;
850
+ margin: 2px;
851
+ max-height: calc(100% - 8px);
852
+ max-width: calc(50% - 4px);
853
+ outline: none;
854
+ overflow: hidden;
855
+ padding: 0;
856
+ position: relative;
857
+ -webkit-tap-highlight-color: transparent;
858
+ width: 100px;
859
+ }
860
+
861
+ .fancybox-thumbs__list a::before {
862
+ border: 6px solid #ff5268;
863
+ bottom: 0;
864
+ content: '';
865
+ left: 0;
866
+ opacity: 0;
867
+ position: absolute;
868
+ right: 0;
869
+ top: 0;
870
+ transition: all .2s cubic-bezier(.25, .46, .45, .94);
871
+ z-index: 99991;
872
+ }
873
+
874
+ .fancybox-thumbs__list a:focus::before {
875
+ opacity: .5;
876
+ }
877
+
878
+ .fancybox-thumbs__list a.fancybox-thumbs-active::before {
879
+ opacity: 1;
880
+ }
881
+
882
+ /* Styling for Small-Screen Devices */
883
+ @media all and (max-width: 576px) {
884
+ .fancybox-thumbs {
885
+ width: 110px;
886
+ }
887
+
888
+ .fancybox-show-thumbs .fancybox-inner {
889
+ right: 110px;
890
+ }
891
+
892
+ .fancybox-thumbs__list a {
893
+ max-width: calc(100% - 10px);
894
+ }
895
+ }
fancybox/3.5.7/jquery.fancybox.js ADDED
@@ -0,0 +1,5632 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // ==================================================
2
+ // fancyBox v3.5.7
3
+ //
4
+ // Licensed GPLv3 for open source use
5
+ // or fancyBox Commercial License for commercial use
6
+ //
7
+ // http://fancyapps.com/fancybox/
8
+ // Copyright 2019 fancyApps
9
+ //
10
+ // ==================================================
11
+ (function (window, document, $, undefined) {
12
+ "use strict";
13
+
14
+ window.console = window.console || {
15
+ info: function (stuff) {}
16
+ };
17
+
18
+ // If there's no jQuery, fancyBox can't work
19
+ // =========================================
20
+
21
+ if (!$) {
22
+ return;
23
+ }
24
+
25
+ // Check if fancyBox is already initialized
26
+ // ========================================
27
+
28
+ if ($.fn.fancybox) {
29
+ console.info("fancyBox already initialized");
30
+
31
+ return;
32
+ }
33
+
34
+ // Private default settings
35
+ // ========================
36
+
37
+ var defaults = {
38
+ // Close existing modals
39
+ // Set this to false if you do not need to stack multiple instances
40
+ closeExisting: false,
41
+
42
+ // Enable infinite gallery navigation
43
+ loop: false,
44
+
45
+ // Horizontal space between slides
46
+ gutter: 50,
47
+
48
+ // Enable keyboard navigation
49
+ keyboard: true,
50
+
51
+ // Should allow caption to overlap the content
52
+ preventCaptionOverlap: true,
53
+
54
+ // Should display navigation arrows at the screen edges
55
+ arrows: true,
56
+
57
+ // Should display counter at the top left corner
58
+ infobar: true,
59
+
60
+ // Should display close button (using `btnTpl.smallBtn` template) over the content
61
+ // Can be true, false, "auto"
62
+ // If "auto" - will be automatically enabled for "html", "inline" or "ajax" items
63
+ smallBtn: "auto",
64
+
65
+ // Should display toolbar (buttons at the top)
66
+ // Can be true, false, "auto"
67
+ // If "auto" - will be automatically hidden if "smallBtn" is enabled
68
+ toolbar: "auto",
69
+
70
+ // What buttons should appear in the top right corner.
71
+ // Buttons will be created using templates from `btnTpl` option
72
+ // and they will be placed into toolbar (class="fancybox-toolbar"` element)
73
+ buttons: [
74
+ "zoom",
75
+ //"share",
76
+ "slideShow",
77
+ //"fullScreen",
78
+ //"download",
79
+ "thumbs",
80
+ "close"
81
+ ],
82
+
83
+ // Detect "idle" time in seconds
84
+ idleTime: 3,
85
+
86
+ // Disable right-click and use simple image protection for images
87
+ protect: false,
88
+
89
+ // Shortcut to make content "modal" - disable keyboard navigtion, hide buttons, etc
90
+ modal: false,
91
+
92
+ image: {
93
+ // Wait for images to load before displaying
94
+ // true - wait for image to load and then display;
95
+ // false - display thumbnail and load the full-sized image over top,
96
+ // requires predefined image dimensions (`data-width` and `data-height` attributes)
97
+ preload: false
98
+ },
99
+
100
+ ajax: {
101
+ // Object containing settings for ajax request
102
+ settings: {
103
+ // This helps to indicate that request comes from the modal
104
+ // Feel free to change naming
105
+ data: {
106
+ fancybox: true
107
+ }
108
+ }
109
+ },
110
+
111
+ iframe: {
112
+ // Iframe template
113
+ tpl: '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allowfullscreen="allowfullscreen" allow="autoplay; fullscreen" src=""></iframe>',
114
+
115
+ // Preload iframe before displaying it
116
+ // This allows to calculate iframe content width and height
117
+ // (note: Due to "Same Origin Policy", you can't get cross domain data).
118
+ preload: true,
119
+
120
+ // Custom CSS styling for iframe wrapping element
121
+ // You can use this to set custom iframe dimensions
122
+ css: {},
123
+
124
+ // Iframe tag attributes
125
+ attr: {
126
+ scrolling: "auto"
127
+ }
128
+ },
129
+
130
+ // For HTML5 video only
131
+ video: {
132
+ tpl: '<video class="fancybox-video" controls controlsList="nodownload" poster="{{poster}}">' +
133
+ '<source src="{{src}}" type="{{format}}" />' +
134
+ 'Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player!' +
135
+ "</video>",
136
+ format: "", // custom video format
137
+ autoStart: true
138
+ },
139
+
140
+ // Default content type if cannot be detected automatically
141
+ defaultType: "image",
142
+
143
+ // Open/close animation type
144
+ // Possible values:
145
+ // false - disable
146
+ // "zoom" - zoom images from/to thumbnail
147
+ // "fade"
148
+ // "zoom-in-out"
149
+ //
150
+ animationEffect: "zoom",
151
+
152
+ // Duration in ms for open/close animation
153
+ animationDuration: 366,
154
+
155
+ // Should image change opacity while zooming
156
+ // If opacity is "auto", then opacity will be changed if image and thumbnail have different aspect ratios
157
+ zoomOpacity: "auto",
158
+
159
+ // Transition effect between slides
160
+ //
161
+ // Possible values:
162
+ // false - disable
163
+ // "fade'
164
+ // "slide'
165
+ // "circular'
166
+ // "tube'
167
+ // "zoom-in-out'
168
+ // "rotate'
169
+ //
170
+ transitionEffect: "fade",
171
+
172
+ // Duration in ms for transition animation
173
+ transitionDuration: 366,
174
+
175
+ // Custom CSS class for slide element
176
+ slideClass: "",
177
+
178
+ // Custom CSS class for layout
179
+ baseClass: "",
180
+
181
+ // Base template for layout
182
+ baseTpl: '<div class="fancybox-container" role="dialog" tabindex="-1">' +
183
+ '<div class="fancybox-bg"></div>' +
184
+ '<div class="fancybox-inner">' +
185
+ '<div class="fancybox-infobar"><span data-fancybox-index></span>&nbsp;/&nbsp;<span data-fancybox-count></span></div>' +
186
+ '<div class="fancybox-toolbar">{{buttons}}</div>' +
187
+ '<div class="fancybox-navigation">{{arrows}}</div>' +
188
+ '<div class="fancybox-stage"></div>' +
189
+ '<div class="fancybox-caption"><div class="fancybox-caption__body"></div></div>' +
190
+ "</div>" +
191
+ "</div>",
192
+
193
+ // Loading indicator template
194
+ spinnerTpl: '<div class="fancybox-loading"></div>',
195
+
196
+ // Error message template
197
+ errorTpl: '<div class="fancybox-error"><p>{{ERROR}}</p></div>',
198
+
199
+ btnTpl: {
200
+ download: '<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;">' +
201
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z"/></svg>' +
202
+ "</a>",
203
+
204
+ zoom: '<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}">' +
205
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z"/></svg>' +
206
+ "</button>",
207
+
208
+ close: '<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}">' +
209
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z"/></svg>' +
210
+ "</button>",
211
+
212
+ // Arrows
213
+ arrowLeft: '<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}">' +
214
+ '<div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z"/></svg></div>' +
215
+ "</button>",
216
+
217
+ arrowRight: '<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}">' +
218
+ '<div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z"/></svg></div>' +
219
+ "</button>",
220
+
221
+ // This small close button will be appended to your html/inline/ajax content by default,
222
+ // if "smallBtn" option is not set to false
223
+ smallBtn: '<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small" title="{{CLOSE}}">' +
224
+ '<svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"/></svg>' +
225
+ "</button>"
226
+ },
227
+
228
+ // Container is injected into this element
229
+ parentEl: "body",
230
+
231
+ // Hide browser vertical scrollbars; use at your own risk
232
+ hideScrollbar: true,
233
+
234
+ // Focus handling
235
+ // ==============
236
+
237
+ // Try to focus on the first focusable element after opening
238
+ autoFocus: true,
239
+
240
+ // Put focus back to active element after closing
241
+ backFocus: true,
242
+
243
+ // Do not let user to focus on element outside modal content
244
+ trapFocus: true,
245
+
246
+ // Module specific options
247
+ // =======================
248
+
249
+ fullScreen: {
250
+ autoStart: false
251
+ },
252
+
253
+ // Set `touch: false` to disable panning/swiping
254
+ touch: {
255
+ vertical: true, // Allow to drag content vertically
256
+ momentum: true // Continue movement after releasing mouse/touch when panning
257
+ },
258
+
259
+ // Hash value when initializing manually,
260
+ // set `false` to disable hash change
261
+ hash: null,
262
+
263
+ // Customize or add new media types
264
+ // Example:
265
+ /*
266
+ media : {
267
+ youtube : {
268
+ params : {
269
+ autoplay : 0
270
+ }
271
+ }
272
+ }
273
+ */
274
+ media: {},
275
+
276
+ slideShow: {
277
+ autoStart: false,
278
+ speed: 3000
279
+ },
280
+
281
+ thumbs: {
282
+ autoStart: false, // Display thumbnails on opening
283
+ hideOnClose: true, // Hide thumbnail grid when closing animation starts
284
+ parentEl: ".fancybox-container", // Container is injected into this element
285
+ axis: "y" // Vertical (y) or horizontal (x) scrolling
286
+ },
287
+
288
+ // Use mousewheel to navigate gallery
289
+ // If 'auto' - enabled for images only
290
+ wheel: "auto",
291
+
292
+ // Callbacks
293
+ //==========
294
+
295
+ // See Documentation/API/Events for more information
296
+ // Example:
297
+ /*
298
+ afterShow: function( instance, current ) {
299
+ console.info( 'Clicked element:' );
300
+ console.info( current.opts.$orig );
301
+ }
302
+ */
303
+
304
+ onInit: $.noop, // When instance has been initialized
305
+
306
+ beforeLoad: $.noop, // Before the content of a slide is being loaded
307
+ afterLoad: $.noop, // When the content of a slide is done loading
308
+
309
+ beforeShow: $.noop, // Before open animation starts
310
+ afterShow: $.noop, // When content is done loading and animating
311
+
312
+ beforeClose: $.noop, // Before the instance attempts to close. Return false to cancel the close.
313
+ afterClose: $.noop, // After instance has been closed
314
+
315
+ onActivate: $.noop, // When instance is brought to front
316
+ onDeactivate: $.noop, // When other instance has been activated
317
+
318
+ // Interaction
319
+ // ===========
320
+
321
+ // Use options below to customize taken action when user clicks or double clicks on the fancyBox area,
322
+ // each option can be string or method that returns value.
323
+ //
324
+ // Possible values:
325
+ // "close" - close instance
326
+ // "next" - move to next gallery item
327
+ // "nextOrClose" - move to next gallery item or close if gallery has only one item
328
+ // "toggleControls" - show/hide controls
329
+ // "zoom" - zoom image (if loaded)
330
+ // false - do nothing
331
+
332
+ // Clicked on the content
333
+ clickContent: function (current, event) {
334
+ return current.type === "image" ? "zoom" : false;
335
+ },
336
+
337
+ // Clicked on the slide
338
+ clickSlide: "close",
339
+
340
+ // Clicked on the background (backdrop) element;
341
+ // if you have not changed the layout, then most likely you need to use `clickSlide` option
342
+ clickOutside: "close",
343
+
344
+ // Same as previous two, but for double click
345
+ dblclickContent: false,
346
+ dblclickSlide: false,
347
+ dblclickOutside: false,
348
+
349
+ // Custom options when mobile device is detected
350
+ // =============================================
351
+
352
+ mobile: {
353
+ preventCaptionOverlap: false,
354
+ idleTime: false,
355
+ clickContent: function (current, event) {
356
+ return current.type === "image" ? "toggleControls" : false;
357
+ },
358
+ clickSlide: function (current, event) {
359
+ return current.type === "image" ? "toggleControls" : "close";
360
+ },
361
+ dblclickContent: function (current, event) {
362
+ return current.type === "image" ? "zoom" : false;
363
+ },
364
+ dblclickSlide: function (current, event) {
365
+ return current.type === "image" ? "zoom" : false;
366
+ }
367
+ },
368
+
369
+ // Internationalization
370
+ // ====================
371
+
372
+ lang: "en",
373
+ i18n: {
374
+ en: {
375
+ CLOSE: "Close",
376
+ NEXT: "Next",
377
+ PREV: "Previous",
378
+ ERROR: "The requested content cannot be loaded. <br/> Please try again later.",
379
+ PLAY_START: "Start slideshow",
380
+ PLAY_STOP: "Pause slideshow",
381
+ FULL_SCREEN: "Full screen",
382
+ THUMBS: "Thumbnails",
383
+ DOWNLOAD: "Download",
384
+ SHARE: "Share",
385
+ ZOOM: "Zoom"
386
+ },
387
+ de: {
388
+ CLOSE: "Schlie&szlig;en",
389
+ NEXT: "Weiter",
390
+ PREV: "Zur&uuml;ck",
391
+ ERROR: "Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es sp&auml;ter nochmal.",
392
+ PLAY_START: "Diaschau starten",
393
+ PLAY_STOP: "Diaschau beenden",
394
+ FULL_SCREEN: "Vollbild",
395
+ THUMBS: "Vorschaubilder",
396
+ DOWNLOAD: "Herunterladen",
397
+ SHARE: "Teilen",
398
+ ZOOM: "Vergr&ouml;&szlig;ern"
399
+ }
400
+ }
401
+ };
402
+
403
+ // Few useful variables and methods
404
+ // ================================
405
+
406
+ var $W = $(window);
407
+ var $D = $(document);
408
+
409
+ var called = 0;
410
+
411
+ // Check if an object is a jQuery object and not a native JavaScript object
412
+ // ========================================================================
413
+ var isQuery = function (obj) {
414
+ return obj && obj.hasOwnProperty && obj instanceof $;
415
+ };
416
+
417
+ // Handle multiple browsers for "requestAnimationFrame" and "cancelAnimationFrame"
418
+ // ===============================================================================
419
+ var requestAFrame = (function () {
420
+ return (
421
+ window.requestAnimationFrame ||
422
+ window.webkitRequestAnimationFrame ||
423
+ window.mozRequestAnimationFrame ||
424
+ window.oRequestAnimationFrame ||
425
+ // if all else fails, use setTimeout
426
+ function (callback) {
427
+ return window.setTimeout(callback, 1000 / 60);
428
+ }
429
+ );
430
+ })();
431
+
432
+ var cancelAFrame = (function () {
433
+ return (
434
+ window.cancelAnimationFrame ||
435
+ window.webkitCancelAnimationFrame ||
436
+ window.mozCancelAnimationFrame ||
437
+ window.oCancelAnimationFrame ||
438
+ function (id) {
439
+ window.clearTimeout(id);
440
+ }
441
+ );
442
+ })();
443
+
444
+ // Detect the supported transition-end event property name
445
+ // =======================================================
446
+ var transitionEnd = (function () {
447
+ var el = document.createElement("fakeelement"),
448
+ t;
449
+
450
+ var transitions = {
451
+ transition: "transitionend",
452
+ OTransition: "oTransitionEnd",
453
+ MozTransition: "transitionend",
454
+ WebkitTransition: "webkitTransitionEnd"
455
+ };
456
+
457
+ for (t in transitions) {
458
+ if (el.style[t] !== undefined) {
459
+ return transitions[t];
460
+ }
461
+ }
462
+
463
+ return "transitionend";
464
+ })();
465
+
466
+ // Force redraw on an element.
467
+ // This helps in cases where the browser doesn't redraw an updated element properly
468
+ // ================================================================================
469
+ var forceRedraw = function ($el) {
470
+ return $el && $el.length && $el[0].offsetHeight;
471
+ };
472
+
473
+ // Exclude array (`buttons`) options from deep merging
474
+ // ===================================================
475
+ var mergeOpts = function (opts1, opts2) {
476
+ var rez = $.extend(true, {}, opts1, opts2);
477
+
478
+ $.each(opts2, function (key, value) {
479
+ if ($.isArray(value)) {
480
+ rez[key] = value;
481
+ }
482
+ });
483
+
484
+ return rez;
485
+ };
486
+
487
+ // How much of an element is visible in viewport
488
+ // =============================================
489
+
490
+ var inViewport = function (elem) {
491
+ var elemCenter, rez;
492
+
493
+ if (!elem || elem.ownerDocument !== document) {
494
+ return false;
495
+ }
496
+
497
+ $(".fancybox-container").css("pointer-events", "none");
498
+
499
+ elemCenter = {
500
+ x: elem.getBoundingClientRect().left + elem.offsetWidth / 2,
501
+ y: elem.getBoundingClientRect().top + elem.offsetHeight / 2
502
+ };
503
+
504
+ rez = document.elementFromPoint(elemCenter.x, elemCenter.y) === elem;
505
+
506
+ $(".fancybox-container").css("pointer-events", "");
507
+
508
+ return rez;
509
+ };
510
+
511
+ // Class definition
512
+ // ================
513
+
514
+ var FancyBox = function (content, opts, index) {
515
+ var self = this;
516
+
517
+ self.opts = mergeOpts({
518
+ index: index
519
+ }, $.fancybox.defaults);
520
+
521
+ if ($.isPlainObject(opts)) {
522
+ self.opts = mergeOpts(self.opts, opts);
523
+ }
524
+
525
+ if ($.fancybox.isMobile) {
526
+ self.opts = mergeOpts(self.opts, self.opts.mobile);
527
+ }
528
+
529
+ self.id = self.opts.id || ++called;
530
+
531
+ self.currIndex = parseInt(self.opts.index, 10) || 0;
532
+ self.prevIndex = null;
533
+
534
+ self.prevPos = null;
535
+ self.currPos = 0;
536
+
537
+ self.firstRun = true;
538
+
539
+ // All group items
540
+ self.group = [];
541
+
542
+ // Existing slides (for current, next and previous gallery items)
543
+ self.slides = {};
544
+
545
+ // Create group elements
546
+ self.addContent(content);
547
+
548
+ if (!self.group.length) {
549
+ return;
550
+ }
551
+
552
+ self.init();
553
+ };
554
+
555
+ $.extend(FancyBox.prototype, {
556
+ // Create DOM structure
557
+ // ====================
558
+
559
+ init: function () {
560
+ var self = this,
561
+ firstItem = self.group[self.currIndex],
562
+ firstItemOpts = firstItem.opts,
563
+ $container,
564
+ buttonStr;
565
+
566
+ if (firstItemOpts.closeExisting) {
567
+ $.fancybox.close(true);
568
+ }
569
+
570
+ // Hide scrollbars
571
+ // ===============
572
+
573
+ $("body").addClass("fancybox-active");
574
+
575
+ if (
576
+ !$.fancybox.getInstance() &&
577
+ firstItemOpts.hideScrollbar !== false &&
578
+ !$.fancybox.isMobile &&
579
+ document.body.scrollHeight > window.innerHeight
580
+ ) {
581
+ $("head").append(
582
+ '<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:' +
583
+ (window.innerWidth - document.documentElement.clientWidth) +
584
+ "px;}</style>"
585
+ );
586
+
587
+ $("body").addClass("compensate-for-scrollbar");
588
+ }
589
+
590
+ // Build html markup and set references
591
+ // ====================================
592
+
593
+ // Build html code for buttons and insert into main template
594
+ buttonStr = "";
595
+
596
+ $.each(firstItemOpts.buttons, function (index, value) {
597
+ buttonStr += firstItemOpts.btnTpl[value] || "";
598
+ });
599
+
600
+ // Create markup from base template, it will be initially hidden to
601
+ // avoid unnecessary work like painting while initializing is not complete
602
+ $container = $(
603
+ self.translate(
604
+ self,
605
+ firstItemOpts.baseTpl
606
+ .replace("{{buttons}}", buttonStr)
607
+ .replace("{{arrows}}", firstItemOpts.btnTpl.arrowLeft + firstItemOpts.btnTpl.arrowRight)
608
+ )
609
+ )
610
+ .attr("id", "fancybox-container-" + self.id)
611
+ .addClass(firstItemOpts.baseClass)
612
+ .data("FancyBox", self)
613
+ .appendTo(firstItemOpts.parentEl);
614
+
615
+ // Create object holding references to jQuery wrapped nodes
616
+ self.$refs = {
617
+ container: $container
618
+ };
619
+
620
+ ["bg", "inner", "infobar", "toolbar", "stage", "caption", "navigation"].forEach(function (item) {
621
+ self.$refs[item] = $container.find(".fancybox-" + item);
622
+ });
623
+
624
+ self.trigger("onInit");
625
+
626
+ // Enable events, deactive previous instances
627
+ self.activate();
628
+
629
+ // Build slides, load and reveal content
630
+ self.jumpTo(self.currIndex);
631
+ },
632
+
633
+ // Simple i18n support - replaces object keys found in template
634
+ // with corresponding values
635
+ // ============================================================
636
+
637
+ translate: function (obj, str) {
638
+ var arr = obj.opts.i18n[obj.opts.lang] || obj.opts.i18n.en;
639
+
640
+ return str.replace(/\{\{(\w+)\}\}/g, function (match, n) {
641
+ return arr[n] === undefined ? match : arr[n];
642
+ });
643
+ },
644
+
645
+ // Populate current group with fresh content
646
+ // Check if each object has valid type and content
647
+ // ===============================================
648
+
649
+ addContent: function (content) {
650
+ var self = this,
651
+ items = $.makeArray(content),
652
+ thumbs;
653
+
654
+ $.each(items, function (i, item) {
655
+ var obj = {},
656
+ opts = {},
657
+ $item,
658
+ type,
659
+ found,
660
+ src,
661
+ srcParts;
662
+
663
+ // Step 1 - Make sure we have an object
664
+ // ====================================
665
+
666
+ if ($.isPlainObject(item)) {
667
+ // We probably have manual usage here, something like
668
+ // $.fancybox.open( [ { src : "image.jpg", type : "image" } ] )
669
+
670
+ obj = item;
671
+ opts = item.opts || item;
672
+ } else if ($.type(item) === "object" && $(item).length) {
673
+ // Here we probably have jQuery collection returned by some selector
674
+ $item = $(item);
675
+
676
+ // Support attributes like `data-options='{"touch" : false}'` and `data-touch='false'`
677
+ opts = $item.data() || {};
678
+ opts = $.extend(true, {}, opts, opts.options);
679
+
680
+ // Here we store clicked element
681
+ opts.$orig = $item;
682
+
683
+ obj.src = self.opts.src || opts.src || $item.attr("href");
684
+
685
+ // Assume that simple syntax is used, for example:
686
+ // `$.fancybox.open( $("#test"), {} );`
687
+ if (!obj.type && !obj.src) {
688
+ obj.type = "inline";
689
+ obj.src = item;
690
+ }
691
+ } else {
692
+ // Assume we have a simple html code, for example:
693
+ // $.fancybox.open( '<div><h1>Hi!</h1></div>' );
694
+ obj = {
695
+ type: "html",
696
+ src: item + ""
697
+ };
698
+ }
699
+
700
+ // Each gallery object has full collection of options
701
+ obj.opts = $.extend(true, {}, self.opts, opts);
702
+
703
+ // Do not merge buttons array
704
+ if ($.isArray(opts.buttons)) {
705
+ obj.opts.buttons = opts.buttons;
706
+ }
707
+
708
+ if ($.fancybox.isMobile && obj.opts.mobile) {
709
+ obj.opts = mergeOpts(obj.opts, obj.opts.mobile);
710
+ }
711
+
712
+ // Step 2 - Make sure we have content type, if not - try to guess
713
+ // ==============================================================
714
+
715
+ type = obj.type || obj.opts.type;
716
+ src = obj.src || "";
717
+
718
+ if (!type && src) {
719
+ if ((found = src.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))) {
720
+ type = "video";
721
+
722
+ if (!obj.opts.video.format) {
723
+ obj.opts.video.format = "video/" + (found[1] === "ogv" ? "ogg" : found[1]);
724
+ }
725
+ } else if (src.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)) {
726
+ type = "image";
727
+ } else if (src.match(/\.(pdf)((\?|#).*)?$/i)) {
728
+ type = "iframe";
729
+ obj = $.extend(true, obj, {
730
+ contentType: "pdf",
731
+ opts: {
732
+ iframe: {
733
+ preload: false
734
+ }
735
+ }
736
+ });
737
+ } else if (src.charAt(0) === "#") {
738
+ type = "inline";
739
+ }
740
+ }
741
+
742
+ if (type) {
743
+ obj.type = type;
744
+ } else {
745
+ self.trigger("objectNeedsType", obj);
746
+ }
747
+
748
+ if (!obj.contentType) {
749
+ obj.contentType = $.inArray(obj.type, ["html", "inline", "ajax"]) > -1 ? "html" : obj.type;
750
+ }
751
+
752
+ // Step 3 - Some adjustments
753
+ // =========================
754
+
755
+ obj.index = self.group.length;
756
+
757
+ if (obj.opts.smallBtn == "auto") {
758
+ obj.opts.smallBtn = $.inArray(obj.type, ["html", "inline", "ajax"]) > -1;
759
+ }
760
+
761
+ if (obj.opts.toolbar === "auto") {
762
+ obj.opts.toolbar = !obj.opts.smallBtn;
763
+ }
764
+
765
+ // Find thumbnail image, check if exists and if is in the viewport
766
+ obj.$thumb = obj.opts.$thumb || null;
767
+
768
+ if (obj.opts.$trigger && obj.index === self.opts.index) {
769
+ obj.$thumb = obj.opts.$trigger.find("img:first");
770
+
771
+ if (obj.$thumb.length) {
772
+ obj.opts.$orig = obj.opts.$trigger;
773
+ }
774
+ }
775
+
776
+ if (!(obj.$thumb && obj.$thumb.length) && obj.opts.$orig) {
777
+ obj.$thumb = obj.opts.$orig.find("img:first");
778
+ }
779
+
780
+ if (obj.$thumb && !obj.$thumb.length) {
781
+ obj.$thumb = null;
782
+ }
783
+
784
+ obj.thumb = obj.opts.thumb || (obj.$thumb ? obj.$thumb[0].src : null);
785
+
786
+ // "caption" is a "special" option, it can be used to customize caption per gallery item
787
+ if ($.type(obj.opts.caption) === "function") {
788
+ obj.opts.caption = obj.opts.caption.apply(item, [self, obj]);
789
+ }
790
+
791
+ if ($.type(self.opts.caption) === "function") {
792
+ obj.opts.caption = self.opts.caption.apply(item, [self, obj]);
793
+ }
794
+
795
+ // Make sure we have caption as a string or jQuery object
796
+ if (!(obj.opts.caption instanceof $)) {
797
+ obj.opts.caption = obj.opts.caption === undefined ? "" : obj.opts.caption + "";
798
+ }
799
+
800
+ // Check if url contains "filter" used to filter the content
801
+ // Example: "ajax.html #something"
802
+ if (obj.type === "ajax") {
803
+ srcParts = src.split(/\s+/, 2);
804
+
805
+ if (srcParts.length > 1) {
806
+ obj.src = srcParts.shift();
807
+
808
+ obj.opts.filter = srcParts.shift();
809
+ }
810
+ }
811
+
812
+ // Hide all buttons and disable interactivity for modal items
813
+ if (obj.opts.modal) {
814
+ obj.opts = $.extend(true, obj.opts, {
815
+ trapFocus: true,
816
+ // Remove buttons
817
+ infobar: 0,
818
+ toolbar: 0,
819
+
820
+ smallBtn: 0,
821
+
822
+ // Disable keyboard navigation
823
+ keyboard: 0,
824
+
825
+ // Disable some modules
826
+ slideShow: 0,
827
+ fullScreen: 0,
828
+ thumbs: 0,
829
+ touch: 0,
830
+
831
+ // Disable click event handlers
832
+ clickContent: false,
833
+ clickSlide: false,
834
+ clickOutside: false,
835
+ dblclickContent: false,
836
+ dblclickSlide: false,
837
+ dblclickOutside: false
838
+ });
839
+ }
840
+
841
+ // Step 4 - Add processed object to group
842
+ // ======================================
843
+
844
+ self.group.push(obj);
845
+ });
846
+
847
+ // Update controls if gallery is already opened
848
+ if (Object.keys(self.slides).length) {
849
+ self.updateControls();
850
+
851
+ // Update thumbnails, if needed
852
+ thumbs = self.Thumbs;
853
+
854
+ if (thumbs && thumbs.isActive) {
855
+ thumbs.create();
856
+
857
+ thumbs.focus();
858
+ }
859
+ }
860
+ },
861
+
862
+ // Attach an event handler functions for:
863
+ // - navigation buttons
864
+ // - browser scrolling, resizing;
865
+ // - focusing
866
+ // - keyboard
867
+ // - detecting inactivity
868
+ // ======================================
869
+
870
+ addEvents: function () {
871
+ var self = this;
872
+
873
+ self.removeEvents();
874
+
875
+ // Make navigation elements clickable
876
+ // ==================================
877
+
878
+ self.$refs.container
879
+ .on("click.fb-close", "[data-fancybox-close]", function (e) {
880
+ e.stopPropagation();
881
+ e.preventDefault();
882
+
883
+ self.close(e);
884
+ })
885
+ .on("touchstart.fb-prev click.fb-prev", "[data-fancybox-prev]", function (e) {
886
+ e.stopPropagation();
887
+ e.preventDefault();
888
+
889
+ self.previous();
890
+ })
891
+ .on("touchstart.fb-next click.fb-next", "[data-fancybox-next]", function (e) {
892
+ e.stopPropagation();
893
+ e.preventDefault();
894
+
895
+ self.next();
896
+ })
897
+ .on("click.fb", "[data-fancybox-zoom]", function (e) {
898
+ // Click handler for zoom button
899
+ self[self.isScaledDown() ? "scaleToActual" : "scaleToFit"]();
900
+ });
901
+
902
+ // Handle page scrolling and browser resizing
903
+ // ==========================================
904
+
905
+ $W.on("orientationchange.fb resize.fb", function (e) {
906
+ if (e && e.originalEvent && e.originalEvent.type === "resize") {
907
+ if (self.requestId) {
908
+ cancelAFrame(self.requestId);
909
+ }
910
+
911
+ self.requestId = requestAFrame(function () {
912
+ self.update(e);
913
+ });
914
+ } else {
915
+ if (self.current && self.current.type === "iframe") {
916
+ self.$refs.stage.hide();
917
+ }
918
+
919
+ setTimeout(
920
+ function () {
921
+ self.$refs.stage.show();
922
+
923
+ self.update(e);
924
+ },
925
+ $.fancybox.isMobile ? 600 : 250
926
+ );
927
+ }
928
+ });
929
+
930
+ $D.on("keydown.fb", function (e) {
931
+ var instance = $.fancybox ? $.fancybox.getInstance() : null,
932
+ current = instance.current,
933
+ keycode = e.keyCode || e.which;
934
+
935
+ // Trap keyboard focus inside of the modal
936
+ // =======================================
937
+
938
+ if (keycode == 9) {
939
+ if (current.opts.trapFocus) {
940
+ self.focus(e);
941
+ }
942
+
943
+ return;
944
+ }
945
+
946
+ // Enable keyboard navigation
947
+ // ==========================
948
+
949
+ if (!current.opts.keyboard || e.ctrlKey || e.altKey || e.shiftKey || $(e.target).is("input,textarea,video,audio,select")) {
950
+ return;
951
+ }
952
+
953
+ // Backspace and Esc keys
954
+ if (keycode === 8 || keycode === 27) {
955
+ e.preventDefault();
956
+
957
+ self.close(e);
958
+
959
+ return;
960
+ }
961
+
962
+ // Left arrow and Up arrow
963
+ if (keycode === 37 || keycode === 38) {
964
+ e.preventDefault();
965
+
966
+ self.previous();
967
+
968
+ return;
969
+ }
970
+
971
+ // Righ arrow and Down arrow
972
+ if (keycode === 39 || keycode === 40) {
973
+ e.preventDefault();
974
+
975
+ self.next();
976
+
977
+ return;
978
+ }
979
+
980
+ self.trigger("afterKeydown", e, keycode);
981
+ });
982
+
983
+ // Hide controls after some inactivity period
984
+ if (self.group[self.currIndex].opts.idleTime) {
985
+ self.idleSecondsCounter = 0;
986
+
987
+ $D.on(
988
+ "mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",
989
+ function (e) {
990
+ self.idleSecondsCounter = 0;
991
+
992
+ if (self.isIdle) {
993
+ self.showControls();
994
+ }
995
+
996
+ self.isIdle = false;
997
+ }
998
+ );
999
+
1000
+ self.idleInterval = window.setInterval(function () {
1001
+ self.idleSecondsCounter++;
1002
+
1003
+ if (self.idleSecondsCounter >= self.group[self.currIndex].opts.idleTime && !self.isDragging) {
1004
+ self.isIdle = true;
1005
+ self.idleSecondsCounter = 0;
1006
+
1007
+ self.hideControls();
1008
+ }
1009
+ }, 1000);
1010
+ }
1011
+ },
1012
+
1013
+ // Remove events added by the core
1014
+ // ===============================
1015
+
1016
+ removeEvents: function () {
1017
+ var self = this;
1018
+
1019
+ $W.off("orientationchange.fb resize.fb");
1020
+ $D.off("keydown.fb .fb-idle");
1021
+
1022
+ this.$refs.container.off(".fb-close .fb-prev .fb-next");
1023
+
1024
+ if (self.idleInterval) {
1025
+ window.clearInterval(self.idleInterval);
1026
+
1027
+ self.idleInterval = null;
1028
+ }
1029
+ },
1030
+
1031
+ // Change to previous gallery item
1032
+ // ===============================
1033
+
1034
+ previous: function (duration) {
1035
+ return this.jumpTo(this.currPos - 1, duration);
1036
+ },
1037
+
1038
+ // Change to next gallery item
1039
+ // ===========================
1040
+
1041
+ next: function (duration) {
1042
+ return this.jumpTo(this.currPos + 1, duration);
1043
+ },
1044
+
1045
+ // Switch to selected gallery item
1046
+ // ===============================
1047
+
1048
+ jumpTo: function (pos, duration) {
1049
+ var self = this,
1050
+ groupLen = self.group.length,
1051
+ firstRun,
1052
+ isMoved,
1053
+ loop,
1054
+ current,
1055
+ previous,
1056
+ slidePos,
1057
+ stagePos,
1058
+ prop,
1059
+ diff;
1060
+
1061
+ if (self.isDragging || self.isClosing || (self.isAnimating && self.firstRun)) {
1062
+ return;
1063
+ }
1064
+
1065
+ // Should loop?
1066
+ pos = parseInt(pos, 10);
1067
+ loop = self.current ? self.current.opts.loop : self.opts.loop;
1068
+
1069
+ if (!loop && (pos < 0 || pos >= groupLen)) {
1070
+ return false;
1071
+ }
1072
+
1073
+ // Check if opening for the first time; this helps to speed things up
1074
+ firstRun = self.firstRun = !Object.keys(self.slides).length;
1075
+
1076
+ // Create slides
1077
+ previous = self.current;
1078
+
1079
+ self.prevIndex = self.currIndex;
1080
+ self.prevPos = self.currPos;
1081
+
1082
+ current = self.createSlide(pos);
1083
+
1084
+ if (groupLen > 1) {
1085
+ if (loop || current.index < groupLen - 1) {
1086
+ self.createSlide(pos + 1);
1087
+ }
1088
+
1089
+ if (loop || current.index > 0) {
1090
+ self.createSlide(pos - 1);
1091
+ }
1092
+ }
1093
+
1094
+ self.current = current;
1095
+ self.currIndex = current.index;
1096
+ self.currPos = current.pos;
1097
+
1098
+ self.trigger("beforeShow", firstRun);
1099
+
1100
+ self.updateControls();
1101
+
1102
+ // Validate duration length
1103
+ current.forcedDuration = undefined;
1104
+
1105
+ if ($.isNumeric(duration)) {
1106
+ current.forcedDuration = duration;
1107
+ } else {
1108
+ duration = current.opts[firstRun ? "animationDuration" : "transitionDuration"];
1109
+ }
1110
+
1111
+ duration = parseInt(duration, 10);
1112
+
1113
+ // Check if user has swiped the slides or if still animating
1114
+ isMoved = self.isMoved(current);
1115
+
1116
+ // Make sure current slide is visible
1117
+ current.$slide.addClass("fancybox-slide--current");
1118
+
1119
+ // Fresh start - reveal container, current slide and start loading content
1120
+ if (firstRun) {
1121
+ if (current.opts.animationEffect && duration) {
1122
+ self.$refs.container.css("transition-duration", duration + "ms");
1123
+ }
1124
+
1125
+ self.$refs.container.addClass("fancybox-is-open").trigger("focus");
1126
+
1127
+ // Attempt to load content into slide
1128
+ // This will later call `afterLoad` -> `revealContent`
1129
+ self.loadSlide(current);
1130
+
1131
+ self.preload("image");
1132
+
1133
+ return;
1134
+ }
1135
+
1136
+ // Get actual slide/stage positions (before cleaning up)
1137
+ slidePos = $.fancybox.getTranslate(previous.$slide);
1138
+ stagePos = $.fancybox.getTranslate(self.$refs.stage);
1139
+
1140
+ // Clean up all slides
1141
+ $.each(self.slides, function (index, slide) {
1142
+ $.fancybox.stop(slide.$slide, true);
1143
+ });
1144
+
1145
+ if (previous.pos !== current.pos) {
1146
+ previous.isComplete = false;
1147
+ }
1148
+
1149
+ previous.$slide.removeClass("fancybox-slide--complete fancybox-slide--current");
1150
+
1151
+ // If slides are out of place, then animate them to correct position
1152
+ if (isMoved) {
1153
+ // Calculate horizontal swipe distance
1154
+ diff = slidePos.left - (previous.pos * slidePos.width + previous.pos * previous.opts.gutter);
1155
+
1156
+ $.each(self.slides, function (index, slide) {
1157
+ slide.$slide.removeClass("fancybox-animated").removeClass(function (index, className) {
1158
+ return (className.match(/(^|\s)fancybox-fx-\S+/g) || []).join(" ");
1159
+ });
1160
+
1161
+ // Make sure that each slide is in equal distance
1162
+ // This is mostly needed for freshly added slides, because they are not yet positioned
1163
+ var leftPos = slide.pos * slidePos.width + slide.pos * slide.opts.gutter;
1164
+
1165
+ $.fancybox.setTranslate(slide.$slide, {
1166
+ top: 0,
1167
+ left: leftPos - stagePos.left + diff
1168
+ });
1169
+
1170
+ if (slide.pos !== current.pos) {
1171
+ slide.$slide.addClass("fancybox-slide--" + (slide.pos > current.pos ? "next" : "previous"));
1172
+ }
1173
+
1174
+ // Redraw to make sure that transition will start
1175
+ forceRedraw(slide.$slide);
1176
+
1177
+ // Animate the slide
1178
+ $.fancybox.animate(
1179
+ slide.$slide, {
1180
+ top: 0,
1181
+ left: (slide.pos - current.pos) * slidePos.width + (slide.pos - current.pos) * slide.opts.gutter
1182
+ },
1183
+ duration,
1184
+ function () {
1185
+ slide.$slide
1186
+ .css({
1187
+ transform: "",
1188
+ opacity: ""
1189
+ })
1190
+ .removeClass("fancybox-slide--next fancybox-slide--previous");
1191
+
1192
+ if (slide.pos === self.currPos) {
1193
+ self.complete();
1194
+ }
1195
+ }
1196
+ );
1197
+ });
1198
+ } else if (duration && current.opts.transitionEffect) {
1199
+ // Set transition effect for previously active slide
1200
+ prop = "fancybox-animated fancybox-fx-" + current.opts.transitionEffect;
1201
+
1202
+ previous.$slide.addClass("fancybox-slide--" + (previous.pos > current.pos ? "next" : "previous"));
1203
+
1204
+ $.fancybox.animate(
1205
+ previous.$slide,
1206
+ prop,
1207
+ duration,
1208
+ function () {
1209
+ previous.$slide.removeClass(prop).removeClass("fancybox-slide--next fancybox-slide--previous");
1210
+ },
1211
+ false
1212
+ );
1213
+ }
1214
+
1215
+ if (current.isLoaded) {
1216
+ self.revealContent(current);
1217
+ } else {
1218
+ self.loadSlide(current);
1219
+ }
1220
+
1221
+ self.preload("image");
1222
+ },
1223
+
1224
+ // Create new "slide" element
1225
+ // These are gallery items that are actually added to DOM
1226
+ // =======================================================
1227
+
1228
+ createSlide: function (pos) {
1229
+ var self = this,
1230
+ $slide,
1231
+ index;
1232
+
1233
+ index = pos % self.group.length;
1234
+ index = index < 0 ? self.group.length + index : index;
1235
+
1236
+ if (!self.slides[pos] && self.group[index]) {
1237
+ $slide = $('<div class="fancybox-slide"></div>').appendTo(self.$refs.stage);
1238
+
1239
+ self.slides[pos] = $.extend(true, {}, self.group[index], {
1240
+ pos: pos,
1241
+ $slide: $slide,
1242
+ isLoaded: false
1243
+ });
1244
+
1245
+ self.updateSlide(self.slides[pos]);
1246
+ }
1247
+
1248
+ return self.slides[pos];
1249
+ },
1250
+
1251
+ // Scale image to the actual size of the image;
1252
+ // x and y values should be relative to the slide
1253
+ // ==============================================
1254
+
1255
+ scaleToActual: function (x, y, duration) {
1256
+ var self = this,
1257
+ current = self.current,
1258
+ $content = current.$content,
1259
+ canvasWidth = $.fancybox.getTranslate(current.$slide).width,
1260
+ canvasHeight = $.fancybox.getTranslate(current.$slide).height,
1261
+ newImgWidth = current.width,
1262
+ newImgHeight = current.height,
1263
+ imgPos,
1264
+ posX,
1265
+ posY,
1266
+ scaleX,
1267
+ scaleY;
1268
+
1269
+ if (self.isAnimating || self.isMoved() || !$content || !(current.type == "image" && current.isLoaded && !current.hasError)) {
1270
+ return;
1271
+ }
1272
+
1273
+ self.isAnimating = true;
1274
+
1275
+ $.fancybox.stop($content);
1276
+
1277
+ x = x === undefined ? canvasWidth * 0.5 : x;
1278
+ y = y === undefined ? canvasHeight * 0.5 : y;
1279
+
1280
+ imgPos = $.fancybox.getTranslate($content);
1281
+
1282
+ imgPos.top -= $.fancybox.getTranslate(current.$slide).top;
1283
+ imgPos.left -= $.fancybox.getTranslate(current.$slide).left;
1284
+
1285
+ scaleX = newImgWidth / imgPos.width;
1286
+ scaleY = newImgHeight / imgPos.height;
1287
+
1288
+ // Get center position for original image
1289
+ posX = canvasWidth * 0.5 - newImgWidth * 0.5;
1290
+ posY = canvasHeight * 0.5 - newImgHeight * 0.5;
1291
+
1292
+ // Make sure image does not move away from edges
1293
+ if (newImgWidth > canvasWidth) {
1294
+ posX = imgPos.left * scaleX - (x * scaleX - x);
1295
+
1296
+ if (posX > 0) {
1297
+ posX = 0;
1298
+ }
1299
+
1300
+ if (posX < canvasWidth - newImgWidth) {
1301
+ posX = canvasWidth - newImgWidth;
1302
+ }
1303
+ }
1304
+
1305
+ if (newImgHeight > canvasHeight) {
1306
+ posY = imgPos.top * scaleY - (y * scaleY - y);
1307
+
1308
+ if (posY > 0) {
1309
+ posY = 0;
1310
+ }
1311
+
1312
+ if (posY < canvasHeight - newImgHeight) {
1313
+ posY = canvasHeight - newImgHeight;
1314
+ }
1315
+ }
1316
+
1317
+ self.updateCursor(newImgWidth, newImgHeight);
1318
+
1319
+ $.fancybox.animate(
1320
+ $content, {
1321
+ top: posY,
1322
+ left: posX,
1323
+ scaleX: scaleX,
1324
+ scaleY: scaleY
1325
+ },
1326
+ duration || 366,
1327
+ function () {
1328
+ self.isAnimating = false;
1329
+ }
1330
+ );
1331
+
1332
+ // Stop slideshow
1333
+ if (self.SlideShow && self.SlideShow.isActive) {
1334
+ self.SlideShow.stop();
1335
+ }
1336
+ },
1337
+
1338
+ // Scale image to fit inside parent element
1339
+ // ========================================
1340
+
1341
+ scaleToFit: function (duration) {
1342
+ var self = this,
1343
+ current = self.current,
1344
+ $content = current.$content,
1345
+ end;
1346
+
1347
+ if (self.isAnimating || self.isMoved() || !$content || !(current.type == "image" && current.isLoaded && !current.hasError)) {
1348
+ return;
1349
+ }
1350
+
1351
+ self.isAnimating = true;
1352
+
1353
+ $.fancybox.stop($content);
1354
+
1355
+ end = self.getFitPos(current);
1356
+
1357
+ self.updateCursor(end.width, end.height);
1358
+
1359
+ $.fancybox.animate(
1360
+ $content, {
1361
+ top: end.top,
1362
+ left: end.left,
1363
+ scaleX: end.width / $content.width(),
1364
+ scaleY: end.height / $content.height()
1365
+ },
1366
+ duration || 366,
1367
+ function () {
1368
+ self.isAnimating = false;
1369
+ }
1370
+ );
1371
+ },
1372
+
1373
+ // Calculate image size to fit inside viewport
1374
+ // ===========================================
1375
+
1376
+ getFitPos: function (slide) {
1377
+ var self = this,
1378
+ $content = slide.$content,
1379
+ $slide = slide.$slide,
1380
+ width = slide.width || slide.opts.width,
1381
+ height = slide.height || slide.opts.height,
1382
+ maxWidth,
1383
+ maxHeight,
1384
+ minRatio,
1385
+ aspectRatio,
1386
+ rez = {};
1387
+
1388
+ if (!slide.isLoaded || !$content || !$content.length) {
1389
+ return false;
1390
+ }
1391
+
1392
+ maxWidth = $.fancybox.getTranslate(self.$refs.stage).width;
1393
+ maxHeight = $.fancybox.getTranslate(self.$refs.stage).height;
1394
+
1395
+ maxWidth -=
1396
+ parseFloat($slide.css("paddingLeft")) +
1397
+ parseFloat($slide.css("paddingRight")) +
1398
+ parseFloat($content.css("marginLeft")) +
1399
+ parseFloat($content.css("marginRight"));
1400
+
1401
+ maxHeight -=
1402
+ parseFloat($slide.css("paddingTop")) +
1403
+ parseFloat($slide.css("paddingBottom")) +
1404
+ parseFloat($content.css("marginTop")) +
1405
+ parseFloat($content.css("marginBottom"));
1406
+
1407
+ if (!width || !height) {
1408
+ width = maxWidth;
1409
+ height = maxHeight;
1410
+ }
1411
+
1412
+ minRatio = Math.min(1, maxWidth / width, maxHeight / height);
1413
+
1414
+ width = minRatio * width;
1415
+ height = minRatio * height;
1416
+
1417
+ // Adjust width/height to precisely fit into container
1418
+ if (width > maxWidth - 0.5) {
1419
+ width = maxWidth;
1420
+ }
1421
+
1422
+ if (height > maxHeight - 0.5) {
1423
+ height = maxHeight;
1424
+ }
1425
+
1426
+ if (slide.type === "image") {
1427
+ rez.top = Math.floor((maxHeight - height) * 0.5) + parseFloat($slide.css("paddingTop"));
1428
+ rez.left = Math.floor((maxWidth - width) * 0.5) + parseFloat($slide.css("paddingLeft"));
1429
+ } else if (slide.contentType === "video") {
1430
+ // Force aspect ratio for the video
1431
+ // "I say the whole world must learn of our peaceful ways… by force!"
1432
+ aspectRatio = slide.opts.width && slide.opts.height ? width / height : slide.opts.ratio || 16 / 9;
1433
+
1434
+ if (height > width / aspectRatio) {
1435
+ height = width / aspectRatio;
1436
+ } else if (width > height * aspectRatio) {
1437
+ width = height * aspectRatio;
1438
+ }
1439
+ }
1440
+
1441
+ rez.width = width;
1442
+ rez.height = height;
1443
+
1444
+ return rez;
1445
+ },
1446
+
1447
+ // Update content size and position for all slides
1448
+ // ==============================================
1449
+
1450
+ update: function (e) {
1451
+ var self = this;
1452
+
1453
+ $.each(self.slides, function (key, slide) {
1454
+ self.updateSlide(slide, e);
1455
+ });
1456
+ },
1457
+
1458
+ // Update slide content position and size
1459
+ // ======================================
1460
+
1461
+ updateSlide: function (slide, e) {
1462
+ var self = this,
1463
+ $content = slide && slide.$content,
1464
+ width = slide.width || slide.opts.width,
1465
+ height = slide.height || slide.opts.height,
1466
+ $slide = slide.$slide;
1467
+
1468
+ // First, prevent caption overlap, if needed
1469
+ self.adjustCaption(slide);
1470
+
1471
+ // Then resize content to fit inside the slide
1472
+ if ($content && (width || height || slide.contentType === "video") && !slide.hasError) {
1473
+ $.fancybox.stop($content);
1474
+
1475
+ $.fancybox.setTranslate($content, self.getFitPos(slide));
1476
+
1477
+ if (slide.pos === self.currPos) {
1478
+ self.isAnimating = false;
1479
+
1480
+ self.updateCursor();
1481
+ }
1482
+ }
1483
+
1484
+ // Then some adjustments
1485
+ self.adjustLayout(slide);
1486
+
1487
+ if ($slide.length) {
1488
+ $slide.trigger("refresh");
1489
+
1490
+ if (slide.pos === self.currPos) {
1491
+ self.$refs.toolbar
1492
+ .add(self.$refs.navigation.find(".fancybox-button--arrow_right"))
1493
+ .toggleClass("compensate-for-scrollbar", $slide.get(0).scrollHeight > $slide.get(0).clientHeight);
1494
+ }
1495
+ }
1496
+
1497
+ self.trigger("onUpdate", slide, e);
1498
+ },
1499
+
1500
+ // Horizontally center slide
1501
+ // =========================
1502
+
1503
+ centerSlide: function (duration) {
1504
+ var self = this,
1505
+ current = self.current,
1506
+ $slide = current.$slide;
1507
+
1508
+ if (self.isClosing || !current) {
1509
+ return;
1510
+ }
1511
+
1512
+ $slide.siblings().css({
1513
+ transform: "",
1514
+ opacity: ""
1515
+ });
1516
+
1517
+ $slide
1518
+ .parent()
1519
+ .children()
1520
+ .removeClass("fancybox-slide--previous fancybox-slide--next");
1521
+
1522
+ $.fancybox.animate(
1523
+ $slide, {
1524
+ top: 0,
1525
+ left: 0,
1526
+ opacity: 1
1527
+ },
1528
+ duration === undefined ? 0 : duration,
1529
+ function () {
1530
+ // Clean up
1531
+ $slide.css({
1532
+ transform: "",
1533
+ opacity: ""
1534
+ });
1535
+
1536
+ if (!current.isComplete) {
1537
+ self.complete();
1538
+ }
1539
+ },
1540
+ false
1541
+ );
1542
+ },
1543
+
1544
+ // Check if current slide is moved (swiped)
1545
+ // ========================================
1546
+
1547
+ isMoved: function (slide) {
1548
+ var current = slide || this.current,
1549
+ slidePos,
1550
+ stagePos;
1551
+
1552
+ if (!current) {
1553
+ return false;
1554
+ }
1555
+
1556
+ stagePos = $.fancybox.getTranslate(this.$refs.stage);
1557
+ slidePos = $.fancybox.getTranslate(current.$slide);
1558
+
1559
+ return (
1560
+ !current.$slide.hasClass("fancybox-animated") &&
1561
+ (Math.abs(slidePos.top - stagePos.top) > 0.5 || Math.abs(slidePos.left - stagePos.left) > 0.5)
1562
+ );
1563
+ },
1564
+
1565
+ // Update cursor style depending if content can be zoomed
1566
+ // ======================================================
1567
+
1568
+ updateCursor: function (nextWidth, nextHeight) {
1569
+ var self = this,
1570
+ current = self.current,
1571
+ $container = self.$refs.container,
1572
+ canPan,
1573
+ isZoomable;
1574
+
1575
+ if (!current || self.isClosing || !self.Guestures) {
1576
+ return;
1577
+ }
1578
+
1579
+ $container.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan");
1580
+
1581
+ canPan = self.canPan(nextWidth, nextHeight);
1582
+
1583
+ isZoomable = canPan ? true : self.isZoomable();
1584
+
1585
+ $container.toggleClass("fancybox-is-zoomable", isZoomable);
1586
+
1587
+ $("[data-fancybox-zoom]").prop("disabled", !isZoomable);
1588
+
1589
+ if (canPan) {
1590
+ $container.addClass("fancybox-can-pan");
1591
+ } else if (
1592
+ isZoomable &&
1593
+ (current.opts.clickContent === "zoom" || ($.isFunction(current.opts.clickContent) && current.opts.clickContent(current) == "zoom"))
1594
+ ) {
1595
+ $container.addClass("fancybox-can-zoomIn");
1596
+ } else if (current.opts.touch && (current.opts.touch.vertical || self.group.length > 1) && current.contentType !== "video") {
1597
+ $container.addClass("fancybox-can-swipe");
1598
+ }
1599
+ },
1600
+
1601
+ // Check if current slide is zoomable
1602
+ // ==================================
1603
+
1604
+ isZoomable: function () {
1605
+ var self = this,
1606
+ current = self.current,
1607
+ fitPos;
1608
+
1609
+ // Assume that slide is zoomable if:
1610
+ // - image is still loading
1611
+ // - actual size of the image is smaller than available area
1612
+ if (current && !self.isClosing && current.type === "image" && !current.hasError) {
1613
+ if (!current.isLoaded) {
1614
+ return true;
1615
+ }
1616
+
1617
+ fitPos = self.getFitPos(current);
1618
+
1619
+ if (fitPos && (current.width > fitPos.width || current.height > fitPos.height)) {
1620
+ return true;
1621
+ }
1622
+ }
1623
+
1624
+ return false;
1625
+ },
1626
+
1627
+ // Check if current image dimensions are smaller than actual
1628
+ // =========================================================
1629
+
1630
+ isScaledDown: function (nextWidth, nextHeight) {
1631
+ var self = this,
1632
+ rez = false,
1633
+ current = self.current,
1634
+ $content = current.$content;
1635
+
1636
+ if (nextWidth !== undefined && nextHeight !== undefined) {
1637
+ rez = nextWidth < current.width && nextHeight < current.height;
1638
+ } else if ($content) {
1639
+ rez = $.fancybox.getTranslate($content);
1640
+ rez = rez.width < current.width && rez.height < current.height;
1641
+ }
1642
+
1643
+ return rez;
1644
+ },
1645
+
1646
+ // Check if image dimensions exceed parent element
1647
+ // ===============================================
1648
+
1649
+ canPan: function (nextWidth, nextHeight) {
1650
+ var self = this,
1651
+ current = self.current,
1652
+ pos = null,
1653
+ rez = false;
1654
+
1655
+ if (current.type === "image" && (current.isComplete || (nextWidth && nextHeight)) && !current.hasError) {
1656
+ rez = self.getFitPos(current);
1657
+
1658
+ if (nextWidth !== undefined && nextHeight !== undefined) {
1659
+ pos = {
1660
+ width: nextWidth,
1661
+ height: nextHeight
1662
+ };
1663
+ } else if (current.isComplete) {
1664
+ pos = $.fancybox.getTranslate(current.$content);
1665
+ }
1666
+
1667
+ if (pos && rez) {
1668
+ rez = Math.abs(pos.width - rez.width) > 1.5 || Math.abs(pos.height - rez.height) > 1.5;
1669
+ }
1670
+ }
1671
+
1672
+ return rez;
1673
+ },
1674
+
1675
+ // Load content into the slide
1676
+ // ===========================
1677
+
1678
+ loadSlide: function (slide) {
1679
+ var self = this,
1680
+ type,
1681
+ $slide,
1682
+ ajaxLoad;
1683
+
1684
+ if (slide.isLoading || slide.isLoaded) {
1685
+ return;
1686
+ }
1687
+
1688
+ slide.isLoading = true;
1689
+
1690
+ if (self.trigger("beforeLoad", slide) === false) {
1691
+ slide.isLoading = false;
1692
+
1693
+ return false;
1694
+ }
1695
+
1696
+ type = slide.type;
1697
+ $slide = slide.$slide;
1698
+
1699
+ $slide
1700
+ .off("refresh")
1701
+ .trigger("onReset")
1702
+ .addClass(slide.opts.slideClass);
1703
+
1704
+ // Create content depending on the type
1705
+ switch (type) {
1706
+ case "image":
1707
+ self.setImage(slide);
1708
+
1709
+ break;
1710
+
1711
+ case "iframe":
1712
+ self.setIframe(slide);
1713
+
1714
+ break;
1715
+
1716
+ case "html":
1717
+ self.setContent(slide, slide.src || slide.content);
1718
+
1719
+ break;
1720
+
1721
+ case "video":
1722
+ self.setContent(
1723
+ slide,
1724
+ slide.opts.video.tpl
1725
+ .replace(/\{\{src\}\}/gi, slide.src)
1726
+ .replace("{{format}}", slide.opts.videoFormat || slide.opts.video.format || "")
1727
+ .replace("{{poster}}", slide.thumb || "")
1728
+ );
1729
+
1730
+ break;
1731
+
1732
+ case "inline":
1733
+ if ($(slide.src).length) {
1734
+ self.setContent(slide, $(slide.src));
1735
+ } else {
1736
+ self.setError(slide);
1737
+ }
1738
+
1739
+ break;
1740
+
1741
+ case "ajax":
1742
+ self.showLoading(slide);
1743
+
1744
+ ajaxLoad = $.ajax(
1745
+ $.extend({}, slide.opts.ajax.settings, {
1746
+ url: slide.src,
1747
+ success: function (data, textStatus) {
1748
+ if (textStatus === "success") {
1749
+ self.setContent(slide, data);
1750
+ }
1751
+ },
1752
+ error: function (jqXHR, textStatus) {
1753
+ if (jqXHR && textStatus !== "abort") {
1754
+ self.setError(slide);
1755
+ }
1756
+ }
1757
+ })
1758
+ );
1759
+
1760
+ $slide.one("onReset", function () {
1761
+ ajaxLoad.abort();
1762
+ });
1763
+
1764
+ break;
1765
+
1766
+ default:
1767
+ self.setError(slide);
1768
+
1769
+ break;
1770
+ }
1771
+
1772
+ return true;
1773
+ },
1774
+
1775
+ // Use thumbnail image, if possible
1776
+ // ================================
1777
+
1778
+ setImage: function (slide) {
1779
+ var self = this,
1780
+ ghost;
1781
+
1782
+ // Check if need to show loading icon
1783
+ setTimeout(function () {
1784
+ var $img = slide.$image;
1785
+
1786
+ if (!self.isClosing && slide.isLoading && (!$img || !$img.length || !$img[0].complete) && !slide.hasError) {
1787
+ self.showLoading(slide);
1788
+ }
1789
+ }, 50);
1790
+
1791
+ //Check if image has srcset
1792
+ self.checkSrcset(slide);
1793
+
1794
+ // This will be wrapper containing both ghost and actual image
1795
+ slide.$content = $('<div class="fancybox-content"></div>')
1796
+ .addClass("fancybox-is-hidden")
1797
+ .appendTo(slide.$slide.addClass("fancybox-slide--image"));
1798
+
1799
+ // If we have a thumbnail, we can display it while actual image is loading
1800
+ // Users will not stare at black screen and actual image will appear gradually
1801
+ if (slide.opts.preload !== false && slide.opts.width && slide.opts.height && slide.thumb) {
1802
+ slide.width = slide.opts.width;
1803
+ slide.height = slide.opts.height;
1804
+
1805
+ ghost = document.createElement("img");
1806
+
1807
+ ghost.onerror = function () {
1808
+ $(this).remove();
1809
+
1810
+ slide.$ghost = null;
1811
+ };
1812
+
1813
+ ghost.onload = function () {
1814
+ self.afterLoad(slide);
1815
+ };
1816
+
1817
+ slide.$ghost = $(ghost)
1818
+ .addClass("fancybox-image")
1819
+ .appendTo(slide.$content)
1820
+ .attr("src", slide.thumb);
1821
+ }
1822
+
1823
+ // Start loading actual image
1824
+ self.setBigImage(slide);
1825
+ },
1826
+
1827
+ // Check if image has srcset and get the source
1828
+ // ============================================
1829
+ checkSrcset: function (slide) {
1830
+ var srcset = slide.opts.srcset || slide.opts.image.srcset,
1831
+ found,
1832
+ temp,
1833
+ pxRatio,
1834
+ windowWidth;
1835
+
1836
+ // If we have "srcset", then we need to find first matching "src" value.
1837
+ // This is necessary, because when you set an src attribute, the browser will preload the image
1838
+ // before any javascript or even CSS is applied.
1839
+ if (srcset) {
1840
+ pxRatio = window.devicePixelRatio || 1;
1841
+ windowWidth = window.innerWidth * pxRatio;
1842
+
1843
+ temp = srcset.split(",").map(function (el) {
1844
+ var ret = {};
1845
+
1846
+ el.trim()
1847
+ .split(/\s+/)
1848
+ .forEach(function (el, i) {
1849
+ var value = parseInt(el.substring(0, el.length - 1), 10);
1850
+
1851
+ if (i === 0) {
1852
+ return (ret.url = el);
1853
+ }
1854
+
1855
+ if (value) {
1856
+ ret.value = value;
1857
+ ret.postfix = el[el.length - 1];
1858
+ }
1859
+ });
1860
+
1861
+ return ret;
1862
+ });
1863
+
1864
+ // Sort by value
1865
+ temp.sort(function (a, b) {
1866
+ return a.value - b.value;
1867
+ });
1868
+
1869
+ // Ok, now we have an array of all srcset values
1870
+ for (var j = 0; j < temp.length; j++) {
1871
+ var el = temp[j];
1872
+
1873
+ if ((el.postfix === "w" && el.value >= windowWidth) || (el.postfix === "x" && el.value >= pxRatio)) {
1874
+ found = el;
1875
+ break;
1876
+ }
1877
+ }
1878
+
1879
+ // If not found, take the last one
1880
+ if (!found && temp.length) {
1881
+ found = temp[temp.length - 1];
1882
+ }
1883
+
1884
+ if (found) {
1885
+ slide.src = found.url;
1886
+
1887
+ // If we have default width/height values, we can calculate height for matching source
1888
+ if (slide.width && slide.height && found.postfix == "w") {
1889
+ slide.height = (slide.width / slide.height) * found.value;
1890
+ slide.width = found.value;
1891
+ }
1892
+
1893
+ slide.opts.srcset = srcset;
1894
+ }
1895
+ }
1896
+ },
1897
+
1898
+ // Create full-size image
1899
+ // ======================
1900
+
1901
+ setBigImage: function (slide) {
1902
+ var self = this,
1903
+ img = document.createElement("img"),
1904
+ $img = $(img);
1905
+
1906
+ slide.$image = $img
1907
+ .one("error", function () {
1908
+ self.setError(slide);
1909
+ })
1910
+ .one("load", function () {
1911
+ var sizes;
1912
+
1913
+ if (!slide.$ghost) {
1914
+ self.resolveImageSlideSize(slide, this.naturalWidth, this.naturalHeight);
1915
+
1916
+ self.afterLoad(slide);
1917
+ }
1918
+
1919
+ if (self.isClosing) {
1920
+ return;
1921
+ }
1922
+
1923
+ if (slide.opts.srcset) {
1924
+ sizes = slide.opts.sizes;
1925
+
1926
+ if (!sizes || sizes === "auto") {
1927
+ sizes =
1928
+ (slide.width / slide.height > 1 && $W.width() / $W.height() > 1 ? "100" : Math.round((slide.width / slide.height) * 100)) +
1929
+ "vw";
1930
+ }
1931
+
1932
+ $img.attr("sizes", sizes).attr("srcset", slide.opts.srcset);
1933
+ }
1934
+
1935
+ // Hide temporary image after some delay
1936
+ if (slide.$ghost) {
1937
+ setTimeout(function () {
1938
+ if (slide.$ghost && !self.isClosing) {
1939
+ slide.$ghost.hide();
1940
+ }
1941
+ }, Math.min(300, Math.max(1000, slide.height / 1600)));
1942
+ }
1943
+
1944
+ self.hideLoading(slide);
1945
+ })
1946
+ .addClass("fancybox-image")
1947
+ .attr("src", slide.src)
1948
+ .appendTo(slide.$content);
1949
+
1950
+ if ((img.complete || img.readyState == "complete") && $img.naturalWidth && $img.naturalHeight) {
1951
+ $img.trigger("load");
1952
+ } else if (img.error) {
1953
+ $img.trigger("error");
1954
+ }
1955
+ },
1956
+
1957
+ // Computes the slide size from image size and maxWidth/maxHeight
1958
+ // ==============================================================
1959
+
1960
+ resolveImageSlideSize: function (slide, imgWidth, imgHeight) {
1961
+ var maxWidth = parseInt(slide.opts.width, 10),
1962
+ maxHeight = parseInt(slide.opts.height, 10);
1963
+
1964
+ // Sets the default values from the image
1965
+ slide.width = imgWidth;
1966
+ slide.height = imgHeight;
1967
+
1968
+ if (maxWidth > 0) {
1969
+ slide.width = maxWidth;
1970
+ slide.height = Math.floor((maxWidth * imgHeight) / imgWidth);
1971
+ }
1972
+
1973
+ if (maxHeight > 0) {
1974
+ slide.width = Math.floor((maxHeight * imgWidth) / imgHeight);
1975
+ slide.height = maxHeight;
1976
+ }
1977
+ },
1978
+
1979
+ // Create iframe wrapper, iframe and bindings
1980
+ // ==========================================
1981
+
1982
+ setIframe: function (slide) {
1983
+ var self = this,
1984
+ opts = slide.opts.iframe,
1985
+ $slide = slide.$slide,
1986
+ $iframe;
1987
+
1988
+ slide.$content = $('<div class="fancybox-content' + (opts.preload ? " fancybox-is-hidden" : "") + '"></div>')
1989
+ .css(opts.css)
1990
+ .appendTo($slide);
1991
+
1992
+ $slide.addClass("fancybox-slide--" + slide.contentType);
1993
+
1994
+ slide.$iframe = $iframe = $(opts.tpl.replace(/\{rnd\}/g, new Date().getTime()))
1995
+ .attr(opts.attr)
1996
+ .appendTo(slide.$content);
1997
+
1998
+ if (opts.preload) {
1999
+ self.showLoading(slide);
2000
+
2001
+ // Unfortunately, it is not always possible to determine if iframe is successfully loaded
2002
+ // (due to browser security policy)
2003
+
2004
+ $iframe.on("load.fb error.fb", function (e) {
2005
+ this.isReady = 1;
2006
+
2007
+ slide.$slide.trigger("refresh");
2008
+
2009
+ self.afterLoad(slide);
2010
+ });
2011
+
2012
+ // Recalculate iframe content size
2013
+ // ===============================
2014
+
2015
+ $slide.on("refresh.fb", function () {
2016
+ var $content = slide.$content,
2017
+ frameWidth = opts.css.width,
2018
+ frameHeight = opts.css.height,
2019
+ $contents,
2020
+ $body;
2021
+
2022
+ if ($iframe[0].isReady !== 1) {
2023
+ return;
2024
+ }
2025
+
2026
+ try {
2027
+ $contents = $iframe.contents();
2028
+ $body = $contents.find("body");
2029
+ } catch (ignore) {}
2030
+
2031
+ // Calculate content dimensions, if it is accessible
2032
+ if ($body && $body.length && $body.children().length) {
2033
+ // Avoid scrolling to top (if multiple instances)
2034
+ $slide.css("overflow", "visible");
2035
+
2036
+ $content.css({
2037
+ width: "100%",
2038
+ "max-width": "100%",
2039
+ height: "9999px"
2040
+ });
2041
+
2042
+ if (frameWidth === undefined) {
2043
+ frameWidth = Math.ceil(Math.max($body[0].clientWidth, $body.outerWidth(true)));
2044
+ }
2045
+
2046
+ $content.css("width", frameWidth ? frameWidth : "").css("max-width", "");
2047
+
2048
+ if (frameHeight === undefined) {
2049
+ frameHeight = Math.ceil(Math.max($body[0].clientHeight, $body.outerHeight(true)));
2050
+ }
2051
+
2052
+ $content.css("height", frameHeight ? frameHeight : "");
2053
+
2054
+ $slide.css("overflow", "auto");
2055
+ }
2056
+
2057
+ $content.removeClass("fancybox-is-hidden");
2058
+ });
2059
+ } else {
2060
+ self.afterLoad(slide);
2061
+ }
2062
+
2063
+ $iframe.attr("src", slide.src);
2064
+
2065
+ // Remove iframe if closing or changing gallery item
2066
+ $slide.one("onReset", function () {
2067
+ // This helps IE not to throw errors when closing
2068
+ try {
2069
+ $(this)
2070
+ .find("iframe")
2071
+ .hide()
2072
+ .unbind()
2073
+ .attr("src", "//about:blank");
2074
+ } catch (ignore) {}
2075
+
2076
+ $(this)
2077
+ .off("refresh.fb")
2078
+ .empty();
2079
+
2080
+ slide.isLoaded = false;
2081
+ slide.isRevealed = false;
2082
+ });
2083
+ },
2084
+
2085
+ // Wrap and append content to the slide
2086
+ // ======================================
2087
+
2088
+ setContent: function (slide, content) {
2089
+ var self = this;
2090
+
2091
+ if (self.isClosing) {
2092
+ return;
2093
+ }
2094
+
2095
+ self.hideLoading(slide);
2096
+
2097
+ if (slide.$content) {
2098
+ $.fancybox.stop(slide.$content);
2099
+ }
2100
+
2101
+ slide.$slide.empty();
2102
+
2103
+ // If content is a jQuery object, then it will be moved to the slide.
2104
+ // The placeholder is created so we will know where to put it back.
2105
+ if (isQuery(content) && content.parent().length) {
2106
+ // Make sure content is not already moved to fancyBox
2107
+ if (content.hasClass("fancybox-content") || content.parent().hasClass("fancybox-content")) {
2108
+ content.parents(".fancybox-slide").trigger("onReset");
2109
+ }
2110
+
2111
+ // Create temporary element marking original place of the content
2112
+ slide.$placeholder = $("<div>")
2113
+ .hide()
2114
+ .insertAfter(content);
2115
+
2116
+ // Make sure content is visible
2117
+ content.css("display", "inline-block");
2118
+ } else if (!slide.hasError) {
2119
+ // If content is just a plain text, try to convert it to html
2120
+ if ($.type(content) === "string") {
2121
+ content = $("<div>")
2122
+ .append($.trim(content))
2123
+ .contents();
2124
+ }
2125
+
2126
+ // If "filter" option is provided, then filter content
2127
+ if (slide.opts.filter) {
2128
+ content = $("<div>")
2129
+ .html(content)
2130
+ .find(slide.opts.filter);
2131
+ }
2132
+ }
2133
+
2134
+ slide.$slide.one("onReset", function () {
2135
+ // Pause all html5 video/audio
2136
+ $(this)
2137
+ .find("video,audio")
2138
+ .trigger("pause");
2139
+
2140
+ // Put content back
2141
+ if (slide.$placeholder) {
2142
+ slide.$placeholder.after(content.removeClass("fancybox-content").hide()).remove();
2143
+
2144
+ slide.$placeholder = null;
2145
+ }
2146
+
2147
+ // Remove custom close button
2148
+ if (slide.$smallBtn) {
2149
+ slide.$smallBtn.remove();
2150
+
2151
+ slide.$smallBtn = null;
2152
+ }
2153
+
2154
+ // Remove content and mark slide as not loaded
2155
+ if (!slide.hasError) {
2156
+ $(this).empty();
2157
+
2158
+ slide.isLoaded = false;
2159
+ slide.isRevealed = false;
2160
+ }
2161
+ });
2162
+
2163
+ $(content).appendTo(slide.$slide);
2164
+
2165
+ if ($(content).is("video,audio")) {
2166
+ $(content).addClass("fancybox-video");
2167
+
2168
+ $(content).wrap("<div></div>");
2169
+
2170
+ slide.contentType = "video";
2171
+
2172
+ slide.opts.width = slide.opts.width || $(content).attr("width");
2173
+ slide.opts.height = slide.opts.height || $(content).attr("height");
2174
+ }
2175
+
2176
+ slide.$content = slide.$slide
2177
+ .children()
2178
+ .filter("div,form,main,video,audio,article,.fancybox-content")
2179
+ .first();
2180
+
2181
+ slide.$content.siblings().hide();
2182
+
2183
+ // Re-check if there is a valid content
2184
+ // (in some cases, ajax response can contain various elements or plain text)
2185
+ if (!slide.$content.length) {
2186
+ slide.$content = slide.$slide
2187
+ .wrapInner("<div></div>")
2188
+ .children()
2189
+ .first();
2190
+ }
2191
+
2192
+ slide.$content.addClass("fancybox-content");
2193
+
2194
+ slide.$slide.addClass("fancybox-slide--" + slide.contentType);
2195
+
2196
+ self.afterLoad(slide);
2197
+ },
2198
+
2199
+ // Display error message
2200
+ // =====================
2201
+
2202
+ setError: function (slide) {
2203
+ slide.hasError = true;
2204
+
2205
+ slide.$slide
2206
+ .trigger("onReset")
2207
+ .removeClass("fancybox-slide--" + slide.contentType)
2208
+ .addClass("fancybox-slide--error");
2209
+
2210
+ slide.contentType = "html";
2211
+
2212
+ this.setContent(slide, this.translate(slide, slide.opts.errorTpl));
2213
+
2214
+ if (slide.pos === this.currPos) {
2215
+ this.isAnimating = false;
2216
+ }
2217
+ },
2218
+
2219
+ // Show loading icon inside the slide
2220
+ // ==================================
2221
+
2222
+ showLoading: function (slide) {
2223
+ var self = this;
2224
+
2225
+ slide = slide || self.current;
2226
+
2227
+ if (slide && !slide.$spinner) {
2228
+ slide.$spinner = $(self.translate(self, self.opts.spinnerTpl))
2229
+ .appendTo(slide.$slide)
2230
+ .hide()
2231
+ .fadeIn("fast");
2232
+ }
2233
+ },
2234
+
2235
+ // Remove loading icon from the slide
2236
+ // ==================================
2237
+
2238
+ hideLoading: function (slide) {
2239
+ var self = this;
2240
+
2241
+ slide = slide || self.current;
2242
+
2243
+ if (slide && slide.$spinner) {
2244
+ slide.$spinner.stop().remove();
2245
+
2246
+ delete slide.$spinner;
2247
+ }
2248
+ },
2249
+
2250
+ // Adjustments after slide content has been loaded
2251
+ // ===============================================
2252
+
2253
+ afterLoad: function (slide) {
2254
+ var self = this;
2255
+
2256
+ if (self.isClosing) {
2257
+ return;
2258
+ }
2259
+
2260
+ slide.isLoading = false;
2261
+ slide.isLoaded = true;
2262
+
2263
+ self.trigger("afterLoad", slide);
2264
+
2265
+ self.hideLoading(slide);
2266
+
2267
+ // Add small close button
2268
+ if (slide.opts.smallBtn && (!slide.$smallBtn || !slide.$smallBtn.length)) {
2269
+ slide.$smallBtn = $(self.translate(slide, slide.opts.btnTpl.smallBtn)).appendTo(slide.$content);
2270
+ }
2271
+
2272
+ // Disable right click
2273
+ if (slide.opts.protect && slide.$content && !slide.hasError) {
2274
+ slide.$content.on("contextmenu.fb", function (e) {
2275
+ if (e.button == 2) {
2276
+ e.preventDefault();
2277
+ }
2278
+
2279
+ return true;
2280
+ });
2281
+
2282
+ // Add fake element on top of the image
2283
+ // This makes a bit harder for user to select image
2284
+ if (slide.type === "image") {
2285
+ $('<div class="fancybox-spaceball"></div>').appendTo(slide.$content);
2286
+ }
2287
+ }
2288
+
2289
+ self.adjustCaption(slide);
2290
+
2291
+ self.adjustLayout(slide);
2292
+
2293
+ if (slide.pos === self.currPos) {
2294
+ self.updateCursor();
2295
+ }
2296
+
2297
+ self.revealContent(slide);
2298
+ },
2299
+
2300
+ // Prevent caption overlap,
2301
+ // fix css inconsistency across browsers
2302
+ // =====================================
2303
+
2304
+ adjustCaption: function (slide) {
2305
+ var self = this,
2306
+ current = slide || self.current,
2307
+ caption = current.opts.caption,
2308
+ preventOverlap = current.opts.preventCaptionOverlap,
2309
+ $caption = self.$refs.caption,
2310
+ $clone,
2311
+ captionH = false;
2312
+
2313
+ $caption.toggleClass("fancybox-caption--separate", preventOverlap);
2314
+
2315
+ if (preventOverlap && caption && caption.length) {
2316
+ if (current.pos !== self.currPos) {
2317
+ $clone = $caption.clone().appendTo($caption.parent());
2318
+
2319
+ $clone
2320
+ .children()
2321
+ .eq(0)
2322
+ .empty()
2323
+ .html(caption);
2324
+
2325
+ captionH = $clone.outerHeight(true);
2326
+
2327
+ $clone.empty().remove();
2328
+ } else if (self.$caption) {
2329
+ captionH = self.$caption.outerHeight(true);
2330
+ }
2331
+
2332
+ current.$slide.css("padding-bottom", captionH || "");
2333
+ }
2334
+ },
2335
+
2336
+ // Simple hack to fix inconsistency across browsers, described here (affects Edge, too):
2337
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=748518
2338
+ // ====================================================================================
2339
+
2340
+ adjustLayout: function (slide) {
2341
+ var self = this,
2342
+ current = slide || self.current,
2343
+ scrollHeight,
2344
+ marginBottom,
2345
+ inlinePadding,
2346
+ actualPadding;
2347
+
2348
+ if (current.isLoaded && current.opts.disableLayoutFix !== true) {
2349
+ current.$content.css("margin-bottom", "");
2350
+
2351
+ // If we would always set margin-bottom for the content,
2352
+ // then it would potentially break vertical align
2353
+ if (current.$content.outerHeight() > current.$slide.height() + 0.5) {
2354
+ inlinePadding = current.$slide[0].style["padding-bottom"];
2355
+ actualPadding = current.$slide.css("padding-bottom");
2356
+
2357
+ if (parseFloat(actualPadding) > 0) {
2358
+ scrollHeight = current.$slide[0].scrollHeight;
2359
+
2360
+ current.$slide.css("padding-bottom", 0);
2361
+
2362
+ if (Math.abs(scrollHeight - current.$slide[0].scrollHeight) < 1) {
2363
+ marginBottom = actualPadding;
2364
+ }
2365
+
2366
+ current.$slide.css("padding-bottom", inlinePadding);
2367
+ }
2368
+ }
2369
+
2370
+ current.$content.css("margin-bottom", marginBottom);
2371
+ }
2372
+ },
2373
+
2374
+ // Make content visible
2375
+ // This method is called right after content has been loaded or
2376
+ // user navigates gallery and transition should start
2377
+ // ============================================================
2378
+
2379
+ revealContent: function (slide) {
2380
+ var self = this,
2381
+ $slide = slide.$slide,
2382
+ end = false,
2383
+ start = false,
2384
+ isMoved = self.isMoved(slide),
2385
+ isRevealed = slide.isRevealed,
2386
+ effect,
2387
+ effectClassName,
2388
+ duration,
2389
+ opacity;
2390
+
2391
+ slide.isRevealed = true;
2392
+
2393
+ effect = slide.opts[self.firstRun ? "animationEffect" : "transitionEffect"];
2394
+ duration = slide.opts[self.firstRun ? "animationDuration" : "transitionDuration"];
2395
+
2396
+ duration = parseInt(slide.forcedDuration === undefined ? duration : slide.forcedDuration, 10);
2397
+
2398
+ if (isMoved || slide.pos !== self.currPos || !duration) {
2399
+ effect = false;
2400
+ }
2401
+
2402
+ // Check if can zoom
2403
+ if (effect === "zoom") {
2404
+ if (slide.pos === self.currPos && duration && slide.type === "image" && !slide.hasError && (start = self.getThumbPos(slide))) {
2405
+ end = self.getFitPos(slide);
2406
+ } else {
2407
+ effect = "fade";
2408
+ }
2409
+ }
2410
+
2411
+ // Zoom animation
2412
+ // ==============
2413
+ if (effect === "zoom") {
2414
+ self.isAnimating = true;
2415
+
2416
+ end.scaleX = end.width / start.width;
2417
+ end.scaleY = end.height / start.height;
2418
+
2419
+ // Check if we need to animate opacity
2420
+ opacity = slide.opts.zoomOpacity;
2421
+
2422
+ if (opacity == "auto") {
2423
+ opacity = Math.abs(slide.width / slide.height - start.width / start.height) > 0.1;
2424
+ }
2425
+
2426
+ if (opacity) {
2427
+ start.opacity = 0.1;
2428
+ end.opacity = 1;
2429
+ }
2430
+
2431
+ // Draw image at start position
2432
+ $.fancybox.setTranslate(slide.$content.removeClass("fancybox-is-hidden"), start);
2433
+
2434
+ forceRedraw(slide.$content);
2435
+
2436
+ // Start animation
2437
+ $.fancybox.animate(slide.$content, end, duration, function () {
2438
+ self.isAnimating = false;
2439
+
2440
+ self.complete();
2441
+ });
2442
+
2443
+ return;
2444
+ }
2445
+
2446
+ self.updateSlide(slide);
2447
+
2448
+ // Simply show content if no effect
2449
+ // ================================
2450
+ if (!effect) {
2451
+ slide.$content.removeClass("fancybox-is-hidden");
2452
+
2453
+ if (!isRevealed && isMoved && slide.type === "image" && !slide.hasError) {
2454
+ slide.$content.hide().fadeIn("fast");
2455
+ }
2456
+
2457
+ if (slide.pos === self.currPos) {
2458
+ self.complete();
2459
+ }
2460
+
2461
+ return;
2462
+ }
2463
+
2464
+ // Prepare for CSS transiton
2465
+ // =========================
2466
+ $.fancybox.stop($slide);
2467
+
2468
+ //effectClassName = "fancybox-animated fancybox-slide--" + (slide.pos >= self.prevPos ? "next" : "previous") + " fancybox-fx-" + effect;
2469
+ effectClassName = "fancybox-slide--" + (slide.pos >= self.prevPos ? "next" : "previous") + " fancybox-animated fancybox-fx-" + effect;
2470
+
2471
+ $slide.addClass(effectClassName).removeClass("fancybox-slide--current"); //.addClass(effectClassName);
2472
+
2473
+ slide.$content.removeClass("fancybox-is-hidden");
2474
+
2475
+ // Force reflow
2476
+ forceRedraw($slide);
2477
+
2478
+ if (slide.type !== "image") {
2479
+ slide.$content.hide().show(0);
2480
+ }
2481
+
2482
+ $.fancybox.animate(
2483
+ $slide,
2484
+ "fancybox-slide--current",
2485
+ duration,
2486
+ function () {
2487
+ $slide.removeClass(effectClassName).css({
2488
+ transform: "",
2489
+ opacity: ""
2490
+ });
2491
+
2492
+ if (slide.pos === self.currPos) {
2493
+ self.complete();
2494
+ }
2495
+ },
2496
+ true
2497
+ );
2498
+ },
2499
+
2500
+ // Check if we can and have to zoom from thumbnail
2501
+ //================================================
2502
+
2503
+ getThumbPos: function (slide) {
2504
+ var rez = false,
2505
+ $thumb = slide.$thumb,
2506
+ thumbPos,
2507
+ btw,
2508
+ brw,
2509
+ bbw,
2510
+ blw;
2511
+
2512
+ if (!$thumb || !inViewport($thumb[0])) {
2513
+ return false;
2514
+ }
2515
+
2516
+ thumbPos = $.fancybox.getTranslate($thumb);
2517
+
2518
+ btw = parseFloat($thumb.css("border-top-width") || 0);
2519
+ brw = parseFloat($thumb.css("border-right-width") || 0);
2520
+ bbw = parseFloat($thumb.css("border-bottom-width") || 0);
2521
+ blw = parseFloat($thumb.css("border-left-width") || 0);
2522
+
2523
+ rez = {
2524
+ top: thumbPos.top + btw,
2525
+ left: thumbPos.left + blw,
2526
+ width: thumbPos.width - brw - blw,
2527
+ height: thumbPos.height - btw - bbw,
2528
+ scaleX: 1,
2529
+ scaleY: 1
2530
+ };
2531
+
2532
+ return thumbPos.width > 0 && thumbPos.height > 0 ? rez : false;
2533
+ },
2534
+
2535
+ // Final adjustments after current gallery item is moved to position
2536
+ // and it`s content is loaded
2537
+ // ==================================================================
2538
+
2539
+ complete: function () {
2540
+ var self = this,
2541
+ current = self.current,
2542
+ slides = {},
2543
+ $el;
2544
+
2545
+ if (self.isMoved() || !current.isLoaded) {
2546
+ return;
2547
+ }
2548
+
2549
+ if (!current.isComplete) {
2550
+ current.isComplete = true;
2551
+
2552
+ current.$slide.siblings().trigger("onReset");
2553
+
2554
+ self.preload("inline");
2555
+
2556
+ // Trigger any CSS transiton inside the slide
2557
+ forceRedraw(current.$slide);
2558
+
2559
+ current.$slide.addClass("fancybox-slide--complete");
2560
+
2561
+ // Remove unnecessary slides
2562
+ $.each(self.slides, function (key, slide) {
2563
+ if (slide.pos >= self.currPos - 1 && slide.pos <= self.currPos + 1) {
2564
+ slides[slide.pos] = slide;
2565
+ } else if (slide) {
2566
+ $.fancybox.stop(slide.$slide);
2567
+
2568
+ slide.$slide.off().remove();
2569
+ }
2570
+ });
2571
+
2572
+ self.slides = slides;
2573
+ }
2574
+
2575
+ self.isAnimating = false;
2576
+
2577
+ self.updateCursor();
2578
+
2579
+ self.trigger("afterShow");
2580
+
2581
+ // Autoplay first html5 video/audio
2582
+ if (!!current.opts.video.autoStart) {
2583
+ current.$slide
2584
+ .find("video,audio")
2585
+ .filter(":visible:first")
2586
+ .trigger("play")
2587
+ .one("ended", function () {
2588
+ if (Document.exitFullscreen) {
2589
+ Document.exitFullscreen();
2590
+ } else if (this.webkitExitFullscreen) {
2591
+ this.webkitExitFullscreen();
2592
+ }
2593
+
2594
+ self.next();
2595
+ });
2596
+ }
2597
+
2598
+ // Try to focus on the first focusable element
2599
+ if (current.opts.autoFocus && current.contentType === "html") {
2600
+ // Look for the first input with autofocus attribute
2601
+ $el = current.$content.find("input[autofocus]:enabled:visible:first");
2602
+
2603
+ if ($el.length) {
2604
+ $el.trigger("focus");
2605
+ } else {
2606
+ self.focus(null, true);
2607
+ }
2608
+ }
2609
+
2610
+ // Avoid jumping
2611
+ current.$slide.scrollTop(0).scrollLeft(0);
2612
+ },
2613
+
2614
+ // Preload next and previous slides
2615
+ // ================================
2616
+
2617
+ preload: function (type) {
2618
+ var self = this,
2619
+ prev,
2620
+ next;
2621
+
2622
+ if (self.group.length < 2) {
2623
+ return;
2624
+ }
2625
+
2626
+ next = self.slides[self.currPos + 1];
2627
+ prev = self.slides[self.currPos - 1];
2628
+
2629
+ if (prev && prev.type === type) {
2630
+ self.loadSlide(prev);
2631
+ }
2632
+
2633
+ if (next && next.type === type) {
2634
+ self.loadSlide(next);
2635
+ }
2636
+ },
2637
+
2638
+ // Try to find and focus on the first focusable element
2639
+ // ====================================================
2640
+
2641
+ focus: function (e, firstRun) {
2642
+ var self = this,
2643
+ focusableStr = [
2644
+ "a[href]",
2645
+ "area[href]",
2646
+ 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',
2647
+ "select:not([disabled]):not([aria-hidden])",
2648
+ "textarea:not([disabled]):not([aria-hidden])",
2649
+ "button:not([disabled]):not([aria-hidden])",
2650
+ "iframe",
2651
+ "object",
2652
+ "embed",
2653
+ "video",
2654
+ "audio",
2655
+ "[contenteditable]",
2656
+ '[tabindex]:not([tabindex^="-"])'
2657
+ ].join(","),
2658
+ focusableItems,
2659
+ focusedItemIndex;
2660
+
2661
+ if (self.isClosing) {
2662
+ return;
2663
+ }
2664
+
2665
+ if (e || !self.current || !self.current.isComplete) {
2666
+ // Focus on any element inside fancybox
2667
+ focusableItems = self.$refs.container.find("*:visible");
2668
+ } else {
2669
+ // Focus inside current slide
2670
+ focusableItems = self.current.$slide.find("*:visible" + (firstRun ? ":not(.fancybox-close-small)" : ""));
2671
+ }
2672
+
2673
+ focusableItems = focusableItems.filter(focusableStr).filter(function () {
2674
+ return $(this).css("visibility") !== "hidden" && !$(this).hasClass("disabled");
2675
+ });
2676
+
2677
+ if (focusableItems.length) {
2678
+ focusedItemIndex = focusableItems.index(document.activeElement);
2679
+
2680
+ if (e && e.shiftKey) {
2681
+ // Back tab
2682
+ if (focusedItemIndex < 0 || focusedItemIndex == 0) {
2683
+ e.preventDefault();
2684
+
2685
+ focusableItems.eq(focusableItems.length - 1).trigger("focus");
2686
+ }
2687
+ } else {
2688
+ // Outside or Forward tab
2689
+ if (focusedItemIndex < 0 || focusedItemIndex == focusableItems.length - 1) {
2690
+ if (e) {
2691
+ e.preventDefault();
2692
+ }
2693
+
2694
+ focusableItems.eq(0).trigger("focus");
2695
+ }
2696
+ }
2697
+ } else {
2698
+ self.$refs.container.trigger("focus");
2699
+ }
2700
+ },
2701
+
2702
+ // Activates current instance - brings container to the front and enables keyboard,
2703
+ // notifies other instances about deactivating
2704
+ // =================================================================================
2705
+
2706
+ activate: function () {
2707
+ var self = this;
2708
+
2709
+ // Deactivate all instances
2710
+ $(".fancybox-container").each(function () {
2711
+ var instance = $(this).data("FancyBox");
2712
+
2713
+ // Skip self and closing instances
2714
+ if (instance && instance.id !== self.id && !instance.isClosing) {
2715
+ instance.trigger("onDeactivate");
2716
+
2717
+ instance.removeEvents();
2718
+
2719
+ instance.isVisible = false;
2720
+ }
2721
+ });
2722
+
2723
+ self.isVisible = true;
2724
+
2725
+ if (self.current || self.isIdle) {
2726
+ self.update();
2727
+
2728
+ self.updateControls();
2729
+ }
2730
+
2731
+ self.trigger("onActivate");
2732
+
2733
+ self.addEvents();
2734
+ },
2735
+
2736
+ // Start closing procedure
2737
+ // This will start "zoom-out" animation if needed and clean everything up afterwards
2738
+ // =================================================================================
2739
+
2740
+ close: function (e, d) {
2741
+ var self = this,
2742
+ current = self.current,
2743
+ effect,
2744
+ duration,
2745
+ $content,
2746
+ domRect,
2747
+ opacity,
2748
+ start,
2749
+ end;
2750
+
2751
+ var done = function () {
2752
+ self.cleanUp(e);
2753
+ };
2754
+
2755
+ if (self.isClosing) {
2756
+ return false;
2757
+ }
2758
+
2759
+ self.isClosing = true;
2760
+
2761
+ // If beforeClose callback prevents closing, make sure content is centered
2762
+ if (self.trigger("beforeClose", e) === false) {
2763
+ self.isClosing = false;
2764
+
2765
+ requestAFrame(function () {
2766
+ self.update();
2767
+ });
2768
+
2769
+ return false;
2770
+ }
2771
+
2772
+ // Remove all events
2773
+ // If there are multiple instances, they will be set again by "activate" method
2774
+ self.removeEvents();
2775
+
2776
+ $content = current.$content;
2777
+ effect = current.opts.animationEffect;
2778
+ duration = $.isNumeric(d) ? d : effect ? current.opts.animationDuration : 0;
2779
+
2780
+ current.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated");
2781
+
2782
+ if (e !== true) {
2783
+ $.fancybox.stop(current.$slide);
2784
+ } else {
2785
+ effect = false;
2786
+ }
2787
+
2788
+ // Remove other slides
2789
+ current.$slide
2790
+ .siblings()
2791
+ .trigger("onReset")
2792
+ .remove();
2793
+
2794
+ // Trigger animations
2795
+ if (duration) {
2796
+ self.$refs.container
2797
+ .removeClass("fancybox-is-open")
2798
+ .addClass("fancybox-is-closing")
2799
+ .css("transition-duration", duration + "ms");
2800
+ }
2801
+
2802
+ // Clean up
2803
+ self.hideLoading(current);
2804
+
2805
+ self.hideControls(true);
2806
+
2807
+ self.updateCursor();
2808
+
2809
+ // Check if possible to zoom-out
2810
+ if (
2811
+ effect === "zoom" &&
2812
+ !($content && duration && current.type === "image" && !self.isMoved() && !current.hasError && (end = self.getThumbPos(current)))
2813
+ ) {
2814
+ effect = "fade";
2815
+ }
2816
+
2817
+ if (effect === "zoom") {
2818
+ $.fancybox.stop($content);
2819
+
2820
+ domRect = $.fancybox.getTranslate($content);
2821
+
2822
+ start = {
2823
+ top: domRect.top,
2824
+ left: domRect.left,
2825
+ scaleX: domRect.width / end.width,
2826
+ scaleY: domRect.height / end.height,
2827
+ width: end.width,
2828
+ height: end.height
2829
+ };
2830
+
2831
+ // Check if we need to animate opacity
2832
+ opacity = current.opts.zoomOpacity;
2833
+
2834
+ if (opacity == "auto") {
2835
+ opacity = Math.abs(current.width / current.height - end.width / end.height) > 0.1;
2836
+ }
2837
+
2838
+ if (opacity) {
2839
+ end.opacity = 0;
2840
+ }
2841
+
2842
+ $.fancybox.setTranslate($content, start);
2843
+
2844
+ forceRedraw($content);
2845
+
2846
+ $.fancybox.animate($content, end, duration, done);
2847
+
2848
+ return true;
2849
+ }
2850
+
2851
+ if (effect && duration) {
2852
+ $.fancybox.animate(
2853
+ current.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"),
2854
+ "fancybox-animated fancybox-fx-" + effect,
2855
+ duration,
2856
+ done
2857
+ );
2858
+ } else {
2859
+ // If skip animation
2860
+ if (e === true) {
2861
+ setTimeout(done, duration);
2862
+ } else {
2863
+ done();
2864
+ }
2865
+ }
2866
+
2867
+ return true;
2868
+ },
2869
+
2870
+ // Final adjustments after removing the instance
2871
+ // =============================================
2872
+
2873
+ cleanUp: function (e) {
2874
+ var self = this,
2875
+ instance,
2876
+ $focus = self.current.opts.$orig,
2877
+ x,
2878
+ y;
2879
+
2880
+ self.current.$slide.trigger("onReset");
2881
+
2882
+ self.$refs.container.empty().remove();
2883
+
2884
+ self.trigger("afterClose", e);
2885
+
2886
+ // Place back focus
2887
+ if (!!self.current.opts.backFocus) {
2888
+ if (!$focus || !$focus.length || !$focus.is(":visible")) {
2889
+ $focus = self.$trigger;
2890
+ }
2891
+
2892
+ if ($focus && $focus.length) {
2893
+ x = window.scrollX;
2894
+ y = window.scrollY;
2895
+
2896
+ $focus.trigger("focus");
2897
+
2898
+ $("html, body")
2899
+ .scrollTop(y)
2900
+ .scrollLeft(x);
2901
+ }
2902
+ }
2903
+
2904
+ self.current = null;
2905
+
2906
+ // Check if there are other instances
2907
+ instance = $.fancybox.getInstance();
2908
+
2909
+ if (instance) {
2910
+ instance.activate();
2911
+ } else {
2912
+ $("body").removeClass("fancybox-active compensate-for-scrollbar");
2913
+
2914
+ $("#fancybox-style-noscroll").remove();
2915
+ }
2916
+ },
2917
+
2918
+ // Call callback and trigger an event
2919
+ // ==================================
2920
+
2921
+ trigger: function (name, slide) {
2922
+ var args = Array.prototype.slice.call(arguments, 1),
2923
+ self = this,
2924
+ obj = slide && slide.opts ? slide : self.current,
2925
+ rez;
2926
+
2927
+ if (obj) {
2928
+ args.unshift(obj);
2929
+ } else {
2930
+ obj = self;
2931
+ }
2932
+
2933
+ args.unshift(self);
2934
+
2935
+ if ($.isFunction(obj.opts[name])) {
2936
+ rez = obj.opts[name].apply(obj, args);
2937
+ }
2938
+
2939
+ if (rez === false) {
2940
+ return rez;
2941
+ }
2942
+
2943
+ if (name === "afterClose" || !self.$refs) {
2944
+ $D.trigger(name + ".fb", args);
2945
+ } else {
2946
+ self.$refs.container.trigger(name + ".fb", args);
2947
+ }
2948
+ },
2949
+
2950
+ // Update infobar values, navigation button states and reveal caption
2951
+ // ==================================================================
2952
+
2953
+ updateControls: function () {
2954
+ var self = this,
2955
+ current = self.current,
2956
+ index = current.index,
2957
+ $container = self.$refs.container,
2958
+ $caption = self.$refs.caption,
2959
+ caption = current.opts.caption;
2960
+
2961
+ // Recalculate content dimensions
2962
+ current.$slide.trigger("refresh");
2963
+
2964
+ // Set caption
2965
+ if (caption && caption.length) {
2966
+ self.$caption = $caption;
2967
+
2968
+ $caption
2969
+ .children()
2970
+ .eq(0)
2971
+ .html(caption);
2972
+ } else {
2973
+ self.$caption = null;
2974
+ }
2975
+
2976
+ if (!self.hasHiddenControls && !self.isIdle) {
2977
+ self.showControls();
2978
+ }
2979
+
2980
+ // Update info and navigation elements
2981
+ $container.find("[data-fancybox-count]").html(self.group.length);
2982
+ $container.find("[data-fancybox-index]").html(index + 1);
2983
+
2984
+ $container.find("[data-fancybox-prev]").prop("disabled", !current.opts.loop && index <= 0);
2985
+ $container.find("[data-fancybox-next]").prop("disabled", !current.opts.loop && index >= self.group.length - 1);
2986
+
2987
+ if (current.type === "image") {
2988
+ // Re-enable buttons; update download button source
2989
+ $container
2990
+ .find("[data-fancybox-zoom]")
2991
+ .show()
2992
+ .end()
2993
+ .find("[data-fancybox-download]")
2994
+ .attr("href", current.opts.image.src || current.src)
2995
+ .show();
2996
+ } else if (current.opts.toolbar) {
2997
+ $container.find("[data-fancybox-download],[data-fancybox-zoom]").hide();
2998
+ }
2999
+
3000
+ // Make sure focus is not on disabled button/element
3001
+ if ($(document.activeElement).is(":hidden,[disabled]")) {
3002
+ self.$refs.container.trigger("focus");
3003
+ }
3004
+ },
3005
+
3006
+ // Hide toolbar and caption
3007
+ // ========================
3008
+
3009
+ hideControls: function (andCaption) {
3010
+ var self = this,
3011
+ arr = ["infobar", "toolbar", "nav"];
3012
+
3013
+ if (andCaption || !self.current.opts.preventCaptionOverlap) {
3014
+ arr.push("caption");
3015
+ }
3016
+
3017
+ this.$refs.container.removeClass(
3018
+ arr
3019
+ .map(function (i) {
3020
+ return "fancybox-show-" + i;
3021
+ })
3022
+ .join(" ")
3023
+ );
3024
+
3025
+ this.hasHiddenControls = true;
3026
+ },
3027
+
3028
+ showControls: function () {
3029
+ var self = this,
3030
+ opts = self.current ? self.current.opts : self.opts,
3031
+ $container = self.$refs.container;
3032
+
3033
+ self.hasHiddenControls = false;
3034
+ self.idleSecondsCounter = 0;
3035
+
3036
+ $container
3037
+ .toggleClass("fancybox-show-toolbar", !!(opts.toolbar && opts.buttons))
3038
+ .toggleClass("fancybox-show-infobar", !!(opts.infobar && self.group.length > 1))
3039
+ .toggleClass("fancybox-show-caption", !!self.$caption)
3040
+ .toggleClass("fancybox-show-nav", !!(opts.arrows && self.group.length > 1))
3041
+ .toggleClass("fancybox-is-modal", !!opts.modal);
3042
+ },
3043
+
3044
+ // Toggle toolbar and caption
3045
+ // ==========================
3046
+
3047
+ toggleControls: function () {
3048
+ if (this.hasHiddenControls) {
3049
+ this.showControls();
3050
+ } else {
3051
+ this.hideControls();
3052
+ }
3053
+ }
3054
+ });
3055
+
3056
+ $.fancybox = {
3057
+ version: "3.5.7",
3058
+ defaults: defaults,
3059
+
3060
+ // Get current instance and execute a command.
3061
+ //
3062
+ // Examples of usage:
3063
+ //
3064
+ // $instance = $.fancybox.getInstance();
3065
+ // $.fancybox.getInstance().jumpTo( 1 );
3066
+ // $.fancybox.getInstance( 'jumpTo', 1 );
3067
+ // $.fancybox.getInstance( function() {
3068
+ // console.info( this.currIndex );
3069
+ // });
3070
+ // ======================================================
3071
+
3072
+ getInstance: function (command) {
3073
+ var instance = $('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),
3074
+ args = Array.prototype.slice.call(arguments, 1);
3075
+
3076
+ if (instance instanceof FancyBox) {
3077
+ if ($.type(command) === "string") {
3078
+ instance[command].apply(instance, args);
3079
+ } else if ($.type(command) === "function") {
3080
+ command.apply(instance, args);
3081
+ }
3082
+
3083
+ return instance;
3084
+ }
3085
+
3086
+ return false;
3087
+ },
3088
+
3089
+ // Create new instance
3090
+ // ===================
3091
+
3092
+ open: function (items, opts, index) {
3093
+ return new FancyBox(items, opts, index);
3094
+ },
3095
+
3096
+ // Close current or all instances
3097
+ // ==============================
3098
+
3099
+ close: function (all) {
3100
+ var instance = this.getInstance();
3101
+
3102
+ if (instance) {
3103
+ instance.close();
3104
+
3105
+ // Try to find and close next instance
3106
+ if (all === true) {
3107
+ this.close(all);
3108
+ }
3109
+ }
3110
+ },
3111
+
3112
+ // Close all instances and unbind all events
3113
+ // =========================================
3114
+
3115
+ destroy: function () {
3116
+ this.close(true);
3117
+
3118
+ $D.add("body").off("click.fb-start", "**");
3119
+ },
3120
+
3121
+ // Try to detect mobile devices
3122
+ // ============================
3123
+
3124
+ isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
3125
+
3126
+ // Detect if 'translate3d' support is available
3127
+ // ============================================
3128
+
3129
+ use3d: (function () {
3130
+ var div = document.createElement("div");
3131
+
3132
+ return (
3133
+ window.getComputedStyle &&
3134
+ window.getComputedStyle(div) &&
3135
+ window.getComputedStyle(div).getPropertyValue("transform") &&
3136
+ !(document.documentMode && document.documentMode < 11)
3137
+ );
3138
+ })(),
3139
+
3140
+ // Helper function to get current visual state of an element
3141
+ // returns array[ top, left, horizontal-scale, vertical-scale, opacity ]
3142
+ // =====================================================================
3143
+
3144
+ getTranslate: function ($el) {
3145
+ var domRect;
3146
+
3147
+ if (!$el || !$el.length) {
3148
+ return false;
3149
+ }
3150
+
3151
+ domRect = $el[0].getBoundingClientRect();
3152
+
3153
+ return {
3154
+ top: domRect.top || 0,
3155
+ left: domRect.left || 0,
3156
+ width: domRect.width,
3157
+ height: domRect.height,
3158
+ opacity: parseFloat($el.css("opacity"))
3159
+ };
3160
+ },
3161
+
3162
+ // Shortcut for setting "translate3d" properties for element
3163
+ // Can set be used to set opacity, too
3164
+ // ========================================================
3165
+
3166
+ setTranslate: function ($el, props) {
3167
+ var str = "",
3168
+ css = {};
3169
+
3170
+ if (!$el || !props) {
3171
+ return;
3172
+ }
3173
+
3174
+ if (props.left !== undefined || props.top !== undefined) {
3175
+ str =
3176
+ (props.left === undefined ? $el.position().left : props.left) +
3177
+ "px, " +
3178
+ (props.top === undefined ? $el.position().top : props.top) +
3179
+ "px";
3180
+
3181
+ if (this.use3d) {
3182
+ str = "translate3d(" + str + ", 0px)";
3183
+ } else {
3184
+ str = "translate(" + str + ")";
3185
+ }
3186
+ }
3187
+
3188
+ if (props.scaleX !== undefined && props.scaleY !== undefined) {
3189
+ str += " scale(" + props.scaleX + ", " + props.scaleY + ")";
3190
+ } else if (props.scaleX !== undefined) {
3191
+ str += " scaleX(" + props.scaleX + ")";
3192
+ }
3193
+
3194
+ if (str.length) {
3195
+ css.transform = str;
3196
+ }
3197
+
3198
+ if (props.opacity !== undefined) {
3199
+ css.opacity = props.opacity;
3200
+ }
3201
+
3202
+ if (props.width !== undefined) {
3203
+ css.width = props.width;
3204
+ }
3205
+
3206
+ if (props.height !== undefined) {
3207
+ css.height = props.height;
3208
+ }
3209
+
3210
+ return $el.css(css);
3211
+ },
3212
+
3213
+ // Simple CSS transition handler
3214
+ // =============================
3215
+
3216
+ animate: function ($el, to, duration, callback, leaveAnimationName) {
3217
+ var self = this,
3218
+ from;
3219
+
3220
+ if ($.isFunction(duration)) {
3221
+ callback = duration;
3222
+ duration = null;
3223
+ }
3224
+
3225
+ self.stop($el);
3226
+
3227
+ from = self.getTranslate($el);
3228
+
3229
+ $el.on(transitionEnd, function (e) {
3230
+ // Skip events from child elements and z-index change
3231
+ if (e && e.originalEvent && (!$el.is(e.originalEvent.target) || e.originalEvent.propertyName == "z-index")) {
3232
+ return;
3233
+ }
3234
+
3235
+ self.stop($el);
3236
+
3237
+ if ($.isNumeric(duration)) {
3238
+ $el.css("transition-duration", "");
3239
+ }
3240
+
3241
+ if ($.isPlainObject(to)) {
3242
+ if (to.scaleX !== undefined && to.scaleY !== undefined) {
3243
+ self.setTranslate($el, {
3244
+ top: to.top,
3245
+ left: to.left,
3246
+ width: from.width * to.scaleX,
3247
+ height: from.height * to.scaleY,
3248
+ scaleX: 1,
3249
+ scaleY: 1
3250
+ });
3251
+ }
3252
+ } else if (leaveAnimationName !== true) {
3253
+ $el.removeClass(to);
3254
+ }
3255
+
3256
+ if ($.isFunction(callback)) {
3257
+ callback(e);
3258
+ }
3259
+ });
3260
+
3261
+ if ($.isNumeric(duration)) {
3262
+ $el.css("transition-duration", duration + "ms");
3263
+ }
3264
+
3265
+ // Start animation by changing CSS properties or class name
3266
+ if ($.isPlainObject(to)) {
3267
+ if (to.scaleX !== undefined && to.scaleY !== undefined) {
3268
+ delete to.width;
3269
+ delete to.height;
3270
+
3271
+ if ($el.parent().hasClass("fancybox-slide--image")) {
3272
+ $el.parent().addClass("fancybox-is-scaling");
3273
+ }
3274
+ }
3275
+
3276
+ $.fancybox.setTranslate($el, to);
3277
+ } else {
3278
+ $el.addClass(to);
3279
+ }
3280
+
3281
+ // Make sure that `transitionend` callback gets fired
3282
+ $el.data(
3283
+ "timer",
3284
+ setTimeout(function () {
3285
+ $el.trigger(transitionEnd);
3286
+ }, duration + 33)
3287
+ );
3288
+ },
3289
+
3290
+ stop: function ($el, callCallback) {
3291
+ if ($el && $el.length) {
3292
+ clearTimeout($el.data("timer"));
3293
+
3294
+ if (callCallback) {
3295
+ $el.trigger(transitionEnd);
3296
+ }
3297
+
3298
+ $el.off(transitionEnd).css("transition-duration", "");
3299
+
3300
+ $el.parent().removeClass("fancybox-is-scaling");
3301
+ }
3302
+ }
3303
+ };
3304
+
3305
+ // Default click handler for "fancyboxed" links
3306
+ // ============================================
3307
+
3308
+ function _run(e, opts) {
3309
+ var items = [],
3310
+ index = 0,
3311
+ $target,
3312
+ value,
3313
+ instance;
3314
+
3315
+ // Avoid opening multiple times
3316
+ if (e && e.isDefaultPrevented()) {
3317
+ return;
3318
+ }
3319
+
3320
+ e.preventDefault();
3321
+
3322
+ opts = opts || {};
3323
+
3324
+ if (e && e.data) {
3325
+ opts = mergeOpts(e.data.options, opts);
3326
+ }
3327
+
3328
+ $target = opts.$target || $(e.currentTarget).trigger("blur");
3329
+ instance = $.fancybox.getInstance();
3330
+
3331
+ if (instance && instance.$trigger && instance.$trigger.is($target)) {
3332
+ return;
3333
+ }
3334
+
3335
+ if (opts.selector) {
3336
+ items = $(opts.selector);
3337
+ } else {
3338
+ // Get all related items and find index for clicked one
3339
+ value = $target.attr("data-fancybox") || "";
3340
+
3341
+ if (value) {
3342
+ items = e.data ? e.data.items : [];
3343
+ items = items.length ? items.filter('[data-fancybox="' + value + '"]') : $('[data-fancybox="' + value + '"]');
3344
+ } else {
3345
+ items = [$target];
3346
+ }
3347
+ }
3348
+
3349
+ index = $(items).index($target);
3350
+
3351
+ // Sometimes current item can not be found
3352
+ if (index < 0) {
3353
+ index = 0;
3354
+ }
3355
+
3356
+ instance = $.fancybox.open(items, opts, index);
3357
+
3358
+ // Save last active element
3359
+ instance.$trigger = $target;
3360
+ }
3361
+
3362
+ // Create a jQuery plugin
3363
+ // ======================
3364
+
3365
+ $.fn.fancybox = function (options) {
3366
+ var selector;
3367
+
3368
+ options = options || {};
3369
+ selector = options.selector || false;
3370
+
3371
+ if (selector) {
3372
+ // Use body element instead of document so it executes first
3373
+ $("body")
3374
+ .off("click.fb-start", selector)
3375
+ .on("click.fb-start", selector, {
3376
+ options: options
3377
+ }, _run);
3378
+ } else {
3379
+ this.off("click.fb-start").on(
3380
+ "click.fb-start", {
3381
+ items: this,
3382
+ options: options
3383
+ },
3384
+ _run
3385
+ );
3386
+ }
3387
+
3388
+ return this;
3389
+ };
3390
+
3391
+ // Self initializing plugin for all elements having `data-fancybox` attribute
3392
+ // ==========================================================================
3393
+
3394
+ $D.on("click.fb-start", "[data-fancybox]", _run);
3395
+
3396
+ // Enable "trigger elements"
3397
+ // =========================
3398
+
3399
+ $D.on("click.fb-start", "[data-fancybox-trigger]", function (e) {
3400
+ $('[data-fancybox="' + $(this).attr("data-fancybox-trigger") + '"]')
3401
+ .eq($(this).attr("data-fancybox-index") || 0)
3402
+ .trigger("click.fb-start", {
3403
+ $trigger: $(this)
3404
+ });
3405
+ });
3406
+
3407
+ // Track focus event for better accessibility styling
3408
+ // ==================================================
3409
+ (function () {
3410
+ var buttonStr = ".fancybox-button",
3411
+ focusStr = "fancybox-focus",
3412
+ $pressed = null;
3413
+
3414
+ $D.on("mousedown mouseup focus blur", buttonStr, function (e) {
3415
+ switch (e.type) {
3416
+ case "mousedown":
3417
+ $pressed = $(this);
3418
+ break;
3419
+ case "mouseup":
3420
+ $pressed = null;
3421
+ break;
3422
+ case "focusin":
3423
+ $(buttonStr).removeClass(focusStr);
3424
+
3425
+ if (!$(this).is($pressed) && !$(this).is("[disabled]")) {
3426
+ $(this).addClass(focusStr);
3427
+ }
3428
+ break;
3429
+ case "focusout":
3430
+ $(buttonStr).removeClass(focusStr);
3431
+ break;
3432
+ }
3433
+ });
3434
+ })();
3435
+ })(window, document, jQuery);
3436
+ // ==========================================================================
3437
+ //
3438
+ // Media
3439
+ // Adds additional media type support
3440
+ //
3441
+ // ==========================================================================
3442
+ (function ($) {
3443
+ "use strict";
3444
+
3445
+ // Object containing properties for each media type
3446
+ var defaults = {
3447
+ youtube: {
3448
+ matcher: /(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,
3449
+ params: {
3450
+ autoplay: 1,
3451
+ autohide: 1,
3452
+ fs: 1,
3453
+ rel: 0,
3454
+ hd: 1,
3455
+ wmode: "transparent",
3456
+ enablejsapi: 1,
3457
+ html5: 1
3458
+ },
3459
+ paramPlace: 8,
3460
+ type: "iframe",
3461
+ url: "https://www.youtube-nocookie.com/embed/$4",
3462
+ thumb: "https://img.youtube.com/vi/$4/hqdefault.jpg"
3463
+ },
3464
+
3465
+ vimeo: {
3466
+ matcher: /^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,
3467
+ params: {
3468
+ autoplay: 1,
3469
+ hd: 1,
3470
+ show_title: 1,
3471
+ show_byline: 1,
3472
+ show_portrait: 0,
3473
+ fullscreen: 1
3474
+ },
3475
+ paramPlace: 3,
3476
+ type: "iframe",
3477
+ url: "//player.vimeo.com/video/$2"
3478
+ },
3479
+
3480
+ instagram: {
3481
+ matcher: /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
3482
+ type: "image",
3483
+ url: "//$1/p/$2/media/?size=l"
3484
+ },
3485
+
3486
+ // Examples:
3487
+ // http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
3488
+ // https://www.google.com/maps/@37.7852006,-122.4146355,14.65z
3489
+ // https://www.google.com/maps/@52.2111123,2.9237542,6.61z?hl=en
3490
+ // https://www.google.com/maps/place/Googleplex/@37.4220041,-122.0833494,17z/data=!4m5!3m4!1s0x0:0x6c296c66619367e0!8m2!3d37.4219998!4d-122.0840572
3491
+ gmap_place: {
3492
+ matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,
3493
+ type: "iframe",
3494
+ url: function (rez) {
3495
+ return (
3496
+ "//maps.google." +
3497
+ rez[2] +
3498
+ "/?ll=" +
3499
+ (rez[9] ? rez[9] + "&z=" + Math.floor(rez[10]) + (rez[12] ? rez[12].replace(/^\//, "&") : "") : rez[12] + "").replace(/\?/, "&") +
3500
+ "&output=" +
3501
+ (rez[12] && rez[12].indexOf("layer=c") > 0 ? "svembed" : "embed")
3502
+ );
3503
+ }
3504
+ },
3505
+
3506
+ // Examples:
3507
+ // https://www.google.com/maps/search/Empire+State+Building/
3508
+ // https://www.google.com/maps/search/?api=1&query=centurylink+field
3509
+ // https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393
3510
+ gmap_search: {
3511
+ matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,
3512
+ type: "iframe",
3513
+ url: function (rez) {
3514
+ return "//maps.google." + rez[2] + "/maps?q=" + rez[5].replace("query=", "q=").replace("api=1", "") + "&output=embed";
3515
+ }
3516
+ }
3517
+ };
3518
+
3519
+ // Formats matching url to final form
3520
+ var format = function (url, rez, params) {
3521
+ if (!url) {
3522
+ return;
3523
+ }
3524
+
3525
+ params = params || "";
3526
+
3527
+ if ($.type(params) === "object") {
3528
+ params = $.param(params, true);
3529
+ }
3530
+
3531
+ $.each(rez, function (key, value) {
3532
+ url = url.replace("$" + key, value || "");
3533
+ });
3534
+
3535
+ if (params.length) {
3536
+ url += (url.indexOf("?") > 0 ? "&" : "?") + params;
3537
+ }
3538
+
3539
+ return url;
3540
+ };
3541
+
3542
+ $(document).on("objectNeedsType.fb", function (e, instance, item) {
3543
+ var url = item.src || "",
3544
+ type = false,
3545
+ media,
3546
+ thumb,
3547
+ rez,
3548
+ params,
3549
+ urlParams,
3550
+ paramObj,
3551
+ provider;
3552
+
3553
+ media = $.extend(true, {}, defaults, item.opts.media);
3554
+
3555
+ // Look for any matching media type
3556
+ $.each(media, function (providerName, providerOpts) {
3557
+ rez = url.match(providerOpts.matcher);
3558
+
3559
+ if (!rez) {
3560
+ return;
3561
+ }
3562
+
3563
+ type = providerOpts.type;
3564
+ provider = providerName;
3565
+ paramObj = {};
3566
+
3567
+ if (providerOpts.paramPlace && rez[providerOpts.paramPlace]) {
3568
+ urlParams = rez[providerOpts.paramPlace];
3569
+
3570
+ if (urlParams[0] == "?") {
3571
+ urlParams = urlParams.substring(1);
3572
+ }
3573
+
3574
+ urlParams = urlParams.split("&");
3575
+
3576
+ for (var m = 0; m < urlParams.length; ++m) {
3577
+ var p = urlParams[m].split("=", 2);
3578
+
3579
+ if (p.length == 2) {
3580
+ paramObj[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
3581
+ }
3582
+ }
3583
+ }
3584
+
3585
+ params = $.extend(true, {}, providerOpts.params, item.opts[providerName], paramObj);
3586
+
3587
+ url =
3588
+ $.type(providerOpts.url) === "function" ? providerOpts.url.call(this, rez, params, item) : format(providerOpts.url, rez, params);
3589
+
3590
+ thumb =
3591
+ $.type(providerOpts.thumb) === "function" ? providerOpts.thumb.call(this, rez, params, item) : format(providerOpts.thumb, rez);
3592
+
3593
+ if (providerName === "youtube") {
3594
+ url = url.replace(/&t=((\d+)m)?(\d+)s/, function (match, p1, m, s) {
3595
+ return "&start=" + ((m ? parseInt(m, 10) * 60 : 0) + parseInt(s, 10));
3596
+ });
3597
+ } else if (providerName === "vimeo") {
3598
+ url = url.replace("&%23", "#");
3599
+ }
3600
+
3601
+ return false;
3602
+ });
3603
+
3604
+ // If it is found, then change content type and update the url
3605
+
3606
+ if (type) {
3607
+ if (!item.opts.thumb && !(item.opts.$thumb && item.opts.$thumb.length)) {
3608
+ item.opts.thumb = thumb;
3609
+ }
3610
+
3611
+ if (type === "iframe") {
3612
+ item.opts = $.extend(true, item.opts, {
3613
+ iframe: {
3614
+ preload: false,
3615
+ attr: {
3616
+ scrolling: "no"
3617
+ }
3618
+ }
3619
+ });
3620
+ }
3621
+
3622
+ $.extend(item, {
3623
+ type: type,
3624
+ src: url,
3625
+ origSrc: item.src,
3626
+ contentSource: provider,
3627
+ contentType: type === "image" ? "image" : provider == "gmap_place" || provider == "gmap_search" ? "map" : "video"
3628
+ });
3629
+ } else if (url) {
3630
+ item.type = item.opts.defaultType;
3631
+ }
3632
+ });
3633
+
3634
+ // Load YouTube/Video API on request to detect when video finished playing
3635
+ var VideoAPILoader = {
3636
+ youtube: {
3637
+ src: "https://www.youtube.com/iframe_api",
3638
+ class: "YT",
3639
+ loading: false,
3640
+ loaded: false
3641
+ },
3642
+
3643
+ vimeo: {
3644
+ src: "https://player.vimeo.com/api/player.js",
3645
+ class: "Vimeo",
3646
+ loading: false,
3647
+ loaded: false
3648
+ },
3649
+
3650
+ load: function (vendor) {
3651
+ var _this = this,
3652
+ script;
3653
+
3654
+ if (this[vendor].loaded) {
3655
+ setTimeout(function () {
3656
+ _this.done(vendor);
3657
+ });
3658
+ return;
3659
+ }
3660
+
3661
+ if (this[vendor].loading) {
3662
+ return;
3663
+ }
3664
+
3665
+ this[vendor].loading = true;
3666
+
3667
+ script = document.createElement("script");
3668
+ script.type = "text/javascript";
3669
+ script.src = this[vendor].src;
3670
+
3671
+ if (vendor === "youtube") {
3672
+ window.onYouTubeIframeAPIReady = function () {
3673
+ _this[vendor].loaded = true;
3674
+ _this.done(vendor);
3675
+ };
3676
+ } else {
3677
+ script.onload = function () {
3678
+ _this[vendor].loaded = true;
3679
+ _this.done(vendor);
3680
+ };
3681
+ }
3682
+
3683
+ document.body.appendChild(script);
3684
+ },
3685
+ done: function (vendor) {
3686
+ var instance, $el, player;
3687
+
3688
+ if (vendor === "youtube") {
3689
+ delete window.onYouTubeIframeAPIReady;
3690
+ }
3691
+
3692
+ instance = $.fancybox.getInstance();
3693
+
3694
+ if (instance) {
3695
+ $el = instance.current.$content.find("iframe");
3696
+
3697
+ if (vendor === "youtube" && YT !== undefined && YT) {
3698
+ player = new YT.Player($el.attr("id"), {
3699
+ events: {
3700
+ onStateChange: function (e) {
3701
+ if (e.data == 0) {
3702
+ instance.next();
3703
+ }
3704
+ }
3705
+ }
3706
+ });
3707
+ } else if (vendor === "vimeo" && Vimeo !== undefined && Vimeo) {
3708
+ player = new Vimeo.Player($el);
3709
+
3710
+ player.on("ended", function () {
3711
+ instance.next();
3712
+ });
3713
+ }
3714
+ }
3715
+ }
3716
+ };
3717
+
3718
+ $(document).on({
3719
+ "afterShow.fb": function (e, instance, current) {
3720
+ if (instance.group.length > 1 && (current.contentSource === "youtube" || current.contentSource === "vimeo")) {
3721
+ VideoAPILoader.load(current.contentSource);
3722
+ }
3723
+ }
3724
+ });
3725
+ })(jQuery);
3726
+ // ==========================================================================
3727
+ //
3728
+ // Guestures
3729
+ // Adds touch guestures, handles click and tap events
3730
+ //
3731
+ // ==========================================================================
3732
+ (function (window, document, $) {
3733
+ "use strict";
3734
+
3735
+ var requestAFrame = (function () {
3736
+ return (
3737
+ window.requestAnimationFrame ||
3738
+ window.webkitRequestAnimationFrame ||
3739
+ window.mozRequestAnimationFrame ||
3740
+ window.oRequestAnimationFrame ||
3741
+ // if all else fails, use setTimeout
3742
+ function (callback) {
3743
+ return window.setTimeout(callback, 1000 / 60);
3744
+ }
3745
+ );
3746
+ })();
3747
+
3748
+ var cancelAFrame = (function () {
3749
+ return (
3750
+ window.cancelAnimationFrame ||
3751
+ window.webkitCancelAnimationFrame ||
3752
+ window.mozCancelAnimationFrame ||
3753
+ window.oCancelAnimationFrame ||
3754
+ function (id) {
3755
+ window.clearTimeout(id);
3756
+ }
3757
+ );
3758
+ })();
3759
+
3760
+ var getPointerXY = function (e) {
3761
+ var result = [];
3762
+
3763
+ e = e.originalEvent || e || window.e;
3764
+ e = e.touches && e.touches.length ? e.touches : e.changedTouches && e.changedTouches.length ? e.changedTouches : [e];
3765
+
3766
+ for (var key in e) {
3767
+ if (e[key].pageX) {
3768
+ result.push({
3769
+ x: e[key].pageX,
3770
+ y: e[key].pageY
3771
+ });
3772
+ } else if (e[key].clientX) {
3773
+ result.push({
3774
+ x: e[key].clientX,
3775
+ y: e[key].clientY
3776
+ });
3777
+ }
3778
+ }
3779
+
3780
+ return result;
3781
+ };
3782
+
3783
+ var distance = function (point2, point1, what) {
3784
+ if (!point1 || !point2) {
3785
+ return 0;
3786
+ }
3787
+
3788
+ if (what === "x") {
3789
+ return point2.x - point1.x;
3790
+ } else if (what === "y") {
3791
+ return point2.y - point1.y;
3792
+ }
3793
+
3794
+ return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2));
3795
+ };
3796
+
3797
+ var isClickable = function ($el) {
3798
+ if (
3799
+ $el.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe') ||
3800
+ $.isFunction($el.get(0).onclick) ||
3801
+ $el.data("selectable")
3802
+ ) {
3803
+ return true;
3804
+ }
3805
+
3806
+ // Check for attributes like data-fancybox-next or data-fancybox-close
3807
+ for (var i = 0, atts = $el[0].attributes, n = atts.length; i < n; i++) {
3808
+ if (atts[i].nodeName.substr(0, 14) === "data-fancybox-") {
3809
+ return true;
3810
+ }
3811
+ }
3812
+
3813
+ return false;
3814
+ };
3815
+
3816
+ var hasScrollbars = function (el) {
3817
+ var overflowY = window.getComputedStyle(el)["overflow-y"],
3818
+ overflowX = window.getComputedStyle(el)["overflow-x"],
3819
+ vertical = (overflowY === "scroll" || overflowY === "auto") && el.scrollHeight > el.clientHeight,
3820
+ horizontal = (overflowX === "scroll" || overflowX === "auto") && el.scrollWidth > el.clientWidth;
3821
+
3822
+ return vertical || horizontal;
3823
+ };
3824
+
3825
+ var isScrollable = function ($el) {
3826
+ var rez = false;
3827
+
3828
+ while (true) {
3829
+ rez = hasScrollbars($el.get(0));
3830
+
3831
+ if (rez) {
3832
+ break;
3833
+ }
3834
+
3835
+ $el = $el.parent();
3836
+
3837
+ if (!$el.length || $el.hasClass("fancybox-stage") || $el.is("body")) {
3838
+ break;
3839
+ }
3840
+ }
3841
+
3842
+ return rez;
3843
+ };
3844
+
3845
+ var Guestures = function (instance) {
3846
+ var self = this;
3847
+
3848
+ self.instance = instance;
3849
+
3850
+ self.$bg = instance.$refs.bg;
3851
+ self.$stage = instance.$refs.stage;
3852
+ self.$container = instance.$refs.container;
3853
+
3854
+ self.destroy();
3855
+
3856
+ self.$container.on("touchstart.fb.touch mousedown.fb.touch", $.proxy(self, "ontouchstart"));
3857
+ };
3858
+
3859
+ Guestures.prototype.destroy = function () {
3860
+ var self = this;
3861
+
3862
+ self.$container.off(".fb.touch");
3863
+
3864
+ $(document).off(".fb.touch");
3865
+
3866
+ if (self.requestId) {
3867
+ cancelAFrame(self.requestId);
3868
+ self.requestId = null;
3869
+ }
3870
+
3871
+ if (self.tapped) {
3872
+ clearTimeout(self.tapped);
3873
+ self.tapped = null;
3874
+ }
3875
+ };
3876
+
3877
+ Guestures.prototype.ontouchstart = function (e) {
3878
+ var self = this,
3879
+ $target = $(e.target),
3880
+ instance = self.instance,
3881
+ current = instance.current,
3882
+ $slide = current.$slide,
3883
+ $content = current.$content,
3884
+ isTouchDevice = e.type == "touchstart";
3885
+
3886
+ // Do not respond to both (touch and mouse) events
3887
+ if (isTouchDevice) {
3888
+ self.$container.off("mousedown.fb.touch");
3889
+ }
3890
+
3891
+ // Ignore right click
3892
+ if (e.originalEvent && e.originalEvent.button == 2) {
3893
+ return;
3894
+ }
3895
+
3896
+ // Ignore taping on links, buttons, input elements
3897
+ if (!$slide.length || !$target.length || isClickable($target) || isClickable($target.parent())) {
3898
+ return;
3899
+ }
3900
+ // Ignore clicks on the scrollbar
3901
+ if (!$target.is("img") && e.originalEvent.clientX > $target[0].clientWidth + $target.offset().left) {
3902
+ return;
3903
+ }
3904
+
3905
+ // Ignore clicks while zooming or closing
3906
+ if (!current || instance.isAnimating || current.$slide.hasClass("fancybox-animated")) {
3907
+ e.stopPropagation();
3908
+ e.preventDefault();
3909
+
3910
+ return;
3911
+ }
3912
+
3913
+ self.realPoints = self.startPoints = getPointerXY(e);
3914
+
3915
+ if (!self.startPoints.length) {
3916
+ return;
3917
+ }
3918
+
3919
+ // Allow other scripts to catch touch event if "touch" is set to false
3920
+ if (current.touch) {
3921
+ e.stopPropagation();
3922
+ }
3923
+
3924
+ self.startEvent = e;
3925
+
3926
+ self.canTap = true;
3927
+ self.$target = $target;
3928
+ self.$content = $content;
3929
+ self.opts = current.opts.touch;
3930
+
3931
+ self.isPanning = false;
3932
+ self.isSwiping = false;
3933
+ self.isZooming = false;
3934
+ self.isScrolling = false;
3935
+ self.canPan = instance.canPan();
3936
+
3937
+ self.startTime = new Date().getTime();
3938
+ self.distanceX = self.distanceY = self.distance = 0;
3939
+
3940
+ self.canvasWidth = Math.round($slide[0].clientWidth);
3941
+ self.canvasHeight = Math.round($slide[0].clientHeight);
3942
+
3943
+ self.contentLastPos = null;
3944
+ self.contentStartPos = $.fancybox.getTranslate(self.$content) || {
3945
+ top: 0,
3946
+ left: 0
3947
+ };
3948
+ self.sliderStartPos = $.fancybox.getTranslate($slide);
3949
+
3950
+ // Since position will be absolute, but we need to make it relative to the stage
3951
+ self.stagePos = $.fancybox.getTranslate(instance.$refs.stage);
3952
+
3953
+ self.sliderStartPos.top -= self.stagePos.top;
3954
+ self.sliderStartPos.left -= self.stagePos.left;
3955
+
3956
+ self.contentStartPos.top -= self.stagePos.top;
3957
+ self.contentStartPos.left -= self.stagePos.left;
3958
+
3959
+ $(document)
3960
+ .off(".fb.touch")
3961
+ .on(isTouchDevice ? "touchend.fb.touch touchcancel.fb.touch" : "mouseup.fb.touch mouseleave.fb.touch", $.proxy(self, "ontouchend"))
3962
+ .on(isTouchDevice ? "touchmove.fb.touch" : "mousemove.fb.touch", $.proxy(self, "ontouchmove"));
3963
+
3964
+ if ($.fancybox.isMobile) {
3965
+ document.addEventListener("scroll", self.onscroll, true);
3966
+ }
3967
+
3968
+ // Skip if clicked outside the sliding area
3969
+ if (!(self.opts || self.canPan) || !($target.is(self.$stage) || self.$stage.find($target).length)) {
3970
+ if ($target.is(".fancybox-image")) {
3971
+ e.preventDefault();
3972
+ }
3973
+
3974
+ if (!($.fancybox.isMobile && $target.parents(".fancybox-caption").length)) {
3975
+ return;
3976
+ }
3977
+ }
3978
+
3979
+ self.isScrollable = isScrollable($target) || isScrollable($target.parent());
3980
+
3981
+ // Check if element is scrollable and try to prevent default behavior (scrolling)
3982
+ if (!($.fancybox.isMobile && self.isScrollable)) {
3983
+ e.preventDefault();
3984
+ }
3985
+
3986
+ // One finger or mouse click - swipe or pan an image
3987
+ if (self.startPoints.length === 1 || current.hasError) {
3988
+ if (self.canPan) {
3989
+ $.fancybox.stop(self.$content);
3990
+
3991
+ self.isPanning = true;
3992
+ } else {
3993
+ self.isSwiping = true;
3994
+ }
3995
+
3996
+ self.$container.addClass("fancybox-is-grabbing");
3997
+ }
3998
+
3999
+ // Two fingers - zoom image
4000
+ if (self.startPoints.length === 2 && current.type === "image" && (current.isLoaded || current.$ghost)) {
4001
+ self.canTap = false;
4002
+ self.isSwiping = false;
4003
+ self.isPanning = false;
4004
+
4005
+ self.isZooming = true;
4006
+
4007
+ $.fancybox.stop(self.$content);
4008
+
4009
+ self.centerPointStartX = (self.startPoints[0].x + self.startPoints[1].x) * 0.5 - $(window).scrollLeft();
4010
+ self.centerPointStartY = (self.startPoints[0].y + self.startPoints[1].y) * 0.5 - $(window).scrollTop();
4011
+
4012
+ self.percentageOfImageAtPinchPointX = (self.centerPointStartX - self.contentStartPos.left) / self.contentStartPos.width;
4013
+ self.percentageOfImageAtPinchPointY = (self.centerPointStartY - self.contentStartPos.top) / self.contentStartPos.height;
4014
+
4015
+ self.startDistanceBetweenFingers = distance(self.startPoints[0], self.startPoints[1]);
4016
+ }
4017
+ };
4018
+
4019
+ Guestures.prototype.onscroll = function (e) {
4020
+ var self = this;
4021
+
4022
+ self.isScrolling = true;
4023
+
4024
+ document.removeEventListener("scroll", self.onscroll, true);
4025
+ };
4026
+
4027
+ Guestures.prototype.ontouchmove = function (e) {
4028
+ var self = this;
4029
+
4030
+ // Make sure user has not released over iframe or disabled element
4031
+ if (e.originalEvent.buttons !== undefined && e.originalEvent.buttons === 0) {
4032
+ self.ontouchend(e);
4033
+ return;
4034
+ }
4035
+
4036
+ if (self.isScrolling) {
4037
+ self.canTap = false;
4038
+ return;
4039
+ }
4040
+
4041
+ self.newPoints = getPointerXY(e);
4042
+
4043
+ if (!(self.opts || self.canPan) || !self.newPoints.length || !self.newPoints.length) {
4044
+ return;
4045
+ }
4046
+
4047
+ if (!(self.isSwiping && self.isSwiping === true)) {
4048
+ e.preventDefault();
4049
+ }
4050
+
4051
+ self.distanceX = distance(self.newPoints[0], self.startPoints[0], "x");
4052
+ self.distanceY = distance(self.newPoints[0], self.startPoints[0], "y");
4053
+
4054
+ self.distance = distance(self.newPoints[0], self.startPoints[0]);
4055
+
4056
+ // Skip false ontouchmove events (Chrome)
4057
+ if (self.distance > 0) {
4058
+ if (self.isSwiping) {
4059
+ self.onSwipe(e);
4060
+ } else if (self.isPanning) {
4061
+ self.onPan();
4062
+ } else if (self.isZooming) {
4063
+ self.onZoom();
4064
+ }
4065
+ }
4066
+ };
4067
+
4068
+ Guestures.prototype.onSwipe = function (e) {
4069
+ var self = this,
4070
+ instance = self.instance,
4071
+ swiping = self.isSwiping,
4072
+ left = self.sliderStartPos.left || 0,
4073
+ angle;
4074
+
4075
+ // If direction is not yet determined
4076
+ if (swiping === true) {
4077
+ // We need at least 10px distance to correctly calculate an angle
4078
+ if (Math.abs(self.distance) > 10) {
4079
+ self.canTap = false;
4080
+
4081
+ if (instance.group.length < 2 && self.opts.vertical) {
4082
+ self.isSwiping = "y";
4083
+ } else if (instance.isDragging || self.opts.vertical === false || (self.opts.vertical === "auto" && $(window).width() > 800)) {
4084
+ self.isSwiping = "x";
4085
+ } else {
4086
+ angle = Math.abs((Math.atan2(self.distanceY, self.distanceX) * 180) / Math.PI);
4087
+
4088
+ self.isSwiping = angle > 45 && angle < 135 ? "y" : "x";
4089
+ }
4090
+
4091
+ if (self.isSwiping === "y" && $.fancybox.isMobile && self.isScrollable) {
4092
+ self.isScrolling = true;
4093
+
4094
+ return;
4095
+ }
4096
+
4097
+ instance.isDragging = self.isSwiping;
4098
+
4099
+ // Reset points to avoid jumping, because we dropped first swipes to calculate the angle
4100
+ self.startPoints = self.newPoints;
4101
+
4102
+ $.each(instance.slides, function (index, slide) {
4103
+ var slidePos, stagePos;
4104
+
4105
+ $.fancybox.stop(slide.$slide);
4106
+
4107
+ slidePos = $.fancybox.getTranslate(slide.$slide);
4108
+ stagePos = $.fancybox.getTranslate(instance.$refs.stage);
4109
+
4110
+ slide.$slide
4111
+ .css({
4112
+ transform: "",
4113
+ opacity: "",
4114
+ "transition-duration": ""
4115
+ })
4116
+ .removeClass("fancybox-animated")
4117
+ .removeClass(function (index, className) {
4118
+ return (className.match(/(^|\s)fancybox-fx-\S+/g) || []).join(" ");
4119
+ });
4120
+
4121
+ if (slide.pos === instance.current.pos) {
4122
+ self.sliderStartPos.top = slidePos.top - stagePos.top;
4123
+ self.sliderStartPos.left = slidePos.left - stagePos.left;
4124
+ }
4125
+
4126
+ $.fancybox.setTranslate(slide.$slide, {
4127
+ top: slidePos.top - stagePos.top,
4128
+ left: slidePos.left - stagePos.left
4129
+ });
4130
+ });
4131
+
4132
+ // Stop slideshow
4133
+ if (instance.SlideShow && instance.SlideShow.isActive) {
4134
+ instance.SlideShow.stop();
4135
+ }
4136
+ }
4137
+
4138
+ return;
4139
+ }
4140
+
4141
+ // Sticky edges
4142
+ if (swiping == "x") {
4143
+ if (
4144
+ self.distanceX > 0 &&
4145
+ (self.instance.group.length < 2 || (self.instance.current.index === 0 && !self.instance.current.opts.loop))
4146
+ ) {
4147
+ left = left + Math.pow(self.distanceX, 0.8);
4148
+ } else if (
4149
+ self.distanceX < 0 &&
4150
+ (self.instance.group.length < 2 ||
4151
+ (self.instance.current.index === self.instance.group.length - 1 && !self.instance.current.opts.loop))
4152
+ ) {
4153
+ left = left - Math.pow(-self.distanceX, 0.8);
4154
+ } else {
4155
+ left = left + self.distanceX;
4156
+ }
4157
+ }
4158
+
4159
+ self.sliderLastPos = {
4160
+ top: swiping == "x" ? 0 : self.sliderStartPos.top + self.distanceY,
4161
+ left: left
4162
+ };
4163
+
4164
+ if (self.requestId) {
4165
+ cancelAFrame(self.requestId);
4166
+
4167
+ self.requestId = null;
4168
+ }
4169
+
4170
+ self.requestId = requestAFrame(function () {
4171
+ if (self.sliderLastPos) {
4172
+ $.each(self.instance.slides, function (index, slide) {
4173
+ var pos = slide.pos - self.instance.currPos;
4174
+
4175
+ $.fancybox.setTranslate(slide.$slide, {
4176
+ top: self.sliderLastPos.top,
4177
+ left: self.sliderLastPos.left + pos * self.canvasWidth + pos * slide.opts.gutter
4178
+ });
4179
+ });
4180
+
4181
+ self.$container.addClass("fancybox-is-sliding");
4182
+ }
4183
+ });
4184
+ };
4185
+
4186
+ Guestures.prototype.onPan = function () {
4187
+ var self = this;
4188
+
4189
+ // Prevent accidental movement (sometimes, when tapping casually, finger can move a bit)
4190
+ if (distance(self.newPoints[0], self.realPoints[0]) < ($.fancybox.isMobile ? 10 : 5)) {
4191
+ self.startPoints = self.newPoints;
4192
+ return;
4193
+ }
4194
+
4195
+ self.canTap = false;
4196
+
4197
+ self.contentLastPos = self.limitMovement();
4198
+
4199
+ if (self.requestId) {
4200
+ cancelAFrame(self.requestId);
4201
+ }
4202
+
4203
+ self.requestId = requestAFrame(function () {
4204
+ $.fancybox.setTranslate(self.$content, self.contentLastPos);
4205
+ });
4206
+ };
4207
+
4208
+ // Make panning sticky to the edges
4209
+ Guestures.prototype.limitMovement = function () {
4210
+ var self = this;
4211
+
4212
+ var canvasWidth = self.canvasWidth;
4213
+ var canvasHeight = self.canvasHeight;
4214
+
4215
+ var distanceX = self.distanceX;
4216
+ var distanceY = self.distanceY;
4217
+
4218
+ var contentStartPos = self.contentStartPos;
4219
+
4220
+ var currentOffsetX = contentStartPos.left;
4221
+ var currentOffsetY = contentStartPos.top;
4222
+
4223
+ var currentWidth = contentStartPos.width;
4224
+ var currentHeight = contentStartPos.height;
4225
+
4226
+ var minTranslateX, minTranslateY, maxTranslateX, maxTranslateY, newOffsetX, newOffsetY;
4227
+
4228
+ if (currentWidth > canvasWidth) {
4229
+ newOffsetX = currentOffsetX + distanceX;
4230
+ } else {
4231
+ newOffsetX = currentOffsetX;
4232
+ }
4233
+
4234
+ newOffsetY = currentOffsetY + distanceY;
4235
+
4236
+ // Slow down proportionally to traveled distance
4237
+ minTranslateX = Math.max(0, canvasWidth * 0.5 - currentWidth * 0.5);
4238
+ minTranslateY = Math.max(0, canvasHeight * 0.5 - currentHeight * 0.5);
4239
+
4240
+ maxTranslateX = Math.min(canvasWidth - currentWidth, canvasWidth * 0.5 - currentWidth * 0.5);
4241
+ maxTranslateY = Math.min(canvasHeight - currentHeight, canvasHeight * 0.5 - currentHeight * 0.5);
4242
+
4243
+ // ->
4244
+ if (distanceX > 0 && newOffsetX > minTranslateX) {
4245
+ newOffsetX = minTranslateX - 1 + Math.pow(-minTranslateX + currentOffsetX + distanceX, 0.8) || 0;
4246
+ }
4247
+
4248
+ // <-
4249
+ if (distanceX < 0 && newOffsetX < maxTranslateX) {
4250
+ newOffsetX = maxTranslateX + 1 - Math.pow(maxTranslateX - currentOffsetX - distanceX, 0.8) || 0;
4251
+ }
4252
+
4253
+ // \/
4254
+ if (distanceY > 0 && newOffsetY > minTranslateY) {
4255
+ newOffsetY = minTranslateY - 1 + Math.pow(-minTranslateY + currentOffsetY + distanceY, 0.8) || 0;
4256
+ }
4257
+
4258
+ // /\
4259
+ if (distanceY < 0 && newOffsetY < maxTranslateY) {
4260
+ newOffsetY = maxTranslateY + 1 - Math.pow(maxTranslateY - currentOffsetY - distanceY, 0.8) || 0;
4261
+ }
4262
+
4263
+ return {
4264
+ top: newOffsetY,
4265
+ left: newOffsetX
4266
+ };
4267
+ };
4268
+
4269
+ Guestures.prototype.limitPosition = function (newOffsetX, newOffsetY, newWidth, newHeight) {
4270
+ var self = this;
4271
+
4272
+ var canvasWidth = self.canvasWidth;
4273
+ var canvasHeight = self.canvasHeight;
4274
+
4275
+ if (newWidth > canvasWidth) {
4276
+ newOffsetX = newOffsetX > 0 ? 0 : newOffsetX;
4277
+ newOffsetX = newOffsetX < canvasWidth - newWidth ? canvasWidth - newWidth : newOffsetX;
4278
+ } else {
4279
+ // Center horizontally
4280
+ newOffsetX = Math.max(0, canvasWidth / 2 - newWidth / 2);
4281
+ }
4282
+
4283
+ if (newHeight > canvasHeight) {
4284
+ newOffsetY = newOffsetY > 0 ? 0 : newOffsetY;
4285
+ newOffsetY = newOffsetY < canvasHeight - newHeight ? canvasHeight - newHeight : newOffsetY;
4286
+ } else {
4287
+ // Center vertically
4288
+ newOffsetY = Math.max(0, canvasHeight / 2 - newHeight / 2);
4289
+ }
4290
+
4291
+ return {
4292
+ top: newOffsetY,
4293
+ left: newOffsetX
4294
+ };
4295
+ };
4296
+
4297
+ Guestures.prototype.onZoom = function () {
4298
+ var self = this;
4299
+
4300
+ // Calculate current distance between points to get pinch ratio and new width and height
4301
+ var contentStartPos = self.contentStartPos;
4302
+
4303
+ var currentWidth = contentStartPos.width;
4304
+ var currentHeight = contentStartPos.height;
4305
+
4306
+ var currentOffsetX = contentStartPos.left;
4307
+ var currentOffsetY = contentStartPos.top;
4308
+
4309
+ var endDistanceBetweenFingers = distance(self.newPoints[0], self.newPoints[1]);
4310
+
4311
+ var pinchRatio = endDistanceBetweenFingers / self.startDistanceBetweenFingers;
4312
+
4313
+ var newWidth = Math.floor(currentWidth * pinchRatio);
4314
+ var newHeight = Math.floor(currentHeight * pinchRatio);
4315
+
4316
+ // This is the translation due to pinch-zooming
4317
+ var translateFromZoomingX = (currentWidth - newWidth) * self.percentageOfImageAtPinchPointX;
4318
+ var translateFromZoomingY = (currentHeight - newHeight) * self.percentageOfImageAtPinchPointY;
4319
+
4320
+ // Point between the two touches
4321
+ var centerPointEndX = (self.newPoints[0].x + self.newPoints[1].x) / 2 - $(window).scrollLeft();
4322
+ var centerPointEndY = (self.newPoints[0].y + self.newPoints[1].y) / 2 - $(window).scrollTop();
4323
+
4324
+ // And this is the translation due to translation of the centerpoint
4325
+ // between the two fingers
4326
+ var translateFromTranslatingX = centerPointEndX - self.centerPointStartX;
4327
+ var translateFromTranslatingY = centerPointEndY - self.centerPointStartY;
4328
+
4329
+ // The new offset is the old/current one plus the total translation
4330
+ var newOffsetX = currentOffsetX + (translateFromZoomingX + translateFromTranslatingX);
4331
+ var newOffsetY = currentOffsetY + (translateFromZoomingY + translateFromTranslatingY);
4332
+
4333
+ var newPos = {
4334
+ top: newOffsetY,
4335
+ left: newOffsetX,
4336
+ scaleX: pinchRatio,
4337
+ scaleY: pinchRatio
4338
+ };
4339
+
4340
+ self.canTap = false;
4341
+
4342
+ self.newWidth = newWidth;
4343
+ self.newHeight = newHeight;
4344
+
4345
+ self.contentLastPos = newPos;
4346
+
4347
+ if (self.requestId) {
4348
+ cancelAFrame(self.requestId);
4349
+ }
4350
+
4351
+ self.requestId = requestAFrame(function () {
4352
+ $.fancybox.setTranslate(self.$content, self.contentLastPos);
4353
+ });
4354
+ };
4355
+
4356
+ Guestures.prototype.ontouchend = function (e) {
4357
+ var self = this;
4358
+
4359
+ var swiping = self.isSwiping;
4360
+ var panning = self.isPanning;
4361
+ var zooming = self.isZooming;
4362
+ var scrolling = self.isScrolling;
4363
+
4364
+ self.endPoints = getPointerXY(e);
4365
+ self.dMs = Math.max(new Date().getTime() - self.startTime, 1);
4366
+
4367
+ self.$container.removeClass("fancybox-is-grabbing");
4368
+
4369
+ $(document).off(".fb.touch");
4370
+
4371
+ document.removeEventListener("scroll", self.onscroll, true);
4372
+
4373
+ if (self.requestId) {
4374
+ cancelAFrame(self.requestId);
4375
+
4376
+ self.requestId = null;
4377
+ }
4378
+
4379
+ self.isSwiping = false;
4380
+ self.isPanning = false;
4381
+ self.isZooming = false;
4382
+ self.isScrolling = false;
4383
+
4384
+ self.instance.isDragging = false;
4385
+
4386
+ if (self.canTap) {
4387
+ return self.onTap(e);
4388
+ }
4389
+
4390
+ self.speed = 100;
4391
+
4392
+ // Speed in px/ms
4393
+ self.velocityX = (self.distanceX / self.dMs) * 0.5;
4394
+ self.velocityY = (self.distanceY / self.dMs) * 0.5;
4395
+
4396
+ if (panning) {
4397
+ self.endPanning();
4398
+ } else if (zooming) {
4399
+ self.endZooming();
4400
+ } else {
4401
+ self.endSwiping(swiping, scrolling);
4402
+ }
4403
+
4404
+ return;
4405
+ };
4406
+
4407
+ Guestures.prototype.endSwiping = function (swiping, scrolling) {
4408
+ var self = this,
4409
+ ret = false,
4410
+ len = self.instance.group.length,
4411
+ distanceX = Math.abs(self.distanceX),
4412
+ canAdvance = swiping == "x" && len > 1 && ((self.dMs > 130 && distanceX > 10) || distanceX > 50),
4413
+ speedX = 300;
4414
+
4415
+ self.sliderLastPos = null;
4416
+
4417
+ // Close if swiped vertically / navigate if horizontally
4418
+ if (swiping == "y" && !scrolling && Math.abs(self.distanceY) > 50) {
4419
+ // Continue vertical movement
4420
+ $.fancybox.animate(
4421
+ self.instance.current.$slide, {
4422
+ top: self.sliderStartPos.top + self.distanceY + self.velocityY * 150,
4423
+ opacity: 0
4424
+ },
4425
+ 200
4426
+ );
4427
+ ret = self.instance.close(true, 250);
4428
+ } else if (canAdvance && self.distanceX > 0) {
4429
+ ret = self.instance.previous(speedX);
4430
+ } else if (canAdvance && self.distanceX < 0) {
4431
+ ret = self.instance.next(speedX);
4432
+ }
4433
+
4434
+ if (ret === false && (swiping == "x" || swiping == "y")) {
4435
+ self.instance.centerSlide(200);
4436
+ }
4437
+
4438
+ self.$container.removeClass("fancybox-is-sliding");
4439
+ };
4440
+
4441
+ // Limit panning from edges
4442
+ // ========================
4443
+ Guestures.prototype.endPanning = function () {
4444
+ var self = this,
4445
+ newOffsetX,
4446
+ newOffsetY,
4447
+ newPos;
4448
+
4449
+ if (!self.contentLastPos) {
4450
+ return;
4451
+ }
4452
+
4453
+ if (self.opts.momentum === false || self.dMs > 350) {
4454
+ newOffsetX = self.contentLastPos.left;
4455
+ newOffsetY = self.contentLastPos.top;
4456
+ } else {
4457
+ // Continue movement
4458
+ newOffsetX = self.contentLastPos.left + self.velocityX * 500;
4459
+ newOffsetY = self.contentLastPos.top + self.velocityY * 500;
4460
+ }
4461
+
4462
+ newPos = self.limitPosition(newOffsetX, newOffsetY, self.contentStartPos.width, self.contentStartPos.height);
4463
+
4464
+ newPos.width = self.contentStartPos.width;
4465
+ newPos.height = self.contentStartPos.height;
4466
+
4467
+ $.fancybox.animate(self.$content, newPos, 366);
4468
+ };
4469
+
4470
+ Guestures.prototype.endZooming = function () {
4471
+ var self = this;
4472
+
4473
+ var current = self.instance.current;
4474
+
4475
+ var newOffsetX, newOffsetY, newPos, reset;
4476
+
4477
+ var newWidth = self.newWidth;
4478
+ var newHeight = self.newHeight;
4479
+
4480
+ if (!self.contentLastPos) {
4481
+ return;
4482
+ }
4483
+
4484
+ newOffsetX = self.contentLastPos.left;
4485
+ newOffsetY = self.contentLastPos.top;
4486
+
4487
+ reset = {
4488
+ top: newOffsetY,
4489
+ left: newOffsetX,
4490
+ width: newWidth,
4491
+ height: newHeight,
4492
+ scaleX: 1,
4493
+ scaleY: 1
4494
+ };
4495
+
4496
+ // Reset scalex/scaleY values; this helps for perfomance and does not break animation
4497
+ $.fancybox.setTranslate(self.$content, reset);
4498
+
4499
+ if (newWidth < self.canvasWidth && newHeight < self.canvasHeight) {
4500
+ self.instance.scaleToFit(150);
4501
+ } else if (newWidth > current.width || newHeight > current.height) {
4502
+ self.instance.scaleToActual(self.centerPointStartX, self.centerPointStartY, 150);
4503
+ } else {
4504
+ newPos = self.limitPosition(newOffsetX, newOffsetY, newWidth, newHeight);
4505
+
4506
+ $.fancybox.animate(self.$content, newPos, 150);
4507
+ }
4508
+ };
4509
+
4510
+ Guestures.prototype.onTap = function (e) {
4511
+ var self = this;
4512
+ var $target = $(e.target);
4513
+
4514
+ var instance = self.instance;
4515
+ var current = instance.current;
4516
+
4517
+ var endPoints = (e && getPointerXY(e)) || self.startPoints;
4518
+
4519
+ var tapX = endPoints[0] ? endPoints[0].x - $(window).scrollLeft() - self.stagePos.left : 0;
4520
+ var tapY = endPoints[0] ? endPoints[0].y - $(window).scrollTop() - self.stagePos.top : 0;
4521
+
4522
+ var where;
4523
+
4524
+ var process = function (prefix) {
4525
+ var action = current.opts[prefix];
4526
+
4527
+ if ($.isFunction(action)) {
4528
+ action = action.apply(instance, [current, e]);
4529
+ }
4530
+
4531
+ if (!action) {
4532
+ return;
4533
+ }
4534
+
4535
+ switch (action) {
4536
+ case "close":
4537
+ instance.close(self.startEvent);
4538
+
4539
+ break;
4540
+
4541
+ case "toggleControls":
4542
+ instance.toggleControls();
4543
+
4544
+ break;
4545
+
4546
+ case "next":
4547
+ instance.next();
4548
+
4549
+ break;
4550
+
4551
+ case "nextOrClose":
4552
+ if (instance.group.length > 1) {
4553
+ instance.next();
4554
+ } else {
4555
+ instance.close(self.startEvent);
4556
+ }
4557
+
4558
+ break;
4559
+
4560
+ case "zoom":
4561
+ if (current.type == "image" && (current.isLoaded || current.$ghost)) {
4562
+ if (instance.canPan()) {
4563
+ instance.scaleToFit();
4564
+ } else if (instance.isScaledDown()) {
4565
+ instance.scaleToActual(tapX, tapY);
4566
+ } else if (instance.group.length < 2) {
4567
+ instance.close(self.startEvent);
4568
+ }
4569
+ }
4570
+
4571
+ break;
4572
+ }
4573
+ };
4574
+
4575
+ // Ignore right click
4576
+ if (e.originalEvent && e.originalEvent.button == 2) {
4577
+ return;
4578
+ }
4579
+
4580
+ // Skip if clicked on the scrollbar
4581
+ if (!$target.is("img") && tapX > $target[0].clientWidth + $target.offset().left) {
4582
+ return;
4583
+ }
4584
+
4585
+ // Check where is clicked
4586
+ if ($target.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container")) {
4587
+ where = "Outside";
4588
+ } else if ($target.is(".fancybox-slide")) {
4589
+ where = "Slide";
4590
+ } else if (
4591
+ instance.current.$content &&
4592
+ instance.current.$content
4593
+ .find($target)
4594
+ .addBack()
4595
+ .filter($target).length
4596
+ ) {
4597
+ where = "Content";
4598
+ } else {
4599
+ return;
4600
+ }
4601
+
4602
+ // Check if this is a double tap
4603
+ if (self.tapped) {
4604
+ // Stop previously created single tap
4605
+ clearTimeout(self.tapped);
4606
+ self.tapped = null;
4607
+
4608
+ // Skip if distance between taps is too big
4609
+ if (Math.abs(tapX - self.tapX) > 50 || Math.abs(tapY - self.tapY) > 50) {
4610
+ return this;
4611
+ }
4612
+
4613
+ // OK, now we assume that this is a double-tap
4614
+ process("dblclick" + where);
4615
+ } else {
4616
+ // Single tap will be processed if user has not clicked second time within 300ms
4617
+ // or there is no need to wait for double-tap
4618
+ self.tapX = tapX;
4619
+ self.tapY = tapY;
4620
+
4621
+ if (current.opts["dblclick" + where] && current.opts["dblclick" + where] !== current.opts["click" + where]) {
4622
+ self.tapped = setTimeout(function () {
4623
+ self.tapped = null;
4624
+
4625
+ if (!instance.isAnimating) {
4626
+ process("click" + where);
4627
+ }
4628
+ }, 500);
4629
+ } else {
4630
+ process("click" + where);
4631
+ }
4632
+ }
4633
+
4634
+ return this;
4635
+ };
4636
+
4637
+ $(document)
4638
+ .on("onActivate.fb", function (e, instance) {
4639
+ if (instance && !instance.Guestures) {
4640
+ instance.Guestures = new Guestures(instance);
4641
+ }
4642
+ })
4643
+ .on("beforeClose.fb", function (e, instance) {
4644
+ if (instance && instance.Guestures) {
4645
+ instance.Guestures.destroy();
4646
+ }
4647
+ });
4648
+ })(window, document, jQuery);
4649
+ // ==========================================================================
4650
+ //
4651
+ // SlideShow
4652
+ // Enables slideshow functionality
4653
+ //
4654
+ // Example of usage:
4655
+ // $.fancybox.getInstance().SlideShow.start()
4656
+ //
4657
+ // ==========================================================================
4658
+ (function (document, $) {
4659
+ "use strict";
4660
+
4661
+ $.extend(true, $.fancybox.defaults, {
4662
+ btnTpl: {
4663
+ slideShow: '<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}">' +
4664
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 5.4v13.2l11-6.6z"/></svg>' +
4665
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z"/></svg>' +
4666
+ "</button>"
4667
+ },
4668
+ slideShow: {
4669
+ autoStart: false,
4670
+ speed: 3000,
4671
+ progress: true
4672
+ }
4673
+ });
4674
+
4675
+ var SlideShow = function (instance) {
4676
+ this.instance = instance;
4677
+ this.init();
4678
+ };
4679
+
4680
+ $.extend(SlideShow.prototype, {
4681
+ timer: null,
4682
+ isActive: false,
4683
+ $button: null,
4684
+
4685
+ init: function () {
4686
+ var self = this,
4687
+ instance = self.instance,
4688
+ opts = instance.group[instance.currIndex].opts.slideShow;
4689
+
4690
+ self.$button = instance.$refs.toolbar.find("[data-fancybox-play]").on("click", function () {
4691
+ self.toggle();
4692
+ });
4693
+
4694
+ if (instance.group.length < 2 || !opts) {
4695
+ self.$button.hide();
4696
+ } else if (opts.progress) {
4697
+ self.$progress = $('<div class="fancybox-progress"></div>').appendTo(instance.$refs.inner);
4698
+ }
4699
+ },
4700
+
4701
+ set: function (force) {
4702
+ var self = this,
4703
+ instance = self.instance,
4704
+ current = instance.current;
4705
+
4706
+ // Check if reached last element
4707
+ if (current && (force === true || current.opts.loop || instance.currIndex < instance.group.length - 1)) {
4708
+ if (self.isActive && current.contentType !== "video") {
4709
+ if (self.$progress) {
4710
+ $.fancybox.animate(self.$progress.show(), {
4711
+ scaleX: 1
4712
+ }, current.opts.slideShow.speed);
4713
+ }
4714
+
4715
+ self.timer = setTimeout(function () {
4716
+ if (!instance.current.opts.loop && instance.current.index == instance.group.length - 1) {
4717
+ instance.jumpTo(0);
4718
+ } else {
4719
+ instance.next();
4720
+ }
4721
+ }, current.opts.slideShow.speed);
4722
+ }
4723
+ } else {
4724
+ self.stop();
4725
+ instance.idleSecondsCounter = 0;
4726
+ instance.showControls();
4727
+ }
4728
+ },
4729
+
4730
+ clear: function () {
4731
+ var self = this;
4732
+
4733
+ clearTimeout(self.timer);
4734
+
4735
+ self.timer = null;
4736
+
4737
+ if (self.$progress) {
4738
+ self.$progress.removeAttr("style").hide();
4739
+ }
4740
+ },
4741
+
4742
+ start: function () {
4743
+ var self = this,
4744
+ current = self.instance.current;
4745
+
4746
+ if (current) {
4747
+ self.$button
4748
+ .attr("title", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_STOP)
4749
+ .removeClass("fancybox-button--play")
4750
+ .addClass("fancybox-button--pause");
4751
+
4752
+ self.isActive = true;
4753
+
4754
+ if (current.isComplete) {
4755
+ self.set(true);
4756
+ }
4757
+
4758
+ self.instance.trigger("onSlideShowChange", true);
4759
+ }
4760
+ },
4761
+
4762
+ stop: function () {
4763
+ var self = this,
4764
+ current = self.instance.current;
4765
+
4766
+ self.clear();
4767
+
4768
+ self.$button
4769
+ .attr("title", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_START)
4770
+ .removeClass("fancybox-button--pause")
4771
+ .addClass("fancybox-button--play");
4772
+
4773
+ self.isActive = false;
4774
+
4775
+ self.instance.trigger("onSlideShowChange", false);
4776
+
4777
+ if (self.$progress) {
4778
+ self.$progress.removeAttr("style").hide();
4779
+ }
4780
+ },
4781
+
4782
+ toggle: function () {
4783
+ var self = this;
4784
+
4785
+ if (self.isActive) {
4786
+ self.stop();
4787
+ } else {
4788
+ self.start();
4789
+ }
4790
+ }
4791
+ });
4792
+
4793
+ $(document).on({
4794
+ "onInit.fb": function (e, instance) {
4795
+ if (instance && !instance.SlideShow) {
4796
+ instance.SlideShow = new SlideShow(instance);
4797
+ }
4798
+ },
4799
+
4800
+ "beforeShow.fb": function (e, instance, current, firstRun) {
4801
+ var SlideShow = instance && instance.SlideShow;
4802
+
4803
+ if (firstRun) {
4804
+ if (SlideShow && current.opts.slideShow.autoStart) {
4805
+ SlideShow.start();
4806
+ }
4807
+ } else if (SlideShow && SlideShow.isActive) {
4808
+ SlideShow.clear();
4809
+ }
4810
+ },
4811
+
4812
+ "afterShow.fb": function (e, instance, current) {
4813
+ var SlideShow = instance && instance.SlideShow;
4814
+
4815
+ if (SlideShow && SlideShow.isActive) {
4816
+ SlideShow.set();
4817
+ }
4818
+ },
4819
+
4820
+ "afterKeydown.fb": function (e, instance, current, keypress, keycode) {
4821
+ var SlideShow = instance && instance.SlideShow;
4822
+
4823
+ // "P" or Spacebar
4824
+ if (SlideShow && current.opts.slideShow && (keycode === 80 || keycode === 32) && !$(document.activeElement).is("button,a,input")) {
4825
+ keypress.preventDefault();
4826
+
4827
+ SlideShow.toggle();
4828
+ }
4829
+ },
4830
+
4831
+ "beforeClose.fb onDeactivate.fb": function (e, instance) {
4832
+ var SlideShow = instance && instance.SlideShow;
4833
+
4834
+ if (SlideShow) {
4835
+ SlideShow.stop();
4836
+ }
4837
+ }
4838
+ });
4839
+
4840
+ // Page Visibility API to pause slideshow when window is not active
4841
+ $(document).on("visibilitychange", function () {
4842
+ var instance = $.fancybox.getInstance(),
4843
+ SlideShow = instance && instance.SlideShow;
4844
+
4845
+ if (SlideShow && SlideShow.isActive) {
4846
+ if (document.hidden) {
4847
+ SlideShow.clear();
4848
+ } else {
4849
+ SlideShow.set();
4850
+ }
4851
+ }
4852
+ });
4853
+ })(document, jQuery);
4854
+ // ==========================================================================
4855
+ //
4856
+ // FullScreen
4857
+ // Adds fullscreen functionality
4858
+ //
4859
+ // ==========================================================================
4860
+ (function (document, $) {
4861
+ "use strict";
4862
+
4863
+ // Collection of methods supported by user browser
4864
+ var fn = (function () {
4865
+ var fnMap = [
4866
+ ["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"],
4867
+ // new WebKit
4868
+ [
4869
+ "webkitRequestFullscreen",
4870
+ "webkitExitFullscreen",
4871
+ "webkitFullscreenElement",
4872
+ "webkitFullscreenEnabled",
4873
+ "webkitfullscreenchange",
4874
+ "webkitfullscreenerror"
4875
+ ],
4876
+ // old WebKit (Safari 5.1)
4877
+ [
4878
+ "webkitRequestFullScreen",
4879
+ "webkitCancelFullScreen",
4880
+ "webkitCurrentFullScreenElement",
4881
+ "webkitCancelFullScreen",
4882
+ "webkitfullscreenchange",
4883
+ "webkitfullscreenerror"
4884
+ ],
4885
+ [
4886
+ "mozRequestFullScreen",
4887
+ "mozCancelFullScreen",
4888
+ "mozFullScreenElement",
4889
+ "mozFullScreenEnabled",
4890
+ "mozfullscreenchange",
4891
+ "mozfullscreenerror"
4892
+ ],
4893
+ ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError"]
4894
+ ];
4895
+
4896
+ var ret = {};
4897
+
4898
+ for (var i = 0; i < fnMap.length; i++) {
4899
+ var val = fnMap[i];
4900
+
4901
+ if (val && val[1] in document) {
4902
+ for (var j = 0; j < val.length; j++) {
4903
+ ret[fnMap[0][j]] = val[j];
4904
+ }
4905
+
4906
+ return ret;
4907
+ }
4908
+ }
4909
+
4910
+ return false;
4911
+ })();
4912
+
4913
+ if (fn) {
4914
+ var FullScreen = {
4915
+ request: function (elem) {
4916
+ elem = elem || document.documentElement;
4917
+
4918
+ elem[fn.requestFullscreen](elem.ALLOW_KEYBOARD_INPUT);
4919
+ },
4920
+ exit: function () {
4921
+ document[fn.exitFullscreen]();
4922
+ },
4923
+ toggle: function (elem) {
4924
+ elem = elem || document.documentElement;
4925
+
4926
+ if (this.isFullscreen()) {
4927
+ this.exit();
4928
+ } else {
4929
+ this.request(elem);
4930
+ }
4931
+ },
4932
+ isFullscreen: function () {
4933
+ return Boolean(document[fn.fullscreenElement]);
4934
+ },
4935
+ enabled: function () {
4936
+ return Boolean(document[fn.fullscreenEnabled]);
4937
+ }
4938
+ };
4939
+
4940
+ $.extend(true, $.fancybox.defaults, {
4941
+ btnTpl: {
4942
+ fullScreen: '<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}">' +
4943
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg>' +
4944
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"/></svg>' +
4945
+ "</button>"
4946
+ },
4947
+ fullScreen: {
4948
+ autoStart: false
4949
+ }
4950
+ });
4951
+
4952
+ $(document).on(fn.fullscreenchange, function () {
4953
+ var isFullscreen = FullScreen.isFullscreen(),
4954
+ instance = $.fancybox.getInstance();
4955
+
4956
+ if (instance) {
4957
+ // If image is zooming, then force to stop and reposition properly
4958
+ if (instance.current && instance.current.type === "image" && instance.isAnimating) {
4959
+ instance.isAnimating = false;
4960
+
4961
+ instance.update(true, true, 0);
4962
+
4963
+ if (!instance.isComplete) {
4964
+ instance.complete();
4965
+ }
4966
+ }
4967
+
4968
+ instance.trigger("onFullscreenChange", isFullscreen);
4969
+
4970
+ instance.$refs.container.toggleClass("fancybox-is-fullscreen", isFullscreen);
4971
+
4972
+ instance.$refs.toolbar
4973
+ .find("[data-fancybox-fullscreen]")
4974
+ .toggleClass("fancybox-button--fsenter", !isFullscreen)
4975
+ .toggleClass("fancybox-button--fsexit", isFullscreen);
4976
+ }
4977
+ });
4978
+ }
4979
+
4980
+ $(document).on({
4981
+ "onInit.fb": function (e, instance) {
4982
+ var $container;
4983
+
4984
+ if (!fn) {
4985
+ instance.$refs.toolbar.find("[data-fancybox-fullscreen]").remove();
4986
+
4987
+ return;
4988
+ }
4989
+
4990
+ if (instance && instance.group[instance.currIndex].opts.fullScreen) {
4991
+ $container = instance.$refs.container;
4992
+
4993
+ $container.on("click.fb-fullscreen", "[data-fancybox-fullscreen]", function (e) {
4994
+ e.stopPropagation();
4995
+ e.preventDefault();
4996
+
4997
+ FullScreen.toggle();
4998
+ });
4999
+
5000
+ if (instance.opts.fullScreen && instance.opts.fullScreen.autoStart === true) {
5001
+ FullScreen.request();
5002
+ }
5003
+
5004
+ // Expose API
5005
+ instance.FullScreen = FullScreen;
5006
+ } else if (instance) {
5007
+ instance.$refs.toolbar.find("[data-fancybox-fullscreen]").hide();
5008
+ }
5009
+ },
5010
+
5011
+ "afterKeydown.fb": function (e, instance, current, keypress, keycode) {
5012
+ // "F"
5013
+ if (instance && instance.FullScreen && keycode === 70) {
5014
+ keypress.preventDefault();
5015
+
5016
+ instance.FullScreen.toggle();
5017
+ }
5018
+ },
5019
+
5020
+ "beforeClose.fb": function (e, instance) {
5021
+ if (instance && instance.FullScreen && instance.$refs.container.hasClass("fancybox-is-fullscreen")) {
5022
+ FullScreen.exit();
5023
+ }
5024
+ }
5025
+ });
5026
+ })(document, jQuery);
5027
+ // ==========================================================================
5028
+ //
5029
+ // Thumbs
5030
+ // Displays thumbnails in a grid
5031
+ //
5032
+ // ==========================================================================
5033
+ (function (document, $) {
5034
+ "use strict";
5035
+
5036
+ var CLASS = "fancybox-thumbs",
5037
+ CLASS_ACTIVE = CLASS + "-active";
5038
+
5039
+ // Make sure there are default values
5040
+ $.fancybox.defaults = $.extend(
5041
+ true, {
5042
+ btnTpl: {
5043
+ thumbs: '<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}">' +
5044
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg>' +
5045
+ "</button>"
5046
+ },
5047
+ thumbs: {
5048
+ autoStart: false, // Display thumbnails on opening
5049
+ hideOnClose: true, // Hide thumbnail grid when closing animation starts
5050
+ parentEl: ".fancybox-container", // Container is injected into this element
5051
+ axis: "y" // Vertical (y) or horizontal (x) scrolling
5052
+ }
5053
+ },
5054
+ $.fancybox.defaults
5055
+ );
5056
+
5057
+ var FancyThumbs = function (instance) {
5058
+ this.init(instance);
5059
+ };
5060
+
5061
+ $.extend(FancyThumbs.prototype, {
5062
+ $button: null,
5063
+ $grid: null,
5064
+ $list: null,
5065
+ isVisible: false,
5066
+ isActive: false,
5067
+
5068
+ init: function (instance) {
5069
+ var self = this,
5070
+ group = instance.group,
5071
+ enabled = 0;
5072
+
5073
+ self.instance = instance;
5074
+ self.opts = group[instance.currIndex].opts.thumbs;
5075
+
5076
+ instance.Thumbs = self;
5077
+
5078
+ self.$button = instance.$refs.toolbar.find("[data-fancybox-thumbs]");
5079
+
5080
+ // Enable thumbs if at least two group items have thumbnails
5081
+ for (var i = 0, len = group.length; i < len; i++) {
5082
+ if (group[i].thumb) {
5083
+ enabled++;
5084
+ }
5085
+
5086
+ if (enabled > 1) {
5087
+ break;
5088
+ }
5089
+ }
5090
+
5091
+ if (enabled > 1 && !!self.opts) {
5092
+ self.$button.removeAttr("style").on("click", function () {
5093
+ self.toggle();
5094
+ });
5095
+
5096
+ self.isActive = true;
5097
+ } else {
5098
+ self.$button.hide();
5099
+ }
5100
+ },
5101
+
5102
+ create: function () {
5103
+ var self = this,
5104
+ instance = self.instance,
5105
+ parentEl = self.opts.parentEl,
5106
+ list = [],
5107
+ src;
5108
+
5109
+ if (!self.$grid) {
5110
+ // Create main element
5111
+ self.$grid = $('<div class="' + CLASS + " " + CLASS + "-" + self.opts.axis + '"></div>').appendTo(
5112
+ instance.$refs.container
5113
+ .find(parentEl)
5114
+ .addBack()
5115
+ .filter(parentEl)
5116
+ );
5117
+
5118
+ // Add "click" event that performs gallery navigation
5119
+ self.$grid.on("click", "a", function () {
5120
+ instance.jumpTo($(this).attr("data-index"));
5121
+ });
5122
+ }
5123
+
5124
+ // Build the list
5125
+ if (!self.$list) {
5126
+ self.$list = $('<div class="' + CLASS + '__list">').appendTo(self.$grid);
5127
+ }
5128
+
5129
+ $.each(instance.group, function (i, item) {
5130
+ src = item.thumb;
5131
+
5132
+ if (!src && item.type === "image") {
5133
+ src = item.src;
5134
+ }
5135
+
5136
+ list.push(
5137
+ '<a href="javascript:;" tabindex="0" data-index="' +
5138
+ i +
5139
+ '"' +
5140
+ (src && src.length ? ' style="background-image:url(' + src + ')"' : 'class="fancybox-thumbs-missing"') +
5141
+ "></a>"
5142
+ );
5143
+ });
5144
+
5145
+ self.$list[0].innerHTML = list.join("");
5146
+
5147
+ if (self.opts.axis === "x") {
5148
+ // Set fixed width for list element to enable horizontal scrolling
5149
+ self.$list.width(
5150
+ parseInt(self.$grid.css("padding-right"), 10) +
5151
+ instance.group.length *
5152
+ self.$list
5153
+ .children()
5154
+ .eq(0)
5155
+ .outerWidth(true)
5156
+ );
5157
+ }
5158
+ },
5159
+
5160
+ focus: function (duration) {
5161
+ var self = this,
5162
+ $list = self.$list,
5163
+ $grid = self.$grid,
5164
+ thumb,
5165
+ thumbPos;
5166
+
5167
+ if (!self.instance.current) {
5168
+ return;
5169
+ }
5170
+
5171
+ thumb = $list
5172
+ .children()
5173
+ .removeClass(CLASS_ACTIVE)
5174
+ .filter('[data-index="' + self.instance.current.index + '"]')
5175
+ .addClass(CLASS_ACTIVE);
5176
+
5177
+ thumbPos = thumb.position();
5178
+
5179
+ // Check if need to scroll to make current thumb visible
5180
+ if (self.opts.axis === "y" && (thumbPos.top < 0 || thumbPos.top > $list.height() - thumb.outerHeight())) {
5181
+ $list.stop().animate({
5182
+ scrollTop: $list.scrollTop() + thumbPos.top
5183
+ },
5184
+ duration
5185
+ );
5186
+ } else if (
5187
+ self.opts.axis === "x" &&
5188
+ (thumbPos.left < $grid.scrollLeft() || thumbPos.left > $grid.scrollLeft() + ($grid.width() - thumb.outerWidth()))
5189
+ ) {
5190
+ $list
5191
+ .parent()
5192
+ .stop()
5193
+ .animate({
5194
+ scrollLeft: thumbPos.left
5195
+ },
5196
+ duration
5197
+ );
5198
+ }
5199
+ },
5200
+
5201
+ update: function () {
5202
+ var that = this;
5203
+ that.instance.$refs.container.toggleClass("fancybox-show-thumbs", this.isVisible);
5204
+
5205
+ if (that.isVisible) {
5206
+ if (!that.$grid) {
5207
+ that.create();
5208
+ }
5209
+
5210
+ that.instance.trigger("onThumbsShow");
5211
+
5212
+ that.focus(0);
5213
+ } else if (that.$grid) {
5214
+ that.instance.trigger("onThumbsHide");
5215
+ }
5216
+
5217
+ // Update content position
5218
+ that.instance.update();
5219
+ },
5220
+
5221
+ hide: function () {
5222
+ this.isVisible = false;
5223
+ this.update();
5224
+ },
5225
+
5226
+ show: function () {
5227
+ this.isVisible = true;
5228
+ this.update();
5229
+ },
5230
+
5231
+ toggle: function () {
5232
+ this.isVisible = !this.isVisible;
5233
+ this.update();
5234
+ }
5235
+ });
5236
+
5237
+ $(document).on({
5238
+ "onInit.fb": function (e, instance) {
5239
+ var Thumbs;
5240
+
5241
+ if (instance && !instance.Thumbs) {
5242
+ Thumbs = new FancyThumbs(instance);
5243
+
5244
+ if (Thumbs.isActive && Thumbs.opts.autoStart === true) {
5245
+ Thumbs.show();
5246
+ }
5247
+ }
5248
+ },
5249
+
5250
+ "beforeShow.fb": function (e, instance, item, firstRun) {
5251
+ var Thumbs = instance && instance.Thumbs;
5252
+
5253
+ if (Thumbs && Thumbs.isVisible) {
5254
+ Thumbs.focus(firstRun ? 0 : 250);
5255
+ }
5256
+ },
5257
+
5258
+ "afterKeydown.fb": function (e, instance, current, keypress, keycode) {
5259
+ var Thumbs = instance && instance.Thumbs;
5260
+
5261
+ // "G"
5262
+ if (Thumbs && Thumbs.isActive && keycode === 71) {
5263
+ keypress.preventDefault();
5264
+
5265
+ Thumbs.toggle();
5266
+ }
5267
+ },
5268
+
5269
+ "beforeClose.fb": function (e, instance) {
5270
+ var Thumbs = instance && instance.Thumbs;
5271
+
5272
+ if (Thumbs && Thumbs.isVisible && Thumbs.opts.hideOnClose !== false) {
5273
+ Thumbs.$grid.hide();
5274
+ }
5275
+ }
5276
+ });
5277
+ })(document, jQuery);
5278
+ //// ==========================================================================
5279
+ //
5280
+ // Share
5281
+ // Displays simple form for sharing current url
5282
+ //
5283
+ // ==========================================================================
5284
+ (function (document, $) {
5285
+ "use strict";
5286
+
5287
+ $.extend(true, $.fancybox.defaults, {
5288
+ btnTpl: {
5289
+ share: '<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}">' +
5290
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z"/></svg>' +
5291
+ "</button>"
5292
+ },
5293
+ share: {
5294
+ url: function (instance, item) {
5295
+ return (
5296
+ (!instance.currentHash && !(item.type === "inline" || item.type === "html") ? item.origSrc || item.src : false) || window.location
5297
+ );
5298
+ },
5299
+ tpl: '<div class="fancybox-share">' +
5300
+ "<h1>{{SHARE}}</h1>" +
5301
+ "<p>" +
5302
+ '<a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}">' +
5303
+ '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg>' +
5304
+ "<span>Facebook</span>" +
5305
+ "</a>" +
5306
+ '<a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}">' +
5307
+ '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg>' +
5308
+ "<span>Twitter</span>" +
5309
+ "</a>" +
5310
+ '<a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}">' +
5311
+ '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg>' +
5312
+ "<span>Pinterest</span>" +
5313
+ "</a>" +
5314
+ "</p>" +
5315
+ '<p><input class="fancybox-share__input" type="text" value="{{url_raw}}" onclick="select()" /></p>' +
5316
+ "</div>"
5317
+ }
5318
+ });
5319
+
5320
+ function escapeHtml(string) {
5321
+ var entityMap = {
5322
+ "&": "&amp;",
5323
+ "<": "&lt;",
5324
+ ">": "&gt;",
5325
+ '"': "&quot;",
5326
+ "'": "&#39;",
5327
+ "/": "&#x2F;",
5328
+ "`": "&#x60;",
5329
+ "=": "&#x3D;"
5330
+ };
5331
+
5332
+ return String(string).replace(/[&<>"'`=\/]/g, function (s) {
5333
+ return entityMap[s];
5334
+ });
5335
+ }
5336
+
5337
+ $(document).on("click", "[data-fancybox-share]", function () {
5338
+ var instance = $.fancybox.getInstance(),
5339
+ current = instance.current || null,
5340
+ url,
5341
+ tpl;
5342
+
5343
+ if (!current) {
5344
+ return;
5345
+ }
5346
+
5347
+ if ($.type(current.opts.share.url) === "function") {
5348
+ url = current.opts.share.url.apply(current, [instance, current]);
5349
+ }
5350
+
5351
+ tpl = current.opts.share.tpl
5352
+ .replace(/\{\{media\}\}/g, current.type === "image" ? encodeURIComponent(current.src) : "")
5353
+ .replace(/\{\{url\}\}/g, encodeURIComponent(url))
5354
+ .replace(/\{\{url_raw\}\}/g, escapeHtml(url))
5355
+ .replace(/\{\{descr\}\}/g, instance.$caption ? encodeURIComponent(instance.$caption.text()) : "");
5356
+
5357
+ $.fancybox.open({
5358
+ src: instance.translate(instance, tpl),
5359
+ type: "html",
5360
+ opts: {
5361
+ touch: false,
5362
+ animationEffect: false,
5363
+ afterLoad: function (shareInstance, shareCurrent) {
5364
+ // Close self if parent instance is closing
5365
+ instance.$refs.container.one("beforeClose.fb", function () {
5366
+ shareInstance.close(null, 0);
5367
+ });
5368
+
5369
+ // Opening links in a popup window
5370
+ shareCurrent.$content.find(".fancybox-share__button").click(function () {
5371
+ window.open(this.href, "Share", "width=550, height=450");
5372
+ return false;
5373
+ });
5374
+ },
5375
+ mobile: {
5376
+ autoFocus: false
5377
+ }
5378
+ }
5379
+ });
5380
+ });
5381
+ })(document, jQuery);
5382
+ // ==========================================================================
5383
+ //
5384
+ // Hash
5385
+ // Enables linking to each modal
5386
+ //
5387
+ // ==========================================================================
5388
+ (function (window, document, $) {
5389
+ "use strict";
5390
+
5391
+ // Simple $.escapeSelector polyfill (for jQuery prior v3)
5392
+ if (!$.escapeSelector) {
5393
+ $.escapeSelector = function (sel) {
5394
+ var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
5395
+ var fcssescape = function (ch, asCodePoint) {
5396
+ if (asCodePoint) {
5397
+ // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
5398
+ if (ch === "\0") {
5399
+ return "\uFFFD";
5400
+ }
5401
+
5402
+ // Control characters and (dependent upon position) numbers get escaped as code points
5403
+ return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
5404
+ }
5405
+
5406
+ // Other potentially-special ASCII characters get backslash-escaped
5407
+ return "\\" + ch;
5408
+ };
5409
+
5410
+ return (sel + "").replace(rcssescape, fcssescape);
5411
+ };
5412
+ }
5413
+
5414
+ // Get info about gallery name and current index from url
5415
+ function parseUrl() {
5416
+ var hash = window.location.hash.substr(1),
5417
+ rez = hash.split("-"),
5418
+ index = rez.length > 1 && /^\+?\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,
5419
+ gallery = rez.join("-");
5420
+
5421
+ return {
5422
+ hash: hash,
5423
+ /* Index is starting from 1 */
5424
+ index: index < 1 ? 1 : index,
5425
+ gallery: gallery
5426
+ };
5427
+ }
5428
+
5429
+ // Trigger click evnt on links to open new fancyBox instance
5430
+ function triggerFromUrl(url) {
5431
+ if (url.gallery !== "") {
5432
+ // If we can find element matching 'data-fancybox' atribute,
5433
+ // then triggering click event should start fancyBox
5434
+ $("[data-fancybox='" + $.escapeSelector(url.gallery) + "']")
5435
+ .eq(url.index - 1)
5436
+ .focus()
5437
+ .trigger("click.fb-start");
5438
+ }
5439
+ }
5440
+
5441
+ // Get gallery name from current instance
5442
+ function getGalleryID(instance) {
5443
+ var opts, ret;
5444
+
5445
+ if (!instance) {
5446
+ return false;
5447
+ }
5448
+
5449
+ opts = instance.current ? instance.current.opts : instance.opts;
5450
+ ret = opts.hash || (opts.$orig ? opts.$orig.data("fancybox") || opts.$orig.data("fancybox-trigger") : "");
5451
+
5452
+ return ret === "" ? false : ret;
5453
+ }
5454
+
5455
+ // Start when DOM becomes ready
5456
+ $(function () {
5457
+ // Check if user has disabled this module
5458
+ if ($.fancybox.defaults.hash === false) {
5459
+ return;
5460
+ }
5461
+
5462
+ // Update hash when opening/closing fancyBox
5463
+ $(document).on({
5464
+ "onInit.fb": function (e, instance) {
5465
+ var url, gallery;
5466
+
5467
+ if (instance.group[instance.currIndex].opts.hash === false) {
5468
+ return;
5469
+ }
5470
+
5471
+ url = parseUrl();
5472
+ gallery = getGalleryID(instance);
5473
+
5474
+ // Make sure gallery start index matches index from hash
5475
+ if (gallery && url.gallery && gallery == url.gallery) {
5476
+ instance.currIndex = url.index - 1;
5477
+ }
5478
+ },
5479
+
5480
+ "beforeShow.fb": function (e, instance, current, firstRun) {
5481
+ var gallery;
5482
+
5483
+ if (!current || current.opts.hash === false) {
5484
+ return;
5485
+ }
5486
+
5487
+ // Check if need to update window hash
5488
+ gallery = getGalleryID(instance);
5489
+
5490
+ if (!gallery) {
5491
+ return;
5492
+ }
5493
+
5494
+ // Variable containing last hash value set by fancyBox
5495
+ // It will be used to determine if fancyBox needs to close after hash change is detected
5496
+ instance.currentHash = gallery + (instance.group.length > 1 ? "-" + (current.index + 1) : "");
5497
+
5498
+ // If current hash is the same (this instance most likely is opened by hashchange), then do nothing
5499
+ if (window.location.hash === "#" + instance.currentHash) {
5500
+ return;
5501
+ }
5502
+
5503
+ if (firstRun && !instance.origHash) {
5504
+ instance.origHash = window.location.hash;
5505
+ }
5506
+
5507
+ if (instance.hashTimer) {
5508
+ clearTimeout(instance.hashTimer);
5509
+ }
5510
+
5511
+ // Update hash
5512
+ instance.hashTimer = setTimeout(function () {
5513
+ if ("replaceState" in window.history) {
5514
+ window.history[firstRun ? "pushState" : "replaceState"]({},
5515
+ document.title,
5516
+ window.location.pathname + window.location.search + "#" + instance.currentHash
5517
+ );
5518
+
5519
+ if (firstRun) {
5520
+ instance.hasCreatedHistory = true;
5521
+ }
5522
+ } else {
5523
+ window.location.hash = instance.currentHash;
5524
+ }
5525
+
5526
+ instance.hashTimer = null;
5527
+ }, 300);
5528
+ },
5529
+
5530
+ "beforeClose.fb": function (e, instance, current) {
5531
+ if (!current || current.opts.hash === false) {
5532
+ return;
5533
+ }
5534
+
5535
+ clearTimeout(instance.hashTimer);
5536
+
5537
+ // Goto previous history entry
5538
+ if (instance.currentHash && instance.hasCreatedHistory) {
5539
+ window.history.back();
5540
+ } else if (instance.currentHash) {
5541
+ if ("replaceState" in window.history) {
5542
+ window.history.replaceState({}, document.title, window.location.pathname + window.location.search + (instance.origHash || ""));
5543
+ } else {
5544
+ window.location.hash = instance.origHash;
5545
+ }
5546
+ }
5547
+
5548
+ instance.currentHash = null;
5549
+ }
5550
+ });
5551
+
5552
+ // Check if need to start/close after url has changed
5553
+ $(window).on("hashchange.fb", function () {
5554
+ var url = parseUrl(),
5555
+ fb = null;
5556
+
5557
+ // Find last fancyBox instance that has "hash"
5558
+ $.each(
5559
+ $(".fancybox-container")
5560
+ .get()
5561
+ .reverse(),
5562
+ function (index, value) {
5563
+ var tmp = $(value).data("FancyBox");
5564
+
5565
+ if (tmp && tmp.currentHash) {
5566
+ fb = tmp;
5567
+ return false;
5568
+ }
5569
+ }
5570
+ );
5571
+
5572
+ if (fb) {
5573
+ // Now, compare hash values
5574
+ if (fb.currentHash !== url.gallery + "-" + url.index && !(url.index === 1 && fb.currentHash == url.gallery)) {
5575
+ fb.currentHash = null;
5576
+
5577
+ fb.close();
5578
+ }
5579
+ } else if (url.gallery !== "") {
5580
+ triggerFromUrl(url);
5581
+ }
5582
+ });
5583
+
5584
+ // Check current hash and trigger click event on matching element to start fancyBox, if needed
5585
+ setTimeout(function () {
5586
+ if (!$.fancybox.getInstance()) {
5587
+ triggerFromUrl(parseUrl());
5588
+ }
5589
+ }, 50);
5590
+ });
5591
+ })(window, document, jQuery);
5592
+ // ==========================================================================
5593
+ //
5594
+ // Wheel
5595
+ // Basic mouse weheel support for gallery navigation
5596
+ //
5597
+ // ==========================================================================
5598
+ (function (document, $) {
5599
+ "use strict";
5600
+
5601
+ var prevTime = new Date().getTime();
5602
+
5603
+ $(document).on({
5604
+ "onInit.fb": function (e, instance, current) {
5605
+ instance.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll", function (e) {
5606
+ var current = instance.current,
5607
+ currTime = new Date().getTime();
5608
+
5609
+ if (instance.group.length < 2 || current.opts.wheel === false || (current.opts.wheel === "auto" && current.type !== "image")) {
5610
+ return;
5611
+ }
5612
+
5613
+ e.preventDefault();
5614
+ e.stopPropagation();
5615
+
5616
+ if (current.$slide.hasClass("fancybox-animated")) {
5617
+ return;
5618
+ }
5619
+
5620
+ e = e.originalEvent || e;
5621
+
5622
+ if (currTime - prevTime < 250) {
5623
+ return;
5624
+ }
5625
+
5626
+ prevTime = currTime;
5627
+
5628
+ instance[(-e.deltaY || -e.deltaX || e.wheelDelta || -e.detail) < 0 ? "next" : "previous"]();
5629
+ });
5630
+ }
5631
+ });
5632
+ })(document, jQuery);
fancybox/3.5.7/jquery.fancybox.min.css ADDED
@@ -0,0 +1 @@
 
1
+ body.compensate-for-scrollbar{overflow:hidden;}.fancybox-active{height:auto;}.fancybox-is-hidden{left:-9999px;margin:0;position:absolute!important;top:-9999px;visibility:hidden;}.fancybox-container{-webkit-backface-visibility:hidden;height:100%;left:0;outline:none;position:fixed;-webkit-tap-highlight-color:transparent;top:0;-ms-touch-action:manipulation;touch-action:manipulation;transform:translateZ(0);width:100%;z-index:99992;}.fancybox-container *{box-sizing:border-box;}.fancybox-outer,.fancybox-inner,.fancybox-bg,.fancybox-stage{bottom:0;left:0;position:absolute;right:0;top:0;}.fancybox-outer{-webkit-overflow-scrolling:touch;overflow-y:auto;}.fancybox-bg{background:rgb(30,30,30);opacity:0;transition-duration:inherit;transition-property:opacity;transition-timing-function:cubic-bezier(.47,0,.74,.71);}.fancybox-is-open .fancybox-bg{opacity:.9;transition-timing-function:cubic-bezier(.22,.61,.36,1);}.fancybox-infobar,.fancybox-toolbar,.fancybox-caption,.fancybox-navigation .fancybox-button{direction:ltr;opacity:0;position:absolute;transition:opacity .25s ease,visibility 0s ease .25s;visibility:hidden;z-index:99997;}.fancybox-show-infobar .fancybox-infobar,.fancybox-show-toolbar .fancybox-toolbar,.fancybox-show-caption .fancybox-caption,.fancybox-show-nav .fancybox-navigation .fancybox-button{opacity:1;transition:opacity .25s ease 0s,visibility 0s ease 0s;visibility:visible;}.fancybox-infobar{color:#ccc;font-size:13px;-webkit-font-smoothing:subpixel-antialiased;height:44px;left:0;line-height:44px;min-width:44px;mix-blend-mode:difference;padding:0 10px;pointer-events:none;top:0;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.fancybox-toolbar{right:0;top:0;}.fancybox-stage{direction:ltr;overflow:visible;transform:translateZ(0);z-index:99994;}.fancybox-is-open .fancybox-stage{overflow:hidden;}.fancybox-slide{-webkit-backface-visibility:hidden;display:none;height:100%;left:0;outline:none;overflow:auto;-webkit-overflow-scrolling:touch;padding:44px;position:absolute;text-align:center;top:0;transition-property:transform,opacity;white-space:normal;width:100%;z-index:99994;}.fancybox-slide::before{content:'';display:inline-block;font-size:0;height:100%;vertical-align:middle;width:0;}.fancybox-is-sliding .fancybox-slide,.fancybox-slide--previous,.fancybox-slide--current,.fancybox-slide--next{display:block;}.fancybox-slide--image{overflow:hidden;padding:44px 0;}.fancybox-slide--image::before{display:none;}.fancybox-slide--html{padding:6px;}.fancybox-content{background:#fff;display:inline-block;margin:0;max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch;padding:44px;position:relative;text-align:left;vertical-align:middle;}.fancybox-slide--image .fancybox-content{animation-timing-function:cubic-bezier(.5,0,.14,1);-webkit-backface-visibility:hidden;background:transparent;background-repeat:no-repeat;background-size:100% 100%;left:0;max-width:none;overflow:visible;padding:0;position:absolute;top:0;-ms-transform-origin:top left;transform-origin:top left;transition-property:transform,opacity;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:99995;}.fancybox-can-zoomOut .fancybox-content{cursor:zoom-out;}.fancybox-can-zoomIn .fancybox-content{cursor:zoom-in;}.fancybox-can-swipe .fancybox-content,.fancybox-can-pan .fancybox-content{cursor:-webkit-grab;cursor:grab;}.fancybox-is-grabbing .fancybox-content{cursor:-webkit-grabbing;cursor:grabbing;}.fancybox-container [data-selectable='true']{cursor:text;}.fancybox-image,.fancybox-spaceball{background:transparent;border:0;height:100%;left:0;margin:0;max-height:none;max-width:none;padding:0;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;}.fancybox-spaceball{z-index:1;}.fancybox-slide--video .fancybox-content,.fancybox-slide--map .fancybox-content,.fancybox-slide--pdf .fancybox-content,.fancybox-slide--iframe .fancybox-content{height:100%;overflow:visible;padding:0;width:100%;}.fancybox-slide--video .fancybox-content{background:#000;}.fancybox-slide--map .fancybox-content{background:#e5e3df;}.fancybox-slide--iframe .fancybox-content{background:#fff;}.fancybox-video,.fancybox-iframe{background:transparent;border:0;display:block;height:100%;margin:0;overflow:hidden;padding:0;width:100%;}.fancybox-iframe{left:0;position:absolute;top:0;}.fancybox-error{background:#fff;cursor:default;max-width:400px;padding:40px;width:100%;}.fancybox-error p{color:#444;font-size:16px;line-height:20px;margin:0;padding:0;}.fancybox-button{background:rgba(30,30,30,.6);border:0;border-radius:0;box-shadow:none;cursor:pointer;display:inline-block;height:44px;margin:0;padding:10px;position:relative;transition:color .2s;vertical-align:top;visibility:inherit;width:44px;}.fancybox-button,.fancybox-button:visited,.fancybox-button:link{color:#ccc;}.fancybox-button:hover{color:#fff;}.fancybox-button:focus{outline:none;}.fancybox-button.fancybox-focus{outline:1px dotted;}.fancybox-button[disabled],.fancybox-button[disabled]:hover{color:#888;cursor:default;outline:none;}.fancybox-button div{height:100%;}.fancybox-button svg{display:block;height:100%;overflow:visible;position:relative;width:100%;}.fancybox-button svg path{fill:currentColor;stroke-width:0;}.fancybox-button--play svg:nth-child(2),.fancybox-button--fsenter svg:nth-child(2){display:none;}.fancybox-button--pause svg:nth-child(1),.fancybox-button--fsexit svg:nth-child(1){display:none;}.fancybox-progress{background:#ff5268;height:2px;left:0;position:absolute;right:0;top:0;-ms-transform:scaleX(0);transform:scaleX(0);-ms-transform-origin:0;transform-origin:0;transition-property:transform;transition-timing-function:linear;z-index:99998;}.fancybox-close-small{background:transparent;border:0;border-radius:0;color:#ccc;cursor:pointer;opacity:.8;padding:8px;position:absolute;right:-12px;top:-44px;z-index:401;}.fancybox-close-small:hover{color:#fff;opacity:1;}.fancybox-slide--html .fancybox-close-small{color:currentColor;padding:10px;right:0;top:0;}.fancybox-slide--image.fancybox-is-scaling .fancybox-content{overflow:hidden;}.fancybox-is-scaling .fancybox-close-small,.fancybox-is-zoomable.fancybox-can-pan .fancybox-close-small{display:none;}.fancybox-navigation .fancybox-button{background-clip:content-box;height:100px;opacity:0;position:absolute;top:calc(50% - 50px);width:70px;}.fancybox-navigation .fancybox-button div{padding:7px;}.fancybox-navigation .fancybox-button--arrow_left{left:0;left:env(safe-area-inset-left);padding:31px 26px 31px 6px;}.fancybox-navigation .fancybox-button--arrow_right{padding:31px 6px 31px 26px;right:0;right:env(safe-area-inset-right);}.fancybox-caption{background:linear-gradient(to top,rgba(0,0,0,.85) 0%,rgba(0,0,0,.3) 50%,rgba(0,0,0,.15) 65%,rgba(0,0,0,.075) 75.5%,rgba(0,0,0,.037) 82.85%,rgba(0,0,0,.019) 88%,rgba(0,0,0,0) 100%);bottom:0;color:#eee;font-size:14px;font-weight:400;left:0;line-height:1.5;padding:75px 44px 25px 44px;pointer-events:none;right:0;text-align:center;z-index:99996;}@supports (padding:max(0)){.fancybox-caption{padding:75px max(44px,env(safe-area-inset-right)) max(25px,env(safe-area-inset-bottom)) max(44px,env(safe-area-inset-left))}}.fancybox-caption--separate{margin-top:-50px;}.fancybox-caption__body{max-height:50vh;overflow:auto;pointer-events:all;}.fancybox-caption a,.fancybox-caption a:link,.fancybox-caption a:visited{color:#ccc;text-decoration:none;}.fancybox-caption a:hover{color:#fff;text-decoration:underline;}.fancybox-loading{animation:fancybox-rotate 1s linear infinite;background:transparent;border:4px solid #888;border-bottom-color:#fff;border-radius:50%;height:50px;left:50%;margin:-25px 0 0 -25px;opacity:.7;padding:0;position:absolute;top:50%;width:50px;z-index:99999;}@keyframes fancybox-rotate{100%{transform:rotate(360deg)}}.fancybox-animated{transition-timing-function:cubic-bezier(0,0,.25,1);}.fancybox-fx-slide.fancybox-slide--previous{opacity:0;transform:translate3d(-100%,0,0);}.fancybox-fx-slide.fancybox-slide--next{opacity:0;transform:translate3d(100%,0,0);}.fancybox-fx-slide.fancybox-slide--current{opacity:1;transform:translate3d(0,0,0);}.fancybox-fx-fade.fancybox-slide--previous,.fancybox-fx-fade.fancybox-slide--next{opacity:0;transition-timing-function:cubic-bezier(.19,1,.22,1);}.fancybox-fx-fade.fancybox-slide--current{opacity:1;}.fancybox-fx-zoom-in-out.fancybox-slide--previous{opacity:0;transform:scale3d(1.5,1.5,1.5);}.fancybox-fx-zoom-in-out.fancybox-slide--next{opacity:0;transform:scale3d(.5,.5,.5);}.fancybox-fx-zoom-in-out.fancybox-slide--current{opacity:1;transform:scale3d(1,1,1);}.fancybox-fx-rotate.fancybox-slide--previous{opacity:0;-ms-transform:rotate(-360deg);transform:rotate(-360deg);}.fancybox-fx-rotate.fancybox-slide--next{opacity:0;-ms-transform:rotate(360deg);transform:rotate(360deg);}.fancybox-fx-rotate.fancybox-slide--current{opacity:1;-ms-transform:rotate(0deg);transform:rotate(0deg);}.fancybox-fx-circular.fancybox-slide--previous{opacity:0;transform:scale3d(0,0,0) translate3d(-100%,0,0);}.fancybox-fx-circular.fancybox-slide--next{opacity:0;transform:scale3d(0,0,0) translate3d(100%,0,0);}.fancybox-fx-circular.fancybox-slide--current{opacity:1;transform:scale3d(1,1,1) translate3d(0,0,0);}.fancybox-fx-tube.fancybox-slide--previous{transform:translate3d(-100%,0,0) scale(.1) skew(-10deg);}.fancybox-fx-tube.fancybox-slide--next{transform:translate3d(100%,0,0) scale(.1) skew(10deg);}.fancybox-fx-tube.fancybox-slide--current{transform:translate3d(0,0,0) scale(1);}@media all and (max-height:576px){.fancybox-slide{padding-left:6px;padding-right:6px}.fancybox-slide--image{padding:6px 0}.fancybox-close-small{right:-6px}.fancybox-slide--image .fancybox-close-small{background:#4e4e4e;color:#f2f4f6;height:36px;opacity:1;padding:6px;right:0;top:0;width:36px}.fancybox-caption{padding-left:12px;padding-right:12px}@supports (padding:max(0)){.fancybox-caption{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}}}.fancybox-share{background:#f4f4f4;border-radius:3px;max-width:90%;padding:30px;text-align:center;}.fancybox-share h1{color:#222;font-size:35px;font-weight:700;margin:0 0 20px 0;}.fancybox-share p{margin:0;padding:0;}.fancybox-share__button{border:0;border-radius:3px;display:inline-block;font-size:14px;font-weight:700;line-height:40px;margin:0 5px 10px 5px;min-width:130px;padding:0 15px;text-decoration:none;transition:all .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;}.fancybox-share__button:visited,.fancybox-share__button:link{color:#fff;}.fancybox-share__button:hover{text-decoration:none;}.fancybox-share__button--fb{background:#3b5998;}.fancybox-share__button--fb:hover{background:#344e86;}.fancybox-share__button--pt{background:#bd081d;}.fancybox-share__button--pt:hover{background:#aa0719;}.fancybox-share__button--tw{background:#1da1f2;}.fancybox-share__button--tw:hover{background:#0d95e8;}.fancybox-share__button svg{height:25px;margin-right:7px;position:relative;top:-1px;vertical-align:middle;width:25px;}.fancybox-share__button svg path{fill:#fff;}.fancybox-share__input{background:transparent;border:0;border-bottom:1px solid #d7d7d7;border-radius:0;color:#5d5b5b;font-size:14px;margin:10px 0 0 0;outline:none;padding:10px 15px;width:100%;}.fancybox-thumbs{background:#ddd;bottom:0;display:none;margin:0;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;padding:2px 2px 4px 2px;position:absolute;right:0;-webkit-tap-highlight-color:rgba(0,0,0,0);top:0;width:212px;z-index:99995;}.fancybox-thumbs-x{overflow-x:auto;overflow-y:hidden;}.fancybox-show-thumbs .fancybox-thumbs{display:block;}.fancybox-show-thumbs .fancybox-inner{right:212px;}.fancybox-thumbs__list{font-size:0;height:100%;list-style:none;margin:0;overflow-x:hidden;overflow-y:auto;padding:0;position:absolute;position:relative;white-space:nowrap;width:100%;}.fancybox-thumbs-x .fancybox-thumbs__list{overflow:hidden;}.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar{width:7px;}.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-track{background:#fff;border-radius:10px;box-shadow:inset 0 0 6px rgba(0,0,0,.3);}.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-thumb{background:#2a2a2a;border-radius:10px;}.fancybox-thumbs__list a{-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:rgba(0,0,0,.1);background-position:center center;background-repeat:no-repeat;background-size:cover;cursor:pointer;float:left;height:75px;margin:2px;max-height:calc(100% - 8px);max-width:calc(50% - 4px);outline:none;overflow:hidden;padding:0;position:relative;-webkit-tap-highlight-color:transparent;width:100px;}.fancybox-thumbs__list a::before{border:6px solid #ff5268;bottom:0;content:'';left:0;opacity:0;position:absolute;right:0;top:0;transition:all .2s cubic-bezier(.25,.46,.45,.94);z-index:99991;}.fancybox-thumbs__list a:focus::before{opacity:.5;}.fancybox-thumbs__list a.fancybox-thumbs-active::before{opacity:1;}@media all and (max-width:576px){.fancybox-thumbs{width:110px}.fancybox-show-thumbs .fancybox-inner{right:110px}.fancybox-thumbs__list a{max-width:calc(100% - 10px)}}
fancybox/3.5.7/jquery.fancybox.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t,e,n,o){"use strict";if(t.console=t.console||{info:function(t){}},n&&!n.fn.fancybox){var a,i,s,r,c={closeExisting:!1,loop:!1,gutter:50,keyboard:!0,preventCaptionOverlap:!0,arrows:!0,infobar:!0,smallBtn:"auto",toolbar:"auto",buttons:["zoom","slideShow","thumbs","close"],idleTime:3,protect:!1,modal:!1,image:{preload:!1},ajax:{settings:{data:{fancybox:!0}}},iframe:{tpl:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allowfullscreen="allowfullscreen" allow="autoplay; fullscreen" src=""></iframe>',preload:!0,css:{},attr:{scrolling:"auto"}},video:{tpl:'<video class="fancybox-video" controls controlsList="nodownload" poster="{{poster}}"><source src="{{src}}" type="{{format}}" />Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player!</video>',format:"",autoStart:!0},defaultType:"image",animationEffect:"zoom",animationDuration:366,zoomOpacity:"auto",transitionEffect:"fade",transitionDuration:366,slideClass:"",baseClass:"",baseTpl:'<div class="fancybox-container" role="dialog" tabindex="-1"><div class="fancybox-bg"></div><div class="fancybox-inner"><div class="fancybox-infobar"><span data-fancybox-index></span>&nbsp;/&nbsp;<span data-fancybox-count></span></div><div class="fancybox-toolbar">{{buttons}}</div><div class="fancybox-navigation">{{arrows}}</div><div class="fancybox-stage"></div><div class="fancybox-caption"><div class="fancybox-caption__body"></div></div></div></div>',spinnerTpl:'<div class="fancybox-loading"></div>',errorTpl:'<div class="fancybox-error"><p>{{ERROR}}</p></div>',btnTpl:{download:'<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z"/></svg></a>',zoom:'<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z"/></svg></button>',close:'<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z"/></svg></button>',arrowLeft:'<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z"/></svg></div></button>',arrowRight:'<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z"/></svg></div></button>',smallBtn:'<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"/></svg></button>'},parentEl:"body",hideScrollbar:!0,autoFocus:!0,backFocus:!0,trapFocus:!0,fullScreen:{autoStart:!1},touch:{vertical:!0,momentum:!0},hash:null,media:{},slideShow:{autoStart:!1,speed:3e3},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"},wheel:"auto",onInit:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeClose:n.noop,afterClose:n.noop,onActivate:n.noop,onDeactivate:n.noop,clickContent:function(t,e){return"image"===t.type&&"zoom"},clickSlide:"close",clickOutside:"close",dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1,mobile:{preventCaptionOverlap:!1,idleTime:!1,clickContent:function(t,e){return"image"===t.type&&"toggleControls"},clickSlide:function(t,e){return"image"===t.type?"toggleControls":"close"},dblclickContent:function(t,e){return"image"===t.type&&"zoom"},dblclickSlide:function(t,e){return"image"===t.type&&"zoom"}},lang:"en",i18n:{en:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",ERROR:"The requested content cannot be loaded. <br/> Please try again later.",PLAY_START:"Start slideshow",PLAY_STOP:"Pause slideshow",FULL_SCREEN:"Full screen",THUMBS:"Thumbnails",DOWNLOAD:"Download",SHARE:"Share",ZOOM:"Zoom"},de:{CLOSE:"Schlie&szlig;en",NEXT:"Weiter",PREV:"Zur&uuml;ck",ERROR:"Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es sp&auml;ter nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder",DOWNLOAD:"Herunterladen",SHARE:"Teilen",ZOOM:"Vergr&ouml;&szlig;ern"}}},l=n(t),d=n(e),u=0,p=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)},f=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)},h=function(){var t,n=e.createElement("fakeelement"),a={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in a)if(n.style[t]!==o)return a[t];return"transitionend"}(),g=function(t){return t&&t.length&&t[0].offsetHeight},b=function(t,e){var o=n.extend(!0,{},t,e);return n.each(e,(function(t,e){n.isArray(e)&&(o[t]=e)})),o},m=function(t,e,o){var a=this;a.opts=b({index:o},n.fancybox.defaults),n.isPlainObject(e)&&(a.opts=b(a.opts,e)),n.fancybox.isMobile&&(a.opts=b(a.opts,a.opts.mobile)),a.id=a.opts.id||++u,a.currIndex=parseInt(a.opts.index,10)||0,a.prevIndex=null,a.prevPos=null,a.currPos=0,a.firstRun=!0,a.group=[],a.slides={},a.addContent(t),a.group.length&&a.init()};n.extend(m.prototype,{init:function(){var o,a,i=this,s=i.group[i.currIndex].opts;s.closeExisting&&n.fancybox.close(!0),n("body").addClass("fancybox-active"),!n.fancybox.getInstance()&&!1!==s.hideScrollbar&&!n.fancybox.isMobile&&e.body.scrollHeight>t.innerHeight&&(n("head").append('<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:'+(t.innerWidth-e.documentElement.clientWidth)+"px;}</style>"),n("body").addClass("compensate-for-scrollbar")),a="",n.each(s.buttons,(function(t,e){a+=s.btnTpl[e]||""})),o=n(i.translate(i,s.baseTpl.replace("{{buttons}}",a).replace("{{arrows}}",s.btnTpl.arrowLeft+s.btnTpl.arrowRight))).attr("id","fancybox-container-"+i.id).addClass(s.baseClass).data("FancyBox",i).appendTo(s.parentEl),i.$refs={container:o},["bg","inner","infobar","toolbar","stage","caption","navigation"].forEach((function(t){i.$refs[t]=o.find(".fancybox-"+t)})),i.trigger("onInit"),i.activate(),i.jumpTo(i.currIndex)},translate:function(t,e){var n=t.opts.i18n[t.opts.lang]||t.opts.i18n.en;return e.replace(/\{\{(\w+)\}\}/g,(function(t,e){return n[e]===o?t:n[e]}))},addContent:function(t){var e,a=this,i=n.makeArray(t);n.each(i,(function(t,e){var i,s,r,c,l,d={},u={};n.isPlainObject(e)?(d=e,u=e.opts||e):"object"===n.type(e)&&n(e).length?(u=(i=n(e)).data()||{},(u=n.extend(!0,{},u,u.options)).$orig=i,d.src=a.opts.src||u.src||i.attr("href"),d.type||d.src||(d.type="inline",d.src=e)):d={type:"html",src:e+""},d.opts=n.extend(!0,{},a.opts,u),n.isArray(u.buttons)&&(d.opts.buttons=u.buttons),n.fancybox.isMobile&&d.opts.mobile&&(d.opts=b(d.opts,d.opts.mobile)),s=d.type||d.opts.type,c=d.src||"",!s&&c&&((r=c.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(s="video",d.opts.video.format||(d.opts.video.format="video/"+("ogv"===r[1]?"ogg":r[1]))):c.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?s="image":c.match(/\.(pdf)((\?|#).*)?$/i)?(s="iframe",d=n.extend(!0,d,{contentType:"pdf",opts:{iframe:{preload:!1}}})):"#"===c.charAt(0)&&(s="inline")),s?d.type=s:a.trigger("objectNeedsType",d),d.contentType||(d.contentType=n.inArray(d.type,["html","inline","ajax"])>-1?"html":d.type),d.index=a.group.length,"auto"==d.opts.smallBtn&&(d.opts.smallBtn=n.inArray(d.type,["html","inline","ajax"])>-1),"auto"===d.opts.toolbar&&(d.opts.toolbar=!d.opts.smallBtn),d.$thumb=d.opts.$thumb||null,d.opts.$trigger&&d.index===a.opts.index&&(d.$thumb=d.opts.$trigger.find("img:first"),d.$thumb.length&&(d.opts.$orig=d.opts.$trigger)),d.$thumb&&d.$thumb.length||!d.opts.$orig||(d.$thumb=d.opts.$orig.find("img:first")),d.$thumb&&!d.$thumb.length&&(d.$thumb=null),d.thumb=d.opts.thumb||(d.$thumb?d.$thumb[0].src:null),"function"===n.type(d.opts.caption)&&(d.opts.caption=d.opts.caption.apply(e,[a,d])),"function"===n.type(a.opts.caption)&&(d.opts.caption=a.opts.caption.apply(e,[a,d])),d.opts.caption instanceof n||(d.opts.caption=d.opts.caption===o?"":d.opts.caption+""),"ajax"===d.type&&(l=c.split(/\s+/,2)).length>1&&(d.src=l.shift(),d.opts.filter=l.shift()),d.opts.modal&&(d.opts=n.extend(!0,d.opts,{trapFocus:!0,infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})),a.group.push(d)})),Object.keys(a.slides).length&&(a.updateControls(),(e=a.Thumbs)&&e.isActive&&(e.create(),e.focus()))},addEvents:function(){var e=this;e.removeEvents(),e.$refs.container.on("click.fb-close","[data-fancybox-close]",(function(t){t.stopPropagation(),t.preventDefault(),e.close(t)})).on("touchstart.fb-prev click.fb-prev","[data-fancybox-prev]",(function(t){t.stopPropagation(),t.preventDefault(),e.previous()})).on("touchstart.fb-next click.fb-next","[data-fancybox-next]",(function(t){t.stopPropagation(),t.preventDefault(),e.next()})).on("click.fb","[data-fancybox-zoom]",(function(t){e[e.isScaledDown()?"scaleToActual":"scaleToFit"]()})),l.on("orientationchange.fb resize.fb",(function(t){t&&t.originalEvent&&"resize"===t.originalEvent.type?(e.requestId&&f(e.requestId),e.requestId=p((function(){e.update(t)}))):(e.current&&"iframe"===e.current.type&&e.$refs.stage.hide(),setTimeout((function(){e.$refs.stage.show(),e.update(t)}),n.fancybox.isMobile?600:250))})),d.on("keydown.fb",(function(t){var o=(n.fancybox?n.fancybox.getInstance():null).current,a=t.keyCode||t.which;if(9!=a){if(!(!o.opts.keyboard||t.ctrlKey||t.altKey||t.shiftKey||n(t.target).is("input,textarea,video,audio,select")))return 8===a||27===a?(t.preventDefault(),void e.close(t)):37===a||38===a?(t.preventDefault(),void e.previous()):39===a||40===a?(t.preventDefault(),void e.next()):void e.trigger("afterKeydown",t,a)}else o.opts.trapFocus&&e.focus(t)})),e.group[e.currIndex].opts.idleTime&&(e.idleSecondsCounter=0,d.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",(function(t){e.idleSecondsCounter=0,e.isIdle&&e.showControls(),e.isIdle=!1})),e.idleInterval=t.setInterval((function(){e.idleSecondsCounter++,e.idleSecondsCounter>=e.group[e.currIndex].opts.idleTime&&!e.isDragging&&(e.isIdle=!0,e.idleSecondsCounter=0,e.hideControls())}),1e3))},removeEvents:function(){var e=this;l.off("orientationchange.fb resize.fb"),d.off("keydown.fb .fb-idle"),this.$refs.container.off(".fb-close .fb-prev .fb-next"),e.idleInterval&&(t.clearInterval(e.idleInterval),e.idleInterval=null)},previous:function(t){return this.jumpTo(this.currPos-1,t)},next:function(t){return this.jumpTo(this.currPos+1,t)},jumpTo:function(t,e){var a,i,s,r,c,l,d,u,p,f=this,h=f.group.length;if(!(f.isDragging||f.isClosing||f.isAnimating&&f.firstRun)){if(t=parseInt(t,10),!(s=f.current?f.current.opts.loop:f.opts.loop)&&(t<0||t>=h))return!1;if(a=f.firstRun=!Object.keys(f.slides).length,c=f.current,f.prevIndex=f.currIndex,f.prevPos=f.currPos,r=f.createSlide(t),h>1&&((s||r.index<h-1)&&f.createSlide(t+1),(s||r.index>0)&&f.createSlide(t-1)),f.current=r,f.currIndex=r.index,f.currPos=r.pos,f.trigger("beforeShow",a),f.updateControls(),r.forcedDuration=o,n.isNumeric(e)?r.forcedDuration=e:e=r.opts[a?"animationDuration":"transitionDuration"],e=parseInt(e,10),i=f.isMoved(r),r.$slide.addClass("fancybox-slide--current"),a)return r.opts.animationEffect&&e&&f.$refs.container.css("transition-duration",e+"ms"),f.$refs.container.addClass("fancybox-is-open").trigger("focus"),f.loadSlide(r),void f.preload("image");l=n.fancybox.getTranslate(c.$slide),d=n.fancybox.getTranslate(f.$refs.stage),n.each(f.slides,(function(t,e){n.fancybox.stop(e.$slide,!0)})),c.pos!==r.pos&&(c.isComplete=!1),c.$slide.removeClass("fancybox-slide--complete fancybox-slide--current"),i?(p=l.left-(c.pos*l.width+c.pos*c.opts.gutter),n.each(f.slides,(function(t,o){o.$slide.removeClass("fancybox-animated").removeClass((function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")}));var a=o.pos*l.width+o.pos*o.opts.gutter;n.fancybox.setTranslate(o.$slide,{top:0,left:a-d.left+p}),o.pos!==r.pos&&o.$slide.addClass("fancybox-slide--"+(o.pos>r.pos?"next":"previous")),g(o.$slide),n.fancybox.animate(o.$slide,{top:0,left:(o.pos-r.pos)*l.width+(o.pos-r.pos)*o.opts.gutter},e,(function(){o.$slide.css({transform:"",opacity:""}).removeClass("fancybox-slide--next fancybox-slide--previous"),o.pos===f.currPos&&f.complete()}))}))):e&&r.opts.transitionEffect&&(u="fancybox-animated fancybox-fx-"+r.opts.transitionEffect,c.$slide.addClass("fancybox-slide--"+(c.pos>r.pos?"next":"previous")),n.fancybox.animate(c.$slide,u,e,(function(){c.$slide.removeClass(u).removeClass("fancybox-slide--next fancybox-slide--previous")}),!1)),r.isLoaded?f.revealContent(r):f.loadSlide(r),f.preload("image")}},createSlide:function(t){var e,o,a=this;return o=(o=t%a.group.length)<0?a.group.length+o:o,!a.slides[t]&&a.group[o]&&(e=n('<div class="fancybox-slide"></div>').appendTo(a.$refs.stage),a.slides[t]=n.extend(!0,{},a.group[o],{pos:t,$slide:e,isLoaded:!1}),a.updateSlide(a.slides[t])),a.slides[t]},scaleToActual:function(t,e,a){var i,s,r,c,l,d=this,u=d.current,p=u.$content,f=n.fancybox.getTranslate(u.$slide).width,h=n.fancybox.getTranslate(u.$slide).height,g=u.width,b=u.height;d.isAnimating||d.isMoved()||!p||"image"!=u.type||!u.isLoaded||u.hasError||(d.isAnimating=!0,n.fancybox.stop(p),t=t===o?.5*f:t,e=e===o?.5*h:e,(i=n.fancybox.getTranslate(p)).top-=n.fancybox.getTranslate(u.$slide).top,i.left-=n.fancybox.getTranslate(u.$slide).left,c=g/i.width,l=b/i.height,s=.5*f-.5*g,r=.5*h-.5*b,g>f&&((s=i.left*c-(t*c-t))>0&&(s=0),s<f-g&&(s=f-g)),b>h&&((r=i.top*l-(e*l-e))>0&&(r=0),r<h-b&&(r=h-b)),d.updateCursor(g,b),n.fancybox.animate(p,{top:r,left:s,scaleX:c,scaleY:l},a||366,(function(){d.isAnimating=!1})),d.SlideShow&&d.SlideShow.isActive&&d.SlideShow.stop())},scaleToFit:function(t){var e,o=this,a=o.current,i=a.$content;o.isAnimating||o.isMoved()||!i||"image"!=a.type||!a.isLoaded||a.hasError||(o.isAnimating=!0,n.fancybox.stop(i),e=o.getFitPos(a),o.updateCursor(e.width,e.height),n.fancybox.animate(i,{top:e.top,left:e.left,scaleX:e.width/i.width(),scaleY:e.height/i.height()},t||366,(function(){o.isAnimating=!1})))},getFitPos:function(t){var e,o,a,i,s=t.$content,r=t.$slide,c=t.width||t.opts.width,l=t.height||t.opts.height,d={};return!!(t.isLoaded&&s&&s.length)&&(e=n.fancybox.getTranslate(this.$refs.stage).width,o=n.fancybox.getTranslate(this.$refs.stage).height,e-=parseFloat(r.css("paddingLeft"))+parseFloat(r.css("paddingRight"))+parseFloat(s.css("marginLeft"))+parseFloat(s.css("marginRight")),o-=parseFloat(r.css("paddingTop"))+parseFloat(r.css("paddingBottom"))+parseFloat(s.css("marginTop"))+parseFloat(s.css("marginBottom")),c&&l||(c=e,l=o),(c*=a=Math.min(1,e/c,o/l))>e-.5&&(c=e),(l*=a)>o-.5&&(l=o),"image"===t.type?(d.top=Math.floor(.5*(o-l))+parseFloat(r.css("paddingTop")),d.left=Math.floor(.5*(e-c))+parseFloat(r.css("paddingLeft"))):"video"===t.contentType&&(l>c/(i=t.opts.width&&t.opts.height?c/l:t.opts.ratio||16/9)?l=c/i:c>l*i&&(c=l*i)),d.width=c,d.height=l,d)},update:function(t){var e=this;n.each(e.slides,(function(n,o){e.updateSlide(o,t)}))},updateSlide:function(t,e){var o=this,a=t&&t.$content,i=t.width||t.opts.width,s=t.height||t.opts.height,r=t.$slide;o.adjustCaption(t),a&&(i||s||"video"===t.contentType)&&!t.hasError&&(n.fancybox.stop(a),n.fancybox.setTranslate(a,o.getFitPos(t)),t.pos===o.currPos&&(o.isAnimating=!1,o.updateCursor())),o.adjustLayout(t),r.length&&(r.trigger("refresh"),t.pos===o.currPos&&o.$refs.toolbar.add(o.$refs.navigation.find(".fancybox-button--arrow_right")).toggleClass("compensate-for-scrollbar",r.get(0).scrollHeight>r.get(0).clientHeight)),o.trigger("onUpdate",t,e)},centerSlide:function(t){var e=this,a=e.current,i=a.$slide;!e.isClosing&&a&&(i.siblings().css({transform:"",opacity:""}),i.parent().children().removeClass("fancybox-slide--previous fancybox-slide--next"),n.fancybox.animate(i,{top:0,left:0,opacity:1},t===o?0:t,(function(){i.css({transform:"",opacity:""}),a.isComplete||e.complete()}),!1))},isMoved:function(t){var e,o,a=t||this.current;return!!a&&(o=n.fancybox.getTranslate(this.$refs.stage),e=n.fancybox.getTranslate(a.$slide),!a.$slide.hasClass("fancybox-animated")&&(Math.abs(e.top-o.top)>.5||Math.abs(e.left-o.left)>.5))},updateCursor:function(t,e){var o,a,i=this,s=i.current,r=i.$refs.container;s&&!i.isClosing&&i.Guestures&&(r.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan"),a=!!(o=i.canPan(t,e))||i.isZoomable(),r.toggleClass("fancybox-is-zoomable",a),n("[data-fancybox-zoom]").prop("disabled",!a),o?r.addClass("fancybox-can-pan"):a&&("zoom"===s.opts.clickContent||n.isFunction(s.opts.clickContent)&&"zoom"==s.opts.clickContent(s))?r.addClass("fancybox-can-zoomIn"):s.opts.touch&&(s.opts.touch.vertical||i.group.length>1)&&"video"!==s.contentType&&r.addClass("fancybox-can-swipe"))},isZoomable:function(){var t,e=this,n=e.current;if(n&&!e.isClosing&&"image"===n.type&&!n.hasError){if(!n.isLoaded)return!0;if((t=e.getFitPos(n))&&(n.width>t.width||n.height>t.height))return!0}return!1},isScaledDown:function(t,e){var a=!1,i=this.current,s=i.$content;return t!==o&&e!==o?a=t<i.width&&e<i.height:s&&(a=(a=n.fancybox.getTranslate(s)).width<i.width&&a.height<i.height),a},canPan:function(t,e){var a=this.current,i=null,s=!1;return"image"===a.type&&(a.isComplete||t&&e)&&!a.hasError&&(s=this.getFitPos(a),t!==o&&e!==o?i={width:t,height:e}:a.isComplete&&(i=n.fancybox.getTranslate(a.$content)),i&&s&&(s=Math.abs(i.width-s.width)>1.5||Math.abs(i.height-s.height)>1.5)),s},loadSlide:function(t){var e,o,a,i=this;if(!t.isLoading&&!t.isLoaded){if(t.isLoading=!0,!1===i.trigger("beforeLoad",t))return t.isLoading=!1,!1;switch(e=t.type,(o=t.$slide).off("refresh").trigger("onReset").addClass(t.opts.slideClass),e){case"image":i.setImage(t);break;case"iframe":i.setIframe(t);break;case"html":i.setContent(t,t.src||t.content);break;case"video":i.setContent(t,t.opts.video.tpl.replace(/\{\{src\}\}/gi,t.src).replace("{{format}}",t.opts.videoFormat||t.opts.video.format||"").replace("{{poster}}",t.thumb||""));break;case"inline":n(t.src).length?i.setContent(t,n(t.src)):i.setError(t);break;case"ajax":i.showLoading(t),a=n.ajax(n.extend({},t.opts.ajax.settings,{url:t.src,success:function(e,n){"success"===n&&i.setContent(t,e)},error:function(e,n){e&&"abort"!==n&&i.setError(t)}})),o.one("onReset",(function(){a.abort()}));break;default:i.setError(t);break}return!0}},setImage:function(t){var o,a=this;setTimeout((function(){var e=t.$image;a.isClosing||!t.isLoading||e&&e.length&&e[0].complete||t.hasError||a.showLoading(t)}),50),a.checkSrcset(t),t.$content=n('<div class="fancybox-content"></div>').addClass("fancybox-is-hidden").appendTo(t.$slide.addClass("fancybox-slide--image")),!1!==t.opts.preload&&t.opts.width&&t.opts.height&&t.thumb&&(t.width=t.opts.width,t.height=t.opts.height,(o=e.createElement("img")).onerror=function(){n(this).remove(),t.$ghost=null},o.onload=function(){a.afterLoad(t)},t.$ghost=n(o).addClass("fancybox-image").appendTo(t.$content).attr("src",t.thumb)),a.setBigImage(t)},checkSrcset:function(e){var n,o,a,i,s=e.opts.srcset||e.opts.image.srcset;if(s){a=t.devicePixelRatio||1,i=t.innerWidth*a,o=s.split(",").map((function(t){var e={};return t.trim().split(/\s+/).forEach((function(t,n){var o=parseInt(t.substring(0,t.length-1),10);if(0===n)return e.url=t;o&&(e.value=o,e.postfix=t[t.length-1])})),e})),o.sort((function(t,e){return t.value-e.value}));for(var r=0;r<o.length;r++){var c=o[r];if("w"===c.postfix&&c.value>=i||"x"===c.postfix&&c.value>=a){n=c;break}}!n&&o.length&&(n=o[o.length-1]),n&&(e.src=n.url,e.width&&e.height&&"w"==n.postfix&&(e.height=e.width/e.height*n.value,e.width=n.value),e.opts.srcset=s)}},setBigImage:function(t){var o=this,a=e.createElement("img"),i=n(a);t.$image=i.one("error",(function(){o.setError(t)})).one("load",(function(){var e;t.$ghost||(o.resolveImageSlideSize(t,this.naturalWidth,this.naturalHeight),o.afterLoad(t)),o.isClosing||(t.opts.srcset&&((e=t.opts.sizes)&&"auto"!==e||(e=(t.width/t.height>1&&l.width()/l.height()>1?"100":Math.round(t.width/t.height*100))+"vw"),i.attr("sizes",e).attr("srcset",t.opts.srcset)),t.$ghost&&setTimeout((function(){t.$ghost&&!o.isClosing&&t.$ghost.hide()}),Math.min(300,Math.max(1e3,t.height/1600))),o.hideLoading(t))})).addClass("fancybox-image").attr("src",t.src).appendTo(t.$content),(a.complete||"complete"==a.readyState)&&i.naturalWidth&&i.naturalHeight?i.trigger("load"):a.error&&i.trigger("error")},resolveImageSlideSize:function(t,e,n){var o=parseInt(t.opts.width,10),a=parseInt(t.opts.height,10);t.width=e,t.height=n,o>0&&(t.width=o,t.height=Math.floor(o*n/e)),a>0&&(t.width=Math.floor(a*e/n),t.height=a)},setIframe:function(t){var e,a=this,i=t.opts.iframe,s=t.$slide;t.$content=n('<div class="fancybox-content'+(i.preload?" fancybox-is-hidden":"")+'"></div>').css(i.css).appendTo(s),s.addClass("fancybox-slide--"+t.contentType),t.$iframe=e=n(i.tpl.replace(/\{rnd\}/g,(new Date).getTime())).attr(i.attr).appendTo(t.$content),i.preload?(a.showLoading(t),e.on("load.fb error.fb",(function(e){this.isReady=1,t.$slide.trigger("refresh"),a.afterLoad(t)})),s.on("refresh.fb",(function(){var n,a=t.$content,r=i.css.width,c=i.css.height;if(1===e[0].isReady){try{n=e.contents().find("body")}catch(t){}n&&n.length&&n.children().length&&(s.css("overflow","visible"),a.css({width:"100%","max-width":"100%",height:"9999px"}),r===o&&(r=Math.ceil(Math.max(n[0].clientWidth,n.outerWidth(!0)))),a.css("width",r||"").css("max-width",""),c===o&&(c=Math.ceil(Math.max(n[0].clientHeight,n.outerHeight(!0)))),a.css("height",c||""),s.css("overflow","auto")),a.removeClass("fancybox-is-hidden")}}))):a.afterLoad(t),e.attr("src",t.src),s.one("onReset",(function(){try{n(this).find("iframe").hide().unbind().attr("src","//about:blank")}catch(t){}n(this).off("refresh.fb").empty(),t.isLoaded=!1,t.isRevealed=!1}))},setContent:function(t,e){var o,a=this;a.isClosing||(a.hideLoading(t),t.$content&&n.fancybox.stop(t.$content),t.$slide.empty(),(o=e)&&o.hasOwnProperty&&o instanceof n&&e.parent().length?((e.hasClass("fancybox-content")||e.parent().hasClass("fancybox-content"))&&e.parents(".fancybox-slide").trigger("onReset"),t.$placeholder=n("<div>").hide().insertAfter(e),e.css("display","inline-block")):t.hasError||("string"===n.type(e)&&(e=n("<div>").append(n.trim(e)).contents()),t.opts.filter&&(e=n("<div>").html(e).find(t.opts.filter))),t.$slide.one("onReset",(function(){n(this).find("video,audio").trigger("pause"),t.$placeholder&&(t.$placeholder.after(e.removeClass("fancybox-content").hide()).remove(),t.$placeholder=null),t.$smallBtn&&(t.$smallBtn.remove(),t.$smallBtn=null),t.hasError||(n(this).empty(),t.isLoaded=!1,t.isRevealed=!1)})),n(e).appendTo(t.$slide),n(e).is("video,audio")&&(n(e).addClass("fancybox-video"),n(e).wrap("<div></div>"),t.contentType="video",t.opts.width=t.opts.width||n(e).attr("width"),t.opts.height=t.opts.height||n(e).attr("height")),t.$content=t.$slide.children().filter("div,form,main,video,audio,article,.fancybox-content").first(),t.$content.siblings().hide(),t.$content.length||(t.$content=t.$slide.wrapInner("<div></div>").children().first()),t.$content.addClass("fancybox-content"),t.$slide.addClass("fancybox-slide--"+t.contentType),a.afterLoad(t))},setError:function(t){t.hasError=!0,t.$slide.trigger("onReset").removeClass("fancybox-slide--"+t.contentType).addClass("fancybox-slide--error"),t.contentType="html",this.setContent(t,this.translate(t,t.opts.errorTpl)),t.pos===this.currPos&&(this.isAnimating=!1)},showLoading:function(t){var e=this;(t=t||e.current)&&!t.$spinner&&(t.$spinner=n(e.translate(e,e.opts.spinnerTpl)).appendTo(t.$slide).hide().fadeIn("fast"))},hideLoading:function(t){(t=t||this.current)&&t.$spinner&&(t.$spinner.stop().remove(),delete t.$spinner)},afterLoad:function(t){var e=this;e.isClosing||(t.isLoading=!1,t.isLoaded=!0,e.trigger("afterLoad",t),e.hideLoading(t),!t.opts.smallBtn||t.$smallBtn&&t.$smallBtn.length||(t.$smallBtn=n(e.translate(t,t.opts.btnTpl.smallBtn)).appendTo(t.$content)),t.opts.protect&&t.$content&&!t.hasError&&(t.$content.on("contextmenu.fb",(function(t){return 2==t.button&&t.preventDefault(),!0})),"image"===t.type&&n('<div class="fancybox-spaceball"></div>').appendTo(t.$content)),e.adjustCaption(t),e.adjustLayout(t),t.pos===e.currPos&&e.updateCursor(),e.revealContent(t))},adjustCaption:function(t){var e,n=this,o=t||n.current,a=o.opts.caption,i=o.opts.preventCaptionOverlap,s=n.$refs.caption,r=!1;s.toggleClass("fancybox-caption--separate",i),i&&a&&a.length&&(o.pos!==n.currPos?((e=s.clone().appendTo(s.parent())).children().eq(0).empty().html(a),r=e.outerHeight(!0),e.empty().remove()):n.$caption&&(r=n.$caption.outerHeight(!0)),o.$slide.css("padding-bottom",r||""))},adjustLayout:function(t){var e,n,o,a,i=t||this.current;i.isLoaded&&!0!==i.opts.disableLayoutFix&&(i.$content.css("margin-bottom",""),i.$content.outerHeight()>i.$slide.height()+.5&&(o=i.$slide[0].style["padding-bottom"],a=i.$slide.css("padding-bottom"),parseFloat(a)>0&&(e=i.$slide[0].scrollHeight,i.$slide.css("padding-bottom",0),Math.abs(e-i.$slide[0].scrollHeight)<1&&(n=a),i.$slide.css("padding-bottom",o))),i.$content.css("margin-bottom",n))},revealContent:function(t){var e,a,i,s,r=this,c=t.$slide,l=!1,d=!1,u=r.isMoved(t),p=t.isRevealed;return t.isRevealed=!0,e=t.opts[r.firstRun?"animationEffect":"transitionEffect"],i=t.opts[r.firstRun?"animationDuration":"transitionDuration"],i=parseInt(t.forcedDuration===o?i:t.forcedDuration,10),!u&&t.pos===r.currPos&&i||(e=!1),"zoom"===e&&(t.pos===r.currPos&&i&&"image"===t.type&&!t.hasError&&(d=r.getThumbPos(t))?l=r.getFitPos(t):e="fade"),"zoom"===e?(r.isAnimating=!0,l.scaleX=l.width/d.width,l.scaleY=l.height/d.height,"auto"==(s=t.opts.zoomOpacity)&&(s=Math.abs(t.width/t.height-d.width/d.height)>.1),s&&(d.opacity=.1,l.opacity=1),n.fancybox.setTranslate(t.$content.removeClass("fancybox-is-hidden"),d),g(t.$content),void n.fancybox.animate(t.$content,l,i,(function(){r.isAnimating=!1,r.complete()}))):(r.updateSlide(t),e?(n.fancybox.stop(c),a="fancybox-slide--"+(t.pos>=r.prevPos?"next":"previous")+" fancybox-animated fancybox-fx-"+e,c.addClass(a).removeClass("fancybox-slide--current"),t.$content.removeClass("fancybox-is-hidden"),g(c),"image"!==t.type&&t.$content.hide().show(0),void n.fancybox.animate(c,"fancybox-slide--current",i,(function(){c.removeClass(a).css({transform:"",opacity:""}),t.pos===r.currPos&&r.complete()}),!0)):(t.$content.removeClass("fancybox-is-hidden"),p||!u||"image"!==t.type||t.hasError||t.$content.hide().fadeIn("fast"),void(t.pos===r.currPos&&r.complete())))},getThumbPos:function(t){var o,a,i,s,r,c,l=t.$thumb;return!(!l||!function(t){var o,a;return!(!t||t.ownerDocument!==e)&&(n(".fancybox-container").css("pointer-events","none"),o={x:t.getBoundingClientRect().left+t.offsetWidth/2,y:t.getBoundingClientRect().top+t.offsetHeight/2},a=e.elementFromPoint(o.x,o.y)===t,n(".fancybox-container").css("pointer-events",""),a)}(l[0]))&&(a=n.fancybox.getTranslate(l),i=parseFloat(l.css("border-top-width")||0),s=parseFloat(l.css("border-right-width")||0),r=parseFloat(l.css("border-bottom-width")||0),c=parseFloat(l.css("border-left-width")||0),o={top:a.top+i,left:a.left+c,width:a.width-s-c,height:a.height-i-r,scaleX:1,scaleY:1},a.width>0&&a.height>0&&o)},complete:function(){var t,e=this,o=e.current,a={};!e.isMoved()&&o.isLoaded&&(o.isComplete||(o.isComplete=!0,o.$slide.siblings().trigger("onReset"),e.preload("inline"),g(o.$slide),o.$slide.addClass("fancybox-slide--complete"),n.each(e.slides,(function(t,o){o.pos>=e.currPos-1&&o.pos<=e.currPos+1?a[o.pos]=o:o&&(n.fancybox.stop(o.$slide),o.$slide.off().remove())})),e.slides=a),e.isAnimating=!1,e.updateCursor(),e.trigger("afterShow"),o.opts.video.autoStart&&o.$slide.find("video,audio").filter(":visible:first").trigger("play").one("ended",(function(){Document.exitFullscreen?Document.exitFullscreen():this.webkitExitFullscreen&&this.webkitExitFullscreen(),e.next()})),o.opts.autoFocus&&"html"===o.contentType&&((t=o.$content.find("input[autofocus]:enabled:visible:first")).length?t.trigger("focus"):e.focus(null,!0)),o.$slide.scrollTop(0).scrollLeft(0))},preload:function(t){var e,n,o=this;o.group.length<2||(n=o.slides[o.currPos+1],(e=o.slides[o.currPos-1])&&e.type===t&&o.loadSlide(e),n&&n.type===t&&o.loadSlide(n))},focus:function(t,o){var a,i,s=this,r=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","video","audio","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(",");s.isClosing||((a=(a=!t&&s.current&&s.current.isComplete?s.current.$slide.find("*:visible"+(o?":not(.fancybox-close-small)":"")):s.$refs.container.find("*:visible")).filter(r).filter((function(){return"hidden"!==n(this).css("visibility")&&!n(this).hasClass("disabled")}))).length?(i=a.index(e.activeElement),t&&t.shiftKey?(i<0||0==i)&&(t.preventDefault(),a.eq(a.length-1).trigger("focus")):(i<0||i==a.length-1)&&(t&&t.preventDefault(),a.eq(0).trigger("focus"))):s.$refs.container.trigger("focus"))},activate:function(){var t=this;n(".fancybox-container").each((function(){var e=n(this).data("FancyBox");e&&e.id!==t.id&&!e.isClosing&&(e.trigger("onDeactivate"),e.removeEvents(),e.isVisible=!1)})),t.isVisible=!0,(t.current||t.isIdle)&&(t.update(),t.updateControls()),t.trigger("onActivate"),t.addEvents()},close:function(t,e){var o,a,i,s,r,c,l,d=this,u=d.current,f=function(){d.cleanUp(t)};return!d.isClosing&&(d.isClosing=!0,!1===d.trigger("beforeClose",t)?(d.isClosing=!1,p((function(){d.update()})),!1):(d.removeEvents(),i=u.$content,o=u.opts.animationEffect,a=n.isNumeric(e)?e:o?u.opts.animationDuration:0,u.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),!0!==t?n.fancybox.stop(u.$slide):o=!1,u.$slide.siblings().trigger("onReset").remove(),a&&d.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing").css("transition-duration",a+"ms"),d.hideLoading(u),d.hideControls(!0),d.updateCursor(),"zoom"!==o||i&&a&&"image"===u.type&&!d.isMoved()&&!u.hasError&&(l=d.getThumbPos(u))||(o="fade"),"zoom"===o?(n.fancybox.stop(i),c={top:(s=n.fancybox.getTranslate(i)).top,left:s.left,scaleX:s.width/l.width,scaleY:s.height/l.height,width:l.width,height:l.height},"auto"==(r=u.opts.zoomOpacity)&&(r=Math.abs(u.width/u.height-l.width/l.height)>.1),r&&(l.opacity=0),n.fancybox.setTranslate(i,c),g(i),n.fancybox.animate(i,l,a,f),!0):(o&&a?n.fancybox.animate(u.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"),"fancybox-animated fancybox-fx-"+o,a,f):!0===t?setTimeout(f,a):f(),!0)))},cleanUp:function(e){var o,a,i,s=this,r=s.current.opts.$orig;s.current.$slide.trigger("onReset"),s.$refs.container.empty().remove(),s.trigger("afterClose",e),s.current.opts.backFocus&&(r&&r.length&&r.is(":visible")||(r=s.$trigger),r&&r.length&&(a=t.scrollX,i=t.scrollY,r.trigger("focus"),n("html, body").scrollTop(i).scrollLeft(a))),s.current=null,(o=n.fancybox.getInstance())?o.activate():(n("body").removeClass("fancybox-active compensate-for-scrollbar"),n("#fancybox-style-noscroll").remove())},trigger:function(t,e){var o,a=Array.prototype.slice.call(arguments,1),i=this,s=e&&e.opts?e:i.current;if(s?a.unshift(s):s=i,a.unshift(i),n.isFunction(s.opts[t])&&(o=s.opts[t].apply(s,a)),!1===o)return o;"afterClose"!==t&&i.$refs?i.$refs.container.trigger(t+".fb",a):d.trigger(t+".fb",a)},updateControls:function(){var t=this,o=t.current,a=o.index,i=t.$refs.container,s=t.$refs.caption,r=o.opts.caption;o.$slide.trigger("refresh"),r&&r.length?(t.$caption=s,s.children().eq(0).html(r)):t.$caption=null,t.hasHiddenControls||t.isIdle||t.showControls(),i.find("[data-fancybox-count]").html(t.group.length),i.find("[data-fancybox-index]").html(a+1),i.find("[data-fancybox-prev]").prop("disabled",!o.opts.loop&&a<=0),i.find("[data-fancybox-next]").prop("disabled",!o.opts.loop&&a>=t.group.length-1),"image"===o.type?i.find("[data-fancybox-zoom]").show().end().find("[data-fancybox-download]").attr("href",o.opts.image.src||o.src).show():o.opts.toolbar&&i.find("[data-fancybox-download],[data-fancybox-zoom]").hide(),n(e.activeElement).is(":hidden,[disabled]")&&t.$refs.container.trigger("focus")},hideControls:function(t){var e=["infobar","toolbar","nav"];!t&&this.current.opts.preventCaptionOverlap||e.push("caption"),this.$refs.container.removeClass(e.map((function(t){return"fancybox-show-"+t})).join(" ")),this.hasHiddenControls=!0},showControls:function(){var t=this,e=t.current?t.current.opts:t.opts,n=t.$refs.container;t.hasHiddenControls=!1,t.idleSecondsCounter=0,n.toggleClass("fancybox-show-toolbar",!(!e.toolbar||!e.buttons)).toggleClass("fancybox-show-infobar",!!(e.infobar&&t.group.length>1)).toggleClass("fancybox-show-caption",!!t.$caption).toggleClass("fancybox-show-nav",!!(e.arrows&&t.group.length>1)).toggleClass("fancybox-is-modal",!!e.modal)},toggleControls:function(){this.hasHiddenControls?this.showControls():this.hideControls()}}),n.fancybox={version:"3.5.7",defaults:c,getInstance:function(t){var e=n('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),o=Array.prototype.slice.call(arguments,1);return e instanceof m&&("string"===n.type(t)?e[t].apply(e,o):"function"===n.type(t)&&t.apply(e,o),e)},open:function(t,e,n){return new m(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),!0===t&&this.close(t))},destroy:function(){this.close(!0),d.add("body").off("click.fb-start","**")},isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:(a=e.createElement("div"),t.getComputedStyle&&t.getComputedStyle(a)&&t.getComputedStyle(a).getPropertyValue("transform")&&!(e.documentMode&&e.documentMode<11)),getTranslate:function(t){var e;return!(!t||!t.length)&&{top:(e=t[0].getBoundingClientRect()).top||0,left:e.left||0,width:e.width,height:e.height,opacity:parseFloat(t.css("opacity"))}},setTranslate:function(t,e){var n="",a={};if(t&&e)return e.left===o&&e.top===o||(n=(e.left===o?t.position().left:e.left)+"px, "+(e.top===o?t.position().top:e.top)+"px",n=this.use3d?"translate3d("+n+", 0px)":"translate("+n+")"),e.scaleX!==o&&e.scaleY!==o?n+=" scale("+e.scaleX+", "+e.scaleY+")":e.scaleX!==o&&(n+=" scaleX("+e.scaleX+")"),n.length&&(a.transform=n),e.opacity!==o&&(a.opacity=e.opacity),e.width!==o&&(a.width=e.width),e.height!==o&&(a.height=e.height),t.css(a)},animate:function(t,e,a,i,s){var r,c=this;n.isFunction(a)&&(i=a,a=null),c.stop(t),r=c.getTranslate(t),t.on(h,(function(l){(!l||!l.originalEvent||t.is(l.originalEvent.target)&&"z-index"!=l.originalEvent.propertyName)&&(c.stop(t),n.isNumeric(a)&&t.css("transition-duration",""),n.isPlainObject(e)?e.scaleX!==o&&e.scaleY!==o&&c.setTranslate(t,{top:e.top,left:e.left,width:r.width*e.scaleX,height:r.height*e.scaleY,scaleX:1,scaleY:1}):!0!==s&&t.removeClass(e),n.isFunction(i)&&i(l))})),n.isNumeric(a)&&t.css("transition-duration",a+"ms"),n.isPlainObject(e)?(e.scaleX!==o&&e.scaleY!==o&&(delete e.width,delete e.height,t.parent().hasClass("fancybox-slide--image")&&t.parent().addClass("fancybox-is-scaling")),n.fancybox.setTranslate(t,e)):t.addClass(e),t.data("timer",setTimeout((function(){t.trigger(h)}),a+33))},stop:function(t,e){t&&t.length&&(clearTimeout(t.data("timer")),e&&t.trigger(h),t.off(h).css("transition-duration",""),t.parent().removeClass("fancybox-is-scaling"))}},n.fn.fancybox=function(t){var e;return(e=(t=t||{}).selector||!1)?n("body").off("click.fb-start",e).on("click.fb-start",e,{options:t},y):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},y),this},d.on("click.fb-start","[data-fancybox]",y),d.on("click.fb-start","[data-fancybox-trigger]",(function(t){n('[data-fancybox="'+n(this).attr("data-fancybox-trigger")+'"]').eq(n(this).attr("data-fancybox-index")||0).trigger("click.fb-start",{$trigger:n(this)})})),i=".fancybox-button",s="fancybox-focus",r=null,d.on("mousedown mouseup focus blur",i,(function(t){switch(t.type){case"mousedown":r=n(this);break;case"mouseup":r=null;break;case"focusin":n(i).removeClass(s),n(this).is(r)||n(this).is("[disabled]")||n(this).addClass(s);break;case"focusout":n(i).removeClass(s);break}}))}function y(t,e){var o,a,i,s=[],r=0;t&&t.isDefaultPrevented()||(t.preventDefault(),e=e||{},t&&t.data&&(e=b(t.data.options,e)),o=e.$target||n(t.currentTarget).trigger("blur"),(i=n.fancybox.getInstance())&&i.$trigger&&i.$trigger.is(o)||(s=e.selector?n(e.selector):(a=o.attr("data-fancybox")||"")?(s=t.data?t.data.items:[]).length?s.filter('[data-fancybox="'+a+'"]'):n('[data-fancybox="'+a+'"]'):[o],(r=n(s).index(o))<0&&(r=0),(i=n.fancybox.open(s,e,r)).$trigger=o))}}(window,document,jQuery),function(t){"use strict";var e={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramPlace:8,type:"iframe",url:"https://www.youtube-nocookie.com/embed/$4",thumb:"https://img.youtube.com/vi/$4/hqdefault.jpg"},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},gmap_place:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/?ll="+(t[9]?t[9]+"&z="+Math.floor(t[10])+(t[12]?t[12].replace(/^\//,"&"):""):t[12]+"").replace(/\?/,"&")+"&output="+(t[12]&&t[12].indexOf("layer=c")>0?"svembed":"embed")}},gmap_search:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/maps?q="+t[5].replace("query=","q=").replace("api=1","")+"&output=embed"}}},n=function(e,n,o){if(e)return o=o||"","object"===t.type(o)&&(o=t.param(o,!0)),t.each(n,(function(t,n){e=e.replace("$"+t,n||"")})),o.length&&(e+=(e.indexOf("?")>0?"&":"?")+o),e};t(document).on("objectNeedsType.fb",(function(o,a,i){var s,r,c,l,d,u,p,f=i.src||"",h=!1;s=t.extend(!0,{},e,i.opts.media),t.each(s,(function(e,o){if(c=f.match(o.matcher)){if(h=o.type,p=e,u={},o.paramPlace&&c[o.paramPlace]){"?"==(d=c[o.paramPlace])[0]&&(d=d.substring(1)),d=d.split("&");for(var a=0;a<d.length;++a){var s=d[a].split("=",2);2==s.length&&(u[s[0]]=decodeURIComponent(s[1].replace(/\+/g," ")))}}return l=t.extend(!0,{},o.params,i.opts[e],u),f="function"===t.type(o.url)?o.url.call(this,c,l,i):n(o.url,c,l),r="function"===t.type(o.thumb)?o.thumb.call(this,c,l,i):n(o.thumb,c),"youtube"===e?f=f.replace(/&t=((\d+)m)?(\d+)s/,(function(t,e,n,o){return"&start="+((n?60*parseInt(n,10):0)+parseInt(o,10))})):"vimeo"===e&&(f=f.replace("&%23","#")),!1}})),h?(i.opts.thumb||i.opts.$thumb&&i.opts.$thumb.length||(i.opts.thumb=r),"iframe"===h&&(i.opts=t.extend(!0,i.opts,{iframe:{preload:!1,attr:{scrolling:"no"}}})),t.extend(i,{type:h,src:f,origSrc:i.src,contentSource:p,contentType:"image"===h?"image":"gmap_place"==p||"gmap_search"==p?"map":"video"})):f&&(i.type=i.opts.defaultType)}));var o={youtube:{src:"https://www.youtube.com/iframe_api",class:"YT",loading:!1,loaded:!1},vimeo:{src:"https://player.vimeo.com/api/player.js",class:"Vimeo",loading:!1,loaded:!1},load:function(t){var e,n=this;this[t].loaded?setTimeout((function(){n.done(t)})):this[t].loading||(this[t].loading=!0,(e=document.createElement("script")).type="text/javascript",e.src=this[t].src,"youtube"===t?window.onYouTubeIframeAPIReady=function(){n[t].loaded=!0,n.done(t)}:e.onload=function(){n[t].loaded=!0,n.done(t)},document.body.appendChild(e))},done:function(e){var n,o;"youtube"===e&&delete window.onYouTubeIframeAPIReady,(n=t.fancybox.getInstance())&&(o=n.current.$content.find("iframe"),"youtube"===e&&void 0!==YT&&YT?new YT.Player(o.attr("id"),{events:{onStateChange:function(t){0==t.data&&n.next()}}}):"vimeo"===e&&void 0!==Vimeo&&Vimeo&&new Vimeo.Player(o).on("ended",(function(){n.next()})))}};t(document).on({"afterShow.fb":function(t,e,n){e.group.length>1&&("youtube"===n.contentSource||"vimeo"===n.contentSource)&&o.load(n.contentSource)}})}(jQuery),function(t,e,n){"use strict";var o=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)},a=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)},i=function(e){var n=[];for(var o in e=(e=e.originalEvent||e||t.e).touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e])e[o].pageX?n.push({x:e[o].pageX,y:e[o].pageY}):e[o].clientX&&n.push({x:e[o].clientX,y:e[o].clientY});return n},s=function(t,e,n){return e&&t?"x"===n?t.x-e.x:"y"===n?t.y-e.y:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):0},r=function(t){if(t.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe')||n.isFunction(t.get(0).onclick)||t.data("selectable"))return!0;for(var e=0,o=t[0].attributes,a=o.length;e<a;e++)if("data-fancybox-"===o[e].nodeName.substr(0,14))return!0;return!1},c=function(e){for(var n,o,a,i,s,r=!1;n=e.get(0),o=void 0,a=void 0,i=void 0,s=void 0,o=t.getComputedStyle(n)["overflow-y"],a=t.getComputedStyle(n)["overflow-x"],i=("scroll"===o||"auto"===o)&&n.scrollHeight>n.clientHeight,s=("scroll"===a||"auto"===a)&&n.scrollWidth>n.clientWidth,!(r=i||s)&&(e=e.parent()).length&&!e.hasClass("fancybox-stage")&&!e.is("body"););return r},l=function(t){var e=this;e.instance=t,e.$bg=t.$refs.bg,e.$stage=t.$refs.stage,e.$container=t.$refs.container,e.destroy(),e.$container.on("touchstart.fb.touch mousedown.fb.touch",n.proxy(e,"ontouchstart"))};l.prototype.destroy=function(){var t=this;t.$container.off(".fb.touch"),n(e).off(".fb.touch"),t.requestId&&(a(t.requestId),t.requestId=null),t.tapped&&(clearTimeout(t.tapped),t.tapped=null)},l.prototype.ontouchstart=function(o){var a=this,l=n(o.target),d=a.instance,u=d.current,p=u.$slide,f=u.$content,h="touchstart"==o.type;if(h&&a.$container.off("mousedown.fb.touch"),(!o.originalEvent||2!=o.originalEvent.button)&&p.length&&l.length&&!r(l)&&!r(l.parent())&&(l.is("img")||!(o.originalEvent.clientX>l[0].clientWidth+l.offset().left))){if(!u||d.isAnimating||u.$slide.hasClass("fancybox-animated"))return o.stopPropagation(),void o.preventDefault();a.realPoints=a.startPoints=i(o),a.startPoints.length&&(u.touch&&o.stopPropagation(),a.startEvent=o,a.canTap=!0,a.$target=l,a.$content=f,a.opts=u.opts.touch,a.isPanning=!1,a.isSwiping=!1,a.isZooming=!1,a.isScrolling=!1,a.canPan=d.canPan(),a.startTime=(new Date).getTime(),a.distanceX=a.distanceY=a.distance=0,a.canvasWidth=Math.round(p[0].clientWidth),a.canvasHeight=Math.round(p[0].clientHeight),a.contentLastPos=null,a.contentStartPos=n.fancybox.getTranslate(a.$content)||{top:0,left:0},a.sliderStartPos=n.fancybox.getTranslate(p),a.stagePos=n.fancybox.getTranslate(d.$refs.stage),a.sliderStartPos.top-=a.stagePos.top,a.sliderStartPos.left-=a.stagePos.left,a.contentStartPos.top-=a.stagePos.top,a.contentStartPos.left-=a.stagePos.left,n(e).off(".fb.touch").on(h?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",n.proxy(a,"ontouchend")).on(h?"touchmove.fb.touch":"mousemove.fb.touch",n.proxy(a,"ontouchmove")),n.fancybox.isMobile&&e.addEventListener("scroll",a.onscroll,!0),((a.opts||a.canPan)&&(l.is(a.$stage)||a.$stage.find(l).length)||(l.is(".fancybox-image")&&o.preventDefault(),n.fancybox.isMobile&&l.parents(".fancybox-caption").length))&&(a.isScrollable=c(l)||c(l.parent()),n.fancybox.isMobile&&a.isScrollable||o.preventDefault(),(1===a.startPoints.length||u.hasError)&&(a.canPan?(n.fancybox.stop(a.$content),a.isPanning=!0):a.isSwiping=!0,a.$container.addClass("fancybox-is-grabbing")),2===a.startPoints.length&&"image"===u.type&&(u.isLoaded||u.$ghost)&&(a.canTap=!1,a.isSwiping=!1,a.isPanning=!1,a.isZooming=!0,n.fancybox.stop(a.$content),a.centerPointStartX=.5*(a.startPoints[0].x+a.startPoints[1].x)-n(t).scrollLeft(),a.centerPointStartY=.5*(a.startPoints[0].y+a.startPoints[1].y)-n(t).scrollTop(),a.percentageOfImageAtPinchPointX=(a.centerPointStartX-a.contentStartPos.left)/a.contentStartPos.width,a.percentageOfImageAtPinchPointY=(a.centerPointStartY-a.contentStartPos.top)/a.contentStartPos.height,a.startDistanceBetweenFingers=s(a.startPoints[0],a.startPoints[1]))))}},l.prototype.onscroll=function(t){this.isScrolling=!0,e.removeEventListener("scroll",this.onscroll,!0)},l.prototype.ontouchmove=function(t){var e=this;void 0===t.originalEvent.buttons||0!==t.originalEvent.buttons?e.isScrolling?e.canTap=!1:(e.newPoints=i(t),(e.opts||e.canPan)&&e.newPoints.length&&e.newPoints.length&&(e.isSwiping&&!0===e.isSwiping||t.preventDefault(),e.distanceX=s(e.newPoints[0],e.startPoints[0],"x"),e.distanceY=s(e.newPoints[0],e.startPoints[0],"y"),e.distance=s(e.newPoints[0],e.startPoints[0]),e.distance>0&&(e.isSwiping?e.onSwipe(t):e.isPanning?e.onPan():e.isZooming&&e.onZoom()))):e.ontouchend(t)},l.prototype.onSwipe=function(e){var i,s=this,r=s.instance,c=s.isSwiping,l=s.sliderStartPos.left||0;if(!0!==c)"x"==c&&(s.distanceX>0&&(s.instance.group.length<2||0===s.instance.current.index&&!s.instance.current.opts.loop)?l+=Math.pow(s.distanceX,.8):s.distanceX<0&&(s.instance.group.length<2||s.instance.current.index===s.instance.group.length-1&&!s.instance.current.opts.loop)?l-=Math.pow(-s.distanceX,.8):l+=s.distanceX),s.sliderLastPos={top:"x"==c?0:s.sliderStartPos.top+s.distanceY,left:l},s.requestId&&(a(s.requestId),s.requestId=null),s.requestId=o((function(){s.sliderLastPos&&(n.each(s.instance.slides,(function(t,e){var o=e.pos-s.instance.currPos;n.fancybox.setTranslate(e.$slide,{top:s.sliderLastPos.top,left:s.sliderLastPos.left+o*s.canvasWidth+o*e.opts.gutter})})),s.$container.addClass("fancybox-is-sliding"))}));else if(Math.abs(s.distance)>10){if(s.canTap=!1,r.group.length<2&&s.opts.vertical?s.isSwiping="y":r.isDragging||!1===s.opts.vertical||"auto"===s.opts.vertical&&n(t).width()>800?s.isSwiping="x":(i=Math.abs(180*Math.atan2(s.distanceY,s.distanceX)/Math.PI),s.isSwiping=i>45&&i<135?"y":"x"),"y"===s.isSwiping&&n.fancybox.isMobile&&s.isScrollable)return void(s.isScrolling=!0);r.isDragging=s.isSwiping,s.startPoints=s.newPoints,n.each(r.slides,(function(t,e){var o,a;n.fancybox.stop(e.$slide),o=n.fancybox.getTranslate(e.$slide),a=n.fancybox.getTranslate(r.$refs.stage),e.$slide.css({transform:"",opacity:"","transition-duration":""}).removeClass("fancybox-animated").removeClass((function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")})),e.pos===r.current.pos&&(s.sliderStartPos.top=o.top-a.top,s.sliderStartPos.left=o.left-a.left),n.fancybox.setTranslate(e.$slide,{top:o.top-a.top,left:o.left-a.left})})),r.SlideShow&&r.SlideShow.isActive&&r.SlideShow.stop()}},l.prototype.onPan=function(){var t=this;s(t.newPoints[0],t.realPoints[0])<(n.fancybox.isMobile?10:5)?t.startPoints=t.newPoints:(t.canTap=!1,t.contentLastPos=t.limitMovement(),t.requestId&&a(t.requestId),t.requestId=o((function(){n.fancybox.setTranslate(t.$content,t.contentLastPos)})))},l.prototype.limitMovement=function(){var t,e,n,o,a,i,s=this,r=s.canvasWidth,c=s.canvasHeight,l=s.distanceX,d=s.distanceY,u=s.contentStartPos,p=u.left,f=u.top,h=u.width,g=u.height;return a=h>r?p+l:p,i=f+d,t=Math.max(0,.5*r-.5*h),e=Math.max(0,.5*c-.5*g),n=Math.min(r-h,.5*r-.5*h),o=Math.min(c-g,.5*c-.5*g),l>0&&a>t&&(a=t-1+Math.pow(-t+p+l,.8)||0),l<0&&a<n&&(a=n+1-Math.pow(n-p-l,.8)||0),d>0&&i>e&&(i=e-1+Math.pow(-e+f+d,.8)||0),d<0&&i<o&&(i=o+1-Math.pow(o-f-d,.8)||0),{top:i,left:a}},l.prototype.limitPosition=function(t,e,n,o){var a=this.canvasWidth,i=this.canvasHeight;return t=n>a?(t=t>0?0:t)<a-n?a-n:t:Math.max(0,a/2-n/2),{top:e=o>i?(e=e>0?0:e)<i-o?i-o:e:Math.max(0,i/2-o/2),left:t}},l.prototype.onZoom=function(){var e=this,i=e.contentStartPos,r=i.width,c=i.height,l=i.left,d=i.top,u=s(e.newPoints[0],e.newPoints[1])/e.startDistanceBetweenFingers,p=Math.floor(r*u),f=Math.floor(c*u),h=(r-p)*e.percentageOfImageAtPinchPointX,g=(c-f)*e.percentageOfImageAtPinchPointY,b=(e.newPoints[0].x+e.newPoints[1].x)/2-n(t).scrollLeft(),m=(e.newPoints[0].y+e.newPoints[1].y)/2-n(t).scrollTop(),y=b-e.centerPointStartX,v={top:d+(g+(m-e.centerPointStartY)),left:l+(h+y),scaleX:u,scaleY:u};e.canTap=!1,e.newWidth=p,e.newHeight=f,e.contentLastPos=v,e.requestId&&a(e.requestId),e.requestId=o((function(){n.fancybox.setTranslate(e.$content,e.contentLastPos)}))},l.prototype.ontouchend=function(t){var o=this,s=o.isSwiping,r=o.isPanning,c=o.isZooming,l=o.isScrolling;if(o.endPoints=i(t),o.dMs=Math.max((new Date).getTime()-o.startTime,1),o.$container.removeClass("fancybox-is-grabbing"),n(e).off(".fb.touch"),e.removeEventListener("scroll",o.onscroll,!0),o.requestId&&(a(o.requestId),o.requestId=null),o.isSwiping=!1,o.isPanning=!1,o.isZooming=!1,o.isScrolling=!1,o.instance.isDragging=!1,o.canTap)return o.onTap(t);o.speed=100,o.velocityX=o.distanceX/o.dMs*.5,o.velocityY=o.distanceY/o.dMs*.5,r?o.endPanning():c?o.endZooming():o.endSwiping(s,l)},l.prototype.endSwiping=function(t,e){var o=this,a=!1,i=o.instance.group.length,s=Math.abs(o.distanceX),r="x"==t&&i>1&&(o.dMs>130&&s>10||s>50);o.sliderLastPos=null,"y"==t&&!e&&Math.abs(o.distanceY)>50?(n.fancybox.animate(o.instance.current.$slide,{top:o.sliderStartPos.top+o.distanceY+150*o.velocityY,opacity:0},200),a=o.instance.close(!0,250)):r&&o.distanceX>0?a=o.instance.previous(300):r&&o.distanceX<0&&(a=o.instance.next(300)),!1!==a||"x"!=t&&"y"!=t||o.instance.centerSlide(200),o.$container.removeClass("fancybox-is-sliding")},l.prototype.endPanning=function(){var t,e,o,a=this;a.contentLastPos&&(!1===a.opts.momentum||a.dMs>350?(t=a.contentLastPos.left,e=a.contentLastPos.top):(t=a.contentLastPos.left+500*a.velocityX,e=a.contentLastPos.top+500*a.velocityY),(o=a.limitPosition(t,e,a.contentStartPos.width,a.contentStartPos.height)).width=a.contentStartPos.width,o.height=a.contentStartPos.height,n.fancybox.animate(a.$content,o,366))},l.prototype.endZooming=function(){var t,e,o,a,i=this,s=i.instance.current,r=i.newWidth,c=i.newHeight;i.contentLastPos&&(t=i.contentLastPos.left,a={top:e=i.contentLastPos.top,left:t,width:r,height:c,scaleX:1,scaleY:1},n.fancybox.setTranslate(i.$content,a),r<i.canvasWidth&&c<i.canvasHeight?i.instance.scaleToFit(150):r>s.width||c>s.height?i.instance.scaleToActual(i.centerPointStartX,i.centerPointStartY,150):(o=i.limitPosition(t,e,r,c),n.fancybox.animate(i.$content,o,150)))},l.prototype.onTap=function(e){var o,a=this,s=n(e.target),r=a.instance,c=r.current,l=e&&i(e)||a.startPoints,d=l[0]?l[0].x-n(t).scrollLeft()-a.stagePos.left:0,u=l[0]?l[0].y-n(t).scrollTop()-a.stagePos.top:0,p=function(t){var o=c.opts[t];if(n.isFunction(o)&&(o=o.apply(r,[c,e])),o)switch(o){case"close":r.close(a.startEvent);break;case"toggleControls":r.toggleControls();break;case"next":r.next();break;case"nextOrClose":r.group.length>1?r.next():r.close(a.startEvent);break;case"zoom":"image"==c.type&&(c.isLoaded||c.$ghost)&&(r.canPan()?r.scaleToFit():r.isScaledDown()?r.scaleToActual(d,u):r.group.length<2&&r.close(a.startEvent));break}};if((!e.originalEvent||2!=e.originalEvent.button)&&(s.is("img")||!(d>s[0].clientWidth+s.offset().left))){if(s.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container"))o="Outside";else if(s.is(".fancybox-slide"))o="Slide";else{if(!r.current.$content||!r.current.$content.find(s).addBack().filter(s).length)return;o="Content"}if(a.tapped){if(clearTimeout(a.tapped),a.tapped=null,Math.abs(d-a.tapX)>50||Math.abs(u-a.tapY)>50)return this;p("dblclick"+o)}else a.tapX=d,a.tapY=u,c.opts["dblclick"+o]&&c.opts["dblclick"+o]!==c.opts["click"+o]?a.tapped=setTimeout((function(){a.tapped=null,r.isAnimating||p("click"+o)}),500):p("click"+o);return this}},n(e).on("onActivate.fb",(function(t,e){e&&!e.Guestures&&(e.Guestures=new l(e))})).on("beforeClose.fb",(function(t,e){e&&e.Guestures&&e.Guestures.destroy()}))}(window,document,jQuery),function(t,e){"use strict";e.extend(!0,e.fancybox.defaults,{btnTpl:{slideShow:'<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 5.4v13.2l11-6.6z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z"/></svg></button>'},slideShow:{autoStart:!1,speed:3e3,progress:!0}});var n=function(t){this.instance=t,this.init()};e.extend(n.prototype,{timer:null,isActive:!1,$button:null,init:function(){var t=this,n=t.instance,o=n.group[n.currIndex].opts.slideShow;t.$button=n.$refs.toolbar.find("[data-fancybox-play]").on("click",(function(){t.toggle()})),n.group.length<2||!o?t.$button.hide():o.progress&&(t.$progress=e('<div class="fancybox-progress"></div>').appendTo(n.$refs.inner))},set:function(t){var n=this,o=n.instance,a=o.current;a&&(!0===t||a.opts.loop||o.currIndex<o.group.length-1)?n.isActive&&"video"!==a.contentType&&(n.$progress&&e.fancybox.animate(n.$progress.show(),{scaleX:1},a.opts.slideShow.speed),n.timer=setTimeout((function(){o.current.opts.loop||o.current.index!=o.group.length-1?o.next():o.jumpTo(0)}),a.opts.slideShow.speed)):(n.stop(),o.idleSecondsCounter=0,o.showControls())},clear:function(){var t=this;clearTimeout(t.timer),t.timer=null,t.$progress&&t.$progress.removeAttr("style").hide()},start:function(){var t=this,e=t.instance.current;e&&(t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_STOP).removeClass("fancybox-button--play").addClass("fancybox-button--pause"),t.isActive=!0,e.isComplete&&t.set(!0),t.instance.trigger("onSlideShowChange",!0))},stop:function(){var t=this,e=t.instance.current;t.clear(),t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_START).removeClass("fancybox-button--pause").addClass("fancybox-button--play"),t.isActive=!1,t.instance.trigger("onSlideShowChange",!1),t.$progress&&t.$progress.removeAttr("style").hide()},toggle:function(){var t=this;t.isActive?t.stop():t.start()}}),e(t).on({"onInit.fb":function(t,e){e&&!e.SlideShow&&(e.SlideShow=new n(e))},"beforeShow.fb":function(t,e,n,o){var a=e&&e.SlideShow;o?a&&n.opts.slideShow.autoStart&&a.start():a&&a.isActive&&a.clear()},"afterShow.fb":function(t,e,n){var o=e&&e.SlideShow;o&&o.isActive&&o.set()},"afterKeydown.fb":function(n,o,a,i,s){var r=o&&o.SlideShow;!r||!a.opts.slideShow||80!==s&&32!==s||e(t.activeElement).is("button,a,input")||(i.preventDefault(),r.toggle())},"beforeClose.fb onDeactivate.fb":function(t,e){var n=e&&e.SlideShow;n&&n.stop()}}),e(t).on("visibilitychange",(function(){var n=e.fancybox.getInstance(),o=n&&n.SlideShow;o&&o.isActive&&(t.hidden?o.clear():o.set())}))}(document,jQuery),function(t,e){"use strict";var n=function(){for(var e=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n={},o=0;o<e.length;o++){var a=e[o];if(a&&a[1]in t){for(var i=0;i<a.length;i++)n[e[0][i]]=a[i];return n}}return!1}();if(n){var o={request:function(e){(e=e||t.documentElement)[n.requestFullscreen](e.ALLOW_KEYBOARD_INPUT)},exit:function(){t[n.exitFullscreen]()},toggle:function(e){e=e||t.documentElement,this.isFullscreen()?this.exit():this.request(e)},isFullscreen:function(){return Boolean(t[n.fullscreenElement])},enabled:function(){return Boolean(t[n.fullscreenEnabled])}};e.extend(!0,e.fancybox.defaults,{btnTpl:{fullScreen:'<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"/></svg></button>'},fullScreen:{autoStart:!1}}),e(t).on(n.fullscreenchange,(function(){var t=o.isFullscreen(),n=e.fancybox.getInstance();n&&(n.current&&"image"===n.current.type&&n.isAnimating&&(n.isAnimating=!1,n.update(!0,!0,0),n.isComplete||n.complete()),n.trigger("onFullscreenChange",t),n.$refs.container.toggleClass("fancybox-is-fullscreen",t),n.$refs.toolbar.find("[data-fancybox-fullscreen]").toggleClass("fancybox-button--fsenter",!t).toggleClass("fancybox-button--fsexit",t))}))}e(t).on({"onInit.fb":function(t,e){n?e&&e.group[e.currIndex].opts.fullScreen?(e.$refs.container.on("click.fb-fullscreen","[data-fancybox-fullscreen]",(function(t){t.stopPropagation(),t.preventDefault(),o.toggle()})),e.opts.fullScreen&&!0===e.opts.fullScreen.autoStart&&o.request(),e.FullScreen=o):e&&e.$refs.toolbar.find("[data-fancybox-fullscreen]").hide():e.$refs.toolbar.find("[data-fancybox-fullscreen]").remove()},"afterKeydown.fb":function(t,e,n,o,a){e&&e.FullScreen&&70===a&&(o.preventDefault(),e.FullScreen.toggle())},"beforeClose.fb":function(t,e){e&&e.FullScreen&&e.$refs.container.hasClass("fancybox-is-fullscreen")&&o.exit()}})}(document,jQuery),function(t,e){"use strict";var n="fancybox-thumbs",o=n+"-active";e.fancybox.defaults=e.extend(!0,{btnTpl:{thumbs:'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg></button>'},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"}},e.fancybox.defaults);var a=function(t){this.init(t)};e.extend(a.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(t){var e=this,n=t.group,o=0;e.instance=t,e.opts=n[t.currIndex].opts.thumbs,t.Thumbs=e,e.$button=t.$refs.toolbar.find("[data-fancybox-thumbs]");for(var a=0,i=n.length;a<i&&(n[a].thumb&&o++,!(o>1));a++);o>1&&e.opts?(e.$button.removeAttr("style").on("click",(function(){e.toggle()})),e.isActive=!0):e.$button.hide()},create:function(){var t,o=this,a=o.instance,i=o.opts.parentEl,s=[];o.$grid||(o.$grid=e('<div class="'+n+" "+n+"-"+o.opts.axis+'"></div>').appendTo(a.$refs.container.find(i).addBack().filter(i)),o.$grid.on("click","a",(function(){a.jumpTo(e(this).attr("data-index"))}))),o.$list||(o.$list=e('<div class="'+n+'__list">').appendTo(o.$grid)),e.each(a.group,(function(e,n){(t=n.thumb)||"image"!==n.type||(t=n.src),s.push('<a href="javascript:;" tabindex="0" data-index="'+e+'"'+(t&&t.length?' style="background-image:url('+t+')"':'class="fancybox-thumbs-missing"')+"></a>")})),o.$list[0].innerHTML=s.join(""),"x"===o.opts.axis&&o.$list.width(parseInt(o.$grid.css("padding-right"),10)+a.group.length*o.$list.children().eq(0).outerWidth(!0))},focus:function(t){var e,n,a=this,i=a.$list,s=a.$grid;a.instance.current&&(n=(e=i.children().removeClass(o).filter('[data-index="'+a.instance.current.index+'"]').addClass(o)).position(),"y"===a.opts.axis&&(n.top<0||n.top>i.height()-e.outerHeight())?i.stop().animate({scrollTop:i.scrollTop()+n.top},t):"x"===a.opts.axis&&(n.left<s.scrollLeft()||n.left>s.scrollLeft()+(s.width()-e.outerWidth()))&&i.parent().stop().animate({scrollLeft:n.left},t))},update:function(){var t=this;t.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),t.isVisible?(t.$grid||t.create(),t.instance.trigger("onThumbsShow"),t.focus(0)):t.$grid&&t.instance.trigger("onThumbsHide"),t.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),e(t).on({"onInit.fb":function(t,e){var n;e&&!e.Thumbs&&(n=new a(e)).isActive&&!0===n.opts.autoStart&&n.show()},"beforeShow.fb":function(t,e,n,o){var a=e&&e.Thumbs;a&&a.isVisible&&a.focus(o?0:250)},"afterKeydown.fb":function(t,e,n,o,a){var i=e&&e.Thumbs;i&&i.isActive&&71===a&&(o.preventDefault(),i.toggle())},"beforeClose.fb":function(t,e){var n=e&&e.Thumbs;n&&n.isVisible&&!1!==n.opts.hideOnClose&&n.$grid.hide()}})}(document,jQuery),function(t,e){"use strict";e.extend(!0,e.fancybox.defaults,{btnTpl:{share:'<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z"/></svg></button>'},share:{url:function(t,e){return!t.currentHash&&"inline"!==e.type&&"html"!==e.type&&(e.origSrc||e.src)||window.location},tpl:'<div class="fancybox-share"><h1>{{SHARE}}</h1><p><a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg><span>Facebook</span></a><a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg><span>Twitter</span></a><a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg><span>Pinterest</span></a></p><p><input class="fancybox-share__input" type="text" value="{{url_raw}}" onclick="select()" /></p></div>'}}),e(t).on("click","[data-fancybox-share]",(function(){var t,n,o,a,i=e.fancybox.getInstance(),s=i.current||null;s&&("function"===e.type(s.opts.share.url)&&(t=s.opts.share.url.apply(s,[i,s])),n=s.opts.share.tpl.replace(/\{\{media\}\}/g,"image"===s.type?encodeURIComponent(s.src):"").replace(/\{\{url\}\}/g,encodeURIComponent(t)).replace(/\{\{url_raw\}\}/g,(o=t,a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},String(o).replace(/[&<>"'`=\/]/g,(function(t){return a[t]})))).replace(/\{\{descr\}\}/g,i.$caption?encodeURIComponent(i.$caption.text()):""),e.fancybox.open({src:i.translate(i,n),type:"html",opts:{touch:!1,animationEffect:!1,afterLoad:function(t,e){i.$refs.container.one("beforeClose.fb",(function(){t.close(null,0)})),e.$content.find(".fancybox-share__button").click((function(){return window.open(this.href,"Share","width=550, height=450"),!1}))},mobile:{autoFocus:!1}}}))}))}(document,jQuery),function(t,e,n){"use strict";function o(){var e=t.location.hash.substr(1),n=e.split("-"),o=n.length>1&&/^\+?\d+$/.test(n[n.length-1])&&parseInt(n.pop(-1),10)||1;return{hash:e,index:o<1?1:o,gallery:n.join("-")}}function a(t){""!==t.gallery&&n("[data-fancybox='"+n.escapeSelector(t.gallery)+"']").eq(t.index-1).focus().trigger("click.fb-start")}function i(t){var e,n;return!!t&&(""!==(n=(e=t.current?t.current.opts:t.opts).hash||(e.$orig?e.$orig.data("fancybox")||e.$orig.data("fancybox-trigger"):""))&&n)}n.escapeSelector||(n.escapeSelector=function(t){return(t+"").replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,(function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}))}),n((function(){!1!==n.fancybox.defaults.hash&&(n(e).on({"onInit.fb":function(t,e){var n,a;!1!==e.group[e.currIndex].opts.hash&&(n=o(),(a=i(e))&&n.gallery&&a==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(n,o,a,s){var r;a&&!1!==a.opts.hash&&(r=i(o))&&(o.currentHash=r+(o.group.length>1?"-"+(a.index+1):""),t.location.hash!=="#"+o.currentHash&&(s&&!o.origHash&&(o.origHash=t.location.hash),o.hashTimer&&clearTimeout(o.hashTimer),o.hashTimer=setTimeout((function(){"replaceState"in t.history?(t.history[s?"pushState":"replaceState"]({},e.title,t.location.pathname+t.location.search+"#"+o.currentHash),s&&(o.hasCreatedHistory=!0)):t.location.hash=o.currentHash,o.hashTimer=null}),300)))},"beforeClose.fb":function(n,o,a){a&&!1!==a.opts.hash&&(clearTimeout(o.hashTimer),o.currentHash&&o.hasCreatedHistory?t.history.back():o.currentHash&&("replaceState"in t.history?t.history.replaceState({},e.title,t.location.pathname+t.location.search+(o.origHash||"")):t.location.hash=o.origHash),o.currentHash=null)}}),n(t).on("hashchange.fb",(function(){var t=o(),e=null;n.each(n(".fancybox-container").get().reverse(),(function(t,o){var a=n(o).data("FancyBox");if(a&&a.currentHash)return e=a,!1})),e?e.currentHash===t.gallery+"-"+t.index||1===t.index&&e.currentHash==t.gallery||(e.currentHash=null,e.close()):""!==t.gallery&&a(t)})),setTimeout((function(){n.fancybox.getInstance()||a(o())}),50))}))}(window,document,jQuery),function(t,e){"use strict";var n=(new Date).getTime();e(t).on({"onInit.fb":function(t,e,o){e.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll",(function(t){var o=e.current,a=(new Date).getTime();e.group.length<2||!1===o.opts.wheel||"auto"===o.opts.wheel&&"image"!==o.type||(t.preventDefault(),t.stopPropagation(),o.$slide.hasClass("fancybox-animated")||(t=t.originalEvent||t,a-n<250||(n=a,e[(-t.deltaY||-t.deltaX||t.wheelDelta||-t.detail)<0?"next":"previous"]())))}))}})}(document,jQuery);
inc/class-easyfancybox-admin.php CHANGED
@@ -2,34 +2,166 @@
2
  /**
3
  * Easy FancyBox Admin Class.
4
  */
5
- class easyFancyBox_Admin extends easyFancyBox {
6
 
7
- public static $pagehook;
 
 
 
8
 
9
- public static $compat_pro_min = '1.8';
10
 
11
- public static $do_compat_warning = false;
12
 
13
  /**
14
  * ADMIN METHODS
15
  */
16
 
17
- public static function add_settings_section()
18
  {
19
- add_settings_section('fancybox_section', __('FancyBox','easy-fancybox'), array(__CLASS__, 'settings_section'), 'media');
20
  }
21
 
22
- public static function register_settings( $args = array() )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  if ( empty( $args ) ) {
25
- $args = parent::$options;
26
  }
27
 
28
  foreach ( $args as $key => $value ) {
29
  // Check to see if the section is enabled, else skip to next.
30
  if ( ! isset( $value['input'] ) ||
31
- array_key_exists($key, parent::$options['Global']['options']['Enable']['options']) &&
32
- !get_option( parent::$options['Global']['options']['Enable']['options'][$key]['id'], parent::$options['Global']['options']['Enable']['options'][$key]['default'])
33
  ) {
34
  continue;
35
  }
@@ -37,7 +169,7 @@ class easyFancyBox_Admin extends easyFancyBox {
37
  switch( $value['input'] ) {
38
  case 'deep':
39
  // Go deeper by looping back on itself.
40
- self::register_settings($value['options']);
41
  break;
42
 
43
  case 'multiple':
@@ -49,6 +181,7 @@ class easyFancyBox_Admin extends easyFancyBox {
49
  $sanitize_callback = array( __CLASS__, $_value['sanitize_callback'] );
50
  if ( isset($_value['id']) )
51
  register_setting( 'media', $_value['id'], $sanitize_callback );
 
52
  }
53
  break;
54
 
@@ -63,35 +196,6 @@ class easyFancyBox_Admin extends easyFancyBox {
63
  }
64
  }
65
 
66
- // Add our FancyBox Media Settings Section on Settings > Media admin page.
67
- public static function settings_section()
68
- {
69
- echo '<style type="text/css">.options-media-php br { display: initial; }</style><!-- undo WP style rule introduced in 4.9 on settings-media -->
70
- <p><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Easy%20FancyBox&item_number='.EASY_FANCYBOX_VERSION.'&no_shipping=0&tax=0&charset=UTF%2d8&currency_code=EUR" title="'.__('Donate to keep the Easy FancyBox plugin development going!','easy-fancybox').'">
71
- <img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" style="border:none;float:right;margin:5px 0 0 10px" alt="'.__('Donate to keep the Easy FancyBox plugin development going!','easy-fancybox').'" width="92" height="26" /></a>';
72
- echo sprintf( __( 'The options in this section are provided by the plugin %s and determine the <strong>Media Lightbox</strong> overlay appearance and behavior controlled by %s.', 'easy-fancybox' ), '<strong><a href="http://status301.net/wordpress-plugins/easy-fancybox/">' . __( 'Easy FancyBox', 'easy-fancybox' ) . '</a></strong>', '<strong><a href="http://fancybox.net/">' . __( 'FancyBox', 'easy-fancybox' ) . '</a></strong>' );
73
- echo '</p><p>'.__( 'First enable each sub-section that you need. Then save and come back to adjust its specific settings.', 'easy-fancybox' ) . ' ' . __( 'Note: Each additional sub-section and features like <em>Auto-detection</em>, <em>Elastic transitions</em> and all <em>Easing effects</em> (except Swing) will have some extra impact on client-side page speed. Enable only those sub-sections and options that you actually need on your site.', 'easy-fancybox' ) . ' ' . __( 'Some setting like Transition options are unavailable for SWF video, PDF and iFrame content to ensure browser compatibility and readability.', 'easy-fancybox' ) . '</p>';
74
-
75
- // Pro extension message.
76
- if ( ! class_exists('easyFancyBox_Advanced') ) {
77
- echo '<p><a href="'.easyFancyBox::$pro_plugin_url.'"><strong><em>' . __( 'For advanced options and support, please get the Easy FancyBox - Pro extension.', 'easy-fancybox' ) . '</strong></a></p>';
78
- } else {
79
- echo '<p><strong><em>' . __( 'Thank you for purchasing the Easy FancyBox - Pro extension. Your advanced options are available!', 'easy-fancybox' ) . ' <a href="https://premium.status301.com/support/forum/easy-fancybox-pro/">' . __( 'Get support here.', 'easy-fancybox' ) . '</a></em></strong></p>';
80
- }
81
-
82
- // Pro extension version compatibility message.
83
- if ( self::$do_compat_warning ) {
84
- echo '<p class="update-nag">';
85
- _e( 'Notice: The current Easy FancyBox plugin version is not fully compatible with your version of the Pro extension. Some advanced options may not be functional.', 'easy-fancybox' );
86
- echo ' ';
87
- if ( current_user_can( 'install_plugins' ) )
88
- printf( __( 'Please <a href="%1$s" target="_blank">download and install the latest Pro version</a>.', 'easy-fancybox' ), 'https://premium.status301.com/account/' );
89
- else
90
- _e( 'Please contact your web site administrator.', 'easy-fancybox' );
91
- echo '</p>';
92
- }
93
- }
94
-
95
  // Add our FancyBox Media Settings Fields.
96
  public static function settings_fields( $args )
97
  {
@@ -187,7 +291,6 @@ class easyFancyBox_Admin extends easyFancyBox {
187
  if ( isset( $args['description'] ) ) {
188
  $output[] = $args['description'];
189
  }
190
-
191
  }
192
 
193
  else :
@@ -206,8 +309,10 @@ class easyFancyBox_Admin extends easyFancyBox {
206
  */
207
  public static function add_action_link( $links )
208
  {
209
- $settings_link = '<a href="' . admin_url('options-media.php') . '">' . translate('Settings') . '</a>';
210
- array_unshift( $links, $settings_link );
 
 
211
  return $links;
212
  }
213
 
@@ -216,7 +321,7 @@ class easyFancyBox_Admin extends easyFancyBox {
216
  */
217
  public static function plugin_meta_links( $links, $file )
218
  {
219
- if ( $file == plugin_basename(__FILE__) ) {
220
  $links[] = '<a target="_blank" href="https://wordpress.org/support/plugin/easy-fancybox/">' . __('Support','easy-fancybox') . '</a>';
221
  $links[] = '<a target="_blank" href="https://wordpress.org/support/plugin/easy-fancybox/reviews/?filter=5#new-post">' . __('Rate ★★★★★','easy-fancybox') . '</a>';
222
  }
@@ -245,11 +350,33 @@ class easyFancyBox_Admin extends easyFancyBox {
245
  }
246
 
247
  public static function colorval( $setting = '' ) {
248
- // Strip possible # to prepare for sanitizing.
249
- $setting = substr($setting, 0, 1) == '#' ? substr($setting, 1) : $setting;
250
 
251
- // Only allow hex values or empty string.
252
- $sanitized = ctype_xdigit($setting) ? '#'.$setting : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
 
254
  return $sanitized;
255
  }
@@ -283,32 +410,29 @@ class easyFancyBox_Admin extends easyFancyBox {
283
  {
284
  global $current_user;
285
 
 
 
 
 
286
  /* Version Nag */
287
- if ( self::$do_compat_warning && current_user_can( 'install_plugins' ) && !get_user_meta($current_user->ID, 'easy_fancybox_ignore_notice') ) {
288
- echo '<div class="update-nag"><p>';
289
- //echo '<a href="?easy_fancybox_ignore_notice=1" title="' . __('Hide message','easy-fancybox') . '" style="display:block;float:right">X</a>';
290
- _e('Notice: The current Easy FancyBox plugin version is not fully compatible with your version of the Pro extension. Some advanced options may not be functional.','easy-fancybox');
291
- echo '<br />';
292
- printf(__('Please <a href="%1$s" target="_blank">download and install the latest Pro version</a>.','easy-fancybox'), 'https://premium.status301.com/account/');
293
- echo ' ';
294
- printf(__('Or you can ignore and <a href="%1$s">hide this message</a>.','easy-fancybox'), '?easy_fancybox_ignore_notice=1');
295
- echo '</p></div>';
296
  }
297
  }
298
 
299
  public static function load_textdomain()
300
  {
301
- load_plugin_textdomain('easy-fancybox', false, dirname( parent::$plugin_basename ) . '/languages' );
302
  }
303
 
304
- public static function admin_init()
305
  {
306
  /* Dismissable notice */
307
  /* If user clicks to ignore the notice, add that to their user meta */
308
  global $current_user;
309
 
310
  if ( isset( $_GET['easy_fancybox_ignore_notice'] ) && '1' == $_GET['easy_fancybox_ignore_notice'] ) {
311
- add_user_meta($current_user->ID, 'easy_fancybox_ignore_notice', 'true', true);
312
  }
313
 
314
  if (
@@ -326,15 +450,21 @@ class easyFancyBox_Admin extends easyFancyBox {
326
 
327
  public function __construct()
328
  {
329
- add_action('plugins_loaded', array(__CLASS__, 'load_textdomain'));
330
- add_action('admin_notices', array(__CLASS__, 'admin_notice'));
331
- add_filter('plugin_action_links_'.parent::$plugin_basename, array(__CLASS__, 'add_action_link') );
 
 
 
 
 
 
332
 
333
- // In preparation of dedicated admin page move:
334
- //add_action('admin_menu', array(__CLASS__, 'add_menu'));
 
335
 
336
- add_action('admin_init', array(__CLASS__, 'add_settings_section'));
337
- add_action('admin_init', array(__CLASS__, 'register_settings'));
338
- add_action('admin_init', array(__CLASS__, 'admin_init'));
339
  }
340
  }
2
  /**
3
  * Easy FancyBox Admin Class.
4
  */
5
+ class easyFancyBox_Admin {
6
 
7
+ /**
8
+ * Holds the values to be used in the fields callbacks
9
+ */
10
+ private static $screen_id;
11
 
12
+ private static $compat_pro_min = '1.8';
13
 
14
+ private static $do_compat_warning = false;
15
 
16
  /**
17
  * ADMIN METHODS
18
  */
19
 
20
+ public static function add_media_settings_section()
21
  {
22
+ add_settings_section( 'fancybox_section', '<a name="fancybox"></a>'.__( 'FancyBox', 'easy-fancybox' ), function() { include EASY_FANCYBOX_DIR . '/views/settings-section-intro.php'; }, 'media' );
23
  }
24
 
25
+ /**
26
+ * Add options page
27
+ */
28
+ public static function add_options_page()
29
+ {
30
+ // This page will be under "Settings".
31
+ $screen_id = add_options_page (
32
+ __( 'FancyBox', 'easy-fancybox' ),
33
+ __( 'FancyBox', 'easy-fancybox' ),
34
+ 'manage_options',
35
+ 'easy_fancybox',
36
+ array( __CLASS__, 'options_page' ),
37
+ 5
38
+ );
39
+
40
+ // Help tab.
41
+ add_action(
42
+ 'load-'.$screen_id,
43
+ array( __CLASS__, 'help_tab' )
44
+ );
45
+ }
46
+
47
+ public static function help_tab()
48
+ {
49
+ // TODO
50
+ }
51
+
52
+ public static function options_page()
53
  {
54
+ // Prepare sections and settings and nav tabs.
55
+ self::add_settings();
56
+
57
+ // Prepare nav tabs.
58
+ $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'general';
59
+ $tabs = array (
60
+ 'general' => translate( 'General' ),
61
+ //'appearance' => translate( 'Appearance' ),
62
+ //'behavior' => esc_html__( 'Behavior', 'easy-fancybox' ),
63
+ 'images' => get_option( 'fancybox_enableImg' ) ? esc_html__( 'Images', 'easy-fancybox' ) : false,
64
+ 'inline' => get_option( 'fancybox_enableInline' ) ? esc_html__( 'Inline', 'easy-fancybox' ) : false,
65
+ 'pdf' => get_option( 'fancybox_enablePDF' ) ? esc_html__( 'PDF', 'easy-fancybox' ) : false,
66
+ 'swf' => get_option( 'fancybox_enableSWF' ) ? esc_html__( 'SWF', 'easy-fancybox' ) : false,
67
+ /*'video' => get_option( 'fancybox_enableVideoPress' ) ||
68
+ get_option( 'fancybox_enableYoutube' ) || get_option( 'fancybox_enableVimeo' ) ||
69
+ get_option( 'fancybox_enableDailymotion' ) ? esc_html__( 'Video', 'easy-fancybox' ) : false,*/
70
+ 'videopress' => get_option( 'fancybox_enableVideoPress' ) ? esc_html__( 'VideoPress', 'easy-fancybox' ) : false,
71
+ 'youtube' => get_option( 'fancybox_enableYoutube' ) ? esc_html__( 'YouTube', 'easy-fancybox' ) : false,
72
+ 'vimeo' => get_option( 'fancybox_enableVimeo' ) ? esc_html__( 'Vimeo', 'easy-fancybox' ) : false,
73
+ 'dailymotion' => get_option( 'fancybox_enableDailymotion' ) ? esc_html__( 'Dailymotion', 'easy-fancybox' ) : false,
74
+ 'instagram' => get_option( 'fancybox_enableInstagram' ) ? esc_html__( 'Instagram', 'easy-fancybox' ) : false,
75
+ 'googlemaps' => get_option( 'fancybox_enableGoogleMaps' ) ? esc_html__( 'Google Maps', 'easy-fancybox' ) : false,
76
+ 'iframe' => get_option( 'fancybox_enableiFrame' ) ? esc_html__( 'iFrames', 'easy-fancybox' ) : false,
77
+ //'advanced' => esc_html__( 'Advanced', 'easy-fancybox' ),
78
+ );
79
+
80
+ // Render page.
81
+ include EASY_FANCYBOX_DIR . '/views/admin-page.php';
82
+ }
83
+
84
+ public static function add_settings()
85
+ {
86
+ /** SECTIONS */
87
+ add_settings_section( 'easy_fancybox_general_section', null, null, 'easy_fancybox_general' );
88
+ //add_settings_section( 'easy_fancybox_appearance_section', null, null, 'easy_fancybox_appearance' );
89
+ //add_settings_section( 'easy_fancybox_behavior_section', null, null, 'easy_fancybox_behavior' );
90
+
91
+ // Media sections.
92
+ add_settings_section( 'easy_fancybox_images_section', null, null, 'easy_fancybox_images' );
93
+ add_settings_section( 'easy_fancybox_inline_section', null, null, 'easy_fancybox_inline' );
94
+ add_settings_section( 'easy_fancybox_pdf_section', null, null, 'easy_fancybox_pdf' );
95
+ add_settings_section( 'easy_fancybox_swf_section', null, null, 'easy_fancybox_swf' );
96
+ add_settings_section( 'easy_fancybox_videopress_section', null, null, 'easy_fancybox_videopress' );
97
+ add_settings_section( 'easy_fancybox_youtube_section', null, null, 'easy_fancybox_youtube' );
98
+ add_settings_section( 'easy_fancybox_vimeo_section', null, null, 'easy_fancybox_vimeo' );
99
+ add_settings_section( 'easy_fancybox_dailymotion_section', null, null, 'easy_fancybox_dailymotion' );
100
+ add_settings_section( 'easy_fancybox_instagram_section', null, null, 'easy_fancybox_instagram' );
101
+ add_settings_section( 'easy_fancybox_googlemaps_section', null, null, 'easy_fancybox_googlemaps' );
102
+ add_settings_section( 'easy_fancybox_iframe_section', null, null, 'easy_fancybox_iframe' );
103
+
104
+ /** GENERAL */
105
+ add_settings_field( 'fancybox_version', esc_html__( 'Version', 'easy-fancybox' ), function(){ include EASY_FANCYBOX_DIR . '/views/settings-field-version.php'; }, 'easy_fancybox_general', 'easy_fancybox_general_section', array('label_for'=>'fancybox_scriptVersion') );
106
+ add_settings_field( 'fancybox_media', esc_html__( 'Media', 'easy-fancybox' ), function(){ include EASY_FANCYBOX_DIR . '/views/settings-field-media.php'; }, 'easy_fancybox_general', 'easy_fancybox_general_section' );
107
+
108
+ /** IMAGES */
109
+ if ( get_option('fancybox_enableImg') ) {
110
+ add_settings_field( 'fancybox_auto', esc_html__( 'Autodetect', 'easy-fancybox' ), function(){ include EASY_FANCYBOX_DIR . '/views/settings-field-images-auto.php'; }, 'easy_fancybox_images', 'easy_fancybox_images_section', array('label_for'=>'fancybox_autoAttribute') );
111
+ //add_settings_field( 'fancybox_autolimit', esc_html__( 'Autodetect', 'easy-fancybox' ), function(){ include EASY_FANCYBOX_DIR . '/views/settings-field-images-auto-limit.php'; }, 'easy_fancybox_images', 'easy_fancybox_images_section', array('label_for'=>'fancybox_autoAttributeLimit') );
112
+
113
+ }
114
+ }
115
+
116
+ public static function register_settings()
117
+ {
118
+ // Version.
119
+ register_setting( 'easy_fancybox_general', 'fancybox_scriptVersion', array( 'default' => 'classic', 'sanitize_callback' => 'sanitize_text_field' ) );
120
+ // Media.
121
+ register_setting( 'easy_fancybox_general', 'fancybox_enableImg', array( 'default' => ( function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( EASY_FANCYBOX_BASENAME ) ) ? '' : '1', 'sanitize_callback' => 'boolval' ) );
122
+ register_setting( 'easy_fancybox_general', 'fancybox_enableInline', array( 'default' => '', 'sanitize_callback' => 'boolval' ) );
123
+ register_setting( 'easy_fancybox_general', 'fancybox_enablePDF', array( 'default' => '', 'sanitize_callback' => 'boolval' ) );
124
+ register_setting( 'easy_fancybox_general', 'fancybox_enableSWF', array( 'default' => '', 'sanitize_callback' => 'boolval' ) );
125
+ register_setting( 'easy_fancybox_general', 'fancybox_enableVideoPress', array( 'default' => '', 'sanitize_callback' => 'boolval' ) );
126
+ register_setting( 'easy_fancybox_general', 'fancybox_enableYoutube', array( 'default' => '', 'sanitize_callback' => 'boolval' ) );
127
+ register_setting( 'easy_fancybox_general', 'fancybox_enableVimeo', array( 'default' => '', 'sanitize_callback' => 'boolval' ) );
128
+ register_setting( 'easy_fancybox_general', 'fancybox_enableDailymotion', array( 'default' => '', 'sanitize_callback' => 'boolval' ) );
129
+ register_setting( 'easy_fancybox_general', 'fancybox_enableInstagram', array( 'default' => '', 'sanitize_callback' => 'boolval' ) );
130
+ register_setting( 'easy_fancybox_general', 'fancybox_enableGoogleMaps', array( 'default' => '', 'sanitize_callback' => 'boolval' ) );
131
+ register_setting( 'easy_fancybox_general', 'fancybox_enableiFrame', array( 'default' => '', 'sanitize_callback' => 'boolval' ) );
132
+
133
+ // Images.
134
+ register_setting( 'easy_fancybox_images', 'fancybox_autoAttribute', array( 'default' => '.jpg,.png,.webp', 'sanitize_callback' => array( __CLASS__, 'csl_text' ) ) );
135
+ register_setting( 'easy_fancybox_images', 'fancybox_autoAttributeLimit', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field' ) );
136
+ //register_setting( 'easy_fancybox_images', 'fancybox_', array( 'default' => '', 'sanitize_callback' => array( __CLASS__, 'csl_text' ) ) );
137
+ //register_setting( 'easy_fancybox_images', 'fancybox_', array( 'default' => '', 'sanitize_callback' => array( __CLASS__, 'csl_text' ) ) );
138
+ //register_setting( 'easy_fancybox_images', 'fancybox_', array( 'default' => '', 'sanitize_callback' => array( __CLASS__, 'csl_text' ) ) );
139
+ //register_setting( 'easy_fancybox_images', 'fancybox_', array( 'default' => '', 'sanitize_callback' => array( __CLASS__, 'csl_text' ) ) );
140
+ //register_setting( 'easy_fancybox_images', 'fancybox_', array( 'default' => '', 'sanitize_callback' => array( __CLASS__, 'csl_text' ) ) );
141
+ //register_setting( 'easy_fancybox_images', 'fancybox_', array( 'default' => '', 'sanitize_callback' => array( __CLASS__, 'csl_text' ) ) );
142
+ }
143
+
144
+ public static function register_media_settings( $args = array() )
145
+ {
146
+ /* if ( ! in_array( get_option( 'fancybox_scriptVersion', 'classic' ), array( 'classic', 'legacy' ) ) ) {
147
+ register_setting( 'media', 'easy_fancyboxEnabled', array( 'default' => ( function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( EASY_FANCYBOX_BASENAME ) ) ? '' : '1', 'sanitize_callback' => 'int' ) );
148
+ add_settings_field( 'easy_fancyboxEnabled', esc_html__('FancyBox','easy-fancybox'), function(){ include EASY_FANCYBOX_DIR . '/views/settings-field-enable.php'; }, 'media', 'fancybox_section', array('label_for'=>'easy_fancyboxEnabled') );
149
+ return;
150
+ }*/
151
+
152
+ // Version.
153
+ add_settings_field( 'fancybox_scriptVersion', esc_html__('Version','easy-fancybox'), function(){ include EASY_FANCYBOX_DIR . '/views/settings-field-version.php'; }, 'media', 'fancybox_section', array('label_for'=>'fancybox_scriptVersion') );
154
+ register_setting( 'media', 'fancybox_scriptVersion', 'sanitize_text_field' );
155
+
156
  if ( empty( $args ) ) {
157
+ $args = easyFancyBox::$options;
158
  }
159
 
160
  foreach ( $args as $key => $value ) {
161
  // Check to see if the section is enabled, else skip to next.
162
  if ( ! isset( $value['input'] ) ||
163
+ array_key_exists($key, easyFancyBox::$options['Global']['options']['Enable']['options']) &&
164
+ !get_option( easyFancyBox::$options['Global']['options']['Enable']['options'][$key]['id'], easyFancyBox::$options['Global']['options']['Enable']['options'][$key]['default'])
165
  ) {
166
  continue;
167
  }
169
  switch( $value['input'] ) {
170
  case 'deep':
171
  // Go deeper by looping back on itself.
172
+ self::register_media_settings($value['options']);
173
  break;
174
 
175
  case 'multiple':
181
  $sanitize_callback = array( __CLASS__, $_value['sanitize_callback'] );
182
  if ( isset($_value['id']) )
183
  register_setting( 'media', $_value['id'], $sanitize_callback );
184
+ //register_setting( 'media', $_value['id'], isset($_value['sanitize_callback']) ? array( __CLASS__, $_value['sanitize_callback'] ) : '' );
185
  }
186
  break;
187
 
196
  }
197
  }
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  // Add our FancyBox Media Settings Fields.
200
  public static function settings_fields( $args )
201
  {
291
  if ( isset( $args['description'] ) ) {
292
  $output[] = $args['description'];
293
  }
 
294
  }
295
 
296
  else :
309
  */
310
  public static function add_action_link( $links )
311
  {
312
+ $url = admin_url( 'options-media.php#fancybox' );
313
+
314
+ array_unshift( $links, '<a href="' . $url . '">' . translate( 'Settings' ) . '</a>' );
315
+
316
  return $links;
317
  }
318
 
321
  */
322
  public static function plugin_meta_links( $links, $file )
323
  {
324
+ if ( $file == EASY_FANCYBOX_BASENAME ) {
325
  $links[] = '<a target="_blank" href="https://wordpress.org/support/plugin/easy-fancybox/">' . __('Support','easy-fancybox') . '</a>';
326
  $links[] = '<a target="_blank" href="https://wordpress.org/support/plugin/easy-fancybox/reviews/?filter=5#new-post">' . __('Rate ★★★★★','easy-fancybox') . '</a>';
327
  }
350
  }
351
 
352
  public static function colorval( $setting = '' ) {
353
+ $setting = trim( $setting );
354
+ $sanitized = '';
355
 
356
+ // Is it a hex value?
357
+ if ( substr( $setting, 0, 1 ) == '#' ) {
358
+ // Strip #.
359
+ $setting = substr( $setting, 1 );
360
+
361
+ // Only allow hex values or empty string.
362
+ $sanitized = ctype_xdigit( $setting ) ? '#'.$setting : '';
363
+ }
364
+
365
+ // Is it an rgb value?
366
+ if ( substr( $setting, 0, 3 ) == 'rgb' ) {
367
+ // Strip...
368
+ $setting = str_replace( array('rgb(','rgba(',')'), '', $setting );
369
+
370
+ $rgb_array = explode( ',', $setting );
371
+
372
+ if ( $rgb_array ) {
373
+ $r = isset( $rgb_array[0] ) ? (int) $rgb_array[0] : 119;
374
+ $g = isset( $rgb_array[1] ) ? (int) $rgb_array[1] : 119;
375
+ $b = isset( $rgb_array[2] ) ? (int) $rgb_array[2] : 119;
376
+ $a = isset( $rgb_array[3] ) ? (float) $rgb_array[3] : 0.7;
377
+ $sanitized = 'rgba('.$r.','.$g.','.$b.','.$a.')';
378
+ }
379
+ }
380
 
381
  return $sanitized;
382
  }
410
  {
411
  global $current_user;
412
 
413
+ if ( get_user_meta( $current_user->ID, 'easy_fancybox_ignore_notice' ) || ! current_user_can( 'install_plugins' ) ) {
414
+ return;
415
+ }
416
+
417
  /* Version Nag */
418
+ if ( self::$do_compat_warning ) {
419
+ include EASY_FANCYBOX_DIR . '/views/admin-notice.php';
 
 
 
 
 
 
 
420
  }
421
  }
422
 
423
  public static function load_textdomain()
424
  {
425
+ load_plugin_textdomain('easy-fancybox', false, dirname( EASY_FANCYBOX_BASENAME ) . '/languages' );
426
  }
427
 
428
+ public static function compat_warning()
429
  {
430
  /* Dismissable notice */
431
  /* If user clicks to ignore the notice, add that to their user meta */
432
  global $current_user;
433
 
434
  if ( isset( $_GET['easy_fancybox_ignore_notice'] ) && '1' == $_GET['easy_fancybox_ignore_notice'] ) {
435
+ add_user_meta( $current_user->ID, 'easy_fancybox_ignore_notice', 'true', true );
436
  }
437
 
438
  if (
450
 
451
  public function __construct()
452
  {
453
+ // Text domain.
454
+ add_action( 'plugins_loaded', array(__CLASS__, 'load_textdomain') );
455
+
456
+ // Admin notices.
457
+ add_action( 'admin_init', array(__CLASS__, 'compat_warning') );
458
+ add_action( 'admin_notices', array(__CLASS__, 'admin_notice') );
459
+
460
+ // Plugin action links.
461
+ add_filter( 'plugin_action_links_'.EASY_FANCYBOX_BASENAME, array(__CLASS__, 'add_action_link') );
462
 
463
+ // Options page V2
464
+ //add_action( 'admin_init', array(__CLASS__, 'register_settings') );
465
+ //add_action( 'admin_menu', array(__CLASS__, 'add_options_page') );
466
 
467
+ add_action( 'admin_init', array(__CLASS__, 'register_media_settings') );
468
+ add_action( 'admin_init', array(__CLASS__, 'add_media_settings_section') );
 
469
  }
470
  }
inc/class-easyfancybox.php CHANGED
@@ -5,23 +5,38 @@
5
 
6
  class easyFancyBox {
7
 
8
- private static $plugin_url;
 
 
9
 
10
  public static $plugin_basename;
11
 
12
- public static $plugin_dir;
13
 
14
- private static $inline_script;
 
 
 
15
 
16
- private static $inline_style;
17
 
18
- private static $inline_style_ie;
19
 
20
- public static $priority = 10;
21
 
22
- public static $onready_auto = false;
 
 
 
 
 
 
23
 
24
- public static $add_scripts = false;
 
 
 
 
25
 
26
  public static $options = array();
27
 
@@ -29,395 +44,130 @@ class easyFancyBox {
29
 
30
  public static $pro_plugin_url = "https://premium.status301.com/downloads/easy-fancybox-pro/";
31
 
32
- /**********************
33
- MAIN INLINE SCRIPT
34
- **********************/
35
 
36
- private static function main()
37
  {
38
- // Check for any enabled sections.
39
- foreach ( self::$options['Global']['options']['Enable']['options'] as $value ) {
40
- if ( isset($value['id']) && '1' == get_option($value['id'],$value['default']) ) {
41
- self::$add_scripts = true;
42
- break;
43
- }
44
  }
45
 
46
- // Abort when none are active.
47
- if ( !self::$add_scripts )
48
- return false;
49
-
50
- // Begin building output FancyBox settings.
51
- $script = 'var fb_timeout, fb_opts={';
52
-
53
- /**
54
- * Global settings routine.
55
- */
56
- $more = 0;
57
- foreach (self::$options['Global']['options'] as $globals) {
58
- foreach ($globals['options'] as $_key => $_value) {
59
- if ( isset($_value['id']) )
60
- if ( isset($_value['default']) )
61
- $parm = get_option($_value['id'], $_value['default']);
62
- else
63
- $parm = get_option($_value['id']);
64
- elseif ( isset($_value['default']) )
65
- $parm = $_value['default'];
66
- else
67
- $parm = '';
68
-
69
- if ( isset($_value['input']) && 'checkbox'==$_value['input'] )
70
- $parm = ( '1' == $parm ) ? 'true' : 'false';
71
-
72
- if( !isset($_value['hide']) && $parm!='' ) {
73
- $quote = (is_numeric($parm) || (isset($_value['noquotes']) && $_value['noquotes'] == true) ) ? '' : '\'';
74
- if ($more>0)
75
- $script .= ',';
76
- $script .= '\''.$_key.'\':';
77
- $script .= $quote.$parm.$quote;
78
- $more++;
79
- } else {
80
- ${$_key} = $parm;
81
  }
82
  }
 
 
 
 
 
 
83
  }
84
 
85
- $script .= ' };
86
- if(typeof easy_fancybox_handler===\'undefined\'){
87
- var easy_fancybox_handler=function(){';
 
 
 
 
 
 
 
 
88
 
89
- $exclude = get_option( 'fancybox_autoExclude', self::$options['Global']['options']['Miscellaneous']['options']['autoExclude']['default'] );
90
- $exclude_array = $exclude ? explode( ',', $exclude ) : array();
91
- $exclude_selectors = ! empty( $exclude_array ) ? wp_json_encode( $exclude_array ) : false;
92
- if ( $exclude_selectors ) {
93
- $script .= '
94
- jQuery(' . $exclude_selectors . '.join(\',\')).addClass(\'nofancybox\');';
95
  }
96
 
97
- $script .= '
98
- jQuery(\'a.fancybox-close\').on(\'click\',function(e){e.preventDefault();jQuery.fancybox.close()});';
99
-
100
- foreach (self::$options as $key => $value) {
101
- // Check if not enabled or hide=true then skip.
102
- if ( isset( $value['hide'] ) || ! isset( self::$options['Global']['options']['Enable']['options'][$key]['id'] ) || ! get_option( self::$options['Global']['options']['Enable']['options'][$key]['id'], self::$options['Global']['options']['Enable']['options'][$key]['default'] ) )
103
- continue;
104
-
105
- $script .= '
106
- /* ' . $key . ' */';
107
 
108
- /**
109
- * Auto-detection routines (2x)
110
- */
111
- $autoAttribute = isset( $value['options']['autoAttribute'] ) ? get_option( $value['options']['autoAttribute']['id'], $value['options']['autoAttribute']['default'] ) : '';
112
 
113
- if ( !empty($autoAttribute) ) {
114
- if ( is_numeric($autoAttribute) ) {
115
- $script .= '
116
- jQuery('.$value['options']['autoAttribute']['selector'].').not(\'.nofancybox,li.nofancybox>a\').addClass(\''.$value['options']['class']['default'].'\');';
 
117
  } else {
118
- // Set selectors.
119
- $file_types = array_filter( explode( ',', str_replace( ' ', ',', $autoAttribute ) ) );
120
- $more = 0;
121
- $script .= '
122
- var fb_'.$key.'_select=\'';
123
- foreach ( $file_types as $type ) {
124
- if ($type == "jpg" || $type == "jpeg" || $type == "png" || $type == "webp" || $type == "gif")
125
- $type = '.'.$type;
126
- if ($more>0)
127
- $script .= ',';
128
- $script .= 'a['.$value['options']['autoAttribute']['selector'].'"'.$type.'"]:not(.nofancybox,li.nofancybox>a),area['.$value['options']['autoAttribute']['selector'].'"'.$type.'"]:not(.nofancybox)';
129
- $more++;
130
- }
131
- $script .= '\';';
132
-
133
- $autoselector = class_exists('easyFancyBox_Advanced') ? get_option($value['options']['autoSelector']['id'],$value['options']['autoSelector']['default']) : $value['options']['autoSelector']['default'];
134
-
135
- // Class and rel depending on settings.
136
- if( '1' == get_option($value['options']['autoAttributeLimit']['id'],$value['options']['autoAttributeLimit']['default']) ) {
137
- // Add class.
138
- $script .= '
139
- var fb_'.$key.'_sections=jQuery(\''.$autoselector.'\');
140
- fb_'.$key.'_sections.each(function(){jQuery(this).find(fb_'.$key.'_select).addClass(\''.$value['options']['class']['default'].'\')';
141
- // Set rel.
142
- switch( get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
143
- case '':
144
- default :
145
- $script .= ';});';
146
- break;
147
-
148
- case '1':
149
- $script .= '.attr(\'rel\',\'gallery-\'+fb_'.$key.'_sections.index(this));});';
150
- break;
151
-
152
- case '2':
153
- $script .= '.attr(\'rel\',\'gallery\');});';
154
- break;
155
- }
156
- } else {
157
- // Add class.
158
- $script .= '
159
- jQuery(fb_'.$key.'_select).addClass(\''.$value['options']['class']['default'].'\')';
160
- // Set rel.
161
- switch( get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
162
- case '':
163
- default :
164
- $script .= ';';
165
- break;
166
-
167
- case '1':
168
- $script .= ';
169
- var fb_'.$key.'_sections=jQuery(\''.$autoselector.'\');
170
- fb_'.$key.'_sections.each(function(){jQuery(this).find(fb_'.$key.'_select).attr(\'rel\',\'gallery-\'+fb_'.$key.'_sections.index(this));});';
171
- break;
172
-
173
- case '2':
174
- $script .= '.attr(\'rel\',\'gallery\');';
175
- break;
176
- }
177
- }
178
  }
179
  }
180
-
181
- /**
182
- * Generate .fancybox() bind.
183
- */
184
-
185
- // Prepare auto popup.
186
- if ( $key == $autoClick )
187
- $trigger = $value['options']['class']['default'];
188
-
189
- $script .= '
190
- jQuery(\'' . $value['options']['tag']['default'] . '\')';
191
-
192
- // Use each() to allow different metadata values per instance; fix by Elron. Thanks!
193
- $script .= '.each(function(){';
194
-
195
- // Filter here.
196
- $bind = 'jQuery(this).fancybox(jQuery.extend({},fb_opts,{';
197
- $more = 0;
198
- foreach ( $value['options'] as $_key => $_value ) {
199
- if ( isset($_value['id']) || isset($_value['default']) )
200
- $parm = isset($_value['id']) ? strval( get_option($_value['id'], $_value['default']) ) : strval( $_value['default'] );
201
- else
202
- $parm = '';
203
-
204
- if ( isset($_value['input']) && 'checkbox'==$_value['input'] )
205
- $parm = ( '1' == $parm ) ? 'true' : 'false';
206
-
207
- if ( !isset($_value['hide']) && $parm!='' ) {
208
- $quote = ( is_numeric($parm) || ( isset($_value['noquotes']) && $_value['noquotes'] == true ) ) ? '' : '\'';
209
- if ( $more > 0 )
210
- $bind .= ',';
211
- $bind .= '\''.$_key.'\':';
212
- $bind .= $quote.$parm.$quote;
213
- $more++;
214
- }
215
  }
216
- $bind .= '}))';
217
-
218
- $script .= apply_filters( 'easy_fancybox_bind', $bind );
219
-
220
- $script .= '});';
221
  }
222
 
223
- $script .= '
224
- };};';
225
-
226
- if ( empty($delayClick) ) $delayClick = '0';
227
-
228
- switch ( $autoClick ) {
229
- case '':
230
- break;
231
-
232
- case '1':
233
- $script .= '
234
- var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'#fancybox-auto\').trigger(\'click\')},'.$delayClick.');};';
235
- self::$onready_auto = true;
236
- break;
237
-
238
- case '2':
239
- $script .= '
240
- var easy_fancybox_auto=function(){setTimeout(function(){if(location.hash){jQuery(location.hash).trigger(\'click\');}},'.$delayClick.');};';
241
- self::$onready_auto = true;
242
- break;
243
-
244
- case '99':
245
- $script .= '
246
- var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class|="fancybox"]\').filter(\':first\').trigger(\'click\')},'.$delayClick.');};';
247
- self::$onready_auto = true;
248
- break;
249
-
250
- default :
251
- if ( !empty($trigger) ) {
252
- $script .= '
253
- var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class*="'.$trigger.'"]\').filter(\':first\').trigger(\'click\')},'.$delayClick.');};';
254
- self::$onready_auto = true;
255
  }
256
- }
257
-
258
- $script .= PHP_EOL;
259
-
260
- self::$inline_script = apply_filters( 'easy_fancybox_inline_script', $script );
261
-
262
- /**
263
- * HEADER STYLES
264
- */
265
-
266
- // Customized styles.
267
- $styles = '';
268
- if ( isset($overlaySpotlight) && 'true' == $overlaySpotlight )
269
- $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%}';
270
-
271
- if ( !empty($borderRadius) )
272
- $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}';
273
-
274
- $content_style = '';
275
- if ( !empty($backgroundColor) )
276
- $content_style .= 'background:'.$backgroundColor.';';
277
-
278
- if ( !empty($paddingColor) )
279
- $content_style .= 'border-color:'.$paddingColor.';';
280
-
281
- if ( !empty($textColor) ) {
282
- $content_style .= 'color:'.$textColor.';';
283
- $styles .= '#fancybox-outer{background:'.$paddingColor.'}'; //.fancybox-title-inside{background-color:'.$paddingColor.';margin-left:0 !important;margin-right:0 !important;width:100% !important;}
284
- }
285
- if ( !empty($content_style) )
286
- $styles .= '#fancybox-content{'.$content_style.'}';
287
-
288
- if ( !empty($titleColor) )
289
- $styles .= '#fancybox-title,#fancybox-title-float-main{color:'.$titleColor.'}';
290
-
291
- if ( !empty($styles) )
292
- self::$inline_style = wp_strip_all_tags( $styles, true );
293
-
294
- // Running our IE alphaimageloader relative path styles here.
295
- if ( isset($compatIE8) && 'true' == $compatIE8 ) {
296
- self::$inline_style_ie = '/* IE6 */
297
- .fancybox-ie6 #fancybox-close{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_close.png",sizingMethod="scale")}
298
- .fancybox-ie6 #fancybox-left-ico{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_nav_left.png",sizingMethod="scale")}
299
- .fancybox-ie6 #fancybox-right-ico{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_nav_right.png",sizingMethod="scale")}
300
- .fancybox-ie6 #fancybox-title-over{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_title_over.png",sizingMethod="scale");zoom:1}
301
- .fancybox-ie6 #fancybox-title-float-left{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_title_left.png",sizingMethod="scale")}
302
- .fancybox-ie6 #fancybox-title-float-main{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_title_main.png",sizingMethod="scale")}
303
- .fancybox-ie6 #fancybox-title-float-right{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_title_right.png",sizingMethod="scale")}
304
- #fancybox-loading.fancybox-ie6 div{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_loading.png",sizingMethod="scale")}
305
- /* IE6, IE7, IE8 */
306
- .fancybox-ie #fancybox-title-over{background-image:url('.self::$plugin_url.'images/fancy_title_over.png)}
307
- .fancybox-ie #fancybox-bg-n{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_shadow_n.png",sizingMethod="scale")}
308
- .fancybox-ie #fancybox-bg-ne{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_shadow_ne.png",sizingMethod="scale")}
309
- .fancybox-ie #fancybox-bg-e{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_shadow_e.png",sizingMethod="scale")}
310
- .fancybox-ie #fancybox-bg-se{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_shadow_se.png",sizingMethod="scale")}
311
- .fancybox-ie #fancybox-bg-s{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_shadow_s.png",sizingMethod="scale")}
312
- .fancybox-ie #fancybox-bg-sw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_shadow_sw.png",sizingMethod="scale")}
313
- .fancybox-ie #fancybox-bg-w{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_shadow_w.png",sizingMethod="scale")}
314
- .fancybox-ie #fancybox-bg-nw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/fancy_shadow_nw.png",sizingMethod="scale")}';
315
-
316
- if ( isset($overlaySpotlight) && 'true' == $overlaySpotlight )
317
- self::$inline_style_ie .= '
318
- #fancybox-overlay{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.self::$plugin_url.'images/light-mask.png",sizingMethod="scale")}';
319
- }
320
-
321
- return true;
322
- }
323
-
324
- /***********************
325
- ACTIONS & FILTERS
326
- ***********************/
327
-
328
- public static function enqueue_scripts()
329
- {
330
- // Make sure whe actually need to do anything.
331
- if ( !self::$add_scripts )
332
- return;
333
-
334
- global $wp_styles;
335
- $min = ( defined('WP_DEBUG') && WP_DEBUG ) ? '' : '.min';
336
-
337
- // ENQUEUE STYLE
338
- wp_enqueue_style( 'fancybox', self::$plugin_url.'css/jquery.fancybox'.$min.'.css', false, FANCYBOX_VERSION, 'screen' );
339
- if ( !empty(self::$inline_style_ie) ) {
340
- wp_enqueue_style( 'fancybox-ie', self::$plugin_url.'css/jquery.fancybox-ie'.$min.'.css', false, FANCYBOX_VERSION, 'screen' );
341
- $wp_styles->add_data( 'fancybox-ie', 'conditional', 'lt IE 9' );
342
- }
343
-
344
- // ENQUEUE SCRIPTS
345
- $dep = get_option( 'fancybox_nojQuery', false ) ? array() : array('jquery');
346
- $footer = get_option( 'fancybox_noFooter', false ) ? false : true;
347
-
348
- // Register main fancybox script.
349
- wp_enqueue_script( 'jquery-fancybox', self::$plugin_url.'js/jquery.fancybox'.$min.'.js', $dep, FANCYBOX_VERSION, $footer );
350
-
351
- // jQuery Easing, which is ot needed if jQueryUI Core Effects are loaded.
352
- if ( !wp_script_is( 'jquery-effects-core', 'enqueued' ) ) {
353
- $add_easing = false;
354
- // Test for easing in IMG settings.
355
- if ( get_option( 'fancybox_enableImg', self::$options['Global']['options']['Enable']['options']['IMG']['default'] )
356
- && ( 'elastic' === get_option( 'fancybox_transitionIn', 'elastic' )
357
- || 'elastic' === get_option( 'fancybox_transitionOut', 'elastic' ) ) )
358
- $add_easing = true;
359
- // Test for easing in Inline settings.
360
- if ( get_option( 'fancybox_enableInline', false )
361
- && ( 'elastic' === get_option( 'fancybox_transitionInInline' )
362
- || 'elastic' === get_option( 'fancybox_transitionOutInline' ) ) )
363
- $add_easing = true;
364
- // Enqueue easing?
365
- if ( $add_easing ) {
366
- wp_enqueue_script( 'jquery-easing', self::$plugin_url.'js/jquery.easing'.$min.'.js', $dep, EASING_VERSION, $footer );
367
  }
368
- }
369
-
370
- // jQuery Mousewheel, which is not needed if jQueryUI Mouse is loaded.
371
- if ( get_option( 'fancybox_mouseWheel', true ) && !wp_script_is( 'jquery-ui-mouse', 'enqueued' ) ) {
372
- wp_enqueue_script( 'jquery-mousewheel', self::$plugin_url.'js/jquery.mousewheel'.$min.'.js', $dep, MOUSEWHEEL_VERSION, $footer );
373
- }
374
-
375
- // Metadata in Miscellaneous settings?
376
- if ( get_option( 'fancybox_metaData' ) ) {
377
- wp_enqueue_script( 'jquery-metadata',self::$plugin_url.'js/jquery.metadata'.$min.'.js', $dep, METADATA_VERSION, $footer );
378
- }
379
-
380
- if ( get_option( 'fancybox_pre45Compat', false ) || !function_exists( 'wp_add_inline_script' ) ) {
381
- // Do it the old way.
382
- if ( !empty(self::$inline_style) )
383
- add_action( 'wp_head', array(__CLASS__, 'print_inline_style'), 11 );
384
- if ( !empty(self::$inline_style_ie) )
385
- add_action( 'wp_head', array(__CLASS__, 'print_inline_style_ie'), 12 );
386
- if ( !empty(self::$inline_script) )
387
- add_action( $footer ? 'wp_footer' : 'wp_head', array(__CLASS__, 'print_inline_script'), self::$priority + 1 );
388
  } else {
389
- if ( !empty(self::$inline_style) )
390
- wp_add_inline_style( 'fancybox', self::$inline_style );
391
- if ( !empty(self::$inline_style_ie) )
392
- wp_add_inline_style( 'fancybox-ie', self::$inline_style_ie );
393
- if ( !empty(self::$inline_script) )
394
- wp_add_inline_script( 'jquery-fancybox', self::$inline_script );
395
  }
396
 
397
- do_action( 'easy_fancybox_enqueue_scripts', array($min,$dep,$footer) );
398
- }
399
-
400
- // Fallback methods for WordPress pre-4.5
401
- public static function print_inline_script()
402
- {
403
- print( '<script type="text/javascript">' . self::$inline_script . '</script>' );
404
- }
405
-
406
- public static function print_inline_style()
407
- {
408
- print( '<style id="fancybox-inline-css" type="text/css">' . self::$inline_style . '</style>' );
409
- }
410
-
411
- public static function print_inline_style_ie()
412
- {
413
- print( '<!--[if lt IE 9]><style id="fancybox-inline-css-ie" type="text/css">' . self::$inline_style_ie . '</style><![endif]-->' );
414
  }
415
 
416
  // Hack to fix missing wmode in Youtube oEmbed code based on David C's code in the comments on
417
  // http://www.mehigh.biz/wordpress/adding-wmode-transparent-to-wordpress-3-media-embeds.html
418
  // without the wmode, videos will float over the light box no matter what z-index is set.
419
- public static function add_video_wmode_opaque($html)
420
  {
 
 
 
 
 
421
  if ( strpos($html, "<embed src=" ) !== false ) {
422
  $html = str_replace('</param><embed', '</param><param name="wmode" value="opaque"></param><embed wmode="opaque"', $html);
423
  } elseif ( strpos($html, 'youtube' ) !== false && strpos($html, 'wmode' ) == false ) {
@@ -427,75 +177,153 @@ var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class*="'.$tr
427
  } elseif ( strpos($html, "dailymotion" ) !== false && strpos($html, 'wmode' ) == false ) {
428
  $html = str_replace('" width', '?wmode=opaque" width', $html);
429
  }
 
430
  return $html;
431
  }
432
 
433
- public static function onready_callback( $content )
434
  {
435
- $content .= 'jQuery(easy_fancybox_handler);jQuery(document).on(\'' . implode(" ", self::$events) . '\',easy_fancybox_handler);' . PHP_EOL;
436
 
437
- if ( self::$onready_auto )
438
- $content .= apply_filters( 'easy_fancybox_onready_auto', 'jQuery(easy_fancybox_auto);' );
439
-
440
- return $content;
441
  }
442
 
443
  public static function upgrade( $old_version )
444
  {
445
- if ( ! $old_version ) { // Upgrade from 1.7 or older.
446
- if ( 'html' === get_option('fancybox_PDFclassType') ) {
447
- update_option('fancybox_PDFonStart', 'function(a,i,o){o.type=\'pdf\';}');
448
- delete_option('fancybox_PDFclassType');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
449
  }
450
  }
 
451
  // Save new version.
452
  update_option( 'easy_fancybox_version', EASY_FANCYBOX_VERSION );
453
  }
454
 
455
- public static function load_defaults()
456
  {
457
- if ( empty( self::$options ) ) {
458
- include self::$plugin_dir . '/inc/easyfancybox-options.php';
459
- self::$options = $efb_options;
 
460
  }
 
 
461
  }
462
 
463
- public static function maybe_upgrade()
464
  {
465
- $old_version = get_option('easy_fancybox_version', 0);
466
-
467
- if ( 0 !== version_compare( EASY_FANCYBOX_VERSION, $old_version ) ) {
468
- self::upgrade( $old_version );
469
  }
 
 
470
  }
471
 
472
- public static function load_main()
473
  {
474
- // Treat settings and prepare inline scripts and styles, or log debug message.
475
- if ( self::main() ) {
476
- $priority = get_option( 'fancybox_scriptPriority' );
477
- if ( is_numeric($priority) ) self::$priority = $priority;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
 
479
- add_action( 'wp_enqueue_scripts', array(__CLASS__,'enqueue_scripts'), self::$priority );
480
- add_filter( 'embed_oembed_html', array(__CLASS__,'add_video_wmode_opaque'), 10 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
481
  }
 
 
 
482
  }
483
 
484
- /**********************
485
- RUN
486
- **********************/
487
 
488
- public function __construct( $file )
489
  {
490
  // VARS
491
- self::$plugin_url = plugins_url( '/', $file );
492
- self::$plugin_basename = plugin_basename( $file );
493
- self::$plugin_dir = dirname( $file );
494
-
495
- add_action( 'init', array(__CLASS__, 'maybe_upgrade') );
496
- add_action( 'init', array(__CLASS__, 'load_defaults') );
497
- add_action( 'init', array(__CLASS__, 'load_main'), 12 );
498
 
499
- add_filter( 'easy_fancybox_inline_script', array(__CLASS__,'onready_callback') );
 
500
  }
501
  }
5
 
6
  class easyFancyBox {
7
 
8
+ public static $plugin_url;
9
+
10
+ public static $priority;
11
 
12
  public static $plugin_basename;
13
 
14
+ public static $add_scripts;
15
 
16
+ public static $styles = array();
17
+ public static $inline_styles = array();
18
+ public static $scripts = array();
19
+ public static $inline_scripts = array();
20
 
21
+ public static $style_url;
22
 
23
+ public static $style_ie_url;
24
 
25
+ public static $script_url;
26
 
27
+ public static $inline_script;
28
+
29
+ public static $inline_style;
30
+
31
+ public static $inline_style_ie;
32
+
33
+ public static $easing_script_url;
34
 
35
+ public static $mousewheel_script_url;
36
+
37
+ public static $metadata_script_url;
38
+
39
+ public static $onready_auto = false;
40
 
41
  public static $options = array();
42
 
44
 
45
  public static $pro_plugin_url = "https://premium.status301.com/downloads/easy-fancybox-pro/";
46
 
47
+ /**
48
+ * ACTIONS & FILTERS
49
+ */
50
 
51
+ public static function enqueue_scripts()
52
  {
53
+ // Make sure whe actually need to do anything.
54
+ if ( ! self::add_scripts() ){
55
+ return;
 
 
 
56
  }
57
 
58
+ global $wp_styles;
59
+ $_dep = get_option( 'fancybox_nojQuery', false ) ? array() : array( 'jquery' );
60
+ $_ver = defined( 'WP_DEBUG' ) && WP_DEBUG ? time() : false;
61
+ $_footer = get_option( 'fancybox_noFooter', false ) ? false : true;
62
+
63
+ // ENQUEUE STYLES
64
+ if ( !empty( self::$styles ) ) {
65
+ foreach ( self::$styles as $handle => $options ) {
66
+ $src = ! empty( $options['src'] ) ? $options['src'] : '';
67
+ $deps = ! empty( $options['deps'] ) ? (array) $options['deps'] : array();
68
+ $ver = ! empty( $options['ver'] ) ? $options['ver'] : $_ver;
69
+ $media = ! empty( $options['media'] ) ? $options['media'] : 'all';
70
+ wp_enqueue_style( $handle, $src, $deps, $ver, $media );
71
+ if ( ! empty( $options['conditional']) ) {
72
+ $wp_styles->add_data( $handle, 'conditional', $options['conditional'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
74
  }
75
+ } else {
76
+ wp_enqueue_style( 'fancybox', self::$style_url, array(), $_ver, 'screen' );
77
+ if ( ! empty( self::$inline_style_ie ) ) {
78
+ wp_enqueue_style( 'fancybox-ie', self::$style_ie_url, false, null, 'screen' );
79
+ $wp_styles->add_data( 'fancybox-ie', 'conditional', 'lt IE 9' );
80
+ }
81
  }
82
 
83
+ // ENQUEUE SCRIPTS
84
+ if ( !empty( self::$scripts ) ) {
85
+ foreach ( self::$scripts as $handle => $options ) {
86
+ $src = ! empty( $options['src'] ) ? $options['src'] : '';
87
+ $deps = ! empty( $options['deps'] ) ? (array) $options['deps'] : array();
88
+ $ver = ! empty( $options['ver'] ) ? $options['ver'] : $_ver;
89
+ wp_enqueue_script( $handle, $src, $deps, $ver, ! empty( $options['footer'] ) );
90
+ }
91
+ } else {
92
+ // Register main fancybox script.
93
+ wp_enqueue_script( 'jquery-fancybox', self::$script_url, $_dep, $_ver, $_footer );
94
 
95
+ // Metadata in Miscellaneous settings?
96
+ if ( ! empty( self::$metadata_script_url ) ) {
97
+ wp_enqueue_script( 'jquery-metadata', self::$metadata_script_url, $_dep, METADATA_VERSION, $_footer );
98
+ }
 
 
99
  }
100
 
101
+ // jQuery Easing, which is not needed if jQueryUI Core Effects are loaded or when using fancyBox 3.
102
+ if ( ! empty( self::$easing_script_url ) && ! wp_script_is( 'jquery-effects-core', 'enqueued' ) ) {
103
+ wp_enqueue_script( 'jquery-easing', self::$easing_script_url, $_dep, EASING_VERSION, $_footer );
104
+ }
 
 
 
 
 
 
105
 
106
+ // jQuery Mousewheel, which is not needed if jQueryUI Mouse is loaded or when using fancyBox 3.
107
+ if ( ! empty( self::$mousewheel_script_url ) && ! wp_script_is( 'jquery-ui-mouse', 'enqueued' ) ) {
108
+ wp_enqueue_script( 'jquery-mousewheel', self::$mousewheel_script_url, $_dep, MOUSEWHEEL_VERSION, $_footer );
109
+ }
110
 
111
+ // Inline styles.
112
+ if ( !empty( self::$inline_styles ) ) {
113
+ foreach ( self::$inline_styles as $handle => $data ) {
114
+ if ( function_exists( 'wp_add_inline_style' ) && ! get_option( 'fancybox_pre45Compat', false ) ) {
115
+ wp_add_inline_style( $handle, $data );
116
  } else {
117
+ // Do it the old way.
118
+ add_action( 'wp_head', function() use ( $data ) { print( '<style id="fancybox-inline-css" type="text/css">' . $data . '</style>' ); }, self::priority() );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  }
120
  }
121
+ } else {
122
+ if ( function_exists( 'wp_add_inline_style' ) && ! get_option( 'fancybox_pre45Compat', false ) ) {
123
+ empty( self::$inline_style ) || wp_add_inline_style( 'fancybox', self::$inline_style );
124
+ empty( self::$inline_style_ie ) || wp_add_inline_style( 'fancybox-ie', self::$inline_style_ie );
125
+ } else {
126
+ // Do it the old way.
127
+ empty( self::$inline_style ) || add_action( 'wp_head', function() { print( '<style id="fancybox-inline-css" type="text/css">' . self::$inline_style . '</style>' ); }, self::priority() );
128
+ empty( self::$inline_style_ie ) || add_action( 'wp_head', function() { print( '<!--[if lt IE 9]><style id="fancybox-inline-css-ie" type="text/css">' . self::$inline_style_ie . '</style><![endif]-->' ); }, self::priority() );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  }
 
 
 
 
 
130
  }
131
 
132
+ // Inline scripts.
133
+ if ( !empty( self::$inline_scripts ) ) {
134
+ foreach ( self::$inline_scripts as $handle => $data ) {
135
+ if ( is_array( $data ) ) {
136
+ $position = ! empty( $data['position'] ) ? $data['position'] : 'after';
137
+ $data = ! empty( $data['data'] ) ? $data['data'] : '';
138
+ }
139
+ if ( function_exists( 'wp_add_inline_script' ) && ! get_option( 'fancybox_pre45Compat', false ) ) {
140
+ wp_add_inline_script( $handle, $data, $position );
141
+ } else {
142
+ // Do it the old way.
143
+ $priority = self::priority();
144
+ if ( 'after' !== $position ) {
145
+ $priority = $priority - 1;
146
+ }
147
+ add_action( $_footer ? 'wp_footer' : 'wp_head', function() use ( $data ) { print( '<script type="text/javascript">' . $data . '</script>' ); }, $priority );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  } else {
151
+ if ( function_exists( 'wp_add_inline_script' ) && ! get_option( 'fancybox_pre45Compat', false ) ) {
152
+ empty( self::$inline_script ) || wp_add_inline_script( 'jquery-fancybox', self::$inline_script );
153
+ } else {
154
+ // Do it the old way.
155
+ empty( self::$inline_script ) || add_action( $_footer ? 'wp_footer' : 'wp_head', function() { print( '<script type="text/javascript">' . self::$inline_script . '</script>' ); }, self::priority() );
156
+ }
157
  }
158
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  }
160
 
161
  // Hack to fix missing wmode in Youtube oEmbed code based on David C's code in the comments on
162
  // http://www.mehigh.biz/wordpress/adding-wmode-transparent-to-wordpress-3-media-embeds.html
163
  // without the wmode, videos will float over the light box no matter what z-index is set.
164
+ public static function add_video_wmode_opaque( $html )
165
  {
166
+ // Make sure whe actually need this at all.
167
+ if ( ! self::add_scripts() ) {
168
+ return $html;
169
+ }
170
+
171
  if ( strpos($html, "<embed src=" ) !== false ) {
172
  $html = str_replace('</param><embed', '</param><param name="wmode" value="opaque"></param><embed wmode="opaque"', $html);
173
  } elseif ( strpos($html, 'youtube' ) !== false && strpos($html, 'wmode' ) == false ) {
177
  } elseif ( strpos($html, "dailymotion" ) !== false && strpos($html, 'wmode' ) == false ) {
178
  $html = str_replace('" width', '?wmode=opaque" width', $html);
179
  }
180
+
181
  return $html;
182
  }
183
 
184
+ public static function maybe_upgrade()
185
  {
186
+ $old_version = get_option( 'easy_fancybox_version', 0 );
187
 
188
+ if ( 0 !== version_compare( EASY_FANCYBOX_VERSION, $old_version ) ) {
189
+ self::upgrade( $old_version );
190
+ }
 
191
  }
192
 
193
  public static function upgrade( $old_version )
194
  {
195
+ // Upgrade from 1.7 or older.
196
+ if ( ! $old_version ) {
197
+ delete_option( 'fancybox_PDFclassType' );
198
+ }
199
+
200
+ // Upgrade from before 1.9.
201
+ if ( version_compare( $old_version, '0', '>' ) && version_compare( $old_version, '1.9', '<' ) ) {
202
+ // Introducing script version.
203
+ add_option( 'fancybox_scriptVersion', 'classic' );
204
+
205
+ // Change PDF embed option default.
206
+ $onstart = get_option('fancybox_PDFonStart');
207
+ $replaces = array(
208
+ 'function(a,i,o){o.type=\'pdf\';}' => '{{object}}',
209
+ 'function(a,i,o){o.type=\'html\';o.content=\'<embed src="\'+a[i].href+\'" type="application/pdf" height="100%" width="100%" />\'}' => '{{embed}}',
210
+ 'function(a,i,o){o.href=\'https://docs.google.com/viewer?embedded=true&url=\'+a[i].href;}' => '{{googleviewer}}'
211
+ );
212
+ if ( false === $onstart ) {
213
+ add_option( 'fancybox_PDFonStart', '{{object}}' );
214
+ } elseif ( array_key_exists( $onstart, $replaces ) ) {
215
+ update_option( 'fancybox_PDFonStart', $replaces[$onstart] );
216
+ } else {
217
+ update_option( 'fancybox_PDFonStart', '' );
218
  }
219
  }
220
+
221
  // Save new version.
222
  update_option( 'easy_fancybox_version', EASY_FANCYBOX_VERSION );
223
  }
224
 
225
+ public static function priority()
226
  {
227
+ if ( null === self::$priority ) {
228
+ $priority = get_option( 'fancybox_scriptPriority' );
229
+
230
+ self::$priority = is_numeric( $priority ) ? (int) $priority : 10;
231
  }
232
+
233
+ return self::$priority;
234
  }
235
 
236
+ public static function add_scripts()
237
  {
238
+ if ( null === self::$add_scripts ) {
239
+ _doing_it_wrong( __FUNCTION__, 'Method easyFancyBox::add_scripts() has been called before init.', '2.0' );
240
+ return false;
 
241
  }
242
+
243
+ return self::$add_scripts;
244
  }
245
 
246
+ public static function extend()
247
  {
248
+ $script_version = get_option( 'fancybox_scriptVersion', 'classic' );
249
+ if ( ! array_key_exists( $script_version, FANCYBOX_VERSIONS ) ) {
250
+ $script_version = 'classic';
251
+ }
252
+
253
+ switch( $script_version ) {
254
+ case 'legacy':
255
+ include EASY_FANCYBOX_DIR . '/inc/fancybox-legacy.php';
256
+ // Load defaults.
257
+ if ( empty( self::$options ) ) {
258
+ include EASY_FANCYBOX_DIR . '/inc/fancybox-legacy-options.php';
259
+ self::$options = $efb_options;
260
+ }
261
+ // Check for any enabled sections to set the scripts flag.
262
+ foreach ( self::$options['Global']['options']['Enable']['options'] as $value ) {
263
+ if ( isset($value['id']) && '1' == get_option($value['id'],$value['default']) ) {
264
+ self::$add_scripts = true;
265
+ break;
266
+ } else {
267
+ self::$add_scripts = false;
268
+ }
269
+ }
270
+ break;
271
+
272
+ case 'fancyBox2':
273
+ include EASY_FANCYBOX_DIR . '/inc/fancybox-2.php';
274
+ // Load defaults.
275
+ if ( empty( self::$options ) ) {
276
+ include EASY_FANCYBOX_DIR . '/inc/fancybox-2-options.php';
277
+ self::$options = $efb_options;
278
+ }
279
+ // Check for any enabled sections to set the scripts flag.
280
+ foreach ( self::$options['Global']['options']['Enable']['options'] as $value ) {
281
+ if ( isset($value['id']) && '1' == get_option($value['id'],$value['default']) ) {
282
+ self::$add_scripts = true;
283
+ break;
284
+ } else {
285
+ self::$add_scripts = false;
286
+ }
287
+ }
288
+ break;
289
 
290
+ case 'fancyBox3':
291
+ //include EASY_FANCYBOX_DIR . '/inc/fancybox-3.php';
292
+ break;
293
+
294
+ case 'classic':
295
+ default:
296
+ include EASY_FANCYBOX_DIR . '/inc/fancybox-classic.php';
297
+ // Load defaults.
298
+ if ( empty( self::$options ) ) {
299
+ include EASY_FANCYBOX_DIR . '/inc/fancybox-classic-options.php';
300
+ self::$options = $efb_options;
301
+ }
302
+ // Check for any enabled sections to set the scripts flag.
303
+ foreach ( self::$options['Global']['options']['Enable']['options'] as $value ) {
304
+ if ( isset($value['id']) && '1' == get_option($value['id'],$value['default']) ) {
305
+ self::$add_scripts = true;
306
+ break;
307
+ } else {
308
+ self::$add_scripts = false;
309
+ }
310
+ }
311
  }
312
+
313
+ add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ), self::priority() );
314
+ //add_filter( 'embed_oembed_html', array( __CLASS__, 'add_video_wmode_opaque' ) ); // Maybe TODO: make optional?
315
  }
316
 
317
+ /**
318
+ * RUN
319
+ */
320
 
321
+ public function __construct()
322
  {
323
  // VARS
324
+ self::$plugin_url = plugins_url( '/', EASY_FANCYBOX_BASENAME /* EASY_FANCYBOX_DIR.'/easy-fancybox.php' */ );
 
 
 
 
 
 
325
 
326
+ add_action( 'init', array( __CLASS__, 'maybe_upgrade' ), 9 );
327
+ add_action( 'init', array( __CLASS__, 'extend' ), 9 );
328
  }
329
  }
inc/fancybox-2-options.php ADDED
@@ -0,0 +1,1485 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * FancyBox v2 options and their defaults array.
4
+ */
5
+
6
+ $efb_options = array (
7
+ 'Global' => array(
8
+ 'title' => esc_html__('Global settings','easy-fancybox'),
9
+ 'input' => 'deep',
10
+ 'hide' => true,
11
+ 'options' => array(
12
+ 'Enable' => array (
13
+ 'title' => esc_html__('Media','easy-fancybox'),
14
+ 'input' => 'multiple',
15
+ 'hide' => true,
16
+ 'options' => array(
17
+ 'p1' => array (
18
+ 'hide' => true,
19
+ 'description' => esc_html__('Enable FancyBox for','easy-fancybox') . '<br />'
20
+ ),
21
+ 'IMG' => array (
22
+ 'id' => 'fancybox_enableImg',
23
+ 'input' => 'checkbox',
24
+ 'hide' => true,
25
+ 'default' => ( function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( EASY_FANCYBOX_BASENAME ) ) ? '' : '1',
26
+ 'description' => '<strong>' . esc_html__( 'Images', 'easy-fancybox' ) . '</strong>' . ( get_option('fancybox_enableImg') ? ' &mdash; <a href="#IMG">' . translate( 'Settings' ) . '</a>' : '' )
27
+ ),
28
+ 'Inline' => array (
29
+ 'id' => 'fancybox_enableInline',
30
+ 'input' => 'checkbox',
31
+ 'hide' => true,
32
+ 'default' => '',
33
+ 'description' => '<strong>' . esc_html__( 'Inline content', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableInline') ? ' &mdash; <a href="#Inline">' . translate( 'Settings' ) . '</a>' : '' )
34
+ ),
35
+ 'PDF' => array (
36
+ 'id' => 'fancybox_enablePDF',
37
+ 'input' => 'checkbox',
38
+ 'hide' => true,
39
+ 'default' => '',
40
+ 'description' => '<strong>' . esc_html__( 'PDF', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enablePDF') ? ' &mdash; <a href="#PDF">' . translate( 'Settings' ) . '</a>' : '' )
41
+ ),
42
+ 'SVG' => array (
43
+ 'id' => 'fancybox_enableSVG',
44
+ 'input' => 'checkbox',
45
+ 'hide' => true,
46
+ 'default' => '',
47
+ 'description' => '<strong>' . esc_html__( 'SVG', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableSVG') ? ' &mdash; <a href="#SVG">' . translate( 'Settings' ) . '</a>' : '' )
48
+ ),
49
+ 'VideoPress' => array (
50
+ 'id' => '',
51
+ 'input' => 'checkbox',
52
+ 'hide' => true,
53
+ 'default' => '',
54
+ 'status' => 'disabled',
55
+ 'description' => '<strong>' . esc_html__( 'VideoPress', 'easy-fancybox' ) . '</strong>' . ' ' . '<em>' . esc_html__('Under development','easy-fancybox') . '</em>'
56
+ ),
57
+ 'YouTube' => array (
58
+ 'id' => 'fancybox_enableYoutube',
59
+ 'input' => 'checkbox',
60
+ 'hide' => true,
61
+ 'default' => '',
62
+ 'description' => '<strong>' . esc_html__( 'YouTube', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableYouTube') ? ' &mdash; <a href="#YouTube">' . translate( 'Settings' ) . '</a>' : '' )
63
+ ),
64
+ 'Vimeo' => array (
65
+ 'id' => 'fancybox_enableVimeo',
66
+ 'input' => 'checkbox',
67
+ 'hide' => true,
68
+ 'default' => '',
69
+ 'description' => '<strong>' . esc_html__( 'Vimeo', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableVimeo') ? ' &mdash; <a href="#Vimeo">' . translate( 'Settings' ) . '</a>' : '' )
70
+ ),
71
+ 'Dailymotion' => array (
72
+ 'id' => 'fancybox_enableDailymotion',
73
+ 'input' => 'checkbox',
74
+ 'hide' => true,
75
+ 'default' => '',
76
+ 'description' => '<strong>' . esc_html__( 'Dailymotion', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableDailymotion') ? ' &mdash; <a href="#Dailymotion">' . translate( 'Settings' ) . '</a>' : '' )
77
+ ),
78
+ 'Instagram' => array (
79
+ 'id' => 'fancybox_enableInstagram',
80
+ 'input' => 'checkbox',
81
+ 'hide' => true,
82
+ 'status' => 'disabled',
83
+ 'default' => '',
84
+ 'description' => '<strong>' . esc_html__( 'Instagram', 'easy-fancybox' ) . '</strong>' . ' ' . '<em>' . esc_html__('Under development','easy-fancybox') . '</em>'
85
+ ),
86
+ 'GoogleMaps' => array (
87
+ 'id' => 'fancybox_enableGoogleMaps',
88
+ 'input' => 'checkbox',
89
+ 'hide' => true,
90
+ 'status' => 'disabled',
91
+ 'default' => '',
92
+ 'description' => '<strong>' . esc_html__( 'Google Maps', 'easy-fancybox' ) . '</strong>' . ' ' . '<em>' . esc_html__('Under development','easy-fancybox') . '</em>'
93
+ ),
94
+ 'iFrame' => array (
95
+ 'id' => 'fancybox_enableiFrame',
96
+ 'input' => 'checkbox',
97
+ 'hide' => true,
98
+ 'default' => '',
99
+ 'description' => '<strong>' . esc_html__('iFrames','easy-fancybox') . '</strong>' . '</strong>' . ( get_option('fancybox_enableiFrame') ? ' &mdash; <a href="#iFrame">' . translate( 'Settings' ) . '</a>' : '' )
100
+ )
101
+ ),
102
+ 'description' => ''
103
+ ),
104
+ 'Overlay' => array (
105
+ 'title' => esc_html__('Overlay','easy-fancybox'),
106
+ 'input' => 'multiple',
107
+ 'hide' => true,
108
+ 'options' => array(
109
+ 'overlayShow' => array (
110
+ 'id' => 'fancybox_overlayShow',
111
+ 'input' => 'checkbox',
112
+ 'hide' => true,
113
+ 'default' => '1',
114
+ 'description' => esc_html__('Show the overlay around content opened in FancyBox.','easy-fancybox')
115
+ ),
116
+ 'hideOnOverlayClick' => array (
117
+ 'id' => 'fancybox_hideOnOverlayClick',
118
+ 'input' => 'checkbox',
119
+ 'hide' => true,
120
+ 'default' => '1',
121
+ 'description' => esc_html__('Close FancyBox when overlay is clicked.','easy-fancybox')
122
+ ),
123
+ 'overlayColor' => array (
124
+ 'id' => 'fancybox_overlayColor',
125
+ 'title' => esc_html__('Color','easy-fancybox'),
126
+ 'label_for' => 'fancybox_overlayColor',
127
+ 'input' => 'text',
128
+ 'hide' => true,
129
+ 'sanitize_callback' => 'colorval',
130
+ 'class' => '',
131
+ 'default' => '',
132
+ 'description' => esc_html__('Enter an RGBA color value.','easy-fancybox') . ' <em>' . esc_html__('Example:','easy-fancybox') . ' rgba(119,119,119,0.7)</em><br />'
133
+ ),
134
+ 'overlaySpotlight' => array (
135
+ 'id' => 'fancybox_overlaySpotlight',
136
+ 'input' => 'checkbox',
137
+ 'hide' => true,
138
+ 'status' => get_option('fancybox_overlaySpotlight') ? '' : 'disabled',
139
+ 'default' => '',
140
+ 'description' => esc_html__('Spotlight effect','easy-fancybox') . ( get_option('fancybox_overlaySpotlight') ? '' : '. <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') ) . '</a></em>'
141
+ )
142
+ )
143
+ ),
144
+ 'Window' => array (
145
+ 'title' => esc_html__('Window','easy-fancybox'),
146
+ 'input' => 'multiple',
147
+ 'hide' => true,
148
+ 'options' => array(
149
+ 'p1' => array (
150
+ 'hide' => true,
151
+ 'description' => '<strong>' . esc_html__('Appearance','easy-fancybox') . '</strong><br />'
152
+ ),
153
+ 'closeBtn' => array (
154
+ 'id' => 'fancybox_showCloseButton',
155
+ 'input' => 'checkbox',
156
+ 'default' => '1',
157
+ 'description' => esc_html__('Show the (X) close button','easy-fancybox')
158
+ ),
159
+ 'backgroundColor' => array (
160
+ 'id' => 'fancybox_backgroundColor',
161
+ 'hide' => true,
162
+ 'title' => esc_html__('Background color','easy-fancybox'),
163
+ 'label_for' => 'fancybox_backgroundColor',
164
+ 'input' => 'text',
165
+ 'sanitize_callback' => 'colorval',
166
+ 'status' => 'disabled',
167
+ 'class' => 'small-text',
168
+ 'default' => '',
169
+ 'description' => ''
170
+ ),
171
+ 'textColor' => array (
172
+ 'id' => 'fancybox_textColor',
173
+ 'hide' => true,
174
+ 'title' => esc_html__('Text color','easy-fancybox'),
175
+ 'label_for' => 'fancybox_textColor',
176
+ 'input' => 'text',
177
+ 'sanitize_callback' => 'colorval',
178
+ 'status' => 'disabled',
179
+ 'class' => 'small-text',
180
+ 'default' => '',
181
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em><br />'
182
+ ),
183
+ 'titleColor' => array (
184
+ 'id' => 'fancybox_titleColor',
185
+ 'hide' => true,
186
+ 'title' => esc_html__('Title color','easy-fancybox'),
187
+ 'label_for' => 'fancybox_titleColor',
188
+ 'input' => 'text',
189
+ 'sanitize_callback' => 'colorval',
190
+ 'class' => 'small-text',
191
+ 'default' => '',
192
+ 'description' => ''
193
+ ),
194
+ 'paddingColor' => array (
195
+ 'id' => 'fancybox_paddingColor',
196
+ 'hide' => true,
197
+ 'title' => esc_html__('Border color','easy-fancybox'),
198
+ 'label_for' => 'fancybox_paddingColor',
199
+ 'input' => 'text',
200
+ 'sanitize_callback' => 'colorval',
201
+ 'class' => 'small-text',
202
+ 'default' => '',
203
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' #000 x #fff</em><br />' . esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('Use RGBA notation for semi-transparent borders.','easy-fancybox') . ' <em>' . esc_html__('Example:','easy-fancybox') . ' rgba(10,10,30,0.7)</em><br />'
204
+ ),
205
+ 'borderRadius' => array (
206
+ 'id' => 'fancybox_borderRadius',
207
+ 'hide' => true,
208
+ 'title' => esc_html__('Border radius','easy-fancybox'),
209
+ 'label_for' => 'fancybox_borderRadius',
210
+ 'input' => 'number',
211
+ 'step' => '1',
212
+ 'min' => '0',
213
+ 'max' => '99',
214
+ 'sanitize_callback' => 'intval',
215
+ 'status' => 'disabled',
216
+ 'class' => 'small-text',
217
+ 'default' => '4',
218
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em><br />'
219
+ ),
220
+
221
+ 'p11' => array (
222
+ 'hide' => true,
223
+ 'description' => '<br /><strong>' . esc_html__('Dimensions','easy-fancybox') . '</strong><br />'
224
+ ),
225
+ 'width' => array (
226
+ 'id' => 'fancybox_width',
227
+ 'title' => translate('Width'),
228
+ 'label_for' => 'fancybox_width',
229
+ 'input' => 'text',
230
+ 'sanitize_callback' => 'intval',
231
+ 'class' => 'small-text',
232
+ 'default' => '',
233
+ 'description' => ' '
234
+ ),
235
+ 'height' => array (
236
+ 'id' => 'fancybox_height',
237
+ 'title' => translate('Height'),
238
+ 'label_for' => 'fancybox_height',
239
+ 'input' => 'text',
240
+ 'sanitize_callback' => 'intval',
241
+ 'class' => 'small-text',
242
+ 'default' => '',
243
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' 800 x 600</em><br />' . esc_html__('If content size is not set or cannot be determined automatically, these default dimensions will be used.','easy-fancybox') . '<br />'
244
+ ),
245
+ // TODO: minWidth minHeight maxWidth maxHeight
246
+ 'padding' => array (
247
+ 'id' => 'fancybox_padding',
248
+ 'title' => translate('Border'),
249
+ 'label_for' => 'fancybox_padding',
250
+ 'input' => 'number',
251
+ 'step' => '1',
252
+ 'min' => '0',
253
+ 'max' => '100',
254
+ 'sanitize_callback' => 'intval',
255
+ 'class' => 'small-text',
256
+ 'default' => '',
257
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' 15</em><br />'
258
+ ),
259
+ 'margin' => array (
260
+ 'id' => 'fancybox_margin',
261
+ 'title' => esc_html__('Margin','easy-fancybox'),
262
+ 'label_for' => 'fancybox_margin',
263
+ 'input' => 'number',
264
+ 'step' => '1',
265
+ 'min' => '20',
266
+ 'max' => '80',
267
+ 'sanitize_callback' => 'intval',
268
+ 'class' => 'small-text',
269
+ 'default' => '20',
270
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' 20</em><br />'
271
+ ),
272
+
273
+ 'p2' => array (
274
+ 'hide' => true,
275
+ 'description' => '<br /><strong>' . esc_html__('Behavior','easy-fancybox') . '</strong><br />'
276
+ ),
277
+ /* TODO: autoResize
278
+ /* TODO: Autocenter select box for always true, always false or default (!isTouch)
279
+ 'autoCenter' => array (
280
+ 'id' => 'fancybox_centerOnScroll',
281
+ 'input' => 'checkbox',
282
+ 'default' => '!isTouch',
283
+ 'description' => esc_html__('Center while scrolling (always disabled on touch devices and when content, including the title, might be larger than the viewport)','easy-fancybox')
284
+ ),*/
285
+ /* TODO: Section to define keyboard keys for gallery navigation, closing and slideshow
286
+ Default value:
287
+ 'keys' : {
288
+ next : {
289
+ 13 : 'left', // enter
290
+ 34 : 'up', // page down
291
+ 39 : 'left', // right arrow
292
+ 40 : 'up' // down arrow
293
+ },
294
+ prev : {
295
+ 8 : 'right', // backspace
296
+ 33 : 'down', // page up
297
+ 37 : 'right', // left arrow
298
+ 38 : 'down' // up arrow
299
+ },
300
+ close : [27], // escape key
301
+ play : [32], // space - start/stop slideshow
302
+ toggle : [70] // letter "f" - toggle fullscreen
303
+ }*/
304
+ 'enableEscapeButton' => array (
305
+ 'id' => 'fancybox_enableEscapeButton',
306
+ 'input' => 'checkbox',
307
+ 'hide' => true,
308
+ 'default' => '1',
309
+ 'description' => esc_html__('Esc key stroke closes FancyBox','easy-fancybox')
310
+ ),
311
+ /* TODO: topRatio leftRatio for centering adjustments. */
312
+ 'fitToView' => array (
313
+ 'id' => 'fancybox_autoScale',
314
+ 'input' => 'checkbox',
315
+ 'default' => '1',
316
+ 'description' => esc_html__('Scale large content down to fit in the browser viewport.','easy-fancybox')
317
+ ),
318
+ 'openSpeed' => array (
319
+ 'id' => 'fancybox_speedIn',
320
+ 'title' => esc_html__('Opening speed','easy-fancybox'),
321
+ 'label_for' => 'fancybox_speedIn',
322
+ 'input' => 'number',
323
+ 'step' => '100',
324
+ 'min' => '0',
325
+ 'max' => '6000',
326
+ 'sanitize_callback' => 'intval',
327
+ 'class' => 'small-text',
328
+ 'default' => '',
329
+ ),
330
+ 'closeSpeed' => array (
331
+ 'id' => 'fancybox_speedOut',
332
+ 'title' => esc_html__('Closing speed','easy-fancybox'),
333
+ 'label_for' => 'fancybox_speedOut',
334
+ 'input' => 'number',
335
+ 'step' => '100',
336
+ 'min' => '0',
337
+ 'max' => '6000',
338
+ 'sanitize_callback' => 'intval',
339
+ 'class' => 'small-text',
340
+ 'default' => '',
341
+ 'description' => '<br />' . esc_html__('Duration in milliseconds. Higher is slower.','easy-fancybox') . ' <em>' . esc_html__('Default:','easy-fancybox') . ' 250</em><br />'
342
+ )
343
+ )
344
+ ),
345
+
346
+ 'Miscellaneous' => array (
347
+ 'title' => esc_html__('Miscellaneous','easy-fancybox'),
348
+ 'input' => 'multiple',
349
+ 'hide' => true,
350
+ 'options' => array(
351
+ 'p0' => array (
352
+ 'hide' => true,
353
+ 'description' => '<strong>' . esc_html__('Auto popup','easy-fancybox') . '</strong><br />'
354
+ ),
355
+ 'autoClick' => array (
356
+ 'id' => 'fancybox_autoClick',
357
+ 'title' => esc_html__('Open on page load','easy-fancybox'),
358
+ 'label_for' => 'fancybox_autoClick',
359
+ 'hide' => true,
360
+ 'input' => 'select',
361
+ 'options' => array(
362
+ '' => translate('None'),
363
+ '1' => esc_html__('Link with ID "fancybox-auto"','easy-fancybox'),
364
+ ),
365
+ 'default' => '1',
366
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />'
367
+ ),
368
+ 'delayClick' => array (
369
+ 'id' => 'fancybox_delayClick',
370
+ 'title' => esc_html__('Delay in milliseconds','easy-fancybox'),
371
+ 'label_for' => 'fancybox_delayClick',
372
+ 'hide' => true,
373
+ 'input' => 'number',
374
+ 'step' => '100',
375
+ 'min' => '0',
376
+ 'max' => '',
377
+ 'sanitize_callback' => 'intval',
378
+ 'class' => 'small-text',
379
+ 'default' => '1000',
380
+ 'description' => ' <em>' . esc_html__('Default:','easy-fancybox') . ' 1000</em><br />'
381
+ ),
382
+ 'jqCookie' => array (
383
+ 'id' => '',
384
+ 'title' => esc_html__('Hide popup after first visit?','easy-fancybox'),
385
+ 'hide' => true,
386
+ 'input' => 'select',
387
+ 'status' => 'disabled',
388
+ 'default' => '0',
389
+ 'sanitize_callback' => 'intval',
390
+ 'options' => array(
391
+ '0' => translate('No'),
392
+ '1' => esc_html__('1 Day','easy-fancybox'),
393
+ '7' => esc_html__('1 Week','easy-fancybox'),
394
+ '30' => esc_html__('1 Month','easy-fancybox'),
395
+ '365' => esc_html__('1 Year','easy-fancybox')
396
+ ),
397
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em><br />'
398
+ ),
399
+ 'cookiePath' => array (
400
+ 'id' => '',
401
+ 'default' => '',
402
+ 'hide' => true
403
+ ),
404
+ 'p1' => array (
405
+ 'hide' => true,
406
+ 'description' => '<br /><strong>' . esc_html__('Browser & device compatibility','easy-fancybox') . '</strong><br />'
407
+ ),
408
+ 'minVpWidth' => array (
409
+ 'id' => 'fancybox_minViewportWidth',
410
+ 'title' => esc_html__('Minimum browser/device viewport width','easy-fancybox'),
411
+ 'label_for' => 'fancybox_minViewportWidth',
412
+ 'input' => 'number',
413
+ 'step' => '1',
414
+ 'min' => '320',
415
+ 'max' => '900',
416
+ 'sanitize_callback' => 'intval',
417
+ 'class' => 'small-text',
418
+ 'default' => '',
419
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' 320</em><br />'
420
+ ),
421
+ 'minVpHeight' => array (
422
+ 'id' => 'fancybox_minViewportHeight',
423
+ 'title' => esc_html__('Minimum browser/device viewport height','easy-fancybox'),
424
+ 'label_for' => 'fancybox_minViewportHeight',
425
+ 'input' => 'number',
426
+ 'step' => '1',
427
+ 'min' => '320',
428
+ 'max' => '900',
429
+ 'sanitize_callback' => 'intval',
430
+ 'class' => 'small-text',
431
+ 'default' => '',
432
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' 320</em><br />'
433
+ ),
434
+ /* 'forceNewtab' => array (
435
+ 'id' => 'fancybox_forceNewtab',
436
+ 'input' => 'checkbox',
437
+ 'hide' => true,
438
+ 'default' => '1',
439
+ 'description' => esc_html__('Make media links open in a new tab when viewport falls below minimum width (above)','easy-fancybox')
440
+ ),*/
441
+ 'p2' => array (
442
+ 'hide' => true,
443
+ 'description' => '<br /><strong>' . esc_html__('Theme & plugins compatibility','easy-fancybox') . '</strong><br />'
444
+ . esc_html__('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')
445
+ . '<br /><br />'
446
+ ),
447
+ 'scriptPriority' => array (
448
+ 'id' => 'fancybox_scriptPriority',
449
+ 'title' => esc_html__('FancyBox script priority','easy-fancybox'),
450
+ 'label_for' => 'fancybox_scriptPriority',
451
+ 'hide' => true,
452
+ 'input' => 'number',
453
+ 'step' => '1',
454
+ 'min' => '-99',
455
+ 'max' => '999',
456
+ 'sanitize_callback' => 'intval',
457
+ 'class' => 'small-text',
458
+ 'default' => '10',
459
+ 'description' => esc_html__('Default priority is 10.','easy-fancybox') . ' ' . esc_html__('Higher is later.','easy-fancybox') . '<br/>'
460
+ ),
461
+ 'noFooter' => array (
462
+ 'id' => 'fancybox_noFooter',
463
+ 'input' => 'checkbox',
464
+ 'hide' => true,
465
+ 'default' => '',
466
+ 'description' => esc_html__('Move scripts from footer to theme head section (not recommended for site load times!)','easy-fancybox')
467
+ ),
468
+ 'nojQuery' => array (
469
+ 'id' => 'fancybox_nojQuery',
470
+ 'input' => 'checkbox',
471
+ 'hide' => true,
472
+ 'default' => '',
473
+ 'description' => esc_html__('Do not include standard WordPress jQuery library (do this only if you are sure jQuery is included from another source!)','easy-fancybox')
474
+ ),
475
+ 'pre45Compat' => array (
476
+ 'id' => 'fancybox_pre45Compat',
477
+ 'input' => 'checkbox',
478
+ 'hide' => true,
479
+ 'default' => function_exists( 'wp_add_inline_script' ) ? '' : '1',
480
+ 'description' => esc_html__('Do not use wp_add_inline_script/style functions (may solve issues with older script minification plugins)','easy-fancybox')
481
+ ),
482
+ 'p3' => array (
483
+ 'hide' => true,
484
+ 'description' => '<br /><strong>' . esc_html__('Advanced','easy-fancybox') . '</strong><br />'
485
+ ),
486
+ 'metaData' => array (
487
+ 'id' => 'fancybox_metaData',
488
+ 'hide' => true,
489
+ 'input' => 'checkbox',
490
+ 'status' => get_option('fancybox_metaData') ? '' : 'disabled',
491
+ 'default' => '',
492
+ 'description' => esc_html__('Include the Metadata jQuery extension script to allow passing custom parameters via link class.','easy-fancybox') . ( get_option('fancybox_metaData') ? '' : '. <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') ) . '</a></em>'
493
+ ),
494
+ 'vcMasonryCompat' => array (
495
+ 'id' => 'fancybox_vcMasonryCompat',
496
+ 'hide' => true,
497
+ 'input' => 'checkbox',
498
+ 'status' => 'disabled',
499
+ 'default' => '',
500
+ 'description' => esc_html__('WPBakery / Visual Composer - Masonry Grid Gallery compatibility.','easy-fancybox') . ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em>'
501
+ ),
502
+ 'autoExclude' => array (
503
+ 'id' => 'fancybox_autoExclude',
504
+ 'title' => esc_html__('Exclude','easy-fancybox'),
505
+ 'label_for' => 'fancybox_autoExclude',
506
+ 'input' => 'text',
507
+ 'class' => 'regular-text',
508
+ 'hide' => true,
509
+ 'default' => '.nolightbox,a.wp-block-file__button,a.pin-it-button,a[href*=\'pinterest.com/pin/create\'],a[href*=\'facebook.com/share\'],a[href*=\'twitter.com/share\']',
510
+ 'sanitize_callback' => 'csl_text',
511
+ 'description' => esc_html__('A comma-separated list of selectors for elements to which FancyBox should not automatically bind itself. Media links inside these elements will be ignored by Autodetect.','easy-fancybox') . ' <em>' . esc_html__('Default:','easy-fancybox') . ' .nolightbox,a.wp-block-file__button,a.pin-it-button,a[href*=\'pinterest.com/pin/create\'],a[href*=\'facebook.com/share\'],a[href*=\'twitter.com/share\']</em><br />'
512
+ )
513
+ )
514
+ )
515
+ )
516
+ ),
517
+
518
+ 'IMG' => array(
519
+ 'title' => esc_html__('Images','easy-fancybox'),
520
+ 'input' => 'multiple',
521
+ 'options' => array(
522
+ 'intro' => array (
523
+ 'hide' => true,
524
+ 'description' => esc_html__('To make images open in an overlay, add their extension to the Autodetect field or use the class "fancybox" for its link. Clear field to switch off all autodetection.','easy-fancybox') . '<br />'
525
+ ),
526
+ 'tag' => array (
527
+ 'hide' => true,
528
+ 'default' => 'a.fancybox,area.fancybox,.fancybox>a'
529
+ ),
530
+ 'class' => array (
531
+ 'hide' => true,
532
+ 'default' => 'fancybox'
533
+ ),
534
+ 'autoAttribute' => array (
535
+ 'id' => 'fancybox_autoAttribute',
536
+ 'title' => esc_html__('Autodetect','easy-fancybox'),
537
+ 'label_for' => 'fancybox_autoAttribute',
538
+ 'input' => 'text',
539
+ 'class' => 'regular-text',
540
+ 'hide' => true,
541
+ 'default' => '.jpg,.png,.webp',
542
+ 'sanitize_callback' => 'csl_text',
543
+ 'selector' => 'href*=',
544
+ 'description' => esc_html__('A comma-separated list of image file extensions to which FancyBox should automatically bind itself.','easy-fancybox') . ' <em>' . esc_html__('Example:','easy-fancybox') . ' .jpg,.png,.gif,.jpeg</em><br />'
545
+ ),
546
+ 'autoAttributeLimit' => array (
547
+ 'id' => 'fancybox_autoAttributeLimit',
548
+ 'title' => esc_html__('Apply to','easy-fancybox'),
549
+ 'label_for' => 'fancybox_autoAttributeLimit',
550
+ 'hide' => true,
551
+ 'input' => 'select',
552
+ 'options' => array(
553
+ '' => esc_html__('All image links', 'easy-fancybox')
554
+ ),
555
+ 'default' => '',
556
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />'
557
+ ),
558
+ 'type' => array (
559
+ 'id' => 'fancybox_classType',
560
+ 'title' => esc_html__('Force FancyBox to treat all media linked with class="fancybox" as images?','easy-fancybox'),
561
+ 'label_for' => 'fancybox_classType',
562
+ 'input' => 'select',
563
+ 'options' => array(
564
+ 'image' => translate('Yes'),
565
+ '' => translate('No')
566
+ ),
567
+ 'default' => get_option('fancybox_enableInline') ? 'image' : '',
568
+ 'description' => '<br/>'
569
+ ),
570
+ 'p2' => array (
571
+ 'hide' => true,
572
+ 'description' => '<br /><strong>' . esc_html__('Behavior','easy-fancybox') . '</strong><br />'
573
+ ),
574
+ 'openEffect' => array (
575
+ 'id' => 'fancybox_transitionIn',
576
+ 'title' => esc_html__('Transition In','easy-fancybox'),
577
+ 'label_for' => 'fancybox_transitionIn',
578
+ 'input' => 'select',
579
+ 'options' => array(
580
+ 'none' => translate('None'),
581
+ '' => esc_html__('Fade','easy-fancybox'),
582
+ 'elastic' => esc_html__('Elastic','easy-fancybox'),
583
+ ),
584
+ 'default' => 'elastic',
585
+ 'description' => ' '
586
+ ),
587
+ 'easingIn' => array ( // converted to openEasing
588
+ 'id' => 'fancybox_easingIn',
589
+ 'title' => esc_html__('Easing In','easy-fancybox'),
590
+ 'label_for' => 'fancybox_easingIn',
591
+ 'input' => 'select',
592
+ 'options' => array(
593
+ 'linear' => esc_html__('Linear','easy-fancybox'),
594
+ '' => esc_html__('Swing','easy-fancybox')
595
+ ),
596
+ 'default' => '',
597
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />'
598
+ ),
599
+ 'closeEffect' => array (
600
+ 'id' => 'fancybox_transitionOut',
601
+ 'title' => esc_html__('Transition Out','easy-fancybox'),
602
+ 'label_for' => 'fancybox_transitionOut',
603
+ 'input' => 'select',
604
+ 'options' => array(
605
+ 'none' => translate('None'),
606
+ '' => esc_html__('Fade','easy-fancybox'),
607
+ 'elastic' => esc_html__('Elastic','easy-fancybox'),
608
+ ),
609
+ 'default' => 'elastic',
610
+ 'description' => ' '
611
+ ),
612
+ 'easingOut' => array ( // converted to closeEasing
613
+ 'id' => 'fancybox_easingOut',
614
+ 'title' => esc_html__('Easing Out','easy-fancybox'),
615
+ 'label_for' => 'fancybox_easingOut',
616
+ 'input' => 'select',
617
+ 'options' => array(
618
+ 'linear' => esc_html__('Linear','easy-fancybox'),
619
+ '' => esc_html__('Swing','easy-fancybox')
620
+ ),
621
+ 'default' => '',
622
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />' . esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('Easing effects only apply when Transition is set to Elastic. ','easy-fancybox') . '<br /><br />'
623
+ ),
624
+ /*'openOpacity' => array (
625
+ 'id' => 'fancybox_openOpacity',
626
+ 'input' => 'checkbox',
627
+ 'default' => '1',
628
+ 'description' => esc_html__('Transparency fade during elastic open transition.','easy-fancybox')
629
+ ),
630
+ 'closeOpacity' => array (
631
+ 'id' => 'fancybox_closeOpacity',
632
+ 'input' => 'checkbox',
633
+ 'default' => '1',
634
+ 'description' => esc_html__('Transparency fade during elastic close transition.','easy-fancybox')
635
+ ),*/
636
+ /* TODO: openMethod / closeMethod / nextMethod / prevMethod */
637
+ 'closeClick' => array (
638
+ 'id' => 'fancybox_hideOnContentClick',
639
+ 'input' => 'checkbox',
640
+ 'default' => '',
641
+ 'description' => esc_html__('Close FancyBox when content is clicked','easy-fancybox')
642
+ ),
643
+ 'p1' => array (
644
+ 'hide' => true,
645
+ 'description' => '<br /><strong>' . esc_html__('Appearance','easy-fancybox') . '</strong><br />'
646
+ ),
647
+ 'titleShow' => array (
648
+ 'id' => 'fancybox_titleShow',
649
+ 'input' => 'checkbox',
650
+ 'hide' => true,
651
+ 'default' => '1',
652
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
653
+ ),
654
+ 'titlePosition' => array (
655
+ 'id' => 'fancybox_titlePosition',
656
+ 'title' => esc_html__('Title Style','easy-fancybox'),
657
+ 'label_for' => 'fancybox_titlePosition',
658
+ 'input' => 'select',
659
+ 'hide' => true,
660
+ 'options' => array(
661
+ '' => esc_html__('Float','easy-fancybox'),
662
+ 'outside' => esc_html__('Outside','easy-fancybox'),
663
+ 'outside-top' => esc_html__('Outside top','easy-fancybox'),
664
+ 'inside' => esc_html__('Inside','easy-fancybox'),
665
+ 'inside-top' => esc_html__('Inside top','easy-fancybox'),
666
+ 'over' => esc_html__('Overlay','easy-fancybox')
667
+ ),
668
+ 'default' => '',
669
+ 'description' => '<br />'
670
+ ),
671
+ 'titleFromAlt' => array (
672
+ 'id' => 'fancybox_titleFromAlt',
673
+ 'input' => 'checkbox',
674
+ 'hide' => true,
675
+ 'default' => '1',
676
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
677
+ ),
678
+ 'beforeLoad' => array (
679
+ 'id' => '',
680
+ 'title' => esc_html__('Advanced','easy-fancybox'),
681
+ 'hide' => true,
682
+ 'input' => 'select',
683
+ 'status' => 'disabled',
684
+ 'options' => array(
685
+ '' => esc_html__('Hide/show title on mouse hover action','easy-fancybox')
686
+ ),
687
+ 'default' => '',
688
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em><br />'
689
+ ),
690
+ 'p3' => array (
691
+ 'hide' => true,
692
+ 'description' => '<br /><strong>' . esc_html__('Gallery','easy-fancybox') . '</strong><br />'
693
+ ),
694
+ 'autoGallery' => array (
695
+ 'id' => 'fancybox_autoGallery',
696
+ 'title' => esc_html__('Autogallery','easy-fancybox'),
697
+ 'label_for' => 'fancybox_autoGallery',
698
+ 'hide' => true,
699
+ 'input' => 'select',
700
+ 'options' => array(
701
+ '' => translate('Disabled'),
702
+ '1' => esc_html__('WordPress galleries only','easy-fancybox'),
703
+ '2' => esc_html__('All in one gallery','easy-fancybox')
704
+ ),
705
+ 'default' => '1',
706
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />' . esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('When disabled, you can use the rel attribute to manually group image links together.','easy-fancybox') . '<br /><br />'
707
+ ),
708
+ 'arrows' => array (
709
+ 'id' => 'fancybox_showNavArrows',
710
+ 'input' => 'checkbox',
711
+ 'default' => '1',
712
+ 'description' => esc_html__('Show the gallery navigation arrows','easy-fancybox')
713
+ ),
714
+ /* TODO: nextClick to navigate to next gallery item when user clicks the content, default false */
715
+ 'enableKeyboardNav' => array (
716
+ 'id' => 'fancybox_enableKeyboardNav',
717
+ 'input' => 'checkbox',
718
+ 'hide' => true,
719
+ 'default' => '1',
720
+ 'description' => esc_html__('Arrow key strokes browse the gallery','easy-fancybox')
721
+ ),
722
+ 'loop' => array (
723
+ 'id' => 'fancybox_cyclic',
724
+ 'input' => 'checkbox',
725
+ 'hide' => true,
726
+ 'default' => '',
727
+ 'description' => esc_html__('Make galleries cyclic, allowing you to keep pressing next/back.','easy-fancybox')
728
+ ),
729
+ 'mouseWheel' => array (
730
+ 'id' => 'fancybox_mouseWheel',
731
+ 'input' => 'checkbox',
732
+ 'default' => '1',
733
+ 'description' => esc_html__('Allow gallery browsing by mousewheel action.','easy-fancybox')
734
+ ),
735
+ 'changeSpeed' => array (
736
+ 'id' => 'fancybox_changeSpeed',
737
+ 'title' => esc_html__( 'Change speed', 'easy-fancybox' ),
738
+ 'label_for' => 'fancybox_changeSpeed',
739
+ 'input' => 'number',
740
+ 'step' => '1',
741
+ 'min' => '0',
742
+ 'max' => '6000',
743
+ 'sanitize_callback' => 'intval',
744
+ 'class' => 'small-text',
745
+ 'default' => '',
746
+ 'description' => '<br />' . esc_html__('Duration in milliseconds. Higher is slower.','easy-fancybox') . ' <em>' . esc_html__('Default:','easy-fancybox') . ' 250</em><br /><br />'
747
+ ),
748
+ 'autoSelector' => array (
749
+ 'id' => 'fancybox_autoSelector',
750
+ 'hide' => true,
751
+ 'input' => 'hidden',
752
+ 'default' => '.gallery,.wp-block-gallery,.tiled-gallery,.wp-block-jetpack-tiled-gallery'
753
+ ),
754
+ 'autoPlay' => array (
755
+ 'id' => 'fancybox_autoPlay',
756
+ 'input' => 'checkbox',
757
+ 'default' => '',
758
+ 'description' => esc_html__( 'Slideshow', 'easy-fancybox' )
759
+ )
760
+ )
761
+ ),
762
+
763
+ 'Inline' => array(
764
+ 'title' => esc_html__('Inline content','easy-fancybox'),
765
+ 'input' => 'multiple',
766
+ 'options' => array(
767
+ 'intro' => array (
768
+ 'hide' => true,
769
+ 'description' => esc_html__('To make inline content open in an overlay, wrap that content in a div with a unique ID, create a link with target "#uniqueID" and give it a class "fancybox-inline" attribute.','easy-fancybox') . '<br /><br />'
770
+ ),
771
+ 'tag' => array (
772
+ 'hide' => true,
773
+ 'default' => 'a.fancybox-inline,area.fancybox-inline,.fancybox-inline>a'
774
+ ),
775
+ 'class' => array (
776
+ 'hide' => true,
777
+ 'default' => 'fancybox-inline'
778
+ ),
779
+ 'type' => array (
780
+ 'default' => 'inline'
781
+ ),
782
+ 'autoSize' => array (
783
+ 'id' => 'fancybox_autoDimensions',
784
+ 'input' => 'checkbox',
785
+ 'default' => '1',
786
+ 'description' => esc_html__('Try to adjust size to inline/html content. If unchecked the default dimensions will be used.','easy-fancybox') . ''
787
+ ),
788
+ /* TODO: autoHeight autoWidth */
789
+ 'scrolling' => array (
790
+ 'id' => 'fancybox_InlineScrolling',
791
+ 'title' => esc_html__('Scrolling','easy-fancybox'),
792
+ 'label_for' => 'fancybox_InlineScrolling',
793
+ 'input' => 'select',
794
+ 'options' => array(
795
+ 'auto' => esc_html__('Auto','easy-fancybox'),
796
+ 'yes' => esc_html__('Always','easy-fancybox'),
797
+ 'no' => esc_html__('Never','easy-fancybox')
798
+ ),
799
+ 'default' => 'auto',
800
+ 'description' => esc_html__('Define scrolling and scrollbar visibility.','easy-fancybox') . '<br /><br />'
801
+ ),
802
+ 'openEffect' => array (
803
+ 'id' => 'fancybox_transitionInInline',
804
+ 'title' => esc_html__('Transition In','easy-fancybox'),
805
+ 'label_for' => 'fancybox_transitionInInline',
806
+ 'input' => 'select',
807
+ 'options' => array(
808
+ 'none' => translate('None'),
809
+ '' => esc_html__('Fade','easy-fancybox'),
810
+ 'elastic' => esc_html__('Elastic','easy-fancybox'),
811
+ ),
812
+ 'default' => '',
813
+ 'description' => ' '
814
+ ),
815
+ 'easingIn' => array ( // converted to openEasing
816
+ 'id' => 'fancybox_easingInInline',
817
+ 'title' => esc_html__('Easing In','easy-fancybox'),
818
+ 'label_for' => 'fancybox_easingInInline',
819
+ 'input' => 'select',
820
+ 'options' => array(
821
+ 'linear' => esc_html__('Linear','easy-fancybox'),
822
+ '' => esc_html__('Swing','easy-fancybox')
823
+ ),
824
+ 'default' => '',
825
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />'
826
+ ),
827
+ 'closeEffect' => array (
828
+ 'id' => 'fancybox_transitionOutInline',
829
+ 'title' => esc_html__('Transition Out','easy-fancybox'),
830
+ 'label_for' => 'fancybox_transitionOutInline',
831
+ 'input' => 'select',
832
+ 'options' => array(
833
+ 'none' => translate('None'),
834
+ '' => esc_html__('Fade','easy-fancybox'),
835
+ 'elastic' => esc_html__('Elastic','easy-fancybox'),
836
+ ),
837
+ 'default' => '',
838
+ 'description' => ' '
839
+ ),
840
+ 'easingOut' => array ( // converted to closeEasing
841
+ 'id' => 'fancybox_easingOutInline',
842
+ 'title' => esc_html__('Easing Out','easy-fancybox'),
843
+ 'label_for' => 'fancybox_easingOutInline',
844
+ 'input' => 'select',
845
+ 'options' => array(
846
+ 'linear' => esc_html__('Linear','easy-fancybox'),
847
+ '' => esc_html__('Swing','easy-fancybox')
848
+ ),
849
+ 'default' => '',
850
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />' . esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('Easing effects only apply when Transition is set to Elastic. ','easy-fancybox') . '<br /><br />'
851
+ ),
852
+ 'closeClick' => array (
853
+ 'id' => 'fancybox_hideOnContentClickInline',
854
+ 'input' => 'checkbox',
855
+ 'default' => '',
856
+ 'description' => esc_html__('Close FancyBox when content is clicked','easy-fancybox')
857
+ ),
858
+ 'titleShow' => array (
859
+ 'default' => 'false',
860
+ 'hide' => true
861
+ )
862
+ )
863
+ ),
864
+
865
+ 'PDF' => array(
866
+ 'title' => esc_html__('PDF','easy-fancybox'),
867
+ 'input' => 'multiple',
868
+ 'options' => array(
869
+ 'intro' => array (
870
+ 'hide' => true,
871
+ 'description' => esc_html__('To make any PDF document file open in an overlay, switch on Autodetect or use the class "fancybox-pdf" for its link.','easy-fancybox') . '<br />'
872
+ ),
873
+ 'autoAttribute' => array (
874
+ 'id' => 'fancybox_autoAttributePDF',
875
+ 'input' => 'checkbox',
876
+ 'hide' => true,
877
+ 'default' => '1',
878
+ 'selector' => '\'a[href*=".pdf"],area[href*=".pdf"],a[href*=".PDF"],area[href*=".PDF"]\'',
879
+ 'description' => esc_html__('Autodetect','easy-fancybox')
880
+ ),
881
+ 'tag' => array (
882
+ 'hide' => true,
883
+ 'default' => 'a.fancybox-pdf,area.fancybox-pdf,.fancybox-pdf>a'
884
+ ),
885
+ 'class' => array (
886
+ 'hide' => true,
887
+ 'default' => 'fancybox-pdf'
888
+ ),
889
+ 'type' => array (
890
+ 'default' => 'iframe'
891
+ ),
892
+ 'beforeLoad' => array (
893
+ 'id' => 'fancybox_PDFonStart',
894
+ 'title' => esc_html__('Embed with','easy-fancybox'),
895
+ 'label_for' => 'fancybox_PDFonStart',
896
+ 'input' => 'select',
897
+ 'options' => array(
898
+ '{{object}}' => esc_html__('Object tag (plus fall-back link)','easy-fancybox'),
899
+ '{{embed}}' => esc_html__('Embed tag','easy-fancybox'),
900
+ '' => esc_html__('iFrame tag (let browser decide)','easy-fancybox'),
901
+ '{{googleviewer}}' => esc_html__('Google Docs Viewer (external)','easy-fancybox')
902
+ ),
903
+ 'default' => '',
904
+ 'description' => esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('External viewers have bandwidth, usage rate and and file size limits.','easy-fancybox') . '<br /><br />'
905
+ ),
906
+ 'width' => array (
907
+ 'id' => 'fancybox_PDFwidth',
908
+ 'title' => translate('Width'),
909
+ 'label_for' => 'fancybox_PDFwidth',
910
+ 'input' => 'text',
911
+ 'sanitize_callback' => 'intval',
912
+ 'class' => 'small-text',
913
+ 'default' => '90%',
914
+ 'description' => ' '
915
+ ),
916
+ 'height' => array (
917
+ 'id' => 'fancybox_PDFheight',
918
+ 'title' => translate('Height'),
919
+ 'label_for' => 'fancybox_PDFheight',
920
+ 'input' => 'text',
921
+ 'sanitize_callback' => 'intval',
922
+ 'class' => 'small-text',
923
+ 'default' => '90%'
924
+ ),
925
+ 'padding' => array (
926
+ 'id' => 'fancybox_PDFpadding',
927
+ 'title' => translate('Border'),
928
+ 'label_for' => 'fancybox_PDFpadding',
929
+ 'input' => 'number',
930
+ 'step' => '1',
931
+ 'min' => '0',
932
+ 'max' => '100',
933
+ 'sanitize_callback' => 'intval',
934
+ 'class' => 'small-text',
935
+ 'default' => '10',
936
+ 'description' => '<br /><br />'
937
+ ),
938
+ 'titleShow' => array (
939
+ 'id' => 'fancybox_PDFtitleShow',
940
+ 'input' => 'checkbox',
941
+ 'hide' => true,
942
+ 'default' => '',
943
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
944
+ ),
945
+ 'titlePosition' => array (
946
+ 'id' => 'fancybox_PDFtitlePosition',
947
+ 'title' => esc_html__('Title Style','easy-fancybox'),
948
+ 'label_for' => 'fancybox_PDFtitlePosition',
949
+ 'input' => 'select',
950
+ 'hide' => true,
951
+ 'options' => array(
952
+ '' => esc_html__('Float','easy-fancybox'),
953
+ 'outside' => esc_html__('Outside','easy-fancybox'),
954
+ 'outside-top' => esc_html__('Outside top','easy-fancybox'),
955
+ 'inside' => esc_html__('Inside','easy-fancybox'),
956
+ 'inside-top' => esc_html__('Inside top','easy-fancybox'),
957
+ ),
958
+ 'default' => '',
959
+ 'description' => '<br />'
960
+ ),
961
+ 'titleFromAlt' => array (
962
+ 'id' => 'fancybox_PDFtitleFromAlt',
963
+ 'input' => 'checkbox',
964
+ 'hide' => true,
965
+ 'default' => '1',
966
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
967
+ ),
968
+ 'scrolling' => array (
969
+ 'default' => 'no',
970
+ )
971
+ )
972
+ ),
973
+
974
+ 'SVG' => array(
975
+ 'title' => esc_html__('SVG','easy-fancybox'),
976
+ 'input' => 'multiple',
977
+ 'options' => array(
978
+ 'tag' => array (
979
+ 'hide' => true,
980
+ 'default' => 'a.fancybox-svg,area.fancybox-svg,.fancybox-svg>a'
981
+ ),
982
+ 'intro' => array (
983
+ 'hide' => true,
984
+ 'description' => esc_html__('To make any SVG (.svg) file open in an overlay, switch on Autodetect or use the class "fancybox-svg" for its link.','easy-fancybox') . '<br />'
985
+ ),
986
+ 'autoAttribute' => array (
987
+ 'id' => 'fancybox_autoAttributeSVG',
988
+ 'input' => 'checkbox',
989
+ 'hide' => true,
990
+ 'default' => '1',
991
+ 'selector' => '\'a[href*=".svg"],area[href*=".svg"],a[href*=".SVG"],area[href*=".SVG"]\'',
992
+ 'description' => esc_html__('Autodetect','easy-fancybox') . '<br />'
993
+ ),
994
+ 'class' => array (
995
+ 'hide' => true,
996
+ 'default' => 'fancybox-svg'
997
+ ),
998
+ 'type' => array(
999
+ 'default' => 'svg'
1000
+ ),
1001
+ 'width' => array (
1002
+ 'id' => 'fancybox_SVGWidth',
1003
+ 'title' => translate('Width'),
1004
+ 'label_for' => 'fancybox_SVGWidth',
1005
+ 'input' => 'text',
1006
+ 'sanitize_callback' => 'intval',
1007
+ 'class' => 'small-text',
1008
+ 'options' => array(),
1009
+ 'default' => '680',
1010
+ 'description' => ' '
1011
+ ),
1012
+ 'height' => array (
1013
+ 'id' => 'fancybox_SVGHeight',
1014
+ 'title' => translate('Height'),
1015
+ 'label_for' => 'fancybox_SVGHeight',
1016
+ 'input' => 'text',
1017
+ 'sanitize_callback' => 'intval',
1018
+ 'class' => 'small-text',
1019
+ 'options' => array(),
1020
+ 'default' => '495',
1021
+ ),
1022
+ 'padding' => array (
1023
+ 'id' => 'fancybox_SVGpadding',
1024
+ 'title' => translate('Border'),
1025
+ 'label_for' => 'fancybox_SVGpadding',
1026
+ 'input' => 'number',
1027
+ 'step' => '1',
1028
+ 'min' => '0',
1029
+ 'max' => '100',
1030
+ 'sanitize_callback' => 'intval',
1031
+ 'class' => 'small-text',
1032
+ 'default' => '0',
1033
+ 'description' => '<br /><br />'
1034
+ ),
1035
+ 'titleShow' => array (
1036
+ 'id' => 'fancybox_SVGtitleShow',
1037
+ 'input' => 'checkbox',
1038
+ 'hide' => true,
1039
+ 'default' => '',
1040
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1041
+ ),
1042
+ 'titlePosition' => array (
1043
+ 'id' => 'fancybox_SVGtitlePosition',
1044
+ 'title' => esc_html__('Title Style','easy-fancybox'),
1045
+ 'label_for' => 'fancybox_SVGtitlePosition',
1046
+ 'input' => 'select',
1047
+ 'hide' => true,
1048
+ 'options' => array(
1049
+ '' => esc_html__('Float','easy-fancybox'),
1050
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1051
+ 'outside-top' => esc_html__('Outside top','easy-fancybox'),
1052
+ 'inside' => esc_html__('Inside','easy-fancybox'),
1053
+ 'inside-top' => esc_html__('Inside top','easy-fancybox'),
1054
+ ),
1055
+ 'default' => '',
1056
+ 'description' => '<br />'
1057
+ ),
1058
+ 'titleFromAlt' => array (
1059
+ 'id' => 'fancybox_SVGtitleFromAlt',
1060
+ 'input' => 'checkbox',
1061
+ 'hide' => true,
1062
+ 'default' => '1',
1063
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
1064
+ ),
1065
+ 'svg' => array (
1066
+ 'default' => '{\'wmode\':\'opaque\',\'allowfullscreen\':true}'
1067
+ )
1068
+ )
1069
+ ),
1070
+
1071
+ 'VideoPress' => array(
1072
+ ),
1073
+
1074
+ 'YouTube' => array(
1075
+ 'title' => esc_html__('YouTube','easy-fancybox'),
1076
+ 'input' => 'multiple',
1077
+ 'options' => array(
1078
+ 'intro' => array (
1079
+ 'hide' => true,
1080
+ 'description' => esc_html__('To make any YouTube movie open in an overlay, switch on Autodetect or use the class "fancybox-youtube" for its link.','easy-fancybox') . '<br />'
1081
+ ),
1082
+ 'autoAttribute' => array (
1083
+ 'id' => 'fancybox_autoAttributeYoutube',
1084
+ 'input' => 'checkbox',
1085
+ 'hide' => true,
1086
+ 'default' => '1',
1087
+ 'selector' => '\'a[href*="youtu.be/"],area[href*="youtu.be/"],a[href*="youtube.com/"],area[href*="youtube.com/"]\').filter(function(){return this.href.match(/\/(?:youtu\.be|watch\?|embed\/)/);}',
1088
+ 'description' => esc_html__('Autodetect','easy-fancybox') . '<br />'
1089
+ ),
1090
+ 'tag' => array (
1091
+ 'hide' => true,
1092
+ 'default' => 'a.fancybox-youtube,area.fancybox-youtube,.fancybox-youtube>a'
1093
+ ),
1094
+ 'class' => array (
1095
+ 'hide' => true,
1096
+ 'default' => 'fancybox-youtube'
1097
+ ),
1098
+ 'width' => array (
1099
+ 'id' => 'fancybox_YoutubeWidth',
1100
+ 'title' => translate('Width'),
1101
+ 'label_for' => 'fancybox_YoutubeWidth',
1102
+ 'input' => 'number',
1103
+ 'step' => '1',
1104
+ 'min' => '420',
1105
+ 'max' => '1500',
1106
+ 'sanitize_callback' => 'intval',
1107
+ 'class' => 'small-text',
1108
+ 'default' => '640',
1109
+ 'description' => ' '
1110
+ ),
1111
+ 'height' => array (
1112
+ 'id' => 'fancybox_YoutubeHeight',
1113
+ 'title' => translate('Height'),
1114
+ 'label_for' => 'fancybox_YoutubeHeight',
1115
+ 'input' => 'number',
1116
+ 'step' => '1',
1117
+ 'min' => '315',
1118
+ 'max' => '900',
1119
+ 'sanitize_callback' => 'intval',
1120
+ 'class' => 'small-text',
1121
+ 'default' => '360',
1122
+ ),
1123
+ 'padding' => array (
1124
+ 'id' => 'fancybox_Youtubepadding',
1125
+ 'title' => translate('Border'),
1126
+ 'label_for' => 'fancybox_Youtubepadding',
1127
+ 'input' => 'number',
1128
+ 'step' => '1',
1129
+ 'min' => '0',
1130
+ 'max' => '100',
1131
+ 'sanitize_callback' => 'intval',
1132
+ 'class' => 'small-text',
1133
+ 'default' => '0',
1134
+ 'description' => '<br /><br />'
1135
+ ),
1136
+ 'aspectRatio' => array(
1137
+ 'default' => '1'
1138
+ ),
1139
+ 'titleShow' => array (
1140
+ 'id' => 'fancybox_YoutubetitleShow',
1141
+ 'input' => 'checkbox',
1142
+ 'hide' => true,
1143
+ 'default' => '',
1144
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1145
+ ),
1146
+ 'titlePosition' => array (
1147
+ 'id' => 'fancybox_YoutubetitlePosition',
1148
+ 'title' => esc_html__('Title Style','easy-fancybox'),
1149
+ 'label_for' => 'fancybox_YoutubetitlePosition',
1150
+ 'input' => 'select',
1151
+ 'hide' => true,
1152
+ 'options' => array(
1153
+ '' => esc_html__('Float','easy-fancybox'),
1154
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1155
+ 'outside-top' => esc_html__('Outside top','easy-fancybox'),
1156
+ 'inside' => esc_html__('Inside','easy-fancybox'),
1157
+ 'inside-top' => esc_html__('Inside top','easy-fancybox'),
1158
+ ),
1159
+ 'default' => '',
1160
+ 'description' => '<br />'
1161
+ ),
1162
+ 'titleFromAlt' => array (
1163
+ 'id' => 'fancybox_YoutubetitleFromAlt',
1164
+ 'input' => 'checkbox',
1165
+ 'hide' => true,
1166
+ 'default' => '1',
1167
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
1168
+ )
1169
+ )
1170
+ ),
1171
+
1172
+ 'Vimeo' => array(
1173
+ 'title' => esc_html__('Vimeo','easy-fancybox'),
1174
+ 'input' => 'multiple',
1175
+ 'options' => array(
1176
+ 'intro' => array (
1177
+ 'hide' => true,
1178
+ 'description' => esc_html__('To make any Vimeo movie open in an overlay, switch on Autodetect or use the class "fancybox-vimeo" for its link.','easy-fancybox') . '<br />'
1179
+ ),
1180
+ 'autoAttribute' => array (
1181
+ 'id' => 'fancybox_autoAttributeVimeo',
1182
+ 'input' => 'checkbox',
1183
+ 'hide' => true,
1184
+ 'default' => '1',
1185
+ 'selector' => '\'a[href*="vimeo.com/"],area[href*="vimeo.com/"]\').filter(function(){return this.href.match(/\/(?:[0-9]+|video\/)/);}',
1186
+ 'description' => esc_html__('Autodetect','easy-fancybox') . '<br />'
1187
+ ),
1188
+ 'tag' => array (
1189
+ 'hide' => true,
1190
+ 'default' => 'a.fancybox-vimeo,area.fancybox-vimeo,.fancybox-vimeo>a'
1191
+ ),
1192
+ 'class' => array (
1193
+ 'hide' => true,
1194
+ 'default' => 'fancybox-vimeo'
1195
+ ),
1196
+ 'width' => array (
1197
+ 'id' => 'fancybox_VimeoWidth',
1198
+ 'title' => translate('Width'),
1199
+ 'label_for' => 'fancybox_VimeoWidth',
1200
+ 'input' => 'number',
1201
+ 'step' => '1',
1202
+ 'min' => '400',
1203
+ 'max' => '1500',
1204
+ 'sanitize_callback' => 'intval',
1205
+ 'class' => 'small-text',
1206
+ 'default' => '500',
1207
+ 'description' => ' '
1208
+ ),
1209
+ 'height' => array (
1210
+ 'id' => 'fancybox_VimeoHeight',
1211
+ 'title' => translate('Height'),
1212
+ 'label_for' => 'fancybox_VimeoHeight',
1213
+ 'input' => 'number',
1214
+ 'step' => '1',
1215
+ 'min' => '225',
1216
+ 'max' => '900',
1217
+ 'sanitize_callback' => 'intval',
1218
+ 'class' => 'small-text',
1219
+ 'default' => '281'
1220
+ ),
1221
+ 'padding' => array (
1222
+ 'id' => 'fancybox_Vimeopadding',
1223
+ 'title' => translate('Border'),
1224
+ 'label_for' => 'fancybox_Vimeopadding',
1225
+ 'input' => 'number',
1226
+ 'step' => '1',
1227
+ 'min' => '0',
1228
+ 'max' => '100',
1229
+ 'sanitize_callback' => 'intval',
1230
+ 'class' => 'small-text',
1231
+ 'default' => '0',
1232
+ 'description' => '<br /><br />'
1233
+ ),
1234
+ 'aspectRatio' => array(
1235
+ 'default' => '1'
1236
+ ),
1237
+ 'titleShow' => array (
1238
+ 'id' => 'fancybox_VimeotitleShow',
1239
+ 'input' => 'checkbox',
1240
+ 'hide' => true,
1241
+ 'default' => '',
1242
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1243
+ ),
1244
+ 'titlePosition' => array (
1245
+ 'id' => 'fancybox_VimeotitlePosition',
1246
+ 'title' => esc_html__('Title Style','easy-fancybox'),
1247
+ 'label_for' => 'fancybox_VimeotitlePosition',
1248
+ 'input' => 'select',
1249
+ 'hide' => true,
1250
+ 'options' => array(
1251
+ '' => esc_html__('Float','easy-fancybox'),
1252
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1253
+ 'outside-top' => esc_html__('Outside top','easy-fancybox'),
1254
+ 'inside' => esc_html__('Inside','easy-fancybox'),
1255
+ 'inside-top' => esc_html__('Inside top','easy-fancybox'),
1256
+ ),
1257
+ 'default' => '',
1258
+ 'description' => '<br />'
1259
+ ),
1260
+ 'titleFromAlt' => array (
1261
+ 'id' => 'fancybox_VimeotitleFromAlt',
1262
+ 'input' => 'checkbox',
1263
+ 'hide' => true,
1264
+ 'default' => '1',
1265
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
1266
+ )
1267
+ )
1268
+ ),
1269
+
1270
+ 'Dailymotion' => array(
1271
+ 'title' => esc_html__('Dailymotion','easy-fancybox'),
1272
+ 'input' => 'multiple',
1273
+ 'options' => array(
1274
+ 'intro' => array (
1275
+ 'hide' => true,
1276
+ 'description' => esc_html__('To make any Dailymotion movie open in an overlay, switch on Autodetect or use the class "fancybox-dailymotion" for its link.','easy-fancybox') . '<br />'
1277
+ ),
1278
+ 'autoAttribute' => array (
1279
+ 'id' => 'fancybox_autoAttributeDailymotion',
1280
+ 'input' => 'checkbox',
1281
+ 'hide' => true,
1282
+ 'default' => '1',
1283
+ 'selector' => '\'a[href*="dailymotion.com/"],area[href*="dailymotion.com/"]\').filter(function(){return this.href.match(/\/video\//);}',
1284
+ 'description' => esc_html__('Autodetect','easy-fancybox') . '<br />'
1285
+ ),
1286
+ 'tag' => array (
1287
+ 'hide' => true,
1288
+ 'default' => 'a.fancybox-dailymotion,area.fancybox-dailymotion,.fancybox-dailymotion>a'
1289
+ ),
1290
+ 'class' => array (
1291
+ 'hide' => true,
1292
+ 'default' => 'fancybox-dailymotion'
1293
+ ),
1294
+ 'width' => array (
1295
+ 'id' => 'fancybox_DailymotionWidth',
1296
+ 'title' => translate('Width'),
1297
+ 'label_for' => 'fancybox_DailymotionWidth',
1298
+ 'input' => 'number',
1299
+ 'step' => '1',
1300
+ 'min' => '320',
1301
+ 'max' => '1500',
1302
+ 'sanitize_callback' => 'intval',
1303
+ 'class' => 'small-text',
1304
+ 'default' => '560',
1305
+ 'description' => ' '
1306
+ ),
1307
+ 'height' => array (
1308
+ 'id' => 'fancybox_DailymotionHeight',
1309
+ 'title' => translate('Height'),
1310
+ 'label_for' => 'fancybox_DailymotionHeight',
1311
+ 'input' => 'number',
1312
+ 'step' => '1',
1313
+ 'min' => '180',
1314
+ 'max' => '900',
1315
+ 'sanitize_callback' => 'intval',
1316
+ 'class' => 'small-text',
1317
+ 'default' => '315'
1318
+ ),
1319
+ 'padding' => array (
1320
+ 'id' => 'fancybox_DailymotionPadding',
1321
+ 'title' => translate('Border'),
1322
+ 'label_for' => 'fancybox_DailymotionPadding',
1323
+ 'input' => 'number',
1324
+ 'step' => '1',
1325
+ 'min' => '0',
1326
+ 'max' => '100',
1327
+ 'sanitize_callback' => 'intval',
1328
+ 'class' => 'small-text',
1329
+ 'default' => '0',
1330
+ 'description' => '<br /><br />'
1331
+ ),
1332
+ 'aspectRatio' => array(
1333
+ 'default' => '1'
1334
+ ),
1335
+ 'titleShow' => array (
1336
+ 'id' => 'fancybox_DailymotiontitleShow',
1337
+ 'input' => 'checkbox',
1338
+ 'hide' => true,
1339
+ 'default' => '',
1340
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1341
+ ),
1342
+ 'titlePosition' => array (
1343
+ 'id' => 'fancybox_DailymotiontitlePosition',
1344
+ 'title' => esc_html__('Title Style','easy-fancybox'),
1345
+ 'label_for' => 'fancybox_DailymotiontitlePosition',
1346
+ 'input' => 'select',
1347
+ 'hide' => true,
1348
+ 'options' => array(
1349
+ '' => esc_html__('Float','easy-fancybox'),
1350
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1351
+ 'outside-top' => esc_html__('Outside top','easy-fancybox'),
1352
+ 'inside' => esc_html__('Inside','easy-fancybox'),
1353
+ 'inside-top' => esc_html__('Inside top','easy-fancybox'),
1354
+ ),
1355
+ 'default' => '',
1356
+ 'description' => '<br />'
1357
+ ),
1358
+ 'titleFromAlt' => array (
1359
+ 'id' => 'fancybox_DailymotiontitleFromAlt',
1360
+ 'input' => 'checkbox',
1361
+ 'hide' => true,
1362
+ 'default' => '1',
1363
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
1364
+ )
1365
+ )
1366
+ ),
1367
+
1368
+ /* 'Tudou' => array(
1369
+ 'id' => 'fancybox_Tudou',
1370
+ 'title' => esc_html__('Tudou','easy-fancybox'),
1371
+ 'label_for' => '',
1372
+ 'input' => 'multiple',
1373
+ 'class' => '', 'description' => '',
1374
+ 'options' => array(
1375
+ 'autoAttributeTudou' => array (
1376
+ 'id' => 'fancybox_autoAttributeTudou',
1377
+ 'label_for' => '',
1378
+ 'input' => 'checkbox',
1379
+ 'class' => '',
1380
+ 'options' => array(),
1381
+ 'hide' => true,
1382
+ 'default' => '1',
1383
+ 'description' => esc_html__('Tudou links','easy-fancybox')
1384
+ )
1385
+ )
1386
+ ),*/
1387
+
1388
+ /* 'Animoto' => array(),
1389
+
1390
+ Example ANIMOTO page link http://animoto.com/play/Kf9POzQMSOGWyu41gtOtsw should become
1391
+ http://static.animoto.com/swf/w.swf?w=swf/vp1&f=Kf9POzQMSOGWyu41gtOtsw&i=m
1392
+
1393
+ */
1394
+
1395
+ 'iFrame' => array(
1396
+ 'title' => esc_html__('iFrames','easy-fancybox'),
1397
+ 'input' => 'multiple',
1398
+ 'options' => array(
1399
+ 'intro' => array (
1400
+ 'hide' => true,
1401
+ 'description' => esc_html__('To make a website or HTML document open in an overlay, use the class "fancybox-iframe" for its link.','easy-fancybox') . '<br /><br />'
1402
+ ),
1403
+ 'tag' => array (
1404
+ 'hide' => true,
1405
+ 'default' => 'a.fancybox-iframe,area.fancybox-iframe,.fancybox-iframe>a'
1406
+ ),
1407
+ 'class' => array (
1408
+ 'hide' => true,
1409
+ 'default' => 'fancybox-iframe'
1410
+ ),
1411
+ 'type' => array (
1412
+ 'default' => 'iframe'
1413
+ ),
1414
+ 'width' => array (
1415
+ 'id' => 'fancybox_iFramewidth',
1416
+ 'title' => translate('Width'),
1417
+ 'label_for' => 'fancybox_iFramewidth',
1418
+ 'input' => 'text',
1419
+ 'sanitize_callback' => 'intval',
1420
+ 'class' => 'small-text',
1421
+ 'default' => '70%',
1422
+ 'description' => ' '
1423
+ ),
1424
+ 'height' => array (
1425
+ 'id' => 'fancybox_iFrameheight',
1426
+ 'title' => translate('Height'),
1427
+ 'label_for' => 'fancybox_iFrameheight',
1428
+ 'input' => 'text',
1429
+ 'sanitize_callback' => 'intval',
1430
+ 'class' => 'small-text',
1431
+ 'default' => '90%',
1432
+ ),
1433
+ 'padding' => array (
1434
+ 'id' => 'fancybox_iFramepadding',
1435
+ 'title' => translate('Border'),
1436
+ 'label_for' => 'fancybox_iFramepadding',
1437
+ 'input' => 'number',
1438
+ 'step' => '1',
1439
+ 'min' => '0',
1440
+ 'max' => '100',
1441
+ 'sanitize_callback' => 'intval',
1442
+ 'class' => 'small-text',
1443
+ 'default' => '0',
1444
+ 'description' => '<br /><br />'
1445
+ ),
1446
+ 'titleShow' => array (
1447
+ 'id' => 'fancybox_iFrametitleShow',
1448
+ 'input' => 'checkbox',
1449
+ 'hide' => true,
1450
+ 'default' => '',
1451
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1452
+ ),
1453
+ 'titlePosition' => array (
1454
+ 'id' => 'fancybox_iFrametitlePosition',
1455
+ 'title' => esc_html__('Title Style','easy-fancybox'),
1456
+ 'label_for' => 'fancybox_iFrametitlePosition',
1457
+ 'input' => 'select',
1458
+ 'hide' => true,
1459
+ 'options' => array(
1460
+ '' => esc_html__('Float','easy-fancybox'),
1461
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1462
+ 'outside-top' => esc_html__('Outside top','easy-fancybox'),
1463
+ 'inside' => esc_html__('Inside','easy-fancybox'),
1464
+ 'inside-top' => esc_html__('Inside top','easy-fancybox'),
1465
+ ),
1466
+ 'default' => '',
1467
+ 'description' => '<br />'
1468
+ ),
1469
+ 'titleFromAlt' => array (
1470
+ 'id' => 'fancybox_iFrametitleFromAlt',
1471
+ 'input' => 'checkbox',
1472
+ 'hide' => true,
1473
+ 'default' => '1',
1474
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox') . '<br/>'
1475
+ ),
1476
+ 'allowFullScreen' => array (
1477
+ 'id' => 'fancybox_allowFullScreen',
1478
+ 'input' => 'checkbox',
1479
+ 'hide' => true,
1480
+ 'default' => '1',
1481
+ 'description' => esc_html__('Allow embedded content to jump to full screen mode','easy-fancybox')
1482
+ )
1483
+ )
1484
+ )
1485
+ );
inc/fancybox-2.php ADDED
@@ -0,0 +1,503 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * FancyBox v1
4
+ */
5
+
6
+ namespace easyFancyBox\fancyBox_2;
7
+
8
+ /**
9
+ * MAIN INLINE SCRIPT & STYLE
10
+ */
11
+
12
+ function prepare_inline_scripts() {
13
+ /**
14
+ * Global parameters and value extraction.
15
+ */
16
+ $fb_opts = array();
17
+
18
+ foreach ( \easyFancyBox::$options['Global']['options'] as $globals ) {
19
+ foreach ( $globals['options'] as $_key => $_value ) {
20
+ if ( isset($_value['id']) )
21
+ if ( isset($_value['default']) )
22
+ $parm = \get_option($_value['id'], $_value['default']);
23
+ else
24
+ $parm = \get_option($_value['id']);
25
+ elseif ( isset($_value['default']) )
26
+ $parm = $_value['default'];
27
+ else
28
+ $parm = '';
29
+
30
+ if ( isset($_value['input']) && 'checkbox' == $_value['input'] ) {
31
+ $parm = ( '1' == $parm ) ? true : false;
32
+ }
33
+
34
+ if( ! isset($_value['hide']) && $parm !== '' ) {
35
+ $fb_opts[$_key] = $parm;
36
+ } else {
37
+ ${$_key} = $parm;
38
+ }
39
+ }
40
+ }
41
+
42
+ // Change speeds.
43
+ $changespeed = get_option( 'fancybox_changeSpeed' );
44
+ if ( ! empty( $changespeed ) ) {
45
+ $fb_opts['prevSpeed'] = intval( $changespeed );
46
+ $fb_opts['nextSpeed'] = intval( $changespeed );
47
+ }
48
+
49
+ // Keys.
50
+ if ( ! \get_option( 'fancybox_enableEscapeButton', true ) ) {
51
+ $fb_opts['keys'] = array( 'close' => null );
52
+ }
53
+
54
+ // Overlay.
55
+ if ( \get_option( 'fancybox_overlayShow', true ) ) {
56
+ if ( ! \get_option( 'fancybox_hideOnOverlayClick', true ) ) {
57
+ $fb_opts['helpers']['overlay']['closeClick'] = false;
58
+ }
59
+ if ( \get_option( 'fancybox_overlayColor' ) ) {
60
+ $fb_opts['helpers']['overlay']['css'] = array(
61
+ 'background' =>
62
+ \esc_attr( \get_option('fancybox_overlayColor') )
63
+ );
64
+ }
65
+ } else {
66
+ $fb_opts['helpers']['overlay'] = null;
67
+ }
68
+
69
+ // Media helpers.
70
+ if ( add_media() ) {
71
+ $fb_opts['helpers']['media'] = array();
72
+
73
+ // Null the unselected.
74
+ \get_option( 'fancybox_enableYoutube' ) || $fb_opts['helpers']['media']['youtube'] = null;
75
+ \get_option( 'fancybox_enableVimeo' ) || $fb_opts['helpers']['media']['vimeo'] = null;
76
+ \get_option( 'fancybox_enableDailymotion' ) || $fb_opts['helpers']['media']['dailymotion'] = null;
77
+ \get_option( 'fancybox_enableInstagram' ) || $fb_opts['helpers']['media']['instagram'] = null;
78
+ \get_option( 'fancybox_enableGoogleMaps' ) || $fb_opts['helpers']['media']['google_maps'] = null;
79
+ }
80
+
81
+ $fb_opts = apply_filters( 'easy_fancybox_fb_opts', $fb_opts );
82
+
83
+ /**
84
+ * Build main handler.
85
+ */
86
+ $fb_handler = 'function(){';
87
+
88
+ // Exclude.
89
+ $exclude = \get_option( 'fancybox_autoExclude', \easyFancyBox::$options['Global']['options']['Miscellaneous']['options']['autoExclude']['default'] );
90
+ $exclude_array = $exclude ? \explode( ',', $exclude ) : array();
91
+ $exclude_selectors = ! empty( $exclude_array ) ? \json_encode( $exclude_array ) : false;
92
+
93
+ $fb_handler .= $exclude_selectors ? PHP_EOL . 'jQuery(' . $exclude_selectors . '.join(\',\')).addClass(\'nofancybox\');' : '';
94
+
95
+ // Close link.
96
+ $fb_handler .= PHP_EOL . 'jQuery(\'a.fancybox-close\').on(\'click\',function(e){e.preventDefault();jQuery.fancybox.close()});';
97
+
98
+ foreach ( \easyFancyBox::$options as $key => $value ) {
99
+ // Check if not enabled or hide=true then skip.
100
+ if ( isset( $value['hide'] ) || ! isset( \easyFancyBox::$options['Global']['options']['Enable']['options'][$key]['id'] ) || ! \get_option( \easyFancyBox::$options['Global']['options']['Enable']['options'][$key]['id'], \easyFancyBox::$options['Global']['options']['Enable']['options'][$key]['default'] ) )
101
+ continue;
102
+
103
+ $fb_handler .= '
104
+ /* ' . $key . ' */';
105
+
106
+ /**
107
+ * Auto-detection routines (2x)
108
+ */
109
+ $autoAttribute = isset( $value['options']['autoAttribute'] ) ? \get_option( $value['options']['autoAttribute']['id'], $value['options']['autoAttribute']['default'] ) : '';
110
+
111
+ if ( !empty($autoAttribute) ) {
112
+ if ( is_numeric($autoAttribute) ) {
113
+ $fb_handler .= '
114
+ jQuery('.$value['options']['autoAttribute']['selector'].').not(\'.nofancybox,li.nofancybox>a\').addClass(\''.$value['options']['class']['default'].'\');';
115
+ } else {
116
+ // Set selectors.
117
+ $file_types = array_filter( explode( ',', str_replace( ' ', ',', $autoAttribute ) ) );
118
+ $more = 0;
119
+ $fb_handler .= '
120
+ var fb_'.$key.'_select=\'';
121
+ foreach ( $file_types as $type ) {
122
+ if ($type == "jpg" || $type == "jpeg" || $type == "png" || $type == "webp" || $type == "gif")
123
+ $type = '.'.$type;
124
+ if ($more>0)
125
+ $fb_handler .= ',';
126
+ $fb_handler .= 'a['.$value['options']['autoAttribute']['selector'].'"'.$type.'"]:not(.nofancybox,li.nofancybox>a),area['.$value['options']['autoAttribute']['selector'].'"'.$type.'"]:not(.nofancybox)';
127
+ $more++;
128
+ }
129
+ $fb_handler .= '\';';
130
+
131
+ $autoselector = class_exists('easyFancyBox_Advanced') ? \get_option($value['options']['autoSelector']['id'],$value['options']['autoSelector']['default']) : $value['options']['autoSelector']['default'];
132
+
133
+ // Class and rel depending on settings.
134
+ if( '1' == \get_option($value['options']['autoAttributeLimit']['id'],$value['options']['autoAttributeLimit']['default']) ) {
135
+ // Add class.
136
+ $fb_handler .= '
137
+ var fb_'.$key.'_sections=jQuery(\''.$autoselector.'\');
138
+ fb_'.$key.'_sections.each(function(){jQuery(this).find(fb_'.$key.'_select).addClass(\''.$value['options']['class']['default'].'\')';
139
+ // Set rel.
140
+ switch( \get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
141
+ case '':
142
+ default :
143
+ $fb_handler .= ';});';
144
+ break;
145
+
146
+ case '1':
147
+ $fb_handler .= '.attr(\'data-fancybox-group\',\'gallery-\'+fb_'.$key.'_sections.index(this));});';
148
+ break;
149
+
150
+ case '2':
151
+ $fb_handler .= '.attr(\'data-fancybox-group\',\'gallery\');});';
152
+ break;
153
+ }
154
+ } else {
155
+ // Add class.
156
+ $fb_handler .= '
157
+ jQuery(fb_'.$key.'_select).addClass(\''.$value['options']['class']['default'].'\')';
158
+ // Set rel.
159
+ switch( \get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
160
+ case '':
161
+ default :
162
+ $fb_handler .= ';';
163
+ break;
164
+
165
+ case '1':
166
+ $fb_handler .= ';
167
+ var fb_'.$key.'_sections=jQuery(\''.$autoselector.'\');
168
+ fb_'.$key.'_sections.each(function(){jQuery(this).find(fb_'.$key.'_select).attr(\'data-fancybox-group\',\'gallery-\'+fb_'.$key.'_sections.index(this));});';
169
+ break;
170
+
171
+ case '2':
172
+ $fb_handler .= '.attr(\'data-fancybox-group\',\'gallery\');';
173
+ break;
174
+ }
175
+ }
176
+ }
177
+ }
178
+
179
+ // Prepare auto popup.
180
+ $trigger = $key == $autoClick ? $value['options']['class']['default'] : '';
181
+
182
+ /**
183
+ * Generate .fancybox() bind.
184
+ */
185
+
186
+ $bind_parameters = array();
187
+ foreach ( $value['options'] as $_key => $_value ) {
188
+ // Treat some known keys differently
189
+ $convert_to = array(
190
+ 'easingIn' => 'openEasing',
191
+ 'easingOut' => 'closeEasing',
192
+ );
193
+ if ( array_key_exists ( $_key, $convert_to ) ) {
194
+ $_key = $convert_to[$_key];
195
+ }
196
+
197
+ if ( isset($_value['id']) || isset($_value['default']) )
198
+ $parm = ! empty($_value['id']) ? strval( \get_option($_value['id'], isset($_value['default']) ? $_value['default'] : '' ) ) : strval( $_value['default'] );
199
+ else
200
+ $parm = '';
201
+
202
+ if ( isset($_value['input']) && 'checkbox'==$_value['input'] )
203
+ $parm = ( '1' == $parm ) ? true : false;
204
+
205
+ if ( ! isset($_value['hide']) && $parm !== '' ) {
206
+ $bind_parameters[$_key] = $parm;
207
+ }
208
+ }
209
+
210
+ // Title.
211
+ if ( isset( $value['options']['titleShow'] ) && ! empty( $value['options']['titleShow']['id'] ) && \get_option( $value['options']['titleShow']['id'] ) ) {
212
+ $bind_parameters['helpers'] = array( 'title' => array() );
213
+ /*if ( isset( $value['options']['titleType'] ) && \get_option( $value['options']['titleType']['id'] ) ) {
214
+ $bind_parameters['helpers']['title']['type'] = \esc_attr( \get_option( $value['options']['titleType']['id'] ) );
215
+ }*/
216
+ if ( isset( $value['options']['titlePosition'] ) ) {
217
+ $position = \get_option( $value['options']['titlePosition']['id'], $value['options']['titlePosition']['default'] );
218
+ $title = explode( '-', $position );
219
+ if ( ! empty( $title ) ) {
220
+ $bind_parameters['helpers']['title']['type'] = $title[0];
221
+ isset( $title[1] ) && $bind_parameters['helpers']['title']['position'] = $title[1];
222
+ }
223
+ }
224
+ if ( isset( $value['options']['titleFromAlt'] ) && \get_option( $value['options']['titleFromAlt']['id'] ) ) {
225
+ $bind_parameters['beforeShow'] = '{{titleFromAlt}}'; //;
226
+ }
227
+ } else {
228
+ $bind_parameters['helpers'] = array( 'title' => null );
229
+ }
230
+
231
+ // Iframe
232
+ if ( isset( $value['options']['allowFullScreen'] ) && ! \get_option( $value['options']['allowFullScreen']['id'], $value['options']['allowFullScreen']['default'] ) ) {
233
+ $bind_parameters['iframe'] = array( 'allowfullscreen' => false ); //;
234
+ }
235
+
236
+ // Keys.
237
+ if ( isset( $value['options']['enableKeyboardNav'] ) && ! empty( $value['options']['enableKeyboardNav']['id'] ) && ! \get_option( $value['options']['enableKeyboardNav']['id'], true ) ) {
238
+ $bind_parameters['keys'] = array( 'next' => null, 'prev' => null );
239
+ }
240
+
241
+ // Cyclic.
242
+ if ( isset( $value['options']['loop'] ) && ! empty( $value['options']['loop']['id'] ) && ! \get_option( $value['options']['loop']['id'] ) ) {
243
+ $bind_parameters['loop'] = false;
244
+ }
245
+
246
+ $fb_handler .= PHP_EOL . 'jQuery(\'' . $value['options']['tag']['default'] . '\').fancybox(jQuery.extend(true,{},fb_opts,' . \json_encode( $bind_parameters, JSON_NUMERIC_CHECK ) . '));';
247
+ }
248
+
249
+ $fb_handler .= '};';
250
+
251
+ // Replace TitleFromAlt shortcode.
252
+ $fb_handler = str_replace( '"{{titleFromAlt}}"', 'function(){var alt=this.element.find(\'img\').attr(\'alt\');this.inner.find(\'img\').attr(\'alt\',alt);this.title=this.title||alt;}', $fb_handler );
253
+
254
+ // Replace PDF embed shortcodes.
255
+ if ( ! empty( get_option('fancybox_enablePDF') ) && ! empty( get_option('fancybox_PDFonStart', '{{object}}') ) ) {
256
+ $replaces = array(
257
+ '"{{object}}"' => 'function(){this.type=\'html\';this.content=\'<object data="\'+this.href+\'" type="application/pdf" height="\'+this.width+\'" width="\'+this.height+\'" aria-label="\'+this.title+\'" />\'}',
258
+ '"{{embed}}"' => 'function(){this.type=\'html\';this.autoSize=false;this.content=\'<embed src="\'+this.href+\'" type="application/pdf" height="\'+this.width+\'" width="\'+this.height+\'" aria-label="\'+this.title+\'" />\'}',
259
+ '"{{googleviewer}}"' => 'function(){this.href=\'https://docs.google.com/viewer?embedded=true&url=\'+this.href;}'
260
+ );
261
+ foreach ($replaces as $short => $replace) {
262
+ $fb_handler = str_replace( $short, $replace, $fb_handler );
263
+ }
264
+ }
265
+
266
+ // Build script.
267
+ $script = 'var fb_timeout,fb_opts=' . \json_encode( $fb_opts, JSON_NUMERIC_CHECK ) . ',' . PHP_EOL .
268
+ 'easy_fancybox_handler=easy_fancybox_handler||' . $fb_handler . '' . PHP_EOL;
269
+
270
+ if ( empty( $delayClick ) ) $delayClick = '0';
271
+
272
+ switch ( $autoClick ) {
273
+ case '':
274
+ break;
275
+
276
+ case '1':
277
+ $script .= PHP_EOL . 'var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a#fancybox-auto,#fancybox-auto>a\').first().trigger(\'click\')},'.$delayClick.');};';
278
+ \easyFancyBox::$onready_auto = true;
279
+ break;
280
+
281
+ case '2':
282
+ $script .= PHP_EOL . 'var easy_fancybox_auto=function(){setTimeout(function(){if(location.hash){jQuery(location.hash).trigger(\'click\');}},'.$delayClick.');};';
283
+ \easyFancyBox::$onready_auto = true;
284
+ break;
285
+
286
+ case '99':
287
+ $script .= PHP_EOL . 'var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class|="fancybox"]\').filter(\':first\').trigger(\'click\')},'.$delayClick.');};';
288
+ \easyFancyBox::$onready_auto = true;
289
+ break;
290
+
291
+ default :
292
+ if ( ! empty( $trigger ) ) {
293
+ $script .= PHP_EOL . 'var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class*="'.$trigger.'"]\').filter(\':first\').trigger(\'click\')},'.$delayClick.');};';
294
+ \easyFancyBox::$onready_auto = true;
295
+ }
296
+ }
297
+
298
+ $script .= 'jQuery(easy_fancybox_handler);jQuery(document).on(\'' . implode( " ", \easyFancyBox::$events ) . '\',easy_fancybox_handler);' . PHP_EOL;
299
+
300
+ if ( \easyFancyBox::$onready_auto ) {
301
+ $script .= \apply_filters( 'easy_fancybox_onready_auto', 'jQuery(easy_fancybox_auto);' );
302
+ }
303
+
304
+ $script = \apply_filters( 'easy_fancybox_inline_script', $script );
305
+
306
+ \easyFancyBox::$inline_scripts['jquery-fancybox'] = array(
307
+ 'data' => $script,
308
+ 'position' => 'after'
309
+ );
310
+ }
311
+
312
+ function prepare_inline_styles() {
313
+ $styles = '';
314
+
315
+ $backgroundColor = get_option( 'fancybox_backgroundColor' );
316
+ $textColor = get_option( 'fancybox_textColor' );
317
+ $borderRadius = get_option( 'fancybox_borderRadius' );
318
+ $paddingColor = get_option( 'fancybox_paddingColor' );
319
+ $overlaySpotlight = get_option( 'fancybox_overlaySpotlight' );
320
+ $titleColor = get_option( 'fancybox_titleColor' );
321
+
322
+ // Content styles.
323
+ $content_style = '';
324
+ empty( $backgroundColor ) || $content_style .= 'background:'.$backgroundColor.';';
325
+ empty( $textColor ) || $content_style .= 'color:'.$textColor.';';
326
+
327
+ // Skin styles.
328
+ $skin_style = '';
329
+ empty( $borderRadius ) || $skin_style .= 'border-radius:'.$borderRadius.'px;';
330
+ empty( $paddingColor ) || $skin_style .= 'background:'.$paddingColor.';';
331
+
332
+ // Overlay.
333
+ empty( $overlaySpotlight ) || $styles .= '.fancybox-overlay{background-image:url("' . \easyFancyBox::$plugin_url . 'images/light-mask.png")!important;background-repeat:no-repeat!important;background-size:100% 100% !important}';
334
+ // Content.
335
+ empty( $content_style ) || $styles .= '.fancybox-inner{'.$content_style.'}';
336
+ // Skin.
337
+ empty( $skin_style ) || $styles .= '.fancybox-skin{'.$skin_style.'}';
338
+ // Title.
339
+ empty( $titleColor ) || $styles .= '.fancybox-title{color:'.$titleColor.'}';
340
+
341
+ $styles = \apply_filters( 'easy_fancybox_inline_style', $styles );
342
+
343
+ \easyFancyBox::$inline_styles['fancybox'] = \wp_strip_all_tags( $styles, true );
344
+ }
345
+
346
+ function add_media() {
347
+ static $add;
348
+
349
+ if ( null === $add ) {
350
+ $add = \get_option( 'fancybox_enableYoutube' ) ||
351
+ \get_option( 'fancybox_enableVimeo' ) ||
352
+ \get_option( 'fancybox_enableDailymotion' ) ||
353
+ \get_option( 'fancybox_enableInstagram' ) ||
354
+ \get_option( 'fancybox_enableGoogleMaps' );
355
+ }
356
+
357
+ return $add;
358
+ }
359
+
360
+ function add_thumbs() {
361
+ static $add;
362
+
363
+ if ( null === $add ) {
364
+ $add = apply_filters( 'easy_fancybox_add_thumbs', false );
365
+ }
366
+
367
+ return $add;
368
+ }
369
+
370
+ function add_buttons() {
371
+ static $add;
372
+
373
+ if ( null === $add ) {
374
+ $add = apply_filters( 'easy_fancybox_add_thumbs', false );;
375
+ }
376
+
377
+ return $add;
378
+ }
379
+
380
+ function add_easing() {
381
+ // Check IMG settings.
382
+ if ( \get_option( 'fancybox_enableImg', \easyFancyBox::$options['Global']['options']['Enable']['options']['IMG']['default'] ) &&
383
+ (
384
+ ( 'linear' !== \get_option( 'fancybox_easingIn', '' ) && '' !== \get_option( 'fancybox_easingIn', '' ) ) ||
385
+ ( 'linear' !== \get_option( 'fancybox_easingOut', '' ) && '' !== \get_option( 'fancybox_easingOut', '' ) )
386
+ )
387
+ ) {
388
+ return true;
389
+ }
390
+
391
+ // Check Inline Content settings.
392
+ if ( \get_option( 'fancybox_enableInline', false ) &&
393
+ (
394
+ ( 'linear' !== \get_option( 'fancybox_easingInInline', '' ) && '' !== \get_option( 'fancybox_easingInInline', '' ) ) ||
395
+ ( 'linear' !== \get_option( 'fancybox_easingOutInline', '' ) && '' !== \get_option( 'fancybox_easingOutInline', '' ) )
396
+ )
397
+ ) {
398
+ return true;
399
+ }
400
+
401
+ return false;
402
+ }
403
+
404
+ /**
405
+ * ACTIONS & FILTERS
406
+ */
407
+
408
+ function prepare_scripts_styles() {
409
+ // Make sure whe actually need to do anything.
410
+ if ( ! \easyFancyBox::add_scripts() ){
411
+ return;
412
+ }
413
+
414
+ // INLINE SCRIPT & STYLE
415
+ prepare_inline_scripts();
416
+ prepare_inline_styles();
417
+
418
+ // SCRIPT & STYLE URLS
419
+
420
+ $dep = get_option( 'fancybox_nojQuery', false ) ? array() : array( 'jquery' );
421
+ $ver = defined( 'WP_DEBUG' ) && WP_DEBUG ? time() : false;
422
+ $min = defined( 'WP_DEBUG' ) && WP_DEBUG ? '' : '.min';
423
+ $footer = get_option( 'fancybox_noFooter', false ) ? false : true;
424
+
425
+ // https://cdnjs.com/libraries/fancybox
426
+
427
+ // FancyBox.
428
+ \easyFancyBox::$styles['fancybox'] = array(
429
+ 'src' => \easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['fancyBox2'].'/jquery.fancybox'.$min.'.css',
430
+ 'deps' => array(),
431
+ 'ver' => $ver,
432
+ 'media' => 'screen'
433
+ );
434
+ \easyFancyBox::$scripts['jquery-fancybox'] = array(
435
+ 'src' => \easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['fancyBox2'].'/jquery.fancybox'.$min.'.js',
436
+ 'deps' => $dep,
437
+ 'ver' => $ver,
438
+ 'footer' => $footer
439
+ );
440
+
441
+ // Fancybox Media Helpers.
442
+ if ( add_media() ) {
443
+ \easyFancyBox::$scripts['jquery-fancybox-media'] = array(
444
+ 'src' => \easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['fancyBox2'].'/helpers/jquery.fancybox-media'.$min.'.js',
445
+ 'deps' => array('jquery-fancybox'),
446
+ 'ver' => $ver,
447
+ 'footer' => $footer
448
+ );
449
+ }
450
+
451
+ // Fancybox Thumbs Helpers.
452
+ if ( add_thumbs() ) {
453
+ \easyFancyBox::$styles['fancybox-thumbs'] = array(
454
+ 'src' => \easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['fancyBox2'].'/helpers/jquery.fancybox-thumbs'.$min.'.css',
455
+ 'deps' => array('fancybox'),
456
+ 'ver' => $ver,
457
+ 'media' => 'screen'
458
+ );
459
+ \easyFancyBox::$scripts['jquery-fancybox-thumbs'] = array(
460
+ 'src' => \easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['fancyBox2'].'/helpers/jquery.fancybox-thumbs'.$min.'.js',
461
+ 'deps' => array('jquery-fancybox'),
462
+ 'ver' => $ver,
463
+ 'footer' => $footer
464
+ );
465
+ }
466
+
467
+ // Fancybox Buttons Helpers.
468
+ if ( add_thumbs() ) {
469
+ \easyFancyBox::$styles['fancybox-buttons'] = array(
470
+ 'src' => \easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['fancyBox2'].'/helpers/jquery.fancybox-buttons'.$min.'.css',
471
+ 'deps' => array('fancybox'),
472
+ 'ver' => $ver,
473
+ 'media' => 'screen'
474
+ );
475
+ \easyFancyBox::$scripts['jquery-fancybox-buttons'] = array(
476
+ 'src' => \easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['fancyBox2'].'/helpers/jquery.fancybox-buttons'.$min.'.js',
477
+ 'deps' => array('jquery-fancybox'),
478
+ 'ver' => $ver,
479
+ 'footer' => $footer
480
+ );
481
+ }
482
+
483
+ // jQuery Easing, which is not needed if Easing is set to swing or linear.
484
+ if ( add_easing() ) {
485
+ \easyFancyBox::$easing_script_url = \easyFancyBox::$plugin_url.'vendor/jquery.easing.min.js';
486
+ }
487
+
488
+ // jQuery Mousewheel, which is not needed if jQueryUI Mouse is loaded or when using fancyBox 3.
489
+ if ( \get_option( 'fancybox_mouseWheel', true ) ) {
490
+ \easyFancyBox::$mousewheel_script_url = \easyFancyBox::$plugin_url.'vendor/jquery.mousewheel.min.js';
491
+ }
492
+
493
+ // Metadata in Miscellaneous settings?
494
+ if ( \get_option( 'fancybox_metaData' ) ) {
495
+ \easyFancyBox::$scripts['jquery-metadata'] = array(
496
+ 'src' => \easyFancyBox::$plugin_url.'vendor/jquery.metadata.min.js',
497
+ 'deps' => $dep,
498
+ 'ver' => METADATA_VERSION,
499
+ 'footer' => $footer
500
+ );
501
+ }
502
+ }
503
+ \add_action( 'init', __NAMESPACE__.'\prepare_scripts_styles', 12 );
inc/fancybox-classic-options.php ADDED
@@ -0,0 +1,1479 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * FancyBox v1 options and their defaults array.
4
+ */
5
+
6
+ $efb_options = array (
7
+ 'Global' => array (
8
+ 'backwardcompatible' => true, // Marks older Pro version compatibility.
9
+ 'input' => 'deep',
10
+ 'hide' => true,
11
+ 'options' => array(
12
+ 'Enable' => array (
13
+ 'title' => esc_html__('Media','easy-fancybox'),
14
+ 'input' => 'multiple',
15
+ 'hide' => true,
16
+ 'options' => array(
17
+ 'p1' => array (
18
+ 'hide' => true,
19
+ 'description' => esc_html__('Enable FancyBox for','easy-fancybox') . '<br />'
20
+ ),
21
+ 'IMG' => array (
22
+ 'id' => 'fancybox_enableImg',
23
+ 'input' => 'checkbox',
24
+ 'hide' => true,
25
+ 'default' => ( function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( EASY_FANCYBOX_BASENAME ) ) ? '' : '1',
26
+ 'description' => '<strong>' . esc_html__( 'Images', 'easy-fancybox' ) . '</strong>' . ( get_option('fancybox_enableImg') ? ' &mdash; <a href="#IMG">' . translate( 'Settings' ) . '</a>' : '' )
27
+ ),
28
+ 'Inline' => array (
29
+ 'id' => 'fancybox_enableInline',
30
+ 'input' => 'checkbox',
31
+ 'hide' => true,
32
+ 'default' => '',
33
+ 'description' => '<strong>' . esc_html__( 'Inline content', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableInline') ? ' &mdash; <a href="#Inline">' . translate( 'Settings' ) . '</a>' : '' )
34
+ ),
35
+ 'PDF' => array (
36
+ 'id' => 'fancybox_enablePDF',
37
+ 'input' => 'checkbox',
38
+ 'hide' => true,
39
+ 'default' => '',
40
+ 'description' => '<strong>' . esc_html__( 'PDF', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enablePDF') ? ' &mdash; <a href="#PDF">' . translate( 'Settings' ) . '</a>' : '' )
41
+ ),
42
+ 'SVG' => array (
43
+ 'id' => 'fancybox_enableSVG',
44
+ 'input' => 'checkbox',
45
+ 'hide' => true,
46
+ 'default' => '',
47
+ 'description' => '<strong>' . esc_html__( 'SVG', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableSVG') ? ' &mdash; <a href="#SVG">' . translate( 'Settings' ) . '</a>' : '' )
48
+ ),
49
+ 'VideoPress' => array (
50
+ 'id' => '',
51
+ 'input' => 'checkbox',
52
+ 'hide' => true,
53
+ 'default' => '',
54
+ 'status' => 'disabled',
55
+ 'description' => '<strong>' . esc_html__( 'VideoPress', 'easy-fancybox' ) . '</strong>' . ' ' . '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em>'
56
+ ),
57
+ 'YouTube' => array (
58
+ 'id' => 'fancybox_enableYoutube',
59
+ 'input' => 'checkbox',
60
+ 'hide' => true,
61
+ 'default' => '',
62
+ 'description' => '<strong>' . esc_html__( 'YouTube', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableYouTube') ? ' &mdash; <a href="#YouTube">' . translate( 'Settings' ) . '</a>' : '' )
63
+ ),
64
+ 'Vimeo' => array (
65
+ 'id' => 'fancybox_enableVimeo',
66
+ 'input' => 'checkbox',
67
+ 'hide' => true,
68
+ 'default' => '',
69
+ 'description' => '<strong>' . esc_html__( 'Vimeo', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableVimeo') ? ' &mdash; <a href="#Vimeo">' . translate( 'Settings' ) . '</a>' : '' )
70
+ ),
71
+ 'Dailymotion' => array (
72
+ 'id' => 'fancybox_enableDailymotion',
73
+ 'input' => 'checkbox',
74
+ 'hide' => true,
75
+ 'default' => '',
76
+ 'description' => '<strong>' . esc_html__( 'Dailymotion', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableDailymotion') ? ' &mdash; <a href="#Dailymotion">' . translate( 'Settings' ) . '</a>' : '' )
77
+ ),
78
+ 'iFrame' => array (
79
+ 'id' => 'fancybox_enableiFrame',
80
+ 'input' => 'checkbox',
81
+ 'hide' => true,
82
+ 'default' => '',
83
+ 'description' => '<strong>' . esc_html__('iFrames','easy-fancybox') . '</strong>' . '</strong>' . ( get_option('fancybox_enableiFrame') ? ' &mdash; <a href="#iFrame">' . translate( 'Settings' ) . '</a>' : '' )
84
+ )
85
+ ),
86
+ 'description' => ''
87
+ ),
88
+ 'Overlay' => array (
89
+ 'title' => esc_html__('Overlay','easy-fancybox'),
90
+ 'input' => 'multiple',
91
+ 'hide' => true,
92
+ 'options' => array(
93
+ 'overlayShow' => array (
94
+ 'id' => 'fancybox_overlayShow',
95
+ 'input' => 'checkbox',
96
+ 'noquotes' => true,
97
+ 'default' => '1',
98
+ 'description' => esc_html__('Show the overlay around content opened in FancyBox.','easy-fancybox')
99
+ ),
100
+ 'hideOnOverlayClick' => array (
101
+ 'id' => 'fancybox_hideOnOverlayClick',
102
+ 'input' => 'checkbox',
103
+ 'noquotes' => true,
104
+ 'default' => '1',
105
+ 'description' => esc_html__('Close FancyBox when overlay is clicked.','easy-fancybox')
106
+ ),
107
+ 'overlayOpacity' => array (
108
+ 'id' => 'fancybox_overlayOpacity',
109
+ 'title' => esc_html__('Opacity','easy-fancybox'),
110
+ 'label_for' => 'fancybox_overlayOpacity',
111
+ 'input' => 'number',
112
+ 'step' => '0.1',
113
+ 'min' => '0',
114
+ 'max' => '1',
115
+ 'class' => 'small-text',
116
+ 'default' => '',
117
+ 'description' => esc_html__('Value between 0 and 1. ','easy-fancybox') . ' <em>' . esc_html__('Default:','easy-fancybox') . ' 0.7</em><br />'
118
+ ),
119
+ 'overlayColor' => array (
120
+ 'id' => 'fancybox_overlayColor',
121
+ 'title' => esc_html__('Color','easy-fancybox'),
122
+ 'label_for' => 'fancybox_overlayColor',
123
+ 'input' => 'text',
124
+ 'sanitize_callback' => 'colorval',
125
+ 'class' => 'small-text',
126
+ 'default' => '',
127
+ 'description' => esc_html__('Enter an HTML color value.','easy-fancybox') . ' <em>' . esc_html__('Default:','easy-fancybox') . ' #777</em><br />'
128
+ ),
129
+ 'overlaySpotlight' => array (
130
+ 'id' => 'fancybox_overlaySpotlight',
131
+ 'input' => 'checkbox',
132
+ 'hide' => true,
133
+ 'status' => get_option('fancybox_overlaySpotlight') ? '' : 'disabled',
134
+ 'default' => '',
135
+ 'description' => esc_html__('Spotlight effect','easy-fancybox') . ( get_option('fancybox_overlaySpotlight') ? '' : '. <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') ) . '</a></em>'
136
+ )
137
+ )
138
+ ),
139
+ 'Window' => array (
140
+ 'title' => esc_html__('Window','easy-fancybox'),
141
+ 'input' => 'multiple',
142
+ 'hide' => true,
143
+ 'options' => array(
144
+ 'p1' => array (
145
+ 'hide' => true,
146
+ 'description' => '<strong>' . esc_html__('Appearance','easy-fancybox') . '</strong><br />'
147
+ ),
148
+ 'showCloseButton' => array (
149
+ 'id' => 'fancybox_showCloseButton',
150
+ 'input' => 'checkbox',
151
+ 'noquotes' => true,
152
+ 'default' => '1',
153
+ 'description' => esc_html__('Show the (X) close button','easy-fancybox')
154
+ ),
155
+ 'backgroundColor' => array (
156
+ 'id' => 'fancybox_backgroundColor',
157
+ 'hide' => true,
158
+ 'title' => esc_html__('Background color','easy-fancybox'),
159
+ 'label_for' => 'fancybox_backgroundColor',
160
+ 'input' => 'text',
161
+ 'sanitize_callback' => 'colorval',
162
+ 'status' => 'disabled',
163
+ 'class' => 'small-text',
164
+ 'default' => '',
165
+ 'description' => ''
166
+ ),
167
+ 'textColor' => array (
168
+ 'id' => 'fancybox_textColor',
169
+ 'hide' => true,
170
+ 'title' => esc_html__('Text color','easy-fancybox'),
171
+ 'label_for' => 'fancybox_textColor',
172
+ 'input' => 'text',
173
+ 'sanitize_callback' => 'colorval',
174
+ 'status' => 'disabled',
175
+ 'class' => 'small-text',
176
+ 'default' => '',
177
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em><br />'
178
+ ),
179
+ 'titleColor' => array (
180
+ 'id' => 'fancybox_titleColor',
181
+ 'hide' => true,
182
+ 'title' => esc_html__('Title color','easy-fancybox'),
183
+ 'label_for' => 'fancybox_titleColor',
184
+ 'input' => 'text',
185
+ 'sanitize_callback' => 'colorval',
186
+ 'class' => 'small-text',
187
+ 'default' => '',
188
+ 'description' => ''
189
+ ),
190
+ 'paddingColor' => array (
191
+ 'id' => 'fancybox_paddingColor',
192
+ 'hide' => true,
193
+ 'title' => esc_html__('Border color','easy-fancybox'),
194
+ 'label_for' => 'fancybox_paddingColor',
195
+ 'input' => 'text',
196
+ 'sanitize_callback' => 'colorval',
197
+ 'class' => 'small-text',
198
+ 'default' => '',
199
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' #000 x #fff</em><br />' . esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('Use RGBA notation for semi-transparent borders.','easy-fancybox') . ' <em>' . esc_html__('Example:','easy-fancybox') . ' rgba(10,10,30,0.7)</em><br />'
200
+ ),
201
+ 'borderRadius' => array (
202
+ 'id' => 'fancybox_borderRadius',
203
+ 'hide' => true,
204
+ 'title' => esc_html__('Border radius','easy-fancybox'),
205
+ 'label_for' => 'fancybox_borderRadius',
206
+ 'input' => 'number',
207
+ 'step' => '1',
208
+ 'min' => '0',
209
+ 'max' => '99',
210
+ 'sanitize_callback' => 'intval',
211
+ 'status' => 'disabled',
212
+ 'class' => 'small-text',
213
+ 'default' => '',
214
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em><br />'
215
+ ),
216
+
217
+ 'p11' => array (
218
+ 'hide' => true,
219
+ 'description' => '<br /><strong>' . esc_html__('Dimensions','easy-fancybox') . '</strong><br />'
220
+ ),
221
+ 'width' => array (
222
+ 'id' => 'fancybox_width',
223
+ 'title' => translate('Width'),
224
+ 'label_for' => 'fancybox_width',
225
+ 'input' => 'text',
226
+ 'sanitize_callback' => 'intval',
227
+ 'class' => 'small-text',
228
+ 'default' => '',
229
+ 'description' => ' '
230
+ ),
231
+ 'height' => array (
232
+ 'id' => 'fancybox_height',
233
+ 'title' => translate('Height'),
234
+ 'label_for' => 'fancybox_height',
235
+ 'input' => 'text',
236
+ 'sanitize_callback' => 'intval',
237
+ 'class' => 'small-text',
238
+ 'default' => '',
239
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' 560 x 340</em><br />' . esc_html__('If content size is not set or cannot be determined automatically, these default dimensions will be used.','easy-fancybox') . '<br />'
240
+ ),
241
+ 'padding' => array (
242
+ 'id' => 'fancybox_padding',
243
+ 'title' => translate('Border'),
244
+ 'label_for' => 'fancybox_padding',
245
+ 'input' => 'number',
246
+ 'step' => '1',
247
+ 'min' => '0',
248
+ 'max' => '100',
249
+ 'sanitize_callback' => 'intval',
250
+ 'class' => 'small-text',
251
+ 'default' => '',
252
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' 10</em><br />'
253
+ ),
254
+ 'margin' => array (
255
+ 'id' => 'fancybox_margin',
256
+ 'title' => esc_html__('Margin','easy-fancybox'),
257
+ 'label_for' => 'fancybox_margin',
258
+ 'input' => 'number',
259
+ 'step' => '1',
260
+ 'min' => '20',
261
+ 'max' => '80',
262
+ 'sanitize_callback' => 'intval',
263
+ 'class' => 'small-text',
264
+ 'default' => '20',
265
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' 40</em><br />'
266
+ ),
267
+
268
+ 'p2' => array (
269
+ 'hide' => true,
270
+ 'description' => '<br /><strong>' . esc_html__('Behavior','easy-fancybox') . '</strong><br />'
271
+ ),
272
+ 'enableEscapeButton' => array (
273
+ 'id' => 'fancybox_enableEscapeButton',
274
+ 'input' => 'checkbox',
275
+ 'noquotes' => true,
276
+ 'default' => '1',
277
+ 'description' => esc_html__('Esc key stroke closes FancyBox','easy-fancybox')
278
+ ),
279
+ 'autoScale' => array (
280
+ 'id' => 'fancybox_autoScale',
281
+ 'input' => 'checkbox',
282
+ 'noquotes' => true,
283
+ 'default' => '1',
284
+ 'description' => esc_html__('Scale large content down to fit in the browser viewport.','easy-fancybox')
285
+ ),
286
+ 'speedIn' => array (
287
+ 'id' => 'fancybox_speedIn',
288
+ 'title' => esc_html__('Opening speed','easy-fancybox'),
289
+ 'label_for' => 'fancybox_speedIn',
290
+ 'input' => 'number',
291
+ 'step' => '100',
292
+ 'min' => '0',
293
+ 'max' => '6000',
294
+ 'sanitize_callback' => 'intval',
295
+ 'class' => 'small-text',
296
+ 'default' => '',
297
+ ),
298
+ 'speedOut' => array (
299
+ 'id' => 'fancybox_speedOut',
300
+ 'title' => esc_html__('Closing speed','easy-fancybox'),
301
+ 'label_for' => 'fancybox_speedOut',
302
+ 'input' => 'number',
303
+ 'step' => '100',
304
+ 'min' => '0',
305
+ 'max' => '6000',
306
+ 'sanitize_callback' => 'intval',
307
+ 'class' => 'small-text',
308
+ 'default' => '',
309
+ 'description' => '<br />' . esc_html__('Duration in milliseconds. Higher is slower.','easy-fancybox') . ' <em>' . esc_html__('Default:','easy-fancybox') . ' 300</em><br />'
310
+ ),
311
+ 'mouseWheel' => array (
312
+ 'id' => 'fancybox_mouseWheel',
313
+ 'hide' => true,
314
+ 'input' => 'checkbox',
315
+ 'default' => '',
316
+ 'description' => esc_html__('Include the Mousewheel jQuery extension script to allow gallery browsing by mousewheel action.','easy-fancybox')
317
+ )
318
+ )
319
+ ),
320
+
321
+ 'Miscellaneous' => array (
322
+ 'title' => esc_html__('Miscellaneous','easy-fancybox'),
323
+ 'input' => 'multiple',
324
+ 'hide' => true,
325
+ 'options' => array(
326
+ 'p0' => array (
327
+ 'hide' => true,
328
+ 'description' => '<strong>' . esc_html__('Auto popup','easy-fancybox') . '</strong><br />'
329
+ ),
330
+ 'autoClick' => array (
331
+ 'id' => 'fancybox_autoClick',
332
+ 'title' => esc_html__('Open on page load','easy-fancybox'),
333
+ 'label_for' => 'fancybox_autoClick',
334
+ 'hide' => true,
335
+ 'input' => 'select',
336
+ 'options' => array(
337
+ '' => translate('None'),
338
+ '1' => esc_html__('Link with ID "fancybox-auto"','easy-fancybox'),
339
+ ),
340
+ 'default' => '1',
341
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />'
342
+ ),
343
+ 'delayClick' => array (
344
+ 'id' => 'fancybox_delayClick',
345
+ 'title' => esc_html__('Delay in milliseconds','easy-fancybox'),
346
+ 'label_for' => 'fancybox_delayClick',
347
+ 'hide' => true,
348
+ 'input' => 'number',
349
+ 'step' => '100',
350
+ 'min' => '0',
351
+ 'max' => '',
352
+ 'sanitize_callback' => 'intval',
353
+ 'class' => 'small-text',
354
+ 'default' => '1000',
355
+ 'description' => ' <em>' . esc_html__('Default:','easy-fancybox') . ' 1000</em><br />'
356
+ ),
357
+ 'jqCookie' => array (
358
+ 'id' => '',
359
+ 'title' => esc_html__('Hide popup after first visit?','easy-fancybox'),
360
+ 'hide' => true,
361
+ 'input' => 'select',
362
+ 'status' => 'disabled',
363
+ 'default' => '0',
364
+ 'sanitize_callback' => 'intval',
365
+ 'options' => array(
366
+ '0' => translate('No'),
367
+ '1' => esc_html__('1 Day','easy-fancybox'),
368
+ '7' => esc_html__('1 Week','easy-fancybox'),
369
+ '30' => esc_html__('1 Month','easy-fancybox'),
370
+ '365' => esc_html__('1 Year','easy-fancybox')
371
+ ),
372
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em><br />'
373
+ ),
374
+ 'cookiePath' => array (
375
+ 'id' => '',
376
+ 'default' => '',
377
+ 'hide' => true
378
+ ),
379
+ 'p1' => array (
380
+ 'hide' => true,
381
+ 'description' => '<br /><strong>' . esc_html__('Browser & device compatibility','easy-fancybox') . '</strong><br />'
382
+ ),
383
+ 'minViewportWidth' => array (
384
+ 'id' => 'fancybox_minViewportWidth',
385
+ 'title' => esc_html__('Minimum browser/device viewport width','easy-fancybox'),
386
+ 'label_for' => 'fancybox_minViewportWidth',
387
+ 'input' => 'number',
388
+ 'step' => '1',
389
+ 'min' => '320',
390
+ 'max' => '900',
391
+ 'sanitize_callback' => 'intval',
392
+ 'class' => 'small-text',
393
+ 'default' => '',
394
+ 'description' => esc_html__('(leave empty to ignore)','easy-fancybox') . '<br/>'
395
+ ),
396
+ /* 'forceNewtab' => array (
397
+ 'id' => 'fancybox_forceNewtab',
398
+ 'input' => 'checkbox',
399
+ 'hide' => true,
400
+ 'default' => '1',
401
+ 'description' => esc_html__('Make media links open in a new tab when viewport falls below minimum width (above)','easy-fancybox')
402
+ ),*/
403
+ 'p2' => array (
404
+ 'hide' => true,
405
+ 'description' => '<br /><strong>' . esc_html__('Theme & plugins compatibility','easy-fancybox') . '</strong><br />'
406
+ . esc_html__('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')
407
+ . '<br /><br />'
408
+ ),
409
+ 'scriptPriority' => array (
410
+ 'id' => 'fancybox_scriptPriority',
411
+ 'title' => esc_html__('FancyBox script priority','easy-fancybox'),
412
+ 'label_for' => 'fancybox_scriptPriority',
413
+ 'hide' => true,
414
+ 'input' => 'number',
415
+ 'step' => '1',
416
+ 'min' => '-99',
417
+ 'max' => '999',
418
+ 'sanitize_callback' => 'intval',
419
+ 'class' => 'small-text',
420
+ 'default' => '10',
421
+ 'description' => esc_html__('Default priority is 10.','easy-fancybox') . ' ' . esc_html__('Higher is later.','easy-fancybox') . '<br/>'
422
+ ),
423
+ 'noFooter' => array (
424
+ 'id' => 'fancybox_noFooter',
425
+ 'input' => 'checkbox',
426
+ 'hide' => true,
427
+ 'default' => '',
428
+ 'description' => esc_html__('Move scripts from footer to theme head section (not recommended for site load times!)','easy-fancybox')
429
+ ),
430
+ 'nojQuery' => array (
431
+ 'id' => 'fancybox_nojQuery',
432
+ 'input' => 'checkbox',
433
+ 'hide' => true,
434
+ 'default' => '',
435
+ 'description' => esc_html__('Do not include standard WordPress jQuery library (do this only if you are sure jQuery is included from another source!)','easy-fancybox')
436
+ ),
437
+ 'pre45Compat' => array (
438
+ 'id' => 'fancybox_pre45Compat',
439
+ 'input' => 'checkbox',
440
+ 'hide' => true,
441
+ 'default' => function_exists( 'wp_add_inline_script' ) ? '' : '1',
442
+ 'description' => esc_html__('Do not use wp_add_inline_script/style functions (may solve issues with older script minification plugins)','easy-fancybox')
443
+ ),
444
+ 'p3' => array (
445
+ 'hide' => true,
446
+ 'description' => '<br /><strong>' . esc_html__('Advanced','easy-fancybox') . '</strong><br />'
447
+ ),
448
+ 'metaData' => array (
449
+ 'id' => 'fancybox_metaData',
450
+ 'hide' => true,
451
+ 'input' => 'checkbox',
452
+ 'status' => get_option('fancybox_metaData') ? '' : 'disabled',
453
+ 'default' => '',
454
+ 'description' => esc_html__('Include the Metadata jQuery extension script to allow passing custom parameters via link class.','easy-fancybox') . ( get_option('fancybox_metaData') ? '' : '. <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') ) . '</a></em>'
455
+ ),
456
+ 'vcMasonryCompat' => array (
457
+ 'id' => 'fancybox_vcMasonryCompat',
458
+ 'hide' => true,
459
+ 'input' => 'checkbox',
460
+ 'status' => 'disabled',
461
+ 'default' => '',
462
+ 'description' => esc_html__('WPBakery / Visual Composer - Masonry Grid Gallery compatibility.','easy-fancybox') . ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em>'
463
+ ),
464
+ 'autoExclude' => array (
465
+ 'id' => 'fancybox_autoExclude',
466
+ 'title' => esc_html__('Exclude','easy-fancybox'),
467
+ 'label_for' => 'fancybox_autoExclude',
468
+ 'input' => 'text',
469
+ 'class' => 'regular-text',
470
+ 'hide' => true,
471
+ 'default' => '.nolightbox,a.wp-block-fileesc_html__button,a.pin-it-button,a[href*=\'pinterest.com/pin/create\'],a[href*=\'facebook.com/share\'],a[href*=\'twitter.com/share\']',
472
+ 'sanitize_callback' => 'csl_text',
473
+ 'description' => esc_html__('A comma-separated list of selectors for elements to which FancyBox should not automatically bind itself. Media links inside these elements will be ignored by Autodetect.','easy-fancybox') . ' <em>' . esc_html__('Default:','easy-fancybox') . ' .nolightbox,a.wp-block-fileesc_html__button,a.pin-it-button,a[href*=\'pinterest.com/pin/create\'],a[href*=\'facebook.com/share\'],a[href*=\'twitter.com/share\']</em><br />'
474
+ )
475
+ )
476
+ )
477
+ )
478
+ ),
479
+
480
+ 'IMG' => array(
481
+ 'title' => esc_html__('Images','easy-fancybox'),
482
+ 'input' => 'multiple',
483
+ 'options' => array(
484
+ 'intro' => array (
485
+ 'hide' => true,
486
+ 'description' => esc_html__('To make images open in an overlay, add their extension to the Autodetect field or use the class "fancybox" for its link. Clear field to switch off all autodetection.','easy-fancybox') . '<br />'
487
+ ),
488
+ 'tag' => array (
489
+ 'hide' => true,
490
+ 'default' => 'a.fancybox,area.fancybox,.fancybox>a'
491
+ ),
492
+ 'class' => array (
493
+ 'hide' => true,
494
+ 'default' => 'fancybox image'
495
+ ),
496
+ 'autoAttribute' => array (
497
+ 'id' => 'fancybox_autoAttribute',
498
+ 'title' => esc_html__('Autodetect','easy-fancybox'),
499
+ 'label_for' => 'fancybox_autoAttribute',
500
+ 'input' => 'text',
501
+ 'class' => 'regular-text',
502
+ 'hide' => true,
503
+ 'default' => '.jpg,.png,.webp',
504
+ 'sanitize_callback' => 'csl_text',
505
+ 'selector' => 'href*=',
506
+ 'description' => esc_html__('A comma-separated list of image file extensions to which FancyBox should automatically bind itself.','easy-fancybox') . ' <em>' . esc_html__('Example:','easy-fancybox') . ' .jpg,.png,.gif,.jpeg</em><br />'
507
+ ),
508
+ 'autoAttributeLimit' => array (
509
+ 'id' => 'fancybox_autoAttributeLimit',
510
+ 'title' => esc_html__('Apply to','easy-fancybox'),
511
+ 'label_for' => 'fancybox_autoAttributeLimit',
512
+ 'hide' => true,
513
+ 'input' => 'select',
514
+ 'options' => array(
515
+ '' => esc_html__('All image links', 'easy-fancybox')
516
+ ),
517
+ 'default' => '',
518
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />'
519
+ ),
520
+ 'type' => array (
521
+ 'id' => 'fancybox_classType',
522
+ 'title' => esc_html__('Force FancyBox to treat all media linked with class="fancybox" as images?','easy-fancybox'),
523
+ 'label_for' => 'fancybox_classType',
524
+ 'input' => 'select',
525
+ 'options' => array(
526
+ 'image' => translate('Yes'),
527
+ '' => translate('No')
528
+ ),
529
+ 'default' => get_option('fancybox_enableInline') ? 'image' : '',
530
+ 'description' => '<br/>'
531
+ ),
532
+ 'p2' => array (
533
+ 'hide' => true,
534
+ 'description' => '<br /><strong>' . esc_html__('Behavior','easy-fancybox') . '</strong><br />'
535
+ ),
536
+ 'transitionIn' => array (
537
+ 'id' => 'fancybox_transitionIn',
538
+ 'title' => esc_html__('Transition In','easy-fancybox'),
539
+ 'label_for' => 'fancybox_transitionIn',
540
+ 'input' => 'select',
541
+ 'options' => array(
542
+ 'none' => translate('None'),
543
+ '' => esc_html__('Fade','easy-fancybox'),
544
+ 'elastic' => esc_html__('Elastic','easy-fancybox'),
545
+ ),
546
+ 'default' => 'elastic',
547
+ 'description' => ' '
548
+ ),
549
+ 'easingIn' => array (
550
+ 'id' => 'fancybox_easingIn',
551
+ 'title' => esc_html__('Easing In','easy-fancybox'),
552
+ 'label_for' => 'fancybox_easingIn',
553
+ 'input' => 'select',
554
+ 'options' => array(
555
+ 'linear' => esc_html__('Linear','easy-fancybox'),
556
+ '' => esc_html__('Swing','easy-fancybox')
557
+ ),
558
+ 'default' => '',
559
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />'
560
+ ),
561
+ 'transitionOut' => array (
562
+ 'id' => 'fancybox_transitionOut',
563
+ 'title' => esc_html__('Transition Out','easy-fancybox'),
564
+ 'label_for' => 'fancybox_transitionOut',
565
+ 'input' => 'select',
566
+ 'options' => array(
567
+ 'none' => translate('None'),
568
+ '' => esc_html__('Fade','easy-fancybox'),
569
+ 'elastic' => esc_html__('Elastic','easy-fancybox'),
570
+ ),
571
+ 'default' => 'elastic',
572
+ 'description' => ' '
573
+ ),
574
+ 'easingOut' => array (
575
+ 'id' => 'fancybox_easingOut',
576
+ 'title' => esc_html__('Easing Out','easy-fancybox'),
577
+ 'label_for' => 'fancybox_easingOut',
578
+ 'input' => 'select',
579
+ 'options' => array(
580
+ 'linear' => esc_html__('Linear','easy-fancybox'),
581
+ '' => esc_html__('Swing','easy-fancybox')
582
+ ),
583
+ 'default' => '',
584
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />' . esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('Easing effects only apply when Transition is set to Elastic. ','easy-fancybox') . '<br /><br />'
585
+ ),
586
+ 'opacity' => array (
587
+ 'id' => 'fancybox_opacity',
588
+ 'input' => 'checkbox',
589
+ 'noquotes' => true,
590
+ 'default' => '',
591
+ 'description' => esc_html__('Transparency fade during elastic transition. CAUTION: Use only when at least Transition In is set to Elastic!','easy-fancybox')
592
+ ),
593
+ 'hideOnContentClick' => array (
594
+ 'id' => 'fancybox_hideOnContentClick',
595
+ 'input' => 'checkbox',
596
+ 'noquotes' => true,
597
+ 'default' => '',
598
+ 'description' => esc_html__('Close FancyBox when content is clicked','easy-fancybox')
599
+ ),
600
+ 'p1' => array (
601
+ 'hide' => true,
602
+ 'description' => '<br /><strong>' . esc_html__('Appearance','easy-fancybox') . '</strong><br />'
603
+ ),
604
+ 'titleShow' => array (
605
+ 'id' => 'fancybox_titleShow',
606
+ 'input' => 'checkbox',
607
+ 'noquotes' => true,
608
+ 'default' => '1',
609
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
610
+ ),
611
+ 'titlePosition' => array (
612
+ 'id' => 'fancybox_titlePosition',
613
+ 'title' => esc_html__('Title Position','easy-fancybox'),
614
+ 'label_for' => 'fancybox_titlePosition',
615
+ 'input' => 'select',
616
+ 'options' => array(
617
+ '' => esc_html__('Float','easy-fancybox'),
618
+ 'outside' => esc_html__('Outside','easy-fancybox'),
619
+ 'inside' => esc_html__('Inside','easy-fancybox'),
620
+ 'over' => esc_html__('Overlay','easy-fancybox')
621
+ ),
622
+ 'default' => 'over',
623
+ 'description' => '<br />'
624
+ ),
625
+ 'titleFromAlt' => array (
626
+ 'id' => 'fancybox_titleFromAlt',
627
+ 'input' => 'checkbox',
628
+ 'noquotes' => true,
629
+ 'default' => '1',
630
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
631
+ ),
632
+ 'onStart' => array (
633
+ 'id' => '',
634
+ 'title' => esc_html__('Advanced','easy-fancybox'),
635
+ 'input' => 'select',
636
+ 'status' => 'disabled',
637
+ 'options' => array(
638
+ '' => esc_html__('Hide/show title on mouse hover action','easy-fancybox')
639
+ ),
640
+ 'default' => '',
641
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em><br />'
642
+ ),
643
+ 'p3' => array (
644
+ 'hide' => true,
645
+ 'description' => '<br /><strong>' . esc_html__('Gallery','easy-fancybox') . '</strong><br />'
646
+ ),
647
+ 'autoGallery' => array (
648
+ 'id' => 'fancybox_autoGallery',
649
+ 'title' => esc_html__('Autogallery','easy-fancybox'),
650
+ 'label_for' => 'fancybox_autoGallery',
651
+ 'hide' => true,
652
+ 'input' => 'select',
653
+ 'options' => array(
654
+ '' => translate('Disabled'),
655
+ '1' => esc_html__('WordPress galleries only','easy-fancybox'),
656
+ '2' => esc_html__('All in one gallery','easy-fancybox')
657
+ ),
658
+ 'default' => '1',
659
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />' . esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('When disabled, you can use the rel attribute to manually group image links together.','easy-fancybox') . '<br /><br />'
660
+ ),
661
+ 'showNavArrows' => array (
662
+ 'id' => 'fancybox_showNavArrows',
663
+ 'input' => 'checkbox',
664
+ 'noquotes' => true,
665
+ 'default' => '1',
666
+ 'description' => esc_html__('Show the gallery navigation arrows','easy-fancybox')
667
+ ),
668
+ 'enableKeyboardNav' => array (
669
+ 'id' => 'fancybox_enableKeyboardNav',
670
+ 'input' => 'checkbox',
671
+ 'noquotes' => true,
672
+ 'default' => '1',
673
+ 'description' => esc_html__('Arrow key strokes browse the gallery','easy-fancybox')
674
+ ),
675
+ 'cyclic' => array (
676
+ 'id' => 'fancybox_cyclic',
677
+ 'input' => 'checkbox',
678
+ 'noquotes' => true,
679
+ 'default' => '',
680
+ 'description' => esc_html__('Make galleries cyclic, allowing you to keep pressing next/back.','easy-fancybox')
681
+ ),
682
+ 'changeSpeed' => array (
683
+ 'id' => 'fancybox_changeSpeed',
684
+ 'title' => esc_html__('Change speed','easy-fancybox'),
685
+ 'label_for' => 'fancybox_changeSpeed',
686
+ 'input' => 'number',
687
+ 'step' => '1',
688
+ 'min' => '0',
689
+ 'max' => '6000',
690
+ 'sanitize_callback' => 'intval',
691
+ 'class' => 'small-text',
692
+ 'default' => '',
693
+ ),
694
+ 'changeFade' => array (
695
+ 'id' => 'fancybox_changeFade',
696
+ 'title' => esc_html__('Fade speed','easy-fancybox'),
697
+ 'label_for' => 'fancybox_changeFade',
698
+ 'input' => 'number',
699
+ 'step' => '1',
700
+ 'min' => '0',
701
+ 'max' => '6000',
702
+ 'sanitize_callback' => 'intval',
703
+ 'class' => 'small-text',
704
+ 'default' => '',
705
+ 'description' => '<br />' . esc_html__('Duration in milliseconds. Higher is slower.','easy-fancybox') . ' <em>' . esc_html__('Default:','easy-fancybox') . ' 300</em><br /><br />'
706
+ ),
707
+ 'autoSelector' => array (
708
+ 'id' => 'fancybox_autoSelector',
709
+ 'hide' => true,
710
+ 'input' => 'hidden',
711
+ 'default' => '.gallery,.wp-block-gallery,.tiled-gallery,.wp-block-jetpack-tiled-gallery'
712
+ ),
713
+ 'onComplete' => array (
714
+ 'id' => '',
715
+ 'title' => esc_html__('Advanced','easy-fancybox'),
716
+ 'input' => 'select',
717
+ 'status' => 'disabled',
718
+ 'options' => array(
719
+ '' => esc_html__('Slideshow','easy-fancybox')
720
+ ),
721
+ 'default' => '',
722
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em>'
723
+ )
724
+ )
725
+ ),
726
+
727
+ 'Inline' => array(
728
+ 'title' => esc_html__('Inline content','easy-fancybox'),
729
+ 'input' => 'multiple',
730
+ 'options' => array(
731
+ 'intro' => array (
732
+ 'hide' => true,
733
+ 'description' => esc_html__('To make inline content open in an overlay, wrap that content in a div with a unique ID, create a link with target "#uniqueID" and give it a class "fancybox-inline" attribute.','easy-fancybox') . '<br /><br />'
734
+ ),
735
+ 'tag' => array (
736
+ 'hide' => true,
737
+ 'default' => 'a.fancybox-inline,area.fancybox-inline,.fancybox-inline>a'
738
+ ),
739
+ 'class' => array (
740
+ 'hide' => true,
741
+ 'default' => 'fancybox-inline'
742
+ ),
743
+ 'type' => array (
744
+ 'default' => 'inline'
745
+ ),
746
+ 'autoDimensions' => array (
747
+ 'id' => 'fancybox_autoDimensions',
748
+ 'input' => 'checkbox',
749
+ 'noquotes' => true,
750
+ 'default' => '1',
751
+ 'description' => esc_html__('Try to adjust size to inline/html content. If unchecked the default dimensions will be used.','easy-fancybox') . ''
752
+ ),
753
+ 'scrolling' => array (
754
+ 'id' => 'fancybox_InlineScrolling',
755
+ 'title' => esc_html__('Scrolling','easy-fancybox'),
756
+ 'label_for' => 'fancybox_InlineScrolling',
757
+ 'input' => 'select',
758
+ 'options' => array(
759
+ 'auto' => esc_html__('Auto','easy-fancybox'),
760
+ 'yes' => esc_html__('Always','easy-fancybox'),
761
+ 'no' => esc_html__('Never','easy-fancybox')
762
+ ),
763
+ 'default' => 'no',
764
+ 'description' => esc_html__('Define scrolling and scrollbar visibility.','easy-fancybox') . '<br /><br />'
765
+ ),
766
+ 'transitionIn' => array (
767
+ 'id' => 'fancybox_transitionInInline',
768
+ 'title' => esc_html__('Transition In','easy-fancybox'),
769
+ 'label_for' => 'fancybox_transitionInInline',
770
+ 'input' => 'select',
771
+ 'options' => array(
772
+ 'none' => translate('None'),
773
+ '' => esc_html__('Fade','easy-fancybox'),
774
+ 'elastic' => esc_html__('Elastic','easy-fancybox'),
775
+ ),
776
+ 'default' => '',
777
+ 'description' => ' '
778
+ ),
779
+ 'easingIn' => array (
780
+ 'id' => 'fancybox_easingInInline',
781
+ 'title' => esc_html__('Easing In','easy-fancybox'),
782
+ 'label_for' => 'fancybox_easingInInline',
783
+ 'input' => 'select',
784
+ 'options' => array(
785
+ 'linear' => esc_html__('Linear','easy-fancybox'),
786
+ '' => esc_html__('Swing','easy-fancybox')
787
+ ),
788
+ 'default' => 'easeOutBack',
789
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />'
790
+ ),
791
+ 'transitionOut' => array (
792
+ 'id' => 'fancybox_transitionOutInline',
793
+ 'title' => esc_html__('Transition Out','easy-fancybox'),
794
+ 'label_for' => 'fancybox_transitionOutInline',
795
+ 'input' => 'select',
796
+ 'options' => array(
797
+ 'none' => translate('None'),
798
+ '' => esc_html__('Fade','easy-fancybox'),
799
+ 'elastic' => esc_html__('Elastic','easy-fancybox'),
800
+ ),
801
+ 'default' => '',
802
+ 'description' => ' '
803
+ ),
804
+ 'easingOut' => array (
805
+ 'id' => 'fancybox_easingOutInline',
806
+ 'title' => esc_html__('Easing Out','easy-fancybox'),
807
+ 'label_for' => 'fancybox_easingOutInline',
808
+ 'input' => 'select',
809
+ 'options' => array(
810
+ 'linear' => esc_html__('Linear','easy-fancybox'),
811
+ '' => esc_html__('Swing','easy-fancybox')
812
+ ),
813
+ 'default' => '',
814
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />' . esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('Easing effects only apply when Transition is set to Elastic. ','easy-fancybox') . '<br /><br />'
815
+ ),
816
+ 'opacity' => array (
817
+ 'id' => 'fancybox_opacityInline',
818
+ 'input' => 'checkbox',
819
+ 'noquotes' => true,
820
+ 'default' => '',
821
+ 'description' => esc_html__('Transparency fade during elastic transition. CAUTION: Use only when at least Transition In is set to Elastic!','easy-fancybox')
822
+ ),
823
+ 'hideOnContentClick' => array (
824
+ 'id' => 'fancybox_hideOnContentClickInline',
825
+ 'input' => 'checkbox',
826
+ 'noquotes' => true,
827
+ 'default' => '',
828
+ 'description' => esc_html__('Close FancyBox when content is clicked','easy-fancybox')
829
+ ),
830
+ 'titleShow' => array (
831
+ 'noquotes' => true,
832
+ 'default' => 'false',
833
+ )
834
+ )
835
+ ),
836
+
837
+ 'PDF' => array(
838
+ 'title' => esc_html__('PDF','easy-fancybox'),
839
+ 'input' => 'multiple',
840
+ 'options' => array(
841
+ 'intro' => array (
842
+ 'hide' => true,
843
+ 'description' => esc_html__('To make any PDF document file open in an overlay, switch on Autodetect or use the class "fancybox-pdf" for its link.','easy-fancybox') . '<br />'
844
+ ),
845
+ 'autoAttribute' => array (
846
+ 'id' => 'fancybox_autoAttributePDF',
847
+ 'input' => 'checkbox',
848
+ 'hide' => true,
849
+ 'default' => '1',
850
+ 'selector' => '\'a[href*=".pdf"],area[href*=".pdf"],a[href*=".PDF"],area[href*=".PDF"]\'',
851
+ 'description' => esc_html__('Autodetect','easy-fancybox')
852
+ ),
853
+ 'tag' => array (
854
+ 'hide' => true,
855
+ 'default' => 'a.fancybox-pdf,area.fancybox-pdf,.fancybox-pdf>a'
856
+ ),
857
+ 'class' => array (
858
+ 'hide' => true,
859
+ 'default' => 'fancybox-pdf'
860
+ ),
861
+ 'type' => array (
862
+ 'default' => 'iframe'
863
+ ),
864
+ 'onStart' => array (
865
+ 'id' => 'fancybox_PDFonStart',
866
+ 'noquotes' => true,
867
+ 'title' => esc_html__('Embed with','easy-fancybox'),
868
+ 'label_for' => 'fancybox_PDFonStart',
869
+ 'input' => 'select',
870
+ 'options' => array(
871
+ '{{object}}' => esc_html__('Object tag (plus fall-back link)','easy-fancybox'),
872
+ '{{embed}}' => esc_html__('Embed tag','easy-fancybox'),
873
+ '' => esc_html__('iFrame tag (let browser decide)','easy-fancybox'),
874
+ '{{googleviewer}}' => esc_html__('Google Docs Viewer (external)','easy-fancybox')
875
+ ),
876
+ 'default' => '{{object}}',
877
+ 'description' => esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('External viewers have bandwidth, usage rate and and file size limits.','easy-fancybox') . '<br /><br />'
878
+ ),
879
+ 'width' => array (
880
+ 'id' => 'fancybox_PDFwidth',
881
+ 'title' => translate('Width'),
882
+ 'label_for' => 'fancybox_PDFwidth',
883
+ 'input' => 'text',
884
+ 'sanitize_callback' => 'intval',
885
+ 'class' => 'small-text',
886
+ 'default' => '90%',
887
+ 'description' => ' '
888
+ ),
889
+ 'height' => array (
890
+ 'id' => 'fancybox_PDFheight',
891
+ 'title' => translate('Height'),
892
+ 'label_for' => 'fancybox_PDFheight',
893
+ 'input' => 'text',
894
+ 'sanitize_callback' => 'intval',
895
+ 'class' => 'small-text',
896
+ 'default' => '90%'
897
+ ),
898
+ 'padding' => array (
899
+ 'id' => 'fancybox_PDFpadding',
900
+ 'title' => translate('Border'),
901
+ 'label_for' => 'fancybox_PDFpadding',
902
+ 'input' => 'number',
903
+ 'step' => '1',
904
+ 'min' => '0',
905
+ 'max' => '100',
906
+ 'sanitize_callback' => 'intval',
907
+ 'class' => 'small-text',
908
+ 'default' => '10',
909
+ 'description' => '<br /><br />'
910
+ ),
911
+ 'titleShow' => array (
912
+ 'id' => 'fancybox_PDFtitleShow',
913
+ 'input' => 'checkbox',
914
+ 'noquotes' => true,
915
+ 'default' => '',
916
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
917
+ ),
918
+ 'titlePosition' => array (
919
+ 'id' => 'fancybox_PDFtitlePosition',
920
+ 'title' => esc_html__('Title Position','easy-fancybox'),
921
+ 'label_for' => 'fancybox_PDFtitlePosition',
922
+ 'input' => 'select',
923
+ 'options' => array(
924
+ 'float' => esc_html__('Float','easy-fancybox'),
925
+ 'outside' => esc_html__('Outside','easy-fancybox'),
926
+ 'inside' => esc_html__('Inside','easy-fancybox')
927
+ ),
928
+ 'default' => 'float',
929
+ 'description' => '<br />'
930
+ ),
931
+ 'titleFromAlt' => array (
932
+ 'id' => 'fancybox_PDFtitleFromAlt',
933
+ 'input' => 'checkbox',
934
+ 'noquotes' => true,
935
+ 'default' => '1',
936
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
937
+ ),
938
+ 'autoDimensions' => array (
939
+ 'noquotes' => true,
940
+ 'default' => 'false'
941
+ ),
942
+ 'scrolling' => array (
943
+ 'default' => 'no',
944
+ ),
945
+ )
946
+ ),
947
+
948
+ 'SVG' => array(
949
+ 'title' => esc_html__('SVG','easy-fancybox'),
950
+ 'input' => 'multiple',
951
+ 'options' => array(
952
+ 'intro' => array (
953
+ 'hide' => true,
954
+ 'description' => esc_html__('To make any SVG (.svg) file open in an overlay, switch on Autodetect or use the class "fancybox-svg" for its link.','easy-fancybox') . '<br />'
955
+ ),
956
+ 'autoAttribute' => array (
957
+ 'id' => 'fancybox_autoAttributeSVG',
958
+ 'input' => 'checkbox',
959
+ 'hide' => true,
960
+ 'default' => '1',
961
+ 'selector' => '\'a[href*=".svg"],area[href*=".svg"],a[href*=".SVG"],area[href*=".SVG"]\'',
962
+ 'description' => esc_html__('Autodetect','easy-fancybox') . '<br />'
963
+ ),
964
+ 'tag' => array (
965
+ 'hide' => true,
966
+ 'default' => 'a.fancybox-svg,area.fancybox-svg,.fancybox-svg>a'
967
+ ),
968
+ 'class' => array (
969
+ 'hide' => true,
970
+ 'default' => 'fancybox-svg'
971
+ ),
972
+ 'type' => array(
973
+ 'default' => 'svg'
974
+ ),
975
+ 'width' => array (
976
+ 'id' => 'fancybox_SVGWidth',
977
+ 'title' => translate('Width'),
978
+ 'label_for' => 'fancybox_SVGWidth',
979
+ 'input' => 'text',
980
+ 'sanitize_callback' => 'intval',
981
+ 'class' => 'small-text',
982
+ 'options' => array(),
983
+ 'default' => '680',
984
+ 'description' => ' '
985
+ ),
986
+ 'height' => array (
987
+ 'id' => 'fancybox_SVGHeight',
988
+ 'title' => translate('Height'),
989
+ 'label_for' => 'fancybox_SVGHeight',
990
+ 'input' => 'text',
991
+ 'sanitize_callback' => 'intval',
992
+ 'class' => 'small-text',
993
+ 'options' => array(),
994
+ 'default' => '495',
995
+ ),
996
+ 'padding' => array (
997
+ 'id' => 'fancybox_SVGpadding',
998
+ 'title' => translate('Border'),
999
+ 'label_for' => 'fancybox_SVGpadding',
1000
+ 'input' => 'number',
1001
+ 'step' => '1',
1002
+ 'min' => '0',
1003
+ 'max' => '100',
1004
+ 'sanitize_callback' => 'intval',
1005
+ 'class' => 'small-text',
1006
+ 'default' => '0',
1007
+ 'description' => '<br /><br />'
1008
+ ),
1009
+ 'titleShow' => array (
1010
+ 'id' => 'fancybox_SVGtitleShow',
1011
+ 'input' => 'checkbox',
1012
+ 'noquotes' => true,
1013
+ 'default' => '',
1014
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1015
+ ),
1016
+ 'titlePosition' => array (
1017
+ 'id' => 'fancybox_SVGtitlePosition',
1018
+ 'title' => esc_html__('Title Position','easy-fancybox'),
1019
+ 'label_for' => 'fancybox_SVGtitlePosition',
1020
+ 'input' => 'select',
1021
+ 'options' => array(
1022
+ 'float' => esc_html__('Float','easy-fancybox'),
1023
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1024
+ 'inside' => esc_html__('Inside','easy-fancybox')
1025
+ //,'over' => esc_html__('Overlay','easy-fancybox')
1026
+ ),
1027
+ 'default' => 'float',
1028
+ 'description' => '<br />'
1029
+ ),
1030
+ 'titleFromAlt' => array (
1031
+ 'id' => 'fancybox_SVGtitleFromAlt',
1032
+ 'input' => 'checkbox',
1033
+ 'noquotes' => true,
1034
+ 'default' => '1',
1035
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
1036
+ ),
1037
+ 'svg' => array (
1038
+ 'noquotes' => true,
1039
+ 'default' => '{\'wmode\':\'opaque\',\'allowfullscreen\':true}'
1040
+ )
1041
+ )
1042
+ ),
1043
+
1044
+ 'VideoPress' => array(
1045
+ ),
1046
+
1047
+ 'YouTube' => array(
1048
+ 'title' => esc_html__('YouTube','easy-fancybox'),
1049
+ 'input' => 'multiple',
1050
+ 'options' => array(
1051
+ 'intro' => array (
1052
+ 'hide' => true,
1053
+ 'description' => esc_html__('To make any YouTube movie open in an overlay, switch on Autodetect or use the class "fancybox-youtube" for its link.','easy-fancybox') . '<br />'
1054
+ ),
1055
+ 'autoAttribute' => array (
1056
+ 'id' => 'fancybox_autoAttributeYoutube',
1057
+ 'input' => 'checkbox',
1058
+ 'hide' => true,
1059
+ 'default' => '1',
1060
+ 'selector' => '\'a[href*="youtu.be/"],area[href*="youtu.be/"],a[href*="youtube.com/"],area[href*="youtube.com/"]\').filter(function(){return this.href.match(/\/(?:youtu\.be|watch\?|embed\/)/);}',
1061
+ 'description' => esc_html__('Autodetect','easy-fancybox') . '<br />'
1062
+ ),
1063
+ 'tag' => array (
1064
+ 'hide' => true,
1065
+ 'default' => 'a.fancybox-youtube,area.fancybox-youtube,.fancybox-youtube>a'
1066
+ ),
1067
+ 'class' => array (
1068
+ 'hide' => true,
1069
+ 'default' => 'fancybox-youtube'
1070
+ ),
1071
+ 'type' => array(
1072
+ 'default' => 'iframe'
1073
+ ),
1074
+ 'noCookie' => array (
1075
+ 'id' => 'fancybox_YoutubenoCookie',
1076
+ 'input' => 'checkbox',
1077
+ 'hide' => true,
1078
+ 'default' => '',
1079
+ 'description' => esc_html__('Enable privacy-enhanced mode','easy-fancybox') . '<br />'
1080
+ ),
1081
+ 'width' => array (
1082
+ 'id' => 'fancybox_YoutubeWidth',
1083
+ 'title' => translate('Width'),
1084
+ 'label_for' => 'fancybox_YoutubeWidth',
1085
+ 'input' => 'number',
1086
+ 'step' => '1',
1087
+ 'min' => '420',
1088
+ 'max' => '1500',
1089
+ 'sanitize_callback' => 'intval',
1090
+ 'class' => 'small-text',
1091
+ 'default' => '640',
1092
+ 'description' => ' '
1093
+ ),
1094
+ 'height' => array (
1095
+ 'id' => 'fancybox_YoutubeHeight',
1096
+ 'title' => translate('Height'),
1097
+ 'label_for' => 'fancybox_YoutubeHeight',
1098
+ 'input' => 'number',
1099
+ 'step' => '1',
1100
+ 'min' => '315',
1101
+ 'max' => '900',
1102
+ 'sanitize_callback' => 'intval',
1103
+ 'class' => 'small-text',
1104
+ 'default' => '360',
1105
+ ),
1106
+ 'padding' => array (
1107
+ 'id' => 'fancybox_Youtubepadding',
1108
+ 'title' => translate('Border'),
1109
+ 'label_for' => 'fancybox_Youtubepadding',
1110
+ 'input' => 'number',
1111
+ 'step' => '1',
1112
+ 'min' => '0',
1113
+ 'max' => '100',
1114
+ 'sanitize_callback' => 'intval',
1115
+ 'class' => 'small-text',
1116
+ 'default' => '0',
1117
+ 'description' => '<br /><br />'
1118
+ ),
1119
+ 'keepRatio' => array(
1120
+ 'noquotes' => true,
1121
+ 'default' => '1'
1122
+ ),
1123
+ 'titleShow' => array (
1124
+ 'id' => 'fancybox_YoutubetitleShow',
1125
+ 'input' => 'checkbox',
1126
+ 'noquotes' => true,
1127
+ 'default' => '',
1128
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1129
+ ),
1130
+ 'titlePosition' => array (
1131
+ 'id' => 'fancybox_YoutubetitlePosition',
1132
+ 'title' => esc_html__('Title Position','easy-fancybox'),
1133
+ 'label_for' => 'fancybox_YoutubetitlePosition',
1134
+ 'input' => 'select',
1135
+ 'options' => array(
1136
+ 'float' => esc_html__('Float','easy-fancybox'),
1137
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1138
+ 'inside' => esc_html__('Inside','easy-fancybox')
1139
+ ),
1140
+ 'default' => 'float',
1141
+ 'description' => '<br />'
1142
+ ),
1143
+ 'titleFromAlt' => array (
1144
+ 'id' => 'fancybox_YoutubetitleFromAlt',
1145
+ 'input' => 'checkbox',
1146
+ 'noquotes' => true,
1147
+ 'default' => '1',
1148
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
1149
+ ),
1150
+ 'onStart' => array (
1151
+ 'noquotes' => true,
1152
+ 'default' => get_option( 'fancybox_YoutubenoCookie' ) ?
1153
+ 'function(a,i,o){var splitOn=a[i].href.indexOf("?");var urlParms=(splitOn>-1)?a[i].href.substring(splitOn):"";o.allowfullscreen=(urlParms.indexOf("fs=0")>-1)?false:true;o.href=a[i].href.replace(/https?:\/\/(?:www\.)?youtu(?:\.be\/([^\?]+)\??|be\.com\/watch\?(.*(?=v=))v=([^&]+))(.*)/gi,"https://www.youtube-nocookie.com/embed/$1$3?$2$4");}' :
1154
+ 'function(a,i,o){var splitOn=a[i].href.indexOf("?");var urlParms=(splitOn>-1)?a[i].href.substring(splitOn):"";o.allowfullscreen=(urlParms.indexOf("fs=0")>-1)?false:true;o.href=a[i].href.replace(/https?:\/\/(?:www\.)?youtu(?:\.be\/([^\?]+)\??|be\.com\/watch\?(.*(?=v=))v=([^&]+))(.*)/gi,"https://www.youtube.com/embed/$1$3?$2$4&autoplay=1");}'
1155
+ )
1156
+ )
1157
+ ),
1158
+
1159
+ 'Vimeo' => array(
1160
+ 'title' => esc_html__('Vimeo','easy-fancybox'),
1161
+ 'input' => 'multiple',
1162
+ 'options' => array(
1163
+ 'intro' => array (
1164
+ 'hide' => true,
1165
+ 'description' => esc_html__('To make any Vimeo movie open in an overlay, switch on Autodetect or use the class "fancybox-vimeo" for its link.','easy-fancybox') . '<br />'
1166
+ ),
1167
+ 'autoAttribute' => array (
1168
+ 'id' => 'fancybox_autoAttributeVimeo',
1169
+ 'input' => 'checkbox',
1170
+ 'hide' => true,
1171
+ 'default' => '1',
1172
+ 'selector' => '\'a[href*="vimeo.com/"],area[href*="vimeo.com/"]\').filter(function(){return this.href.match(/\/(?:[0-9]+|video\/)/);}',
1173
+ 'description' => esc_html__('Autodetect','easy-fancybox') . '<br />'
1174
+ ),
1175
+ 'tag' => array (
1176
+ 'hide' => true,
1177
+ 'default' => 'a.fancybox-vimeo,area.fancybox-vimeo,.fancybox-vimeo>a'
1178
+ ),
1179
+ 'class' => array (
1180
+ 'hide' => true,
1181
+ 'default' => 'fancybox-vimeo'
1182
+ ),
1183
+ 'type' => array(
1184
+ 'default' => 'iframe'
1185
+ ),
1186
+ 'width' => array (
1187
+ 'id' => 'fancybox_VimeoWidth',
1188
+ 'title' => translate('Width'),
1189
+ 'label_for' => 'fancybox_VimeoWidth',
1190
+ 'input' => 'number',
1191
+ 'step' => '1',
1192
+ 'min' => '400',
1193
+ 'max' => '1500',
1194
+ 'sanitize_callback' => 'intval',
1195
+ 'class' => 'small-text',
1196
+ 'default' => '500',
1197
+ 'description' => ' '
1198
+ ),
1199
+ 'height' => array (
1200
+ 'id' => 'fancybox_VimeoHeight',
1201
+ 'title' => translate('Height'),
1202
+ 'label_for' => 'fancybox_VimeoHeight',
1203
+ 'input' => 'number',
1204
+ 'step' => '1',
1205
+ 'min' => '225',
1206
+ 'max' => '900',
1207
+ 'sanitize_callback' => 'intval',
1208
+ 'class' => 'small-text',
1209
+ 'default' => '281'
1210
+ ),
1211
+ 'padding' => array (
1212
+ 'id' => 'fancybox_Vimeopadding',
1213
+ 'title' => translate('Border'),
1214
+ 'label_for' => 'fancybox_Vimeopadding',
1215
+ 'input' => 'number',
1216
+ 'step' => '1',
1217
+ 'min' => '0',
1218
+ 'max' => '100',
1219
+ 'sanitize_callback' => 'intval',
1220
+ 'class' => 'small-text',
1221
+ 'default' => '0',
1222
+ 'description' => '<br /><br />'
1223
+ ),
1224
+ 'keepRatio' => array(
1225
+ 'noquotes' => true,
1226
+ 'default' => '1'
1227
+ ),
1228
+ 'titleShow' => array (
1229
+ 'id' => 'fancybox_VimeotitleShow',
1230
+ 'input' => 'checkbox',
1231
+ 'noquotes' => true,
1232
+ 'default' => '',
1233
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1234
+ ),
1235
+ 'titlePosition' => array (
1236
+ 'id' => 'fancybox_VimeotitlePosition',
1237
+ 'title' => esc_html__('Title Position','easy-fancybox'),
1238
+ 'label_for' => 'fancybox_VimeotitlePosition',
1239
+ 'input' => 'select',
1240
+ 'options' => array(
1241
+ 'float' => esc_html__('Float','easy-fancybox'),
1242
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1243
+ 'inside' => esc_html__('Inside','easy-fancybox')
1244
+ ),
1245
+ 'default' => 'float',
1246
+ 'description' => '<br />'
1247
+ ),
1248
+ 'titleFromAlt' => array (
1249
+ 'id' => 'fancybox_VimeotitleFromAlt',
1250
+ 'input' => 'checkbox',
1251
+ 'noquotes' => true,
1252
+ 'default' => '1',
1253
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
1254
+ ),
1255
+ 'onStart' => array (
1256
+ 'noquotes' => true,
1257
+ 'default' => 'function(a,i,o){var splitOn=a[i].href.indexOf("?");var urlParms=(splitOn>-1)?a[i].href.substring(splitOn):"";o.allowfullscreen=(urlParms.indexOf("fullscreen=0")>-1)?false:true;o.href=a[i].href.replace(/https?:\/\/(?:www\.)?vimeo\.com\/([0-9]+)\??(.*)/gi,"https://player.vimeo.com/video/$1?$2&autoplay=1");}'
1258
+ )
1259
+ )
1260
+ ),
1261
+
1262
+ 'Dailymotion' => array(
1263
+ 'title' => esc_html__('Dailymotion','easy-fancybox'),
1264
+ 'input' => 'multiple',
1265
+ 'options' => array(
1266
+ 'intro' => array (
1267
+ 'hide' => true,
1268
+ 'description' => esc_html__('To make any Dailymotion movie open in an overlay, switch on Autodetect or use the class "fancybox-dailymotion" for its link.','easy-fancybox') . '<br />'
1269
+ ),
1270
+ 'autoAttribute' => array (
1271
+ 'id' => 'fancybox_autoAttributeDailymotion',
1272
+ 'input' => 'checkbox',
1273
+ 'hide' => true,
1274
+ 'default' => '1',
1275
+ 'selector' => '\'a[href*="dailymotion.com/"],area[href*="dailymotion.com/"]\').filter(function(){return this.href.match(/\/video\//);}',
1276
+ 'description' => esc_html__('Autodetect','easy-fancybox') . '<br />'
1277
+ ),
1278
+ 'tag' => array (
1279
+ 'hide' => true,
1280
+ 'default' => 'a.fancybox-dailymotion,area.fancybox-dailymotion,.fancybox-dailymotion>a'
1281
+ ),
1282
+ 'class' => array (
1283
+ 'hide' => true,
1284
+ 'default' => 'fancybox-dailymotion'
1285
+ ),
1286
+ 'type' => array(
1287
+ 'default' => 'iframe'
1288
+ ),
1289
+ 'width' => array (
1290
+ 'id' => 'fancybox_DailymotionWidth',
1291
+ 'title' => translate('Width'),
1292
+ 'label_for' => 'fancybox_DailymotionWidth',
1293
+ 'input' => 'number',
1294
+ 'step' => '1',
1295
+ 'min' => '320',
1296
+ 'max' => '1500',
1297
+ 'sanitize_callback' => 'intval',
1298
+ 'class' => 'small-text',
1299
+ 'default' => '560',
1300
+ 'description' => ' '
1301
+ ),
1302
+ 'height' => array (
1303
+ 'id' => 'fancybox_DailymotionHeight',
1304
+ 'title' => translate('Height'),
1305
+ 'label_for' => 'fancybox_DailymotionHeight',
1306
+ 'input' => 'number',
1307
+ 'step' => '1',
1308
+ 'min' => '180',
1309
+ 'max' => '900',
1310
+ 'sanitize_callback' => 'intval',
1311
+ 'class' => 'small-text',
1312
+ 'default' => '315'
1313
+ ),
1314
+ 'padding' => array (
1315
+ 'id' => 'fancybox_DailymotionPadding',
1316
+ 'title' => translate('Border'),
1317
+ 'label_for' => 'fancybox_DailymotionPadding',
1318
+ 'input' => 'number',
1319
+ 'step' => '1',
1320
+ 'min' => '0',
1321
+ 'max' => '100',
1322
+ 'sanitize_callback' => 'intval',
1323
+ 'class' => 'small-text',
1324
+ 'default' => '0',
1325
+ 'description' => '<br /><br />'
1326
+ ),
1327
+ 'keepRatio' => array(
1328
+ 'noquotes' => true,
1329
+ 'default' => '1'
1330
+ ),
1331
+ 'titleShow' => array (
1332
+ 'id' => 'fancybox_DailymotiontitleShow',
1333
+ 'input' => 'checkbox',
1334
+ 'noquotes' => true,
1335
+ 'default' => '',
1336
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1337
+ ),
1338
+ 'titlePosition' => array (
1339
+ 'id' => 'fancybox_DailymotiontitlePosition',
1340
+ 'title' => esc_html__('Title Position','easy-fancybox'),
1341
+ 'label_for' => 'fancybox_DailymotiontitlePosition',
1342
+ 'input' => 'select',
1343
+ 'options' => array(
1344
+ 'float' => esc_html__('Float','easy-fancybox'),
1345
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1346
+ 'inside' => esc_html__('Inside','easy-fancybox')
1347
+ ),
1348
+ 'default' => 'float',
1349
+ 'description' => '<br />'
1350
+ ),
1351
+ 'titleFromAlt' => array (
1352
+ 'id' => 'fancybox_DailymotiontitleFromAlt',
1353
+ 'input' => 'checkbox',
1354
+ 'noquotes' => true,
1355
+ 'default' => '1',
1356
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
1357
+ ),
1358
+ 'onStart' => array (
1359
+ 'noquotes' => true,
1360
+ 'default' => 'function(a,i,o){var splitOn=a[i].href.indexOf("?");var urlParms=(splitOn>-1)?a[i].href.substring(splitOn):"";o.allowfullscreen=(urlParms.indexOf("fullscreen=0")>-1)?false:true;o.href=a[i].href.replace(/^https?:\/\/(?:www\.)?dailymotion.com\/video\/([^\?]+)(.*)/gi,"https://www.dailymotion.com/embed/video/$1?$2&autoPlay=1");}'
1361
+ )
1362
+ )
1363
+ ),
1364
+
1365
+ /* 'Tudou' => array(
1366
+ 'id' => 'fancybox_Tudou',
1367
+ 'title' => esc_html__('Tudou','easy-fancybox'),
1368
+ 'label_for' => '',
1369
+ 'input' => 'multiple',
1370
+ 'class' => '', 'description' => '',
1371
+ 'options' => array(
1372
+ 'autoAttributeTudou' => array (
1373
+ 'id' => 'fancybox_autoAttributeTudou',
1374
+ 'label_for' => '',
1375
+ 'input' => 'checkbox',
1376
+ 'class' => '',
1377
+ 'options' => array(),
1378
+ 'hide' => true,
1379
+ 'default' => '1',
1380
+ 'description' => esc_html__('Tudou links','easy-fancybox')
1381
+ )
1382
+ )
1383
+ ),*/
1384
+
1385
+ /* 'Animoto' => array(),
1386
+
1387
+ Example ANIMOTO page link http://animoto.com/play/Kf9POzQMSOGWyu41gtOtsw should become
1388
+ http://static.animoto.com/swf/w.swf?w=swf/vp1&f=Kf9POzQMSOGWyu41gtOtsw&i=m
1389
+
1390
+ */
1391
+
1392
+ 'iFrame' => array(
1393
+ 'title' => esc_html__('iFrames','easy-fancybox'),
1394
+ 'input' => 'multiple',
1395
+ 'options' => array(
1396
+ 'intro' => array (
1397
+ 'hide' => true,
1398
+ 'description' => esc_html__('To make a website or HTML document open in an overlay, use the class "fancybox-iframe" for its link.','easy-fancybox') . '<br /><br />'
1399
+ ),
1400
+ 'tag' => array (
1401
+ 'hide' => true,
1402
+ 'default' => 'a.fancybox-iframe,area.fancybox-iframe,.fancybox-iframe>a'
1403
+ ),
1404
+ 'class' => array (
1405
+ 'hide' => true,
1406
+ 'default' => 'fancybox-iframe'
1407
+ ),
1408
+ 'type' => array (
1409
+ 'default' => 'iframe'
1410
+ ),
1411
+ 'width' => array (
1412
+ 'id' => 'fancybox_iFramewidth',
1413
+ 'title' => translate('Width'),
1414
+ 'label_for' => 'fancybox_iFramewidth',
1415
+ 'input' => 'text',
1416
+ 'sanitize_callback' => 'intval',
1417
+ 'class' => 'small-text',
1418
+ 'default' => '70%',
1419
+ 'description' => ' '
1420
+ ),
1421
+ 'height' => array (
1422
+ 'id' => 'fancybox_iFrameheight',
1423
+ 'title' => translate('Height'),
1424
+ 'label_for' => 'fancybox_iFrameheight',
1425
+ 'input' => 'text',
1426
+ 'sanitize_callback' => 'intval',
1427
+ 'class' => 'small-text',
1428
+ 'default' => '90%',
1429
+ ),
1430
+ 'padding' => array (
1431
+ 'id' => 'fancybox_iFramepadding',
1432
+ 'title' => translate('Border'),
1433
+ 'label_for' => 'fancybox_iFramepadding',
1434
+ 'input' => 'number',
1435
+ 'step' => '1',
1436
+ 'min' => '0',
1437
+ 'max' => '100',
1438
+ 'sanitize_callback' => 'intval',
1439
+ 'class' => 'small-text',
1440
+ 'default' => '0',
1441
+ 'description' => '<br /><br />'
1442
+ ),
1443
+ 'titleShow' => array (
1444
+ 'id' => 'fancybox_iFrametitleShow',
1445
+ 'input' => 'checkbox',
1446
+ 'noquotes' => true,
1447
+ 'default' => '',
1448
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1449
+ ),
1450
+ 'titlePosition' => array (
1451
+ 'id' => 'fancybox_iFrametitlePosition',
1452
+ 'title' => esc_html__('Title Position','easy-fancybox'),
1453
+ 'label_for' => 'fancybox_iFrametitlePosition',
1454
+ 'input' => 'select',
1455
+ 'options' => array(
1456
+ 'float' => esc_html__('Float','easy-fancybox'),
1457
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1458
+ 'inside' => esc_html__('Inside','easy-fancybox')
1459
+ ),
1460
+ 'default' => 'float',
1461
+ 'description' => '<br />'
1462
+ ),
1463
+ 'titleFromAlt' => array (
1464
+ 'id' => 'fancybox_iFrametitleFromAlt',
1465
+ 'input' => 'checkbox',
1466
+ 'noquotes' => true,
1467
+ 'default' => '1',
1468
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox') . '<br/>'
1469
+ ),
1470
+ 'allowfullscreen' => array (
1471
+ 'id' => 'fancybox_allowFullScreen',
1472
+ 'input' => 'checkbox',
1473
+ 'noquotes' => true,
1474
+ 'default' => '',
1475
+ 'description' => esc_html__('Allow embedded content to jump to full screen mode','easy-fancybox')
1476
+ )
1477
+ )
1478
+ )
1479
+ );
inc/fancybox-classic.php ADDED
@@ -0,0 +1,343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * FancyBox v1
4
+ */
5
+
6
+ namespace easyFancyBox\fancyBox_1;
7
+
8
+ /**
9
+ * MAIN INLINE SCRIPT
10
+ */
11
+
12
+ function prepare_inline() {
13
+ // Begin building output FancyBox settings.
14
+ $script = 'var fb_timeout, fb_opts={';
15
+
16
+ /**
17
+ * Global settings routine.
18
+ */
19
+ $more = 0;
20
+ foreach ( \easyFancyBox::$options['Global']['options'] as $globals ) {
21
+ foreach ( $globals['options'] as $_key => $_value ) {
22
+ if ( isset($_value['id']) )
23
+ if ( isset($_value['default']) )
24
+ $parm = \get_option($_value['id'], $_value['default']);
25
+ else
26
+ $parm = \get_option($_value['id']);
27
+ elseif ( isset($_value['default']) )
28
+ $parm = $_value['default'];
29
+ else
30
+ $parm = '';
31
+
32
+ if ( isset($_value['input']) && 'checkbox'==$_value['input'] )
33
+ $parm = ( '1' == $parm ) ? 'true' : 'false';
34
+
35
+ if( ! isset($_value['hide']) && $parm!='' ) {
36
+ $quote = ( is_numeric($parm) || (isset($_value['noquotes']) && $_value['noquotes'] == true) ) ? '' : '\'';
37
+ if ($more>0)
38
+ $script .= ',';
39
+ $script .= '\''.$_key.'\':';
40
+ $script .= $quote.$parm.$quote;
41
+ $more++;
42
+ } else {
43
+ ${$_key} = $parm;
44
+ }
45
+ }
46
+ }
47
+
48
+ $script .= ' };
49
+ if(typeof easy_fancybox_handler===\'undefined\'){
50
+ var easy_fancybox_handler=function(){';
51
+
52
+ $exclude = \get_option( 'fancybox_autoExclude', \easyFancyBox::$options['Global']['options']['Miscellaneous']['options']['autoExclude']['default'] );
53
+ $exclude_array = $exclude ? explode( ',', $exclude ) : array();
54
+ $exclude_selectors = ! empty( $exclude_array ) ? \wp_json_encode( $exclude_array ) : false;
55
+ if ( $exclude_selectors ) {
56
+ $script .= '
57
+ jQuery(' . $exclude_selectors . '.join(\',\')).addClass(\'nofancybox\');';
58
+ }
59
+
60
+ $script .= '
61
+ jQuery(\'a.fancybox-close\').on(\'click\',function(e){e.preventDefault();jQuery.fancybox.close()});';
62
+
63
+ foreach ( \easyFancyBox::$options as $key => $value ) {
64
+ // Check if not enabled or hide=true then skip.
65
+ if ( isset( $value['hide'] ) || ! isset( \easyFancyBox::$options['Global']['options']['Enable']['options'][$key]['id'] ) || ! \get_option( \easyFancyBox::$options['Global']['options']['Enable']['options'][$key]['id'], \easyFancyBox::$options['Global']['options']['Enable']['options'][$key]['default'] ) )
66
+ continue;
67
+
68
+ $script .= '
69
+ /* ' . $key . ' */';
70
+
71
+ /**
72
+ * Auto-detection routines (2x)
73
+ */
74
+ $autoAttribute = isset( $value['options']['autoAttribute'] ) ? \get_option( $value['options']['autoAttribute']['id'], $value['options']['autoAttribute']['default'] ) : '';
75
+
76
+ if ( !empty($autoAttribute) ) {
77
+ if ( is_numeric($autoAttribute) ) {
78
+ $script .= '
79
+ jQuery('.$value['options']['autoAttribute']['selector'].').not(\'.nofancybox,li.nofancybox>a\').addClass(\''.$value['options']['class']['default'].'\');';
80
+ } else {
81
+ // Set selectors.
82
+ $file_types = array_filter( explode( ',', str_replace( ' ', ',', $autoAttribute ) ) );
83
+ $more = 0;
84
+ $script .= '
85
+ var fb_'.$key.'_select=\'';
86
+ foreach ( $file_types as $type ) {
87
+ if ($type == "jpg" || $type == "jpeg" || $type == "png" || $type == "webp" || $type == "gif")
88
+ $type = '.'.$type;
89
+ if ($more>0)
90
+ $script .= ',';
91
+ $script .= 'a['.$value['options']['autoAttribute']['selector'].'"'.$type.'"]:not(.nofancybox,li.nofancybox>a),area['.$value['options']['autoAttribute']['selector'].'"'.$type.'"]:not(.nofancybox)';
92
+ $more++;
93
+ }
94
+ $script .= '\';';
95
+
96
+ $autoselector = class_exists('easyFancyBox_Advanced') ? \get_option($value['options']['autoSelector']['id'],$value['options']['autoSelector']['default']) : $value['options']['autoSelector']['default'];
97
+
98
+ // Class and rel depending on settings.
99
+ if( '1' == \get_option($value['options']['autoAttributeLimit']['id'],$value['options']['autoAttributeLimit']['default']) ) {
100
+ // Add class.
101
+ $script .= '
102
+ var fb_'.$key.'_sections=jQuery(\''.$autoselector.'\');
103
+ fb_'.$key.'_sections.each(function(){jQuery(this).find(fb_'.$key.'_select).addClass(\''.$value['options']['class']['default'].'\')';
104
+ // Set rel.
105
+ switch( \get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
106
+ case '':
107
+ default :
108
+ $script .= ';});';
109
+ break;
110
+
111
+ case '1':
112
+ $script .= '.attr(\'rel\',\'gallery-\'+fb_'.$key.'_sections.index(this));});';
113
+ break;
114
+
115
+ case '2':
116
+ $script .= '.attr(\'rel\',\'gallery\');});';
117
+ break;
118
+ }
119
+ } else {
120
+ // Add class.
121
+ $script .= '
122
+ jQuery(fb_'.$key.'_select).addClass(\''.$value['options']['class']['default'].'\')';
123
+ // Set rel.
124
+ switch( \get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
125
+ case '':
126
+ default :
127
+ $script .= ';';
128
+ break;
129
+
130
+ case '1':
131
+ $script .= ';
132
+ var fb_'.$key.'_sections=jQuery(\''.$autoselector.'\');
133
+ fb_'.$key.'_sections.each(function(){jQuery(this).find(fb_'.$key.'_select).attr(\'rel\',\'gallery-\'+fb_'.$key.'_sections.index(this));});';
134
+ break;
135
+
136
+ case '2':
137
+ $script .= '.attr(\'rel\',\'gallery\');';
138
+ break;
139
+ }
140
+ }
141
+ }
142
+ }
143
+
144
+ /**
145
+ * Generate .fancybox() bind.
146
+ */
147
+
148
+ // Prepare auto popup.
149
+ if ( $key == $autoClick )
150
+ $trigger = $value['options']['class']['default'];
151
+
152
+ $script .= '
153
+ jQuery(\'' . $value['options']['tag']['default'] . '\')';
154
+
155
+ // Use each() to allow different metadata values per instance; fix by Elron. Thanks!
156
+ $script .= '.each(function(){';
157
+
158
+ // Filter here.
159
+ $bind = 'jQuery(this).fancybox(jQuery.extend(true,{},fb_opts,{';
160
+ $more = 0;
161
+ foreach ( $value['options'] as $_key => $_value ) {
162
+ if ( isset($_value['id']) || isset($_value['default']) )
163
+ $parm = isset($_value['id']) ? strval( \get_option($_value['id'], isset($_value['default']) ? $_value['default'] : '' ) ) : strval( $_value['default'] );
164
+ else
165
+ $parm = '';
166
+
167
+ if ( isset($_value['input']) && 'checkbox'==$_value['input'] )
168
+ $parm = ( '1' == $parm ) ? 'true' : 'false';
169
+
170
+ if ( !isset($_value['hide']) && $parm!='' ) {
171
+ $quote = ( is_numeric($parm) || ( isset($_value['noquotes']) && $_value['noquotes'] == true ) ) ? '' : '\'';
172
+ if ( $more > 0 )
173
+ $bind .= ',';
174
+ $bind .= '\''.$_key.'\':';
175
+ $bind .= $quote.$parm.$quote;
176
+ $more++;
177
+ }
178
+ }
179
+ $bind .= '}))';
180
+
181
+ $script .= \apply_filters( 'easy_fancybox_bind', $bind );
182
+
183
+ $script .= '});';
184
+ }
185
+
186
+ $script .= '
187
+ };};';
188
+
189
+ if ( empty( $delayClick ) ) $delayClick = '0';
190
+
191
+ switch ( $autoClick ) {
192
+ case '':
193
+ break;
194
+
195
+ case '1':
196
+ $script .= PHP_EOL . 'var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a#fancybox-auto,#fancybox-auto>a\').first().trigger(\'click\')},'.$delayClick.');};';
197
+ \easyFancyBox::$onready_auto = true;
198
+ break;
199
+
200
+ case '2':
201
+ $script .= PHP_EOL . 'var easy_fancybox_auto=function(){setTimeout(function(){if(location.hash){jQuery(location.hash).trigger(\'click\');}},'.$delayClick.');};';
202
+ \easyFancyBox::$onready_auto = true;
203
+ break;
204
+
205
+ case '99':
206
+ $script .= PHP_EOL . 'var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class|="fancybox"]\').filter(\':first\').trigger(\'click\')},'.$delayClick.');};';
207
+ \easyFancyBox::$onready_auto = true;
208
+ break;
209
+
210
+ default :
211
+ if ( ! empty( $trigger ) ) {
212
+ $script .= PHP_EOL . 'var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class*="'.$trigger.'"]\').filter(\':first\').trigger(\'click\')},'.$delayClick.');};';
213
+ \easyFancyBox::$onready_auto = true;
214
+ }
215
+ }
216
+
217
+
218
+ $script .= PHP_EOL;
219
+
220
+ // Replace PDF embed shortcodes.
221
+ if ( ! empty( get_option('fancybox_enablePDF') ) && ! empty( get_option( 'fancybox_PDFonStart', '{{object}}' ) ) ) {
222
+ $replaces = array(
223
+ '{{object}}' => 'function(a,i,o){o.type=\'pdf\';}',
224
+ '{{embed}}' => 'function(a,i,o){o.type=\'html\';o.content=\'<embed src="\'+a[i].href+\'" type="application/pdf" height="100%" width="100%" />\'}',
225
+ '{{googleviewer}}' => 'function(a,i,o){o.href=\'https://docs.google.com/viewer?embedded=true&url=\'+a[i].href;}'
226
+ );
227
+ foreach ($replaces as $short => $replace) {
228
+ $script = str_replace( $short, $replace, $script );
229
+ }
230
+ }
231
+ \easyFancyBox::$inline_script = \apply_filters( 'easy_fancybox_inline_script', $script );
232
+
233
+ /**
234
+ * HEADER STYLES
235
+ */
236
+
237
+ // Customized styles.
238
+ $styles = '';
239
+ ! isset( $overlaySpotlight ) || 'true' !== $overlaySpotlight || $styles .= '#fancybox-overlay{background-attachment:fixed;background-image:url("' . \easyFancyBox::$plugin_url . 'images/light-mask.png");background-position:center;background-repeat:no-repeat;background-size:100% 100%}';
240
+
241
+ empty( $borderRadius ) || $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}';
242
+
243
+ $content_style = '';
244
+ empty( $backgroundColor ) || $content_style .= 'background:'.$backgroundColor.';';
245
+ empty( $paddingColor ) || $content_style .= 'border-color:'.$paddingColor.';';
246
+ if ( ! empty( $textColor ) ) {
247
+ $content_style .= 'color:'.$textColor.';';
248
+ $styles .= '#fancybox-outer{background:'.$paddingColor.'}'; //.fancybox-title-inside{background-color:'.$paddingColor.';margin-left:0 !important;margin-right:0 !important;width:100% !important;}
249
+ }
250
+ empty( $content_style ) || $styles .= '#fancybox-content{'.$content_style.'}';
251
+
252
+ empty( $titleColor ) || $styles .= '#fancybox-title,#fancybox-title-float-main{color:'.$titleColor.'}';
253
+
254
+ empty( $styles ) || \easyFancyBox::$inline_style = \wp_strip_all_tags( $styles );
255
+ }
256
+
257
+ function add_easing() {
258
+ // Check IMG settings.
259
+ if (
260
+ \get_option( 'fancybox_enableImg', \easyFancyBox::$options['Global']['options']['Enable']['options']['IMG']['default'] ) &&
261
+ ( 'elastic' === \get_option( 'fancybox_transitionIn', 'elastic' ) || 'elastic' === \get_option( 'fancybox_transitionOut', 'elastic' ) )
262
+ ) {
263
+ return true;
264
+ }
265
+
266
+ // Check Inline Content settings.
267
+ if (
268
+ \get_option( 'fancybox_enableInline', false ) &&
269
+ ( 'elastic' === \get_option( 'fancybox_transitionInInline' ) || 'elastic' === \get_option( 'fancybox_transitionOutInline' ) )
270
+ ) {
271
+ return true;
272
+ }
273
+
274
+ return false;
275
+ }
276
+
277
+ /**
278
+ * ACTIONS & FILTERS
279
+ */
280
+
281
+ function prepare_scripts_styles() {
282
+ // Make sure whe actually need to do anything.
283
+ if ( ! \easyFancyBox::add_scripts() ){
284
+ return;
285
+ }
286
+
287
+ // INLINE SCRIPT & STYLE
288
+ prepare_inline();
289
+
290
+ $min = ( defined('WP_DEBUG') && WP_DEBUG ) ? '' : '.min';
291
+
292
+ // SCRIPT & STYLE URLS
293
+
294
+ $dep = get_option( 'fancybox_nojQuery', false ) ? array() : array( 'jquery' );
295
+ $ver = defined( 'WP_DEBUG' ) && WP_DEBUG ? time() : false;
296
+ $min = defined( 'WP_DEBUG' ) && WP_DEBUG ? '' : '.min';
297
+ $footer = get_option( 'fancybox_noFooter', false ) ? false : true;
298
+
299
+ // FancyBox.
300
+ \easyFancyBox::$styles['fancybox'] = array(
301
+ 'src' => \easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['classic'].'/jquery.fancybox'.$min.'.css',
302
+ 'deps' => array(),
303
+ 'ver' => $ver,
304
+ 'media' => 'screen'
305
+ );
306
+ \easyFancyBox::$scripts['jquery-fancybox'] = array(
307
+ 'src' => \easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['classic'].'/jquery.fancybox'.$min.'.js',
308
+ 'deps' => $dep,
309
+ 'ver' => $ver,
310
+ 'footer' => $footer
311
+ );
312
+
313
+ // jQuery Easing, which is not needed if jQueryUI Core Effects are loaded or when using fancyBox 3.
314
+ if ( add_easing() ) {
315
+ \easyFancyBox::$easing_script_url = \easyFancyBox::$plugin_url.'vendor/jquery.easing'.$min.'.js';
316
+ }
317
+
318
+ // jQuery Mousewheel, which is not needed if jQueryUI Mouse is loaded or when using fancyBox 3.
319
+ if ( \get_option( 'fancybox_mouseWheel', true ) ) {
320
+ \easyFancyBox::$mousewheel_script_url = \easyFancyBox::$plugin_url.'vendor/jquery.mousewheel'.$min.'.js';
321
+ }
322
+
323
+ // Metadata in Miscellaneous settings?
324
+ if ( \get_option( 'fancybox_metaData' ) ) {
325
+ \easyFancyBox::$scripts['jquery-metadata'] = array(
326
+ 'src' => \easyFancyBox::$plugin_url.'vendor/jquery.metadata.min.js',
327
+ 'deps' => $dep,
328
+ 'ver' => METADATA_VERSION,
329
+ 'footer' => $footer
330
+ );
331
+ }
332
+ }
333
+ \add_action( 'init', __NAMESPACE__.'\prepare_scripts_styles', 12 );
334
+
335
+ function onready_callback( $content ) {
336
+ $content .= 'jQuery(easy_fancybox_handler);jQuery(document).on(\'' . implode( " ", \easyFancyBox::$events ) . '\',easy_fancybox_handler);' . PHP_EOL;
337
+
338
+ if ( \easyFancyBox::$onready_auto )
339
+ $content .= \apply_filters( 'easy_fancybox_onready_auto', 'jQuery(easy_fancybox_auto);' );
340
+
341
+ return $content;
342
+ }
343
+ \add_filter( 'easy_fancybox_inline_script', __NAMESPACE__.'\onready_callback' );
inc/{easyfancybox-options.php → fancybox-legacy-options.php} RENAMED
@@ -1,99 +1,99 @@
1
  <?php
2
  /**
3
- * Easy FancyBox options and their defaults array
4
  */
5
 
6
  $efb_options = array (
7
- 'Global' => array(
8
- 'title' => __('Global settings','easy-fancybox'),
9
  'input' => 'deep',
10
  'hide' => true,
11
  'options' => array(
12
  'Enable' => array (
13
- 'title' => __('Media','easy-fancybox'),
14
  'input' => 'multiple',
15
  'hide' => true,
16
  'options' => array(
17
  'p1' => array (
18
  'hide' => true,
19
- 'description' => __('Enable FancyBox for','easy-fancybox') . '<br />'
20
  ),
21
  'IMG' => array (
22
  'id' => 'fancybox_enableImg',
23
  'input' => 'checkbox',
24
  'hide' => true,
25
- 'default' => ( function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( easyFancyBox::$plugin_basename ) ) ? '' : '1',
26
- 'description' => '<strong>' . __( 'Images', 'easy-fancybox' ) . '</strong>' . ( get_option('fancybox_enableImg') ? ' &mdash; <a href="#IMG">' . translate( 'Settings' ) . '</a>' : '' )
27
  ),
28
  'Inline' => array (
29
  'id' => 'fancybox_enableInline',
30
  'input' => 'checkbox',
31
  'hide' => true,
32
  'default' => '',
33
- 'description' => '<strong>' . __( 'Inline content', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableInline') ? ' &mdash; <a href="#Inline">' . translate( 'Settings' ) . '</a>' : '' )
34
  ),
35
  'PDF' => array (
36
  'id' => 'fancybox_enablePDF',
37
  'input' => 'checkbox',
38
  'hide' => true,
39
  'default' => '',
40
- 'description' => '<strong>' . __( 'PDF', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enablePDF') ? ' &mdash; <a href="#PDF">' . translate( 'Settings' ) . '</a>' : '' )
41
  ),
42
  'SWF' => array (
43
  'id' => 'fancybox_enableSWF',
44
  'input' => 'checkbox',
45
  'hide' => true,
46
  'default' => '',
47
- 'description' => '<strong>' . __( 'SWF', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableSWF') ? ' &mdash; <a href="#SWF">' . translate( 'Settings' ) . '</a>' : '' )
48
  ),
49
  'SVG' => array (
50
  'id' => 'fancybox_enableSVG',
51
  'input' => 'checkbox',
52
  'hide' => true,
53
  'default' => '',
54
- 'description' => '<strong>' . __( 'SVG', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableSVG') ? ' &mdash; <a href="#SVG">' . translate( 'Settings' ) . '</a>' : '' )
55
  ),
56
  'VideoPress' => array (
57
- 'id' => 'fancybox_enableVideoPress',
58
  'input' => 'checkbox',
59
  'hide' => true,
60
  'default' => '',
61
  'status' => 'disabled',
62
- 'description' => '<strong>' . __( 'VideoPress', 'easy-fancybox' ) . '</strong>' . ' ' . '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('Make available &raquo;','easy-fancybox') . '</a></em>'
63
  ),
64
  'YouTube' => array (
65
  'id' => 'fancybox_enableYoutube',
66
  'input' => 'checkbox',
67
  'hide' => true,
68
  'default' => '',
69
- 'description' => '<strong>' . __( 'YouTube', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableYouTube') ? ' &mdash; <a href="#YouTube">' . translate( 'Settings' ) . '</a>' : '' )
70
  ),
71
  'Vimeo' => array (
72
  'id' => 'fancybox_enableVimeo',
73
  'input' => 'checkbox',
74
  'hide' => true,
75
  'default' => '',
76
- 'description' => '<strong>' . __( 'Vimeo', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableVimeo') ? ' &mdash; <a href="#Vimeo">' . translate( 'Settings' ) . '</a>' : '' )
77
  ),
78
  'Dailymotion' => array (
79
  'id' => 'fancybox_enableDailymotion',
80
  'input' => 'checkbox',
81
  'hide' => true,
82
  'default' => '',
83
- 'description' => '<strong>' . __( 'Dailymotion', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableDailymotion') ? ' &mdash; <a href="#Dailymotion">' . translate( 'Settings' ) . '</a>' : '' )
84
  ),
85
  'iFrame' => array (
86
  'id' => 'fancybox_enableiFrame',
87
  'input' => 'checkbox',
88
  'hide' => true,
89
  'default' => '',
90
- 'description' => '<strong>' . __('iFrames','easy-fancybox') . '</strong>' . '</strong>' . ( get_option('fancybox_enableiFrame') ? ' &mdash; <a href="#iFrame">' . translate( 'Settings' ) . '</a>' : '' )
91
  )
92
  ),
93
  'description' => ''
94
  ),
95
  'Overlay' => array (
96
- 'title' => __('Overlay','easy-fancybox'),
97
  'input' => 'multiple',
98
  'hide' => true,
99
  'options' => array(
@@ -102,18 +102,18 @@ $efb_options = array (
102
  'input' => 'checkbox',
103
  'noquotes' => true,
104
  'default' => '1',
105
- 'description' => __('Show the overlay around content opened in FancyBox.','easy-fancybox')
106
  ),
107
  'hideOnOverlayClick' => array (
108
  'id' => 'fancybox_hideOnOverlayClick',
109
  'input' => 'checkbox',
110
  'noquotes' => true,
111
  'default' => '1',
112
- 'description' => __('Close FancyBox when overlay is clicked.','easy-fancybox')
113
  ),
114
  'overlayOpacity' => array (
115
  'id' => 'fancybox_overlayOpacity',
116
- 'title' => __('Opacity','easy-fancybox'),
117
  'label_for' => 'fancybox_overlayOpacity',
118
  'input' => 'number',
119
  'step' => '0.1',
@@ -121,17 +121,17 @@ $efb_options = array (
121
  'max' => '1',
122
  'class' => 'small-text',
123
  'default' => '',
124
- 'description' => __('Value between 0 and 1. ','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' 0.7</em><br />'
125
  ),
126
  'overlayColor' => array (
127
  'id' => 'fancybox_overlayColor',
128
- 'title' => __('Color','easy-fancybox'),
129
  'label_for' => 'fancybox_overlayColor',
130
  'input' => 'text',
131
  'sanitize_callback' => 'colorval',
132
  'class' => 'small-text',
133
  'default' => '',
134
- 'description' => __('Enter an HTML color value.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' #777</em><br />'
135
  ),
136
  'overlaySpotlight' => array (
137
  'id' => 'fancybox_overlaySpotlight',
@@ -139,30 +139,30 @@ $efb_options = array (
139
  'hide' => true,
140
  'status' => get_option('fancybox_overlaySpotlight') ? '' : 'disabled',
141
  'default' => '',
142
- 'description' => __('Spotlight effect','easy-fancybox') . ( get_option('fancybox_overlaySpotlight') ? '' : '. <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('Make available &raquo;','easy-fancybox') ) . '</a></em>'
143
  )
144
  )
145
  ),
146
  'Window' => array (
147
- 'title' => __('Window','easy-fancybox'),
148
  'input' => 'multiple',
149
  'hide' => true,
150
  'options' => array(
151
  'p1' => array (
152
  'hide' => true,
153
- 'description' => '<strong>' . __('Appearance','easy-fancybox') . '</strong><br />'
154
  ),
155
  'showCloseButton' => array (
156
  'id' => 'fancybox_showCloseButton',
157
  'input' => 'checkbox',
158
  'noquotes' => true,
159
  'default' => '1',
160
- 'description' => __('Show the (X) close button','easy-fancybox')
161
  ),
162
  'backgroundColor' => array (
163
  'id' => 'fancybox_backgroundColor',
164
  'hide' => true,
165
- 'title' => __('Background color','easy-fancybox'),
166
  'label_for' => 'fancybox_backgroundColor',
167
  'input' => 'text',
168
  'sanitize_callback' => 'colorval',
@@ -174,19 +174,19 @@ $efb_options = array (
174
  'textColor' => array (
175
  'id' => 'fancybox_textColor',
176
  'hide' => true,
177
- 'title' => __('Text color','easy-fancybox'),
178
  'label_for' => 'fancybox_textColor',
179
  'input' => 'text',
180
  'sanitize_callback' => 'colorval',
181
  'status' => 'disabled',
182
  'class' => 'small-text',
183
  'default' => '',
184
- 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('Make available &raquo;','easy-fancybox') . '</a></em><br />'
185
  ),
186
  'titleColor' => array (
187
  'id' => 'fancybox_titleColor',
188
  'hide' => true,
189
- 'title' => __('Title color','easy-fancybox'),
190
  'label_for' => 'fancybox_titleColor',
191
  'input' => 'text',
192
  'sanitize_callback' => 'colorval',
@@ -197,18 +197,18 @@ $efb_options = array (
197
  'paddingColor' => array (
198
  'id' => 'fancybox_paddingColor',
199
  'hide' => true,
200
- 'title' => __('Border color','easy-fancybox'),
201
  'label_for' => 'fancybox_paddingColor',
202
  'input' => 'text',
203
  'sanitize_callback' => 'colorval',
204
  'class' => 'small-text',
205
  'default' => '',
206
- 'description' => '<em>' . __('Default:','easy-fancybox') . ' #000 x #fff</em><br />' . __('Note:','easy-fancybox') . ' ' . __('Use RGBA notation for semi-transparent borders.','easy-fancybox') . ' <em>' . __('Example:','easy-fancybox') . ' rgba(10,10,30,0.7)</em><br />'
207
  ),
208
  'borderRadius' => array (
209
  'id' => 'fancybox_borderRadius',
210
  'hide' => true,
211
- 'title' => __('Border radius','easy-fancybox'),
212
  'label_for' => 'fancybox_borderRadius',
213
  'input' => 'number',
214
  'step' => '1',
@@ -218,12 +218,12 @@ $efb_options = array (
218
  'status' => 'disabled',
219
  'class' => 'small-text',
220
  'default' => '',
221
- 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('Make available &raquo;','easy-fancybox') . '</a></em><br />'
222
  ),
223
 
224
  'p11' => array (
225
  'hide' => true,
226
- 'description' => '<br /><strong>' . __('Dimensions','easy-fancybox') . '</strong><br />'
227
  ),
228
  'width' => array (
229
  'id' => 'fancybox_width',
@@ -243,7 +243,7 @@ $efb_options = array (
243
  'sanitize_callback' => 'intval',
244
  'class' => 'small-text',
245
  'default' => '',
246
- 'description' => '<em>' . __('Default:','easy-fancybox') . ' 560 x 340</em><br />' . __('If content size is not set or cannot be determined automatically, these default dimensions will be used.','easy-fancybox') . '<br />'
247
  ),
248
  'padding' => array (
249
  'id' => 'fancybox_padding',
@@ -256,11 +256,11 @@ $efb_options = array (
256
  'sanitize_callback' => 'intval',
257
  'class' => 'small-text',
258
  'default' => '',
259
- 'description' => '<em>' . __('Default:','easy-fancybox') . ' 10</em><br />'
260
  ),
261
  'margin' => array (
262
  'id' => 'fancybox_margin',
263
- 'title' => __('Margin','easy-fancybox'),
264
  'label_for' => 'fancybox_margin',
265
  'input' => 'number',
266
  'step' => '1',
@@ -269,37 +269,30 @@ $efb_options = array (
269
  'sanitize_callback' => 'intval',
270
  'class' => 'small-text',
271
  'default' => '20',
272
- 'description' => '<em>' . __('Default:','easy-fancybox') . ' 40</em><br />'
273
  ),
274
 
275
  'p2' => array (
276
  'hide' => true,
277
- 'description' => '<br /><strong>' . __('Behavior','easy-fancybox') . '</strong><br />'
278
- ),
279
- 'centerOnScroll' => array (
280
- 'id' => 'fancybox_centerOnScroll',
281
- 'input' => 'checkbox',
282
- 'noquotes' => true,
283
- 'default' => '',
284
- 'description' => __('Center while scrolling (always disabled on touch devices and when content, including the title, might be larger than the viewport)','easy-fancybox')
285
  ),
286
  'enableEscapeButton' => array (
287
  'id' => 'fancybox_enableEscapeButton',
288
  'input' => 'checkbox',
289
  'noquotes' => true,
290
  'default' => '1',
291
- 'description' => __('Esc key stroke closes FancyBox','easy-fancybox')
292
  ),
293
  'autoScale' => array (
294
  'id' => 'fancybox_autoScale',
295
  'input' => 'checkbox',
296
  'noquotes' => true,
297
  'default' => '1',
298
- 'description' => __('Scale large content down to fit in the browser viewport.','easy-fancybox')
299
  ),
300
  'speedIn' => array (
301
  'id' => 'fancybox_speedIn',
302
- 'title' => __('Opening speed','easy-fancybox'),
303
  'label_for' => 'fancybox_speedIn',
304
  'input' => 'number',
305
  'step' => '100',
@@ -311,7 +304,7 @@ $efb_options = array (
311
  ),
312
  'speedOut' => array (
313
  'id' => 'fancybox_speedOut',
314
- 'title' => __('Closing speed','easy-fancybox'),
315
  'label_for' => 'fancybox_speedOut',
316
  'input' => 'number',
317
  'step' => '100',
@@ -320,43 +313,43 @@ $efb_options = array (
320
  'sanitize_callback' => 'intval',
321
  'class' => 'small-text',
322
  'default' => '',
323
- 'description' => '<br />' . __('Duration in milliseconds. Higher is slower.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' 300</em><br />'
324
  ),
325
  'mouseWheel' => array (
326
  'id' => 'fancybox_mouseWheel',
327
  'hide' => true,
328
  'input' => 'checkbox',
329
  'default' => '',
330
- 'description' => __('Include the Mousewheel jQuery extension script to allow gallery browsing by mousewheel action.','easy-fancybox')
331
  )
332
  )
333
  ),
334
 
335
  'Miscellaneous' => array (
336
- 'title' => __('Miscellaneous','easy-fancybox'),
337
  'input' => 'multiple',
338
  'hide' => true,
339
  'options' => array(
340
  'p0' => array (
341
  'hide' => true,
342
- 'description' => '<strong>' . __('Auto popup','easy-fancybox') . '</strong><br />'
343
  ),
344
  'autoClick' => array (
345
  'id' => 'fancybox_autoClick',
346
- 'title' => __('Open on page load','easy-fancybox'),
347
  'label_for' => 'fancybox_autoClick',
348
  'hide' => true,
349
  'input' => 'select',
350
  'options' => array(
351
  '' => translate('None'),
352
- '1' => __('Link with ID "fancybox-auto"','easy-fancybox'),
353
  ),
354
  'default' => '1',
355
- 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('More options &raquo;','easy-fancybox') . '</a></em><br />'
356
  ),
357
  'delayClick' => array (
358
  'id' => 'fancybox_delayClick',
359
- 'title' => __('Delay in milliseconds','easy-fancybox'),
360
  'label_for' => 'fancybox_delayClick',
361
  'hide' => true,
362
  'input' => 'number',
@@ -366,11 +359,11 @@ $efb_options = array (
366
  'sanitize_callback' => 'intval',
367
  'class' => 'small-text',
368
  'default' => '1000',
369
- 'description' => ' <em>' . __('Default:','easy-fancybox') . ' 1000</em><br />'
370
  ),
371
  'jqCookie' => array (
372
  'id' => '',
373
- 'title' => __('Hide popup after first visit?','easy-fancybox'),
374
  'hide' => true,
375
  'input' => 'select',
376
  'status' => 'disabled',
@@ -378,12 +371,12 @@ $efb_options = array (
378
  'sanitize_callback' => 'intval',
379
  'options' => array(
380
  '0' => translate('No'),
381
- '1' => __('1 Day','easy-fancybox'),
382
- '7' => __('1 Week','easy-fancybox'),
383
- '30' => __('1 Month','easy-fancybox'),
384
- '365' => __('1 Year','easy-fancybox')
385
  ),
386
- 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('Make available &raquo;','easy-fancybox') . '</a></em><br />'
387
  ),
388
  'cookiePath' => array (
389
  'id' => '',
@@ -392,11 +385,11 @@ $efb_options = array (
392
  ),
393
  'p1' => array (
394
  'hide' => true,
395
- 'description' => '<br /><strong>' . __('Browser & device compatibility','easy-fancybox') . '</strong><br />'
396
  ),
397
  'minViewportWidth' => array (
398
  'id' => 'fancybox_minViewportWidth',
399
- 'title' => __('Minimum browser/device viewport width','easy-fancybox'),
400
  'label_for' => 'fancybox_minViewportWidth',
401
  'input' => 'number',
402
  'step' => '1',
@@ -405,31 +398,31 @@ $efb_options = array (
405
  'sanitize_callback' => 'intval',
406
  'class' => 'small-text',
407
  'default' => '',
408
- 'description' => __('(leave empty to ignore)','easy-fancybox') . '<br/>'
409
  ),
410
  /* 'forceNewtab' => array (
411
  'id' => 'fancybox_forceNewtab',
412
  'input' => 'checkbox',
413
  'hide' => true,
414
  'default' => '1',
415
- 'description' => __('Make media links open in a new tab when viewport falls below minimum width (above)','easy-fancybox')
416
  ),*/
417
  'compatIE8' => array (
418
  'id' => 'fancybox_compatIE8',
419
  'input' => 'checkbox',
420
  'hide' => true,
421
  'default' => '',
422
- 'description' => __('Include IE 8 compatibility style rules','easy-fancybox')
423
  ),
424
  'p2' => array (
425
  'hide' => true,
426
- 'description' => '<br /><strong>' . __('Theme & plugins compatibility','easy-fancybox') . '</strong><br />'
427
- . __('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')
428
  . '<br /><br />'
429
  ),
430
  'scriptPriority' => array (
431
  'id' => 'fancybox_scriptPriority',
432
- 'title' => __('FancyBox script priority','easy-fancybox'),
433
  'label_for' => 'fancybox_scriptPriority',
434
  'hide' => true,
435
  'input' => 'number',
@@ -439,32 +432,32 @@ $efb_options = array (
439
  'sanitize_callback' => 'intval',
440
  'class' => 'small-text',
441
  'default' => '10',
442
- 'description' => __('Default priority is 10.','easy-fancybox') . ' ' . __('Higher is later.','easy-fancybox') . '<br/>'
443
  ),
444
  'noFooter' => array (
445
  'id' => 'fancybox_noFooter',
446
  'input' => 'checkbox',
447
  'hide' => true,
448
  'default' => '',
449
- 'description' => __('Move scripts from footer to theme head section (not recommended for site load times!)','easy-fancybox')
450
  ),
451
  'nojQuery' => array (
452
  'id' => 'fancybox_nojQuery',
453
  'input' => 'checkbox',
454
  'hide' => true,
455
  'default' => '',
456
- 'description' => __('Do not include standard WordPress jQuery library (do this only if you are sure jQuery is included from another source!)','easy-fancybox')
457
  ),
458
  'pre45Compat' => array (
459
  'id' => 'fancybox_pre45Compat',
460
  'input' => 'checkbox',
461
  'hide' => true,
462
  'default' => function_exists( 'wp_add_inline_script' ) ? '' : '1',
463
- 'description' => __('Do not use wp_add_inline_script/style functions (may solve issues with older script minification plugins)','easy-fancybox')
464
  ),
465
  'p3' => array (
466
  'hide' => true,
467
- 'description' => '<br /><strong>' . __('Advanced','easy-fancybox') . '</strong><br />'
468
  ),
469
  'metaData' => array (
470
  'id' => 'fancybox_metaData',
@@ -472,7 +465,7 @@ $efb_options = array (
472
  'input' => 'checkbox',
473
  'status' => get_option('fancybox_metaData') ? '' : 'disabled',
474
  'default' => '',
475
- 'description' => __('Include the Metadata jQuery extension script to allow passing custom parameters via link class.','easy-fancybox') . ( get_option('fancybox_metaData') ? '' : '. <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('Make available &raquo;','easy-fancybox') ) . '</a></em>'
476
  ),
477
  'vcMasonryCompat' => array (
478
  'id' => 'fancybox_vcMasonryCompat',
@@ -480,18 +473,18 @@ $efb_options = array (
480
  'input' => 'checkbox',
481
  'status' => 'disabled',
482
  'default' => '',
483
- 'description' => __('WPBakery / Visual Composer - Masonry Grid Gallery compatibility.','easy-fancybox') . ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('Make available &raquo;','easy-fancybox') . '</a></em>'
484
  ),
485
  'autoExclude' => array (
486
  'id' => 'fancybox_autoExclude',
487
- 'title' => __('Exclude','easy-fancybox'),
488
  'label_for' => 'fancybox_autoExclude',
489
  'input' => 'text',
490
  'class' => 'regular-text',
491
  'hide' => true,
492
  'default' => '.nolightbox,a.wp-block-file__button,a.pin-it-button,a[href*=\'pinterest.com/pin/create\'],a[href*=\'facebook.com/share\'],a[href*=\'twitter.com/share\']',
493
  'sanitize_callback' => 'csl_text',
494
- 'description' => __('A comma-separated list of selectors for elements to which FancyBox should not automatically bind itself. Media links inside these elements will be ignored by Autodetect.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' .nolightbox,a.wp-block-file__button,a.pin-it-button,a[href*=\'pinterest.com/pin/create\'],a[href*=\'facebook.com/share\'],a[href*=\'twitter.com/share\']</em><br />'
495
  )
496
  )
497
  )
@@ -499,16 +492,16 @@ $efb_options = array (
499
  ),
500
 
501
  'IMG' => array(
502
- 'title' => __('Images','easy-fancybox'),
503
  'input' => 'multiple',
504
  'options' => array(
505
  'intro' => array (
506
  'hide' => true,
507
- 'description' => __('To make images open in an overlay, add their extension to the Autodetect field or use the class "fancybox" for its link. Clear field to switch off all autodetection.','easy-fancybox') . '<br />'
508
  ),
509
  'tag' => array (
510
  'hide' => true,
511
- 'default' => 'a.fancybox,area.fancybox,li.fancybox a'
512
  ),
513
  'class' => array (
514
  'hide' => true,
@@ -516,7 +509,7 @@ $efb_options = array (
516
  ),
517
  'autoAttribute' => array (
518
  'id' => 'fancybox_autoAttribute',
519
- 'title' => __('Autodetect','easy-fancybox'),
520
  'label_for' => 'fancybox_autoAttribute',
521
  'input' => 'text',
522
  'class' => 'regular-text',
@@ -524,23 +517,23 @@ $efb_options = array (
524
  'default' => '.jpg,.png,.webp',
525
  'sanitize_callback' => 'csl_text',
526
  'selector' => 'href*=',
527
- 'description' => __('A comma-separated list of image file extensions to which FancyBox should automatically bind itself.','easy-fancybox') . ' <em>' . __('Example:','easy-fancybox') . ' .jpg,.png,.gif,.jpeg</em><br />'
528
  ),
529
  'autoAttributeLimit' => array (
530
  'id' => 'fancybox_autoAttributeLimit',
531
- 'title' => __('Apply to','easy-fancybox'),
532
  'label_for' => 'fancybox_autoAttributeLimit',
533
  'hide' => true,
534
  'input' => 'select',
535
  'options' => array(
536
- '' => __('All image links', 'easy-fancybox')
537
  ),
538
  'default' => '',
539
- 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('More options &raquo;','easy-fancybox') . '</a></em><br />'
540
  ),
541
  'type' => array (
542
  'id' => 'fancybox_classType',
543
- 'title' => __('Force FancyBox to treat all media linked with class="fancybox" as images?','easy-fancybox'),
544
  'label_for' => 'fancybox_classType',
545
  'input' => 'select',
546
  'options' => array(
@@ -552,97 +545,93 @@ $efb_options = array (
552
  ),
553
  'p2' => array (
554
  'hide' => true,
555
- 'description' => '<br /><strong>' . __('Behavior','easy-fancybox') . '</strong><br />'
556
  ),
557
  'transitionIn' => array (
558
  'id' => 'fancybox_transitionIn',
559
- 'title' => __('Transition In','easy-fancybox'),
560
  'label_for' => 'fancybox_transitionIn',
561
  'input' => 'select',
562
  'options' => array(
563
  'none' => translate('None'),
564
- '' => __('Fade','easy-fancybox'),
565
- 'elastic' => __('Elastic','easy-fancybox'),
566
  ),
567
  'default' => 'elastic',
568
  'description' => ' '
569
  ),
570
  'easingIn' => array (
571
  'id' => 'fancybox_easingIn',
572
- 'title' => __('Easing In','easy-fancybox'),
573
  'label_for' => 'fancybox_easingIn',
574
  'input' => 'select',
575
  'options' => array(
576
- 'linear' => __('Linear','easy-fancybox'),
577
- '' => __('Swing','easy-fancybox'),
578
- 'easeInBack' => __('easeInBack','easy-fancybox'),
579
- 'easeOutBack' => __('easeOutBack','easy-fancybox')
580
  ),
581
- 'default' => 'easeOutBack',
582
- 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('More options &raquo;','easy-fancybox') . '</a></em><br />'
583
  ),
584
  'transitionOut' => array (
585
  'id' => 'fancybox_transitionOut',
586
- 'title' => __('Transition Out','easy-fancybox'),
587
  'label_for' => 'fancybox_transitionOut',
588
  'input' => 'select',
589
  'options' => array(
590
  'none' => translate('None'),
591
- '' => __('Fade','easy-fancybox'),
592
- 'elastic' => __('Elastic','easy-fancybox'),
593
  ),
594
  'default' => 'elastic',
595
  'description' => ' '
596
  ),
597
  'easingOut' => array (
598
  'id' => 'fancybox_easingOut',
599
- 'title' => __('Easing Out','easy-fancybox'),
600
  'label_for' => 'fancybox_easingOut',
601
  'input' => 'select',
602
  'options' => array(
603
- 'linear' => __('Linear','easy-fancybox'),
604
- '' => __('Swing','easy-fancybox'),
605
- 'easeInBack' => __('easeInBack','easy-fancybox'),
606
- 'easeOutBack' => __('easeOutBack','easy-fancybox')
607
  ),
608
- 'default' => 'easeInBack',
609
- 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('More options &raquo;','easy-fancybox') . '</a></em><br />' . __('Note:','easy-fancybox') . ' ' . __('Easing effects only apply when Transition is set to Elastic. ','easy-fancybox') . '<br /><br />'
610
  ),
611
  'opacity' => array (
612
  'id' => 'fancybox_opacity',
613
  'input' => 'checkbox',
614
  'noquotes' => true,
615
  'default' => '',
616
- 'description' => __('Transparency fade during elastic transition. CAUTION: Use only when at least Transition In is set to Elastic!','easy-fancybox')
617
  ),
618
  'hideOnContentClick' => array (
619
  'id' => 'fancybox_hideOnContentClick',
620
  'input' => 'checkbox',
621
  'noquotes' => true,
622
  'default' => '',
623
- 'description' => __('Close FancyBox when content is clicked','easy-fancybox')
624
  ),
625
  'p1' => array (
626
  'hide' => true,
627
- 'description' => '<br /><strong>' . __('Appearance','easy-fancybox') . '</strong><br />'
628
  ),
629
  'titleShow' => array (
630
  'id' => 'fancybox_titleShow',
631
  'input' => 'checkbox',
632
  'noquotes' => true,
633
  'default' => '1',
634
- 'description' => __('Show title.','easy-fancybox') . ' ' . __('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
635
  ),
636
  'titlePosition' => array (
637
  'id' => 'fancybox_titlePosition',
638
- 'title' => __('Title Position','easy-fancybox'),
639
  'label_for' => 'fancybox_titlePosition',
640
  'input' => 'select',
641
  'options' => array(
642
- '' => __('Float','easy-fancybox'),
643
- 'outside' => __('Outside','easy-fancybox'),
644
- 'inside' => __('Inside','easy-fancybox'),
645
- 'over' => __('Overlay','easy-fancybox')
646
  ),
647
  'default' => 'over',
648
  'description' => '<br />'
@@ -652,61 +641,61 @@ $efb_options = array (
652
  'input' => 'checkbox',
653
  'noquotes' => true,
654
  'default' => '1',
655
- 'description' => __('Allow title from thumbnail alt attribute.','easy-fancybox')
656
  ),
657
  'onStart' => array (
658
  'id' => '',
659
- 'title' => __('Advanced','easy-fancybox'),
660
  'input' => 'select',
661
  'status' => 'disabled',
662
  'options' => array(
663
- '' => __('Hide/show title on mouse hover action','easy-fancybox')
664
  ),
665
  'default' => '',
666
- 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('Make available &raquo;','easy-fancybox') . '</a></em><br />'
667
  ),
668
  'p3' => array (
669
  'hide' => true,
670
- 'description' => '<br /><strong>' . __('Gallery','easy-fancybox') . '</strong><br />'
671
  ),
672
  'autoGallery' => array (
673
  'id' => 'fancybox_autoGallery',
674
- 'title' => __('Autogallery','easy-fancybox'),
675
  'label_for' => 'fancybox_autoGallery',
676
  'hide' => true,
677
  'input' => 'select',
678
  'options' => array(
679
  '' => translate('Disabled'),
680
- '1' => __('WordPress galleries only','easy-fancybox'),
681
- '2' => __('All in one gallery','easy-fancybox')
682
  ),
683
  'default' => '1',
684
- 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('More options &raquo;','easy-fancybox') . '</a></em><br />' . __('Note:','easy-fancybox') . ' ' . __('When disabled, you can use the rel attribute to manually group image links together.','easy-fancybox') . '<br /><br />'
685
  ),
686
  'showNavArrows' => array (
687
  'id' => 'fancybox_showNavArrows',
688
  'input' => 'checkbox',
689
  'noquotes' => true,
690
  'default' => '1',
691
- 'description' => __('Show the gallery navigation arrows','easy-fancybox')
692
  ),
693
  'enableKeyboardNav' => array (
694
  'id' => 'fancybox_enableKeyboardNav',
695
  'input' => 'checkbox',
696
  'noquotes' => true,
697
  'default' => '1',
698
- 'description' => __('Arrow key strokes browse the gallery','easy-fancybox')
699
  ),
700
  'cyclic' => array (
701
  'id' => 'fancybox_cyclic',
702
  'input' => 'checkbox',
703
  'noquotes' => true,
704
  'default' => '',
705
- 'description' => __('Make galleries cyclic, allowing you to keep pressing next/back.','easy-fancybox')
706
  ),
707
  'changeSpeed' => array (
708
  'id' => 'fancybox_changeSpeed',
709
- 'title' => __('Change speed','easy-fancybox'),
710
  'label_for' => 'fancybox_changeSpeed',
711
  'input' => 'number',
712
  'step' => '1',
@@ -718,7 +707,7 @@ $efb_options = array (
718
  ),
719
  'changeFade' => array (
720
  'id' => 'fancybox_changeFade',
721
- 'title' => __('Fade speed','easy-fancybox'),
722
  'label_for' => 'fancybox_changeFade',
723
  'input' => 'number',
724
  'step' => '1',
@@ -727,7 +716,7 @@ $efb_options = array (
727
  'sanitize_callback' => 'intval',
728
  'class' => 'small-text',
729
  'default' => '',
730
- 'description' => '<br />' . __('Duration in milliseconds. Higher is slower.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' 300</em><br /><br />'
731
  ),
732
  'autoSelector' => array (
733
  'id' => 'fancybox_autoSelector',
@@ -737,29 +726,29 @@ $efb_options = array (
737
  ),
738
  'onComplete' => array (
739
  'id' => '',
740
- 'title' => __('Advanced','easy-fancybox'),
741
  'input' => 'select',
742
  'status' => 'disabled',
743
  'options' => array(
744
- '' => __('Slideshow','easy-fancybox')
745
  ),
746
  'default' => '',
747
- 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('Make available &raquo;','easy-fancybox') . '</a></em>'
748
  )
749
  )
750
  ),
751
 
752
  'Inline' => array(
753
- 'title' => __('Inline content','easy-fancybox'),
754
  'input' => 'multiple',
755
  'options' => array(
756
  'intro' => array (
757
  'hide' => true,
758
- 'description' => __('To make inline content open in an overlay, wrap that content in a div with a unique ID, create a link with target "#uniqueID" and give it a class "fancybox-inline" attribute.','easy-fancybox') . '<br /><br />'
759
  ),
760
  'tag' => array (
761
  'hide' => true,
762
- 'default' => 'a.fancybox-inline,area.fancybox-inline,li.fancybox-inline a'
763
  ),
764
  'class' => array (
765
  'hide' => true,
@@ -773,88 +762,84 @@ $efb_options = array (
773
  'input' => 'checkbox',
774
  'noquotes' => true,
775
  'default' => '1',
776
- 'description' => __('Try to adjust size to inline/html content. If unchecked the default dimensions will be used.','easy-fancybox') . ''
777
  ),
778
  'scrolling' => array (
779
  'id' => 'fancybox_InlineScrolling',
780
- 'title' => __('Scrolling','easy-fancybox'),
781
  'label_for' => 'fancybox_InlineScrolling',
782
  'input' => 'select',
783
  'options' => array(
784
- 'auto' => __('Auto','easy-fancybox'),
785
- 'yes' => __('Always','easy-fancybox'),
786
- 'no' => __('Never','easy-fancybox')
787
  ),
788
  'default' => 'no',
789
- 'description' => __('Define scrolling and scrollbar visibility.','easy-fancybox') . '<br /><br />'
790
  ),
791
  'transitionIn' => array (
792
  'id' => 'fancybox_transitionInInline',
793
- 'title' => __('Transition In','easy-fancybox'),
794
  'label_for' => 'fancybox_transitionInInline',
795
  'input' => 'select',
796
  'options' => array(
797
  'none' => translate('None'),
798
- '' => __('Fade','easy-fancybox'),
799
- 'elastic' => __('Elastic','easy-fancybox'),
800
  ),
801
  'default' => '',
802
  'description' => ' '
803
  ),
804
  'easingIn' => array (
805
  'id' => 'fancybox_easingInInline',
806
- 'title' => __('Easing In','easy-fancybox'),
807
  'label_for' => 'fancybox_easingInInline',
808
  'input' => 'select',
809
  'options' => array(
810
- 'linear' => __('Linear','easy-fancybox'),
811
- '' => __('Swing','easy-fancybox'),
812
- 'easeInBack' => __('easeInBack','easy-fancybox'),
813
- 'easeOutBack' => __('easeOutBack','easy-fancybox')
814
  ),
815
  'default' => 'easeOutBack',
816
- 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('More options &raquo;','easy-fancybox') . '</a></em><br />'
817
  ),
818
  'transitionOut' => array (
819
  'id' => 'fancybox_transitionOutInline',
820
- 'title' => __('Transition Out','easy-fancybox'),
821
  'label_for' => 'fancybox_transitionOutInline',
822
  'input' => 'select',
823
  'options' => array(
824
  'none' => translate('None'),
825
- '' => __('Fade','easy-fancybox'),
826
- 'elastic' => __('Elastic','easy-fancybox'),
827
  ),
828
  'default' => '',
829
  'description' => ' '
830
  ),
831
  'easingOut' => array (
832
  'id' => 'fancybox_easingOutInline',
833
- 'title' => __('Easing Out','easy-fancybox'),
834
  'label_for' => 'fancybox_easingOutInline',
835
  'input' => 'select',
836
  'options' => array(
837
- 'linear' => __('Linear','easy-fancybox'),
838
- '' => __('Swing','easy-fancybox'),
839
- 'easeInBack' => __('easeInBack','easy-fancybox'),
840
- 'easeOutBack' => __('easeOutBack','easy-fancybox')
841
  ),
842
- 'default' => 'easeInBack',
843
- 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . __('More options &raquo;','easy-fancybox') . '</a></em><br />' . __('Note:','easy-fancybox') . ' ' . __('Easing effects only apply when Transition is set to Elastic. ','easy-fancybox') . '<br /><br />'
844
  ),
845
  'opacity' => array (
846
  'id' => 'fancybox_opacityInline',
847
  'input' => 'checkbox',
848
  'noquotes' => true,
849
  'default' => '',
850
- 'description' => __('Transparency fade during elastic transition. CAUTION: Use only when at least Transition In is set to Elastic!','easy-fancybox')
851
  ),
852
  'hideOnContentClick' => array (
853
  'id' => 'fancybox_hideOnContentClickInline',
854
  'input' => 'checkbox',
855
  'noquotes' => true,
856
  'default' => '',
857
- 'description' => __('Close FancyBox when content is clicked','easy-fancybox')
858
  ),
859
  'titleShow' => array (
860
  'noquotes' => true,
@@ -864,12 +849,12 @@ $efb_options = array (
864
  ),
865
 
866
  'PDF' => array(
867
- 'title' => __('PDF','easy-fancybox'),
868
  'input' => 'multiple',
869
  'options' => array(
870
  'intro' => array (
871
  'hide' => true,
872
- 'description' => __('To make any PDF document file open in an overlay, switch on Autodetect or use the class "fancybox-pdf" for its link.','easy-fancybox') . '<br />'
873
  ),
874
  'autoAttribute' => array (
875
  'id' => 'fancybox_autoAttributePDF',
@@ -877,11 +862,11 @@ $efb_options = array (
877
  'hide' => true,
878
  'default' => '1',
879
  'selector' => '\'a[href*=".pdf"],area[href*=".pdf"],a[href*=".PDF"],area[href*=".PDF"]\'',
880
- 'description' => __('Autodetect','easy-fancybox')
881
  ),
882
  'tag' => array (
883
  'hide' => true,
884
- 'default' => 'a.fancybox-pdf,area.fancybox-pdf,li.fancybox-pdf a'
885
  ),
886
  'class' => array (
887
  'hide' => true,
@@ -893,17 +878,17 @@ $efb_options = array (
893
  'onStart' => array (
894
  'id' => 'fancybox_PDFonStart',
895
  'noquotes' => true,
896
- 'title' => __('Embed with','easy-fancybox'),
897
  'label_for' => 'fancybox_PDFonStart',
898
  'input' => 'select',
899
  'options' => array(
900
- 'function(a,i,o){o.type=\'pdf\';}' => __('Object tag (plus fall-back link)','easy-fancybox'),
901
- 'function(a,i,o){o.type=\'html\';o.content=\'<embed src="\'+a[i].href+\'" type="application/pdf" height="100%" width="100%" />\'}' => __('Embed tag','easy-fancybox'),
902
- '' => __('iFrame tag (let browser decide)','easy-fancybox'),
903
- 'function(a,i,o){o.href=\'https://docs.google.com/viewer?embedded=true&url=\'+a[i].href;}' => __('Google Docs Viewer (external)','easy-fancybox')
904
  ),
905
- 'default' => '',
906
- 'description' => __('Note:','easy-fancybox') . ' ' . __('External viewers have bandwidth, usage rate and and file size limits.','easy-fancybox') . '<br /><br />'
907
  ),
908
  'width' => array (
909
  'id' => 'fancybox_PDFwidth',
@@ -942,17 +927,17 @@ $efb_options = array (
942
  'input' => 'checkbox',
943
  'noquotes' => true,
944
  'default' => '',
945
- 'description' => __('Show title.','easy-fancybox') . ' ' . __('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
946
  ),
947
  'titlePosition' => array (
948
  'id' => 'fancybox_PDFtitlePosition',
949
- 'title' => __('Title Position','easy-fancybox'),
950
  'label_for' => 'fancybox_PDFtitlePosition',
951
  'input' => 'select',
952
  'options' => array(
953
- 'float' => __('Float','easy-fancybox'),
954
- 'outside' => __('Outside','easy-fancybox'),
955
- 'inside' => __('Inside','easy-fancybox')
956
  ),
957
  'default' => 'float',
958
  'description' => '<br />'
@@ -962,7 +947,7 @@ $efb_options = array (
962
  'input' => 'checkbox',
963
  'noquotes' => true,
964
  'default' => '1',
965
- 'description' => __('Allow title from thumbnail alt attribute.','easy-fancybox')
966
  ),
967
  'autoDimensions' => array (
968
  'noquotes' => true,
@@ -975,12 +960,12 @@ $efb_options = array (
975
  ),
976
 
977
  'SWF' => array(
978
- 'title' => __('SWF','easy-fancybox'),
979
  'input' => 'multiple',
980
  'options' => array(
981
  'intro' => array (
982
  'hide' => true,
983
- 'description' => __('To make any Flash (.swf) file open in an overlay, switch on Autodetect or use the class "fancybox-swf" for its link.','easy-fancybox') . '<br />'
984
  ),
985
  'autoAttribute' => array (
986
  'id' => 'fancybox_autoAttributeSWF',
@@ -988,11 +973,11 @@ $efb_options = array (
988
  'hide' => true,
989
  'default' => '1',
990
  'selector' => '\'a[href*=".swf"],area[href*=".swf"],a[href*=".SWF"],area[href*=".SWF"]\'',
991
- 'description' => __('Autodetect','easy-fancybox') . '<br />'
992
  ),
993
  'tag' => array (
994
  'hide' => true,
995
- 'default' => 'a.fancybox-swf,area.fancybox-swf,li.fancybox-swf a'
996
  ),
997
  'class' => array (
998
  'hide' => true,
@@ -1040,17 +1025,17 @@ $efb_options = array (
1040
  'input' => 'checkbox',
1041
  'noquotes' => true,
1042
  'default' => '',
1043
- 'description' => __('Show title.','easy-fancybox') . ' ' . __('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1044
  ),
1045
  'titlePosition' => array (
1046
  'id' => 'fancybox_SWFtitlePosition',
1047
- 'title' => __('Title Position','easy-fancybox'),
1048
  'label_for' => 'fancybox_SWFtitlePosition',
1049
  'input' => 'select',
1050
  'options' => array(
1051
- 'float' => __('Float','easy-fancybox'),
1052
- 'outside' => __('Outside','easy-fancybox'),
1053
- 'inside' => __('Inside','easy-fancybox')
1054
  ),
1055
  'default' => 'float',
1056
  'description' => '<br />'
@@ -1060,7 +1045,7 @@ $efb_options = array (
1060
  'input' => 'checkbox',
1061
  'noquotes' => true,
1062
  'default' => '1',
1063
- 'description' => __('Allow title from thumbnail alt attribute.','easy-fancybox')
1064
  ),
1065
  'swf' => array (
1066
  'noquotes' => true,
@@ -1070,12 +1055,12 @@ $efb_options = array (
1070
  ),
1071
 
1072
  'SVG' => array(
1073
- 'title' => __('SVG','easy-fancybox'),
1074
  'input' => 'multiple',
1075
  'options' => array(
1076
  'intro' => array (
1077
  'hide' => true,
1078
- 'description' => __('To make any SVG (.svg) file open in an overlay, switch on Autodetect or use the class "fancybox-svg" for its link.','easy-fancybox') . '<br />'
1079
  ),
1080
  'autoAttribute' => array (
1081
  'id' => 'fancybox_autoAttributeSVG',
@@ -1083,11 +1068,11 @@ $efb_options = array (
1083
  'hide' => true,
1084
  'default' => '1',
1085
  'selector' => '\'a[href*=".svg"],area[href*=".svg"],a[href*=".SVG"],area[href*=".SVG"]\'',
1086
- 'description' => __('Autodetect','easy-fancybox') . '<br />'
1087
  ),
1088
  'tag' => array (
1089
  'hide' => true,
1090
- 'default' => 'a.fancybox-svg,area.fancybox-svg,li.fancybox-svg a'
1091
  ),
1092
  'class' => array (
1093
  'hide' => true,
@@ -1135,18 +1120,18 @@ $efb_options = array (
1135
  'input' => 'checkbox',
1136
  'noquotes' => true,
1137
  'default' => '',
1138
- 'description' => __('Show title.','easy-fancybox') . ' ' . __('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1139
  ),
1140
  'titlePosition' => array (
1141
  'id' => 'fancybox_SVGtitlePosition',
1142
- 'title' => __('Title Position','easy-fancybox'),
1143
  'label_for' => 'fancybox_SVGtitlePosition',
1144
  'input' => 'select',
1145
  'options' => array(
1146
- 'float' => __('Float','easy-fancybox'),
1147
- 'outside' => __('Outside','easy-fancybox'),
1148
- 'inside' => __('Inside','easy-fancybox')
1149
- //,'over' => __('Overlay','easy-fancybox')
1150
  ),
1151
  'default' => 'float',
1152
  'description' => '<br />'
@@ -1156,7 +1141,7 @@ $efb_options = array (
1156
  'input' => 'checkbox',
1157
  'noquotes' => true,
1158
  'default' => '1',
1159
- 'description' => __('Allow title from thumbnail alt attribute.','easy-fancybox')
1160
  ),
1161
  'svg' => array (
1162
  'noquotes' => true,
@@ -1169,12 +1154,12 @@ $efb_options = array (
1169
  ),
1170
 
1171
  'YouTube' => array(
1172
- 'title' => __('YouTube','easy-fancybox'),
1173
  'input' => 'multiple',
1174
  'options' => array(
1175
  'intro' => array (
1176
  'hide' => true,
1177
- 'description' => __('To make any YouTube movie open in an overlay, switch on Autodetect or use the class "fancybox-youtube" for its link.','easy-fancybox') . '<br />'
1178
  ),
1179
  'autoAttribute' => array (
1180
  'id' => 'fancybox_autoAttributeYoutube',
@@ -1182,11 +1167,11 @@ $efb_options = array (
1182
  'hide' => true,
1183
  'default' => '1',
1184
  'selector' => '\'a[href*="youtu.be/"],area[href*="youtu.be/"],a[href*="youtube.com/"],area[href*="youtube.com/"]\').filter(function(){return this.href.match(/\/(?:youtu\.be|watch\?|embed\/)/);}',
1185
- 'description' => __('Autodetect','easy-fancybox') . '<br />'
1186
  ),
1187
  'tag' => array (
1188
  'hide' => true,
1189
- 'default' => 'a.fancybox-youtube,area.fancybox-youtube,li.fancybox-youtube a'
1190
  ),
1191
  'class' => array (
1192
  'hide' => true,
@@ -1200,7 +1185,7 @@ $efb_options = array (
1200
  'input' => 'checkbox',
1201
  'hide' => true,
1202
  'default' => '',
1203
- 'description' => __('Enable privacy-enhanced mode','easy-fancybox') . '<br />'
1204
  ),
1205
  'width' => array (
1206
  'id' => 'fancybox_YoutubeWidth',
@@ -1249,17 +1234,17 @@ $efb_options = array (
1249
  'input' => 'checkbox',
1250
  'noquotes' => true,
1251
  'default' => '',
1252
- 'description' => __('Show title.','easy-fancybox') . ' ' . __('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1253
  ),
1254
  'titlePosition' => array (
1255
  'id' => 'fancybox_YoutubetitlePosition',
1256
- 'title' => __('Title Position','easy-fancybox'),
1257
  'label_for' => 'fancybox_YoutubetitlePosition',
1258
  'input' => 'select',
1259
  'options' => array(
1260
- 'float' => __('Float','easy-fancybox'),
1261
- 'outside' => __('Outside','easy-fancybox'),
1262
- 'inside' => __('Inside','easy-fancybox')
1263
  ),
1264
  'default' => 'float',
1265
  'description' => '<br />'
@@ -1269,7 +1254,7 @@ $efb_options = array (
1269
  'input' => 'checkbox',
1270
  'noquotes' => true,
1271
  'default' => '1',
1272
- 'description' => __('Allow title from thumbnail alt attribute.','easy-fancybox')
1273
  ),
1274
  'onStart' => array (
1275
  'noquotes' => true,
@@ -1281,12 +1266,12 @@ $efb_options = array (
1281
  ),
1282
 
1283
  'Vimeo' => array(
1284
- 'title' => __('Vimeo','easy-fancybox'),
1285
  'input' => 'multiple',
1286
  'options' => array(
1287
  'intro' => array (
1288
  'hide' => true,
1289
- 'description' => __('To make any Vimeo movie open in an overlay, switch on Autodetect or use the class "fancybox-vimeo" for its link.','easy-fancybox') . '<br />'
1290
  ),
1291
  'autoAttribute' => array (
1292
  'id' => 'fancybox_autoAttributeVimeo',
@@ -1294,11 +1279,11 @@ $efb_options = array (
1294
  'hide' => true,
1295
  'default' => '1',
1296
  'selector' => '\'a[href*="vimeo.com/"],area[href*="vimeo.com/"]\').filter(function(){return this.href.match(/\/(?:[0-9]+|video\/)/);}',
1297
- 'description' => __('Autodetect','easy-fancybox') . '<br />'
1298
  ),
1299
  'tag' => array (
1300
  'hide' => true,
1301
- 'default' => 'a.fancybox-vimeo,area.fancybox-vimeo,li.fancybox-vimeo a'
1302
  ),
1303
  'class' => array (
1304
  'hide' => true,
@@ -1354,17 +1339,17 @@ $efb_options = array (
1354
  'input' => 'checkbox',
1355
  'noquotes' => true,
1356
  'default' => '',
1357
- 'description' => __('Show title.','easy-fancybox') . ' ' . __('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1358
  ),
1359
  'titlePosition' => array (
1360
  'id' => 'fancybox_VimeotitlePosition',
1361
- 'title' => __('Title Position','easy-fancybox'),
1362
  'label_for' => 'fancybox_VimeotitlePosition',
1363
  'input' => 'select',
1364
  'options' => array(
1365
- 'float' => __('Float','easy-fancybox'),
1366
- 'outside' => __('Outside','easy-fancybox'),
1367
- 'inside' => __('Inside','easy-fancybox')
1368
  ),
1369
  'default' => 'float',
1370
  'description' => '<br />'
@@ -1374,7 +1359,7 @@ $efb_options = array (
1374
  'input' => 'checkbox',
1375
  'noquotes' => true,
1376
  'default' => '1',
1377
- 'description' => __('Allow title from thumbnail alt attribute.','easy-fancybox')
1378
  ),
1379
  'onStart' => array (
1380
  'noquotes' => true,
@@ -1384,12 +1369,12 @@ $efb_options = array (
1384
  ),
1385
 
1386
  'Dailymotion' => array(
1387
- 'title' => __('Dailymotion','easy-fancybox'),
1388
  'input' => 'multiple',
1389
  'options' => array(
1390
  'intro' => array (
1391
  'hide' => true,
1392
- 'description' => __('To make any Dailymotion movie open in an overlay, switch on Autodetect or use the class "fancybox-dailymotion" for its link.','easy-fancybox') . '<br />'
1393
  ),
1394
  'autoAttribute' => array (
1395
  'id' => 'fancybox_autoAttributeDailymotion',
@@ -1397,11 +1382,11 @@ $efb_options = array (
1397
  'hide' => true,
1398
  'default' => '1',
1399
  'selector' => '\'a[href*="dailymotion.com/"],area[href*="dailymotion.com/"]\').filter(function(){return this.href.match(/\/video\//);}',
1400
- 'description' => __('Autodetect','easy-fancybox') . '<br />'
1401
  ),
1402
  'tag' => array (
1403
  'hide' => true,
1404
- 'default' => 'a.fancybox-dailymotion,area.fancybox-dailymotion,li.fancybox-dailymotion a'
1405
  ),
1406
  'class' => array (
1407
  'hide' => true,
@@ -1457,17 +1442,17 @@ $efb_options = array (
1457
  'input' => 'checkbox',
1458
  'noquotes' => true,
1459
  'default' => '',
1460
- 'description' => __('Show title.','easy-fancybox') . ' ' . __('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1461
  ),
1462
  'titlePosition' => array (
1463
  'id' => 'fancybox_DailymotiontitlePosition',
1464
- 'title' => __('Title Position','easy-fancybox'),
1465
  'label_for' => 'fancybox_DailymotiontitlePosition',
1466
  'input' => 'select',
1467
  'options' => array(
1468
- 'float' => __('Float','easy-fancybox'),
1469
- 'outside' => __('Outside','easy-fancybox'),
1470
- 'inside' => __('Inside','easy-fancybox')
1471
  ),
1472
  'default' => 'float',
1473
  'description' => '<br />'
@@ -1477,7 +1462,7 @@ $efb_options = array (
1477
  'input' => 'checkbox',
1478
  'noquotes' => true,
1479
  'default' => '1',
1480
- 'description' => __('Allow title from thumbnail alt attribute.','easy-fancybox')
1481
  ),
1482
  'onStart' => array (
1483
  'noquotes' => true,
@@ -1488,7 +1473,7 @@ $efb_options = array (
1488
 
1489
  /* 'Tudou' => array(
1490
  'id' => 'fancybox_Tudou',
1491
- 'title' => __('Tudou','easy-fancybox'),
1492
  'label_for' => '',
1493
  'input' => 'multiple',
1494
  'class' => '', 'description' => '',
@@ -1501,7 +1486,7 @@ $efb_options = array (
1501
  'options' => array(),
1502
  'hide' => true,
1503
  'default' => '1',
1504
- 'description' => __('Tudou links','easy-fancybox')
1505
  )
1506
  )
1507
  ),*/
@@ -1514,16 +1499,16 @@ http://static.animoto.com/swf/w.swf?w=swf/vp1&f=Kf9POzQMSOGWyu41gtOtsw&i=m
1514
  */
1515
 
1516
  'iFrame' => array(
1517
- 'title' => __('iFrames','easy-fancybox'),
1518
  'input' => 'multiple',
1519
  'options' => array(
1520
  'intro' => array (
1521
  'hide' => true,
1522
- 'description' => __('To make a website or HTML document open in an overlay, use the class "fancybox-iframe" for its link.','easy-fancybox') . '<br /><br />'
1523
  ),
1524
  'tag' => array (
1525
  'hide' => true,
1526
- 'default' => 'a.fancybox-iframe,area.fancybox-iframe,li.fancybox-iframe a'
1527
  ),
1528
  'class' => array (
1529
  'hide' => true,
@@ -1569,17 +1554,17 @@ http://static.animoto.com/swf/w.swf?w=swf/vp1&f=Kf9POzQMSOGWyu41gtOtsw&i=m
1569
  'input' => 'checkbox',
1570
  'noquotes' => true,
1571
  'default' => '',
1572
- 'description' => __('Show title.','easy-fancybox') . ' ' . __('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1573
  ),
1574
  'titlePosition' => array (
1575
  'id' => 'fancybox_iFrametitlePosition',
1576
- 'title' => __('Title Position','easy-fancybox'),
1577
  'label_for' => 'fancybox_iFrametitlePosition',
1578
  'input' => 'select',
1579
  'options' => array(
1580
- 'float' => __('Float','easy-fancybox'),
1581
- 'outside' => __('Outside','easy-fancybox'),
1582
- 'inside' => __('Inside','easy-fancybox')
1583
  ),
1584
  'default' => 'float',
1585
  'description' => '<br />'
@@ -1589,14 +1574,14 @@ http://static.animoto.com/swf/w.swf?w=swf/vp1&f=Kf9POzQMSOGWyu41gtOtsw&i=m
1589
  'input' => 'checkbox',
1590
  'noquotes' => true,
1591
  'default' => '1',
1592
- 'description' => __('Allow title from thumbnail alt attribute.','easy-fancybox') . '<br/>'
1593
  ),
1594
  'allowfullscreen' => array (
1595
  'id' => 'fancybox_allowFullScreen',
1596
  'input' => 'checkbox',
1597
  'noquotes' => true,
1598
  'default' => '',
1599
- 'description' => __('Allow embedded content to jump to full screen mode','easy-fancybox')
1600
  )
1601
  )
1602
  )
1
  <?php
2
  /**
3
+ * FancyBox v1 options and their defaults array.
4
  */
5
 
6
  $efb_options = array (
7
+ 'Global' => array (
8
+ 'backwardcompatible' => true, // Marks older Pro version compatibility.
9
  'input' => 'deep',
10
  'hide' => true,
11
  'options' => array(
12
  'Enable' => array (
13
+ 'title' => esc_html__('Media','easy-fancybox'),
14
  'input' => 'multiple',
15
  'hide' => true,
16
  'options' => array(
17
  'p1' => array (
18
  'hide' => true,
19
+ 'description' => esc_html__('Enable FancyBox for','easy-fancybox') . '<br />'
20
  ),
21
  'IMG' => array (
22
  'id' => 'fancybox_enableImg',
23
  'input' => 'checkbox',
24
  'hide' => true,
25
+ 'default' => ( function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( EASY_FANCYBOX_BASENAME ) ) ? '' : '1',
26
+ 'description' => '<strong>' . esc_html__( 'Images', 'easy-fancybox' ) . '</strong>' . ( get_option('fancybox_enableImg') ? ' &mdash; <a href="#IMG">' . translate( 'Settings' ) . '</a>' : '' )
27
  ),
28
  'Inline' => array (
29
  'id' => 'fancybox_enableInline',
30
  'input' => 'checkbox',
31
  'hide' => true,
32
  'default' => '',
33
+ 'description' => '<strong>' . esc_html__( 'Inline content', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableInline') ? ' &mdash; <a href="#Inline">' . translate( 'Settings' ) . '</a>' : '' )
34
  ),
35
  'PDF' => array (
36
  'id' => 'fancybox_enablePDF',
37
  'input' => 'checkbox',
38
  'hide' => true,
39
  'default' => '',
40
+ 'description' => '<strong>' . esc_html__( 'PDF', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enablePDF') ? ' &mdash; <a href="#PDF">' . translate( 'Settings' ) . '</a>' : '' )
41
  ),
42
  'SWF' => array (
43
  'id' => 'fancybox_enableSWF',
44
  'input' => 'checkbox',
45
  'hide' => true,
46
  'default' => '',
47
+ 'description' => '<strong>' . esc_html__( 'SWF', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableSWF') ? ' &mdash; <a href="#SWF">' . translate( 'Settings' ) . '</a>' : '' )
48
  ),
49
  'SVG' => array (
50
  'id' => 'fancybox_enableSVG',
51
  'input' => 'checkbox',
52
  'hide' => true,
53
  'default' => '',
54
+ 'description' => '<strong>' . esc_html__( 'SVG', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableSVG') ? ' &mdash; <a href="#SVG">' . translate( 'Settings' ) . '</a>' : '' )
55
  ),
56
  'VideoPress' => array (
57
+ 'id' => '',
58
  'input' => 'checkbox',
59
  'hide' => true,
60
  'default' => '',
61
  'status' => 'disabled',
62
+ 'description' => '<strong>' . esc_html__( 'VideoPress', 'easy-fancybox' ) . '</strong>' . ' ' . '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em>'
63
  ),
64
  'YouTube' => array (
65
  'id' => 'fancybox_enableYoutube',
66
  'input' => 'checkbox',
67
  'hide' => true,
68
  'default' => '',
69
+ 'description' => '<strong>' . esc_html__( 'YouTube', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableYouTube') ? ' &mdash; <a href="#YouTube">' . translate( 'Settings' ) . '</a>' : '' )
70
  ),
71
  'Vimeo' => array (
72
  'id' => 'fancybox_enableVimeo',
73
  'input' => 'checkbox',
74
  'hide' => true,
75
  'default' => '',
76
+ 'description' => '<strong>' . esc_html__( 'Vimeo', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableVimeo') ? ' &mdash; <a href="#Vimeo">' . translate( 'Settings' ) . '</a>' : '' )
77
  ),
78
  'Dailymotion' => array (
79
  'id' => 'fancybox_enableDailymotion',
80
  'input' => 'checkbox',
81
  'hide' => true,
82
  'default' => '',
83
+ 'description' => '<strong>' . esc_html__( 'Dailymotion', 'easy-fancybox' ) . '</strong>' . '</strong>' . ( get_option('fancybox_enableDailymotion') ? ' &mdash; <a href="#Dailymotion">' . translate( 'Settings' ) . '</a>' : '' )
84
  ),
85
  'iFrame' => array (
86
  'id' => 'fancybox_enableiFrame',
87
  'input' => 'checkbox',
88
  'hide' => true,
89
  'default' => '',
90
+ 'description' => '<strong>' . esc_html__('iFrames','easy-fancybox') . '</strong>' . '</strong>' . ( get_option('fancybox_enableiFrame') ? ' &mdash; <a href="#iFrame">' . translate( 'Settings' ) . '</a>' : '' )
91
  )
92
  ),
93
  'description' => ''
94
  ),
95
  'Overlay' => array (
96
+ 'title' => esc_html__('Overlay','easy-fancybox'),
97
  'input' => 'multiple',
98
  'hide' => true,
99
  'options' => array(
102
  'input' => 'checkbox',
103
  'noquotes' => true,
104
  'default' => '1',
105
+ 'description' => esc_html__('Show the overlay around content opened in FancyBox.','easy-fancybox')
106
  ),
107
  'hideOnOverlayClick' => array (
108
  'id' => 'fancybox_hideOnOverlayClick',
109
  'input' => 'checkbox',
110
  'noquotes' => true,
111
  'default' => '1',
112
+ 'description' => esc_html__('Close FancyBox when overlay is clicked.','easy-fancybox')
113
  ),
114
  'overlayOpacity' => array (
115
  'id' => 'fancybox_overlayOpacity',
116
+ 'title' => esc_html__('Opacity','easy-fancybox'),
117
  'label_for' => 'fancybox_overlayOpacity',
118
  'input' => 'number',
119
  'step' => '0.1',
121
  'max' => '1',
122
  'class' => 'small-text',
123
  'default' => '',
124
+ 'description' => esc_html__('Value between 0 and 1. ','easy-fancybox') . ' <em>' . esc_html__('Default:','easy-fancybox') . ' 0.7</em><br />'
125
  ),
126
  'overlayColor' => array (
127
  'id' => 'fancybox_overlayColor',
128
+ 'title' => esc_html__('Color','easy-fancybox'),
129
  'label_for' => 'fancybox_overlayColor',
130
  'input' => 'text',
131
  'sanitize_callback' => 'colorval',
132
  'class' => 'small-text',
133
  'default' => '',
134
+ 'description' => esc_html__('Enter an HTML color value.','easy-fancybox') . ' <em>' . esc_html__('Default:','easy-fancybox') . ' #777</em><br />'
135
  ),
136
  'overlaySpotlight' => array (
137
  'id' => 'fancybox_overlaySpotlight',
139
  'hide' => true,
140
  'status' => get_option('fancybox_overlaySpotlight') ? '' : 'disabled',
141
  'default' => '',
142
+ 'description' => esc_html__('Spotlight effect','easy-fancybox') . ( get_option('fancybox_overlaySpotlight') ? '' : '. <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') ) . '</a></em>'
143
  )
144
  )
145
  ),
146
  'Window' => array (
147
+ 'title' => esc_html__('Window','easy-fancybox'),
148
  'input' => 'multiple',
149
  'hide' => true,
150
  'options' => array(
151
  'p1' => array (
152
  'hide' => true,
153
+ 'description' => '<strong>' . esc_html__('Appearance','easy-fancybox') . '</strong><br />'
154
  ),
155
  'showCloseButton' => array (
156
  'id' => 'fancybox_showCloseButton',
157
  'input' => 'checkbox',
158
  'noquotes' => true,
159
  'default' => '1',
160
+ 'description' => esc_html__('Show the (X) close button','easy-fancybox')
161
  ),
162
  'backgroundColor' => array (
163
  'id' => 'fancybox_backgroundColor',
164
  'hide' => true,
165
+ 'title' => esc_html__('Background color','easy-fancybox'),
166
  'label_for' => 'fancybox_backgroundColor',
167
  'input' => 'text',
168
  'sanitize_callback' => 'colorval',
174
  'textColor' => array (
175
  'id' => 'fancybox_textColor',
176
  'hide' => true,
177
+ 'title' => esc_html__('Text color','easy-fancybox'),
178
  'label_for' => 'fancybox_textColor',
179
  'input' => 'text',
180
  'sanitize_callback' => 'colorval',
181
  'status' => 'disabled',
182
  'class' => 'small-text',
183
  'default' => '',
184
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em><br />'
185
  ),
186
  'titleColor' => array (
187
  'id' => 'fancybox_titleColor',
188
  'hide' => true,
189
+ 'title' => esc_html__('Title color','easy-fancybox'),
190
  'label_for' => 'fancybox_titleColor',
191
  'input' => 'text',
192
  'sanitize_callback' => 'colorval',
197
  'paddingColor' => array (
198
  'id' => 'fancybox_paddingColor',
199
  'hide' => true,
200
+ 'title' => esc_html__('Border color','easy-fancybox'),
201
  'label_for' => 'fancybox_paddingColor',
202
  'input' => 'text',
203
  'sanitize_callback' => 'colorval',
204
  'class' => 'small-text',
205
  'default' => '',
206
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' #000 x #fff</em><br />' . esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('Use RGBA notation for semi-transparent borders.','easy-fancybox') . ' <em>' . esc_html__('Example:','easy-fancybox') . ' rgba(10,10,30,0.7)</em><br />'
207
  ),
208
  'borderRadius' => array (
209
  'id' => 'fancybox_borderRadius',
210
  'hide' => true,
211
+ 'title' => esc_html__('Border radius','easy-fancybox'),
212
  'label_for' => 'fancybox_borderRadius',
213
  'input' => 'number',
214
  'step' => '1',
218
  'status' => 'disabled',
219
  'class' => 'small-text',
220
  'default' => '',
221
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em><br />'
222
  ),
223
 
224
  'p11' => array (
225
  'hide' => true,
226
+ 'description' => '<br /><strong>' . esc_html__('Dimensions','easy-fancybox') . '</strong><br />'
227
  ),
228
  'width' => array (
229
  'id' => 'fancybox_width',
243
  'sanitize_callback' => 'intval',
244
  'class' => 'small-text',
245
  'default' => '',
246
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' 560 x 340</em><br />' . esc_html__('If content size is not set or cannot be determined automatically, these default dimensions will be used.','easy-fancybox') . '<br />'
247
  ),
248
  'padding' => array (
249
  'id' => 'fancybox_padding',
256
  'sanitize_callback' => 'intval',
257
  'class' => 'small-text',
258
  'default' => '',
259
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' 10</em><br />'
260
  ),
261
  'margin' => array (
262
  'id' => 'fancybox_margin',
263
+ 'title' => esc_html__('Margin','easy-fancybox'),
264
  'label_for' => 'fancybox_margin',
265
  'input' => 'number',
266
  'step' => '1',
269
  'sanitize_callback' => 'intval',
270
  'class' => 'small-text',
271
  'default' => '20',
272
+ 'description' => '<em>' . esc_html__('Default:','easy-fancybox') . ' 40</em><br />'
273
  ),
274
 
275
  'p2' => array (
276
  'hide' => true,
277
+ 'description' => '<br /><strong>' . esc_html__('Behavior','easy-fancybox') . '</strong><br />'
 
 
 
 
 
 
 
278
  ),
279
  'enableEscapeButton' => array (
280
  'id' => 'fancybox_enableEscapeButton',
281
  'input' => 'checkbox',
282
  'noquotes' => true,
283
  'default' => '1',
284
+ 'description' => esc_html__('Esc key stroke closes FancyBox','easy-fancybox')
285
  ),
286
  'autoScale' => array (
287
  'id' => 'fancybox_autoScale',
288
  'input' => 'checkbox',
289
  'noquotes' => true,
290
  'default' => '1',
291
+ 'description' => esc_html__('Scale large content down to fit in the browser viewport.','easy-fancybox')
292
  ),
293
  'speedIn' => array (
294
  'id' => 'fancybox_speedIn',
295
+ 'title' => esc_html__('Opening speed','easy-fancybox'),
296
  'label_for' => 'fancybox_speedIn',
297
  'input' => 'number',
298
  'step' => '100',
304
  ),
305
  'speedOut' => array (
306
  'id' => 'fancybox_speedOut',
307
+ 'title' => esc_html__('Closing speed','easy-fancybox'),
308
  'label_for' => 'fancybox_speedOut',
309
  'input' => 'number',
310
  'step' => '100',
313
  'sanitize_callback' => 'intval',
314
  'class' => 'small-text',
315
  'default' => '',
316
+ 'description' => '<br />' . esc_html__('Duration in milliseconds. Higher is slower.','easy-fancybox') . ' <em>' . esc_html__('Default:','easy-fancybox') . ' 300</em><br />'
317
  ),
318
  'mouseWheel' => array (
319
  'id' => 'fancybox_mouseWheel',
320
  'hide' => true,
321
  'input' => 'checkbox',
322
  'default' => '',
323
+ 'description' => esc_html__('Include the Mousewheel jQuery extension script to allow gallery browsing by mousewheel action.','easy-fancybox')
324
  )
325
  )
326
  ),
327
 
328
  'Miscellaneous' => array (
329
+ 'title' => esc_html__('Miscellaneous','easy-fancybox'),
330
  'input' => 'multiple',
331
  'hide' => true,
332
  'options' => array(
333
  'p0' => array (
334
  'hide' => true,
335
+ 'description' => '<strong>' . esc_html__('Auto popup','easy-fancybox') . '</strong><br />'
336
  ),
337
  'autoClick' => array (
338
  'id' => 'fancybox_autoClick',
339
+ 'title' => esc_html__('Open on page load','easy-fancybox'),
340
  'label_for' => 'fancybox_autoClick',
341
  'hide' => true,
342
  'input' => 'select',
343
  'options' => array(
344
  '' => translate('None'),
345
+ '1' => esc_html__('Link with ID "fancybox-auto"','easy-fancybox'),
346
  ),
347
  'default' => '1',
348
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />'
349
  ),
350
  'delayClick' => array (
351
  'id' => 'fancybox_delayClick',
352
+ 'title' => esc_html__('Delay in milliseconds','easy-fancybox'),
353
  'label_for' => 'fancybox_delayClick',
354
  'hide' => true,
355
  'input' => 'number',
359
  'sanitize_callback' => 'intval',
360
  'class' => 'small-text',
361
  'default' => '1000',
362
+ 'description' => ' <em>' . esc_html__('Default:','easy-fancybox') . ' 1000</em><br />'
363
  ),
364
  'jqCookie' => array (
365
  'id' => '',
366
+ 'title' => esc_html__('Hide popup after first visit?','easy-fancybox'),
367
  'hide' => true,
368
  'input' => 'select',
369
  'status' => 'disabled',
371
  'sanitize_callback' => 'intval',
372
  'options' => array(
373
  '0' => translate('No'),
374
+ '1' => esc_html__('1 Day','easy-fancybox'),
375
+ '7' => esc_html__('1 Week','easy-fancybox'),
376
+ '30' => esc_html__('1 Month','easy-fancybox'),
377
+ '365' => esc_html__('1 Year','easy-fancybox')
378
  ),
379
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em><br />'
380
  ),
381
  'cookiePath' => array (
382
  'id' => '',
385
  ),
386
  'p1' => array (
387
  'hide' => true,
388
+ 'description' => '<br /><strong>' . esc_html__('Browser & device compatibility','easy-fancybox') . '</strong><br />'
389
  ),
390
  'minViewportWidth' => array (
391
  'id' => 'fancybox_minViewportWidth',
392
+ 'title' => esc_html__('Minimum browser/device viewport width','easy-fancybox'),
393
  'label_for' => 'fancybox_minViewportWidth',
394
  'input' => 'number',
395
  'step' => '1',
398
  'sanitize_callback' => 'intval',
399
  'class' => 'small-text',
400
  'default' => '',
401
+ 'description' => esc_html__('(leave empty to ignore)','easy-fancybox') . '<br/>'
402
  ),
403
  /* 'forceNewtab' => array (
404
  'id' => 'fancybox_forceNewtab',
405
  'input' => 'checkbox',
406
  'hide' => true,
407
  'default' => '1',
408
+ 'description' => esc_html__('Make media links open in a new tab when viewport falls below minimum width (above)','easy-fancybox')
409
  ),*/
410
  'compatIE8' => array (
411
  'id' => 'fancybox_compatIE8',
412
  'input' => 'checkbox',
413
  'hide' => true,
414
  'default' => '',
415
+ 'description' => esc_html__('Include IE 8 compatibility style rules','easy-fancybox')
416
  ),
417
  'p2' => array (
418
  'hide' => true,
419
+ 'description' => '<br /><strong>' . esc_html__('Theme & plugins compatibility','easy-fancybox') . '</strong><br />'
420
+ . esc_html__('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')
421
  . '<br /><br />'
422
  ),
423
  'scriptPriority' => array (
424
  'id' => 'fancybox_scriptPriority',
425
+ 'title' => esc_html__('FancyBox script priority','easy-fancybox'),
426
  'label_for' => 'fancybox_scriptPriority',
427
  'hide' => true,
428
  'input' => 'number',
432
  'sanitize_callback' => 'intval',
433
  'class' => 'small-text',
434
  'default' => '10',
435
+ 'description' => esc_html__('Default priority is 10.','easy-fancybox') . ' ' . esc_html__('Higher is later.','easy-fancybox') . '<br/>'
436
  ),
437
  'noFooter' => array (
438
  'id' => 'fancybox_noFooter',
439
  'input' => 'checkbox',
440
  'hide' => true,
441
  'default' => '',
442
+ 'description' => esc_html__('Move scripts from footer to theme head section (not recommended for site load times!)','easy-fancybox')
443
  ),
444
  'nojQuery' => array (
445
  'id' => 'fancybox_nojQuery',
446
  'input' => 'checkbox',
447
  'hide' => true,
448
  'default' => '',
449
+ 'description' => esc_html__('Do not include standard WordPress jQuery library (do this only if you are sure jQuery is included from another source!)','easy-fancybox')
450
  ),
451
  'pre45Compat' => array (
452
  'id' => 'fancybox_pre45Compat',
453
  'input' => 'checkbox',
454
  'hide' => true,
455
  'default' => function_exists( 'wp_add_inline_script' ) ? '' : '1',
456
+ 'description' => esc_html__('Do not use wp_add_inline_script/style functions (may solve issues with older script minification plugins)','easy-fancybox')
457
  ),
458
  'p3' => array (
459
  'hide' => true,
460
+ 'description' => '<br /><strong>' . esc_html__('Advanced','easy-fancybox') . '</strong><br />'
461
  ),
462
  'metaData' => array (
463
  'id' => 'fancybox_metaData',
465
  'input' => 'checkbox',
466
  'status' => get_option('fancybox_metaData') ? '' : 'disabled',
467
  'default' => '',
468
+ 'description' => esc_html__('Include the Metadata jQuery extension script to allow passing custom parameters via link class.','easy-fancybox') . ( get_option('fancybox_metaData') ? '' : '. <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') ) . '</a></em>'
469
  ),
470
  'vcMasonryCompat' => array (
471
  'id' => 'fancybox_vcMasonryCompat',
473
  'input' => 'checkbox',
474
  'status' => 'disabled',
475
  'default' => '',
476
+ 'description' => esc_html__('WPBakery / Visual Composer - Masonry Grid Gallery compatibility.','easy-fancybox') . ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em>'
477
  ),
478
  'autoExclude' => array (
479
  'id' => 'fancybox_autoExclude',
480
+ 'title' => esc_html__('Exclude','easy-fancybox'),
481
  'label_for' => 'fancybox_autoExclude',
482
  'input' => 'text',
483
  'class' => 'regular-text',
484
  'hide' => true,
485
  'default' => '.nolightbox,a.wp-block-file__button,a.pin-it-button,a[href*=\'pinterest.com/pin/create\'],a[href*=\'facebook.com/share\'],a[href*=\'twitter.com/share\']',
486
  'sanitize_callback' => 'csl_text',
487
+ 'description' => esc_html__('A comma-separated list of selectors for elements to which FancyBox should not automatically bind itself. Media links inside these elements will be ignored by Autodetect.','easy-fancybox') . ' <em>' . esc_html__('Default:','easy-fancybox') . ' .nolightbox,a.wp-block-file__button,a.pin-it-button,a[href*=\'pinterest.com/pin/create\'],a[href*=\'facebook.com/share\'],a[href*=\'twitter.com/share\']</em><br />'
488
  )
489
  )
490
  )
492
  ),
493
 
494
  'IMG' => array(
495
+ 'title' => esc_html__('Images','easy-fancybox'),
496
  'input' => 'multiple',
497
  'options' => array(
498
  'intro' => array (
499
  'hide' => true,
500
+ 'description' => esc_html__('To make images open in an overlay, add their extension to the Autodetect field or use the class "fancybox" for its link. Clear field to switch off all autodetection.','easy-fancybox') . '<br />'
501
  ),
502
  'tag' => array (
503
  'hide' => true,
504
+ 'default' => 'a.fancybox,area.fancybox,.fancybox>a'
505
  ),
506
  'class' => array (
507
  'hide' => true,
509
  ),
510
  'autoAttribute' => array (
511
  'id' => 'fancybox_autoAttribute',
512
+ 'title' => esc_html__('Autodetect','easy-fancybox'),
513
  'label_for' => 'fancybox_autoAttribute',
514
  'input' => 'text',
515
  'class' => 'regular-text',
517
  'default' => '.jpg,.png,.webp',
518
  'sanitize_callback' => 'csl_text',
519
  'selector' => 'href*=',
520
+ 'description' => esc_html__('A comma-separated list of image file extensions to which FancyBox should automatically bind itself.','easy-fancybox') . ' <em>' . esc_html__('Example:','easy-fancybox') . ' .jpg,.png,.gif,.jpeg</em><br />'
521
  ),
522
  'autoAttributeLimit' => array (
523
  'id' => 'fancybox_autoAttributeLimit',
524
+ 'title' => esc_html__('Apply to','easy-fancybox'),
525
  'label_for' => 'fancybox_autoAttributeLimit',
526
  'hide' => true,
527
  'input' => 'select',
528
  'options' => array(
529
+ '' => esc_html__('All image links', 'easy-fancybox')
530
  ),
531
  'default' => '',
532
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />'
533
  ),
534
  'type' => array (
535
  'id' => 'fancybox_classType',
536
+ 'title' => esc_html__('Force FancyBox to treat all media linked with class="fancybox" as images?','easy-fancybox'),
537
  'label_for' => 'fancybox_classType',
538
  'input' => 'select',
539
  'options' => array(
545
  ),
546
  'p2' => array (
547
  'hide' => true,
548
+ 'description' => '<br /><strong>' . esc_html__('Behavior','easy-fancybox') . '</strong><br />'
549
  ),
550
  'transitionIn' => array (
551
  'id' => 'fancybox_transitionIn',
552
+ 'title' => esc_html__('Transition In','easy-fancybox'),
553
  'label_for' => 'fancybox_transitionIn',
554
  'input' => 'select',
555
  'options' => array(
556
  'none' => translate('None'),
557
+ '' => esc_html__('Fade','easy-fancybox'),
558
+ 'elastic' => esc_html__('Elastic','easy-fancybox'),
559
  ),
560
  'default' => 'elastic',
561
  'description' => ' '
562
  ),
563
  'easingIn' => array (
564
  'id' => 'fancybox_easingIn',
565
+ 'title' => esc_html__('Easing In','easy-fancybox'),
566
  'label_for' => 'fancybox_easingIn',
567
  'input' => 'select',
568
  'options' => array(
569
+ 'linear' => esc_html__('Linear','easy-fancybox'),
570
+ '' => esc_html__('Swing','easy-fancybox')
 
 
571
  ),
572
+ 'default' => '',
573
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />'
574
  ),
575
  'transitionOut' => array (
576
  'id' => 'fancybox_transitionOut',
577
+ 'title' => esc_html__('Transition Out','easy-fancybox'),
578
  'label_for' => 'fancybox_transitionOut',
579
  'input' => 'select',
580
  'options' => array(
581
  'none' => translate('None'),
582
+ '' => esc_html__('Fade','easy-fancybox'),
583
+ 'elastic' => esc_html__('Elastic','easy-fancybox'),
584
  ),
585
  'default' => 'elastic',
586
  'description' => ' '
587
  ),
588
  'easingOut' => array (
589
  'id' => 'fancybox_easingOut',
590
+ 'title' => esc_html__('Easing Out','easy-fancybox'),
591
  'label_for' => 'fancybox_easingOut',
592
  'input' => 'select',
593
  'options' => array(
594
+ 'linear' => esc_html__('Linear','easy-fancybox'),
595
+ '' => esc_html__('Swing','easy-fancybox')
 
 
596
  ),
597
+ 'default' => '',
598
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />' . esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('Easing effects only apply when Transition is set to Elastic. ','easy-fancybox') . '<br /><br />'
599
  ),
600
  'opacity' => array (
601
  'id' => 'fancybox_opacity',
602
  'input' => 'checkbox',
603
  'noquotes' => true,
604
  'default' => '',
605
+ 'description' => esc_html__('Transparency fade during elastic transition. CAUTION: Use only when at least Transition In is set to Elastic!','easy-fancybox')
606
  ),
607
  'hideOnContentClick' => array (
608
  'id' => 'fancybox_hideOnContentClick',
609
  'input' => 'checkbox',
610
  'noquotes' => true,
611
  'default' => '',
612
+ 'description' => esc_html__('Close FancyBox when content is clicked','easy-fancybox')
613
  ),
614
  'p1' => array (
615
  'hide' => true,
616
+ 'description' => '<br /><strong>' . esc_html__('Appearance','easy-fancybox') . '</strong><br />'
617
  ),
618
  'titleShow' => array (
619
  'id' => 'fancybox_titleShow',
620
  'input' => 'checkbox',
621
  'noquotes' => true,
622
  'default' => '1',
623
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
624
  ),
625
  'titlePosition' => array (
626
  'id' => 'fancybox_titlePosition',
627
+ 'title' => esc_html__('Title Position','easy-fancybox'),
628
  'label_for' => 'fancybox_titlePosition',
629
  'input' => 'select',
630
  'options' => array(
631
+ '' => esc_html__('Float','easy-fancybox'),
632
+ 'outside' => esc_html__('Outside','easy-fancybox'),
633
+ 'inside' => esc_html__('Inside','easy-fancybox'),
634
+ 'over' => esc_html__('Overlay','easy-fancybox')
635
  ),
636
  'default' => 'over',
637
  'description' => '<br />'
641
  'input' => 'checkbox',
642
  'noquotes' => true,
643
  'default' => '1',
644
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
645
  ),
646
  'onStart' => array (
647
  'id' => '',
648
+ 'title' => esc_html__('Advanced','easy-fancybox'),
649
  'input' => 'select',
650
  'status' => 'disabled',
651
  'options' => array(
652
+ '' => esc_html__('Hide/show title on mouse hover action','easy-fancybox')
653
  ),
654
  'default' => '',
655
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em><br />'
656
  ),
657
  'p3' => array (
658
  'hide' => true,
659
+ 'description' => '<br /><strong>' . esc_html__('Gallery','easy-fancybox') . '</strong><br />'
660
  ),
661
  'autoGallery' => array (
662
  'id' => 'fancybox_autoGallery',
663
+ 'title' => esc_html__('Autogallery','easy-fancybox'),
664
  'label_for' => 'fancybox_autoGallery',
665
  'hide' => true,
666
  'input' => 'select',
667
  'options' => array(
668
  '' => translate('Disabled'),
669
+ '1' => esc_html__('WordPress galleries only','easy-fancybox'),
670
+ '2' => esc_html__('All in one gallery','easy-fancybox')
671
  ),
672
  'default' => '1',
673
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />' . esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('When disabled, you can use the rel attribute to manually group image links together.','easy-fancybox') . '<br /><br />'
674
  ),
675
  'showNavArrows' => array (
676
  'id' => 'fancybox_showNavArrows',
677
  'input' => 'checkbox',
678
  'noquotes' => true,
679
  'default' => '1',
680
+ 'description' => esc_html__('Show the gallery navigation arrows','easy-fancybox')
681
  ),
682
  'enableKeyboardNav' => array (
683
  'id' => 'fancybox_enableKeyboardNav',
684
  'input' => 'checkbox',
685
  'noquotes' => true,
686
  'default' => '1',
687
+ 'description' => esc_html__('Arrow key strokes browse the gallery','easy-fancybox')
688
  ),
689
  'cyclic' => array (
690
  'id' => 'fancybox_cyclic',
691
  'input' => 'checkbox',
692
  'noquotes' => true,
693
  'default' => '',
694
+ 'description' => esc_html__('Make galleries cyclic, allowing you to keep pressing next/back.','easy-fancybox')
695
  ),
696
  'changeSpeed' => array (
697
  'id' => 'fancybox_changeSpeed',
698
+ 'title' => esc_html__('Change speed','easy-fancybox'),
699
  'label_for' => 'fancybox_changeSpeed',
700
  'input' => 'number',
701
  'step' => '1',
707
  ),
708
  'changeFade' => array (
709
  'id' => 'fancybox_changeFade',
710
+ 'title' => esc_html__('Fade speed','easy-fancybox'),
711
  'label_for' => 'fancybox_changeFade',
712
  'input' => 'number',
713
  'step' => '1',
716
  'sanitize_callback' => 'intval',
717
  'class' => 'small-text',
718
  'default' => '',
719
+ 'description' => '<br />' . esc_html__('Duration in milliseconds. Higher is slower.','easy-fancybox') . ' <em>' . esc_html__('Default:','easy-fancybox') . ' 300</em><br /><br />'
720
  ),
721
  'autoSelector' => array (
722
  'id' => 'fancybox_autoSelector',
726
  ),
727
  'onComplete' => array (
728
  'id' => '',
729
+ 'title' => esc_html__('Advanced','easy-fancybox'),
730
  'input' => 'select',
731
  'status' => 'disabled',
732
  'options' => array(
733
+ '' => esc_html__('Slideshow','easy-fancybox')
734
  ),
735
  'default' => '',
736
+ 'description' => '<em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('Make available &raquo;','easy-fancybox') . '</a></em>'
737
  )
738
  )
739
  ),
740
 
741
  'Inline' => array(
742
+ 'title' => esc_html__('Inline content','easy-fancybox'),
743
  'input' => 'multiple',
744
  'options' => array(
745
  'intro' => array (
746
  'hide' => true,
747
+ 'description' => esc_html__('To make inline content open in an overlay, wrap that content in a div with a unique ID, create a link with target "#uniqueID" and give it a class "fancybox-inline" attribute.','easy-fancybox') . '<br /><br />'
748
  ),
749
  'tag' => array (
750
  'hide' => true,
751
+ 'default' => 'a.fancybox-inline,area.fancybox-inline,.fancybox-inline>a'
752
  ),
753
  'class' => array (
754
  'hide' => true,
762
  'input' => 'checkbox',
763
  'noquotes' => true,
764
  'default' => '1',
765
+ 'description' => esc_html__('Try to adjust size to inline/html content. If unchecked the default dimensions will be used.','easy-fancybox') . ''
766
  ),
767
  'scrolling' => array (
768
  'id' => 'fancybox_InlineScrolling',
769
+ 'title' => esc_html__('Scrolling','easy-fancybox'),
770
  'label_for' => 'fancybox_InlineScrolling',
771
  'input' => 'select',
772
  'options' => array(
773
+ 'auto' => esc_html__('Auto','easy-fancybox'),
774
+ 'yes' => esc_html__('Always','easy-fancybox'),
775
+ 'no' => esc_html__('Never','easy-fancybox')
776
  ),
777
  'default' => 'no',
778
+ 'description' => esc_html__('Define scrolling and scrollbar visibility.','easy-fancybox') . '<br /><br />'
779
  ),
780
  'transitionIn' => array (
781
  'id' => 'fancybox_transitionInInline',
782
+ 'title' => esc_html__('Transition In','easy-fancybox'),
783
  'label_for' => 'fancybox_transitionInInline',
784
  'input' => 'select',
785
  'options' => array(
786
  'none' => translate('None'),
787
+ '' => esc_html__('Fade','easy-fancybox'),
788
+ 'elastic' => esc_html__('Elastic','easy-fancybox'),
789
  ),
790
  'default' => '',
791
  'description' => ' '
792
  ),
793
  'easingIn' => array (
794
  'id' => 'fancybox_easingInInline',
795
+ 'title' => esc_html__('Easing In','easy-fancybox'),
796
  'label_for' => 'fancybox_easingInInline',
797
  'input' => 'select',
798
  'options' => array(
799
+ 'linear' => esc_html__('Linear','easy-fancybox'),
800
+ '' => esc_html__('Swing','easy-fancybox')
 
 
801
  ),
802
  'default' => 'easeOutBack',
803
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />'
804
  ),
805
  'transitionOut' => array (
806
  'id' => 'fancybox_transitionOutInline',
807
+ 'title' => esc_html__('Transition Out','easy-fancybox'),
808
  'label_for' => 'fancybox_transitionOutInline',
809
  'input' => 'select',
810
  'options' => array(
811
  'none' => translate('None'),
812
+ '' => esc_html__('Fade','easy-fancybox'),
813
+ 'elastic' => esc_html__('Elastic','easy-fancybox'),
814
  ),
815
  'default' => '',
816
  'description' => ' '
817
  ),
818
  'easingOut' => array (
819
  'id' => 'fancybox_easingOutInline',
820
+ 'title' => esc_html__('Easing Out','easy-fancybox'),
821
  'label_for' => 'fancybox_easingOutInline',
822
  'input' => 'select',
823
  'options' => array(
824
+ 'linear' => esc_html__('Linear','easy-fancybox'),
825
+ '' => esc_html__('Swing','easy-fancybox')
 
 
826
  ),
827
+ 'default' => '',
828
+ 'description' => ' <em><a href="'.easyFancyBox::$pro_plugin_url.'">' . esc_html__('More options &raquo;','easy-fancybox') . '</a></em><br />' . esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('Easing effects only apply when Transition is set to Elastic. ','easy-fancybox') . '<br /><br />'
829
  ),
830
  'opacity' => array (
831
  'id' => 'fancybox_opacityInline',
832
  'input' => 'checkbox',
833
  'noquotes' => true,
834
  'default' => '',
835
+ 'description' => esc_html__('Transparency fade during elastic transition. CAUTION: Use only when at least Transition In is set to Elastic!','easy-fancybox')
836
  ),
837
  'hideOnContentClick' => array (
838
  'id' => 'fancybox_hideOnContentClickInline',
839
  'input' => 'checkbox',
840
  'noquotes' => true,
841
  'default' => '',
842
+ 'description' => esc_html__('Close FancyBox when content is clicked','easy-fancybox')
843
  ),
844
  'titleShow' => array (
845
  'noquotes' => true,
849
  ),
850
 
851
  'PDF' => array(
852
+ 'title' => esc_html__('PDF','easy-fancybox'),
853
  'input' => 'multiple',
854
  'options' => array(
855
  'intro' => array (
856
  'hide' => true,
857
+ 'description' => esc_html__('To make any PDF document file open in an overlay, switch on Autodetect or use the class "fancybox-pdf" for its link.','easy-fancybox') . '<br />'
858
  ),
859
  'autoAttribute' => array (
860
  'id' => 'fancybox_autoAttributePDF',
862
  'hide' => true,
863
  'default' => '1',
864
  'selector' => '\'a[href*=".pdf"],area[href*=".pdf"],a[href*=".PDF"],area[href*=".PDF"]\'',
865
+ 'description' => esc_html__('Autodetect','easy-fancybox')
866
  ),
867
  'tag' => array (
868
  'hide' => true,
869
+ 'default' => 'a.fancybox-pdf,area.fancybox-pdf,.fancybox-pdf>a'
870
  ),
871
  'class' => array (
872
  'hide' => true,
878
  'onStart' => array (
879
  'id' => 'fancybox_PDFonStart',
880
  'noquotes' => true,
881
+ 'title' => esc_html__('Embed with','easy-fancybox'),
882
  'label_for' => 'fancybox_PDFonStart',
883
  'input' => 'select',
884
  'options' => array(
885
+ '{{object}}' => esc_html__('Object tag (plus fall-back link)','easy-fancybox'),
886
+ '{{embed}}' => esc_html__('Embed tag','easy-fancybox'),
887
+ '' => esc_html__('iFrame tag (let browser decide)','easy-fancybox'),
888
+ '{{googleviewer}}' => esc_html__('Google Docs Viewer (external)','easy-fancybox')
889
  ),
890
+ 'default' => '{{object}}',
891
+ 'description' => esc_html__('Note:','easy-fancybox') . ' ' . esc_html__('External viewers have bandwidth, usage rate and and file size limits.','easy-fancybox') . '<br /><br />'
892
  ),
893
  'width' => array (
894
  'id' => 'fancybox_PDFwidth',
927
  'input' => 'checkbox',
928
  'noquotes' => true,
929
  'default' => '',
930
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
931
  ),
932
  'titlePosition' => array (
933
  'id' => 'fancybox_PDFtitlePosition',
934
+ 'title' => esc_html__('Title Position','easy-fancybox'),
935
  'label_for' => 'fancybox_PDFtitlePosition',
936
  'input' => 'select',
937
  'options' => array(
938
+ 'float' => esc_html__('Float','easy-fancybox'),
939
+ 'outside' => esc_html__('Outside','easy-fancybox'),
940
+ 'inside' => esc_html__('Inside','easy-fancybox')
941
  ),
942
  'default' => 'float',
943
  'description' => '<br />'
947
  'input' => 'checkbox',
948
  'noquotes' => true,
949
  'default' => '1',
950
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
951
  ),
952
  'autoDimensions' => array (
953
  'noquotes' => true,
960
  ),
961
 
962
  'SWF' => array(
963
+ 'title' => esc_html__('SWF','easy-fancybox'),
964
  'input' => 'multiple',
965
  'options' => array(
966
  'intro' => array (
967
  'hide' => true,
968
+ 'description' => esc_html__('To make any Flash (.swf) file open in an overlay, switch on Autodetect or use the class "fancybox-swf" for its link.','easy-fancybox') . '<br />'
969
  ),
970
  'autoAttribute' => array (
971
  'id' => 'fancybox_autoAttributeSWF',
973
  'hide' => true,
974
  'default' => '1',
975
  'selector' => '\'a[href*=".swf"],area[href*=".swf"],a[href*=".SWF"],area[href*=".SWF"]\'',
976
+ 'description' => esc_html__('Autodetect','easy-fancybox') . '<br />'
977
  ),
978
  'tag' => array (
979
  'hide' => true,
980
+ 'default' => 'a.fancybox-swf,area.fancybox-swf,.fancybox-swf>a'
981
  ),
982
  'class' => array (
983
  'hide' => true,
1025
  'input' => 'checkbox',
1026
  'noquotes' => true,
1027
  'default' => '',
1028
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1029
  ),
1030
  'titlePosition' => array (
1031
  'id' => 'fancybox_SWFtitlePosition',
1032
+ 'title' => esc_html__('Title Position','easy-fancybox'),
1033
  'label_for' => 'fancybox_SWFtitlePosition',
1034
  'input' => 'select',
1035
  'options' => array(
1036
+ 'float' => esc_html__('Float','easy-fancybox'),
1037
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1038
+ 'inside' => esc_html__('Inside','easy-fancybox')
1039
  ),
1040
  'default' => 'float',
1041
  'description' => '<br />'
1045
  'input' => 'checkbox',
1046
  'noquotes' => true,
1047
  'default' => '1',
1048
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
1049
  ),
1050
  'swf' => array (
1051
  'noquotes' => true,
1055
  ),
1056
 
1057
  'SVG' => array(
1058
+ 'title' => esc_html__('SVG','easy-fancybox'),
1059
  'input' => 'multiple',
1060
  'options' => array(
1061
  'intro' => array (
1062
  'hide' => true,
1063
+ 'description' => esc_html__('To make any SVG (.svg) file open in an overlay, switch on Autodetect or use the class "fancybox-svg" for its link.','easy-fancybox') . '<br />'
1064
  ),
1065
  'autoAttribute' => array (
1066
  'id' => 'fancybox_autoAttributeSVG',
1068
  'hide' => true,
1069
  'default' => '1',
1070
  'selector' => '\'a[href*=".svg"],area[href*=".svg"],a[href*=".SVG"],area[href*=".SVG"]\'',
1071
+ 'description' => esc_html__('Autodetect','easy-fancybox') . '<br />'
1072
  ),
1073
  'tag' => array (
1074
  'hide' => true,
1075
+ 'default' => 'a.fancybox-svg,area.fancybox-svg,.fancybox-svg>a'
1076
  ),
1077
  'class' => array (
1078
  'hide' => true,
1120
  'input' => 'checkbox',
1121
  'noquotes' => true,
1122
  'default' => '',
1123
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1124
  ),
1125
  'titlePosition' => array (
1126
  'id' => 'fancybox_SVGtitlePosition',
1127
+ 'title' => esc_html__('Title Position','easy-fancybox'),
1128
  'label_for' => 'fancybox_SVGtitlePosition',
1129
  'input' => 'select',
1130
  'options' => array(
1131
+ 'float' => esc_html__('Float','easy-fancybox'),
1132
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1133
+ 'inside' => esc_html__('Inside','easy-fancybox')
1134
+ //,'over' => esc_html__('Overlay','easy-fancybox')
1135
  ),
1136
  'default' => 'float',
1137
  'description' => '<br />'
1141
  'input' => 'checkbox',
1142
  'noquotes' => true,
1143
  'default' => '1',
1144
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
1145
  ),
1146
  'svg' => array (
1147
  'noquotes' => true,
1154
  ),
1155
 
1156
  'YouTube' => array(
1157
+ 'title' => esc_html__('YouTube','easy-fancybox'),
1158
  'input' => 'multiple',
1159
  'options' => array(
1160
  'intro' => array (
1161
  'hide' => true,
1162
+ 'description' => esc_html__('To make any YouTube movie open in an overlay, switch on Autodetect or use the class "fancybox-youtube" for its link.','easy-fancybox') . '<br />'
1163
  ),
1164
  'autoAttribute' => array (
1165
  'id' => 'fancybox_autoAttributeYoutube',
1167
  'hide' => true,
1168
  'default' => '1',
1169
  'selector' => '\'a[href*="youtu.be/"],area[href*="youtu.be/"],a[href*="youtube.com/"],area[href*="youtube.com/"]\').filter(function(){return this.href.match(/\/(?:youtu\.be|watch\?|embed\/)/);}',
1170
+ 'description' => esc_html__('Autodetect','easy-fancybox') . '<br />'
1171
  ),
1172
  'tag' => array (
1173
  'hide' => true,
1174
+ 'default' => 'a.fancybox-youtube,area.fancybox-youtube,.fancybox-youtube>a'
1175
  ),
1176
  'class' => array (
1177
  'hide' => true,
1185
  'input' => 'checkbox',
1186
  'hide' => true,
1187
  'default' => '',
1188
+ 'description' => esc_html__('Enable privacy-enhanced mode','easy-fancybox') . '<br />'
1189
  ),
1190
  'width' => array (
1191
  'id' => 'fancybox_YoutubeWidth',
1234
  'input' => 'checkbox',
1235
  'noquotes' => true,
1236
  'default' => '',
1237
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1238
  ),
1239
  'titlePosition' => array (
1240
  'id' => 'fancybox_YoutubetitlePosition',
1241
+ 'title' => esc_html__('Title Position','easy-fancybox'),
1242
  'label_for' => 'fancybox_YoutubetitlePosition',
1243
  'input' => 'select',
1244
  'options' => array(
1245
+ 'float' => esc_html__('Float','easy-fancybox'),
1246
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1247
+ 'inside' => esc_html__('Inside','easy-fancybox')
1248
  ),
1249
  'default' => 'float',
1250
  'description' => '<br />'
1254
  'input' => 'checkbox',
1255
  'noquotes' => true,
1256
  'default' => '1',
1257
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
1258
  ),
1259
  'onStart' => array (
1260
  'noquotes' => true,
1266
  ),
1267
 
1268
  'Vimeo' => array(
1269
+ 'title' => esc_html__('Vimeo','easy-fancybox'),
1270
  'input' => 'multiple',
1271
  'options' => array(
1272
  'intro' => array (
1273
  'hide' => true,
1274
+ 'description' => esc_html__('To make any Vimeo movie open in an overlay, switch on Autodetect or use the class "fancybox-vimeo" for its link.','easy-fancybox') . '<br />'
1275
  ),
1276
  'autoAttribute' => array (
1277
  'id' => 'fancybox_autoAttributeVimeo',
1279
  'hide' => true,
1280
  'default' => '1',
1281
  'selector' => '\'a[href*="vimeo.com/"],area[href*="vimeo.com/"]\').filter(function(){return this.href.match(/\/(?:[0-9]+|video\/)/);}',
1282
+ 'description' => esc_html__('Autodetect','easy-fancybox') . '<br />'
1283
  ),
1284
  'tag' => array (
1285
  'hide' => true,
1286
+ 'default' => 'a.fancybox-vimeo,area.fancybox-vimeo,.fancybox-vimeo>a'
1287
  ),
1288
  'class' => array (
1289
  'hide' => true,
1339
  'input' => 'checkbox',
1340
  'noquotes' => true,
1341
  'default' => '',
1342
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1343
  ),
1344
  'titlePosition' => array (
1345
  'id' => 'fancybox_VimeotitlePosition',
1346
+ 'title' => esc_html__('Title Position','easy-fancybox'),
1347
  'label_for' => 'fancybox_VimeotitlePosition',
1348
  'input' => 'select',
1349
  'options' => array(
1350
+ 'float' => esc_html__('Float','easy-fancybox'),
1351
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1352
+ 'inside' => esc_html__('Inside','easy-fancybox')
1353
  ),
1354
  'default' => 'float',
1355
  'description' => '<br />'
1359
  'input' => 'checkbox',
1360
  'noquotes' => true,
1361
  'default' => '1',
1362
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
1363
  ),
1364
  'onStart' => array (
1365
  'noquotes' => true,
1369
  ),
1370
 
1371
  'Dailymotion' => array(
1372
+ 'title' => esc_html__('Dailymotion','easy-fancybox'),
1373
  'input' => 'multiple',
1374
  'options' => array(
1375
  'intro' => array (
1376
  'hide' => true,
1377
+ 'description' => esc_html__('To make any Dailymotion movie open in an overlay, switch on Autodetect or use the class "fancybox-dailymotion" for its link.','easy-fancybox') . '<br />'
1378
  ),
1379
  'autoAttribute' => array (
1380
  'id' => 'fancybox_autoAttributeDailymotion',
1382
  'hide' => true,
1383
  'default' => '1',
1384
  'selector' => '\'a[href*="dailymotion.com/"],area[href*="dailymotion.com/"]\').filter(function(){return this.href.match(/\/video\//);}',
1385
+ 'description' => esc_html__('Autodetect','easy-fancybox') . '<br />'
1386
  ),
1387
  'tag' => array (
1388
  'hide' => true,
1389
+ 'default' => 'a.fancybox-dailymotion,area.fancybox-dailymotion,.fancybox-dailymotion>a'
1390
  ),
1391
  'class' => array (
1392
  'hide' => true,
1442
  'input' => 'checkbox',
1443
  'noquotes' => true,
1444
  'default' => '',
1445
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1446
  ),
1447
  'titlePosition' => array (
1448
  'id' => 'fancybox_DailymotiontitlePosition',
1449
+ 'title' => esc_html__('Title Position','easy-fancybox'),
1450
  'label_for' => 'fancybox_DailymotiontitlePosition',
1451
  'input' => 'select',
1452
  'options' => array(
1453
+ 'float' => esc_html__('Float','easy-fancybox'),
1454
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1455
+ 'inside' => esc_html__('Inside','easy-fancybox')
1456
  ),
1457
  'default' => 'float',
1458
  'description' => '<br />'
1462
  'input' => 'checkbox',
1463
  'noquotes' => true,
1464
  'default' => '1',
1465
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox')
1466
  ),
1467
  'onStart' => array (
1468
  'noquotes' => true,
1473
 
1474
  /* 'Tudou' => array(
1475
  'id' => 'fancybox_Tudou',
1476
+ 'title' => esc_html__('Tudou','easy-fancybox'),
1477
  'label_for' => '',
1478
  'input' => 'multiple',
1479
  'class' => '', 'description' => '',
1486
  'options' => array(),
1487
  'hide' => true,
1488
  'default' => '1',
1489
+ 'description' => esc_html__('Tudou links','easy-fancybox')
1490
  )
1491
  )
1492
  ),*/
1499
  */
1500
 
1501
  'iFrame' => array(
1502
+ 'title' => esc_html__('iFrames','easy-fancybox'),
1503
  'input' => 'multiple',
1504
  'options' => array(
1505
  'intro' => array (
1506
  'hide' => true,
1507
+ 'description' => esc_html__('To make a website or HTML document open in an overlay, use the class "fancybox-iframe" for its link.','easy-fancybox') . '<br /><br />'
1508
  ),
1509
  'tag' => array (
1510
  'hide' => true,
1511
+ 'default' => 'a.fancybox-iframe,area.fancybox-iframe,.fancybox-iframe>a'
1512
  ),
1513
  'class' => array (
1514
  'hide' => true,
1554
  'input' => 'checkbox',
1555
  'noquotes' => true,
1556
  'default' => '',
1557
+ 'description' => esc_html__('Show title.','easy-fancybox') . ' ' . esc_html__('FancyBox will try to get a title from the link or thumbnail title attributes.','easy-fancybox')
1558
  ),
1559
  'titlePosition' => array (
1560
  'id' => 'fancybox_iFrametitlePosition',
1561
+ 'title' => esc_html__('Title Position','easy-fancybox'),
1562
  'label_for' => 'fancybox_iFrametitlePosition',
1563
  'input' => 'select',
1564
  'options' => array(
1565
+ 'float' => esc_html__('Float','easy-fancybox'),
1566
+ 'outside' => esc_html__('Outside','easy-fancybox'),
1567
+ 'inside' => esc_html__('Inside','easy-fancybox')
1568
  ),
1569
  'default' => 'float',
1570
  'description' => '<br />'
1574
  'input' => 'checkbox',
1575
  'noquotes' => true,
1576
  'default' => '1',
1577
+ 'description' => esc_html__('Allow title from thumbnail alt attribute.','easy-fancybox') . '<br/>'
1578
  ),
1579
  'allowfullscreen' => array (
1580
  'id' => 'fancybox_allowFullScreen',
1581
  'input' => 'checkbox',
1582
  'noquotes' => true,
1583
  'default' => '',
1584
+ 'description' => esc_html__('Allow embedded content to jump to full screen mode','easy-fancybox')
1585
  )
1586
  )
1587
  )
inc/fancybox-legacy.php ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * FancyBox v1
4
+ */
5
+
6
+ namespace easyFancyBox\fancyBox_1;
7
+
8
+ /**
9
+ * MAIN INLINE SCRIPT
10
+ */
11
+
12
+ function prepare_inline() {
13
+ // Begin building output FancyBox settings.
14
+ $script = 'var fb_timeout, fb_opts={';
15
+
16
+ /**
17
+ * Global settings routine.
18
+ */
19
+ $more = 0;
20
+ foreach ( \easyFancyBox::$options['Global']['options'] as $globals ) {
21
+ foreach ( $globals['options'] as $_key => $_value ) {
22
+ if ( isset($_value['id']) )
23
+ if ( isset($_value['default']) )
24
+ $parm = \get_option($_value['id'], $_value['default']);
25
+ else
26
+ $parm = \get_option($_value['id']);
27
+ elseif ( isset($_value['default']) )
28
+ $parm = $_value['default'];
29
+ else
30
+ $parm = '';
31
+
32
+ if ( isset($_value['input']) && 'checkbox'==$_value['input'] )
33
+ $parm = ( '1' == $parm ) ? 'true' : 'false';
34
+
35
+ if( ! isset($_value['hide']) && $parm!='' ) {
36
+ $quote = ( is_numeric($parm) || (isset($_value['noquotes']) && $_value['noquotes'] == true) ) ? '' : '\'';
37
+ if ($more>0)
38
+ $script .= ',';
39
+ $script .= '\''.$_key.'\':';
40
+ $script .= $quote.$parm.$quote;
41
+ $more++;
42
+ } else {
43
+ ${$_key} = $parm;
44
+ }
45
+ }
46
+ }
47
+
48
+ $script .= ' };
49
+ if(typeof easy_fancybox_handler===\'undefined\'){
50
+ var easy_fancybox_handler=function(){';
51
+
52
+ $exclude = \get_option( 'fancybox_autoExclude', \easyFancyBox::$options['Global']['options']['Miscellaneous']['options']['autoExclude']['default'] );
53
+ $exclude_array = $exclude ? explode( ',', $exclude ) : array();
54
+ $exclude_selectors = ! empty( $exclude_array ) ? \wp_json_encode( $exclude_array ) : false;
55
+ if ( $exclude_selectors ) {
56
+ $script .= '
57
+ jQuery(' . $exclude_selectors . '.join(\',\')).addClass(\'nofancybox\');';
58
+ }
59
+
60
+ $script .= '
61
+ jQuery(\'a.fancybox-close\').on(\'click\',function(e){e.preventDefault();jQuery.fancybox.close()});';
62
+
63
+ foreach ( \easyFancyBox::$options as $key => $value ) {
64
+ // Check if not enabled or hide=true then skip.
65
+ if ( isset( $value['hide'] ) || ! isset( \easyFancyBox::$options['Global']['options']['Enable']['options'][$key]['id'] ) || ! \get_option( \easyFancyBox::$options['Global']['options']['Enable']['options'][$key]['id'], \easyFancyBox::$options['Global']['options']['Enable']['options'][$key]['default'] ) )
66
+ continue;
67
+
68
+ $script .= '
69
+ /* ' . $key . ' */';
70
+
71
+ /**
72
+ * Auto-detection routines (2x)
73
+ */
74
+ $autoAttribute = isset( $value['options']['autoAttribute'] ) ? \get_option( $value['options']['autoAttribute']['id'], $value['options']['autoAttribute']['default'] ) : '';
75
+
76
+ if ( !empty($autoAttribute) ) {
77
+ if ( is_numeric($autoAttribute) ) {
78
+ $script .= '
79
+ jQuery('.$value['options']['autoAttribute']['selector'].').not(\'.nofancybox,li.nofancybox>a\').addClass(\''.$value['options']['class']['default'].'\');';
80
+ } else {
81
+ // Set selectors.
82
+ $file_types = array_filter( explode( ',', str_replace( ' ', ',', $autoAttribute ) ) );
83
+ $more = 0;
84
+ $script .= '
85
+ var fb_'.$key.'_select=\'';
86
+ foreach ( $file_types as $type ) {
87
+ if ($type == "jpg" || $type == "jpeg" || $type == "png" || $type == "webp" || $type == "gif")
88
+ $type = '.'.$type;
89
+ if ($more>0)
90
+ $script .= ',';
91
+ $script .= 'a['.$value['options']['autoAttribute']['selector'].'"'.$type.'"]:not(.nofancybox,li.nofancybox>a),area['.$value['options']['autoAttribute']['selector'].'"'.$type.'"]:not(.nofancybox)';
92
+ $more++;
93
+ }
94
+ $script .= '\';';
95
+
96
+ $autoselector = class_exists('easyFancyBox_Advanced') ? \get_option($value['options']['autoSelector']['id'],$value['options']['autoSelector']['default']) : $value['options']['autoSelector']['default'];
97
+
98
+ // Class and rel depending on settings.
99
+ if( '1' == \get_option($value['options']['autoAttributeLimit']['id'],$value['options']['autoAttributeLimit']['default']) ) {
100
+ // Add class.
101
+ $script .= '
102
+ var fb_'.$key.'_sections=jQuery(\''.$autoselector.'\');
103
+ fb_'.$key.'_sections.each(function(){jQuery(this).find(fb_'.$key.'_select).addClass(\''.$value['options']['class']['default'].'\')';
104
+ // Set rel.
105
+ switch( \get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
106
+ case '':
107
+ default :
108
+ $script .= ';});';
109
+ break;
110
+
111
+ case '1':
112
+ $script .= '.attr(\'rel\',\'gallery-\'+fb_'.$key.'_sections.index(this));});';
113
+ break;
114
+
115
+ case '2':
116
+ $script .= '.attr(\'rel\',\'gallery\');});';
117
+ break;
118
+ }
119
+ } else {
120
+ // Add class.
121
+ $script .= '
122
+ jQuery(fb_'.$key.'_select).addClass(\''.$value['options']['class']['default'].'\')';
123
+ // Set rel.
124
+ switch( \get_option($value['options']['autoGallery']['id'],$value['options']['autoGallery']['default']) ) {
125
+ case '':
126
+ default :
127
+ $script .= ';';
128
+ break;
129
+
130
+ case '1':
131
+ $script .= ';
132
+ var fb_'.$key.'_sections=jQuery(\''.$autoselector.'\');
133
+ fb_'.$key.'_sections.each(function(){jQuery(this).find(fb_'.$key.'_select).attr(\'rel\',\'gallery-\'+fb_'.$key.'_sections.index(this));});';
134
+ break;
135
+
136
+ case '2':
137
+ $script .= '.attr(\'rel\',\'gallery\');';
138
+ break;
139
+ }
140
+ }
141
+ }
142
+ }
143
+
144
+ /**
145
+ * Generate .fancybox() bind.
146
+ */
147
+
148
+ // Prepare auto popup.
149
+ if ( $key == $autoClick )
150
+ $trigger = $value['options']['class']['default'];
151
+
152
+ $script .= '
153
+ jQuery(\'' . $value['options']['tag']['default'] . '\')';
154
+
155
+ // Use each() to allow different metadata values per instance; fix by Elron. Thanks!
156
+ $script .= '.each(function(){';
157
+
158
+ // Filter here.
159
+ $bind = 'jQuery(this).fancybox(jQuery.extend({},fb_opts,{';
160
+ $more = 0;
161
+ foreach ( $value['options'] as $_key => $_value ) {
162
+ if ( isset($_value['id']) || isset($_value['default']) )
163
+ $parm = isset($_value['id']) ? strval( \get_option($_value['id'], isset($_value['default']) ? $_value['default'] : '' ) ) : strval( $_value['default'] );
164
+ else
165
+ $parm = '';
166
+
167
+ if ( isset($_value['input']) && 'checkbox'==$_value['input'] )
168
+ $parm = ( '1' == $parm ) ? 'true' : 'false';
169
+
170
+ if ( !isset($_value['hide']) && $parm!='' ) {
171
+ $quote = ( is_numeric($parm) || ( isset($_value['noquotes']) && $_value['noquotes'] == true ) ) ? '' : '\'';
172
+ if ( $more > 0 )
173
+ $bind .= ',';
174
+ $bind .= '\''.$_key.'\':';
175
+ $bind .= $quote.$parm.$quote;
176
+ $more++;
177
+ }
178
+ }
179
+ $bind .= '}))';
180
+
181
+ $script .= \apply_filters( 'easy_fancybox_bind', $bind );
182
+
183
+ $script .= '});';
184
+ }
185
+
186
+ $script .= '
187
+ };};';
188
+
189
+ if ( empty( $delayClick ) ) $delayClick = '0';
190
+
191
+ switch ( $autoClick ) {
192
+ case '':
193
+ break;
194
+
195
+ case '1':
196
+ $script .= PHP_EOL . 'var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a#fancybox-auto,#fancybox-auto>a\').first().trigger(\'click\')},'.$delayClick.');};';
197
+ \easyFancyBox::$onready_auto = true;
198
+ break;
199
+
200
+ case '2':
201
+ $script .= PHP_EOL . 'var easy_fancybox_auto=function(){setTimeout(function(){if(location.hash){jQuery(location.hash).trigger(\'click\');}},'.$delayClick.');};';
202
+ \easyFancyBox::$onready_auto = true;
203
+ break;
204
+
205
+ case '99':
206
+ $script .= PHP_EOL . 'var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class|="fancybox"]\').filter(\':first\').trigger(\'click\')},'.$delayClick.');};';
207
+ \easyFancyBox::$onready_auto = true;
208
+ break;
209
+
210
+ default :
211
+ if ( ! empty( $trigger ) ) {
212
+ $script .= PHP_EOL . 'var easy_fancybox_auto=function(){setTimeout(function(){jQuery(\'a[class*="'.$trigger.'"]\').filter(\':first\').trigger(\'click\')},'.$delayClick.');};';
213
+ \easyFancyBox::$onready_auto = true;
214
+ }
215
+ }
216
+
217
+ $script .= PHP_EOL;
218
+
219
+ // Replace PDF embed shortcodes.
220
+ if ( ! empty( get_option('fancybox_enablePDF') ) && ! empty( get_option('fancybox_PDFonStart', '{{object}}') ) ) {
221
+ $replaces = array(
222
+ '{{object}}' => 'function(a,i,o){o.type=\'pdf\';}',
223
+ '{{embed}}' => 'function(a,i,o){o.type=\'html\';o.content=\'<embed src="\'+a[i].href+\'" type="application/pdf" height="100%" width="100%" />\'}',
224
+ '{{googleviewer}}' => 'function(a,i,o){o.href=\'https://docs.google.com/viewer?embedded=true&url=\'+a[i].href;}'
225
+ );
226
+ foreach ($replaces as $needle => $replace) {
227
+ $script = str_replace( $needle, $replace, $script );
228
+ }
229
+ }
230
+
231
+ \easyFancyBox::$inline_script = \apply_filters( 'easy_fancybox_inline_script', $script );
232
+
233
+ /**
234
+ * HEADER STYLES
235
+ */
236
+
237
+ // Customized styles.
238
+ $styles = '';
239
+ ! isset( $overlaySpotlight ) || 'true' !== $overlaySpotlight || $styles .= '#fancybox-overlay{background-attachment:fixed;background-image:url("' . \easyFancyBox::$plugin_url . 'images/light-mask.png");background-position:center;background-repeat:no-repeat;background-size:100% 100%}';
240
+
241
+ empty( $borderRadius ) || $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}';
242
+
243
+ $content_style = '';
244
+ empty( $backgroundColor ) || $content_style .= 'background:'.$backgroundColor.';';
245
+ empty( $paddingColor ) || $content_style .= 'border-color:'.$paddingColor.';';
246
+ if ( ! empty( $textColor ) ) {
247
+ $content_style .= 'color:'.$textColor.';';
248
+ $styles .= '#fancybox-outer{background:'.$paddingColor.'}'; //.fancybox-title-inside{background-color:'.$paddingColor.';margin-left:0 !important;margin-right:0 !important;width:100% !important;}
249
+ }
250
+ empty( $content_style ) || $styles .= '#fancybox-content{'.$content_style.'}';
251
+
252
+ empty( $titleColor ) || $styles .= '#fancybox-title,#fancybox-title-float-main{color:'.$titleColor.'}';
253
+
254
+ $styles .= '.fancybox-hidden{display:none}#fancybox-content .fancybox-hidden,#fancybox-tmp .fancybox-hidden{display:revert}';
255
+
256
+ empty( $styles ) || \easyFancyBox::$inline_style = \wp_strip_all_tags( $styles );
257
+
258
+ // Running our IE alphaimageloader relative path styles here.
259
+ if ( isset( $compatIE8 ) && 'true' == $compatIE8 ) {
260
+ \easyFancyBox::$inline_style_ie = '/* IE6 */
261
+ .fancybox-ie6 #fancybox-close{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_close.png",sizingMethod="scale")}
262
+ .fancybox-ie6 #fancybox-left-ico{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_nav_left.png",sizingMethod="scale")}
263
+ .fancybox-ie6 #fancybox-right-ico{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_nav_right.png",sizingMethod="scale")}
264
+ .fancybox-ie6 #fancybox-title-over{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_title_over.png",sizingMethod="scale");zoom:1}
265
+ .fancybox-ie6 #fancybox-title-float-left{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_title_left.png",sizingMethod="scale")}
266
+ .fancybox-ie6 #fancybox-title-float-main{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_title_main.png",sizingMethod="scale")}
267
+ .fancybox-ie6 #fancybox-title-float-right{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_title_right.png",sizingMethod="scale")}
268
+ #fancybox-loading.fancybox-ie6 div{background:transparent;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_loading.png",sizingMethod="scale")}
269
+ /* IE6, IE7, IE8 */
270
+ .fancybox-ie #fancybox-title-over{background-image:url('.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_title_over.png)}
271
+ .fancybox-ie #fancybox-bg-n{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_shadow_n.png",sizingMethod="scale")}
272
+ .fancybox-ie #fancybox-bg-ne{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_shadow_ne.png",sizingMethod="scale")}
273
+ .fancybox-ie #fancybox-bg-e{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_shadow_e.png",sizingMethod="scale")}
274
+ .fancybox-ie #fancybox-bg-se{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_shadow_se.png",sizingMethod="scale")}
275
+ .fancybox-ie #fancybox-bg-s{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_shadow_s.png",sizingMethod="scale")}
276
+ .fancybox-ie #fancybox-bg-sw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_shadow_sw.png",sizingMethod="scale")}
277
+ .fancybox-ie #fancybox-bg-w{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_shadow_w.png",sizingMethod="scale")}
278
+ .fancybox-ie #fancybox-bg-nw{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/fancy_shadow_nw.png",sizingMethod="scale")}
279
+ .fancybox-ie #fancybox-left, .fancybox-ie #fancybox-right{background-image:url("'.\easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/blank.gif");}';
280
+
281
+ if ( isset( $overlaySpotlight ) && 'true' == $overlaySpotlight )
282
+ \easyFancyBox::$inline_style_ie .= '
283
+ #fancybox-overlay{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'.\easyFancyBox::$plugin_url.'images/light-mask.png",sizingMethod="scale")}';
284
+ }
285
+ }
286
+
287
+ /**
288
+ * ACTIONS & FILTERS
289
+ */
290
+
291
+ function prepare_scripts_styles() {
292
+ // Make sure whe actually need to do anything.
293
+ if ( ! \easyFancyBox::add_scripts() ){
294
+ return;
295
+ }
296
+
297
+ // INLINE SCRIPT & STYLE
298
+ prepare_inline();
299
+
300
+ $min = ( defined('WP_DEBUG') && WP_DEBUG ) ? '' : '.min';
301
+
302
+ // STYLE URLS
303
+ \easyFancyBox::$style_url = \easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/jquery.fancybox'.$min.'.css';
304
+ \easyFancyBox::$style_ie_url = \easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/jquery.fancybox-ie'.$min.'.css';
305
+
306
+ // SCRIPT URLS
307
+
308
+ // Register main fancybox script.
309
+ \easyFancyBox::$script_url = \easyFancyBox::$plugin_url.'fancybox/'.FANCYBOX_VERSIONS['legacy'].'/jquery.fancybox'.$min.'.js';
310
+
311
+ // jQuery Easing, which is not needed if jQueryUI Core Effects are loaded or when using fancyBox 3.
312
+ if (
313
+ // Check IMG settings.
314
+ ( \get_option( 'fancybox_enableImg', \easyFancyBox::$options['Global']['options']['Enable']['options']['IMG']['default'] ) && ( 'elastic' === \get_option( 'fancybox_transitionIn', 'elastic' ) || 'elastic' === \get_option( 'fancybox_transitionOut', 'elastic' ) ) ) ||
315
+ // Check Inline Content settings.
316
+ ( \get_option( 'fancybox_enableInline', false ) && ( 'elastic' === \get_option( 'fancybox_transitionInInline' ) || 'elastic' === \get_option( 'fancybox_transitionOutInline' ) ) )
317
+ ) {
318
+ \easyFancyBox::$easing_script_url = \easyFancyBox::$plugin_url.'vendor/jquery.easing'.$min.'.js';
319
+ }
320
+
321
+ // jQuery Mousewheel, which is not needed if jQueryUI Mouse is loaded or when using fancyBox 3.
322
+ if ( \get_option( 'fancybox_mouseWheel', true ) ) {
323
+ \easyFancyBox::$mousewheel_script_url = \easyFancyBox::$plugin_url.'vendor/jquery.mousewheel'.$min.'.js';
324
+ }
325
+
326
+ // Metadata in Miscellaneous settings?
327
+ if ( \get_option( 'fancybox_metaData' ) ) {
328
+ \easyFancyBox::$metadata_script_url = \easyFancyBox::$plugin_url.'vendor/jquery.metadata'.$min.'.js';
329
+ }
330
+ }
331
+ \add_action( 'init', __NAMESPACE__.'\prepare_scripts_styles', 12 );
332
+
333
+ function onready_callback( $content ) {
334
+ $content .= 'jQuery(easy_fancybox_handler);jQuery(document).on(\'' . implode( " ", \easyFancyBox::$events ) . '\',easy_fancybox_handler);' . PHP_EOL;
335
+
336
+ if ( \easyFancyBox::$onready_auto )
337
+ $content .= \apply_filters( 'easy_fancybox_onready_auto', 'jQuery(easy_fancybox_auto);' );
338
+
339
+ return $content;
340
+ }
341
+ \add_filter( 'easy_fancybox_inline_script', __NAMESPACE__.'\onready_callback' );
js/jquery.fancybox.min.js DELETED
@@ -1 +0,0 @@
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}if("object"===typeof arguments[0]&&"click"===arguments[0].type){arguments[0].preventDefault()}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.find(M))}).on("fancybox-cancel",function(){l(this).replaceWith(D.find(M))});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";y.enableKeyboardNav=false;y.showNavArrows=false;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":y.enableKeyboardNav=false;y.showNavArrows=false;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){l("html").addClass("fancybox-active");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:a.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:a.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(a.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:'+(a.scrolling=="auto"?"auto":(a.scrolling=="yes"?"scroll":"hidden"))+'" src="'+a.href+'"'+(false===a.allowfullscreen?"":" allowfullscreen")+' allow="autoplay; encrypted-media" tabindex="999"></iframe>').appendTo(z).on("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(I==d){a.enableKeyboardNav=false;r.off("mousewheel.fb");i.hide();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(I==d){a.enableKeyboardNav=false;r.off("mousewheel.fb");v.hide();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,K;K=arguments[0]===true?0:a.margin;return[I-(K*2),J-(K*2),l(document).scrollLeft()+K,l(document).scrollTop()+K]},_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){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(K);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(J!=d&&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(J!=d&&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");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("html").removeClass("fancybox-active")};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(true);if(!J&&((r.width()+40)>I[0]||(r.height()+40)>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 id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),i=l('<a 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);
 
readme.txt CHANGED
@@ -1,760 +1,737 @@
1
- === Easy FancyBox ===
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: 6.0
7
- Stable tag: 1.8.19
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
- **GDPR / EU Privacy**
18
-
19
- This plugin does not collect any data and does not set any browser cookies. However, the PRO version offers an option to disable the automatic popup after the first visit, which needs a browser cookie. This cookie stores the visitors first website visit timestamp and path on the client side. It is not shared nor is any data stored server side or elsewhere.
20
-
21
- **FEATURES**
22
-
23
- Supported media and content types:
24
-
25
- - All common image formats _including_ webp
26
- - Hosted video on **Youtube**, **Vimeo** _and_ **Dailmotion**
27
- - PDF files (embed with object tag, in iframe or in external Google Docs Viewer)
28
- - SWF (Flash) files
29
- - SVG media images (thanks to Simon Maillard)
30
- - 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))
31
- - 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))
32
-
33
- Also supports:
34
-
35
- - WordPress Galleries (option "Link to" must be set to "Media File")
36
- - NextGEN galleries (see [instructions in the FAQs](https://wordpress.org/plugins/easy-fancybox#can%20nextgen%20gallery%20work%20with%20easy%20fancybox%20%3F))
37
- - Image maps
38
- - 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))
39
- - Jetpack Infinite Scroll
40
-
41
- Additional features:
42
-
43
- - Modal window option (see [instructions in the FAQs](https://wordpress.org/plugins/easy-fancybox#can%20i%20have%20a%20modal%20window%20%3F))
44
- - Automatic detection of media file links
45
- - Automatic detection of galleries
46
- - 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))
47
- - Fade or Elastic popup effects
48
- - Styling options for light box overlay (color and opacity) and window (border size and color)
49
-
50
- For **advanced options** and **priority support**, there is a **[Pro extension](https://premium.status301.com/downloads/easy-fancybox-pro/)** available. See Pro features below.
51
-
52
- 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.
53
-
54
- 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).
55
-
56
- Visit [FancyBox](http://fancybox.net/) for more information and examples.
57
-
58
- **PRO FEATURES**
59
-
60
- - Priority support on dedicated forum
61
- - Slideshow effect for galleries (autorotation)
62
- - Spotlight effect for the light box overlay
63
- - FacetWP, Gravity Forms and TablePress compatibility
64
- - More styling options: rounded corners, inline content background and text colors
65
- - More automatic popup options: triggered by URL hash, first link by media type, hide popup after first visit
66
- - 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))
67
- - More elastic (easing) popup effects on open and close
68
- - Show/hide image title on mouse hover
69
- - Fine-tune media link and gallery autodetection to match your theme source markup to allow galleries per post for example
70
-
71
- For these additional features, you need to install the **[Pro extension](https://premium.status301.com/downloads/easy-fancybox-pro/)** alongside this free plugin.
72
-
73
-
74
- = Contribute =
75
-
76
- 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).
77
-
78
- 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/).
79
-
80
- **KNOWN ISSUES**
81
-
82
- = General =
83
-
84
- - **Outbound click or Download tracking** in some of the stats plugins can interfere with FancyBox. Disable such options or exclude links manually with a class if possible (see instructions for SlimStat below)
85
- - Most plugins and themes that already include a light box script. Continue reading to see if you are using one of the know ones or follow the troubleshooting steps to find out what is conflicting on your site.
86
- - Any theme that is missing the obligatory `<?php wp_footer(); ?>` call in the footer.php template.
87
- - When showing an iframe as inline content in FancyBox -- not advised, use fancybox-iframe instead! -- the iframe will become blank after opening and closing it. The solution is to link directly to the iframe source and use `class="fancybox-iframe"` instead.
88
- - Embedded flash content that has no wmode or wmode 'window', is displayed above the overlay and other javascript rendered content like dropdown menus. WordPress does NOT check for missing wmode in oEmbed generated embed code. Since version 1.3.4.5, the missing wmode is added by this plugin for WP (auto-)embeds but not for other user-embedded content. Please make sure you set the wmode parameter to 'opaque' (best performance) or 'transparent' (only when you need transparency) for your embedded content.
89
-
90
- = Plugin conflicts =
91
-
92
- - Google Translate plugins like **GTranslate**, **Weglot** and **Google Language Translator** cause the light box to be off-center, pushed downward for logged-in users (with admin bar). A work-around: add `.admin-bar #fancybox-outer{margin-top:-32px}` to Custom CSS in your theme Customizer.
93
- - **WP Slimstat** and **Matomo/Piwik** with Track Outbound Clicks enabled, will break the light box effect on some browsers. Adding `fancybox` (or any of the other classes like `fancybox-youtube,fancybox-iframe,fancybox-inline` depending on which media should be displayed in FancyBox) to the Do Not Track field is reported to solve the issue. Slimstat also might interfere with the YouTube url conversion. When clicking a Youtube link, the movie opens in an overlay as it is supposed to but immediately after that, the complete page gets redirected to the original YouTube page. Adding a `class="noslimstat"` to the link is reported to work around the issue.
94
- - **Google Analytics for WordPress** converts links like `href="#anyID"` to `href="http://yoursite.url/page/#anyID"`, disabling inline content shown in FancyBox.
95
- - Both the **uBillBoard** and **Camera slideshow** have their own easing script hard-coded which conflicts with the one in Easy FancyBox. The only way around the conflict is to set both the Easing In and Easing Out options on your Settings > Media page to **Swing**.
96
- - **Wordpress Firewall 2** blocks access to image files needed for proper display of the FancyBox overlay in older IE and other non-css3 browsers.
97
- - **WordPress Amazon Associate**: A script provided by Amazon and the FancyBox script are incompatible. Disabling _Product Preview_ in the **WP - Amazon > Settings** page should work around the issue.
98
- - **WP Supersized** uses the Animate Enhanced jQuery extension which causes a conflict with the Easing extension used by FancyBox resulting in a 0px sized lightbox frame and/or some kind of positioning issue with auto-centering.
99
-
100
- = Theme conflicts =
101
-
102
- - Older versions of **Elegant Themes** have FancyBox integrated in a hard-coded way, making them incompatible with Easy FancyBox. In the latest versions of these themes, there is an option to disable the included FancyBox. Use this option to make your theme compatible with Easy FancyBox :)
103
- - The **Mystique** theme has two options called "Lightbox" and "Optimize website for faster loading" that will break Easy FancyBox. Disable both in Mystique's options > Advanced.
104
- - **Imbalance** and other themes that uses the Photo Galleria jQuery extension: turn of the JSGallery option.
105
- - Themes like **Envisioned**, **Chameleon** and many others have FancyBox baked in. There is no solution other than stripping the theme of all FancyBox related code or better: disable the plugin and use the theme provided version...
106
- - Themes based on the **Thesis** framework might see issues in IE 8, for which [a hack has been proposed](https://voidzonemedia.com/solutions/thesis-ie8-remove-ie7-emulation/)
107
-
108
-
109
- == Installation ==
110
-
111
- = Wordpress =
112
-
113
- Quick installation: [Install now](https://coveredwebservices.com/wp-plugin-install/?plugin=easy-fancybox) !
114
-
115
- &hellip; OR &hellip;
116
-
117
- Search for "easy fancybox" and install with that slick **Plugins > Add New** back-end page.
118
-
119
- &hellip; OR &hellip;
120
-
121
- Follow these steps:
122
-
123
- 1. Download archive.
124
-
125
- 2. Upload the zip file via the Plugins > Add New > Upload page &hellip; OR &hellip; unpack and upload with your favorite FTP client to the /plugins/ folder.
126
-
127
- 3. Activate the plugin on the Plug-ins page.
128
-
129
- Done! By default, any images that are linked to directly (not to a WordPress page) from within your posts and pages, should now be opening in a FancyBox overlay :)
130
-
131
- Not happy with the default settings? Check out the new options under **Settings > Media**.
132
-
133
- = Wordpress MU / WordPress 3+ in Multi Site mode =
134
-
135
- Same as above but do a **Network Activate** to activate FancyBox image overlays on each site on your network. No database tables are created or manipulated and no activation hook needs to be run for it to function with default settings.
136
-
137
-
138
- == Frequently Asked Questions ==
139
-
140
- = BASIC =
141
-
142
- = What's FancyBox? =
143
-
144
- Basically, it is a fancy way of presenting images, movies, portable documents and inline content on your website. For example, if you have scaled-down images in your posts which are linked to the original large version, instead of opening them on a blank page, FancyBox opens those in a smooth overlay. Visit [FancyBox](http://fancybox.net/) for more information and examples.
145
-
146
-
147
- = Which version of FancyBox does this plugin use? =
148
-
149
- This plugin uses an **updated version** of the original [FancyBox 1.3.4](http://fancybox.net), better adapted to the mobile era.
150
-
151
-
152
- = I installed the plugin. What now? =
153
-
154
- First, make sure that image thumbnails in your posts and pages are linked to their full size counterpart directly. Open any post with thumbnail images in it for editing and select the first thumbnail. Click the **Edit Image** button that appears and choose **Link To: Media File**. From now on, clicking that thumbnail should open the full size version in FancyBox.
155
-
156
- The same thing goes for WordPress Galleries. Choose **Link To: Media File** when inserting a gallery tag.
157
-
158
-
159
- = Where is the settings page? =
160
-
161
- 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](https://wordpress.org/plugins/easy-fancybox/screenshots/) ...
162
-
163
-
164
- = Help! It does not work... =
165
-
166
- 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](https://wordpress.org/support/plugin/easy-fancybox) or go to the [development site](https://status301.net/wordpress-plugins/easy-fancybox/)
167
-
168
-
169
- = ADVANCED =
170
-
171
- = Will a WordPress gallery be displayed in a FancyBox overlay? =
172
-
173
- 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" ]`.
174
-
175
-
176
- = The lightbox does not look good on mobile devices. What can I do about that? =
177
-
178
- 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**.
179
-
180
-
181
- = Can I make a slideshow from my gallery? =
182
-
183
- In the [Pro extension](https://premium.status301.com/downloads/easy-fancybox-pro/), there is an Advanced option called "Gallery Auto-rotation" for that.
184
-
185
-
186
- = Can I exclude images or other links from auto-attribution? =
187
-
188
- Yes. All links with class **nolightbox** that would normally get auto-enabled, will be excluded from opening in a FancyBox overlay.
189
-
190
- `<a href="url/to/fullimg.jpg" class="nolightbox"><img src="url/to/thumbnail.jpg" /></a>`
191
-
192
-
193
- = Can NextGEN Gallery work with Easy FancyBox ? =
194
-
195
- 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.
196
-
197
- 1. Go to your Settings > Media admin page and switch OFF the FancyBox "Auto-gallery" option in the Images section;
198
- 1. Go to Gallery > Other Options and set the Lightbox Effects option to "Custom" and click on **Show Advanced Settings**;
199
- 1. fill the Code field with
200
- `class="fancybox" rel="%GALLERY_NAME%"`
201
- 1. Leave the other fields empty and save your settings.
202
-
203
-
204
- = Can I use ONE thumbnail to open a complete gallery ? =
205
-
206
- It can be done manually (using the internal WordPress gallery feature, or not) _or_ in combination with NextGen Gallery.
207
-
208
- **Manual**
209
-
210
- **A.** Open your post for editing in HTML mode and insert the first image thumbnail in your post content (linking to the images file, not page) to serve as the gallery thumbnail.
211
-
212
- **B.** Place the following code to start a hidden div containing all the other images that should only be visible in FancyBox:
213
- `
214
- <div class="fancybox-hidden">
215
- `
216
-
217
- **C.** Right after that starting on a new line, insert all other images you want to show in your gallery. You can even use the WordPress internal gallery feature with the shortcode `[ gallery link="file" ]`. NOTE: if the gallery thumbnail is attached to the post, it will be show a second time when flipping through the gallery in FancyBox. If you do not want that, use an image that is not attached to the post as gallery thumbnail.
218
-
219
- **D.** Close the hidden div with the following code on a new line:
220
- `
221
- </div>
222
- `
223
-
224
- **With NextGEN Gallery**
225
-
226
- You can choose between two shortcodes to show a gallery that (1) limits images per gallery using the shortcode `[nggallery id=x]` or (2) per tag name (accross galleries; you need to set tag name manually => more work but more control) using the shortcode `[nggtags gallery=YourTagName,AnotherTagName]`.
227
-
228
- General steps:
229
-
230
- **A.** Place the shortcode of your choice in your page/post content.
231
-
232
- **B.** Configure NextGen on **Gallery > Gallery Settings** to Display galleries as "NextGEN Basic Thumbnails" and then under the NextGEN Basic Thumbnails to at least have the following options set like this:
233
-
234
- 1. Number of images per page: 1
235
- 1. Use imagebrowser effect: No
236
- 1. Add hidden images: Yes
237
-
238
- **C.** Optional: add the following new CSS rule to your theme stylesheet (or install [Custom CSS](https://wordpress.org/plugins/safecss/) or [Jetpack](https://wordpress.org/plugins/jetpack/) and add it on the new Appearance > Edit CSS admin page) to hide the page browsing links below the gallery thumbnail.
239
- `
240
- .ngg-navigation {
241
- display:none;
242
- }
243
- `
244
-
245
- = Can I play YouTube, Dailymotion and Vimeo movies in a FancyBox overlay? =
246
-
247
- Yes. Simply create a link using the Share URL (the full Page URL, the Short URL with or without options like HD etc.) to the YouTube/Vimeo/Dailymotion page in your post content. If you have Auto-detect enabled, the plugin will take care of the rest for you! :)
248
-
249
- If you have disabled Auto-detection, give the link a class attribute like `class="fancybox-youtube"` for Youtube, `class="fancybox-vimeo"` for Vimeo and `class="fancybox-dailymotion"` for Dailymotion, to manually enable FancyBox for it.
250
-
251
- Both YouTube and Vimeo movies can be made to play immediately after opening by adding the paramer `autoplay=1` to the URL. For example, a short-url YouTube link that should play in HD mode, have the full screen button and auto-start on open, would look like:
252
- `
253
- <a href="https://youtu.be/N_tONWXYviM?hd=1&fs=1&autoplay=1">text or thumbnail</a>
254
- `
255
-
256
-
257
- = I want that 'Show in full-screen' button on my YouTube movies =
258
-
259
- Append `&fs=1` to your YouTube share URL.
260
-
261
-
262
- = Can I show a Youtube playlist in FancyBox? =
263
-
264
- Yes, just go to Youtube page of any movie that's in the playlist and use the Share button to get the share URL just like with single movies, but this time place a checkmark at the 'Share with playlist' option.
265
-
266
-
267
- = Can I link a NextGEN thumbnail to a Youtube movie in FancyBox? =
268
-
269
- User Mark Szoldan shared a neat trick how to do this:
270
-
271
- 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.
272
- 1. Then give the image that you want to link to a Youtube movie the URL to the Youtube page as title.
273
- 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...
274
-
275
- `
276
- <script type="text/javascript">
277
- jQuery('.fancybox [title*="www.youtube.com"]').each(function() {
278
- var title = jQuery(this).attr('title');
279
- var desc = jQuery(this).parent().attr('title');
280
- jQuery(this).attr('title', desc);
281
- jQuery(this).parent().attr('href', title);
282
- });
283
- </script>
284
- `
285
-
286
- This script snippet will scan the image titles and if it finds a Youtube URL there, it will replace the links href attribute value accordingly.
287
-
288
-
289
- = Can I create a gallery of Youtube thumbnails which open in FancyBox? =
290
-
291
- You could do this manually by uploading individual thumbnails that you can retrieve by using the unique movie ID in these URLs for three different sizes:
292
- `
293
- https://img.youtube.com/vi/UNIQUE-MOVIE-ID/default.jpg
294
- https://img.youtube.com/vi/UNIQUE-MOVIE-ID/mqdefault.jpg
295
- https://img.youtube.com/vi/UNIQUE-MOVIE-ID/hqdefault.jpg
296
- `
297
- Other locations might be
298
- `
299
- https://img.youtube.com/vi/UNIQUE-MOVIE-ID/0.jpg (same as hqdefault.jpg)
300
- https://img.youtube.com/vi/UNIQUE-MOVIE-ID/1.jpg
301
- https://img.youtube.com/vi/UNIQUE-MOVIE-ID/2.jpg
302
- https://img.youtube.com/vi/UNIQUE-MOVIE-ID/3.jpg
303
- https://img.youtube.com/vi_webp/UNIQUE-MOVIE-ID/0.webp (same as hqdefault.webp)
304
- etc...
305
-
306
- `
307
-
308
- But an easier method is this one, shared by Shashank Shekhar (thanks!) :
309
-
310
- To create Youtube thumbnail galleries, install https://wordpress.org/plugins/youtube-simplegallery/ and set the 'Effect' option to fancybox. Then disable Youtube autodetection on Settings > Media.
311
-
312
-
313
- = Can I display web pages or HTML files in a FancyBox overlay? =
314
-
315
- Yes. First, enable the iFrame option on Settings > Media. Then, in your post or page content create a link to any web page or .htm(l) file in your content. Then switch to the Text tab in the Classic Editor or to Edit as HTML (under More options in the block menu) in Gutenberg, find the link `<a ... >` tag and give it a `class="fancybox-iframe"` attribute.
316
-
317
- Note: Not all external web pages are allowed to be embedded in an iframe and may be blocked by a server response header or script. The result will be either an empty/blank light box or the target page "breaking out" of the light box and loading in the main browser tab.
318
-
319
-
320
- = Can I show PDF files in a FancyBox overlay? =
321
-
322
- Yes. Just place a link _with the URL ending in .pdf_ to your Portable Document file in the page content.
323
-
324
- If you don't have *Auto-detect* checked under **PDF** on Settings > Media admin page, you will need to add `class="fancybox-pdf"` (to force pdf content recognition) to the link to enable FancyBox for it.
325
-
326
-
327
- = Can I play SWF files in a FancyBox overlay? =
328
-
329
- Yes. Just place a link _with the URL ending in .swf_ to your Flash file in the page content.
330
-
331
- If you don't have *Auto-detect* checked under **SWF** on Settings > Media admin page, you will need to add either `class="fancybox"` or `class="fancybox-swf"` (to force swf content recognition) to the link to enable FancyBox for it.
332
-
333
-
334
- = How do I show content with different sizes? =
335
-
336
- FancyBox tries to detect the size of the content automatically but if it can not find a size, it will default to the settings for that particular content type as set on the Settings > Media page.
337
-
338
- The **[Pro extension](https://premium.status301.com/downloads/easy-fancybox-pro/)** provides an extra option to allow you to manually override this by defining the width and height wrapped in curly braces in the class attribute of the link itself. Make sure the option "Include the Metadata jQuery extension script..." under FancyBox | Miscellaneous | Advanced on Settings > Media is enabled.
339
-
340
- For example, a Flash movie with different size:
341
-
342
- `
343
- <a class="fancybox-swf {width:1024,height:675}" href="link-to-your-swf"></a>
344
- `
345
-
346
- = The flash movie in the overlay shows BELOW some other flash content that is on the same page! =
347
-
348
- Make sure the OTHER flash content as a **wmode** set, preferably to 'opaque' or else 'transparent' but never 'window' or missing. For example, if your embedded object looks something like:
349
- `
350
- <object type="application/x-shockwave-flash" width="200" height="300" data="...url...">
351
- <param name="allowfullscreen" value="true" />
352
- <param name="allowscriptaccess" value="always" />
353
- <param name="movie" value="...url..." />
354
- </object>
355
- `
356
- just add `<param name="wmode" value="opaque" />` among the other parameters. Or if you are using an embed like:
357
- `
358
- <object width="640" height="385">
359
- <param name="movie" value="...url..."></param>
360
- <param name="allowFullScreen" value="true"></param>
361
- <param name="allowscriptaccess" value="always"></param>
362
- <embed src="...url..." type="application/x-shockwave-flash" width="640" height="385" allowscriptaccess="always" allowfullscreen="true" wmode="window"></embed>
363
- </object>
364
- `
365
- just change that `wmode="window"` to `wmode="opaque"` or add the attribute if it is missing.
366
-
367
-
368
- = How can I display INLINE content in a FancyBox overlay ? =
369
-
370
- First go to your **Settings > Media** admin page and activate the **Inline** option under the FancyBox settings. After saving, the amin page will show a new section called Inline where you can tweak its parameters.
371
-
372
- Next, open your page/post for editing in the HTML tab and wrap the inline content in
373
- `
374
- <div style="display:none" class="fancybox-hidden"><div id="fancyboxID-1" class="hentry" style="width:460px;max-width:100%;">
375
- ...inline content here...
376
- </div></div>
377
- `
378
-
379
- Then place a FancyBox link tag with class attribute "fancybox-inline" anywhere else in the post/page content that will point to the inline content like
380
- `
381
- <a href="#fancyboxID-1" class="fancybox-inline">Read my inline content</a>
382
- `
383
-
384
- NOTE: The wrapping divs ID *must* be unique and it must correspond with the links HREF with a # in front of it. When using the above example for more FancyBox inline content (hidden div + opening link) combinations on one page, give the second one the ID fancyboxID-2 and so on...
385
-
386
- NOTE 2: If you find that the inline content shown in FancyBox is styled very different than the rests of the page content, then you might want to change the div tag attribute `class="hentry"` to something else that matches your theme. Find out what class name is used for the main content on your site and re-use that.
387
-
388
-
389
- = Can I display a contact form in FancyBox? =
390
-
391
- Yes. There are several methods imaginable but the easiest would be to use the Inline method. First go to your Settings > Media admin page and enable the Inline Content option. Next, go back to edit your post or page in the Text editor tab. The inline content can be a shortcode like in this example using Contact Forms 7 and Easy FancyBox:
392
-
393
- `
394
- <a href="#contact_form_pop" class="fancybox-inline">Contact Us</a>
395
-
396
- <div style="display:none" class="fancybox-hidden">
397
- <div id="contact_form_pop" class="hentry" style="width:460px;max-width:100%;">
398
- [contact-form-7 id="87" title="Contact form 1"]
399
- </div>
400
- </div>
401
- `
402
- 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.
403
-
404
-
405
- = Can I make an image or hidden content to pop up in FancyBox on page load? =
406
-
407
- 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.
408
-
409
- Use the instructions above for inline content but this time give the link also `id="fancybox-auto"` (leave the class too) and remove the anchor text to hide it. Now the hidden div content will pop up automatically when a visitor opens the page.
410
-
411
- 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...
412
-
413
-
414
- = Can I have a modal window ? =
415
-
416
- 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.
417
-
418
- This means there is NO option to close the light box, unless you create a link like this inside the hidden inline content div:
419
-
420
- `
421
- <a href="" class="fancybox-close">Accept</a>
422
- `
423
-
424
-
425
- = Can I make a menu item open in a FancyBox overlay ? =
426
-
427
- 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:
428
-
429
- 1. Go to Settings > Media and enable FancyBox iFrame support.
430
- 2. Go to Appearance > Menus and open the little tab "Screen Options" in the top-right corner.
431
- 3. Enable the option "CSS Classes" under Advanced menu properties.
432
- 4. Now give the menu item you want to open in a FancyBox iframe the class `fancybox-iframe`.
433
-
434
- 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"` attribute.
435
-
436
-
437
- = How can I make AJAX loaded content be seen by FancyBox ? =
438
-
439
- 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.
440
-
441
- 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.
442
-
443
- You can trigger the event like this:
444
- `
445
- jQuery(document.body).trigger('post-load');
446
- `
447
-
448
- 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.
449
-
450
-
451
- = Is Easy FancyBox multi-site compatible? =
452
-
453
- Yes. Designed to work with **Network Activate** and does not require manual activation on each site in your network.
454
-
455
-
456
- = TROUBLE SHOOTING =
457
-
458
- If, after activation, your images do not open in a FancyBox overlay, there are several possible reasons. Some are easily solved, others are more difficult. Follow these basic checks to make sure everything is in place:
459
-
460
- = Basic checks =
461
-
462
- 1. Make sure that thumbnail images are linked *directly* to their larger counterpart, not to a dynamic WordPress page that includes the larger image. This means when you insert an image in your posts or pages, you need to select **Media File** at the Link option instead of Page URL. You'll have to manually edit your old posts if you have always inserted images with `Page URL` before, FancyBox cannot do this for you.
463
- 1. Make sure you have all the needed media and their *Auto-detect* options activated on your **Settings > Media** admin page. If you are using images in other formats that JPG, GIF or PNG, you need to add the extensions to the Auto-detect field for Images. Please note: The image file names must actaully _end_ with that extension! This means that if you have an image file that (for example) has _no_ extension (does not end with .jpg or any other) even if is in JPEG compressed format, the FancyBox will not be able to detect is as an image. You will need to manually give those links the class `fancybox image` to trigger FancyBox.
464
-
465
- = General trouble shooting steps =
466
-
467
- 1. Switch off all other plugins and switch your sites appearance to the default Twenty Seventeen theme. FancyBox should work now. If so, continue with the next step. If not, re-install the plugin and verify the basic steps above.
468
- 1. Switch back to your original theme and check if FancyBox is still working. If so, continue with the next step. If not, See the Theme Incompatibility checks below.
469
- 1. One by one, switch each plugin that you had running before back ON. Keep checking to see at which point FancyBox starts failing and you will hve found the conflicting plugin.
470
-
471
- = Theme Incompatibility checks =
472
-
473
- 1. See known theme conflicts above first, then continue with these following steps.
474
- 1. Make sure your theme is capable of placing the needed javascript and css in the page header and footer. Open any page on your site and view the source code by right-clicking on an empty section and selecting 'View source...' (or similar). There you will need to check of there are any references to javascript files like `jquery.fancybox.min.js?ver=x.x.x` near the closing `</body>` tag. There should also be a `easy-fancybox.min.css?ver=x.x.x` in the head section... If it's not there, your theme is really out of date. Consider switching to a new theme fast!
475
- 1. Make sure that your theme does not load the main jQuery library file more than once. Look for references to javascript files like `jquery.js?ver=x.x.x` or `jquery.min.js` in the page source code. If you find more than one, try to find out in which theme template file that second reference is hard-coded and remove that line. Usually in header.php or footer.php
476
- 1. Check if your theme loads another or the same lightbox script. Look for references to Thickbox, Prettyphoto, Lightbox2, Colorbox or FancyBox script files or code. These are very likely to cause the incompatibility and you will either have to remove these by hacking your theme or switch to another theme.
477
-
478
- If you still do not get to see your images in FancyBox, ask on the [Easy FancyBox WordPress forum](https://wordpress.org/tags/easy-fancybox) or go to the [development site](https://status301.net/wordpress-plugins/easy-fancybox/)
479
-
480
- = Plugin Incompatibility checks =
481
-
482
- 1. If you followed the general trouble shooting steps above, you should now be aware of which plugin is conflicting whith Easy FancyBox. See known plugin conflicts above first. If the plugin and its solution are not mentioned there, continue with the following steps.
483
- 1. Make sure that the plugins do not make the main jQuery library file load more than once. Look for references to javascript files like `jquery.js?ver=x.x.x` or `jquery.min.js` in the page source code. If you find more than one, try to find out where that comes from.
484
- 1. Check if your theme loads another or the same lightbox script or any other of the needed jQuery extensions like jquery.easing or jquery.mousewheel. Look for references to Thickbox, Prettyphoto, Lightbox2, Colorbox or FancyBox script files or code. These are very likely to cause the incompatibility and you will have to either find a setting in the other plugin to switch OFF the use of the conflicting script (possible in NextGEN for example, see under Advanced below) or choose between the two conflicting plugins.
485
-
486
-
487
- == Screenshots ==
488
-
489
- 1. Example image with **Overlay** caption. This is the default way Easy FancyBox displays images. Other options are **Inside** and the old **Outside**.
490
-
491
- 2. Example of a YouTube movie in overlay.
492
-
493
-
494
- == Upgrade Notice ==
495
-
496
- = 1.8.19 =
497
-
498
- Admin settings links, new Exclude selector option.
499
-
500
- == Changelog ==
501
-
502
- = 1.8.19 =
503
- * Admin settings links
504
- * Pro compatibility message for VideoPress
505
- * NEW: Exclude selector option
506
- * FIX: border 0 ignored sometimes
507
-
508
- = 1.8.18 =
509
- * FIX: Jetpack Tiled Gallery block compatibility
510
- * Don't include mousewheel script by default
511
- * SECURITY: fixed failing color value sanitization + added inline styles output filter, issue reported by Jakob Hagl sba-research.org
512
-
513
- = 1.8.17 =
514
- * Pro compatibility messages
515
- * Support forum link
516
-
517
- = 1.8.16 =
518
- * FIX: Trying to get property 'ID' of non-object
519
- * mark WordPress 5.2 compatible
520
-
521
- = 1.8.15 =
522
- * FIX: inline wrapper nesting issue
523
- * Revert to file names without version
524
-
525
- = 1.8.13 =
526
- * FIX: version constant issue
527
- * Prepare Visual Composer Masonry Grid Gallery compatibility option
528
-
529
- = 1.8.11 =
530
- * FIX: Vimeo player direct links breaking
531
-
532
- = 1.8.10 =
533
- * Force default autoselector for galleries
534
-
535
- = 1.8.9 =
536
- * Prevent gallery next/prev links to show dud target
537
- * FIX: allow youtube url parameters before v=
538
-
539
- = 1.8.7 =
540
- * Autoplay Youtube/Vimeo/Dailymotion
541
- * FIX: Exclude Vimeo user pages from autodetect
542
- * FIX: Exclude facebook/twitter share link
543
- * FIX: PDF embed tag
544
-
545
- = 1.8.6 =
546
- * Gutenberg file block download button compatibility
547
- * Gutenberg gallery block compatibility
548
- * FIX: Missing argument in easyFancyBox::add_video_wmode_opaque()
549
- * Remove version URL parameters
550
- * FIX: jQuery 3+ e.indexOf is not a function
551
-
552
- = 1.8.5 =
553
- * FIX: prevent Inline content title
554
-
555
- = 1.8.4 =
556
- * Improved center on scroll behavior with title outside
557
- * FIX: Pro options compatibility
558
-
559
- = 1.8.3 =
560
- * FIX: AutoScale option restored
561
- * FIX: outline issue in Firefox
562
- * Prevent SiteGround Optimizer warning about break outside loop
563
-
564
- = 1.8.2 =
565
- * FIX: main method not returning true in some cases
566
- * Force all hosted video to https
567
- * FIX: video iframe needs allow="autoplay" on modern browsers
568
- * FIX: default enqueue priority not 10
569
- * FIX: possible infinite loop in prev/next and image preloader
570
- * Move main method (back) to init, position 9
571
- * Introducing easy_fancybox_enqueue_scripts action hook
572
-
573
- = 1.8 =
574
- * NEW: Google Docs Viewer for PDF
575
- * NEW: Youtube privacy-enhanced embed
576
- * NEW: Compatibility options: late script inclusion, jquery exclusion, no wp_add_inline_script
577
- * FancyBox: Improved mobile viewport height detection
578
- * FancyBox: now skips subsequent double links in gallery
579
- * FancyBox: new PDF content type
580
- * FancyBox: improved error messages
581
- * Dedicated IE8 stylesheet
582
- * jQuery Easing update to 1.4.1
583
-
584
- = 1.7 =
585
- * NEW: Aspect ratio for video frames on smaller screens
586
- * NEW: Global minimum screen size
587
- * NEW: Loading icon for video/iframe content
588
- * NEW: Resize light box on device orientation or browser window size change
589
- * NEW: Modal window class and close button class
590
- * FIX: pre PHP 5.4 compatibility
591
- * FIX: iPhone iframe scrolling
592
- * FIX: Autoptimize compatibility
593
- * Switch to wp_add_inline_script() script printing, thanks @szepeviktor
594
-
595
- = 1.6.3 =
596
- * FIX: inline js minification incompatibility, thanks @alexiswilke
597
-
598
- = 1.6.2 =
599
- * FIX: line breaks hidden on options media admin page since WP 4.9, thanks @garrett-eclipse
600
-
601
- = 1.6.1 =
602
- * Nolightbox class in menu also for other media types than images
603
- * FIX: CSS color code
604
- * Spelling fixes, thanks @garrett-eclipse
605
- * FIX: Pinterest button compatibility
606
- * FIX: Double load plugin text domain
607
-
608
- = 1.6 =
609
- * Add webp to default Autodetect image types
610
- * Exclude more rel attribute values from galleries
611
- * BUGFIX: gallery preload
612
- * Update jquery.easing.js and jquery.mousewheel.js
613
-
614
- = 1.5.8.2 =
615
- * BUGFIX: use dirname(__FILE__) instead of relying on __DIR__ to be available
616
- * Explicit transparency for gallery navigation links
617
-
618
- = 1.5.8 =
619
- * FIX: variable variable php 7 compat
620
- * FIX: obj undefined in minified js
621
- * FIX: nofancybox in menu ignored, thanks Trishah
622
- * Color value sanitize
623
- * NEW: auto popup delay
624
- * NEW: pro extension version compatibility check routine
625
- * NEW: margin option
626
- * NEW: iFrame alow full screen option
627
- * Dropped mu-plugins support
628
- * Added support for universal nolightbox class
629
- * Set focus on iframe after load
630
- * FIX: No center on scroll on touch devices
631
- * FIX: Allow fullscreen videos
632
-
633
- = 1.5.7 =
634
- * FIX: Pro extension link update
635
- * NEW: WebP support and class='image' to force image media type
636
- * IE 6-8 css rules optional
637
- * iframe embed for Youtube, Vimeo and Dailymotion
638
- * Croation translation
639
- * HTML5 players allowfullscreen default
640
-
641
- = 1.5.6 =
642
- * iPad positioning patch
643
- * Don't unregister scripts that are not ours even for conflict prevention
644
- * box-sizing: border-box issue in Firefox fixed
645
- * Allow mousewheel scrolling page in the background again
646
-
647
- = 1.5.5 =
648
- * Prevent mousewheel scrolling page in the background
649
- * New stylesheet IE alphaimageloader path fix approach
650
- * Czech translation added
651
- * Updated Indonesian translation
652
-
653
- = 1.5.2 =
654
- * BUGFIX: easy_fancybox_handler() in combo with trigger('click') causes Uncaught Exception script error
655
-
656
- = 1.5.1 =
657
- * FIX: jQuery 1.9+ compatibility
658
- * Dropping support for gForms again -- "Cannot convert 'c' to object" error in combination with some older gForms version :(
659
- * NEW: support for Infinite Scroll by Jetpack
660
-
661
- = 1.5.0 =
662
- * FIX: CSS3 box-sizing issue (Twenty Thirteen) misplacing close button
663
- * NEW: Added SVG support. Thanks to Simon Maillard.
664
- * Pre WP 3.6: jQuery 1.9+ compatibility
665
- * JQuery Mousewheel extension update to 3.1.3
666
- * NEW: Elegant Themes compatibility
667
- * Some small Touch device compatibility improvement hacks to the 1.3.4 script
668
- * Major plugin overhaul: Class implementation
669
- * NEW: Disable hide on overlay click
670
- * NEW: Allow automatic resizing to large image size set on Settings > Media during media upload via the hidden WordPress function media_upload_max_image_resize()
671
- * NEW Options: iFrame scrolling, autoScale, key navigation/close, cyclic galleries
672
- * Metadata custom parameters and Mousewheel gallery scrolling scripts optional
673
- * Basic RTL languages/text direction support (gallery navigation inversion, title position)
674
- * BUGFIX: https in stylesheet on Windows IIS
675
- * Improved W3TC compatibility: query string issue
676
- * Gravity Forms in ajax mode compatibility
677
- * Use jQuery's bind('ready') for better ajax content compatibility
678
- * Dynamic stylesheet response headers to allow browser caching
679
- * Minified version of jquery.metadata.js
680
- * Auto-detect on image map areas
681
- * nolightbox class for menu items
682
- * SECURITY: Settings sanitization
683
- * BUGFIX: load_textdomain firing after the main settings array is loaded, leaving text strings in it untranslated.
684
- * BUGFIX: missing signs in Youtube url regular expression
685
- * BUGFIX: unquoted rel attribute selectors in jquery.fancybox-1.3.4.js
686
- * BUGFIX: broken url path in IE stylesheet when missing $_SERVER['SERVER_NAME']
687
- * BUGFIX: easing extension not needed on linear easing
688
-
689
- = 1.3.4.9 =
690
- * NEW: Lithuanian translation
691
- * NEW: Hindi translation
692
- * NEW: Indonesian translation
693
- * NEW: Romanian translation
694
- * NEW: Polish translation
695
- * NEW: Spanish translation
696
- * NEW: jQuery Metadata support
697
- * NEW: Image map AREA support for all content types
698
- * NEW: new iFrame/HTML5 embed code for YouTube, Vimeo and Dailymotion
699
- * NEW: fix WordPress Dailymotion auto-embed code missing wmode
700
- * Some changes to default settings
701
- * Updated Dutch translation
702
- * BUGFIX: Opening speed
703
-
704
- = 1.3.4.8 =
705
- * NEW: Advanced option: Gallery auto-rotation
706
- * NEW: Spotlight effect
707
- * Improved auto-enable and auto-gallery settings
708
- * BIGFIX: CSS IE6 hack
709
- * BIGFIX: PDF object in IE7
710
-
711
- = 1.3.4.6 =
712
- * PDF embed compatibility improvement
713
- * NEW: Show/hide title on mouse hover action
714
- * NEW: Auto-gallery modes (Disabled, page/post images only, all)
715
- * NEW: Dailymotion support
716
- * Links with id **fancybox-auto** will be triggered on page load
717
- * Anything with class **fancybox-hidden"** will be hidden
718
- * Support for menu items in iframe
719
- * Added class **nofancybox** for exclusion when auto-enabling
720
-
721
- = 1.3.4.5 =
722
- * FancyBox script version 1.3.4 (2010/11/11 - http://fancybox.net/changelog/)
723
- * NEW: Support for PDF
724
- * NEW: Easing options
725
- * YouTube, Vimeo and iFrame options adjustable
726
- * lots and lots of more options!
727
- * BIGFIX: work-around for missing wmode in WordPress (auto-)embedded movies (credits: Crantea Mihaita)
728
-
729
- = 1.3.3.4.2 =
730
- * BIGFIX: iframe width
731
- * BIGFIX: image overlay size in Google Chrome browser issue (FancyBox 1.3.3)
732
- * BIGFIX: fancybox-swf
733
-
734
- = 1.3.3.4 =
735
- * FancyBox script version 1.3.3 (2010/11/4 - http://fancybox.net/changelog/)
736
- * Vimeo support
737
- * YouTube Short URL support (disabled by default)
738
- * Auto-recognition and seperate class `fancybox-youtube` for YouTube
739
- * Auto-recognition and seperate class `fancybox-vimeo` for Vimeo
740
-
741
- = 1.3.2 =
742
- * FancyBox script version 1.3.2 (2010/10/10 - http://fancybox.net/changelog/)
743
-
744
- = 1.3.1.3 =
745
- * translation .pot file available
746
- * Dutch translation
747
- * NEW: YouTube and Flash movie support
748
- * NEW: Iframe support
749
- * added option Auto-enable for...
750
-
751
- = 1.3.1.2 =
752
- * added option titlePosition : over / inside / outside
753
- * added option transitionIn : elastic / fade / none
754
- * added option transitionOut : elastic / fade / none
755
-
756
- = 1.3.1.1 =
757
- * small jQuery speed improvement by chaining object calls
758
-
759
- = 1.3.1 =
760
- * Using FancyBox version 1.3.1
1
+ === Easy FancyBox ===
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, overlay, youtube, vimeo, dailymotion, pdf, svg, iframe, jquery, webp
5
+ Requires at least: 3.3
6
+ Tested up to: 6.1-RC1
7
+ Stable tag: 1.9
8
+
9
+ Easily enable the FancyBox light box on just about all media links. Multi-Site compatible. Supports iframe, inline content and well known video hosts.
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
+ **GDPR / EU Privacy**
18
+
19
+ This plugin does not collect any data and does not set any browser cookies. However, the PRO version offers an option to disable the automatic popup after the first visit, which needs a browser cookie. This cookie stores the visitors first website visit timestamp and path on the client side. It is not shared nor is any data stored server side or elsewhere.
20
+
21
+ **FEATURES**
22
+
23
+ Supported media and content types:
24
+
25
+ - All common image formats _including_ webp
26
+ - Hosted video on **Youtube**, **Vimeo** _and_ **Dailmotion**
27
+ - PDF files (embed with object tag, in iframe or in external Google Docs Viewer)
28
+ - SVG media images (thanks to Simon Maillard)
29
+ - 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))
30
+ - 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))
31
+
32
+ Also supports:
33
+
34
+ - WordPress Galleries (option "Link to" must be set to "Media File")
35
+ - NextGEN galleries (see [instructions in the FAQs](https://wordpress.org/plugins/easy-fancybox#can%20nextgen%20gallery%20work%20with%20easy%20fancybox%20%3F))
36
+ - Image maps
37
+ - 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))
38
+ - Jetpack Infinite Scroll
39
+
40
+ Additional features:
41
+
42
+ - Modal window option (see [instructions in the FAQs](https://wordpress.org/plugins/easy-fancybox#can%20i%20have%20a%20modal%20window%20%3F))
43
+ - Automatic detection of media file links
44
+ - Automatic detection of galleries
45
+ - 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))
46
+ - Fade or Elastic popup effects
47
+ - Styling options for light box overlay (color and opacity) and window (border size and color)
48
+
49
+ For **advanced options** and **priority support**, there is a **[Pro extension](https://premium.status301.com/downloads/easy-fancybox-pro/)** available. See Pro features below.
50
+
51
+ 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.
52
+
53
+ 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).
54
+
55
+ Visit [FancyBox](http://fancybox.net/) for more information and examples.
56
+
57
+ **PRO FEATURES**
58
+
59
+ - Priority support on dedicated forum
60
+ - Slideshow effect for galleries (autorotation)
61
+ - Spotlight effect for the light box overlay
62
+ - FacetWP, Gravity Forms and TablePress compatibility
63
+ - More styling options: rounded corners, inline content background and text colors
64
+ - More automatic popup options: triggered by URL hash, first link by media type, hide popup after first visit
65
+ - 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))
66
+ - More elastic (easing) popup effects on open and close
67
+ - Show/hide image title on mouse hover
68
+ - Fine-tune media link and gallery autodetection to match your theme source markup to allow galleries per post for example
69
+
70
+ For these additional features, you need to install the **[Pro extension](https://premium.status301.com/downloads/easy-fancybox-pro/)** alongside this free plugin.
71
+
72
+
73
+ = Contribute =
74
+
75
+ 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).
76
+
77
+ 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/).
78
+
79
+ **KNOWN ISSUES**
80
+
81
+ = General =
82
+
83
+ - **Outbound click or Download tracking** in some of the stats plugins can interfere with FancyBox. Disable such options or exclude links manually with a class if possible (see instructions for SlimStat below)
84
+ - Most plugins and themes that already include a light box script. Continue reading to see if you are using one of the know ones or follow the troubleshooting steps to find out what is conflicting on your site.
85
+ - Any theme that is missing the obligatory `<?php wp_footer(); ?>` call in the footer.php template.
86
+ - When showing an iframe as inline content in FancyBox -- not advised, use fancybox-iframe instead! -- the iframe will become blank after opening and closing it. The solution is to link directly to the iframe source and use `class="fancybox-iframe"` instead.
87
+
88
+ = Plugin conflicts =
89
+
90
+ - Google Translate plugins like **GTranslate**, **Weglot** and **Google Language Translator** cause the light box to be off-center, pushed downward for logged-in users (with admin bar). A work-around: add `.admin-bar #fancybox-outer{margin-top:-32px}` to Custom CSS in your theme Customizer.
91
+ - **WP Slimstat** and **Matomo/Piwik** with Track Outbound Clicks enabled, will break the light box effect on some browsers. Adding `fancybox` (or any of the other classes like `fancybox-youtube,fancybox-iframe,fancybox-inline` depending on which media should be displayed in FancyBox) to the Do Not Track field is reported to solve the issue. Slimstat also might interfere with the YouTube url conversion. When clicking a Youtube link, the movie opens in an overlay as it is supposed to but immediately after that, the complete page gets redirected to the original YouTube page. Adding a `class="noslimstat"` to the link is reported to work around the issue.
92
+ - **Google Analytics for WordPress** converts links like `href="#anyID"` to `href="http://yoursite.url/page/#anyID"`, disabling inline content shown in FancyBox.
93
+ - Both the **uBillBoard** and **Camera slideshow** have their own easing script hard-coded which conflicts with the one in Easy FancyBox. The only way around the conflict is to set both the Easing In and Easing Out options on your Settings > Media page to **Swing**.
94
+ - **Wordpress Firewall 2** blocks access to image files needed for proper display of the FancyBox overlay in older IE and other non-css3 browsers.
95
+ - **WordPress Amazon Associate**: A script provided by Amazon and the FancyBox script are incompatible. Disabling _Product Preview_ in the **WP - Amazon > Settings** page should work around the issue.
96
+ - **WP Supersized** uses the Animate Enhanced jQuery extension which causes a conflict with the Easing extension used by FancyBox resulting in a 0px sized lightbox frame and/or some kind of positioning issue with auto-centering.
97
+
98
+ = Theme conflicts =
99
+
100
+ - Older versions of **Elegant Themes** have FancyBox integrated in a hard-coded way, making them incompatible with Easy FancyBox. In the latest versions of these themes, there is an option to disable the included FancyBox. Use this option to make your theme compatible with Easy FancyBox :)
101
+ - The **Mystique** theme has two options called "Lightbox" and "Optimize website for faster loading" that will break Easy FancyBox. Disable both in Mystique's options > Advanced.
102
+ - **Imbalance** and other themes that uses the Photo Galleria jQuery extension: turn of the JSGallery option.
103
+ - Themes like **Envisioned**, **Chameleon** and many others have FancyBox baked in. There is no solution other than stripping the theme of all FancyBox related code or better: disable the plugin and use the theme provided version...
104
+ - Themes based on the **Thesis** framework might see issues in IE 8, for which [a hack has been proposed](https://voidzonemedia.com/solutions/thesis-ie8-remove-ie7-emulation/)
105
+
106
+
107
+ == Installation ==
108
+
109
+ = Wordpress =
110
+
111
+ Quick installation: [Install now](https://coveredwebservices.com/wp-plugin-install/?plugin=easy-fancybox) !
112
+
113
+ &hellip; OR &hellip;
114
+
115
+ Search for "easy fancybox" and install with that slick **Plugins > Add New** back-end page.
116
+
117
+ &hellip; OR &hellip;
118
+
119
+ Follow these steps:
120
+
121
+ 1. Download archive.
122
+
123
+ 2. Upload the zip file via the Plugins > Add New > Upload page &hellip; OR &hellip; unpack and upload with your favorite FTP client to the /plugins/ folder.
124
+
125
+ 3. Activate the plugin on the Plug-ins page.
126
+
127
+ Done! By default, any images that are linked to directly (not to a WordPress page) from within your posts and pages, should now be opening in a FancyBox overlay :)
128
+
129
+ Not happy with the default settings? Check out the new options under **Settings > Media**.
130
+
131
+ = Wordpress MU / WordPress 3+ in Multi Site mode =
132
+
133
+ Same as above but do a **Network Activate** to activate FancyBox image overlays on each site on your network. No database tables are created or manipulated and no activation hook needs to be run for it to function with default settings.
134
+
135
+
136
+ == Frequently Asked Questions ==
137
+
138
+ = BASIC =
139
+
140
+ = What's FancyBox? =
141
+
142
+ Basically, it is a fancy way of presenting images, movies, portable documents and inline content on your website. For example, if you have scaled-down images in your posts which are linked to the original large version, instead of opening them on a blank page, FancyBox opens those in a smooth overlay. Visit [FancyBox](http://fancybox.net/) for more information and examples.
143
+
144
+
145
+ = Which version of FancyBox does this plugin use? =
146
+
147
+ This plugin uses an **updated version** of the original [FancyBox 1.3.4](http://fancybox.net), better adapted to the mobile era.
148
+
149
+
150
+ = I installed the plugin. What now? =
151
+
152
+ First, make sure that image thumbnails in your posts and pages are linked to their full size counterpart directly. Open any post with thumbnail images in it for editing and select the first thumbnail. Click the **Edit Image** button that appears and choose **Link To: Media File**. From now on, clicking that thumbnail should open the full size version in FancyBox.
153
+
154
+ The same thing goes for WordPress Galleries. Choose **Link To: Media File** when inserting a gallery tag.
155
+
156
+
157
+ = Where is the settings page? =
158
+
159
+ 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](https://wordpress.org/plugins/easy-fancybox/screenshots/) ...
160
+
161
+
162
+ = Help! It does not work... =
163
+
164
+ 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](https://wordpress.org/support/plugin/easy-fancybox) or go to the [development site](https://status301.net/wordpress-plugins/easy-fancybox/)
165
+
166
+
167
+ = ADVANCED =
168
+
169
+ = Will a WordPress gallery be displayed in a FancyBox overlay? =
170
+
171
+ 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" ]`.
172
+
173
+
174
+ = The lightbox does not look good on mobile devices. What can I do about that? =
175
+
176
+ 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**.
177
+
178
+
179
+ = Can I make a slideshow from my gallery? =
180
+
181
+ In the [Pro extension](https://premium.status301.com/downloads/easy-fancybox-pro/), there is an Advanced option called "Gallery Auto-rotation" for that.
182
+
183
+
184
+ = Can I exclude images or other links from auto-attribution? =
185
+
186
+ Yes. All links with class **nolightbox** that would normally get auto-enabled, will be excluded from opening in a FancyBox overlay.
187
+
188
+ `<a href="url/to/fullimg.jpg" class="nolightbox"><img src="url/to/thumbnail.jpg" /></a>`
189
+
190
+
191
+ = Can NextGEN Gallery work with Easy FancyBox ? =
192
+
193
+ 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.
194
+
195
+ 1. Go to your Settings > Media admin page and switch OFF the FancyBox "Auto-gallery" option in the Images section;
196
+ 1. Go to Gallery > Other Options and set the Lightbox Effects option to "Custom" and click on **Show Advanced Settings**;
197
+ 1. fill the Code field with
198
+ `class="fancybox" rel="%GALLERY_NAME%"`
199
+ 1. Leave the other fields empty and save your settings.
200
+
201
+
202
+ = Can I use ONE thumbnail to open a complete gallery ? =
203
+
204
+ It can be done manually (using the internal WordPress gallery feature, or not) _or_ in combination with NextGen Gallery.
205
+
206
+ **Manual**
207
+
208
+ **A.** Open your post for editing in HTML mode and insert the first image thumbnail in your post content (linking to the images file, not page) to serve as the gallery thumbnail.
209
+
210
+ **B.** Place the following code to start a hidden div containing all the other images that should only be visible in FancyBox:
211
+ `
212
+ <div class="fancybox-hidden">
213
+ `
214
+
215
+ **C.** Right after that starting on a new line, insert all other images you want to show in your gallery. You can even use the WordPress internal gallery feature with the shortcode `[ gallery link="file" ]`. NOTE: if the gallery thumbnail is attached to the post, it will be show a second time when flipping through the gallery in FancyBox. If you do not want that, use an image that is not attached to the post as gallery thumbnail.
216
+
217
+ **D.** Close the hidden div with the following code on a new line:
218
+ `
219
+ </div>
220
+ `
221
+
222
+ **With NextGEN Gallery**
223
+
224
+ You can choose between two shortcodes to show a gallery that (1) limits images per gallery using the shortcode `[nggallery id=x]` or (2) per tag name (accross galleries; you need to set tag name manually => more work but more control) using the shortcode `[nggtags gallery=YourTagName,AnotherTagName]`.
225
+
226
+ General steps:
227
+
228
+ **A.** Place the shortcode of your choice in your page/post content.
229
+
230
+ **B.** Configure NextGen on **Gallery > Gallery Settings** to Display galleries as "NextGEN Basic Thumbnails" and then under the NextGEN Basic Thumbnails to at least have the following options set like this:
231
+
232
+ 1. Number of images per page: 1
233
+ 1. Use imagebrowser effect: No
234
+ 1. Add hidden images: Yes
235
+
236
+ **C.** Optional: add the following new CSS rule to your theme stylesheet (or install [Custom CSS](https://wordpress.org/plugins/safecss/) or [Jetpack](https://wordpress.org/plugins/jetpack/) and add it on the new Appearance > Edit CSS admin page) to hide the page browsing links below the gallery thumbnail.
237
+ `
238
+ .ngg-navigation {
239
+ display:none;
240
+ }
241
+ `
242
+
243
+ = Can I play YouTube, Dailymotion and Vimeo movies in a FancyBox overlay? =
244
+
245
+ Yes. Simply create a link using the Share URL (the full Page URL, the Short URL with or without options like HD etc.) to the YouTube/Vimeo/Dailymotion page in your post content. If you have Auto-detect enabled, the plugin will take care of the rest for you! :)
246
+
247
+ If you have disabled Auto-detection, give the link a class attribute like `class="fancybox-youtube"` for Youtube, `class="fancybox-vimeo"` for Vimeo and `class="fancybox-dailymotion"` for Dailymotion, to manually enable FancyBox for it.
248
+
249
+ Both YouTube and Vimeo movies can be made to play immediately after opening by adding the paramer `autoplay=1` to the URL. For example, a short-url YouTube link that should play in HD mode, have the full screen button and auto-start on open, would look like:
250
+ `
251
+ <a href="https://youtu.be/N_tONWXYviM?hd=1&fs=1&autoplay=1">text or thumbnail</a>
252
+ `
253
+
254
+
255
+ = I want that 'Show in full-screen' button on my YouTube movies =
256
+
257
+ Append `&fs=1` to your YouTube share URL.
258
+
259
+
260
+ = Can I show a Youtube playlist in FancyBox? =
261
+
262
+ Yes, just go to Youtube page of any movie that's in the playlist and use the Share button to get the share URL just like with single movies, but this time place a checkmark at the 'Share with playlist' option.
263
+
264
+
265
+ = Can I link a NextGEN thumbnail to a Youtube movie in FancyBox? =
266
+
267
+ User Mark Szoldan shared a neat trick how to do this:
268
+
269
+ 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.
270
+ 1. Then give the image that you want to link to a Youtube movie the URL to the Youtube page as title.
271
+ 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...
272
+
273
+ `
274
+ <script type="text/javascript">
275
+ jQuery('.fancybox [title*="www.youtube.com"]').each(function() {
276
+ var title = jQuery(this).attr('title');
277
+ var desc = jQuery(this).parent().attr('title');
278
+ jQuery(this).attr('title', desc);
279
+ jQuery(this).parent().attr('href', title);
280
+ });
281
+ </script>
282
+ `
283
+
284
+ This script snippet will scan the image titles and if it finds a Youtube URL there, it will replace the links href attribute value accordingly.
285
+
286
+
287
+ = Can I create a gallery of Youtube thumbnails which open in FancyBox? =
288
+
289
+ You could do this manually by uploading individual thumbnails that you can retrieve by using the unique movie ID in these URLs for three different sizes:
290
+ `
291
+ https://img.youtube.com/vi/UNIQUE-MOVIE-ID/default.jpg
292
+ https://img.youtube.com/vi/UNIQUE-MOVIE-ID/mqdefault.jpg
293
+ https://img.youtube.com/vi/UNIQUE-MOVIE-ID/hqdefault.jpg
294
+ `
295
+ Other locations might be
296
+ `
297
+ https://img.youtube.com/vi/UNIQUE-MOVIE-ID/0.jpg (same as hqdefault.jpg)
298
+ https://img.youtube.com/vi/UNIQUE-MOVIE-ID/1.jpg
299
+ https://img.youtube.com/vi/UNIQUE-MOVIE-ID/2.jpg
300
+ https://img.youtube.com/vi/UNIQUE-MOVIE-ID/3.jpg
301
+ https://img.youtube.com/vi_webp/UNIQUE-MOVIE-ID/0.webp (same as hqdefault.webp)
302
+ etc...
303
+
304
+ `
305
+
306
+ But an easier method is this one, shared by Shashank Shekhar (thanks!) :
307
+
308
+ To create Youtube thumbnail galleries, install https://wordpress.org/plugins/youtube-simplegallery/ and set the 'Effect' option to fancybox. Then disable Youtube autodetection on Settings > Media.
309
+
310
+
311
+ = Can I display web pages or HTML files in a FancyBox overlay? =
312
+
313
+ Yes. First, enable the iFrame option on Settings > Media. Then, in your post or page content create a link to any web page or .htm(l) file in your content. Then switch to the Text tab in the Classic Editor or to Edit as HTML (under More options in the block menu) in Gutenberg, find the link `<a ... >` tag and give it a `class="fancybox-iframe"` attribute.
314
+
315
+ Note: Not all external web pages are allowed to be embedded in an iframe and may be blocked by a server response header or script. The result will be either an empty/blank light box or the target page "breaking out" of the light box and loading in the main browser tab.
316
+
317
+
318
+ = Can I show PDF files in a FancyBox overlay? =
319
+
320
+ Yes. Just place a link _with the URL ending in .pdf_ to your Portable Document file in the page content.
321
+
322
+ If you don't have *Auto-detect* checked under **PDF** on Settings > Media admin page, you will need to add `class="fancybox-pdf"` (to force pdf content recognition) to the link to enable FancyBox for it.
323
+
324
+
325
+ = How do I show content with different sizes? =
326
+
327
+ FancyBox tries to detect the size of the content automatically but if it can not find a size, it will default to the settings for that particular content type as set on the Settings > Media page.
328
+
329
+ The **[Pro extension](https://premium.status301.com/downloads/easy-fancybox-pro/)** provides an extra option to allow you to manually override this by defining the width and height wrapped in curly braces in the class attribute of the link itself. Make sure the option "Include the Metadata jQuery extension script..." under FancyBox | Miscellaneous | Advanced on Settings > Media is enabled.
330
+
331
+ For example, an SVG file with different size:
332
+
333
+ `
334
+ <a class="fancybox-svg {width:1024,height:675}" href="_your_svg_"></a>
335
+ `
336
+
337
+ = How can I display INLINE content in a FancyBox overlay ? =
338
+
339
+ First go to your **Settings > Media** admin page and activate the **Inline** option under the FancyBox settings. After saving, the amin page will show a new section called Inline where you can tweak its parameters.
340
+
341
+ Next, open your page/post for editing in the HTML tab and wrap the inline content in
342
+ `
343
+ <div style="display:none" class="fancybox-hidden"><div id="fancyboxID-1" class="hentry" style="width:460px;max-width:100%;">
344
+ ...inline content here...
345
+ </div></div>
346
+ `
347
+
348
+ Then place a FancyBox link tag with class attribute "fancybox-inline" anywhere else in the post/page content that will point to the inline content like
349
+ `
350
+ <a href="#fancyboxID-1" class="fancybox-inline">Read my inline content</a>
351
+ `
352
+
353
+ NOTE: The wrapping divs ID *must* be unique and it must correspond with the links HREF with a # in front of it. When using the above example for more FancyBox inline content (hidden div + opening link) combinations on one page, give the second one the ID fancyboxID-2 and so on...
354
+
355
+ NOTE 2: If you find that the inline content shown in FancyBox is styled very different than the rests of the page content, then you might want to change the div tag attribute `class="hentry"` to something else that matches your theme. Find out what class name is used for the main content on your site and re-use that.
356
+
357
+
358
+ = Can I display a contact form in FancyBox? =
359
+
360
+ Yes. There are several methods imaginable but the easiest would be to use the Inline method. First go to your Settings > Media admin page and enable the Inline Content option. Next, go back to edit your post or page in the Text editor tab. The inline content can be a shortcode like in this example using Contact Forms 7 and Easy FancyBox:
361
+
362
+ `
363
+ <a href="#contact_form_pop" class="fancybox-inline">Contact Us</a>
364
+
365
+ <div style="display:none" class="fancybox-hidden">
366
+ <div id="contact_form_pop" class="hentry" style="width:460px;max-width:100%;">
367
+ [contact-form-7 id="87" title="Contact form 1"]
368
+ </div>
369
+ </div>
370
+ `
371
+ 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.
372
+
373
+
374
+ = Can I make an image or hidden content to pop up in FancyBox on page load? =
375
+
376
+ 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.
377
+
378
+ Use the instructions above for inline content but this time give the link also `id="fancybox-auto"` (leave the class too) and remove the anchor text to hide it. Now the hidden div content will pop up automatically when a visitor opens the page.
379
+
380
+ Same can be done with any other media or iframe link! But please remember there can be only **one** item using the ID fancybox-auto per page...
381
+
382
+
383
+ = Can I have a modal window ? =
384
+
385
+ 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.
386
+
387
+ This means there is NO option to close the light box, unless you create a link like this inside the hidden inline content div:
388
+
389
+ `
390
+ <a href="" class="fancybox-close">Accept</a>
391
+ `
392
+
393
+
394
+ = Can I make a menu item open in a FancyBox overlay ? =
395
+
396
+ 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:
397
+
398
+ 1. Go to Settings > Media and enable FancyBox iFrame support.
399
+ 2. Go to Appearance > Menus and open the little tab "Screen Options" in the top-right corner.
400
+ 3. Enable the option "CSS Classes" under Advanced menu properties.
401
+ 4. Now give the menu item you want to open in a FancyBox iframe the class `fancybox-iframe`.
402
+
403
+ 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"` attribute.
404
+
405
+
406
+ = How can I make AJAX loaded content be seen by FancyBox ? =
407
+
408
+ 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.
409
+
410
+ 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.
411
+
412
+ You can trigger the event like this:
413
+ `
414
+ jQuery(document.body).trigger('post-load');
415
+ `
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.
423
+
424
+
425
+ = TROUBLE SHOOTING =
426
+
427
+ If, after activation, your images do not open in a FancyBox overlay, there are several possible reasons. Some are easily solved, others are more difficult. Follow these basic checks to make sure everything is in place:
428
+
429
+ = Basic checks =
430
+
431
+ 1. Make sure that thumbnail images are linked *directly* to their larger counterpart, not to a dynamic WordPress page that includes the larger image. This means when you insert an image in your posts or pages, you need to select **Media File** at the Link option instead of Page URL. You'll have to manually edit your old posts if you have always inserted images with `Page URL` before, FancyBox cannot do this for you.
432
+ 1. Make sure you have all the needed media and their *Auto-detect* options activated on your **Settings > Media** admin page. If you are using images in other formats that JPG, GIF or PNG, you need to add the extensions to the Auto-detect field for Images. Please note: The image file names must actaully _end_ with that extension! This means that if you have an image file that (for example) has _no_ extension (does not end with .jpg or any other) even if is in JPEG compressed format, the FancyBox will not be able to detect is as an image. You will need to manually give those links the class `fancybox image` to trigger FancyBox.
433
+
434
+ = General trouble shooting steps =
435
+
436
+ 1. Switch off all other plugins and switch your sites appearance to the default Twenty Seventeen theme. FancyBox should work now. If so, continue with the next step. If not, re-install the plugin and verify the basic steps above.
437
+ 1. Switch back to your original theme and check if FancyBox is still working. If so, continue with the next step. If not, See the Theme Incompatibility checks below.
438
+ 1. One by one, switch each plugin that you had running before back ON. Keep checking to see at which point FancyBox starts failing and you will hve found the conflicting plugin.
439
+
440
+ = Theme Incompatibility checks =
441
+
442
+ 1. See known theme conflicts above first, then continue with these following steps.
443
+ 1. Make sure your theme is capable of placing the needed javascript and css in the page header and footer. Open any page on your site and view the source code by right-clicking on an empty section and selecting 'View source...' (or similar). There you will need to check of there are any references to javascript files like `jquery.fancybox.min.js?ver=x.x.x` near the closing `</body>` tag. There should also be a `easy-fancybox.min.css?ver=x.x.x` in the head section... If it's not there, your theme is really out of date. Consider switching to a new theme fast!
444
+ 1. Make sure that your theme does not load the main jQuery library file more than once. Look for references to javascript files like `jquery.js?ver=x.x.x` or `jquery.min.js` in the page source code. If you find more than one, try to find out in which theme template file that second reference is hard-coded and remove that line. Usually in header.php or footer.php
445
+ 1. Check if your theme loads another or the same lightbox script. Look for references to Thickbox, Prettyphoto, Lightbox2, Colorbox or FancyBox script files or code. These are very likely to cause the incompatibility and you will either have to remove these by hacking your theme or switch to another theme.
446
+
447
+ If you still do not get to see your images in FancyBox, ask on the [Easy FancyBox WordPress forum](https://wordpress.org/tags/easy-fancybox) or go to the [development site](https://status301.net/wordpress-plugins/easy-fancybox/)
448
+
449
+ = Plugin Incompatibility checks =
450
+
451
+ 1. If you followed the general trouble shooting steps above, you should now be aware of which plugin is conflicting whith Easy FancyBox. See known plugin conflicts above first. If the plugin and its solution are not mentioned there, continue with the following steps.
452
+ 1. Make sure that the plugins do not make the main jQuery library file load more than once. Look for references to javascript files like `jquery.js?ver=x.x.x` or `jquery.min.js` in the page source code. If you find more than one, try to find out where that comes from.
453
+ 1. Check if your theme loads another or the same lightbox script or any other of the needed jQuery extensions like jquery.easing or jquery.mousewheel. Look for references to Thickbox, Prettyphoto, Lightbox2, Colorbox or FancyBox script files or code. These are very likely to cause the incompatibility and you will have to either find a setting in the other plugin to switch OFF the use of the conflicting script (possible in NextGEN for example, see under Advanced below) or choose between the two conflicting plugins.
454
+
455
+
456
+ == Screenshots ==
457
+
458
+ 1. Example image with **Overlay** caption. This is the default way Easy FancyBox displays images. Other options are **Inside** and the old **Outside**.
459
+
460
+ 2. Example of a YouTube movie in overlay.
461
+
462
+
463
+ == Upgrade Notice ==
464
+
465
+ = 1.9 =
466
+
467
+ Swipe support, fixed background and accessibility improvements.
468
+
469
+ == Changelog ==
470
+
471
+ = 1.9 =
472
+ * NEW: Swipe support
473
+ * NEW: Optional fancyBox 2 or Legacy scripts
474
+ * Fixed background
475
+ * Dropped IE6-8 support
476
+ * Dropped SWF support (only availbale in Legacy)
477
+ * Accessibility improvements
478
+
479
+ = 1.8.19 =
480
+ * Admin settings links
481
+ * Pro compatibility message for VideoPress
482
+ * NEW: Exclude selector option
483
+ * FIX: border 0 ignored sometimes
484
+
485
+ = 1.8.18 =
486
+ * FIX: Jetpack Tiled Gallery block compatibility
487
+ * Don't include mousewheel script by default
488
+ * SECURITY: fixed failing color value sanitization + added inline styles output filter, issue reported by Jakob Hagl sba-research.org
489
+
490
+ = 1.8.17 =
491
+ * Pro compatibility messages
492
+ * Support forum link
493
+
494
+ = 1.8.16 =
495
+ * FIX: Trying to get property 'ID' of non-object
496
+ * mark WordPress 5.2 compatible
497
+
498
+ = 1.8.15 =
499
+ * FIX: inline wrapper nesting issue
500
+ * Revert to file names without version
501
+
502
+ = 1.8.13 =
503
+ * FIX: version constant issue
504
+ * Prepare Visual Composer Masonry Grid Gallery compatibility option
505
+
506
+ = 1.8.11 =
507
+ * FIX: Vimeo player direct links breaking
508
+
509
+ = 1.8.10 =
510
+ * Force default autoselector for galleries
511
+
512
+ = 1.8.9 =
513
+ * Prevent gallery next/prev links to show dud target
514
+ * FIX: allow youtube url parameters before v=
515
+
516
+ = 1.8.7 =
517
+ * Autoplay Youtube/Vimeo/Dailymotion
518
+ * FIX: Exclude Vimeo user pages from autodetect
519
+ * FIX: Exclude facebook/twitter share link
520
+ * FIX: PDF embed tag
521
+
522
+ = 1.8.6 =
523
+ * Gutenberg file block download button compatibility
524
+ * Gutenberg gallery block compatibility
525
+ * FIX: Missing argument in easyFancyBox::add_video_wmode_opaque()
526
+ * Remove version URL parameters
527
+ * FIX: jQuery 3+ e.indexOf is not a function
528
+
529
+ = 1.8.5 =
530
+ * FIX: prevent Inline content title
531
+
532
+ = 1.8.4 =
533
+ * Improved center on scroll behavior with title outside
534
+ * FIX: Pro options compatibility
535
+
536
+ = 1.8.3 =
537
+ * FIX: AutoScale option restored
538
+ * FIX: outline issue in Firefox
539
+ * Prevent SiteGround Optimizer warning about break outside loop
540
+
541
+ = 1.8.2 =
542
+ * FIX: main method not returning true in some cases
543
+ * Force all hosted video to https
544
+ * FIX: video iframe needs allow="autoplay" on modern browsers
545
+ * FIX: default enqueue priority not 10
546
+ * FIX: possible infinite loop in prev/next and image preloader
547
+ * Move main method (back) to init, position 9
548
+ * Introducing easy_fancybox_enqueue_scripts action hook
549
+
550
+ = 1.8 =
551
+ * NEW: Google Docs Viewer for PDF
552
+ * NEW: Youtube privacy-enhanced embed
553
+ * NEW: Compatibility options: late script inclusion, jquery exclusion, no wp_add_inline_script
554
+ * FancyBox: Improved mobile viewport height detection
555
+ * FancyBox: now skips subsequent double links in gallery
556
+ * FancyBox: new PDF content type
557
+ * FancyBox: improved error messages
558
+ * Dedicated IE8 stylesheet
559
+ * jQuery Easing update to 1.4.1
560
+
561
+ = 1.7 =
562
+ * NEW: Aspect ratio for video frames on smaller screens
563
+ * NEW: Global minimum screen size
564
+ * NEW: Loading icon for video/iframe content
565
+ * NEW: Resize light box on device orientation or browser window size change
566
+ * NEW: Modal window class and close button class
567
+ * FIX: pre PHP 5.4 compatibility
568
+ * FIX: iPhone iframe scrolling
569
+ * FIX: Autoptimize compatibility
570
+ * Switch to wp_add_inline_script() script printing, thanks @szepeviktor
571
+
572
+ = 1.6.3 =
573
+ * FIX: inline js minification incompatibility, thanks @alexiswilke
574
+
575
+ = 1.6.2 =
576
+ * FIX: line breaks hidden on options media admin page since WP 4.9, thanks @garrett-eclipse
577
+
578
+ = 1.6.1 =
579
+ * Nolightbox class in menu also for other media types than images
580
+ * FIX: CSS color code
581
+ * Spelling fixes, thanks @garrett-eclipse
582
+ * FIX: Pinterest button compatibility
583
+ * FIX: Double load plugin text domain
584
+
585
+ = 1.6 =
586
+ * Add webp to default Autodetect image types
587
+ * Exclude more rel attribute values from galleries
588
+ * BUGFIX: gallery preload
589
+ * Update jquery.easing.js and jquery.mousewheel.js
590
+
591
+ = 1.5.8.2 =
592
+ * BUGFIX: use dirname(__FILE__) instead of relying on __DIR__ to be available
593
+ * Explicit transparency for gallery navigation links
594
+
595
+ = 1.5.8 =
596
+ * FIX: variable variable php 7 compat
597
+ * FIX: obj undefined in minified js
598
+ * FIX: nofancybox in menu ignored, thanks Trishah
599
+ * Color value sanitize
600
+ * NEW: auto popup delay
601
+ * NEW: pro extension version compatibility check routine
602
+ * NEW: margin option
603
+ * NEW: iFrame alow full screen option
604
+ * Dropped mu-plugins support
605
+ * Added support for universal nolightbox class
606
+ * Set focus on iframe after load
607
+ * FIX: No center on scroll on touch devices
608
+ * FIX: Allow fullscreen videos
609
+
610
+ = 1.5.7 =
611
+ * FIX: Pro extension link update
612
+ * NEW: WebP support and class='image' to force image media type
613
+ * IE 6-8 css rules optional
614
+ * iframe embed for Youtube, Vimeo and Dailymotion
615
+ * Croation translation
616
+ * HTML5 players allowfullscreen default
617
+
618
+ = 1.5.6 =
619
+ * iPad positioning patch
620
+ * Don't unregister scripts that are not ours even for conflict prevention
621
+ * box-sizing: border-box issue in Firefox fixed
622
+ * Allow mousewheel scrolling page in the background again
623
+
624
+ = 1.5.5 =
625
+ * Prevent mousewheel scrolling page in the background
626
+ * New stylesheet IE alphaimageloader path fix approach
627
+ * Czech translation added
628
+ * Updated Indonesian translation
629
+
630
+ = 1.5.2 =
631
+ * BUGFIX: easy_fancybox_handler() in combo with trigger('click') causes Uncaught Exception script error
632
+
633
+ = 1.5.1 =
634
+ * FIX: jQuery 1.9+ compatibility
635
+ * Dropping support for gForms again -- "Cannot convert 'c' to object" error in combination with some older gForms version :(
636
+ * NEW: support for Infinite Scroll by Jetpack
637
+
638
+ = 1.5.0 =
639
+ * FIX: CSS3 box-sizing issue (Twenty Thirteen) misplacing close button
640
+ * NEW: Added SVG support. Thanks to Simon Maillard.
641
+ * Pre WP 3.6: jQuery 1.9+ compatibility
642
+ * JQuery Mousewheel extension update to 3.1.3
643
+ * NEW: Elegant Themes compatibility
644
+ * Some small Touch device compatibility improvement hacks to the 1.3.4 script
645
+ * Major plugin overhaul: Class implementation
646
+ * NEW: Disable hide on overlay click
647
+ * NEW: Allow automatic resizing to large image size set on Settings > Media during media upload via the hidden WordPress function media_upload_max_image_resize()
648
+ * NEW Options: iFrame scrolling, autoScale, key navigation/close, cyclic galleries
649
+ * Metadata custom parameters and Mousewheel gallery scrolling scripts optional
650
+ * Basic RTL languages/text direction support (gallery navigation inversion, title position)
651
+ * BUGFIX: https in stylesheet on Windows IIS
652
+ * Improved W3TC compatibility: query string issue
653
+ * Gravity Forms in ajax mode compatibility
654
+ * Use jQuery's bind('ready') for better ajax content compatibility
655
+ * Dynamic stylesheet response headers to allow browser caching
656
+ * Minified version of jquery.metadata.js
657
+ * Auto-detect on image map areas
658
+ * nolightbox class for menu items
659
+ * SECURITY: Settings sanitization
660
+ * BUGFIX: load_textdomain firing after the main settings array is loaded, leaving text strings in it untranslated.
661
+ * BUGFIX: missing signs in Youtube url regular expression
662
+ * BUGFIX: unquoted rel attribute selectors in jquery.fancybox-1.3.4.js
663
+ * BUGFIX: broken url path in IE stylesheet when missing $_SERVER['SERVER_NAME']
664
+ * BUGFIX: easing extension not needed on linear easing
665
+
666
+ = 1.3.4.9 =
667
+ * NEW: Lithuanian translation
668
+ * NEW: Hindi translation
669
+ * NEW: Indonesian translation
670
+ * NEW: Romanian translation
671
+ * NEW: Polish translation
672
+ * NEW: Spanish translation
673
+ * NEW: jQuery Metadata support
674
+ * NEW: Image map AREA support for all content types
675
+ * NEW: new iFrame/HTML5 embed code for YouTube, Vimeo and Dailymotion
676
+ * NEW: fix WordPress Dailymotion auto-embed code missing wmode
677
+ * Some changes to default settings
678
+ * Updated Dutch translation
679
+ * BUGFIX: Opening speed
680
+
681
+ = 1.3.4.8 =
682
+ * NEW: Advanced option: Gallery auto-rotation
683
+ * NEW: Spotlight effect
684
+ * Improved auto-enable and auto-gallery settings
685
+ * BIGFIX: CSS IE6 hack
686
+ * BIGFIX: PDF object in IE7
687
+
688
+ = 1.3.4.6 =
689
+ * PDF embed compatibility improvement
690
+ * NEW: Show/hide title on mouse hover action
691
+ * NEW: Auto-gallery modes (Disabled, page/post images only, all)
692
+ * NEW: Dailymotion support
693
+ * Links with id **fancybox-auto** will be triggered on page load
694
+ * Anything with class **fancybox-hidden"** will be hidden
695
+ * Support for menu items in iframe
696
+ * Added class **nofancybox** for exclusion when auto-enabling
697
+
698
+ = 1.3.4.5 =
699
+ * FancyBox script version 1.3.4 (2010/11/11 - http://fancybox.net/changelog/)
700
+ * NEW: Support for PDF
701
+ * NEW: Easing options
702
+ * YouTube, Vimeo and iFrame options adjustable
703
+ * lots and lots of more options!
704
+ * BIGFIX: work-around for missing wmode in WordPress (auto-)embedded movies (credits: Crantea Mihaita)
705
+
706
+ = 1.3.3.4.2 =
707
+ * BIGFIX: iframe width
708
+ * BIGFIX: image overlay size in Google Chrome browser issue (FancyBox 1.3.3)
709
+ * BIGFIX: fancybox-swf
710
+
711
+ = 1.3.3.4 =
712
+ * FancyBox script version 1.3.3 (2010/11/4 - http://fancybox.net/changelog/)
713
+ * Vimeo support
714
+ * YouTube Short URL support (disabled by default)
715
+ * Auto-recognition and seperate class `fancybox-youtube` for YouTube
716
+ * Auto-recognition and seperate class `fancybox-vimeo` for Vimeo
717
+
718
+ = 1.3.2 =
719
+ * FancyBox script version 1.3.2 (2010/10/10 - http://fancybox.net/changelog/)
720
+
721
+ = 1.3.1.3 =
722
+ * translation .pot file available
723
+ * Dutch translation
724
+ * NEW: YouTube and Flash movie support
725
+ * NEW: Iframe support
726
+ * added option Auto-enable for...
727
+
728
+ = 1.3.1.2 =
729
+ * added option titlePosition : over / inside / outside
730
+ * added option transitionIn : elastic / fade / none
731
+ * added option transitionOut : elastic / fade / none
732
+
733
+ = 1.3.1.1 =
734
+ * small jQuery speed improvement by chaining object calls
735
+
736
+ = 1.3.1 =
737
+ * Using FancyBox version 1.3.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
uninstall.php ADDED
@@ -0,0 +1,222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * EASY_FANCYBOX_MS_UNINSTALL
4
+ *
5
+ * Set this constant in wp-config.php if you want to allow looping over each site
6
+ * in the network to run XMLSitemapFeed_Uninstall->uninstall() defined in uninstall.php
7
+ *
8
+ * There is NO batch-processing so it does not scale on large networks.
9
+ * The constant is ignored on networks over 10k sites.
10
+ *
11
+ * example:
12
+ * define( 'EASY_FANCYBOX_MS_UNINSTALL', true);
13
+ */
14
+
15
+ // Exit if uninstall not called from WordPress.
16
+ defined( 'WP_UNINSTALL_PLUGIN' ) || exit();
17
+
18
+ /*
19
+ * Easy FancyBox uninstallation.
20
+ *
21
+ * @since 1.9
22
+ */
23
+ class easyFancyBox_Uninstall {
24
+
25
+ /*
26
+ * constructor: manages uninstall for multisite
27
+ *
28
+ * @since 1.9
29
+ */
30
+ function __construct()
31
+ {
32
+ global $wpdb;
33
+
34
+ // Check if it is a multisite and if EASY_FANCYBOX_MS_UNINSTALL constant is defined and
35
+ // if so, run the uninstall function for each blog id.
36
+ if ( is_multisite() && defined( 'EASY_FANCYBOX_MS_UNINSTALL' ) && EASY_FANCYBOX_MS_UNINSTALL && ! wp_is_large_network() ) {
37
+ error_log( 'Clearing Easy FancyBox settings from each site before uninstall:' );
38
+ $field = 'blog_id';
39
+ $table = $wpdb->prefix.'blogs';
40
+ foreach ( $wpdb->get_col("SELECT {$field} FROM {$table}") as $blog_id ) {
41
+ switch_to_blog($blog_id);
42
+ $this->uninstall($blog_id);
43
+ }
44
+ restore_current_blog();
45
+ } else {
46
+ $this->uninstall();
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Remove plugin settings.
52
+ *
53
+ * @since 1.9
54
+ */
55
+ function uninstall( $blog_id = false )
56
+ {
57
+ delete_option( 'easy_fancybox_version' );
58
+
59
+ // General settings.
60
+ delete_option( 'fancybox_scriptVersion' );
61
+ delete_option( 'fancybox_enableImg' );
62
+ delete_option( 'fancybox_enableInline' );
63
+ delete_option( 'fancybox_enablePDF' );
64
+ delete_option( 'fancybox_enableSWF' );
65
+ delete_option( 'fancybox_enableSVG' );
66
+ delete_option( 'fancybox_enableYoutube' );
67
+ delete_option( 'fancybox_enableVimeo' );
68
+ delete_option( 'fancybox_enableDailymotion' );
69
+ delete_option( 'fancybox_enableiFrame' );
70
+
71
+ // Overlay settings.
72
+ delete_option( 'fancybox_overlayShow' );
73
+ delete_option( 'fancybox_hideOnOverlayClick' );
74
+ delete_option( 'fancybox_overlayColor' );
75
+ delete_option( 'fancybox_overlaySpotlight' );
76
+ delete_option( 'fancybox_overlayOpacity' );
77
+
78
+ // Window settings.
79
+ delete_option( 'fancybox_showCloseButton' );
80
+ delete_option( 'fancybox_backgroundColor' );
81
+ delete_option( 'fancybox_textColor' );
82
+ delete_option( 'fancybox_titleColor' );
83
+ delete_option( 'fancybox_paddingColor' );
84
+ delete_option( 'fancybox_borderRadius' );
85
+ delete_option( 'fancybox_width' );
86
+ delete_option( 'fancybox_height' );
87
+ delete_option( 'fancybox_padding' );
88
+ delete_option( 'fancybox_margin' );
89
+ delete_option( 'fancybox_centerOnScroll' );
90
+ delete_option( 'fancybox_enableEscapeButton' );
91
+ delete_option( 'fancybox_autoScale' );
92
+ delete_option( 'fancybox_speedIn' );
93
+ delete_option( 'fancybox_speedOut' );
94
+
95
+ // Miscellaneous.
96
+ delete_option( 'fancybox_autoClick' );
97
+ delete_option( 'fancybox_delayClick' );
98
+ delete_option( 'fancybox_minViewportWidth' );
99
+ delete_option( 'fancybox_minViewportHeight' ); // fb2
100
+ delete_option( 'fancybox_scriptPriority' );
101
+ delete_option( 'fancybox_noFooter' );
102
+ delete_option( 'fancybox_nojQuery' );
103
+ delete_option( 'fancybox_pre45Compat' );
104
+ delete_option( 'fancybox_vcMasonryCompat' );
105
+ delete_option( 'fancybox_autoExclude' );
106
+ delete_option( 'fancybox_compatIE8' );
107
+ delete_option( 'fancybox_mouseWheel' );
108
+ delete_option( 'fancybox_metaData' );
109
+
110
+ // Image
111
+ delete_option( 'fancybox_autoAttribute' );
112
+ delete_option( 'fancybox_autoAttributeLimit' );
113
+ delete_option( 'fancybox_classType' );
114
+ delete_option( 'fancybox_transitionIn' );
115
+ delete_option( 'fancybox_easingIn' );
116
+ delete_option( 'fancybox_transitionOut' );
117
+ delete_option( 'fancybox_easingOut' );
118
+ delete_option( 'fancybox_opacity' );
119
+ delete_option( 'fancybox_hideOnContentClick' );
120
+ delete_option( 'fancybox_titleShow' );
121
+ delete_option( 'fancybox_titlePosition' );
122
+ delete_option( 'fancybox_titleFromAlt' );
123
+ delete_option( 'fancybox_autoGallery' );
124
+ delete_option( 'fancybox_showNavArrows' );
125
+ delete_option( 'fancybox_enableKeyboardNav' );
126
+ delete_option( 'fancybox_cyclic' );
127
+ delete_option( 'fancybox_changeSpeed' );
128
+ delete_option( 'fancybox_changeFade' );
129
+ delete_option( 'fancybox_autoSelector' );
130
+ delete_option( 'fancybox_autoPlay' ); // fb 2
131
+
132
+ // Inline.
133
+ delete_option( 'fancybox_autoDimensions' );
134
+ delete_option( 'fancybox_InlineScrolling' );
135
+ delete_option( 'fancybox_transitionInInline' );
136
+ delete_option( 'fancybox_easingInInline' );
137
+ delete_option( 'fancybox_transitionOutInline' );
138
+ delete_option( 'fancybox_easingOutInline' );
139
+ delete_option( 'fancybox_opacityInline' );
140
+ delete_option( 'fancybox_hideOnContentClickInline' );
141
+
142
+ // PDF.
143
+ delete_option( 'fancybox_autoAttributePDF' );
144
+ delete_option( 'fancybox_PDFonStart' );
145
+ delete_option( 'fancybox_PDFwidth' );
146
+ delete_option( 'fancybox_PDFheight' );
147
+ delete_option( 'fancybox_PDFpadding' );
148
+ delete_option( 'fancybox_PDFtitleShow' );
149
+ delete_option( 'fancybox_PDFtitlePosition' );
150
+ delete_option( 'fancybox_PDFtitleFromAlt' );
151
+
152
+ // SWF.
153
+ delete_option( 'fancybox_autoAttributeSWF' );
154
+ delete_option( 'fancybox_SWFWidth' );
155
+ delete_option( 'fancybox_SWFHeight' );
156
+ delete_option( 'fancybox_SWFpadding' );
157
+ delete_option( 'fancybox_SWFtitleShow' );
158
+ delete_option( 'fancybox_SWFtitlePosition' );
159
+ delete_option( 'fancybox_SWFtitleFromAlt' );
160
+
161
+ // SVG.
162
+ delete_option( 'fancybox_autoAttributeSVG' );
163
+ delete_option( 'fancybox_SVGWidth' );
164
+ delete_option( 'fancybox_SVGHeight' );
165
+ delete_option( 'fancybox_SVGpadding' );
166
+ delete_option( 'fancybox_SVGtitleShow' );
167
+ delete_option( 'fancybox_SVGtitlePosition' );
168
+ delete_option( 'fancybox_SVGtitleFromAlt' );
169
+
170
+ // Youtube.
171
+ delete_option( 'fancybox_autoAttributeYoutube' );
172
+ delete_option( 'fancybox_YoutubeWidth' );
173
+ delete_option( 'fancybox_YoutubeHeight' );
174
+ delete_option( 'fancybox_Youtubepadding' );
175
+ delete_option( 'fancybox_YoutubetitleShow' );
176
+ delete_option( 'fancybox_YoutubetitlePosition' );
177
+ delete_option( 'fancybox_YoutubetitleFromAlt' );
178
+ delete_option( 'fancybox_YoutubenoCookie' );
179
+
180
+ // Vimeo.
181
+ delete_option( 'fancybox_autoAttributeVimeo' );
182
+ delete_option( 'fancybox_VimeoWidth' );
183
+ delete_option( 'fancybox_VimeoHeight' );
184
+ delete_option( 'fancybox_Vimeopadding' );
185
+ delete_option( 'fancybox_VimeotitleShow' );
186
+ delete_option( 'fancybox_VimeotitlePosition' );
187
+ delete_option( 'fancybox_VimeotitleFromAlt' );
188
+
189
+ // Dailymotion.
190
+ delete_option( 'fancybox_autoAttributeDailymotion' );
191
+ delete_option( 'fancybox_DailymotionWidth' );
192
+ delete_option( 'fancybox_DailymotionHeight' );
193
+ delete_option( 'fancybox_DailymotionPadding' );
194
+ delete_option( 'fancybox_DailymotiontitleShow' );
195
+ delete_option( 'fancybox_DailymotiontitlePosition' );
196
+ delete_option( 'fancybox_DailymotiontitleFromAlt' );
197
+
198
+ // Iframe.
199
+ delete_option( 'fancybox_iFramewidth' );
200
+ delete_option( 'fancybox_iFrameheight' );
201
+ delete_option( 'fancybox_iFramepadding' );
202
+ delete_option( 'fancybox_iFrametitleShow' );
203
+ delete_option( 'fancybox_iFrametitlePosition' );
204
+ delete_option( 'fancybox_iFrametitleFromAlt' );
205
+ delete_option( 'fancybox_allowFullScreen' );
206
+
207
+ // Google Maps.
208
+ delete_option( 'fancybox_enableGoogleMaps' ); // fb 2
209
+ // Instagram
210
+ delete_option( 'fancybox_enableInstagram' ); // fb 2
211
+
212
+ // Kilroy was here.
213
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
214
+ if ($blog_id)
215
+ error_log( $blog_id );
216
+ else
217
+ error_log( 'Easy FancyBox settings cleared on uninstall.' );
218
+ }
219
+ }
220
+ }
221
+
222
+ new easyFancyBox_Uninstall();
vendor/fancybox-1.3.4/blank.gif ADDED
Binary file
vendor/fancybox-1.3.4/fancy_close.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_loading.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_nav_left.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_nav_right.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_shadow_e.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_shadow_n.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_shadow_ne.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_shadow_nw.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_shadow_s.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_shadow_se.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_shadow_sw.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_shadow_w.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_title_left.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_title_main.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_title_over.png ADDED
Binary file
vendor/fancybox-1.3.4/fancy_title_right.png ADDED
Binary file
vendor/fancybox-1.3.4/fancybox-x.png ADDED
Binary file
vendor/fancybox-1.3.4/fancybox-y.png ADDED
Binary file
vendor/fancybox-1.3.4/fancybox.png ADDED
Binary file
vendor/fancybox-1.3.4/jquery.fancybox-1.3.4.css ADDED
@@ -0,0 +1,359 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * FancyBox - jQuery Plugin
3
+ * Simple and fancy lightbox alternative
4
+ *
5
+ * Examples and documentation at: http://fancybox.net
6
+ *
7
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
8
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Version: 1.3.4 (11/11/2010)
11
+ * Requires: jQuery v1.3+
12
+ *
13
+ * Dual licensed under the MIT and GPL licenses:
14
+ * http://www.opensource.org/licenses/mit-license.php
15
+ * http://www.gnu.org/licenses/gpl.html
16
+ */
17
+
18
+ #fancybox-loading {
19
+ position: fixed;
20
+ top: 50%;
21
+ left: 50%;
22
+ width: 40px;
23
+ height: 40px;
24
+ margin-top: -20px;
25
+ margin-left: -20px;
26
+ cursor: pointer;
27
+ overflow: hidden;
28
+ z-index: 1104;
29
+ display: none;
30
+ }
31
+
32
+ #fancybox-loading div {
33
+ position: absolute;
34
+ top: 0;
35
+ left: 0;
36
+ width: 40px;
37
+ height: 480px;
38
+ background-image: url('fancybox.png');
39
+ }
40
+
41
+ #fancybox-overlay {
42
+ position: absolute;
43
+ top: 0;
44
+ left: 0;
45
+ width: 100%;
46
+ z-index: 1100;
47
+ display: none;
48
+ }
49
+
50
+ #fancybox-tmp {
51
+ padding: 0;
52
+ margin: 0;
53
+ border: 0;
54
+ overflow: auto;
55
+ display: none;
56
+ }
57
+
58
+ #fancybox-wrap {
59
+ position: absolute;
60
+ top: 0;
61
+ left: 0;
62
+ padding: 20px;
63
+ z-index: 1101;
64
+ outline: none;
65
+ display: none;
66
+ }
67
+
68
+ #fancybox-outer {
69
+ position: relative;
70
+ width: 100%;
71
+ height: 100%;
72
+ background: #fff;
73
+ }
74
+
75
+ #fancybox-content {
76
+ width: 0;
77
+ height: 0;
78
+ padding: 0;
79
+ outline: none;
80
+ position: relative;
81
+ overflow: hidden;
82
+ z-index: 1102;
83
+ border: 0px solid #fff;
84
+ }
85
+
86
+ #fancybox-hide-sel-frame {
87
+ position: absolute;
88
+ top: 0;
89
+ left: 0;
90
+ width: 100%;
91
+ height: 100%;
92
+ background: transparent;
93
+ z-index: 1101;
94
+ }
95
+
96
+ #fancybox-close {
97
+ position: absolute;
98
+ top: -15px;
99
+ right: -15px;
100
+ width: 30px;
101
+ height: 30px;
102
+ background: transparent url('fancybox.png') -40px 0px;
103
+ cursor: pointer;
104
+ z-index: 1103;
105
+ display: none;
106
+ }
107
+
108
+ #fancybox-error {
109
+ color: #444;
110
+ font: normal 12px/20px Arial;
111
+ padding: 14px;
112
+ margin: 0;
113
+ }
114
+
115
+ #fancybox-img {
116
+ width: 100%;
117
+ height: 100%;
118
+ padding: 0;
119
+ margin: 0;
120
+ border: none;
121
+ outline: none;
122
+ line-height: 0;
123
+ vertical-align: top;
124
+ }
125
+
126
+ #fancybox-frame {
127
+ width: 100%;
128
+ height: 100%;
129
+ border: none;
130
+ display: block;
131
+ }
132
+
133
+ #fancybox-left, #fancybox-right {
134
+ position: absolute;
135
+ bottom: 0px;
136
+ height: 100%;
137
+ width: 35%;
138
+ cursor: pointer;
139
+ outline: none;
140
+ background: transparent url('blank.gif');
141
+ z-index: 1102;
142
+ display: none;
143
+ }
144
+
145
+ #fancybox-left {
146
+ left: 0px;
147
+ }
148
+
149
+ #fancybox-right {
150
+ right: 0px;
151
+ }
152
+
153
+ #fancybox-left-ico, #fancybox-right-ico {
154
+ position: absolute;
155
+ top: 50%;
156
+ left: -9999px;
157
+ width: 30px;
158
+ height: 30px;
159
+ margin-top: -15px;
160
+ cursor: pointer;
161
+ z-index: 1102;
162
+ display: block;
163
+ }
164
+
165
+ #fancybox-left-ico {
166
+ background-image: url('fancybox.png');
167
+ background-position: -40px -30px;
168
+ }
169
+
170
+ #fancybox-right-ico {
171
+ background-image: url('fancybox.png');
172
+ background-position: -40px -60px;
173
+ }
174
+
175
+ #fancybox-left:hover, #fancybox-right:hover {
176
+ visibility: visible; /* IE6 */
177
+ }
178
+
179
+ #fancybox-left:hover span {
180
+ left: 20px;
181
+ }
182
+
183
+ #fancybox-right:hover span {
184
+ left: auto;
185
+ right: 20px;
186
+ }
187
+
188
+ .fancybox-bg {
189
+ position: absolute;
190
+ padding: 0;
191
+ margin: 0;
192
+ border: 0;
193
+ width: 20px;
194
+ height: 20px;
195
+ z-index: 1001;
196
+ }
197
+
198
+ #fancybox-bg-n {
199
+ top: -20px;
200
+ left: 0;
201
+ width: 100%;
202
+ background-image: url('fancybox-x.png');
203
+ }
204
+
205
+ #fancybox-bg-ne {
206
+ top: -20px;
207
+ right: -20px;
208
+ background-image: url('fancybox.png');
209
+ background-position: -40px -162px;
210
+ }
211
+
212
+ #fancybox-bg-e {
213
+ top: 0;
214
+ right: -20px;
215
+ height: 100%;
216
+ background-image: url('fancybox-y.png');
217
+ background-position: -20px 0px;
218
+ }
219
+
220
+ #fancybox-bg-se {
221
+ bottom: -20px;
222
+ right: -20px;
223
+ background-image: url('fancybox.png');
224
+ background-position: -40px -182px;
225
+ }
226
+
227
+ #fancybox-bg-s {
228
+ bottom: -20px;
229
+ left: 0;
230
+ width: 100%;
231
+ background-image: url('fancybox-x.png');
232
+ background-position: 0px -20px;
233
+ }
234
+
235
+ #fancybox-bg-sw {
236
+ bottom: -20px;
237
+ left: -20px;
238
+ background-image: url('fancybox.png');
239
+ background-position: -40px -142px;
240
+ }
241
+
242
+ #fancybox-bg-w {
243
+ top: 0;
244
+ left: -20px;
245
+ height: 100%;
246
+ background-image: url('fancybox-y.png');
247
+ }
248
+
249
+ #fancybox-bg-nw {
250
+ top: -20px;
251
+ left: -20px;
252
+ background-image: url('fancybox.png');
253
+ background-position: -40px -122px;
254
+ }
255
+
256
+ #fancybox-title {
257
+ font-family: Helvetica;
258
+ font-size: 12px;
259
+ z-index: 1102;
260
+ }
261
+
262
+ .fancybox-title-inside {
263
+ padding-bottom: 10px;
264
+ text-align: center;
265
+ color: #333;
266
+ background: #fff;
267
+ position: relative;
268
+ }
269
+
270
+ .fancybox-title-outside {
271
+ padding-top: 10px;
272
+ color: #fff;
273
+ }
274
+
275
+ .fancybox-title-over {
276
+ position: absolute;
277
+ bottom: 0;
278
+ left: 0;
279
+ color: #FFF;
280
+ text-align: left;
281
+ }
282
+
283
+ #fancybox-title-over {
284
+ padding: 10px;
285
+ background-image: url('fancy_title_over.png');
286
+ display: block;
287
+ }
288
+
289
+ .fancybox-title-float {
290
+ position: absolute;
291
+ left: 0;
292
+ bottom: -20px;
293
+ height: 32px;
294
+ }
295
+
296
+ #fancybox-title-float-wrap {
297
+ border: none;
298
+ border-collapse: collapse;
299
+ width: auto;
300
+ }
301
+
302
+ #fancybox-title-float-wrap td {
303
+ border: none;
304
+ white-space: nowrap;
305
+ }
306
+
307
+ #fancybox-title-float-left {
308
+ padding: 0 0 0 15px;
309
+ background: url('fancybox.png') -40px -90px no-repeat;
310
+ }
311
+
312
+ #fancybox-title-float-main {
313
+ color: #FFF;
314
+ line-height: 29px;
315
+ font-weight: bold;
316
+ padding: 0 0 3px 0;
317
+ background: url('fancybox-x.png') 0px -40px;
318
+ }
319
+
320
+ #fancybox-title-float-right {
321
+ padding: 0 0 0 15px;
322
+ background: url('fancybox.png') -55px -90px no-repeat;
323
+ }
324
+
325
+ /* IE6 */
326
+
327
+ .fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
328
+
329
+ .fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
330
+ .fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
331
+
332
+ .fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
333
+ .fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
334
+ .fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
335
+ .fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
336
+
337
+ .fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
338
+ height: expression(this.parentNode.clientHeight + "px");
339
+ }
340
+
341
+ #fancybox-loading.fancybox-ie6 {
342
+ position: absolute; margin-top: 0;
343
+ top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
344
+ }
345
+
346
+ #fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
347
+
348
+ /* IE6, IE7, IE8 */
349
+
350
+ .fancybox-ie .fancybox-bg { background: transparent !important; }
351
+
352
+ .fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
353
+ .fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
354
+ .fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
355
+ .fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
356
+ .fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
357
+ .fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
358
+ .fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
359
+ .fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
js/jquery.fancybox.js → vendor/fancybox-1.3.4/jquery.fancybox-1.3.4.js RENAMED
@@ -7,36 +7,33 @@
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.24 (2019/04/06)
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
 
28
  titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
29
 
30
- isIE6 = navigator.userAgent.match(/msie [6]/i) && !window.XMLHttpRequest,
31
-
32
- isTouch = document.createTouch !== undefined;
33
 
34
  /*
35
- * Private methods
36
  */
37
 
38
  _abort = function() {
39
- $.fancybox.hideActivity();
40
 
41
  imgPreloader.onerror = imgPreloader.onload = null;
42
 
@@ -47,31 +44,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
  },
70
 
71
  _start = function() {
72
  var obj = selectedArray[ selectedIndex ],
73
- href,
74
- type,
75
  title,
76
  str,
77
  emb,
@@ -81,15 +74,6 @@
81
 
82
  selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
83
 
84
- if ( document.documentElement.clientWidth < selectedOpts.minViewportWidth ) {
85
- busy = false;
86
- return;
87
- }
88
-
89
- if ('object' === typeof arguments[0] && 'click' === arguments[0].type) {
90
- arguments[0].preventDefault();
91
- }
92
-
93
  ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
94
 
95
  if (ret === false) {
@@ -102,11 +86,11 @@
102
  title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
103
 
104
  if (obj.nodeName && !selectedOpts.orig) {
105
- selectedOpts.orig = $(obj).find("img:first").length ? $(obj).find("img:first") : $(obj);
106
  }
107
 
108
- if (title === '' && selectedOpts.orig) {
109
- title = selectedOpts.orig.attr('title') || (selectedOpts.titleFromAlt ? selectedOpts.orig.attr('alt') : '');
110
  }
111
 
112
  href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
@@ -125,21 +109,15 @@
125
  } else if (selectedOpts.content) {
126
  type = 'html';
127
 
128
- } else if ( $(obj).hasClass('iframe') ) {
129
- type = 'iframe';
130
-
131
  } else if (href) {
132
- if (href.match(imgRegExp) || $(obj).hasClass("image")) {
133
  type = 'image';
134
 
135
  } else if (href.match(swfRegExp)) {
136
  type = 'swf';
137
 
138
- } else if (href.match(svgRegExp)) {
139
- type = 'svg';
140
-
141
- } else if (href.match(pdfRegExp)) {
142
- type = 'pdf';
143
 
144
  } else if (href.indexOf("#") === 0) {
145
  type = 'inline';
@@ -150,14 +128,10 @@
150
  }
151
 
152
  if (!type) {
153
- _error('No content type found.');
154
  return;
155
  }
156
 
157
- if ($(obj).hasClass('modal')) {
158
- selectedOpts.modal = true;
159
- }
160
-
161
  if (type == 'inline') {
162
  obj = href.substr(href.indexOf("#"));
163
  type = $(obj).length > 0 ? 'inline' : 'ajax';
@@ -172,7 +146,7 @@
172
  selectedOpts.width = 'auto';
173
  selectedOpts.height = 'auto';
174
  } else {
175
- selectedOpts.autoDimensions = false;
176
  }
177
  }
178
 
@@ -189,8 +163,8 @@
189
 
190
  tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
191
 
192
- $('.fancybox-inline-tmp').off('fancybox-cancel').on('fancybox-change', function() {
193
- $(this).replaceWith(content.children());
194
  });
195
 
196
  switch (type) {
@@ -208,10 +182,10 @@
208
  $('<div class="fancybox-inline-tmp" />')
209
  .hide()
210
  .insertBefore( $(obj) )
211
- .on('fancybox-cleanup', function() {
212
- $(this).replaceWith(content.find(obj));
213
- }).on('fancybox-cancel', function() {
214
- $(this).replaceWith(tmp.find(obj));
215
  });
216
 
217
  $(obj).appendTo(tmp);
@@ -220,8 +194,6 @@
220
  break;
221
 
222
  case 'image':
223
- selectedOpts.keepRatio = true;
224
-
225
  busy = false;
226
 
227
  $.fancybox.showActivity();
@@ -229,7 +201,7 @@
229
  imgPreloader = new Image();
230
 
231
  imgPreloader.onerror = function() {
232
- _error('No image found.');
233
  };
234
 
235
  imgPreloader.onload = function() {
@@ -245,9 +217,8 @@
245
 
246
  case 'swf':
247
  selectedOpts.scrolling = 'no';
248
- selectedOpts.keepRatio = true;
249
 
250
- 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>';
251
  emb = '';
252
 
253
  $.each(selectedOpts.swf, function(name, val) {
@@ -262,29 +233,6 @@
262
  _process_inline();
263
  break;
264
 
265
- case 'svg':
266
- selectedOpts.scrolling = 'no';
267
- selectedOpts.keepRatio = true;
268
-
269
- str = '<object type="image/svg+xml" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '" data="' + href + '"></object>';
270
-
271
- tmp.html(str);
272
-
273
- _process_inline();
274
- break;
275
-
276
- case 'pdf':
277
- selectedOpts.scrolling = 'no';
278
- selectedOpts.enableKeyboardNav = false;
279
- selectedOpts.showNavArrows = false;
280
-
281
- 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>';
282
-
283
- tmp.html(str);
284
-
285
- _process_inline();
286
- break;
287
-
288
  case 'ajax':
289
  busy = false;
290
 
@@ -297,7 +245,7 @@
297
  data : selectedOpts.ajax.data || {},
298
  error : function(XMLHttpRequest, textStatus, errorThrown) {
299
  if ( XMLHttpRequest.status > 0 ) {
300
- _error(errorThrown);
301
  }
302
  },
303
  success : function(data, textStatus, XMLHttpRequest) {
@@ -307,56 +255,47 @@
307
  ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
308
 
309
  if (ret === false) {
310
- $.fancybox.hideActivity();
311
  return;
312
  } else if (typeof ret == 'string' || typeof ret == 'object') {
313
  data = ret;
314
  }
315
  }
316
 
317
- if ( data.indexOf("<!DOCTYPE") > -1 || data.indexOf("<html") > -1 || data.indexOf("<body") > -1 ) {
318
- _error('Unexpected response.');
319
- } else {
320
- tmp.html( data );
321
- _process_inline();
322
- }
323
  }
324
  }
325
  }));
 
326
  break;
327
 
328
  case 'iframe':
329
- selectedOpts.enableKeyboardNav = false;
330
- selectedOpts.showNavArrows = false;
331
-
332
- $.fancybox.showActivity();
333
-
334
  _show();
335
  break;
336
  }
337
  },
338
 
339
  _process_inline = function() {
340
- var w = selectedOpts.width,
341
- h = selectedOpts.height,
342
- ww = $(window).width() == 0 ? window.innerWidth : $(window).width(),
343
- wh = $(window).height() == 0 ? window.innerHeight : $(window).height();
344
 
345
  if (w.toString().indexOf('%') > -1) {
346
- w = parseInt( (ww - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
347
 
348
  } else {
349
- w = w == 'auto' ? 'auto' : w + 'px';
350
  }
351
 
352
  if (h.toString().indexOf('%') > -1) {
353
- h = parseInt( (wh - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
354
 
355
  } else {
356
- h = h == 'auto' ? 'auto' : h + 'px';
357
  }
358
 
359
- tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow:' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
360
 
361
  selectedOpts.width = tmp.width();
362
  selectedOpts.height = tmp.height();
@@ -380,12 +319,10 @@
380
  _show = function() {
381
  var pos, equal;
382
 
383
- if (selectedOpts.type !== 'iframe') {
384
- $.fancybox.hideActivity();
385
- }
386
 
387
  if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
388
- $('.fancybox-inline-tmp').trigger('fancybox-cancel');
389
 
390
  busy = false;
391
  return;
@@ -393,10 +330,10 @@
393
 
394
  busy = true;
395
 
396
- $(content.add( overlay )).off();
397
 
398
- $(window).off("orientationchange.fb resize.fb scroll.fb");
399
- $(document).off('keydown.fb');
400
 
401
  if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
402
  wrap.css('height', wrap.height());
@@ -407,8 +344,6 @@
407
  currentOpts = selectedOpts;
408
 
409
  if (currentOpts.overlayShow) {
410
- $('html').addClass('fancybox-active');
411
-
412
  overlay.css({
413
  'background-color' : currentOpts.overlayColor,
414
  'opacity' : currentOpts.overlayOpacity,
@@ -424,6 +359,7 @@
424
  this.style.visibility = 'inherit';
425
  });
426
  }
 
427
  overlay.show();
428
  }
429
  } else {
@@ -453,7 +389,7 @@
453
  content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
454
  };
455
 
456
- $('.fancybox-inline-tmp').trigger('fancybox-change');
457
 
458
  content
459
  .empty()
@@ -461,11 +397,12 @@
461
  .css({
462
  'border-width' : currentOpts.padding,
463
  'width' : final_pos.width - currentOpts.padding * 2,
464
- 'height' : currentOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
465
  });
466
 
467
  if (equal) {
468
  finish_resizing();
 
469
  } else {
470
  fx.prop = 0;
471
 
@@ -508,14 +445,14 @@
508
  return;
509
  }
510
 
511
- if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
512
- title.show();
513
  }
514
 
515
  content
516
  .css({
517
  'width' : final_pos.width - currentOpts.padding * 2,
518
- 'height' : currentOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
519
  })
520
  .html( tmp.contents() );
521
 
@@ -527,7 +464,7 @@
527
  _format_title = function(title) {
528
  if (title && title.length) {
529
  if (currentOpts.titlePosition == 'float') {
530
- 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">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
531
  }
532
 
533
  return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
@@ -570,10 +507,12 @@
570
  'width' : final_pos.width - (currentOpts.padding * 2),
571
  'marginLeft' : currentOpts.padding,
572
  'marginRight' : currentOpts.padding
573
- }).appendTo( outer );
574
 
575
  titleHeight = title.outerHeight(true);
576
 
 
 
577
  final_pos.height += titleHeight;
578
  break;
579
 
@@ -589,8 +528,8 @@
589
 
590
  case 'float':
591
  title
592
- .css('left', parseInt( ( title.width() - final_pos.width ) / 2, 10 ) * -1 )
593
- .appendTo( outer );
594
  break;
595
 
596
  default:
@@ -609,21 +548,19 @@
609
 
610
  _set_navigation = function() {
611
  if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
612
- $(document).on('keydown.fb', function(e) {
613
  if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
614
  e.preventDefault();
615
  $.fancybox.close();
 
616
  } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
617
  e.preventDefault();
618
  $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
619
- } else if ((e.keyCode == 9) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
620
- e.preventDefault();
621
- $.fancybox[ e.shiftKey ? 'prev' : 'next']();
622
  }
623
  });
624
  }
625
 
626
- if (!currentOpts.showNavArrows) {
627
  nav_left.hide();
628
  nav_right.hide();
629
  return;
@@ -640,12 +577,12 @@
640
 
641
  _finish = function () {
642
  if (!$.support.opacity) {
643
- content.css('filter', 0);
644
- wrap.css('filter', 0);
645
  }
646
 
647
- if (currentOpts.autoDimensions) {
648
- content.css('height','auto');
649
  }
650
 
651
  wrap.css('height', 'auto');
@@ -659,41 +596,23 @@
659
  }
660
 
661
  _set_navigation();
662
-
663
  if (currentOpts.hideOnContentClick) {
664
- content.on('click', $.fancybox.close);
665
  }
666
 
667
  if (currentOpts.hideOnOverlayClick) {
668
- overlay.on('click', $.fancybox.close);
669
  }
670
 
671
- if (currentOpts.autoResize) {
672
- $(window).on("resize.fb", $.fancybox.resize);
673
- }
674
-
675
- if (currentOpts.centerOnScroll && !isTouch) {
676
- $(window).on("scroll.fb", $.fancybox.center);
677
- }
678
 
679
- if ($.fn.mousewheel) {
680
- wrap.on('mousewheel.fb', function(e, delta) {
681
- if (busy) {
682
- e.preventDefault();
683
- } else if ( currentOpts.type == 'image' && ( $(e.target).outerHeight() == 0 || $(e.target).prop('scrollHeight') === $(e.target).outerHeight() ) ) {
684
- e.preventDefault();
685
- $.fancybox[ delta > 0 ? 'prev' : 'next' ]();
686
- }
687
- });
688
  }
689
 
690
  if (currentOpts.type == 'iframe') {
691
- $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '"' + (navigator.userAgent.match(/msie [6]/i) ? ' allowtransparency="true""' : '')
692
- + ' style="border:0;margin:0;overflow:' + (currentOpts.scrolling == 'auto' ? 'auto' : (currentOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + '" src="'
693
- + currentOpts.href + '"' + (false === currentOpts.allowfullscreen ? '' : ' allowfullscreen') + ' allow="autoplay; encrypted-media" tabindex="999"></iframe>')
694
- .appendTo(content).on('load',function() {
695
- $.fancybox.hideActivity();
696
- }).focus();
697
  }
698
 
699
  wrap.show();
@@ -704,71 +623,29 @@
704
 
705
  currentOpts.onComplete(currentArray, currentIndex, currentOpts);
706
 
707
- if (currentArray.length > 1) {
708
- _preload_next();
709
- _preload_prev();
710
- }
711
  },
712
 
713
- _preload_next = function() {
714
- var pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex + 1;
715
-
716
- if ( pos >= currentArray.length ) {
717
- if (currentOpts.cyclic) {
718
- pos = 0;
719
- } else {
720
- return;
721
- }
722
- }
723
-
724
- if ( pos == currentIndex ) {
725
- currentOpts.enableKeyboardNav = false;
726
- wrap.off('mousewheel.fb');
727
- nav_right.hide();
728
- return;
729
- }
730
-
731
- if ( _preload_image( pos ) ) {
732
- return;
733
- } else {
734
- _preload_next( pos + 1 );
735
- }
736
- },
737
 
738
- _preload_prev = function() {
739
- var pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex - 1;
740
 
741
- if ( pos < 0 ) {
742
- if (currentOpts.cyclic) {
743
- pos = currentArray.length - 1;
744
- } else {
745
- return;
746
  }
747
  }
748
 
749
- if ( pos == currentIndex ) {
750
- currentOpts.enableKeyboardNav = false;
751
- wrap.off('mousewheel.fb');
752
- nav_left.hide();
753
- return;
754
- }
755
-
756
- if ( _preload_image( pos ) ) {
757
- return;
758
- } else {
759
- _preload_prev( pos - 1 );
760
- }
761
- },
762
-
763
- _preload_image = function(pos) {
764
- var objNext, obj = currentArray[ pos ];
765
 
766
- if ( typeof obj !== 'undefined' && typeof obj.href !== 'undefined' && obj.href !== currentOpts.href && (obj.href.match(imgRegExp) || $(obj).hasClass("image")) ) {
767
- objNext = new Image();
768
- objNext.src = obj.href;
769
- return true;
770
- } else {
771
- return false;
772
  }
773
  },
774
 
@@ -794,27 +671,18 @@
794
  },
795
 
796
  _get_viewport = function() {
797
- var w = !isTouch && window.innerWidth && document.documentElement.clientWidth ?
798
- Math.min(window.innerWidth, document.documentElement.clientWidth) :
799
- window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth,
800
- h = !isTouch && window.innerHeight && document.documentElement.clientHeight ?
801
- Math.min(window.innerHeight, document.documentElement.clientHeight) :
802
- window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight,
803
- margin;
804
-
805
- margin = arguments[0] === true ? 0 : currentOpts.margin;
806
-
807
  return [
808
- w - (margin * 2),
809
- h - (margin * 2),
810
- $(document).scrollLeft() + margin,
811
- $(document).scrollTop() + margin
812
  ];
813
  },
814
 
815
  _get_zoom_to = function () {
816
  var view = _get_viewport(),
817
  to = {},
 
818
  double_padding = currentOpts.padding * 2,
819
  ratio;
820
 
@@ -830,9 +698,9 @@
830
  to.height = currentOpts.height + double_padding;
831
  }
832
 
833
- if (currentOpts.autoScale && (to.width > view[0] || to.height > view[1])) {
834
- if (currentOpts.keepRatio) {
835
- ratio = currentOpts.width / currentOpts.height;
836
 
837
  if ((to.width ) > view[0]) {
838
  to.width = view[0];
@@ -843,6 +711,7 @@
843
  to.height = view[1];
844
  to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
845
  }
 
846
  } else {
847
  to.width = Math.min(to.width, view[0]);
848
  to.height = Math.min(to.height, view[1]);
@@ -882,7 +751,7 @@
882
  from = {
883
  width : pos.width + (currentOpts.padding * 2),
884
  height : pos.height + (currentOpts.padding * 2),
885
- top : pos.top - currentOpts.padding - 20,
886
  left : pos.left - currentOpts.padding - 20
887
  };
888
 
@@ -892,8 +761,8 @@
892
  from = {
893
  width : currentOpts.padding * 2,
894
  height : currentOpts.padding * 2,
895
- top : parseInt((view[3] + view[1]) * 0.5, 10),
896
- left : parseInt((view[2] + view[0]) * 0.5, 10)
897
  };
898
  }
899
 
@@ -906,13 +775,13 @@
906
  return;
907
  }
908
 
909
- $('div', loading).css('top', (loadingFrame * - 40 ) + 'px');
910
 
911
  loadingFrame = (loadingFrame + 1) % 12;
912
  };
913
 
914
  /*
915
- * Public methods
916
  */
917
 
918
  $.fn.fancybox = function(options) {
@@ -922,8 +791,10 @@
922
 
923
  $(this)
924
  .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
925
- .off('click.fb')
926
- .on('click.fb', function(e) {
 
 
927
  if (busy) {
928
  return;
929
  }
@@ -937,14 +808,15 @@
937
 
938
  var rel = $(this).attr('rel') || '';
939
 
940
- if (rel == '' || rel.replace(/alternate|external|help|license|nofollow|noreferrer|noopener|\s+/gi,'') == '') {
941
  selectedArray.push(this);
 
942
  } else {
943
- selectedArray = $('a[rel="' + rel + '"], area[rel="' + rel + '"]');
944
  selectedIndex = selectedArray.index( this );
945
  }
946
 
947
- _start(e);
948
 
949
  return;
950
  });
@@ -965,7 +837,7 @@
965
  selectedArray = [];
966
  selectedIndex = parseInt(opts.index, 10) || 0;
967
 
968
- if ( $.isArray(obj) ) {
969
  for (var i = 0, j = obj.length; i < j; i++) {
970
  if (typeof obj[i] == 'object') {
971
  $(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
@@ -977,7 +849,7 @@
977
  selectedArray = jQuery.merge(selectedArray, obj);
978
 
979
  } else {
980
- if ( typeof obj == 'object' ) {
981
  $(obj).data('fancybox', $.extend({}, opts, obj));
982
  } else {
983
  obj = $({}).data('fancybox', $.extend({content : obj}, opts));
@@ -997,7 +869,7 @@
997
  clearInterval(loadingTimer);
998
 
999
  loading.show();
1000
- loadingTimer = setInterval( _animate_loading, 66 );
1001
  };
1002
 
1003
  $.fancybox.hideActivity = function() {
@@ -1005,47 +877,11 @@
1005
  };
1006
 
1007
  $.fancybox.next = function() {
1008
- var obj, pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex + 1;
1009
-
1010
- if (pos >= currentArray.length) {
1011
- if (currentOpts.cyclic) {
1012
- pos = 0;
1013
- } else {
1014
- return;
1015
- }
1016
- }
1017
-
1018
- obj = currentArray[pos];
1019
-
1020
- if ( pos != currentIndex && typeof obj !== 'undefined' && typeof obj.href !== 'undefined' && obj.href === currentOpts.href ) {
1021
- $.fancybox.next( pos + 1 );
1022
- } else {
1023
- $.fancybox.pos( pos );
1024
- }
1025
-
1026
- return;
1027
  };
1028
 
1029
  $.fancybox.prev = function() {
1030
- var obj, pos = typeof arguments[0] == 'number' ? arguments[0] : currentIndex - 1;
1031
-
1032
- if (pos < 0) {
1033
- if (currentOpts.cyclic) {
1034
- pos = currentArray.length - 1;
1035
- } else {
1036
- return;
1037
- }
1038
- }
1039
-
1040
- obj = currentArray[pos];
1041
-
1042
- if ( pos != currentIndex && typeof obj !== 'undefined' && typeof obj.href !== 'undefined' && obj.href === currentOpts.href ) {
1043
- $.fancybox.prev( pos - 1 );
1044
- } else {
1045
- $.fancybox.pos( pos );
1046
- }
1047
-
1048
- return;
1049
  };
1050
 
1051
  $.fancybox.pos = function(pos) {
@@ -1060,6 +896,10 @@
1060
  if (pos > -1 && pos < currentArray.length) {
1061
  selectedIndex = pos;
1062
  _start();
 
 
 
 
1063
  }
1064
 
1065
  return;
@@ -1072,7 +912,7 @@
1072
 
1073
  busy = true;
1074
 
1075
- $('.fancybox-inline-tmp').trigger('fancybox-cancel');
1076
 
1077
  _abort();
1078
 
@@ -1098,13 +938,12 @@
1098
 
1099
  $(close.add( nav_left ).add( nav_right )).hide();
1100
 
1101
- $(content.add( overlay )).off();
1102
 
1103
- $(window).off("orientationchange.fb resize.fb scroll.fb mousewheel.fb");
1104
- $(document).off('keydown.fb');
1105
 
1106
- /* causes an extra entry in the browser history. why is this needed at all?
1107
- content.find('iframe#fancybox-frame').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');*/
1108
 
1109
  if (currentOpts.titlePosition !== 'inside') {
1110
  title.empty();
@@ -1118,7 +957,7 @@
1118
  title.empty().hide();
1119
  wrap.hide();
1120
 
1121
- $('.fancybox-inline-tmp').trigger('fancybox-cleanup');
1122
 
1123
  content.empty();
1124
 
@@ -1137,7 +976,7 @@
1137
  var pos = wrap.position();
1138
 
1139
  final_pos = {
1140
- top : pos.top ,
1141
  left : pos.left,
1142
  width : wrap.width(),
1143
  height : wrap.height()
@@ -1161,74 +1000,28 @@
1161
  } else {
1162
  wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
1163
  }
1164
-
1165
- $('html').removeClass('fancybox-active');
1166
  };
1167
 
1168
  $.fancybox.resize = function() {
1169
- var pos;
1170
-
1171
- clearTimeout( resize_timeout );
1172
-
1173
- resize_timeout = setTimeout( function() {
1174
- var finish_resizing = function() {
1175
- if (selectedOpts.autoDimensions) {
1176
- content.css('height','auto');
1177
- }
1178
-
1179
- wrap.css('height', 'auto');
1180
-
1181
- if (titleStr && titleStr.length) {
1182
- title.show();
1183
- }
1184
-
1185
- busy = false;
1186
-
1187
- $.fancybox.center(true);
1188
- };
1189
-
1190
- if (overlay.is(':visible')) {
1191
- overlay.css('height', $(document).height());
1192
- }
1193
-
1194
- pos = wrap.position(),
1195
-
1196
- start_pos = {
1197
- top : pos.top,
1198
- left : pos.left,
1199
- width : wrap.width(),
1200
- height : wrap.height()
1201
- };
1202
-
1203
- final_pos = _get_zoom_to();
1204
-
1205
- busy = true;
1206
-
1207
- _process_title();
1208
-
1209
- fx.prop = 0;
1210
 
1211
- $(fx).animate({prop: 1}, {
1212
- duration : currentOpts.changeSpeed,
1213
- easing : currentOpts.easingChange,
1214
- step : _draw,
1215
- complete : finish_resizing
1216
- });
1217
- }, 500 );
1218
  };
1219
 
1220
  $.fancybox.center = function() {
1221
  var view, align;
1222
 
1223
  if (busy) {
1224
- return;
1225
  }
1226
 
1227
  align = arguments[0] === true ? 1 : 0;
1228
- view = _get_viewport(true);
1229
 
1230
- if (!align && ((wrap.width() + 40) > view[0] || (wrap.height() + 40) > view[1])) {
1231
- return;
1232
  }
1233
 
1234
  wrap
@@ -1236,7 +1029,7 @@
1236
  .animate({
1237
  'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
1238
  'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
1239
- }, typeof arguments[0] == 'number' ? arguments[0] : 300);
1240
  };
1241
 
1242
  $.fancybox.init = function() {
@@ -1260,8 +1053,8 @@
1260
  close = $('<a id="fancybox-close"></a>'),
1261
  title = $('<div id="fancybox-title"></div>'),
1262
 
1263
- nav_left = $('<a id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
1264
- nav_right = $('<a id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
1265
  );
1266
 
1267
  close.click($.fancybox.close);
@@ -1277,6 +1070,18 @@
1277
  $.fancybox.next();
1278
  });
1279
 
 
 
 
 
 
 
 
 
 
 
 
 
1280
  if (!$.support.opacity) {
1281
  wrap.addClass('fancybox-ie');
1282
  }
@@ -1285,7 +1090,7 @@
1285
  loading.addClass('fancybox-ie6');
1286
  wrap.addClass('fancybox-ie6');
1287
 
1288
- $('<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(outer);
1289
  }
1290
  };
1291
 
@@ -1295,7 +1100,6 @@
1295
  opacity : false,
1296
  modal : false,
1297
  cyclic : false,
1298
- allowfullscreen : false,
1299
  scrolling : 'auto', // 'auto', 'yes' or 'no'
1300
 
1301
  width : 560,
@@ -1304,13 +1108,9 @@
1304
  autoScale : true,
1305
  autoDimensions : true,
1306
  centerOnScroll : false,
1307
- autoResize : true,
1308
- keepRatio : false,
1309
- minViewportWidth : 0,
1310
 
1311
  ajax : {},
1312
- swf : { wmode: 'opaque' },
1313
- svg : { wmode: 'opaque' },
1314
 
1315
  hideOnOverlayClick : true,
1316
  hideOnContentClick : false,
@@ -1322,7 +1122,7 @@
1322
  titleShow : true,
1323
  titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
1324
  titleFormat : null,
1325
- titleFromAlt : true,
1326
 
1327
  transitionIn : 'fade', // 'elastic', 'fade' or 'none'
1328
  transitionOut : 'fade', // 'elastic', 'fade' or 'none'
@@ -1353,4 +1153,4 @@
1353
  $.fancybox.init();
1354
  });
1355
 
1356
- })(jQuery);
7
  * Copyright (c) 2008 - 2010 Janis Skarnelis
8
  * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
  *
10
+ * Version: 1.3.4 (11/11/2010)
11
+ * Requires: jQuery v1.3+
12
  *
13
  * Dual licensed under the MIT and GPL licenses:
14
  * http://www.opensource.org/licenses/mit-license.php
15
  * http://www.gnu.org/licenses/gpl.html
16
  */
 
 
17
 
18
+ ;(function($) {
19
+ var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
20
 
21
+ selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
22
 
23
+ ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,
24
 
25
  loadingTimer, loadingFrame = 1,
26
 
27
  titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
28
 
29
+ isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
 
 
30
 
31
  /*
32
+ * Private methods
33
  */
34
 
35
  _abort = function() {
36
+ loading.hide();
37
 
38
  imgPreloader.onerror = imgPreloader.onload = null;
39
 
44
  tmp.empty();
45
  },
46
 
47
+ _error = function() {
48
  if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
49
+ loading.hide();
50
  busy = false;
51
  return;
52
  }
53
 
 
 
 
 
54
  selectedOpts.titleShow = false;
55
 
56
  selectedOpts.width = 'auto';
57
  selectedOpts.height = 'auto';
58
 
59
+ tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' );
60
 
61
  _process_inline();
62
  },
63
 
64
  _start = function() {
65
  var obj = selectedArray[ selectedIndex ],
66
+ href,
67
+ type,
68
  title,
69
  str,
70
  emb,
74
 
75
  selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
76
 
 
 
 
 
 
 
 
 
 
77
  ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
78
 
79
  if (ret === false) {
86
  title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
87
 
88
  if (obj.nodeName && !selectedOpts.orig) {
89
+ selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
90
  }
91
 
92
+ if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
93
+ title = selectedOpts.orig.attr('alt');
94
  }
95
 
96
  href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
109
  } else if (selectedOpts.content) {
110
  type = 'html';
111
 
 
 
 
112
  } else if (href) {
113
+ if (href.match(imgRegExp)) {
114
  type = 'image';
115
 
116
  } else if (href.match(swfRegExp)) {
117
  type = 'swf';
118
 
119
+ } else if ($(obj).hasClass("iframe")) {
120
+ type = 'iframe';
 
 
 
121
 
122
  } else if (href.indexOf("#") === 0) {
123
  type = 'inline';
128
  }
129
 
130
  if (!type) {
131
+ _error();
132
  return;
133
  }
134
 
 
 
 
 
135
  if (type == 'inline') {
136
  obj = href.substr(href.indexOf("#"));
137
  type = $(obj).length > 0 ? 'inline' : 'ajax';
146
  selectedOpts.width = 'auto';
147
  selectedOpts.height = 'auto';
148
  } else {
149
+ selectedOpts.autoDimensions = false;
150
  }
151
  }
152
 
163
 
164
  tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
165
 
166
+ $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
167
+ $(this).replaceWith(content.children());
168
  });
169
 
170
  switch (type) {
182
  $('<div class="fancybox-inline-tmp" />')
183
  .hide()
184
  .insertBefore( $(obj) )
185
+ .bind('fancybox-cleanup', function() {
186
+ $(this).replaceWith(content.children());
187
+ }).bind('fancybox-cancel', function() {
188
+ $(this).replaceWith(tmp.children());
189
  });
190
 
191
  $(obj).appendTo(tmp);
194
  break;
195
 
196
  case 'image':
 
 
197
  busy = false;
198
 
199
  $.fancybox.showActivity();
201
  imgPreloader = new Image();
202
 
203
  imgPreloader.onerror = function() {
204
+ _error();
205
  };
206
 
207
  imgPreloader.onload = function() {
217
 
218
  case 'swf':
219
  selectedOpts.scrolling = 'no';
 
220
 
221
+ str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
222
  emb = '';
223
 
224
  $.each(selectedOpts.swf, function(name, val) {
233
  _process_inline();
234
  break;
235
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  case 'ajax':
237
  busy = false;
238
 
245
  data : selectedOpts.ajax.data || {},
246
  error : function(XMLHttpRequest, textStatus, errorThrown) {
247
  if ( XMLHttpRequest.status > 0 ) {
248
+ _error();
249
  }
250
  },
251
  success : function(data, textStatus, XMLHttpRequest) {
255
  ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
256
 
257
  if (ret === false) {
258
+ loading.hide();
259
  return;
260
  } else if (typeof ret == 'string' || typeof ret == 'object') {
261
  data = ret;
262
  }
263
  }
264
 
265
+ tmp.html( data );
266
+ _process_inline();
 
 
 
 
267
  }
268
  }
269
  }));
270
+
271
  break;
272
 
273
  case 'iframe':
 
 
 
 
 
274
  _show();
275
  break;
276
  }
277
  },
278
 
279
  _process_inline = function() {
280
+ var
281
+ w = selectedOpts.width,
282
+ h = selectedOpts.height;
 
283
 
284
  if (w.toString().indexOf('%') > -1) {
285
+ w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
286
 
287
  } else {
288
+ w = w == 'auto' ? 'auto' : w + 'px';
289
  }
290
 
291
  if (h.toString().indexOf('%') > -1) {
292
+ h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
293
 
294
  } else {
295
+ h = h == 'auto' ? 'auto' : h + 'px';
296
  }
297
 
298
+ tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
299
 
300
  selectedOpts.width = tmp.width();
301
  selectedOpts.height = tmp.height();
319
  _show = function() {
320
  var pos, equal;
321
 
322
+ loading.hide();
 
 
323
 
324
  if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
325
+ $.event.trigger('fancybox-cancel');
326
 
327
  busy = false;
328
  return;
330
 
331
  busy = true;
332
 
333
+ $(content.add( overlay )).unbind();
334
 
335
+ $(window).unbind("resize.fb scroll.fb");
336
+ $(document).unbind('keydown.fb');
337
 
338
  if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
339
  wrap.css('height', wrap.height());
344
  currentOpts = selectedOpts;
345
 
346
  if (currentOpts.overlayShow) {
 
 
347
  overlay.css({
348
  'background-color' : currentOpts.overlayColor,
349
  'opacity' : currentOpts.overlayOpacity,
359
  this.style.visibility = 'inherit';
360
  });
361
  }
362
+
363
  overlay.show();
364
  }
365
  } else {
389
  content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
390
  };
391
 
392
+ $.event.trigger('fancybox-change');
393
 
394
  content
395
  .empty()
397
  .css({
398
  'border-width' : currentOpts.padding,
399
  'width' : final_pos.width - currentOpts.padding * 2,
400
+ 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
401
  });
402
 
403
  if (equal) {
404
  finish_resizing();
405
+
406
  } else {
407
  fx.prop = 0;
408
 
445
  return;
446
  }
447
 
448
+ if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
449
+ title.show();
450
  }
451
 
452
  content
453
  .css({
454
  'width' : final_pos.width - currentOpts.padding * 2,
455
+ 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
456
  })
457
  .html( tmp.contents() );
458
 
464
  _format_title = function(title) {
465
  if (title && title.length) {
466
  if (currentOpts.titlePosition == 'float') {
467
+ return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
468
  }
469
 
470
  return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
507
  'width' : final_pos.width - (currentOpts.padding * 2),
508
  'marginLeft' : currentOpts.padding,
509
  'marginRight' : currentOpts.padding
510
+ });
511
 
512
  titleHeight = title.outerHeight(true);
513
 
514
+ title.appendTo( outer );
515
+
516
  final_pos.height += titleHeight;
517
  break;
518
 
528
 
529
  case 'float':
530
  title
531
+ .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
532
+ .appendTo( wrap );
533
  break;
534
 
535
  default:
548
 
549
  _set_navigation = function() {
550
  if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
551
+ $(document).bind('keydown.fb', function(e) {
552
  if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
553
  e.preventDefault();
554
  $.fancybox.close();
555
+
556
  } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
557
  e.preventDefault();
558
  $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
 
 
 
559
  }
560
  });
561
  }
562
 
563
+ if (!currentOpts.showNavArrows) {
564
  nav_left.hide();
565
  nav_right.hide();
566
  return;
577
 
578
  _finish = function () {
579
  if (!$.support.opacity) {
580
+ content.get(0).style.removeAttribute('filter');
581
+ wrap.get(0).style.removeAttribute('filter');
582
  }
583
 
584
+ if (selectedOpts.autoDimensions) {
585
+ content.css('height', 'auto');
586
  }
587
 
588
  wrap.css('height', 'auto');
596
  }
597
 
598
  _set_navigation();
599
+
600
  if (currentOpts.hideOnContentClick) {
601
+ content.bind('click', $.fancybox.close);
602
  }
603
 
604
  if (currentOpts.hideOnOverlayClick) {
605
+ overlay.bind('click', $.fancybox.close);
606
  }
607
 
608
+ $(window).bind("resize.fb", $.fancybox.resize);
 
 
 
 
 
 
609
 
610
+ if (currentOpts.centerOnScroll) {
611
+ $(window).bind("scroll.fb", $.fancybox.center);
 
 
 
 
 
 
 
612
  }
613
 
614
  if (currentOpts.type == 'iframe') {
615
+ $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content);
 
 
 
 
 
616
  }
617
 
618
  wrap.show();
623
 
624
  currentOpts.onComplete(currentArray, currentIndex, currentOpts);
625
 
626
+ _preload_images();
 
 
 
627
  },
628
 
629
+ _preload_images = function() {
630
+ var href,
631
+ objNext;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
632
 
633
+ if ((currentArray.length -1) > currentIndex) {
634
+ href = currentArray[ currentIndex + 1 ].href;
635
 
636
+ if (typeof href !== 'undefined' && href.match(imgRegExp)) {
637
+ objNext = new Image();
638
+ objNext.src = href;
 
 
639
  }
640
  }
641
 
642
+ if (currentIndex > 0) {
643
+ href = currentArray[ currentIndex - 1 ].href;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
644
 
645
+ if (typeof href !== 'undefined' && href.match(imgRegExp)) {
646
+ objNext = new Image();
647
+ objNext.src = href;
648
+ }
 
 
649
  }
650
  },
651
 
671
  },
672
 
673
  _get_viewport = function() {
 
 
 
 
 
 
 
 
 
 
674
  return [
675
+ $(window).width() - (currentOpts.margin * 2),
676
+ $(window).height() - (currentOpts.margin * 2),
677
+ $(document).scrollLeft() + currentOpts.margin,
678
+ $(document).scrollTop() + currentOpts.margin
679
  ];
680
  },
681
 
682
  _get_zoom_to = function () {
683
  var view = _get_viewport(),
684
  to = {},
685
+ resize = currentOpts.autoScale,
686
  double_padding = currentOpts.padding * 2,
687
  ratio;
688
 
698
  to.height = currentOpts.height + double_padding;
699
  }
700
 
701
+ if (resize && (to.width > view[0] || to.height > view[1])) {
702
+ if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
703
+ ratio = (currentOpts.width ) / (currentOpts.height );
704
 
705
  if ((to.width ) > view[0]) {
706
  to.width = view[0];
711
  to.height = view[1];
712
  to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
713
  }
714
+
715
  } else {
716
  to.width = Math.min(to.width, view[0]);
717
  to.height = Math.min(to.height, view[1]);
751
  from = {
752
  width : pos.width + (currentOpts.padding * 2),
753
  height : pos.height + (currentOpts.padding * 2),
754
+ top : pos.top - currentOpts.padding - 20,
755
  left : pos.left - currentOpts.padding - 20
756
  };
757
 
761
  from = {
762
  width : currentOpts.padding * 2,
763
  height : currentOpts.padding * 2,
764
+ top : parseInt(view[3] + view[1] * 0.5, 10),
765
+ left : parseInt(view[2] + view[0] * 0.5, 10)
766
  };
767
  }
768
 
775
  return;
776
  }
777
 
778
+ $('div', loading).css('top', (loadingFrame * -40) + 'px');
779
 
780
  loadingFrame = (loadingFrame + 1) % 12;
781
  };
782
 
783
  /*
784
+ * Public methods
785
  */
786
 
787
  $.fn.fancybox = function(options) {
791
 
792
  $(this)
793
  .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
794
+ .unbind('click.fb')
795
+ .bind('click.fb', function(e) {
796
+ e.preventDefault();
797
+
798
  if (busy) {
799
  return;
800
  }
808
 
809
  var rel = $(this).attr('rel') || '';
810
 
811
+ if (!rel || rel == '' || rel === 'nofollow') {
812
  selectedArray.push(this);
813
+
814
  } else {
815
+ selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]");
816
  selectedIndex = selectedArray.index( this );
817
  }
818
 
819
+ _start();
820
 
821
  return;
822
  });
837
  selectedArray = [];
838
  selectedIndex = parseInt(opts.index, 10) || 0;
839
 
840
+ if ($.isArray(obj)) {
841
  for (var i = 0, j = obj.length; i < j; i++) {
842
  if (typeof obj[i] == 'object') {
843
  $(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
849
  selectedArray = jQuery.merge(selectedArray, obj);
850
 
851
  } else {
852
+ if (typeof obj == 'object') {
853
  $(obj).data('fancybox', $.extend({}, opts, obj));
854
  } else {
855
  obj = $({}).data('fancybox', $.extend({content : obj}, opts));
869
  clearInterval(loadingTimer);
870
 
871
  loading.show();
872
+ loadingTimer = setInterval(_animate_loading, 66);
873
  };
874
 
875
  $.fancybox.hideActivity = function() {
877
  };
878
 
879
  $.fancybox.next = function() {
880
+ return $.fancybox.pos( currentIndex + 1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
881
  };
882
 
883
  $.fancybox.prev = function() {
884
+ return $.fancybox.pos( currentIndex - 1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
885
  };
886
 
887
  $.fancybox.pos = function(pos) {
896
  if (pos > -1 && pos < currentArray.length) {
897
  selectedIndex = pos;
898
  _start();
899
+
900
+ } else if (currentOpts.cyclic && currentArray.length > 1) {
901
+ selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
902
+ _start();
903
  }
904
 
905
  return;
912
 
913
  busy = true;
914
 
915
+ $.event.trigger('fancybox-cancel');
916
 
917
  _abort();
918
 
938
 
939
  $(close.add( nav_left ).add( nav_right )).hide();
940
 
941
+ $(content.add( overlay )).unbind();
942
 
943
+ $(window).unbind("resize.fb scroll.fb");
944
+ $(document).unbind('keydown.fb');
945
 
946
+ content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
 
947
 
948
  if (currentOpts.titlePosition !== 'inside') {
949
  title.empty();
957
  title.empty().hide();
958
  wrap.hide();
959
 
960
+ $.event.trigger('fancybox-cleanup');
961
 
962
  content.empty();
963
 
976
  var pos = wrap.position();
977
 
978
  final_pos = {
979
+ top : pos.top ,
980
  left : pos.left,
981
  width : wrap.width(),
982
  height : wrap.height()
1000
  } else {
1001
  wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
1002
  }
 
 
1003
  };
1004
 
1005
  $.fancybox.resize = function() {
1006
+ if (overlay.is(':visible')) {
1007
+ overlay.css('height', $(document).height());
1008
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1009
 
1010
+ $.fancybox.center(true);
 
 
 
 
 
 
1011
  };
1012
 
1013
  $.fancybox.center = function() {
1014
  var view, align;
1015
 
1016
  if (busy) {
1017
+ return;
1018
  }
1019
 
1020
  align = arguments[0] === true ? 1 : 0;
1021
+ view = _get_viewport();
1022
 
1023
+ if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
1024
+ return;
1025
  }
1026
 
1027
  wrap
1029
  .animate({
1030
  'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
1031
  'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
1032
+ }, typeof arguments[0] == 'number' ? arguments[0] : 200);
1033
  };
1034
 
1035
  $.fancybox.init = function() {
1053
  close = $('<a id="fancybox-close"></a>'),
1054
  title = $('<div id="fancybox-title"></div>'),
1055
 
1056
+ nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
1057
+ nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
1058
  );
1059
 
1060
  close.click($.fancybox.close);
1070
  $.fancybox.next();
1071
  });
1072
 
1073
+ if ($.fn.mousewheel) {
1074
+ wrap.bind('mousewheel.fb', function(e, delta) {
1075
+ if (busy) {
1076
+ e.preventDefault();
1077
+
1078
+ } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
1079
+ e.preventDefault();
1080
+ $.fancybox[ delta > 0 ? 'prev' : 'next']();
1081
+ }
1082
+ });
1083
+ }
1084
+
1085
  if (!$.support.opacity) {
1086
  wrap.addClass('fancybox-ie');
1087
  }
1090
  loading.addClass('fancybox-ie6');
1091
  wrap.addClass('fancybox-ie6');
1092
 
1093
+ $('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
1094
  }
1095
  };
1096
 
1100
  opacity : false,
1101
  modal : false,
1102
  cyclic : false,
 
1103
  scrolling : 'auto', // 'auto', 'yes' or 'no'
1104
 
1105
  width : 560,
1108
  autoScale : true,
1109
  autoDimensions : true,
1110
  centerOnScroll : false,
 
 
 
1111
 
1112
  ajax : {},
1113
+ swf : { wmode: 'transparent' },
 
1114
 
1115
  hideOnOverlayClick : true,
1116
  hideOnContentClick : false,
1122
  titleShow : true,
1123
  titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
1124
  titleFormat : null,
1125
+ titleFromAlt : false,
1126
 
1127
  transitionIn : 'fade', // 'elastic', 'fade' or 'none'
1128
  transitionOut : 'fade', // 'elastic', 'fade' or 'none'
1153
  $.fancybox.init();
1154
  });
1155
 
1156
+ })(jQuery);
vendor/fancybox-1.3.4/jquery.fancybox-1.3.4.pack.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * FancyBox - jQuery Plugin
3
+ * Simple and fancy lightbox alternative
4
+ *
5
+ * Examples and documentation at: http://fancybox.net
6
+ *
7
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
8
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Version: 1.3.4 (11/11/2010)
11
+ * Requires: jQuery v1.3+
12
+ *
13
+ * Dual licensed under the MIT and GPL licenses:
14
+ * http://www.opensource.org/licenses/mit-license.php
15
+ * http://www.gnu.org/licenses/gpl.html
16
+ */
17
+
18
+ ;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
19
+ F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
20
+ c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
21
+ false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
22
+ function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
23
+ '"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
24
+ "function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
25
+ ";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
26
+ opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
27
+ d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
28
+ y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
29
+ i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
30
+ f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
31
+ 37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
32
+ s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
33
+ f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
34
+ j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
35
+ "image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
36
+ 10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
37
+ b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
38
+ 0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
39
+ 1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
40
+ true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
41
+ b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
42
+ d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<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(f);
43
+ D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
44
+ b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
45
+ b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
46
+ easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
vendor/fancybox-2.1.7/.gitattributes ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
3
+
4
+ # Denote all files that are truly binary and should not be modified.
5
+ *.png binary
6
+ *.jpg binary
7
+ *.gif binary
vendor/fancybox-2.1.7/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ .project
2
+ .settings
3
+ dist/
vendor/fancybox-2.1.7/CHANGELOG.md ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fancyBox - Changelog
2
+ =========
3
+
4
+ ### Version 2.1.5 - June 14, 2013
5
+ * Fixed #493 - Broken slideshow
6
+ * Fixed #556 - Parent option
7
+ * Retina graphics (#564) and retina display support (#420)
8
+ * Improved "lock" feature
9
+
10
+ ### Version 2.1.4 - January 10, 2013
11
+ * Update to be compatible with jQuery v1.9
12
+ * Small changes that should fix usability issues for certain users
13
+
14
+ ### Version 2.1.3 - October 23, 2012
15
+
16
+ * Fixed #426 - Broken IE7
17
+ * Fixed #423 - Background flickering on iOS
18
+ * Fixed #418 - Automatically Grow/Shrink and Center
19
+ * Updated the script to work with jQuery 1.6
20
+ * Media helper supports YouTube video series
21
+
22
+ ### Version 2.1.2 - October 15, 2012
23
+
24
+ * Fixed #414 - Don't allow nextClick if there is only one item
25
+ * Fixed #397 - Button helper 'Menu' not visible in IE7
26
+ * Overlay can be opened/closed manually:
27
+ * $.fancybox.helpers.overlay.open();
28
+ * $.fancybox.helpers.overlay.open({closeClick : false});
29
+ * $.fancybox.helpers.overlay.close();
30
+ * Optimized for Internet Explorer 10 (Windows 8)
31
+
32
+ ### Version 2.1.1 - October 01, 2012
33
+
34
+ * Fixed #357 - Converting values like 'auto' in getScalar()
35
+ * Fixed #358 - Updated overlay background image
36
+ * New "fancybox-href" and "fancybox-title" HTML5 data-attributes (#317)
37
+ * Improved helpers:
38
+ * - now they can have a property 'defaults' that contains default settings
39
+ * - updated vimeo and youtube parsers for media helper
40
+ * Content locking now can be turned off
41
+
42
+ ### Version 2.1.0 - August 20, 2012
43
+
44
+ * Fixed #103 - DOM element re-injection after closing
45
+ * Fixed #188 - navigation keys inside editable content
46
+ * New animation directions (see https://github.com/fancyapps/fancyBox/issues/233#issuecomment-5512453)
47
+ * New option "iframe" - it is now possible to separate scrolling for iframe and wrapping element; choose to preload
48
+ * New option "swf" - brings back functionality from fancyBox v1
49
+ * Improved media helper - better support for vimeo and youtube; links are now configurable
50
+ * Rewritten overlay helper:
51
+ * - new option "showEarly" - toggles if should be open before of after content is loaded
52
+ * - Facebook-style (https://github.com/fancyapps/fancyBox/issues/24) and therefore uses image for background
53
+ * Option "padding" accepts array (e.g., padding: [15, 50, 10, 5])
54
+ * One of dimensions (width or height) can now be set to "auto" (option "autoSize" needs to be "false")
55
+ * Updated callbacks:
56
+ * - "beforeClose" is now called only once
57
+ * - "afterLoad" receives current and previous object as arguments
58
+ * Method "$.fancybox.update();" recalculates content width/height
59
+ * Updated to work with jQuery v1.8
60
+
61
+ ### Version 2.0.6 - April 16, 2012
62
+
63
+ * Fixed #188 - keystrokes in contenteditable
64
+ * Fixed #171 - non-images should not be preloaded
65
+ * Fixed #158 - 'closeClick: true' breaks gallery navigation
66
+ * New "media" helper - detects and displays various media types
67
+ * New option "groupAttr" - name of group selector attribute, default is "data-fancybox-group"
68
+ * New feature - selector expressions in URLs, see #170
69
+ * Improved 'overlay' helper to use "position: fixed"
70
+ * Improved autoSize, fixed wrong height in some cases
71
+ * Improved centering and iframe scrolling for iOS
72
+ * Updated markup, new element '.fancybox-skin' is now used for styling
73
+
74
+ ### Version 2.0.5 - February 21, 2012
75
+
76
+ * Fixed #155 - easing for prev/next animations
77
+ * Fixed #153 - overriding "keys" options
78
+ * Fixed #147 - IE7 problem with #hash links
79
+ * Fixed #130 - changing dynamically data-fancybox-group
80
+ * Fixed #126 - obey minWidth/minHeight
81
+ * Fixed #118 - placement of loading icon and navigation arrows
82
+ * Fixed #101 - "index" option not working
83
+ * Fixed #94 - "orig" option not working
84
+ * Fixed #80 - does not work on IE6
85
+ * Fixed #72 - can't set overlay opacity to 0
86
+ * Fixed #63 - properly set gallery index
87
+ * New option "autoCenter" - toggles centering on window resize or scroll, disabled for mobile devices by default
88
+ * New option "autoResize" - toggles responsivity, disabled for mobile devices by default
89
+ * New option "preload" - number of images to preload
90
+ * New feature to target mobile/desktop browsers using CSS, see #108
91
+ * Changed ajax option defaults to "{ dataType: 'html', headers: { 'X-fancyBox': true } }", see #150 and #128
92
+ * Updated loading icon for IE7, IE8
93
+ * Calculates height of the iframe if 'autoSize' is set to 'true' and the iframe is on the same domain as the main page
94
+
95
+ ### Version 2.0.4 - December 12, 2011
96
+
97
+ * Fixed #47 - fix overriding properties
98
+ * New option "position" to thumbnail and button helpers
99
+
100
+
101
+ ### Version 2.0.3 - November 29, 2011
102
+
103
+ * Fixed #29 - broken elastic transitions
104
+
105
+
106
+ ### Version 2.0.2 - November 28, 2011
107
+
108
+ * Fixed slideshow
109
+ * Fixed scrollbars issue when displayed a very tall image
110
+ * New option "nextClick" - navigate to next gallery item when user clicks the content
111
+ * New option "modal" - to disable navigation and closing
112
+ * Add 'metadata' plugin support
113
+ * Add ability to create groups using 'data-fancybox-group' attribute
114
+ * Updated manual usage to match earlier releases
115
+
116
+
117
+ ### Version 2.0.1 - November 23, 2011
118
+
119
+ * Fixed keyboard events inside form elements
120
+ * Fixed manual usage
121
+
122
+
123
+ ### Version 2.0.0 - November 21, 2011
124
+
125
+ First release - completely rewritten, many new features and updated graphics.
vendor/fancybox-2.1.7/README.md ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fancyBox
2
+ ========
3
+
4
+ fancyBox is a tool that offers a nice and elegant way to add zooming functionality for images, html content and multi-media on your webpages.
5
+
6
+ More information and examples: http://www.fancyapps.com/fancybox/
7
+
8
+ License: http://www.fancyapps.com/fancybox/#license
9
+
10
+ Copyright (c) 2017 fancyapps.com
11
+
12
+
13
+ How to use
14
+ ----------
15
+
16
+ To get started, download the plugin, unzip it and copy files to your website/application directory.
17
+ Load files in the <head> section of your HTML document. Make sure you also add the jQuery library.
18
+
19
+ ```html
20
+ <head>
21
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
22
+ <link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css" media="screen" />
23
+ <script type="text/javascript" src="/fancybox/jquery.fancybox.pack.js"></script>
24
+ </head>
25
+ ```
26
+
27
+ Create your links with a `title` (or `data-fancybox-title`) if you want a title to be shown, and add a class:
28
+
29
+ ```html
30
+ <a href="large_image.jpg" class="fancybox" title="Sample title"><img src="small_image.jpg" /></a>
31
+ ```
32
+
33
+ If you have a set of related items that you would like to group,
34
+ additionally include a group name in the `rel` (or `data-fancybox-group`) attribute:
35
+
36
+ ```html
37
+ <a href="large_1.jpg" class="fancybox" rel="gallery" title="Sample title 1"><img src="small_1.jpg" /></a>
38
+ <a href="large_2.jpg" class="fancybox" rel="gallery" title="Sample title 1"><img src="small_2.jpg" /></a>
39
+ ```
40
+
41
+ Initialise the script like this:
42
+
43
+ ```html
44
+ <script>
45
+ $(document).ready(function() {
46
+ $('.fancybox').fancybox();
47
+ });
48
+ </script>
49
+ ```
50
+
51
+ May also be passed an optional options object which will extend the default values. Example:
52
+
53
+ ```html
54
+ <script>
55
+ $(document).ready(function() {
56
+ $('.fancybox').fancybox({
57
+ padding : 0,
58
+ openEffect : 'elastic',
59
+ closeBtn: false
60
+ });
61
+ });
62
+ </script>
63
+ ```
64
+
65
+ Tip: Automatically group and apply fancyBox to all images:
66
+
67
+ ```js
68
+ $("a[href$='.jpg'],a[href$='.jpeg'],a[href$='.png'],a[href$='.gif']").attr('rel', 'gallery').fancybox();
69
+ ```
70
+
71
+ Script uses the `href` attribute of the matched elements to obtain the location of the content and to figure out content type you want to display.
72
+ You can specify type directly by adding classname (fancybox.image, fancybox.iframe, etc) or `data-fancybox-type` attribute:
73
+
74
+ ```html
75
+ //Ajax:
76
+ <a href="/example.html" class="fancybox fancybox.ajax">Example</a>
77
+ //or
78
+ <a href="/example.html" class="fancybox" data-fancybox-type="ajax">Example</a>
79
+
80
+ //Iframe:
81
+ <a href="example.html" class="fancybox fancybox.iframe">Example</a>
82
+
83
+ //Inline (will display an element with `id="example"`)
84
+ <a href="#example" class="fancybox">Example</a>
85
+
86
+ //SWF:
87
+ <a href="example.swf" class="fancybox">Example</a>
88
+
89
+ //Image:
90
+ <a href="example.jpg" class="fancybox">Example</a>
91
+ ```
92
+
93
+ Note, ajax requests are subject to the [same origin policy](http://en.wikipedia.org/wiki/Same_origin_policy).
94
+ If fancyBox will not be able to get content type, it will try to guess based on 'href' and will quit silently if would not succeed.
95
+ (this is different from previsous versions where 'ajax' was used as default type or an error message was displayed).
96
+
97
+ Advanced
98
+ --------
99
+
100
+ ### Helpers
101
+
102
+ Helpers provide a simple mechanism to extend the capabilities of fancyBox. There are two built-in helpers - 'overlay' and 'title'.
103
+ You can disable them, set custom options or enable other helpers. Examples:
104
+
105
+ ```js
106
+ //Disable title helper
107
+ $(".fancybox").fancybox({
108
+ helpers: {
109
+ title: null
110
+ }
111
+ });
112
+
113
+ //Disable overlay helper
114
+ $(".fancybox").fancybox({
115
+ helpers: {
116
+ overlay : null
117
+ }
118
+ });
119
+
120
+ //Change title position and overlay color
121
+ $(".fancybox").fancybox({
122
+ helpers: {
123
+ title : {
124
+ type : 'inside'
125
+ },
126
+ overlay : {
127
+ css : {
128
+ 'background' : 'rgba(255,255,255,0.5)'
129
+ }
130
+ }
131
+ }
132
+ });
133
+
134
+ //Enable thumbnail helper and set custom options
135
+ $(".fancybox").fancybox({
136
+ helpers: {
137
+ thumbs : {
138
+ width: 50,
139
+ height: 50
140
+ }
141
+ }
142
+ });
143
+ ```
144
+
145
+ ### API
146
+
147
+ Also available are event driven callback methods. The `this` keyword refers to the current or upcoming object (depends on callback method). Here is how you can change title:
148
+
149
+ ```js
150
+ $(".fancybox").fancybox({
151
+ beforeLoad : function() {
152
+ this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
153
+
154
+ /*
155
+ "this.element" refers to current element, so you can, for example, use the "alt" attribute of the image to store the title:
156
+ this.title = $(this.element).find('img').attr('alt');
157
+ */
158
+ }
159
+ });
160
+ ```
161
+
162
+ It`s possible to open fancyBox programmatically in various ways:
163
+
164
+ ```js
165
+ //HTML content:
166
+ $.fancybox( '<div><h1>Lorem Lipsum</h1><p>Lorem lipsum</p></div>', {
167
+ title : 'Custom Title'
168
+ });
169
+
170
+ //DOM element:
171
+ $.fancybox( $("#inline"), {
172
+ title : 'Custom Title'
173
+ });
174
+
175
+ //Custom object:
176
+ $.fancybox({
177
+ href: 'example.jpg',
178
+ title : 'Custom Title'
179
+ });
180
+
181
+ //Array of objects:
182
+ $.fancybox([
183
+ {
184
+ href: 'example1.jpg',
185
+ title : 'Custom Title 1'
186
+ },
187
+ {
188
+ href: 'example2.jpg',
189
+ title : 'Custom Title 2'
190
+ }
191
+ ], {
192
+ padding: 0
193
+ });
194
+ ```
195
+
196
+ There are several methods that allow you to interact with and manipulate fancyBox, example:
197
+
198
+ ```js
199
+ //Close fancybox:
200
+ $.fancybox.close();
201
+ ```
202
+
203
+ There is a simply way to access wrapping elements using JS:
204
+
205
+ ```js
206
+ $.fancybox.wrap
207
+ $.fancybox.skin
208
+ $.fancybox.outer
209
+ $.fancybox.inner
210
+ ```
211
+
212
+ You can override CSS to customize the look. For example, make navigation arrows always visible,
213
+ change width and move them outside of area (use this snippet after including fancybox.css):
214
+
215
+ ```css
216
+ .fancybox-nav span {
217
+ visibility: visible;
218
+ }
219
+
220
+ .fancybox-nav {
221
+ width: 80px;
222
+ }
223
+
224
+ .fancybox-prev {
225
+ left: -80px;
226
+ }
227
+
228
+ .fancybox-next {
229
+ right: -80px;
230
+ }
231
+ ```
232
+
233
+ In that case, you might want to increase space around box:
234
+
235
+ ```js
236
+ $(".fancybox").fancybox({
237
+ margin : [20, 60, 20, 60]
238
+ });
239
+ ```
240
+
241
+ Bug tracker
242
+ -----------
243
+
244
+ Have a bug? Please create an issue on GitHub at https://github.com/fancyapps/fancyBox/issues
vendor/fancybox-2.1.7/bower.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "fancybox",
3
+ "title": "fancyBox",
4
+ "version": "2.1.7",
5
+ "description": "fancyBox offers an elegant way to present images, html content and multimedia for webpages",
6
+ "keywords": [
7
+ "lightbox",
8
+ "effect",
9
+ "responsive",
10
+ "modal",
11
+ "window",
12
+ "ui"
13
+ ],
14
+ "license": "GPLv3",
15
+ "homepage": "http://fancyapps.com/fancybox/",
16
+ "main": [
17
+ "source/jquery.fancybox.css",
18
+ "source/jquery.fancybox.pack.js",
19
+ "source/blank.gif",
20
+ "source/fancybox_loading.gif",
21
+ "source/fancybox_loading@2x.gif",
22
+ "source/fancybox_overlay.png",
23
+ "source/fancybox_sprite.png",
24
+ "source/fancybox_sprite@2x.png"
25
+ ],
26
+ "ignore": [
27
+ "**/.*",
28
+ "fancybox.jquery.json",
29
+ "demo"
30
+ ],
31
+ "dependencies": {
32
+ "jquery": ">=1.10",
33
+ "jquery-mousewheel": "~3.1.3"
34
+ }
35
+ }
vendor/fancybox-2.1.7/composer.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "fancyapps/fancybox",
3
+ "type": "component",
4
+ "require": {
5
+ "robloach/component-installer": "*"
6
+ },
7
+ "extra": {
8
+ "component": {
9
+ "files": [
10
+ "source/*"
11
+ ]
12
+ }
13
+ }
14
+ }
vendor/fancybox-2.1.7/demo/1_b.jpg ADDED
Binary file
vendor/fancybox-2.1.7/demo/1_s.jpg ADDED
Binary file
vendor/fancybox-2.1.7/demo/2_b.jpg ADDED
Binary file
vendor/fancybox-2.1.7/demo/2_s.jpg ADDED
Binary file
vendor/fancybox-2.1.7/demo/3_b.jpg ADDED
Binary file
vendor/fancybox-2.1.7/demo/3_s.jpg ADDED
Binary file
vendor/fancybox-2.1.7/demo/4_b.jpg ADDED
Binary file
vendor/fancybox-2.1.7/demo/4_s.jpg ADDED
Binary file
vendor/fancybox-2.1.7/demo/5_b.jpg ADDED
Binary file
vendor/fancybox-2.1.7/demo/5_s.jpg ADDED
Binary file
vendor/fancybox-2.1.7/demo/ajax.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div style="max-width:700px;min-width:200px;">
2
+ <h2>Lorem ipsum dolor sit amet3</h2>
3
+ <p>
4
+ <a href="javascript:jQuery.fancybox.close();">Close me</a>
5
+ </p>
6
+ <p>
7
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas fermentum ante et sapien dignissim in viverra magna feugiat. Donec tempus ipsum nec neque dignissim quis eleifend eros gravida. Praesent nisi massa, sodales quis tincidunt ac, semper quis risus. In suscipit nisl sed leo aliquet consequat. Integer vitae augue in risus porttitor pellentesque eu eget odio. Fusce ut sagittis quam. Morbi aliquam interdum blandit. Integer pharetra tempor velit, aliquam dictum justo tempus sed. Morbi congue fringilla justo a feugiat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent quis metus et nisl consectetur pharetra. Nam bibendum turpis eu metus luctus eu volutpat sem molestie. Nam sollicitudin porttitor lorem, ac ultricies est venenatis eu. Ut dignissim elit et orci feugiat ac placerat purus euismod. Ut mi lorem, cursus et sagittis elementum, luctus ac massa.
8
+ </p>
9
+ <p>
10
+ Phasellus et ligula vel diam ullamcorper volutpat. Integer rhoncus rhoncus aliquam. Aliquam erat volutpat. Aenean luctus vestibulum placerat. Quisque quam neque, lacinia aliquet eleifend ac, aliquet blandit felis. Curabitur porta ultricies dui, sit amet mattis quam euismod a. Ut eleifend scelerisque neque, sit amet accumsan odio consequat ut. Proin facilisis auctor elit sed accumsan. Cras dapibus nisl in nisi rhoncus laoreet. Nullam pellentesque tortor libero, eget facilisis ipsum. Donec ultricies tellus tellus, in tincidunt purus. Nullam in est aliquam velit scelerisque blandit. In tincidunt, magna a dapibus imperdiet, quam urna elementum leo, vitae rhoncus nisl velit cursus velit. In dignissim sem ac mauris rhoncus ornare.
11
+ </p>
12
+ <p>
13
+ Duis imperdiet velit vel quam malesuada suscipit imperdiet tellus hendrerit. Mauris vestibulum odio mauris, ut placerat leo. Mauris quis neque at tellus feugiat congue id non enim. Nam vehicula posuere nulla eget vehicula. Donec pretium purus nec ligula porta eu laoreet sapien venenatis. Nulla facilisi. Phasellus eget mi enim. Phasellus molestie tincidunt ultrices. Aenean id sem a tellus lobortis tincidunt. Nam laoreet nulla vel velit tincidunt ac rutrum libero malesuada. Nulla consequat dolor quis nisl tempor fermentum. Integer sodales pretium varius. Aenean a leo vitae odio dictum dignissim malesuada nec dolor. Phasellus adipiscing viverra est, ac sagittis libero sagittis quis. Sed interdum dapibus nunc et fringilla. Nunc vel velit et urna laoreet bibendum.
14
+ </p>
15
+ </div>
vendor/fancybox-2.1.7/demo/iframe.html ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>fancyBox - iframe demo</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+ </head>
7
+ <body>
8
+ <h1>fancyBox - iframe demo</h1>
9
+
10
+ <p>
11
+ <a href="javascript:parent.jQuery.fancybox.close();">Close iframe parent</a>
12
+
13
+ |
14
+
15
+ <a href="javascript:parent.jQuery.fancybox.open({href : '1_b.jpg', title : 'My title'});">Change content</a>
16
+ </p>
17
+
18
+ <p>
19
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam scelerisque justo ac eros consectetur bibendum. In hac habitasse platea dictumst. Nulla aliquam turpis et tellus elementum luctus. Duis sit amet rhoncus velit. Duis nisl ligula, mattis interdum blandit laoreet, mattis id ante. Cras pulvinar lacus vitae nisi egestas non euismod neque bibendum. Vestibulum faucibus libero id ante molestie ultricies. Vestibulum quis nibh felis. Vestibulum libero nisl, vehicula vel ullamcorper sit amet, tristique sit amet augue. Etiam urna neque, porttitor sed sodales lacinia, posuere a nisl. Vestibulum blandit neque in sapien volutpat ac condimentum sapien auctor. Ut imperdiet venenatis ultricies. Phasellus accumsan, sem eu placerat commodo, felis purus commodo ipsum, sit amet vulputate orci est viverra est.
20
+ </p>
21
+
22
+ <p>
23
+ Aenean velit est, condimentum ut iaculis ut, accumsan at mi. Maecenas velit mi, venenatis ut condimentum at, ultrices vel tortor. Curabitur pharetra ornare dapibus. Ut volutpat cursus semper. In hac habitasse platea dictumst. Donec eu iaculis ipsum. Morbi eu dolor velit, a semper nunc.
24
+ </p>
25
+ </body>
26
+ </html>
vendor/fancybox-2.1.7/demo/index.html ADDED
@@ -0,0 +1,312 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>fancyBox - Fancy jQuery Lightbox Alternative | Demonstration</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+
7
+ <!-- Add jQuery library -->
8
+ <script type="text/javascript" src="../lib/jquery-1.10.2.min.js"></script>
9
+
10
+ <!-- Add mousewheel plugin (this is optional) -->
11
+ <script type="text/javascript" src="../lib/jquery.mousewheel.pack.js?v=3.1.3"></script>
12
+
13
+ <!-- Add fancyBox main JS and CSS files -->
14
+ <script type="text/javascript" src="../source/jquery.fancybox.pack.js?v=2.1.5"></script>
15
+ <link rel="stylesheet" type="text/css" href="../source/jquery.fancybox.css?v=2.1.5" media="screen" />
16
+
17
+ <!-- Add Button helper (this is optional) -->
18
+ <link rel="stylesheet" type="text/css" href="../source/helpers/jquery.fancybox-buttons.css?v=1.0.5" />
19
+ <script type="text/javascript" src="../source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
20
+
21
+ <!-- Add Thumbnail helper (this is optional) -->
22
+ <link rel="stylesheet" type="text/css" href="../source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" />
23
+ <script type="text/javascript" src="../source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
24
+
25
+ <!-- Add Media helper (this is optional) -->
26
+ <script type="text/javascript" src="../source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>
27
+
28
+ <script type="text/javascript">
29
+ $(document).ready(function() {
30
+ /*
31
+ * Simple image gallery. Uses default settings
32
+ */
33
+
34
+ $('.fancybox').fancybox();
35
+
36
+ /*
37
+ * Different effects
38
+ */
39
+
40
+ // Change title type, overlay closing speed
41
+ $(".fancybox-effects-a").fancybox({
42
+ helpers: {
43
+ title : {
44
+ type : 'outside'
45
+ },
46
+ overlay : {
47
+ speedOut : 0
48
+ }
49
+ }
50
+ });
51
+
52
+ // Disable opening and closing animations, change title type
53
+ $(".fancybox-effects-b").fancybox({
54
+ openEffect : 'none',
55
+ closeEffect : 'none',
56
+
57
+ helpers : {
58
+ title : {
59
+ type : 'over'
60
+ }
61
+ }
62
+ });
63
+
64
+ // Set custom style, close if clicked, change title type and overlay color
65
+ $(".fancybox-effects-c").fancybox({
66
+ wrapCSS : 'fancybox-custom',
67
+ closeClick : true,
68
+
69
+ openEffect : 'none',
70
+
71
+ helpers : {
72
+ title : {
73
+ type : 'inside'
74
+ },
75
+ overlay : {
76
+ css : {
77
+ 'background' : 'rgba(238,238,238,0.85)'
78
+ }
79
+ }
80
+ }
81
+ });
82
+
83
+ // Remove padding, set opening and closing animations, close if clicked and disable overlay
84
+ $(".fancybox-effects-d").fancybox({
85
+ padding: 0,
86
+
87
+ openEffect : 'elastic',
88
+ openSpeed : 150,
89
+
90
+ closeEffect : 'elastic',
91
+ closeSpeed : 150,
92
+
93
+ closeClick : true,
94
+
95
+ helpers : {
96
+ overlay : null
97
+ }
98
+ });
99
+
100
+ /*
101
+ * Button helper. Disable animations, hide close button, change title type and content
102
+ */
103
+
104
+ $('.fancybox-buttons').fancybox({
105
+ openEffect : 'none',
106
+ closeEffect : 'none',
107
+
108
+ prevEffect : 'none',
109
+ nextEffect : 'none',
110
+
111
+ closeBtn : false,
112
+
113
+ helpers : {
114
+ title : {
115
+ type : 'inside'
116
+ },
117
+ buttons : {}
118
+ },
119
+
120
+ afterLoad : function() {
121
+ this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
122
+ }
123
+ });
124
+
125
+
126
+ /*
127
+ * Thumbnail helper. Disable animations, hide close button, arrows and slide to next gallery item if clicked
128
+ */
129
+
130
+ $('.fancybox-thumbs').fancybox({
131
+ prevEffect : 'none',
132
+ nextEffect : 'none',
133
+
134
+ closeBtn : false,
135
+ arrows : false,
136
+ nextClick : true,
137
+
138
+ helpers : {
139
+ thumbs : {
140
+ width : 50,
141
+ height : 50
142
+ }
143
+ }
144
+ });
145
+
146
+ /*
147
+ * Media helper. Group items, disable animations, hide arrows, enable media and button helpers.
148
+ */
149
+ $('.fancybox-media')
150
+ .attr('rel', 'media-gallery')
151
+ .fancybox({
152
+ openEffect : 'none',
153
+ closeEffect : 'none',
154
+ prevEffect : 'none',
155
+ nextEffect : 'none',
156
+
157
+ arrows : false,
158
+ helpers : {
159
+ media : {},
160
+ buttons : {}
161
+ }
162
+ });
163
+
164
+ /*
165
+ * Open manually
166
+ */
167
+
168
+ $("#fancybox-manual-a").click(function() {
169
+ $.fancybox.open('1_b.jpg');
170
+ });
171
+
172
+ $("#fancybox-manual-b").click(function() {
173
+ $.fancybox.open({
174
+ href : 'iframe.html',
175
+ type : 'iframe',
176
+ padding : 5
177
+ });
178
+ });
179
+
180
+ $("#fancybox-manual-c").click(function() {
181
+ $.fancybox.open([
182
+ {
183
+ href : '1_b.jpg',
184
+ title : 'My title'
185
+ }, {
186
+ href : '2_b.jpg',
187
+ title : '2nd title'
188
+ }, {
189
+ href : '3_b.jpg'
190
+ }
191
+ ], {
192
+ helpers : {
193
+ thumbs : {
194
+ width: 75,
195
+ height: 50
196
+ }
197
+ }
198
+ });
199
+ });
200
+
201
+
202
+ });
203
+ </script>
204
+ <style type="text/css">
205
+ .fancybox-custom .fancybox-skin {
206
+ box-shadow: 0 0 50px #222;
207
+ }
208
+
209
+ body {
210
+ max-width: 700px;
211
+ margin: 0 auto;
212
+ }
213
+ </style>
214
+ </head>
215
+ <body>
216
+ <h1>fancyBox</h1>
217
+
218
+ <p>This is a demonstration. More information and examples: <a href="http://fancyapps.com/fancybox/">www.fancyapps.com/fancybox/</a></p>
219
+
220
+ <h3>Simple image gallery</h3>
221
+ <p>
222
+ <a class="fancybox" href="1_b.jpg" data-fancybox-group="gallery" title="Lorem ipsum dolor sit amet"><img src="1_s.jpg" alt="" /></a>
223
+
224
+ <a class="fancybox" href="2_b.jpg" data-fancybox-group="gallery" title="Etiam quis mi eu elit temp"><img src="2_s.jpg" alt="" /></a>
225
+
226
+ <a class="fancybox" href="3_b.jpg" data-fancybox-group="gallery" title="Cras neque mi, semper leon"><img src="3_s.jpg" alt="" /></a>
227
+
228
+ <a class="fancybox" href="4_b.jpg" data-fancybox-group="gallery" title="Sed vel sapien vel sem uno"><img src="4_s.jpg" alt="" /></a>
229
+ </p>
230
+
231
+ <h3>Different effects</h3>
232
+ <p>
233
+ <a class="fancybox-effects-a" href="5_b.jpg" title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"><img src="5_s.jpg" alt="" /></a>
234
+
235
+ <a class="fancybox-effects-b" href="5_b.jpg" title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"><img src="5_s.jpg" alt="" /></a>
236
+
237
+ <a class="fancybox-effects-c" href="5_b.jpg" title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"><img src="5_s.jpg" alt="" /></a>
238
+
239
+ <a class="fancybox-effects-d" href="5_b.jpg" title="Lorem ipsum dolor sit amet, consectetur adipiscing elit"><img src="5_s.jpg" alt="" /></a>
240
+ </p>
241
+
242
+ <h3>Various types</h3>
243
+ <p>
244
+ fancyBox will try to guess content type from href attribute but you can specify it directly by adding classname (fancybox.image, fancybox.iframe, etc).
245
+ </p>
246
+ <ul>
247
+ <li><a class="fancybox" href="#inline1" title="Lorem ipsum dolor sit amet">Inline</a></li>
248
+ <li><a class="fancybox fancybox.ajax" href="ajax.txt">Ajax</a></li>
249
+ <li><a class="fancybox fancybox.iframe" href="iframe.html">Iframe</a></li>
250
+ <li><a class="fancybox" href="http://www.adobe.com/jp/events/cs3_web_edition_tour/swfs/perform.swf">Swf</a></li>
251
+ </ul>
252
+
253
+ <div id="inline1" style="width:400px;display: none;">
254
+ <h3>Etiam quis mi eu elit</h3>
255
+ <p>
256
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam quis mi eu elit tempor facilisis id et neque. Nulla sit amet sem sapien. Vestibulum imperdiet porta ante ac ornare. Nulla et lorem eu nibh adipiscing ultricies nec at lacus. Cras laoreet ultricies sem, at blandit mi eleifend aliquam. Nunc enim ipsum, vehicula non pretium varius, cursus ac tortor. Vivamus fringilla congue laoreet. Quisque ultrices sodales orci, quis rhoncus justo auctor in. Phasellus dui eros, bibendum eu feugiat ornare, faucibus eu mi. Nunc aliquet tempus sem, id aliquam diam varius ac. Maecenas nisl nunc, molestie vitae eleifend vel, iaculis sed magna. Aenean tempus lacus vitae orci posuere porttitor eget non felis. Donec lectus elit, aliquam nec eleifend sit amet, vestibulum sed nunc.
257
+ </p>
258
+ </div>
259
+
260
+ <p>
261
+ Ajax example will not run from your local computer and requires a server to run.
262
+ </p>
263
+
264
+ <h3>Button helper</h3>
265
+ <p>
266
+ <a class="fancybox-buttons" data-fancybox-group="button" href="1_b.jpg"><img src="1_s.jpg" alt="" /></a>
267
+
268
+ <a class="fancybox-buttons" data-fancybox-group="button" href="2_b.jpg"><img src="2_s.jpg" alt="" /></a>
269
+
270
+ <a class="fancybox-buttons" data-fancybox-group="button" href="3_b.jpg"><img src="3_s.jpg" alt="" /></a>
271
+
272
+ <a class="fancybox-buttons" data-fancybox-group="button" href="4_b.jpg"><img src="4_s.jpg" alt="" /></a>
273
+ </p>
274
+
275
+ <h3>Thumbnail helper</h3>
276
+ <p>
277
+ <a class="fancybox-thumbs" data-fancybox-group="thumb" href="4_b.jpg"><img src="4_s.jpg" alt="" /></a>
278
+
279
+ <a class="fancybox-thumbs" data-fancybox-group="thumb" href="3_b.jpg"><img src="3_s.jpg" alt="" /></a>
280
+
281
+ <a class="fancybox-thumbs" data-fancybox-group="thumb" href="2_b.jpg"><img src="2_s.jpg" alt="" /></a>
282
+
283
+ <a class="fancybox-thumbs" data-fancybox-group="thumb" href="1_b.jpg"><img src="1_s.jpg" alt="" /></a>
284
+ </p>
285
+
286
+ <h3>Media helper</h3>
287
+ <p>
288
+ Will not run from your local computer, requires a server to run.
289
+ </p>
290
+
291
+ <ul>
292
+ <li><a class="fancybox-media" href="http://www.youtube.com/watch?v=opj24KnzrWo">Youtube</a></li>
293
+ <li><a class="fancybox-media" href="http://vimeo.com/47480346">Vimeo</a></li>
294
+ <li><a class="fancybox-media" href="http://www.metacafe.com/watch/7635964/">Metacafe</a></li>
295
+ <li><a class="fancybox-media" href="http://www.dailymotion.com/video/xoeylt_electric-guest-this-head-i-hold_music">Dailymotion</a></li>
296
+ <li><a class="fancybox-media" href="http://twitvid.com/QY7MD">Twitvid</a></li>
297
+ <li><a class="fancybox-media" href="http://twitpic.com/7p93st">Twitpic</a></li>
298
+ <li><a class="fancybox-media" href="http://instagr.am/p/IejkuUGxQn">Instagram</a></li>
299
+ </ul>
300
+
301
+ <h3>Open manually</h3>
302
+ <ul>
303
+ <li><a id="fancybox-manual-a" href="javascript:;">Open single item</a></li>
304
+ <li><a id="fancybox-manual-b" href="javascript:;">Open single item, custom options</a></li>
305
+ <li><a id="fancybox-manual-c" href="javascript:;">Open gallery</a></li>
306
+ </ul>
307
+
308
+ <p>
309
+ Photo Credit: Instagrammer @whitjohns
310
+ </p>
311
+ </body>
312
+ </html>
vendor/fancybox-2.1.7/fancybox.jquery.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "fancybox",
3
+ "title": "fancyBox",
4
+ "description": "fancyBox offers an elegant way to present images, html content and multimedia for webpages",
5
+ "keywords": [
6
+ "lightbox",
7
+ "effect",
8
+ "responsive",
9
+ "modal",
10
+ "window",
11
+ "ui"
12
+ ],
13
+ "version": "2.1.5",
14
+ "author": {
15
+ "name": "Janis Skarnelis",
16
+ "url": "http://fancyapps.com/contact/"
17
+ },
18
+ "licenses": [
19
+ {
20
+ "type": "fancyBox",
21
+ "url": "http://fancyapps.com/fancybox/#license"
22
+ }
23
+ ],
24
+ "homepage": "http://fancyapps.com/fancybox/",
25
+ "docs": "http://fancyapps.com/fancybox/#docs",
26
+ "download": "http://fancyapps.com/fancybox/#license",
27
+ "bugs": "https://github.com/fancyapps/fancyBox/issues",
28
+ "dependencies": {
29
+ "jquery": ">=1.7"
30
+ }
31
+ }
vendor/fancybox-2.1.7/gulpfile.js ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jshint node: true */
2
+ /* global $: true */
3
+ "use strict";
4
+
5
+ var gulp = require("gulp"),
6
+ $ = require("gulp-load-plugins")();
7
+ var config = {
8
+ js: [
9
+ "lib/jquery.mousewheel.pack.js",
10
+ "source/jquery.fancybox.pack.js",
11
+ "source/helpers/jquery.fancybox-buttons.js",
12
+ "source/helpers/jquery.fancybox-thumbs.js",
13
+ "source/helpers/jquery.fancybox-media.js"
14
+ ],
15
+ css: [
16
+ "source/jquery.fancybox.css",
17
+ "source/helpers/jquery.fancybox-buttons.css",
18
+ "source/helpers/jquery.fancybox-thumbs.css"
19
+ ],
20
+ images: [
21
+ "source/helpers/**/*.{jpg,png,svg,gif,webp,ico}",
22
+ "source/*.{jpg,png,svg,gif,webp,ico}"
23
+ ]
24
+ },
25
+ dist = {
26
+ images: "dist/images/fancybox",
27
+ css: "dist/css",
28
+ js: "dist/js"
29
+ };
30
+
31
+
32
+ /*
33
+ - |--------------------------------------------------------------------------
34
+ - | Gulp Front Tasks
35
+ - |--------------------------------------------------------------------------
36
+ - |
37
+ + *
38
+ + *
39
+ */
40
+
41
+ gulp.task("clean", function () {
42
+ return gulp.src("dist", {read: false})
43
+ .pipe($.clean());
44
+ });
45
+
46
+ gulp.task("scripts", function () {
47
+ return gulp.src(config.js)
48
+ .pipe($.plumberNotifier())
49
+ .pipe($.concat("jquery.fancybox.min.js"))
50
+ .pipe($.uglify())
51
+ .pipe(gulp.dest(dist.js));
52
+ });
53
+
54
+ gulp.task("styles", function () {
55
+ return gulp.src(config.css)
56
+ .pipe($.plumberNotifier())
57
+ .pipe($.concat("jquery.fancybox.min.css"))
58
+ .pipe($.autoprefixer("last 5 version"))
59
+ .pipe($.replace(/url\('?(.*)'?\)/g, "url('../images/fancybox/$1')"))
60
+ .pipe($.replace("''", "'"))
61
+ .pipe($.cleanCss({compatibility: 'ie8'}))
62
+ .pipe(gulp.dest(dist.css))
63
+ });
64
+
65
+ gulp.task("images", function () {
66
+ return gulp.src(config.images)
67
+ .pipe($.newer(dist.images))
68
+ .pipe(gulp.dest(dist.images));
69
+ });
70
+
71
+
72
+ gulp.task('default', ["images", "styles", "scripts"]);
73
+
74
+
75
+
76
+
vendor/fancybox-2.1.7/lib/jquery-1.10.2.min.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ /*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
2
+ //@ sourceMappingURL=jquery-1.10.2.min.map
3
+ */
4
+ (function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t
5
+ }({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
6
+ u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function