Version Description
- Added notification for Modula 2.0
- Added Compatibility with AO
Download this release
Release Info
Developer | machothemes |
Plugin | Gallery – Photo Gallery – Image Gallery |
Version | 1.3.3 |
Comparing to | |
See all releases |
Code changes from version 1.3.2 to 1.3.3
- Modula.php +156 -5
- README.txt +21 -1
- admin/css/materialdesignicons.css +0 -0
- admin/fancybox/jquery.fancybox.css +771 -0
- admin/fancybox/jquery.fancybox.js +5629 -0
- admin/fancybox/jquery.fancybox.min.css +1 -0
- admin/fancybox/jquery.fancybox.min.js +13 -0
- admin/font/material-design-icons/license.txt +0 -0
- admin/font/material-design-icons/materialdesignicons-webfont.eot +0 -0
- admin/font/material-design-icons/materialdesignicons-webfont.svg +0 -0
- admin/font/material-design-icons/materialdesignicons-webfont.ttf +0 -0
- admin/font/material-design-icons/materialdesignicons-webfont.woff +0 -0
- admin/font/material-design-icons/materialdesignicons-webfont.woff2 +0 -0
- admin/font/roboto/Roboto-Bold-webfont.eot +0 -0
- admin/font/roboto/Roboto-Bold-webfont.svg +0 -0
- admin/font/roboto/Roboto-Bold-webfont.ttf +0 -0
- admin/font/roboto/Roboto-Bold-webfont.woff +0 -0
- admin/font/roboto/Roboto-Light-webfont.eot +0 -0
- admin/font/roboto/Roboto-Light-webfont.svg +0 -0
- admin/font/roboto/Roboto-Light-webfont.ttf +0 -0
- admin/font/roboto/Roboto-Light-webfont.woff +0 -0
- admin/font/roboto/Roboto-Regular-webfont.eot +0 -0
- admin/font/roboto/Roboto-Regular-webfont.svg +0 -0
- admin/font/roboto/Roboto-Regular-webfont.ttf +0 -0
- admin/font/roboto/Roboto-Regular-webfont.woff +0 -0
- admin/images/captions-settings.jpg +0 -0
- admin/images/creative-gallery-settings.jpg +0 -0
- admin/images/custom-grid-settings.jpg +0 -0
- admin/images/customizations-settings.jpg +0 -0
- admin/images/drag-and-drop-upload.jpg +0 -0
- admin/images/galleries-list.jpg +0 -0
- admin/images/gallery-edit.jpg +0 -0
- admin/images/helper-grid.jpg +0 -0
- admin/images/hover-effects-settings.jpg +0 -0
- admin/images/landscape-portrait.jpg +0 -0
- admin/images/live-preview.jpg +0 -0
- admin/images/loading-effects-settings.jpg +0 -0
- admin/images/modula-v2-custom-grid.png +0 -0
- admin/images/modula-v2-drag-and-drop-upload.png +0 -0
- admin/images/modula-v2-familiar-dashboard.png +0 -0
- admin/images/modula-v2-helper-grid.png +0 -0
- admin/images/modula-v2-intuitive-settings.png +0 -0
- admin/images/modula-v2-landscape-or-portrait.png +0 -0
- admin/images/modula-v2-live-preview.png +0 -0
- admin/images/modula.svg +48 -0
- admin/images/social-settings.jpg +0 -0
- admin/images/style-settings.jpg +0 -0
- admin/modula-v2.php +99 -0
- admin/welcome-screen/sections/modula-v2.php +11 -0
- lib/class-modula-plugin-rollback.php +71 -0
- lib/class-modula-review.php +177 -0
- lib/class-modula-rollback.php +178 -0
- lib/install-db.php +1 -3
- scripts/rollback.js +11 -0
Modula.php
CHANGED
@@ -5,13 +5,18 @@
|
|
5 |
* Description: Modula is one of the best & most creative WordPress gallery plugins. Use it to create a great grid or
|
6 |
* masonry image gallery.
|
7 |
* Author: Macho Themes
|
8 |
-
* Version: 1.3.
|
9 |
* Author URI: https://www.machothemes.com/
|
10 |
*/
|
11 |
|
12 |
define( 'MODULA_PLUGIN_DIR_PATH', plugin_dir_path( __FILE__ ) );
|
13 |
define( 'MODULA_PLUGIN_DIR_URL', plugin_dir_url( __FILE__ ) );
|
14 |
|
|
|
|
|
|
|
|
|
|
|
15 |
function modula_lite_create_db_tables() {
|
16 |
include_once( WP_PLUGIN_DIR . '/modula-best-grid-gallery/lib/install-db.php' );
|
17 |
modula_lite_install_db();
|
@@ -23,7 +28,7 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
23 |
private $loadedData;
|
24 |
private $fields = array();
|
25 |
|
26 |
-
private $version = "1.3.
|
27 |
|
28 |
private $defaultValues = array(
|
29 |
'width' => 100,
|
@@ -109,6 +114,9 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
109 |
add_filter( 'plugin_row_meta', array( $this, 'register_links' ), 10, 2 );
|
110 |
add_filter( 'admin_footer_text', array( $this, 'admin_footer' ), 1, 2 );
|
111 |
|
|
|
|
|
|
|
112 |
|
113 |
// Set fields
|
114 |
$this->fields[ __( 'General', 'modula-gallery' ) ] = array(
|
@@ -454,6 +462,17 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
454 |
|
455 |
}
|
456 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
//Define textdomain
|
458 |
public function create_textdomain() {
|
459 |
$plugin_dir = basename( dirname( __FILE__ ) );
|
@@ -875,6 +894,10 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
875 |
$this,
|
876 |
'upgrade',
|
877 |
) );
|
|
|
|
|
|
|
|
|
878 |
|
879 |
|
880 |
add_action( 'load-' . $overview, array( $this, 'gallery_admin_init' ) );
|
@@ -897,6 +920,10 @@ if ( ! class_exists( "ModulaLite" ) ) {
|
|
897 |
include( "admin/add-gallery.php" );
|
898 |
}
|
899 |
|
|
|
|
|
|
|
|
|
900 |
public function fix() {
|
901 |
global $wpdb;
|
902 |
include( "admin/fix.php" );
|
@@ -1252,8 +1279,9 @@ class ModulaLiteTools {
|
|
1252 |
$metadata = wp_get_attachment_metadata( $img->imageId );
|
1253 |
|
1254 |
if ( $img->imageId > 0 ) {
|
1255 |
-
$
|
1256 |
-
$
|
|
|
1257 |
$res_name = ModulaLiteTools::resize_image( $img->imageId, $size );
|
1258 |
|
1259 |
if ( ! ( array_key_exists( "image_meta", $metadata ) && array_key_exists( "resized_images", $metadata["image_meta"] ) && in_array( $size . "x" . $size, $metadata["image_meta"]["resized_images"] ) ) ) {
|
@@ -1278,4 +1306,127 @@ if ( class_exists( "ModulaLite" ) ) {
|
|
1278 |
global $ob_ModulaLite;
|
1279 |
$ob_ModulaLite = new ModulaLite();
|
1280 |
}
|
1281 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
* Description: Modula is one of the best & most creative WordPress gallery plugins. Use it to create a great grid or
|
6 |
* masonry image gallery.
|
7 |
* Author: Macho Themes
|
8 |
+
* Version: 1.3.3
|
9 |
* Author URI: https://www.machothemes.com/
|
10 |
*/
|
11 |
|
12 |
define( 'MODULA_PLUGIN_DIR_PATH', plugin_dir_path( __FILE__ ) );
|
13 |
define( 'MODULA_PLUGIN_DIR_URL', plugin_dir_url( __FILE__ ) );
|
14 |
|
15 |
+
define( 'MODULA_VERSION', '1.3.3' );
|
16 |
+
define( 'MODULA_PLUGIN_BASE', plugin_basename( __FILE__ ) );
|
17 |
+
define( 'MODULA_PREVIOUS_PLUGIN_VERSION', '1.3.2' );
|
18 |
+
define( 'MODULA_FILE_', __FILE__ );
|
19 |
+
|
20 |
function modula_lite_create_db_tables() {
|
21 |
include_once( WP_PLUGIN_DIR . '/modula-best-grid-gallery/lib/install-db.php' );
|
22 |
modula_lite_install_db();
|
28 |
private $loadedData;
|
29 |
private $fields = array();
|
30 |
|
31 |
+
private $version = "1.3.3";
|
32 |
|
33 |
private $defaultValues = array(
|
34 |
'width' => 100,
|
114 |
add_filter( 'plugin_row_meta', array( $this, 'register_links' ), 10, 2 );
|
115 |
add_filter( 'admin_footer_text', array( $this, 'admin_footer' ), 1, 2 );
|
116 |
|
117 |
+
// Enqueue Fancybox for Modula 2.0 Page
|
118 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'modula_beta_scripts' ) );
|
119 |
+
|
120 |
|
121 |
// Set fields
|
122 |
$this->fields[ __( 'General', 'modula-gallery' ) ] = array(
|
462 |
|
463 |
}
|
464 |
|
465 |
+
public function modula_beta_scripts( $hook ) {
|
466 |
+
|
467 |
+
if ( 'modula_page_modula-lite-gallery-v2' != $hook ) {
|
468 |
+
return;
|
469 |
+
}
|
470 |
+
|
471 |
+
wp_enqueue_script( 'modula-fancybox', plugins_url() . '/modula-best-grid-gallery/admin/fancybox/jquery.fancybox.min.js', array( 'jquery' ) );
|
472 |
+
wp_enqueue_style( 'modula-fancybox', plugins_url() . '/modula-best-grid-gallery/admin/fancybox/jquery.fancybox.min.css' );
|
473 |
+
|
474 |
+
}
|
475 |
+
|
476 |
//Define textdomain
|
477 |
public function create_textdomain() {
|
478 |
$plugin_dir = basename( dirname( __FILE__ ) );
|
894 |
$this,
|
895 |
'upgrade',
|
896 |
) );
|
897 |
+
$v2 = add_submenu_page( 'modula-lite-admin', __( 'Try Modula 2.0', 'modula-gallery' ), __( 'Try Modula 2.0', 'modula-gallery' ), 'edit_posts', 'modula-lite-gallery-v2', array(
|
898 |
+
$this,
|
899 |
+
'new_modula',
|
900 |
+
) );
|
901 |
|
902 |
|
903 |
add_action( 'load-' . $overview, array( $this, 'gallery_admin_init' ) );
|
920 |
include( "admin/add-gallery.php" );
|
921 |
}
|
922 |
|
923 |
+
public function new_modula() {
|
924 |
+
include( "admin/modula-v2.php" );
|
925 |
+
}
|
926 |
+
|
927 |
public function fix() {
|
928 |
global $wpdb;
|
929 |
include( "admin/fix.php" );
|
1279 |
$metadata = wp_get_attachment_metadata( $img->imageId );
|
1280 |
|
1281 |
if ( $img->imageId > 0 ) {
|
1282 |
+
$uploads = wp_get_upload_dir();
|
1283 |
+
$file = get_post_meta( $img->imageId, '_wp_attached_file', true );
|
1284 |
+
$baseurl = $uploads['baseurl'] . '/' . str_replace( basename( $file ), "", $file );
|
1285 |
$res_name = ModulaLiteTools::resize_image( $img->imageId, $size );
|
1286 |
|
1287 |
if ( ! ( array_key_exists( "image_meta", $metadata ) && array_key_exists( "resized_images", $metadata["image_meta"] ) && in_array( $size . "x" . $size, $metadata["image_meta"]["resized_images"] ) ) ) {
|
1306 |
global $ob_ModulaLite;
|
1307 |
$ob_ModulaLite = new ModulaLite();
|
1308 |
}
|
1309 |
+
|
1310 |
+
function modula_lite_check_for_review() {
|
1311 |
+
|
1312 |
+
if ( ! is_admin() ) {
|
1313 |
+
return;
|
1314 |
+
}
|
1315 |
+
|
1316 |
+
require_once MODULA_PLUGIN_DIR_PATH . 'lib/class-modula-review.php';
|
1317 |
+
|
1318 |
+
Modula_Review::get_instance( array(
|
1319 |
+
'slug' => 'modula-best-grid-gallery',
|
1320 |
+
'messages' => array(
|
1321 |
+
'notice' => __( "Hey, I noticed you have created %s galleries - that's awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation.<br><br><strong>~ Cristian Raiber</strong>,<br><strong>CEO Modula</strong>.", 'modula-gallery' ),
|
1322 |
+
'rate' => __( 'Ok, you deserve it', 'modula-gallery' ),
|
1323 |
+
'rated' => __( 'I already did', 'modula-gallery' ),
|
1324 |
+
'no_rate' => __( 'No, not good enough', 'modula-gallery' ),
|
1325 |
+
),
|
1326 |
+
) );
|
1327 |
+
|
1328 |
+
}
|
1329 |
+
modula_lite_check_for_review();
|
1330 |
+
|
1331 |
+
// Add compatibility with AO
|
1332 |
+
add_filter('autoptimize_filter_js_exclude','modula_lite_override_jsexclude',90,1);
|
1333 |
+
function modula_lite_override_jsexclude( $exclude ) {
|
1334 |
+
if ( is_array( $exclude ) ) {
|
1335 |
+
$exclude[] = 'jquery.modula.js';
|
1336 |
+
}else{
|
1337 |
+
$exclude .= ", jquery.modula.js";
|
1338 |
+
}
|
1339 |
+
return $exclude;
|
1340 |
+
}
|
1341 |
+
|
1342 |
+
// Beta Testing.
|
1343 |
+
add_action( 'admin_notices', 'modula_beta_notices' );
|
1344 |
+
add_action( 'wp_ajax_modula_beta_testing', 'modula_beta_ajax' );
|
1345 |
+
add_action( 'admin_print_footer_scripts', 'modula_beta_ajax_script', 99 );
|
1346 |
+
|
1347 |
+
function modula_beta_notices() {
|
1348 |
+
|
1349 |
+
$options = get_option( 'modula-checks', array() );
|
1350 |
+
|
1351 |
+
if ( isset( $options['beta-testing'] ) ) {
|
1352 |
+
return;
|
1353 |
+
}
|
1354 |
+
?>
|
1355 |
+
<style type="text/css">
|
1356 |
+
#modula-beta-testing-info {
|
1357 |
+
display: inline-block;
|
1358 |
+
margin-left: 15px;
|
1359 |
+
}
|
1360 |
+
</style>
|
1361 |
+
<div id="modula-beta-testing" class="notice notice-success is-dismissible">
|
1362 |
+
<h3>Try Modula 2.0 !!</h3>
|
1363 |
+
<p>We’ve been working on an awesome update to Modula over the last few months and can’t wait to release it to the public. But, before that can happen, we need the help of amazing users in the WordPress community (just like you) to improve Modula 2.0’s first beta.</p>
|
1364 |
+
<p class="actions">
|
1365 |
+
<a id="modula-beta-testing-dwn" href="https://machothemes.com/downloads/modula-2.0.0.zip" target="_blank" class="button button-primary modula-beta-testing-button"><?php echo __( 'Download Modula 2.0 Beta', 'modula-gallery' ); ?></a>
|
1366 |
+
<a id="modula-beta-testing-info" href="<?php echo admin_url( 'admin.php?page=modula-lite-gallery-v2' ) ?>" target="_blank" class="modula-beta-testing-button"><?php echo __( 'Find more', 'modula-gallery' ); ?></a>
|
1367 |
+
</p>
|
1368 |
+
</div>
|
1369 |
+
<?php
|
1370 |
+
}
|
1371 |
+
|
1372 |
+
function modula_beta_ajax() {
|
1373 |
+
|
1374 |
+
check_ajax_referer( 'modula-beta-testing', 'security' );
|
1375 |
+
|
1376 |
+
$options = get_option( 'modula-checks', array() );
|
1377 |
+
$options['beta-testing'] = 1;
|
1378 |
+
|
1379 |
+
update_option( 'modula-checks', $options );
|
1380 |
+
|
1381 |
+
wp_die( 'ok' );
|
1382 |
+
|
1383 |
+
}
|
1384 |
+
|
1385 |
+
function modula_beta_ajax_script() {
|
1386 |
+
|
1387 |
+
$ajax_nonce = wp_create_nonce( "modula-beta-testing" );
|
1388 |
+
|
1389 |
+
?>
|
1390 |
+
|
1391 |
+
<script type="text/javascript">
|
1392 |
+
jQuery( document ).ready( function( $ ){
|
1393 |
+
|
1394 |
+
$( '.modula-beta-testing-button' ).click( function( evt ){
|
1395 |
+
var href = $(this).attr('href'),
|
1396 |
+
id = $(this).attr('id');
|
1397 |
+
|
1398 |
+
var data = {
|
1399 |
+
action: 'modula_beta_testing',
|
1400 |
+
security: '<?php echo $ajax_nonce; ?>',
|
1401 |
+
};
|
1402 |
+
|
1403 |
+
$.post( '<?php echo admin_url( 'admin-ajax.php' ) ?>', data, function( response ) {
|
1404 |
+
$( '#modula-beta-testing' ).slideUp( 'fast', function() {
|
1405 |
+
$( this ).remove();
|
1406 |
+
} );
|
1407 |
+
});
|
1408 |
+
|
1409 |
+
} );
|
1410 |
+
|
1411 |
+
});
|
1412 |
+
</script>
|
1413 |
+
|
1414 |
+
<?php
|
1415 |
+
}
|
1416 |
+
|
1417 |
+
/* RollBack functionality */
|
1418 |
+
require MODULA_PLUGIN_DIR_PATH . '/lib/class-modula-plugin-rollback.php';
|
1419 |
+
require MODULA_PLUGIN_DIR_PATH . '/lib/class-modula-rollback.php';
|
1420 |
+
|
1421 |
+
/**
|
1422 |
+
* Insert Rollback link for plugin in plugins page
|
1423 |
+
*/
|
1424 |
+
|
1425 |
+
function modula_lite_rollback_link( $links ) {
|
1426 |
+
|
1427 |
+
$links['rollback'] = sprintf( '<a href="%s" class="modula-rollback-button">%s</a>', wp_nonce_url( admin_url( 'admin-post.php?action=modula_rollback' ), 'modula_rollback' ), __( 'Rollback version', 'modula-gallery' ) );
|
1428 |
+
|
1429 |
+
return $links;
|
1430 |
+
}
|
1431 |
+
|
1432 |
+
add_action( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'modula_lite_rollback_link' );
|
README.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: machothemes, silkalns
|
|
3 |
Tags: best gallery plugin, image gallery, photo gallery, responsive gallery, wordpress gallery plugin, wordpress portfolio plugin, masonry gallery, fancy gallery, media gallery, mosaic gallery, polaroid gallery, portfolio gallery
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 4.9
|
6 |
-
Stable tag: 1.3.
|
7 |
License: GPLv3 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -13,6 +13,14 @@ Photo Gallery by Modula - an advanced solution for Photo Gallery users. Create b
|
|
13 |
|
14 |
Modula Image Gallery is a creative and original WordPress plugin perfect for creating custom, unique, and responsive image galleries. Modula is available in both a Lite/free version and a premium version and it is currently the easiest and fastest photo gallery plugin for WordPress. Directly from its dashboard you are able to build stunning galleries in a few seconds, unlike many other WordPress plugins.
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
= See a 60s video of Modula in action =
|
17 |
|
18 |
https://www.youtube.com/watch?v=tq8yUYxgtnA
|
@@ -135,6 +143,14 @@ If you get blurry and pixellated images then you need to raise the "Minimum imag
|
|
135 |
|
136 |
The PRO license bundles 6 different lightboxes. However you can use any other lightbox you want also with the Lite license. If you have installed a lightbox plugin then you just need to select "Direct link to image" in the "Lightbox" settings.
|
137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
= How can I get support? =
|
139 |
|
140 |
Free support is included only with a PRO license: [Buy Modula PRO](https://wp-modula.com/#buy "Buy Modula PRO")
|
@@ -157,6 +173,10 @@ Free support is included only with a PRO license: [Buy Modula PRO](https://wp-mo
|
|
157 |
|
158 |
== Changelog ==
|
159 |
|
|
|
|
|
|
|
|
|
160 |
= 1.3.2 =
|
161 |
* Validated HTML markup
|
162 |
|
3 |
Tags: best gallery plugin, image gallery, photo gallery, responsive gallery, wordpress gallery plugin, wordpress portfolio plugin, masonry gallery, fancy gallery, media gallery, mosaic gallery, polaroid gallery, portfolio gallery
|
4 |
Requires at least: 3.8
|
5 |
Tested up to: 4.9
|
6 |
+
Stable tag: 1.3.3
|
7 |
License: GPLv3 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
13 |
|
14 |
Modula Image Gallery is a creative and original WordPress plugin perfect for creating custom, unique, and responsive image galleries. Modula is available in both a Lite/free version and a premium version and it is currently the easiest and fastest photo gallery plugin for WordPress. Directly from its dashboard you are able to build stunning galleries in a few seconds, unlike many other WordPress plugins.
|
15 |
|
16 |
+
= Try Modula 2.0 Beta =
|
17 |
+
|
18 |
+
We’ve been working on an awesome update to Modula over the last few months and can’t wait to release it to the public. But, before that can happen, we need the help of amazing users in the WordPress community (just like you) to improve Modula 2.0’s first beta. You can download our new plugin from <a href="https://machothemes.com/downloads/modula-2.0.0.zip" target="_blank">here</a>.
|
19 |
+
|
20 |
+
Below is a video that showcases the new features of Modula 2.0.
|
21 |
+
|
22 |
+
https://www.youtube.com/watch?v=NxrTXQNExh4
|
23 |
+
|
24 |
= See a 60s video of Modula in action =
|
25 |
|
26 |
https://www.youtube.com/watch?v=tq8yUYxgtnA
|
143 |
|
144 |
The PRO license bundles 6 different lightboxes. However you can use any other lightbox you want also with the Lite license. If you have installed a lightbox plugin then you just need to select "Direct link to image" in the "Lightbox" settings.
|
145 |
|
146 |
+
= How can I change the lightbox's background? =
|
147 |
+
|
148 |
+
You can change the lightbox popup background color using the following code:
|
149 |
+
|
150 |
+
`body .lg-backdrop {
|
151 |
+
background-color: white;
|
152 |
+
}`
|
153 |
+
|
154 |
= How can I get support? =
|
155 |
|
156 |
Free support is included only with a PRO license: [Buy Modula PRO](https://wp-modula.com/#buy "Buy Modula PRO")
|
173 |
|
174 |
== Changelog ==
|
175 |
|
176 |
+
= 1.3.3 =
|
177 |
+
* Added notification for Modula 2.0
|
178 |
+
* Added Compatibility with AO
|
179 |
+
|
180 |
= 1.3.2 =
|
181 |
* Validated HTML markup
|
182 |
|
admin/css/materialdesignicons.css
CHANGED
File without changes
|
admin/fancybox/jquery.fancybox.css
ADDED
@@ -0,0 +1,771 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
body.compensate-for-scrollbar {
|
2 |
+
overflow: hidden; }
|
3 |
+
|
4 |
+
.fancybox-active {
|
5 |
+
height: auto; }
|
6 |
+
|
7 |
+
.fancybox-is-hidden {
|
8 |
+
left: -9999px;
|
9 |
+
margin: 0;
|
10 |
+
position: absolute !important;
|
11 |
+
top: -9999px;
|
12 |
+
visibility: hidden; }
|
13 |
+
|
14 |
+
.fancybox-container {
|
15 |
+
-webkit-backface-visibility: hidden;
|
16 |
+
height: 100%;
|
17 |
+
left: 0;
|
18 |
+
outline: none;
|
19 |
+
position: fixed;
|
20 |
+
-webkit-tap-highlight-color: transparent;
|
21 |
+
top: 0;
|
22 |
+
-ms-touch-action: manipulation;
|
23 |
+
touch-action: manipulation;
|
24 |
+
-webkit-transform: translateZ(0);
|
25 |
+
transform: translateZ(0);
|
26 |
+
width: 100%;
|
27 |
+
z-index: 99992; }
|
28 |
+
|
29 |
+
.fancybox-container * {
|
30 |
+
box-sizing: border-box; }
|
31 |
+
|
32 |
+
.fancybox-outer,
|
33 |
+
.fancybox-inner,
|
34 |
+
.fancybox-bg,
|
35 |
+
.fancybox-stage {
|
36 |
+
bottom: 0;
|
37 |
+
left: 0;
|
38 |
+
position: absolute;
|
39 |
+
right: 0;
|
40 |
+
top: 0; }
|
41 |
+
|
42 |
+
.fancybox-outer {
|
43 |
+
-webkit-overflow-scrolling: touch;
|
44 |
+
overflow-y: auto; }
|
45 |
+
|
46 |
+
.fancybox-bg {
|
47 |
+
background: #1e1e1e;
|
48 |
+
opacity: 0;
|
49 |
+
transition-duration: inherit;
|
50 |
+
transition-property: opacity;
|
51 |
+
transition-timing-function: cubic-bezier(0.47, 0, 0.74, 0.71); }
|
52 |
+
|
53 |
+
.fancybox-is-open .fancybox-bg {
|
54 |
+
opacity: .9;
|
55 |
+
transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
|
56 |
+
|
57 |
+
.fancybox-infobar,
|
58 |
+
.fancybox-toolbar,
|
59 |
+
.fancybox-caption,
|
60 |
+
.fancybox-navigation .fancybox-button {
|
61 |
+
direction: ltr;
|
62 |
+
opacity: 0;
|
63 |
+
position: absolute;
|
64 |
+
transition: opacity .25s ease, visibility 0s ease .25s;
|
65 |
+
visibility: hidden;
|
66 |
+
z-index: 99997; }
|
67 |
+
|
68 |
+
.fancybox-show-infobar .fancybox-infobar,
|
69 |
+
.fancybox-show-toolbar .fancybox-toolbar,
|
70 |
+
.fancybox-show-caption .fancybox-caption,
|
71 |
+
.fancybox-show-nav .fancybox-navigation .fancybox-button {
|
72 |
+
opacity: 1;
|
73 |
+
transition: opacity .25s ease 0s, visibility 0s ease 0s;
|
74 |
+
visibility: visible; }
|
75 |
+
|
76 |
+
.fancybox-infobar {
|
77 |
+
color: #ccc;
|
78 |
+
font-size: 13px;
|
79 |
+
-webkit-font-smoothing: subpixel-antialiased;
|
80 |
+
height: 44px;
|
81 |
+
left: 0;
|
82 |
+
line-height: 44px;
|
83 |
+
min-width: 44px;
|
84 |
+
mix-blend-mode: difference;
|
85 |
+
padding: 0 10px;
|
86 |
+
pointer-events: none;
|
87 |
+
top: 0;
|
88 |
+
-webkit-touch-callout: none;
|
89 |
+
-webkit-user-select: none;
|
90 |
+
-moz-user-select: none;
|
91 |
+
-ms-user-select: none;
|
92 |
+
user-select: none; }
|
93 |
+
|
94 |
+
.fancybox-toolbar {
|
95 |
+
right: 0;
|
96 |
+
top: 0; }
|
97 |
+
|
98 |
+
.fancybox-stage {
|
99 |
+
direction: ltr;
|
100 |
+
overflow: visible;
|
101 |
+
-webkit-transform: translateZ(0);
|
102 |
+
transform: translateZ(0);
|
103 |
+
z-index: 99994; }
|
104 |
+
|
105 |
+
.fancybox-is-open .fancybox-stage {
|
106 |
+
overflow: hidden; }
|
107 |
+
|
108 |
+
.fancybox-slide {
|
109 |
+
-webkit-backface-visibility: hidden;
|
110 |
+
/* Using without prefix would break IE11 */
|
111 |
+
display: none;
|
112 |
+
height: 100%;
|
113 |
+
left: 0;
|
114 |
+
outline: none;
|
115 |
+
overflow: auto;
|
116 |
+
-webkit-overflow-scrolling: touch;
|
117 |
+
padding: 44px;
|
118 |
+
position: absolute;
|
119 |
+
text-align: center;
|
120 |
+
top: 0;
|
121 |
+
transition-property: opacity, -webkit-transform;
|
122 |
+
transition-property: transform, opacity;
|
123 |
+
transition-property: transform, opacity, -webkit-transform;
|
124 |
+
white-space: normal;
|
125 |
+
width: 100%;
|
126 |
+
z-index: 99994; }
|
127 |
+
|
128 |
+
.fancybox-slide::before {
|
129 |
+
content: '';
|
130 |
+
display: inline-block;
|
131 |
+
font-size: 0;
|
132 |
+
height: 100%;
|
133 |
+
vertical-align: middle;
|
134 |
+
width: 0; }
|
135 |
+
|
136 |
+
.fancybox-is-sliding .fancybox-slide,
|
137 |
+
.fancybox-slide--previous,
|
138 |
+
.fancybox-slide--current,
|
139 |
+
.fancybox-slide--next {
|
140 |
+
display: block; }
|
141 |
+
|
142 |
+
.fancybox-slide--image {
|
143 |
+
overflow: hidden;
|
144 |
+
padding: 44px 0; }
|
145 |
+
|
146 |
+
.fancybox-slide--image::before {
|
147 |
+
display: none; }
|
148 |
+
|
149 |
+
.fancybox-slide--html {
|
150 |
+
padding: 6px; }
|
151 |
+
|
152 |
+
.fancybox-content {
|
153 |
+
background: #fff;
|
154 |
+
display: inline-block;
|
155 |
+
margin: 0;
|
156 |
+
max-width: 100%;
|
157 |
+
overflow: auto;
|
158 |
+
-webkit-overflow-scrolling: touch;
|
159 |
+
padding: 44px;
|
160 |
+
position: relative;
|
161 |
+
text-align: left;
|
162 |
+
vertical-align: middle; }
|
163 |
+
|
164 |
+
.fancybox-slide--image .fancybox-content {
|
165 |
+
-webkit-animation-timing-function: cubic-bezier(0.5, 0, 0.14, 1);
|
166 |
+
animation-timing-function: cubic-bezier(0.5, 0, 0.14, 1);
|
167 |
+
-webkit-backface-visibility: hidden;
|
168 |
+
background: transparent;
|
169 |
+
background-repeat: no-repeat;
|
170 |
+
background-size: 100% 100%;
|
171 |
+
left: 0;
|
172 |
+
max-width: none;
|
173 |
+
overflow: visible;
|
174 |
+
padding: 0;
|
175 |
+
position: absolute;
|
176 |
+
top: 0;
|
177 |
+
-webkit-transform-origin: top left;
|
178 |
+
-ms-transform-origin: top left;
|
179 |
+
transform-origin: top left;
|
180 |
+
transition-property: opacity, -webkit-transform;
|
181 |
+
transition-property: transform, opacity;
|
182 |
+
transition-property: transform, opacity, -webkit-transform;
|
183 |
+
-webkit-user-select: none;
|
184 |
+
-moz-user-select: none;
|
185 |
+
-ms-user-select: none;
|
186 |
+
user-select: none;
|
187 |
+
z-index: 99995; }
|
188 |
+
|
189 |
+
.fancybox-can-zoomOut .fancybox-content {
|
190 |
+
cursor: -webkit-zoom-out;
|
191 |
+
cursor: zoom-out; }
|
192 |
+
|
193 |
+
.fancybox-can-zoomIn .fancybox-content {
|
194 |
+
cursor: -webkit-zoom-in;
|
195 |
+
cursor: zoom-in; }
|
196 |
+
|
197 |
+
.fancybox-can-swipe .fancybox-content,
|
198 |
+
.fancybox-can-pan .fancybox-content {
|
199 |
+
cursor: -webkit-grab;
|
200 |
+
cursor: grab; }
|
201 |
+
|
202 |
+
.fancybox-is-grabbing .fancybox-content {
|
203 |
+
cursor: -webkit-grabbing;
|
204 |
+
cursor: grabbing; }
|
205 |
+
|
206 |
+
.fancybox-container [data-selectable='true'] {
|
207 |
+
cursor: text; }
|
208 |
+
|
209 |
+
.fancybox-image,
|
210 |
+
.fancybox-spaceball {
|
211 |
+
background: transparent;
|
212 |
+
border: 0;
|
213 |
+
height: 100%;
|
214 |
+
left: 0;
|
215 |
+
margin: 0;
|
216 |
+
max-height: none;
|
217 |
+
max-width: none;
|
218 |
+
padding: 0;
|
219 |
+
position: absolute;
|
220 |
+
top: 0;
|
221 |
+
-webkit-user-select: none;
|
222 |
+
-moz-user-select: none;
|
223 |
+
-ms-user-select: none;
|
224 |
+
user-select: none;
|
225 |
+
width: 100%; }
|
226 |
+
|
227 |
+
.fancybox-spaceball {
|
228 |
+
z-index: 1; }
|
229 |
+
|
230 |
+
.fancybox-slide--video .fancybox-content,
|
231 |
+
.fancybox-slide--map .fancybox-content,
|
232 |
+
.fancybox-slide--pdf .fancybox-content,
|
233 |
+
.fancybox-slide--iframe .fancybox-content {
|
234 |
+
height: 100%;
|
235 |
+
overflow: visible;
|
236 |
+
padding: 0;
|
237 |
+
width: 100%; }
|
238 |
+
|
239 |
+
.fancybox-slide--video .fancybox-content {
|
240 |
+
background: #000; }
|
241 |
+
|
242 |
+
.fancybox-slide--map .fancybox-content {
|
243 |
+
background: #e5e3df; }
|
244 |
+
|
245 |
+
.fancybox-slide--iframe .fancybox-content {
|
246 |
+
background: #fff; }
|
247 |
+
|
248 |
+
.fancybox-video,
|
249 |
+
.fancybox-iframe {
|
250 |
+
background: transparent;
|
251 |
+
border: 0;
|
252 |
+
display: block;
|
253 |
+
height: 100%;
|
254 |
+
margin: 0;
|
255 |
+
overflow: hidden;
|
256 |
+
padding: 0;
|
257 |
+
width: 100%; }
|
258 |
+
|
259 |
+
/* Fix iOS */
|
260 |
+
.fancybox-iframe {
|
261 |
+
left: 0;
|
262 |
+
position: absolute;
|
263 |
+
top: 0; }
|
264 |
+
|
265 |
+
.fancybox-error {
|
266 |
+
background: #fff;
|
267 |
+
cursor: default;
|
268 |
+
max-width: 400px;
|
269 |
+
padding: 40px;
|
270 |
+
width: 100%; }
|
271 |
+
|
272 |
+
.fancybox-error p {
|
273 |
+
color: #444;
|
274 |
+
font-size: 16px;
|
275 |
+
line-height: 20px;
|
276 |
+
margin: 0;
|
277 |
+
padding: 0; }
|
278 |
+
|
279 |
+
/* Buttons */
|
280 |
+
.fancybox-button {
|
281 |
+
background: rgba(30, 30, 30, 0.6);
|
282 |
+
border: 0;
|
283 |
+
border-radius: 0;
|
284 |
+
box-shadow: none;
|
285 |
+
cursor: pointer;
|
286 |
+
display: inline-block;
|
287 |
+
height: 44px;
|
288 |
+
margin: 0;
|
289 |
+
padding: 10px;
|
290 |
+
position: relative;
|
291 |
+
transition: color .2s;
|
292 |
+
vertical-align: top;
|
293 |
+
visibility: inherit;
|
294 |
+
width: 44px; }
|
295 |
+
|
296 |
+
.fancybox-button,
|
297 |
+
.fancybox-button:visited,
|
298 |
+
.fancybox-button:link {
|
299 |
+
color: #ccc; }
|
300 |
+
|
301 |
+
.fancybox-button:hover {
|
302 |
+
color: #fff; }
|
303 |
+
|
304 |
+
.fancybox-button:focus {
|
305 |
+
outline: none; }
|
306 |
+
|
307 |
+
.fancybox-button.fancybox-focus {
|
308 |
+
outline: 1px dotted; }
|
309 |
+
|
310 |
+
.fancybox-button[disabled],
|
311 |
+
.fancybox-button[disabled]:hover {
|
312 |
+
color: #888;
|
313 |
+
cursor: default;
|
314 |
+
outline: none; }
|
315 |
+
|
316 |
+
/* Fix IE11 */
|
317 |
+
.fancybox-button div {
|
318 |
+
height: 100%; }
|
319 |
+
|
320 |
+
.fancybox-button svg {
|
321 |
+
display: block;
|
322 |
+
height: 100%;
|
323 |
+
overflow: visible;
|
324 |
+
position: relative;
|
325 |
+
width: 100%; }
|
326 |
+
|
327 |
+
.fancybox-button svg path {
|
328 |
+
fill: currentColor;
|
329 |
+
stroke-width: 0; }
|
330 |
+
|
331 |
+
.fancybox-button--play svg:nth-child(2),
|
332 |
+
.fancybox-button--fsenter svg:nth-child(2) {
|
333 |
+
display: none; }
|
334 |
+
|
335 |
+
.fancybox-button--pause svg:nth-child(1),
|
336 |
+
.fancybox-button--fsexit svg:nth-child(1) {
|
337 |
+
display: none; }
|
338 |
+
|
339 |
+
.fancybox-progress {
|
340 |
+
background: #ff5268;
|
341 |
+
height: 2px;
|
342 |
+
left: 0;
|
343 |
+
position: absolute;
|
344 |
+
right: 0;
|
345 |
+
top: 0;
|
346 |
+
-webkit-transform: scaleX(0);
|
347 |
+
-ms-transform: scaleX(0);
|
348 |
+
transform: scaleX(0);
|
349 |
+
-webkit-transform-origin: 0;
|
350 |
+
-ms-transform-origin: 0;
|
351 |
+
transform-origin: 0;
|
352 |
+
transition-property: -webkit-transform;
|
353 |
+
transition-property: transform;
|
354 |
+
transition-property: transform, -webkit-transform;
|
355 |
+
transition-timing-function: linear;
|
356 |
+
z-index: 99998; }
|
357 |
+
|
358 |
+
/* Close button on the top right corner of html content */
|
359 |
+
.fancybox-close-small {
|
360 |
+
background: transparent;
|
361 |
+
border: 0;
|
362 |
+
border-radius: 0;
|
363 |
+
color: #ccc;
|
364 |
+
cursor: pointer;
|
365 |
+
opacity: .8;
|
366 |
+
padding: 8px;
|
367 |
+
position: absolute;
|
368 |
+
right: -12px;
|
369 |
+
top: -44px;
|
370 |
+
z-index: 401; }
|
371 |
+
|
372 |
+
.fancybox-close-small:hover {
|
373 |
+
color: #fff;
|
374 |
+
opacity: 1; }
|
375 |
+
|
376 |
+
.fancybox-slide--html .fancybox-close-small {
|
377 |
+
color: currentColor;
|
378 |
+
padding: 10px;
|
379 |
+
right: 0;
|
380 |
+
top: 0; }
|
381 |
+
|
382 |
+
.fancybox-slide--image.fancybox-is-scaling .fancybox-content {
|
383 |
+
overflow: hidden; }
|
384 |
+
|
385 |
+
.fancybox-is-scaling .fancybox-close-small,
|
386 |
+
.fancybox-is-zoomable.fancybox-can-pan .fancybox-close-small {
|
387 |
+
display: none; }
|
388 |
+
|
389 |
+
/* Navigation arrows */
|
390 |
+
.fancybox-navigation .fancybox-button {
|
391 |
+
background-clip: content-box;
|
392 |
+
height: 100px;
|
393 |
+
opacity: 0;
|
394 |
+
position: absolute;
|
395 |
+
top: calc(50% - 50px);
|
396 |
+
width: 70px; }
|
397 |
+
|
398 |
+
.fancybox-navigation .fancybox-button div {
|
399 |
+
padding: 7px; }
|
400 |
+
|
401 |
+
.fancybox-navigation .fancybox-button--arrow_left {
|
402 |
+
left: 0;
|
403 |
+
padding: 31px 26px 31px 6px; }
|
404 |
+
|
405 |
+
.fancybox-navigation .fancybox-button--arrow_right {
|
406 |
+
padding: 31px 6px 31px 26px;
|
407 |
+
right: 0; }
|
408 |
+
|
409 |
+
/* Caption */
|
410 |
+
.fancybox-caption {
|
411 |
+
bottom: 0;
|
412 |
+
color: #eee;
|
413 |
+
font-size: 14px;
|
414 |
+
font-weight: 400;
|
415 |
+
left: 0;
|
416 |
+
line-height: 1.5;
|
417 |
+
padding: 25px 44px 25px 44px;
|
418 |
+
right: 0;
|
419 |
+
text-align: center;
|
420 |
+
z-index: 99996; }
|
421 |
+
|
422 |
+
.fancybox-caption::before {
|
423 |
+
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAD6CAQAAADKSeXYAAAAYklEQVQoz42RwQ3AMAgDjfcfup8WoRykfBAK5mQHKSz5rbXJPis1hjiV3CIqgG0hLZPkVkA4p4x5oR1bVeDrdCLrW2Q0D5bcwY3TGMHbdw3mPRuOtaspYP1w//G1OIcW148H0DMCqI/3mMMAAAAASUVORK5CYII=);
|
424 |
+
background-repeat: repeat-x;
|
425 |
+
background-size: contain;
|
426 |
+
bottom: 0;
|
427 |
+
content: '';
|
428 |
+
display: block;
|
429 |
+
left: 0;
|
430 |
+
pointer-events: none;
|
431 |
+
position: absolute;
|
432 |
+
right: 0;
|
433 |
+
top: -44px;
|
434 |
+
z-index: -1; }
|
435 |
+
|
436 |
+
.fancybox-caption a,
|
437 |
+
.fancybox-caption a:link,
|
438 |
+
.fancybox-caption a:visited {
|
439 |
+
color: #ccc;
|
440 |
+
text-decoration: none; }
|
441 |
+
|
442 |
+
.fancybox-caption a:hover {
|
443 |
+
color: #fff;
|
444 |
+
text-decoration: underline; }
|
445 |
+
|
446 |
+
/* Loading indicator */
|
447 |
+
.fancybox-loading {
|
448 |
+
-webkit-animation: fancybox-rotate 1s linear infinite;
|
449 |
+
animation: fancybox-rotate 1s linear infinite;
|
450 |
+
background: transparent;
|
451 |
+
border: 4px solid #888;
|
452 |
+
border-bottom-color: #fff;
|
453 |
+
border-radius: 50%;
|
454 |
+
height: 50px;
|
455 |
+
left: 50%;
|
456 |
+
margin: -25px 0 0 -25px;
|
457 |
+
opacity: .7;
|
458 |
+
padding: 0;
|
459 |
+
position: absolute;
|
460 |
+
top: 50%;
|
461 |
+
width: 50px;
|
462 |
+
z-index: 99999; }
|
463 |
+
|
464 |
+
@-webkit-keyframes fancybox-rotate {
|
465 |
+
100% {
|
466 |
+
-webkit-transform: rotate(360deg);
|
467 |
+
transform: rotate(360deg); } }
|
468 |
+
|
469 |
+
@keyframes fancybox-rotate {
|
470 |
+
100% {
|
471 |
+
-webkit-transform: rotate(360deg);
|
472 |
+
transform: rotate(360deg); } }
|
473 |
+
|
474 |
+
/* Transition effects */
|
475 |
+
.fancybox-animated {
|
476 |
+
transition-timing-function: cubic-bezier(0, 0, 0.25, 1); }
|
477 |
+
|
478 |
+
/* transitionEffect: slide */
|
479 |
+
.fancybox-fx-slide.fancybox-slide--previous {
|
480 |
+
opacity: 0;
|
481 |
+
-webkit-transform: translate3d(-100%, 0, 0);
|
482 |
+
transform: translate3d(-100%, 0, 0); }
|
483 |
+
|
484 |
+
.fancybox-fx-slide.fancybox-slide--next {
|
485 |
+
opacity: 0;
|
486 |
+
-webkit-transform: translate3d(100%, 0, 0);
|
487 |
+
transform: translate3d(100%, 0, 0); }
|
488 |
+
|
489 |
+
.fancybox-fx-slide.fancybox-slide--current {
|
490 |
+
opacity: 1;
|
491 |
+
-webkit-transform: translate3d(0, 0, 0);
|
492 |
+
transform: translate3d(0, 0, 0); }
|
493 |
+
|
494 |
+
/* transitionEffect: fade */
|
495 |
+
.fancybox-fx-fade.fancybox-slide--previous,
|
496 |
+
.fancybox-fx-fade.fancybox-slide--next {
|
497 |
+
opacity: 0;
|
498 |
+
transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1); }
|
499 |
+
|
500 |
+
.fancybox-fx-fade.fancybox-slide--current {
|
501 |
+
opacity: 1; }
|
502 |
+
|
503 |
+
/* transitionEffect: zoom-in-out */
|
504 |
+
.fancybox-fx-zoom-in-out.fancybox-slide--previous {
|
505 |
+
opacity: 0;
|
506 |
+
-webkit-transform: scale3d(1.5, 1.5, 1.5);
|
507 |
+
transform: scale3d(1.5, 1.5, 1.5); }
|
508 |
+
|
509 |
+
.fancybox-fx-zoom-in-out.fancybox-slide--next {
|
510 |
+
opacity: 0;
|
511 |
+
-webkit-transform: scale3d(0.5, 0.5, 0.5);
|
512 |
+
transform: scale3d(0.5, 0.5, 0.5); }
|
513 |
+
|
514 |
+
.fancybox-fx-zoom-in-out.fancybox-slide--current {
|
515 |
+
opacity: 1;
|
516 |
+
-webkit-transform: scale3d(1, 1, 1);
|
517 |
+
transform: scale3d(1, 1, 1); }
|
518 |
+
|
519 |
+
/* transitionEffect: rotate */
|
520 |
+
.fancybox-fx-rotate.fancybox-slide--previous {
|
521 |
+
opacity: 0;
|
522 |
+
-webkit-transform: rotate(-360deg);
|
523 |
+
-ms-transform: rotate(-360deg);
|
524 |
+
transform: rotate(-360deg); }
|
525 |
+
|
526 |
+
.fancybox-fx-rotate.fancybox-slide--next {
|
527 |
+
opacity: 0;
|
528 |
+
-webkit-transform: rotate(360deg);
|
529 |
+
-ms-transform: rotate(360deg);
|
530 |
+
transform: rotate(360deg); }
|
531 |
+
|
532 |
+
.fancybox-fx-rotate.fancybox-slide--current {
|
533 |
+
opacity: 1;
|
534 |
+
-webkit-transform: rotate(0deg);
|
535 |
+
-ms-transform: rotate(0deg);
|
536 |
+
transform: rotate(0deg); }
|
537 |
+
|
538 |
+
/* transitionEffect: circular */
|
539 |
+
.fancybox-fx-circular.fancybox-slide--previous {
|
540 |
+
opacity: 0;
|
541 |
+
-webkit-transform: scale3d(0, 0, 0) translate3d(-100%, 0, 0);
|
542 |
+
transform: scale3d(0, 0, 0) translate3d(-100%, 0, 0); }
|
543 |
+
|
544 |
+
.fancybox-fx-circular.fancybox-slide--next {
|
545 |
+
opacity: 0;
|
546 |
+
-webkit-transform: scale3d(0, 0, 0) translate3d(100%, 0, 0);
|
547 |
+
transform: scale3d(0, 0, 0) translate3d(100%, 0, 0); }
|
548 |
+
|
549 |
+
.fancybox-fx-circular.fancybox-slide--current {
|
550 |
+
opacity: 1;
|
551 |
+
-webkit-transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
552 |
+
transform: scale3d(1, 1, 1) translate3d(0, 0, 0); }
|
553 |
+
|
554 |
+
/* transitionEffect: tube */
|
555 |
+
.fancybox-fx-tube.fancybox-slide--previous {
|
556 |
+
-webkit-transform: translate3d(-100%, 0, 0) scale(0.1) skew(-10deg);
|
557 |
+
transform: translate3d(-100%, 0, 0) scale(0.1) skew(-10deg); }
|
558 |
+
|
559 |
+
.fancybox-fx-tube.fancybox-slide--next {
|
560 |
+
-webkit-transform: translate3d(100%, 0, 0) scale(0.1) skew(10deg);
|
561 |
+
transform: translate3d(100%, 0, 0) scale(0.1) skew(10deg); }
|
562 |
+
|
563 |
+
.fancybox-fx-tube.fancybox-slide--current {
|
564 |
+
-webkit-transform: translate3d(0, 0, 0) scale(1);
|
565 |
+
transform: translate3d(0, 0, 0) scale(1); }
|
566 |
+
|
567 |
+
/* Styling for Small-Screen Devices */
|
568 |
+
@media all and (max-height: 576px) {
|
569 |
+
.fancybox-caption {
|
570 |
+
padding: 12px; }
|
571 |
+
.fancybox-slide {
|
572 |
+
padding-left: 6px;
|
573 |
+
padding-right: 6px; }
|
574 |
+
.fancybox-slide--image {
|
575 |
+
padding: 6px 0; }
|
576 |
+
.fancybox-close-small {
|
577 |
+
right: -6px; }
|
578 |
+
.fancybox-slide--image .fancybox-close-small {
|
579 |
+
background: #4e4e4e;
|
580 |
+
color: #f2f4f6;
|
581 |
+
height: 36px;
|
582 |
+
opacity: 1;
|
583 |
+
padding: 6px;
|
584 |
+
right: 0;
|
585 |
+
top: 0;
|
586 |
+
width: 36px; } }
|
587 |
+
|
588 |
+
/* Share */
|
589 |
+
.fancybox-share {
|
590 |
+
background: #f4f4f4;
|
591 |
+
border-radius: 3px;
|
592 |
+
max-width: 90%;
|
593 |
+
padding: 30px;
|
594 |
+
text-align: center; }
|
595 |
+
|
596 |
+
.fancybox-share h1 {
|
597 |
+
color: #222;
|
598 |
+
font-size: 35px;
|
599 |
+
font-weight: 700;
|
600 |
+
margin: 0 0 20px 0; }
|
601 |
+
|
602 |
+
.fancybox-share p {
|
603 |
+
margin: 0;
|
604 |
+
padding: 0; }
|
605 |
+
|
606 |
+
.fancybox-share__button {
|
607 |
+
border: 0;
|
608 |
+
border-radius: 3px;
|
609 |
+
display: inline-block;
|
610 |
+
font-size: 14px;
|
611 |
+
font-weight: 700;
|
612 |
+
line-height: 40px;
|
613 |
+
margin: 0 5px 10px 5px;
|
614 |
+
min-width: 130px;
|
615 |
+
padding: 0 15px;
|
616 |
+
text-decoration: none;
|
617 |
+
transition: all .2s;
|
618 |
+
-webkit-user-select: none;
|
619 |
+
-moz-user-select: none;
|
620 |
+
-ms-user-select: none;
|
621 |
+
user-select: none;
|
622 |
+
white-space: nowrap; }
|
623 |
+
|
624 |
+
.fancybox-share__button:visited,
|
625 |
+
.fancybox-share__button:link {
|
626 |
+
color: #fff; }
|
627 |
+
|
628 |
+
.fancybox-share__button:hover {
|
629 |
+
text-decoration: none; }
|
630 |
+
|
631 |
+
.fancybox-share__button--fb {
|
632 |
+
background: #3b5998; }
|
633 |
+
|
634 |
+
.fancybox-share__button--fb:hover {
|
635 |
+
background: #344e86; }
|
636 |
+
|
637 |
+
.fancybox-share__button--pt {
|
638 |
+
background: #bd081d; }
|
639 |
+
|
640 |
+
.fancybox-share__button--pt:hover {
|
641 |
+
background: #aa0719; }
|
642 |
+
|
643 |
+
.fancybox-share__button--tw {
|
644 |
+
background: #1da1f2; }
|
645 |
+
|
646 |
+
.fancybox-share__button--tw:hover {
|
647 |
+
background: #0d95e8; }
|
648 |
+
|
649 |
+
.fancybox-share__button svg {
|
650 |
+
height: 25px;
|
651 |
+
margin-right: 7px;
|
652 |
+
position: relative;
|
653 |
+
top: -1px;
|
654 |
+
vertical-align: middle;
|
655 |
+
width: 25px; }
|
656 |
+
|
657 |
+
.fancybox-share__button svg path {
|
658 |
+
fill: #fff; }
|
659 |
+
|
660 |
+
.fancybox-share__input {
|
661 |
+
background: transparent;
|
662 |
+
border: 0;
|
663 |
+
border-bottom: 1px solid #d7d7d7;
|
664 |
+
border-radius: 0;
|
665 |
+
color: #5d5b5b;
|
666 |
+
font-size: 14px;
|
667 |
+
margin: 10px 0 0 0;
|
668 |
+
outline: none;
|
669 |
+
padding: 10px 15px;
|
670 |
+
width: 100%; }
|
671 |
+
|
672 |
+
/* Thumbs */
|
673 |
+
.fancybox-thumbs {
|
674 |
+
background: #ddd;
|
675 |
+
bottom: 0;
|
676 |
+
display: none;
|
677 |
+
margin: 0;
|
678 |
+
-webkit-overflow-scrolling: touch;
|
679 |
+
-ms-overflow-style: -ms-autohiding-scrollbar;
|
680 |
+
padding: 2px 2px 4px 2px;
|
681 |
+
position: absolute;
|
682 |
+
right: 0;
|
683 |
+
-webkit-tap-highlight-color: transparent;
|
684 |
+
top: 0;
|
685 |
+
width: 212px;
|
686 |
+
z-index: 99995; }
|
687 |
+
|
688 |
+
.fancybox-thumbs-x {
|
689 |
+
overflow-x: auto;
|
690 |
+
overflow-y: hidden; }
|
691 |
+
|
692 |
+
.fancybox-show-thumbs .fancybox-thumbs {
|
693 |
+
display: block; }
|
694 |
+
|
695 |
+
.fancybox-show-thumbs .fancybox-inner {
|
696 |
+
right: 212px; }
|
697 |
+
|
698 |
+
.fancybox-thumbs__list {
|
699 |
+
font-size: 0;
|
700 |
+
height: 100%;
|
701 |
+
list-style: none;
|
702 |
+
margin: 0;
|
703 |
+
overflow-x: hidden;
|
704 |
+
overflow-y: auto;
|
705 |
+
padding: 0;
|
706 |
+
position: absolute;
|
707 |
+
position: relative;
|
708 |
+
white-space: nowrap;
|
709 |
+
width: 100%; }
|
710 |
+
|
711 |
+
.fancybox-thumbs-x .fancybox-thumbs__list {
|
712 |
+
overflow: hidden; }
|
713 |
+
|
714 |
+
.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar {
|
715 |
+
width: 7px; }
|
716 |
+
|
717 |
+
.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-track {
|
718 |
+
background: #fff;
|
719 |
+
border-radius: 10px;
|
720 |
+
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); }
|
721 |
+
|
722 |
+
.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-thumb {
|
723 |
+
background: #2a2a2a;
|
724 |
+
border-radius: 10px; }
|
725 |
+
|
726 |
+
.fancybox-thumbs__list a {
|
727 |
+
-webkit-backface-visibility: hidden;
|
728 |
+
backface-visibility: hidden;
|
729 |
+
background-color: rgba(0, 0, 0, 0.1);
|
730 |
+
background-position: center center;
|
731 |
+
background-repeat: no-repeat;
|
732 |
+
background-size: cover;
|
733 |
+
cursor: pointer;
|
734 |
+
float: left;
|
735 |
+
height: 75px;
|
736 |
+
margin: 2px;
|
737 |
+
max-height: calc(100% - 8px);
|
738 |
+
max-width: calc(50% - 4px);
|
739 |
+
outline: none;
|
740 |
+
overflow: hidden;
|
741 |
+
padding: 0;
|
742 |
+
position: relative;
|
743 |
+
-webkit-tap-highlight-color: transparent;
|
744 |
+
width: 100px; }
|
745 |
+
|
746 |
+
.fancybox-thumbs__list a::before {
|
747 |
+
border: 6px solid #ff5268;
|
748 |
+
bottom: 0;
|
749 |
+
content: '';
|
750 |
+
left: 0;
|
751 |
+
opacity: 0;
|
752 |
+
position: absolute;
|
753 |
+
right: 0;
|
754 |
+
top: 0;
|
755 |
+
transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
756 |
+
z-index: 99991; }
|
757 |
+
|
758 |
+
.fancybox-thumbs__list a:focus::before {
|
759 |
+
opacity: .5; }
|
760 |
+
|
761 |
+
.fancybox-thumbs__list a.fancybox-thumbs-active::before {
|
762 |
+
opacity: 1; }
|
763 |
+
|
764 |
+
/* Styling for Small-Screen Devices */
|
765 |
+
@media all and (max-width: 576px) {
|
766 |
+
.fancybox-thumbs {
|
767 |
+
width: 110px; }
|
768 |
+
.fancybox-show-thumbs .fancybox-inner {
|
769 |
+
right: 110px; }
|
770 |
+
.fancybox-thumbs__list a {
|
771 |
+
max-width: calc(100% - 10px); } }
|
admin/fancybox/jquery.fancybox.js
ADDED
@@ -0,0 +1,5629 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// ==================================================
|
2 |
+
// fancyBox v3.5.2
|
3 |
+
//
|
4 |
+
// Licensed GPLv3 for open source use
|
5 |
+
// or fancyBox Commercial License for commercial use
|
6 |
+
//
|
7 |
+
// http://fancyapps.com/fancybox/
|
8 |
+
// Copyright 2018 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:
|
114 |
+
'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allowfullscreen allow="autoplay; fullscreen" src=""></iframe>',
|
115 |
+
|
116 |
+
// Preload iframe before displaying it
|
117 |
+
// This allows to calculate iframe content width and height
|
118 |
+
// (note: Due to "Same Origin Policy", you can't get cross domain data).
|
119 |
+
preload: true,
|
120 |
+
|
121 |
+
// Custom CSS styling for iframe wrapping element
|
122 |
+
// You can use this to set custom iframe dimensions
|
123 |
+
css: {},
|
124 |
+
|
125 |
+
// Iframe tag attributes
|
126 |
+
attr: {
|
127 |
+
scrolling: "auto"
|
128 |
+
}
|
129 |
+
},
|
130 |
+
|
131 |
+
// For HTML5 video only
|
132 |
+
video: {
|
133 |
+
tpl:
|
134 |
+
'<video class="fancybox-video" controls controlsList="nodownload" poster="{{poster}}">' +
|
135 |
+
'<source src="{{src}}" type="{{format}}" />' +
|
136 |
+
'Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player!' +
|
137 |
+
"</video>",
|
138 |
+
format: "", // custom video format
|
139 |
+
autoStart: true
|
140 |
+
},
|
141 |
+
|
142 |
+
// Default content type if cannot be detected automatically
|
143 |
+
defaultType: "image",
|
144 |
+
|
145 |
+
// Open/close animation type
|
146 |
+
// Possible values:
|
147 |
+
// false - disable
|
148 |
+
// "zoom" - zoom images from/to thumbnail
|
149 |
+
// "fade"
|
150 |
+
// "zoom-in-out"
|
151 |
+
//
|
152 |
+
animationEffect: "zoom",
|
153 |
+
|
154 |
+
// Duration in ms for open/close animation
|
155 |
+
animationDuration: 366,
|
156 |
+
|
157 |
+
// Should image change opacity while zooming
|
158 |
+
// If opacity is "auto", then opacity will be changed if image and thumbnail have different aspect ratios
|
159 |
+
zoomOpacity: "auto",
|
160 |
+
|
161 |
+
// Transition effect between slides
|
162 |
+
//
|
163 |
+
// Possible values:
|
164 |
+
// false - disable
|
165 |
+
// "fade'
|
166 |
+
// "slide'
|
167 |
+
// "circular'
|
168 |
+
// "tube'
|
169 |
+
// "zoom-in-out'
|
170 |
+
// "rotate'
|
171 |
+
//
|
172 |
+
transitionEffect: "fade",
|
173 |
+
|
174 |
+
// Duration in ms for transition animation
|
175 |
+
transitionDuration: 366,
|
176 |
+
|
177 |
+
// Custom CSS class for slide element
|
178 |
+
slideClass: "",
|
179 |
+
|
180 |
+
// Custom CSS class for layout
|
181 |
+
baseClass: "",
|
182 |
+
|
183 |
+
// Base template for layout
|
184 |
+
baseTpl:
|
185 |
+
'<div class="fancybox-container" role="dialog" tabindex="-1">' +
|
186 |
+
'<div class="fancybox-bg"></div>' +
|
187 |
+
'<div class="fancybox-inner">' +
|
188 |
+
'<div class="fancybox-infobar"><span data-fancybox-index></span> / <span data-fancybox-count></span></div>' +
|
189 |
+
'<div class="fancybox-toolbar">{{buttons}}</div>' +
|
190 |
+
'<div class="fancybox-navigation">{{arrows}}</div>' +
|
191 |
+
'<div class="fancybox-stage"></div>' +
|
192 |
+
'<div class="fancybox-caption"></div>' +
|
193 |
+
"</div>" +
|
194 |
+
"</div>",
|
195 |
+
|
196 |
+
// Loading indicator template
|
197 |
+
spinnerTpl: '<div class="fancybox-loading"></div>',
|
198 |
+
|
199 |
+
// Error message template
|
200 |
+
errorTpl: '<div class="fancybox-error"><p>{{ERROR}}</p></div>',
|
201 |
+
|
202 |
+
btnTpl: {
|
203 |
+
download:
|
204 |
+
'<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;">' +
|
205 |
+
'<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>' +
|
206 |
+
"</a>",
|
207 |
+
|
208 |
+
zoom:
|
209 |
+
'<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}">' +
|
210 |
+
'<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>' +
|
211 |
+
"</button>",
|
212 |
+
|
213 |
+
close:
|
214 |
+
'<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}">' +
|
215 |
+
'<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>' +
|
216 |
+
"</button>",
|
217 |
+
|
218 |
+
// Arrows
|
219 |
+
arrowLeft:
|
220 |
+
'<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}">' +
|
221 |
+
'<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>' +
|
222 |
+
"</button>",
|
223 |
+
|
224 |
+
arrowRight:
|
225 |
+
'<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}">' +
|
226 |
+
'<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>' +
|
227 |
+
"</button>",
|
228 |
+
|
229 |
+
// This small close button will be appended to your html/inline/ajax content by default,
|
230 |
+
// if "smallBtn" option is not set to false
|
231 |
+
smallBtn:
|
232 |
+
'<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small" title="{{CLOSE}}">' +
|
233 |
+
'<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>' +
|
234 |
+
"</button>"
|
235 |
+
},
|
236 |
+
|
237 |
+
// Container is injected into this element
|
238 |
+
parentEl: "body",
|
239 |
+
|
240 |
+
// Hide browser vertical scrollbars; use at your own risk
|
241 |
+
hideScrollbar: true,
|
242 |
+
|
243 |
+
// Focus handling
|
244 |
+
// ==============
|
245 |
+
|
246 |
+
// Try to focus on the first focusable element after opening
|
247 |
+
autoFocus: true,
|
248 |
+
|
249 |
+
// Put focus back to active element after closing
|
250 |
+
backFocus: true,
|
251 |
+
|
252 |
+
// Do not let user to focus on element outside modal content
|
253 |
+
trapFocus: true,
|
254 |
+
|
255 |
+
// Module specific options
|
256 |
+
// =======================
|
257 |
+
|
258 |
+
fullScreen: {
|
259 |
+
autoStart: false
|
260 |
+
},
|
261 |
+
|
262 |
+
// Set `touch: false` to disable panning/swiping
|
263 |
+
touch: {
|
264 |
+
vertical: true, // Allow to drag content vertically
|
265 |
+
momentum: true // Continue movement after releasing mouse/touch when panning
|
266 |
+
},
|
267 |
+
|
268 |
+
// Hash value when initializing manually,
|
269 |
+
// set `false` to disable hash change
|
270 |
+
hash: null,
|
271 |
+
|
272 |
+
// Customize or add new media types
|
273 |
+
// Example:
|
274 |
+
/*
|
275 |
+
media : {
|
276 |
+
youtube : {
|
277 |
+
params : {
|
278 |
+
autoplay : 0
|
279 |
+
}
|
280 |
+
}
|
281 |
+
}
|
282 |
+
*/
|
283 |
+
media: {},
|
284 |
+
|
285 |
+
slideShow: {
|
286 |
+
autoStart: false,
|
287 |
+
speed: 3000
|
288 |
+
},
|
289 |
+
|
290 |
+
thumbs: {
|
291 |
+
autoStart: false, // Display thumbnails on opening
|
292 |
+
hideOnClose: true, // Hide thumbnail grid when closing animation starts
|
293 |
+
parentEl: ".fancybox-container", // Container is injected into this element
|
294 |
+
axis: "y" // Vertical (y) or horizontal (x) scrolling
|
295 |
+
},
|
296 |
+
|
297 |
+
// Use mousewheel to navigate gallery
|
298 |
+
// If 'auto' - enabled for images only
|
299 |
+
wheel: "auto",
|
300 |
+
|
301 |
+
// Callbacks
|
302 |
+
//==========
|
303 |
+
|
304 |
+
// See Documentation/API/Events for more information
|
305 |
+
// Example:
|
306 |
+
/*
|
307 |
+
afterShow: function( instance, current ) {
|
308 |
+
console.info( 'Clicked element:' );
|
309 |
+
console.info( current.opts.$orig );
|
310 |
+
}
|
311 |
+
*/
|
312 |
+
|
313 |
+
onInit: $.noop, // When instance has been initialized
|
314 |
+
|
315 |
+
beforeLoad: $.noop, // Before the content of a slide is being loaded
|
316 |
+
afterLoad: $.noop, // When the content of a slide is done loading
|
317 |
+
|
318 |
+
beforeShow: $.noop, // Before open animation starts
|
319 |
+
afterShow: $.noop, // When content is done loading and animating
|
320 |
+
|
321 |
+
beforeClose: $.noop, // Before the instance attempts to close. Return false to cancel the close.
|
322 |
+
afterClose: $.noop, // After instance has been closed
|
323 |
+
|
324 |
+
onActivate: $.noop, // When instance is brought to front
|
325 |
+
onDeactivate: $.noop, // When other instance has been activated
|
326 |
+
|
327 |
+
// Interaction
|
328 |
+
// ===========
|
329 |
+
|
330 |
+
// Use options below to customize taken action when user clicks or double clicks on the fancyBox area,
|
331 |
+
// each option can be string or method that returns value.
|
332 |
+
//
|
333 |
+
// Possible values:
|
334 |
+
// "close" - close instance
|
335 |
+
// "next" - move to next gallery item
|
336 |
+
// "nextOrClose" - move to next gallery item or close if gallery has only one item
|
337 |
+
// "toggleControls" - show/hide controls
|
338 |
+
// "zoom" - zoom image (if loaded)
|
339 |
+
// false - do nothing
|
340 |
+
|
341 |
+
// Clicked on the content
|
342 |
+
clickContent: function(current, event) {
|
343 |
+
return current.type === "image" ? "zoom" : false;
|
344 |
+
},
|
345 |
+
|
346 |
+
// Clicked on the slide
|
347 |
+
clickSlide: "close",
|
348 |
+
|
349 |
+
// Clicked on the background (backdrop) element;
|
350 |
+
// if you have not changed the layout, then most likely you need to use `clickSlide` option
|
351 |
+
clickOutside: "close",
|
352 |
+
|
353 |
+
// Same as previous two, but for double click
|
354 |
+
dblclickContent: false,
|
355 |
+
dblclickSlide: false,
|
356 |
+
dblclickOutside: false,
|
357 |
+
|
358 |
+
// Custom options when mobile device is detected
|
359 |
+
// =============================================
|
360 |
+
|
361 |
+
mobile: {
|
362 |
+
preventCaptionOverlap: false,
|
363 |
+
idleTime: false,
|
364 |
+
clickContent: function(current, event) {
|
365 |
+
return current.type === "image" ? "toggleControls" : false;
|
366 |
+
},
|
367 |
+
clickSlide: function(current, event) {
|
368 |
+
return current.type === "image" ? "toggleControls" : "close";
|
369 |
+
},
|
370 |
+
dblclickContent: function(current, event) {
|
371 |
+
return current.type === "image" ? "zoom" : false;
|
372 |
+
},
|
373 |
+
dblclickSlide: function(current, event) {
|
374 |
+
return current.type === "image" ? "zoom" : false;
|
375 |
+
}
|
376 |
+
},
|
377 |
+
|
378 |
+
// Internationalization
|
379 |
+
// ====================
|
380 |
+
|
381 |
+
lang: "en",
|
382 |
+
i18n: {
|
383 |
+
en: {
|
384 |
+
CLOSE: "Close",
|
385 |
+
NEXT: "Next",
|
386 |
+
PREV: "Previous",
|
387 |
+
ERROR: "The requested content cannot be loaded. <br/> Please try again later.",
|
388 |
+
PLAY_START: "Start slideshow",
|
389 |
+
PLAY_STOP: "Pause slideshow",
|
390 |
+
FULL_SCREEN: "Full screen",
|
391 |
+
THUMBS: "Thumbnails",
|
392 |
+
DOWNLOAD: "Download",
|
393 |
+
SHARE: "Share",
|
394 |
+
ZOOM: "Zoom"
|
395 |
+
},
|
396 |
+
de: {
|
397 |
+
CLOSE: "Schliessen",
|
398 |
+
NEXT: "Weiter",
|
399 |
+
PREV: "Zurück",
|
400 |
+
ERROR: "Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es später nochmal.",
|
401 |
+
PLAY_START: "Diaschau starten",
|
402 |
+
PLAY_STOP: "Diaschau beenden",
|
403 |
+
FULL_SCREEN: "Vollbild",
|
404 |
+
THUMBS: "Vorschaubilder",
|
405 |
+
DOWNLOAD: "Herunterladen",
|
406 |
+
SHARE: "Teilen",
|
407 |
+
ZOOM: "Maßstab"
|
408 |
+
}
|
409 |
+
}
|
410 |
+
};
|
411 |
+
|
412 |
+
// Few useful variables and methods
|
413 |
+
// ================================
|
414 |
+
|
415 |
+
var $W = $(window);
|
416 |
+
var $D = $(document);
|
417 |
+
|
418 |
+
var called = 0;
|
419 |
+
|
420 |
+
// Check if an object is a jQuery object and not a native JavaScript object
|
421 |
+
// ========================================================================
|
422 |
+
var isQuery = function(obj) {
|
423 |
+
return obj && obj.hasOwnProperty && obj instanceof $;
|
424 |
+
};
|
425 |
+
|
426 |
+
// Handle multiple browsers for "requestAnimationFrame" and "cancelAnimationFrame"
|
427 |
+
// ===============================================================================
|
428 |
+
var requestAFrame = (function() {
|
429 |
+
return (
|
430 |
+
window.requestAnimationFrame ||
|
431 |
+
window.webkitRequestAnimationFrame ||
|
432 |
+
window.mozRequestAnimationFrame ||
|
433 |
+
window.oRequestAnimationFrame ||
|
434 |
+
// if all else fails, use setTimeout
|
435 |
+
function(callback) {
|
436 |
+
return window.setTimeout(callback, 1000 / 60);
|
437 |
+
}
|
438 |
+
);
|
439 |
+
})();
|
440 |
+
|
441 |
+
var cancelAFrame = (function() {
|
442 |
+
return (
|
443 |
+
window.cancelAnimationFrame ||
|
444 |
+
window.webkitCancelAnimationFrame ||
|
445 |
+
window.mozCancelAnimationFrame ||
|
446 |
+
window.oCancelAnimationFrame ||
|
447 |
+
function(id) {
|
448 |
+
window.clearTimeout(id);
|
449 |
+
}
|
450 |
+
);
|
451 |
+
})();
|
452 |
+
|
453 |
+
// Detect the supported transition-end event property name
|
454 |
+
// =======================================================
|
455 |
+
var transitionEnd = (function() {
|
456 |
+
var el = document.createElement("fakeelement"),
|
457 |
+
t;
|
458 |
+
|
459 |
+
var transitions = {
|
460 |
+
transition: "transitionend",
|
461 |
+
OTransition: "oTransitionEnd",
|
462 |
+
MozTransition: "transitionend",
|
463 |
+
WebkitTransition: "webkitTransitionEnd"
|
464 |
+
};
|
465 |
+
|
466 |
+
for (t in transitions) {
|
467 |
+
if (el.style[t] !== undefined) {
|
468 |
+
return transitions[t];
|
469 |
+
}
|
470 |
+
}
|
471 |
+
|
472 |
+
return "transitionend";
|
473 |
+
})();
|
474 |
+
|
475 |
+
// Force redraw on an element.
|
476 |
+
// This helps in cases where the browser doesn't redraw an updated element properly
|
477 |
+
// ================================================================================
|
478 |
+
var forceRedraw = function($el) {
|
479 |
+
return $el && $el.length && $el[0].offsetHeight;
|
480 |
+
};
|
481 |
+
|
482 |
+
// Exclude array (`buttons`) options from deep merging
|
483 |
+
// ===================================================
|
484 |
+
var mergeOpts = function(opts1, opts2) {
|
485 |
+
var rez = $.extend(true, {}, opts1, opts2);
|
486 |
+
|
487 |
+
$.each(opts2, function(key, value) {
|
488 |
+
if ($.isArray(value)) {
|
489 |
+
rez[key] = value;
|
490 |
+
}
|
491 |
+
});
|
492 |
+
|
493 |
+
return rez;
|
494 |
+
};
|
495 |
+
|
496 |
+
// How much of an element is visible in viewport
|
497 |
+
// =============================================
|
498 |
+
|
499 |
+
var inViewport = function(elem) {
|
500 |
+
var elemCenter, rez;
|
501 |
+
|
502 |
+
if (!elem || elem.ownerDocument !== document) {
|
503 |
+
return false;
|
504 |
+
}
|
505 |
+
|
506 |
+
$(".fancybox-container").css("pointer-events", "none");
|
507 |
+
|
508 |
+
elemCenter = {
|
509 |
+
x: elem.getBoundingClientRect().left + elem.offsetWidth / 2,
|
510 |
+
y: elem.getBoundingClientRect().top + elem.offsetHeight / 2
|
511 |
+
};
|
512 |
+
|
513 |
+
rez = document.elementFromPoint(elemCenter.x, elemCenter.y) === elem;
|
514 |
+
|
515 |
+
$(".fancybox-container").css("pointer-events", "");
|
516 |
+
|
517 |
+
return rez;
|
518 |
+
};
|
519 |
+
|
520 |
+
// Class definition
|
521 |
+
// ================
|
522 |
+
|
523 |
+
var FancyBox = function(content, opts, index) {
|
524 |
+
var self = this;
|
525 |
+
|
526 |
+
self.opts = mergeOpts({index: index}, $.fancybox.defaults);
|
527 |
+
|
528 |
+
if ($.isPlainObject(opts)) {
|
529 |
+
self.opts = mergeOpts(self.opts, opts);
|
530 |
+
}
|
531 |
+
|
532 |
+
if ($.fancybox.isMobile) {
|
533 |
+
self.opts = mergeOpts(self.opts, self.opts.mobile);
|
534 |
+
}
|
535 |
+
|
536 |
+
self.id = self.opts.id || ++called;
|
537 |
+
|
538 |
+
self.currIndex = parseInt(self.opts.index, 10) || 0;
|
539 |
+
self.prevIndex = null;
|
540 |
+
|
541 |
+
self.prevPos = null;
|
542 |
+
self.currPos = 0;
|
543 |
+
|
544 |
+
self.firstRun = true;
|
545 |
+
|
546 |
+
// All group items
|
547 |
+
self.group = [];
|
548 |
+
|
549 |
+
// Existing slides (for current, next and previous gallery items)
|
550 |
+
self.slides = {};
|
551 |
+
|
552 |
+
// Create group elements
|
553 |
+
self.addContent(content);
|
554 |
+
|
555 |
+
if (!self.group.length) {
|
556 |
+
return;
|
557 |
+
}
|
558 |
+
|
559 |
+
self.init();
|
560 |
+
};
|
561 |
+
|
562 |
+
$.extend(FancyBox.prototype, {
|
563 |
+
// Create DOM structure
|
564 |
+
// ====================
|
565 |
+
|
566 |
+
init: function() {
|
567 |
+
var self = this,
|
568 |
+
firstItem = self.group[self.currIndex],
|
569 |
+
firstItemOpts = firstItem.opts,
|
570 |
+
$container,
|
571 |
+
buttonStr;
|
572 |
+
|
573 |
+
if (firstItemOpts.closeExisting) {
|
574 |
+
$.fancybox.close(true);
|
575 |
+
}
|
576 |
+
|
577 |
+
// Hide scrollbars
|
578 |
+
// ===============
|
579 |
+
|
580 |
+
$("body").addClass("fancybox-active");
|
581 |
+
|
582 |
+
if (
|
583 |
+
!$.fancybox.getInstance() &&
|
584 |
+
firstItemOpts.hideScrollbar !== false &&
|
585 |
+
!$.fancybox.isMobile &&
|
586 |
+
document.body.scrollHeight > window.innerHeight
|
587 |
+
) {
|
588 |
+
$("head").append(
|
589 |
+
'<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:' +
|
590 |
+
(window.innerWidth - document.documentElement.clientWidth) +
|
591 |
+
"px;}</style>"
|
592 |
+
);
|
593 |
+
|
594 |
+
$("body").addClass("compensate-for-scrollbar");
|
595 |
+
}
|
596 |
+
|
597 |
+
// Build html markup and set references
|
598 |
+
// ====================================
|
599 |
+
|
600 |
+
// Build html code for buttons and insert into main template
|
601 |
+
buttonStr = "";
|
602 |
+
|
603 |
+
$.each(firstItemOpts.buttons, function(index, value) {
|
604 |
+
buttonStr += firstItemOpts.btnTpl[value] || "";
|
605 |
+
});
|
606 |
+
|
607 |
+
// Create markup from base template, it will be initially hidden to
|
608 |
+
// avoid unnecessary work like painting while initializing is not complete
|
609 |
+
$container = $(
|
610 |
+
self.translate(
|
611 |
+
self,
|
612 |
+
firstItemOpts.baseTpl
|
613 |
+
.replace("{{buttons}}", buttonStr)
|
614 |
+
.replace("{{arrows}}", firstItemOpts.btnTpl.arrowLeft + firstItemOpts.btnTpl.arrowRight)
|
615 |
+
)
|
616 |
+
)
|
617 |
+
.attr("id", "fancybox-container-" + self.id)
|
618 |
+
.addClass(firstItemOpts.baseClass)
|
619 |
+
.data("FancyBox", self)
|
620 |
+
.appendTo(firstItemOpts.parentEl);
|
621 |
+
|
622 |
+
// Create object holding references to jQuery wrapped nodes
|
623 |
+
self.$refs = {
|
624 |
+
container: $container
|
625 |
+
};
|
626 |
+
|
627 |
+
["bg", "inner", "infobar", "toolbar", "stage", "caption", "navigation"].forEach(function(item) {
|
628 |
+
self.$refs[item] = $container.find(".fancybox-" + item);
|
629 |
+
});
|
630 |
+
|
631 |
+
self.trigger("onInit");
|
632 |
+
|
633 |
+
// Enable events, deactive previous instances
|
634 |
+
self.activate();
|
635 |
+
|
636 |
+
// Build slides, load and reveal content
|
637 |
+
self.jumpTo(self.currIndex);
|
638 |
+
},
|
639 |
+
|
640 |
+
// Simple i18n support - replaces object keys found in template
|
641 |
+
// with corresponding values
|
642 |
+
// ============================================================
|
643 |
+
|
644 |
+
translate: function(obj, str) {
|
645 |
+
var arr = obj.opts.i18n[obj.opts.lang] || obj.opts.i18n.en;
|
646 |
+
|
647 |
+
return str.replace(/\{\{(\w+)\}\}/g, function(match, n) {
|
648 |
+
var value = arr[n];
|
649 |
+
|
650 |
+
if (value === undefined) {
|
651 |
+
return match;
|
652 |
+
}
|
653 |
+
|
654 |
+
return value;
|
655 |
+
});
|
656 |
+
},
|
657 |
+
|
658 |
+
// Populate current group with fresh content
|
659 |
+
// Check if each object has valid type and content
|
660 |
+
// ===============================================
|
661 |
+
|
662 |
+
addContent: function(content) {
|
663 |
+
var self = this,
|
664 |
+
items = $.makeArray(content),
|
665 |
+
thumbs;
|
666 |
+
|
667 |
+
$.each(items, function(i, item) {
|
668 |
+
var obj = {},
|
669 |
+
opts = {},
|
670 |
+
$item,
|
671 |
+
type,
|
672 |
+
found,
|
673 |
+
src,
|
674 |
+
srcParts;
|
675 |
+
|
676 |
+
// Step 1 - Make sure we have an object
|
677 |
+
// ====================================
|
678 |
+
|
679 |
+
if ($.isPlainObject(item)) {
|
680 |
+
// We probably have manual usage here, something like
|
681 |
+
// $.fancybox.open( [ { src : "image.jpg", type : "image" } ] )
|
682 |
+
|
683 |
+
obj = item;
|
684 |
+
opts = item.opts || item;
|
685 |
+
} else if ($.type(item) === "object" && $(item).length) {
|
686 |
+
// Here we probably have jQuery collection returned by some selector
|
687 |
+
$item = $(item);
|
688 |
+
|
689 |
+
// Support attributes like `data-options='{"touch" : false}'` and `data-touch='false'`
|
690 |
+
opts = $item.data() || {};
|
691 |
+
opts = $.extend(true, {}, opts, opts.options);
|
692 |
+
|
693 |
+
// Here we store clicked element
|
694 |
+
opts.$orig = $item;
|
695 |
+
|
696 |
+
obj.src = self.opts.src || opts.src || $item.attr("href");
|
697 |
+
|
698 |
+
// Assume that simple syntax is used, for example:
|
699 |
+
// `$.fancybox.open( $("#test"), {} );`
|
700 |
+
if (!obj.type && !obj.src) {
|
701 |
+
obj.type = "inline";
|
702 |
+
obj.src = item;
|
703 |
+
}
|
704 |
+
} else {
|
705 |
+
// Assume we have a simple html code, for example:
|
706 |
+
// $.fancybox.open( '<div><h1>Hi!</h1></div>' );
|
707 |
+
obj = {
|
708 |
+
type: "html",
|
709 |
+
src: item + ""
|
710 |
+
};
|
711 |
+
}
|
712 |
+
|
713 |
+
// Each gallery object has full collection of options
|
714 |
+
obj.opts = $.extend(true, {}, self.opts, opts);
|
715 |
+
|
716 |
+
// Do not merge buttons array
|
717 |
+
if ($.isArray(opts.buttons)) {
|
718 |
+
obj.opts.buttons = opts.buttons;
|
719 |
+
}
|
720 |
+
|
721 |
+
if ($.fancybox.isMobile && obj.opts.mobile) {
|
722 |
+
obj.opts = mergeOpts(obj.opts, obj.opts.mobile);
|
723 |
+
}
|
724 |
+
|
725 |
+
// Step 2 - Make sure we have content type, if not - try to guess
|
726 |
+
// ==============================================================
|
727 |
+
|
728 |
+
type = obj.type || obj.opts.type;
|
729 |
+
src = obj.src || "";
|
730 |
+
|
731 |
+
if (!type && src) {
|
732 |
+
if ((found = src.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))) {
|
733 |
+
type = "video";
|
734 |
+
|
735 |
+
if (!obj.opts.video.format) {
|
736 |
+
obj.opts.video.format = "video/" + (found[1] === "ogv" ? "ogg" : found[1]);
|
737 |
+
}
|
738 |
+
} else if (src.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)) {
|
739 |
+
type = "image";
|
740 |
+
} else if (src.match(/\.(pdf)((\?|#).*)?$/i)) {
|
741 |
+
type = "iframe";
|
742 |
+
obj = $.extend(true, obj, {contentType: "pdf", opts: {iframe: {preload: false}}});
|
743 |
+
} else if (src.charAt(0) === "#") {
|
744 |
+
type = "inline";
|
745 |
+
}
|
746 |
+
}
|
747 |
+
|
748 |
+
if (type) {
|
749 |
+
obj.type = type;
|
750 |
+
} else {
|
751 |
+
self.trigger("objectNeedsType", obj);
|
752 |
+
}
|
753 |
+
|
754 |
+
if (!obj.contentType) {
|
755 |
+
obj.contentType = $.inArray(obj.type, ["html", "inline", "ajax"]) > -1 ? "html" : obj.type;
|
756 |
+
}
|
757 |
+
|
758 |
+
// Step 3 - Some adjustments
|
759 |
+
// =========================
|
760 |
+
|
761 |
+
obj.index = self.group.length;
|
762 |
+
|
763 |
+
if (obj.opts.smallBtn == "auto") {
|
764 |
+
obj.opts.smallBtn = $.inArray(obj.type, ["html", "inline", "ajax"]) > -1;
|
765 |
+
}
|
766 |
+
|
767 |
+
if (obj.opts.toolbar === "auto") {
|
768 |
+
obj.opts.toolbar = !obj.opts.smallBtn;
|
769 |
+
}
|
770 |
+
|
771 |
+
// Find thumbnail image, check if exists and if is in the viewport
|
772 |
+
obj.$thumb = obj.opts.$thumb || null;
|
773 |
+
|
774 |
+
if (obj.opts.$trigger && obj.index === self.opts.index) {
|
775 |
+
obj.$thumb = obj.opts.$trigger.find("img:first");
|
776 |
+
|
777 |
+
if (obj.$thumb.length) {
|
778 |
+
obj.opts.$orig = obj.opts.$trigger;
|
779 |
+
}
|
780 |
+
}
|
781 |
+
|
782 |
+
if (!(obj.$thumb && obj.$thumb.length) && obj.opts.$orig) {
|
783 |
+
obj.$thumb = obj.opts.$orig.find("img:first");
|
784 |
+
}
|
785 |
+
|
786 |
+
if (obj.$thumb && !obj.$thumb.length) {
|
787 |
+
obj.$thumb = null;
|
788 |
+
}
|
789 |
+
|
790 |
+
obj.thumb = obj.opts.thumb || (obj.$thumb ? obj.$thumb[0].src : null);
|
791 |
+
|
792 |
+
// "caption" is a "special" option, it can be used to customize caption per gallery item
|
793 |
+
if ($.type(obj.opts.caption) === "function") {
|
794 |
+
obj.opts.caption = obj.opts.caption.apply(item, [self, obj]);
|
795 |
+
}
|
796 |
+
|
797 |
+
if ($.type(self.opts.caption) === "function") {
|
798 |
+
obj.opts.caption = self.opts.caption.apply(item, [self, obj]);
|
799 |
+
}
|
800 |
+
|
801 |
+
// Make sure we have caption as a string or jQuery object
|
802 |
+
if (!(obj.opts.caption instanceof $)) {
|
803 |
+
obj.opts.caption = obj.opts.caption === undefined ? "" : obj.opts.caption + "";
|
804 |
+
}
|
805 |
+
|
806 |
+
// Check if url contains "filter" used to filter the content
|
807 |
+
// Example: "ajax.html #something"
|
808 |
+
if (obj.type === "ajax") {
|
809 |
+
srcParts = src.split(/\s+/, 2);
|
810 |
+
|
811 |
+
if (srcParts.length > 1) {
|
812 |
+
obj.src = srcParts.shift();
|
813 |
+
|
814 |
+
obj.opts.filter = srcParts.shift();
|
815 |
+
}
|
816 |
+
}
|
817 |
+
|
818 |
+
// Hide all buttons and disable interactivity for modal items
|
819 |
+
if (obj.opts.modal) {
|
820 |
+
obj.opts = $.extend(true, obj.opts, {
|
821 |
+
trapFocus: true,
|
822 |
+
// Remove buttons
|
823 |
+
infobar: 0,
|
824 |
+
toolbar: 0,
|
825 |
+
|
826 |
+
smallBtn: 0,
|
827 |
+
|
828 |
+
// Disable keyboard navigation
|
829 |
+
keyboard: 0,
|
830 |
+
|
831 |
+
// Disable some modules
|
832 |
+
slideShow: 0,
|
833 |
+
fullScreen: 0,
|
834 |
+
thumbs: 0,
|
835 |
+
touch: 0,
|
836 |
+
|
837 |
+
// Disable click event handlers
|
838 |
+
clickContent: false,
|
839 |
+
clickSlide: false,
|
840 |
+
clickOutside: false,
|
841 |
+
dblclickContent: false,
|
842 |
+
dblclickSlide: false,
|
843 |
+
dblclickOutside: false
|
844 |
+
});
|
845 |
+
}
|
846 |
+
|
847 |
+
// Step 4 - Add processed object to group
|
848 |
+
// ======================================
|
849 |
+
|
850 |
+
self.group.push(obj);
|
851 |
+
});
|
852 |
+
|
853 |
+
// Update controls if gallery is already opened
|
854 |
+
if (Object.keys(self.slides).length) {
|
855 |
+
self.updateControls();
|
856 |
+
|
857 |
+
// Update thumbnails, if needed
|
858 |
+
thumbs = self.Thumbs;
|
859 |
+
|
860 |
+
if (thumbs && thumbs.isActive) {
|
861 |
+
thumbs.create();
|
862 |
+
|
863 |
+
thumbs.focus();
|
864 |
+
}
|
865 |
+
}
|
866 |
+
},
|
867 |
+
|
868 |
+
// Attach an event handler functions for:
|
869 |
+
// - navigation buttons
|
870 |
+
// - browser scrolling, resizing;
|
871 |
+
// - focusing
|
872 |
+
// - keyboard
|
873 |
+
// - detecting inactivity
|
874 |
+
// ======================================
|
875 |
+
|
876 |
+
addEvents: function() {
|
877 |
+
var self = this;
|
878 |
+
|
879 |
+
self.removeEvents();
|
880 |
+
|
881 |
+
// Make navigation elements clickable
|
882 |
+
// ==================================
|
883 |
+
|
884 |
+
self.$refs.container
|
885 |
+
.on("click.fb-close", "[data-fancybox-close]", function(e) {
|
886 |
+
e.stopPropagation();
|
887 |
+
e.preventDefault();
|
888 |
+
|
889 |
+
self.close(e);
|
890 |
+
})
|
891 |
+
.on("touchstart.fb-prev click.fb-prev", "[data-fancybox-prev]", function(e) {
|
892 |
+
e.stopPropagation();
|
893 |
+
e.preventDefault();
|
894 |
+
|
895 |
+
self.previous();
|
896 |
+
})
|
897 |
+
.on("touchstart.fb-next click.fb-next", "[data-fancybox-next]", function(e) {
|
898 |
+
e.stopPropagation();
|
899 |
+
e.preventDefault();
|
900 |
+
|
901 |
+
self.next();
|
902 |
+
})
|
903 |
+
.on("click.fb", "[data-fancybox-zoom]", function(e) {
|
904 |
+
// Click handler for zoom button
|
905 |
+
self[self.isScaledDown() ? "scaleToActual" : "scaleToFit"]();
|
906 |
+
});
|
907 |
+
|
908 |
+
// Handle page scrolling and browser resizing
|
909 |
+
// ==========================================
|
910 |
+
|
911 |
+
$W.on("orientationchange.fb resize.fb", function(e) {
|
912 |
+
if (e && e.originalEvent && e.originalEvent.type === "resize") {
|
913 |
+
if (self.requestId) {
|
914 |
+
cancelAFrame(self.requestId);
|
915 |
+
}
|
916 |
+
|
917 |
+
self.requestId = requestAFrame(function() {
|
918 |
+
self.update(e);
|
919 |
+
});
|
920 |
+
} else {
|
921 |
+
if (self.current && self.current.type === "iframe") {
|
922 |
+
self.$refs.stage.hide();
|
923 |
+
}
|
924 |
+
|
925 |
+
setTimeout(function() {
|
926 |
+
self.$refs.stage.show();
|
927 |
+
|
928 |
+
self.update(e);
|
929 |
+
}, $.fancybox.isMobile ? 600 : 250);
|
930 |
+
}
|
931 |
+
});
|
932 |
+
|
933 |
+
$D.on("keydown.fb", function(e) {
|
934 |
+
var instance = $.fancybox ? $.fancybox.getInstance() : null,
|
935 |
+
current = instance.current,
|
936 |
+
keycode = e.keyCode || e.which;
|
937 |
+
|
938 |
+
// Trap keyboard focus inside of the modal
|
939 |
+
// =======================================
|
940 |
+
|
941 |
+
if (keycode == 9) {
|
942 |
+
if (current.opts.trapFocus) {
|
943 |
+
self.focus(e);
|
944 |
+
}
|
945 |
+
|
946 |
+
return;
|
947 |
+
}
|
948 |
+
|
949 |
+
// Enable keyboard navigation
|
950 |
+
// ==========================
|
951 |
+
|
952 |
+
if (!current.opts.keyboard || e.ctrlKey || e.altKey || e.shiftKey || $(e.target).is("input") || $(e.target).is("textarea")) {
|
953 |
+
return;
|
954 |
+
}
|
955 |
+
|
956 |
+
// Backspace and Esc keys
|
957 |
+
if (keycode === 8 || keycode === 27) {
|
958 |
+
e.preventDefault();
|
959 |
+
|
960 |
+
self.close(e);
|
961 |
+
|
962 |
+
return;
|
963 |
+
}
|
964 |
+
|
965 |
+
// Left arrow and Up arrow
|
966 |
+
if (keycode === 37 || keycode === 38) {
|
967 |
+
e.preventDefault();
|
968 |
+
|
969 |
+
self.previous();
|
970 |
+
|
971 |
+
return;
|
972 |
+
}
|
973 |
+
|
974 |
+
// Righ arrow and Down arrow
|
975 |
+
if (keycode === 39 || keycode === 40) {
|
976 |
+
e.preventDefault();
|
977 |
+
|
978 |
+
self.next();
|
979 |
+
|
980 |
+
return;
|
981 |
+
}
|
982 |
+
|
983 |
+
self.trigger("afterKeydown", e, keycode);
|
984 |
+
});
|
985 |
+
|
986 |
+
// Hide controls after some inactivity period
|
987 |
+
if (self.group[self.currIndex].opts.idleTime) {
|
988 |
+
self.idleSecondsCounter = 0;
|
989 |
+
|
990 |
+
$D.on(
|
991 |
+
"mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",
|
992 |
+
function(e) {
|
993 |
+
self.idleSecondsCounter = 0;
|
994 |
+
|
995 |
+
if (self.isIdle) {
|
996 |
+
self.showControls();
|
997 |
+
}
|
998 |
+
|
999 |
+
self.isIdle = false;
|
1000 |
+
}
|
1001 |
+
);
|
1002 |
+
|
1003 |
+
self.idleInterval = window.setInterval(function() {
|
1004 |
+
self.idleSecondsCounter++;
|
1005 |
+
|
1006 |
+
if (self.idleSecondsCounter >= self.group[self.currIndex].opts.idleTime && !self.isDragging) {
|
1007 |
+
self.isIdle = true;
|
1008 |
+
self.idleSecondsCounter = 0;
|
1009 |
+
|
1010 |
+
self.hideControls();
|
1011 |
+
}
|
1012 |
+
}, 1000);
|
1013 |
+
}
|
1014 |
+
},
|
1015 |
+
|
1016 |
+
// Remove events added by the core
|
1017 |
+
// ===============================
|
1018 |
+
|
1019 |
+
removeEvents: function() {
|
1020 |
+
var self = this;
|
1021 |
+
|
1022 |
+
$W.off("orientationchange.fb resize.fb");
|
1023 |
+
$D.off("keydown.fb .fb-idle");
|
1024 |
+
|
1025 |
+
this.$refs.container.off(".fb-close .fb-prev .fb-next");
|
1026 |
+
|
1027 |
+
if (self.idleInterval) {
|
1028 |
+
window.clearInterval(self.idleInterval);
|
1029 |
+
|
1030 |
+
self.idleInterval = null;
|
1031 |
+
}
|
1032 |
+
},
|
1033 |
+
|
1034 |
+
// Change to previous gallery item
|
1035 |
+
// ===============================
|
1036 |
+
|
1037 |
+
previous: function(duration) {
|
1038 |
+
return this.jumpTo(this.currPos - 1, duration);
|
1039 |
+
},
|
1040 |
+
|
1041 |
+
// Change to next gallery item
|
1042 |
+
// ===========================
|
1043 |
+
|
1044 |
+
next: function(duration) {
|
1045 |
+
return this.jumpTo(this.currPos + 1, duration);
|
1046 |
+
},
|
1047 |
+
|
1048 |
+
// Switch to selected gallery item
|
1049 |
+
// ===============================
|
1050 |
+
|
1051 |
+
jumpTo: function(pos, duration) {
|
1052 |
+
var self = this,
|
1053 |
+
groupLen = self.group.length,
|
1054 |
+
firstRun,
|
1055 |
+
isMoved,
|
1056 |
+
loop,
|
1057 |
+
current,
|
1058 |
+
previous,
|
1059 |
+
slidePos,
|
1060 |
+
stagePos,
|
1061 |
+
prop,
|
1062 |
+
diff;
|
1063 |
+
|
1064 |
+
if (self.isDragging || self.isClosing || (self.isAnimating && self.firstRun)) {
|
1065 |
+
return;
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
// Should loop?
|
1069 |
+
pos = parseInt(pos, 10);
|
1070 |
+
loop = self.current ? self.current.opts.loop : self.opts.loop;
|
1071 |
+
|
1072 |
+
if (!loop && (pos < 0 || pos >= groupLen)) {
|
1073 |
+
return false;
|
1074 |
+
}
|
1075 |
+
|
1076 |
+
// Check if opening for the first time; this helps to speed things up
|
1077 |
+
firstRun = self.firstRun = !Object.keys(self.slides).length;
|
1078 |
+
|
1079 |
+
// Create slides
|
1080 |
+
previous = self.current;
|
1081 |
+
|
1082 |
+
self.prevIndex = self.currIndex;
|
1083 |
+
self.prevPos = self.currPos;
|
1084 |
+
|
1085 |
+
current = self.createSlide(pos);
|
1086 |
+
|
1087 |
+
if (groupLen > 1) {
|
1088 |
+
if (loop || current.index < groupLen - 1) {
|
1089 |
+
self.createSlide(pos + 1);
|
1090 |
+
}
|
1091 |
+
|
1092 |
+
if (loop || current.index > 0) {
|
1093 |
+
self.createSlide(pos - 1);
|
1094 |
+
}
|
1095 |
+
}
|
1096 |
+
|
1097 |
+
self.current = current;
|
1098 |
+
self.currIndex = current.index;
|
1099 |
+
self.currPos = current.pos;
|
1100 |
+
|
1101 |
+
self.trigger("beforeShow", firstRun);
|
1102 |
+
|
1103 |
+
self.updateControls();
|
1104 |
+
|
1105 |
+
// Validate duration length
|
1106 |
+
current.forcedDuration = undefined;
|
1107 |
+
|
1108 |
+
if ($.isNumeric(duration)) {
|
1109 |
+
current.forcedDuration = duration;
|
1110 |
+
} else {
|
1111 |
+
duration = current.opts[firstRun ? "animationDuration" : "transitionDuration"];
|
1112 |
+
}
|
1113 |
+
|
1114 |
+
duration = parseInt(duration, 10);
|
1115 |
+
|
1116 |
+
// Check if user has swiped the slides or if still animating
|
1117 |
+
isMoved = self.isMoved(current);
|
1118 |
+
|
1119 |
+
// Make sure current slide is visible
|
1120 |
+
current.$slide.addClass("fancybox-slide--current");
|
1121 |
+
|
1122 |
+
// Fresh start - reveal container, current slide and start loading content
|
1123 |
+
if (firstRun) {
|
1124 |
+
if (current.opts.animationEffect && duration) {
|
1125 |
+
self.$refs.container.css("transition-duration", duration + "ms");
|
1126 |
+
}
|
1127 |
+
|
1128 |
+
self.$refs.container.addClass("fancybox-is-open").trigger("focus");
|
1129 |
+
|
1130 |
+
// Attempt to load content into slide
|
1131 |
+
// This will later call `afterLoad` -> `revealContent`
|
1132 |
+
self.loadSlide(current);
|
1133 |
+
|
1134 |
+
self.preload("image");
|
1135 |
+
|
1136 |
+
return;
|
1137 |
+
}
|
1138 |
+
|
1139 |
+
// Get actual slide/stage positions (before cleaning up)
|
1140 |
+
slidePos = $.fancybox.getTranslate(previous.$slide);
|
1141 |
+
stagePos = $.fancybox.getTranslate(self.$refs.stage);
|
1142 |
+
|
1143 |
+
// Clean up all slides
|
1144 |
+
$.each(self.slides, function(index, slide) {
|
1145 |
+
$.fancybox.stop(slide.$slide, true);
|
1146 |
+
});
|
1147 |
+
|
1148 |
+
if (previous.pos !== current.pos) {
|
1149 |
+
previous.isComplete = false;
|
1150 |
+
}
|
1151 |
+
|
1152 |
+
previous.$slide.removeClass("fancybox-slide--complete fancybox-slide--current");
|
1153 |
+
|
1154 |
+
// If slides are out of place, then animate them to correct position
|
1155 |
+
if (isMoved) {
|
1156 |
+
// Calculate horizontal swipe distance
|
1157 |
+
diff = slidePos.left - (previous.pos * slidePos.width + previous.pos * previous.opts.gutter);
|
1158 |
+
|
1159 |
+
$.each(self.slides, function(index, slide) {
|
1160 |
+
slide.$slide.removeClass("fancybox-animated").removeClass(function(index, className) {
|
1161 |
+
return (className.match(/(^|\s)fancybox-fx-\S+/g) || []).join(" ");
|
1162 |
+
});
|
1163 |
+
|
1164 |
+
// Make sure that each slide is in equal distance
|
1165 |
+
// This is mostly needed for freshly added slides, because they are not yet positioned
|
1166 |
+
var leftPos = slide.pos * slidePos.width + slide.pos * slide.opts.gutter;
|
1167 |
+
|
1168 |
+
$.fancybox.setTranslate(slide.$slide, {top: 0, left: leftPos - stagePos.left + diff});
|
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 |
+
{
|
1181 |
+
top: 0,
|
1182 |
+
left: (slide.pos - current.pos) * slidePos.width + (slide.pos - current.pos) * slide.opts.gutter
|
1183 |
+
},
|
1184 |
+
duration,
|
1185 |
+
function() {
|
1186 |
+
slide.$slide
|
1187 |
+
.css({
|
1188 |
+
transform: "",
|
1189 |
+
opacity: ""
|
1190 |
+
})
|
1191 |
+
.removeClass("fancybox-slide--next fancybox-slide--previous");
|
1192 |
+
|
1193 |
+
if (slide.pos === self.currPos) {
|
1194 |
+
self.complete();
|
1195 |
+
}
|
1196 |
+
}
|
1197 |
+
);
|
1198 |
+
});
|
1199 |
+
} else if (duration && current.opts.transitionEffect) {
|
1200 |
+
// Set transition effect for previously active slide
|
1201 |
+
prop = "fancybox-animated fancybox-fx-" + current.opts.transitionEffect;
|
1202 |
+
|
1203 |
+
previous.$slide.addClass("fancybox-slide--" + (previous.pos > current.pos ? "next" : "previous"));
|
1204 |
+
|
1205 |
+
$.fancybox.animate(
|
1206 |
+
previous.$slide,
|
1207 |
+
prop,
|
1208 |
+
duration,
|
1209 |
+
function() {
|
1210 |
+
previous.$slide.removeClass(prop).removeClass("fancybox-slide--next fancybox-slide--previous");
|
1211 |
+
},
|
1212 |
+
false
|
1213 |
+
);
|
1214 |
+
}
|
1215 |
+
|
1216 |
+
if (current.isLoaded) {
|
1217 |
+
self.revealContent(current);
|
1218 |
+
} else {
|
1219 |
+
self.loadSlide(current);
|
1220 |
+
}
|
1221 |
+
|
1222 |
+
self.preload("image");
|
1223 |
+
},
|
1224 |
+
|
1225 |
+
// Create new "slide" element
|
1226 |
+
// These are gallery items that are actually added to DOM
|
1227 |
+
// =======================================================
|
1228 |
+
|
1229 |
+
createSlide: function(pos) {
|
1230 |
+
var self = this,
|
1231 |
+
$slide,
|
1232 |
+
index;
|
1233 |
+
|
1234 |
+
index = pos % self.group.length;
|
1235 |
+
index = index < 0 ? self.group.length + index : index;
|
1236 |
+
|
1237 |
+
if (!self.slides[pos] && self.group[index]) {
|
1238 |
+
$slide = $('<div class="fancybox-slide"></div>').appendTo(self.$refs.stage);
|
1239 |
+
|
1240 |
+
self.slides[pos] = $.extend(true, {}, self.group[index], {
|
1241 |
+
pos: pos,
|
1242 |
+
$slide: $slide,
|
1243 |
+
isLoaded: false
|
1244 |
+
});
|
1245 |
+
|
1246 |
+
self.updateSlide(self.slides[pos]);
|
1247 |
+
}
|
1248 |
+
|
1249 |
+
return self.slides[pos];
|
1250 |
+
},
|
1251 |
+
|
1252 |
+
// Scale image to the actual size of the image;
|
1253 |
+
// x and y values should be relative to the slide
|
1254 |
+
// ==============================================
|
1255 |
+
|
1256 |
+
scaleToActual: function(x, y, duration) {
|
1257 |
+
var self = this,
|
1258 |
+
current = self.current,
|
1259 |
+
$content = current.$content,
|
1260 |
+
canvasWidth = $.fancybox.getTranslate(current.$slide).width,
|
1261 |
+
canvasHeight = $.fancybox.getTranslate(current.$slide).height,
|
1262 |
+
newImgWidth = current.width,
|
1263 |
+
newImgHeight = current.height,
|
1264 |
+
imgPos,
|
1265 |
+
posX,
|
1266 |
+
posY,
|
1267 |
+
scaleX,
|
1268 |
+
scaleY;
|
1269 |
+
|
1270 |
+
if (self.isAnimating || self.isMoved() || !$content || !(current.type == "image" && current.isLoaded && !current.hasError)) {
|
1271 |
+
return;
|
1272 |
+
}
|
1273 |
+
|
1274 |
+
self.isAnimating = true;
|
1275 |
+
|
1276 |
+
$.fancybox.stop($content);
|
1277 |
+
|
1278 |
+
x = x === undefined ? canvasWidth * 0.5 : x;
|
1279 |
+
y = y === undefined ? canvasHeight * 0.5 : y;
|
1280 |
+
|
1281 |
+
imgPos = $.fancybox.getTranslate($content);
|
1282 |
+
|
1283 |
+
imgPos.top -= $.fancybox.getTranslate(current.$slide).top;
|
1284 |
+
imgPos.left -= $.fancybox.getTranslate(current.$slide).left;
|
1285 |
+
|
1286 |
+
scaleX = newImgWidth / imgPos.width;
|
1287 |
+
scaleY = newImgHeight / imgPos.height;
|
1288 |
+
|
1289 |
+
// Get center position for original image
|
1290 |
+
posX = canvasWidth * 0.5 - newImgWidth * 0.5;
|
1291 |
+
posY = canvasHeight * 0.5 - newImgHeight * 0.5;
|
1292 |
+
|
1293 |
+
// Make sure image does not move away from edges
|
1294 |
+
if (newImgWidth > canvasWidth) {
|
1295 |
+
posX = imgPos.left * scaleX - (x * scaleX - x);
|
1296 |
+
|
1297 |
+
if (posX > 0) {
|
1298 |
+
posX = 0;
|
1299 |
+
}
|
1300 |
+
|
1301 |
+
if (posX < canvasWidth - newImgWidth) {
|
1302 |
+
posX = canvasWidth - newImgWidth;
|
1303 |
+
}
|
1304 |
+
}
|
1305 |
+
|
1306 |
+
if (newImgHeight > canvasHeight) {
|
1307 |
+
posY = imgPos.top * scaleY - (y * scaleY - y);
|
1308 |
+
|
1309 |
+
if (posY > 0) {
|
1310 |
+
posY = 0;
|
1311 |
+
}
|
1312 |
+
|
1313 |
+
if (posY < canvasHeight - newImgHeight) {
|
1314 |
+
posY = canvasHeight - newImgHeight;
|
1315 |
+
}
|
1316 |
+
}
|
1317 |
+
|
1318 |
+
self.updateCursor(newImgWidth, newImgHeight);
|
1319 |
+
|
1320 |
+
$.fancybox.animate(
|
1321 |
+
$content,
|
1322 |
+
{
|
1323 |
+
top: posY,
|
1324 |
+
left: posX,
|
1325 |
+
scaleX: scaleX,
|
1326 |
+
scaleY: scaleY
|
1327 |
+
},
|
1328 |
+
duration || 330,
|
1329 |
+
function() {
|
1330 |
+
self.isAnimating = false;
|
1331 |
+
}
|
1332 |
+
);
|
1333 |
+
|
1334 |
+
// Stop slideshow
|
1335 |
+
if (self.SlideShow && self.SlideShow.isActive) {
|
1336 |
+
self.SlideShow.stop();
|
1337 |
+
}
|
1338 |
+
},
|
1339 |
+
|
1340 |
+
// Scale image to fit inside parent element
|
1341 |
+
// ========================================
|
1342 |
+
|
1343 |
+
scaleToFit: function(duration) {
|
1344 |
+
var self = this,
|
1345 |
+
current = self.current,
|
1346 |
+
$content = current.$content,
|
1347 |
+
end;
|
1348 |
+
|
1349 |
+
if (self.isAnimating || self.isMoved() || !$content || !(current.type == "image" && current.isLoaded && !current.hasError)) {
|
1350 |
+
return;
|
1351 |
+
}
|
1352 |
+
|
1353 |
+
self.isAnimating = true;
|
1354 |
+
|
1355 |
+
$.fancybox.stop($content);
|
1356 |
+
|
1357 |
+
end = self.getFitPos(current);
|
1358 |
+
|
1359 |
+
self.updateCursor(end.width, end.height);
|
1360 |
+
|
1361 |
+
$.fancybox.animate(
|
1362 |
+
$content,
|
1363 |
+
{
|
1364 |
+
top: end.top,
|
1365 |
+
left: end.left,
|
1366 |
+
scaleX: end.width / $content.width(),
|
1367 |
+
scaleY: end.height / $content.height()
|
1368 |
+
},
|
1369 |
+
duration || 330,
|
1370 |
+
function() {
|
1371 |
+
self.isAnimating = false;
|
1372 |
+
}
|
1373 |
+
);
|
1374 |
+
},
|
1375 |
+
|
1376 |
+
// Calculate image size to fit inside viewport
|
1377 |
+
// ===========================================
|
1378 |
+
|
1379 |
+
getFitPos: function(slide) {
|
1380 |
+
var self = this,
|
1381 |
+
$content = slide.$content,
|
1382 |
+
$slide = slide.$slide,
|
1383 |
+
width = slide.width || slide.opts.width,
|
1384 |
+
height = slide.height || slide.opts.height,
|
1385 |
+
maxWidth,
|
1386 |
+
maxHeight,
|
1387 |
+
minRatio,
|
1388 |
+
aspectRatio,
|
1389 |
+
rez = {};
|
1390 |
+
|
1391 |
+
if (!slide.isLoaded || !$content || !$content.length) {
|
1392 |
+
return false;
|
1393 |
+
}
|
1394 |
+
|
1395 |
+
maxWidth = $.fancybox.getTranslate(self.$refs.stage).width;
|
1396 |
+
maxHeight = $.fancybox.getTranslate(self.$refs.stage).height;
|
1397 |
+
|
1398 |
+
maxWidth -=
|
1399 |
+
parseFloat($slide.css("paddingLeft")) +
|
1400 |
+
parseFloat($slide.css("paddingRight")) +
|
1401 |
+
parseFloat($content.css("marginLeft")) +
|
1402 |
+
parseFloat($content.css("marginRight"));
|
1403 |
+
|
1404 |
+
maxHeight -=
|
1405 |
+
parseFloat($slide.css("paddingTop")) +
|
1406 |
+
parseFloat($slide.css("paddingBottom")) +
|
1407 |
+
parseFloat($content.css("marginTop")) +
|
1408 |
+
parseFloat($content.css("marginBottom"));
|
1409 |
+
|
1410 |
+
if (!width || !height) {
|
1411 |
+
width = maxWidth;
|
1412 |
+
height = maxHeight;
|
1413 |
+
}
|
1414 |
+
|
1415 |
+
minRatio = Math.min(1, maxWidth / width, maxHeight / height);
|
1416 |
+
|
1417 |
+
width = minRatio * width;
|
1418 |
+
height = minRatio * height;
|
1419 |
+
|
1420 |
+
// Adjust width/height to precisely fit into container
|
1421 |
+
if (width > maxWidth - 0.5) {
|
1422 |
+
width = maxWidth;
|
1423 |
+
}
|
1424 |
+
|
1425 |
+
if (height > maxHeight - 0.5) {
|
1426 |
+
height = maxHeight;
|
1427 |
+
}
|
1428 |
+
|
1429 |
+
if (slide.type === "image") {
|
1430 |
+
rez.top = Math.floor((maxHeight - height) * 0.5) + parseFloat($slide.css("paddingTop"));
|
1431 |
+
rez.left = Math.floor((maxWidth - width) * 0.5) + parseFloat($slide.css("paddingLeft"));
|
1432 |
+
} else if (slide.contentType === "video") {
|
1433 |
+
// Force aspect ratio for the video
|
1434 |
+
// "I say the whole world must learn of our peaceful ways… by force!"
|
1435 |
+
aspectRatio = slide.opts.width && slide.opts.height ? width / height : slide.opts.ratio || 16 / 9;
|
1436 |
+
|
1437 |
+
if (height > width / aspectRatio) {
|
1438 |
+
height = width / aspectRatio;
|
1439 |
+
} else if (width > height * aspectRatio) {
|
1440 |
+
width = height * aspectRatio;
|
1441 |
+
}
|
1442 |
+
}
|
1443 |
+
|
1444 |
+
rez.width = width;
|
1445 |
+
rez.height = height;
|
1446 |
+
|
1447 |
+
return rez;
|
1448 |
+
},
|
1449 |
+
|
1450 |
+
// Update content size and position for all slides
|
1451 |
+
// ==============================================
|
1452 |
+
|
1453 |
+
update: function(e) {
|
1454 |
+
var self = this;
|
1455 |
+
|
1456 |
+
$.each(self.slides, function(key, slide) {
|
1457 |
+
self.updateSlide(slide, e);
|
1458 |
+
});
|
1459 |
+
},
|
1460 |
+
|
1461 |
+
// Update slide content position and size
|
1462 |
+
// ======================================
|
1463 |
+
|
1464 |
+
updateSlide: function(slide, e) {
|
1465 |
+
var self = this,
|
1466 |
+
$content = slide && slide.$content,
|
1467 |
+
width = slide.width || slide.opts.width,
|
1468 |
+
height = slide.height || slide.opts.height,
|
1469 |
+
$slide = slide.$slide;
|
1470 |
+
|
1471 |
+
// First, prevent caption overlap, if needed
|
1472 |
+
self.adjustCaption(slide);
|
1473 |
+
|
1474 |
+
// Then resize content to fit inside the slide
|
1475 |
+
if ($content && (width || height || slide.contentType === "video") && !slide.hasError) {
|
1476 |
+
$.fancybox.stop($content);
|
1477 |
+
|
1478 |
+
$.fancybox.setTranslate($content, self.getFitPos(slide));
|
1479 |
+
|
1480 |
+
if (slide.pos === self.currPos) {
|
1481 |
+
self.isAnimating = false;
|
1482 |
+
|
1483 |
+
self.updateCursor();
|
1484 |
+
}
|
1485 |
+
}
|
1486 |
+
|
1487 |
+
// Then some adjustments
|
1488 |
+
self.adjustLayout(slide);
|
1489 |
+
|
1490 |
+
if ($slide.length) {
|
1491 |
+
$slide.trigger("refresh");
|
1492 |
+
|
1493 |
+
if (slide.pos === self.currPos) {
|
1494 |
+
self.$refs.toolbar
|
1495 |
+
.add(self.$refs.navigation.find(".fancybox-button--arrow_right"))
|
1496 |
+
.toggleClass("compensate-for-scrollbar", $slide.get(0).scrollHeight > $slide.get(0).clientHeight);
|
1497 |
+
}
|
1498 |
+
}
|
1499 |
+
|
1500 |
+
self.trigger("onUpdate", slide, e);
|
1501 |
+
},
|
1502 |
+
|
1503 |
+
// Horizontally center slide
|
1504 |
+
// =========================
|
1505 |
+
|
1506 |
+
centerSlide: function(duration) {
|
1507 |
+
var self = this,
|
1508 |
+
current = self.current,
|
1509 |
+
$slide = current.$slide;
|
1510 |
+
|
1511 |
+
if (self.isClosing || !current) {
|
1512 |
+
return;
|
1513 |
+
}
|
1514 |
+
|
1515 |
+
$slide.siblings().css({
|
1516 |
+
transform: "",
|
1517 |
+
opacity: ""
|
1518 |
+
});
|
1519 |
+
|
1520 |
+
$slide
|
1521 |
+
.parent()
|
1522 |
+
.children()
|
1523 |
+
.removeClass("fancybox-slide--previous fancybox-slide--next");
|
1524 |
+
|
1525 |
+
$.fancybox.animate(
|
1526 |
+
$slide,
|
1527 |
+
{
|
1528 |
+
top: 0,
|
1529 |
+
left: 0,
|
1530 |
+
opacity: 1
|
1531 |
+
},
|
1532 |
+
duration === undefined ? 0 : duration,
|
1533 |
+
function() {
|
1534 |
+
// Clean up
|
1535 |
+
$slide.css({
|
1536 |
+
transform: "",
|
1537 |
+
opacity: ""
|
1538 |
+
});
|
1539 |
+
|
1540 |
+
if (!current.isComplete) {
|
1541 |
+
self.complete();
|
1542 |
+
}
|
1543 |
+
},
|
1544 |
+
false
|
1545 |
+
);
|
1546 |
+
},
|
1547 |
+
|
1548 |
+
// Check if current slide is moved (swiped)
|
1549 |
+
// ========================================
|
1550 |
+
|
1551 |
+
isMoved: function(slide) {
|
1552 |
+
var current = slide || this.current,
|
1553 |
+
slidePos,
|
1554 |
+
stagePos;
|
1555 |
+
|
1556 |
+
if (!current) {
|
1557 |
+
return false;
|
1558 |
+
}
|
1559 |
+
|
1560 |
+
stagePos = $.fancybox.getTranslate(this.$refs.stage);
|
1561 |
+
slidePos = $.fancybox.getTranslate(current.$slide);
|
1562 |
+
|
1563 |
+
return (
|
1564 |
+
!current.$slide.hasClass("fancybox-animated") &&
|
1565 |
+
(Math.abs(slidePos.top - stagePos.top) > 0.5 || Math.abs(slidePos.left - stagePos.left) > 0.5)
|
1566 |
+
);
|
1567 |
+
},
|
1568 |
+
|
1569 |
+
// Update cursor style depending if content can be zoomed
|
1570 |
+
// ======================================================
|
1571 |
+
|
1572 |
+
updateCursor: function(nextWidth, nextHeight) {
|
1573 |
+
var self = this,
|
1574 |
+
current = self.current,
|
1575 |
+
$container = self.$refs.container,
|
1576 |
+
canPan,
|
1577 |
+
isZoomable;
|
1578 |
+
|
1579 |
+
if (!current || self.isClosing || !self.Guestures) {
|
1580 |
+
return;
|
1581 |
+
}
|
1582 |
+
|
1583 |
+
$container.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan");
|
1584 |
+
|
1585 |
+
canPan = self.canPan(nextWidth, nextHeight);
|
1586 |
+
|
1587 |
+
isZoomable = canPan ? true : self.isZoomable();
|
1588 |
+
|
1589 |
+
$container.toggleClass("fancybox-is-zoomable", isZoomable);
|
1590 |
+
|
1591 |
+
$("[data-fancybox-zoom]").prop("disabled", !isZoomable);
|
1592 |
+
|
1593 |
+
if (canPan) {
|
1594 |
+
$container.addClass("fancybox-can-pan");
|
1595 |
+
} else if (
|
1596 |
+
isZoomable &&
|
1597 |
+
(current.opts.clickContent === "zoom" || ($.isFunction(current.opts.clickContent) && current.opts.clickContent(current) == "zoom"))
|
1598 |
+
) {
|
1599 |
+
$container.addClass("fancybox-can-zoomIn");
|
1600 |
+
} else if (current.opts.touch && (current.opts.touch.vertical || self.group.length > 1) && current.contentType !== "video") {
|
1601 |
+
$container.addClass("fancybox-can-swipe");
|
1602 |
+
}
|
1603 |
+
},
|
1604 |
+
|
1605 |
+
// Check if current slide is zoomable
|
1606 |
+
// ==================================
|
1607 |
+
|
1608 |
+
isZoomable: function() {
|
1609 |
+
var self = this,
|
1610 |
+
current = self.current,
|
1611 |
+
fitPos;
|
1612 |
+
|
1613 |
+
// Assume that slide is zoomable if:
|
1614 |
+
// - image is still loading
|
1615 |
+
// - actual size of the image is smaller than available area
|
1616 |
+
if (current && !self.isClosing && current.type === "image" && !current.hasError) {
|
1617 |
+
if (!current.isLoaded) {
|
1618 |
+
return true;
|
1619 |
+
}
|
1620 |
+
|
1621 |
+
fitPos = self.getFitPos(current);
|
1622 |
+
|
1623 |
+
if (fitPos && (current.width > fitPos.width || current.height > fitPos.height)) {
|
1624 |
+
return true;
|
1625 |
+
}
|
1626 |
+
}
|
1627 |
+
|
1628 |
+
return false;
|
1629 |
+
},
|
1630 |
+
|
1631 |
+
// Check if current image dimensions are smaller than actual
|
1632 |
+
// =========================================================
|
1633 |
+
|
1634 |
+
isScaledDown: function(nextWidth, nextHeight) {
|
1635 |
+
var self = this,
|
1636 |
+
rez = false,
|
1637 |
+
current = self.current,
|
1638 |
+
$content = current.$content;
|
1639 |
+
|
1640 |
+
if (nextWidth !== undefined && nextHeight !== undefined) {
|
1641 |
+
rez = nextWidth < current.width && nextHeight < current.height;
|
1642 |
+
} else if ($content) {
|
1643 |
+
rez = $.fancybox.getTranslate($content);
|
1644 |
+
rez = rez.width < current.width && rez.height < current.height;
|
1645 |
+
}
|
1646 |
+
|
1647 |
+
return rez;
|
1648 |
+
},
|
1649 |
+
|
1650 |
+
// Check if image dimensions exceed parent element
|
1651 |
+
// ===============================================
|
1652 |
+
|
1653 |
+
canPan: function(nextWidth, nextHeight) {
|
1654 |
+
var self = this,
|
1655 |
+
current = self.current,
|
1656 |
+
pos = null,
|
1657 |
+
rez = false;
|
1658 |
+
|
1659 |
+
if (current.type === "image" && (current.isComplete || (nextWidth && nextHeight)) && !current.hasError) {
|
1660 |
+
rez = self.getFitPos(current);
|
1661 |
+
|
1662 |
+
if (nextWidth !== undefined && nextHeight !== undefined) {
|
1663 |
+
pos = {width: nextWidth, height: nextHeight};
|
1664 |
+
} else if (current.isComplete) {
|
1665 |
+
pos = $.fancybox.getTranslate(current.$content);
|
1666 |
+
}
|
1667 |
+
|
1668 |
+
if (pos && rez) {
|
1669 |
+
rez = Math.abs(pos.width - rez.width) > 1.5 || Math.abs(pos.height - rez.height) > 1.5;
|
1670 |
+
}
|
1671 |
+
}
|
1672 |
+
|
1673 |
+
return rez;
|
1674 |
+
},
|
1675 |
+
|
1676 |
+
// Load content into the slide
|
1677 |
+
// ===========================
|
1678 |
+
|
1679 |
+
loadSlide: function(slide) {
|
1680 |
+
var self = this,
|
1681 |
+
type,
|
1682 |
+
$slide,
|
1683 |
+
ajaxLoad;
|
1684 |
+
|
1685 |
+
if (slide.isLoading || slide.isLoaded) {
|
1686 |
+
return;
|
1687 |
+
}
|
1688 |
+
|
1689 |
+
slide.isLoading = true;
|
1690 |
+
|
1691 |
+
if (self.trigger("beforeLoad", slide) === false) {
|
1692 |
+
slide.isLoading = false;
|
1693 |
+
|
1694 |
+
return false;
|
1695 |
+
}
|
1696 |
+
|
1697 |
+
type = slide.type;
|
1698 |
+
$slide = slide.$slide;
|
1699 |
+
|
1700 |
+
$slide
|
1701 |
+
.off("refresh")
|
1702 |
+
.trigger("onReset")
|
1703 |
+
.addClass(slide.opts.slideClass);
|
1704 |
+
|
1705 |
+
// Create content depending on the type
|
1706 |
+
switch (type) {
|
1707 |
+
case "image":
|
1708 |
+
self.setImage(slide);
|
1709 |
+
|
1710 |
+
break;
|
1711 |
+
|
1712 |
+
case "iframe":
|
1713 |
+
self.setIframe(slide);
|
1714 |
+
|
1715 |
+
break;
|
1716 |
+
|
1717 |
+
case "html":
|
1718 |
+
self.setContent(slide, slide.src || slide.content);
|
1719 |
+
|
1720 |
+
break;
|
1721 |
+
|
1722 |
+
case "video":
|
1723 |
+
self.setContent(
|
1724 |
+
slide,
|
1725 |
+
slide.opts.video.tpl
|
1726 |
+
.replace(/\{\{src\}\}/gi, slide.src)
|
1727 |
+
.replace("{{format}}", slide.opts.videoFormat || slide.opts.video.format || "")
|
1728 |
+
.replace("{{poster}}", slide.thumb || "")
|
1729 |
+
);
|
1730 |
+
|
1731 |
+
break;
|
1732 |
+
|
1733 |
+
case "inline":
|
1734 |
+
if ($(slide.src).length) {
|
1735 |
+
self.setContent(slide, $(slide.src));
|
1736 |
+
} else {
|
1737 |
+
self.setError(slide);
|
1738 |
+
}
|
1739 |
+
|
1740 |
+
break;
|
1741 |
+
|
1742 |
+
case "ajax":
|
1743 |
+
self.showLoading(slide);
|
1744 |
+
|
1745 |
+
ajaxLoad = $.ajax(
|
1746 |
+
$.extend({}, slide.opts.ajax.settings, {
|
1747 |
+
url: slide.src,
|
1748 |
+
success: function(data, textStatus) {
|
1749 |
+
if (textStatus === "success") {
|
1750 |
+
self.setContent(slide, data);
|
1751 |
+
}
|
1752 |
+
},
|
1753 |
+
error: function(jqXHR, textStatus) {
|
1754 |
+
if (jqXHR && textStatus !== "abort") {
|
1755 |
+
self.setError(slide);
|
1756 |
+
}
|
1757 |
+
}
|
1758 |
+
})
|
1759 |
+
);
|
1760 |
+
|
1761 |
+
$slide.one("onReset", function() {
|
1762 |
+
ajaxLoad.abort();
|
1763 |
+
});
|
1764 |
+
|
1765 |
+
break;
|
1766 |
+
|
1767 |
+
default:
|
1768 |
+
self.setError(slide);
|
1769 |
+
|
1770 |
+
break;
|
1771 |
+
}
|
1772 |
+
|
1773 |
+
return true;
|
1774 |
+
},
|
1775 |
+
|
1776 |
+
// Use thumbnail image, if possible
|
1777 |
+
// ================================
|
1778 |
+
|
1779 |
+
setImage: function(slide) {
|
1780 |
+
var self = this,
|
1781 |
+
ghost;
|
1782 |
+
|
1783 |
+
// Check if need to show loading icon
|
1784 |
+
setTimeout(function() {
|
1785 |
+
var $img = slide.$image;
|
1786 |
+
|
1787 |
+
if (!self.isClosing && slide.isLoading && (!$img || !$img.length || !$img[0].complete) && !slide.hasError) {
|
1788 |
+
self.showLoading(slide);
|
1789 |
+
}
|
1790 |
+
}, 50);
|
1791 |
+
|
1792 |
+
//Check if image has srcset
|
1793 |
+
self.checkSrcset(slide);
|
1794 |
+
|
1795 |
+
// This will be wrapper containing both ghost and actual image
|
1796 |
+
slide.$content = $('<div class="fancybox-content"></div>')
|
1797 |
+
.addClass("fancybox-is-hidden")
|
1798 |
+
.appendTo(slide.$slide.addClass("fancybox-slide--image"));
|
1799 |
+
|
1800 |
+
// If we have a thumbnail, we can display it while actual image is loading
|
1801 |
+
// Users will not stare at black screen and actual image will appear gradually
|
1802 |
+
if (slide.opts.preload !== false && slide.opts.width && slide.opts.height && slide.thumb) {
|
1803 |
+
slide.width = slide.opts.width;
|
1804 |
+
slide.height = slide.opts.height;
|
1805 |
+
|
1806 |
+
ghost = document.createElement("img");
|
1807 |
+
|
1808 |
+
ghost.onerror = function() {
|
1809 |
+
$(this).remove();
|
1810 |
+
|
1811 |
+
slide.$ghost = null;
|
1812 |
+
};
|
1813 |
+
|
1814 |
+
ghost.onload = function() {
|
1815 |
+
self.afterLoad(slide);
|
1816 |
+
};
|
1817 |
+
|
1818 |
+
slide.$ghost = $(ghost)
|
1819 |
+
.addClass("fancybox-image")
|
1820 |
+
.appendTo(slide.$content)
|
1821 |
+
.attr("src", slide.thumb);
|
1822 |
+
}
|
1823 |
+
|
1824 |
+
// Start loading actual image
|
1825 |
+
self.setBigImage(slide);
|
1826 |
+
},
|
1827 |
+
|
1828 |
+
// Check if image has srcset and get the source
|
1829 |
+
// ============================================
|
1830 |
+
checkSrcset: function(slide) {
|
1831 |
+
var srcset = slide.opts.srcset || slide.opts.image.srcset,
|
1832 |
+
found,
|
1833 |
+
temp,
|
1834 |
+
pxRatio,
|
1835 |
+
windowWidth;
|
1836 |
+
|
1837 |
+
// If we have "srcset", then we need to find first matching "src" value.
|
1838 |
+
// This is necessary, because when you set an src attribute, the browser will preload the image
|
1839 |
+
// before any javascript or even CSS is applied.
|
1840 |
+
if (srcset) {
|
1841 |
+
pxRatio = window.devicePixelRatio || 1;
|
1842 |
+
windowWidth = window.innerWidth * pxRatio;
|
1843 |
+
|
1844 |
+
temp = srcset.split(",").map(function(el) {
|
1845 |
+
var ret = {};
|
1846 |
+
|
1847 |
+
el.trim()
|
1848 |
+
.split(/\s+/)
|
1849 |
+
.forEach(function(el, i) {
|
1850 |
+
var value = parseInt(el.substring(0, el.length - 1), 10);
|
1851 |
+
|
1852 |
+
if (i === 0) {
|
1853 |
+
return (ret.url = el);
|
1854 |
+
}
|
1855 |
+
|
1856 |
+
if (value) {
|
1857 |
+
ret.value = value;
|
1858 |
+
ret.postfix = el[el.length - 1];
|
1859 |
+
}
|
1860 |
+
});
|
1861 |
+
|
1862 |
+
return ret;
|
1863 |
+
});
|
1864 |
+
|
1865 |
+
// Sort by value
|
1866 |
+
temp.sort(function(a, b) {
|
1867 |
+
return a.value - b.value;
|
1868 |
+
});
|
1869 |
+
|
1870 |
+
// Ok, now we have an array of all srcset values
|
1871 |
+
for (var j = 0; j < temp.length; j++) {
|
1872 |
+
var el = temp[j];
|
1873 |
+
|
1874 |
+
if ((el.postfix === "w" && el.value >= windowWidth) || (el.postfix === "x" && el.value >= pxRatio)) {
|
1875 |
+
found = el;
|
1876 |
+
break;
|
1877 |
+
}
|
1878 |
+
}
|
1879 |
+
|
1880 |
+
// If not found, take the last one
|
1881 |
+
if (!found && temp.length) {
|
1882 |
+
found = temp[temp.length - 1];
|
1883 |
+
}
|
1884 |
+
|
1885 |
+
if (found) {
|
1886 |
+
slide.src = found.url;
|
1887 |
+
|
1888 |
+
// If we have default width/height values, we can calculate height for matching source
|
1889 |
+
if (slide.width && slide.height && found.postfix == "w") {
|
1890 |
+
slide.height = (slide.width / slide.height) * found.value;
|
1891 |
+
slide.width = found.value;
|
1892 |
+
}
|
1893 |
+
|
1894 |
+
slide.opts.srcset = srcset;
|
1895 |
+
}
|
1896 |
+
}
|
1897 |
+
},
|
1898 |
+
|
1899 |
+
// Create full-size image
|
1900 |
+
// ======================
|
1901 |
+
|
1902 |
+
setBigImage: function(slide) {
|
1903 |
+
var self = this,
|
1904 |
+
img = document.createElement("img"),
|
1905 |
+
$img = $(img);
|
1906 |
+
|
1907 |
+
slide.$image = $img
|
1908 |
+
.one("error", function() {
|
1909 |
+
self.setError(slide);
|
1910 |
+
})
|
1911 |
+
.one("load", function() {
|
1912 |
+
var sizes;
|
1913 |
+
|
1914 |
+
if (!slide.$ghost) {
|
1915 |
+
self.resolveImageSlideSize(slide, this.naturalWidth, this.naturalHeight);
|
1916 |
+
|
1917 |
+
self.afterLoad(slide);
|
1918 |
+
}
|
1919 |
+
|
1920 |
+
if (self.isClosing) {
|
1921 |
+
return;
|
1922 |
+
}
|
1923 |
+
|
1924 |
+
if (slide.opts.srcset) {
|
1925 |
+
sizes = slide.opts.sizes;
|
1926 |
+
|
1927 |
+
if (!sizes || sizes === "auto") {
|
1928 |
+
sizes =
|
1929 |
+
(slide.width / slide.height > 1 && $W.width() / $W.height() > 1 ? "100" : Math.round((slide.width / slide.height) * 100)) +
|
1930 |
+
"vw";
|
1931 |
+
}
|
1932 |
+
|
1933 |
+
$img.attr("sizes", sizes).attr("srcset", slide.opts.srcset);
|
1934 |
+
}
|
1935 |
+
|
1936 |
+
// Hide temporary image after some delay
|
1937 |
+
if (slide.$ghost) {
|
1938 |
+
setTimeout(function() {
|
1939 |
+
if (slide.$ghost && !self.isClosing) {
|
1940 |
+
slide.$ghost.hide();
|
1941 |
+
}
|
1942 |
+
}, Math.min(300, Math.max(1000, slide.height / 1600)));
|
1943 |
+
}
|
1944 |
+
|
1945 |
+
self.hideLoading(slide);
|
1946 |
+
})
|
1947 |
+
.addClass("fancybox-image")
|
1948 |
+
.attr("src", slide.src)
|
1949 |
+
.appendTo(slide.$content);
|
1950 |
+
|
1951 |
+
if ((img.complete || img.readyState == "complete") && $img.naturalWidth && $img.naturalHeight) {
|
1952 |
+
$img.trigger("load");
|
1953 |
+
} else if (img.error) {
|
1954 |
+
$img.trigger("error");
|
1955 |
+
}
|
1956 |
+
},
|
1957 |
+
|
1958 |
+
// Computes the slide size from image size and maxWidth/maxHeight
|
1959 |
+
// ==============================================================
|
1960 |
+
|
1961 |
+
resolveImageSlideSize: function(slide, imgWidth, imgHeight) {
|
1962 |
+
var maxWidth = parseInt(slide.opts.width, 10),
|
1963 |
+
maxHeight = parseInt(slide.opts.height, 10);
|
1964 |
+
|
1965 |
+
// Sets the default values from the image
|
1966 |
+
slide.width = imgWidth;
|
1967 |
+
slide.height = imgHeight;
|
1968 |
+
|
1969 |
+
if (maxWidth > 0) {
|
1970 |
+
slide.width = maxWidth;
|
1971 |
+
slide.height = Math.floor((maxWidth * imgHeight) / imgWidth);
|
1972 |
+
}
|
1973 |
+
|
1974 |
+
if (maxHeight > 0) {
|
1975 |
+
slide.width = Math.floor((maxHeight * imgWidth) / imgHeight);
|
1976 |
+
slide.height = maxHeight;
|
1977 |
+
}
|
1978 |
+
},
|
1979 |
+
|
1980 |
+
// Create iframe wrapper, iframe and bindings
|
1981 |
+
// ==========================================
|
1982 |
+
|
1983 |
+
setIframe: function(slide) {
|
1984 |
+
var self = this,
|
1985 |
+
opts = slide.opts.iframe,
|
1986 |
+
$slide = slide.$slide,
|
1987 |
+
$iframe;
|
1988 |
+
|
1989 |
+
// Fix responsive iframes on iOS (along with `position:absolute;` for iframe element)
|
1990 |
+
if ($.fancybox.isMobile) {
|
1991 |
+
opts.css.overflow = "scroll";
|
1992 |
+
}
|
1993 |
+
|
1994 |
+
slide.$content = $('<div class="fancybox-content' + (opts.preload ? " fancybox-is-hidden" : "") + '"></div>')
|
1995 |
+
.css(opts.css)
|
1996 |
+
.appendTo($slide);
|
1997 |
+
|
1998 |
+
$slide.addClass("fancybox-slide--" + slide.contentType);
|
1999 |
+
|
2000 |
+
slide.$iframe = $iframe = $(opts.tpl.replace(/\{rnd\}/g, new Date().getTime()))
|
2001 |
+
.attr(opts.attr)
|
2002 |
+
.appendTo(slide.$content);
|
2003 |
+
|
2004 |
+
if (opts.preload) {
|
2005 |
+
self.showLoading(slide);
|
2006 |
+
|
2007 |
+
// Unfortunately, it is not always possible to determine if iframe is successfully loaded
|
2008 |
+
// (due to browser security policy)
|
2009 |
+
|
2010 |
+
$iframe.on("load.fb error.fb", function(e) {
|
2011 |
+
this.isReady = 1;
|
2012 |
+
|
2013 |
+
slide.$slide.trigger("refresh");
|
2014 |
+
|
2015 |
+
self.afterLoad(slide);
|
2016 |
+
});
|
2017 |
+
|
2018 |
+
// Recalculate iframe content size
|
2019 |
+
// ===============================
|
2020 |
+
|
2021 |
+
$slide.on("refresh.fb", function() {
|
2022 |
+
var $content = slide.$content,
|
2023 |
+
frameWidth = opts.css.width,
|
2024 |
+
frameHeight = opts.css.height,
|
2025 |
+
$contents,
|
2026 |
+
$body;
|
2027 |
+
|
2028 |
+
if ($iframe[0].isReady !== 1) {
|
2029 |
+
return;
|
2030 |
+
}
|
2031 |
+
|
2032 |
+
try {
|
2033 |
+
$contents = $iframe.contents();
|
2034 |
+
$body = $contents.find("body");
|
2035 |
+
} catch (ignore) {}
|
2036 |
+
|
2037 |
+
// Calculate contnet dimensions if it is accessible
|
2038 |
+
if ($body && $body.length && $body.children().length) {
|
2039 |
+
// Avoid scrolling to top (if multiple instances)
|
2040 |
+
$slide.css("overflow", "visible");
|
2041 |
+
|
2042 |
+
$content.css({
|
2043 |
+
width: "100%",
|
2044 |
+
"max-width": "100%",
|
2045 |
+
height: "9999px"
|
2046 |
+
});
|
2047 |
+
|
2048 |
+
if (frameWidth === undefined) {
|
2049 |
+
frameWidth = Math.ceil(Math.max($body[0].clientWidth, $body.outerWidth(true)));
|
2050 |
+
}
|
2051 |
+
|
2052 |
+
$content.css("width", frameWidth ? frameWidth : "").css("max-width", "");
|
2053 |
+
|
2054 |
+
if (frameHeight === undefined) {
|
2055 |
+
frameHeight = Math.ceil(Math.max($body[0].clientHeight, $body.outerHeight(true)));
|
2056 |
+
}
|
2057 |
+
|
2058 |
+
$content.css("height", frameHeight ? frameHeight : "");
|
2059 |
+
|
2060 |
+
$slide.css("overflow", "auto");
|
2061 |
+
}
|
2062 |
+
|
2063 |
+
$content.removeClass("fancybox-is-hidden");
|
2064 |
+
});
|
2065 |
+
} else {
|
2066 |
+
self.afterLoad(slide);
|
2067 |
+
}
|
2068 |
+
|
2069 |
+
$iframe.attr("src", slide.src);
|
2070 |
+
|
2071 |
+
// Remove iframe if closing or changing gallery item
|
2072 |
+
$slide.one("onReset", function() {
|
2073 |
+
// This helps IE not to throw errors when closing
|
2074 |
+
try {
|
2075 |
+
$(this)
|
2076 |
+
.find("iframe")
|
2077 |
+
.hide()
|
2078 |
+
.unbind()
|
2079 |
+
.attr("src", "//about:blank");
|
2080 |
+
} catch (ignore) {}
|
2081 |
+
|
2082 |
+
$(this)
|
2083 |
+
.off("refresh.fb")
|
2084 |
+
.empty();
|
2085 |
+
|
2086 |
+
slide.isLoaded = false;
|
2087 |
+
slide.isRevealed = false;
|
2088 |
+
});
|
2089 |
+
},
|
2090 |
+
|
2091 |
+
// Wrap and append content to the slide
|
2092 |
+
// ======================================
|
2093 |
+
|
2094 |
+
setContent: function(slide, content) {
|
2095 |
+
var self = this;
|
2096 |
+
|
2097 |
+
if (self.isClosing) {
|
2098 |
+
return;
|
2099 |
+
}
|
2100 |
+
|
2101 |
+
self.hideLoading(slide);
|
2102 |
+
|
2103 |
+
if (slide.$content) {
|
2104 |
+
$.fancybox.stop(slide.$content);
|
2105 |
+
}
|
2106 |
+
|
2107 |
+
slide.$slide.empty();
|
2108 |
+
|
2109 |
+
// If content is a jQuery object, then it will be moved to the slide.
|
2110 |
+
// The placeholder is created so we will know where to put it back.
|
2111 |
+
if (isQuery(content) && content.parent().length) {
|
2112 |
+
// Make sure content is not already moved to fancyBox
|
2113 |
+
if (content.hasClass("fancybox-content") || content.parent().hasClass("fancybox-content")) {
|
2114 |
+
content.parents(".fancybox-slide").trigger("onReset");
|
2115 |
+
}
|
2116 |
+
|
2117 |
+
// Create temporary element marking original place of the content
|
2118 |
+
slide.$placeholder = $("<div>")
|
2119 |
+
.hide()
|
2120 |
+
.insertAfter(content);
|
2121 |
+
|
2122 |
+
// Make sure content is visible
|
2123 |
+
content.css("display", "inline-block");
|
2124 |
+
} else if (!slide.hasError) {
|
2125 |
+
// If content is just a plain text, try to convert it to html
|
2126 |
+
if ($.type(content) === "string") {
|
2127 |
+
content = $("<div>")
|
2128 |
+
.append($.trim(content))
|
2129 |
+
.contents();
|
2130 |
+
}
|
2131 |
+
|
2132 |
+
// If "filter" option is provided, then filter content
|
2133 |
+
if (slide.opts.filter) {
|
2134 |
+
content = $("<div>")
|
2135 |
+
.html(content)
|
2136 |
+
.find(slide.opts.filter);
|
2137 |
+
}
|
2138 |
+
}
|
2139 |
+
|
2140 |
+
slide.$slide.one("onReset", function() {
|
2141 |
+
// Pause all html5 video/audio
|
2142 |
+
$(this)
|
2143 |
+
.find("video,audio")
|
2144 |
+
.trigger("pause");
|
2145 |
+
|
2146 |
+
// Put content back
|
2147 |
+
if (slide.$placeholder) {
|
2148 |
+
slide.$placeholder.after(content.removeClass("fancybox-content").hide()).remove();
|
2149 |
+
|
2150 |
+
slide.$placeholder = null;
|
2151 |
+
}
|
2152 |
+
|
2153 |
+
// Remove custom close button
|
2154 |
+
if (slide.$smallBtn) {
|
2155 |
+
slide.$smallBtn.remove();
|
2156 |
+
|
2157 |
+
slide.$smallBtn = null;
|
2158 |
+
}
|
2159 |
+
|
2160 |
+
// Remove content and mark slide as not loaded
|
2161 |
+
if (!slide.hasError) {
|
2162 |
+
$(this).empty();
|
2163 |
+
|
2164 |
+
slide.isLoaded = false;
|
2165 |
+
slide.isRevealed = false;
|
2166 |
+
}
|
2167 |
+
});
|
2168 |
+
|
2169 |
+
$(content).appendTo(slide.$slide);
|
2170 |
+
|
2171 |
+
if ($(content).is("video,audio")) {
|
2172 |
+
$(content).addClass("fancybox-video");
|
2173 |
+
|
2174 |
+
$(content).wrap("<div></div>");
|
2175 |
+
|
2176 |
+
slide.contentType = "video";
|
2177 |
+
|
2178 |
+
slide.opts.width = slide.opts.width || $(content).attr("width");
|
2179 |
+
slide.opts.height = slide.opts.height || $(content).attr("height");
|
2180 |
+
}
|
2181 |
+
|
2182 |
+
slide.$content = slide.$slide
|
2183 |
+
.children()
|
2184 |
+
.filter("div,form,main,video,audio,article,.fancybox-content")
|
2185 |
+
.first();
|
2186 |
+
|
2187 |
+
slide.$content.siblings().hide();
|
2188 |
+
|
2189 |
+
// Re-check if there is a valid content
|
2190 |
+
// (in some cases, ajax response can contain various elements or plain text)
|
2191 |
+
if (!slide.$content.length) {
|
2192 |
+
slide.$content = slide.$slide
|
2193 |
+
.wrapInner("<div></div>")
|
2194 |
+
.children()
|
2195 |
+
.first();
|
2196 |
+
}
|
2197 |
+
|
2198 |
+
slide.$content.addClass("fancybox-content");
|
2199 |
+
|
2200 |
+
slide.$slide.addClass("fancybox-slide--" + slide.contentType);
|
2201 |
+
|
2202 |
+
self.afterLoad(slide);
|
2203 |
+
},
|
2204 |
+
|
2205 |
+
// Display error message
|
2206 |
+
// =====================
|
2207 |
+
|
2208 |
+
setError: function(slide) {
|
2209 |
+
slide.hasError = true;
|
2210 |
+
|
2211 |
+
slide.$slide
|
2212 |
+
.trigger("onReset")
|
2213 |
+
.removeClass("fancybox-slide--" + slide.contentType)
|
2214 |
+
.addClass("fancybox-slide--error");
|
2215 |
+
|
2216 |
+
slide.contentType = "html";
|
2217 |
+
|
2218 |
+
this.setContent(slide, this.translate(slide, slide.opts.errorTpl));
|
2219 |
+
|
2220 |
+
if (slide.pos === this.currPos) {
|
2221 |
+
this.isAnimating = false;
|
2222 |
+
}
|
2223 |
+
},
|
2224 |
+
|
2225 |
+
// Show loading icon inside the slide
|
2226 |
+
// ==================================
|
2227 |
+
|
2228 |
+
showLoading: function(slide) {
|
2229 |
+
var self = this;
|
2230 |
+
|
2231 |
+
slide = slide || self.current;
|
2232 |
+
|
2233 |
+
if (slide && !slide.$spinner) {
|
2234 |
+
slide.$spinner = $(self.translate(self, self.opts.spinnerTpl))
|
2235 |
+
.appendTo(slide.$slide)
|
2236 |
+
.hide()
|
2237 |
+
.fadeIn("fast");
|
2238 |
+
}
|
2239 |
+
},
|
2240 |
+
|
2241 |
+
// Remove loading icon from the slide
|
2242 |
+
// ==================================
|
2243 |
+
|
2244 |
+
hideLoading: function(slide) {
|
2245 |
+
var self = this;
|
2246 |
+
|
2247 |
+
slide = slide || self.current;
|
2248 |
+
|
2249 |
+
if (slide && slide.$spinner) {
|
2250 |
+
slide.$spinner.stop().remove();
|
2251 |
+
|
2252 |
+
delete slide.$spinner;
|
2253 |
+
}
|
2254 |
+
},
|
2255 |
+
|
2256 |
+
// Adjustments after slide content has been loaded
|
2257 |
+
// ===============================================
|
2258 |
+
|
2259 |
+
afterLoad: function(slide) {
|
2260 |
+
var self = this;
|
2261 |
+
|
2262 |
+
if (self.isClosing) {
|
2263 |
+
return;
|
2264 |
+
}
|
2265 |
+
|
2266 |
+
slide.isLoading = false;
|
2267 |
+
slide.isLoaded = true;
|
2268 |
+
|
2269 |
+
self.trigger("afterLoad", slide);
|
2270 |
+
|
2271 |
+
self.hideLoading(slide);
|
2272 |
+
|
2273 |
+
// Add small close button
|
2274 |
+
if (slide.opts.smallBtn && (!slide.$smallBtn || !slide.$smallBtn.length)) {
|
2275 |
+
slide.$smallBtn = $(self.translate(slide, slide.opts.btnTpl.smallBtn)).appendTo(slide.$content);
|
2276 |
+
}
|
2277 |
+
|
2278 |
+
// Disable right click
|
2279 |
+
if (slide.opts.protect && slide.$content && !slide.hasError) {
|
2280 |
+
slide.$content.on("contextmenu.fb", function(e) {
|
2281 |
+
if (e.button == 2) {
|
2282 |
+
e.preventDefault();
|
2283 |
+
}
|
2284 |
+
|
2285 |
+
return true;
|
2286 |
+
});
|
2287 |
+
|
2288 |
+
// Add fake element on top of the image
|
2289 |
+
// This makes a bit harder for user to select image
|
2290 |
+
if (slide.type === "image") {
|
2291 |
+
$('<div class="fancybox-spaceball"></div>').appendTo(slide.$content);
|
2292 |
+
}
|
2293 |
+
}
|
2294 |
+
|
2295 |
+
self.adjustCaption(slide);
|
2296 |
+
|
2297 |
+
self.adjustLayout(slide);
|
2298 |
+
|
2299 |
+
if (slide.pos === self.currPos) {
|
2300 |
+
self.updateCursor();
|
2301 |
+
}
|
2302 |
+
|
2303 |
+
self.revealContent(slide);
|
2304 |
+
},
|
2305 |
+
|
2306 |
+
// Prevent caption overlap,
|
2307 |
+
// fix css inconsistency across browsers
|
2308 |
+
// =====================================
|
2309 |
+
|
2310 |
+
adjustCaption: function(slide) {
|
2311 |
+
var self = this,
|
2312 |
+
current = slide || self.current,
|
2313 |
+
caption = current.opts.caption,
|
2314 |
+
$caption = self.$refs.caption,
|
2315 |
+
captionH = false;
|
2316 |
+
|
2317 |
+
if (current.opts.preventCaptionOverlap && caption && caption.length) {
|
2318 |
+
if (current.pos !== self.currPos) {
|
2319 |
+
$caption = $caption
|
2320 |
+
.clone()
|
2321 |
+
.empty()
|
2322 |
+
.appendTo($caption.parent());
|
2323 |
+
|
2324 |
+
$caption.html(caption);
|
2325 |
+
|
2326 |
+
captionH = $caption.outerHeight(true);
|
2327 |
+
|
2328 |
+
$caption.empty().remove();
|
2329 |
+
} else if (self.$caption) {
|
2330 |
+
captionH = self.$caption.outerHeight(true);
|
2331 |
+
}
|
2332 |
+
|
2333 |
+
current.$slide.css("padding-bottom", captionH || "");
|
2334 |
+
}
|
2335 |
+
},
|
2336 |
+
|
2337 |
+
// Simple hack to fix inconsistency across browsers, described here (affects Edge, too):
|
2338 |
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=748518
|
2339 |
+
// ====================================================================================
|
2340 |
+
|
2341 |
+
adjustLayout: function(slide) {
|
2342 |
+
var self = this,
|
2343 |
+
current = slide || self.current,
|
2344 |
+
scrollHeight,
|
2345 |
+
marginBottom,
|
2346 |
+
inlinePadding,
|
2347 |
+
actualPadding;
|
2348 |
+
|
2349 |
+
if (current.isLoaded && current.opts.disableLayoutFix !== true) {
|
2350 |
+
current.$content.css("margin-bottom", "");
|
2351 |
+
|
2352 |
+
// If we would always set margin-bottom for the content,
|
2353 |
+
// then it would potentially break vertical align
|
2354 |
+
if (current.$content.outerHeight() > current.$slide.height() + 0.5) {
|
2355 |
+
inlinePadding = current.$slide[0].style["padding-bottom"];
|
2356 |
+
actualPadding = current.$slide.css("padding-bottom");
|
2357 |
+
|
2358 |
+
if (parseFloat(actualPadding) > 0) {
|
2359 |
+
scrollHeight = current.$slide[0].scrollHeight;
|
2360 |
+
|
2361 |
+
current.$slide.css("padding-bottom", 0);
|
2362 |
+
|
2363 |
+
if (Math.abs(scrollHeight - current.$slide[0].scrollHeight) < 1) {
|
2364 |
+
marginBottom = actualPadding;
|
2365 |
+
}
|
2366 |
+
|
2367 |
+
current.$slide.css("padding-bottom", inlinePadding);
|
2368 |
+
}
|
2369 |
+
}
|
2370 |
+
|
2371 |
+
current.$content.css("margin-bottom", marginBottom);
|
2372 |
+
}
|
2373 |
+
},
|
2374 |
+
|
2375 |
+
// Make content visible
|
2376 |
+
// This method is called right after content has been loaded or
|
2377 |
+
// user navigates gallery and transition should start
|
2378 |
+
// ============================================================
|
2379 |
+
|
2380 |
+
revealContent: function(slide) {
|
2381 |
+
var self = this,
|
2382 |
+
$slide = slide.$slide,
|
2383 |
+
end = false,
|
2384 |
+
start = false,
|
2385 |
+
isMoved = self.isMoved(slide),
|
2386 |
+
isRevealed = slide.isRevealed,
|
2387 |
+
effect,
|
2388 |
+
effectClassName,
|
2389 |
+
duration,
|
2390 |
+
opacity;
|
2391 |
+
|
2392 |
+
slide.isRevealed = true;
|
2393 |
+
|
2394 |
+
effect = slide.opts[self.firstRun ? "animationEffect" : "transitionEffect"];
|
2395 |
+
duration = slide.opts[self.firstRun ? "animationDuration" : "transitionDuration"];
|
2396 |
+
|
2397 |
+
duration = parseInt(slide.forcedDuration === undefined ? duration : slide.forcedDuration, 10);
|
2398 |
+
|
2399 |
+
if (isMoved || slide.pos !== self.currPos || !duration) {
|
2400 |
+
effect = false;
|
2401 |
+
}
|
2402 |
+
|
2403 |
+
// Check if can zoom
|
2404 |
+
if (effect === "zoom") {
|
2405 |
+
if (slide.pos === self.currPos && duration && slide.type === "image" && !slide.hasError && (start = self.getThumbPos(slide))) {
|
2406 |
+
end = self.getFitPos(slide);
|
2407 |
+
} else {
|
2408 |
+
effect = "fade";
|
2409 |
+
}
|
2410 |
+
}
|
2411 |
+
|
2412 |
+
// Zoom animation
|
2413 |
+
// ==============
|
2414 |
+
if (effect === "zoom") {
|
2415 |
+
self.isAnimating = true;
|
2416 |
+
|
2417 |
+
end.scaleX = end.width / start.width;
|
2418 |
+
end.scaleY = end.height / start.height;
|
2419 |
+
|
2420 |
+
// Check if we need to animate opacity
|
2421 |
+
opacity = slide.opts.zoomOpacity;
|
2422 |
+
|
2423 |
+
if (opacity == "auto") {
|
2424 |
+
opacity = Math.abs(slide.width / slide.height - start.width / start.height) > 0.1;
|
2425 |
+
}
|
2426 |
+
|
2427 |
+
if (opacity) {
|
2428 |
+
start.opacity = 0.1;
|
2429 |
+
end.opacity = 1;
|
2430 |
+
}
|
2431 |
+
|
2432 |
+
// Draw image at start position
|
2433 |
+
$.fancybox.setTranslate(slide.$content.removeClass("fancybox-is-hidden"), start);
|
2434 |
+
|
2435 |
+
forceRedraw(slide.$content);
|
2436 |
+
|
2437 |
+
// Start animation
|
2438 |
+
$.fancybox.animate(slide.$content, end, duration, function() {
|
2439 |
+
self.isAnimating = false;
|
2440 |
+
|
2441 |
+
self.complete();
|
2442 |
+
});
|
2443 |
+
|
2444 |
+
return;
|
2445 |
+
}
|
2446 |
+
|
2447 |
+
self.updateSlide(slide);
|
2448 |
+
|
2449 |
+
// Simply show content if no effect
|
2450 |
+
// ================================
|
2451 |
+
if (!effect) {
|
2452 |
+
slide.$content.removeClass("fancybox-is-hidden");
|
2453 |
+
|
2454 |
+
if (!isRevealed && isMoved && slide.type === "image" && !slide.hasError) {
|
2455 |
+
slide.$content.hide().fadeIn("fast");
|
2456 |
+
}
|
2457 |
+
|
2458 |
+
if (slide.pos === self.currPos) {
|
2459 |
+
self.complete();
|
2460 |
+
}
|
2461 |
+
|
2462 |
+
return;
|
2463 |
+
}
|
2464 |
+
|
2465 |
+
// Prepare for CSS transiton
|
2466 |
+
// =========================
|
2467 |
+
$.fancybox.stop($slide);
|
2468 |
+
|
2469 |
+
//effectClassName = "fancybox-animated fancybox-slide--" + (slide.pos >= self.prevPos ? "next" : "previous") + " fancybox-fx-" + effect;
|
2470 |
+
effectClassName = "fancybox-slide--" + (slide.pos >= self.prevPos ? "next" : "previous") + " fancybox-animated fancybox-fx-" + effect;
|
2471 |
+
|
2472 |
+
$slide.addClass(effectClassName).removeClass("fancybox-slide--current"); //.addClass(effectClassName);
|
2473 |
+
|
2474 |
+
slide.$content.removeClass("fancybox-is-hidden");
|
2475 |
+
|
2476 |
+
// Force reflow
|
2477 |
+
forceRedraw($slide);
|
2478 |
+
|
2479 |
+
if (slide.type !== "image") {
|
2480 |
+
slide.$content.hide().show(0);
|
2481 |
+
}
|
2482 |
+
|
2483 |
+
$.fancybox.animate(
|
2484 |
+
$slide,
|
2485 |
+
"fancybox-slide--current",
|
2486 |
+
duration,
|
2487 |
+
function() {
|
2488 |
+
$slide.removeClass(effectClassName).css({
|
2489 |
+
transform: "",
|
2490 |
+
opacity: ""
|
2491 |
+
});
|
2492 |
+
|
2493 |
+
if (slide.pos === self.currPos) {
|
2494 |
+
self.complete();
|
2495 |
+
}
|
2496 |
+
},
|
2497 |
+
true
|
2498 |
+
);
|
2499 |
+
},
|
2500 |
+
|
2501 |
+
// Check if we can and have to zoom from thumbnail
|
2502 |
+
//================================================
|
2503 |
+
|
2504 |
+
getThumbPos: function(slide) {
|
2505 |
+
var rez = false,
|
2506 |
+
$thumb = slide.$thumb,
|
2507 |
+
thumbPos,
|
2508 |
+
btw,
|
2509 |
+
brw,
|
2510 |
+
bbw,
|
2511 |
+
blw;
|
2512 |
+
|
2513 |
+
if (!$thumb || !inViewport($thumb[0])) {
|
2514 |
+
return false;
|
2515 |
+
}
|
2516 |
+
|
2517 |
+
thumbPos = $.fancybox.getTranslate($thumb);
|
2518 |
+
|
2519 |
+
btw = parseFloat($thumb.css("border-top-width") || 0);
|
2520 |
+
brw = parseFloat($thumb.css("border-right-width") || 0);
|
2521 |
+
bbw = parseFloat($thumb.css("border-bottom-width") || 0);
|
2522 |
+
blw = parseFloat($thumb.css("border-left-width") || 0);
|
2523 |
+
|
2524 |
+
rez = {
|
2525 |
+
top: thumbPos.top + btw,
|
2526 |
+
left: thumbPos.left + blw,
|
2527 |
+
width: thumbPos.width - brw - blw,
|
2528 |
+
height: thumbPos.height - btw - bbw,
|
2529 |
+
scaleX: 1,
|
2530 |
+
scaleY: 1
|
2531 |
+
};
|
2532 |
+
|
2533 |
+
return thumbPos.width > 0 && thumbPos.height > 0 ? rez : false;
|
2534 |
+
},
|
2535 |
+
|
2536 |
+
// Final adjustments after current gallery item is moved to position
|
2537 |
+
// and it`s content is loaded
|
2538 |
+
// ==================================================================
|
2539 |
+
|
2540 |
+
complete: function() {
|
2541 |
+
var self = this,
|
2542 |
+
current = self.current,
|
2543 |
+
slides = {},
|
2544 |
+
$el;
|
2545 |
+
|
2546 |
+
if (self.isMoved() || !current.isLoaded) {
|
2547 |
+
return;
|
2548 |
+
}
|
2549 |
+
|
2550 |
+
if (!current.isComplete) {
|
2551 |
+
current.isComplete = true;
|
2552 |
+
|
2553 |
+
current.$slide.siblings().trigger("onReset");
|
2554 |
+
|
2555 |
+
self.preload("inline");
|
2556 |
+
|
2557 |
+
// Trigger any CSS transiton inside the slide
|
2558 |
+
forceRedraw(current.$slide);
|
2559 |
+
|
2560 |
+
current.$slide.addClass("fancybox-slide--complete");
|
2561 |
+
|
2562 |
+
// Remove unnecessary slides
|
2563 |
+
$.each(self.slides, function(key, slide) {
|
2564 |
+
if (slide.pos >= self.currPos - 1 && slide.pos <= self.currPos + 1) {
|
2565 |
+
slides[slide.pos] = slide;
|
2566 |
+
} else if (slide) {
|
2567 |
+
$.fancybox.stop(slide.$slide);
|
2568 |
+
|
2569 |
+
slide.$slide.off().remove();
|
2570 |
+
}
|
2571 |
+
});
|
2572 |
+
|
2573 |
+
self.slides = slides;
|
2574 |
+
}
|
2575 |
+
|
2576 |
+
self.isAnimating = false;
|
2577 |
+
|
2578 |
+
self.updateCursor();
|
2579 |
+
|
2580 |
+
self.trigger("afterShow");
|
2581 |
+
|
2582 |
+
// Autoplay first html5 video/audio
|
2583 |
+
if (!!current.opts.video.autoStart) {
|
2584 |
+
current.$slide
|
2585 |
+
.find("video,audio")
|
2586 |
+
.filter(":visible:first")
|
2587 |
+
.trigger("play")
|
2588 |
+
.one("ended", function() {
|
2589 |
+
if (this.webkitExitFullscreen) {
|
2590 |
+
this.webkitExitFullscreen();
|
2591 |
+
}
|
2592 |
+
|
2593 |
+
self.next();
|
2594 |
+
});
|
2595 |
+
}
|
2596 |
+
|
2597 |
+
// Try to focus on the first focusable element
|
2598 |
+
if (current.opts.autoFocus && current.contentType === "html") {
|
2599 |
+
// Look for the first input with autofocus attribute
|
2600 |
+
$el = current.$content.find("input[autofocus]:enabled:visible:first");
|
2601 |
+
|
2602 |
+
if ($el.length) {
|
2603 |
+
$el.trigger("focus");
|
2604 |
+
} else {
|
2605 |
+
self.focus(null, true);
|
2606 |
+
}
|
2607 |
+
}
|
2608 |
+
|
2609 |
+
// Avoid jumping
|
2610 |
+
current.$slide.scrollTop(0).scrollLeft(0);
|
2611 |
+
},
|
2612 |
+
|
2613 |
+
// Preload next and previous slides
|
2614 |
+
// ================================
|
2615 |
+
|
2616 |
+
preload: function(type) {
|
2617 |
+
var self = this,
|
2618 |
+
prev,
|
2619 |
+
next;
|
2620 |
+
|
2621 |
+
if (self.group.length < 2) {
|
2622 |
+
return;
|
2623 |
+
}
|
2624 |
+
|
2625 |
+
next = self.slides[self.currPos + 1];
|
2626 |
+
prev = self.slides[self.currPos - 1];
|
2627 |
+
|
2628 |
+
if (prev && prev.type === type) {
|
2629 |
+
self.loadSlide(prev);
|
2630 |
+
}
|
2631 |
+
|
2632 |
+
if (next && next.type === type) {
|
2633 |
+
self.loadSlide(next);
|
2634 |
+
}
|
2635 |
+
},
|
2636 |
+
|
2637 |
+
// Try to find and focus on the first focusable element
|
2638 |
+
// ====================================================
|
2639 |
+
|
2640 |
+
focus: function(e, firstRun) {
|
2641 |
+
var self = this,
|
2642 |
+
focusableStr = [
|
2643 |
+
"a[href]",
|
2644 |
+
"area[href]",
|
2645 |
+
'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',
|
2646 |
+
"select:not([disabled]):not([aria-hidden])",
|
2647 |
+
"textarea:not([disabled]):not([aria-hidden])",
|
2648 |
+
"button:not([disabled]):not([aria-hidden])",
|
2649 |
+
"iframe",
|
2650 |
+
"object",
|
2651 |
+
"embed",
|
2652 |
+
"[contenteditable]",
|
2653 |
+
'[tabindex]:not([tabindex^="-"])'
|
2654 |
+
].join(","),
|
2655 |
+
focusableItems,
|
2656 |
+
focusedItemIndex;
|
2657 |
+
|
2658 |
+
if (self.isClosing) {
|
2659 |
+
return;
|
2660 |
+
}
|
2661 |
+
|
2662 |
+
if (e || !self.current || !self.current.isComplete) {
|
2663 |
+
// Focus on any element inside fancybox
|
2664 |
+
focusableItems = self.$refs.container.find("*:visible");
|
2665 |
+
} else {
|
2666 |
+
// Focus inside current slide
|
2667 |
+
focusableItems = self.current.$slide.find("*:visible" + (firstRun ? ":not(.fancybox-close-small)" : ""));
|
2668 |
+
}
|
2669 |
+
|
2670 |
+
focusableItems = focusableItems.filter(focusableStr).filter(function() {
|
2671 |
+
return $(this).css("visibility") !== "hidden" && !$(this).hasClass("disabled");
|
2672 |
+
});
|
2673 |
+
|
2674 |
+
if (focusableItems.length) {
|
2675 |
+
focusedItemIndex = focusableItems.index(document.activeElement);
|
2676 |
+
|
2677 |
+
if (e && e.shiftKey) {
|
2678 |
+
// Back tab
|
2679 |
+
if (focusedItemIndex < 0 || focusedItemIndex == 0) {
|
2680 |
+
e.preventDefault();
|
2681 |
+
|
2682 |
+
focusableItems.eq(focusableItems.length - 1).trigger("focus");
|
2683 |
+
}
|
2684 |
+
} else {
|
2685 |
+
// Outside or Forward tab
|
2686 |
+
if (focusedItemIndex < 0 || focusedItemIndex == focusableItems.length - 1) {
|
2687 |
+
if (e) {
|
2688 |
+
e.preventDefault();
|
2689 |
+
}
|
2690 |
+
|
2691 |
+
focusableItems.eq(0).trigger("focus");
|
2692 |
+
}
|
2693 |
+
}
|
2694 |
+
} else {
|
2695 |
+
self.$refs.container.trigger("focus");
|
2696 |
+
}
|
2697 |
+
},
|
2698 |
+
|
2699 |
+
// Activates current instance - brings container to the front and enables keyboard,
|
2700 |
+
// notifies other instances about deactivating
|
2701 |
+
// =================================================================================
|
2702 |
+
|
2703 |
+
activate: function() {
|
2704 |
+
var self = this;
|
2705 |
+
|
2706 |
+
// Deactivate all instances
|
2707 |
+
$(".fancybox-container").each(function() {
|
2708 |
+
var instance = $(this).data("FancyBox");
|
2709 |
+
|
2710 |
+
// Skip self and closing instances
|
2711 |
+
if (instance && instance.id !== self.id && !instance.isClosing) {
|
2712 |
+
instance.trigger("onDeactivate");
|
2713 |
+
|
2714 |
+
instance.removeEvents();
|
2715 |
+
|
2716 |
+
instance.isVisible = false;
|
2717 |
+
}
|
2718 |
+
});
|
2719 |
+
|
2720 |
+
self.isVisible = true;
|
2721 |
+
|
2722 |
+
if (self.current || self.isIdle) {
|
2723 |
+
self.update();
|
2724 |
+
|
2725 |
+
self.updateControls();
|
2726 |
+
}
|
2727 |
+
|
2728 |
+
self.trigger("onActivate");
|
2729 |
+
|
2730 |
+
self.addEvents();
|
2731 |
+
},
|
2732 |
+
|
2733 |
+
// Start closing procedure
|
2734 |
+
// This will start "zoom-out" animation if needed and clean everything up afterwards
|
2735 |
+
// =================================================================================
|
2736 |
+
|
2737 |
+
close: function(e, d) {
|
2738 |
+
var self = this,
|
2739 |
+
current = self.current,
|
2740 |
+
effect,
|
2741 |
+
duration,
|
2742 |
+
$content,
|
2743 |
+
domRect,
|
2744 |
+
opacity,
|
2745 |
+
start,
|
2746 |
+
end;
|
2747 |
+
|
2748 |
+
var done = function() {
|
2749 |
+
self.cleanUp(e);
|
2750 |
+
};
|
2751 |
+
|
2752 |
+
if (self.isClosing) {
|
2753 |
+
return false;
|
2754 |
+
}
|
2755 |
+
|
2756 |
+
self.isClosing = true;
|
2757 |
+
|
2758 |
+
// If beforeClose callback prevents closing, make sure content is centered
|
2759 |
+
if (self.trigger("beforeClose", e) === false) {
|
2760 |
+
self.isClosing = false;
|
2761 |
+
|
2762 |
+
requestAFrame(function() {
|
2763 |
+
self.update();
|
2764 |
+
});
|
2765 |
+
|
2766 |
+
return false;
|
2767 |
+
}
|
2768 |
+
|
2769 |
+
// Remove all events
|
2770 |
+
// If there are multiple instances, they will be set again by "activate" method
|
2771 |
+
self.removeEvents();
|
2772 |
+
|
2773 |
+
$content = current.$content;
|
2774 |
+
effect = current.opts.animationEffect;
|
2775 |
+
duration = $.isNumeric(d) ? d : effect ? current.opts.animationDuration : 0;
|
2776 |
+
|
2777 |
+
current.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated");
|
2778 |
+
|
2779 |
+
if (e !== true) {
|
2780 |
+
$.fancybox.stop(current.$slide);
|
2781 |
+
} else {
|
2782 |
+
effect = false;
|
2783 |
+
}
|
2784 |
+
|
2785 |
+
// Remove other slides
|
2786 |
+
current.$slide
|
2787 |
+
.siblings()
|
2788 |
+
.trigger("onReset")
|
2789 |
+
.remove();
|
2790 |
+
|
2791 |
+
// Trigger animations
|
2792 |
+
if (duration) {
|
2793 |
+
self.$refs.container
|
2794 |
+
.removeClass("fancybox-is-open")
|
2795 |
+
.addClass("fancybox-is-closing")
|
2796 |
+
.css("transition-duration", duration + "ms");
|
2797 |
+
}
|
2798 |
+
|
2799 |
+
// Clean up
|
2800 |
+
self.hideLoading(current);
|
2801 |
+
|
2802 |
+
self.hideControls(true);
|
2803 |
+
|
2804 |
+
self.updateCursor();
|
2805 |
+
|
2806 |
+
// Check if possible to zoom-out
|
2807 |
+
if (
|
2808 |
+
effect === "zoom" &&
|
2809 |
+
!($content && duration && current.type === "image" && !self.isMoved() && !current.hasError && (end = self.getThumbPos(current)))
|
2810 |
+
) {
|
2811 |
+
effect = "fade";
|
2812 |
+
}
|
2813 |
+
|
2814 |
+
if (effect === "zoom") {
|
2815 |
+
$.fancybox.stop($content);
|
2816 |
+
|
2817 |
+
domRect = $.fancybox.getTranslate($content);
|
2818 |
+
|
2819 |
+
start = {
|
2820 |
+
top: domRect.top,
|
2821 |
+
left: domRect.left,
|
2822 |
+
scaleX: domRect.width / end.width,
|
2823 |
+
scaleY: domRect.height / end.height,
|
2824 |
+
width: end.width,
|
2825 |
+
height: end.height
|
2826 |
+
};
|
2827 |
+
|
2828 |
+
// Check if we need to animate opacity
|
2829 |
+
opacity = current.opts.zoomOpacity;
|
2830 |
+
|
2831 |
+
if (opacity == "auto") {
|
2832 |
+
opacity = Math.abs(current.width / current.height - end.width / end.height) > 0.1;
|
2833 |
+
}
|
2834 |
+
|
2835 |
+
if (opacity) {
|
2836 |
+
end.opacity = 0;
|
2837 |
+
}
|
2838 |
+
|
2839 |
+
$.fancybox.setTranslate($content, start);
|
2840 |
+
|
2841 |
+
forceRedraw($content);
|
2842 |
+
|
2843 |
+
$.fancybox.animate($content, end, duration, done);
|
2844 |
+
|
2845 |
+
return true;
|
2846 |
+
}
|
2847 |
+
|
2848 |
+
if (effect && duration) {
|
2849 |
+
$.fancybox.animate(
|
2850 |
+
current.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"),
|
2851 |
+
"fancybox-animated fancybox-fx-" + effect,
|
2852 |
+
duration,
|
2853 |
+
done
|
2854 |
+
);
|
2855 |
+
} else {
|
2856 |
+
// If skip animation
|
2857 |
+
if (e === true) {
|
2858 |
+
setTimeout(done, duration);
|
2859 |
+
} else {
|
2860 |
+
done();
|
2861 |
+
}
|
2862 |
+
}
|
2863 |
+
|
2864 |
+
return true;
|
2865 |
+
},
|
2866 |
+
|
2867 |
+
// Final adjustments after removing the instance
|
2868 |
+
// =============================================
|
2869 |
+
|
2870 |
+
cleanUp: function(e) {
|
2871 |
+
var self = this,
|
2872 |
+
instance,
|
2873 |
+
$focus = self.current.opts.$orig,
|
2874 |
+
x,
|
2875 |
+
y;
|
2876 |
+
|
2877 |
+
self.current.$slide.trigger("onReset");
|
2878 |
+
|
2879 |
+
self.$refs.container.empty().remove();
|
2880 |
+
|
2881 |
+
self.trigger("afterClose", e);
|
2882 |
+
|
2883 |
+
// Place back focus
|
2884 |
+
if (!!self.current.opts.backFocus) {
|
2885 |
+
if (!$focus || !$focus.length || !$focus.is(":visible")) {
|
2886 |
+
$focus = self.$trigger;
|
2887 |
+
}
|
2888 |
+
|
2889 |
+
if ($focus && $focus.length) {
|
2890 |
+
x = window.scrollX;
|
2891 |
+
y = window.scrollY;
|
2892 |
+
|
2893 |
+
$focus.trigger("focus");
|
2894 |
+
|
2895 |
+
$("html, body")
|
2896 |
+
.scrollTop(y)
|
2897 |
+
.scrollLeft(x);
|
2898 |
+
}
|
2899 |
+
}
|
2900 |
+
|
2901 |
+
self.current = null;
|
2902 |
+
|
2903 |
+
// Check if there are other instances
|
2904 |
+
instance = $.fancybox.getInstance();
|
2905 |
+
|
2906 |
+
if (instance) {
|
2907 |
+
instance.activate();
|
2908 |
+
} else {
|
2909 |
+
$("body").removeClass("fancybox-active compensate-for-scrollbar");
|
2910 |
+
|
2911 |
+
$("#fancybox-style-noscroll").remove();
|
2912 |
+
}
|
2913 |
+
},
|
2914 |
+
|
2915 |
+
// Call callback and trigger an event
|
2916 |
+
// ==================================
|
2917 |
+
|
2918 |
+
trigger: function(name, slide) {
|
2919 |
+
var args = Array.prototype.slice.call(arguments, 1),
|
2920 |
+
self = this,
|
2921 |
+
obj = slide && slide.opts ? slide : self.current,
|
2922 |
+
rez;
|
2923 |
+
|
2924 |
+
if (obj) {
|
2925 |
+
args.unshift(obj);
|
2926 |
+
} else {
|
2927 |
+
obj = self;
|
2928 |
+
}
|
2929 |
+
|
2930 |
+
args.unshift(self);
|
2931 |
+
|
2932 |
+
if ($.isFunction(obj.opts[name])) {
|
2933 |
+
rez = obj.opts[name].apply(obj, args);
|
2934 |
+
}
|
2935 |
+
|
2936 |
+
if (rez === false) {
|
2937 |
+
return rez;
|
2938 |
+
}
|
2939 |
+
|
2940 |
+
if (name === "afterClose" || !self.$refs) {
|
2941 |
+
$D.trigger(name + ".fb", args);
|
2942 |
+
} else {
|
2943 |
+
self.$refs.container.trigger(name + ".fb", args);
|
2944 |
+
}
|
2945 |
+
},
|
2946 |
+
|
2947 |
+
// Update infobar values, navigation button states and reveal caption
|
2948 |
+
// ==================================================================
|
2949 |
+
|
2950 |
+
updateControls: function() {
|
2951 |
+
var self = this,
|
2952 |
+
current = self.current,
|
2953 |
+
index = current.index,
|
2954 |
+
$container = self.$refs.container,
|
2955 |
+
$caption = self.$refs.caption,
|
2956 |
+
caption = current.opts.caption;
|
2957 |
+
|
2958 |
+
// Recalculate content dimensions
|
2959 |
+
current.$slide.trigger("refresh");
|
2960 |
+
|
2961 |
+
self.$caption = caption && caption.length ? $caption.html(caption) : null;
|
2962 |
+
|
2963 |
+
if (!self.hasHiddenControls && !self.isIdle) {
|
2964 |
+
self.showControls();
|
2965 |
+
}
|
2966 |
+
|
2967 |
+
// Update info and navigation elements
|
2968 |
+
$container.find("[data-fancybox-count]").html(self.group.length);
|
2969 |
+
$container.find("[data-fancybox-index]").html(index + 1);
|
2970 |
+
|
2971 |
+
$container.find("[data-fancybox-prev]").prop("disabled", !current.opts.loop && index <= 0);
|
2972 |
+
$container.find("[data-fancybox-next]").prop("disabled", !current.opts.loop && index >= self.group.length - 1);
|
2973 |
+
|
2974 |
+
if (current.type === "image") {
|
2975 |
+
// Re-enable buttons; update download button source
|
2976 |
+
$container
|
2977 |
+
.find("[data-fancybox-zoom]")
|
2978 |
+
.show()
|
2979 |
+
.end()
|
2980 |
+
.find("[data-fancybox-download]")
|
2981 |
+
.attr("href", current.opts.image.src || current.src)
|
2982 |
+
.show();
|
2983 |
+
} else if (current.opts.toolbar) {
|
2984 |
+
$container.find("[data-fancybox-download],[data-fancybox-zoom]").hide();
|
2985 |
+
}
|
2986 |
+
|
2987 |
+
// Make sure focus is not on disabled button/element
|
2988 |
+
if ($(document.activeElement).is(":hidden,[disabled]")) {
|
2989 |
+
self.$refs.container.trigger("focus");
|
2990 |
+
}
|
2991 |
+
},
|
2992 |
+
|
2993 |
+
// Hide toolbar and caption
|
2994 |
+
// ========================
|
2995 |
+
|
2996 |
+
hideControls: function(andCaption) {
|
2997 |
+
var self = this,
|
2998 |
+
arr = ["infobar", "toolbar", "nav"];
|
2999 |
+
|
3000 |
+
if (andCaption || !self.current.opts.preventCaptionOverlap) {
|
3001 |
+
arr.push("caption");
|
3002 |
+
}
|
3003 |
+
|
3004 |
+
this.$refs.container.removeClass(
|
3005 |
+
arr
|
3006 |
+
.map(function(i) {
|
3007 |
+
return "fancybox-show-" + i;
|
3008 |
+
})
|
3009 |
+
.join(" ")
|
3010 |
+
);
|
3011 |
+
|
3012 |
+
this.hasHiddenControls = true;
|
3013 |
+
},
|
3014 |
+
|
3015 |
+
showControls: function() {
|
3016 |
+
var self = this,
|
3017 |
+
opts = self.current ? self.current.opts : self.opts,
|
3018 |
+
$container = self.$refs.container;
|
3019 |
+
|
3020 |
+
self.hasHiddenControls = false;
|
3021 |
+
self.idleSecondsCounter = 0;
|
3022 |
+
|
3023 |
+
$container
|
3024 |
+
.toggleClass("fancybox-show-toolbar", !!(opts.toolbar && opts.buttons))
|
3025 |
+
.toggleClass("fancybox-show-infobar", !!(opts.infobar && self.group.length > 1))
|
3026 |
+
.toggleClass("fancybox-show-caption", !!self.$caption)
|
3027 |
+
.toggleClass("fancybox-show-nav", !!(opts.arrows && self.group.length > 1))
|
3028 |
+
.toggleClass("fancybox-is-modal", !!opts.modal);
|
3029 |
+
},
|
3030 |
+
|
3031 |
+
// Toggle toolbar and caption
|
3032 |
+
// ==========================
|
3033 |
+
|
3034 |
+
toggleControls: function() {
|
3035 |
+
if (this.hasHiddenControls) {
|
3036 |
+
this.showControls();
|
3037 |
+
} else {
|
3038 |
+
this.hideControls();
|
3039 |
+
}
|
3040 |
+
}
|
3041 |
+
});
|
3042 |
+
|
3043 |
+
$.fancybox = {
|
3044 |
+
version: "3.5.2",
|
3045 |
+
defaults: defaults,
|
3046 |
+
|
3047 |
+
// Get current instance and execute a command.
|
3048 |
+
//
|
3049 |
+
// Examples of usage:
|
3050 |
+
//
|
3051 |
+
// $instance = $.fancybox.getInstance();
|
3052 |
+
// $.fancybox.getInstance().jumpTo( 1 );
|
3053 |
+
// $.fancybox.getInstance( 'jumpTo', 1 );
|
3054 |
+
// $.fancybox.getInstance( function() {
|
3055 |
+
// console.info( this.currIndex );
|
3056 |
+
// });
|
3057 |
+
// ======================================================
|
3058 |
+
|
3059 |
+
getInstance: function(command) {
|
3060 |
+
var instance = $('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),
|
3061 |
+
args = Array.prototype.slice.call(arguments, 1);
|
3062 |
+
|
3063 |
+
if (instance instanceof FancyBox) {
|
3064 |
+
if ($.type(command) === "string") {
|
3065 |
+
instance[command].apply(instance, args);
|
3066 |
+
} else if ($.type(command) === "function") {
|
3067 |
+
command.apply(instance, args);
|
3068 |
+
}
|
3069 |
+
|
3070 |
+
return instance;
|
3071 |
+
}
|
3072 |
+
|
3073 |
+
return false;
|
3074 |
+
},
|
3075 |
+
|
3076 |
+
// Create new instance
|
3077 |
+
// ===================
|
3078 |
+
|
3079 |
+
open: function(items, opts, index) {
|
3080 |
+
return new FancyBox(items, opts, index);
|
3081 |
+
},
|
3082 |
+
|
3083 |
+
// Close current or all instances
|
3084 |
+
// ==============================
|
3085 |
+
|
3086 |
+
close: function(all) {
|
3087 |
+
var instance = this.getInstance();
|
3088 |
+
|
3089 |
+
if (instance) {
|
3090 |
+
instance.close();
|
3091 |
+
|
3092 |
+
// Try to find and close next instance
|
3093 |
+
if (all === true) {
|
3094 |
+
this.close(all);
|
3095 |
+
}
|
3096 |
+
}
|
3097 |
+
},
|
3098 |
+
|
3099 |
+
// Close all instances and unbind all events
|
3100 |
+
// =========================================
|
3101 |
+
|
3102 |
+
destroy: function() {
|
3103 |
+
this.close(true);
|
3104 |
+
|
3105 |
+
$D.add("body").off("click.fb-start", "**");
|
3106 |
+
},
|
3107 |
+
|
3108 |
+
// Try to detect mobile devices
|
3109 |
+
// ============================
|
3110 |
+
|
3111 |
+
isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
|
3112 |
+
|
3113 |
+
// Detect if 'translate3d' support is available
|
3114 |
+
// ============================================
|
3115 |
+
|
3116 |
+
use3d: (function() {
|
3117 |
+
var div = document.createElement("div");
|
3118 |
+
|
3119 |
+
return (
|
3120 |
+
window.getComputedStyle &&
|
3121 |
+
window.getComputedStyle(div) &&
|
3122 |
+
window.getComputedStyle(div).getPropertyValue("transform") &&
|
3123 |
+
!(document.documentMode && document.documentMode < 11)
|
3124 |
+
);
|
3125 |
+
})(),
|
3126 |
+
|
3127 |
+
// Helper function to get current visual state of an element
|
3128 |
+
// returns array[ top, left, horizontal-scale, vertical-scale, opacity ]
|
3129 |
+
// =====================================================================
|
3130 |
+
|
3131 |
+
getTranslate: function($el) {
|
3132 |
+
var domRect;
|
3133 |
+
|
3134 |
+
if (!$el || !$el.length) {
|
3135 |
+
return false;
|
3136 |
+
}
|
3137 |
+
|
3138 |
+
domRect = $el[0].getBoundingClientRect();
|
3139 |
+
|
3140 |
+
return {
|
3141 |
+
top: domRect.top || 0,
|
3142 |
+
left: domRect.left || 0,
|
3143 |
+
width: domRect.width,
|
3144 |
+
height: domRect.height,
|
3145 |
+
opacity: parseFloat($el.css("opacity"))
|
3146 |
+
};
|
3147 |
+
},
|
3148 |
+
|
3149 |
+
// Shortcut for setting "translate3d" properties for element
|
3150 |
+
// Can set be used to set opacity, too
|
3151 |
+
// ========================================================
|
3152 |
+
|
3153 |
+
setTranslate: function($el, props) {
|
3154 |
+
var str = "",
|
3155 |
+
css = {};
|
3156 |
+
|
3157 |
+
if (!$el || !props) {
|
3158 |
+
return;
|
3159 |
+
}
|
3160 |
+
|
3161 |
+
if (props.left !== undefined || props.top !== undefined) {
|
3162 |
+
str =
|
3163 |
+
(props.left === undefined ? $el.position().left : props.left) +
|
3164 |
+
"px, " +
|
3165 |
+
(props.top === undefined ? $el.position().top : props.top) +
|
3166 |
+
"px";
|
3167 |
+
|
3168 |
+
if (this.use3d) {
|
3169 |
+
str = "translate3d(" + str + ", 0px)";
|
3170 |
+
} else {
|
3171 |
+
str = "translate(" + str + ")";
|
3172 |
+
}
|
3173 |
+
}
|
3174 |
+
|
3175 |
+
if (props.scaleX !== undefined && props.scaleY !== undefined) {
|
3176 |
+
str += " scale(" + props.scaleX + ", " + props.scaleY + ")";
|
3177 |
+
} else if (props.scaleX !== undefined) {
|
3178 |
+
str += " scaleX(" + props.scaleX + ")";
|
3179 |
+
}
|
3180 |
+
|
3181 |
+
if (str.length) {
|
3182 |
+
css.transform = str;
|
3183 |
+
}
|
3184 |
+
|
3185 |
+
if (props.opacity !== undefined) {
|
3186 |
+
css.opacity = props.opacity;
|
3187 |
+
}
|
3188 |
+
|
3189 |
+
if (props.width !== undefined) {
|
3190 |
+
css.width = props.width;
|
3191 |
+
}
|
3192 |
+
|
3193 |
+
if (props.height !== undefined) {
|
3194 |
+
css.height = props.height;
|
3195 |
+
}
|
3196 |
+
|
3197 |
+
return $el.css(css);
|
3198 |
+
},
|
3199 |
+
|
3200 |
+
// Simple CSS transition handler
|
3201 |
+
// =============================
|
3202 |
+
|
3203 |
+
animate: function($el, to, duration, callback, leaveAnimationName) {
|
3204 |
+
var self = this,
|
3205 |
+
from;
|
3206 |
+
|
3207 |
+
if ($.isFunction(duration)) {
|
3208 |
+
callback = duration;
|
3209 |
+
duration = null;
|
3210 |
+
}
|
3211 |
+
|
3212 |
+
self.stop($el);
|
3213 |
+
|
3214 |
+
from = self.getTranslate($el);
|
3215 |
+
|
3216 |
+
$el.on(transitionEnd, function(e) {
|
3217 |
+
// Skip events from child elements and z-index change
|
3218 |
+
if (e && e.originalEvent && (!$el.is(e.originalEvent.target) || e.originalEvent.propertyName == "z-index")) {
|
3219 |
+
return;
|
3220 |
+
}
|
3221 |
+
|
3222 |
+
self.stop($el);
|
3223 |
+
|
3224 |
+
if ($.isNumeric(duration)) {
|
3225 |
+
$el.css("transition-duration", "");
|
3226 |
+
}
|
3227 |
+
|
3228 |
+
if ($.isPlainObject(to)) {
|
3229 |
+
if (to.scaleX !== undefined && to.scaleY !== undefined) {
|
3230 |
+
self.setTranslate($el, {
|
3231 |
+
top: to.top,
|
3232 |
+
left: to.left,
|
3233 |
+
width: from.width * to.scaleX,
|
3234 |
+
height: from.height * to.scaleY,
|
3235 |
+
scaleX: 1,
|
3236 |
+
scaleY: 1
|
3237 |
+
});
|
3238 |
+
}
|
3239 |
+
} else if (leaveAnimationName !== true) {
|
3240 |
+
$el.removeClass(to);
|
3241 |
+
}
|
3242 |
+
|
3243 |
+
if ($.isFunction(callback)) {
|
3244 |
+
callback(e);
|
3245 |
+
}
|
3246 |
+
});
|
3247 |
+
|
3248 |
+
if ($.isNumeric(duration)) {
|
3249 |
+
$el.css("transition-duration", duration + "ms");
|
3250 |
+
}
|
3251 |
+
|
3252 |
+
// Start animation by changing CSS properties or class name
|
3253 |
+
if ($.isPlainObject(to)) {
|
3254 |
+
if (to.scaleX !== undefined && to.scaleY !== undefined) {
|
3255 |
+
delete to.width;
|
3256 |
+
delete to.height;
|
3257 |
+
|
3258 |
+
if ($el.parent().hasClass("fancybox-slide--image")) {
|
3259 |
+
$el.parent().addClass("fancybox-is-scaling");
|
3260 |
+
}
|
3261 |
+
}
|
3262 |
+
|
3263 |
+
$.fancybox.setTranslate($el, to);
|
3264 |
+
} else {
|
3265 |
+
$el.addClass(to);
|
3266 |
+
}
|
3267 |
+
|
3268 |
+
// Make sure that `transitionend` callback gets fired
|
3269 |
+
$el.data(
|
3270 |
+
"timer",
|
3271 |
+
setTimeout(function() {
|
3272 |
+
$el.trigger(transitionEnd);
|
3273 |
+
}, duration + 33)
|
3274 |
+
);
|
3275 |
+
},
|
3276 |
+
|
3277 |
+
stop: function($el, callCallback) {
|
3278 |
+
if ($el && $el.length) {
|
3279 |
+
clearTimeout($el.data("timer"));
|
3280 |
+
|
3281 |
+
if (callCallback) {
|
3282 |
+
$el.trigger(transitionEnd);
|
3283 |
+
}
|
3284 |
+
|
3285 |
+
$el.off(transitionEnd).css("transition-duration", "");
|
3286 |
+
|
3287 |
+
$el.parent().removeClass("fancybox-is-scaling");
|
3288 |
+
}
|
3289 |
+
}
|
3290 |
+
};
|
3291 |
+
|
3292 |
+
// Default click handler for "fancyboxed" links
|
3293 |
+
// ============================================
|
3294 |
+
|
3295 |
+
function _run(e, opts) {
|
3296 |
+
var items = [],
|
3297 |
+
index = 0,
|
3298 |
+
$target,
|
3299 |
+
value,
|
3300 |
+
instance;
|
3301 |
+
|
3302 |
+
// Avoid opening multiple times
|
3303 |
+
if (e && e.isDefaultPrevented()) {
|
3304 |
+
return;
|
3305 |
+
}
|
3306 |
+
|
3307 |
+
e.preventDefault();
|
3308 |
+
|
3309 |
+
opts = opts || {};
|
3310 |
+
|
3311 |
+
if (e && e.data) {
|
3312 |
+
opts = mergeOpts(e.data.options, opts);
|
3313 |
+
}
|
3314 |
+
|
3315 |
+
$target = opts.$target || $(e.currentTarget).trigger("blur");
|
3316 |
+
instance = $.fancybox.getInstance();
|
3317 |
+
|
3318 |
+
if (instance && instance.$trigger && instance.$trigger.is($target)) {
|
3319 |
+
return;
|
3320 |
+
}
|
3321 |
+
|
3322 |
+
if (opts.selector) {
|
3323 |
+
items = $(opts.selector);
|
3324 |
+
} else {
|
3325 |
+
// Get all related items and find index for clicked one
|
3326 |
+
value = $target.attr("data-fancybox") || "";
|
3327 |
+
|
3328 |
+
if (value) {
|
3329 |
+
items = e.data ? e.data.items : [];
|
3330 |
+
items = items.length ? items.filter('[data-fancybox="' + value + '"]') : $('[data-fancybox="' + value + '"]');
|
3331 |
+
} else {
|
3332 |
+
items = [$target];
|
3333 |
+
}
|
3334 |
+
}
|
3335 |
+
|
3336 |
+
index = $(items).index($target);
|
3337 |
+
|
3338 |
+
// Sometimes current item can not be found
|
3339 |
+
if (index < 0) {
|
3340 |
+
index = 0;
|
3341 |
+
}
|
3342 |
+
|
3343 |
+
instance = $.fancybox.open(items, opts, index);
|
3344 |
+
|
3345 |
+
// Save last active element
|
3346 |
+
instance.$trigger = $target;
|
3347 |
+
}
|
3348 |
+
|
3349 |
+
// Create a jQuery plugin
|
3350 |
+
// ======================
|
3351 |
+
|
3352 |
+
$.fn.fancybox = function(options) {
|
3353 |
+
var selector;
|
3354 |
+
|
3355 |
+
options = options || {};
|
3356 |
+
selector = options.selector || false;
|
3357 |
+
|
3358 |
+
if (selector) {
|
3359 |
+
// Use body element instead of document so it executes first
|
3360 |
+
$("body")
|
3361 |
+
.off("click.fb-start", selector)
|
3362 |
+
.on("click.fb-start", selector, {options: options}, _run);
|
3363 |
+
} else {
|
3364 |
+
this.off("click.fb-start").on(
|
3365 |
+
"click.fb-start",
|
3366 |
+
{
|
3367 |
+
items: this,
|
3368 |
+
options: options
|
3369 |
+
},
|
3370 |
+
_run
|
3371 |
+
);
|
3372 |
+
}
|
3373 |
+
|
3374 |
+
return this;
|
3375 |
+
};
|
3376 |
+
|
3377 |
+
// Self initializing plugin for all elements having `data-fancybox` attribute
|
3378 |
+
// ==========================================================================
|
3379 |
+
|
3380 |
+
$D.on("click.fb-start", "[data-fancybox]", _run);
|
3381 |
+
|
3382 |
+
// Enable "trigger elements"
|
3383 |
+
// =========================
|
3384 |
+
|
3385 |
+
$D.on("click.fb-start", "[data-fancybox-trigger]", function(e) {
|
3386 |
+
$('[data-fancybox="' + $(this).attr("data-fancybox-trigger") + '"]')
|
3387 |
+
.eq($(this).attr("data-fancybox-index") || 0)
|
3388 |
+
.trigger("click.fb-start", {
|
3389 |
+
$trigger: $(this)
|
3390 |
+
});
|
3391 |
+
});
|
3392 |
+
|
3393 |
+
// Track focus event for better accessibility styling
|
3394 |
+
// ==================================================
|
3395 |
+
(function() {
|
3396 |
+
var buttonStr = ".fancybox-button",
|
3397 |
+
focusStr = "fancybox-focus",
|
3398 |
+
$pressed = null;
|
3399 |
+
|
3400 |
+
$D.on("mousedown mouseup focus blur", buttonStr, function(e) {
|
3401 |
+
switch (e.type) {
|
3402 |
+
case "mousedown":
|
3403 |
+
$pressed = $(this);
|
3404 |
+
break;
|
3405 |
+
case "mouseup":
|
3406 |
+
$pressed = null;
|
3407 |
+
break;
|
3408 |
+
case "focusin":
|
3409 |
+
$(buttonStr).removeClass(focusStr);
|
3410 |
+
|
3411 |
+
if (!$(this).is($pressed) && !$(this).is("[disabled]")) {
|
3412 |
+
$(this).addClass(focusStr);
|
3413 |
+
}
|
3414 |
+
break;
|
3415 |
+
case "focusout":
|
3416 |
+
$(buttonStr).removeClass(focusStr);
|
3417 |
+
break;
|
3418 |
+
}
|
3419 |
+
});
|
3420 |
+
})();
|
3421 |
+
})(window, document, jQuery);
|
3422 |
+
|
3423 |
+
// ==========================================================================
|
3424 |
+
//
|
3425 |
+
// Media
|
3426 |
+
// Adds additional media type support
|
3427 |
+
//
|
3428 |
+
// ==========================================================================
|
3429 |
+
(function($) {
|
3430 |
+
"use strict";
|
3431 |
+
|
3432 |
+
// Object containing properties for each media type
|
3433 |
+
var defaults = {
|
3434 |
+
youtube: {
|
3435 |
+
matcher: /(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,
|
3436 |
+
params: {
|
3437 |
+
autoplay: 1,
|
3438 |
+
autohide: 1,
|
3439 |
+
fs: 1,
|
3440 |
+
rel: 0,
|
3441 |
+
hd: 1,
|
3442 |
+
wmode: "transparent",
|
3443 |
+
enablejsapi: 1,
|
3444 |
+
html5: 1
|
3445 |
+
},
|
3446 |
+
paramPlace: 8,
|
3447 |
+
type: "iframe",
|
3448 |
+
url: "//www.youtube-nocookie.com/embed/$4",
|
3449 |
+
thumb: "//img.youtube.com/vi/$4/hqdefault.jpg"
|
3450 |
+
},
|
3451 |
+
|
3452 |
+
vimeo: {
|
3453 |
+
matcher: /^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,
|
3454 |
+
params: {
|
3455 |
+
autoplay: 1,
|
3456 |
+
hd: 1,
|
3457 |
+
show_title: 1,
|
3458 |
+
show_byline: 1,
|
3459 |
+
show_portrait: 0,
|
3460 |
+
fullscreen: 1
|
3461 |
+
},
|
3462 |
+
paramPlace: 3,
|
3463 |
+
type: "iframe",
|
3464 |
+
url: "//player.vimeo.com/video/$2"
|
3465 |
+
},
|
3466 |
+
|
3467 |
+
instagram: {
|
3468 |
+
matcher: /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
|
3469 |
+
type: "image",
|
3470 |
+
url: "//$1/p/$2/media/?size=l"
|
3471 |
+
},
|
3472 |
+
|
3473 |
+
// Examples:
|
3474 |
+
// http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
|
3475 |
+
// https://www.google.com/maps/@37.7852006,-122.4146355,14.65z
|
3476 |
+
// https://www.google.com/maps/@52.2111123,2.9237542,6.61z?hl=en
|
3477 |
+
// https://www.google.com/maps/place/Googleplex/@37.4220041,-122.0833494,17z/data=!4m5!3m4!1s0x0:0x6c296c66619367e0!8m2!3d37.4219998!4d-122.0840572
|
3478 |
+
gmap_place: {
|
3479 |
+
matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,
|
3480 |
+
type: "iframe",
|
3481 |
+
url: function(rez) {
|
3482 |
+
return (
|
3483 |
+
"//maps.google." +
|
3484 |
+
rez[2] +
|
3485 |
+
"/?ll=" +
|
3486 |
+
(rez[9] ? rez[9] + "&z=" + Math.floor(rez[10]) + (rez[12] ? rez[12].replace(/^\//, "&") : "") : rez[12] + "").replace(/\?/, "&") +
|
3487 |
+
"&output=" +
|
3488 |
+
(rez[12] && rez[12].indexOf("layer=c") > 0 ? "svembed" : "embed")
|
3489 |
+
);
|
3490 |
+
}
|
3491 |
+
},
|
3492 |
+
|
3493 |
+
// Examples:
|
3494 |
+
// https://www.google.com/maps/search/Empire+State+Building/
|
3495 |
+
// https://www.google.com/maps/search/?api=1&query=centurylink+field
|
3496 |
+
// https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393
|
3497 |
+
gmap_search: {
|
3498 |
+
matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,
|
3499 |
+
type: "iframe",
|
3500 |
+
url: function(rez) {
|
3501 |
+
return "//maps.google." + rez[2] + "/maps?q=" + rez[5].replace("query=", "q=").replace("api=1", "") + "&output=embed";
|
3502 |
+
}
|
3503 |
+
}
|
3504 |
+
};
|
3505 |
+
|
3506 |
+
// Formats matching url to final form
|
3507 |
+
var format = function(url, rez, params) {
|
3508 |
+
if (!url) {
|
3509 |
+
return;
|
3510 |
+
}
|
3511 |
+
|
3512 |
+
params = params || "";
|
3513 |
+
|
3514 |
+
if ($.type(params) === "object") {
|
3515 |
+
params = $.param(params, true);
|
3516 |
+
}
|
3517 |
+
|
3518 |
+
$.each(rez, function(key, value) {
|
3519 |
+
url = url.replace("$" + key, value || "");
|
3520 |
+
});
|
3521 |
+
|
3522 |
+
if (params.length) {
|
3523 |
+
url += (url.indexOf("?") > 0 ? "&" : "?") + params;
|
3524 |
+
}
|
3525 |
+
|
3526 |
+
return url;
|
3527 |
+
};
|
3528 |
+
|
3529 |
+
$(document).on("objectNeedsType.fb", function(e, instance, item) {
|
3530 |
+
var url = item.src || "",
|
3531 |
+
type = false,
|
3532 |
+
media,
|
3533 |
+
thumb,
|
3534 |
+
rez,
|
3535 |
+
params,
|
3536 |
+
urlParams,
|
3537 |
+
paramObj,
|
3538 |
+
provider;
|
3539 |
+
|
3540 |
+
media = $.extend(true, {}, defaults, item.opts.media);
|
3541 |
+
|
3542 |
+
// Look for any matching media type
|
3543 |
+
$.each(media, function(providerName, providerOpts) {
|
3544 |
+
rez = url.match(providerOpts.matcher);
|
3545 |
+
|
3546 |
+
if (!rez) {
|
3547 |
+
return;
|
3548 |
+
}
|
3549 |
+
|
3550 |
+
type = providerOpts.type;
|
3551 |
+
provider = providerName;
|
3552 |
+
paramObj = {};
|
3553 |
+
|
3554 |
+
if (providerOpts.paramPlace && rez[providerOpts.paramPlace]) {
|
3555 |
+
urlParams = rez[providerOpts.paramPlace];
|
3556 |
+
|
3557 |
+
if (urlParams[0] == "?") {
|
3558 |
+
urlParams = urlParams.substring(1);
|
3559 |
+
}
|
3560 |
+
|
3561 |
+
urlParams = urlParams.split("&");
|
3562 |
+
|
3563 |
+
for (var m = 0; m < urlParams.length; ++m) {
|
3564 |
+
var p = urlParams[m].split("=", 2);
|
3565 |
+
|
3566 |
+
if (p.length == 2) {
|
3567 |
+
paramObj[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
|
3568 |
+
}
|
3569 |
+
}
|
3570 |
+
}
|
3571 |
+
|
3572 |
+
params = $.extend(true, {}, providerOpts.params, item.opts[providerName], paramObj);
|
3573 |
+
|
3574 |
+
url =
|
3575 |
+
$.type(providerOpts.url) === "function" ? providerOpts.url.call(this, rez, params, item) : format(providerOpts.url, rez, params);
|
3576 |
+
|
3577 |
+
thumb =
|
3578 |
+
$.type(providerOpts.thumb) === "function" ? providerOpts.thumb.call(this, rez, params, item) : format(providerOpts.thumb, rez);
|
3579 |
+
|
3580 |
+
if (providerName === "youtube") {
|
3581 |
+
url = url.replace(/&t=((\d+)m)?(\d+)s/, function(match, p1, m, s) {
|
3582 |
+
return "&start=" + ((m ? parseInt(m, 10) * 60 : 0) + parseInt(s, 10));
|
3583 |
+
});
|
3584 |
+
} else if (providerName === "vimeo") {
|
3585 |
+
url = url.replace("&%23", "#");
|
3586 |
+
}
|
3587 |
+
|
3588 |
+
return false;
|
3589 |
+
});
|
3590 |
+
|
3591 |
+
// If it is found, then change content type and update the url
|
3592 |
+
|
3593 |
+
if (type) {
|
3594 |
+
if (!item.opts.thumb && !(item.opts.$thumb && item.opts.$thumb.length)) {
|
3595 |
+
item.opts.thumb = thumb;
|
3596 |
+
}
|
3597 |
+
|
3598 |
+
if (type === "iframe") {
|
3599 |
+
item.opts = $.extend(true, item.opts, {
|
3600 |
+
iframe: {
|
3601 |
+
preload: false,
|
3602 |
+
attr: {
|
3603 |
+
scrolling: "no"
|
3604 |
+
}
|
3605 |
+
}
|
3606 |
+
});
|
3607 |
+
}
|
3608 |
+
|
3609 |
+
$.extend(item, {
|
3610 |
+
type: type,
|
3611 |
+
src: url,
|
3612 |
+
origSrc: item.src,
|
3613 |
+
contentSource: provider,
|
3614 |
+
contentType: type === "image" ? "image" : provider == "gmap_place" || provider == "gmap_search" ? "map" : "video"
|
3615 |
+
});
|
3616 |
+
} else if (url) {
|
3617 |
+
item.type = item.opts.defaultType;
|
3618 |
+
}
|
3619 |
+
});
|
3620 |
+
|
3621 |
+
// Load YouTube/Video API on request to detect when video finished playing
|
3622 |
+
var VideoAPILoader = {
|
3623 |
+
youtube: {
|
3624 |
+
src: "https://www.youtube.com/iframe_api",
|
3625 |
+
class: "YT",
|
3626 |
+
loading: false,
|
3627 |
+
loaded: false
|
3628 |
+
},
|
3629 |
+
|
3630 |
+
vimeo: {
|
3631 |
+
src: "https://player.vimeo.com/api/player.js",
|
3632 |
+
class: "Vimeo",
|
3633 |
+
loading: false,
|
3634 |
+
loaded: false
|
3635 |
+
},
|
3636 |
+
|
3637 |
+
load: function(vendor) {
|
3638 |
+
var _this = this,
|
3639 |
+
script;
|
3640 |
+
|
3641 |
+
if (this[vendor].loaded) {
|
3642 |
+
setTimeout(function() {
|
3643 |
+
_this.done(vendor);
|
3644 |
+
});
|
3645 |
+
return;
|
3646 |
+
}
|
3647 |
+
|
3648 |
+
if (this[vendor].loading) {
|
3649 |
+
return;
|
3650 |
+
}
|
3651 |
+
|
3652 |
+
this[vendor].loading = true;
|
3653 |
+
|
3654 |
+
script = document.createElement("script");
|
3655 |
+
script.type = "text/javascript";
|
3656 |
+
script.src = this[vendor].src;
|
3657 |
+
|
3658 |
+
if (vendor === "youtube") {
|
3659 |
+
window.onYouTubeIframeAPIReady = function() {
|
3660 |
+
_this[vendor].loaded = true;
|
3661 |
+
_this.done(vendor);
|
3662 |
+
};
|
3663 |
+
} else {
|
3664 |
+
script.onload = function() {
|
3665 |
+
_this[vendor].loaded = true;
|
3666 |
+
_this.done(vendor);
|
3667 |
+
};
|
3668 |
+
}
|
3669 |
+
|
3670 |
+
document.body.appendChild(script);
|
3671 |
+
},
|
3672 |
+
done: function(vendor) {
|
3673 |
+
var instance, $el, player;
|
3674 |
+
|
3675 |
+
if (vendor === "youtube") {
|
3676 |
+
delete window.onYouTubeIframeAPIReady;
|
3677 |
+
}
|
3678 |
+
|
3679 |
+
instance = $.fancybox.getInstance();
|
3680 |
+
|
3681 |
+
if (instance) {
|
3682 |
+
$el = instance.current.$content.find("iframe");
|
3683 |
+
|
3684 |
+
if (vendor === "youtube" && YT !== undefined && YT) {
|
3685 |
+
player = new YT.Player($el.attr("id"), {
|
3686 |
+
events: {
|
3687 |
+
onStateChange: function(e) {
|
3688 |
+
if (e.data == 0) {
|
3689 |
+
instance.next();
|
3690 |
+
}
|
3691 |
+
}
|
3692 |
+
}
|
3693 |
+
});
|
3694 |
+
} else if (vendor === "vimeo" && Vimeo !== undefined && Vimeo) {
|
3695 |
+
player = new Vimeo.Player($el);
|
3696 |
+
|
3697 |
+
player.on("ended", function() {
|
3698 |
+
instance.next();
|
3699 |
+
});
|
3700 |
+
}
|
3701 |
+
}
|
3702 |
+
}
|
3703 |
+
};
|
3704 |
+
|
3705 |
+
$(document).on({
|
3706 |
+
"afterShow.fb": function(e, instance, current) {
|
3707 |
+
if (instance.group.length > 1 && (current.contentSource === "youtube" || current.contentSource === "vimeo")) {
|
3708 |
+
VideoAPILoader.load(current.contentSource);
|
3709 |
+
}
|
3710 |
+
}
|
3711 |
+
});
|
3712 |
+
})(jQuery);
|
3713 |
+
|
3714 |
+
// ==========================================================================
|
3715 |
+
//
|
3716 |
+
// Guestures
|
3717 |
+
// Adds touch guestures, handles click and tap events
|
3718 |
+
//
|
3719 |
+
// ==========================================================================
|
3720 |
+
(function(window, document, $) {
|
3721 |
+
"use strict";
|
3722 |
+
|
3723 |
+
var requestAFrame = (function() {
|
3724 |
+
return (
|
3725 |
+
window.requestAnimationFrame ||
|
3726 |
+
window.webkitRequestAnimationFrame ||
|
3727 |
+
window.mozRequestAnimationFrame ||
|
3728 |
+
window.oRequestAnimationFrame ||
|
3729 |
+
// if all else fails, use setTimeout
|
3730 |
+
function(callback) {
|
3731 |
+
return window.setTimeout(callback, 1000 / 60);
|
3732 |
+
}
|
3733 |
+
);
|
3734 |
+
})();
|
3735 |
+
|
3736 |
+
var cancelAFrame = (function() {
|
3737 |
+
return (
|
3738 |
+
window.cancelAnimationFrame ||
|
3739 |
+
window.webkitCancelAnimationFrame ||
|
3740 |
+
window.mozCancelAnimationFrame ||
|
3741 |
+
window.oCancelAnimationFrame ||
|
3742 |
+
function(id) {
|
3743 |
+
window.clearTimeout(id);
|
3744 |
+
}
|
3745 |
+
);
|
3746 |
+
})();
|
3747 |
+
|
3748 |
+
var getPointerXY = function(e) {
|
3749 |
+
var result = [];
|
3750 |
+
|
3751 |
+
e = e.originalEvent || e || window.e;
|
3752 |
+
e = e.touches && e.touches.length ? e.touches : e.changedTouches && e.changedTouches.length ? e.changedTouches : [e];
|
3753 |
+
|
3754 |
+
for (var key in e) {
|
3755 |
+
if (e[key].pageX) {
|
3756 |
+
result.push({
|
3757 |
+
x: e[key].pageX,
|
3758 |
+
y: e[key].pageY
|
3759 |
+
});
|
3760 |
+
} else if (e[key].clientX) {
|
3761 |
+
result.push({
|
3762 |
+
x: e[key].clientX,
|
3763 |
+
y: e[key].clientY
|
3764 |
+
});
|
3765 |
+
}
|
3766 |
+
}
|
3767 |
+
|
3768 |
+
return result;
|
3769 |
+
};
|
3770 |
+
|
3771 |
+
var distance = function(point2, point1, what) {
|
3772 |
+
if (!point1 || !point2) {
|
3773 |
+
return 0;
|
3774 |
+
}
|
3775 |
+
|
3776 |
+
if (what === "x") {
|
3777 |
+
return point2.x - point1.x;
|
3778 |
+
} else if (what === "y") {
|
3779 |
+
return point2.y - point1.y;
|
3780 |
+
}
|
3781 |
+
|
3782 |
+
return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2));
|
3783 |
+
};
|
3784 |
+
|
3785 |
+
var isClickable = function($el) {
|
3786 |
+
if (
|
3787 |
+
$el.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe') ||
|
3788 |
+
$.isFunction($el.get(0).onclick) ||
|
3789 |
+
$el.data("selectable")
|
3790 |
+
) {
|
3791 |
+
return true;
|
3792 |
+
}
|
3793 |
+
|
3794 |
+
// Check for attributes like data-fancybox-next or data-fancybox-close
|
3795 |
+
for (var i = 0, atts = $el[0].attributes, n = atts.length; i < n; i++) {
|
3796 |
+
if (atts[i].nodeName.substr(0, 14) === "data-fancybox-") {
|
3797 |
+
return true;
|
3798 |
+
}
|
3799 |
+
}
|
3800 |
+
|
3801 |
+
return false;
|
3802 |
+
};
|
3803 |
+
|
3804 |
+
var hasScrollbars = function(el) {
|
3805 |
+
var overflowY = window.getComputedStyle(el)["overflow-y"],
|
3806 |
+
overflowX = window.getComputedStyle(el)["overflow-x"],
|
3807 |
+
vertical = (overflowY === "scroll" || overflowY === "auto") && el.scrollHeight > el.clientHeight,
|
3808 |
+
horizontal = (overflowX === "scroll" || overflowX === "auto") && el.scrollWidth > el.clientWidth;
|
3809 |
+
|
3810 |
+
return vertical || horizontal;
|
3811 |
+
};
|
3812 |
+
|
3813 |
+
var isScrollable = function($el) {
|
3814 |
+
var rez = false;
|
3815 |
+
|
3816 |
+
while (true) {
|
3817 |
+
rez = hasScrollbars($el.get(0));
|
3818 |
+
|
3819 |
+
if (rez) {
|
3820 |
+
break;
|
3821 |
+
}
|
3822 |
+
|
3823 |
+
$el = $el.parent();
|
3824 |
+
|
3825 |
+
if (!$el.length || $el.hasClass("fancybox-stage") || $el.is("body")) {
|
3826 |
+
break;
|
3827 |
+
}
|
3828 |
+
}
|
3829 |
+
|
3830 |
+
return rez;
|
3831 |
+
};
|
3832 |
+
|
3833 |
+
var Guestures = function(instance) {
|
3834 |
+
var self = this;
|
3835 |
+
|
3836 |
+
self.instance = instance;
|
3837 |
+
|
3838 |
+
self.$bg = instance.$refs.bg;
|
3839 |
+
self.$stage = instance.$refs.stage;
|
3840 |
+
self.$container = instance.$refs.container;
|
3841 |
+
|
3842 |
+
self.destroy();
|
3843 |
+
|
3844 |
+
self.$container.on("touchstart.fb.touch mousedown.fb.touch", $.proxy(self, "ontouchstart"));
|
3845 |
+
};
|
3846 |
+
|
3847 |
+
Guestures.prototype.destroy = function() {
|
3848 |
+
var self = this;
|
3849 |
+
|
3850 |
+
self.$container.off(".fb.touch");
|
3851 |
+
|
3852 |
+
$(document).off(".fb.touch");
|
3853 |
+
|
3854 |
+
if (self.requestId) {
|
3855 |
+
cancelAFrame(self.requestId);
|
3856 |
+
self.requestId = null;
|
3857 |
+
}
|
3858 |
+
|
3859 |
+
if (self.tapped) {
|
3860 |
+
clearTimeout(self.tapped);
|
3861 |
+
self.tapped = null;
|
3862 |
+
}
|
3863 |
+
};
|
3864 |
+
|
3865 |
+
Guestures.prototype.ontouchstart = function(e) {
|
3866 |
+
var self = this,
|
3867 |
+
$target = $(e.target),
|
3868 |
+
instance = self.instance,
|
3869 |
+
current = instance.current,
|
3870 |
+
$slide = current.$slide,
|
3871 |
+
$content = current.$content,
|
3872 |
+
isTouchDevice = e.type == "touchstart";
|
3873 |
+
|
3874 |
+
// Do not respond to both (touch and mouse) events
|
3875 |
+
if (isTouchDevice) {
|
3876 |
+
self.$container.off("mousedown.fb.touch");
|
3877 |
+
}
|
3878 |
+
|
3879 |
+
// Ignore right click
|
3880 |
+
if (e.originalEvent && e.originalEvent.button == 2) {
|
3881 |
+
return;
|
3882 |
+
}
|
3883 |
+
|
3884 |
+
// Ignore taping on links, buttons, input elements
|
3885 |
+
if (!$slide.length || !$target.length || isClickable($target) || isClickable($target.parent())) {
|
3886 |
+
return;
|
3887 |
+
}
|
3888 |
+
// Ignore clicks on the scrollbar
|
3889 |
+
if (!$target.is("img") && e.originalEvent.clientX > $target[0].clientWidth + $target.offset().left) {
|
3890 |
+
return;
|
3891 |
+
}
|
3892 |
+
|
3893 |
+
// Ignore clicks while zooming or closing
|
3894 |
+
if (!current || instance.isAnimating || current.$slide.hasClass("fancybox-animated")) {
|
3895 |
+
e.stopPropagation();
|
3896 |
+
e.preventDefault();
|
3897 |
+
|
3898 |
+
return;
|
3899 |
+
}
|
3900 |
+
|
3901 |
+
self.realPoints = self.startPoints = getPointerXY(e);
|
3902 |
+
|
3903 |
+
if (!self.startPoints.length) {
|
3904 |
+
return;
|
3905 |
+
}
|
3906 |
+
|
3907 |
+
// Allow other scripts to catch touch event if "touch" is set to false
|
3908 |
+
if (current.touch) {
|
3909 |
+
e.stopPropagation();
|
3910 |
+
}
|
3911 |
+
|
3912 |
+
self.startEvent = e;
|
3913 |
+
|
3914 |
+
self.canTap = true;
|
3915 |
+
self.$target = $target;
|
3916 |
+
self.$content = $content;
|
3917 |
+
self.opts = current.opts.touch;
|
3918 |
+
|
3919 |
+
self.isPanning = false;
|
3920 |
+
self.isSwiping = false;
|
3921 |
+
self.isZooming = false;
|
3922 |
+
self.isScrolling = false;
|
3923 |
+
self.canPan = instance.canPan();
|
3924 |
+
|
3925 |
+
self.startTime = new Date().getTime();
|
3926 |
+
self.distanceX = self.distanceY = self.distance = 0;
|
3927 |
+
|
3928 |
+
self.canvasWidth = Math.round($slide[0].clientWidth);
|
3929 |
+
self.canvasHeight = Math.round($slide[0].clientHeight);
|
3930 |
+
|
3931 |
+
self.contentLastPos = null;
|
3932 |
+
self.contentStartPos = $.fancybox.getTranslate(self.$content) || {top: 0, left: 0};
|
3933 |
+
self.sliderStartPos = $.fancybox.getTranslate($slide);
|
3934 |
+
|
3935 |
+
// Since position will be absolute, but we need to make it relative to the stage
|
3936 |
+
self.stagePos = $.fancybox.getTranslate(instance.$refs.stage);
|
3937 |
+
|
3938 |
+
self.sliderStartPos.top -= self.stagePos.top;
|
3939 |
+
self.sliderStartPos.left -= self.stagePos.left;
|
3940 |
+
|
3941 |
+
self.contentStartPos.top -= self.stagePos.top;
|
3942 |
+
self.contentStartPos.left -= self.stagePos.left;
|
3943 |
+
|
3944 |
+
$(document)
|
3945 |
+
.off(".fb.touch")
|
3946 |
+
.on(isTouchDevice ? "touchend.fb.touch touchcancel.fb.touch" : "mouseup.fb.touch mouseleave.fb.touch", $.proxy(self, "ontouchend"))
|
3947 |
+
.on(isTouchDevice ? "touchmove.fb.touch" : "mousemove.fb.touch", $.proxy(self, "ontouchmove"));
|
3948 |
+
|
3949 |
+
if ($.fancybox.isMobile) {
|
3950 |
+
document.addEventListener("scroll", self.onscroll, true);
|
3951 |
+
}
|
3952 |
+
|
3953 |
+
// Skip if clicked outside the sliding area
|
3954 |
+
if (!(self.opts || self.canPan) || !($target.is(self.$stage) || self.$stage.find($target).length)) {
|
3955 |
+
if ($target.is(".fancybox-image")) {
|
3956 |
+
e.preventDefault();
|
3957 |
+
}
|
3958 |
+
|
3959 |
+
if (!($.fancybox.isMobile && $target.hasClass("fancybox-caption"))) {
|
3960 |
+
return;
|
3961 |
+
}
|
3962 |
+
}
|
3963 |
+
|
3964 |
+
self.isScrollable = isScrollable($target) || isScrollable($target.parent());
|
3965 |
+
|
3966 |
+
// Check if element is scrollable and try to prevent default behavior (scrolling)
|
3967 |
+
if (!($.fancybox.isMobile && self.isScrollable)) {
|
3968 |
+
e.preventDefault();
|
3969 |
+
}
|
3970 |
+
|
3971 |
+
// One finger or mouse click - swipe or pan an image
|
3972 |
+
if (self.startPoints.length === 1 || current.hasError) {
|
3973 |
+
if (self.canPan) {
|
3974 |
+
$.fancybox.stop(self.$content);
|
3975 |
+
|
3976 |
+
self.isPanning = true;
|
3977 |
+
} else {
|
3978 |
+
self.isSwiping = true;
|
3979 |
+
}
|
3980 |
+
|
3981 |
+
self.$container.addClass("fancybox-is-grabbing");
|
3982 |
+
}
|
3983 |
+
|
3984 |
+
// Two fingers - zoom image
|
3985 |
+
if (self.startPoints.length === 2 && current.type === "image" && (current.isLoaded || current.$ghost)) {
|
3986 |
+
self.canTap = false;
|
3987 |
+
self.isSwiping = false;
|
3988 |
+
self.isPanning = false;
|
3989 |
+
|
3990 |
+
self.isZooming = true;
|
3991 |
+
|
3992 |
+
$.fancybox.stop(self.$content);
|
3993 |
+
|
3994 |
+
self.centerPointStartX = (self.startPoints[0].x + self.startPoints[1].x) * 0.5 - $(window).scrollLeft();
|
3995 |
+
self.centerPointStartY = (self.startPoints[0].y + self.startPoints[1].y) * 0.5 - $(window).scrollTop();
|
3996 |
+
|
3997 |
+
self.percentageOfImageAtPinchPointX = (self.centerPointStartX - self.contentStartPos.left) / self.contentStartPos.width;
|
3998 |
+
self.percentageOfImageAtPinchPointY = (self.centerPointStartY - self.contentStartPos.top) / self.contentStartPos.height;
|
3999 |
+
|
4000 |
+
self.startDistanceBetweenFingers = distance(self.startPoints[0], self.startPoints[1]);
|
4001 |
+
}
|
4002 |
+
};
|
4003 |
+
|
4004 |
+
Guestures.prototype.onscroll = function(e) {
|
4005 |
+
var self = this;
|
4006 |
+
|
4007 |
+
self.isScrolling = true;
|
4008 |
+
|
4009 |
+
document.removeEventListener("scroll", self.onscroll, true);
|
4010 |
+
};
|
4011 |
+
|
4012 |
+
Guestures.prototype.ontouchmove = function(e) {
|
4013 |
+
var self = this;
|
4014 |
+
|
4015 |
+
// Make sure user has not released over iframe or disabled element
|
4016 |
+
if (e.originalEvent.buttons !== undefined && e.originalEvent.buttons === 0) {
|
4017 |
+
self.ontouchend(e);
|
4018 |
+
return;
|
4019 |
+
}
|
4020 |
+
|
4021 |
+
if (self.isScrolling) {
|
4022 |
+
self.canTap = false;
|
4023 |
+
return;
|
4024 |
+
}
|
4025 |
+
|
4026 |
+
self.newPoints = getPointerXY(e);
|
4027 |
+
|
4028 |
+
if (!(self.opts || self.canPan) || !self.newPoints.length || !self.newPoints.length) {
|
4029 |
+
return;
|
4030 |
+
}
|
4031 |
+
|
4032 |
+
if (!(self.isSwiping && self.isSwiping === true)) {
|
4033 |
+
e.preventDefault();
|
4034 |
+
}
|
4035 |
+
|
4036 |
+
self.distanceX = distance(self.newPoints[0], self.startPoints[0], "x");
|
4037 |
+
self.distanceY = distance(self.newPoints[0], self.startPoints[0], "y");
|
4038 |
+
|
4039 |
+
self.distance = distance(self.newPoints[0], self.startPoints[0]);
|
4040 |
+
|
4041 |
+
// Skip false ontouchmove events (Chrome)
|
4042 |
+
if (self.distance > 0) {
|
4043 |
+
if (self.isSwiping) {
|
4044 |
+
self.onSwipe(e);
|
4045 |
+
} else if (self.isPanning) {
|
4046 |
+
self.onPan();
|
4047 |
+
} else if (self.isZooming) {
|
4048 |
+
self.onZoom();
|
4049 |
+
}
|
4050 |
+
}
|
4051 |
+
};
|
4052 |
+
|
4053 |
+
Guestures.prototype.onSwipe = function(e) {
|
4054 |
+
var self = this,
|
4055 |
+
instance = self.instance,
|
4056 |
+
swiping = self.isSwiping,
|
4057 |
+
left = self.sliderStartPos.left || 0,
|
4058 |
+
angle;
|
4059 |
+
|
4060 |
+
// If direction is not yet determined
|
4061 |
+
if (swiping === true) {
|
4062 |
+
// We need at least 10px distance to correctly calculate an angle
|
4063 |
+
if (Math.abs(self.distance) > 10) {
|
4064 |
+
self.canTap = false;
|
4065 |
+
|
4066 |
+
if (instance.group.length < 2 && self.opts.vertical) {
|
4067 |
+
self.isSwiping = "y";
|
4068 |
+
} else if (instance.isDragging || self.opts.vertical === false || (self.opts.vertical === "auto" && $(window).width() > 800)) {
|
4069 |
+
self.isSwiping = "x";
|
4070 |
+
} else {
|
4071 |
+
angle = Math.abs((Math.atan2(self.distanceY, self.distanceX) * 180) / Math.PI);
|
4072 |
+
|
4073 |
+
self.isSwiping = angle > 45 && angle < 135 ? "y" : "x";
|
4074 |
+
}
|
4075 |
+
|
4076 |
+
if (self.isSwiping === "y" && $.fancybox.isMobile && self.isScrollable) {
|
4077 |
+
self.isScrolling = true;
|
4078 |
+
|
4079 |
+
return;
|
4080 |
+
}
|
4081 |
+
|
4082 |
+
instance.isDragging = self.isSwiping;
|
4083 |
+
|
4084 |
+
// Reset points to avoid jumping, because we dropped first swipes to calculate the angle
|
4085 |
+
self.startPoints = self.newPoints;
|
4086 |
+
|
4087 |
+
$.each(instance.slides, function(index, slide) {
|
4088 |
+
var slidePos, stagePos;
|
4089 |
+
|
4090 |
+
$.fancybox.stop(slide.$slide);
|
4091 |
+
|
4092 |
+
slidePos = $.fancybox.getTranslate(slide.$slide);
|
4093 |
+
stagePos = $.fancybox.getTranslate(instance.$refs.stage);
|
4094 |
+
|
4095 |
+
slide.$slide
|
4096 |
+
.css({
|
4097 |
+
transform: "",
|
4098 |
+
opacity: "",
|
4099 |
+
"transition-duration": ""
|
4100 |
+
})
|
4101 |
+
.removeClass("fancybox-animated")
|
4102 |
+
.removeClass(function(index, className) {
|
4103 |
+
return (className.match(/(^|\s)fancybox-fx-\S+/g) || []).join(" ");
|
4104 |
+
});
|
4105 |
+
|
4106 |
+
if (slide.pos === instance.current.pos) {
|
4107 |
+
self.sliderStartPos.top = slidePos.top - stagePos.top;
|
4108 |
+
self.sliderStartPos.left = slidePos.left - stagePos.left;
|
4109 |
+
}
|
4110 |
+
|
4111 |
+
$.fancybox.setTranslate(slide.$slide, {
|
4112 |
+
top: slidePos.top - stagePos.top,
|
4113 |
+
left: slidePos.left - stagePos.left
|
4114 |
+
});
|
4115 |
+
});
|
4116 |
+
|
4117 |
+
// Stop slideshow
|
4118 |
+
if (instance.SlideShow && instance.SlideShow.isActive) {
|
4119 |
+
instance.SlideShow.stop();
|
4120 |
+
}
|
4121 |
+
}
|
4122 |
+
|
4123 |
+
return;
|
4124 |
+
}
|
4125 |
+
|
4126 |
+
// Sticky edges
|
4127 |
+
if (swiping == "x") {
|
4128 |
+
if (
|
4129 |
+
self.distanceX > 0 &&
|
4130 |
+
(self.instance.group.length < 2 || (self.instance.current.index === 0 && !self.instance.current.opts.loop))
|
4131 |
+
) {
|
4132 |
+
left = left + Math.pow(self.distanceX, 0.8);
|
4133 |
+
} else if (
|
4134 |
+
self.distanceX < 0 &&
|
4135 |
+
(self.instance.group.length < 2 ||
|
4136 |
+
(self.instance.current.index === self.instance.group.length - 1 && !self.instance.current.opts.loop))
|
4137 |
+
) {
|
4138 |
+
left = left - Math.pow(-self.distanceX, 0.8);
|
4139 |
+
} else {
|
4140 |
+
left = left + self.distanceX;
|
4141 |
+
}
|
4142 |
+
}
|
4143 |
+
|
4144 |
+
self.sliderLastPos = {
|
4145 |
+
top: swiping == "x" ? 0 : self.sliderStartPos.top + self.distanceY,
|
4146 |
+
left: left
|
4147 |
+
};
|
4148 |
+
|
4149 |
+
if (self.requestId) {
|
4150 |
+
cancelAFrame(self.requestId);
|
4151 |
+
|
4152 |
+
self.requestId = null;
|
4153 |
+
}
|
4154 |
+
|
4155 |
+
self.requestId = requestAFrame(function() {
|
4156 |
+
if (self.sliderLastPos) {
|
4157 |
+
$.each(self.instance.slides, function(index, slide) {
|
4158 |
+
var pos = slide.pos - self.instance.currPos;
|
4159 |
+
|
4160 |
+
$.fancybox.setTranslate(slide.$slide, {
|
4161 |
+
top: self.sliderLastPos.top,
|
4162 |
+
left: self.sliderLastPos.left + pos * self.canvasWidth + pos * slide.opts.gutter
|
4163 |
+
});
|
4164 |
+
});
|
4165 |
+
|
4166 |
+
self.$container.addClass("fancybox-is-sliding");
|
4167 |
+
}
|
4168 |
+
});
|
4169 |
+
};
|
4170 |
+
|
4171 |
+
Guestures.prototype.onPan = function() {
|
4172 |
+
var self = this;
|
4173 |
+
|
4174 |
+
// Prevent accidental movement (sometimes, when tapping casually, finger can move a bit)
|
4175 |
+
if (distance(self.newPoints[0], self.realPoints[0]) < ($.fancybox.isMobile ? 10 : 5)) {
|
4176 |
+
self.startPoints = self.newPoints;
|
4177 |
+
return;
|
4178 |
+
}
|
4179 |
+
|
4180 |
+
self.canTap = false;
|
4181 |
+
|
4182 |
+
self.contentLastPos = self.limitMovement();
|
4183 |
+
|
4184 |
+
if (self.requestId) {
|
4185 |
+
cancelAFrame(self.requestId);
|
4186 |
+
}
|
4187 |
+
|
4188 |
+
self.requestId = requestAFrame(function() {
|
4189 |
+
$.fancybox.setTranslate(self.$content, self.contentLastPos);
|
4190 |
+
});
|
4191 |
+
};
|
4192 |
+
|
4193 |
+
// Make panning sticky to the edges
|
4194 |
+
Guestures.prototype.limitMovement = function() {
|
4195 |
+
var self = this;
|
4196 |
+
|
4197 |
+
var canvasWidth = self.canvasWidth;
|
4198 |
+
var canvasHeight = self.canvasHeight;
|
4199 |
+
|
4200 |
+
var distanceX = self.distanceX;
|
4201 |
+
var distanceY = self.distanceY;
|
4202 |
+
|
4203 |
+
var contentStartPos = self.contentStartPos;
|
4204 |
+
|
4205 |
+
var currentOffsetX = contentStartPos.left;
|
4206 |
+
var currentOffsetY = contentStartPos.top;
|
4207 |
+
|
4208 |
+
var currentWidth = contentStartPos.width;
|
4209 |
+
var currentHeight = contentStartPos.height;
|
4210 |
+
|
4211 |
+
var minTranslateX, minTranslateY, maxTranslateX, maxTranslateY, newOffsetX, newOffsetY;
|
4212 |
+
|
4213 |
+
if (currentWidth > canvasWidth) {
|
4214 |
+
newOffsetX = currentOffsetX + distanceX;
|
4215 |
+
} else {
|
4216 |
+
newOffsetX = currentOffsetX;
|
4217 |
+
}
|
4218 |
+
|
4219 |
+
newOffsetY = currentOffsetY + distanceY;
|
4220 |
+
|
4221 |
+
// Slow down proportionally to traveled distance
|
4222 |
+
minTranslateX = Math.max(0, canvasWidth * 0.5 - currentWidth * 0.5);
|
4223 |
+
minTranslateY = Math.max(0, canvasHeight * 0.5 - currentHeight * 0.5);
|
4224 |
+
|
4225 |
+
maxTranslateX = Math.min(canvasWidth - currentWidth, canvasWidth * 0.5 - currentWidth * 0.5);
|
4226 |
+
maxTranslateY = Math.min(canvasHeight - currentHeight, canvasHeight * 0.5 - currentHeight * 0.5);
|
4227 |
+
|
4228 |
+
// ->
|
4229 |
+
if (distanceX > 0 && newOffsetX > minTranslateX) {
|
4230 |
+
newOffsetX = minTranslateX - 1 + Math.pow(-minTranslateX + currentOffsetX + distanceX, 0.8) || 0;
|
4231 |
+
}
|
4232 |
+
|
4233 |
+
// <-
|
4234 |
+
if (distanceX < 0 && newOffsetX < maxTranslateX) {
|
4235 |
+
newOffsetX = maxTranslateX + 1 - Math.pow(maxTranslateX - currentOffsetX - distanceX, 0.8) || 0;
|
4236 |
+
}
|
4237 |
+
|
4238 |
+
// \/
|
4239 |
+
if (distanceY > 0 && newOffsetY > minTranslateY) {
|
4240 |
+
newOffsetY = minTranslateY - 1 + Math.pow(-minTranslateY + currentOffsetY + distanceY, 0.8) || 0;
|
4241 |
+
}
|
4242 |
+
|
4243 |
+
// /\
|
4244 |
+
if (distanceY < 0 && newOffsetY < maxTranslateY) {
|
4245 |
+
newOffsetY = maxTranslateY + 1 - Math.pow(maxTranslateY - currentOffsetY - distanceY, 0.8) || 0;
|
4246 |
+
}
|
4247 |
+
|
4248 |
+
return {
|
4249 |
+
top: newOffsetY,
|
4250 |
+
left: newOffsetX
|
4251 |
+
};
|
4252 |
+
};
|
4253 |
+
|
4254 |
+
Guestures.prototype.limitPosition = function(newOffsetX, newOffsetY, newWidth, newHeight) {
|
4255 |
+
var self = this;
|
4256 |
+
|
4257 |
+
var canvasWidth = self.canvasWidth;
|
4258 |
+
var canvasHeight = self.canvasHeight;
|
4259 |
+
|
4260 |
+
if (newWidth > canvasWidth) {
|
4261 |
+
newOffsetX = newOffsetX > 0 ? 0 : newOffsetX;
|
4262 |
+
newOffsetX = newOffsetX < canvasWidth - newWidth ? canvasWidth - newWidth : newOffsetX;
|
4263 |
+
} else {
|
4264 |
+
// Center horizontally
|
4265 |
+
newOffsetX = Math.max(0, canvasWidth / 2 - newWidth / 2);
|
4266 |
+
}
|
4267 |
+
|
4268 |
+
if (newHeight > canvasHeight) {
|
4269 |
+
newOffsetY = newOffsetY > 0 ? 0 : newOffsetY;
|
4270 |
+
newOffsetY = newOffsetY < canvasHeight - newHeight ? canvasHeight - newHeight : newOffsetY;
|
4271 |
+
} else {
|
4272 |
+
// Center vertically
|
4273 |
+
newOffsetY = Math.max(0, canvasHeight / 2 - newHeight / 2);
|
4274 |
+
}
|
4275 |
+
|
4276 |
+
return {
|
4277 |
+
top: newOffsetY,
|
4278 |
+
left: newOffsetX
|
4279 |
+
};
|
4280 |
+
};
|
4281 |
+
|
4282 |
+
Guestures.prototype.onZoom = function() {
|
4283 |
+
var self = this;
|
4284 |
+
|
4285 |
+
// Calculate current distance between points to get pinch ratio and new width and height
|
4286 |
+
var contentStartPos = self.contentStartPos;
|
4287 |
+
|
4288 |
+
var currentWidth = contentStartPos.width;
|
4289 |
+
var currentHeight = contentStartPos.height;
|
4290 |
+
|
4291 |
+
var currentOffsetX = contentStartPos.left;
|
4292 |
+
var currentOffsetY = contentStartPos.top;
|
4293 |
+
|
4294 |
+
var endDistanceBetweenFingers = distance(self.newPoints[0], self.newPoints[1]);
|
4295 |
+
|
4296 |
+
var pinchRatio = endDistanceBetweenFingers / self.startDistanceBetweenFingers;
|
4297 |
+
|
4298 |
+
var newWidth = Math.floor(currentWidth * pinchRatio);
|
4299 |
+
var newHeight = Math.floor(currentHeight * pinchRatio);
|
4300 |
+
|
4301 |
+
// This is the translation due to pinch-zooming
|
4302 |
+
var translateFromZoomingX = (currentWidth - newWidth) * self.percentageOfImageAtPinchPointX;
|
4303 |
+
var translateFromZoomingY = (currentHeight - newHeight) * self.percentageOfImageAtPinchPointY;
|
4304 |
+
|
4305 |
+
// Point between the two touches
|
4306 |
+
var centerPointEndX = (self.newPoints[0].x + self.newPoints[1].x) / 2 - $(window).scrollLeft();
|
4307 |
+
var centerPointEndY = (self.newPoints[0].y + self.newPoints[1].y) / 2 - $(window).scrollTop();
|
4308 |
+
|
4309 |
+
// And this is the translation due to translation of the centerpoint
|
4310 |
+
// between the two fingers
|
4311 |
+
var translateFromTranslatingX = centerPointEndX - self.centerPointStartX;
|
4312 |
+
var translateFromTranslatingY = centerPointEndY - self.centerPointStartY;
|
4313 |
+
|
4314 |
+
// The new offset is the old/current one plus the total translation
|
4315 |
+
var newOffsetX = currentOffsetX + (translateFromZoomingX + translateFromTranslatingX);
|
4316 |
+
var newOffsetY = currentOffsetY + (translateFromZoomingY + translateFromTranslatingY);
|
4317 |
+
|
4318 |
+
var newPos = {
|
4319 |
+
top: newOffsetY,
|
4320 |
+
left: newOffsetX,
|
4321 |
+
scaleX: pinchRatio,
|
4322 |
+
scaleY: pinchRatio
|
4323 |
+
};
|
4324 |
+
|
4325 |
+
self.canTap = false;
|
4326 |
+
|
4327 |
+
self.newWidth = newWidth;
|
4328 |
+
self.newHeight = newHeight;
|
4329 |
+
|
4330 |
+
self.contentLastPos = newPos;
|
4331 |
+
|
4332 |
+
if (self.requestId) {
|
4333 |
+
cancelAFrame(self.requestId);
|
4334 |
+
}
|
4335 |
+
|
4336 |
+
self.requestId = requestAFrame(function() {
|
4337 |
+
$.fancybox.setTranslate(self.$content, self.contentLastPos);
|
4338 |
+
});
|
4339 |
+
};
|
4340 |
+
|
4341 |
+
Guestures.prototype.ontouchend = function(e) {
|
4342 |
+
var self = this;
|
4343 |
+
|
4344 |
+
var swiping = self.isSwiping;
|
4345 |
+
var panning = self.isPanning;
|
4346 |
+
var zooming = self.isZooming;
|
4347 |
+
var scrolling = self.isScrolling;
|
4348 |
+
|
4349 |
+
self.endPoints = getPointerXY(e);
|
4350 |
+
self.dMs = Math.max(new Date().getTime() - self.startTime, 1);
|
4351 |
+
|
4352 |
+
self.$container.removeClass("fancybox-is-grabbing");
|
4353 |
+
|
4354 |
+
$(document).off(".fb.touch");
|
4355 |
+
|
4356 |
+
document.removeEventListener("scroll", self.onscroll, true);
|
4357 |
+
|
4358 |
+
if (self.requestId) {
|
4359 |
+
cancelAFrame(self.requestId);
|
4360 |
+
|
4361 |
+
self.requestId = null;
|
4362 |
+
}
|
4363 |
+
|
4364 |
+
self.isSwiping = false;
|
4365 |
+
self.isPanning = false;
|
4366 |
+
self.isZooming = false;
|
4367 |
+
self.isScrolling = false;
|
4368 |
+
|
4369 |
+
self.instance.isDragging = false;
|
4370 |
+
|
4371 |
+
if (self.canTap) {
|
4372 |
+
return self.onTap(e);
|
4373 |
+
}
|
4374 |
+
|
4375 |
+
self.speed = 100;
|
4376 |
+
|
4377 |
+
// Speed in px/ms
|
4378 |
+
self.velocityX = (self.distanceX / self.dMs) * 0.5;
|
4379 |
+
self.velocityY = (self.distanceY / self.dMs) * 0.5;
|
4380 |
+
|
4381 |
+
if (panning) {
|
4382 |
+
self.endPanning();
|
4383 |
+
} else if (zooming) {
|
4384 |
+
self.endZooming();
|
4385 |
+
} else {
|
4386 |
+
self.endSwiping(swiping, scrolling);
|
4387 |
+
}
|
4388 |
+
|
4389 |
+
return;
|
4390 |
+
};
|
4391 |
+
|
4392 |
+
Guestures.prototype.endSwiping = function(swiping, scrolling) {
|
4393 |
+
var self = this,
|
4394 |
+
ret = false,
|
4395 |
+
len = self.instance.group.length,
|
4396 |
+
distanceX = Math.abs(self.distanceX),
|
4397 |
+
canAdvance = swiping == "x" && len > 1 && ((self.dMs > 130 && distanceX > 10) || distanceX > 50),
|
4398 |
+
speedX = 300;
|
4399 |
+
|
4400 |
+
self.sliderLastPos = null;
|
4401 |
+
|
4402 |
+
// Close if swiped vertically / navigate if horizontally
|
4403 |
+
if (swiping == "y" && !scrolling && Math.abs(self.distanceY) > 50) {
|
4404 |
+
// Continue vertical movement
|
4405 |
+
$.fancybox.animate(
|
4406 |
+
self.instance.current.$slide,
|
4407 |
+
{
|
4408 |
+
top: self.sliderStartPos.top + self.distanceY + self.velocityY * 150,
|
4409 |
+
opacity: 0
|
4410 |
+
},
|
4411 |
+
200
|
4412 |
+
);
|
4413 |
+
ret = self.instance.close(true, 250);
|
4414 |
+
} else if (canAdvance && self.distanceX > 0) {
|
4415 |
+
ret = self.instance.previous(speedX);
|
4416 |
+
} else if (canAdvance && self.distanceX < 0) {
|
4417 |
+
ret = self.instance.next(speedX);
|
4418 |
+
}
|
4419 |
+
|
4420 |
+
if (ret === false && (swiping == "x" || swiping == "y")) {
|
4421 |
+
self.instance.centerSlide(200);
|
4422 |
+
}
|
4423 |
+
|
4424 |
+
self.$container.removeClass("fancybox-is-sliding");
|
4425 |
+
};
|
4426 |
+
|
4427 |
+
// Limit panning from edges
|
4428 |
+
// ========================
|
4429 |
+
Guestures.prototype.endPanning = function() {
|
4430 |
+
var self = this,
|
4431 |
+
newOffsetX,
|
4432 |
+
newOffsetY,
|
4433 |
+
newPos;
|
4434 |
+
|
4435 |
+
if (!self.contentLastPos) {
|
4436 |
+
return;
|
4437 |
+
}
|
4438 |
+
|
4439 |
+
if (self.opts.momentum === false || self.dMs > 350) {
|
4440 |
+
newOffsetX = self.contentLastPos.left;
|
4441 |
+
newOffsetY = self.contentLastPos.top;
|
4442 |
+
} else {
|
4443 |
+
// Continue movement
|
4444 |
+
newOffsetX = self.contentLastPos.left + self.velocityX * 500;
|
4445 |
+
newOffsetY = self.contentLastPos.top + self.velocityY * 500;
|
4446 |
+
}
|
4447 |
+
|
4448 |
+
newPos = self.limitPosition(newOffsetX, newOffsetY, self.contentStartPos.width, self.contentStartPos.height);
|
4449 |
+
|
4450 |
+
newPos.width = self.contentStartPos.width;
|
4451 |
+
newPos.height = self.contentStartPos.height;
|
4452 |
+
|
4453 |
+
$.fancybox.animate(self.$content, newPos, 330);
|
4454 |
+
};
|
4455 |
+
|
4456 |
+
Guestures.prototype.endZooming = function() {
|
4457 |
+
var self = this;
|
4458 |
+
|
4459 |
+
var current = self.instance.current;
|
4460 |
+
|
4461 |
+
var newOffsetX, newOffsetY, newPos, reset;
|
4462 |
+
|
4463 |
+
var newWidth = self.newWidth;
|
4464 |
+
var newHeight = self.newHeight;
|
4465 |
+
|
4466 |
+
if (!self.contentLastPos) {
|
4467 |
+
return;
|
4468 |
+
}
|
4469 |
+
|
4470 |
+
newOffsetX = self.contentLastPos.left;
|
4471 |
+
newOffsetY = self.contentLastPos.top;
|
4472 |
+
|
4473 |
+
reset = {
|
4474 |
+
top: newOffsetY,
|
4475 |
+
left: newOffsetX,
|
4476 |
+
width: newWidth,
|
4477 |
+
height: newHeight,
|
4478 |
+
scaleX: 1,
|
4479 |
+
scaleY: 1
|
4480 |
+
};
|
4481 |
+
|
4482 |
+
// Reset scalex/scaleY values; this helps for perfomance and does not break animation
|
4483 |
+
$.fancybox.setTranslate(self.$content, reset);
|
4484 |
+
|
4485 |
+
if (newWidth < self.canvasWidth && newHeight < self.canvasHeight) {
|
4486 |
+
self.instance.scaleToFit(150);
|
4487 |
+
} else if (newWidth > current.width || newHeight > current.height) {
|
4488 |
+
self.instance.scaleToActual(self.centerPointStartX, self.centerPointStartY, 150);
|
4489 |
+
} else {
|
4490 |
+
newPos = self.limitPosition(newOffsetX, newOffsetY, newWidth, newHeight);
|
4491 |
+
|
4492 |
+
$.fancybox.animate(self.$content, newPos, 150);
|
4493 |
+
}
|
4494 |
+
};
|
4495 |
+
|
4496 |
+
Guestures.prototype.onTap = function(e) {
|
4497 |
+
var self = this;
|
4498 |
+
var $target = $(e.target);
|
4499 |
+
|
4500 |
+
var instance = self.instance;
|
4501 |
+
var current = instance.current;
|
4502 |
+
|
4503 |
+
var endPoints = (e && getPointerXY(e)) || self.startPoints;
|
4504 |
+
|
4505 |
+
var tapX = endPoints[0] ? endPoints[0].x - $(window).scrollLeft() - self.stagePos.left : 0;
|
4506 |
+
var tapY = endPoints[0] ? endPoints[0].y - $(window).scrollTop() - self.stagePos.top : 0;
|
4507 |
+
|
4508 |
+
var where;
|
4509 |
+
|
4510 |
+
var process = function(prefix) {
|
4511 |
+
var action = current.opts[prefix];
|
4512 |
+
|
4513 |
+
if ($.isFunction(action)) {
|
4514 |
+
action = action.apply(instance, [current, e]);
|
4515 |
+
}
|
4516 |
+
|
4517 |
+
if (!action) {
|
4518 |
+
return;
|
4519 |
+
}
|
4520 |
+
|
4521 |
+
switch (action) {
|
4522 |
+
case "close":
|
4523 |
+
instance.close(self.startEvent);
|
4524 |
+
|
4525 |
+
break;
|
4526 |
+
|
4527 |
+
case "toggleControls":
|
4528 |
+
instance.toggleControls();
|
4529 |
+
|
4530 |
+
break;
|
4531 |
+
|
4532 |
+
case "next":
|
4533 |
+
instance.next();
|
4534 |
+
|
4535 |
+
break;
|
4536 |
+
|
4537 |
+
case "nextOrClose":
|
4538 |
+
if (instance.group.length > 1) {
|
4539 |
+
instance.next();
|
4540 |
+
} else {
|
4541 |
+
instance.close(self.startEvent);
|
4542 |
+
}
|
4543 |
+
|
4544 |
+
break;
|
4545 |
+
|
4546 |
+
case "zoom":
|
4547 |
+
if (current.type == "image" && (current.isLoaded || current.$ghost)) {
|
4548 |
+
if (instance.canPan()) {
|
4549 |
+
instance.scaleToFit();
|
4550 |
+
} else if (instance.isScaledDown()) {
|
4551 |
+
instance.scaleToActual(tapX, tapY);
|
4552 |
+
} else if (instance.group.length < 2) {
|
4553 |
+
instance.close(self.startEvent);
|
4554 |
+
}
|
4555 |
+
}
|
4556 |
+
|
4557 |
+
break;
|
4558 |
+
}
|
4559 |
+
};
|
4560 |
+
|
4561 |
+
// Ignore right click
|
4562 |
+
if (e.originalEvent && e.originalEvent.button == 2) {
|
4563 |
+
return;
|
4564 |
+
}
|
4565 |
+
|
4566 |
+
// Skip if clicked on the scrollbar
|
4567 |
+
if (!$target.is("img") && tapX > $target[0].clientWidth + $target.offset().left) {
|
4568 |
+
return;
|
4569 |
+
}
|
4570 |
+
|
4571 |
+
// Check where is clicked
|
4572 |
+
if ($target.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container")) {
|
4573 |
+
where = "Outside";
|
4574 |
+
} else if ($target.is(".fancybox-slide")) {
|
4575 |
+
where = "Slide";
|
4576 |
+
} else if (
|
4577 |
+
instance.current.$content &&
|
4578 |
+
instance.current.$content
|
4579 |
+
.find($target)
|
4580 |
+
.addBack()
|
4581 |
+
.filter($target).length
|
4582 |
+
) {
|
4583 |
+
where = "Content";
|
4584 |
+
} else {
|
4585 |
+
return;
|
4586 |
+
}
|
4587 |
+
|
4588 |
+
// Check if this is a double tap
|
4589 |
+
if (self.tapped) {
|
4590 |
+
// Stop previously created single tap
|
4591 |
+
clearTimeout(self.tapped);
|
4592 |
+
self.tapped = null;
|
4593 |
+
|
4594 |
+
// Skip if distance between taps is too big
|
4595 |
+
if (Math.abs(tapX - self.tapX) > 50 || Math.abs(tapY - self.tapY) > 50) {
|
4596 |
+
return this;
|
4597 |
+
}
|
4598 |
+
|
4599 |
+
// OK, now we assume that this is a double-tap
|
4600 |
+
process("dblclick" + where);
|
4601 |
+
} else {
|
4602 |
+
// Single tap will be processed if user has not clicked second time within 300ms
|
4603 |
+
// or there is no need to wait for double-tap
|
4604 |
+
self.tapX = tapX;
|
4605 |
+
self.tapY = tapY;
|
4606 |
+
|
4607 |
+
if (current.opts["dblclick" + where] && current.opts["dblclick" + where] !== current.opts["click" + where]) {
|
4608 |
+
self.tapped = setTimeout(function() {
|
4609 |
+
self.tapped = null;
|
4610 |
+
|
4611 |
+
if (!instance.isAnimating) {
|
4612 |
+
process("click" + where);
|
4613 |
+
}
|
4614 |
+
}, 500);
|
4615 |
+
} else {
|
4616 |
+
process("click" + where);
|
4617 |
+
}
|
4618 |
+
}
|
4619 |
+
|
4620 |
+
return this;
|
4621 |
+
};
|
4622 |
+
|
4623 |
+
$(document)
|
4624 |
+
.on("onActivate.fb", function(e, instance) {
|
4625 |
+
if (instance && !instance.Guestures) {
|
4626 |
+
instance.Guestures = new Guestures(instance);
|
4627 |
+
}
|
4628 |
+
})
|
4629 |
+
.on("beforeClose.fb", function(e, instance) {
|
4630 |
+
if (instance && instance.Guestures) {
|
4631 |
+
instance.Guestures.destroy();
|
4632 |
+
}
|
4633 |
+
});
|
4634 |
+
})(window, document, jQuery);
|
4635 |
+
|
4636 |
+
// ==========================================================================
|
4637 |
+
//
|
4638 |
+
// SlideShow
|
4639 |
+
// Enables slideshow functionality
|
4640 |
+
//
|
4641 |
+
// Example of usage:
|
4642 |
+
// $.fancybox.getInstance().SlideShow.start()
|
4643 |
+
//
|
4644 |
+
// ==========================================================================
|
4645 |
+
(function(document, $) {
|
4646 |
+
"use strict";
|
4647 |
+
|
4648 |
+
$.extend(true, $.fancybox.defaults, {
|
4649 |
+
btnTpl: {
|
4650 |
+
slideShow:
|
4651 |
+
'<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}">' +
|
4652 |
+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 5.4v13.2l11-6.6z"/></svg>' +
|
4653 |
+
'<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>' +
|
4654 |
+
"</button>"
|
4655 |
+
},
|
4656 |
+
slideShow: {
|
4657 |
+
autoStart: false,
|
4658 |
+
speed: 3000,
|
4659 |
+
progress: true
|
4660 |
+
}
|
4661 |
+
});
|
4662 |
+
|
4663 |
+
var SlideShow = function(instance) {
|
4664 |
+
this.instance = instance;
|
4665 |
+
this.init();
|
4666 |
+
};
|
4667 |
+
|
4668 |
+
$.extend(SlideShow.prototype, {
|
4669 |
+
timer: null,
|
4670 |
+
isActive: false,
|
4671 |
+
$button: null,
|
4672 |
+
|
4673 |
+
init: function() {
|
4674 |
+
var self = this,
|
4675 |
+
instance = self.instance,
|
4676 |
+
opts = instance.group[instance.currIndex].opts.slideShow;
|
4677 |
+
|
4678 |
+
self.$button = instance.$refs.toolbar.find("[data-fancybox-play]").on("click", function() {
|
4679 |
+
self.toggle();
|
4680 |
+
});
|
4681 |
+
|
4682 |
+
if (instance.group.length < 2 || !opts) {
|
4683 |
+
self.$button.hide();
|
4684 |
+
} else if (opts.progress) {
|
4685 |
+
self.$progress = $('<div class="fancybox-progress"></div>').appendTo(instance.$refs.inner);
|
4686 |
+
}
|
4687 |
+
},
|
4688 |
+
|
4689 |
+
set: function(force) {
|
4690 |
+
var self = this,
|
4691 |
+
instance = self.instance,
|
4692 |
+
current = instance.current;
|
4693 |
+
|
4694 |
+
// Check if reached last element
|
4695 |
+
if (current && (force === true || current.opts.loop || instance.currIndex < instance.group.length - 1)) {
|
4696 |
+
if (self.isActive && current.contentType !== "video") {
|
4697 |
+
if (self.$progress) {
|
4698 |
+
$.fancybox.animate(self.$progress.show(), {scaleX: 1}, current.opts.slideShow.speed);
|
4699 |
+
}
|
4700 |
+
|
4701 |
+
self.timer = setTimeout(function() {
|
4702 |
+
if (!instance.current.opts.loop && instance.current.index == instance.group.length - 1) {
|
4703 |
+
instance.jumpTo(0);
|
4704 |
+
} else {
|
4705 |
+
instance.next();
|
4706 |
+
}
|
4707 |
+
}, current.opts.slideShow.speed);
|
4708 |
+
}
|
4709 |
+
} else {
|
4710 |
+
self.stop();
|
4711 |
+
instance.idleSecondsCounter = 0;
|
4712 |
+
instance.showControls();
|
4713 |
+
}
|
4714 |
+
},
|
4715 |
+
|
4716 |
+
clear: function() {
|
4717 |
+
var self = this;
|
4718 |
+
|
4719 |
+
clearTimeout(self.timer);
|
4720 |
+
|
4721 |
+
self.timer = null;
|
4722 |
+
|
4723 |
+
if (self.$progress) {
|
4724 |
+
self.$progress.removeAttr("style").hide();
|
4725 |
+
}
|
4726 |
+
},
|
4727 |
+
|
4728 |
+
start: function() {
|
4729 |
+
var self = this,
|
4730 |
+
current = self.instance.current;
|
4731 |
+
|
4732 |
+
if (current) {
|
4733 |
+
self.$button
|
4734 |
+
.attr("title", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_STOP)
|
4735 |
+
.removeClass("fancybox-button--play")
|
4736 |
+
.addClass("fancybox-button--pause");
|
4737 |
+
|
4738 |
+
self.isActive = true;
|
4739 |
+
|
4740 |
+
if (current.isComplete) {
|
4741 |
+
self.set(true);
|
4742 |
+
}
|
4743 |
+
|
4744 |
+
self.instance.trigger("onSlideShowChange", true);
|
4745 |
+
}
|
4746 |
+
},
|
4747 |
+
|
4748 |
+
stop: function() {
|
4749 |
+
var self = this,
|
4750 |
+
current = self.instance.current;
|
4751 |
+
|
4752 |
+
self.clear();
|
4753 |
+
|
4754 |
+
self.$button
|
4755 |
+
.attr("title", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_START)
|
4756 |
+
.removeClass("fancybox-button--pause")
|
4757 |
+
.addClass("fancybox-button--play");
|
4758 |
+
|
4759 |
+
self.isActive = false;
|
4760 |
+
|
4761 |
+
self.instance.trigger("onSlideShowChange", false);
|
4762 |
+
|
4763 |
+
if (self.$progress) {
|
4764 |
+
self.$progress.removeAttr("style").hide();
|
4765 |
+
}
|
4766 |
+
},
|
4767 |
+
|
4768 |
+
toggle: function() {
|
4769 |
+
var self = this;
|
4770 |
+
|
4771 |
+
if (self.isActive) {
|
4772 |
+
self.stop();
|
4773 |
+
} else {
|
4774 |
+
self.start();
|
4775 |
+
}
|
4776 |
+
}
|
4777 |
+
});
|
4778 |
+
|
4779 |
+
$(document).on({
|
4780 |
+
"onInit.fb": function(e, instance) {
|
4781 |
+
if (instance && !instance.SlideShow) {
|
4782 |
+
instance.SlideShow = new SlideShow(instance);
|
4783 |
+
}
|
4784 |
+
},
|
4785 |
+
|
4786 |
+
"beforeShow.fb": function(e, instance, current, firstRun) {
|
4787 |
+
var SlideShow = instance && instance.SlideShow;
|
4788 |
+
|
4789 |
+
if (firstRun) {
|
4790 |
+
if (SlideShow && current.opts.slideShow.autoStart) {
|
4791 |
+
SlideShow.start();
|
4792 |
+
}
|
4793 |
+
} else if (SlideShow && SlideShow.isActive) {
|
4794 |
+
SlideShow.clear();
|
4795 |
+
}
|
4796 |
+
},
|
4797 |
+
|
4798 |
+
"afterShow.fb": function(e, instance, current) {
|
4799 |
+
var SlideShow = instance && instance.SlideShow;
|
4800 |
+
|
4801 |
+
if (SlideShow && SlideShow.isActive) {
|
4802 |
+
SlideShow.set();
|
4803 |
+
}
|
4804 |
+
},
|
4805 |
+
|
4806 |
+
"afterKeydown.fb": function(e, instance, current, keypress, keycode) {
|
4807 |
+
var SlideShow = instance && instance.SlideShow;
|
4808 |
+
|
4809 |
+
// "P" or Spacebar
|
4810 |
+
if (SlideShow && current.opts.slideShow && (keycode === 80 || keycode === 32) && !$(document.activeElement).is("button,a,input")) {
|
4811 |
+
keypress.preventDefault();
|
4812 |
+
|
4813 |
+
SlideShow.toggle();
|
4814 |
+
}
|
4815 |
+
},
|
4816 |
+
|
4817 |
+
"beforeClose.fb onDeactivate.fb": function(e, instance) {
|
4818 |
+
var SlideShow = instance && instance.SlideShow;
|
4819 |
+
|
4820 |
+
if (SlideShow) {
|
4821 |
+
SlideShow.stop();
|
4822 |
+
}
|
4823 |
+
}
|
4824 |
+
});
|
4825 |
+
|
4826 |
+
// Page Visibility API to pause slideshow when window is not active
|
4827 |
+
$(document).on("visibilitychange", function() {
|
4828 |
+
var instance = $.fancybox.getInstance(),
|
4829 |
+
SlideShow = instance && instance.SlideShow;
|
4830 |
+
|
4831 |
+
if (SlideShow && SlideShow.isActive) {
|
4832 |
+
if (document.hidden) {
|
4833 |
+
SlideShow.clear();
|
4834 |
+
} else {
|
4835 |
+
SlideShow.set();
|
4836 |
+
}
|
4837 |
+
}
|
4838 |
+
});
|
4839 |
+
})(document, jQuery);
|
4840 |
+
|
4841 |
+
// ==========================================================================
|
4842 |
+
//
|
4843 |
+
// FullScreen
|
4844 |
+
// Adds fullscreen functionality
|
4845 |
+
//
|
4846 |
+
// ==========================================================================
|
4847 |
+
(function(document, $) {
|
4848 |
+
"use strict";
|
4849 |
+
|
4850 |
+
// Collection of methods supported by user browser
|
4851 |
+
var fn = (function() {
|
4852 |
+
var fnMap = [
|
4853 |
+
["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"],
|
4854 |
+
// new WebKit
|
4855 |
+
[
|
4856 |
+
"webkitRequestFullscreen",
|
4857 |
+
"webkitExitFullscreen",
|
4858 |
+
"webkitFullscreenElement",
|
4859 |
+
"webkitFullscreenEnabled",
|
4860 |
+
"webkitfullscreenchange",
|
4861 |
+
"webkitfullscreenerror"
|
4862 |
+
],
|
4863 |
+
// old WebKit (Safari 5.1)
|
4864 |
+
[
|
4865 |
+
"webkitRequestFullScreen",
|
4866 |
+
"webkitCancelFullScreen",
|
4867 |
+
"webkitCurrentFullScreenElement",
|
4868 |
+
"webkitCancelFullScreen",
|
4869 |
+
"webkitfullscreenchange",
|
4870 |
+
"webkitfullscreenerror"
|
4871 |
+
],
|
4872 |
+
[
|
4873 |
+
"mozRequestFullScreen",
|
4874 |
+
"mozCancelFullScreen",
|
4875 |
+
"mozFullScreenElement",
|
4876 |
+
"mozFullScreenEnabled",
|
4877 |
+
"mozfullscreenchange",
|
4878 |
+
"mozfullscreenerror"
|
4879 |
+
],
|
4880 |
+
["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError"]
|
4881 |
+
];
|
4882 |
+
|
4883 |
+
var ret = {};
|
4884 |
+
|
4885 |
+
for (var i = 0; i < fnMap.length; i++) {
|
4886 |
+
var val = fnMap[i];
|
4887 |
+
|
4888 |
+
if (val && val[1] in document) {
|
4889 |
+
for (var j = 0; j < val.length; j++) {
|
4890 |
+
ret[fnMap[0][j]] = val[j];
|
4891 |
+
}
|
4892 |
+
|
4893 |
+
return ret;
|
4894 |
+
}
|
4895 |
+
}
|
4896 |
+
|
4897 |
+
return false;
|
4898 |
+
})();
|
4899 |
+
|
4900 |
+
if (fn) {
|
4901 |
+
var FullScreen = {
|
4902 |
+
request: function(elem) {
|
4903 |
+
elem = elem || document.documentElement;
|
4904 |
+
|
4905 |
+
elem[fn.requestFullscreen](elem.ALLOW_KEYBOARD_INPUT);
|
4906 |
+
},
|
4907 |
+
exit: function() {
|
4908 |
+
document[fn.exitFullscreen]();
|
4909 |
+
},
|
4910 |
+
toggle: function(elem) {
|
4911 |
+
elem = elem || document.documentElement;
|
4912 |
+
|
4913 |
+
if (this.isFullscreen()) {
|
4914 |
+
this.exit();
|
4915 |
+
} else {
|
4916 |
+
this.request(elem);
|
4917 |
+
}
|
4918 |
+
},
|
4919 |
+
isFullscreen: function() {
|
4920 |
+
return Boolean(document[fn.fullscreenElement]);
|
4921 |
+
},
|
4922 |
+
enabled: function() {
|
4923 |
+
return Boolean(document[fn.fullscreenEnabled]);
|
4924 |
+
}
|
4925 |
+
};
|
4926 |
+
|
4927 |
+
$.extend(true, $.fancybox.defaults, {
|
4928 |
+
btnTpl: {
|
4929 |
+
fullScreen:
|
4930 |
+
'<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}">' +
|
4931 |
+
'<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>' +
|
4932 |
+
'<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>' +
|
4933 |
+
"</button>"
|
4934 |
+
},
|
4935 |
+
fullScreen: {
|
4936 |
+
autoStart: false
|
4937 |
+
}
|
4938 |
+
});
|
4939 |
+
|
4940 |
+
$(document).on(fn.fullscreenchange, function() {
|
4941 |
+
var isFullscreen = FullScreen.isFullscreen(),
|
4942 |
+
instance = $.fancybox.getInstance();
|
4943 |
+
|
4944 |
+
if (instance) {
|
4945 |
+
// If image is zooming, then force to stop and reposition properly
|
4946 |
+
if (instance.current && instance.current.type === "image" && instance.isAnimating) {
|
4947 |
+
instance.current.$content.css("transition", "none");
|
4948 |
+
|
4949 |
+
instance.isAnimating = false;
|
4950 |
+
|
4951 |
+
instance.update(true, true, 0);
|
4952 |
+
}
|
4953 |
+
|
4954 |
+
instance.trigger("onFullscreenChange", isFullscreen);
|
4955 |
+
|
4956 |
+
instance.$refs.container.toggleClass("fancybox-is-fullscreen", isFullscreen);
|
4957 |
+
|
4958 |
+
instance.$refs.toolbar
|
4959 |
+
.find("[data-fancybox-fullscreen]")
|
4960 |
+
.toggleClass("fancybox-button--fsenter", !isFullscreen)
|
4961 |
+
.toggleClass("fancybox-button--fsexit", isFullscreen);
|
4962 |
+
}
|
4963 |
+
});
|
4964 |
+
}
|
4965 |
+
|
4966 |
+
$(document).on({
|
4967 |
+
"onInit.fb": function(e, instance) {
|
4968 |
+
var $container;
|
4969 |
+
|
4970 |
+
if (!fn) {
|
4971 |
+
instance.$refs.toolbar.find("[data-fancybox-fullscreen]").remove();
|
4972 |
+
|
4973 |
+
return;
|
4974 |
+
}
|
4975 |
+
|
4976 |
+
if (instance && instance.group[instance.currIndex].opts.fullScreen) {
|
4977 |
+
$container = instance.$refs.container;
|
4978 |
+
|
4979 |
+
$container.on("click.fb-fullscreen", "[data-fancybox-fullscreen]", function(e) {
|
4980 |
+
e.stopPropagation();
|
4981 |
+
e.preventDefault();
|
4982 |
+
|
4983 |
+
FullScreen.toggle();
|
4984 |
+
});
|
4985 |
+
|
4986 |
+
if (instance.opts.fullScreen && instance.opts.fullScreen.autoStart === true) {
|
4987 |
+
FullScreen.request();
|
4988 |
+
}
|
4989 |
+
|
4990 |
+
// Expose API
|
4991 |
+
instance.FullScreen = FullScreen;
|
4992 |
+
} else if (instance) {
|
4993 |
+
instance.$refs.toolbar.find("[data-fancybox-fullscreen]").hide();
|
4994 |
+
}
|
4995 |
+
},
|
4996 |
+
|
4997 |
+
"afterKeydown.fb": function(e, instance, current, keypress, keycode) {
|
4998 |
+
// "F"
|
4999 |
+
if (instance && instance.FullScreen && keycode === 70) {
|
5000 |
+
keypress.preventDefault();
|
5001 |
+
|
5002 |
+
instance.FullScreen.toggle();
|
5003 |
+
}
|
5004 |
+
},
|
5005 |
+
|
5006 |
+
"beforeClose.fb": function(e, instance) {
|
5007 |
+
if (instance && instance.FullScreen && instance.$refs.container.hasClass("fancybox-is-fullscreen")) {
|
5008 |
+
FullScreen.exit();
|
5009 |
+
}
|
5010 |
+
}
|
5011 |
+
});
|
5012 |
+
})(document, jQuery);
|
5013 |
+
|
5014 |
+
// ==========================================================================
|
5015 |
+
//
|
5016 |
+
// Thumbs
|
5017 |
+
// Displays thumbnails in a grid
|
5018 |
+
//
|
5019 |
+
// ==========================================================================
|
5020 |
+
(function(document, $) {
|
5021 |
+
"use strict";
|
5022 |
+
|
5023 |
+
var CLASS = "fancybox-thumbs",
|
5024 |
+
CLASS_ACTIVE = CLASS + "-active";
|
5025 |
+
|
5026 |
+
// Make sure there are default values
|
5027 |
+
$.fancybox.defaults = $.extend(
|
5028 |
+
true,
|
5029 |
+
{
|
5030 |
+
btnTpl: {
|
5031 |
+
thumbs:
|
5032 |
+
'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}">' +
|
5033 |
+
'<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>' +
|
5034 |
+
"</button>"
|
5035 |
+
},
|
5036 |
+
thumbs: {
|
5037 |
+
autoStart: false, // Display thumbnails on opening
|
5038 |
+
hideOnClose: true, // Hide thumbnail grid when closing animation starts
|
5039 |
+
parentEl: ".fancybox-container", // Container is injected into this element
|
5040 |
+
axis: "y" // Vertical (y) or horizontal (x) scrolling
|
5041 |
+
}
|
5042 |
+
},
|
5043 |
+
$.fancybox.defaults
|
5044 |
+
);
|
5045 |
+
|
5046 |
+
var FancyThumbs = function(instance) {
|
5047 |
+
this.init(instance);
|
5048 |
+
};
|
5049 |
+
|
5050 |
+
$.extend(FancyThumbs.prototype, {
|
5051 |
+
$button: null,
|
5052 |
+
$grid: null,
|
5053 |
+
$list: null,
|
5054 |
+
isVisible: false,
|
5055 |
+
isActive: false,
|
5056 |
+
|
5057 |
+
init: function(instance) {
|
5058 |
+
var self = this,
|
5059 |
+
group = instance.group,
|
5060 |
+
enabled = 0;
|
5061 |
+
|
5062 |
+
self.instance = instance;
|
5063 |
+
self.opts = group[instance.currIndex].opts.thumbs;
|
5064 |
+
|
5065 |
+
instance.Thumbs = self;
|
5066 |
+
|
5067 |
+
self.$button = instance.$refs.toolbar.find("[data-fancybox-thumbs]");
|
5068 |
+
|
5069 |
+
// Enable thumbs if at least two group items have thumbnails
|
5070 |
+
for (var i = 0, len = group.length; i < len; i++) {
|
5071 |
+
if (group[i].thumb) {
|
5072 |
+
enabled++;
|
5073 |
+
}
|
5074 |
+
|
5075 |
+
if (enabled > 1) {
|
5076 |
+
break;
|
5077 |
+
}
|
5078 |
+
}
|
5079 |
+
|
5080 |
+
if (enabled > 1 && !!self.opts) {
|
5081 |
+
self.$button.removeAttr("style").on("click", function() {
|
5082 |
+
self.toggle();
|
5083 |
+
});
|
5084 |
+
|
5085 |
+
self.isActive = true;
|
5086 |
+
} else {
|
5087 |
+
self.$button.hide();
|
5088 |
+
}
|
5089 |
+
},
|
5090 |
+
|
5091 |
+
create: function() {
|
5092 |
+
var self = this,
|
5093 |
+
instance = self.instance,
|
5094 |
+
parentEl = self.opts.parentEl,
|
5095 |
+
list = [],
|
5096 |
+
src;
|
5097 |
+
|
5098 |
+
if (!self.$grid) {
|
5099 |
+
// Create main element
|
5100 |
+
self.$grid = $('<div class="' + CLASS + " " + CLASS + "-" + self.opts.axis + '"></div>').appendTo(
|
5101 |
+
instance.$refs.container
|
5102 |
+
.find(parentEl)
|
5103 |
+
.addBack()
|
5104 |
+
.filter(parentEl)
|
5105 |
+
);
|
5106 |
+
|
5107 |
+
// Add "click" event that performs gallery navigation
|
5108 |
+
self.$grid.on("click", "a", function() {
|
5109 |
+
instance.jumpTo($(this).attr("data-index"));
|
5110 |
+
});
|
5111 |
+
}
|
5112 |
+
|
5113 |
+
// Build the list
|
5114 |
+
if (!self.$list) {
|
5115 |
+
self.$list = $('<div class="' + CLASS + '__list">').appendTo(self.$grid);
|
5116 |
+
}
|
5117 |
+
|
5118 |
+
$.each(instance.group, function(i, item) {
|
5119 |
+
src = item.thumb;
|
5120 |
+
|
5121 |
+
if (!src && item.type === "image") {
|
5122 |
+
src = item.src;
|
5123 |
+
}
|
5124 |
+
|
5125 |
+
list.push(
|
5126 |
+
'<a href="javascript:;" tabindex="0" data-index="' +
|
5127 |
+
i +
|
5128 |
+
'"' +
|
5129 |
+
(src && src.length ? ' style="background-image:url(' + src + ')"' : 'class="fancybox-thumbs-missing"') +
|
5130 |
+
"></a>"
|
5131 |
+
);
|
5132 |
+
});
|
5133 |
+
|
5134 |
+
self.$list[0].innerHTML = list.join("");
|
5135 |
+
|
5136 |
+
if (self.opts.axis === "x") {
|
5137 |
+
// Set fixed width for list element to enable horizontal scrolling
|
5138 |
+
self.$list.width(
|
5139 |
+
parseInt(self.$grid.css("padding-right"), 10) +
|
5140 |
+
instance.group.length *
|
5141 |
+
self.$list
|
5142 |
+
.children()
|
5143 |
+
.eq(0)
|
5144 |
+
.outerWidth(true)
|
5145 |
+
);
|
5146 |
+
}
|
5147 |
+
},
|
5148 |
+
|
5149 |
+
focus: function(duration) {
|
5150 |
+
var self = this,
|
5151 |
+
$list = self.$list,
|
5152 |
+
$grid = self.$grid,
|
5153 |
+
thumb,
|
5154 |
+
thumbPos;
|
5155 |
+
|
5156 |
+
if (!self.instance.current) {
|
5157 |
+
return;
|
5158 |
+
}
|
5159 |
+
|
5160 |
+
thumb = $list
|
5161 |
+
.children()
|
5162 |
+
.removeClass(CLASS_ACTIVE)
|
5163 |
+
.filter('[data-index="' + self.instance.current.index + '"]')
|
5164 |
+
.addClass(CLASS_ACTIVE);
|
5165 |
+
|
5166 |
+
thumbPos = thumb.position();
|
5167 |
+
|
5168 |
+
// Check if need to scroll to make current thumb visible
|
5169 |
+
if (self.opts.axis === "y" && (thumbPos.top < 0 || thumbPos.top > $list.height() - thumb.outerHeight())) {
|
5170 |
+
$list.stop().animate(
|
5171 |
+
{
|
5172 |
+
scrollTop: $list.scrollTop() + thumbPos.top
|
5173 |
+
},
|
5174 |
+
duration
|
5175 |
+
);
|
5176 |
+
} else if (
|
5177 |
+
self.opts.axis === "x" &&
|
5178 |
+
(thumbPos.left < $grid.scrollLeft() || thumbPos.left > $grid.scrollLeft() + ($grid.width() - thumb.outerWidth()))
|
5179 |
+
) {
|
5180 |
+
$list
|
5181 |
+
.parent()
|
5182 |
+
.stop()
|
5183 |
+
.animate(
|
5184 |
+
{
|
5185 |
+
scrollLeft: thumbPos.left
|
5186 |
+
},
|
5187 |
+
duration
|
5188 |
+
);
|
5189 |
+
}
|
5190 |
+
},
|
5191 |
+
|
5192 |
+
update: function() {
|
5193 |
+
var that = this;
|
5194 |
+
that.instance.$refs.container.toggleClass("fancybox-show-thumbs", this.isVisible);
|
5195 |
+
|
5196 |
+
if (that.isVisible) {
|
5197 |
+
if (!that.$grid) {
|
5198 |
+
that.create();
|
5199 |
+
}
|
5200 |
+
|
5201 |
+
that.instance.trigger("onThumbsShow");
|
5202 |
+
|
5203 |
+
that.focus(0);
|
5204 |
+
} else if (that.$grid) {
|
5205 |
+
that.instance.trigger("onThumbsHide");
|
5206 |
+
}
|
5207 |
+
|
5208 |
+
// Update content position
|
5209 |
+
that.instance.update();
|
5210 |
+
},
|
5211 |
+
|
5212 |
+
hide: function() {
|
5213 |
+
this.isVisible = false;
|
5214 |
+
this.update();
|
5215 |
+
},
|
5216 |
+
|
5217 |
+
show: function() {
|
5218 |
+
this.isVisible = true;
|
5219 |
+
this.update();
|
5220 |
+
},
|
5221 |
+
|
5222 |
+
toggle: function() {
|
5223 |
+
this.isVisible = !this.isVisible;
|
5224 |
+
this.update();
|
5225 |
+
}
|
5226 |
+
});
|
5227 |
+
|
5228 |
+
$(document).on({
|
5229 |
+
"onInit.fb": function(e, instance) {
|
5230 |
+
var Thumbs;
|
5231 |
+
|
5232 |
+
if (instance && !instance.Thumbs) {
|
5233 |
+
Thumbs = new FancyThumbs(instance);
|
5234 |
+
|
5235 |
+
if (Thumbs.isActive && Thumbs.opts.autoStart === true) {
|
5236 |
+
Thumbs.show();
|
5237 |
+
}
|
5238 |
+
}
|
5239 |
+
},
|
5240 |
+
|
5241 |
+
"beforeShow.fb": function(e, instance, item, firstRun) {
|
5242 |
+
var Thumbs = instance && instance.Thumbs;
|
5243 |
+
|
5244 |
+
if (Thumbs && Thumbs.isVisible) {
|
5245 |
+
Thumbs.focus(firstRun ? 0 : 250);
|
5246 |
+
}
|
5247 |
+
},
|
5248 |
+
|
5249 |
+
"afterKeydown.fb": function(e, instance, current, keypress, keycode) {
|
5250 |
+
var Thumbs = instance && instance.Thumbs;
|
5251 |
+
|
5252 |
+
// "G"
|
5253 |
+
if (Thumbs && Thumbs.isActive && keycode === 71) {
|
5254 |
+
keypress.preventDefault();
|
5255 |
+
|
5256 |
+
Thumbs.toggle();
|
5257 |
+
}
|
5258 |
+
},
|
5259 |
+
|
5260 |
+
"beforeClose.fb": function(e, instance) {
|
5261 |
+
var Thumbs = instance && instance.Thumbs;
|
5262 |
+
|
5263 |
+
if (Thumbs && Thumbs.isVisible && Thumbs.opts.hideOnClose !== false) {
|
5264 |
+
Thumbs.$grid.hide();
|
5265 |
+
}
|
5266 |
+
}
|
5267 |
+
});
|
5268 |
+
})(document, jQuery);
|
5269 |
+
|
5270 |
+
//// ==========================================================================
|
5271 |
+
//
|
5272 |
+
// Share
|
5273 |
+
// Displays simple form for sharing current url
|
5274 |
+
//
|
5275 |
+
// ==========================================================================
|
5276 |
+
(function(document, $) {
|
5277 |
+
"use strict";
|
5278 |
+
|
5279 |
+
$.extend(true, $.fancybox.defaults, {
|
5280 |
+
btnTpl: {
|
5281 |
+
share:
|
5282 |
+
'<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}">' +
|
5283 |
+
'<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>' +
|
5284 |
+
"</button>"
|
5285 |
+
},
|
5286 |
+
share: {
|
5287 |
+
url: function(instance, item) {
|
5288 |
+
return (
|
5289 |
+
(!instance.currentHash && !(item.type === "inline" || item.type === "html") ? item.origSrc || item.src : false) || window.location
|
5290 |
+
);
|
5291 |
+
},
|
5292 |
+
tpl:
|
5293 |
+
'<div class="fancybox-share">' +
|
5294 |
+
"<h1>{{SHARE}}</h1>" +
|
5295 |
+
"<p>" +
|
5296 |
+
'<a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}">' +
|
5297 |
+
'<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>' +
|
5298 |
+
"<span>Facebook</span>" +
|
5299 |
+
"</a>" +
|
5300 |
+
'<a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}">' +
|
5301 |
+
'<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>' +
|
5302 |
+
"<span>Twitter</span>" +
|
5303 |
+
"</a>" +
|
5304 |
+
'<a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}">' +
|
5305 |
+
'<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>' +
|
5306 |
+
"<span>Pinterest</span>" +
|
5307 |
+
"</a>" +
|
5308 |
+
"</p>" +
|
5309 |
+
'<p><input class="fancybox-share__input" type="text" value="{{url_raw}}" onclick="select()" /></p>' +
|
5310 |
+
"</div>"
|
5311 |
+
}
|
5312 |
+
});
|
5313 |
+
|
5314 |
+
function escapeHtml(string) {
|
5315 |
+
var entityMap = {
|
5316 |
+
"&": "&",
|
5317 |
+
"<": "<",
|
5318 |
+
">": ">",
|
5319 |
+
'"': """,
|
5320 |
+
"'": "'",
|
5321 |
+
"/": "/",
|
5322 |
+
"`": "`",
|
5323 |
+
"=": "="
|
5324 |
+
};
|
5325 |
+
|
5326 |
+
return String(string).replace(/[&<>"'`=\/]/g, function(s) {
|
5327 |
+
return entityMap[s];
|
5328 |
+
});
|
5329 |
+
}
|
5330 |
+
|
5331 |
+
$(document).on("click", "[data-fancybox-share]", function() {
|
5332 |
+
var instance = $.fancybox.getInstance(),
|
5333 |
+
current = instance.current || null,
|
5334 |
+
url,
|
5335 |
+
tpl;
|
5336 |
+
|
5337 |
+
if (!current) {
|
5338 |
+
return;
|
5339 |
+
}
|
5340 |
+
|
5341 |
+
if ($.type(current.opts.share.url) === "function") {
|
5342 |
+
url = current.opts.share.url.apply(current, [instance, current]);
|
5343 |
+
}
|
5344 |
+
|
5345 |
+
tpl = current.opts.share.tpl
|
5346 |
+
.replace(/\{\{media\}\}/g, current.type === "image" ? encodeURIComponent(current.src) : "")
|
5347 |
+
.replace(/\{\{url\}\}/g, encodeURIComponent(url))
|
5348 |
+
.replace(/\{\{url_raw\}\}/g, escapeHtml(url))
|
5349 |
+
.replace(/\{\{descr\}\}/g, instance.$caption ? encodeURIComponent(instance.$caption.text()) : "");
|
5350 |
+
|
5351 |
+
$.fancybox.open({
|
5352 |
+
src: instance.translate(instance, tpl),
|
5353 |
+
type: "html",
|
5354 |
+
opts: {
|
5355 |
+
touch: false,
|
5356 |
+
animationEffect: false,
|
5357 |
+
afterLoad: function(shareInstance, shareCurrent) {
|
5358 |
+
// Close self if parent instance is closing
|
5359 |
+
instance.$refs.container.one("beforeClose.fb", function() {
|
5360 |
+
shareInstance.close(null, 0);
|
5361 |
+
});
|
5362 |
+
|
5363 |
+
// Opening links in a popup window
|
5364 |
+
shareCurrent.$content.find(".fancybox-share__button").click(function() {
|
5365 |
+
window.open(this.href, "Share", "width=550, height=450");
|
5366 |
+
return false;
|
5367 |
+
});
|
5368 |
+
},
|
5369 |
+
mobile: {
|
5370 |
+
autoFocus: false
|
5371 |
+
}
|
5372 |
+
}
|
5373 |
+
});
|
5374 |
+
});
|
5375 |
+
})(document, jQuery);
|
5376 |
+
|
5377 |
+
// ==========================================================================
|
5378 |
+
//
|
5379 |
+
// Hash
|
5380 |
+
// Enables linking to each modal
|
5381 |
+
//
|
5382 |
+
// ==========================================================================
|
5383 |
+
(function(window, document, $) {
|
5384 |
+
"use strict";
|
5385 |
+
|
5386 |
+
// Simple $.escapeSelector polyfill (for jQuery prior v3)
|
5387 |
+
if (!$.escapeSelector) {
|
5388 |
+
$.escapeSelector = function(sel) {
|
5389 |
+
var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
|
5390 |
+
var fcssescape = function(ch, asCodePoint) {
|
5391 |
+
if (asCodePoint) {
|
5392 |
+
// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
|
5393 |
+
if (ch === "\0") {
|
5394 |
+
return "\uFFFD";
|
5395 |
+
}
|
5396 |
+
|
5397 |
+
// Control characters and (dependent upon position) numbers get escaped as code points
|
5398 |
+
return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
|
5399 |
+
}
|
5400 |
+
|
5401 |
+
// Other potentially-special ASCII characters get backslash-escaped
|
5402 |
+
return "\\" + ch;
|
5403 |
+
};
|
5404 |
+
|
5405 |
+
return (sel + "").replace(rcssescape, fcssescape);
|
5406 |
+
};
|
5407 |
+
}
|
5408 |
+
|
5409 |
+
// Get info about gallery name and current index from url
|
5410 |
+
function parseUrl() {
|
5411 |
+
var hash = window.location.hash.substr(1),
|
5412 |
+
rez = hash.split("-"),
|
5413 |
+
index = rez.length > 1 && /^\+?\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,
|
5414 |
+
gallery = rez.join("-");
|
5415 |
+
|
5416 |
+
return {
|
5417 |
+
hash: hash,
|
5418 |
+
/* Index is starting from 1 */
|
5419 |
+
index: index < 1 ? 1 : index,
|
5420 |
+
gallery: gallery
|
5421 |
+
};
|
5422 |
+
}
|
5423 |
+
|
5424 |
+
// Trigger click evnt on links to open new fancyBox instance
|
5425 |
+
function triggerFromUrl(url) {
|
5426 |
+
if (url.gallery !== "") {
|
5427 |
+
// If we can find element matching 'data-fancybox' atribute,
|
5428 |
+
// then triggering click event should start fancyBox
|
5429 |
+
$("[data-fancybox='" + $.escapeSelector(url.gallery) + "']")
|
5430 |
+
.eq(url.index - 1)
|
5431 |
+
.focus()
|
5432 |
+
.trigger("click.fb-start");
|
5433 |
+
}
|
5434 |
+
}
|
5435 |
+
|
5436 |
+
// Get gallery name from current instance
|
5437 |
+
function getGalleryID(instance) {
|
5438 |
+
var opts, ret;
|
5439 |
+
|
5440 |
+
if (!instance) {
|
5441 |
+
return false;
|
5442 |
+
}
|
5443 |
+
|
5444 |
+
opts = instance.current ? instance.current.opts : instance.opts;
|
5445 |
+
ret = opts.hash || (opts.$orig ? opts.$orig.data("fancybox") || opts.$orig.data("fancybox-trigger") : "");
|
5446 |
+
|
5447 |
+
return ret === "" ? false : ret;
|
5448 |
+
}
|
5449 |
+
|
5450 |
+
// Start when DOM becomes ready
|
5451 |
+
$(function() {
|
5452 |
+
// Check if user has disabled this module
|
5453 |
+
if ($.fancybox.defaults.hash === false) {
|
5454 |
+
return;
|
5455 |
+
}
|
5456 |
+
|
5457 |
+
// Update hash when opening/closing fancyBox
|
5458 |
+
$(document).on({
|
5459 |
+
"onInit.fb": function(e, instance) {
|
5460 |
+
var url, gallery;
|
5461 |
+
|
5462 |
+
if (instance.group[instance.currIndex].opts.hash === false) {
|
5463 |
+
return;
|
5464 |
+
}
|
5465 |
+
|
5466 |
+
url = parseUrl();
|
5467 |
+
gallery = getGalleryID(instance);
|
5468 |
+
|
5469 |
+
// Make sure gallery start index matches index from hash
|
5470 |
+
if (gallery && url.gallery && gallery == url.gallery) {
|
5471 |
+
instance.currIndex = url.index - 1;
|
5472 |
+
}
|
5473 |
+
},
|
5474 |
+
|
5475 |
+
"beforeShow.fb": function(e, instance, current, firstRun) {
|
5476 |
+
var gallery;
|
5477 |
+
|
5478 |
+
if (!current || current.opts.hash === false) {
|
5479 |
+
return;
|
5480 |
+
}
|
5481 |
+
|
5482 |
+
// Check if need to update window hash
|
5483 |
+
gallery = getGalleryID(instance);
|
5484 |
+
|
5485 |
+
if (!gallery) {
|
5486 |
+
return;
|
5487 |
+
}
|
5488 |
+
|
5489 |
+
// Variable containing last hash value set by fancyBox
|
5490 |
+
// It will be used to determine if fancyBox needs to close after hash change is detected
|
5491 |
+
instance.currentHash = gallery + (instance.group.length > 1 ? "-" + (current.index + 1) : "");
|
5492 |
+
|
5493 |
+
// If current hash is the same (this instance most likely is opened by hashchange), then do nothing
|
5494 |
+
if (window.location.hash === "#" + instance.currentHash) {
|
5495 |
+
return;
|
5496 |
+
}
|
5497 |
+
|
5498 |
+
if (firstRun && !instance.origHash) {
|
5499 |
+
instance.origHash = window.location.hash;
|
5500 |
+
}
|
5501 |
+
|
5502 |
+
if (instance.hashTimer) {
|
5503 |
+
clearTimeout(instance.hashTimer);
|
5504 |
+
}
|
5505 |
+
|
5506 |
+
// Update hash
|
5507 |
+
instance.hashTimer = setTimeout(function() {
|
5508 |
+
if ("replaceState" in window.history) {
|
5509 |
+
window.history[firstRun ? "pushState" : "replaceState"](
|
5510 |
+
{},
|
5511 |
+
document.title,
|
5512 |
+
window.location.pathname + window.location.search + "#" + instance.currentHash
|
5513 |
+
);
|
5514 |
+
|
5515 |
+
if (firstRun) {
|
5516 |
+
instance.hasCreatedHistory = true;
|
5517 |
+
}
|
5518 |
+
} else {
|
5519 |
+
window.location.hash = instance.currentHash;
|
5520 |
+
}
|
5521 |
+
|
5522 |
+
instance.hashTimer = null;
|
5523 |
+
}, 300);
|
5524 |
+
},
|
5525 |
+
|
5526 |
+
"beforeClose.fb": function(e, instance, current) {
|
5527 |
+
if (current.opts.hash === false) {
|
5528 |
+
return;
|
5529 |
+
}
|
5530 |
+
|
5531 |
+
clearTimeout(instance.hashTimer);
|
5532 |
+
|
5533 |
+
// Goto previous history entry
|
5534 |
+
if (instance.currentHash && instance.hasCreatedHistory) {
|
5535 |
+
window.history.back();
|
5536 |
+
} else if (instance.currentHash) {
|
5537 |
+
if ("replaceState" in window.history) {
|
5538 |
+
window.history.replaceState({}, document.title, window.location.pathname + window.location.search + (instance.origHash || ""));
|
5539 |
+
} else {
|
5540 |
+
window.location.hash = instance.origHash;
|
5541 |
+
}
|
5542 |
+
}
|
5543 |
+
|
5544 |
+
instance.currentHash = null;
|
5545 |
+
}
|
5546 |
+
});
|
5547 |
+
|
5548 |
+
// Check if need to start/close after url has changed
|
5549 |
+
$(window).on("hashchange.fb", function() {
|
5550 |
+
var url = parseUrl(),
|
5551 |
+
fb = null;
|
5552 |
+
|
5553 |
+
// Find last fancyBox instance that has "hash"
|
5554 |
+
$.each(
|
5555 |
+
$(".fancybox-container")
|
5556 |
+
.get()
|
5557 |
+
.reverse(),
|
5558 |
+
function(index, value) {
|
5559 |
+
var tmp = $(value).data("FancyBox");
|
5560 |
+
|
5561 |
+
if (tmp && tmp.currentHash) {
|
5562 |
+
fb = tmp;
|
5563 |
+
return false;
|
5564 |
+
}
|
5565 |
+
}
|
5566 |
+
);
|
5567 |
+
|
5568 |
+
if (fb) {
|
5569 |
+
// Now, compare hash values
|
5570 |
+
if (fb.currentHash !== url.gallery + "-" + url.index && !(url.index === 1 && fb.currentHash == url.gallery)) {
|
5571 |
+
fb.currentHash = null;
|
5572 |
+
|
5573 |
+
fb.close();
|
5574 |
+
}
|
5575 |
+
} else if (url.gallery !== "") {
|
5576 |
+
triggerFromUrl(url);
|
5577 |
+
}
|
5578 |
+
});
|
5579 |
+
|
5580 |
+
// Check current hash and trigger click event on matching element to start fancyBox, if needed
|
5581 |
+
setTimeout(function() {
|
5582 |
+
if (!$.fancybox.getInstance()) {
|
5583 |
+
triggerFromUrl(parseUrl());
|
5584 |
+
}
|
5585 |
+
}, 50);
|
5586 |
+
});
|
5587 |
+
})(window, document, jQuery);
|
5588 |
+
|
5589 |
+
// ==========================================================================
|
5590 |
+
//
|
5591 |
+
// Wheel
|
5592 |
+
// Basic mouse weheel support for gallery navigation
|
5593 |
+
//
|
5594 |
+
// ==========================================================================
|
5595 |
+
(function(document, $) {
|
5596 |
+
"use strict";
|
5597 |
+
|
5598 |
+
var prevTime = new Date().getTime();
|
5599 |
+
|
5600 |
+
$(document).on({
|
5601 |
+
"onInit.fb": function(e, instance, current) {
|
5602 |
+
instance.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll", function(e) {
|
5603 |
+
var current = instance.current,
|
5604 |
+
currTime = new Date().getTime();
|
5605 |
+
|
5606 |
+
if (instance.group.length < 2 || current.opts.wheel === false || (current.opts.wheel === "auto" && current.type !== "image")) {
|
5607 |
+
return;
|
5608 |
+
}
|
5609 |
+
|
5610 |
+
e.preventDefault();
|
5611 |
+
e.stopPropagation();
|
5612 |
+
|
5613 |
+
if (current.$slide.hasClass("fancybox-animated")) {
|
5614 |
+
return;
|
5615 |
+
}
|
5616 |
+
|
5617 |
+
e = e.originalEvent || e;
|
5618 |
+
|
5619 |
+
if (currTime - prevTime < 250) {
|
5620 |
+
return;
|
5621 |
+
}
|
5622 |
+
|
5623 |
+
prevTime = currTime;
|
5624 |
+
|
5625 |
+
instance[(-e.deltaY || -e.deltaX || e.wheelDelta || -e.detail) < 0 ? "next" : "previous"]();
|
5626 |
+
});
|
5627 |
+
}
|
5628 |
+
});
|
5629 |
+
})(document, jQuery);
|
admin/fancybox/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;-webkit-transform:translateZ(0);transform:translateZ(0);width:100%;z-index:99992}.fancybox-container *{box-sizing:border-box}.fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-stage{bottom:0;left:0;position:absolute;right:0;top:0}.fancybox-outer{-webkit-overflow-scrolling:touch;overflow-y:auto}.fancybox-bg{background:#1e1e1e;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-caption,.fancybox-infobar,.fancybox-navigation .fancybox-button,.fancybox-toolbar{direction:ltr;opacity:0;position:absolute;transition:opacity .25s ease,visibility 0s ease .25s;visibility:hidden;z-index:99997}.fancybox-show-caption .fancybox-caption,.fancybox-show-infobar .fancybox-infobar,.fancybox-show-nav .fancybox-navigation .fancybox-button,.fancybox-show-toolbar .fancybox-toolbar{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;-webkit-transform:translateZ(0);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:opacity,-webkit-transform;transition-property:transform,opacity;transition-property:transform,opacity,-webkit-transform;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--current,.fancybox-slide--next,.fancybox-slide--previous{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{-webkit-animation-timing-function:cubic-bezier(.5,0,.14,1);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;-webkit-transform-origin:top left;transform-origin:top left;transition-property:opacity,-webkit-transform;transition-property:transform,opacity;transition-property:transform,opacity,-webkit-transform;-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-pan .fancybox-content,.fancybox-can-swipe .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--iframe .fancybox-content,.fancybox-slide--map .fancybox-content,.fancybox-slide--pdf .fancybox-content,.fancybox-slide--video .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-iframe,.fancybox-video{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:link,.fancybox-button:visited{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--fsenter svg:nth-child(2),.fancybox-button--fsexit svg:nth-child(1),.fancybox-button--pause svg:nth-child(1),.fancybox-button--play svg:nth-child(2){display:none}.fancybox-progress{background:#ff5268;height:2px;left:0;position:absolute;right:0;top:0;-webkit-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:0;transform-origin:0;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-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;padding:31px 26px 31px 6px}.fancybox-navigation .fancybox-button--arrow_right{padding:31px 6px 31px 26px;right:0}.fancybox-caption{bottom:0;color:#eee;font-size:14px;font-weight:400;left:0;line-height:1.5;padding:25px 44px;right:0;text-align:center;z-index:99996}.fancybox-caption:before{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAD6CAQAAADKSeXYAAAAYklEQVQoz42RwQ3AMAgDjfcfup8WoRykfBAK5mQHKSz5rbXJPis1hjiV3CIqgG0hLZPkVkA4p4x5oR1bVeDrdCLrW2Q0D5bcwY3TGMHbdw3mPRuOtaspYP1w//G1OIcW148H0DMCqI/3mMMAAAAASUVORK5CYII=);background-repeat:repeat-x;background-size:contain;bottom:0;content:"";display:block;left:0;pointer-events:none;position:absolute;right:0;top:-44px;z-index:-1}.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{-webkit-animation:a 1s linear infinite;animation:a 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}@-webkit-keyframes a{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fancybox-animated{transition-timing-function:cubic-bezier(0,0,.25,1)}.fancybox-fx-slide.fancybox-slide--previous{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.fancybox-fx-slide.fancybox-slide--next{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.fancybox-fx-slide.fancybox-slide--current{opacity:1;-webkit-transform:translateZ(0);transform:translateZ(0)}.fancybox-fx-fade.fancybox-slide--next,.fancybox-fx-fade.fancybox-slide--previous{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;-webkit-transform:scale3d(1.5,1.5,1.5);transform:scale3d(1.5,1.5,1.5)}.fancybox-fx-zoom-in-out.fancybox-slide--next{opacity:0;-webkit-transform:scale3d(.5,.5,.5);transform:scale3d(.5,.5,.5)}.fancybox-fx-zoom-in-out.fancybox-slide--current{opacity:1;-webkit-transform:scaleX(1);transform:scaleX(1)}.fancybox-fx-rotate.fancybox-slide--previous{opacity:0;-webkit-transform:rotate(-1turn);transform:rotate(-1turn)}.fancybox-fx-rotate.fancybox-slide--next{opacity:0;-webkit-transform:rotate(1turn);transform:rotate(1turn)}.fancybox-fx-rotate.fancybox-slide--current{opacity:1;-webkit-transform:rotate(0deg);transform:rotate(0deg)}.fancybox-fx-circular.fancybox-slide--previous{opacity:0;-webkit-transform:scale3d(0,0,0) translate3d(-100%,0,0);transform:scale3d(0,0,0) translate3d(-100%,0,0)}.fancybox-fx-circular.fancybox-slide--next{opacity:0;-webkit-transform:scale3d(0,0,0) translate3d(100%,0,0);transform:scale3d(0,0,0) translate3d(100%,0,0)}.fancybox-fx-circular.fancybox-slide--current{opacity:1;-webkit-transform:scaleX(1) translateZ(0);transform:scaleX(1) translateZ(0)}.fancybox-fx-tube.fancybox-slide--previous{-webkit-transform:translate3d(-100%,0,0) scale(.1) skew(-10deg);transform:translate3d(-100%,0,0) scale(.1) skew(-10deg)}.fancybox-fx-tube.fancybox-slide--next{-webkit-transform:translate3d(100%,0,0) scale(.1) skew(10deg);transform:translate3d(100%,0,0) scale(.1) skew(10deg)}.fancybox-fx-tube.fancybox-slide--current{-webkit-transform:translateZ(0) scale(1);transform:translateZ(0) scale(1)}@media (max-height:576px){.fancybox-caption{padding:12px}.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-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}.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;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:link,.fancybox-share__button:visited{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;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;position:absolute;right:0;-webkit-tap-highlight-color:transparent;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:50%;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 (max-width:576px){.fancybox-thumbs{width:110px}.fancybox-show-thumbs .fancybox-inner{right:110px}.fancybox-thumbs__list a{max-width:calc(100% - 10px)}}
|
admin/fancybox/jquery.fancybox.min.js
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// ==================================================
|
2 |
+
// fancyBox v3.5.2
|
3 |
+
//
|
4 |
+
// Licensed GPLv3 for open source use
|
5 |
+
// or fancyBox Commercial License for commercial use
|
6 |
+
//
|
7 |
+
// http://fancyapps.com/fancybox/
|
8 |
+
// Copyright 2018 fancyApps
|
9 |
+
//
|
10 |
+
// ==================================================
|
11 |
+
!function(t,e,n,o){"use strict";function a(t,e){var o,a,i,s=[],r=0;t&&t.isDefaultPrevented()||(t.preventDefault(),e=e||{},t&&t.data&&(e=h(t.data.options,e)),o=e.$target||n(t.currentTarget).trigger("blur"),i=n.fancybox.getInstance(),i&&i.$trigger&&i.$trigger.is(o)||(e.selector?s=n(e.selector):(a=o.attr("data-fancybox")||"",a?(s=t.data?t.data.items:[],s=s.length?s.filter('[data-fancybox="'+a+'"]'):n('[data-fancybox="'+a+'"]')):s=[o]),r=n(s).index(o),r<0&&(r=0),i=n.fancybox.open(s,e,r),i.$trigger=o))}if(t.console=t.console||{info:function(t){}},n){if(n.fn.fancybox)return void console.info("fancyBox already initialized");var i={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 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> / <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></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:"Schliessen",NEXT:"Weiter",PREV:"Zurück",ERROR:"Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es später nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder",DOWNLOAD:"Herunterladen",SHARE:"Teilen",ZOOM:"Maßstab"}}},s=n(t),r=n(e),c=0,l=function(t){return t&&t.hasOwnProperty&&t instanceof n},d=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),u=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),f=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"}(),p=function(t){return t&&t.length&&t[0].offsetHeight},h=function(t,e){var o=n.extend(!0,{},t,e);return n.each(e,function(t,e){n.isArray(e)&&(o[t]=e)}),o},g=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)},b=function(t,e,o){var a=this;a.opts=h({index:o},n.fancybox.defaults),n.isPlainObject(e)&&(a.opts=h(a.opts,e)),n.fancybox.isMobile&&(a.opts=h(a.opts,a.opts.mobile)),a.id=a.opts.id||++c,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(b.prototype,{init:function(){var o,a,i=this,s=i.group[i.currIndex],r=s.opts;r.closeExisting&&n.fancybox.close(!0),n("body").addClass("fancybox-active"),!n.fancybox.getInstance()&&r.hideScrollbar!==!1&&!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(r.buttons,function(t,e){a+=r.btnTpl[e]||""}),o=n(i.translate(i,r.baseTpl.replace("{{buttons}}",a).replace("{{arrows}}",r.btnTpl.arrowLeft+r.btnTpl.arrowRight))).attr("id","fancybox-container-"+i.id).addClass(r.baseClass).data("FancyBox",i).appendTo(r.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){var a=n[e];return a===o?t:a})},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?(i=n(e),u=i.data()||{},u=n.extend(!0,{},u,u.options),u.$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=h(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),l.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&&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"]()}),s.on("orientationchange.fb resize.fb",function(t){t&&t.originalEvent&&"resize"===t.originalEvent.type?(e.requestId&&u(e.requestId),e.requestId=d(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))}),r.on("keydown.fb",function(t){var o=n.fancybox?n.fancybox.getInstance():null,a=o.current,i=t.keyCode||t.which;if(9==i)return void(a.opts.trapFocus&&e.focus(t));if(!(!a.opts.keyboard||t.ctrlKey||t.altKey||t.shiftKey||n(t.target).is("input")||n(t.target).is("textarea")))return 8===i||27===i?(t.preventDefault(),void e.close(t)):37===i||38===i?(t.preventDefault(),void e.previous()):39===i||40===i?(t.preventDefault(),void e.next()):void e.trigger("afterKeydown",t,i)}),e.group[e.currIndex].opts.idleTime&&(e.idleSecondsCounter=0,r.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;s.off("orientationchange.fb resize.fb"),r.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,f,h=this,g=h.group.length;if(!(h.isDragging||h.isClosing||h.isAnimating&&h.firstRun)){if(t=parseInt(t,10),s=h.current?h.current.opts.loop:h.opts.loop,!s&&(t<0||t>=g))return!1;if(a=h.firstRun=!Object.keys(h.slides).length,c=h.current,h.prevIndex=h.currIndex,h.prevPos=h.currPos,r=h.createSlide(t),g>1&&((s||r.index<g-1)&&h.createSlide(t+1),(s||r.index>0)&&h.createSlide(t-1)),h.current=r,h.currIndex=r.index,h.currPos=r.pos,h.trigger("beforeShow",a),h.updateControls(),r.forcedDuration=o,n.isNumeric(e)?r.forcedDuration=e:e=r.opts[a?"animationDuration":"transitionDuration"],e=parseInt(e,10),i=h.isMoved(r),r.$slide.addClass("fancybox-slide--current"),a)return r.opts.animationEffect&&e&&h.$refs.container.css("transition-duration",e+"ms"),h.$refs.container.addClass("fancybox-is-open").trigger("focus"),h.loadSlide(r),void h.preload("image");l=n.fancybox.getTranslate(c.$slide),d=n.fancybox.getTranslate(h.$refs.stage),n.each(h.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?(f=l.left-(c.pos*l.width+c.pos*c.opts.gutter),n.each(h.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+f}),o.pos!==r.pos&&o.$slide.addClass("fancybox-slide--"+(o.pos>r.pos?"next":"previous")),p(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===h.currPos&&h.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?h.revealContent(r):h.loadSlide(r),h.preload("image")}},createSlide:function(t){var e,o,a=this;return o=t%a.group.length,o=o<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,f=u.$content,p=n.fancybox.getTranslate(u.$slide).width,h=n.fancybox.getTranslate(u.$slide).height,g=u.width,b=u.height;d.isAnimating||d.isMoved()||!f||"image"!=u.type||!u.isLoaded||u.hasError||(d.isAnimating=!0,n.fancybox.stop(f),t=t===o?.5*p:t,e=e===o?.5*h:e,i=n.fancybox.getTranslate(f),i.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*p-.5*g,r=.5*h-.5*b,g>p&&(s=i.left*c-(t*c-t),s>0&&(s=0),s<p-g&&(s=p-g)),b>h&&(r=i.top*l-(e*l-e),r>0&&(r=0),r<h-b&&(r=h-b)),d.updateCursor(g,b),n.fancybox.animate(f,{top:r,left:s,scaleX:c,scaleY:l},a||330,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||330,function(){o.isAnimating=!1}))},getFitPos:function(t){var e,o,a,i,s=this,r=t.$content,c=t.$slide,l=t.width||t.opts.width,d=t.height||t.opts.height,u={};return!!(t.isLoaded&&r&&r.length)&&(e=n.fancybox.getTranslate(s.$refs.stage).width,o=n.fancybox.getTranslate(s.$refs.stage).height,e-=parseFloat(c.css("paddingLeft"))+parseFloat(c.css("paddingRight"))+parseFloat(r.css("marginLeft"))+parseFloat(r.css("marginRight")),o-=parseFloat(c.css("paddingTop"))+parseFloat(c.css("paddingBottom"))+parseFloat(r.css("marginTop"))+parseFloat(r.css("marginBottom")),l&&d||(l=e,d=o),a=Math.min(1,e/l,o/d),l=a*l,d=a*d,l>e-.5&&(l=e),d>o-.5&&(d=o),"image"===t.type?(u.top=Math.floor(.5*(o-d))+parseFloat(c.css("paddingTop")),u.left=Math.floor(.5*(e-l))+parseFloat(c.css("paddingLeft"))):"video"===t.contentType&&(i=t.opts.width&&t.opts.height?l/d:t.opts.ratio||16/9,d>l/i?d=l/i:l>d*i&&(l=d*i)),u.width=l,u.height=d,u)},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"),o=i.canPan(t,e),a=!!o||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),t&&(n.width>t.width||n.height>t.height))return!0}return!1},isScaledDown:function(t,e){var a=this,i=!1,s=a.current,r=s.$content;return t!==o&&e!==o?i=t<s.width&&e<s.height:r&&(i=n.fancybox.getTranslate(r),i=i.width<s.width&&i.height<s.height),i},canPan:function(t,e){var a=this,i=a.current,s=null,r=!1;return"image"===i.type&&(i.isComplete||t&&e)&&!i.hasError&&(r=a.getFitPos(i),t!==o&&e!==o?s={width:t,height:e}:i.isComplete&&(s=n.fancybox.getTranslate(i.$content)),s&&r&&(r=Math.abs(s.width-r.width)>1.5||Math.abs(s.height-r.height)>1.5)),r},loadSlide:function(t){var e,o,a,i=this;if(!t.isLoading&&!t.isLoaded){if(t.isLoading=!0,i.trigger("beforeLoad",t)===!1)return t.isLoading=!1,!1;switch(e=t.type,o=t.$slide,o.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)}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")),t.opts.preload!==!1&&t.opts.width&&t.opts.height&&t.thumb&&(t.width=t.opts.width,t.height=t.opts.height,o=e.createElement("img"),o.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);return 0===n?e.url=t:void(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,e&&"auto"!==e||(e=(t.width/t.height>1&&s.width()/s.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;n.fancybox.isMobile&&(i.css.overflow="scroll"),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,r=t.$content,c=i.css.width,l=i.css.height;if(1===e[0].isReady){try{n=e.contents(),a=n.find("body")}catch(t){}a&&a.length&&a.children().length&&(s.css("overflow","visible"),r.css({width:"100%","max-width":"100%",height:"9999px"}),c===o&&(c=Math.ceil(Math.max(a[0].clientWidth,a.outerWidth(!0)))),r.css("width",c?c:"").css("max-width",""),l===o&&(l=Math.ceil(Math.max(a[0].clientHeight,a.outerHeight(!0)))),r.css("height",l?l:""),s.css("overflow","auto")),r.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=this;o.isClosing||(o.hideLoading(t),t.$content&&n.fancybox.stop(t.$content),t.$slide.empty(),l(e)&&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),o.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&&!t.$spinner&&(t.$spinner=n(e.translate(e,e.opts.spinnerTpl)).appendTo(t.$slide).hide().fadeIn("fast"))},hideLoading:function(t){var e=this;t=t||e.current,t&&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=this,n=t||e.current,o=n.opts.caption,a=e.$refs.caption,i=!1;n.opts.preventCaptionOverlap&&o&&o.length&&(n.pos!==e.currPos?(a=a.clone().empty().appendTo(a.parent()),a.html(o),i=a.outerHeight(!0),a.empty().remove()):e.$caption&&(i=e.$caption.outerHeight(!0)),n.$slide.css("padding-bottom",i||""))},adjustLayout:function(t){var e,n,o,a,i=this,s=t||i.current;s.isLoaded&&s.opts.disableLayoutFix!==!0&&(s.$content.css("margin-bottom",""),s.$content.outerHeight()>s.$slide.height()+.5&&(o=s.$slide[0].style["padding-bottom"],a=s.$slide.css("padding-bottom"),parseFloat(a)>0&&(e=s.$slide[0].scrollHeight,s.$slide.css("padding-bottom",0),Math.abs(e-s.$slide[0].scrollHeight)<1&&(n=a),s.$slide.css("padding-bottom",o))),s.$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),f=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,s=t.opts.zoomOpacity,"auto"==s&&(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),p(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"),p(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"),f||!u||"image"!==t.type||t.hasError||t.$content.hide().fadeIn("fast"),void(t.pos===r.currPos&&r.complete())))},getThumbPos:function(t){var e,o,a,i,s,r=!1,c=t.$thumb;return!(!c||!g(c[0]))&&(e=n.fancybox.getTranslate(c),o=parseFloat(c.css("border-top-width")||0),a=parseFloat(c.css("border-right-width")||0),i=parseFloat(c.css("border-bottom-width")||0),s=parseFloat(c.css("border-left-width")||0),r={top:e.top+o,left:e.left+s,width:e.width-a-s,height:e.height-o-i,scaleX:1,scaleY:1},e.width>0&&e.height>0&&r)},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"),p(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(){this.webkitExitFullscreen&&this.webkitExitFullscreen(),e.next()}),o.opts.autoFocus&&"html"===o.contentType&&(t=o.$content.find("input[autofocus]:enabled:visible:first"),t.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&&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","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(",");s.isClosing||(a=!t&&s.current&&s.current.isComplete?s.current.$slide.find("*:visible"+(o?":not(.fancybox-close-small)":"")):s.$refs.container.find("*:visible"),a=a.filter(r).filter(function(){return"hidden"!==n(this).css("visibility")&&!n(this).hasClass("disabled")}),a.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,u=this,f=u.current,h=function(){u.cleanUp(t)};return!u.isClosing&&(u.isClosing=!0,u.trigger("beforeClose",t)===!1?(u.isClosing=!1,d(function(){u.update()}),!1):(u.removeEvents(),i=f.$content,o=f.opts.animationEffect,a=n.isNumeric(e)?e:o?f.opts.animationDuration:0,f.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),t!==!0?n.fancybox.stop(f.$slide):o=!1,f.$slide.siblings().trigger("onReset").remove(),a&&u.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing").css("transition-duration",a+"ms"),u.hideLoading(f),u.hideControls(!0),u.updateCursor(),"zoom"!==o||i&&a&&"image"===f.type&&!u.isMoved()&&!f.hasError&&(l=u.getThumbPos(f))||(o="fade"),"zoom"===o?(n.fancybox.stop(i),s=n.fancybox.getTranslate(i),c={top:s.top,left:s.left,scaleX:s.width/l.width,scaleY:s.height/l.height,width:l.width,height:l.height},r=f.opts.zoomOpacity,"auto"==r&&(r=Math.abs(f.width/f.height-l.width/l.height)>.1),r&&(l.opacity=0),n.fancybox.setTranslate(i,c),p(i),n.fancybox.animate(i,l,a,h),!0):(o&&a?n.fancybox.animate(f.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"),"fancybox-animated fancybox-fx-"+o,a,h):t===!0?setTimeout(h,a):h(),
|
12 |
+
!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?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;return s?a.unshift(s):s=i,a.unshift(i),n.isFunction(s.opts[t])&&(o=s.opts[t].apply(s,a)),o===!1?o:void("afterClose"!==t&&i.$refs?i.$refs.container.trigger(t+".fb",a):r.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"),t.$caption=r&&r.length?s.html(r):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=this,n=["infobar","toolbar","nav"];!t&&e.current.opts.preventCaptionOverlap||n.push("caption"),this.$refs.container.removeClass(n.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.2",defaults:i,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 b&&("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 b(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),t===!0&&this.close(t))},destroy:function(){this.close(!0),r.add("body").off("click.fb-start","**")},isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:function(){var n=e.createElement("div");return t.getComputedStyle&&t.getComputedStyle(n)&&t.getComputedStyle(n).getPropertyValue("transform")&&!(e.documentMode&&e.documentMode<11)}(),getTranslate:function(t){var e;return!(!t||!t.length)&&(e=t[0].getBoundingClientRect(),{top:e.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(f,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}):s!==!0&&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(f)},a+33))},stop:function(t,e){t&&t.length&&(clearTimeout(t.data("timer")),e&&t.trigger(f),t.off(f).css("transition-duration",""),t.parent().removeClass("fancybox-is-scaling"))}},n.fn.fancybox=function(t){var e;return t=t||{},e=t.selector||!1,e?n("body").off("click.fb-start",e).on("click.fb-start",e,{options:t},a):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},a),this},r.on("click.fb-start","[data-fancybox]",a),r.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)})}),function(){var t=".fancybox-button",e="fancybox-focus",o=null;r.on("mousedown mouseup focus blur",t,function(a){switch(a.type){case"mousedown":o=n(this);break;case"mouseup":o=null;break;case"focusin":n(t).removeClass(e),n(this).is(o)||n(this).is("[disabled]")||n(this).addClass(e);break;case"focusout":n(t).removeClass(e)}})}()}}(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:"//www.youtube-nocookie.com/embed/$4",thumb:"//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,f,p=i.src||"",h=!1;s=t.extend(!0,{},e,i.opts.media),t.each(s,function(e,o){if(c=p.match(o.matcher)){if(h=o.type,f=e,u={},o.paramPlace&&c[o.paramPlace]){d=c[o.paramPlace],"?"==d[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),p="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?p=p.replace(/&t=((\d+)m)?(\d+)s/,function(t,e,n,o){return"&start="+((n?60*parseInt(n,10):0)+parseInt(o,10))}):"vimeo"===e&&(p=p.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:p,origSrc:i.src,contentSource:f,contentType:"image"===h?"image":"gmap_place"==f||"gmap_search"==f?"map":"video"})):p&&(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;return this[t].loaded?void setTimeout(function(){n.done(t)}):void(this[t].loading||(this[t].loading=!0,e=document.createElement("script"),e.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,a;"youtube"===e&&delete window.onYouTubeIframeAPIReady,n=t.fancybox.getInstance(),n&&(o=n.current.$content.find("iframe"),"youtube"===e&&void 0!==YT&&YT?a=new YT.Player(o.attr("id"),{events:{onStateChange:function(t){0==t.data&&n.next()}}}):"vimeo"===e&&void 0!==Vimeo&&Vimeo&&(a=new Vimeo.Player(o),a.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=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),a=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),i=function(e){var n=[];e=e.originalEvent||e||t.e,e=e.touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e];for(var o in 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){var n=t.getComputedStyle(e)["overflow-y"],o=t.getComputedStyle(e)["overflow-x"],a=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,i=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return a||i},l=function(t){for(var e=!1;;){if(e=c(t.get(0)))break;if(t=t.parent(),!t.length||t.hasClass("fancybox-stage")||t.is("body"))break}return e},d=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"))};d.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)},d.prototype.ontouchstart=function(o){var a=this,c=n(o.target),d=a.instance,u=d.current,f=u.$slide,p=u.$content,h="touchstart"==o.type;if(h&&a.$container.off("mousedown.fb.touch"),(!o.originalEvent||2!=o.originalEvent.button)&&f.length&&c.length&&!r(c)&&!r(c.parent())&&(c.is("img")||!(o.originalEvent.clientX>c[0].clientWidth+c.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=c,a.$content=p,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(f[0].clientWidth),a.canvasHeight=Math.round(f[0].clientHeight),a.contentLastPos=null,a.contentStartPos=n.fancybox.getTranslate(a.$content)||{top:0,left:0},a.sliderStartPos=n.fancybox.getTranslate(f),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)&&(c.is(a.$stage)||a.$stage.find(c).length)||(c.is(".fancybox-image")&&o.preventDefault(),n.fancybox.isMobile&&c.hasClass("fancybox-caption")))&&(a.isScrollable=l(c)||l(c.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]))))}},d.prototype.onscroll=function(t){var n=this;n.isScrolling=!0,e.removeEventListener("scroll",n.onscroll,!0)},d.prototype.ontouchmove=function(t){var e=this;return void 0!==t.originalEvent.buttons&&0===t.originalEvent.buttons?void e.ontouchend(t):e.isScrolling?void(e.canTap=!1):(e.newPoints=i(t),void((e.opts||e.canPan)&&e.newPoints.length&&e.newPoints.length&&(e.isSwiping&&e.isSwiping===!0||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()))))},d.prototype.onSwipe=function(e){var i,s=this,r=s.instance,c=s.isSwiping,l=s.sliderStartPos.left||0;if(c!==!0)"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||s.opts.vertical===!1||"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()}},d.prototype.onPan=function(){var t=this;return s(t.newPoints[0],t.realPoints[0])<(n.fancybox.isMobile?10:5)?void(t.startPoints=t.newPoints):(t.canTap=!1,t.contentLastPos=t.limitMovement(),t.requestId&&a(t.requestId),void(t.requestId=o(function(){n.fancybox.setTranslate(t.$content,t.contentLastPos)})))},d.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,f=u.left,p=u.top,h=u.width,g=u.height;return a=h>r?f+l:f,i=p+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+f+l,.8)||0),l<0&&a<n&&(a=n+1-Math.pow(n-f-l,.8)||0),d>0&&i>e&&(i=e-1+Math.pow(-e+p+d,.8)||0),d<0&&i<o&&(i=o+1-Math.pow(o-p-d,.8)||0),{top:i,left:a}},d.prototype.limitPosition=function(t,e,n,o){var a=this,i=a.canvasWidth,s=a.canvasHeight;return n>i?(t=t>0?0:t,t=t<i-n?i-n:t):t=Math.max(0,i/2-n/2),o>s?(e=e>0?0:e,e=e<s-o?s-o:e):e=Math.max(0,s/2-o/2),{top:e,left:t}},d.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]),f=u/e.startDistanceBetweenFingers,p=Math.floor(r*f),h=Math.floor(c*f),g=(r-p)*e.percentageOfImageAtPinchPointX,b=(c-h)*e.percentageOfImageAtPinchPointY,m=(e.newPoints[0].x+e.newPoints[1].x)/2-n(t).scrollLeft(),v=(e.newPoints[0].y+e.newPoints[1].y)/2-n(t).scrollTop(),y=m-e.centerPointStartX,x=v-e.centerPointStartY,w=l+(g+y),$=d+(b+x),S={top:$,left:w,scaleX:f,scaleY:f};e.canTap=!1,e.newWidth=p,e.newHeight=h,e.contentLastPos=S,e.requestId&&a(e.requestId),e.requestId=o(function(){n.fancybox.setTranslate(e.$content,e.contentLastPos)})},d.prototype.ontouchend=function(t){var o=this,s=o.isSwiping,r=o.isPanning,c=o.isZooming,l=o.isScrolling;return 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?o.onTap(t):(o.speed=100,o.velocityX=o.distanceX/o.dMs*.5,o.velocityY=o.distanceY/o.dMs*.5,void(r?o.endPanning():c?o.endZooming():o.endSwiping(s,l)))},d.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),c=300;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(c):r&&o.distanceX<0&&(a=o.instance.next(c)),a!==!1||"x"!=t&&"y"!=t||o.instance.centerSlide(200),o.$container.removeClass("fancybox-is-sliding")},d.prototype.endPanning=function(){var t,e,o,a=this;a.contentLastPos&&(a.opts.momentum===!1||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),o.width=a.contentStartPos.width,o.height=a.contentStartPos.height,n.fancybox.animate(a.$content,o,330))},d.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,e=i.contentLastPos.top,a={top:e,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)))},d.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,f=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))}};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;f("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||f("click"+o)},500):f("click"+o);return this}},n(e).on("onActivate.fb",function(t,e){e&&!e.Guestures&&(e.Guestures=new d(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&&(t===!0||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,e[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.current.$content.css("transition","none"),n.isAnimating=!1,n.update(!0,!0,0)),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){var a;return n?void(e&&e.group[e.currIndex].opts.fullScreen?(a=e.$refs.container,a.on("click.fb-fullscreen","[data-fancybox-fullscreen]",function(t){t.stopPropagation(),t.preventDefault(),o.toggle()}),e.opts.fullScreen&&e.opts.fullScreen.autoStart===!0&&o.request(),e.FullScreen=o):e&&e.$refs.toolbar.find("[data-fancybox-fullscreen]").hide()):void 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,t||"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&&(e=i.children().removeClass(o).filter('[data-index="'+a.instance.current.index+'"]').addClass(o),n=e.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),n.isActive&&n.opts.autoStart===!0&&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&&n.opts.hideOnClose!==!1&&n.$grid.hide()}})}(document,jQuery),function(t,e){"use strict";function n(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}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>'
|
13 |
+
}}),e(t).on("click","[data-fancybox-share]",function(){var t,o,a=e.fancybox.getInstance(),i=a.current||null;i&&("function"===e.type(i.opts.share.url)&&(t=i.opts.share.url.apply(i,[a,i])),o=i.opts.share.tpl.replace(/\{\{media\}\}/g,"image"===i.type?encodeURIComponent(i.src):"").replace(/\{\{url\}\}/g,encodeURIComponent(t)).replace(/\{\{url_raw\}\}/g,n(t)).replace(/\{\{descr\}\}/g,a.$caption?encodeURIComponent(a.$caption.text()):""),e.fancybox.open({src:a.translate(a,o),type:"html",opts:{touch:!1,animationEffect:!1,afterLoad:function(t,e){a.$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:1,a=n.join("-");return{hash:e,index:o<1?1:o,gallery:a}}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&&(e=t.current?t.current.opts:t.opts,n=e.hash||(e.$orig?e.$orig.data("fancybox")||e.$orig.data("fancybox-trigger"):""),""!==n&&n)}n.escapeSelector||(n.escapeSelector=function(t){var e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,n=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t};return(t+"").replace(e,n)}),n(function(){n.fancybox.defaults.hash!==!1&&(n(e).on({"onInit.fb":function(t,e){var n,a;e.group[e.currIndex].opts.hash!==!1&&(n=o(),a=i(e),a&&n.gallery&&a==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(n,o,a,s){var r;a&&a.opts.hash!==!1&&(r=i(o),r&&(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.opts.hash!==!1&&(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||o.opts.wheel===!1||"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);
|
admin/font/material-design-icons/license.txt
CHANGED
File without changes
|
admin/font/material-design-icons/materialdesignicons-webfont.eot
CHANGED
File without changes
|
admin/font/material-design-icons/materialdesignicons-webfont.svg
CHANGED
File without changes
|
admin/font/material-design-icons/materialdesignicons-webfont.ttf
CHANGED
File without changes
|
admin/font/material-design-icons/materialdesignicons-webfont.woff
CHANGED
File without changes
|
admin/font/material-design-icons/materialdesignicons-webfont.woff2
CHANGED
File without changes
|
admin/font/roboto/Roboto-Bold-webfont.eot
CHANGED
File without changes
|
admin/font/roboto/Roboto-Bold-webfont.svg
CHANGED
File without changes
|
admin/font/roboto/Roboto-Bold-webfont.ttf
CHANGED
File without changes
|
admin/font/roboto/Roboto-Bold-webfont.woff
CHANGED
File without changes
|
admin/font/roboto/Roboto-Light-webfont.eot
CHANGED
File without changes
|
admin/font/roboto/Roboto-Light-webfont.svg
CHANGED
File without changes
|
admin/font/roboto/Roboto-Light-webfont.ttf
CHANGED
File without changes
|
admin/font/roboto/Roboto-Light-webfont.woff
CHANGED
File without changes
|
admin/font/roboto/Roboto-Regular-webfont.eot
CHANGED
File without changes
|
admin/font/roboto/Roboto-Regular-webfont.svg
CHANGED
File without changes
|
admin/font/roboto/Roboto-Regular-webfont.ttf
CHANGED
File without changes
|
admin/font/roboto/Roboto-Regular-webfont.woff
CHANGED
File without changes
|
admin/images/captions-settings.jpg
ADDED
Binary file
|
admin/images/creative-gallery-settings.jpg
ADDED
Binary file
|
admin/images/custom-grid-settings.jpg
ADDED
Binary file
|
admin/images/customizations-settings.jpg
ADDED
Binary file
|
admin/images/drag-and-drop-upload.jpg
ADDED
Binary file
|
admin/images/galleries-list.jpg
ADDED
Binary file
|
admin/images/gallery-edit.jpg
ADDED
Binary file
|
admin/images/helper-grid.jpg
ADDED
Binary file
|
admin/images/hover-effects-settings.jpg
ADDED
Binary file
|
admin/images/landscape-portrait.jpg
ADDED
Binary file
|
admin/images/live-preview.jpg
ADDED
Binary file
|
admin/images/loading-effects-settings.jpg
ADDED
Binary file
|
admin/images/modula-v2-custom-grid.png
ADDED
Binary file
|
admin/images/modula-v2-drag-and-drop-upload.png
ADDED
Binary file
|
admin/images/modula-v2-familiar-dashboard.png
ADDED
Binary file
|
admin/images/modula-v2-helper-grid.png
ADDED
Binary file
|
admin/images/modula-v2-intuitive-settings.png
ADDED
Binary file
|
admin/images/modula-v2-landscape-or-portrait.png
ADDED
Binary file
|
admin/images/modula-v2-live-preview.png
ADDED
Binary file
|
admin/images/modula.svg
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
+
viewBox="0 0 713.4 224.4" xml:space="preserve" fill="#fff">
|
5 |
+
<g>
|
6 |
+
<path d="M237,71c7,0,13.9,0,20.9,0c7.7,12.4,15.3,24.7,23.1,37.2c7.8-12.5,15.4-24.9,23.1-37.2c6.9,0,13.8,0,20.7,0
|
7 |
+
c0.2,0.8,0.3,86.6,0.1,88.2c-6.3,0-12.6,0-19,0c-0.2-2.4-0.1-4.8-0.1-7.2c0-2.4,0-4.7,0-7.1c0-2.4,0-4.8,0-7.2c0-2.4,0-4.7,0-7.1
|
8 |
+
c0-2.4,0-4.8,0-7.2c0-2.4,0-4.7,0-7.1c0-2.4,0-4.8,0-7.2c0-2.3,0-4.7,0-7c-0.1,0-0.2-0.1-0.3-0.1c-0.2,0.3-0.5,0.7-0.7,1
|
9 |
+
c-7.7,11.7-15.3,23.3-23,35c-1.1,1.7-1.1,1.7-2.2,0c-7.6-11.5-15.1-23-22.7-34.5c-0.2-0.4-0.5-0.7-0.9-1.3
|
10 |
+
c-0.1,0.6-0.1,0.9-0.1,1.2c0,2.7,0,5.4,0,8.1c0,15.3,0,30.7,0,46c0,0.5,0,1,0,1.5c-6.4,0-12.6,0-18.9,0C237,129.8,237,100.5,237,71
|
11 |
+
z"/>
|
12 |
+
<path d="M476.3,100.1c0-10.9,0-21.8,0-32.8c6.4,0,12.7,0,18.9,0c0.2,0.8,0.4,89.6,0.1,91.9c-6.3,0-12.6,0-19,0c0-3.1,0-6.1,0-9.4
|
13 |
+
c-0.4,0.5-0.6,0.7-0.8,0.9c-1.1,1.2-2.2,2.5-3.4,3.6c-3.8,3.6-8.3,5.7-13.6,6.2c-8.4,0.7-16-1.4-22.5-7c-4.3-3.7-7.2-8.3-9.1-13.6
|
14 |
+
c-2.1-5.6-2.6-11.3-2.3-17.2c0.3-5.2,1.4-10.2,3.7-14.9c1.6-3.2,3.5-6.2,6.1-8.8c5-5.1,11.1-7.8,18.1-8.4c3.3-0.3,6.6-0.1,9.8,0.6
|
15 |
+
c4.2,0.9,7.6,3.2,10.7,6c1.1,0.9,2,2,3,3C476.1,100.1,476.2,100.1,476.3,100.1z M476.6,125.5c0.1-4.2-0.9-8.1-3.2-11.6
|
16 |
+
c-3.6-5.7-10-8.3-16.5-6.9c-5.1,1.1-8.6,4.2-10.9,8.7c-1.3,2.5-1.9,5.1-2.1,7.9c-0.3,4.8,0.5,9.3,3.2,13.3c3.8,5.6,9.2,8,16,7
|
17 |
+
c4.9-0.8,8.4-3.6,10.9-7.9C475.8,132.8,476.7,129.3,476.6,125.5z"/>
|
18 |
+
<path d="M377,90.4c7.2,0,13.5,1.5,19.3,4.8c10,5.8,15.9,14.5,17.3,26c2.3,19.3-10.5,34.7-27.3,38.5c-10.2,2.3-20,1.1-29-4.4
|
19 |
+
c-9.3-5.7-14.8-14.2-16.2-25c-2.5-20,11-35.4,27.9-39C371.8,90.7,374.6,90.4,377,90.4z M394.9,125.7c0-0.4,0-0.9,0-1.3
|
20 |
+
c-0.5-10-8-16.9-16.3-17.5c-7.8-0.5-14.1,3.2-17,9.8c-1.6,3.6-2,7.4-1.7,11.3c0.9,8.8,8.4,16.9,18.9,16.2c5.8-0.4,10.3-3,13.4-8
|
21 |
+
C394.1,133,394.9,129.5,394.9,125.7z"/>
|
22 |
+
<path d="M668.5,120.7c0.1-2.3-0.1-4.4-0.9-6.4c-1-2.6-2.9-4.4-5.4-5.5c-2.1-0.9-4.3-1.3-6.5-1.4c-6.6-0.3-12.9,0.9-19.1,3.2
|
23 |
+
c-0.4,0.1-0.7,0.2-1.2,0.4c-1.6-4.9-3.2-9.7-4.8-14.5c0.4-0.2,0.7-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8,0,23.7,0,35.5c0,2,0.1,4.1,0.6,6.1
|
33 |
+
c1.3,5.1,5,8.1,10.3,8.2c1.4,0,2.8,0,4.1-0.4c4.5-1.1,7.1-4.1,8-8.5c0.4-1.7,0.5-3.5,0.5-5.3c0-11.8,0-23.7,0-35.5
|
34 |
+
C554.7,92.9,554.7,92.4,554.7,91.8z"/>
|
35 |
+
<path d="M610.8,159.2c-6.3,0-12.6,0-19,0c0-30.6,0-61.2,0-91.8c0.8-0.3,17.1-0.3,19-0.1C610.8,97.9,610.8,128.5,610.8,159.2z"/>
|
36 |
+
<path d="M61.9,169.5c-14.3-4.3-28.6-8.5-43-12.8c14.3-21.4,28.6-42.8,42.8-64.1c0.1,0,0.1,0,0.2,0.1
|
37 |
+
C61.9,118.2,61.9,143.8,61.9,169.5z"/>
|
38 |
+
<path d="M144.7,134.3c-1-25.5-1.9-51-2.9-76.7c14.5,3.7,28.9,7.4,43.5,11.2c-13.5,22-26.9,43.8-40.3,65.7
|
39 |
+
C144.9,134.3,144.8,134.3,144.7,134.3z"/>
|
40 |
+
<path d="M185.3,160.9c-25.8-1.1-51.5-2.1-77.2-3.2c0-0.1,0-0.2-0.1-0.3c21.9-13.3,43.8-26.5,65.9-39.9
|
41 |
+
C177.7,132,181.5,146.4,185.3,160.9z"/>
|
42 |
+
<path d="M23.1,63c25.9,1.4,51.4,2.7,77,4c0.1,0.1,0.1,0.2,0.1,0.2c0,0,0,0.1,0,0.1c-0.4,0.2-0.7,0.5-1.1,0.7
|
43 |
+
c-21.6,12.8-43.3,25.5-65,38.4C30.3,92,26.7,77.6,23.1,63z"/>
|
44 |
+
<path d="M100.3,206c-12.2-22.7-24.4-45.3-36.6-67.9c1,0.2,66.5,35.1,68.1,36.2C121.3,184.8,110.9,195.3,100.3,206z"/>
|
45 |
+
<path d="M73.9,50.3c10.6-10.4,21.2-20.8,31.8-31.2c0.6,0.6,34.8,66.2,35.6,68.2c0,0-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0
|
46 |
+
c-22.3-12.3-44.6-24.5-66.8-36.8C74.2,50.6,74.1,50.5,73.9,50.3z"/>
|
47 |
+
</g>
|
48 |
+
</svg>
|
admin/images/social-settings.jpg
ADDED
Binary file
|
admin/images/style-settings.jpg
ADDED
Binary file
|
admin/modula-v2.php
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<div class="wrap about-wrap modula-wrap">
|
3 |
+
<style type="text/css">
|
4 |
+
.center {
|
5 |
+
text-align: center;
|
6 |
+
}
|
7 |
+
a.modula-video {
|
8 |
+
text-decoration: none;
|
9 |
+
font-size: 20px;
|
10 |
+
margin-left: 20px;
|
11 |
+
line-height: 46px;
|
12 |
+
color: #23282d;
|
13 |
+
}
|
14 |
+
.modula-video span.dashicons.dashicons-video-alt3 {
|
15 |
+
line-height: 46px;
|
16 |
+
width: auto;
|
17 |
+
height: auto;
|
18 |
+
font-size: 26px;
|
19 |
+
vertical-align: middle;
|
20 |
+
}
|
21 |
+
</style>
|
22 |
+
<div class="feature-section one-col">
|
23 |
+
<div class="col">
|
24 |
+
<h2 style="font-size: 2.5em;"><?php echo __( 'Meet The New Modula', 'modula-gallery' ); ?></h2>
|
25 |
+
<p><?php echo __( 'We’ve been working on an awesome update to Modula over the last few months and can’t wait to release it to the public. But, before that can happen, we need the help of amazing users in the WordPress community (just like you) to improve Modula 2.0’s first beta.', 'modula-gallery' ); ?></p>
|
26 |
+
<div class="center">
|
27 |
+
<br>
|
28 |
+
<a href="https://machothemes.com/downloads/modula-2.0.0.zip" target="_blank" class="button button-primary button-hero"><?php echo __( 'Download Modula 2.0 Beta', 'modula-gallery' ); ?></a>
|
29 |
+
<a href="https://www.youtube.com/watch?v=NxrTXQNExh4" data-fancybox class="modula-video"><span class="dashicons dashicons-video-alt3"></span> See Video</a>
|
30 |
+
<br><br>
|
31 |
+
<p><?php echo __( 'Not convinced yet? Keep scrolling to take a look at what’s in store for Modula 2.0…', 'modula-gallery' ); ?></p>
|
32 |
+
</div>
|
33 |
+
</div>
|
34 |
+
</div>
|
35 |
+
<div class="inline-svg">
|
36 |
+
<picture>
|
37 |
+
<img src="<?php echo plugin_dir_url( __FILE__ ) ?>/images/modula-v2-custom-grid.png" alt="">
|
38 |
+
</picture>
|
39 |
+
</div>
|
40 |
+
<div class="feature-section">
|
41 |
+
<h2>Introducing <strong>Custom Grids</strong></h2>
|
42 |
+
</div>
|
43 |
+
<div class="three-col">
|
44 |
+
<div class="col">
|
45 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/landscape-portrait.jpg" data-caption="Take Full Control" data-fancybox="custom-grids"><img src="<?php echo plugin_dir_url( __FILE__ ) ?>/images/modula-v2-landscape-or-portrait.png" alt=""></a>
|
46 |
+
<h4>Take Full Control</h4>
|
47 |
+
<p>We’re proud to introduce custom grids to give you greater flexibility over how you display the images on your website. With Modula 2.0’s new custom grid functionality you have full control over the size of images on your website.</p>
|
48 |
+
</div>
|
49 |
+
<div class="col">
|
50 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/helper-grid.jpg" data-caption="Guidelines to Help you Make the Perfect Gallery" data-fancybox="custom-grids"><img src="<?php echo plugin_dir_url( __FILE__ ) ?>/images/modula-v2-helper-grid.png" alt=""></a>
|
51 |
+
<h4>Guidelines to Help you Make the Perfect Gallery</h4>
|
52 |
+
<p>As a guideline and to make it easier for you to create the perfect grid, we’ve included the helper grid which appears behind your images to indicate every potential layout you could design.</p>
|
53 |
+
</div>
|
54 |
+
<div class="col">
|
55 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/live-preview.jpg" data-caption="Preview your Gallery Without the Hassle" data-fancybox="custom-grids"><img src="<?php echo plugin_dir_url( __FILE__ ) ?>/images/modula-v2-live-preview.png" alt=""></a>
|
56 |
+
<h4>Preview your Gallery Without the Hassle</h4>
|
57 |
+
<p>And, of course, there’s no need to check the front-end every time you make a change, because you can easily preview the changes you make to your gallery in the WordPress admin area.</p>
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
<div class="center">
|
61 |
+
<br>
|
62 |
+
<a href="https://machothemes.com/downloads/modula-2.0.0.zip" target="_blank" class="button button-primary button-hero"><?php echo __( 'Download Modula 2.0 Beta', 'modula-gallery' ); ?></a>
|
63 |
+
<br><br>
|
64 |
+
</div>
|
65 |
+
<div class="feature-section">
|
66 |
+
<h2>Modula 2.0’s new (yet familiar) user interface</h2>
|
67 |
+
</div>
|
68 |
+
<div class="three-col">
|
69 |
+
<div class="col">
|
70 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/galleries-list.jpg" data-caption="Galleries List Screen" data-fancybox="modula-dashboard"><img src="<?php echo plugin_dir_url( __FILE__ ) ?>/images/modula-v2-familiar-dashboard.png" alt=""></a>
|
71 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/gallery-edit.jpg" data-caption="Gallery Edit Screen" data-fancybox="modula-dashboard"></a>
|
72 |
+
<h4>Modula 2.0 Blends in With WordPress</h4>
|
73 |
+
<p>In order to create a more intuitive user interface, we’ve blended our admin dashboard with that of WordPress together.</p>
|
74 |
+
</div>
|
75 |
+
<div class="col">
|
76 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/drag-and-drop-upload.jpg" data-caption="Drag and Drop to Upload" data-fancybox="modula-drag-and-drop"><img src="<?php echo plugin_dir_url( __FILE__ ) ?>/images/modula-v2-drag-and-drop-upload.png" alt=""></a>
|
77 |
+
<h4>Drag and Drop to Upload</h4>
|
78 |
+
<p>Easily drag images into the WordPress admin to add them directly to your gallery</p>
|
79 |
+
</div>
|
80 |
+
<div class="col">
|
81 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/custom-grid-settings.jpg" data-caption="Custom Grid Settings" data-fancybox="modula-settings"><img src="<?php echo plugin_dir_url( __FILE__ ) ?>/images/modula-v2-intuitive-settings.png" alt=""></a>
|
82 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/creative-gallery-settings.jpg" data-caption="Creative Gallery Settings" data-fancybox="modula-settings"></a>
|
83 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/captions-settings.jpg" data-caption="Captions Settings" data-fancybox="modula-settings"></a>
|
84 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/social-settings.jpg" data-caption="Social Settings" data-fancybox="modula-settings"></a>
|
85 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/loading-effects-settings.jpg" data-caption="Loading Effects Settings" data-fancybox="modula-settings"></a>
|
86 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/hover-effects-settings.jpg" data-caption="Hover Effects Settings" data-fancybox="modula-settings"></a>
|
87 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/style-settings.jpg" data-caption="Style Settings" data-fancybox="modula-settings"></a>
|
88 |
+
<a href="<?php echo plugin_dir_url( __FILE__ ) ?>/images/customizations-settings.jpg" data-caption="Customizations Settings" data-fancybox="modula-settings"></a>
|
89 |
+
<h4>Intuitive Settings</h4>
|
90 |
+
<p>Our settings panel has been redesigned to make everything you need easier to access quickly.</p>
|
91 |
+
</div>
|
92 |
+
</div>
|
93 |
+
<div class="center">
|
94 |
+
<br>
|
95 |
+
<a href="https://machothemes.com/downloads/modula-2.0.0.zip" target="_blank" class="button button-primary button-hero"><?php echo __( 'Download Modula 2.0 Beta', 'modula-gallery' ); ?></a>
|
96 |
+
<br><br>
|
97 |
+
</div>
|
98 |
+
|
99 |
+
</div> <!--/.about-wrap-->
|
admin/welcome-screen/sections/modula-v2.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="feature-section one-col">
|
2 |
+
<div class="col">
|
3 |
+
<h2 style="font-size: 2.5em;"><?php echo __( 'New Admin Interface, Custom Grid!', 'modula-gallery' ); ?></h2>
|
4 |
+
<p class="lead-description"><?php echo __( 'Modula 2.0 bring new things like a new admin interface & a new type of gallery.', 'modula-gallery' ); ?></p>
|
5 |
+
<div class="center">
|
6 |
+
<a href="https://www.wp-modula.com/?utm_source=worg&utm_medium=about-page&utm_campaign=upsell" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span>
|
7 |
+
<?php echo __( 'Get Modula Pro', 'modula-gallery' ); ?>
|
8 |
+
</a>
|
9 |
+
</div>
|
10 |
+
</div>
|
11 |
+
</div>
|
lib/class-modula-plugin-rollback.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Modula_Plugin_RollBack {
|
4 |
+
|
5 |
+
public function __construct() {
|
6 |
+
|
7 |
+
/**
|
8 |
+
* $_POST action hook
|
9 |
+
*
|
10 |
+
* @see: https://codex.wordpress.org/Plugin_API/Action_Reference/admin_post_(action)
|
11 |
+
*
|
12 |
+
*/
|
13 |
+
add_action( 'admin_post_modula_rollback', array( $this, 'post_rollback' ) );
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Hook responsible for loading our Rollback JS script
|
17 |
+
*/
|
18 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'rollback_scripts' ) );
|
19 |
+
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* FBFW version rollback.
|
24 |
+
*
|
25 |
+
* Rollback to previous {plugin} version.
|
26 |
+
*
|
27 |
+
* Fired by `admin_post_epfw_rollback` action.
|
28 |
+
*
|
29 |
+
* @since 1.5.0
|
30 |
+
* @access public
|
31 |
+
*/
|
32 |
+
public function post_rollback() {
|
33 |
+
|
34 |
+
check_admin_referer( 'modula_rollback' );
|
35 |
+
|
36 |
+
$plugin_slug = basename( MODULA_FILE_, '.php' );
|
37 |
+
|
38 |
+
// check for const defines
|
39 |
+
if ( ! defined( 'MODULA_PREVIOUS_PLUGIN_VERSION' ) || ! defined( 'MODULA_PLUGIN_BASE' ) ) {
|
40 |
+
wp_die(
|
41 |
+
new WP_Error( 'broke', esc_html__( 'Previous plugin version or plugin basename CONST aren\'t defined.', 'epfw' ) )
|
42 |
+
);
|
43 |
+
}
|
44 |
+
|
45 |
+
if ( class_exists( 'Modula_Rollback' ) ) {
|
46 |
+
$rollback = new Modula_Rollback(
|
47 |
+
array(
|
48 |
+
'version' => MODULA_PREVIOUS_PLUGIN_VERSION,
|
49 |
+
'plugin_name' => MODULA_PLUGIN_BASE,
|
50 |
+
'plugin_slug' => $plugin_slug,
|
51 |
+
'package_url' => sprintf( 'https://downloads.wordpress.org/plugin/%s.%s.zip', 'modula-best-grid-gallery', MODULA_PREVIOUS_PLUGIN_VERSION ),
|
52 |
+
)
|
53 |
+
);
|
54 |
+
$rollback->run();
|
55 |
+
}
|
56 |
+
|
57 |
+
wp_die(
|
58 |
+
'', __( 'Rollback to Previous Version', 'mfbfw' ), array(
|
59 |
+
'response' => 200,
|
60 |
+
)
|
61 |
+
);
|
62 |
+
}
|
63 |
+
|
64 |
+
public function rollback_scripts() {
|
65 |
+
wp_enqueue_script('rollback-script', MODULA_PLUGIN_DIR_URL . 'scripts/rollback.js', MODULA_VERSION ); // Load Rollback script
|
66 |
+
wp_enqueue_script( 'rollback-script' );
|
67 |
+
}
|
68 |
+
|
69 |
+
}
|
70 |
+
|
71 |
+
new Modula_Plugin_RollBack();
|
lib/class-modula-review.php
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Modula_Review {
|
4 |
+
|
5 |
+
private static $instance;
|
6 |
+
private $when = array( 5, 10, 15 );
|
7 |
+
private $value;
|
8 |
+
private $messages;
|
9 |
+
private $link = 'https://wordpress.org/support/plugin/%s/reviews/#new-post';
|
10 |
+
private $slug = '';
|
11 |
+
private $option_name = '';
|
12 |
+
|
13 |
+
function __construct( $args ) {
|
14 |
+
|
15 |
+
if ( isset( $args['slug'] ) ) {
|
16 |
+
$this->slug = $args['slug'];
|
17 |
+
}
|
18 |
+
|
19 |
+
$this->value = $this->value();
|
20 |
+
|
21 |
+
$this->messages = array(
|
22 |
+
'notice' => __( "Hey, I noticed you have installed our plugin for %s day - that's awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation.", 'modula-gallery' ),
|
23 |
+
'rate' => __( 'Ok, you deserve it', 'modula-gallery' ),
|
24 |
+
'rated' => __( 'I already did', 'modula-gallery' ),
|
25 |
+
'no_rate' => __( 'No, not good enough', 'modula-gallery' ),
|
26 |
+
);
|
27 |
+
|
28 |
+
if ( isset( $args['messages'] ) ) {
|
29 |
+
$this->messages = wp_parse_args( $args['messages'], $this->messages );
|
30 |
+
}
|
31 |
+
|
32 |
+
$this->init();
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
public static function get_instance( $args ) {
|
37 |
+
if ( NULL === static::$instance ) {
|
38 |
+
static::$instance = new static( $args );
|
39 |
+
}
|
40 |
+
|
41 |
+
return static::$instance;
|
42 |
+
}
|
43 |
+
|
44 |
+
private function init() {
|
45 |
+
if ( ! is_admin() ) {
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
|
49 |
+
add_action( 'wp_ajax_epsilon_review', array( $this, 'ajax' ) );
|
50 |
+
|
51 |
+
if ( $this->check() ) {
|
52 |
+
add_action( 'admin_notices', array( $this, 'five_star_wp_rate_notice' ) );
|
53 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
|
54 |
+
add_action( 'admin_print_footer_scripts', array( $this, 'ajax_script' ) );
|
55 |
+
}
|
56 |
+
|
57 |
+
}
|
58 |
+
|
59 |
+
private function check() {
|
60 |
+
|
61 |
+
$options = get_option( 'modula-checks' );
|
62 |
+
$option = isset( $options['givemereview'] ) ? $options['givemereview'] : '';
|
63 |
+
|
64 |
+
if ( 'already-rated' == $option ) {
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
if ( $this->value == $option ) {
|
69 |
+
return false;
|
70 |
+
}
|
71 |
+
|
72 |
+
if ( is_array( $this->when ) ) {
|
73 |
+
return in_array( $this->value, $this->when );
|
74 |
+
}
|
75 |
+
|
76 |
+
return ( $this->when == $this->value );
|
77 |
+
|
78 |
+
}
|
79 |
+
|
80 |
+
private function value() {
|
81 |
+
|
82 |
+
$value = get_transient( 'modula-galleries-review' );
|
83 |
+
|
84 |
+
if ( $value ) {
|
85 |
+
return $value;
|
86 |
+
}
|
87 |
+
|
88 |
+
global $wpdb;
|
89 |
+
$galleries = $wpdb->get_var( 'SELECT count(Id) FROM ' . $wpdb->ModulaGalleries );
|
90 |
+
|
91 |
+
set_transient( 'modula-galleries-review', $galleries, 6 * HOUR_IN_SECONDS );
|
92 |
+
|
93 |
+
return $galleries;
|
94 |
+
|
95 |
+
}
|
96 |
+
|
97 |
+
public function five_star_wp_rate_notice() {
|
98 |
+
|
99 |
+
$url = sprintf( $this->link, $this->slug );
|
100 |
+
|
101 |
+
?>
|
102 |
+
<div id="<?php echo $this->slug ?>-epsilon-review-notice" class="notice notice-success is-dismissible">
|
103 |
+
<p><?php echo sprintf( wp_kses_post( $this->messages['notice'] ), $this->value ) ; ?></p>
|
104 |
+
<p class="actions">
|
105 |
+
<a id="epsilon-rate" href="<?php echo esc_url( $url ) ?>" class="button button-primary epsilon-review-button"><?php echo esc_html( $this->messages['rate'] ); ?></a>
|
106 |
+
<a id="epsilon-rated" href="#" class="button button-secondary epsilon-review-button"><?php echo esc_html( $this->messages['rated'] ); ?></a>
|
107 |
+
<a id="epsilon-no-rate" href="#" class="button button-secondary epsilon-review-button"><?php echo esc_html( $this->messages['no_rate'] ); ?></a>
|
108 |
+
</p>
|
109 |
+
</div>
|
110 |
+
<?php
|
111 |
+
}
|
112 |
+
|
113 |
+
public function ajax() {
|
114 |
+
|
115 |
+
check_ajax_referer( 'epsilon-review', 'security' );
|
116 |
+
|
117 |
+
$options = get_option( 'modula-checks', array() );
|
118 |
+
|
119 |
+
if ( isset( $_POST['epsilon-review'] ) ) {
|
120 |
+
$options['givemereview'] = 'already-rated';
|
121 |
+
}else{
|
122 |
+
$options['givemereview'] = $this->value;
|
123 |
+
}
|
124 |
+
|
125 |
+
update_option( 'modula-checks', $options );
|
126 |
+
|
127 |
+
wp_die( 'ok' );
|
128 |
+
|
129 |
+
}
|
130 |
+
|
131 |
+
public function enqueue() {
|
132 |
+
wp_enqueue_script( 'jquery' );
|
133 |
+
}
|
134 |
+
|
135 |
+
public function ajax_script() {
|
136 |
+
|
137 |
+
$ajax_nonce = wp_create_nonce( "epsilon-review" );
|
138 |
+
|
139 |
+
?>
|
140 |
+
|
141 |
+
<script type="text/javascript">
|
142 |
+
jQuery( document ).ready( function( $ ){
|
143 |
+
|
144 |
+
$( '.epsilon-review-button' ).click( function( evt ){
|
145 |
+
var href = $(this).attr('href'),
|
146 |
+
id = $(this).attr('id');
|
147 |
+
|
148 |
+
evt.preventDefault();
|
149 |
+
|
150 |
+
var data = {
|
151 |
+
action: 'epsilon_review',
|
152 |
+
security: '<?php echo $ajax_nonce; ?>',
|
153 |
+
};
|
154 |
+
|
155 |
+
if ( 'epsilon-rated' === id ) {
|
156 |
+
data['epsilon-review'] = 1;
|
157 |
+
}
|
158 |
+
|
159 |
+
$.post( '<?php echo admin_url( 'admin-ajax.php' ) ?>', data, function( response ) {
|
160 |
+
$( '#<?php echo $this->slug ?>-epsilon-review-notice' ).slideUp( 'fast', function() {
|
161 |
+
$( this ).remove();
|
162 |
+
} );
|
163 |
+
|
164 |
+
if ( 'epsilon-rate' === id ) {
|
165 |
+
window.location.href = href;
|
166 |
+
}
|
167 |
+
|
168 |
+
});
|
169 |
+
|
170 |
+
} );
|
171 |
+
|
172 |
+
});
|
173 |
+
</script>
|
174 |
+
|
175 |
+
<?php
|
176 |
+
}
|
177 |
+
}
|
lib/class-modula-rollback.php
ADDED
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit; // Exit if accessed directly.
|
5 |
+
}
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Modula rollback class.
|
9 |
+
*
|
10 |
+
* EPFW rollback handler class is responsible for rolling back EPFW to
|
11 |
+
* previous version.
|
12 |
+
*
|
13 |
+
* @since 1.0.0
|
14 |
+
*/
|
15 |
+
class Modula_Rollback {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Package URL.
|
19 |
+
*
|
20 |
+
* Holds the package URL.
|
21 |
+
*
|
22 |
+
* @since 1.0.0
|
23 |
+
* @access protected
|
24 |
+
*
|
25 |
+
* @var string Package URL.
|
26 |
+
*/
|
27 |
+
protected $package_url;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Version.
|
31 |
+
*
|
32 |
+
* Holds the version.
|
33 |
+
*
|
34 |
+
* @since 1.0.0
|
35 |
+
* @access protected
|
36 |
+
*
|
37 |
+
* @var string Package URL.
|
38 |
+
*/
|
39 |
+
protected $version;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Plugin name.
|
43 |
+
*
|
44 |
+
* Holds the plugin name.
|
45 |
+
*
|
46 |
+
* @since 1.0.0
|
47 |
+
* @access protected
|
48 |
+
*
|
49 |
+
* @var string Plugin name.
|
50 |
+
*/
|
51 |
+
protected $plugin_name;
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Plugin slug.
|
55 |
+
*
|
56 |
+
* Holds the plugin slug.
|
57 |
+
*
|
58 |
+
* @since 1.0.0
|
59 |
+
* @access protected
|
60 |
+
*
|
61 |
+
* @var string Plugin slug.
|
62 |
+
*/
|
63 |
+
protected $plugin_slug;
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Rollback constructor.
|
67 |
+
*
|
68 |
+
* Initializing EPFW rollback.
|
69 |
+
*
|
70 |
+
* @since 1.0.0
|
71 |
+
* @access public
|
72 |
+
*
|
73 |
+
* @param array $args Optional. Rollback arguments. Default is an empty array.
|
74 |
+
*/
|
75 |
+
public function __construct( $args = array() ) {
|
76 |
+
foreach ( $args as $key => $value ) {
|
77 |
+
$this->{$key} = $value;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Print inline style.
|
83 |
+
*
|
84 |
+
* Add an inline CSS to the rollback page.
|
85 |
+
*
|
86 |
+
* @since 1.0.0
|
87 |
+
* @access private
|
88 |
+
*/
|
89 |
+
private function print_inline_style() {
|
90 |
+
?>
|
91 |
+
<style>
|
92 |
+
.wrap {
|
93 |
+
overflow: hidden;
|
94 |
+
}
|
95 |
+
|
96 |
+
h1 {
|
97 |
+
background: #9b0a46;
|
98 |
+
text-align: center;
|
99 |
+
color: #fff !important;
|
100 |
+
padding: 70px !important;
|
101 |
+
text-transform: uppercase;
|
102 |
+
letter-spacing: 1px;
|
103 |
+
}
|
104 |
+
|
105 |
+
h1 img {
|
106 |
+
max-width: 300px;
|
107 |
+
display: block;
|
108 |
+
margin: auto auto 50px;
|
109 |
+
}
|
110 |
+
</style>
|
111 |
+
<?php
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Apply package.
|
116 |
+
*
|
117 |
+
* Change the plugin data when WordPress checks for updates. This method
|
118 |
+
* modifies package data to update the plugin from a specific URL containing
|
119 |
+
* the version package.
|
120 |
+
*
|
121 |
+
* @since 1.0.0
|
122 |
+
* @access protected
|
123 |
+
*/
|
124 |
+
protected function apply_package() {
|
125 |
+
$update_plugins = get_site_transient( 'update_plugins' );
|
126 |
+
if ( ! is_object( $update_plugins ) ) {
|
127 |
+
$update_plugins = new \stdClass();
|
128 |
+
}
|
129 |
+
|
130 |
+
$plugin_info = new \stdClass();
|
131 |
+
$plugin_info->new_version = $this->version;
|
132 |
+
$plugin_info->slug = $this->plugin_slug;
|
133 |
+
$plugin_info->package = $this->package_url;
|
134 |
+
|
135 |
+
$update_plugins->response[ $this->plugin_name ] = $plugin_info;
|
136 |
+
|
137 |
+
set_site_transient( 'update_plugins', $update_plugins );
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Upgrade.
|
142 |
+
*
|
143 |
+
* Run WordPress upgrade to rollback EPFW to previous version.
|
144 |
+
*
|
145 |
+
* @since 1.0.0
|
146 |
+
* @access protected
|
147 |
+
*/
|
148 |
+
protected function upgrade() {
|
149 |
+
require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
|
150 |
+
|
151 |
+
$logo_url = MODULA_PLUGIN_DIR_URL . 'admin/images/modula.svg';
|
152 |
+
|
153 |
+
$upgrader_args = array(
|
154 |
+
'url' => 'update.php?action=upgrade-plugin&plugin=' . rawurlencode( $this->plugin_name ),
|
155 |
+
'plugin' => $this->plugin_name,
|
156 |
+
'nonce' => 'upgrade-plugin_' . $this->plugin_name,
|
157 |
+
'title' => '<img src="' . $logo_url . '" alt="Modula">' . __( 'Rollback to Previous Version', 'epfw' ),
|
158 |
+
);
|
159 |
+
|
160 |
+
$this->print_inline_style();
|
161 |
+
|
162 |
+
$upgrader = new \Plugin_Upgrader( new \Plugin_Upgrader_Skin( $upgrader_args ) );
|
163 |
+
$upgrader->upgrade( $this->plugin_name );
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Run.
|
168 |
+
*
|
169 |
+
* Rollback EPFW to previous versions.
|
170 |
+
*
|
171 |
+
* @since 1.0.0
|
172 |
+
* @access public
|
173 |
+
*/
|
174 |
+
public function run() {
|
175 |
+
$this->apply_package();
|
176 |
+
$this->upgrade();
|
177 |
+
}
|
178 |
+
}
|
lib/install-db.php
CHANGED
@@ -1,9 +1,7 @@
|
|
1 |
-
|
2 |
<?php
|
3 |
|
4 |
|
5 |
-
function modula_lite_install_db()
|
6 |
-
{
|
7 |
global $wpdb;
|
8 |
|
9 |
$ModulaGalleries = $wpdb->ModulaGalleries;
|
|
|
1 |
<?php
|
2 |
|
3 |
|
4 |
+
function modula_lite_install_db() {
|
|
|
5 |
global $wpdb;
|
6 |
|
7 |
$ModulaGalleries = $wpdb->ModulaGalleries;
|
scripts/rollback.js
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function(){
|
2 |
+
//rollback function
|
3 |
+
jQuery('.modula-rollback-button').on('click', function (event) {
|
4 |
+
var checkD = confirm('Are you sure you want to reinstall previous version?');
|
5 |
+
if( checkD == true ){
|
6 |
+
return true;
|
7 |
+
} else {
|
8 |
+
return false;
|
9 |
+
}
|
10 |
+
});
|
11 |
+
});
|