FooGallery – Image Gallery WordPress Plugin - Version 1.9.53

Version Description

  • Date Updated : 2021-23-01
  • Update : FooGallery client side 1.4.26
Download this release

Release Info

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

Code changes from version 1.9.44 to 1.9.53

Files changed (41) hide show
  1. README.md +1 -1
  2. README.txt +59 -5
  3. css/admin-page-foogallery-settings.css +5 -0
  4. extensions/albums/album-default.php +1 -1
  5. extensions/albums/album-stack.php +1 -5
  6. extensions/albums/public/class-foogallery-album-template-loader.php +1 -1
  7. extensions/default-templates/functions.php +15 -0
  8. extensions/default-templates/image-viewer/class-image-viewer-gallery-template.php +2 -35
  9. extensions/default-templates/image-viewer/gallery-image-viewer.php +9 -4
  10. extensions/default-templates/shared/js/foogallery.js +15 -13
  11. extensions/default-templates/shared/js/foogallery.min.js +5 -5
  12. extensions/nextgen-importer/view-importer.php +1 -1
  13. foogallery.php +4 -2
  14. freemius/LICENSE.txt +673 -673
  15. gutenberg/class-foogallery-rest-routes.php +1 -1
  16. includes/WPThumb/wpthumb.php +1 -1
  17. includes/admin/boilerplates/blank/foogallery-EXTSLUG.txt +1 -1
  18. includes/admin/class-admin-notices.php +9 -7
  19. includes/admin/class-admin.php +6 -0
  20. includes/admin/class-gallery-metabox-settings-helper.php +23 -4
  21. includes/admin/class-settings.php +124 -0
  22. includes/class-foogallery-attachment.php +1 -1
  23. includes/class-foogallery-lazyload.php +13 -7
  24. includes/class-gallery-advanced-settings.php +1 -1
  25. includes/class-il8n.php +56 -0
  26. includes/compatibility/class-foovideo-compatibility.php +1 -1
  27. includes/compatibility/class-polylang-compatibility.php +1 -1
  28. includes/constants.php +1 -0
  29. includes/extensions/class-extension.php +2 -2
  30. includes/extensions/class-extensions-api.php +5 -5
  31. includes/foopluginbase/bootstrapper.php +1 -1
  32. includes/foopluginbase/classes/class-foo-plugin-base.php +1 -1
  33. includes/functions.php +63 -7
  34. includes/includes.php +1 -0
  35. includes/public/class-aioseo-sitemaps.php +60 -2
  36. includes/render-functions.php +1 -5
  37. js/admin-foogallery-attachment-autosave.js +14 -1
  38. js/{admin-foogallery.js → admin-foogallery-edit.js} +0 -0
  39. js/foogallery.admin.min.js +1 -1
  40. lib/selectize/foogallery.selectize.js +3 -2
  41. wpml-config.xml +18 -0
README.md CHANGED
@@ -2,6 +2,6 @@
2
 
3
  Why choose FooGallery? Stunning gallery layouts, responsive, retina-ready, lightning fast, easy to use.
4
 
5
- [FooGallery Homepage](http://fooplugins.com/foogallery/)
6
 
7
  [FooGallery on wordpress.org](https://wordpress.org/plugins/foogallery/)
2
 
3
  Why choose FooGallery? Stunning gallery layouts, responsive, retina-ready, lightning fast, easy to use.
4
 
5
+ [FooGallery Homepage](https://fooplugins.com/foogallery/)
6
 
7
  [FooGallery on wordpress.org](https://wordpress.org/plugins/foogallery/)
README.txt CHANGED
@@ -1,7 +1,7 @@
1
- === Image Gallery & Responsive Photo Gallery - FooGallery ===
2
  Contributors: bradvin, steveush, fooplugins
3
  Donate link: https://fooplugins.com
4
- Tags: best gallery plugin, gallery, image gallery, photo gallery, wordpress gallery plugin, responsive gallery, albums, media gallery, video gallery, lightbox
5
  Requires at least: 3.9
6
  Tested up to: 5.6
7
  Stable tag: trunk
@@ -71,7 +71,7 @@ The following free features make FooGallery the **best gallery plugin** on the m
71
  * Import video from Youtube, Vimeo and others
72
  * Self-hosted videos
73
  * Filtered image gallery using Media Tags or Categories - [demo](https://fooplugins.com/foogallery/wordpress-filtered-gallery/)
74
- * Multi-level filtering for galleries
75
  * Media tags and media category management for attachments
76
  * PRO image and media lightbox built in! [demo](https://fooplugins.com/foogallery/foogallery-pro-lightbox/)
77
  * Dynamic Galleries (load images from other sources):
@@ -80,6 +80,7 @@ The following free features make FooGallery the **best gallery plugin** on the m
80
  * Load all attachments with Media Tags
81
  * Load all attachments with Media Categories
82
  * Load from a folder in Real Media Library
 
83
  * Load featured images from a post/page/custom post type
84
  * 11 beautiful hover effect presets - [demo](https://fooplugins.com/foogallery/hover-presets/)
85
  * 12 CSS thumbnail filters (Instagram) - [demo](https://fooplugins.com/foogallery/thumbnail-filters/)
@@ -107,9 +108,9 @@ When you install FooGallery for the first time, the plugin asks you (the website
107
 
108
  From your website point of view, FooGallery never collects or stores any visitor information at all, when someone visits your website.
109
 
110
- **PHP 7 Compatible**
111
 
112
- FooGallery has been tried and tested on servers running up to PHP 7.4
113
 
114
  **Retina Support**
115
 
@@ -226,6 +227,49 @@ Please update in order to for FooGallery to work in WP 5.5+!
226
 
227
  == Changelog ==
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  = 1.9.44 =
230
  * Date Updated : 2020-12-06
231
  * New : Allow thumb width and height to be overridden with shortcode arguments override_width and override_height
@@ -264,6 +308,7 @@ Please update in order to for FooGallery to work in WP 5.5+!
264
  * Date Updated : 2020-10-12
265
  * Fix : Fix for thumbnail generation not working when upload folder is not HTTPS
266
 
 
267
  = 1.9.34 =
268
  * Date Updated : 2020-08-30
269
  * Fix : Fix for incorrect captions in some scenarios
@@ -274,6 +319,7 @@ Please update in order to for FooGallery to work in WP 5.5+!
274
  * Date Updated : 2020-08-07
275
  * Fix : IMPORTANT fix for WP 5.5 compatibility when editing galleries (gallery preview button was not showing)
276
 
 
277
  = 1.9.30 =
278
  * Date Updated : 2020-08-03
279
  * Fix : IMPORTANT fix for WP 5.5 compatibility when editing galleries (gallery template selector was not showing)
@@ -281,24 +327,28 @@ Please update in order to for FooGallery to work in WP 5.5+!
281
  * Update : improved lightbox messages when no lightboxes are installed
282
  * Update : Freemius SDK 2.4.0.1
283
 
 
284
  = 1.9.28 =
285
  * Date Updated : 2020-07-18
286
  * Fix : Fix for some installs showing thumbnail generation error
287
  * Update : better mobile support for admin settings tabs
288
  * Update : FooGallery client side 1.4.16
289
 
 
290
  = 1.9.26 =
291
  * Date Updated : 2020-06-29
292
  * Fix : Fix for All-In-One album hidden items still clickable
293
  * Fix : Fix for fatal error on some versions of PHP
294
  * Update : FooGallery client side 1.4.15
295
 
 
296
  = 1.9.25 =
297
  * Date Updated : 2020-06-04
298
  * Fix : Fixed bug to prevent infinite loop with ResizeObserver in some themes
299
  * Fix : Fixed possible text-domain issue
300
  * Update : FooGallery client side 1.4.13
301
 
 
302
  = 1.9.24 =
303
  * Date Updated : 2020-05-04
304
  * Fix : Fixed bug where thumbs were not loading on mobile in Justified and Portfolio galleries
@@ -320,6 +370,7 @@ Please update in order to for FooGallery to work in WP 5.5+!
320
  * Update : Freemius SDK 2.3.2
321
  * Update : FooGallery client side 1.4.11
322
 
 
323
  = 1.9.11 =
324
  * Date Updated : 2020-03-29
325
  * Fix : Fix for Simple Portfolio template not saving "None" for captions.
@@ -328,6 +379,7 @@ Please update in order to for FooGallery to work in WP 5.5+!
328
  * Fix : Updated RankMath compatibility to work with pre PHP 5.4
329
  * New : Added filter "foogallery_build_dynamic_gallery" for dynamic gallery creation
330
  * New : Added WPML config file for better translations. (Also improves Polylang compatibility.)
 
331
  * Update : FooGallery client side 1.4.6 (including multiple bug fixes)
332
 
333
  = 1.9.8 =
@@ -349,6 +401,7 @@ Please update in order to for FooGallery to work in WP 5.5+!
349
  = 1.8.18 =
350
  * Date Updated : 2019-10-23
351
  * New : Elementor compatibility - gallery previews in Elementor editor work, and added a FooGallery widget to the Elementor editor
 
352
  * Fix : Images in Yoast SEO sitemaps pull correctly for all types of gallery embedding
353
  * Fix : Lazy-load issues on certain browsers (reverted back to old logic)
354
  * Fix : Updated WPThumb so that images with querystrings in the URL will work
@@ -357,6 +410,7 @@ Please update in order to for FooGallery to work in WP 5.5+!
357
  = 1.8.14 =
358
 
359
  * New : Added setting to move "Add Media" button to front of attachment listing (Advanced tab in FooGallery Settings)
 
360
  * Fix : Lazy-load issues with Gutenberg Editor
361
  * Fix : Simple portfolio layout issue with certain themes
362
  * Update : FooGallery client side 1.3.4
1
+ === Best Image Gallery & Responsive Photo Gallery - FooGallery ===
2
  Contributors: bradvin, steveush, fooplugins
3
  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: 3.9
6
  Tested up to: 5.6
7
  Stable tag: trunk
71
  * Import video from Youtube, Vimeo and others
72
  * Self-hosted videos
73
  * Filtered image gallery using Media Tags or Categories - [demo](https://fooplugins.com/foogallery/wordpress-filtered-gallery/)
74
+ * Multi-level filtering for galleries
75
  * Media tags and media category management for attachments
76
  * PRO image and media lightbox built in! [demo](https://fooplugins.com/foogallery/foogallery-pro-lightbox/)
77
  * Dynamic Galleries (load images from other sources):
80
  * Load all attachments with Media Tags
81
  * Load all attachments with Media Categories
82
  * Load from a folder in Real Media Library
83
+ * Load images from Instagram
84
  * Load featured images from a post/page/custom post type
85
  * 11 beautiful hover effect presets - [demo](https://fooplugins.com/foogallery/hover-presets/)
86
  * 12 CSS thumbnail filters (Instagram) - [demo](https://fooplugins.com/foogallery/thumbnail-filters/)
108
 
109
  From your website point of view, FooGallery never collects or stores any visitor information at all, when someone visits your website.
110
 
111
+ **PHP 8 Compatible**
112
 
113
+ FooGallery has been tried and tested on servers running up to PHP 8
114
 
115
  **Retina Support**
116
 
227
 
228
  == Changelog ==
229
 
230
+ = 1.9.53 =
231
+ * Date Updated : 2021-23-01
232
+ * Update : FooGallery client side 1.4.26
233
+
234
+ = 1.9.52 =
235
+ * Date Updated : 2021-22-01
236
+
237
+
238
+ = 1.9.50 =
239
+ * Date Updated : 2021-21-01
240
+
241
+ * Fix : fixed incorrect settings showing for certain gallery templates
242
+
243
+ = 1.9.49 =
244
+ * Date Updated : 2021-13-01
245
+ * Fix : Advanced settings for a gallery to properly override settings rather than merge
246
+
247
+
248
+ = 1.9.48 =
249
+ * Date Updated : 2021-11-01
250
+ * New : Added global Custom JS & CSS settings which are included for all galleries
251
+ * New : Added global language settings which apply to all galleries
252
+ * Update : Updated All-in-one SEO support to work with AIOSEO v4
253
+ * Update : FooGallery client side 1.4.25
254
+ * Update : updated WPML compatibility to account for new language settings
255
+ * Fix : image URL's with spaces - always ensure image URL's are escaped
256
+ * Fix : fixed PHP warning on activation
257
+ * Test : tested PHP8 support!
258
+
259
+
260
+ = 1.9.47 =
261
+ * Date Updated : 2020-16-10
262
+
263
+
264
+ = 1.9.46 =
265
+ * Date Updated : 2020-15-10
266
+
267
+
268
+ = 1.9.45 =
269
+ * Date Updated : 2020-15-10
270
+ * Fix : Updated albums to use FooGallery stylesheet enqueue function
271
+
272
+
273
  = 1.9.44 =
274
  * Date Updated : 2020-12-06
275
  * New : Allow thumb width and height to be overridden with shortcode arguments override_width and override_height
308
  * Date Updated : 2020-10-12
309
  * Fix : Fix for thumbnail generation not working when upload folder is not HTTPS
310
 
311
+
312
  = 1.9.34 =
313
  * Date Updated : 2020-08-30
314
  * Fix : Fix for incorrect captions in some scenarios
319
  * Date Updated : 2020-08-07
320
  * Fix : IMPORTANT fix for WP 5.5 compatibility when editing galleries (gallery preview button was not showing)
321
 
322
+
323
  = 1.9.30 =
324
  * Date Updated : 2020-08-03
325
  * Fix : IMPORTANT fix for WP 5.5 compatibility when editing galleries (gallery template selector was not showing)
327
  * Update : improved lightbox messages when no lightboxes are installed
328
  * Update : Freemius SDK 2.4.0.1
329
 
330
+
331
  = 1.9.28 =
332
  * Date Updated : 2020-07-18
333
  * Fix : Fix for some installs showing thumbnail generation error
334
  * Update : better mobile support for admin settings tabs
335
  * Update : FooGallery client side 1.4.16
336
 
337
+
338
  = 1.9.26 =
339
  * Date Updated : 2020-06-29
340
  * Fix : Fix for All-In-One album hidden items still clickable
341
  * Fix : Fix for fatal error on some versions of PHP
342
  * Update : FooGallery client side 1.4.15
343
 
344
+
345
  = 1.9.25 =
346
  * Date Updated : 2020-06-04
347
  * Fix : Fixed bug to prevent infinite loop with ResizeObserver in some themes
348
  * Fix : Fixed possible text-domain issue
349
  * Update : FooGallery client side 1.4.13
350
 
351
+
352
  = 1.9.24 =
353
  * Date Updated : 2020-05-04
354
  * Fix : Fixed bug where thumbs were not loading on mobile in Justified and Portfolio galleries
370
  * Update : Freemius SDK 2.3.2
371
  * Update : FooGallery client side 1.4.11
372
 
373
+
374
  = 1.9.11 =
375
  * Date Updated : 2020-03-29
376
  * Fix : Fix for Simple Portfolio template not saving "None" for captions.
379
  * Fix : Updated RankMath compatibility to work with pre PHP 5.4
380
  * New : Added filter "foogallery_build_dynamic_gallery" for dynamic gallery creation
381
  * New : Added WPML config file for better translations. (Also improves Polylang compatibility.)
382
+
383
  * Update : FooGallery client side 1.4.6 (including multiple bug fixes)
384
 
385
  = 1.9.8 =
401
  = 1.8.18 =
402
  * Date Updated : 2019-10-23
403
  * New : Elementor compatibility - gallery previews in Elementor editor work, and added a FooGallery widget to the Elementor editor
404
+
405
  * Fix : Images in Yoast SEO sitemaps pull correctly for all types of gallery embedding
406
  * Fix : Lazy-load issues on certain browsers (reverted back to old logic)
407
  * Fix : Updated WPThumb so that images with querystrings in the URL will work
410
  = 1.8.14 =
411
 
412
  * New : Added setting to move "Add Media" button to front of attachment listing (Advanced tab in FooGallery Settings)
413
+
414
  * Fix : Lazy-load issues with Gutenberg Editor
415
  * Fix : Simple portfolio layout issue with certain themes
416
  * Update : FooGallery client side 1.3.4
css/admin-page-foogallery-settings.css CHANGED
@@ -1,3 +1,8 @@
1
  #foogallery-settings-main div+br {
2
  display: none;
 
 
 
 
 
3
  }
1
  #foogallery-settings-main div+br {
2
  display: none;
3
+ }
4
+
5
+ #custom_assets_tab textarea {
6
+ width: 500px;
7
+ height: 300px;
8
  }
extensions/albums/album-default.php CHANGED
@@ -19,7 +19,7 @@ if ( !empty( $gallery ) ) {
19
  }
20
 
21
  if ( false !== $foogallery ) {
22
- $album_url = foogallery_album_remove_gallery_from_link();
23
  $gallery_title_size = foogallery_album_template_setting('gallery_title_size', 'h2');
24
  echo '<div id="' . $current_foogallery_album->slug . '" class="foogallery-album-header">';
25
  echo '<p><a href="' . esc_url( $album_url ) . '">' . foogallery_get_setting( 'language_back_to_album_text', __( '&laquo; back to album', 'foogallery' ) ) . '</a></p>';
19
  }
20
 
21
  if ( false !== $foogallery ) {
22
+ $album_url = trailingslashit( foogallery_album_remove_gallery_from_link() );
23
  $gallery_title_size = foogallery_album_template_setting('gallery_title_size', 'h2');
24
  echo '<div id="' . $current_foogallery_album->slug . '" class="foogallery-album-header">';
25
  echo '<p><a href="' . esc_url( $album_url ) . '">' . foogallery_get_setting( 'language_back_to_album_text', __( '&laquo; back to album', 'foogallery' ) ) . '</a></p>';
extensions/albums/album-stack.php CHANGED
@@ -25,11 +25,7 @@ $data_options = array(
25
  'randomAngle' => 'true' === $random_angle
26
  );
27
 
28
- if ( defined( 'JSON_UNESCAPED_UNICODE' ) ) {
29
- $data_options = json_encode( $data_options, JSON_UNESCAPED_UNICODE );
30
- } else {
31
- $data_options = json_encode( $data_options );
32
- }
33
 
34
  if ( !function_exists( 'foogallery_album_all_in_one_stack_render_gallery_attachment2' ) ) {
35
  function foogallery_album_all_in_one_stack_render_gallery_attachment2( $gallery, $attachment, $args ) {
25
  'randomAngle' => 'true' === $random_angle
26
  );
27
 
28
+ $data_options = foogallery_json_encode( $data_options );
 
 
 
 
29
 
30
  if ( !function_exists( 'foogallery_album_all_in_one_stack_render_gallery_attachment2' ) ) {
31
  function foogallery_album_all_in_one_stack_render_gallery_attachment2( $gallery, $attachment, $args ) {
extensions/albums/public/class-foogallery-album-template-loader.php CHANGED
@@ -74,7 +74,7 @@ class FooGallery_Album_Template_Loader {
74
 
75
  //try to include some CSS
76
  if ( false !== ($css_location = $loader->locate_file( "album-{$current_foogallery_album_template}.css" )) ) {
77
- wp_enqueue_style( "foogallery-album-template-{$current_foogallery_album_template}", $css_location['url'] );
78
  }
79
 
80
  //finally include the actual php template!
74
 
75
  //try to include some CSS
76
  if ( false !== ($css_location = $loader->locate_file( "album-{$current_foogallery_album_template}.css" )) ) {
77
+ foogallery_enqueue_style( "foogallery-album-template-{$current_foogallery_album_template}", $css_location['url'] );
78
  }
79
 
80
  //finally include the actual php template!
extensions/default-templates/functions.php CHANGED
@@ -10,6 +10,13 @@ function foogallery_enqueue_core_gallery_template_style() {
10
  $filename = foogallery_is_debug() ? '' : '.min';
11
  $css = apply_filters( 'foogallery_core_gallery_style', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_URL . 'css/foogallery' . $filename . '.css' );
12
  foogallery_enqueue_style( 'foogallery-core', $css, array(), FOOGALLERY_VERSION );
 
 
 
 
 
 
 
13
  }
14
 
15
  /**
@@ -19,4 +26,12 @@ function foogallery_enqueue_core_gallery_template_script() {
19
  $filename = foogallery_is_debug() ? '' : '.min';
20
  $js = apply_filters( 'foogallery_core_gallery_script', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_URL . 'js/foogallery' . $filename . '.js' );
21
  wp_enqueue_script( 'foogallery-core', $js, array('jquery'), FOOGALLERY_VERSION );
 
 
 
 
 
 
 
 
22
  }
10
  $filename = foogallery_is_debug() ? '' : '.min';
11
  $css = apply_filters( 'foogallery_core_gallery_style', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_URL . 'css/foogallery' . $filename . '.css' );
12
  foogallery_enqueue_style( 'foogallery-core', $css, array(), FOOGALLERY_VERSION );
13
+
14
+ if ( foogallery_get_setting( 'custom_css', '' ) !== '' ) {
15
+ $custom_assets = get_option( FOOGALLERY_OPTION_CUSTOM_ASSETS );
16
+ if ( is_array( $custom_assets ) && array_key_exists( 'style', $custom_assets ) ) {
17
+ foogallery_enqueue_style( 'foogallery-custom', $custom_assets['style'], array('foogallery-core'), FOOGALLERY_VERSION );
18
+ }
19
+ }
20
  }
21
 
22
  /**
26
  $filename = foogallery_is_debug() ? '' : '.min';
27
  $js = apply_filters( 'foogallery_core_gallery_script', FOOGALLERY_DEFAULT_TEMPLATES_EXTENSION_SHARED_URL . 'js/foogallery' . $filename . '.js' );
28
  wp_enqueue_script( 'foogallery-core', $js, array('jquery'), FOOGALLERY_VERSION );
29
+ do_action( 'foogallery_enqueue_script-core', $js );
30
+
31
+ if ( foogallery_get_setting( 'custom_js', '' ) !== '' ) {
32
+ $custom_assets = get_option( FOOGALLERY_OPTION_CUSTOM_ASSETS );
33
+ if ( is_array( $custom_assets ) && array_key_exists( 'script', $custom_assets ) ) {
34
+ wp_enqueue_script( 'foogallery-custom', $custom_assets['script'], array('foogallery-core'), FOOGALLERY_VERSION );
35
+ }
36
+ }
37
  }
extensions/default-templates/image-viewer/class-image-viewer-gallery-template.php CHANGED
@@ -152,43 +152,10 @@ if ( !class_exists( 'FooGallery_Image_Viewer_Gallery_Template' ) ) {
152
  array(
153
  'id' => 'language-help',
154
  'title' => __( 'Language Help', 'foogallery' ),
155
- 'desc' => __( 'This gallery template shows the below items of text. Change them to suit your preference or language.', 'foogallery' ),
156
  'section' => __( 'General', 'foogallery' ),
157
  'type' => 'help'
158
- ),
159
- array(
160
- 'id' => 'text-prev',
161
- 'title' => __( '"Prev" Text', 'foogallery' ),
162
- 'section' => __( 'General', 'foogallery' ),
163
- 'type' => 'text',
164
- 'default' => __('Prev', 'foogallery'),
165
- 'row_data'=> array(
166
- 'data-foogallery-change-selector' => 'input',
167
- 'data-foogallery-preview' => 'shortcode'
168
- )
169
- ),
170
- array(
171
- 'id' => 'text-of',
172
- 'title' => __( '"of" Text', 'foogallery' ),
173
- 'section' => __( 'General', 'foogallery' ),
174
- 'type' => 'text',
175
- 'default' => __('of', 'foogallery'),
176
- 'row_data'=> array(
177
- 'data-foogallery-change-selector' => 'input',
178
- 'data-foogallery-preview' => 'shortcode'
179
- )
180
- ),
181
- array(
182
- 'id' => 'text-next',
183
- 'title' => __( '"Next" Text', 'foogallery' ),
184
- 'section' => __( 'General', 'foogallery' ),
185
- 'type' => 'text',
186
- 'default' => __('Next', 'foogallery'),
187
- 'row_data'=> array(
188
- 'data-foogallery-change-selector' => 'input',
189
- 'data-foogallery-preview' => 'shortcode'
190
- )
191
- )
192
  )
193
  );
194
 
152
  array(
153
  'id' => 'language-help',
154
  'title' => __( 'Language Help', 'foogallery' ),
155
+ 'desc' => __( 'You can change the "Prev", "Next" and "of" text used in the gallery from the settings page, under the Language tab.', 'foogallery' ),
156
  'section' => __( 'General', 'foogallery' ),
157
  'type' => 'help'
158
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  )
160
  );
161
 
extensions/default-templates/image-viewer/gallery-image-viewer.php CHANGED
@@ -7,14 +7,19 @@
7
  global $current_foogallery;
8
  //the current shortcode args
9
  global $current_foogallery_arguments;
10
- //get our thumbnail sizing args
 
 
 
 
 
 
 
 
11
 
12
  //get which lightbox we want to use
13
  $lightbox = foogallery_gallery_template_setting( 'lightbox', 'unknown' );
14
  $alignment = foogallery_gallery_template_setting( 'alignment', 'fg-center' );
15
- $text_prev = foogallery_gallery_template_setting( 'text-prev', __('Prev', 'foogallery') );
16
- $text_of = foogallery_gallery_template_setting( 'text-of', __('of', 'foogallery') );
17
- $text_next = foogallery_gallery_template_setting( 'text-next', __('Next', 'foogallery') );
18
  $link = foogallery_gallery_template_setting( 'thumbnail_link', 'image' );
19
  $foogallery_imageviewer_classes = foogallery_build_class_attribute_safe( $current_foogallery, 'foogallery-link-' . $link, 'foogallery-lightbox-' . $lightbox, $alignment );
20
  $foogallery_imageviewer_attributes = foogallery_build_container_attributes_safe( $current_foogallery, array( 'class' => $foogallery_imageviewer_classes ) );
7
  global $current_foogallery;
8
  //the current shortcode args
9
  global $current_foogallery_arguments;
10
+
11
+ $text_prev_default = foogallery_get_setting( 'language_imageviewer_prev_text', __('Prev', 'foogallery') );
12
+ $text_prev = foogallery_gallery_template_setting( 'text-prev', $text_prev_default );
13
+
14
+ $text_of_default = foogallery_get_setting( 'language_imageviewer_of_text', __('of', 'foogallery') );
15
+ $text_of = foogallery_gallery_template_setting( 'text-of', $text_of_default );
16
+
17
+ $text_next_default = foogallery_get_setting( 'language_imageviewer_next_text', __('Next', 'foogallery') );
18
+ $text_next = foogallery_gallery_template_setting( 'text-next', $text_next_default );
19
 
20
  //get which lightbox we want to use
21
  $lightbox = foogallery_gallery_template_setting( 'lightbox', 'unknown' );
22
  $alignment = foogallery_gallery_template_setting( 'alignment', 'fg-center' );
 
 
 
23
  $link = foogallery_gallery_template_setting( 'thumbnail_link', 'image' );
24
  $foogallery_imageviewer_classes = foogallery_build_class_attribute_safe( $current_foogallery, 'foogallery-link-' . $link, 'foogallery-lightbox-' . $lightbox, $alignment );
25
  $foogallery_imageviewer_attributes = foogallery_build_container_attributes_safe( $current_foogallery, array( 'class' => $foogallery_imageviewer_classes ) );
extensions/default-templates/shared/js/foogallery.js CHANGED
@@ -2293,12 +2293,14 @@
2293
  * _fn.apply( Test, ["My name", "My value"] ); // => "Test: name = My name, value = My value"
2294
  */
2295
  _.fn.apply = function(klass, args){
2296
- args = _is.array(args) ? args : [];
2297
- function Class() {
2298
- return klass.apply(this, args);
2299
- }
2300
- Class.prototype = klass.prototype;
2301
- return new Class();
 
 
2302
  };
2303
 
2304
  /**
@@ -6104,7 +6106,7 @@
6104
  * @name supportedExifProperties
6105
  * @type {string[]}
6106
  */
6107
- _.supportedExifProperties = ["aperture","camera","date","exposure","focalLength","iso","orientation"];
6108
 
6109
  /**
6110
  * @memberof FooGallery.utils.is
@@ -9915,9 +9917,9 @@
9915
  exif: {
9916
  aperture: null,
9917
  camera: null,
9918
- date: null,
9919
- exposure: null,
9920
- focalLength: null,
9921
  iso: null,
9922
  orientation: null
9923
  },
@@ -9965,9 +9967,9 @@
9965
  exif: {
9966
  aperture: "Aperture",
9967
  camera: "Camera",
9968
- date: "Date",
9969
- exposure: "Exposure",
9970
- focalLength: "Focal Length",
9971
  iso: "ISO",
9972
  orientation: "Orientation"
9973
  }
2293
  * _fn.apply( Test, ["My name", "My value"] ); // => "Test: name = My name, value = My value"
2294
  */
2295
  _.fn.apply = function(klass, args){
2296
+ args.unshift(klass);
2297
+ return new (Function.prototype.bind.apply(klass, args));
2298
+ // args = _is.array(args) ? args : [];
2299
+ // function Class() {
2300
+ // return klass.apply(this, args);
2301
+ // }
2302
+ // Class.prototype = klass.prototype;
2303
+ // return new Class();
2304
  };
2305
 
2306
  /**
6106
  * @name supportedExifProperties
6107
  * @type {string[]}
6108
  */
6109
+ _.supportedExifProperties = ["camera","aperture","created_timestamp","shutter_speed","focal_length","iso","orientation"];
6110
 
6111
  /**
6112
  * @memberof FooGallery.utils.is
9917
  exif: {
9918
  aperture: null,
9919
  camera: null,
9920
+ created_timestamp: null,
9921
+ shutter_speed: null,
9922
+ focal_length: null,
9923
  iso: null,
9924
  orientation: null
9925
  },
9967
  exif: {
9968
  aperture: "Aperture",
9969
  camera: "Camera",
9970
+ created_timestamp: "Date",
9971
+ shutter_speed: "Exposure",
9972
+ focal_length: "Focal Length",
9973
  iso: "ISO",
9974
  orientation: "Orientation"
9975
  }
extensions/default-templates/shared/js/foogallery.min.js CHANGED
@@ -1,12 +1,12 @@
1
  /*
2
  * FooGallery - The Most Intuitive and Extensible Gallery Creation and Management Tool Ever Created for WordPress
3
- * @version 1.4.24
4
  * @link
5
  * @copyright Steven Usher & Brad Vincent 2015
6
  * @license Released under the GPLv3 license.
7
  */
8
 
9
- !function(){"use strict";function a(a){this.time=a.time,this.target=a.target,this.rootBounds=a.rootBounds,this.boundingClientRect=a.boundingClientRect,this.intersectionRect=a.intersectionRect||i(),this.isIntersecting=!!a.intersectionRect;var b=this.boundingClientRect,c=b.width*b.height,d=this.intersectionRect,e=d.width*d.height;this.intersectionRatio=c?Number((e/c).toFixed(4)):this.isIntersecting?1:0}function b(a,b){var c=b||{};if("function"!=typeof a)throw new Error("callback must be a function");if(c.root&&1!=c.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=d(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=a,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(c.rootMargin),this.thresholds=this._initThresholds(c.threshold),this.root=c.root||null,this.rootMargin=this._rootMarginValues.map(function(a){return a.value+a.unit}).join(" ")}function c(){return window.performance&&performance.now&&performance.now()}function d(a,b){var c=null;return function(){c||(c=setTimeout(function(){a(),c=null},b))}}function e(a,b,c,d){"function"==typeof a.addEventListener?a.addEventListener(b,c,d||!1):"function"==typeof a.attachEvent&&a.attachEvent("on"+b,c)}function f(a,b,c,d){"function"==typeof a.removeEventListener?a.removeEventListener(b,c,d||!1):"function"==typeof a.detatchEvent&&a.detatchEvent("on"+b,c)}function g(a,b){var c=Math.max(a.top,b.top),d=Math.min(a.bottom,b.bottom),e=Math.max(a.left,b.left),f=Math.min(a.right,b.right),g=f-e,h=d-c;return g>=0&&h>=0&&{top:c,bottom:d,left:e,right:f,width:g,height:h}}function h(a){var b;try{b=a.getBoundingClientRect()}catch(a){}return b?(b.width&&b.height||(b={top:b.top,right:b.right,bottom:b.bottom,left:b.left,width:b.right-b.left,height:b.bottom-b.top}),b):i()}function i(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function j(a,b){for(var c=b;c;){if(c==a)return!0;c=k(c)}return!1}function k(a){var b=a.parentNode;return b&&11==b.nodeType&&b.host?b.host:b&&b.assignedSlot?b.assignedSlot.parentNode:b}if("object"==typeof window){if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)return void("isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}}));var l=window.document,m=[];b.prototype.THROTTLE_TIMEOUT=100,b.prototype.POLL_INTERVAL=null,b.prototype.USE_MUTATION_OBSERVER=!0,b.prototype.observe=function(a){if(!this._observationTargets.some(function(b){return b.element==a})){if(!a||1!=a.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:a,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},b.prototype.unobserve=function(a){this._observationTargets=this._observationTargets.filter(function(b){return b.element!=a}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},b.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},b.prototype.takeRecords=function(){var a=this._queuedEntries.slice();return this._queuedEntries=[],a},b.prototype._initThresholds=function(a){var b=a||[0];return Array.isArray(b)||(b=[b]),b.sort().filter(function(a,b,c){if("number"!=typeof a||isNaN(a)||a<0||a>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return a!==c[b-1]})},b.prototype._parseRootMargin=function(a){var b=a||"0px",c=b.split(/\s+/).map(function(a){var b=/^(-?\d*\.?\d+)(px|%)$/.exec(a);if(!b)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(b[1]),unit:b[2]}});return c[1]=c[1]||c[0],c[2]=c[2]||c[0],c[3]=c[3]||c[1],c},b.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(e(window,"resize",this._checkForIntersections,!0),e(l,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in window&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(l,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},b.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,f(window,"resize",this._checkForIntersections,!0),f(l,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},b.prototype._checkForIntersections=function(){var b=this._rootIsInDom(),d=b?this._getRootRect():i();this._observationTargets.forEach(function(e){var f=e.element,g=h(f),i=this._rootContainsTarget(f),j=e.entry,k=b&&i&&this._computeTargetAndRootIntersection(f,d),l=e.entry=new a({time:c(),target:f,boundingClientRect:g,rootBounds:d,intersectionRect:k});j?b&&i?this._hasCrossedThreshold(j,l)&&this._queuedEntries.push(l):j&&j.isIntersecting&&this._queuedEntries.push(l):this._queuedEntries.push(l)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},b.prototype._computeTargetAndRootIntersection=function(a,b){if("none"!=window.getComputedStyle(a).display){for(var c=h(a),d=c,e=k(a),f=!1;!f;){var i=null,j=1==e.nodeType?window.getComputedStyle(e):{};if("none"==j.display)return;if(e==this.root||e==l?(f=!0,i=b):e!=l.body&&e!=l.documentElement&&"visible"!=j.overflow&&(i=h(e)),i&&!(d=g(i,d)))break;e=k(e)}return d}},b.prototype._getRootRect=function(){var a;if(this.root)a=h(this.root);else{var b=l.documentElement,c=l.body;a={top:0,left:0,right:b.clientWidth||c.clientWidth,width:b.clientWidth||c.clientWidth,bottom:b.clientHeight||c.clientHeight,height:b.clientHeight||c.clientHeight}}return this._expandRectByRootMargin(a)},b.prototype._expandRectByRootMargin=function(a){var b=this._rootMarginValues.map(function(b,c){return"px"==b.unit?b.value:b.value*(c%2?a.width:a.height)/100}),c={top:a.top-b[0],right:a.right+b[1],bottom:a.bottom+b[2],left:a.left-b[3]};return c.width=c.right-c.left,c.height=c.bottom-c.top,c},b.prototype._hasCrossedThreshold=function(a,b){var c=a&&a.isIntersecting?a.intersectionRatio||0:-1,d=b.isIntersecting?b.intersectionRatio||0:-1;if(c!==d)for(var e=0;e<this.thresholds.length;e++){var f=this.thresholds[e];if(f==c||f==d||f<c!=f<d)return!0}},b.prototype._rootIsInDom=function(){return!this.root||j(l,this.root)},b.prototype._rootContainsTarget=function(a){return j(this.root||l,a)},b.prototype._registerInstance=function(){m.indexOf(this)<0&&m.push(this)},b.prototype._unregisterInstance=function(){var a=m.indexOf(this);-1!=a&&m.splice(a,1)},window.IntersectionObserver=b,window.IntersectionObserverEntry=a}}(),function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.ResizeObserver=b()}(this,function(){"use strict";function a(a,b){function c(){f&&(f=!1,a()),g&&e()}function d(){n(c)}function e(){var a=Date.now();if(f){if(a-h<o)return;g=!0}else f=!0,g=!1,setTimeout(d,b);h=a}var f=!1,g=!1,h=0;return e}function b(a){return parseFloat(a)||0}function c(a){for(var c=[],d=1;d<arguments.length;d++)c[d-1]=arguments[d];return c.reduce(function(c,d){return c+b(a["border-"+d+"-width"])},0)}function d(a){for(var c=["top","right","bottom","left"],d={},e=0,f=c;e<f.length;e++){var g=f[e],h=a["padding-"+g];d[g]=b(h)}return d}function e(a){var b=a.getBBox();return j(0,0,b.width,b.height)}function f(a){var e=a.clientWidth,f=a.clientHeight;if(!e&&!f)return v;var h=u(a).getComputedStyle(a),i=d(h),k=i.left+i.right,l=i.top+i.bottom,m=b(h.width),n=b(h.height);if("border-box"===h.boxSizing&&(Math.round(m+k)!==e&&(m-=c(h,"left","right")+k),Math.round(n+l)!==f&&(n-=c(h,"top","bottom")+l)),!g(a)){var o=Math.round(m+k)-e,p=Math.round(n+l)-f;1!==Math.abs(o)&&(m-=o),1!==Math.abs(p)&&(n-=p)}return j(i.left,i.top,m,n)}function g(a){return a===u(a).document.documentElement}function h(a){return l?w(a)?e(a):f(a):v}function i(a){var b=a.x,c=a.y,d=a.width,e=a.height,f="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,g=Object.create(f.prototype);return t(g,{x:b,y:c,width:d,height:e,top:c,right:b+d,bottom:e+c,left:b}),g}function j(a,b,c,d){return{x:a,y:b,width:c,height:d}}var k=function(){function a(a,b){var c=-1;return a.some(function(a,d){return a[0]===b&&(c=d,!0)}),c}return"undefined"!=typeof Map?Map:function(){function b(){this.__entries__=[]}return Object.defineProperty(b.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),b.prototype.get=function(b){var c=a(this.__entries__,b),d=this.__entries__[c];return d&&d[1]},b.prototype.set=function(b,c){var d=a(this.__entries__,b);~d?this.__entries__[d][1]=c:this.__entries__.push([b,c])},b.prototype.delete=function(b){var c=this.__entries__,d=a(c,b);~d&&c.splice(d,1)},b.prototype.has=function(b){return!!~a(this.__entries__,b)},b.prototype.clear=function(){this.__entries__.splice(0)},b.prototype.forEach=function(a,b){void 0===b&&(b=null);for(var c=0,d=this.__entries__;c<d.length;c++){var e=d[c];a.call(b,e[1],e[0])}},b}()}(),l="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,m=function(){return"undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")()}(),n=function(){return"function"==typeof requestAnimationFrame?requestAnimationFrame.bind(m):function(a){return setTimeout(function(){return a(Date.now())},1e3/60)}}(),o=2,p=20,q=["top","right","bottom","left","width","height","size","weight"],r="undefined"!=typeof MutationObserver,s=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=a(this.refresh.bind(this),p)}return b.prototype.addObserver=function(a){~this.observers_.indexOf(a)||this.observers_.push(a),this.connected_||this.connect_()},b.prototype.removeObserver=function(a){var b=this.observers_,c=b.indexOf(a);~c&&b.splice(c,1),!b.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.prototype.updateObservers_=function(){var a=this.observers_.filter(function(a){return a.gatherActive(),a.hasActive()});return a.forEach(function(a){return a.broadcastActive()}),a.length>0},b.prototype.connect_=function(){l&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),r?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},b.prototype.disconnect_=function(){l&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},b.prototype.onTransitionEnd_=function(a){var b=a.propertyName,c=void 0===b?"":b;q.some(function(a){return!!~c.indexOf(a)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),t=function(a,b){for(var c=0,d=Object.keys(b);c<d.length;c++){var e=d[c];Object.defineProperty(a,e,{value:b[e],enumerable:!1,writable:!1,configurable:!0})}return a},u=function(a){return a&&a.ownerDocument&&a.ownerDocument.defaultView||m},v=j(0,0,0,0),w=function(){return"undefined"!=typeof SVGGraphicsElement?function(a){return a instanceof u(a).SVGGraphicsElement}:function(a){return a instanceof u(a).SVGElement&&"function"==typeof a.getBBox}}(),x=function(){function a(a){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=j(0,0,0,0),this.target=a}return a.prototype.isActive=function(){var a=h(this.target);return this.contentRect_=a,a.width!==this.broadcastWidth||a.height!==this.broadcastHeight},a.prototype.broadcastRect=function(){var a=this.contentRect_;return this.broadcastWidth=a.width,this.broadcastHeight=a.height,a},a}(),y=function(){function a(a,b){var c=i(b);t(this,{target:a,contentRect:c})}return a}(),z=function(){function a(a,b,c){if(this.activeObservations_=[],this.observations_=new k,"function"!=typeof a)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=a,this.controller_=b,this.callbackCtx_=c}return a.prototype.observe=function(a){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(a instanceof u(a).Element))throw new TypeError('parameter 1 is not of type "Element".');var b=this.observations_;b.has(a)||(b.set(a,new x(a)),this.controller_.addObserver(this),this.controller_.refresh())}},a.prototype.unobserve=function(a){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(a instanceof u(a).Element))throw new TypeError('parameter 1 is not of type "Element".');var b=this.observations_;b.has(a)&&(b.delete(a),b.size||this.controller_.removeObserver(this))}},a.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},a.prototype.gatherActive=function(){var a=this;this.clearActive(),this.observations_.forEach(function(b){b.isActive()&&a.activeObservations_.push(b)})},a.prototype.broadcastActive=function(){if(this.hasActive()){var a=this.callbackCtx_,b=this.activeObservations_.map(function(a){return new y(a.target,a.broadcastRect())});this.callback_.call(a,b,a),this.clearActive()}},a.prototype.clearActive=function(){this.activeObservations_.splice(0)},a.prototype.hasActive=function(){return this.activeObservations_.length>0},a}(),A="undefined"!=typeof WeakMap?new WeakMap:new k,B=function(){function a(b){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var c=s.getInstance(),d=new z(b,c,this);A.set(this,d)}return a}();return["observe","unobserve","disconnect"].forEach(function(a){B.prototype[a]=function(){var b;return(b=A.get(this))[a].apply(b,arguments)}}),function(){return void 0!==m.ResizeObserver?m.ResizeObserver:B}()}),function(a,b){b.$=a}(jQuery,window.FooGallery=window.FooGallery||{}),function(a){if(!a)return void console.warn("jQuery must be included in the page prior to the FooGallery.utils library.");(function(){try{return!!window.FooGallery.utils}catch(a){return!1}})()||(window.FooGallery.utils={$:a,version:"0.2.2"})}(jQuery),function(a,b){"0.2.2"===b.version&&(b.is={},b.is.array=function(a){return"[object Array]"===Object.prototype.toString.call(a)},b.is.boolean=function(a){return"[object Boolean]"===Object.prototype.toString.call(a)},b.is.element=function(a){return"object"==typeof HTMLElement?a instanceof HTMLElement:!!a&&"object"==typeof a&&1===a.nodeType&&"string"==typeof a.nodeName},b.is.empty=function(a){if(b.is.undef(a)||null===a)return!0;if(b.is.number(a)&&0===a)return!0;if(b.is.boolean(a)&&!1===a)return!0;if(b.is.string(a)&&0===a.length)return!0;if(b.is.array(a)&&0===a.length)return!0;if(b.is.jq(a)&&0===a.length)return!0;if(b.is.hash(a)){for(var c in a)if(a.hasOwnProperty(c))return!1;return!0}return!1},b.is.error=function(a){return"[object Error]"===Object.prototype.toString.call(a)},b.is.fn=function(a){return a===window.alert||"[object Function]"===Object.prototype.toString.call(a)},b.is.hash=function(a){return b.is.object(a)&&a.constructor===Object&&!a.nodeType&&!a.setInterval},b.is.jq=function(c){return!b.is.undef(a)&&c instanceof a},b.is.number=function(a){return"[object Number]"===Object.prototype.toString.call(a)&&!isNaN(a)},b.is.object=function(a){return"[object Object]"===Object.prototype.toString.call(a)&&!b.is.undef(a)&&null!==a},b.is.promise=function(a){return b.is.object(a)&&b.is.fn(a.then)&&b.is.fn(a.promise)},b.is.size=function(a){return!!(b.is.string(a)&&!b.is.empty(a)||b.is.number(a))&&/^(auto|none|(?:[\d.]*)+?(?:%|px|mm|q|cm|in|pt|pc|em|ex|ch|rem|vh|vw|vmin|vmax)?)$/.test(a)},b.is.string=function(a){return"[object String]"===Object.prototype.toString.call(a)},b.is.undef=function(a){return void 0===a})}(FooGallery.utils.$,FooGallery.utils),function(a,b,c){if("0.2.2"===b.version){b.fn={};var d=Function.prototype.toString;b.fn.CONTAINS_SUPER=/xyz/.test(d.call(function(){xyz}))?/\b_super\b/:/.*/,b.fn.addOrOverride=function(a,e,f){if(c.object(a)&&c.string(e)&&!c.empty(e)&&c.fn(f)){var g=a[e],h=c.fn(g)&&b.fn.CONTAINS_SUPER.test(d.call(f));a[e]=h?function(a,b){return function(){var c=this._super;this._super=a;var d=b.apply(this,arguments);return this._super=c,d}}(g,f):f}},b.fn.apply=function(a,b){function d(){return a.apply(this,b)}return b=c.array(b)?b:[],d.prototype=a.prototype,new d},b.fn.arg2arr=function(a){return Array.prototype.slice.call(a)},b.fn.debounce=function(a,c){var d;return function(){var e=this,f=b.fn.arg2arr(arguments);clearTimeout(d),d=setTimeout(function(){a.apply(e,f)},c)}},b.fn.throttle=function(a,c){var d,e;return function(){var f=this,g=b.fn.arg2arr(arguments);d?(clearTimeout(e),e=setTimeout(function(){Date.now()-d>=c&&(a.apply(f,g),d=Date.now())},c-(Date.now()-d))):(a.apply(f,g),d=Date.now())}},b.fn.check=function(d,e,f,g){function h(a){return function(){return a.apply(d,arguments)}}return f=c.fn(f)?f:a.noop,d=c.object(d)?d:window,e=c.string(e)?b.fn.fetch(e,g):e,h(c.fn(e)?e:f)},b.fn.fetch=function(b,d){return!c.string(b)||c.empty(b)?null:(d=c.object(d)?d:window,a.each(b.split("."),function(a,b){if(!d[b])return!1;d=d[b]}),c.fn(d)?d:null)},b.fn.enqueue=function(d,e,f,g){function h(a,b){try{return n.push(a),b.apply(a,i)}catch(a){return j.reject(a,n),j}}var i=b.fn.arg2arr(arguments),j=a.Deferred(),k=a.Deferred(),l=k.promise(),m=[],n=[],o=!0;return d=i.shift(),e=i.shift(),a.each(d,function(a,d){c.fn(d[e])&&(l=l.then(function(){if(!o){var a=b.fn.arg2arr(arguments);m.push(a)}return o=!1,h(d,d[e])}))}),l.then(function(){if(!o){var a=b.fn.arg2arr(arguments);m.push(a)}o=!1,j.resolve(m)}),l.fail(function(){var a=b.fn.arg2arr(arguments);a.push(n),j.reject.apply(j,a)}),k.resolve(),j.promise()},b.fn.when=function(b){function d(){--g||e.resolve(f)}if(!c.array(b)||c.empty(b))return a.when();for(var e=a.Deferred(),f=[],g=b.length,h=0;h<b.length;h++)c.promise(b[h])?b[h].then(function(a){f.push(a)}).always(d):d();return e.promise()},b.fn.rejectWith=function(c,d){var e=a.Deferred(),f=b.fn.arg2arr(arguments);return e.reject.apply(e,f).promise()},b.fn.resolveWith=function(c,d){var e=a.Deferred(),f=b.fn.arg2arr(arguments);return e.resolve.apply(e,f).promise()},b.fn.resolved=a.Deferred().resolve().promise(),b.fn.rejected=a.Deferred().reject().promise()}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b){if("0.2.2"===a.version){a.url={};var c=document.createElement("a");a.url.parts=function(a){c.href=a;var b=c.port?c.port:-1!==["http:","https:"].indexOf(c.protocol)?"https:"===c.protocol?"443":"80":"",d=c.hostname+(b?":"+b:""),e=c.origin?c.origin:c.protocol+"//"+d,f="/"===c.pathname.slice(0,1)?c.pathname:"/"+c.pathname;return{hash:c.hash,host:d,hostname:c.hostname,href:c.href,origin:e,pathname:f,port:b,protocol:c.protocol,search:c.search}},a.url.full=function(a){return!b.string(a)||b.empty(a)?null:(c.href=a,c.href)},a.url.param=function(a,c,d){if(!b.string(a)||!b.string(c)||b.empty(c))return a;var e,f,g,h;return b.undef(d)?(e=new RegExp("[?|&]"+c+"=([^&;]+?)(&|#|;|$)"),f=e.exec(a)||["",""],g=f[1].replace(/\+/g,"%20"),b.string(g)&&!b.empty(g)?decodeURIComponent(g):null):(b.empty(d)?(e=new RegExp("^([^#]*?)(([^#]*)&)?"+c+"(=[^&#]*)?(&|#|$)"),g=a.replace(e,"$1$3$5").replace(/^([^#]*)((\?)&|\?(#|$))/,"$1$3$4")):(e=new RegExp("([?&])"+c+"[^&]*"),h=c+"="+encodeURIComponent(d),(g=a.replace(e,"$1"+h))!==a||e.test(g)||(g+=(-1!==g.indexOf("?")?"&":"?")+h)),g)}}}(FooGallery.utils,FooGallery.utils.is),function(a,b,c){"0.2.2"===a.version&&(a.str={},a.str.camel=function(a){return b.empty(a)?a:a.toUpperCase()===a?a.toLowerCase():a.replace(/^([A-Z])|[-\s_]+(\w)/g,function(a,c,d){return b.string(d)?d.toUpperCase():c.toLowerCase()})},a.str.kebab=function(a){return b.empty(a)?a:a.match(/[A-Z]{2,}(?=[A-Z][a-z0-9]*|\b)|[A-Z]?[a-z0-9]*|[A-Z]|[0-9]+/g).filter(Boolean).map(function(a){return a.toLowerCase()}).join("-")},a.str.contains=function(a,c,d){return!(!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c))&&(c.length<=a.length&&-1!==(d?a.toUpperCase().indexOf(c.toUpperCase()):a.indexOf(c)))},a.str.containsWord=function(a,c,d){if(!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c)||a.length<c.length)return!1;for(var e=a.split(/\W/),f=0,g=e.length;f<g;f++)if(d?e[f].toUpperCase()===c.toUpperCase():e[f]===c)return!0;return!1},a.str.endsWith=function(a,c){return!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c)?a===c:a.slice(a.length-c.length)===c},a.str.escapeRegExp=function(a){return b.empty(a)?a:a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},a.str.fnv1a=function(a){if(!b.string(a)||b.empty(a))return null;var c,d,e=2166136261;for(c=0,d=a.length;c<d;c++)e^=a.charCodeAt(c),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0},a.str.from=function(b,c){return a.str.contains(b,c)?b.substring(b.indexOf(c)+c.length):null},a.str.join=function(d,e,f){if(!b.string(d)||!b.string(e))return null;var g=c.arg2arr(arguments);d=g.shift();var h,i,j=g.shift();for(h=0,i=g.length;h<i;h++)e=g[h],b.empty(e)||(a.str.endsWith(j,d)&&(j=j.slice(0,j.length-d.length)),a.str.startsWith(e,d)&&(e=e.slice(d.length)),j+=d+e);return j},a.str.startsWith=function(a,c){return!b.empty(a)&&!b.empty(c)&&a.slice(0,c.length)===c},a.str.until=function(b,c){return a.str.contains(b,c)?b.substring(0,b.indexOf(c)):b},a.str.format=function(d,e,f){var g=c.arg2arr(arguments);return d=g.shift(),b.string(d)&&g.length>0&&(1===g.length&&(b.array(g[0])||b.object(g[0]))&&(g=g[0]),a.each(g,function(a,b){d=d.replace(new RegExp("\\{"+b+"\\}","gi"),a+"")})),d})}(FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c,d,e){if("0.2.2"===b.version){b.obj={};var f=function(){};b.obj.create=function(a){if(!c.object(a))throw TypeError("Argument must be an object");f.prototype=a;var b=new f;return f.prototype=null,b},b.obj.extend=function(e,f,g){e=c.object(e)?e:{};var h=d.arg2arr(arguments);return h.shift(),a.each(h,function(a,c){b.obj.merge(e,c)}),e},b.obj.merge=function(a,d){a=c.hash(a)?a:{},d=c.hash(d)?d:{};for(var e in d)d.hasOwnProperty(e)&&(c.hash(d[e])?(a[e]=c.hash(a[e])?a[e]:{},b.obj.merge(a[e],d[e])):c.array(d[e])?a[e]=d[e].slice():a[e]=d[e]);return a},b.obj.mergeValid=function(d,e,f,g){if(!c.hash(f)||!c.hash(e))return d;e=c.hash(e)?e:{},g=c.hash(g)?g:{};var h,i,j;for(h in e)e.hasOwnProperty(h)&&c.fn(e[h])&&(i=c.array(g[h])?g[h]:c.string(g[h])?[g[h]]:[h],a.each(i,function(a,g){if(j=b.obj.prop(f,g),!c.undef(j))return e[h](j)?(b.obj.prop(d,h,j),!1):void 0}));return d},b.obj.prop=function(b,d,f){if(c.object(b)&&!c.empty(d)){var g,h;if(c.undef(f))return e.contains(d,".")?(g=d.split("."),h=g.length-1,a.each(g,function(a,d){if(a===h)f=b[d];else{if(!c.hash(b[d]))return!1;b=b[d]}})):c.undef(b[d])||(f=b[d]),f;e.contains(d,".")?(g=d.split("."),h=g.length-1,a.each(g,function(a,d){a===h?b[d]=f:b=c.hash(b[d])?b[d]:b[d]={}})):c.undef(b[d])||(b[d]=f)}}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c){if("0.2.2"===b.version){b.ready=function(a){function c(){try{a.call(window,b.$)}catch(a){console.error(a)}}(Function("/*@cc_on return true@*/")()?"complete"===document.readyState:"loading"!==document.readyState)?c():document.addEventListener("DOMContentLoaded",c,!1)},b.find=function(a,b,d){if(c.fn(b)){d=c.undef(d)?b:d;var e,f;if(c.array(a)){for(e=0,f=a.length;e<f;e++)if(b.call(d,a[e],e,a))return a[e]}else if(c.object(a)){var g=Object.keys(a);for(e=0,f=g.length;e<f;e++)if(b.call(d,a[g[e]],g[e],a))return a[g[e]]}}},b.each=function(a,b,d){if(c.fn(b)){d=c.undef(d)?b:d;var e,f;if(c.array(a))for(e=0,f=a.length;e<f&&!1!==b.call(d,a[e],e,a);e++);else if(c.object(a)){var g=Object.keys(a);for(e=0,f=g.length;e<f&&!1!==b.call(d,a[g[e]],g[e],a);e++);}}},b.inArray=function(a,b){return c.array(b)?b.indexOf(a):-1},b.versionCompare=function(a,b){function c(a){for(var b=a.split("."),c=[],d=0,e=b.length;d<e;d++)c[d]=parseInt(b[d]),isNaN(c[d])&&(c[d]=0);return c}if(!/[\d.]/.test(a)||!/[\d.]/.test(b))return NaN;for(var d=c(a),e=c(b);d.length<e.length;)d.push(0);for(;e.length<d.length;)e.push(0);for(var f=0;f<d.length;++f){if(e.length===f)return 1;if(d[f]!==e[f])return d[f]>e[f]?1:-1}return d.length!==e.length?-1:0};var d=0;b.uniqueId=function(a,b){var e=a.attr("id");return c.empty(e)&&(b=c.string(b)&&!c.empty(b)?b:"uid-",e=b+ ++d,a.attr("id",e).data("__uniqueId__",!0)),e},b.removeUniqueId=function(a){a.data("__uniqueId__")&&a.removeAttr("id").removeData("__uniqueId__")},b.selectify=function(a){if(c.empty(a))return null;if(c.hash(a)){var d,e={};for(var f in a)a.hasOwnProperty(f)&&(d=b.selectify(a[f]))&&(e[f]=d);return e}return c.string(a)||c.array(a)?(c.string(a)&&(a=[a]),a.map(function(a){return c.string(a)?"."+a.split(/\s/g).join("."):null}).join(",")):null},b.src=function(a,b,d,e,f,g,h){if(!c.string(a))return null;if(!c.string(b))return a;var i=b.replace(/(\s[\d.]+[whx]),/g,"$1 @,@ ").split(" @,@ "),j=i.map(function(a){return{url:/^\s*(\S*)/.exec(a)[1],w:parseFloat((/\S\s+(\d+)w/.exec(a)||[0,1/0])[1]),h:parseFloat((/\S\s+(\d+)h/.exec(a)||[0,1/0])[1]),x:parseFloat((/\S\s+([\d.]+)x/.exec(a)||[0,1])[1])}});if(!j.length)return a;j.unshift({url:a,w:j[0].w!==1/0&&j[0].h===1/0?d:1/0,h:j[0].h!==1/0&&j[0].w===1/0?e:1/0,x:1});var k=c.number(h)?h:window.devicePixelRatio||1,l={w:f*k,h:g*k,x:k},m=["w","h","x"];return m.forEach(function(a){var b=Math.max.apply(null,j.map(function(b){return b[a]}));j=j.filter(function(c){return c[a]>=l[a]||c[a]===b})}),m.forEach(function(a){var b=Math.min.apply(null,j.map(function(b){return b[a]}));j=j.filter(function(c){return c[a]===b})}),j[0].url},b.scrollParent=function(b,d,e){b=c.jq(b)?b:a(b),d=c.string(d)&&/^(x|y|xy|yx)$/i.test(d)?d:"xy";var f=a(!!b.length&&b[0].ownerDocument||document);if(e=c.jq(e)?e:f,!b.length)return e;var g=b.css("position"),h="absolute"===g,i=/(auto|scroll)/i,j=/x/i,k=/y/i,l=b.parentsUntil(e).filter(function(b,c){var e=a(this);if(h&&"static"===e.css("position"))return!1;var f=k.test(d)&&c.scrollHeight>c.clientHeight&&i.test(e.css("overflow-y")),g=j.test(d)&&c.scrollWidth>c.clientWidth&&i.test(e.css("overflow-x"));return f||g}).eq(0);return l.is("html")&&(l=f),"fixed"!==g&&l.length?l:e}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c){function d(a){return setTimeout(a,1e3/60)}function e(a){clearTimeout(a)}if("0.2.2"===b.version){b.animation={},b.animation.requestFrame=(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||d).bind(window),b.animation.cancelFrame=(window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||e).bind(window);var f=document.createElement("div");b.animation.supported=function(a){var b=a.style;return c.string(b.animation)||c.string(b.WebkitAnimation)||c.string(b.MozAnimation)||c.string(b.msAnimation)||c.string(b.OAnimation)}(f),b.animation.end=function(a){var b=a.style;return c.string(b.animation)?"animationend":c.string(b.WebkitAnimation)?"webkitAnimationEnd":c.string(b.MozAnimation)?"animationend":c.string(b.msAnimation)?"msAnimationEnd":c.string(b.OAnimation)?"oAnimationEnd":null}(f),b.animation.duration=function(a,b){if(b=c.number(b)?b:0,!c.jq(a))return b;var d=a.css("animation-duration");if(/^([\d.]*)+?(ms|s)/i.test(d)){var e=d.split(","),f=0;return e.forEach(function(a){var b=a.match(/^\s*?([\d.]*)+?(ms|s)\s*?$/i),c=parseFloat(b[1]);"s"===b[2].toLowerCase()&&(c*=1e3),c>f&&(f=c)}),f}return b},b.animation.iterations=function(a,b){if(b=c.number(b)?b:1,!c.jq(a))return b;var d=a.css("animation-iteration-count");if(/^(([\d.]+)|infinite)/i.test(d)){var e=d.split(","),f=0;return e.forEach(function(a){var b=parseFloat(a);isNaN(b)&&(b=1/0),b>f&&(f=b)}),f}return b},b.animation.start=function(d,e,f,g){var h=a.Deferred(),i=h.promise();if(d=d.first(),b.animation.supported){d.prop("offsetTop");var j=d.data("animation_safety");if(c.hash(j)&&c.number(j.timer)&&(clearTimeout(j.timer),d.removeData("animation_safety").off(b.animation.end+".utils"),j.deferred.reject()),!c.number(g)){var k=b.animation.iterations(d);if(k===1/0)return h.reject("No timeout supplied with an infinite animation."),i;g=b.animation.duration(d)*k+50}j={deferred:h,timer:setTimeout(function(){d.removeData("animation_safety").off(b.animation.end+".utils"),h.resolve()},g)},d.data("animation_safety",j),d.on(b.animation.end+".utils",function(a){d.is(a.target)&&(clearTimeout(j.timer),d.removeData("animation_safety").off(b.animation.end+".utils"),h.resolve())})}return b.animation.requestFrame(function(){c.fn(e)?e.apply(d.get(0),[d]):d.toggleClass(e,f),b.animation.supported||h.resolve()}),i}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){if("0.2.2"===b.version){b.transition={};var e=document.createElement("div");b.transition.supported=function(a){var b=a.style;return c.string(b.transition)||c.string(b.WebkitTransition)||c.string(b.MozTransition)||c.string(b.msTransition)||c.string(b.OTransition)}(e),b.transition.end=function(a){var b=a.style;return c.string(b.transition)?"transitionend":c.string(b.WebkitTransition)?"webkitTransitionEnd":c.string(b.MozTransition)?"transitionend":c.string(b.msTransition)?"msTransitionEnd":c.string(b.OTransition)?"oTransitionEnd":null}(e),b.transition.duration=function(a,b){if(b=c.number(b)?b:0,!c.jq(a))return b;var d=a.css("transition-duration");if(/^([\d.]*)+?(ms|s)/i.test(d)){var e=d.split(","),f=0;return e.forEach(function(a){var b=a.match(/^\s*?([\d.]*)+?(ms|s)\s*?$/i),c=parseFloat(b[1]);"s"===b[2].toLowerCase()&&(c*=1e3),c>f&&(f=c)}),f}return b},b.transition.start=function(e,f,g,h){var i=a.Deferred(),j=i.promise();if(e=e.first(),b.transition.supported){e.prop("offsetTop");var k=e.data("transition_safety");c.hash(k)&&c.number(k.timer)&&(clearTimeout(k.timer),e.removeData("transition_safety").off(b.transition.end+".utils"),k.deferred.reject()),h=c.number(h)?h:b.transition.duration(e)+50,k={deferred:i,timer:setTimeout(function(){e.removeData("transition_safety").off(b.transition.end+".utils"),i.resolve()},h)},e.data("transition_safety",k),e.on(b.transition.end+".utils",function(a){e.is(a.target)&&(clearTimeout(k.timer),e.removeData("transition_safety").off(b.transition.end+".utils"),i.resolve())})}return d.requestFrame(function(){c.fn(f)?f.apply(e.get(0),[e]):e.toggleClass(f,g),b.transition.supported||i.resolve()}),j}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.animation),function(a,b,c,d,e){"0.2.2"===b.version&&(b.Class=function(){},b.Class.extend=function(a){function f(){if(!c.fn(this.construct))throw new SyntaxError('FooGallery.utils.Class objects must be constructed with the "new" keyword.');this.construct.apply(this,arguments)}a=c.hash(a)?a:{};var g=d.create(this.prototype);for(var h in a)a.hasOwnProperty(h)&&e.addOrOverride(g,h,a[h]);return g.construct=c.fn(g.construct)?g.construct:function(){},f.prototype=g,f.prototype.constructor=c.fn(g.__ctor__)?g.__ctor__:f,f.extend=b.Class.extend,f.override=b.Class.override,f.bases=b.Class.bases,f.__base__=this,
10
- f},b.Class.override=function(a,b){e.addOrOverride(this.prototype,a,b)},b.Class.__base__=null,b.Class.bases=function(){function a(b,d){return c.array(d)||(d=[]),c.fn(b)&&null!==b.__base__?(d.unshift(b.__base__),a(b.__base__,d)):d}return a(this,[])})}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj,FooGallery.utils.fn),function(a,b,c){"0.2.2"===a.version&&(a.Event=a.Class.extend({construct:function(c){if(b.empty(c))throw new SyntaxError("FooGallery.utils.Event objects must be supplied a `type`.");var d=this,e=a.Event.parse(c);d.type=e.type,d.namespace=e.namespace,d.defaultPrevented=!1,d.target=null},preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return this.defaultPrevented}}),a.Event.parse=function(a){a=b.string(a)&&!b.empty(a)?a:null;var d=c.contains(a,".");return{namespaced:d,type:d?c.startsWith(a,".")?null:c.until(a,"."):a,namespace:d?c.from(a,"."):null}},a.EventClass=a.Class.extend({construct:function(){this.events={}},destroy:function(){this.events={}},on:function(a,c,d){var e=this;return b.object(a)?(d=c,Object.keys(a).forEach(function(c){b.fn(a[c])&&c.split(" ").forEach(function(b){e.addListener(b,a[c],d)})})):b.string(a)&&b.fn(c)&&a.split(" ").forEach(function(a){e.addListener(a,c,d)}),e},addListener:function(c,d,e){if(!b.string(c)||/\s/.test(c)||!b.fn(d))return!1;var f=this,g=a.Event.parse(c);return e=b.undef(e)?f:e,b.array(f.events[g.type])||(f.events[g.type]=[]),!f.events[g.type].some(function(a){return a.namespace===g.namespace&&a.fn===d&&a.thisArg===e})&&(f.events[g.type].push({namespace:g.namespace,fn:d,thisArg:e}),!0)},off:function(a,c,d){var e=this;return b.object(a)?(d=c,Object.keys(a).forEach(function(b){b.split(" ").forEach(function(c){e.removeListener(c,a[b],d)})})):b.string(a)&&a.split(" ").forEach(function(a){e.removeListener(a,c,d)}),e},removeListener:function(c,d,e){if(!b.string(c)||/\s/.test(c))return!1;var f=this,g=a.Event.parse(c),h=[];return e=b.undef(e)?f:e,b.empty(g.type)?b.empty(g.namespace)||h.push.apply(h,Object.keys(f.events)):h.push(g.type),h.forEach(function(a){b.array(f.events[a])&&(f.events[a]=f.events[a].filter(function(a){return null!=d?!(a.namespace===g.namespace&&a.fn===d&&a.thisArg===e):null!=g.namespace&&a.namespace!==g.namespace}),0===f.events[a].length&&delete f.events[a])}),!0},trigger:function(c,d){d=b.array(d)?d:[];var e=this,f=[];return c instanceof a.Event?(f.push(c),e.emit(c,d)):b.string(c)&&c.split(" ").forEach(function(b){var c=new a.Event(b);f.push(c),e.emit(c,d)}),b.empty(f)?null:1===f.length?f[0]:f},emit:function(a,c){if(a instanceof FooGallery.utils.Event){var d=this;c=b.array(c)?c:[],null===a.target&&(a.target=d),b.array(d.events[a.type])&&d.events[a.type].forEach(function(b){null!=a.namespace&&b.namespace!==a.namespace||b.fn.apply(b.thisArg,[a].concat(c))}),b.array(d.events.__all__)&&d.events.__all__.forEach(function(b){b.fn.apply(b.thisArg,[a].concat(c))})}}}))}(FooGallery.utils,FooGallery.utils.is,FooGallery.utils.str),function(a,b,c){if("0.2.2"===b.version){b.Bounds=b.Class.extend({construct:function(){var a=this;a.top=0,a.right=0,a.bottom=0,a.left=0,a.width=0,a.height=0},inflate:function(a){var b=this;return c.number(a)&&(b.top-=a,b.right+=a,b.bottom+=a,b.left-=a,b.width+=2*a,b.height+=2*a),b},intersects:function(a){var b=this;return b.left<=a.right&&a.left<=b.right&&b.top<=a.bottom&&a.top<=b.bottom}});var d;b.getViewportBounds=function(c){d||(d=a(window));var e=new b.Bounds;return e.top=d.scrollTop(),e.left=d.scrollLeft(),e.width=d.width(),e.height=d.height(),e.right=e.left+e.width,e.bottom=e.top+e.height,e.inflate(c),e},b.getElementBounds=function(d){c.jq(d)||(d=a(d));var e=new b.Bounds;if(0!==d.length){var f=d.offset();e.top=f.top,e.left=f.left,e.width=d.width(),e.height=d.height()}return e.right=e.left+e.width,e.bottom=e.top+e.height,e}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d,e){"0.2.2"===b.version&&(b.Timer=b.EventClass.extend({construct:function(a){this._super(),this.interval=c.number(a)?a:1e3,this.isRunning=!1,this.isPaused=!1,this.canResume=!1,this.canRestart=!1,this.__timeout=null,this.__decrement=!1,this.__time=0,this.__remaining=0,this.__current=0,this.__finish=0,this.__restart=[]},__reset:function(){clearTimeout(this.__timeout),this.__timeout=null,this.__decrement=!1,this.__time=0,this.__remaining=0,this.__current=0,this.__finish=0,this.isRunning=!1,this.isPaused=!1,this.canResume=!1},__eventArgs:function(a){return[this.__current,this.__time,this.__decrement].concat(d.arg2arr(arguments))},__tick:function(){var a=this;a.trigger("tick",a.__eventArgs()),a.__current===a.__finish?(a.trigger("complete",a.__eventArgs()),a.__reset()):(a.__decrement?a.__current--:a.__current++,a.__remaining--,a.canResume=a.__remaining>0,a.__timeout=setTimeout(function(){a.__tick()},a.interval))},start:function(a,b){var d=this;d.isRunning||(b=!!c.boolean(b)&&b,d.__restart=[a,b],d.__decrement=b,d.__time=a,d.__remaining=a,d.__current=b?a:0,d.__finish=b?0:a,d.canRestart=!0,d.isRunning=!0,d.isPaused=!1,d.trigger("start",d.__eventArgs()),d.__tick())},countdown:function(a){this.start(a,!0)},countup:function(a){this.start(a,!1)},restart:function(){this.stop(),this.canRestart&&this.start.apply(this,this.__restart)},stop:function(){(this.isRunning||this.isPaused)&&(this.__reset(),this.trigger("stop",this.__eventArgs()))},pause:function(){var a=this;return null!=a.__timeout&&(clearTimeout(a.__timeout),a.__timeout=null),a.isRunning&&(a.isRunning=!1,a.isPaused=!0,a.trigger("pause",a.__eventArgs())),a.__remaining},resume:function(){var a=this;a.canResume&&(a.isRunning=!0,a.isPaused=!1,a.trigger("resume",a.__eventArgs()),a.__tick())},reset:function(){this.__reset(),this.trigger("reset",this.__eventArgs())}}))}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d){"0.2.2"===b.version&&(b.Factory=b.Class.extend({construct:function(){this.registered={}},contains:function(a){return!c.undef(this.registered[a])},load:function(b,e,f){var g,h,i=this,j=d.arg2arr(arguments),k=[],l=[];b=j.shift()||{};for(g in i.registered)if(i.registered.hasOwnProperty(g)){var m=i.registered[g];b.hasOwnProperty(g)&&(h=b[g],c.string(h)&&(h=d.fetch(b[g])),c.fn(h)&&(m={name:g,klass:h,priority:i.registered[g].priority})),k.push(m)}for(g in b)b.hasOwnProperty(g)&&!i.registered.hasOwnProperty(g)&&(h=b[g],c.string(h)&&(h=d.fetch(b[g])),c.fn(h)&&k.push({name:g,klass:h,priority:0}));return k.sort(function(a,b){return b.priority-a.priority}),a.each(k,function(a,b){c.fn(b.klass)&&l.push(d.apply(b.klass,j))}),l},make:function(a,b,e){var f,g=this,h=d.arg2arr(arguments);return a=h.shift(),f=g.registered[a],c.hash(f)&&c.fn(f.klass)?d.apply(f.klass,h):null},names:function(b){b=!!c.boolean(b)&&b;var d,e=[];if(b){var f=[];for(d in this.registered)this.registered.hasOwnProperty(d)&&f.push(this.registered[d]);f.sort(function(a,b){return b.priority-a.priority}),a.each(f,function(a,b){e.push(b.name)})}else for(d in this.registered)this.registered.hasOwnProperty(d)&&e.push(d);return e},register:function(a,b,d){if(!c.string(a)||c.empty(a)||!c.fn(b))return!1;d=c.number(d)?d:0;var e=this.registered[a];return this.registered[a]={name:a,klass:b,priority:c.undef(e)?d:e.priority},!0}}))}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c){"0.2.2"===b.version&&(b.FullscreenAPI=b.EventClass.extend({construct:function(){this._super(),this.apis={w3:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}},this.api=this.getAPI(),this.supported=null!=this.api,this.__listen()},destroy:function(){return this.__stopListening(),this._super()},getAPI:function(){for(var a in this.apis)if(this.apis.hasOwnProperty(a)&&this.apis[a].enabled in document)return this.apis[a];return null},element:function(){return this.supported?document[this.api.element]:null},request:function(b){if(this.supported&&b[this.api.request]){var d=b[this.api.request]();return d||a.Deferred(this.__resolver(this.api.request)).promise()}return c.rejected},exit:function(){if(this.supported&&this.element()){var b=document[this.api.exit]();return b||a.Deferred(this.__resolver(this.api.exit)).promise()}return c.rejected},toggle:function(a){return this.element()?this.exit():this.request(a)},__listen:function(){var b=this;b.supported&&a(document).on(b.api.events.change+".utils",function(){b.trigger("change")}).on(b.api.events.error+".utils",function(){b.trigger("error")})},__stopListening:function(){var b=this;b.supported&&a(document).off(b.api.events.change+".utils").off(b.api.events.error+".utils")},__resolver:function(b){var c=this;return function(d){function e(){d.resolve(),a(document).off(c.api.events.change,e).off(c.api.events.error,f)}function f(){d.reject(new TypeError),a(document).off(c.api.events.change,e).off(c.api.events.error,f)}if(b===c.api.exit&&c.element())return void setTimeout(function(){d.reject(new TypeError)},1);a(document).on(c.api.events.change,e).on(c.api.events.error,f)}}}))}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.fn),function(a,b,c,d,e){b.EMPTY_IMAGE="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",b.DATA_TEMPLATE="__FooGallery__",b.DATA_ITEM="__FooGalleryItem__",b.get=function(c){return a(c).data(b.DATA_TEMPLATE)},b.init=function(c,f){if(f=d.jq(f)?f:a(f),f.length>0){var g=f.data(b.DATA_TEMPLATE);if(g instanceof b.Template)return g.destroy(!0).then(function(){var a=b.template.make(c,f);return a instanceof b.Template?a.initialize():e.rejected})}var h=b.template.make(c,f);return h instanceof b.Template?h.initialize():e.rejected},b.initAll=function(c){return e.when(a(".foogallery").map(function(a,d){return b.init(c,d)}).get())},a.fn.foogallery=function(c,e){return e=d.fn(e)?e:a.noop,this.each(function(f,g){if(d.string(c)){var h=a.data(g,b.DATA_TEMPLATE);if(h instanceof b.Template)switch(c){case"layout":return void h.layout();case"destroy":return void h.destroy()}}else b.init(c,g).then(e)})},b.isCached=function(a){var b=new Image;b.src=a;var c=b.complete;return b.src="",b=null,c},b.supportedExifProperties=["aperture","camera","date","exposure","focalLength","iso","orientation"],d.exif=function(a){if(d.object(a)){var c=Object.keys(a);return c.length>0&&c.some(function(c){return-1!==b.supportedExifProperties.indexOf(c)&&!d.empty(a[c])})}return!1}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c,d,e){var f="__FooGallerySwipe__",g="ontouchstart"in window,h=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!g,i=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!g,j=g||i;b.Swipe=c.Class.extend({construct:function(b,c){var d=this,f=".fgswipe";d.$el=a(b),d.opt=e.extend({threshold:20,allowPageScroll:!1,swipe:a.noop,data:{}},c),d.active=!1,d.startPoint=null,d.endPoint=null,d.events={start:(j?i?h?"MSPointerDown":"pointerdown":"touchstart":"mousedown")+f,move:(j?i?h?"MSPointerMove":"pointermove":"touchmove":"mousemove")+f,end:(j?i?h?"MSPointerUp":"pointerup":"touchend":"mouseup")+f,leave:(j?i?"mouseleave":null:"mouseleave")+f}},init:function(){var a=this;a.$el.on(a.events.start,{self:a},a.onStart),a.$el.on(a.events.move,{self:a},a.onMove),a.$el.on(a.events.end,{self:a},a.onEnd),d.string(a.events.leave)&&a.$el.on(a.events.leave,{self:a},a.onEnd),a.$el.data(f,a)},destroy:function(){var a=this;a.$el.off(a.events.start,a.onStart),a.$el.off(a.events.move,a.onMove),a.$el.off(a.events.end,a.onEnd),d.string(a.events.leave)&&a.$el.off(a.events.leave,a.onEnd),a.$el.removeData(f)},getAngle:function(a,b){var c=Math.atan2(a.x-b.x,a.y-b.y),d=Math.round(180*c/Math.PI);return 360-(d<0?360-Math.abs(d):d)},getDistance:function(a,b){var c=b.x-a.x,d=b.y-a.y;return c*=c,d*=d,Math.sqrt(c+d)},getDirection:function(a,b){var c=this,d=c.getAngle(a,b);return d>337.5||d<=22.5?"N":d>22.5&&d<=67.5?"NE":d>67.5&&d<=112.5?"E":d>112.5&&d<=157.5?"SE":d>157.5&&d<=202.5?"S":d>202.5&&d<=247.5?"SW":d>247.5&&d<=292.5?"W":d>292.5&&d<=337.5?"NW":"NONE"},getPoint:function(a){var b;return j&&!d.empty(b=a.originalEvent.touches||a.touches)?{x:b[0].pageX,y:b[0].pageY}:d.number(a.pageX)&&d.number(a.pageY)?{x:a.pageX,y:a.pageY}:null},getOffset:function(a){var b=this,c=b.$el.offset();return{left:a.x-c.left,top:a.y-c.top}},onStart:function(a){var b=a.data.self,c=b.getPoint(a);d.empty(c)||(b.active=!0,b.startPoint=b.endPoint=c)},onMove:function(a){var b=a.data.self,e=b.getPoint(a);if(b.active&&!d.empty(e))if(b.endPoint=e,b.opt.allowPageScroll){if(d.hash(b.opt.allowPageScroll)){var f=b.getDirection(b.startPoint,b.endPoint);b.opt.allowPageScroll.x||-1===c.inArray(f,["NE","E","SE","NW","W","SW"])||a.preventDefault(),b.opt.allowPageScroll.y||-1===c.inArray(f,["NW","N","NE","SW","S","SE"])||a.preventDefault()}}else a.preventDefault()},onEnd:function(a){var b=a.data.self;if(b.active){b.active=!1;var c={startPoint:b.startPoint,endPoint:b.endPoint,startOffset:b.getOffset(b.startPoint),endOffset:b.getOffset(b.endPoint),angle:b.getAngle(b.startPoint,b.endPoint),distance:b.getDistance(b.startPoint,b.endPoint),direction:b.getDirection(b.startPoint,b.endPoint)};if(b.opt.threshold>0&&c.distance<b.opt.threshold)return;b.opt.swipe.apply(this,[c,b.opt.data]),b.startPoint=null,b.endPoint=null}}}),a.fn.fgswipe=function(c){return this.each(function(){var e=a(this),g=e.data(f);if(g instanceof b.Swipe){if(d.string(c)&&d.fn(g[c]))return void g[c]();g.destroy()}d.hash(c)&&(g=new b.Swipe(this,c),g.init())})}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj),function(a,b,c,d,e,f){b.TemplateFactory=c.Factory.extend({construct:function(){this.registered={}},register:function(a,b,c,e,f,g){var h=this,i=h._super(a,b,g);if(i){var j=h.registered;j[a].opt=d.hash(c)?c:{},j[a].cls=d.hash(e)?e:{},j[a].il8n=d.hash(f)?f:{}}return i},make:function(b,c){c=d.jq(c)?c:a(c),b=f.extend({},b,c.data("foogallery"));var e=this,g=e.type(b,c);return e.contains(g)?(b=e.options(g,b),e._super(g,b,c)):null},type:function(b,e){e=d.jq(e)?e:a(e);var f=this,g=d.hash(b)&&d.hash(b)&&d.string(b.type)&&f.contains(b.type)?b.type:null;if(null===g&&e.length>0)for(var h=f.registered,i=f.names(!0),j=0,k=i.length;j<k;j++)if(h.hasOwnProperty(i[j])&&"core"!==i[j]){var l=i[j],m=h[l].cls;if(d.string(m.container)){var n=c.selectify(m.container);if(e.is(n)){g=i[j];break}}}return g},configure:function(a,b,c,d){var e=this;if(e.contains(a)){var g=e.registered;f.extend(g[a].opt,b),f.extend(g[a].cls,c),f.extend(g[a].il8n,d)}},options:function(a,c){c=f.extend({type:a},c);var e=this,g=e.registered,h=g.core.opt,i=g.core.cls,j=g.core.il8n;return d.hash(c.cls)||(c.cls={}),d.hash(c.il8n)||(c.il8n={}),d.undef(b.filtering)||(c=b.filtering.merge(c)),d.undef(b.paging)||(c=b.paging.merge(c)),"core"!==a&&e.contains(a)?(c=f.extend({},h,g[a].opt,c),c.cls=f.extend({},i,g[a].cls,c.cls),c.il8n=f.extend({},j,g[a].il8n,c.il8n)):(c=f.extend({},h,c),c.cls=f.extend({},i,c.cls),c.il8n=f.extend({},j,c.il8n)),c}}),b.template=new b.TemplateFactory}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e){a.PagingFactory=b.Factory.extend({construct:function(){this.registered={}},register:function(a,b,d,e,f,g,h){var i=this,j=i._super(a,b,h);if(j){var k=i.registered;k[a].ctrl=c.fn(d)?d:null,k[a].opt=c.hash(e)?e:{},k[a].cls=c.hash(f)?f:{},k[a].il8n=c.hash(g)?g:{}}return j},type:function(a){var b,d=this;return c.hash(a)&&c.hash(b=a.paging)&&c.string(b.type)&&d.contains(b.type)?b.type:null},merge:function(a){a=e.extend({},a);var b=this,d=b.type(a),f=b.registered,g=f.default.opt,h=f.default.cls,i=f.default.il8n,j=c.hash(a.paging)?a.paging:{},k=c.hash(a.cls)&&c.hash(a.cls.paging)?e.extend({},a.cls.paging):{},l=c.hash(a.il8n)&&c.hash(a.il8n.paging)?e.extend({},a.il8n.paging):{};return c.hash(a.cls)||(a.cls={}),c.hash(a.il8n)||(a.il8n={}),"default"!==d&&b.contains(d)?(a.paging=e.extend({},g,f[d].opt,j,{type:d}),a.cls=e.extend(a.cls,{paging:h},{paging:f[d].cls},{paging:k}),a.il8n=e.extend(a.il8n,{paging:i},{paging:f[d].il8n},{paging:l})):(a.paging=e.extend({},g,j,{type:d}),a.cls=e.extend(a.cls,{paging:h},{paging:k}),a.il8n=e.extend(a.il8n,{paging:i},{paging:l})),a},configure:function(a,b,c,d){var f=this;if(f.contains(a)){var g=f.registered;e.extend(g[a].opt,b),e.extend(g[a].cls,c),e.extend(g[a].il8n,d)}},hasCtrl:function(a){var b=this,d=b.registered[a];return c.hash(d)&&c.fn(d.ctrl)},makeCtrl:function(a,b,d,e){var f=this,g=f.registered[a];return c.hash(g)&&c.fn(g.ctrl)?new g.ctrl(b,d,e):null}}),a.paging=new a.PagingFactory}(FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e,f){var g=0;b.Template=c.EventClass.extend({construct:function(e,f){var h=this;h._super(),h.namespace=".foogallery-"+ ++g,h.$el=d.jq(f)?f:a(f),h.$scrollParent=null,h.opt=e,h.template=e.template,h.id=h.$el.prop("id")||e.id,h.cls=e.cls,h.il8n=e.il8n,h.sel=c.selectify(h.cls),h.items=b.components.make("items",h),h.pages=d.undef(b.paging)?null:b.paging.make(e.paging.type,h),h.filter=d.undef(b.filtering)?null:b.filtering.make(e.filtering.type,h),h.state=b.components.make("state",h),h._initialize=null,h._checkTimeout=null,h._layoutTimeout=null,h._layoutWidths=[],h.initializing=!1,h.initialized=!1,h.destroying=!1,h.destroyed=!1,h._undo={classes:"",style:"",create:!1,children:!1},h.robserver=new ResizeObserver(function(){h.$el.is(":visible")&&h.layout()})},initialize:function(b){var c=this;return d.promise(c._initialize)?c._initialize:c._initialize=a.Deferred(function(a){c.preInit(b)?c.init().then(function(){c.postInit()?c.firstLoad().then(function(){c.ready(),a.resolve(c)}).fail(a.reject):a.reject("post-init failed")}).fail(a.reject):a.reject("pre-init failed")}).fail(function(a){console.log("initialize failed",c,a),c.destroy()}).promise()},preInit:function(e){var f=this;if(f.destroying)return!1;if(e=d.jq(e)?e:a(e),f.initializing=!0,0===e.length&&0===f.$el.parent().length)return!1;0===f.$el.length&&(f.$el=f.create(),f._undo.create=!0),e.length>0&&f.$el.appendTo(e);var g;d.empty(f.opt.scrollParent)||0===(g=a(f.opt.scrollParent)).length?f.$scrollParent=a(document):f.$scrollParent=g.is("html")?a(document):g,f.$el.data(b.DATA_TEMPLATE,f),d.empty(f.opt.on)||f.$el.on(f.opt.on),f._undo.classes=f.$el.attr("class"),f._undo.style=f.$el.attr("style"),f.$el.is(f.sel.container)||f.$el.addClass(f.cls.container);var h=c.selectify(f.opt.classes);return null==h||f.$el.is(h)||f.$el.addClass(f.opt.classes),f.robserver.observe(f.$el.get(0)),0===f.$el.children().not(f.sel.item.elem).length&&(f.$el.append(f.createChildren()),f._undo.children=!0),!f.raise("pre-init").isDefaultPrevented()},init:function(){var a=this;return a.raise("init").isDefaultPrevented()?e.rejectWith("init default prevented"):a.items.fetch()},postInit:function(){var b=this;return!b.destroying&&(!b.raise("post-init").isDefaultPrevented()&&(b.state.init(),b.$scrollParent.on("scroll"+b.namespace,{self:b},e.throttle(function(){b.loadAvailable()},50)),a(window).on("popstate"+b.namespace,{self:b},b.onWindowPopState),!0))},firstLoad:function(){var a=this;return a.destroying?e.rejected:(a.raise("first-load"),a.loadAvailable())},ready:function(){var a=this;return!a.destroying&&(a.initializing=!1,a.initialized=!0,a._check(1e3),a.raise("ready"),!0)},create:function(){var b=this;return a("<div/>",{id:b.id,class:b.cls.container}).addClass(b.opt.classes)},createChildren:function(){return a()},destroy:function(b){var c=this,f=c._super.bind(c);return c.destroyed?e.resolved:(c.destroying=!0,a.Deferred(function(a){c.initializing&&d.promise(c._initialize)?c._initialize.always(function(){c.destroying=!1,c.doDestroy(b),a.resolve()}):(c.destroying=!1,c.doDestroy(b),a.resolve())}).then(function(){f()}).promise())},doDestroy:function(c){var e=this;e.destroyed||(e.raise("destroy"),e.robserver.disconnect(),e._checkTimeout&&clearTimeout(e._checkTimeout),e.$scrollParent.off(e.namespace),a(window).off(e.namespace),e.state.destroy(c),e.filter&&e.filter.destroy(),e.pages&&e.pages.destroy(),e.items.destroy(),d.empty(e.opt.on)||e.$el.off(e.opt.on),e.raise("destroyed"),e.$el.removeData(b.DATA_TEMPLATE),d.empty(e._undo.classes)?e.$el.removeAttr("class"):e.$el.attr("class",e._undo.classes),d.empty(e._undo.style)?e.$el.removeAttr("style"):e.$el.attr("style",e._undo.style),e._undo.children&&e.destroyChildren(),e._undo.create&&e.$el.remove(),e.$el=e.state=e.items=e.pages=null,e.destroyed=!0,e.initializing=!1,e.initialized=!1)},destroyChildren:function(){},getAvailable:function(){return this.pages?this.pages.available():this.items.available()},loadAvailable:function(){return this.items.load(this.getAvailable())},getItems:function(){return this.pages?this.pages.items():this.items.available()},_check:function(a){a=d.number(a)?a:0;var b=this;return b._checkTimeout&&clearTimeout(b._checkTimeout),b._checkTimeout=setTimeout(function(){b._checkTimeout=null,!b.initialized||b.destroying&&b.destroyed||b.loadAvailable()},a)},raise:function(b,c){if(this.destroying||this.destroyed||!d.string(b)||d.empty(b))return null;c=d.array(c)?c:[];var e=this,g=b.split(".")[0],h=f.camel("on-"+g),i=a.Event(g+".foogallery");return c.unshift(e),e.trigger(g,c).defaultPrevented&&i.preventDefault(),e.$el.trigger(i,c),d.fn(e[h])&&(c.unshift(i),e[h].apply(e.$el.get(0),c)),i},layout:function(){var a=this,b=a.getContainerWidth();null===a._initialize||a._checkWidth(b)||a.raise("layout",[b])},_checkWidth:function(a){var b,c=this;return(b=-1!==c._layoutWidths.indexOf(a))||(c._layoutWidths.unshift(a),c._layoutWidths.splice(2,c._layoutWidths.length-2),null!=c._layoutTimeout&&clearTimeout(c._layoutTimeout),c._layoutTimeout=setTimeout(function(){c._layoutWidths.splice(0,c._layoutWidths.length)},100)),b},getContainerWidth:function(){var a=this;return a.$el.is(":visible")?a.$el.width():a.$el.parents(":visible:first").innerWidth()},getCSSClass:function(a,b){b=d.empty(b)?"":b;var c=a instanceof RegExp?a:d.string(a)&&this.opt.regex.hasOwnProperty(a)?this.opt.regex[a]:null,e=this.$el.prop("className")||"",f=null!=c?e.match(c):null;return null!=f&&f.length>=2?f[1]:b},onWindowPopState:function(a){var b=a.data.self,c=a.originalEvent.state;d.empty(c)||c.id!==b.id||(b.state.set(c),b.loadAvailable())}}),b.template.register("core",b.Template,{id:null,type:"core",classes:"",on:{},lazy:!0,viewport:200,items:[],fixLayout:!0,scrollParent:null,delay:0,throttle:50,timeout:6e4,srcset:"data-srcset-fg",src:"data-src-fg",template:{},regex:{theme:/(?:\s|^)(fg-(?:light|dark|custom))(?:\s|$)/,loadingIcon:/(?:\s|^)(fg-loading-(?:default|bars|dots|partial|pulse|trail))(?:\s|$)/,hoverIcon:/(?:\s|^)(fg-hover-(?:zoom|zoom2|zoom3|plus|circle-plus|eye|external|tint))(?:\s|$)/,videoIcon:/(?:\s|^)(fg-video-(?:default|1|2|3|4))(?:\s|$)/,hoverColor:/(?:\s|^)(fg-hover-(?:colorize|grayscale))(?:\s|$)/,hoverScale:/(?:\s|^)(fg-hover-scale)(?:\s|$)/,stickyVideoIcon:/(?:\s|^)(fg-video-sticky)(?:\s|$)/,insetShadow:/(?:\s|^)(fg-shadow-inset-(?:small|medium|large))(?:\s|$)/,filter:/(?:\s|^)(fg-filter-(?:1977|amaro|brannan|clarendon|earlybird|lofi|poprocket|reyes|toaster|walden|xpro2|xtreme))(?:\s|$)/}},{container:"foogallery"},{},-100)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c){a.Component=b.Class.extend({construct:function(a){this.tmpl=a},destroy:function(){this.tmpl=null}}),a.EventComponent=b.EventClass.extend({construct:function(a,b){this._super(a),this.tmpl=a,this.tmplEventPrefix=b},destroy:function(){this._super(),this.tmpl=null},trigger:function(a,d){var e,f,g=this,h=g._super(a,d);return null!=g.tmpl&&(h instanceof b.Event&&!h.isDefaultPrevented()?(e=null!=h.namespace?[h.type,h.namespace].join("."):h.type,(f=g.tmpl.raise(g.tmplEventPrefix+e,d))&&f.isDefaultPrevented()&&h.preventDefault()):c.array(h)&&h.forEach(function(a){a.isDefaultPrevented()||(e=null!=a.namespace?[a.type,a.namespace].join("."):a.type,(f=g.tmpl.raise(g.tmplEventPrefix+e,d))&&f.isDefaultPrevented()&&a.preventDefault())})),c.empty(h)?null:1===h.length?h[0]:h}}),a.components=new b.Factory}(FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d,e,f){b.State=b.Component.extend({construct:function(a){var b=this;b._super(a),b.apiEnabled=!!window.history&&!!history.replaceState,b.opt=b.tmpl.opt.state,b.enabled=b.opt.enabled,b.current={filter:[],page:0,item:null},b.pushOrReplace=b.isPushOrReplace(b.opt.pushOrReplace)?b.opt.pushOrReplace:"replace",b.defaultMask="foogallery-gallery-{id}";var c=e.escapeRegExp(b.tmpl.id),d=e.escapeRegExp(b.getMasked()),f=e.escapeRegExp(b.opt.values),g=e.escapeRegExp(b.opt.pair);b.regex={exists:new RegExp("^#"+c+"\\"+f+".+?"),masked:new RegExp("^#"+d+"\\"+f+".+?"),values:new RegExp("(\\w+)"+g+"([^"+f+"]+)","g")}},destroy:function(a){var b=this;a||b.clear(),b.opt=b.regex={},b._super()},init:function(){this.set(this.initial())},getIdNumber:function(){return this.tmpl.id.match(/\d+/g)[0]},getMasked:function(){var a=this,b=e.contains(a.opt.mask,"{id}")?a.opt.mask:a.defaultMask;return e.format(b,{id:a.getIdNumber()})},isPushOrReplace:function(a){return-1!==c.inArray(a,["push","replace"])},exists:function(){return this.regex.values.lastIndex=0,(this.regex.exists.test(location.hash)||this.regex.masked.test(location.hash))&&this.regex.values.test(location.hash)},parse:function(){var b=this,c=b.tmpl,d={};if(b.exists())if(b.enabled){d.id=b.tmpl.id,b.regex.values.lastIndex=0;var e=location.hash.match(b.regex.values);a.each(e,function(a,e){var f,g=e.split(b.opt.pair);if(2===g.length)switch(g[0]){case b.opt.itemKey:f=c.items.fromHash(g[1]),null!==f&&(d.item=f);break;case b.opt.pageKey:c.pages&&null!==(f=c.pages.fromHash(g[1]))&&(d.page=f);break;case b.opt.filterKey:c.filter&&null!==(f=c.filter.fromHash(g[1]))&&(d.filter=f)}})}else b.apiEnabled?history.replaceState(null,"",location.pathname+location.search):location.hash="#";return d},hashify:function(a){var b=this,c=b.tmpl;if(d.hash(a)){var e=[],f=c.items.toHash(a.item);return null!==f&&e.push(b.opt.itemKey+b.opt.pair+f),c.filter&&null!==(f=c.filter.toHash(a.filter))&&e.push(b.opt.filterKey+b.opt.pair+f),c.pages&&null!==(f=c.pages.toHash(a.page))&&e.push(b.opt.pageKey+b.opt.pair+f),e.length>0&&e.unshift("#"+b.getMasked()),e.join(b.opt.values)}return""},replace:function(a){var c=this;if(c.enabled&&c.apiEnabled){a.id=c.tmpl.id;var e=c.hashify(a),g=d.empty(e),h=f.extend({},a,{item:a.item instanceof b.Item?a.item.id:a.item});history.replaceState(g?null:h,"",g?location.pathname+location.search:e)}},push:function(a){var c=this;if(c.enabled&&c.apiEnabled){a.id=c.tmpl.id;var e=c.hashify(a),g=d.empty(e),h=f.extend({},a,{item:a.item instanceof b.Item?a.item.id:a.item});history.pushState(g?null:h,"",g?location.pathname+location.search:e)}},update:function(a,b){var c=this;c.enabled&&c.apiEnabled&&(b=c.isPushOrReplace(b)?b:c.pushOrReplace,c[b](a))},clear:function(){this.exists()&&this.replace({})},initial:function(){var a=this,b=a.parse();return d.empty(b)?a.get():f.extend({filter:[],page:1,item:null},b)},get:function(a){var c,d=this,e=d.tmpl,g={};return a instanceof b.Item&&(g.item=a),e.filter&&null!==(c=e.filter.getState())&&(g.filter=c),e.pages&&null!==(c=e.pages.getState())&&(g.page=c),f.extend({filter:[],page:1,item:null},g)},set:function(a){var b=this,c=b.tmpl;if(d.hash(a)){var e=f.extend({filter:[],page:1,item:null},a);c.items.reset();c.raise("before-state",[e]).isDefaultPrevented()||(c.filter&&c.filter.setState(e),c.pages?c.pages.setState(e):(c.items.detach(c.items.all()),c.items.create(c.items.available(),!0)),e.item&&(b.opt.scrollTo&&e.item.scrollTo(),d.empty(a.item)||(a.item=null,b.replace(a))),b.current=e,c.raise("after-state",[e]))}}}),b.template.configure("core",{state:{enabled:!1,scrollTo:!0,pushOrReplace:"replace",mask:"foogallery-gallery-{id}",values:"/",pair:":",array:"+",arraySeparator:",",itemKey:"i",filterKey:"f",pageKey:"p"}}),b.components.register("state",b.State)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.str,FooGallery.utils.obj),function(a,b,c,d,e,f){b.Items=b.Component.extend({construct:function(a){var b=this;b.ALLOW_CREATE=!0,b.ALLOW_APPEND=!0,b.ALLOW_LOAD=!0,b._super(a),b.maps={},b._fetched=null,b._arr=[],b._available=[];var d=b.tmpl.cls.item.caption;b.tmpl.sel.item.caption.all=c.selectify([d.elem,d.inner,d.title,d.description])},fromHash:function(a){return this.get(a)},toHash:function(a){return a instanceof b.Item?a.id:null},destroy:function(){var b=this,c=b.all(),d=[];c.length>0&&(b.tmpl.raise("destroy-items",[c]),d=a.map(c,function(a){return a.destroy()?a:null}),d.length>0&&b.tmpl.raise("destroyed-items",[d])),b.maps={},b._fetched=null,b._arr=[],b._available=[],b._super()},fetch:function(b){var c=this;if(!b&&d.promise(c._fetched))return c._fetched;var e=c.tmpl,f=e.sel,g=e.opt.items,h=a.Deferred(),i=c.make(e.$el.find(f.item.elem));return d.empty(g)?(i.push.apply(i,c.make(window[e.id+"-items"])),h.resolve(i)):d.array(g)?(i.push.apply(i,c.make(g)),h.resolve(i)):d.string(g)?a.get(g).then(function(a){i.push.apply(i,c.make(a)),h.resolve(i)},function(a,b,c){console.log("FooGallery: GET items error.",g,a,b,c),h.resolve(i)}):h.resolve(i),h.then(function(a){c.setAll(a)}),c._fetched=h.promise()},toJSON:function(a){return(a?this.all():this.available()).map(function(a){return a.toJSON()})},all:function(){return this._arr.slice()},count:function(a){return a?this.all().length:this.available().length},available:function(a){return d.fn(a)?this._available.filter(a,this):this._available.slice()},get:function(a){var b=d.number(a)?"index":"id";return this.maps[b][a]?this.maps[b][a]:null},setAll:function(a){this._arr=d.array(a)?a:[],this.maps=this.createMaps(this._arr),this._available=this.all()},setAvailable:function(a){this.maps=this.createMaps(this._arr),this._available=d.array(a)?a:[]},reset:function(){this.setAvailable(this.all())},find:function(a,b){if(b=d.fn(b)?b:function(){return!0},d.array(a))for(var c=0,e=a.length;c<e;c++)if(!0===b.call(this,a[c]))return a[c];return null},first:function(a){return this.find(this._available,a)},last:function(a){return this.find(this._available.slice().reverse(),a)},next:function(a,c,e){if(!(a instanceof b.Item))return null;e=!!d.boolean(e)&&e;var f=this._available.slice(),g=f.indexOf(a);if(-1!==g){var h=f.slice(0,g);return f=f.slice(g+1),e&&(f=f.concat(h)),this.find(f,c)}return null},prev:function(a,c,e){if(!(a instanceof b.Item))return null;e=!!d.boolean(e)&&e;var f=this._available.slice().reverse(),g=f.indexOf(a);if(-1!==g){var h=f.slice(0,g);return f=f.slice(g+1),e&&(f=f.concat(h)),this.find(f,c)}return null},createMaps:function(b){b=d.array(b)?b:[];var c={id:{},index:{}};return a.each(b,function(a,b){d.empty(b.id)&&(b.id=""+(a+1)),b.index=a,c.id[b.id]=b,c.index[b.index]=b}),c},loadable:function(b){var e,f=this,g=f.tmpl.opt;return g.lazy&&(e=c.getViewportBounds(g.viewport)),f.ALLOW_LOAD&&d.array(b)?a.map(b,function(a){return a.isCreated&&a.isAttached&&!a.isLoading&&!a.isLoaded&&!a.isError&&(!g.lazy||g.lazy&&a.intersects(e))?a:null}):[]},creatable:function(c){return this.ALLOW_CREATE&&d.array(c)?a.map(c,function(a){return a instanceof b.Item&&!a.isCreated?a:null}):[]},appendable:function(c){return this.ALLOW_APPEND&&d.array(c)?a.map(c,function(a){return a instanceof b.Item&&a.isCreated&&!a.isAttached?a:null}):[]},detachable:function(c){
11
- return d.array(c)?a.map(c,function(a){return a instanceof b.Item&&a.isCreated&&a.isAttached?a:null}):[]},jquerify:function(b){return a(a.map(b,function(a){return a.$el.get()}))},make:function(c){var e=this,g=[];if(d.jq(c)||d.array(c)){var h=[],i=a.makeArray(c);if(0===i.length)return g;e.tmpl.raise("make-items",[i]).isDefaultPrevented()||(g=a.map(i,function(a){var c=e.type(a),g=f.extend(d.hash(a)?a:{},{type:c}),i=b.components.make(c,e.tmpl,g);return d.element(a)?i.parse(a)?(h.push(i),e.ALLOW_APPEND||i.detach(),i):null:i})),g.length>0&&e.tmpl.raise("made-items",[g]),h.length>0&&e.tmpl.raise("parsed-items",[h])}return g},type:function(c){var e;if(d.hash(c))e=c.type;else if(d.element(c)){var f=a(c),g=this.tmpl.sel.item;e=f.find(g.anchor).data("type")}return d.string(e)&&b.components.contains(e)?e:"image"},create:function(b,c){var e=this,f=[],g=e.creatable(b);if(g.length>0){e.tmpl.raise("create-items",[g]).isDefaultPrevented()||(f=a.map(g,function(a){return a.create()?a:null})),f.length>0&&e.tmpl.raise("created-items",[f])}return d.boolean(c)&&c?e.append(b):f},append:function(b){var c=this,d=[],e=c.appendable(b);if(e.length>0){c.tmpl.raise("append-items",[e]).isDefaultPrevented()||(d=a.map(e,function(a){return a.append()?a:null})),d.length>0&&c.tmpl.raise("appended-items",[d])}return d},detach:function(b){var c=this,d=[],e=c.detachable(b);if(e.length>0){c.tmpl.raise("detach-items",[e]).isDefaultPrevented()||(d=a.map(e,function(a){return a.detach()?a:null})),d.length>0&&c.tmpl.raise("detached-items",[d])}return d},load:function(b){var c=this;if(b=c.loadable(b),b.length>0){if(!c.tmpl.raise("load-items",[b]).isDefaultPrevented()){var d=a.map(b,function(a){return a.load()});return e.when(d).done(function(a){c.tmpl.raise("loaded-items",[a])})}}return e.resolveWith([])}}),b.components.register("items",b.Items)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e,f,g){b.Item=b.Component.extend({construct:function(a,b){var c=this;c._super(a),c.cls=a.cls.item,c.il8n=a.il8n.item,c.sel=a.sel.item,c.opt=f.extend({},a.opt.item,b),c.isAttached=!1,c.isCreated=!1,c.isDestroyed=!1,c.isLoading=!1,c.isLoaded=!1,c.isError=!1,c.isParsed=!1,c.$el=null,c.$inner=null,c.$anchor=null,c.$overlay=null,c.$wrap=null,c.$image=null,c.$caption=null,c.fixLayout=c.tmpl.opt.fixLayout,c.index=-1,c.type=c.opt.type,c.id=c.opt.id,c.productId=c.opt.productId,c.href=c.opt.href,c.src=c.opt.src,c.srcset=c.opt.srcset,c.width=c.opt.width,c.height=c.opt.height,c.title=c.opt.title,c.alt=c.opt.alt,c.caption=d.empty(c.opt.caption)?c.title:c.opt.caption,c.description=d.empty(c.opt.description)?c.alt:c.opt.description,c.attr=c.opt.attr,c.tags=c.opt.tags,c.maxWidth=c.opt.maxWidth,c.maxCaptionLength=c.opt.maxCaptionLength,c.maxDescriptionLength=c.opt.maxDescriptionLength,c.showCaptionTitle=c.opt.showCaptionTitle,c.showCaptionDescription=c.opt.showCaptionDescription,c.noLightbox=c.opt.noLightbox,c.panelHide=c.opt.panelHide,c.exif=c.opt.exif,c.hasExif=d.exif(c.exif),c._thumbUrl=null,c._load=null,c._undo={classes:"",style:"",loader:!1,wrap:!1,overlay:!1,placeholder:!1}},destroy:function(){var a=this;return a.tmpl.raise("destroy-item",[a]).isDefaultPrevented()||(a.isDestroyed=a.doDestroyItem()),a.isDestroyed&&(a.tmpl.raise("destroyed-item",[a]),a._super()),a.isDestroyed},doDestroyItem:function(){var a=this;return a.isParsed?(a.$anchor.add(a.$caption).off("click.foogallery"),a.append(),d.empty(a._undo.classes)?a.$el.removeAttr("class"):a.$el.attr("class",a._undo.classes),d.empty(a._undo.style)?a.$el.removeAttr("style"):a.$el.attr("style",a._undo.style),a._undo.overlay&&a.$overlay.remove(),a._undo.wrap&&(a.$anchor.append(a.$image),a.$wrap.remove()),a._undo.loader&&a.$el.find(a.sel.loader).remove(),a._undo.placeholder&&a.$image.prop("src")===b.EMPTY_IMAGE&&a.$image.removeAttr("src")):a.isCreated&&(a.detach(),a.$el.remove()),!0},parse:function(b){var c=this,d=a(b);return!c.tmpl.raise("parse-item",[c,d]).isDefaultPrevented()&&(c.isCreated=d.is(c.sel.elem))&&(c.isParsed=c.doParseItem(d),c.fixLayout&&c.fix()),c.isParsed&&c.tmpl.raise("parsed-item",[c]),c.isParsed},doParseItem:function(c){var e=this,g=e.tmpl.opt,h=e.cls,i=e.sel;if(e._undo.classes=c.attr("class")||"",e._undo.style=c.attr("style")||"",e.$el=c.data(b.DATA_ITEM,e),e.$inner=e.$el.children(i.inner),e.$anchor=e.$inner.children(i.anchor).on("click.foogallery",{self:e},e.onAnchorClick),e.$image=e.$anchor.find(i.image),e.$caption=e.$inner.children(i.caption.elem).on("click.foogallery",{self:e},e.onCaptionClick),!(e.$el.length&&e.$inner.length&&e.$anchor.length&&e.$image.length))return console.error("FooGallery Error: Invalid HTML markup. Check the item markup for additional elements or malformed HTML in the title or description.",e),e.isError=!0,e.tmpl.raise("error-item",[e]),0!==e.$el.length&&e.$el.remove(),!1;e.isAttached=e.$el.parent().length>0,e.isLoading=e.$el.is(i.loading),e.isLoaded=e.$el.is(i.loaded),e.isError=e.$el.is(i.error);var j=e.$anchor.attr("data-type",e.type).data();e.id=j.id||e.id,e.productId=j.productId||e.productId,e.tags=j.tags||e.tags,e.href=j.href||e.$anchor.attr("href")||e.href,e.src=e.$image.attr(g.src)||e.src,e.srcset=e.$image.attr(g.srcset)||e.srcset,e.width=parseInt(e.$image.attr("width"))||e.width,e.height=parseInt(e.$image.attr("height"))||e.height,e.title=e.$image.attr("title")||e.title,e.alt=e.$image.attr("alt")||e.alt,e.caption=j.title||j.captionTitle||e.caption,e.description=j.description||j.captionDesc||e.description,e.noLightbox=e.$anchor.hasClass(h.noLightbox),e.panelHide=e.$anchor.hasClass(h.panelHide),d.exif(j.exif)&&(e.exif=f.extend(e.exif,j.exif),e.hasExif=!0),d.empty(e.caption)&&(e.caption=a.trim(e.$caption.find(i.caption.title).html())),d.empty(e.description)&&(e.description=a.trim(e.$caption.find(i.caption.description).html())),d.number(e.maxCaptionLength)&&e.maxCaptionLength>0&&!d.empty(e.caption)&&d.string(e.caption)&&e.caption.length>e.maxCaptionLength&&e.$caption.find(i.caption.title).html(e.caption.substr(0,e.maxCaptionLength)+"&hellip;"),d.number(e.maxDescriptionLength)&&e.maxDescriptionLength>0&&!d.empty(e.description)&&d.string(e.description)&&e.description.length>e.maxDescriptionLength&&e.$caption.find(i.caption.description).html(e.description.substr(0,e.maxDescriptionLength)+"&hellip;"),e.$overlay=e.$anchor.children(i.overlay),0===e.$overlay.length&&(e.$overlay=a("<span/>",{class:h.overlay}),e.$anchor.append(e.$overlay),e._undo.overlay=!0),e.$wrap=e.$anchor.children(i.wrap),0===e.$wrap.length&&(e.$wrap=a("<span/>",{class:h.wrap}),e.$anchor.append(e.$wrap.append(e.$image)),e._undo.wrap=!0),0===e.$el.children(i.loader).length&&(e.$el.append(a("<div/>",{class:h.loader})),e._undo.loader=!0);var k=e.$image.get(0);return d.empty(k.src)&&(k.src=b.EMPTY_IMAGE,e._undo.placeholder=!0),e.$el.addClass(e.getTypeClass()),e.hasExif&&e.$el.addClass(h.exif),!e.isCreated||!e.isAttached||e.isLoading||e.isLoaded||e.isError||e.$el.addClass(h.idle),!0},create:function(){var a=this;if(!a.isCreated&&d.string(a.href)&&d.string(a.src)&&d.number(a.width)&&d.number(a.height)){a.tmpl.raise("create-item",[a]).isDefaultPrevented()||(a.isCreated=a.doCreateItem()),a.isCreated&&a.tmpl.raise("created-item",[a])}return a.isCreated},doCreateItem:function(){var c=this,e=c.tmpl.opt,f=c.cls,g=c.attr,h=c.getTypeClass(),i=c.hasExif?f.exif:"";g.elem.class=[f.elem,h,i,f.idle].join(" "),g.inner.class=f.inner;var j=[f.anchor];c.noLightbox&&j.push(f.noLightbox),c.panelHide&&j.push(f.panelHide),g.anchor.class=j.join(" "),g.anchor.href=c.href,g.anchor["data-type"]=c.type,g.anchor["data-id"]=c.id,g.anchor["data-title"]=c.caption,g.anchor["data-description"]=c.description,d.empty(c.tags)||(g.anchor["data-tags"]=JSON.stringify(c.tags)),d.empty(c.productId)||(g.anchor["data-product-id"]=c.productId),g.image.class=f.image,g.image[e.src]=c.src,g.image[e.srcset]=c.srcset,g.image.width=c.width,g.image.height=c.height,g.image.title=c.title,g.image.alt=c.alt,c.$el=a("<div/>").attr(g.elem).data(b.DATA_ITEM,c),c.$inner=a("<figure/>").attr(g.inner).appendTo(c.$el),c.$anchor=a("<a/>").attr(g.anchor).appendTo(c.$inner).on("click.foogallery",{self:c},c.onAnchorClick),c.$overlay=a("<span/>",{class:f.overlay}).appendTo(c.$anchor),c.$wrap=a("<span/>",{class:f.wrap}).appendTo(c.$anchor),c.$image=a("<img/>").attr(g.image).appendTo(c.$wrap),f=c.cls.caption,g=c.attr.caption,g.elem.class=f.elem,c.$caption=a("<figcaption/>").attr(g.elem).on("click.foogallery",{self:c},c.onCaptionClick),g.inner.class=f.inner;var k=a("<div/>").attr(g.inner).appendTo(c.$caption),l=c.showCaptionTitle&&!d.empty(c.caption),m=c.showCaptionDescription&&!d.empty(c.description);if(l||m){if(g.title.class=f.title,g.description.class=f.description,l){var n=a("<div/>").attr(g.title),o=c.caption;d.number(c.maxCaptionLength)&&c.maxCaptionLength>0&&d.string(c.caption)&&c.caption.length>c.maxCaptionLength&&(o=c.caption.substr(0,c.maxCaptionLength)+"&hellip;"),n.get(0).innerHTML=o,k.append(n)}if(m){var p=a("<div/>").attr(g.description),q=c.description;d.number(c.maxDescriptionLength)&&c.maxDescriptionLength>0&&d.string(c.description)&&c.description.length>c.maxDescriptionLength&&(q=c.description.substr(0,c.maxDescriptionLength)+"&hellip;"),p.get(0).innerHTML=q,k.append(p)}}return c.$caption.appendTo(c.$inner),0===c.$el.find(c.sel.loader).length&&c.$el.append(a("<div/>",{class:c.cls.loader})),!0},append:function(){var a=this;if(a.isCreated&&!a.isAttached){a.tmpl.raise("append-item",[a]).isDefaultPrevented()||(a.tmpl.$el.append(a.$el),!a.fixLayout&&a.isParsed||a.fix(),a.isAttached=!0),a.isAttached&&a.tmpl.raise("appended-item",[a])}return a.isAttached},detach:function(){var a=this;if(a.isCreated&&a.isAttached){a.tmpl.raise("detach-item",[a]).isDefaultPrevented()||(a.$el.detach(),!a.fixLayout&&a.isParsed||a.unfix(),a.isAttached=!1),a.isAttached||a.tmpl.raise("detached-item",[a])}return!a.isAttached},load:function(){var b=this;if(d.promise(b._load))return b._load;if(!b.isCreated||!b.isAttached)return e.rejectWith("not created or attached");if(b.tmpl.raise("load-item",[b]).isDefaultPrevented())return e.rejectWith("default prevented");var c=b.cls,f=b.$image.get(0),g=f.src;return b.isLoading=!0,b.$el.removeClass(c.idle).removeClass(c.loaded).removeClass(c.error).addClass(c.loading),b._load=a.Deferred(function(a){f.onload=function(){f.onload=f.onerror=null,b.isLoading=!1,b.isLoaded=!0,b.$el.removeClass(c.loading).addClass(c.loaded),!b.fixLayout&&b.isParsed||b.unfix(),b.tmpl.raise("loaded-item",[b]),a.resolve(b)},f.onerror=function(){f.onload=f.onerror=null,b.isLoading=!1,b.isError=!0,b.$el.removeClass(c.loading).addClass(c.error),d.string(g)&&b.$image.prop("src",g),b.tmpl.raise("error-item",[b]),a.reject(b)},f.src=b.getThumbUrl(),f.complete&&f.onload()}).promise()},fix:function(){var a=this;if(null==a.tmpl)return a;if(a.isCreated&&!a.isLoading&&!a.isLoaded&&!a.isError){var b=a.width,c=a.height,e=a.$image.get(0);if(!isNaN(b)&&!isNaN(c)&&e){var f=d.fn(a.maxWidth)?a.maxWidth(a):a.$image.width();f<=0&&(f=b);var g=f/b,h=c*g;a.$image.css({width:f,height:h})}}return a},unfix:function(){var a=this;return null==a.tmpl?a:(a.isCreated&&a.$image.css({width:"",height:""}),a)},getThumbSrc:function(a,b){return c.src(this.src,this.srcset,this.width,this.height,a,b)},getThumbUrl:function(a){a=!!d.boolean(a)&&a;var b=this;return!a&&d.string(b._thumbUrl)?b._thumbUrl:b._thumbUrl=b.getThumbSrc(b.$anchor.innerWidth(),b.$anchor.innerHeight())},getTypeClass:function(){return this.cls.types.hasOwnProperty(this.type)?this.cls.types[this.type]:""},scrollTo:function(a){var b=this;if(b.isAttached){var d=b.bounds(),e=c.getViewportBounds();switch(a){case"top":d.left+=d.width/2-e.width/2,d.top-=e.height/5;break;default:d.left+=d.width/2-e.width/2,d.top+=d.height/2-e.height/2}window.scrollTo(d.left,d.top)}return b},bounds:function(){return this.isAttached?c.getElementBounds(this.$el):null},intersects:function(a){return!!this.isAttached&&this.bounds().intersects(a)},updateState:function(){this.tmpl.state.update(this.tmpl.state.get(this))},toJSON:function(){return{type:this.type,id:this.id,productId:this.productId,href:this.href,src:this.src,srcset:this.srcset,width:this.width,height:this.height,alt:this.alt,title:this.title,caption:this.caption,description:this.description,tags:this.tags.slice(),maxCaptionLength:this.maxCaptionLength,maxDescriptionLength:this.maxDescriptionLength,showCaptionTitle:this.showCaptionTitle,showCaptionDescription:this.showCaptionDescription,noLightbox:this.noLightbox,panelHide:this.panelHide,attr:f.extend({},this.attr)}},onAnchorClick:function(a){var b=a.data.self;b.tmpl.raise("anchor-click-item",[b]).isDefaultPrevented()?a.preventDefault():b.updateState()},onCaptionClick:function(b){var c=b.data.self;!c.tmpl.raise("caption-click-item",[c]).isDefaultPrevented()&&c.$anchor.length>0&&!a(b.target).is("a,:input")&&c.$anchor.get(0).click()}}),b.template.configure("core",{item:{type:"item",id:"",href:"",src:"",srcset:"",width:0,height:0,title:"",alt:"",caption:"",description:"",tags:[],maxWidth:null,maxCaptionLength:0,maxDescriptionLength:0,showCaptionTitle:!0,showCaptionDescription:!0,noLightbox:!1,panelHide:!1,exif:{aperture:null,camera:null,date:null,exposure:null,focalLength:null,iso:null,orientation:null},attr:{elem:{},inner:{},anchor:{},image:{},caption:{elem:{},inner:{},title:{},description:{}}}}},{item:{elem:"fg-item",inner:"fg-item-inner",exif:"fg-item-exif",anchor:"fg-thumb",overlay:"fg-image-overlay",wrap:"fg-image-wrap",image:"fg-image",loader:"fg-loader",idle:"fg-idle",loading:"fg-loading",loaded:"fg-loaded",error:"fg-error",noLightbox:"fg-no-lightbox",panelHide:"fg-panel-hide",types:{item:"fg-type-unknown"},caption:{elem:"fg-caption",inner:"fg-caption-inner",title:"fg-caption-title",description:"fg-caption-desc"}}},{item:{exif:{aperture:"Aperture",camera:"Camera",date:"Date",exposure:"Exposure",focalLength:"Focal Length",iso:"ISO",orientation:"Orientation"}}}),b.components.register("item",b.Item)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj,FooGallery.utils.str),function(a,b,c,d){b.Image=b.Item.extend({}),b.template.configure("core",null,{item:{types:{image:"fg-type-image"}}}),b.components.register("image",b.Image)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Paging=b.Component.extend({construct:function(a){var b=this;b._super(a),b.opt=b.tmpl.opt.paging,b.cls=b.tmpl.cls.paging,b.il8n=b.tmpl.il8n.paging,b.sel=b.tmpl.sel.paging,b.pushOrReplace=b.opt.pushOrReplace,b.type=b.opt.type,b.theme=b.opt.theme,b.size=b.opt.size,b.position=b.opt.position,b.scrollToTop=b.opt.scrollToTop,b.current=0,b.total=0,b.ctrls=[],b._arr=[]},fromHash:function(a){var b=parseInt(a);return isNaN(b)?null:b},toHash:function(a){return d.number(a)&&a>0?a.toString():null},getState:function(){return this.isValid(this.current)?this.current:null},setState:function(a){this.rebuild(),a.item&&!this.contains(a.page,a.item)&&(a.page=this.find(a.item),a.page=0!==a.page?a.page:1),this.set(a.page,!1,!1,!0)},destroy:function(){var b=this;b._arr.splice(0,b._arr.length),a.each(b.ctrls.splice(0,b.ctrls.length),function(a,b){b.destroy()}),b._super()},build:function(){var a=this,c=a.tmpl.items.available();a.total=a.size>0&&c.length>0?Math.ceil(c.length/a.size):1;for(var d=0;d<a.total;d++)a._arr.push(c.splice(0,a.size));if(a.total>1&&b.paging.hasCtrl(a.type)){var e,f,g=a.position;"both"!==g&&"top"!==g||(e=b.paging.makeCtrl(a.type,a.tmpl,a,"top"),e.create()&&(e.append(),a.ctrls.push(e))),"both"!==g&&"bottom"!==g||(f=b.paging.makeCtrl(a.type,a.tmpl,a,"bottom"),f.create()&&(f.append(),a.ctrls.push(f)))}},rebuild:function(){var b=this;b.current=0,b.total=0,b._arr.splice(0,b._arr.length),a.each(b.ctrls.splice(0,b.ctrls.length),function(a,b){b.destroy()}),b.build()},all:function(){return this._arr.slice()},available:function(){return this.get(this.current)},items:function(){return this.get(this.current)},controls:function(b){var c=this;c.isValid(b)&&a.each(c.ctrls,function(a,c){c.update(b)})},isValid:function(a){return d.number(a)&&a>0&&a<=this.total},number:function(a){return this.isValid(a)?a:0===this.current?1:this.current},create:function(a,b){var c=this;a=c.number(a);var d=a-1;c.tmpl.items.detach(c.tmpl.items.all()),c.current=a,c.tmpl.items.create(c._arr[d],!0)},get:function(a){var b=this;return b.isValid(a)?(a=b.number(a),b._arr[a-1]):[]},set:function(a,b,c,e){var f=this;if(f.isValid(a)){var g,h=f.number(a);if(h!==f.current){var i=f.current,j=function(){if(c=!d.boolean(c)||c,e=!!d.boolean(e)&&e,c&&1===f.current&&!f.tmpl.state.exists()&&(g=f.tmpl.state.get(),f.tmpl.state.update(g,f.pushOrReplace)),f.controls(a),f.create(h,e),c&&(g=f.tmpl.state.get(),f.tmpl.state.update(g,f.pushOrReplace)),f.scrollToTop&&d.boolean(b)&&b){var j=f.get(f.current);j.length>0&&j[0].scrollTo("top")}f.tmpl.raise("after-page-change",[f.current,i,e])};return!f.tmpl.raise("before-page-change",[f.current,h,j,e]).isDefaultPrevented()&&(j(),!0)}}return!1},find:function(a){for(var b=this,d=0,e=b._arr.length;d<e;d++)if(-1!==c.inArray(a,b._arr[d]))return d+1;return 0},contains:function(a,b){var d=this.get(a);return-1!==c.inArray(b,d)},first:function(){this.goto(1)},last:function(){this.goto(this._arr.length)},prev:function(){this.goto(this.current-1)},next:function(){this.goto(this.current+1)},goto:function(a){var b=this;b.set(a,!0)&&b.tmpl.loadAvailable()}}),b.PagingControl=b.Component.extend({construct:function(a,b,c){var d=this;d._super(a),d.pages=b,d.position=c,d.$container=null},create:function(){var b=this;return b.$container=a("<nav/>",{class:b.pages.cls.container}).addClass(b.pages.theme),!0},destroy:function(){var a=this;a.$container.remove(),a.$container=null},append:function(){var a=this;"top"===a.position?a.$container.insertBefore(a.tmpl.$el):a.$container.insertAfter(a.tmpl.$el)},update:function(a){}}),b.paging.register("default",b.Paging,null,{type:"none",theme:"fg-light",size:30,pushOrReplace:"push",position:"none",scrollToTop:!0},{container:"fg-paging-container"},null,-100)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Dots=b.Paging.extend({}),b.DotsControl=b.PagingControl.extend({construct:function(b,c,d){this._super(b,c,d),this.$container=a(),this.$list=a(),this.$items=a()},create:function(){for(var b,c=this,d=c.pages.cls,e=c.pages.il8n,f=[],g=a("<ul/>",{class:d.list}),h=0,i=c.pages.total;h<i;h++)f.push(b=c.createItem(h+1,e.page)),g.append(b);return c.$list=g,c.$container=a("<nav/>",{class:d.container}).addClass(c.pages.theme).append(g),c.$items=a(a.map(f,function(a){return a.get()})),!0},append:function(){var a=this;"top"===a.position?a.$container.insertBefore(a.tmpl.$el):a.$container.insertAfter(a.tmpl.$el)},destroy:function(){var b=this,c=b.pages.sel;b.$list.find(c.link).off("click.foogallery",b.onLinkClick),b.$container.remove(),b.$container=a(),b.$list=a(),b.$items=a()},update:function(a){this.setSelected(a-1)},setSelected:function(b){var c=this,e=c.pages.cls,f=c.pages.il8n,g=c.pages.sel;c.$items.filter(g.selected).removeClass(e.selected).each(function(b,c){var e=a(c),f=e.data("label"),h=e.find(g.reader);d.string(f)&&0!==h.length&&h.html(f)}),c.$items.eq(b).addClass(e.selected).each(function(b,c){var e=a(c),h=e.find(g.reader),i=h.html();d.string(i)&&0!==h.length&&(e.data("label",i),h.html(f.current))})},createItem:function(b,c,e,f,g){e=d.string(e)?e:b,c=d.string(c)?c:"";var h=this,i=h.pages.opt,j=h.pages.cls,k=a("<a/>",{class:j.link,href:"#page-"+b}).html(e).on("click.foogallery",{self:h,page:b},h.onLinkClick);d.empty(c)||k.attr("title",c.replace(/\{PAGE}/g,b).replace(/\{LIMIT}/g,i.limit+"")),g=d.string(g)?g:c,d.empty(g)||k.prepend(a("<span/>",{class:j.reader,text:g.replace(/\{PAGE}/g,"").replace(/\{LIMIT}/g,i.limit+"")}));var l=a("<li/>",{class:j.item}).append(k);return f=d.string(f)?f:"",d.empty(f)||l.addClass(f),l},onLinkClick:function(b){b.preventDefault();var c=b.data.self,d=b.data.page,e=c.pages.sel;a(this).closest(e.item).is(e.disabled)||(c.pages.set(d,!0),c.tmpl.loadAvailable())}}),b.paging.register("dots",b.Dots,b.DotsControl,{type:"dots",position:"both",pushOrReplace:"push"},{list:"fg-dots",item:"fg-dot-item",link:"fg-dot-link",disabled:"fg-disabled",selected:"fg-selected",visible:"fg-visible",reader:"fg-sr-only"},{current:"Current page",page:"Page {PAGE}"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c){b.DefaultTemplate=b.Template.extend({}),b.template.register("default",b.DefaultTemplate,null,{container:"foogallery fg-default"})}(FooGallery.$,FooGallery,FooGallery.utils),function(a,b,c,d){b.MasonryTemplate=b.Template.extend({construct:function(a,b){this._super(a,b),this.masonry=null,this.style=null,this.$columnWidth=null},getStylesheet:function(){var a=this;return null===a.style&&(a.style=document.createElement("style"),a.style.appendChild(document.createTextNode("")),document.head.appendChild(a.style)),a.style.sheet},delayedLayout:function(){var a=this;a._delayedLayout&&clearTimeout(a._delayedLayout),a._delayedLayout=setTimeout(function(){a._delayedLayout=null,a.masonry.layout()},20)},onPreInit:function(b,c){var e=c.sel,f=c.cls;f.layouts=a.map(f.layout,function(a){return a}).join(" ");for(var g=a.map(f.layout,function(a,b){return{key:b,value:a}}),h=0,i=g.length;h<i;h++)if(c.$el.hasClass(g[h].value)){c.template.layout=g[h].key;break}d.string(f.layout[c.template.layout])||(c.template.layout="col4");var j,k,l="fixed"===c.template.layout;if(c.template.isFitWidth=l,c.template.percentPosition=!l,c.template.transitionDuration=0,c.template.itemSelector=e.item.elem,c.$el.removeClass(f.layouts).addClass(f.layout[c.template.layout]),l||(0===c.$el.find(e.gutterWidth).length&&c.$el.prepend(a("<div/>").addClass(f.gutterWidth)),c.template.gutter=e.gutterWidth),0===c.$el.find(e.columnWidth).length&&c.$el.prepend(a("<div/>").addClass(f.columnWidth)),l&&d.number(c.template.columnWidth)){var m=c.$el.find(e.columnWidth).width(c.template.columnWidth);j=c.getStylesheet(),k="#"+c.id+e.container+" "+e.item.elem+" { width: "+m.outerWidth()+"px; }",j.insertRule(k,0)}c.template.columnWidth=e.columnWidth,l&&d.number(c.template.gutter)&&(j=c.getStylesheet(),k="#"+c.id+e.container+" "+e.item.elem+" { margin-bottom: "+c.template.gutter+"px; }",j.insertRule(k,0)),c.masonry=new Masonry(c.$el.get(0),c.template)},onPostInit:function(a,b){b.masonry.layout()},onFirstLoad:function(a,b){b.masonry.layout()},onReady:function(a,b){b.delayedLayout()},onDestroy:function(a,b){b._delayedLayout&&clearTimeout(b._delayedLayout),b.$el.find(b.sel.columnWidth).remove(),b.$el.find(b.sel.gutterWidth).remove(),b.style&&b.style.parentNode&&b.style.parentNode.removeChild(b.style)},onDestroyed:function(a,b){b.masonry instanceof Masonry&&b.masonry.destroy()},onLayout:function(a,b){b.masonry.layout()},onParsedItems:function(a,b,c){b.masonry.layout()},onAppendedItems:function(a,b,c){c=b.items.jquerify(c),c=b.masonry.addItems(c),b.masonry.layoutItems(c,!0)},onDetachItem:function(a,b,c){a.isDefaultPrevented()||(a.preventDefault(),b.masonry.remove(c.$el),c.isAttached=!1,c.unfix())},onDetachedItems:function(a,b,c){b.masonry.layout()},onLoadedItems:function(a,b,c){b.masonry.layout()}}),b.template.register("masonry",b.MasonryTemplate,{fixLayout:!0,template:{initLayout:!1,isInitLayout:!1,layout:"col4"}},{container:"foogallery fg-masonry",columnWidth:"fg-column-width",gutterWidth:"fg-gutter-width",layout:{fixed:"fg-masonry-fixed",col2:"fg-masonry-2col",col3:"fg-masonry-3col",col4:"fg-masonry-4col",col5:"fg-masonry-5col"}})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Justified=c.Class.extend({construct:function(c,d){this.tmpl=c,this.$el=c.$el,this.options=a.extend(!0,{},b.Justified.defaults,d),this._items=[]},init:function(){var a=this;d.string(a.options.maxRowHeight)&&(a.options.maxRowHeight.indexOf("%")?a.options.maxRowHeight=a.options.rowHeight*(parseInt(a.options.maxRowHeight)/100):a.options.maxRowHeight=parseInt(a.options.maxRowHeight))},destroy:function(){this.$el.removeAttr("style")},parse:function(){var b=this;return b._items=a.map(b.tmpl.getItems(),function(a,b){return{index:b,width:a.width,height:a.height,top:0,left:0,$item:a.$el}})},getMaxRowHeight:function(){var a=this;return d.string(a.options.maxRowHeight)&&(a.options.maxRowHeight.indexOf("%")?a.options.maxRowHeight=a.options.rowHeight*(parseInt(a.options.maxRowHeight)/100):a.options.maxRowHeight=parseInt(a.options.maxRowHeight)),d.number(a.options.maxRowHeight)?a.options.maxRowHeight:a.options.rowHeight},getContainerWidth:function(){var a=this;return a.$el.is(":visible")?a.$el.width():a.$el.parents(":visible:first").innerWidth()},layout:function(){this.parse();var b=this,c=0,d=b.getContainerWidth(),e=b.getMaxRowHeight(),f=b.rows(d,e);a.each(f,function(a,d){d.visible&&(a>0&&(c+=b.options.margins),c+=d.height),b.render(d)}),b.$el.height(c)},render:function(a){for(var b,c=0,d=a.items.length;c<d;c++)b=a.items[c],a.visible?b.$item.css({width:b.width,height:b.height,top:b.top,left:b.left,display:"",maxHeight:this.options.maxRowHeight>0?this.options.maxRowHeight:""}).addClass("fg-positioned"):b.$item.css("display","none")},justify:function(a,b,c,d){var e=this,f=e.options.margins*(a.items.length-1),g=c-f,h=g/a.width;a.width=a.width*h,a.height=a.height*h,a.top=b,a.height>d&&(a.height=d),a.left=0,a.width<g&&(a.left=(g-a.width)/2),a.width+=f;for(var i,j=a.left,k=0,l=a.items.length;k<l;k++)k>0&&(j+=e.options.margins),i=a.items[k],i.left=j,i.top=b,i.width=i.width*h,i.height=i.height*h,i.height>d&&(i.height=d),j+=i.width;return a.height},position:function(a,b,c,d){var e=this,f=e.options.margins*(a.items.length-1),g=c-f;if(a.top=b,a.left=0,a.width<g)switch(d){case"center":a.left=(g-a.width)/2;break;case"right":a.left=g-a.width}a.width+=f;for(var h,i=a.left,j=0,k=a.items.length;j<k;j++)j>0&&(i+=e.options.margins),h=a.items[j],h.left=i,h.top=b,i+=h.width;return a.height},lastRow:function(a,b,c,d){var e=this,f=e.options.margins*(a.items.length-1),g=c-f,h=a.width/g>e.options.justifyThreshold;switch(e.options.lastRow){case"hide":h?e.justify(a,b,c,d):a.visible=!1;break;case"justify":e.justify(a,b,c,d);break;case"nojustify":h?e.justify(a,b,c,d):e.position(a,b,c,"left");break;case"left":case"center":case"right":h?e.justify(a,b,c,d):e.position(a,b,c,e.options.lastRow)}},items:function(){return a.map(this._items,function(a){return{index:a.index,width:a.width,height:a.height,$item:a.$item,top:a.top,left:a.left}})},rows:function(a,b){function c(){var a={index:++h,visible:!0,width:0,height:e.options.rowHeight,top:0,left:0,items:[]};return g.push(a),a}for(var d,e=this,f=e.items(),g=[],h=-1,i=c(),j=0,k=0,l=0,m=f.length;l<m;l++){if(d=f[l],d.height!=e.options.rowHeight){var n=e.options.rowHeight/d.height;d.height=d.height*n,d.width=d.width*n}k+d.width>a&&l>0&&(g.length>1&&(j+=e.options.margins),j+=e.justify(i,j,a,b),i=c(),k=0),i.items.length>0&&(k+=e.options.margins),k+=d.width,i.width+=d.width,i.items.push(d)}return g.length>1&&(j+=e.options.margins),e.lastRow(i,j,a,b),g}}),b.Justified.defaults={itemSelector:".fg-item",rowHeight:150,maxRowHeight:"200%",margins:0,lastRow:"center",justifyThreshold:1,refreshInterval:250}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c){b.JustifiedTemplate=b.Template.extend({onPreInit:function(a,c){c.justified=new b.Justified(c,c.template)},onInit:function(a,b){b.justified.init()},onFirstLoad:function(a,b){b.justified.layout()},onReady:function(a,b){b.justified.layout()},onDestroy:function(a,b){b.justified.destroy()},onLayout:function(a,b){b.justified.layout()},onAfterPageChange:function(a,b,c,d,e){e||b.justified.layout()},onAfterFilterChange:function(a,b){b.justified.layout()}}),b.template.register("justified",b.JustifiedTemplate,null,{container:"foogallery fg-justified"})}(FooGallery.$,FooGallery,FooGallery.utils.is),function(a,b,c,d,e){b.PortfolioTemplate=b.Template.extend({construct:function(a,b){this._super(a,b),this.style=null,this.fullWidth=!1},getStylesheet:function(){var a=this;return null===a.style&&(a.style=document.createElement("style"),a.style.appendChild(document.createTextNode("")),document.head.appendChild(a.style)),a.style.sheet},onPreInit:function(a,b){b.appendCSS()},onPostInit:function(a,b){b.checkCSS()},onDestroy:function(a,b){b.removeCSS()},onLayout:function(a,b){b.checkCSS()},checkCSS:function(){var a=this,b=a.getContainerWidth();b<a.template.columnWidth!==a.fullWidth&&a.appendCSS(b)},appendCSS:function(a){var b=this;a=d.number(a)?a:b.getContainerWidth(),b.removeCSS();var c,e=b.getStylesheet(),f="#"+b.id+b.sel.container,g=f+" "+b.sel.item.elem,h=b.template.columnWidth,i=Math.ceil(b.template.gutter/2);switch(b.template.align){case"center":c=f+" { justify-content: center; }",e.insertRule(c,0);break;case"left":c=f+" { justify-content: flex-start; }",e.insertRule(c,0);break;case"right":c=f+" { justify-content: flex-end; }",e.insertRule(c,0)}b.fullWidth=a<h,b.fullWidth?(c=g+" { max-width: 100%; min-width: 100%; margin: "+i+"px; }",e.insertRule(c,0)):(c=g+" { max-width: "+h+"px; min-width: "+h+"px; margin: "+i+"px; }",e.insertRule(c,0))},removeCSS:function(){var a=this;a.style&&a.style.parentNode&&(a.style.parentNode.removeChild(a.style),a.style=null,a.fullWidth=!1)}}),b.template.register("simple_portfolio",b.PortfolioTemplate,{template:{gutter:40,align:"center",columnWidth:250}},{container:"foogallery fg-simple_portfolio"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c,d){b.ImageViewerTemplate=b.Template.extend({construct:function(b,c){this._super(d.extend({},b,{paging:{pushOrReplace:"replace",theme:"fg-light",type:"default",size:1,position:"none",scrollToTop:!1}}),c),this.$inner=a(),this.$current=a(),this.$total=a(),this.$prev=a(),this.$next=a()},createChildren:function(){var b=this;return a("<div/>",{class:b.cls.inner}).append(a("<div/>",{class:b.cls.innerContainer}),a("<div/>",{class:b.cls.controls}).append(a("<div/>",{class:b.cls.prev}).append(a("<span/>",{text:b.il8n.prev})),a("<label/>",{class:b.cls.count,text:b.il8n.count}).prepend(a("<span/>",{class:b.cls.countCurrent,text:"0"})).append(a("<span/>",{class:b.cls.countTotal,text:"0"})),a("<div/>",{class:b.cls.next}).append(a("<span/>",{text:b.il8n.next}))))},destroyChildren:function(){var a=this;a.$el.find(a.sel.inner).remove()},onPreInit:function(a,b){b.$inner=b.$el.find(b.sel.innerContainer),b.$current=b.$el.find(b.sel.countCurrent),b.$total=b.$el.find(b.sel.countTotal),b.$prev=b.$el.find(b.sel.prev),b.$next=b.$el.find(b.sel.next)},onInit:function(a,b){b.template.attachFooBox&&b.$el.on("foobox.previous",{self:b},b.onFooBoxPrev).on("foobox.next",{self:b},b.onFooBoxNext),b.$prev.on("click",{self:b},b.onPrevClick),b.$next.on("click",{self:b},b.onNextClick)},onFirstLoad:function(a,b){b.update()},onDestroy:function(a,b){b.template.attachFooBox&&b.$el.off({"foobox.previous":b.onFooBoxPrev,"foobox.next":b.onFooBoxNext}),b.$prev.off("click",b.onPrevClick),b.$next.off("click",b.onNextClick)},onAppendItem:function(a,b,c){a.preventDefault(),b.$inner.append(c.$el),c.fix(),c.isAttached=!0},onAfterPageChange:function(a,b,c,d,e){e||b.update()},onAfterFilterChange:function(a,b){b.update()},update:function(){this.pages&&(this.$current.text(this.pages.current),this.$total.text(this.pages.total))},prev:function(){this.pages&&(this.template.loop&&1===this.pages.current?this.pages.last():this.pages.prev(),this.update())},next:function(){this.pages&&(this.template.loop&&this.pages.current===this.pages.total?this.pages.first():this.pages.next(),this.update())},onFooBoxPrev:function(a){a.data.self.prev()},onFooBoxNext:function(a){a.data.self.next()},onPrevClick:function(a){a.preventDefault(),a.stopPropagation(),a.data.self.prev()},onNextClick:function(a){a.preventDefault(),a.stopPropagation(),a.data.self.next()}}),b.template.register("image-viewer",b.ImageViewerTemplate,{template:{attachFooBox:!1,loop:!1}},{container:"foogallery fg-image-viewer",inner:"fiv-inner",innerContainer:"fiv-inner-container",
12
- controls:"fiv-ctrls",prev:"fiv-prev",next:"fiv-next",count:"fiv-count",countCurrent:"fiv-count-current",countTotal:"fiv-count-total"},{prev:"Prev",next:"Next",count:"of"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.obj),function(a,b,c){b.ThumbnailTemplate=b.Template.extend({construct:function(a,b){this._super(c.extend({},a,{filtering:{type:"none"},paging:{pushOrReplace:"replace",theme:"fg-light",type:"default",size:1,position:"none",scrollToTop:!1}}),b)}}),b.template.register("thumbnail",b.ThumbnailTemplate,null,{container:"foogallery fg-thumbnail"})}(FooGallery.$,FooGallery,FooGallery.utils.obj),function(a,b,c,d,e,f){b.StackAlbum=c.Class.extend({construct:function(c,f){var g=this;g.$el=d.jq(c)?c:a(c),g.el=g.$el.get(0),g.opt=e.extend({},b.StackAlbum.defaults,f,g.$el.data("foogallery")),g.$back=g.$el.find(".fg-header-back"),g.$active=g.$el.find(".fg-header-active"),g.$piles=g.$el.find(".fg-piles"),g.piles=g.$piles.find(".fg-pile").map(function(a,c){return new b.StackAlbum.Pile(g,c,{index:a})}).get(),g.ignoreResize=!1,g.robserver=new ResizeObserver(function(){!g.ignoreResize&&g.$el.is(":visible")&&g.layout(!0)})},init:function(){var a=this;a.piles.forEach(function(a){a.init()}),a.$back.on("click.foogallery",{self:a},a.onBackClick),a.robserver.observe(a.el)},destroy:function(){var a=this;a.robserver.disconnect(),a.$back.off(".foogallery"),a.piles.forEach(function(a){a.destroy()})},getLayoutInfo:function(){var a=this,b=a.opt.gutter+2*a.opt.border;return{maxWidth:a.$el.width(),space:b,halfSpace:b/2,itemWidth:a.opt.itemWidth,itemHeight:a.opt.itemHeight,itemOuterWidth:a.opt.itemWidth+2*a.opt.border,itemOuterHeight:a.opt.itemHeight+2*a.opt.border,blockWidth:a.opt.itemWidth+b,blockHeight:a.opt.itemHeight+b,border:a.opt.border,doubleBorder:2*a.opt.border,gutter:a.opt.gutter,halfGutter:a.opt.gutter/2}},layout:function(a){var b,c=this;a&&(c.$el.addClass("fg-disable-transitions"),c.$el.prop("offsetWidth")),c.hasActive?(b=c.activePile.layout(),c.activePile.setPosition(0,0,b.width,b.height),c.$piles.css({width:b.width+"px",height:b.height+"px"})):(b=c.layoutPiles(),c.$piles.css({width:b.width+"px",height:b.height+"px"})),a&&c.$el.removeClass("fg-disable-transitions")},layoutPiles:function(a){var b=this,c=b.getLayoutInfo(),e=0,f=1,g=0;return a=d.fn(a)?a:function(){},b.piles.forEach(function(b){var d=e;(e+=c.blockWidth)>c.maxWidth&&(d=0,e=c.blockWidth,f++);var h=c.blockHeight*(f-1);a(b,h,d,c.blockWidth,c.blockHeight),b.setPosition(h,d,c.blockWidth,c.blockHeight),e>g&&(g=e)}),{width:g,height:c.blockHeight*f}},setActive:function(a){var c,d=this,e=d.activePile,g=e instanceof b.StackAlbum.Pile;a=a instanceof b.StackAlbum.Pile?a:null,d.activePile=a,d.hasActive=null!==a,g&&e.collapse(),d.ignoreResize=!0,d.hasActive?(d.piles.forEach(function(b){b!==a&&b.hide(d.activePile)}),c=d.activePile.expand(),d.$active.text(a.title),d.$el.addClass("fg-has-active")):(c=d.layoutPiles(function(a){a.show()}),d.$el.removeClass("fg-has-active")),f.start(d.$piles,function(a){a.css({width:c.width+"px",height:c.height+"px"})},!1,350).then(function(){d.ignoreResize=!1})},onBackClick:function(a){a.preventDefault(),a.stopPropagation(),a.data.self.setActive(null)}}),b.StackAlbum.defaults={gutter:50,itemWidth:150,itemHeight:150,border:10,angleStep:1,randomAngle:!1}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj,FooGallery.utils.transition),function(a,b,c,d,e){b.StackAlbum.Pile=c.Class.extend({construct:function(c,f,g){var h=this;h.album=c,h.$el=d.jq(f)?f:a(f),h.opt=e.extend({},b.StackAlbum.Pile.defaults,g,h.$el.data()),h.title=h.opt.title,h.items=h.$el.find(".fg-pile-item").map(function(a,c){return new b.StackAlbum.Item(h,c,{index:a})}).get(),h.$cover=a("<div/>",{class:"fg-pile-cover"}).append(a("<div/>",{class:"fg-pile-cover-content"}).append(a("<span/>",{class:"fg-pile-cover-title",text:h.opt.title}),a("<span/>",{class:"fg-pile-cover-count",text:h.items.length}))),h.top=0,h.left=0,h.isExpanded=!1},init:function(){var a=this,b=a.album.opt,c=a.getAngles(b.angleStep),d=b.randomAngle?a.randomAngle(c):b.angleStep;a.$cover.on("click.foogallery",{self:a},a.onCoverClick),a.items.forEach(function(e,f){e.init(),f>3||(0===f?(e.$el.addClass("fg-has-cover").append(a.$cover),e.load()):(f%2==0?e.setAngle(-d):e.setAngle(d),b.randomAngle?d=a.randomAngle(c):d+=b.angleStep))})},destroy:function(){var a=this;a.$cover.remove(),a.items.forEach(function(a,b){0===b&&a.$el.removeClass("fg-has-cover"),a.destroy()})},getAngles:function(a){for(var b=[],c=1;c<=3;c++)b.push(c*a);return b},randomAngle:function(a){var b=a.length,c=Math.floor(Math.random()*(b-0)+0),d=a.splice(c,1);return 1===d.length?d[0]:0},setPosition:function(a,b,c,e){var f=this;f.top=a,f.left=b,d.number(c)&&d.number(e)?f.$el.css({top:a+"px",left:b+"px",width:c+"px",height:e+"px"}):f.$el.css({top:a+"px",left:b+"px"})},layout:function(){var a=this,b=a.album.getLayoutInfo(),c=0,d=1,e=!1,f=0;return a.items.forEach(function(a){(c+=b.halfGutter)>b.maxWidth&&(c=b.halfGutter,d++,e=!0);var g=c;c+=b.itemOuterWidth+b.halfGutter,!e&&c>b.maxWidth&&(g=b.halfGutter,c=b.blockWidth,d++);var h=b.blockHeight*(d-1)+b.halfGutter;e=!1,a.setPosition(h,g,b.itemOuterWidth,b.itemOuterHeight),a.isLoaded||a.load(),c>f&&(f=c)}),{width:f,height:b.blockHeight*d}},expand:function(){var a,b=this;return b.$el.removeClass("fg-collapsed").addClass("fg-expanded"),a=b.layout(),b.setPosition(0,0,a.width,a.height),b.isExpanded=!0,a},collapse:function(){var a=this,b=a.album.getLayoutInfo();a.$el.removeClass("fg-expanded").addClass("fg-collapsed"),a.items.forEach(function(a){a.setPosition(b.halfGutter,b.halfGutter,b.itemOuterWidth,b.itemOuterHeight)});var c={width:b.blockWidth,height:b.blockHeight};return a.setPosition(0,0,c.width,c.height),a.isExpanded=!1,c},show:function(){this.$el.removeClass("fg-hidden fg-expanded fg-collapsed")},hide:function(a){var c=this;a instanceof b.StackAlbum.Pile&&c.setPosition(a.top,a.left),c.$el.addClass("fg-hidden")},onCoverClick:function(a){a.preventDefault(),a.stopPropagation();var b=a.data.self;b.album.setActive(b)}}),b.StackAlbum.Pile.defaults={index:-1,title:null}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj),function(a,b,c,d,e){b.StackAlbum.Item=c.Class.extend({construct:function(c,f,g){var h=this;h.$el=d.jq(f)?f:a(f),h.opt=e.extend({},b.StackAlbum.Item.defaults,g,h.$el.data()),h.$thumb=h.$el.find(".fg-pile-item-thumb"),h.$image=h.$el.find(".fg-pile-item-image"),h.isLoaded=!1,h.isLoading=!1,h._loading=null},init:function(){},destroy:function(){},setAngle:function(a){this.$el.css({transform:"rotate("+a+"deg)"})},setPosition:function(a,b,c,d){this.$el.css({top:a+"px",left:b+"px",width:c+"px",height:d+"px"})},load:function(){var b=this;return d.promise(b._loading)?b._loading:b._loading=a.Deferred(function(a){b.$el.addClass("fg-loading"),b.isLoading=!0,b.$image.on({"load.foogallery":function(){b.$image.off(".foogallery"),b.$el.removeClass("fg-loading"),b.isLoading=!1,b.isLoaded=!0,a.resolve()},"error.foogallery":function(){b.$image.off(".foogallery"),b.$el.removeClass("fg-loading"),b.isLoading=!1,b.isLoaded=!0,a.reject()}}),b.$image.prop("src",b.$image.attr(b.opt.src))}).promise()}}),b.StackAlbum.Item.defaults={index:-1,src:"data-src-fg"}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj),function(a,b,c){a.fn.foogalleryStackAlbum=function(c){return this.each(function(c,d){var e=a(d),f=e.data("__FooGalleryAlbum__");f instanceof b.StackAlbum&&f.destroy(),f=new b.StackAlbum(e),f.init(),e.data("__FooGalleryAlbum__",f)})},b.loadStackAlbums=b.reloadStackAlbums=function(){a(function(){a(".foogallery-stack-album:not(.fg-ready)").foogalleryStackAlbum()}),c.ready(function(){a(".foogallery-stack-album.fg-ready").foogalleryStackAlbum()})},b.loadStackAlbums()}(FooGallery.$,FooGallery,FooGallery.utils),function(a,b,c,d,e){b.triggerPostLoad=function(b,c,d,e,f){if("first-load"===b.type||c.initialized&&("after-page-change"===b.type&&!f||"after-filter-change"===b.type))try{if(c.$el.parents(".fbx-item").length>0)return;c.$el.hasClass("fbx-instance")&&window.FOOBOX&&a.fn.foobox?c.$el.foobox(window.FOOBOX.o):a("body").trigger("post-load")}catch(a){console.error(a)}},b.autoDefaults={on:{"first-load.foogallery after-page-change.foogallery after-filter-change.foogallery":b.triggerPostLoad}},b.autoEnabled=!0,b.auto=function(a){b.autoDefaults=d.merge(b.autoDefaults,a)},b.globalsMerged=!1,b.mergeGlobals=function(){if(!0!==b.globalsMerged&&window.FooGallery_il8n&&e.object(window.FooGallery_il8n)){var a=window.FooGallery_il8n;for(var d in a)if(a.hasOwnProperty(d)&&b[d]instanceof c.Factory&&e.object(a[d]))for(var f in a[d])a[d].hasOwnProperty(f)&&b[d].configure(f,null,null,a[d][f]);b.globalsMerged=!0}},b.load=b.reload=function(){a(function(){b.mergeGlobals(),b.autoEnabled&&a('[id^="foogallery-gallery-"]:not(.fg-ready)').foogallery(b.autoDefaults)}),c.ready(function(){b.mergeGlobals(),b.autoEnabled&&a('[id^="foogallery-gallery-"].fg-ready').foogallery(b.autoDefaults)})},b.load()}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.obj,FooGallery.utils.is);
1
  /*
2
  * FooGallery - The Most Intuitive and Extensible Gallery Creation and Management Tool Ever Created for WordPress
3
+ * @version 1.4.26
4
  * @link
5
  * @copyright Steven Usher & Brad Vincent 2015
6
  * @license Released under the GPLv3 license.
7
  */
8
 
9
+ !function(){"use strict";function a(a){this.time=a.time,this.target=a.target,this.rootBounds=a.rootBounds,this.boundingClientRect=a.boundingClientRect,this.intersectionRect=a.intersectionRect||i(),this.isIntersecting=!!a.intersectionRect;var b=this.boundingClientRect,c=b.width*b.height,d=this.intersectionRect,e=d.width*d.height;this.intersectionRatio=c?Number((e/c).toFixed(4)):this.isIntersecting?1:0}function b(a,b){var c=b||{};if("function"!=typeof a)throw new Error("callback must be a function");if(c.root&&1!=c.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=d(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=a,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(c.rootMargin),this.thresholds=this._initThresholds(c.threshold),this.root=c.root||null,this.rootMargin=this._rootMarginValues.map(function(a){return a.value+a.unit}).join(" ")}function c(){return window.performance&&performance.now&&performance.now()}function d(a,b){var c=null;return function(){c||(c=setTimeout(function(){a(),c=null},b))}}function e(a,b,c,d){"function"==typeof a.addEventListener?a.addEventListener(b,c,d||!1):"function"==typeof a.attachEvent&&a.attachEvent("on"+b,c)}function f(a,b,c,d){"function"==typeof a.removeEventListener?a.removeEventListener(b,c,d||!1):"function"==typeof a.detatchEvent&&a.detatchEvent("on"+b,c)}function g(a,b){var c=Math.max(a.top,b.top),d=Math.min(a.bottom,b.bottom),e=Math.max(a.left,b.left),f=Math.min(a.right,b.right),g=f-e,h=d-c;return g>=0&&h>=0&&{top:c,bottom:d,left:e,right:f,width:g,height:h}}function h(a){var b;try{b=a.getBoundingClientRect()}catch(a){}return b?(b.width&&b.height||(b={top:b.top,right:b.right,bottom:b.bottom,left:b.left,width:b.right-b.left,height:b.bottom-b.top}),b):i()}function i(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function j(a,b){for(var c=b;c;){if(c==a)return!0;c=k(c)}return!1}function k(a){var b=a.parentNode;return b&&11==b.nodeType&&b.host?b.host:b&&b.assignedSlot?b.assignedSlot.parentNode:b}if("object"==typeof window){if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)return void("isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}}));var l=window.document,m=[];b.prototype.THROTTLE_TIMEOUT=100,b.prototype.POLL_INTERVAL=null,b.prototype.USE_MUTATION_OBSERVER=!0,b.prototype.observe=function(a){if(!this._observationTargets.some(function(b){return b.element==a})){if(!a||1!=a.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:a,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},b.prototype.unobserve=function(a){this._observationTargets=this._observationTargets.filter(function(b){return b.element!=a}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},b.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},b.prototype.takeRecords=function(){var a=this._queuedEntries.slice();return this._queuedEntries=[],a},b.prototype._initThresholds=function(a){var b=a||[0];return Array.isArray(b)||(b=[b]),b.sort().filter(function(a,b,c){if("number"!=typeof a||isNaN(a)||a<0||a>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return a!==c[b-1]})},b.prototype._parseRootMargin=function(a){var b=a||"0px",c=b.split(/\s+/).map(function(a){var b=/^(-?\d*\.?\d+)(px|%)$/.exec(a);if(!b)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(b[1]),unit:b[2]}});return c[1]=c[1]||c[0],c[2]=c[2]||c[0],c[3]=c[3]||c[1],c},b.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(e(window,"resize",this._checkForIntersections,!0),e(l,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in window&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(l,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},b.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,f(window,"resize",this._checkForIntersections,!0),f(l,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},b.prototype._checkForIntersections=function(){var b=this._rootIsInDom(),d=b?this._getRootRect():i();this._observationTargets.forEach(function(e){var f=e.element,g=h(f),i=this._rootContainsTarget(f),j=e.entry,k=b&&i&&this._computeTargetAndRootIntersection(f,d),l=e.entry=new a({time:c(),target:f,boundingClientRect:g,rootBounds:d,intersectionRect:k});j?b&&i?this._hasCrossedThreshold(j,l)&&this._queuedEntries.push(l):j&&j.isIntersecting&&this._queuedEntries.push(l):this._queuedEntries.push(l)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},b.prototype._computeTargetAndRootIntersection=function(a,b){if("none"!=window.getComputedStyle(a).display){for(var c=h(a),d=c,e=k(a),f=!1;!f;){var i=null,j=1==e.nodeType?window.getComputedStyle(e):{};if("none"==j.display)return;if(e==this.root||e==l?(f=!0,i=b):e!=l.body&&e!=l.documentElement&&"visible"!=j.overflow&&(i=h(e)),i&&!(d=g(i,d)))break;e=k(e)}return d}},b.prototype._getRootRect=function(){var a;if(this.root)a=h(this.root);else{var b=l.documentElement,c=l.body;a={top:0,left:0,right:b.clientWidth||c.clientWidth,width:b.clientWidth||c.clientWidth,bottom:b.clientHeight||c.clientHeight,height:b.clientHeight||c.clientHeight}}return this._expandRectByRootMargin(a)},b.prototype._expandRectByRootMargin=function(a){var b=this._rootMarginValues.map(function(b,c){return"px"==b.unit?b.value:b.value*(c%2?a.width:a.height)/100}),c={top:a.top-b[0],right:a.right+b[1],bottom:a.bottom+b[2],left:a.left-b[3]};return c.width=c.right-c.left,c.height=c.bottom-c.top,c},b.prototype._hasCrossedThreshold=function(a,b){var c=a&&a.isIntersecting?a.intersectionRatio||0:-1,d=b.isIntersecting?b.intersectionRatio||0:-1;if(c!==d)for(var e=0;e<this.thresholds.length;e++){var f=this.thresholds[e];if(f==c||f==d||f<c!=f<d)return!0}},b.prototype._rootIsInDom=function(){return!this.root||j(l,this.root)},b.prototype._rootContainsTarget=function(a){return j(this.root||l,a)},b.prototype._registerInstance=function(){m.indexOf(this)<0&&m.push(this)},b.prototype._unregisterInstance=function(){var a=m.indexOf(this);-1!=a&&m.splice(a,1)},window.IntersectionObserver=b,window.IntersectionObserverEntry=a}}(),function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.ResizeObserver=b()}(this,function(){"use strict";function a(a,b){function c(){f&&(f=!1,a()),g&&e()}function d(){n(c)}function e(){var a=Date.now();if(f){if(a-h<o)return;g=!0}else f=!0,g=!1,setTimeout(d,b);h=a}var f=!1,g=!1,h=0;return e}function b(a){return parseFloat(a)||0}function c(a){for(var c=[],d=1;d<arguments.length;d++)c[d-1]=arguments[d];return c.reduce(function(c,d){return c+b(a["border-"+d+"-width"])},0)}function d(a){for(var c=["top","right","bottom","left"],d={},e=0,f=c;e<f.length;e++){var g=f[e],h=a["padding-"+g];d[g]=b(h)}return d}function e(a){var b=a.getBBox();return j(0,0,b.width,b.height)}function f(a){var e=a.clientWidth,f=a.clientHeight;if(!e&&!f)return v;var h=u(a).getComputedStyle(a),i=d(h),k=i.left+i.right,l=i.top+i.bottom,m=b(h.width),n=b(h.height);if("border-box"===h.boxSizing&&(Math.round(m+k)!==e&&(m-=c(h,"left","right")+k),Math.round(n+l)!==f&&(n-=c(h,"top","bottom")+l)),!g(a)){var o=Math.round(m+k)-e,p=Math.round(n+l)-f;1!==Math.abs(o)&&(m-=o),1!==Math.abs(p)&&(n-=p)}return j(i.left,i.top,m,n)}function g(a){return a===u(a).document.documentElement}function h(a){return l?w(a)?e(a):f(a):v}function i(a){var b=a.x,c=a.y,d=a.width,e=a.height,f="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,g=Object.create(f.prototype);return t(g,{x:b,y:c,width:d,height:e,top:c,right:b+d,bottom:e+c,left:b}),g}function j(a,b,c,d){return{x:a,y:b,width:c,height:d}}var k=function(){function a(a,b){var c=-1;return a.some(function(a,d){return a[0]===b&&(c=d,!0)}),c}return"undefined"!=typeof Map?Map:function(){function b(){this.__entries__=[]}return Object.defineProperty(b.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),b.prototype.get=function(b){var c=a(this.__entries__,b),d=this.__entries__[c];return d&&d[1]},b.prototype.set=function(b,c){var d=a(this.__entries__,b);~d?this.__entries__[d][1]=c:this.__entries__.push([b,c])},b.prototype.delete=function(b){var c=this.__entries__,d=a(c,b);~d&&c.splice(d,1)},b.prototype.has=function(b){return!!~a(this.__entries__,b)},b.prototype.clear=function(){this.__entries__.splice(0)},b.prototype.forEach=function(a,b){void 0===b&&(b=null);for(var c=0,d=this.__entries__;c<d.length;c++){var e=d[c];a.call(b,e[1],e[0])}},b}()}(),l="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,m=function(){return"undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")()}(),n=function(){return"function"==typeof requestAnimationFrame?requestAnimationFrame.bind(m):function(a){return setTimeout(function(){return a(Date.now())},1e3/60)}}(),o=2,p=20,q=["top","right","bottom","left","width","height","size","weight"],r="undefined"!=typeof MutationObserver,s=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=a(this.refresh.bind(this),p)}return b.prototype.addObserver=function(a){~this.observers_.indexOf(a)||this.observers_.push(a),this.connected_||this.connect_()},b.prototype.removeObserver=function(a){var b=this.observers_,c=b.indexOf(a);~c&&b.splice(c,1),!b.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.prototype.updateObservers_=function(){var a=this.observers_.filter(function(a){return a.gatherActive(),a.hasActive()});return a.forEach(function(a){return a.broadcastActive()}),a.length>0},b.prototype.connect_=function(){l&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),r?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},b.prototype.disconnect_=function(){l&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},b.prototype.onTransitionEnd_=function(a){var b=a.propertyName,c=void 0===b?"":b;q.some(function(a){return!!~c.indexOf(a)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),t=function(a,b){for(var c=0,d=Object.keys(b);c<d.length;c++){var e=d[c];Object.defineProperty(a,e,{value:b[e],enumerable:!1,writable:!1,configurable:!0})}return a},u=function(a){return a&&a.ownerDocument&&a.ownerDocument.defaultView||m},v=j(0,0,0,0),w=function(){return"undefined"!=typeof SVGGraphicsElement?function(a){return a instanceof u(a).SVGGraphicsElement}:function(a){return a instanceof u(a).SVGElement&&"function"==typeof a.getBBox}}(),x=function(){function a(a){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=j(0,0,0,0),this.target=a}return a.prototype.isActive=function(){var a=h(this.target);return this.contentRect_=a,a.width!==this.broadcastWidth||a.height!==this.broadcastHeight},a.prototype.broadcastRect=function(){var a=this.contentRect_;return this.broadcastWidth=a.width,this.broadcastHeight=a.height,a},a}(),y=function(){function a(a,b){var c=i(b);t(this,{target:a,contentRect:c})}return a}(),z=function(){function a(a,b,c){if(this.activeObservations_=[],this.observations_=new k,"function"!=typeof a)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=a,this.controller_=b,this.callbackCtx_=c}return a.prototype.observe=function(a){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(a instanceof u(a).Element))throw new TypeError('parameter 1 is not of type "Element".');var b=this.observations_;b.has(a)||(b.set(a,new x(a)),this.controller_.addObserver(this),this.controller_.refresh())}},a.prototype.unobserve=function(a){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(a instanceof u(a).Element))throw new TypeError('parameter 1 is not of type "Element".');var b=this.observations_;b.has(a)&&(b.delete(a),b.size||this.controller_.removeObserver(this))}},a.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},a.prototype.gatherActive=function(){var a=this;this.clearActive(),this.observations_.forEach(function(b){b.isActive()&&a.activeObservations_.push(b)})},a.prototype.broadcastActive=function(){if(this.hasActive()){var a=this.callbackCtx_,b=this.activeObservations_.map(function(a){return new y(a.target,a.broadcastRect())});this.callback_.call(a,b,a),this.clearActive()}},a.prototype.clearActive=function(){this.activeObservations_.splice(0)},a.prototype.hasActive=function(){return this.activeObservations_.length>0},a}(),A="undefined"!=typeof WeakMap?new WeakMap:new k,B=function(){function a(b){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var c=s.getInstance(),d=new z(b,c,this);A.set(this,d)}return a}();return["observe","unobserve","disconnect"].forEach(function(a){B.prototype[a]=function(){var b;return(b=A.get(this))[a].apply(b,arguments)}}),function(){return void 0!==m.ResizeObserver?m.ResizeObserver:B}()}),function(a,b){b.$=a}(jQuery,window.FooGallery=window.FooGallery||{}),function(a){if(!a)return void console.warn("jQuery must be included in the page prior to the FooGallery.utils library.");(function(){try{return!!window.FooGallery.utils}catch(a){return!1}})()||(window.FooGallery.utils={$:a,version:"0.2.2"})}(jQuery),function(a,b){"0.2.2"===b.version&&(b.is={},b.is.array=function(a){return"[object Array]"===Object.prototype.toString.call(a)},b.is.boolean=function(a){return"[object Boolean]"===Object.prototype.toString.call(a)},b.is.element=function(a){return"object"==typeof HTMLElement?a instanceof HTMLElement:!!a&&"object"==typeof a&&1===a.nodeType&&"string"==typeof a.nodeName},b.is.empty=function(a){if(b.is.undef(a)||null===a)return!0;if(b.is.number(a)&&0===a)return!0;if(b.is.boolean(a)&&!1===a)return!0;if(b.is.string(a)&&0===a.length)return!0;if(b.is.array(a)&&0===a.length)return!0;if(b.is.jq(a)&&0===a.length)return!0;if(b.is.hash(a)){for(var c in a)if(a.hasOwnProperty(c))return!1;return!0}return!1},b.is.error=function(a){return"[object Error]"===Object.prototype.toString.call(a)},b.is.fn=function(a){return a===window.alert||"[object Function]"===Object.prototype.toString.call(a)},b.is.hash=function(a){return b.is.object(a)&&a.constructor===Object&&!a.nodeType&&!a.setInterval},b.is.jq=function(c){return!b.is.undef(a)&&c instanceof a},b.is.number=function(a){return"[object Number]"===Object.prototype.toString.call(a)&&!isNaN(a)},b.is.object=function(a){return"[object Object]"===Object.prototype.toString.call(a)&&!b.is.undef(a)&&null!==a},b.is.promise=function(a){return b.is.object(a)&&b.is.fn(a.then)&&b.is.fn(a.promise)},b.is.size=function(a){return!!(b.is.string(a)&&!b.is.empty(a)||b.is.number(a))&&/^(auto|none|(?:[\d.]*)+?(?:%|px|mm|q|cm|in|pt|pc|em|ex|ch|rem|vh|vw|vmin|vmax)?)$/.test(a)},b.is.string=function(a){return"[object String]"===Object.prototype.toString.call(a)},b.is.undef=function(a){return void 0===a})}(FooGallery.utils.$,FooGallery.utils),function(a,b,c){if("0.2.2"===b.version){b.fn={};var d=Function.prototype.toString;b.fn.CONTAINS_SUPER=/xyz/.test(d.call(function(){xyz}))?/\b_super\b/:/.*/,b.fn.addOrOverride=function(a,e,f){if(c.object(a)&&c.string(e)&&!c.empty(e)&&c.fn(f)){var g=a[e],h=c.fn(g)&&b.fn.CONTAINS_SUPER.test(d.call(f));a[e]=h?function(a,b){return function(){var c=this._super;this._super=a;var d=b.apply(this,arguments);return this._super=c,d}}(g,f):f}},b.fn.apply=function(a,b){return b.unshift(a),new(Function.prototype.bind.apply(a,b))},b.fn.arg2arr=function(a){return Array.prototype.slice.call(a)},b.fn.debounce=function(a,c){var d;return function(){var e=this,f=b.fn.arg2arr(arguments);clearTimeout(d),d=setTimeout(function(){a.apply(e,f)},c)}},b.fn.throttle=function(a,c){var d,e;return function(){var f=this,g=b.fn.arg2arr(arguments);d?(clearTimeout(e),e=setTimeout(function(){Date.now()-d>=c&&(a.apply(f,g),d=Date.now())},c-(Date.now()-d))):(a.apply(f,g),d=Date.now())}},b.fn.check=function(d,e,f,g){function h(a){return function(){return a.apply(d,arguments)}}return f=c.fn(f)?f:a.noop,d=c.object(d)?d:window,e=c.string(e)?b.fn.fetch(e,g):e,h(c.fn(e)?e:f)},b.fn.fetch=function(b,d){return!c.string(b)||c.empty(b)?null:(d=c.object(d)?d:window,a.each(b.split("."),function(a,b){if(!d[b])return!1;d=d[b]}),c.fn(d)?d:null)},b.fn.enqueue=function(d,e,f,g){function h(a,b){try{return n.push(a),b.apply(a,i)}catch(a){return j.reject(a,n),j}}var i=b.fn.arg2arr(arguments),j=a.Deferred(),k=a.Deferred(),l=k.promise(),m=[],n=[],o=!0;return d=i.shift(),e=i.shift(),a.each(d,function(a,d){c.fn(d[e])&&(l=l.then(function(){if(!o){var a=b.fn.arg2arr(arguments);m.push(a)}return o=!1,h(d,d[e])}))}),l.then(function(){if(!o){var a=b.fn.arg2arr(arguments);m.push(a)}o=!1,j.resolve(m)}),l.fail(function(){var a=b.fn.arg2arr(arguments);a.push(n),j.reject.apply(j,a)}),k.resolve(),j.promise()},b.fn.when=function(b){function d(){--g||e.resolve(f)}if(!c.array(b)||c.empty(b))return a.when();for(var e=a.Deferred(),f=[],g=b.length,h=0;h<b.length;h++)c.promise(b[h])?b[h].then(function(a){f.push(a)}).always(d):d();return e.promise()},b.fn.rejectWith=function(c,d){var e=a.Deferred(),f=b.fn.arg2arr(arguments);return e.reject.apply(e,f).promise()},b.fn.resolveWith=function(c,d){var e=a.Deferred(),f=b.fn.arg2arr(arguments);return e.resolve.apply(e,f).promise()},b.fn.resolved=a.Deferred().resolve().promise(),b.fn.rejected=a.Deferred().reject().promise()}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b){if("0.2.2"===a.version){a.url={};var c=document.createElement("a");a.url.parts=function(a){c.href=a;var b=c.port?c.port:-1!==["http:","https:"].indexOf(c.protocol)?"https:"===c.protocol?"443":"80":"",d=c.hostname+(b?":"+b:""),e=c.origin?c.origin:c.protocol+"//"+d,f="/"===c.pathname.slice(0,1)?c.pathname:"/"+c.pathname;return{hash:c.hash,host:d,hostname:c.hostname,href:c.href,origin:e,pathname:f,port:b,protocol:c.protocol,search:c.search}},a.url.full=function(a){return!b.string(a)||b.empty(a)?null:(c.href=a,c.href)},a.url.param=function(a,c,d){if(!b.string(a)||!b.string(c)||b.empty(c))return a;var e,f,g,h;return b.undef(d)?(e=new RegExp("[?|&]"+c+"=([^&;]+?)(&|#|;|$)"),f=e.exec(a)||["",""],g=f[1].replace(/\+/g,"%20"),b.string(g)&&!b.empty(g)?decodeURIComponent(g):null):(b.empty(d)?(e=new RegExp("^([^#]*?)(([^#]*)&)?"+c+"(=[^&#]*)?(&|#|$)"),g=a.replace(e,"$1$3$5").replace(/^([^#]*)((\?)&|\?(#|$))/,"$1$3$4")):(e=new RegExp("([?&])"+c+"[^&]*"),h=c+"="+encodeURIComponent(d),(g=a.replace(e,"$1"+h))!==a||e.test(g)||(g+=(-1!==g.indexOf("?")?"&":"?")+h)),g)}}}(FooGallery.utils,FooGallery.utils.is),function(a,b,c){"0.2.2"===a.version&&(a.str={},a.str.camel=function(a){return b.empty(a)?a:a.toUpperCase()===a?a.toLowerCase():a.replace(/^([A-Z])|[-\s_]+(\w)/g,function(a,c,d){return b.string(d)?d.toUpperCase():c.toLowerCase()})},a.str.kebab=function(a){return b.empty(a)?a:a.match(/[A-Z]{2,}(?=[A-Z][a-z0-9]*|\b)|[A-Z]?[a-z0-9]*|[A-Z]|[0-9]+/g).filter(Boolean).map(function(a){return a.toLowerCase()}).join("-")},a.str.contains=function(a,c,d){return!(!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c))&&(c.length<=a.length&&-1!==(d?a.toUpperCase().indexOf(c.toUpperCase()):a.indexOf(c)))},a.str.containsWord=function(a,c,d){if(!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c)||a.length<c.length)return!1;for(var e=a.split(/\W/),f=0,g=e.length;f<g;f++)if(d?e[f].toUpperCase()===c.toUpperCase():e[f]===c)return!0;return!1},a.str.endsWith=function(a,c){return!b.string(a)||b.empty(a)||!b.string(c)||b.empty(c)?a===c:a.slice(a.length-c.length)===c},a.str.escapeRegExp=function(a){return b.empty(a)?a:a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},a.str.fnv1a=function(a){if(!b.string(a)||b.empty(a))return null;var c,d,e=2166136261;for(c=0,d=a.length;c<d;c++)e^=a.charCodeAt(c),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0},a.str.from=function(b,c){return a.str.contains(b,c)?b.substring(b.indexOf(c)+c.length):null},a.str.join=function(d,e,f){if(!b.string(d)||!b.string(e))return null;var g=c.arg2arr(arguments);d=g.shift();var h,i,j=g.shift();for(h=0,i=g.length;h<i;h++)e=g[h],b.empty(e)||(a.str.endsWith(j,d)&&(j=j.slice(0,j.length-d.length)),a.str.startsWith(e,d)&&(e=e.slice(d.length)),j+=d+e);return j},a.str.startsWith=function(a,c){return!b.empty(a)&&!b.empty(c)&&a.slice(0,c.length)===c},a.str.until=function(b,c){return a.str.contains(b,c)?b.substring(0,b.indexOf(c)):b},a.str.format=function(d,e,f){var g=c.arg2arr(arguments);return d=g.shift(),b.string(d)&&g.length>0&&(1===g.length&&(b.array(g[0])||b.object(g[0]))&&(g=g[0]),a.each(g,function(a,b){d=d.replace(new RegExp("\\{"+b+"\\}","gi"),a+"")})),d})}(FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c,d,e){if("0.2.2"===b.version){b.obj={};var f=function(){};b.obj.create=function(a){if(!c.object(a))throw TypeError("Argument must be an object");f.prototype=a;var b=new f;return f.prototype=null,b},b.obj.extend=function(e,f,g){e=c.object(e)?e:{};var h=d.arg2arr(arguments);return h.shift(),a.each(h,function(a,c){b.obj.merge(e,c)}),e},b.obj.merge=function(a,d){a=c.hash(a)?a:{},d=c.hash(d)?d:{};for(var e in d)d.hasOwnProperty(e)&&(c.hash(d[e])?(a[e]=c.hash(a[e])?a[e]:{},b.obj.merge(a[e],d[e])):c.array(d[e])?a[e]=d[e].slice():a[e]=d[e]);return a},b.obj.mergeValid=function(d,e,f,g){if(!c.hash(f)||!c.hash(e))return d;e=c.hash(e)?e:{},g=c.hash(g)?g:{};var h,i,j;for(h in e)e.hasOwnProperty(h)&&c.fn(e[h])&&(i=c.array(g[h])?g[h]:c.string(g[h])?[g[h]]:[h],a.each(i,function(a,g){if(j=b.obj.prop(f,g),!c.undef(j))return e[h](j)?(b.obj.prop(d,h,j),!1):void 0}));return d},b.obj.prop=function(b,d,f){if(c.object(b)&&!c.empty(d)){var g,h;if(c.undef(f))return e.contains(d,".")?(g=d.split("."),h=g.length-1,a.each(g,function(a,d){if(a===h)f=b[d];else{if(!c.hash(b[d]))return!1;b=b[d]}})):c.undef(b[d])||(f=b[d]),f;e.contains(d,".")?(g=d.split("."),h=g.length-1,a.each(g,function(a,d){a===h?b[d]=f:b=c.hash(b[d])?b[d]:b[d]={}})):c.undef(b[d])||(b[d]=f)}}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c){if("0.2.2"===b.version){b.ready=function(a){function c(){try{a.call(window,b.$)}catch(a){console.error(a)}}(Function("/*@cc_on return true@*/")()?"complete"===document.readyState:"loading"!==document.readyState)?c():document.addEventListener("DOMContentLoaded",c,!1)},b.find=function(a,b,d){if(c.fn(b)){d=c.undef(d)?b:d;var e,f;if(c.array(a)){for(e=0,f=a.length;e<f;e++)if(b.call(d,a[e],e,a))return a[e]}else if(c.object(a)){var g=Object.keys(a);for(e=0,f=g.length;e<f;e++)if(b.call(d,a[g[e]],g[e],a))return a[g[e]]}}},b.each=function(a,b,d){if(c.fn(b)){d=c.undef(d)?b:d;var e,f;if(c.array(a))for(e=0,f=a.length;e<f&&!1!==b.call(d,a[e],e,a);e++);else if(c.object(a)){var g=Object.keys(a);for(e=0,f=g.length;e<f&&!1!==b.call(d,a[g[e]],g[e],a);e++);}}},b.inArray=function(a,b){return c.array(b)?b.indexOf(a):-1},b.versionCompare=function(a,b){function c(a){for(var b=a.split("."),c=[],d=0,e=b.length;d<e;d++)c[d]=parseInt(b[d]),isNaN(c[d])&&(c[d]=0);return c}if(!/[\d.]/.test(a)||!/[\d.]/.test(b))return NaN;for(var d=c(a),e=c(b);d.length<e.length;)d.push(0);for(;e.length<d.length;)e.push(0);for(var f=0;f<d.length;++f){if(e.length===f)return 1;if(d[f]!==e[f])return d[f]>e[f]?1:-1}return d.length!==e.length?-1:0};var d=0;b.uniqueId=function(a,b){var e=a.attr("id");return c.empty(e)&&(b=c.string(b)&&!c.empty(b)?b:"uid-",e=b+ ++d,a.attr("id",e).data("__uniqueId__",!0)),e},b.removeUniqueId=function(a){a.data("__uniqueId__")&&a.removeAttr("id").removeData("__uniqueId__")},b.selectify=function(a){if(c.empty(a))return null;if(c.hash(a)){var d,e={};for(var f in a)a.hasOwnProperty(f)&&(d=b.selectify(a[f]))&&(e[f]=d);return e}return c.string(a)||c.array(a)?(c.string(a)&&(a=[a]),a.map(function(a){return c.string(a)?"."+a.split(/\s/g).join("."):null}).join(",")):null},b.src=function(a,b,d,e,f,g,h){if(!c.string(a))return null;if(!c.string(b))return a;var i=b.replace(/(\s[\d.]+[whx]),/g,"$1 @,@ ").split(" @,@ "),j=i.map(function(a){return{url:/^\s*(\S*)/.exec(a)[1],w:parseFloat((/\S\s+(\d+)w/.exec(a)||[0,1/0])[1]),h:parseFloat((/\S\s+(\d+)h/.exec(a)||[0,1/0])[1]),x:parseFloat((/\S\s+([\d.]+)x/.exec(a)||[0,1])[1])}});if(!j.length)return a;j.unshift({url:a,w:j[0].w!==1/0&&j[0].h===1/0?d:1/0,h:j[0].h!==1/0&&j[0].w===1/0?e:1/0,x:1});var k=c.number(h)?h:window.devicePixelRatio||1,l={w:f*k,h:g*k,x:k},m=["w","h","x"];return m.forEach(function(a){var b=Math.max.apply(null,j.map(function(b){return b[a]}));j=j.filter(function(c){return c[a]>=l[a]||c[a]===b})}),m.forEach(function(a){var b=Math.min.apply(null,j.map(function(b){return b[a]}));j=j.filter(function(c){return c[a]===b})}),j[0].url},b.scrollParent=function(b,d,e){b=c.jq(b)?b:a(b),d=c.string(d)&&/^(x|y|xy|yx)$/i.test(d)?d:"xy";var f=a(!!b.length&&b[0].ownerDocument||document);if(e=c.jq(e)?e:f,!b.length)return e;var g=b.css("position"),h="absolute"===g,i=/(auto|scroll)/i,j=/x/i,k=/y/i,l=b.parentsUntil(e).filter(function(b,c){var e=a(this);if(h&&"static"===e.css("position"))return!1;var f=k.test(d)&&c.scrollHeight>c.clientHeight&&i.test(e.css("overflow-y")),g=j.test(d)&&c.scrollWidth>c.clientWidth&&i.test(e.css("overflow-x"));return f||g}).eq(0);return l.is("html")&&(l=f),"fixed"!==g&&l.length?l:e}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c){function d(a){return setTimeout(a,1e3/60)}function e(a){clearTimeout(a)}if("0.2.2"===b.version){b.animation={},b.animation.requestFrame=(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||d).bind(window),b.animation.cancelFrame=(window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||e).bind(window);var f=document.createElement("div");b.animation.supported=function(a){var b=a.style;return c.string(b.animation)||c.string(b.WebkitAnimation)||c.string(b.MozAnimation)||c.string(b.msAnimation)||c.string(b.OAnimation)}(f),b.animation.end=function(a){var b=a.style;return c.string(b.animation)?"animationend":c.string(b.WebkitAnimation)?"webkitAnimationEnd":c.string(b.MozAnimation)?"animationend":c.string(b.msAnimation)?"msAnimationEnd":c.string(b.OAnimation)?"oAnimationEnd":null}(f),b.animation.duration=function(a,b){if(b=c.number(b)?b:0,!c.jq(a))return b;var d=a.css("animation-duration");if(/^([\d.]*)+?(ms|s)/i.test(d)){var e=d.split(","),f=0;return e.forEach(function(a){var b=a.match(/^\s*?([\d.]*)+?(ms|s)\s*?$/i),c=parseFloat(b[1]);"s"===b[2].toLowerCase()&&(c*=1e3),c>f&&(f=c)}),f}return b},b.animation.iterations=function(a,b){if(b=c.number(b)?b:1,!c.jq(a))return b;var d=a.css("animation-iteration-count");if(/^(([\d.]+)|infinite)/i.test(d)){var e=d.split(","),f=0;return e.forEach(function(a){var b=parseFloat(a);isNaN(b)&&(b=1/0),b>f&&(f=b)}),f}return b},b.animation.start=function(d,e,f,g){var h=a.Deferred(),i=h.promise();if(d=d.first(),b.animation.supported){d.prop("offsetTop");var j=d.data("animation_safety");if(c.hash(j)&&c.number(j.timer)&&(clearTimeout(j.timer),d.removeData("animation_safety").off(b.animation.end+".utils"),j.deferred.reject()),!c.number(g)){var k=b.animation.iterations(d);if(k===1/0)return h.reject("No timeout supplied with an infinite animation."),i;g=b.animation.duration(d)*k+50}j={deferred:h,timer:setTimeout(function(){d.removeData("animation_safety").off(b.animation.end+".utils"),h.resolve()},g)},d.data("animation_safety",j),d.on(b.animation.end+".utils",function(a){d.is(a.target)&&(clearTimeout(j.timer),d.removeData("animation_safety").off(b.animation.end+".utils"),h.resolve())})}return b.animation.requestFrame(function(){c.fn(e)?e.apply(d.get(0),[d]):d.toggleClass(e,f),b.animation.supported||h.resolve()}),i}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){if("0.2.2"===b.version){b.transition={};var e=document.createElement("div");b.transition.supported=function(a){var b=a.style;return c.string(b.transition)||c.string(b.WebkitTransition)||c.string(b.MozTransition)||c.string(b.msTransition)||c.string(b.OTransition)}(e),b.transition.end=function(a){var b=a.style;return c.string(b.transition)?"transitionend":c.string(b.WebkitTransition)?"webkitTransitionEnd":c.string(b.MozTransition)?"transitionend":c.string(b.msTransition)?"msTransitionEnd":c.string(b.OTransition)?"oTransitionEnd":null}(e),b.transition.duration=function(a,b){if(b=c.number(b)?b:0,!c.jq(a))return b;var d=a.css("transition-duration");if(/^([\d.]*)+?(ms|s)/i.test(d)){var e=d.split(","),f=0;return e.forEach(function(a){var b=a.match(/^\s*?([\d.]*)+?(ms|s)\s*?$/i),c=parseFloat(b[1]);"s"===b[2].toLowerCase()&&(c*=1e3),c>f&&(f=c)}),f}return b},b.transition.start=function(e,f,g,h){var i=a.Deferred(),j=i.promise();if(e=e.first(),b.transition.supported){e.prop("offsetTop");var k=e.data("transition_safety");c.hash(k)&&c.number(k.timer)&&(clearTimeout(k.timer),e.removeData("transition_safety").off(b.transition.end+".utils"),k.deferred.reject()),h=c.number(h)?h:b.transition.duration(e)+50,k={deferred:i,timer:setTimeout(function(){e.removeData("transition_safety").off(b.transition.end+".utils"),i.resolve()},h)},e.data("transition_safety",k),e.on(b.transition.end+".utils",function(a){e.is(a.target)&&(clearTimeout(k.timer),e.removeData("transition_safety").off(b.transition.end+".utils"),i.resolve())})}return d.requestFrame(function(){c.fn(f)?f.apply(e.get(0),[e]):e.toggleClass(f,g),b.transition.supported||i.resolve()}),j}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.animation),function(a,b,c,d,e){"0.2.2"===b.version&&(b.Class=function(){},b.Class.extend=function(a){function f(){if(!c.fn(this.construct))throw new SyntaxError('FooGallery.utils.Class objects must be constructed with the "new" keyword.');this.construct.apply(this,arguments)}a=c.hash(a)?a:{};var g=d.create(this.prototype);for(var h in a)a.hasOwnProperty(h)&&e.addOrOverride(g,h,a[h]);return g.construct=c.fn(g.construct)?g.construct:function(){},f.prototype=g,f.prototype.constructor=c.fn(g.__ctor__)?g.__ctor__:f,f.extend=b.Class.extend,f.override=b.Class.override,f.bases=b.Class.bases,f.__base__=this,f},
10
+ b.Class.override=function(a,b){e.addOrOverride(this.prototype,a,b)},b.Class.__base__=null,b.Class.bases=function(){function a(b,d){return c.array(d)||(d=[]),c.fn(b)&&null!==b.__base__?(d.unshift(b.__base__),a(b.__base__,d)):d}return a(this,[])})}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj,FooGallery.utils.fn),function(a,b,c){"0.2.2"===a.version&&(a.Event=a.Class.extend({construct:function(c){if(b.empty(c))throw new SyntaxError("FooGallery.utils.Event objects must be supplied a `type`.");var d=this,e=a.Event.parse(c);d.type=e.type,d.namespace=e.namespace,d.defaultPrevented=!1,d.target=null},preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return this.defaultPrevented}}),a.Event.parse=function(a){a=b.string(a)&&!b.empty(a)?a:null;var d=c.contains(a,".");return{namespaced:d,type:d?c.startsWith(a,".")?null:c.until(a,"."):a,namespace:d?c.from(a,"."):null}},a.EventClass=a.Class.extend({construct:function(){this.events={}},destroy:function(){this.events={}},on:function(a,c,d){var e=this;return b.object(a)?(d=c,Object.keys(a).forEach(function(c){b.fn(a[c])&&c.split(" ").forEach(function(b){e.addListener(b,a[c],d)})})):b.string(a)&&b.fn(c)&&a.split(" ").forEach(function(a){e.addListener(a,c,d)}),e},addListener:function(c,d,e){if(!b.string(c)||/\s/.test(c)||!b.fn(d))return!1;var f=this,g=a.Event.parse(c);return e=b.undef(e)?f:e,b.array(f.events[g.type])||(f.events[g.type]=[]),!f.events[g.type].some(function(a){return a.namespace===g.namespace&&a.fn===d&&a.thisArg===e})&&(f.events[g.type].push({namespace:g.namespace,fn:d,thisArg:e}),!0)},off:function(a,c,d){var e=this;return b.object(a)?(d=c,Object.keys(a).forEach(function(b){b.split(" ").forEach(function(c){e.removeListener(c,a[b],d)})})):b.string(a)&&a.split(" ").forEach(function(a){e.removeListener(a,c,d)}),e},removeListener:function(c,d,e){if(!b.string(c)||/\s/.test(c))return!1;var f=this,g=a.Event.parse(c),h=[];return e=b.undef(e)?f:e,b.empty(g.type)?b.empty(g.namespace)||h.push.apply(h,Object.keys(f.events)):h.push(g.type),h.forEach(function(a){b.array(f.events[a])&&(f.events[a]=f.events[a].filter(function(a){return null!=d?!(a.namespace===g.namespace&&a.fn===d&&a.thisArg===e):null!=g.namespace&&a.namespace!==g.namespace}),0===f.events[a].length&&delete f.events[a])}),!0},trigger:function(c,d){d=b.array(d)?d:[];var e=this,f=[];return c instanceof a.Event?(f.push(c),e.emit(c,d)):b.string(c)&&c.split(" ").forEach(function(b){var c=new a.Event(b);f.push(c),e.emit(c,d)}),b.empty(f)?null:1===f.length?f[0]:f},emit:function(a,c){if(a instanceof FooGallery.utils.Event){var d=this;c=b.array(c)?c:[],null===a.target&&(a.target=d),b.array(d.events[a.type])&&d.events[a.type].forEach(function(b){null!=a.namespace&&b.namespace!==a.namespace||b.fn.apply(b.thisArg,[a].concat(c))}),b.array(d.events.__all__)&&d.events.__all__.forEach(function(b){b.fn.apply(b.thisArg,[a].concat(c))})}}}))}(FooGallery.utils,FooGallery.utils.is,FooGallery.utils.str),function(a,b,c){if("0.2.2"===b.version){b.Bounds=b.Class.extend({construct:function(){var a=this;a.top=0,a.right=0,a.bottom=0,a.left=0,a.width=0,a.height=0},inflate:function(a){var b=this;return c.number(a)&&(b.top-=a,b.right+=a,b.bottom+=a,b.left-=a,b.width+=2*a,b.height+=2*a),b},intersects:function(a){var b=this;return b.left<=a.right&&a.left<=b.right&&b.top<=a.bottom&&a.top<=b.bottom}});var d;b.getViewportBounds=function(c){d||(d=a(window));var e=new b.Bounds;return e.top=d.scrollTop(),e.left=d.scrollLeft(),e.width=d.width(),e.height=d.height(),e.right=e.left+e.width,e.bottom=e.top+e.height,e.inflate(c),e},b.getElementBounds=function(d){c.jq(d)||(d=a(d));var e=new b.Bounds;if(0!==d.length){var f=d.offset();e.top=f.top,e.left=f.left,e.width=d.width(),e.height=d.height()}return e.right=e.left+e.width,e.bottom=e.top+e.height,e}}}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d,e){"0.2.2"===b.version&&(b.Timer=b.EventClass.extend({construct:function(a){this._super(),this.interval=c.number(a)?a:1e3,this.isRunning=!1,this.isPaused=!1,this.canResume=!1,this.canRestart=!1,this.__timeout=null,this.__decrement=!1,this.__time=0,this.__remaining=0,this.__current=0,this.__finish=0,this.__restart=[]},__reset:function(){clearTimeout(this.__timeout),this.__timeout=null,this.__decrement=!1,this.__time=0,this.__remaining=0,this.__current=0,this.__finish=0,this.isRunning=!1,this.isPaused=!1,this.canResume=!1},__eventArgs:function(a){return[this.__current,this.__time,this.__decrement].concat(d.arg2arr(arguments))},__tick:function(){var a=this;a.trigger("tick",a.__eventArgs()),a.__current===a.__finish?(a.trigger("complete",a.__eventArgs()),a.__reset()):(a.__decrement?a.__current--:a.__current++,a.__remaining--,a.canResume=a.__remaining>0,a.__timeout=setTimeout(function(){a.__tick()},a.interval))},start:function(a,b){var d=this;d.isRunning||(b=!!c.boolean(b)&&b,d.__restart=[a,b],d.__decrement=b,d.__time=a,d.__remaining=a,d.__current=b?a:0,d.__finish=b?0:a,d.canRestart=!0,d.isRunning=!0,d.isPaused=!1,d.trigger("start",d.__eventArgs()),d.__tick())},countdown:function(a){this.start(a,!0)},countup:function(a){this.start(a,!1)},restart:function(){this.stop(),this.canRestart&&this.start.apply(this,this.__restart)},stop:function(){(this.isRunning||this.isPaused)&&(this.__reset(),this.trigger("stop",this.__eventArgs()))},pause:function(){var a=this;return null!=a.__timeout&&(clearTimeout(a.__timeout),a.__timeout=null),a.isRunning&&(a.isRunning=!1,a.isPaused=!0,a.trigger("pause",a.__eventArgs())),a.__remaining},resume:function(){var a=this;a.canResume&&(a.isRunning=!0,a.isPaused=!1,a.trigger("resume",a.__eventArgs()),a.__tick())},reset:function(){this.__reset(),this.trigger("reset",this.__eventArgs())}}))}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d){"0.2.2"===b.version&&(b.Factory=b.Class.extend({construct:function(){this.registered={}},contains:function(a){return!c.undef(this.registered[a])},load:function(b,e,f){var g,h,i=this,j=d.arg2arr(arguments),k=[],l=[];b=j.shift()||{};for(g in i.registered)if(i.registered.hasOwnProperty(g)){var m=i.registered[g];b.hasOwnProperty(g)&&(h=b[g],c.string(h)&&(h=d.fetch(b[g])),c.fn(h)&&(m={name:g,klass:h,priority:i.registered[g].priority})),k.push(m)}for(g in b)b.hasOwnProperty(g)&&!i.registered.hasOwnProperty(g)&&(h=b[g],c.string(h)&&(h=d.fetch(b[g])),c.fn(h)&&k.push({name:g,klass:h,priority:0}));return k.sort(function(a,b){return b.priority-a.priority}),a.each(k,function(a,b){c.fn(b.klass)&&l.push(d.apply(b.klass,j))}),l},make:function(a,b,e){var f,g=this,h=d.arg2arr(arguments);return a=h.shift(),f=g.registered[a],c.hash(f)&&c.fn(f.klass)?d.apply(f.klass,h):null},names:function(b){b=!!c.boolean(b)&&b;var d,e=[];if(b){var f=[];for(d in this.registered)this.registered.hasOwnProperty(d)&&f.push(this.registered[d]);f.sort(function(a,b){return b.priority-a.priority}),a.each(f,function(a,b){e.push(b.name)})}else for(d in this.registered)this.registered.hasOwnProperty(d)&&e.push(d);return e},register:function(a,b,d){if(!c.string(a)||c.empty(a)||!c.fn(b))return!1;d=c.number(d)?d:0;var e=this.registered[a];return this.registered[a]={name:a,klass:b,priority:c.undef(e)?d:e.priority},!0}}))}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c){"0.2.2"===b.version&&(b.FullscreenAPI=b.EventClass.extend({construct:function(){this._super(),this.apis={w3:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",events:{change:"fullscreenchange",error:"fullscreenerror"}},webkit:{enabled:"webkitFullscreenEnabled",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",events:{change:"webkitfullscreenchange",error:"webkitfullscreenerror"}},moz:{enabled:"mozFullScreenEnabled",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",events:{change:"mozfullscreenchange",error:"mozfullscreenerror"}},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",events:{change:"MSFullscreenChange",error:"MSFullscreenError"}}},this.api=this.getAPI(),this.supported=null!=this.api,this.__listen()},destroy:function(){return this.__stopListening(),this._super()},getAPI:function(){for(var a in this.apis)if(this.apis.hasOwnProperty(a)&&this.apis[a].enabled in document)return this.apis[a];return null},element:function(){return this.supported?document[this.api.element]:null},request:function(b){if(this.supported&&b[this.api.request]){var d=b[this.api.request]();return d||a.Deferred(this.__resolver(this.api.request)).promise()}return c.rejected},exit:function(){if(this.supported&&this.element()){var b=document[this.api.exit]();return b||a.Deferred(this.__resolver(this.api.exit)).promise()}return c.rejected},toggle:function(a){return this.element()?this.exit():this.request(a)},__listen:function(){var b=this;b.supported&&a(document).on(b.api.events.change+".utils",function(){b.trigger("change")}).on(b.api.events.error+".utils",function(){b.trigger("error")})},__stopListening:function(){var b=this;b.supported&&a(document).off(b.api.events.change+".utils").off(b.api.events.error+".utils")},__resolver:function(b){var c=this;return function(d){function e(){d.resolve(),a(document).off(c.api.events.change,e).off(c.api.events.error,f)}function f(){d.reject(new TypeError),a(document).off(c.api.events.change,e).off(c.api.events.error,f)}if(b===c.api.exit&&c.element())return void setTimeout(function(){d.reject(new TypeError)},1);a(document).on(c.api.events.change,e).on(c.api.events.error,f)}}}))}(FooGallery.utils.$,FooGallery.utils,FooGallery.utils.fn),function(a,b,c,d,e){b.EMPTY_IMAGE="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",b.DATA_TEMPLATE="__FooGallery__",b.DATA_ITEM="__FooGalleryItem__",b.get=function(c){return a(c).data(b.DATA_TEMPLATE)},b.init=function(c,f){if(f=d.jq(f)?f:a(f),f.length>0){var g=f.data(b.DATA_TEMPLATE);if(g instanceof b.Template)return g.destroy(!0).then(function(){var a=b.template.make(c,f);return a instanceof b.Template?a.initialize():e.rejected})}var h=b.template.make(c,f);return h instanceof b.Template?h.initialize():e.rejected},b.initAll=function(c){return e.when(a(".foogallery").map(function(a,d){return b.init(c,d)}).get())},a.fn.foogallery=function(c,e){return e=d.fn(e)?e:a.noop,this.each(function(f,g){if(d.string(c)){var h=a.data(g,b.DATA_TEMPLATE);if(h instanceof b.Template)switch(c){case"layout":return void h.layout();case"destroy":return void h.destroy()}}else b.init(c,g).then(e)})},b.isCached=function(a){var b=new Image;b.src=a;var c=b.complete;return b.src="",b=null,c},b.supportedExifProperties=["camera","aperture","created_timestamp","shutter_speed","focal_length","iso","orientation"],d.exif=function(a){if(d.object(a)){var c=Object.keys(a);return c.length>0&&c.some(function(c){return-1!==b.supportedExifProperties.indexOf(c)&&!d.empty(a[c])})}return!1}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c,d,e){var f="__FooGallerySwipe__",g="ontouchstart"in window,h=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!g,i=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!g,j=g||i;b.Swipe=c.Class.extend({construct:function(b,c){var d=this,f=".fgswipe";d.$el=a(b),d.opt=e.extend({threshold:20,allowPageScroll:!1,swipe:a.noop,data:{}},c),d.active=!1,d.startPoint=null,d.endPoint=null,d.events={start:(j?i?h?"MSPointerDown":"pointerdown":"touchstart":"mousedown")+f,move:(j?i?h?"MSPointerMove":"pointermove":"touchmove":"mousemove")+f,end:(j?i?h?"MSPointerUp":"pointerup":"touchend":"mouseup")+f,leave:(j?i?"mouseleave":null:"mouseleave")+f}},init:function(){var a=this;a.$el.on(a.events.start,{self:a},a.onStart),a.$el.on(a.events.move,{self:a},a.onMove),a.$el.on(a.events.end,{self:a},a.onEnd),d.string(a.events.leave)&&a.$el.on(a.events.leave,{self:a},a.onEnd),a.$el.data(f,a)},destroy:function(){var a=this;a.$el.off(a.events.start,a.onStart),a.$el.off(a.events.move,a.onMove),a.$el.off(a.events.end,a.onEnd),d.string(a.events.leave)&&a.$el.off(a.events.leave,a.onEnd),a.$el.removeData(f)},getAngle:function(a,b){var c=Math.atan2(a.x-b.x,a.y-b.y),d=Math.round(180*c/Math.PI);return 360-(d<0?360-Math.abs(d):d)},getDistance:function(a,b){var c=b.x-a.x,d=b.y-a.y;return c*=c,d*=d,Math.sqrt(c+d)},getDirection:function(a,b){var c=this,d=c.getAngle(a,b);return d>337.5||d<=22.5?"N":d>22.5&&d<=67.5?"NE":d>67.5&&d<=112.5?"E":d>112.5&&d<=157.5?"SE":d>157.5&&d<=202.5?"S":d>202.5&&d<=247.5?"SW":d>247.5&&d<=292.5?"W":d>292.5&&d<=337.5?"NW":"NONE"},getPoint:function(a){var b;return j&&!d.empty(b=a.originalEvent.touches||a.touches)?{x:b[0].pageX,y:b[0].pageY}:d.number(a.pageX)&&d.number(a.pageY)?{x:a.pageX,y:a.pageY}:null},getOffset:function(a){var b=this,c=b.$el.offset();return{left:a.x-c.left,top:a.y-c.top}},onStart:function(a){var b=a.data.self,c=b.getPoint(a);d.empty(c)||(b.active=!0,b.startPoint=b.endPoint=c)},onMove:function(a){var b=a.data.self,e=b.getPoint(a);if(b.active&&!d.empty(e))if(b.endPoint=e,b.opt.allowPageScroll){if(d.hash(b.opt.allowPageScroll)){var f=b.getDirection(b.startPoint,b.endPoint);b.opt.allowPageScroll.x||-1===c.inArray(f,["NE","E","SE","NW","W","SW"])||a.preventDefault(),b.opt.allowPageScroll.y||-1===c.inArray(f,["NW","N","NE","SW","S","SE"])||a.preventDefault()}}else a.preventDefault()},onEnd:function(a){var b=a.data.self;if(b.active){b.active=!1;var c={startPoint:b.startPoint,endPoint:b.endPoint,startOffset:b.getOffset(b.startPoint),endOffset:b.getOffset(b.endPoint),angle:b.getAngle(b.startPoint,b.endPoint),distance:b.getDistance(b.startPoint,b.endPoint),direction:b.getDirection(b.startPoint,b.endPoint)};if(b.opt.threshold>0&&c.distance<b.opt.threshold)return;b.opt.swipe.apply(this,[c,b.opt.data]),b.startPoint=null,b.endPoint=null}}}),a.fn.fgswipe=function(c){return this.each(function(){var e=a(this),g=e.data(f);if(g instanceof b.Swipe){if(d.string(c)&&d.fn(g[c]))return void g[c]();g.destroy()}d.hash(c)&&(g=new b.Swipe(this,c),g.init())})}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj),function(a,b,c,d,e,f){b.TemplateFactory=c.Factory.extend({construct:function(){this.registered={}},register:function(a,b,c,e,f,g){var h=this,i=h._super(a,b,g);if(i){var j=h.registered;j[a].opt=d.hash(c)?c:{},j[a].cls=d.hash(e)?e:{},j[a].il8n=d.hash(f)?f:{}}return i},make:function(b,c){c=d.jq(c)?c:a(c),b=f.extend({},b,c.data("foogallery"));var e=this,g=e.type(b,c);return e.contains(g)?(b=e.options(g,b),e._super(g,b,c)):null},type:function(b,e){e=d.jq(e)?e:a(e);var f=this,g=d.hash(b)&&d.hash(b)&&d.string(b.type)&&f.contains(b.type)?b.type:null;if(null===g&&e.length>0)for(var h=f.registered,i=f.names(!0),j=0,k=i.length;j<k;j++)if(h.hasOwnProperty(i[j])&&"core"!==i[j]){var l=i[j],m=h[l].cls;if(d.string(m.container)){var n=c.selectify(m.container);if(e.is(n)){g=i[j];break}}}return g},configure:function(a,b,c,d){var e=this;if(e.contains(a)){var g=e.registered;f.extend(g[a].opt,b),f.extend(g[a].cls,c),f.extend(g[a].il8n,d)}},options:function(a,c){c=f.extend({type:a},c);var e=this,g=e.registered,h=g.core.opt,i=g.core.cls,j=g.core.il8n;return d.hash(c.cls)||(c.cls={}),d.hash(c.il8n)||(c.il8n={}),d.undef(b.filtering)||(c=b.filtering.merge(c)),d.undef(b.paging)||(c=b.paging.merge(c)),"core"!==a&&e.contains(a)?(c=f.extend({},h,g[a].opt,c),c.cls=f.extend({},i,g[a].cls,c.cls),c.il8n=f.extend({},j,g[a].il8n,c.il8n)):(c=f.extend({},h,c),c.cls=f.extend({},i,c.cls),c.il8n=f.extend({},j,c.il8n)),c}}),b.template=new b.TemplateFactory}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e){a.PagingFactory=b.Factory.extend({construct:function(){this.registered={}},register:function(a,b,d,e,f,g,h){var i=this,j=i._super(a,b,h);if(j){var k=i.registered;k[a].ctrl=c.fn(d)?d:null,k[a].opt=c.hash(e)?e:{},k[a].cls=c.hash(f)?f:{},k[a].il8n=c.hash(g)?g:{}}return j},type:function(a){var b,d=this;return c.hash(a)&&c.hash(b=a.paging)&&c.string(b.type)&&d.contains(b.type)?b.type:null},merge:function(a){a=e.extend({},a);var b=this,d=b.type(a),f=b.registered,g=f.default.opt,h=f.default.cls,i=f.default.il8n,j=c.hash(a.paging)?a.paging:{},k=c.hash(a.cls)&&c.hash(a.cls.paging)?e.extend({},a.cls.paging):{},l=c.hash(a.il8n)&&c.hash(a.il8n.paging)?e.extend({},a.il8n.paging):{};return c.hash(a.cls)||(a.cls={}),c.hash(a.il8n)||(a.il8n={}),"default"!==d&&b.contains(d)?(a.paging=e.extend({},g,f[d].opt,j,{type:d}),a.cls=e.extend(a.cls,{paging:h},{paging:f[d].cls},{paging:k}),a.il8n=e.extend(a.il8n,{paging:i},{paging:f[d].il8n},{paging:l})):(a.paging=e.extend({},g,j,{type:d}),a.cls=e.extend(a.cls,{paging:h},{paging:k}),a.il8n=e.extend(a.il8n,{paging:i},{paging:l})),a},configure:function(a,b,c,d){var f=this;if(f.contains(a)){var g=f.registered;e.extend(g[a].opt,b),e.extend(g[a].cls,c),e.extend(g[a].il8n,d)}},hasCtrl:function(a){var b=this,d=b.registered[a];return c.hash(d)&&c.fn(d.ctrl)},makeCtrl:function(a,b,d,e){var f=this,g=f.registered[a];return c.hash(g)&&c.fn(g.ctrl)?new g.ctrl(b,d,e):null}}),a.paging=new a.PagingFactory}(FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e,f){var g=0;b.Template=c.EventClass.extend({construct:function(e,f){var h=this;h._super(),h.namespace=".foogallery-"+ ++g,h.$el=d.jq(f)?f:a(f),h.$scrollParent=null,h.opt=e,h.template=e.template,h.id=h.$el.prop("id")||e.id,h.cls=e.cls,h.il8n=e.il8n,h.sel=c.selectify(h.cls),h.items=b.components.make("items",h),h.pages=d.undef(b.paging)?null:b.paging.make(e.paging.type,h),h.filter=d.undef(b.filtering)?null:b.filtering.make(e.filtering.type,h),h.state=b.components.make("state",h),h._initialize=null,h._checkTimeout=null,h._layoutTimeout=null,h._layoutWidths=[],h.initializing=!1,h.initialized=!1,h.destroying=!1,h.destroyed=!1,h._undo={classes:"",style:"",create:!1,children:!1},h.robserver=new ResizeObserver(function(){h.$el.is(":visible")&&h.layout()})},initialize:function(b){var c=this;return d.promise(c._initialize)?c._initialize:c._initialize=a.Deferred(function(a){c.preInit(b)?c.init().then(function(){c.postInit()?c.firstLoad().then(function(){c.ready(),a.resolve(c)}).fail(a.reject):a.reject("post-init failed")}).fail(a.reject):a.reject("pre-init failed")}).fail(function(a){console.log("initialize failed",c,a),c.destroy()}).promise()},preInit:function(e){var f=this;if(f.destroying)return!1;if(e=d.jq(e)?e:a(e),f.initializing=!0,0===e.length&&0===f.$el.parent().length)return!1;0===f.$el.length&&(f.$el=f.create(),f._undo.create=!0),e.length>0&&f.$el.appendTo(e);var g;d.empty(f.opt.scrollParent)||0===(g=a(f.opt.scrollParent)).length?f.$scrollParent=a(document):f.$scrollParent=g.is("html")?a(document):g,f.$el.data(b.DATA_TEMPLATE,f),d.empty(f.opt.on)||f.$el.on(f.opt.on),f._undo.classes=f.$el.attr("class"),f._undo.style=f.$el.attr("style"),f.$el.is(f.sel.container)||f.$el.addClass(f.cls.container);var h=c.selectify(f.opt.classes);return null==h||f.$el.is(h)||f.$el.addClass(f.opt.classes),f.robserver.observe(f.$el.get(0)),0===f.$el.children().not(f.sel.item.elem).length&&(f.$el.append(f.createChildren()),f._undo.children=!0),!f.raise("pre-init").isDefaultPrevented()},init:function(){var a=this;return a.raise("init").isDefaultPrevented()?e.rejectWith("init default prevented"):a.items.fetch()},postInit:function(){var b=this;return!b.destroying&&(!b.raise("post-init").isDefaultPrevented()&&(b.state.init(),b.$scrollParent.on("scroll"+b.namespace,{self:b},e.throttle(function(){b.loadAvailable()},50)),a(window).on("popstate"+b.namespace,{self:b},b.onWindowPopState),!0))},firstLoad:function(){var a=this;return a.destroying?e.rejected:(a.raise("first-load"),a.loadAvailable())},ready:function(){var a=this;return!a.destroying&&(a.initializing=!1,a.initialized=!0,a._check(1e3),a.raise("ready"),!0)},create:function(){var b=this;return a("<div/>",{id:b.id,class:b.cls.container}).addClass(b.opt.classes)},createChildren:function(){return a()},destroy:function(b){var c=this,f=c._super.bind(c);return c.destroyed?e.resolved:(c.destroying=!0,a.Deferred(function(a){c.initializing&&d.promise(c._initialize)?c._initialize.always(function(){c.destroying=!1,c.doDestroy(b),a.resolve()}):(c.destroying=!1,c.doDestroy(b),a.resolve())}).then(function(){f()}).promise())},doDestroy:function(c){var e=this;e.destroyed||(e.raise("destroy"),e.robserver.disconnect(),e._checkTimeout&&clearTimeout(e._checkTimeout),e.$scrollParent.off(e.namespace),a(window).off(e.namespace),e.state.destroy(c),e.filter&&e.filter.destroy(),e.pages&&e.pages.destroy(),e.items.destroy(),d.empty(e.opt.on)||e.$el.off(e.opt.on),e.raise("destroyed"),e.$el.removeData(b.DATA_TEMPLATE),d.empty(e._undo.classes)?e.$el.removeAttr("class"):e.$el.attr("class",e._undo.classes),d.empty(e._undo.style)?e.$el.removeAttr("style"):e.$el.attr("style",e._undo.style),e._undo.children&&e.destroyChildren(),e._undo.create&&e.$el.remove(),e.$el=e.state=e.items=e.pages=null,e.destroyed=!0,e.initializing=!1,e.initialized=!1)},destroyChildren:function(){},getAvailable:function(){return this.pages?this.pages.available():this.items.available()},loadAvailable:function(){return this.items.load(this.getAvailable())},getItems:function(){return this.pages?this.pages.items():this.items.available()},_check:function(a){a=d.number(a)?a:0;var b=this;return b._checkTimeout&&clearTimeout(b._checkTimeout),b._checkTimeout=setTimeout(function(){b._checkTimeout=null,!b.initialized||b.destroying&&b.destroyed||b.loadAvailable()},a)},raise:function(b,c){if(this.destroying||this.destroyed||!d.string(b)||d.empty(b))return null;c=d.array(c)?c:[];var e=this,g=b.split(".")[0],h=f.camel("on-"+g),i=a.Event(g+".foogallery");return c.unshift(e),e.trigger(g,c).defaultPrevented&&i.preventDefault(),e.$el.trigger(i,c),d.fn(e[h])&&(c.unshift(i),e[h].apply(e.$el.get(0),c)),i},layout:function(){var a=this,b=a.getContainerWidth();null===a._initialize||a._checkWidth(b)||a.raise("layout",[b])},_checkWidth:function(a){var b,c=this;return(b=-1!==c._layoutWidths.indexOf(a))||(c._layoutWidths.unshift(a),c._layoutWidths.splice(2,c._layoutWidths.length-2),null!=c._layoutTimeout&&clearTimeout(c._layoutTimeout),c._layoutTimeout=setTimeout(function(){c._layoutWidths.splice(0,c._layoutWidths.length)},100)),b},getContainerWidth:function(){var a=this;return a.$el.is(":visible")?a.$el.width():a.$el.parents(":visible:first").innerWidth()},getCSSClass:function(a,b){b=d.empty(b)?"":b;var c=a instanceof RegExp?a:d.string(a)&&this.opt.regex.hasOwnProperty(a)?this.opt.regex[a]:null,e=this.$el.prop("className")||"",f=null!=c?e.match(c):null;return null!=f&&f.length>=2?f[1]:b},onWindowPopState:function(a){var b=a.data.self,c=a.originalEvent.state;d.empty(c)||c.id!==b.id||(b.state.set(c),b.loadAvailable())}}),b.template.register("core",b.Template,{id:null,type:"core",classes:"",on:{},lazy:!0,viewport:200,items:[],fixLayout:!0,scrollParent:null,delay:0,throttle:50,timeout:6e4,srcset:"data-srcset-fg",src:"data-src-fg",template:{},regex:{theme:/(?:\s|^)(fg-(?:light|dark|custom))(?:\s|$)/,loadingIcon:/(?:\s|^)(fg-loading-(?:default|bars|dots|partial|pulse|trail))(?:\s|$)/,hoverIcon:/(?:\s|^)(fg-hover-(?:zoom|zoom2|zoom3|plus|circle-plus|eye|external|tint))(?:\s|$)/,videoIcon:/(?:\s|^)(fg-video-(?:default|1|2|3|4))(?:\s|$)/,hoverColor:/(?:\s|^)(fg-hover-(?:colorize|grayscale))(?:\s|$)/,hoverScale:/(?:\s|^)(fg-hover-scale)(?:\s|$)/,stickyVideoIcon:/(?:\s|^)(fg-video-sticky)(?:\s|$)/,insetShadow:/(?:\s|^)(fg-shadow-inset-(?:small|medium|large))(?:\s|$)/,filter:/(?:\s|^)(fg-filter-(?:1977|amaro|brannan|clarendon|earlybird|lofi|poprocket|reyes|toaster|walden|xpro2|xtreme))(?:\s|$)/}},{container:"foogallery"},{},-100)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.str),function(a,b,c){a.Component=b.Class.extend({construct:function(a){this.tmpl=a},destroy:function(){this.tmpl=null}}),a.EventComponent=b.EventClass.extend({construct:function(a,b){this._super(a),this.tmpl=a,this.tmplEventPrefix=b},destroy:function(){this._super(),this.tmpl=null},trigger:function(a,d){var e,f,g=this,h=g._super(a,d);return null!=g.tmpl&&(h instanceof b.Event&&!h.isDefaultPrevented()?(e=null!=h.namespace?[h.type,h.namespace].join("."):h.type,(f=g.tmpl.raise(g.tmplEventPrefix+e,d))&&f.isDefaultPrevented()&&h.preventDefault()):c.array(h)&&h.forEach(function(a){a.isDefaultPrevented()||(e=null!=a.namespace?[a.type,a.namespace].join("."):a.type,(f=g.tmpl.raise(g.tmplEventPrefix+e,d))&&f.isDefaultPrevented()&&a.preventDefault())})),c.empty(h)?null:1===h.length?h[0]:h}}),a.components=new b.Factory}(FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d,e,f){b.State=b.Component.extend({construct:function(a){var b=this;b._super(a),b.apiEnabled=!!window.history&&!!history.replaceState,b.opt=b.tmpl.opt.state,b.enabled=b.opt.enabled,b.current={filter:[],page:0,item:null},b.pushOrReplace=b.isPushOrReplace(b.opt.pushOrReplace)?b.opt.pushOrReplace:"replace",b.defaultMask="foogallery-gallery-{id}";var c=e.escapeRegExp(b.tmpl.id),d=e.escapeRegExp(b.getMasked()),f=e.escapeRegExp(b.opt.values),g=e.escapeRegExp(b.opt.pair);b.regex={exists:new RegExp("^#"+c+"\\"+f+".+?"),masked:new RegExp("^#"+d+"\\"+f+".+?"),values:new RegExp("(\\w+)"+g+"([^"+f+"]+)","g")}},destroy:function(a){var b=this;a||b.clear(),b.opt=b.regex={},b._super()},init:function(){this.set(this.initial())},getIdNumber:function(){return this.tmpl.id.match(/\d+/g)[0]},getMasked:function(){var a=this,b=e.contains(a.opt.mask,"{id}")?a.opt.mask:a.defaultMask;return e.format(b,{id:a.getIdNumber()})},isPushOrReplace:function(a){return-1!==c.inArray(a,["push","replace"])},exists:function(){return this.regex.values.lastIndex=0,(this.regex.exists.test(location.hash)||this.regex.masked.test(location.hash))&&this.regex.values.test(location.hash)},parse:function(){var b=this,c=b.tmpl,d={};if(b.exists())if(b.enabled){d.id=b.tmpl.id,b.regex.values.lastIndex=0;var e=location.hash.match(b.regex.values);a.each(e,function(a,e){var f,g=e.split(b.opt.pair);if(2===g.length)switch(g[0]){case b.opt.itemKey:f=c.items.fromHash(g[1]),null!==f&&(d.item=f);break;case b.opt.pageKey:c.pages&&null!==(f=c.pages.fromHash(g[1]))&&(d.page=f);break;case b.opt.filterKey:c.filter&&null!==(f=c.filter.fromHash(g[1]))&&(d.filter=f)}})}else b.apiEnabled?history.replaceState(null,"",location.pathname+location.search):location.hash="#";return d},hashify:function(a){var b=this,c=b.tmpl;if(d.hash(a)){var e=[],f=c.items.toHash(a.item);return null!==f&&e.push(b.opt.itemKey+b.opt.pair+f),c.filter&&null!==(f=c.filter.toHash(a.filter))&&e.push(b.opt.filterKey+b.opt.pair+f),c.pages&&null!==(f=c.pages.toHash(a.page))&&e.push(b.opt.pageKey+b.opt.pair+f),e.length>0&&e.unshift("#"+b.getMasked()),e.join(b.opt.values)}return""},replace:function(a){var c=this;if(c.enabled&&c.apiEnabled){a.id=c.tmpl.id;var e=c.hashify(a),g=d.empty(e),h=f.extend({},a,{item:a.item instanceof b.Item?a.item.id:a.item});history.replaceState(g?null:h,"",g?location.pathname+location.search:e)}},push:function(a){var c=this;if(c.enabled&&c.apiEnabled){a.id=c.tmpl.id;var e=c.hashify(a),g=d.empty(e),h=f.extend({},a,{item:a.item instanceof b.Item?a.item.id:a.item});history.pushState(g?null:h,"",g?location.pathname+location.search:e)}},update:function(a,b){var c=this;c.enabled&&c.apiEnabled&&(b=c.isPushOrReplace(b)?b:c.pushOrReplace,c[b](a))},clear:function(){this.exists()&&this.replace({})},initial:function(){var a=this,b=a.parse();return d.empty(b)?a.get():f.extend({filter:[],page:1,item:null},b)},get:function(a){var c,d=this,e=d.tmpl,g={};return a instanceof b.Item&&(g.item=a),e.filter&&null!==(c=e.filter.getState())&&(g.filter=c),e.pages&&null!==(c=e.pages.getState())&&(g.page=c),f.extend({filter:[],page:1,item:null},g)},set:function(a){var b=this,c=b.tmpl;if(d.hash(a)){var e=f.extend({filter:[],page:1,item:null},a);c.items.reset();c.raise("before-state",[e]).isDefaultPrevented()||(c.filter&&c.filter.setState(e),c.pages?c.pages.setState(e):(c.items.detach(c.items.all()),c.items.create(c.items.available(),!0)),e.item&&(b.opt.scrollTo&&e.item.scrollTo(),d.empty(a.item)||(a.item=null,b.replace(a))),b.current=e,c.raise("after-state",[e]))}}}),b.template.configure("core",{state:{enabled:!1,scrollTo:!0,pushOrReplace:"replace",mask:"foogallery-gallery-{id}",values:"/",pair:":",array:"+",arraySeparator:",",itemKey:"i",filterKey:"f",pageKey:"p"}}),b.components.register("state",b.State)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.str,FooGallery.utils.obj),function(a,b,c,d,e,f){b.Items=b.Component.extend({construct:function(a){var b=this;b.ALLOW_CREATE=!0,b.ALLOW_APPEND=!0,b.ALLOW_LOAD=!0,b._super(a),b.maps={},b._fetched=null,b._arr=[],b._available=[];var d=b.tmpl.cls.item.caption;b.tmpl.sel.item.caption.all=c.selectify([d.elem,d.inner,d.title,d.description])},fromHash:function(a){return this.get(a)},toHash:function(a){return a instanceof b.Item?a.id:null},destroy:function(){var b=this,c=b.all(),d=[];c.length>0&&(b.tmpl.raise("destroy-items",[c]),d=a.map(c,function(a){return a.destroy()?a:null}),d.length>0&&b.tmpl.raise("destroyed-items",[d])),b.maps={},b._fetched=null,b._arr=[],b._available=[],b._super()},fetch:function(b){var c=this;if(!b&&d.promise(c._fetched))return c._fetched;var e=c.tmpl,f=e.sel,g=e.opt.items,h=a.Deferred(),i=c.make(e.$el.find(f.item.elem));return d.empty(g)?(i.push.apply(i,c.make(window[e.id+"-items"])),h.resolve(i)):d.array(g)?(i.push.apply(i,c.make(g)),h.resolve(i)):d.string(g)?a.get(g).then(function(a){i.push.apply(i,c.make(a)),h.resolve(i)},function(a,b,c){console.log("FooGallery: GET items error.",g,a,b,c),h.resolve(i)}):h.resolve(i),h.then(function(a){c.setAll(a)}),c._fetched=h.promise()},toJSON:function(a){return(a?this.all():this.available()).map(function(a){return a.toJSON()})},all:function(){return this._arr.slice()},count:function(a){return a?this.all().length:this.available().length},available:function(a){return d.fn(a)?this._available.filter(a,this):this._available.slice()},get:function(a){var b=d.number(a)?"index":"id";return this.maps[b][a]?this.maps[b][a]:null},setAll:function(a){this._arr=d.array(a)?a:[],this.maps=this.createMaps(this._arr),this._available=this.all()},setAvailable:function(a){this.maps=this.createMaps(this._arr),this._available=d.array(a)?a:[]},reset:function(){this.setAvailable(this.all())},find:function(a,b){if(b=d.fn(b)?b:function(){return!0},d.array(a))for(var c=0,e=a.length;c<e;c++)if(!0===b.call(this,a[c]))return a[c];return null},first:function(a){return this.find(this._available,a)},last:function(a){return this.find(this._available.slice().reverse(),a)},next:function(a,c,e){if(!(a instanceof b.Item))return null;e=!!d.boolean(e)&&e;var f=this._available.slice(),g=f.indexOf(a);if(-1!==g){var h=f.slice(0,g);return f=f.slice(g+1),e&&(f=f.concat(h)),this.find(f,c)}return null},prev:function(a,c,e){if(!(a instanceof b.Item))return null;e=!!d.boolean(e)&&e;var f=this._available.slice().reverse(),g=f.indexOf(a);if(-1!==g){var h=f.slice(0,g);return f=f.slice(g+1),e&&(f=f.concat(h)),this.find(f,c)}return null},createMaps:function(b){b=d.array(b)?b:[];var c={id:{},index:{}};return a.each(b,function(a,b){d.empty(b.id)&&(b.id=""+(a+1)),b.index=a,c.id[b.id]=b,c.index[b.index]=b}),c},loadable:function(b){var e,f=this,g=f.tmpl.opt;return g.lazy&&(e=c.getViewportBounds(g.viewport)),f.ALLOW_LOAD&&d.array(b)?a.map(b,function(a){return a.isCreated&&a.isAttached&&!a.isLoading&&!a.isLoaded&&!a.isError&&(!g.lazy||g.lazy&&a.intersects(e))?a:null}):[]},creatable:function(c){return this.ALLOW_CREATE&&d.array(c)?a.map(c,function(a){return a instanceof b.Item&&!a.isCreated?a:null}):[]},appendable:function(c){return this.ALLOW_APPEND&&d.array(c)?a.map(c,function(a){return a instanceof b.Item&&a.isCreated&&!a.isAttached?a:null}):[]},
11
+ detachable:function(c){return d.array(c)?a.map(c,function(a){return a instanceof b.Item&&a.isCreated&&a.isAttached?a:null}):[]},jquerify:function(b){return a(a.map(b,function(a){return a.$el.get()}))},make:function(c){var e=this,g=[];if(d.jq(c)||d.array(c)){var h=[],i=a.makeArray(c);if(0===i.length)return g;e.tmpl.raise("make-items",[i]).isDefaultPrevented()||(g=a.map(i,function(a){var c=e.type(a),g=f.extend(d.hash(a)?a:{},{type:c}),i=b.components.make(c,e.tmpl,g);return d.element(a)?i.parse(a)?(h.push(i),e.ALLOW_APPEND||i.detach(),i):null:i})),g.length>0&&e.tmpl.raise("made-items",[g]),h.length>0&&e.tmpl.raise("parsed-items",[h])}return g},type:function(c){var e;if(d.hash(c))e=c.type;else if(d.element(c)){var f=a(c),g=this.tmpl.sel.item;e=f.find(g.anchor).data("type")}return d.string(e)&&b.components.contains(e)?e:"image"},create:function(b,c){var e=this,f=[],g=e.creatable(b);if(g.length>0){e.tmpl.raise("create-items",[g]).isDefaultPrevented()||(f=a.map(g,function(a){return a.create()?a:null})),f.length>0&&e.tmpl.raise("created-items",[f])}return d.boolean(c)&&c?e.append(b):f},append:function(b){var c=this,d=[],e=c.appendable(b);if(e.length>0){c.tmpl.raise("append-items",[e]).isDefaultPrevented()||(d=a.map(e,function(a){return a.append()?a:null})),d.length>0&&c.tmpl.raise("appended-items",[d])}return d},detach:function(b){var c=this,d=[],e=c.detachable(b);if(e.length>0){c.tmpl.raise("detach-items",[e]).isDefaultPrevented()||(d=a.map(e,function(a){return a.detach()?a:null})),d.length>0&&c.tmpl.raise("detached-items",[d])}return d},load:function(b){var c=this;if(b=c.loadable(b),b.length>0){if(!c.tmpl.raise("load-items",[b]).isDefaultPrevented()){var d=a.map(b,function(a){return a.load()});return e.when(d).done(function(a){c.tmpl.raise("loaded-items",[a])})}}return e.resolveWith([])}}),b.components.register("items",b.Items)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj),function(a,b,c,d,e,f,g){b.Item=b.Component.extend({construct:function(a,b){var c=this;c._super(a),c.cls=a.cls.item,c.il8n=a.il8n.item,c.sel=a.sel.item,c.opt=f.extend({},a.opt.item,b),c.isAttached=!1,c.isCreated=!1,c.isDestroyed=!1,c.isLoading=!1,c.isLoaded=!1,c.isError=!1,c.isParsed=!1,c.$el=null,c.$inner=null,c.$anchor=null,c.$overlay=null,c.$wrap=null,c.$image=null,c.$caption=null,c.fixLayout=c.tmpl.opt.fixLayout,c.index=-1,c.type=c.opt.type,c.id=c.opt.id,c.productId=c.opt.productId,c.href=c.opt.href,c.src=c.opt.src,c.srcset=c.opt.srcset,c.width=c.opt.width,c.height=c.opt.height,c.title=c.opt.title,c.alt=c.opt.alt,c.caption=d.empty(c.opt.caption)?c.title:c.opt.caption,c.description=d.empty(c.opt.description)?c.alt:c.opt.description,c.attr=c.opt.attr,c.tags=c.opt.tags,c.maxWidth=c.opt.maxWidth,c.maxCaptionLength=c.opt.maxCaptionLength,c.maxDescriptionLength=c.opt.maxDescriptionLength,c.showCaptionTitle=c.opt.showCaptionTitle,c.showCaptionDescription=c.opt.showCaptionDescription,c.noLightbox=c.opt.noLightbox,c.panelHide=c.opt.panelHide,c.exif=c.opt.exif,c.hasExif=d.exif(c.exif),c._thumbUrl=null,c._load=null,c._undo={classes:"",style:"",loader:!1,wrap:!1,overlay:!1,placeholder:!1}},destroy:function(){var a=this;return a.tmpl.raise("destroy-item",[a]).isDefaultPrevented()||(a.isDestroyed=a.doDestroyItem()),a.isDestroyed&&(a.tmpl.raise("destroyed-item",[a]),a._super()),a.isDestroyed},doDestroyItem:function(){var a=this;return a.isParsed?(a.$anchor.add(a.$caption).off("click.foogallery"),a.append(),d.empty(a._undo.classes)?a.$el.removeAttr("class"):a.$el.attr("class",a._undo.classes),d.empty(a._undo.style)?a.$el.removeAttr("style"):a.$el.attr("style",a._undo.style),a._undo.overlay&&a.$overlay.remove(),a._undo.wrap&&(a.$anchor.append(a.$image),a.$wrap.remove()),a._undo.loader&&a.$el.find(a.sel.loader).remove(),a._undo.placeholder&&a.$image.prop("src")===b.EMPTY_IMAGE&&a.$image.removeAttr("src")):a.isCreated&&(a.detach(),a.$el.remove()),!0},parse:function(b){var c=this,d=a(b);return!c.tmpl.raise("parse-item",[c,d]).isDefaultPrevented()&&(c.isCreated=d.is(c.sel.elem))&&(c.isParsed=c.doParseItem(d),c.fixLayout&&c.fix()),c.isParsed&&c.tmpl.raise("parsed-item",[c]),c.isParsed},doParseItem:function(c){var e=this,g=e.tmpl.opt,h=e.cls,i=e.sel;if(e._undo.classes=c.attr("class")||"",e._undo.style=c.attr("style")||"",e.$el=c.data(b.DATA_ITEM,e),e.$inner=e.$el.children(i.inner),e.$anchor=e.$inner.children(i.anchor).on("click.foogallery",{self:e},e.onAnchorClick),e.$image=e.$anchor.find(i.image),e.$caption=e.$inner.children(i.caption.elem).on("click.foogallery",{self:e},e.onCaptionClick),!(e.$el.length&&e.$inner.length&&e.$anchor.length&&e.$image.length))return console.error("FooGallery Error: Invalid HTML markup. Check the item markup for additional elements or malformed HTML in the title or description.",e),e.isError=!0,e.tmpl.raise("error-item",[e]),0!==e.$el.length&&e.$el.remove(),!1;e.isAttached=e.$el.parent().length>0,e.isLoading=e.$el.is(i.loading),e.isLoaded=e.$el.is(i.loaded),e.isError=e.$el.is(i.error);var j=e.$anchor.attr("data-type",e.type).data();e.id=j.id||e.id,e.productId=j.productId||e.productId,e.tags=j.tags||e.tags,e.href=j.href||e.$anchor.attr("href")||e.href,e.src=e.$image.attr(g.src)||e.src,e.srcset=e.$image.attr(g.srcset)||e.srcset,e.width=parseInt(e.$image.attr("width"))||e.width,e.height=parseInt(e.$image.attr("height"))||e.height,e.title=e.$image.attr("title")||e.title,e.alt=e.$image.attr("alt")||e.alt,e.caption=j.title||j.captionTitle||e.caption,e.description=j.description||j.captionDesc||e.description,e.noLightbox=e.$anchor.hasClass(h.noLightbox),e.panelHide=e.$anchor.hasClass(h.panelHide),d.exif(j.exif)&&(e.exif=f.extend(e.exif,j.exif),e.hasExif=!0),d.empty(e.caption)&&(e.caption=a.trim(e.$caption.find(i.caption.title).html())),d.empty(e.description)&&(e.description=a.trim(e.$caption.find(i.caption.description).html())),d.number(e.maxCaptionLength)&&e.maxCaptionLength>0&&!d.empty(e.caption)&&d.string(e.caption)&&e.caption.length>e.maxCaptionLength&&e.$caption.find(i.caption.title).html(e.caption.substr(0,e.maxCaptionLength)+"&hellip;"),d.number(e.maxDescriptionLength)&&e.maxDescriptionLength>0&&!d.empty(e.description)&&d.string(e.description)&&e.description.length>e.maxDescriptionLength&&e.$caption.find(i.caption.description).html(e.description.substr(0,e.maxDescriptionLength)+"&hellip;"),e.$overlay=e.$anchor.children(i.overlay),0===e.$overlay.length&&(e.$overlay=a("<span/>",{class:h.overlay}),e.$anchor.append(e.$overlay),e._undo.overlay=!0),e.$wrap=e.$anchor.children(i.wrap),0===e.$wrap.length&&(e.$wrap=a("<span/>",{class:h.wrap}),e.$anchor.append(e.$wrap.append(e.$image)),e._undo.wrap=!0),0===e.$el.children(i.loader).length&&(e.$el.append(a("<div/>",{class:h.loader})),e._undo.loader=!0);var k=e.$image.get(0);return d.empty(k.src)&&(k.src=b.EMPTY_IMAGE,e._undo.placeholder=!0),e.$el.addClass(e.getTypeClass()),e.hasExif&&e.$el.addClass(h.exif),!e.isCreated||!e.isAttached||e.isLoading||e.isLoaded||e.isError||e.$el.addClass(h.idle),!0},create:function(){var a=this;if(!a.isCreated&&d.string(a.href)&&d.string(a.src)&&d.number(a.width)&&d.number(a.height)){a.tmpl.raise("create-item",[a]).isDefaultPrevented()||(a.isCreated=a.doCreateItem()),a.isCreated&&a.tmpl.raise("created-item",[a])}return a.isCreated},doCreateItem:function(){var c=this,e=c.tmpl.opt,f=c.cls,g=c.attr,h=c.getTypeClass(),i=c.hasExif?f.exif:"";g.elem.class=[f.elem,h,i,f.idle].join(" "),g.inner.class=f.inner;var j=[f.anchor];c.noLightbox&&j.push(f.noLightbox),c.panelHide&&j.push(f.panelHide),g.anchor.class=j.join(" "),g.anchor.href=c.href,g.anchor["data-type"]=c.type,g.anchor["data-id"]=c.id,g.anchor["data-title"]=c.caption,g.anchor["data-description"]=c.description,d.empty(c.tags)||(g.anchor["data-tags"]=JSON.stringify(c.tags)),d.empty(c.productId)||(g.anchor["data-product-id"]=c.productId),g.image.class=f.image,g.image[e.src]=c.src,g.image[e.srcset]=c.srcset,g.image.width=c.width,g.image.height=c.height,g.image.title=c.title,g.image.alt=c.alt,c.$el=a("<div/>").attr(g.elem).data(b.DATA_ITEM,c),c.$inner=a("<figure/>").attr(g.inner).appendTo(c.$el),c.$anchor=a("<a/>").attr(g.anchor).appendTo(c.$inner).on("click.foogallery",{self:c},c.onAnchorClick),c.$overlay=a("<span/>",{class:f.overlay}).appendTo(c.$anchor),c.$wrap=a("<span/>",{class:f.wrap}).appendTo(c.$anchor),c.$image=a("<img/>").attr(g.image).appendTo(c.$wrap),f=c.cls.caption,g=c.attr.caption,g.elem.class=f.elem,c.$caption=a("<figcaption/>").attr(g.elem).on("click.foogallery",{self:c},c.onCaptionClick),g.inner.class=f.inner;var k=a("<div/>").attr(g.inner).appendTo(c.$caption),l=c.showCaptionTitle&&!d.empty(c.caption),m=c.showCaptionDescription&&!d.empty(c.description);if(l||m){if(g.title.class=f.title,g.description.class=f.description,l){var n=a("<div/>").attr(g.title),o=c.caption;d.number(c.maxCaptionLength)&&c.maxCaptionLength>0&&d.string(c.caption)&&c.caption.length>c.maxCaptionLength&&(o=c.caption.substr(0,c.maxCaptionLength)+"&hellip;"),n.get(0).innerHTML=o,k.append(n)}if(m){var p=a("<div/>").attr(g.description),q=c.description;d.number(c.maxDescriptionLength)&&c.maxDescriptionLength>0&&d.string(c.description)&&c.description.length>c.maxDescriptionLength&&(q=c.description.substr(0,c.maxDescriptionLength)+"&hellip;"),p.get(0).innerHTML=q,k.append(p)}}return c.$caption.appendTo(c.$inner),0===c.$el.find(c.sel.loader).length&&c.$el.append(a("<div/>",{class:c.cls.loader})),!0},append:function(){var a=this;if(a.isCreated&&!a.isAttached){a.tmpl.raise("append-item",[a]).isDefaultPrevented()||(a.tmpl.$el.append(a.$el),!a.fixLayout&&a.isParsed||a.fix(),a.isAttached=!0),a.isAttached&&a.tmpl.raise("appended-item",[a])}return a.isAttached},detach:function(){var a=this;if(a.isCreated&&a.isAttached){a.tmpl.raise("detach-item",[a]).isDefaultPrevented()||(a.$el.detach(),!a.fixLayout&&a.isParsed||a.unfix(),a.isAttached=!1),a.isAttached||a.tmpl.raise("detached-item",[a])}return!a.isAttached},load:function(){var b=this;if(d.promise(b._load))return b._load;if(!b.isCreated||!b.isAttached)return e.rejectWith("not created or attached");if(b.tmpl.raise("load-item",[b]).isDefaultPrevented())return e.rejectWith("default prevented");var c=b.cls,f=b.$image.get(0),g=f.src;return b.isLoading=!0,b.$el.removeClass(c.idle).removeClass(c.loaded).removeClass(c.error).addClass(c.loading),b._load=a.Deferred(function(a){f.onload=function(){f.onload=f.onerror=null,b.isLoading=!1,b.isLoaded=!0,b.$el.removeClass(c.loading).addClass(c.loaded),!b.fixLayout&&b.isParsed||b.unfix(),b.tmpl.raise("loaded-item",[b]),a.resolve(b)},f.onerror=function(){f.onload=f.onerror=null,b.isLoading=!1,b.isError=!0,b.$el.removeClass(c.loading).addClass(c.error),d.string(g)&&b.$image.prop("src",g),b.tmpl.raise("error-item",[b]),a.reject(b)},f.src=b.getThumbUrl(),f.complete&&f.onload()}).promise()},fix:function(){var a=this;if(null==a.tmpl)return a;if(a.isCreated&&!a.isLoading&&!a.isLoaded&&!a.isError){var b=a.width,c=a.height,e=a.$image.get(0);if(!isNaN(b)&&!isNaN(c)&&e){var f=d.fn(a.maxWidth)?a.maxWidth(a):a.$image.width();f<=0&&(f=b);var g=f/b,h=c*g;a.$image.css({width:f,height:h})}}return a},unfix:function(){var a=this;return null==a.tmpl?a:(a.isCreated&&a.$image.css({width:"",height:""}),a)},getThumbSrc:function(a,b){return c.src(this.src,this.srcset,this.width,this.height,a,b)},getThumbUrl:function(a){a=!!d.boolean(a)&&a;var b=this;return!a&&d.string(b._thumbUrl)?b._thumbUrl:b._thumbUrl=b.getThumbSrc(b.$anchor.innerWidth(),b.$anchor.innerHeight())},getTypeClass:function(){return this.cls.types.hasOwnProperty(this.type)?this.cls.types[this.type]:""},scrollTo:function(a){var b=this;if(b.isAttached){var d=b.bounds(),e=c.getViewportBounds();switch(a){case"top":d.left+=d.width/2-e.width/2,d.top-=e.height/5;break;default:d.left+=d.width/2-e.width/2,d.top+=d.height/2-e.height/2}window.scrollTo(d.left,d.top)}return b},bounds:function(){return this.isAttached?c.getElementBounds(this.$el):null},intersects:function(a){return!!this.isAttached&&this.bounds().intersects(a)},updateState:function(){this.tmpl.state.update(this.tmpl.state.get(this))},toJSON:function(){return{type:this.type,id:this.id,productId:this.productId,href:this.href,src:this.src,srcset:this.srcset,width:this.width,height:this.height,alt:this.alt,title:this.title,caption:this.caption,description:this.description,tags:this.tags.slice(),maxCaptionLength:this.maxCaptionLength,maxDescriptionLength:this.maxDescriptionLength,showCaptionTitle:this.showCaptionTitle,showCaptionDescription:this.showCaptionDescription,noLightbox:this.noLightbox,panelHide:this.panelHide,attr:f.extend({},this.attr)}},onAnchorClick:function(a){var b=a.data.self;b.tmpl.raise("anchor-click-item",[b]).isDefaultPrevented()?a.preventDefault():b.updateState()},onCaptionClick:function(b){var c=b.data.self;!c.tmpl.raise("caption-click-item",[c]).isDefaultPrevented()&&c.$anchor.length>0&&!a(b.target).is("a,:input")&&c.$anchor.get(0).click()}}),b.template.configure("core",{item:{type:"item",id:"",href:"",src:"",srcset:"",width:0,height:0,title:"",alt:"",caption:"",description:"",tags:[],maxWidth:null,maxCaptionLength:0,maxDescriptionLength:0,showCaptionTitle:!0,showCaptionDescription:!0,noLightbox:!1,panelHide:!1,exif:{aperture:null,camera:null,created_timestamp:null,shutter_speed:null,focal_length:null,iso:null,orientation:null},attr:{elem:{},inner:{},anchor:{},image:{},caption:{elem:{},inner:{},title:{},description:{}}}}},{item:{elem:"fg-item",inner:"fg-item-inner",exif:"fg-item-exif",anchor:"fg-thumb",overlay:"fg-image-overlay",wrap:"fg-image-wrap",image:"fg-image",loader:"fg-loader",idle:"fg-idle",loading:"fg-loading",loaded:"fg-loaded",error:"fg-error",noLightbox:"fg-no-lightbox",panelHide:"fg-panel-hide",types:{item:"fg-type-unknown"},caption:{elem:"fg-caption",inner:"fg-caption-inner",title:"fg-caption-title",description:"fg-caption-desc"}}},{item:{exif:{aperture:"Aperture",camera:"Camera",created_timestamp:"Date",shutter_speed:"Exposure",focal_length:"Focal Length",iso:"ISO",orientation:"Orientation"}}}),b.components.register("item",b.Item)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn,FooGallery.utils.obj,FooGallery.utils.str),function(a,b,c,d){b.Image=b.Item.extend({}),b.template.configure("core",null,{item:{types:{image:"fg-type-image"}}}),b.components.register("image",b.Image)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Paging=b.Component.extend({construct:function(a){var b=this;b._super(a),b.opt=b.tmpl.opt.paging,b.cls=b.tmpl.cls.paging,b.il8n=b.tmpl.il8n.paging,b.sel=b.tmpl.sel.paging,b.pushOrReplace=b.opt.pushOrReplace,b.type=b.opt.type,b.theme=b.opt.theme,b.size=b.opt.size,b.position=b.opt.position,b.scrollToTop=b.opt.scrollToTop,b.current=0,b.total=0,b.ctrls=[],b._arr=[]},fromHash:function(a){var b=parseInt(a);return isNaN(b)?null:b},toHash:function(a){return d.number(a)&&a>0?a.toString():null},getState:function(){return this.isValid(this.current)?this.current:null},setState:function(a){this.rebuild(),a.item&&!this.contains(a.page,a.item)&&(a.page=this.find(a.item),a.page=0!==a.page?a.page:1),this.set(a.page,!1,!1,!0)},destroy:function(){var b=this;b._arr.splice(0,b._arr.length),a.each(b.ctrls.splice(0,b.ctrls.length),function(a,b){b.destroy()}),b._super()},build:function(){var a=this,c=a.tmpl.items.available();a.total=a.size>0&&c.length>0?Math.ceil(c.length/a.size):1;for(var d=0;d<a.total;d++)a._arr.push(c.splice(0,a.size));if(a.total>1&&b.paging.hasCtrl(a.type)){var e,f,g=a.position;"both"!==g&&"top"!==g||(e=b.paging.makeCtrl(a.type,a.tmpl,a,"top"),e.create()&&(e.append(),a.ctrls.push(e))),"both"!==g&&"bottom"!==g||(f=b.paging.makeCtrl(a.type,a.tmpl,a,"bottom"),f.create()&&(f.append(),a.ctrls.push(f)))}},rebuild:function(){var b=this;b.current=0,b.total=0,b._arr.splice(0,b._arr.length),a.each(b.ctrls.splice(0,b.ctrls.length),function(a,b){b.destroy()}),b.build()},all:function(){return this._arr.slice()},available:function(){return this.get(this.current)},items:function(){return this.get(this.current)},controls:function(b){var c=this;c.isValid(b)&&a.each(c.ctrls,function(a,c){c.update(b)})},isValid:function(a){return d.number(a)&&a>0&&a<=this.total},number:function(a){return this.isValid(a)?a:0===this.current?1:this.current},create:function(a,b){var c=this;a=c.number(a);var d=a-1;c.tmpl.items.detach(c.tmpl.items.all()),c.current=a,c.tmpl.items.create(c._arr[d],!0)},get:function(a){var b=this;return b.isValid(a)?(a=b.number(a),b._arr[a-1]):[]},set:function(a,b,c,e){var f=this;if(f.isValid(a)){var g,h=f.number(a);if(h!==f.current){var i=f.current,j=function(){if(c=!d.boolean(c)||c,e=!!d.boolean(e)&&e,c&&1===f.current&&!f.tmpl.state.exists()&&(g=f.tmpl.state.get(),f.tmpl.state.update(g,f.pushOrReplace)),f.controls(a),f.create(h,e),c&&(g=f.tmpl.state.get(),f.tmpl.state.update(g,f.pushOrReplace)),f.scrollToTop&&d.boolean(b)&&b){var j=f.get(f.current);j.length>0&&j[0].scrollTo("top")}f.tmpl.raise("after-page-change",[f.current,i,e])};return!f.tmpl.raise("before-page-change",[f.current,h,j,e]).isDefaultPrevented()&&(j(),!0)}}return!1},find:function(a){for(var b=this,d=0,e=b._arr.length;d<e;d++)if(-1!==c.inArray(a,b._arr[d]))return d+1;return 0},contains:function(a,b){var d=this.get(a);return-1!==c.inArray(b,d)},first:function(){this.goto(1)},last:function(){this.goto(this._arr.length)},prev:function(){this.goto(this.current-1)},next:function(){this.goto(this.current+1)},goto:function(a){var b=this;b.set(a,!0)&&b.tmpl.loadAvailable()}}),b.PagingControl=b.Component.extend({construct:function(a,b,c){var d=this;d._super(a),d.pages=b,d.position=c,d.$container=null},create:function(){var b=this;return b.$container=a("<nav/>",{class:b.pages.cls.container}).addClass(b.pages.theme),!0},destroy:function(){var a=this;a.$container.remove(),a.$container=null},append:function(){var a=this;"top"===a.position?a.$container.insertBefore(a.tmpl.$el):a.$container.insertAfter(a.tmpl.$el)},update:function(a){}}),b.paging.register("default",b.Paging,null,{type:"none",theme:"fg-light",size:30,pushOrReplace:"push",position:"none",scrollToTop:!0},{container:"fg-paging-container"},null,-100)}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Dots=b.Paging.extend({}),b.DotsControl=b.PagingControl.extend({construct:function(b,c,d){this._super(b,c,d),this.$container=a(),this.$list=a(),this.$items=a()},create:function(){for(var b,c=this,d=c.pages.cls,e=c.pages.il8n,f=[],g=a("<ul/>",{class:d.list}),h=0,i=c.pages.total;h<i;h++)f.push(b=c.createItem(h+1,e.page)),g.append(b);return c.$list=g,c.$container=a("<nav/>",{class:d.container}).addClass(c.pages.theme).append(g),c.$items=a(a.map(f,function(a){return a.get()})),!0},append:function(){var a=this;"top"===a.position?a.$container.insertBefore(a.tmpl.$el):a.$container.insertAfter(a.tmpl.$el)},destroy:function(){var b=this,c=b.pages.sel;b.$list.find(c.link).off("click.foogallery",b.onLinkClick),b.$container.remove(),b.$container=a(),b.$list=a(),b.$items=a()},update:function(a){this.setSelected(a-1)},setSelected:function(b){var c=this,e=c.pages.cls,f=c.pages.il8n,g=c.pages.sel;c.$items.filter(g.selected).removeClass(e.selected).each(function(b,c){var e=a(c),f=e.data("label"),h=e.find(g.reader);d.string(f)&&0!==h.length&&h.html(f)}),c.$items.eq(b).addClass(e.selected).each(function(b,c){var e=a(c),h=e.find(g.reader),i=h.html();d.string(i)&&0!==h.length&&(e.data("label",i),h.html(f.current))})},createItem:function(b,c,e,f,g){e=d.string(e)?e:b,c=d.string(c)?c:"";var h=this,i=h.pages.opt,j=h.pages.cls,k=a("<a/>",{class:j.link,href:"#page-"+b}).html(e).on("click.foogallery",{self:h,page:b},h.onLinkClick);d.empty(c)||k.attr("title",c.replace(/\{PAGE}/g,b).replace(/\{LIMIT}/g,i.limit+"")),g=d.string(g)?g:c,d.empty(g)||k.prepend(a("<span/>",{class:j.reader,text:g.replace(/\{PAGE}/g,"").replace(/\{LIMIT}/g,i.limit+"")}));var l=a("<li/>",{class:j.item}).append(k);return f=d.string(f)?f:"",d.empty(f)||l.addClass(f),l},onLinkClick:function(b){b.preventDefault();var c=b.data.self,d=b.data.page,e=c.pages.sel;a(this).closest(e.item).is(e.disabled)||(c.pages.set(d,!0),c.tmpl.loadAvailable())}}),b.paging.register("dots",b.Dots,b.DotsControl,{type:"dots",position:"both",pushOrReplace:"push"},{list:"fg-dots",item:"fg-dot-item",link:"fg-dot-link",disabled:"fg-disabled",selected:"fg-selected",visible:"fg-visible",reader:"fg-sr-only"},{current:"Current page",page:"Page {PAGE}"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c){b.DefaultTemplate=b.Template.extend({}),b.template.register("default",b.DefaultTemplate,null,{container:"foogallery fg-default"})}(FooGallery.$,FooGallery,FooGallery.utils),function(a,b,c,d){b.MasonryTemplate=b.Template.extend({construct:function(a,b){this._super(a,b),this.masonry=null,this.style=null,this.$columnWidth=null},getStylesheet:function(){var a=this;return null===a.style&&(a.style=document.createElement("style"),a.style.appendChild(document.createTextNode("")),document.head.appendChild(a.style)),a.style.sheet},delayedLayout:function(){var a=this;a._delayedLayout&&clearTimeout(a._delayedLayout),a._delayedLayout=setTimeout(function(){a._delayedLayout=null,a.masonry.layout()},20)},onPreInit:function(b,c){var e=c.sel,f=c.cls;f.layouts=a.map(f.layout,function(a){return a}).join(" ");for(var g=a.map(f.layout,function(a,b){return{key:b,value:a}}),h=0,i=g.length;h<i;h++)if(c.$el.hasClass(g[h].value)){c.template.layout=g[h].key;break}d.string(f.layout[c.template.layout])||(c.template.layout="col4");var j,k,l="fixed"===c.template.layout;if(c.template.isFitWidth=l,c.template.percentPosition=!l,c.template.transitionDuration=0,c.template.itemSelector=e.item.elem,c.$el.removeClass(f.layouts).addClass(f.layout[c.template.layout]),l||(0===c.$el.find(e.gutterWidth).length&&c.$el.prepend(a("<div/>").addClass(f.gutterWidth)),c.template.gutter=e.gutterWidth),0===c.$el.find(e.columnWidth).length&&c.$el.prepend(a("<div/>").addClass(f.columnWidth)),l&&d.number(c.template.columnWidth)){var m=c.$el.find(e.columnWidth).width(c.template.columnWidth);j=c.getStylesheet(),k="#"+c.id+e.container+" "+e.item.elem+" { width: "+m.outerWidth()+"px; }",j.insertRule(k,0)}c.template.columnWidth=e.columnWidth,l&&d.number(c.template.gutter)&&(j=c.getStylesheet(),k="#"+c.id+e.container+" "+e.item.elem+" { margin-bottom: "+c.template.gutter+"px; }",j.insertRule(k,0)),c.masonry=new Masonry(c.$el.get(0),c.template)},onPostInit:function(a,b){b.masonry.layout()},onFirstLoad:function(a,b){b.masonry.layout()},onReady:function(a,b){b.delayedLayout()},onDestroy:function(a,b){b._delayedLayout&&clearTimeout(b._delayedLayout),b.$el.find(b.sel.columnWidth).remove(),b.$el.find(b.sel.gutterWidth).remove(),b.style&&b.style.parentNode&&b.style.parentNode.removeChild(b.style)},onDestroyed:function(a,b){b.masonry instanceof Masonry&&b.masonry.destroy()},onLayout:function(a,b){b.masonry.layout()},onParsedItems:function(a,b,c){b.masonry.layout()},onAppendedItems:function(a,b,c){c=b.items.jquerify(c),c=b.masonry.addItems(c),b.masonry.layoutItems(c,!0)},onDetachItem:function(a,b,c){a.isDefaultPrevented()||(a.preventDefault(),b.masonry.remove(c.$el),c.isAttached=!1,c.unfix())},onDetachedItems:function(a,b,c){b.masonry.layout()},onLoadedItems:function(a,b,c){b.masonry.layout()}}),b.template.register("masonry",b.MasonryTemplate,{fixLayout:!0,template:{initLayout:!1,isInitLayout:!1,layout:"col4"}},{container:"foogallery fg-masonry",columnWidth:"fg-column-width",gutterWidth:"fg-gutter-width",layout:{fixed:"fg-masonry-fixed",col2:"fg-masonry-2col",col3:"fg-masonry-3col",col4:"fg-masonry-4col",col5:"fg-masonry-5col"}})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c,d){b.Justified=c.Class.extend({construct:function(c,d){this.tmpl=c,this.$el=c.$el,this.options=a.extend(!0,{},b.Justified.defaults,d),this._items=[]},init:function(){var a=this;d.string(a.options.maxRowHeight)&&(a.options.maxRowHeight.indexOf("%")?a.options.maxRowHeight=a.options.rowHeight*(parseInt(a.options.maxRowHeight)/100):a.options.maxRowHeight=parseInt(a.options.maxRowHeight))},destroy:function(){this.$el.removeAttr("style")},parse:function(){var b=this;return b._items=a.map(b.tmpl.getItems(),function(a,b){return{index:b,width:a.width,height:a.height,top:0,left:0,$item:a.$el}})},getMaxRowHeight:function(){var a=this;return d.string(a.options.maxRowHeight)&&(a.options.maxRowHeight.indexOf("%")?a.options.maxRowHeight=a.options.rowHeight*(parseInt(a.options.maxRowHeight)/100):a.options.maxRowHeight=parseInt(a.options.maxRowHeight)),d.number(a.options.maxRowHeight)?a.options.maxRowHeight:a.options.rowHeight},getContainerWidth:function(){var a=this;return a.$el.is(":visible")?a.$el.width():a.$el.parents(":visible:first").innerWidth()},layout:function(){this.parse();var b=this,c=0,d=b.getContainerWidth(),e=b.getMaxRowHeight(),f=b.rows(d,e);a.each(f,function(a,d){d.visible&&(a>0&&(c+=b.options.margins),c+=d.height),b.render(d)}),b.$el.height(c)},render:function(a){for(var b,c=0,d=a.items.length;c<d;c++)b=a.items[c],a.visible?b.$item.css({width:b.width,height:b.height,top:b.top,left:b.left,display:"",maxHeight:this.options.maxRowHeight>0?this.options.maxRowHeight:""}).addClass("fg-positioned"):b.$item.css("display","none")},justify:function(a,b,c,d){var e=this,f=e.options.margins*(a.items.length-1),g=c-f,h=g/a.width;a.width=a.width*h,a.height=a.height*h,a.top=b,a.height>d&&(a.height=d),a.left=0,a.width<g&&(a.left=(g-a.width)/2),a.width+=f;for(var i,j=a.left,k=0,l=a.items.length;k<l;k++)k>0&&(j+=e.options.margins),i=a.items[k],i.left=j,i.top=b,i.width=i.width*h,i.height=i.height*h,i.height>d&&(i.height=d),j+=i.width;return a.height},position:function(a,b,c,d){var e=this,f=e.options.margins*(a.items.length-1),g=c-f;if(a.top=b,a.left=0,a.width<g)switch(d){case"center":a.left=(g-a.width)/2;break;case"right":a.left=g-a.width}a.width+=f;for(var h,i=a.left,j=0,k=a.items.length;j<k;j++)j>0&&(i+=e.options.margins),h=a.items[j],h.left=i,h.top=b,i+=h.width;return a.height},lastRow:function(a,b,c,d){var e=this,f=e.options.margins*(a.items.length-1),g=c-f,h=a.width/g>e.options.justifyThreshold;switch(e.options.lastRow){case"hide":h?e.justify(a,b,c,d):a.visible=!1;break;case"justify":e.justify(a,b,c,d);break;case"nojustify":h?e.justify(a,b,c,d):e.position(a,b,c,"left");break;case"left":case"center":case"right":h?e.justify(a,b,c,d):e.position(a,b,c,e.options.lastRow)}},items:function(){return a.map(this._items,function(a){return{index:a.index,width:a.width,height:a.height,$item:a.$item,top:a.top,left:a.left}})},rows:function(a,b){function c(){var a={index:++h,visible:!0,width:0,height:e.options.rowHeight,top:0,left:0,items:[]};return g.push(a),a}for(var d,e=this,f=e.items(),g=[],h=-1,i=c(),j=0,k=0,l=0,m=f.length;l<m;l++){if(d=f[l],d.height!=e.options.rowHeight){var n=e.options.rowHeight/d.height;d.height=d.height*n,d.width=d.width*n}k+d.width>a&&l>0&&(g.length>1&&(j+=e.options.margins),j+=e.justify(i,j,a,b),i=c(),k=0),i.items.length>0&&(k+=e.options.margins),k+=d.width,i.width+=d.width,i.items.push(d)}return g.length>1&&(j+=e.options.margins),e.lastRow(i,j,a,b),g}}),b.Justified.defaults={itemSelector:".fg-item",rowHeight:150,maxRowHeight:"200%",margins:0,lastRow:"center",justifyThreshold:1,refreshInterval:250}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is),function(a,b,c){b.JustifiedTemplate=b.Template.extend({onPreInit:function(a,c){c.justified=new b.Justified(c,c.template)},onInit:function(a,b){b.justified.init()},onFirstLoad:function(a,b){b.justified.layout()},onReady:function(a,b){b.justified.layout()},onDestroy:function(a,b){b.justified.destroy()},onLayout:function(a,b){b.justified.layout()},onAfterPageChange:function(a,b,c,d,e){e||b.justified.layout()},onAfterFilterChange:function(a,b){b.justified.layout()}}),b.template.register("justified",b.JustifiedTemplate,null,{container:"foogallery fg-justified"})}(FooGallery.$,FooGallery,FooGallery.utils.is),function(a,b,c,d,e){b.PortfolioTemplate=b.Template.extend({construct:function(a,b){this._super(a,b),this.style=null,this.fullWidth=!1},getStylesheet:function(){var a=this;return null===a.style&&(a.style=document.createElement("style"),a.style.appendChild(document.createTextNode("")),document.head.appendChild(a.style)),a.style.sheet},onPreInit:function(a,b){b.appendCSS()},onPostInit:function(a,b){b.checkCSS()},onDestroy:function(a,b){b.removeCSS()},onLayout:function(a,b){b.checkCSS()},checkCSS:function(){var a=this,b=a.getContainerWidth();b<a.template.columnWidth!==a.fullWidth&&a.appendCSS(b)},appendCSS:function(a){var b=this;a=d.number(a)?a:b.getContainerWidth(),b.removeCSS();var c,e=b.getStylesheet(),f="#"+b.id+b.sel.container,g=f+" "+b.sel.item.elem,h=b.template.columnWidth,i=Math.ceil(b.template.gutter/2);switch(b.template.align){case"center":c=f+" { justify-content: center; }",e.insertRule(c,0);break;case"left":c=f+" { justify-content: flex-start; }",e.insertRule(c,0);break;case"right":c=f+" { justify-content: flex-end; }",e.insertRule(c,0)}b.fullWidth=a<h,b.fullWidth?(c=g+" { max-width: 100%; min-width: 100%; margin: "+i+"px; }",e.insertRule(c,0)):(c=g+" { max-width: "+h+"px; min-width: "+h+"px; margin: "+i+"px; }",e.insertRule(c,0))},removeCSS:function(){var a=this;a.style&&a.style.parentNode&&(a.style.parentNode.removeChild(a.style),a.style=null,a.fullWidth=!1)}}),b.template.register("simple_portfolio",b.PortfolioTemplate,{template:{gutter:40,align:"center",columnWidth:250}},{container:"foogallery fg-simple_portfolio"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.fn),function(a,b,c,d){b.ImageViewerTemplate=b.Template.extend({construct:function(b,c){this._super(d.extend({},b,{paging:{pushOrReplace:"replace",theme:"fg-light",type:"default",size:1,position:"none",scrollToTop:!1}}),c),this.$inner=a(),this.$current=a(),this.$total=a(),this.$prev=a(),this.$next=a()},createChildren:function(){var b=this;return a("<div/>",{class:b.cls.inner}).append(a("<div/>",{class:b.cls.innerContainer}),a("<div/>",{class:b.cls.controls}).append(a("<div/>",{class:b.cls.prev}).append(a("<span/>",{text:b.il8n.prev})),a("<label/>",{class:b.cls.count,text:b.il8n.count}).prepend(a("<span/>",{class:b.cls.countCurrent,text:"0"})).append(a("<span/>",{class:b.cls.countTotal,text:"0"})),a("<div/>",{class:b.cls.next}).append(a("<span/>",{text:b.il8n.next}))))},destroyChildren:function(){var a=this;a.$el.find(a.sel.inner).remove()},onPreInit:function(a,b){b.$inner=b.$el.find(b.sel.innerContainer),b.$current=b.$el.find(b.sel.countCurrent),b.$total=b.$el.find(b.sel.countTotal),b.$prev=b.$el.find(b.sel.prev),b.$next=b.$el.find(b.sel.next)},onInit:function(a,b){b.template.attachFooBox&&b.$el.on("foobox.previous",{self:b},b.onFooBoxPrev).on("foobox.next",{self:b},b.onFooBoxNext),b.$prev.on("click",{self:b},b.onPrevClick),b.$next.on("click",{self:b},b.onNextClick)},onFirstLoad:function(a,b){b.update()},onDestroy:function(a,b){b.template.attachFooBox&&b.$el.off({"foobox.previous":b.onFooBoxPrev,"foobox.next":b.onFooBoxNext}),b.$prev.off("click",b.onPrevClick),b.$next.off("click",b.onNextClick)},onAppendItem:function(a,b,c){a.preventDefault(),b.$inner.append(c.$el),c.fix(),c.isAttached=!0},onAfterPageChange:function(a,b,c,d,e){e||b.update()},onAfterFilterChange:function(a,b){b.update()},update:function(){this.pages&&(this.$current.text(this.pages.current),this.$total.text(this.pages.total))},prev:function(){this.pages&&(this.template.loop&&1===this.pages.current?this.pages.last():this.pages.prev(),this.update())},next:function(){this.pages&&(this.template.loop&&this.pages.current===this.pages.total?this.pages.first():this.pages.next(),this.update())},onFooBoxPrev:function(a){a.data.self.prev()},onFooBoxNext:function(a){a.data.self.next()},onPrevClick:function(a){a.preventDefault(),a.stopPropagation(),a.data.self.prev()},onNextClick:function(a){a.preventDefault(),a.stopPropagation(),a.data.self.next()}}),b.template.register("image-viewer",b.ImageViewerTemplate,{template:{attachFooBox:!1,loop:!1}},{
12
+ container:"foogallery fg-image-viewer",inner:"fiv-inner",innerContainer:"fiv-inner-container",controls:"fiv-ctrls",prev:"fiv-prev",next:"fiv-next",count:"fiv-count",countCurrent:"fiv-count-current",countTotal:"fiv-count-total"},{prev:"Prev",next:"Next",count:"of"})}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.obj),function(a,b,c){b.ThumbnailTemplate=b.Template.extend({construct:function(a,b){this._super(c.extend({},a,{filtering:{type:"none"},paging:{pushOrReplace:"replace",theme:"fg-light",type:"default",size:1,position:"none",scrollToTop:!1}}),b)}}),b.template.register("thumbnail",b.ThumbnailTemplate,null,{container:"foogallery fg-thumbnail"})}(FooGallery.$,FooGallery,FooGallery.utils.obj),function(a,b,c,d,e,f){b.StackAlbum=c.Class.extend({construct:function(c,f){var g=this;g.$el=d.jq(c)?c:a(c),g.el=g.$el.get(0),g.opt=e.extend({},b.StackAlbum.defaults,f,g.$el.data("foogallery")),g.$back=g.$el.find(".fg-header-back"),g.$active=g.$el.find(".fg-header-active"),g.$piles=g.$el.find(".fg-piles"),g.piles=g.$piles.find(".fg-pile").map(function(a,c){return new b.StackAlbum.Pile(g,c,{index:a})}).get(),g.ignoreResize=!1,g.robserver=new ResizeObserver(function(){!g.ignoreResize&&g.$el.is(":visible")&&g.layout(!0)})},init:function(){var a=this;a.piles.forEach(function(a){a.init()}),a.$back.on("click.foogallery",{self:a},a.onBackClick),a.robserver.observe(a.el)},destroy:function(){var a=this;a.robserver.disconnect(),a.$back.off(".foogallery"),a.piles.forEach(function(a){a.destroy()})},getLayoutInfo:function(){var a=this,b=a.opt.gutter+2*a.opt.border;return{maxWidth:a.$el.width(),space:b,halfSpace:b/2,itemWidth:a.opt.itemWidth,itemHeight:a.opt.itemHeight,itemOuterWidth:a.opt.itemWidth+2*a.opt.border,itemOuterHeight:a.opt.itemHeight+2*a.opt.border,blockWidth:a.opt.itemWidth+b,blockHeight:a.opt.itemHeight+b,border:a.opt.border,doubleBorder:2*a.opt.border,gutter:a.opt.gutter,halfGutter:a.opt.gutter/2}},layout:function(a){var b,c=this;a&&(c.$el.addClass("fg-disable-transitions"),c.$el.prop("offsetWidth")),c.hasActive?(b=c.activePile.layout(),c.activePile.setPosition(0,0,b.width,b.height),c.$piles.css({width:b.width+"px",height:b.height+"px"})):(b=c.layoutPiles(),c.$piles.css({width:b.width+"px",height:b.height+"px"})),a&&c.$el.removeClass("fg-disable-transitions")},layoutPiles:function(a){var b=this,c=b.getLayoutInfo(),e=0,f=1,g=0;return a=d.fn(a)?a:function(){},b.piles.forEach(function(b){var d=e;(e+=c.blockWidth)>c.maxWidth&&(d=0,e=c.blockWidth,f++);var h=c.blockHeight*(f-1);a(b,h,d,c.blockWidth,c.blockHeight),b.setPosition(h,d,c.blockWidth,c.blockHeight),e>g&&(g=e)}),{width:g,height:c.blockHeight*f}},setActive:function(a){var c,d=this,e=d.activePile,g=e instanceof b.StackAlbum.Pile;a=a instanceof b.StackAlbum.Pile?a:null,d.activePile=a,d.hasActive=null!==a,g&&e.collapse(),d.ignoreResize=!0,d.hasActive?(d.piles.forEach(function(b){b!==a&&b.hide(d.activePile)}),c=d.activePile.expand(),d.$active.text(a.title),d.$el.addClass("fg-has-active")):(c=d.layoutPiles(function(a){a.show()}),d.$el.removeClass("fg-has-active")),f.start(d.$piles,function(a){a.css({width:c.width+"px",height:c.height+"px"})},!1,350).then(function(){d.ignoreResize=!1})},onBackClick:function(a){a.preventDefault(),a.stopPropagation(),a.data.self.setActive(null)}}),b.StackAlbum.defaults={gutter:50,itemWidth:150,itemHeight:150,border:10,angleStep:1,randomAngle:!1}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj,FooGallery.utils.transition),function(a,b,c,d,e){b.StackAlbum.Pile=c.Class.extend({construct:function(c,f,g){var h=this;h.album=c,h.$el=d.jq(f)?f:a(f),h.opt=e.extend({},b.StackAlbum.Pile.defaults,g,h.$el.data()),h.title=h.opt.title,h.items=h.$el.find(".fg-pile-item").map(function(a,c){return new b.StackAlbum.Item(h,c,{index:a})}).get(),h.$cover=a("<div/>",{class:"fg-pile-cover"}).append(a("<div/>",{class:"fg-pile-cover-content"}).append(a("<span/>",{class:"fg-pile-cover-title",text:h.opt.title}),a("<span/>",{class:"fg-pile-cover-count",text:h.items.length}))),h.top=0,h.left=0,h.isExpanded=!1},init:function(){var a=this,b=a.album.opt,c=a.getAngles(b.angleStep),d=b.randomAngle?a.randomAngle(c):b.angleStep;a.$cover.on("click.foogallery",{self:a},a.onCoverClick),a.items.forEach(function(e,f){e.init(),f>3||(0===f?(e.$el.addClass("fg-has-cover").append(a.$cover),e.load()):(f%2==0?e.setAngle(-d):e.setAngle(d),b.randomAngle?d=a.randomAngle(c):d+=b.angleStep))})},destroy:function(){var a=this;a.$cover.remove(),a.items.forEach(function(a,b){0===b&&a.$el.removeClass("fg-has-cover"),a.destroy()})},getAngles:function(a){for(var b=[],c=1;c<=3;c++)b.push(c*a);return b},randomAngle:function(a){var b=a.length,c=Math.floor(Math.random()*(b-0)+0),d=a.splice(c,1);return 1===d.length?d[0]:0},setPosition:function(a,b,c,e){var f=this;f.top=a,f.left=b,d.number(c)&&d.number(e)?f.$el.css({top:a+"px",left:b+"px",width:c+"px",height:e+"px"}):f.$el.css({top:a+"px",left:b+"px"})},layout:function(){var a=this,b=a.album.getLayoutInfo(),c=0,d=1,e=!1,f=0;return a.items.forEach(function(a){(c+=b.halfGutter)>b.maxWidth&&(c=b.halfGutter,d++,e=!0);var g=c;c+=b.itemOuterWidth+b.halfGutter,!e&&c>b.maxWidth&&(g=b.halfGutter,c=b.blockWidth,d++);var h=b.blockHeight*(d-1)+b.halfGutter;e=!1,a.setPosition(h,g,b.itemOuterWidth,b.itemOuterHeight),a.isLoaded||a.load(),c>f&&(f=c)}),{width:f,height:b.blockHeight*d}},expand:function(){var a,b=this;return b.$el.removeClass("fg-collapsed").addClass("fg-expanded"),a=b.layout(),b.setPosition(0,0,a.width,a.height),b.isExpanded=!0,a},collapse:function(){var a=this,b=a.album.getLayoutInfo();a.$el.removeClass("fg-expanded").addClass("fg-collapsed"),a.items.forEach(function(a){a.setPosition(b.halfGutter,b.halfGutter,b.itemOuterWidth,b.itemOuterHeight)});var c={width:b.blockWidth,height:b.blockHeight};return a.setPosition(0,0,c.width,c.height),a.isExpanded=!1,c},show:function(){this.$el.removeClass("fg-hidden fg-expanded fg-collapsed")},hide:function(a){var c=this;a instanceof b.StackAlbum.Pile&&c.setPosition(a.top,a.left),c.$el.addClass("fg-hidden")},onCoverClick:function(a){a.preventDefault(),a.stopPropagation();var b=a.data.self;b.album.setActive(b)}}),b.StackAlbum.Pile.defaults={index:-1,title:null}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj),function(a,b,c,d,e){b.StackAlbum.Item=c.Class.extend({construct:function(c,f,g){var h=this;h.$el=d.jq(f)?f:a(f),h.opt=e.extend({},b.StackAlbum.Item.defaults,g,h.$el.data()),h.$thumb=h.$el.find(".fg-pile-item-thumb"),h.$image=h.$el.find(".fg-pile-item-image"),h.isLoaded=!1,h.isLoading=!1,h._loading=null},init:function(){},destroy:function(){},setAngle:function(a){this.$el.css({transform:"rotate("+a+"deg)"})},setPosition:function(a,b,c,d){this.$el.css({top:a+"px",left:b+"px",width:c+"px",height:d+"px"})},load:function(){var b=this;return d.promise(b._loading)?b._loading:b._loading=a.Deferred(function(a){b.$el.addClass("fg-loading"),b.isLoading=!0,b.$image.on({"load.foogallery":function(){b.$image.off(".foogallery"),b.$el.removeClass("fg-loading"),b.isLoading=!1,b.isLoaded=!0,a.resolve()},"error.foogallery":function(){b.$image.off(".foogallery"),b.$el.removeClass("fg-loading"),b.isLoading=!1,b.isLoaded=!0,a.reject()}}),b.$image.prop("src",b.$image.attr(b.opt.src))}).promise()}}),b.StackAlbum.Item.defaults={index:-1,src:"data-src-fg"}}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.is,FooGallery.utils.obj),function(a,b,c){a.fn.foogalleryStackAlbum=function(c){return this.each(function(c,d){var e=a(d),f=e.data("__FooGalleryAlbum__");f instanceof b.StackAlbum&&f.destroy(),f=new b.StackAlbum(e),f.init(),e.data("__FooGalleryAlbum__",f)})},b.loadStackAlbums=b.reloadStackAlbums=function(){a(function(){a(".foogallery-stack-album:not(.fg-ready)").foogalleryStackAlbum()}),c.ready(function(){a(".foogallery-stack-album.fg-ready").foogalleryStackAlbum()})},b.loadStackAlbums()}(FooGallery.$,FooGallery,FooGallery.utils),function(a,b,c,d,e){b.triggerPostLoad=function(b,c,d,e,f){if("first-load"===b.type||c.initialized&&("after-page-change"===b.type&&!f||"after-filter-change"===b.type))try{if(c.$el.parents(".fbx-item").length>0)return;c.$el.hasClass("fbx-instance")&&window.FOOBOX&&a.fn.foobox?c.$el.foobox(window.FOOBOX.o):a("body").trigger("post-load")}catch(a){console.error(a)}},b.autoDefaults={on:{"first-load.foogallery after-page-change.foogallery after-filter-change.foogallery":b.triggerPostLoad}},b.autoEnabled=!0,b.auto=function(a){b.autoDefaults=d.merge(b.autoDefaults,a)},b.globalsMerged=!1,b.mergeGlobals=function(){if(!0!==b.globalsMerged&&window.FooGallery_il8n&&e.object(window.FooGallery_il8n)){var a=window.FooGallery_il8n;for(var d in a)if(a.hasOwnProperty(d)&&b[d]instanceof c.Factory&&e.object(a[d]))for(var f in a[d])a[d].hasOwnProperty(f)&&b[d].configure(f,null,null,a[d][f]);b.globalsMerged=!0}},b.load=b.reload=function(){a(function(){b.mergeGlobals(),b.autoEnabled&&a('[id^="foogallery-gallery-"]:not(.fg-ready)').foogallery(b.autoDefaults)}),c.ready(function(){b.mergeGlobals(),b.autoEnabled&&a('[id^="foogallery-gallery-"].fg-ready').foogallery(b.autoDefaults)})},b.load()}(FooGallery.$,FooGallery,FooGallery.utils,FooGallery.utils.obj,FooGallery.utils.is);
extensions/nextgen-importer/view-importer.php CHANGED
@@ -324,7 +324,7 @@ if ( isset( $_POST['foogallery_nextgen_reset'] ) ) {
324
  <div class="foogallery-help">
325
  <?php _e( 'Importing albums is also really simple:', 'foogallery' ); ?>
326
  <ol>
327
- <li><?php _e( __( 'For all the albums you wish to import, make sure all the galleries have been imported FIRST. If not, then go back to the Galleries tab.', 'foogallery' )); ?></li>
328
  <li><?php _e( 'Click the Import Album button for each album to import the album and link all the galleries. If you do not see the button, then that means you first need to import the galleries.', 'foogallery' ); ?></li>
329
  <li><?php _e( 'Once an album is imported, you can click on the link under the Album Name column to edit the album.', 'foogallery'); ?></li>
330
  </ol>
324
  <div class="foogallery-help">
325
  <?php _e( 'Importing albums is also really simple:', 'foogallery' ); ?>
326
  <ol>
327
+ <li><?php _e( 'For all the albums you wish to import, make sure all the galleries have been imported FIRST. If not, then go back to the Galleries tab.', 'foogallery' ); ?></li>
328
  <li><?php _e( 'Click the Import Album button for each album to import the album and link all the galleries. If you do not see the button, then that means you first need to import the galleries.', 'foogallery' ); ?></li>
329
  <li><?php _e( 'Once an album is imported, you can click on the link under the Album Name column to edit the album.', 'foogallery'); ?></li>
330
  </ol>
foogallery.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: FooGallery
5
  Description: FooGallery is the most intuitive and extensible gallery management tool ever created for WordPress
6
- Version: 1.9.44
7
  Author: FooPlugins
8
  Plugin URI: http://fooplugins.com/foogallery/
9
  Author URI: http://fooplugins.com
@@ -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', '1.9.44' );
29
  define( 'FOOGALLERY_SETTINGS_VERSION', '2' );
30
  require_once FOOGALLERY_PATH . 'includes/constants.php';
31
  // Create a helper function for easy SDK access.
@@ -174,6 +174,8 @@ if ( function_exists( 'foogallery_fs' ) ) {
174
  new FooGallery_Gutenberg();
175
  //init advanced settings
176
  new FooGallery_Advanced_Gallery_Settings();
 
 
177
  }
178
 
179
  function add_foogallery_pro_extension( $extensions )
3
  /*
4
  Plugin Name: FooGallery
5
  Description: FooGallery is the most intuitive and extensible gallery management tool ever created for WordPress
6
+ Version: 1.9.53
7
  Author: FooPlugins
8
  Plugin URI: http://fooplugins.com/foogallery/
9
  Author URI: http://fooplugins.com
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', '1.9.53' );
29
  define( 'FOOGALLERY_SETTINGS_VERSION', '2' );
30
  require_once FOOGALLERY_PATH . 'includes/constants.php';
31
  // Create a helper function for easy SDK access.
174
  new FooGallery_Gutenberg();
175
  //init advanced settings
176
  new FooGallery_Advanced_Gallery_Settings();
177
+ //init localization for FooGallery
178
+ new FooGallery_il8n();
179
  }
180
 
181
  function add_foogallery_pro_extension( $extensions )
freemius/LICENSE.txt CHANGED
@@ -1,674 +1,674 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies
6
- of this license document, but changing it is not allowed.
7
-
8
- Preamble
9
-
10
- The GNU General Public License is a free, copyleft license for
11
- software and other kinds of works.
12
-
13
- The licenses for most software and other practical works are designed
14
- to take away your freedom to share and change the works. By contrast,
15
- the GNU General Public License is intended to guarantee your freedom to
16
- share and change all versions of a program--to make sure it remains free
17
- software for all its users. We, the Free Software Foundation, use the
18
- GNU General Public License for most of our software; it applies also to
19
- any other work released this way by its authors. You can apply it to
20
- your programs, too.
21
-
22
- When we speak of free software, we are referring to freedom, not
23
- price. Our General Public Licenses are designed to make sure that you
24
- have the freedom to distribute copies of free software (and charge for
25
- them if you wish), that you receive source code or can get it if you
26
- want it, that you can change the software or use pieces of it in new
27
- free programs, and that you know you can do these things.
28
-
29
- To protect your rights, we need to prevent others from denying you
30
- these rights or asking you to surrender the rights. Therefore, you have
31
- certain responsibilities if you distribute copies of the software, or if
32
- you modify it: responsibilities to respect the freedom of others.
33
-
34
- For example, if you distribute copies of such a program, whether
35
- gratis or for a fee, you must pass on to the recipients the same
36
- freedoms that you received. You must make sure that they, too, receive
37
- or can get the source code. And you must show them these terms so they
38
- know their rights.
39
-
40
- Developers that use the GNU GPL protect your rights with two steps:
41
- (1) assert copyright on the software, and (2) offer you this License
42
- giving you legal permission to copy, distribute and/or modify it.
43
-
44
- For the developers' and authors' protection, the GPL clearly explains
45
- that there is no warranty for this free software. For both users' and
46
- authors' sake, the GPL requires that modified versions be marked as
47
- changed, so that their problems will not be attributed erroneously to
48
- authors of previous versions.
49
-
50
- Some devices are designed to deny users access to install or run
51
- modified versions of the software inside them, although the manufacturer
52
- can do so. This is fundamentally incompatible with the aim of
53
- protecting users' freedom to change the software. The systematic
54
- pattern of such abuse occurs in the area of products for individuals to
55
- use, which is precisely where it is most unacceptable. Therefore, we
56
- have designed this version of the GPL to prohibit the practice for those
57
- products. If such problems arise substantially in other domains, we
58
- stand ready to extend this provision to those domains in future versions
59
- of the GPL, as needed to protect the freedom of users.
60
-
61
- Finally, every program is threatened constantly by software patents.
62
- States should not allow patents to restrict development and use of
63
- software on general-purpose computers, but in those that do, we wish to
64
- avoid the special danger that patents applied to a free program could
65
- make it effectively proprietary. To prevent this, the GPL assures that
66
- patents cannot be used to render the program non-free.
67
-
68
- The precise terms and conditions for copying, distribution and
69
- modification follow.
70
-
71
- TERMS AND CONDITIONS
72
-
73
- 0. Definitions.
74
-
75
- "This License" refers to version 3 of the GNU General Public License.
76
-
77
- "Copyright" also means copyright-like laws that apply to other kinds of
78
- works, such as semiconductor masks.
79
-
80
- "The Program" refers to any copyrightable work licensed under this
81
- License. Each licensee is addressed as "you". "Licensees" and
82
- "recipients" may be individuals or organizations.
83
-
84
- To "modify" a work means to copy from or adapt all or part of the work
85
- in a fashion requiring copyright permission, other than the making of an
86
- exact copy. The resulting work is called a "modified version" of the
87
- earlier work or a work "based on" the earlier work.
88
-
89
- A "covered work" means either the unmodified Program or a work based
90
- on the Program.
91
-
92
- To "propagate" a work means to do anything with it that, without
93
- permission, would make you directly or secondarily liable for
94
- infringement under applicable copyright law, except executing it on a
95
- computer or modifying a private copy. Propagation includes copying,
96
- distribution (with or without modification), making available to the
97
- public, and in some countries other activities as well.
98
-
99
- To "convey" a work means any kind of propagation that enables other
100
- parties to make or receive copies. Mere interaction with a user through
101
- a computer network, with no transfer of a copy, is not conveying.
102
-
103
- An interactive user interface displays "Appropriate Legal Notices"
104
- to the extent that it includes a convenient and prominently visible
105
- feature that (1) displays an appropriate copyright notice, and (2)
106
- tells the user that there is no warranty for the work (except to the
107
- extent that warranties are provided), that licensees may convey the
108
- work under this License, and how to view a copy of this License. If
109
- the interface presents a list of user commands or options, such as a
110
- menu, a prominent item in the list meets this criterion.
111
-
112
- 1. Source Code.
113
-
114
- The "source code" for a work means the preferred form of the work
115
- for making modifications to it. "Object code" means any non-source
116
- form of a work.
117
-
118
- A "Standard Interface" means an interface that either is an official
119
- standard defined by a recognized standards body, or, in the case of
120
- interfaces specified for a particular programming language, one that
121
- is widely used among developers working in that language.
122
-
123
- The "System Libraries" of an executable work include anything, other
124
- than the work as a whole, that (a) is included in the normal form of
125
- packaging a Major Component, but which is not part of that Major
126
- Component, and (b) serves only to enable use of the work with that
127
- Major Component, or to implement a Standard Interface for which an
128
- implementation is available to the public in source code form. A
129
- "Major Component", in this context, means a major essential component
130
- (kernel, window system, and so on) of the specific operating system
131
- (if any) on which the executable work runs, or a compiler used to
132
- produce the work, or an object code interpreter used to run it.
133
-
134
- The "Corresponding Source" for a work in object code form means all
135
- the source code needed to generate, install, and (for an executable
136
- work) run the object code and to modify the work, including scripts to
137
- control those activities. However, it does not include the work's
138
- System Libraries, or general-purpose tools or generally available free
139
- programs which are used unmodified in performing those activities but
140
- which are not part of the work. For example, Corresponding Source
141
- includes interface definition files associated with source files for
142
- the work, and the source code for shared libraries and dynamically
143
- linked subprograms that the work is specifically designed to require,
144
- such as by intimate data communication or control flow between those
145
- subprograms and other parts of the work.
146
-
147
- The Corresponding Source need not include anything that users
148
- can regenerate automatically from other parts of the Corresponding
149
- Source.
150
-
151
- The Corresponding Source for a work in source code form is that
152
- same work.
153
-
154
- 2. Basic Permissions.
155
-
156
- All rights granted under this License are granted for the term of
157
- copyright on the Program, and are irrevocable provided the stated
158
- conditions are met. This License explicitly affirms your unlimited
159
- permission to run the unmodified Program. The output from running a
160
- covered work is covered by this License only if the output, given its
161
- content, constitutes a covered work. This License acknowledges your
162
- rights of fair use or other equivalent, as provided by copyright law.
163
-
164
- You may make, run and propagate covered works that you do not
165
- convey, without conditions so long as your license otherwise remains
166
- in force. You may convey covered works to others for the sole purpose
167
- of having them make modifications exclusively for you, or provide you
168
- with facilities for running those works, provided that you comply with
169
- the terms of this License in conveying all material for which you do
170
- not control copyright. Those thus making or running the covered works
171
- for you must do so exclusively on your behalf, under your direction
172
- and control, on terms that prohibit them from making any copies of
173
- your copyrighted material outside their relationship with you.
174
-
175
- Conveying under any other circumstances is permitted solely under
176
- the conditions stated below. Sublicensing is not allowed; section 10
177
- makes it unnecessary.
178
-
179
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
-
181
- No covered work shall be deemed part of an effective technological
182
- measure under any applicable law fulfilling obligations under article
183
- 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
- similar laws prohibiting or restricting circumvention of such
185
- measures.
186
-
187
- When you convey a covered work, you waive any legal power to forbid
188
- circumvention of technological measures to the extent such circumvention
189
- is effected by exercising rights under this License with respect to
190
- the covered work, and you disclaim any intention to limit operation or
191
- modification of the work as a means of enforcing, against the work's
192
- users, your or third parties' legal rights to forbid circumvention of
193
- technological measures.
194
-
195
- 4. Conveying Verbatim Copies.
196
-
197
- You may convey verbatim copies of the Program's source code as you
198
- receive it, in any medium, provided that you conspicuously and
199
- appropriately publish on each copy an appropriate copyright notice;
200
- keep intact all notices stating that this License and any
201
- non-permissive terms added in accord with section 7 apply to the code;
202
- keep intact all notices of the absence of any warranty; and give all
203
- recipients a copy of this License along with the Program.
204
-
205
- You may charge any price or no price for each copy that you convey,
206
- and you may offer support or warranty protection for a fee.
207
-
208
- 5. Conveying Modified Source Versions.
209
-
210
- You may convey a work based on the Program, or the modifications to
211
- produce it from the Program, in the form of source code under the
212
- terms of section 4, provided that you also meet all of these conditions:
213
-
214
- a) The work must carry prominent notices stating that you modified
215
- it, and giving a relevant date.
216
-
217
- b) The work must carry prominent notices stating that it is
218
- released under this License and any conditions added under section
219
- 7. This requirement modifies the requirement in section 4 to
220
- "keep intact all notices".
221
-
222
- c) You must license the entire work, as a whole, under this
223
- License to anyone who comes into possession of a copy. This
224
- License will therefore apply, along with any applicable section 7
225
- additional terms, to the whole of the work, and all its parts,
226
- regardless of how they are packaged. This License gives no
227
- permission to license the work in any other way, but it does not
228
- invalidate such permission if you have separately received it.
229
-
230
- d) If the work has interactive user interfaces, each must display
231
- Appropriate Legal Notices; however, if the Program has interactive
232
- interfaces that do not display Appropriate Legal Notices, your
233
- work need not make them do so.
234
-
235
- A compilation of a covered work with other separate and independent
236
- works, which are not by their nature extensions of the covered work,
237
- and which are not combined with it such as to form a larger program,
238
- in or on a volume of a storage or distribution medium, is called an
239
- "aggregate" if the compilation and its resulting copyright are not
240
- used to limit the access or legal rights of the compilation's users
241
- beyond what the individual works permit. Inclusion of a covered work
242
- in an aggregate does not cause this License to apply to the other
243
- parts of the aggregate.
244
-
245
- 6. Conveying Non-Source Forms.
246
-
247
- You may convey a covered work in object code form under the terms
248
- of sections 4 and 5, provided that you also convey the
249
- machine-readable Corresponding Source under the terms of this License,
250
- in one of these ways:
251
-
252
- a) Convey the object code in, or embodied in, a physical product
253
- (including a physical distribution medium), accompanied by the
254
- Corresponding Source fixed on a durable physical medium
255
- customarily used for software interchange.
256
-
257
- b) Convey the object code in, or embodied in, a physical product
258
- (including a physical distribution medium), accompanied by a
259
- written offer, valid for at least three years and valid for as
260
- long as you offer spare parts or customer support for that product
261
- model, to give anyone who possesses the object code either (1) a
262
- copy of the Corresponding Source for all the software in the
263
- product that is covered by this License, on a durable physical
264
- medium customarily used for software interchange, for a price no
265
- more than your reasonable cost of physically performing this
266
- conveying of source, or (2) access to copy the
267
- Corresponding Source from a network server at no charge.
268
-
269
- c) Convey individual copies of the object code with a copy of the
270
- written offer to provide the Corresponding Source. This
271
- alternative is allowed only occasionally and noncommercially, and
272
- only if you received the object code with such an offer, in accord
273
- with subsection 6b.
274
-
275
- d) Convey the object code by offering access from a designated
276
- place (gratis or for a charge), and offer equivalent access to the
277
- Corresponding Source in the same way through the same place at no
278
- further charge. You need not require recipients to copy the
279
- Corresponding Source along with the object code. If the place to
280
- copy the object code is a network server, the Corresponding Source
281
- may be on a different server (operated by you or a third party)
282
- that supports equivalent copying facilities, provided you maintain
283
- clear directions next to the object code saying where to find the
284
- Corresponding Source. Regardless of what server hosts the
285
- Corresponding Source, you remain obligated to ensure that it is
286
- available for as long as needed to satisfy these requirements.
287
-
288
- e) Convey the object code using peer-to-peer transmission, provided
289
- you inform other peers where the object code and Corresponding
290
- Source of the work are being offered to the general public at no
291
- charge under subsection 6d.
292
-
293
- A separable portion of the object code, whose source code is excluded
294
- from the Corresponding Source as a System Library, need not be
295
- included in conveying the object code work.
296
-
297
- A "User Product" is either (1) a "consumer product", which means any
298
- tangible personal property which is normally used for personal, family,
299
- or household purposes, or (2) anything designed or sold for incorporation
300
- into a dwelling. In determining whether a product is a consumer product,
301
- doubtful cases shall be resolved in favor of coverage. For a particular
302
- product received by a particular user, "normally used" refers to a
303
- typical or common use of that class of product, regardless of the status
304
- of the particular user or of the way in which the particular user
305
- actually uses, or expects or is expected to use, the product. A product
306
- is a consumer product regardless of whether the product has substantial
307
- commercial, industrial or non-consumer uses, unless such uses represent
308
- the only significant mode of use of the product.
309
-
310
- "Installation Information" for a User Product means any methods,
311
- procedures, authorization keys, or other information required to install
312
- and execute modified versions of a covered work in that User Product from
313
- a modified version of its Corresponding Source. The information must
314
- suffice to ensure that the continued functioning of the modified object
315
- code is in no case prevented or interfered with solely because
316
- modification has been made.
317
-
318
- If you convey an object code work under this section in, or with, or
319
- specifically for use in, a User Product, and the conveying occurs as
320
- part of a transaction in which the right of possession and use of the
321
- User Product is transferred to the recipient in perpetuity or for a
322
- fixed term (regardless of how the transaction is characterized), the
323
- Corresponding Source conveyed under this section must be accompanied
324
- by the Installation Information. But this requirement does not apply
325
- if neither you nor any third party retains the ability to install
326
- modified object code on the User Product (for example, the work has
327
- been installed in ROM).
328
-
329
- The requirement to provide Installation Information does not include a
330
- requirement to continue to provide support service, warranty, or updates
331
- for a work that has been modified or installed by the recipient, or for
332
- the User Product in which it has been modified or installed. Access to a
333
- network may be denied when the modification itself materially and
334
- adversely affects the operation of the network or violates the rules and
335
- protocols for communication across the network.
336
-
337
- Corresponding Source conveyed, and Installation Information provided,
338
- in accord with this section must be in a format that is publicly
339
- documented (and with an implementation available to the public in
340
- source code form), and must require no special password or key for
341
- unpacking, reading or copying.
342
-
343
- 7. Additional Terms.
344
-
345
- "Additional permissions" are terms that supplement the terms of this
346
- License by making exceptions from one or more of its conditions.
347
- Additional permissions that are applicable to the entire Program shall
348
- be treated as though they were included in this License, to the extent
349
- that they are valid under applicable law. If additional permissions
350
- apply only to part of the Program, that part may be used separately
351
- under those permissions, but the entire Program remains governed by
352
- this License without regard to the additional permissions.
353
-
354
- When you convey a copy of a covered work, you may at your option
355
- remove any additional permissions from that copy, or from any part of
356
- it. (Additional permissions may be written to require their own
357
- removal in certain cases when you modify the work.) You may place
358
- additional permissions on material, added by you to a covered work,
359
- for which you have or can give appropriate copyright permission.
360
-
361
- Notwithstanding any other provision of this License, for material you
362
- add to a covered work, you may (if authorized by the copyright holders of
363
- that material) supplement the terms of this License with terms:
364
-
365
- a) Disclaiming warranty or limiting liability differently from the
366
- terms of sections 15 and 16 of this License; or
367
-
368
- b) Requiring preservation of specified reasonable legal notices or
369
- author attributions in that material or in the Appropriate Legal
370
- Notices displayed by works containing it; or
371
-
372
- c) Prohibiting misrepresentation of the origin of that material, or
373
- requiring that modified versions of such material be marked in
374
- reasonable ways as different from the original version; or
375
-
376
- d) Limiting the use for publicity purposes of names of licensors or
377
- authors of the material; or
378
-
379
- e) Declining to grant rights under trademark law for use of some
380
- trade names, trademarks, or service marks; or
381
-
382
- f) Requiring indemnification of licensors and authors of that
383
- material by anyone who conveys the material (or modified versions of
384
- it) with contractual assumptions of liability to the recipient, for
385
- any liability that these contractual assumptions directly impose on
386
- those licensors and authors.
387
-
388
- All other non-permissive additional terms are considered "further
389
- restrictions" within the meaning of section 10. If the Program as you
390
- received it, or any part of it, contains a notice stating that it is
391
- governed by this License along with a term that is a further
392
- restriction, you may remove that term. If a license document contains
393
- a further restriction but permits relicensing or conveying under this
394
- License, you may add to a covered work material governed by the terms
395
- of that license document, provided that the further restriction does
396
- not survive such relicensing or conveying.
397
-
398
- If you add terms to a covered work in accord with this section, you
399
- must place, in the relevant source files, a statement of the
400
- additional terms that apply to those files, or a notice indicating
401
- where to find the applicable terms.
402
-
403
- Additional terms, permissive or non-permissive, may be stated in the
404
- form of a separately written license, or stated as exceptions;
405
- the above requirements apply either way.
406
-
407
- 8. Termination.
408
-
409
- You may not propagate or modify a covered work except as expressly
410
- provided under this License. Any attempt otherwise to propagate or
411
- modify it is void, and will automatically terminate your rights under
412
- this License (including any patent licenses granted under the third
413
- paragraph of section 11).
414
-
415
- However, if you cease all violation of this License, then your
416
- license from a particular copyright holder is reinstated (a)
417
- provisionally, unless and until the copyright holder explicitly and
418
- finally terminates your license, and (b) permanently, if the copyright
419
- holder fails to notify you of the violation by some reasonable means
420
- prior to 60 days after the cessation.
421
-
422
- Moreover, your license from a particular copyright holder is
423
- reinstated permanently if the copyright holder notifies you of the
424
- violation by some reasonable means, this is the first time you have
425
- received notice of violation of this License (for any work) from that
426
- copyright holder, and you cure the violation prior to 30 days after
427
- your receipt of the notice.
428
-
429
- Termination of your rights under this section does not terminate the
430
- licenses of parties who have received copies or rights from you under
431
- this License. If your rights have been terminated and not permanently
432
- reinstated, you do not qualify to receive new licenses for the same
433
- material under section 10.
434
-
435
- 9. Acceptance Not Required for Having Copies.
436
-
437
- You are not required to accept this License in order to receive or
438
- run a copy of the Program. Ancillary propagation of a covered work
439
- occurring solely as a consequence of using peer-to-peer transmission
440
- to receive a copy likewise does not require acceptance. However,
441
- nothing other than this License grants you permission to propagate or
442
- modify any covered work. These actions infringe copyright if you do
443
- not accept this License. Therefore, by modifying or propagating a
444
- covered work, you indicate your acceptance of this License to do so.
445
-
446
- 10. Automatic Licensing of Downstream Recipients.
447
-
448
- Each time you convey a covered work, the recipient automatically
449
- receives a license from the original licensors, to run, modify and
450
- propagate that work, subject to this License. You are not responsible
451
- for enforcing compliance by third parties with this License.
452
-
453
- An "entity transaction" is a transaction transferring control of an
454
- organization, or substantially all assets of one, or subdividing an
455
- organization, or merging organizations. If propagation of a covered
456
- work results from an entity transaction, each party to that
457
- transaction who receives a copy of the work also receives whatever
458
- licenses to the work the party's predecessor in interest had or could
459
- give under the previous paragraph, plus a right to possession of the
460
- Corresponding Source of the work from the predecessor in interest, if
461
- the predecessor has it or can get it with reasonable efforts.
462
-
463
- You may not impose any further restrictions on the exercise of the
464
- rights granted or affirmed under this License. For example, you may
465
- not impose a license fee, royalty, or other charge for exercise of
466
- rights granted under this License, and you may not initiate litigation
467
- (including a cross-claim or counterclaim in a lawsuit) alleging that
468
- any patent claim is infringed by making, using, selling, offering for
469
- sale, or importing the Program or any portion of it.
470
-
471
- 11. Patents.
472
-
473
- A "contributor" is a copyright holder who authorizes use under this
474
- License of the Program or a work on which the Program is based. The
475
- work thus licensed is called the contributor's "contributor version".
476
-
477
- A contributor's "essential patent claims" are all patent claims
478
- owned or controlled by the contributor, whether already acquired or
479
- hereafter acquired, that would be infringed by some manner, permitted
480
- by this License, of making, using, or selling its contributor version,
481
- but do not include claims that would be infringed only as a
482
- consequence of further modification of the contributor version. For
483
- purposes of this definition, "control" includes the right to grant
484
- patent sublicenses in a manner consistent with the requirements of
485
- this License.
486
-
487
- Each contributor grants you a non-exclusive, worldwide, royalty-free
488
- patent license under the contributor's essential patent claims, to
489
- make, use, sell, offer for sale, import and otherwise run, modify and
490
- propagate the contents of its contributor version.
491
-
492
- In the following three paragraphs, a "patent license" is any express
493
- agreement or commitment, however denominated, not to enforce a patent
494
- (such as an express permission to practice a patent or covenant not to
495
- sue for patent infringement). To "grant" such a patent license to a
496
- party means to make such an agreement or commitment not to enforce a
497
- patent against the party.
498
-
499
- If you convey a covered work, knowingly relying on a patent license,
500
- and the Corresponding Source of the work is not available for anyone
501
- to copy, free of charge and under the terms of this License, through a
502
- publicly available network server or other readily accessible means,
503
- then you must either (1) cause the Corresponding Source to be so
504
- available, or (2) arrange to deprive yourself of the benefit of the
505
- patent license for this particular work, or (3) arrange, in a manner
506
- consistent with the requirements of this License, to extend the patent
507
- license to downstream recipients. "Knowingly relying" means you have
508
- actual knowledge that, but for the patent license, your conveying the
509
- covered work in a country, or your recipient's use of the covered work
510
- in a country, would infringe one or more identifiable patents in that
511
- country that you have reason to believe are valid.
512
-
513
- If, pursuant to or in connection with a single transaction or
514
- arrangement, you convey, or propagate by procuring conveyance of, a
515
- covered work, and grant a patent license to some of the parties
516
- receiving the covered work authorizing them to use, propagate, modify
517
- or convey a specific copy of the covered work, then the patent license
518
- you grant is automatically extended to all recipients of the covered
519
- work and works based on it.
520
-
521
- A patent license is "discriminatory" if it does not include within
522
- the scope of its coverage, prohibits the exercise of, or is
523
- conditioned on the non-exercise of one or more of the rights that are
524
- specifically granted under this License. You may not convey a covered
525
- work if you are a party to an arrangement with a third party that is
526
- in the business of distributing software, under which you make payment
527
- to the third party based on the extent of your activity of conveying
528
- the work, and under which the third party grants, to any of the
529
- parties who would receive the covered work from you, a discriminatory
530
- patent license (a) in connection with copies of the covered work
531
- conveyed by you (or copies made from those copies), or (b) primarily
532
- for and in connection with specific products or compilations that
533
- contain the covered work, unless you entered into that arrangement,
534
- or that patent license was granted, prior to 28 March 2007.
535
-
536
- Nothing in this License shall be construed as excluding or limiting
537
- any implied license or other defenses to infringement that may
538
- otherwise be available to you under applicable patent law.
539
-
540
- 12. No Surrender of Others' Freedom.
541
-
542
- If conditions are imposed on you (whether by court order, agreement or
543
- otherwise) that contradict the conditions of this License, they do not
544
- excuse you from the conditions of this License. If you cannot convey a
545
- covered work so as to satisfy simultaneously your obligations under this
546
- License and any other pertinent obligations, then as a consequence you may
547
- not convey it at all. For example, if you agree to terms that obligate you
548
- to collect a royalty for further conveying from those to whom you convey
549
- the Program, the only way you could satisfy both those terms and this
550
- License would be to refrain entirely from conveying the Program.
551
-
552
- 13. Use with the GNU Affero General Public License.
553
-
554
- Notwithstanding any other provision of this License, you have
555
- permission to link or combine any covered work with a work licensed
556
- under version 3 of the GNU Affero General Public License into a single
557
- combined work, and to convey the resulting work. The terms of this
558
- License will continue to apply to the part which is the covered work,
559
- but the special requirements of the GNU Affero General Public License,
560
- section 13, concerning interaction through a network will apply to the
561
- combination as such.
562
-
563
- 14. Revised Versions of this License.
564
-
565
- The Free Software Foundation may publish revised and/or new versions of
566
- the GNU General Public License from time to time. Such new versions will
567
- be similar in spirit to the present version, but may differ in detail to
568
- address new problems or concerns.
569
-
570
- Each version is given a distinguishing version number. If the
571
- Program specifies that a certain numbered version of the GNU General
572
- Public License "or any later version" applies to it, you have the
573
- option of following the terms and conditions either of that numbered
574
- version or of any later version published by the Free Software
575
- Foundation. If the Program does not specify a version number of the
576
- GNU General Public License, you may choose any version ever published
577
- by the Free Software Foundation.
578
-
579
- If the Program specifies that a proxy can decide which future
580
- versions of the GNU General Public License can be used, that proxy's
581
- public statement of acceptance of a version permanently authorizes you
582
- to choose that version for the Program.
583
-
584
- Later license versions may give you additional or different
585
- permissions. However, no additional obligations are imposed on any
586
- author or copyright holder as a result of your choosing to follow a
587
- later version.
588
-
589
- 15. Disclaimer of Warranty.
590
-
591
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
- OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
- IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
- ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
-
600
- 16. Limitation of Liability.
601
-
602
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
- USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
- PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
- SUCH DAMAGES.
611
-
612
- 17. Interpretation of Sections 15 and 16.
613
-
614
- If the disclaimer of warranty and limitation of liability provided
615
- above cannot be given local legal effect according to their terms,
616
- reviewing courts shall apply local law that most closely approximates
617
- an absolute waiver of all civil liability in connection with the
618
- Program, unless a warranty or assumption of liability accompanies a
619
- copy of the Program in return for a fee.
620
-
621
- END OF TERMS AND CONDITIONS
622
-
623
- How to Apply These Terms to Your New Programs
624
-
625
- If you develop a new program, and you want it to be of the greatest
626
- possible use to the public, the best way to achieve this is to make it
627
- free software which everyone can redistribute and change under these terms.
628
-
629
- To do so, attach the following notices to the program. It is safest
630
- to attach them to the start of each source file to most effectively
631
- state the exclusion of warranty; and each file should have at least
632
- the "copyright" line and a pointer to where the full notice is found.
633
-
634
- {one line to give the program's name and a brief idea of what it does.}
635
- Copyright (C) {year} {name of author}
636
-
637
- This program is free software: you can redistribute it and/or modify
638
- it under the terms of the GNU General Public License as published by
639
- the Free Software Foundation, either version 3 of the License, or
640
- (at your option) any later version.
641
-
642
- This program is distributed in the hope that it will be useful,
643
- but WITHOUT ANY WARRANTY; without even the implied warranty of
644
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
- GNU General Public License for more details.
646
-
647
- You should have received a copy of the GNU General Public License
648
- along with this program. If not, see <http://www.gnu.org/licenses/>.
649
-
650
- Also add information on how to contact you by electronic and paper mail.
651
-
652
- If the program does terminal interaction, make it output a short
653
- notice like this when it starts in an interactive mode:
654
-
655
- {project} Copyright (C) {year} {fullname}
656
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
- This is free software, and you are welcome to redistribute it
658
- under certain conditions; type `show c' for details.
659
-
660
- The hypothetical commands `show w' and `show c' should show the appropriate
661
- parts of the General Public License. Of course, your program's commands
662
- might be different; for a GUI interface, you would use an "about box".
663
-
664
- You should also get your employer (if you work as a programmer) or school,
665
- if any, to sign a "copyright disclaimer" for the program, if necessary.
666
- For more information on this, and how to apply and follow the GNU GPL, see
667
- <http://www.gnu.org/licenses/>.
668
-
669
- The GNU General Public License does not permit incorporating your program
670
- into proprietary programs. If your program is a subroutine library, you
671
- may consider it more useful to permit linking proprietary applications with
672
- the library. If this is what you want to do, use the GNU Lesser General
673
- Public License instead of this License. But first, please read
674
  <http://www.gnu.org/philosophy/why-not-lgpl.html>.
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ {one line to give the program's name and a brief idea of what it does.}
635
+ Copyright (C) {year} {name of author}
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ {project} Copyright (C) {year} {fullname}
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <http://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
  <http://www.gnu.org/philosophy/why-not-lgpl.html>.
gutenberg/class-foogallery-rest-routes.php CHANGED
@@ -112,7 +112,7 @@ if ( ! class_exists( 'FooGallery_Rest_Routes' ) ) {
112
  */
113
  public function get_item_schema() {
114
  return array(
115
- '$schema' => 'http://json-schema.org/schema#',
116
  'title' => 'foogallery',
117
  'type' => 'object',
118
  'properties' => array(
112
  */
113
  public function get_item_schema() {
114
  return array(
115
+ '$schema' => 'https://json-schema.org/schema#',
116
  'title' => 'foogallery',
117
  'type' => 'object',
118
  'properties' => array(
includes/WPThumb/wpthumb.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://github.com/humanmade/WPThumb
5
  Description: An on-demand image generation replacement for WordPress' image resizing.
6
  Author: Human Made Limited
7
  Version: 0.10
8
- Author URI: http://www.hmn.md/
9
  */
10
 
11
  /* Copyright 2014 Human Made Limited (email : hello@humanmade.co.uk)
5
  Description: An on-demand image generation replacement for WordPress' image resizing.
6
  Author: Human Made Limited
7
  Version: 0.10
8
+ Author URI: https://www.hmn.md/
9
  */
10
 
11
  /* Copyright 2014 Human Made Limited (email : hello@humanmade.co.uk)
includes/admin/boilerplates/blank/foogallery-EXTSLUG.txt CHANGED
@@ -10,7 +10,7 @@
10
  * Author: {author}
11
  * Author URI: {author_link}
12
  * License: GPL-2.0+
13
- * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
14
  */
15
 
16
  if ( !class_exists( '{package}' ) ) {
10
  * Author: {author}
11
  * Author URI: {author_link}
12
  * License: GPL-2.0+
13
+ * License URI: https://www.gnu.org/licenses/gpl-2.0.txt
14
  */
15
 
16
  if ( !class_exists( '{package}' ) ) {
includes/admin/class-admin-notices.php CHANGED
@@ -22,15 +22,17 @@ if ( ! class_exists( 'FooGallery_Admin_Notices' ) ) {
22
  $option = get_option( FOOGALLERY_OPTION_THUMB_TEST );
23
  $option_value = $this->generate_option_value();
24
 
25
- if ( !isset( $option ) ) {
26
  //we have never run tests before
27
  return true;
28
  } else {
29
- $option_key = $option['key'];
30
- if ( $option_value !== $option_key ) {
31
- //either the PHP version or Host has changed. In either case, we should run tests again!
32
- return true;
33
- }
 
 
34
  }
35
 
36
  return false;
@@ -257,7 +259,7 @@ if ( ! class_exists( 'FooGallery_Admin_Notices' ) ) {
257
  'numberposts' => 1
258
  ) );
259
 
260
- if ( is_array( $oldest_gallery ) ) {
261
  $oldest_gallery = $oldest_gallery[0];
262
 
263
  if( strtotime( $oldest_gallery->post_date ) < strtotime('-7 days') ) {
22
  $option = get_option( FOOGALLERY_OPTION_THUMB_TEST );
23
  $option_value = $this->generate_option_value();
24
 
25
+ if ( $option === false ) {
26
  //we have never run tests before
27
  return true;
28
  } else {
29
+ if ( is_array( $option ) && array_key_exists( 'key', $option ) ) {
30
+ $option_key = $option['key'];
31
+ if ( $option_value !== $option_key ) {
32
+ //either the PHP version or Host has changed. In either case, we should run tests again!
33
+ return true;
34
+ }
35
+ }
36
  }
37
 
38
  return false;
259
  'numberposts' => 1
260
  ) );
261
 
262
+ if ( is_array( $oldest_gallery ) && count( $oldest_gallery ) > 0 ) {
263
  $oldest_gallery = $oldest_gallery[0];
264
 
265
  if( strtotime( $oldest_gallery->post_date ) < strtotime('-7 days') ) {
includes/admin/class-admin.php CHANGED
@@ -55,6 +55,12 @@ if ( ! class_exists( 'FooGallery_Admin' ) ) {
55
  return;
56
  }
57
 
 
 
 
 
 
 
58
  do_action('foogallery_admin_enqueue_scripts' );
59
  }
60
 
55
  return;
56
  }
57
 
58
+ foogallery_enqueue_core_gallery_template_script();
59
+ foogallery_enqueue_core_gallery_template_style();
60
+
61
+ $foogallery = FooGallery_Plugin::get_instance();
62
+ $foogallery->register_and_enqueue_js( 'admin-foogallery-edit.js' );
63
+
64
  do_action('foogallery_admin_enqueue_scripts' );
65
  }
66
 
includes/admin/class-gallery-metabox-settings-helper.php CHANGED
@@ -43,10 +43,12 @@ if ( ! class_exists( 'FooGallery_Admin_Gallery_MetaBox_Settings_Helper' ) ) {
43
  private function render_gallery_template_settings_tabs( $template, $sections ) {
44
  $tab_active = 'foogallery-tab-active';
45
  foreach ( $sections as $section_slug => $section ) {
 
46
  //if there are no fields then set the slug to the first subsection
47
  if ( isset( $section['subsections'] ) && count( $section['fields'] ) === 0 ) {
48
  foreach ( $section['subsections'] as $subsection_slug => $subsection ) {
49
  $section_slug = $subsection_slug;
 
50
  break;
51
  }
52
  }
@@ -59,10 +61,12 @@ if ( ! class_exists( 'FooGallery_Admin_Gallery_MetaBox_Settings_Helper' ) ) {
59
  if ( isset( $section['subsections'] ) ) { ?>
60
  <div class="foogallery-vertical-child-tabs">
61
  <?php foreach ( $section['subsections'] as $subsection_slug => $subsection ) { ?>
62
- <div class="foogallery-vertical-child-tab" data-name="<?php echo esc_attr( $template['slug'] . '-' . $subsection_slug ); ?>">
63
  <span class="foogallery-tab-text"><?php echo esc_html( $subsection['name'] ); ?></span>
64
  </div>
65
- <?php } ?>
 
 
66
  </div>
67
  <?php } ?>
68
  </div>
@@ -72,14 +76,29 @@ if ( ! class_exists( 'FooGallery_Admin_Gallery_MetaBox_Settings_Helper' ) ) {
72
  }
73
 
74
  private function render_gallery_template_settings_tab_contents( $template, $sections, $tab_active = 'foogallery-tab-active' ) {
75
- foreach ( $sections as $section_slug => $section ) { ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  <div class="foogallery-tab-content <?php echo $tab_active; ?>"
77
  data-name="<?php echo $template['slug']; ?>-<?php echo $section_slug; ?>">
78
  <?php $this->render_gallery_template_settings_tab_contents_fields( $template, $section ); ?>
79
  </div>
80
  <?php
81
  if ( isset( $section['subsections'] ) ) {
82
- $this->render_gallery_template_settings_tab_contents( $template, $section['subsections'], '' );
 
83
  }
84
  $tab_active = '';
85
  }
43
  private function render_gallery_template_settings_tabs( $template, $sections ) {
44
  $tab_active = 'foogallery-tab-active';
45
  foreach ( $sections as $section_slug => $section ) {
46
+ $subsection_active = '';
47
  //if there are no fields then set the slug to the first subsection
48
  if ( isset( $section['subsections'] ) && count( $section['fields'] ) === 0 ) {
49
  foreach ( $section['subsections'] as $subsection_slug => $subsection ) {
50
  $section_slug = $subsection_slug;
51
+ $subsection_active = 'foogallery-tab-active';
52
  break;
53
  }
54
  }
61
  if ( isset( $section['subsections'] ) ) { ?>
62
  <div class="foogallery-vertical-child-tabs">
63
  <?php foreach ( $section['subsections'] as $subsection_slug => $subsection ) { ?>
64
+ <div class="foogallery-vertical-child-tab <?php echo $subsection_active; ?>" data-name="<?php echo esc_attr( $template['slug'] . '-' . $subsection_slug ); ?>">
65
  <span class="foogallery-tab-text"><?php echo esc_html( $subsection['name'] ); ?></span>
66
  </div>
67
+ <?php
68
+ $subsection_active = '';
69
+ } ?>
70
  </div>
71
  <?php } ?>
72
  </div>
76
  }
77
 
78
  private function render_gallery_template_settings_tab_contents( $template, $sections, $tab_active = 'foogallery-tab-active' ) {
79
+ foreach ( $sections as $section_slug => $section ) {
80
+ $subsection_active = '';
81
+
82
+ //if we are on an active section, then do the check for subsections
83
+ if ( $tab_active === 'foogallery-tab-active' ) {
84
+ //if there are no fields then set the slug to the first subsection
85
+ if ( isset( $section['subsections'] ) && count( $section['fields'] ) === 0 ) {
86
+ foreach ( $section['subsections'] as $subsection_slug => $subsection ) {
87
+ $subsection_active = 'foogallery-tab-active';
88
+ break;
89
+ }
90
+ }
91
+ }
92
+
93
+ ?>
94
  <div class="foogallery-tab-content <?php echo $tab_active; ?>"
95
  data-name="<?php echo $template['slug']; ?>-<?php echo $section_slug; ?>">
96
  <?php $this->render_gallery_template_settings_tab_contents_fields( $template, $section ); ?>
97
  </div>
98
  <?php
99
  if ( isset( $section['subsections'] ) ) {
100
+ $this->render_gallery_template_settings_tab_contents( $template, $section['subsections'], $subsection_active );
101
+ $subsection_active = '';
102
  }
103
  $tab_active = '';
104
  }
includes/admin/class-settings.php CHANGED
@@ -11,6 +11,7 @@ if ( ! class_exists( 'FooGallery_Admin_Settings' ) ) {
11
  add_filter( 'foogallery_admin_settings', array( $this, 'create_settings' ), 10, 2 );
12
  add_action( 'foogallery_admin_settings_custom_type_render_setting', array( $this, 'render_custom_setting_types' ) );
13
  add_action( 'foogallery_admin_settings_after_render_setting', array( $this, 'after_render_setting' ) );
 
14
 
15
  // Ajax calls
16
  add_action( 'wp_ajax_foogallery_clear_css_optimizations', array( $this, 'ajax_clear_css_optimizations' ) );
@@ -271,11 +272,39 @@ if ( ! class_exists( 'FooGallery_Admin_Settings' ) ) {
271
  //region Language Tab
272
  $tabs['language'] = __( 'Language', 'foogallery' );
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  $settings[] = array(
275
  'id' => 'language_images_count_none_text',
276
  'title' => __( 'Image Count None Text', 'foogallery' ),
277
  'type' => 'text',
278
  'default' => __( 'No images', 'foogallery' ),
 
279
  'tab' => 'language'
280
  );
281
 
@@ -284,6 +313,7 @@ if ( ! class_exists( 'FooGallery_Admin_Settings' ) ) {
284
  'title' => __( 'Image Count Single Text', 'foogallery' ),
285
  'type' => 'text',
286
  'default' => __( '1 image', 'foogallery' ),
 
287
  'tab' => 'language'
288
  );
289
 
@@ -292,6 +322,7 @@ if ( ! class_exists( 'FooGallery_Admin_Settings' ) ) {
292
  'title' => __( 'Image Count Many Text', 'foogallery' ),
293
  'type' => 'text',
294
  'default' => __( '%s images', 'foogallery' ),
 
295
  'tab' => 'language'
296
  );
297
  //endregion Language Tab
@@ -375,6 +406,28 @@ if ( ! class_exists( 'FooGallery_Admin_Settings' ) ) {
375
  }
376
  //endregion Advanced Tab
377
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  return apply_filters( 'foogallery_admin_settings_override', array(
379
  'tabs' => $tabs,
380
  'sections' => array(),
@@ -491,5 +544,76 @@ if ( ! class_exists( 'FooGallery_Admin_Settings' ) ) {
491
  die();
492
  }
493
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
494
  }
495
  }
11
  add_filter( 'foogallery_admin_settings', array( $this, 'create_settings' ), 10, 2 );
12
  add_action( 'foogallery_admin_settings_custom_type_render_setting', array( $this, 'render_custom_setting_types' ) );
13
  add_action( 'foogallery_admin_settings_after_render_setting', array( $this, 'after_render_setting' ) );
14
+ add_action( 'update_option_foogallery', array( $this, 'generate_assets' ), 10, 3 );
15
 
16
  // Ajax calls
17
  add_action( 'wp_ajax_foogallery_clear_css_optimizations', array( $this, 'ajax_clear_css_optimizations' ) );
272
  //region Language Tab
273
  $tabs['language'] = __( 'Language', 'foogallery' );
274
 
275
+ $settings[] = array(
276
+ 'id' => 'language_imageviewer_prev_text',
277
+ 'title' => __( 'Imageviewer "Prev" Text', 'foogallery' ),
278
+ 'type' => 'text',
279
+ 'default' => __( 'Prev', 'foogallery' ),
280
+ 'section' => __( 'Imageviewer', 'foogallery' ),
281
+ 'tab' => 'language'
282
+ );
283
+
284
+ $settings[] = array(
285
+ 'id' => 'language_imageviewer_next_text',
286
+ 'title' => __( 'Imageviewer "Next" Text', 'foogallery' ),
287
+ 'type' => 'text',
288
+ 'default' => __( 'Next', 'foogallery' ),
289
+ 'section' => __( 'Imageviewer', 'foogallery' ),
290
+ 'tab' => 'language'
291
+ );
292
+
293
+ $settings[] = array(
294
+ 'id' => 'language_imageviewer_of_text',
295
+ 'title' => __( 'Imageviewer "Of" Text', 'foogallery' ),
296
+ 'type' => 'text',
297
+ 'default' => __( 'of', 'foogallery' ),
298
+ 'section' => __( 'Imageviewer', 'foogallery' ),
299
+ 'tab' => 'language'
300
+ );
301
+
302
  $settings[] = array(
303
  'id' => 'language_images_count_none_text',
304
  'title' => __( 'Image Count None Text', 'foogallery' ),
305
  'type' => 'text',
306
  'default' => __( 'No images', 'foogallery' ),
307
+ 'section' => __( 'Admin', 'foogallery' ),
308
  'tab' => 'language'
309
  );
310
 
313
  'title' => __( 'Image Count Single Text', 'foogallery' ),
314
  'type' => 'text',
315
  'default' => __( '1 image', 'foogallery' ),
316
+ 'section' => __( 'Admin', 'foogallery' ),
317
  'tab' => 'language'
318
  );
319
 
322
  'title' => __( 'Image Count Many Text', 'foogallery' ),
323
  'type' => 'text',
324
  'default' => __( '%s images', 'foogallery' ),
325
+ 'section' => __( 'Admin', 'foogallery' ),
326
  'tab' => 'language'
327
  );
328
  //endregion Language Tab
406
  }
407
  //endregion Advanced Tab
408
 
409
+ //region Custom JS & CSS
410
+ $tabs['custom_assets'] = __( 'Custom JS & CSS', 'foogallery' );
411
+
412
+ $settings[] = array(
413
+ 'id' => 'custom_js',
414
+ 'title' => __( 'Custom Javascript', 'foogallery' ),
415
+ 'desc' => __( 'Custom Javascript that will be added to the page when a gallery is rendered.', 'foogallery' ),
416
+ 'type' => 'textarea',
417
+ 'tab' => 'custom_assets',
418
+ 'default' => ''
419
+ );
420
+
421
+ $settings[] = array(
422
+ 'id' => 'custom_css',
423
+ 'title' => __( 'Custom Stylesheet', 'foogallery' ),
424
+ 'desc' => __( 'Custom CSS that will be added to the page when a gallery is rendered.', 'foogallery' ),
425
+ 'type' => 'textarea',
426
+ 'tab' => 'custom_assets',
427
+ 'default' => ''
428
+ );
429
+ //endregion Custom JS & CSS
430
+
431
  return apply_filters( 'foogallery_admin_settings_override', array(
432
  'tabs' => $tabs,
433
  'sections' => array(),
544
  die();
545
  }
546
  }
547
+
548
+ function generate_assets( $old_value, $value, $option) {
549
+ if ( !is_admin() ) {
550
+ return;
551
+ }
552
+
553
+ if ( !current_user_can( 'manage_options' ) ) {
554
+ return;
555
+ }
556
+
557
+ $custom_assets = array();
558
+
559
+ //check if we have saved any custom JS
560
+ $custom_js = foogallery_get_setting( 'custom_js', '' );
561
+ if ( !empty( $custom_js ) ) {
562
+ $custom_js = '
563
+ /*
564
+ * FooGallery Custom Javascript
565
+ * This file is created by adding custom JS on FooGallery Settings page in wp-admin
566
+ * Created : ' . date( 'j M Y, g:i a', time() ) . '
567
+ */
568
+
569
+ '. $custom_js;
570
+ //generate script in upload folder
571
+ $script_url = $this->generate_custom_asset( 'custom.js', $custom_js );
572
+ if ( $script_url !== false ) {
573
+ $custom_assets['script'] = $script_url;
574
+ }
575
+ }
576
+
577
+ //check if we have saved any custom CSS
578
+ $custom_css = foogallery_get_setting( 'custom_css', '' );
579
+ if ( !empty( $custom_css ) ) {
580
+ $custom_css = '
581
+ /*
582
+ * FooGallery Custom CSS
583
+ * This file is created by adding custom CSS on FooGallery Settings page in wp-admin
584
+ * Created : ' . date( 'j M Y, g:i a', time() ) . '
585
+ */
586
+
587
+ '. $custom_css;
588
+ //generate stylesheet in upload folder
589
+ $style_url = $this->generate_custom_asset( 'custom.css', $custom_css );
590
+ if ( $style_url !== false ) {
591
+ $custom_assets['style'] = $style_url;
592
+ }
593
+ }
594
+
595
+ //set another option with the details
596
+ if ( count( $custom_assets ) > 0 ) {
597
+ update_option( FOOGALLERY_OPTION_CUSTOM_ASSETS, $custom_assets );
598
+ } else {
599
+ delete_option( FOOGALLERY_OPTION_CUSTOM_ASSETS );
600
+ }
601
+ }
602
+
603
+ function generate_custom_asset( $filename, $contents ) {
604
+ global $wp_filesystem;
605
+
606
+ $upload_dir = wp_upload_dir();
607
+ if ( !empty( $upload_dir['basedir'] ) ) {
608
+ $dir = trailingslashit( $upload_dir['basedir'] ) . 'foogallery/';
609
+ WP_Filesystem(); // Initial WP file system
610
+ $wp_filesystem->mkdir( $dir ); // Make a new folder for storing our file
611
+ if ( $wp_filesystem->put_contents( $dir . $filename, $contents, 0644 ) ) {
612
+ return set_url_scheme( trailingslashit( $upload_dir['baseurl'] ) . 'foogallery/' . $filename );
613
+ }
614
+ }
615
+
616
+ return false;
617
+ }
618
  }
619
  }
includes/class-foogallery-attachment.php CHANGED
@@ -92,7 +92,7 @@ if ( ! class_exists( 'FooGalleryAttachment' ) ) {
92
  * @return string
93
  */
94
  public function html_img_src( $args = array() ) {
95
- return apply_filters( 'foogallery_attachment_resize_thumbnail', $this->url, $args, $this );
96
  }
97
 
98
  /**
92
  * @return string
93
  */
94
  public function html_img_src( $args = array() ) {
95
+ return esc_url( apply_filters( 'foogallery_attachment_resize_thumbnail', $this->url, $args, $this ) );
96
  }
97
 
98
  /**
includes/class-foogallery-lazyload.php CHANGED
@@ -84,30 +84,36 @@ if ( ! class_exists( 'FooGallery_LazyLoad' ) ) {
84
 
85
  if (isset($current_foogallery->lazyload_support) && true === $current_foogallery->lazyload_support) {
86
  if (isset($attr['src'])) {
87
- //rename src => data-src
88
  $src = $attr['src'];
89
  unset($attr['src']);
90
  $attr['data-src-fg'] = $src;
91
  }
92
 
93
  if (isset($attr['srcset'])) {
94
- //rename srcset => data-srcset
95
  $src = $attr['srcset'];
96
  unset($attr['srcset']);
97
  $attr['data-srcset-fg'] = $src;
98
  }
99
 
100
- //do not add the src attribute
101
- if ( false ) {
102
- //set the src to a 1x1 transparent gif
103
- $attr['src'] = FOOGALLERY_URL . 'assets/1x1.gif';
104
- }
 
 
105
  }
106
  }
107
 
108
  return $attr;
109
  }
110
 
 
 
 
 
111
 
112
  /**
113
  * Add the required lazy load options if needed
84
 
85
  if (isset($current_foogallery->lazyload_support) && true === $current_foogallery->lazyload_support) {
86
  if (isset($attr['src'])) {
87
+ //rename src => data-src-fg
88
  $src = $attr['src'];
89
  unset($attr['src']);
90
  $attr['data-src-fg'] = $src;
91
  }
92
 
93
  if (isset($attr['srcset'])) {
94
+ //rename srcset => data-srcset-fg
95
  $src = $attr['srcset'];
96
  unset($attr['srcset']);
97
  $attr['data-srcset-fg'] = $src;
98
  }
99
 
100
+ if ( apply_filters( 'foogallery_img_src_placeholders', false ) ) {
101
+ //add a placeholder src
102
+ if ( isset( $attr['width'] ) && isset( $attr['height'] ) ) {
103
+ //set the src to a 1x1 transparent gif
104
+ $attr['src'] = $this->get_placeholder_image( $attr['width'], $attr['height'] );
105
+ }
106
+ }
107
  }
108
  }
109
 
110
  return $attr;
111
  }
112
 
113
+ public function get_placeholder_image( $w, $h ) {
114
+ return 'data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%20' . $w . '%20' . $h . '%22%3E%3C/svg%3E';
115
+ }
116
+
117
 
118
  /**
119
  * Add the required lazy load options if needed
includes/class-gallery-advanced-settings.php CHANGED
@@ -76,7 +76,7 @@ if ( ! class_exists( 'FooGallery_Advanced_Gallery_Settings' ) ) {
76
  $settings_array = @json_decode($custom_settings, true);
77
 
78
  if ( isset( $settings_array ) ) {
79
- $options = array_merge_recursive( $options, $settings_array );
80
  }
81
  }
82
 
76
  $settings_array = @json_decode($custom_settings, true);
77
 
78
  if ( isset( $settings_array ) ) {
79
+ $options = array_replace_recursive( $options, $settings_array );
80
  }
81
  }
82
 
includes/class-il8n.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Foogallery class for enqueuing the FooGallery_il8n variable into the page
4
+ */
5
+
6
+ if ( ! class_exists( 'FooGallery_il8n' ) ) {
7
+ class FooGallery_il8n {
8
+
9
+ function __construct() {
10
+ add_action( 'foogallery_enqueue_script-core', array( $this, 'enqueue_il8n' ), 10, 1 );
11
+ }
12
+
13
+ function enqueue_il8n( $js ) {
14
+ $il8n = array();
15
+
16
+ $imageviewer_prev_entry = foogallery_get_language_array_value( 'language_imageviewer_prev_text', __( 'Prev', 'foogallery' ) );
17
+ if ( $imageviewer_prev_entry !== false ) {
18
+ $il8n = array_merge_recursive( $il8n, array(
19
+ 'template' => array(
20
+ "image-viewer" => array(
21
+ 'prev' => $imageviewer_prev_entry
22
+ )
23
+ )
24
+ ) );
25
+ }
26
+
27
+ $imageviewer_next_entry = foogallery_get_language_array_value( 'language_imageviewer_next_text', __( 'Next', 'foogallery' ) );
28
+ if ( $imageviewer_next_entry !== false ) {
29
+ $il8n = array_merge_recursive( $il8n, array(
30
+ 'template' => array(
31
+ "image-viewer" => array(
32
+ 'next' => $imageviewer_next_entry
33
+ )
34
+ )
35
+ ) );
36
+ }
37
+
38
+ $imageviewer_of_entry = foogallery_get_language_array_value( 'language_imageviewer_of_text', __( 'of', 'foogallery' ) );
39
+ if ( $imageviewer_of_entry !== false ) {
40
+ $il8n = array_merge_recursive( $il8n, array(
41
+ 'template' => array(
42
+ "image-viewer" => array(
43
+ 'of' => $imageviewer_of_entry
44
+ )
45
+ )
46
+ ) );
47
+ }
48
+
49
+ $il8n = apply_filters( 'foogallery_il8n', $il8n );
50
+
51
+ $script = "var FooGallery_il8n = " . foogallery_json_encode( $il8n ) . ';';
52
+
53
+ wp_add_inline_script( 'foogallery-core', $script, 'before' );
54
+ }
55
+ }
56
+ }
includes/compatibility/class-foovideo-compatibility.php CHANGED
@@ -129,7 +129,7 @@ if ( ! class_exists( 'FooGallery_FooVideo_Compatibility' ) ) {
129
  $settings_link = '<a target="_blank" href="' . foogallery_admin_settings_url() . '#extensions">' . __('FooGallery Settings page', 'foogallery') . '</a>';
130
  echo '<h4>' . sprintf( __( 'There is no FooVideo license key set for this site. Please set it via the %s under the extensions tab and try again.', 'foogallery' ), $settings_link ) . '</h4>';
131
  } else {
132
- $license_url = "http://fooplugins.com/api/{$license_key}/licensekey/";
133
 
134
  //fetch the license info from FooPlugins.com
135
  $response = wp_remote_get( $license_url, array( 'sslverify' => false ) );
129
  $settings_link = '<a target="_blank" href="' . foogallery_admin_settings_url() . '#extensions">' . __('FooGallery Settings page', 'foogallery') . '</a>';
130
  echo '<h4>' . sprintf( __( 'There is no FooVideo license key set for this site. Please set it via the %s under the extensions tab and try again.', 'foogallery' ), $settings_link ) . '</h4>';
131
  } else {
132
+ $license_url = "https://fooplugins.com/api/{$license_key}/licensekey/";
133
 
134
  //fetch the license info from FooPlugins.com
135
  $response = wp_remote_get( $license_url, array( 'sslverify' => false ) );
includes/compatibility/class-polylang-compatibility.php CHANGED
@@ -94,7 +94,7 @@ if ( ! class_exists( 'FooGallery_Polylang_Compatibility' ) ) {
94
  <p>
95
  <strong><?php _e( 'FooGallery + Polylang Alert : ', 'foogallery' ); ?></strong>
96
  <?php _e( 'We noticed that you have Polylang installed and you have chosen to activate languages and translations for media.', 'foogallery' ); ?><br />
97
- <?php _e( 'This may cause empty galleries on translated pages! To disable this feature, please visit Settings -> Languages -> Settings Tab.', 'foogallery' ); ?>
98
  </p>
99
  </div>
100
  <?php
94
  <p>
95
  <strong><?php _e( 'FooGallery + Polylang Alert : ', 'foogallery' ); ?></strong>
96
  <?php _e( 'We noticed that you have Polylang installed and you have chosen to activate languages and translations for media.', 'foogallery' ); ?><br />
97
+ <?php _e( 'This may cause empty galleries on translated pages! To disable this feature, please visit Languages -> Settings.', 'foogallery' ); ?>
98
  </p>
99
  </div>
100
  <?php
includes/constants.php CHANGED
@@ -27,6 +27,7 @@ define( 'FOOGALLERY_ACTIVATION_REDIRECT_TRANSIENT_KEY', '_foogallery_activation_
27
 
28
  define( 'FOOGALLERY_OPTION_VERSION', 'foogallery-version' );
29
  define( 'FOOGALLERY_OPTION_THUMB_TEST', 'foogallery-thumb-test' );
 
30
 
31
  define( 'FOOGALLERY_ADMIN_MENU_HELP_SLUG', 'foogallery-help' );
32
  define( 'FOOGALLERY_ADMIN_MENU_SETTINGS_SLUG', 'foogallery-settings' );
27
 
28
  define( 'FOOGALLERY_OPTION_VERSION', 'foogallery-version' );
29
  define( 'FOOGALLERY_OPTION_THUMB_TEST', 'foogallery-thumb-test' );
30
+ define( 'FOOGALLERY_OPTION_CUSTOM_ASSETS', 'foogallery-custom-assets' );
31
 
32
  define( 'FOOGALLERY_ADMIN_MENU_HELP_SLUG', 'foogallery-help' );
33
  define( 'FOOGALLERY_ADMIN_MENU_SETTINGS_SLUG', 'foogallery-settings' );
includes/extensions/class-extension.php CHANGED
@@ -40,7 +40,7 @@ if ( ! class_exists( 'FooGallery_Extension' ) ) {
40
  // 'description' => 'The best lightbox for WordPress just got even better!',
41
  // 'price' => '$27',
42
  // 'author' => 'FooPlugins',
43
- // 'author_url' => 'http://fooplugins.com',
44
  // 'thumbnail' => '/assets/extension_bg.png',
45
  // 'tags' => array( 'premium', 'lightbox', ),
46
  // 'source' => 'fooplugins',
@@ -48,7 +48,7 @@ if ( ! class_exists( 'FooGallery_Extension' ) ) {
48
  // array(
49
  // 'text' => 'Buy - $27',
50
  // 'target' => '_blank',
51
- // 'href' => 'http://fooplugins.com/plugins/foobox',
52
  // 'confirm' => false,
53
  // ),
54
  // 'activated_by_default' => true,
40
  // 'description' => 'The best lightbox for WordPress just got even better!',
41
  // 'price' => '$27',
42
  // 'author' => 'FooPlugins',
43
+ // 'author_url' => 'https://fooplugins.com',
44
  // 'thumbnail' => '/assets/extension_bg.png',
45
  // 'tags' => array( 'premium', 'lightbox', ),
46
  // 'source' => 'fooplugins',
48
  // array(
49
  // 'text' => 'Buy - $27',
50
  // 'target' => '_blank',
51
+ // 'href' => 'https://fooplugins.com/plugins/foobox',
52
  // 'confirm' => false,
53
  // ),
54
  // 'activated_by_default' => true,
includes/extensions/class-extensions-api.php CHANGED
@@ -143,7 +143,7 @@ if ( ! class_exists( 'FooGallery_Extensions_API' ) ) {
143
  'description' => 'Group your galleries into albums. Boom!',
144
  'html' => 'Group your galleries into albums. Boom!',
145
  'author' => 'FooPlugins',
146
- 'author_url' => 'http://fooplugins.com',
147
  'thumbnail' => '/extensions/albums/foogallery-albums.png',
148
  'tags' => array( 'functionality' ),
149
  'source' => 'bundled'
@@ -159,7 +159,7 @@ if ( ! class_exists( 'FooGallery_Extensions_API' ) ) {
159
  'description' => 'The best lightbox for WordPress just got even better!',
160
  'price' => '$27',
161
  'author' => 'FooPlugins',
162
- 'author_url' => 'http://fooplugins.com',
163
  'thumbnail' => '/assets/extension_bg.png',
164
  'tags' => array( 'premium', 'lightbox', ),
165
  'source' => 'fooplugins',
@@ -167,7 +167,7 @@ if ( ! class_exists( 'FooGallery_Extensions_API' ) ) {
167
  array(
168
  'text' => 'Buy - $27',
169
  'target' => '_blank',
170
- 'href' => 'http://fooplugins.com/plugins/foobox',
171
  'confirm' => false,
172
  ),
173
  'activated_by_default' => true,
@@ -184,7 +184,7 @@ if ( ! class_exists( 'FooGallery_Extensions_API' ) ) {
184
  'title' => 'FooBox FREE',
185
  'description' => 'The best lightbox for WordPress. Free',
186
  'author' => 'FooPlugins',
187
- 'author_url' => 'http://fooplugins.com',
188
  'thumbnail' => '/assets/extension_bg.png',
189
  'tags' => array( 'lightbox' ),
190
  'source' => 'repo',
@@ -200,7 +200,7 @@ if ( ! class_exists( 'FooGallery_Extensions_API' ) ) {
200
  'title' => 'NextGen Importer',
201
  'description' => 'Imports all your existing NextGen galleries',
202
  'author' => 'FooPlugins',
203
- 'author_url' => 'http://fooplugins.com',
204
  'thumbnail' => '/assets/extension_bg.png',
205
  'tags' => array( 'tools' ),
206
  'source' => 'bundled',
143
  'description' => 'Group your galleries into albums. Boom!',
144
  'html' => 'Group your galleries into albums. Boom!',
145
  'author' => 'FooPlugins',
146
+ 'author_url' => 'https://fooplugins.com',
147
  'thumbnail' => '/extensions/albums/foogallery-albums.png',
148
  'tags' => array( 'functionality' ),
149
  'source' => 'bundled'
159
  'description' => 'The best lightbox for WordPress just got even better!',
160
  'price' => '$27',
161
  'author' => 'FooPlugins',
162
+ 'author_url' => 'https://fooplugins.com',
163
  'thumbnail' => '/assets/extension_bg.png',
164
  'tags' => array( 'premium', 'lightbox', ),
165
  'source' => 'fooplugins',
167
  array(
168
  'text' => 'Buy - $27',
169
  'target' => '_blank',
170
+ 'href' => 'https://fooplugins.com/foobox',
171
  'confirm' => false,
172
  ),
173
  'activated_by_default' => true,
184
  'title' => 'FooBox FREE',
185
  'description' => 'The best lightbox for WordPress. Free',
186
  'author' => 'FooPlugins',
187
+ 'author_url' => 'https://fooplugins.com',
188
  'thumbnail' => '/assets/extension_bg.png',
189
  'tags' => array( 'lightbox' ),
190
  'source' => 'repo',
200
  'title' => 'NextGen Importer',
201
  'description' => 'Imports all your existing NextGen galleries',
202
  'author' => 'FooPlugins',
203
+ 'author_url' => 'https://fooplugins.com',
204
  'thumbnail' => '/assets/extension_bg.png',
205
  'tags' => array( 'tools' ),
206
  'source' => 'bundled',
includes/foopluginbase/bootstrapper.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * Version: 2.1
7
  * Author: Brad Vincent
8
- * Author URI: http://fooplugins.com
9
  * License: GPL2
10
  */
11
 
5
  *
6
  * Version: 2.1
7
  * Author: Brad Vincent
8
+ * Author URI: https://fooplugins.com
9
  * License: GPL2
10
  */
11
 
includes/foopluginbase/classes/class-foo-plugin-base.php CHANGED
@@ -9,7 +9,7 @@
9
  *
10
  * Version: 2.4
11
  * Author: Brad Vincent
12
- * Author URI: http://fooplugins.com
13
  * License: GPL2
14
  */
15
 
9
  *
10
  * Version: 2.4
11
  * Author: Brad Vincent
12
+ * Author URI: https://fooplugins.com
13
  * License: GPL2
14
  */
15
 
includes/functions.php CHANGED
@@ -497,13 +497,7 @@ function foogallery_build_container_data_options( $gallery, $attributes )
497
  $gallery,
498
  $attributes
499
  );
500
-
501
- if ( defined( 'JSON_UNESCAPED_UNICODE' ) ) {
502
- return json_encode( $options, JSON_UNESCAPED_UNICODE );
503
- } else {
504
- return json_encode( $options );
505
- }
506
-
507
  }
508
 
509
  /**
@@ -1503,3 +1497,65 @@ function foogallery_is_pro()
1503
  $pro = false;
1504
  return $pro;
1505
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
497
  $gallery,
498
  $attributes
499
  );
500
+ return foogallery_json_encode( $options );
 
 
 
 
 
 
501
  }
502
 
503
  /**
1497
  $pro = false;
1498
  return $pro;
1499
  }
1500
+
1501
+ /**
1502
+ * Safe function for encoding objects to json which accounts for JSON_UNESCAPED_UNICODE
1503
+ *
1504
+ * @param $value
1505
+ *
1506
+ * @return false|string
1507
+ */
1508
+ function foogallery_json_encode( $value )
1509
+ {
1510
+
1511
+ if ( defined( 'JSON_UNESCAPED_UNICODE' ) ) {
1512
+ return json_encode( $value, JSON_UNESCAPED_UNICODE );
1513
+ } else {
1514
+ return json_encode( $value );
1515
+ }
1516
+
1517
+ }
1518
+
1519
+ /**
1520
+ * Get a language array entry which gets a value from settings
1521
+ * @param $setting_key
1522
+ * @param $default
1523
+ *
1524
+ * @return string|false
1525
+ */
1526
+ function foogallery_get_language_array_value( $setting_key, $default )
1527
+ {
1528
+ $setting_value = foogallery_get_setting( $setting_key, $default );
1529
+ if ( empty($setting_value) ) {
1530
+ $setting_value = $default;
1531
+ }
1532
+ if ( $default !== $setting_value ) {
1533
+ return $setting_value;
1534
+ }
1535
+ return false;
1536
+ }
1537
+
1538
+ /**
1539
+ * Returns a formatted date
1540
+ *
1541
+ * @param $timestamp
1542
+ * @param string $format
1543
+ *
1544
+ * @return string
1545
+ */
1546
+ function foogallery_format_date( $timestamp, $format = null )
1547
+ {
1548
+ if ( !$format ) {
1549
+ $format = get_option( 'date_format' );
1550
+ }
1551
+
1552
+ if ( function_exists( 'wp_date' ) ) {
1553
+ return wp_date( $format, $timestamp );
1554
+ } else {
1555
+ $datetime = date_create( '@' . $timestamp );
1556
+ $timezone = wp_timezone();
1557
+ $datetime->setTimezone( $timezone );
1558
+ return $datetime->format( $format );
1559
+ }
1560
+
1561
+ }
includes/includes.php CHANGED
@@ -89,3 +89,4 @@ if ( is_admin() ) {
89
 
90
  require_once( FOOGALLERY_PATH . 'includes/public/class-shortcodes.php' );
91
  require_once( FOOGALLERY_PATH . 'includes/class-gallery-advanced-settings.php' );
 
89
 
90
  require_once( FOOGALLERY_PATH . 'includes/public/class-shortcodes.php' );
91
  require_once( FOOGALLERY_PATH . 'includes/class-gallery-advanced-settings.php' );
92
+ require_once( FOOGALLERY_PATH . 'includes/class-il8n.php' );
includes/public/class-aioseo-sitemaps.php CHANGED
@@ -9,10 +9,68 @@ if ( ! class_exists( 'FooGallery_All_In_One_Seo_Sitemap_Support' ) ) {
9
  class FooGallery_All_In_One_Seo_Sitemap_Support {
10
 
11
  function __construct() {
12
- add_filter( 'aiosp_sitemap_prio_item_filter', array( $this, 'add_images_to_sitemap' ), 10, 3 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  }
14
 
15
- function add_images_to_sitemap( $pr_info, $post, $args ) {
 
 
 
 
 
 
 
 
 
16
  //check the content for $post_id contains a foogallery shortcode
17
 
18
  $images = array();
9
  class FooGallery_All_In_One_Seo_Sitemap_Support {
10
 
11
  function __construct() {
12
+ //version 4+
13
+ add_filter( 'aioseo_sitemap_posts', array( $this, 'add_images_to_sitemap' ), 10, 2 );
14
+
15
+ //pre version 4
16
+ add_filter( 'aiosp_sitemap_prio_item_filter', array( $this, 'add_images_to_sitemap_old' ), 10, 3 );
17
+ }
18
+
19
+ /**
20
+ * Add sitemap entries for AIOSEO v4+
21
+ *
22
+ * @param $entries
23
+ * @param $post_type
24
+ *
25
+ * @return mixed
26
+ */
27
+ function add_images_to_sitemap( $entries, $post_type ) {
28
+ if ( is_array( $entries ) ) {
29
+ foreach ( $entries as &$entry ) {
30
+ $post_permalink = $entry['loc'];
31
+ $post_id = url_to_postid( $post_permalink );
32
+ $images = isset( $entry['images'] ) ? $entry['images'] : array();
33
+ if ( $post_id > 0 ) {
34
+ $galleries = get_post_meta( $post_id, FOOGALLERY_META_POST_USAGE );
35
+ if ( is_array( $galleries ) ) {
36
+ foreach ( $galleries as $gallery_id ) {
37
+
38
+ //load each gallery
39
+ $gallery = FooGallery::get_by_id( $gallery_id );
40
+
41
+ if ( false === $gallery ) {
42
+ continue;
43
+ }
44
+
45
+ //add each image to the sitemap image array
46
+ foreach ( $gallery->attachments() as $attachment ) {
47
+ $images[] = (object) array(
48
+ 'image:loc' => $attachment->url,
49
+ 'image:caption' => $attachment->alt,
50
+ 'image:title' => $attachment->caption,
51
+ );
52
+ }
53
+ }
54
+
55
+ $entry['images'] = $images;
56
+ }
57
+ }
58
+ }
59
+ }
60
+
61
+ return $entries;
62
  }
63
 
64
+ /**
65
+ * Add images to the sitemap for AIOSEO before version 4
66
+ *
67
+ * @param $pr_info
68
+ * @param $post
69
+ * @param $args
70
+ *
71
+ * @return mixed
72
+ */
73
+ function add_images_to_sitemap_old( $pr_info, $post, $args ) {
74
  //check the content for $post_id contains a foogallery shortcode
75
 
76
  $images = array();
includes/render-functions.php CHANGED
@@ -524,11 +524,7 @@ function foogallery_build_json_from_attachment( $foogallery_attachment, $args =
524
 
525
  $json_object = foogallery_build_json_object_from_attachment( $foogallery_attachment, $args );
526
 
527
- if ( defined( 'JSON_UNESCAPED_UNICODE' ) ) {
528
- return json_encode( $json_object, JSON_UNESCAPED_UNICODE );
529
- } else {
530
- return json_encode( $json_object );
531
- }
532
  }
533
 
534
  return '';
524
 
525
  $json_object = foogallery_build_json_object_from_attachment( $foogallery_attachment, $args );
526
 
527
+ return foogallery_json_encode( $json_object );
 
 
 
 
528
  }
529
 
530
  return '';
js/admin-foogallery-attachment-autosave.js CHANGED
@@ -1,11 +1,24 @@
1
  (function($, view){
2
 
3
- var EXCLUDE_SELECTOR = '.foogallery-attachment-ignore-change';
 
4
 
5
  // hold reference to the original prototype so we can call it's methods
6
  var original = view.AttachmentCompat.prototype;
7
  // replace the wp.media.view.AttachmentCompat with our own which allows us to filter fields from the auto-save
8
  view.AttachmentCompat = view.AttachmentCompat.extend({
 
 
 
 
 
 
 
 
 
 
 
 
9
  /**
10
  * @summary Called when the view is ready so we can bind events etc.
11
  * @description We override the original here so we can hook into the controllers "close" event. The controller
1
  (function($, view){
2
 
3
+ var EXCLUDE_SELECTOR = '.foogallery-attachment-ignore-change',
4
+ SELECTIZE_SELECTOR = '.foogallery-attachment-selectize';
5
 
6
  // hold reference to the original prototype so we can call it's methods
7
  var original = view.AttachmentCompat.prototype;
8
  // replace the wp.media.view.AttachmentCompat with our own which allows us to filter fields from the auto-save
9
  view.AttachmentCompat = view.AttachmentCompat.extend({
10
+ render : function() {
11
+ var result = original.render.apply( this, arguments );
12
+
13
+ if ( !!result ) {
14
+ //we have a valid result and should run our code
15
+ var $selectizeInputs = result.$el.find(SELECTIZE_SELECTOR);
16
+ $selectizeInputs.each( function() {
17
+ FOOGALLERY_SELECTIZE( this );
18
+ } );
19
+ }
20
+ },
21
+
22
  /**
23
  * @summary Called when the view is ready so we can bind events etc.
24
  * @description We override the original here so we can hook into the controllers "close" event. The controller
js/{admin-foogallery.js → admin-foogallery-edit.js} RENAMED
File without changes
js/foogallery.admin.min.js CHANGED
@@ -1,6 +1,6 @@
1
  /*
2
  * FooGallery - The Most Intuitive and Extensible Gallery Creation and Management Tool Ever Created for WordPress
3
- * @version 1.4.24
4
  * @link
5
  * @copyright Steven Usher & Brad Vincent 2015
6
  * @license Released under the GPLv3 license.
1
  /*
2
  * FooGallery - The Most Intuitive and Extensible Gallery Creation and Management Tool Ever Created for WordPress
3
+ * @version 1.4.26
4
  * @link
5
  * @copyright Steven Usher & Brad Vincent 2015
6
  * @license Released under the GPLv3 license.
lib/selectize/foogallery.selectize.js CHANGED
@@ -1,5 +1,6 @@
1
- var FOOGALLERY_SELECTIZE = function(id, taxonomy) {
2
- var $selectize = jQuery(id),
 
3
  taxonomy_data = window.FOOGALLERY_TAXONOMY_DATA[taxonomy],
4
  options = [];
5
 
1
+ var FOOGALLERY_SELECTIZE = function(element) {
2
+ var $selectize = jQuery(element),
3
+ taxonomy = $selectize.data('taxonomy'),
4
  taxonomy_data = window.FOOGALLERY_TAXONOMY_DATA[taxonomy],
5
  options = [];
6
 
wpml-config.xml CHANGED
@@ -4,6 +4,24 @@
4
  <key name="language_filtering_all"/>
5
  <key name="language_paging_loadmore_text"/>
6
  <key name="language_back_to_album_text"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  </key>
8
  </admin-texts>
9
  </wpml-config>
4
  <key name="language_filtering_all"/>
5
  <key name="language_paging_loadmore_text"/>
6
  <key name="language_back_to_album_text"/>
7
+ <key name="language_imageviewer_prev_text"/>
8
+ <key name="language_imageviewer_next_text"/>
9
+ <key name="language_imageviewer_of_text"/>
10
+ <key name="language_paging_current"/>
11
+ <key name="language_paging_page"/>
12
+ <key name="language_paging_first_text"/>
13
+ <key name="language_paging_prev_text"/>
14
+ <key name="language_paging_next_text"/>
15
+ <key name="language_paging_last_text"/>
16
+ <key name="language_paging_prev_more_text"/>
17
+ <key name="language_paging_next_more_text"/>
18
+ <key name="exif_aperture_text"/>
19
+ <key name="exif_camera_text"/>
20
+ <key name="exif_date_text"/>
21
+ <key name="exif_exposure_text"/>
22
+ <key name="exif_focal_length_text"/>
23
+ <key name="exif_iso_text"/>
24
+ <key name="exif_orientation_text"/>
25
  </key>
26
  </admin-texts>
27
  </wpml-config>