FooGallery – Image Gallery WordPress Plugin - Version 2.0.40

Version Description

  • Date Updated : 2021-07-20
  • Fix : Added a custom CSS to 3 gallery templates, to avoid incorrect thumb widths with certain themes and SVG thumbnails.
  • Fix : Added logic to generate unique ID's for the gallery container if the gallery is included more than once on a page.
Download this release

Release Info

Developer bradvin
Plugin Icon 128x128 FooGallery – Image Gallery WordPress Plugin
Version 2.0.40
Comparing to
See all releases

Code changes from version 2.0.39 to 2.0.40

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://fooplugins.com
4
  Tags: gallery, image gallery, photo gallery, responsive gallery, wordpress gallery plugin, best gallery plugin, albums, media gallery, video gallery, lightbox
5
  Requires at least: 4.6
6
  Tested up to: 5.8
7
- Stable tag: 2.0.35
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -74,6 +74,7 @@ The following free features make FooGallery the **best gallery plugin** on the m
74
 
75
  = PRO Gallery Features =
76
 
 
77
  * 3 more beautiful PRO responsive gallery templates:
78
  * Polaroid gallery template - [demo](https://fooplugins.com/foogallery/wordpress-polaroid-gallery/)
79
  * Grid gallery template - [demo](https://fooplugins.com/foogallery/wordpress-grid-gallery/)
@@ -211,7 +212,7 @@ Have you enabled retina support for your galleries? To enable retina support, ed
211
 
212
  = Can I add videos to my galleries? =
213
 
214
- Yes, video is supported in FooGallery PRO!
215
 
216
  = Do I need to install a separate plugin to show a lightbox? =
217
 
@@ -244,6 +245,11 @@ Please update in order to for FooGallery to work in WP 5.5+!
244
 
245
  == Changelog ==
246
 
 
 
 
 
 
247
  = 2.0.39 =
248
  * Date Updated : 2021-06-12
249
  * Fix : Changed how attachment full size image details are determined, when there are issues in certain setups
4
  Tags: gallery, image gallery, photo gallery, responsive gallery, wordpress gallery plugin, best gallery plugin, albums, media gallery, video gallery, lightbox
5
  Requires at least: 4.6
6
  Tested up to: 5.8
7
+ Stable tag: 2.0.39
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
74
 
75
  = PRO Gallery Features =
76
 
77
+ * Get started from $19! (Different plans available)
78
  * 3 more beautiful PRO responsive gallery templates:
79
  * Polaroid gallery template - [demo](https://fooplugins.com/foogallery/wordpress-polaroid-gallery/)
80
  * Grid gallery template - [demo](https://fooplugins.com/foogallery/wordpress-grid-gallery/)
212
 
213
  = Can I add videos to my galleries? =
214
 
215
+ Yes, video is supported in FooGallery PRO Expert!
216
 
217
  = Do I need to install a separate plugin to show a lightbox? =
218
 
245
 
246
  == Changelog ==
247
 
248
+ = 2.0.40 =
249
+ * Date Updated : 2021-07-20
250
+ * Fix : Added a custom CSS to 3 gallery templates, to avoid incorrect thumb widths with certain themes and SVG thumbnails.
251
+ * Fix : Added logic to generate unique ID's for the gallery container if the gallery is included more than once on a page.
252
+
253
  = 2.0.39 =
254
  * Date Updated : 2021-06-12
255
  * Fix : Changed how attachment full size image details are determined, when there are issues in certain setups
extensions/default-templates/default/class-default-gallery-template.php CHANGED
@@ -5,31 +5,57 @@ if ( ! class_exists( 'FooGallery_Default_Gallery_Template' ) ) {
5
  define( 'FOOGALLERY_DEFAULT_GALLERY_TEMPLATE_URL', plugin_dir_url( __FILE__ ) );
6
 
7
  class FooGallery_Default_Gallery_Template {
 
 
 
8
  /**
9
  * Wire up everything we need to run the extension
10
  */
11
  function __construct() {
 
12
  add_filter( 'foogallery_gallery_templates', array( $this, 'add_template' ) );
13
 
14
  add_filter( 'foogallery_gallery_templates_files', array( $this, 'register_myself' ) );
15
 
16
  //build up the thumb dimensions from some arguments
17
- add_filter( 'foogallery_calculate_thumbnail_dimensions-default', array(
18
- $this,
19
- 'build_thumbnail_dimensions_from_arguments'
20
- ), 10, 2 );
21
 
22
  //build up the thumb dimensions on save
23
- add_filter( 'foogallery_template_thumbnail_dimensions-default', array(
24
- $this,
25
- 'get_thumbnail_dimensions'
26
- ), 10, 2 );
27
 
28
  //build up the arguments needed for rendering this template
29
- add_filter( 'foogallery_gallery_template_arguments-default', array(
30
- $this,
31
- 'build_gallery_template_arguments'
32
- ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
34
 
35
  /**
@@ -54,7 +80,7 @@ if ( ! class_exists( 'FooGallery_Default_Gallery_Template' ) ) {
54
  */
55
  function add_template( $gallery_templates ) {
56
  $gallery_templates[] = array(
57
- 'slug' => 'default',
58
  'name' => __( 'Responsive Image Gallery', 'foogallery' ),
59
  'preview_support' => true,
60
  'common_fields_support' => true,
5
  define( 'FOOGALLERY_DEFAULT_GALLERY_TEMPLATE_URL', plugin_dir_url( __FILE__ ) );
6
 
7
  class FooGallery_Default_Gallery_Template {
8
+
9
+ const TEMPLATE_ID = 'default';
10
+
11
  /**
12
  * Wire up everything we need to run the extension
13
  */
14
  function __construct() {
15
+ // @formatter:off
16
  add_filter( 'foogallery_gallery_templates', array( $this, 'add_template' ) );
17
 
18
  add_filter( 'foogallery_gallery_templates_files', array( $this, 'register_myself' ) );
19
 
20
  //build up the thumb dimensions from some arguments
21
+ add_filter( 'foogallery_calculate_thumbnail_dimensions-default', array( $this, 'build_thumbnail_dimensions_from_arguments' ), 10, 2 );
 
 
 
22
 
23
  //build up the thumb dimensions on save
24
+ add_filter( 'foogallery_template_thumbnail_dimensions-default', array( $this, 'get_thumbnail_dimensions' ), 10, 2 );
 
 
 
25
 
26
  //build up the arguments needed for rendering this template
27
+ add_filter( 'foogallery_gallery_template_arguments-default', array( $this, 'build_gallery_template_arguments' ) );
28
+
29
+ // add a style block for the gallery based on the thumbnail width.
30
+ add_action( 'foogallery_loaded_template_before', array( $this, 'add_width_style_block' ), 10, 1 );
31
+ // @formatter:on
32
+ }
33
+
34
+ /**
35
+ * Add a style block based on the width thumbnail size
36
+ *
37
+ * @param $gallery FooGallery
38
+ */
39
+ function add_width_style_block( $gallery ) {
40
+ if ( self::TEMPLATE_ID !== $gallery->gallery_template ) {
41
+ return;
42
+ }
43
+
44
+ $id = $gallery->container_id();
45
+ $dimensions = foogallery_gallery_template_setting('thumbnail_dimensions');
46
+ if ( is_array( $dimensions ) && array_key_exists( 'width', $dimensions ) && intval( $dimensions['width'] ) > 0 ) {
47
+ $width = intval( $dimensions['width'] );
48
+
49
+ // @formatter:off
50
+ ?>
51
+ <style type="text/css">
52
+ <?php echo '#' . $id; ?> .fg-image {
53
+ width: <?php echo $width; ?>px;
54
+ }
55
+ </style>
56
+ <?php
57
+ // @formatter:on
58
+ }
59
  }
60
 
61
  /**
80
  */
81
  function add_template( $gallery_templates ) {
82
  $gallery_templates[] = array(
83
+ 'slug' => self::TEMPLATE_ID,
84
  'name' => __( 'Responsive Image Gallery', 'foogallery' ),
85
  'preview_support' => true,
86
  'common_fields_support' => true,
extensions/default-templates/image-viewer/class-image-viewer-gallery-template.php CHANGED
@@ -5,6 +5,9 @@ if ( !class_exists( 'FooGallery_Image_Viewer_Gallery_Template' ) ) {
5
  define('FOOGALLERY_IMAGE_VIEWER_GALLERY_TEMPLATE_URL', plugin_dir_url( __FILE__ ));
6
 
7
  class FooGallery_Image_Viewer_Gallery_Template {
 
 
 
8
  /**
9
  * Wire up everything we need to run the extension
10
  */
@@ -32,11 +35,41 @@ if ( !class_exists( 'FooGallery_Image_Viewer_Gallery_Template' ) ) {
32
 
33
  //add the data options needed for image viewer
34
  add_filter( 'foogallery_build_container_data_options-image-viewer', array( $this, 'add_data_options' ), 10, 3 );
 
 
 
35
  }
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  function alter_field_value( $value, $field, $gallery, $template ) {
38
  //only do something if we are dealing with the thumbnail_dimensions field in this template
39
- if ( 'image-viewer' === $template['slug'] && 'thumbnail_size' === $field['id'] ) {
40
  if ( !array_key_exists( 'crop', $value ) ) {
41
  $value['crop'] = true;
42
  }
@@ -65,7 +98,7 @@ if ( !class_exists( 'FooGallery_Image_Viewer_Gallery_Template' ) ) {
65
  function add_template( $gallery_templates ) {
66
 
67
  $gallery_templates[] = array(
68
- 'slug' => 'image-viewer',
69
  'name' => __( 'Image Viewer', 'foogallery' ),
70
  'preview_support' => true,
71
  'common_fields_support' => true,
5
  define('FOOGALLERY_IMAGE_VIEWER_GALLERY_TEMPLATE_URL', plugin_dir_url( __FILE__ ));
6
 
7
  class FooGallery_Image_Viewer_Gallery_Template {
8
+
9
+ const TEMPLATE_ID = 'image-viewer';
10
+
11
  /**
12
  * Wire up everything we need to run the extension
13
  */
35
 
36
  //add the data options needed for image viewer
37
  add_filter( 'foogallery_build_container_data_options-image-viewer', array( $this, 'add_data_options' ), 10, 3 );
38
+
39
+ // add a style block for the gallery based on the thumbnail width.
40
+ add_action( 'foogallery_loaded_template_before', array( $this, 'add_width_style_block' ), 10, 1 );
41
  }
42
 
43
+ /**
44
+ * Add a style block based on the width thumbnail size
45
+ *
46
+ * @param $gallery FooGallery
47
+ */
48
+ function add_width_style_block( $gallery ) {
49
+ if ( self::TEMPLATE_ID !== $gallery->gallery_template ) {
50
+ return;
51
+ }
52
+
53
+ $id = $gallery->container_id();
54
+ $dimensions = foogallery_gallery_template_setting('thumbnail_size');
55
+ if ( is_array( $dimensions ) && array_key_exists( 'width', $dimensions ) && intval( $dimensions['width'] ) > 0 ) {
56
+ $width = intval( $dimensions['width'] );
57
+
58
+ // @formatter:off
59
+ ?>
60
+ <style type="text/css">
61
+ <?php echo '#' . $id; ?> .fg-image {
62
+ width: <?php echo $width; ?>px;
63
+ }
64
+ </style>
65
+ <?php
66
+ // @formatter:on
67
+ }
68
+ }
69
+
70
  function alter_field_value( $value, $field, $gallery, $template ) {
71
  //only do something if we are dealing with the thumbnail_dimensions field in this template
72
+ if ( self::TEMPLATE_ID === $template['slug'] && 'thumbnail_size' === $field['id'] ) {
73
  if ( !array_key_exists( 'crop', $value ) ) {
74
  $value['crop'] = true;
75
  }
98
  function add_template( $gallery_templates ) {
99
 
100
  $gallery_templates[] = array(
101
+ 'slug' => self::TEMPLATE_ID,
102
  'name' => __( 'Image Viewer', 'foogallery' ),
103
  'preview_support' => true,
104
  'common_fields_support' => true,
foogallery.php CHANGED
@@ -3,10 +3,10 @@
3
  /*
4
  Plugin Name: FooGallery
5
  Description: FooGallery is the most intuitive and extensible gallery management tool ever created for WordPress
6
- Version: 2.0.39
7
  Author: FooPlugins
8
- Plugin URI: http://fooplugins.com/foogallery/
9
- Author URI: http://fooplugins.com
10
  Text Domain: foogallery
11
  License: GPL-2.0+
12
  Domain Path: /languages
@@ -25,7 +25,7 @@ if ( function_exists( 'foogallery_fs' ) ) {
25
  define( 'FOOGALLERY_PATH', plugin_dir_path( __FILE__ ) );
26
  define( 'FOOGALLERY_URL', plugin_dir_url( __FILE__ ) );
27
  define( 'FOOGALLERY_FILE', __FILE__ );
28
- define( 'FOOGALLERY_VERSION', '2.0.39' );
29
  define( 'FOOGALLERY_SETTINGS_VERSION', '2' );
30
  require_once FOOGALLERY_PATH . 'includes/constants.php';
31
  // Create a helper function for easy SDK access.
3
  /*
4
  Plugin Name: FooGallery
5
  Description: FooGallery is the most intuitive and extensible gallery management tool ever created for WordPress
6
+ Version: 2.0.40
7
  Author: FooPlugins
8
+ Plugin URI: https://fooplugins.com/foogallery/
9
+ Author URI: https://fooplugins.com
10
  Text Domain: foogallery
11
  License: GPL-2.0+
12
  Domain Path: /languages
25
  define( 'FOOGALLERY_PATH', plugin_dir_path( __FILE__ ) );
26
  define( 'FOOGALLERY_URL', plugin_dir_url( __FILE__ ) );
27
  define( 'FOOGALLERY_FILE', __FILE__ );
28
+ define( 'FOOGALLERY_VERSION', '2.0.40' );
29
  define( 'FOOGALLERY_SETTINGS_VERSION', '2' );
30
  require_once FOOGALLERY_PATH . 'includes/constants.php';
31
  // Create a helper function for easy SDK access.
includes/class-foogallery.php CHANGED
@@ -545,12 +545,36 @@ class FooGallery extends stdClass {
545
  return $this->datasource_name !== foogallery_default_datasource();
546
  }
547
 
 
 
548
  /**
549
  * Returns the ID that is rendered on the container div of the gallery
550
  *
551
  * @return string
552
  */
553
  public function container_id() {
554
- return 'foogallery-gallery-' . $this->ID;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555
  }
556
  }
545
  return $this->datasource_name !== foogallery_default_datasource();
546
  }
547
 
548
+ private $container_id;
549
+
550
  /**
551
  * Returns the ID that is rendered on the container div of the gallery
552
  *
553
  * @return string
554
  */
555
  public function container_id() {
556
+ if ( isset( $this->container_id ) ) {
557
+ return $this->container_id;
558
+ }
559
+
560
+ global $foogallery_container_ids;
561
+
562
+ if ( !isset( $foogallery_container_ids ) ) {
563
+ $foogallery_container_ids = array();
564
+ }
565
+ $foogallery_container_id = 'foogallery-gallery-' . $this->ID;
566
+
567
+ if ( array_key_exists( $this->ID, $foogallery_container_ids ) ) {
568
+ //The FooGallery has already been added to the page, so we need to generate a new container_id
569
+
570
+ $count = count( $foogallery_container_ids[$this->ID] );
571
+ $foogallery_container_id .= '_' . $count;
572
+ }
573
+
574
+ $foogallery_container_ids[$this->ID][] = $foogallery_container_id;
575
+
576
+ $this->container_id = $foogallery_container_id;
577
+
578
+ return $foogallery_container_id;
579
  }
580
  }
js/foogallery.admin.min.js CHANGED
@@ -1,9 +1,9 @@
1
- /*
2
- * FooGallery - The Most Intuitive and Extensible Gallery Creation and Management Tool Ever Created for WordPress
3
- * @version 2.0.16
4
- * @link
5
- * @copyright Steven Usher & Brad Vincent 2015
6
- * @license Released under the GPLv3 license.
7
- */
8
-
9
  !function(a,b,c,d,e){b.Settings=c.Class.extend({construct:function(c,f){var g=this;g.$el=d.jq(c)?c:a(c),g.opt=e.extend({},b.Settings.defaults,f),g.mqlMobile=window.matchMedia("(max-width: "+g.opt.mobile+"px)"),g.isMobile=g.mqlMobile.matches,g.mqlHover=window.matchMedia("(hover: hover)"),g.canHover=g.mqlHover.matches,g.tabs=new b.Settings.VerticalTabs(g),g.onMqlMobileChanged=g.onMqlMobileChanged.bind(g),g.onMqlHoverChanged=g.onMqlHoverChanged.bind(g)},init:function(){var a=this;a.tabs.init(),a.isMobile&&a.setupMobile(),a.canHover&&a.setupHover(),a.mqlMobile.addListener(a.onMqlMobileChanged),a.mqlHover.addListener(a.onMqlHoverChanged)},destroy:function(){var a=this;a.tabs.destroy(),a.mqlMobile.removeListener(a.onMqlMobileChanged),a.mqlMobile.removeListener(a.onMqlHoverChanged)},setupMobile:function(){var a=this;a.$el.addClass("is-mobile"),a.tabs.setupMobile()},teardownMobile:function(){var a=this;a.$el.removeClass("is-mobile"),a.tabs.teardownMobile()},setupHover:function(){var a=this;a.$el.addClass("can-hover"),a.tabs.setupHover()},teardownHover:function(){var a=this;a.$el.removeClass("can-hover"),a.tabs.teardownHover()},onMqlMobileChanged:function(a){var b=this;(b.isMobile=a.matches)?b.setupMobile():b.teardownMobile()},onMqlHoverChanged:function(a){var b=this;(b.canHover=a.matches)?b.setupHover():b.teardownHover()}}),b.Settings.defaults={mobile:960},a(function(){b.settings=new b.Settings(".foogallery-settings",{mobile:960}),b.settings.init()})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj),function(a,b,c,d,e){b.Settings.VerticalTabs=c.Class.extend({construct:function(a){var b=this;b.settings=a,b.$tabs=null,b.$contents=null,b.children=[]},init:function(){var a=this,c=a.settings.$el;a.$tabs=c.children(".foogallery-vertical-tabs"),a.$contents=c.children(".foogallery-tab-contents"),a.children=a.$tabs.children(".foogallery-vertical-tab").map(function(c,d){var e=new b.Settings.VerticalTabs.Tab(a,d);return e.init(),e}).get()},destroy:function(){this.children.forEach(function(a){a.destroy()})},setupMobile:function(){this.children.forEach(function(a){a.setupMobile()})},teardownMobile:function(){this.children.forEach(function(a){a.teardownMobile()})},setupHover:function(){this.children.forEach(function(a){a.setupHover()})},teardownHover:function(){this.children.forEach(function(a){a.teardownHover()})},hideMenu:function(){this.children.forEach(function(a){a.toggleMenu(!1)})},showMenu:function(a){this.children.forEach(function(b){b.toggleMenu(b.name===a)})}}),b.Settings.VerticalTabs.Tab=c.Class.extend({construct:function(b,c){var e=this;e.vt=b,e.$el=d.jq(c)?c:a(c),e.name=null,e.selector=null,e.$content=null,e.$tabs=null,e.$header=null,e.children=[],e.target=null,e.hasChildren=!1,e._enter=null,e._leave=null,e.onClick=e.onClick.bind(e),e.onDocumentClick=e.onDocumentClick.bind(e),e.onMouseEnter=e.onMouseEnter.bind(e),e.onMouseLeave=e.onMouseLeave.bind(e)},init:function(){var c=this;c.name=c.$el.data("name"),c.selector='[data-name="'+c.name+'"]',c.$content=c.vt.$contents.find(c.selector),c.$tabs=c.$el.children(".foogallery-vertical-child-tabs"),c.children=c.$tabs.children(".foogallery-vertical-child-tab").map(function(a,d){var e=new b.Settings.VerticalTabs.Tab(c.vt,d);return e.init(),e}).get(),c.hasChildren=c.children.length>0,c.target=c.children.find(function(a){return a.name===c.name})||null,c.$header=a("<div/>",{class:"foogallery-vertical-child-header"}).append(a("<span/>",{class:"foogallery-tab-text",text:c.$el.children(".foogallery-tab-text").first().text()})),c.$el.on("click",c.onClick)},destroy:function(){var a=this;a.$el.off("click",a.onClick)},setupMobile:function(){var a=this;a.$tabs.prepend(a.$header)},teardownMobile:function(){this.$header.remove()},setupHover:function(){var a=this;a.$el.on({mouseenter:a.onMouseEnter,mouseleave:a.onMouseLeave})},teardownHover:function(){var a=this;a.$el.off({mouseenter:a.onMouseEnter,mouseleave:a.onMouseLeave})},activate:function(){var a=this;if(a.target instanceof b.Settings.VerticalTabs.Tab)a.target.activate();else{a.vt.$tabs.add(a.vt.$contents).find(".foogallery-tab-active").removeClass("foogallery-tab-active");a.$el.closest(".foogallery-vertical-tab").add(a.$el).add(a.$content).addClass("foogallery-tab-active"),a.vt.hideMenu()}},toggleMenu:function(b){var c=this,e=c.$el.closest(".foogallery-vertical-tab");b=d.undef(b)?!e.hasClass("foogallery-show-child-menu"):!!b,e.toggleClass("foogallery-show-child-menu",b),b?a(document).on("click",c.onDocumentClick):a(document).off("click",c.onDocumentClick)},onMouseEnter:function(a){var b=this;b.hasChildren&&(clearTimeout(b._leave),b._leave=null,null===b._enter&&(b._enter=setTimeout(function(){b.$el.addClass("foogallery-show-child-menu"),b._enter=null},300)))},onMouseLeave:function(a){var b=this;b.hasChildren&&(clearTimeout(b._enter),b._enter=null,null===b._leave&&(b._leave=setTimeout(function(){b.$el.removeClass("foogallery-show-child-menu"),b._leave=null},300)))},onClick:function(a){a.preventDefault(),a.stopPropagation();var b=this;b.hasChildren&&b.vt.settings.isMobile&&!b.vt.settings.canHover?b.toggleMenu():b.activate()},onDocumentClick:function(a){a.preventDefault(),this.toggleMenu(!1)}})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj);
1
+ /*
2
+ * FooGallery - The Most Intuitive and Extensible Gallery Creation and Management Tool Ever Created for WordPress
3
+ * @version 2.0.16
4
+ * @link
5
+ * @copyright Steven Usher & Brad Vincent 2015
6
+ * @license Released under the GPLv3 license.
7
+ */
8
+
9
  !function(a,b,c,d,e){b.Settings=c.Class.extend({construct:function(c,f){var g=this;g.$el=d.jq(c)?c:a(c),g.opt=e.extend({},b.Settings.defaults,f),g.mqlMobile=window.matchMedia("(max-width: "+g.opt.mobile+"px)"),g.isMobile=g.mqlMobile.matches,g.mqlHover=window.matchMedia("(hover: hover)"),g.canHover=g.mqlHover.matches,g.tabs=new b.Settings.VerticalTabs(g),g.onMqlMobileChanged=g.onMqlMobileChanged.bind(g),g.onMqlHoverChanged=g.onMqlHoverChanged.bind(g)},init:function(){var a=this;a.tabs.init(),a.isMobile&&a.setupMobile(),a.canHover&&a.setupHover(),a.mqlMobile.addListener(a.onMqlMobileChanged),a.mqlHover.addListener(a.onMqlHoverChanged)},destroy:function(){var a=this;a.tabs.destroy(),a.mqlMobile.removeListener(a.onMqlMobileChanged),a.mqlMobile.removeListener(a.onMqlHoverChanged)},setupMobile:function(){var a=this;a.$el.addClass("is-mobile"),a.tabs.setupMobile()},teardownMobile:function(){var a=this;a.$el.removeClass("is-mobile"),a.tabs.teardownMobile()},setupHover:function(){var a=this;a.$el.addClass("can-hover"),a.tabs.setupHover()},teardownHover:function(){var a=this;a.$el.removeClass("can-hover"),a.tabs.teardownHover()},onMqlMobileChanged:function(a){var b=this;(b.isMobile=a.matches)?b.setupMobile():b.teardownMobile()},onMqlHoverChanged:function(a){var b=this;(b.canHover=a.matches)?b.setupHover():b.teardownHover()}}),b.Settings.defaults={mobile:960},a(function(){b.settings=new b.Settings(".foogallery-settings",{mobile:960}),b.settings.init()})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj),function(a,b,c,d,e){b.Settings.VerticalTabs=c.Class.extend({construct:function(a){var b=this;b.settings=a,b.$tabs=null,b.$contents=null,b.children=[]},init:function(){var a=this,c=a.settings.$el;a.$tabs=c.children(".foogallery-vertical-tabs"),a.$contents=c.children(".foogallery-tab-contents"),a.children=a.$tabs.children(".foogallery-vertical-tab").map(function(c,d){var e=new b.Settings.VerticalTabs.Tab(a,d);return e.init(),e}).get()},destroy:function(){this.children.forEach(function(a){a.destroy()})},setupMobile:function(){this.children.forEach(function(a){a.setupMobile()})},teardownMobile:function(){this.children.forEach(function(a){a.teardownMobile()})},setupHover:function(){this.children.forEach(function(a){a.setupHover()})},teardownHover:function(){this.children.forEach(function(a){a.teardownHover()})},hideMenu:function(){this.children.forEach(function(a){a.toggleMenu(!1)})},showMenu:function(a){this.children.forEach(function(b){b.toggleMenu(b.name===a)})}}),b.Settings.VerticalTabs.Tab=c.Class.extend({construct:function(b,c){var e=this;e.vt=b,e.$el=d.jq(c)?c:a(c),e.name=null,e.selector=null,e.$content=null,e.$tabs=null,e.$header=null,e.children=[],e.target=null,e.hasChildren=!1,e._enter=null,e._leave=null,e.onClick=e.onClick.bind(e),e.onDocumentClick=e.onDocumentClick.bind(e),e.onMouseEnter=e.onMouseEnter.bind(e),e.onMouseLeave=e.onMouseLeave.bind(e)},init:function(){var c=this;c.name=c.$el.data("name"),c.selector='[data-name="'+c.name+'"]',c.$content=c.vt.$contents.find(c.selector),c.$tabs=c.$el.children(".foogallery-vertical-child-tabs"),c.children=c.$tabs.children(".foogallery-vertical-child-tab").map(function(a,d){var e=new b.Settings.VerticalTabs.Tab(c.vt,d);return e.init(),e}).get(),c.hasChildren=c.children.length>0,c.target=c.children.find(function(a){return a.name===c.name})||null,c.$header=a("<div/>",{class:"foogallery-vertical-child-header"}).append(a("<span/>",{class:"foogallery-tab-text",text:c.$el.children(".foogallery-tab-text").first().text()})),c.$el.on("click",c.onClick)},destroy:function(){var a=this;a.$el.off("click",a.onClick)},setupMobile:function(){var a=this;a.$tabs.prepend(a.$header)},teardownMobile:function(){this.$header.remove()},setupHover:function(){var a=this;a.$el.on({mouseenter:a.onMouseEnter,mouseleave:a.onMouseLeave})},teardownHover:function(){var a=this;a.$el.off({mouseenter:a.onMouseEnter,mouseleave:a.onMouseLeave})},activate:function(){var a=this;if(a.target instanceof b.Settings.VerticalTabs.Tab)a.target.activate();else{a.vt.$tabs.add(a.vt.$contents).find(".foogallery-tab-active").removeClass("foogallery-tab-active");a.$el.closest(".foogallery-vertical-tab").add(a.$el).add(a.$content).addClass("foogallery-tab-active"),a.vt.hideMenu()}},toggleMenu:function(b){var c=this,e=c.$el.closest(".foogallery-vertical-tab");b=d.undef(b)?!e.hasClass("foogallery-show-child-menu"):!!b,e.toggleClass("foogallery-show-child-menu",b),b?a(document).on("click",c.onDocumentClick):a(document).off("click",c.onDocumentClick)},onMouseEnter:function(a){var b=this;b.hasChildren&&(clearTimeout(b._leave),b._leave=null,null===b._enter&&(b._enter=setTimeout(function(){b.$el.addClass("foogallery-show-child-menu"),b._enter=null},300)))},onMouseLeave:function(a){var b=this;b.hasChildren&&(clearTimeout(b._enter),b._enter=null,null===b._leave&&(b._leave=setTimeout(function(){b.$el.removeClass("foogallery-show-child-menu"),b._leave=null},300)))},onClick:function(a){a.preventDefault(),a.stopPropagation();var b=this;b.hasChildren&&b.vt.settings.isMobile&&!b.vt.settings.canHover?b.toggleMenu():b.activate()},onDocumentClick:function(a){a.preventDefault(),this.toggleMenu(!1)}})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj);