j1-template 2021.0.4 → 2021.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/modules/navigator/generator.html +6 -6
  3. data/_includes/themes/j1/modules/navigator/procedures/topsearch.proc +1 -1
  4. data/_layouts/raw.html +1 -1
  5. data/assets/data/fam.html +1 -1
  6. data/assets/data/gallery_customizer.html +1 -1
  7. data/assets/data/mdi_icons.json +69582 -14640
  8. data/assets/data/mmenu_toc.html +1 -1
  9. data/assets/themes/j1/adapter/js/fam.js +2 -2
  10. data/assets/themes/j1/core/css/animate.min.css +1 -7
  11. data/assets/themes/j1/core/css/icon-fonts/fontawesome.css +3 -10
  12. data/assets/themes/j1/core/css/icon-fonts/fontawesome.min.css +1 -1
  13. data/assets/themes/j1/core/css/icon-fonts/materialdesign.css +12505 -4812
  14. data/assets/themes/j1/core/css/icon-fonts/materialdesign.min.css +1 -1
  15. data/assets/themes/j1/core/css/icon-fonts/twemoji.min.css +1 -1
  16. data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.css +79 -49
  17. data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.min.css +1 -6
  18. data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.css +78 -48
  19. data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.min.css +1 -6
  20. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.css +102 -50
  21. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css +1 -8
  22. data/assets/themes/j1/core/css/vendor.css +2 -2
  23. data/assets/themes/j1/core/css/vendor.min.css +1 -1
  24. data/assets/themes/j1/core/fonts/{materialdesign_icons/fonts → material_design_icons/fonts/_versions/v3.3.92}/eot/materialdesignicons-webfont.eot +0 -0
  25. data/assets/themes/j1/core/fonts/{materialdesign_icons/fonts → material_design_icons/fonts/_versions/v3.3.92}/materialdesignicons-webfont.woff +0 -0
  26. data/assets/themes/j1/core/fonts/{materialdesign_icons/fonts → material_design_icons/fonts/_versions/v3.3.92}/materialdesignicons-webfont.woff2 +0 -0
  27. data/assets/themes/j1/core/fonts/{materialdesign_icons/fonts → material_design_icons/fonts/_versions/v3.3.92}/svg/materialdesignicons-webfont.svg +0 -0
  28. data/assets/themes/j1/core/fonts/{materialdesign_icons/fonts → material_design_icons/fonts/_versions/v3.3.92}/ttf/materialdesignicons-webfont.ttf +0 -0
  29. data/assets/themes/j1/core/fonts/material_design_icons/fonts/_versions/v5.9.55/eot/materialdesignicons-webfont.eot +0 -0
  30. data/assets/themes/j1/core/fonts/material_design_icons/fonts/_versions/v5.9.55/materialdesignicons-webfont.woff +0 -0
  31. data/assets/themes/j1/core/fonts/material_design_icons/fonts/_versions/v5.9.55/materialdesignicons-webfont.woff2 +0 -0
  32. data/assets/themes/j1/core/fonts/material_design_icons/fonts/_versions/v5.9.55/preview.html +717 -0
  33. data/assets/themes/j1/core/fonts/material_design_icons/fonts/_versions/v5.9.55/svg/materialdesignicons-webfont.svg +10188 -0
  34. data/assets/themes/j1/core/fonts/material_design_icons/fonts/_versions/v5.9.55/ttf/materialdesignicons-webfont.ttf +0 -0
  35. data/assets/themes/j1/core/fonts/material_design_icons/fonts/eot/materialdesignicons-webfont.eot +0 -0
  36. data/assets/themes/j1/core/fonts/material_design_icons/fonts/materialdesignicons-webfont.woff +0 -0
  37. data/assets/themes/j1/core/fonts/material_design_icons/fonts/materialdesignicons-webfont.woff2 +0 -0
  38. data/assets/themes/j1/core/fonts/material_design_icons/fonts/svg/materialdesignicons-webfont.svg +10188 -0
  39. data/assets/themes/j1/core/fonts/material_design_icons/fonts/ttf/materialdesignicons-webfont.ttf +0 -0
  40. data/assets/themes/j1/core/fonts/{materialdesign_icons → material_design_icons}/metadata/icons.json +0 -0
  41. data/assets/themes/j1/core/fonts/{materialdesign_icons → material_design_icons}/metadata/icons.yml +0 -0
  42. data/assets/themes/j1/core/js/template.min.js +23 -1
  43. data/assets/themes/j1/modules/jquery/js/jquery-3.5.1.min.map +1 -0
  44. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.8.0/css/justifiedGallery.css +110 -0
  45. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.8.0/css/justifiedGallery.min.css +110 -0
  46. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.8.0/js/jquery.justifiedGallery.js +1245 -0
  47. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.8.0/js/jquery.justifiedGallery.min.js +8 -0
  48. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.8.0/justifiedGallery.min.zip +0 -0
  49. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.8.0/justifiedGallery.zip +0 -0
  50. data/assets/themes/j1/modules/justifiedGallery/css/_archived/justifiedGallery.css +110 -0
  51. data/assets/themes/j1/modules/justifiedGallery/css/_archived/justifiedGallery.min.css +110 -0
  52. data/assets/themes/j1/modules/justifiedGallery/css/justifiedGallery.css +11 -10
  53. data/assets/themes/j1/modules/justifiedGallery/css/justifiedGallery.min.css +3 -106
  54. data/assets/themes/j1/modules/justifiedGallery/js/justifiedGallery.js +147 -146
  55. data/assets/themes/j1/modules/justifiedGallery/js/justifiedGallery.min.js +3 -3
  56. data/assets/themes/j1/modules/lightGallery/js/core/lightgallery.min.js +1 -2
  57. data/assets/themes/j1/modules/lightbox/js/lightbox.js +1 -1
  58. data/assets/themes/j1/modules/lunrSearch/js/quicksearch.min.js +1 -1
  59. data/assets/themes/j1/modules/mdiPreviewer/css/previewer.css +20 -5
  60. data/assets/themes/j1/modules/mdiPreviewer/css/previewer.min.css +1 -1
  61. data/assets/themes/j1/modules/mdiPreviewer/js/previewer.js +115 -0
  62. data/assets/themes/j1/modules/mdiPreviewer/js/previewer.min.js +15 -0
  63. data/assets/themes/j1/modules/mdiPreviewer/js/previewer.new.js +111 -0
  64. data/assets/themes/j1/modules/mdiPreviewer/js/previewer.old.js +103 -0
  65. data/assets/themes/j1/modules/mmenuLight/js/mmenu.js +2 -2
  66. data/assets/themes/j1/modules/mmenuLight/js/mmenu.min.js +3 -3
  67. data/assets/themes/j1/modules/twemoji/css/picker/twemoji-picker.css +4 -4
  68. data/assets/themes/j1/modules/twemoji/css/picker/twemoji-picker.min.css +1 -1
  69. data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.js +46 -45
  70. data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.min.js +1 -1
  71. data/lib/j1/version.rb +1 -1
  72. data/lib/starter_web/Gemfile +18 -17
  73. data/lib/starter_web/_config.yml +3 -3
  74. data/lib/starter_web/_data/apps/light_gallery.yml +1 -1
  75. data/lib/starter_web/_data/j1_config.yml +3 -3
  76. data/lib/starter_web/_data/modules/defaults/quicksearch.yml +13 -4
  77. data/lib/starter_web/_data/modules/navigator_menu.yml +2 -64
  78. data/lib/starter_web/_data/resources.yml +3 -26
  79. data/lib/starter_web/_includes/attributes.asciidoc +276 -90
  80. data/lib/starter_web/_includes/tables/jekyll_variables.asciidoc +1 -1
  81. data/lib/starter_web/_includes/tables/template_variables.asciidoc +1 -1
  82. data/lib/starter_web/_plugins/lunr_index.rb +20 -1
  83. data/lib/starter_web/_plugins/minifyJS.rb +3 -0
  84. data/lib/starter_web/assets/images/modules/attics/machine-generator-1920x1280.jpg +0 -0
  85. data/lib/starter_web/assets/images/modules/attics/modules-apps-1920x1280.jpg +0 -0
  86. data/lib/starter_web/assets/images/modules/attics/no-time-1920x1280.jpg +0 -0
  87. data/lib/starter_web/assets/images/modules/attics/responsive-text-1920x1280.jpg +0 -0
  88. data/lib/starter_web/assets/images/modules/icons/d1/scalable/d1.svg +1 -1
  89. data/lib/starter_web/assets/images/pages/panels/modules-apps-1920x800.jpg +0 -0
  90. data/lib/starter_web/assets/images/pages/panels/no-time-1920x800.jpg +0 -0
  91. data/lib/starter_web/assets/images/pages/panels/the-place-1920x800.jpg +0 -0
  92. data/lib/starter_web/assets/images/pages/roundtrip/600_quicksearch/quicksearch_icon-800x200.jpg +0 -0
  93. data/lib/starter_web/assets/images/pages/roundtrip/600_quicksearch/quicksearch_icon.jpg +0 -0
  94. data/lib/starter_web/assets/images/pages/roundtrip/600_quicksearch/quicksearch_input-800x200.jpg +0 -0
  95. data/lib/starter_web/assets/images/pages/roundtrip/600_quicksearch/quicksearch_input.jpg +0 -0
  96. data/lib/starter_web/assets/images/pages/roundtrip/600_quicksearch/quicksearch_results_jekyll-.jpg +0 -0
  97. data/lib/starter_web/assets/images/pages/roundtrip/600_quicksearch/quicksearch_results_jekyll.jpg +0 -0
  98. data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1-template.adoc.erb +10 -13
  99. data/lib/starter_web/collections/posts/public/featured/_posts/{2018-05-01-confusion-about-base-url.adoc → 2020-04-01-confusion-about-base-url.adoc} +6 -4
  100. data/lib/starter_web/collections/posts/public/featured/_posts/{2019-05-01-top-open-source-static-site-generators.adoc → 2020-05-01-top-open-source-static-site-generators.adoc} +15 -13
  101. data/lib/starter_web/collections/posts/public/featured/_posts/{2019-06-01-about-cookies.adoc → 2020-06-01-about-cookies.adoc} +9 -23
  102. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-test-series.adoc +6 -17
  103. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-test-series.adoc +6 -16
  104. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-test-series.adoc +6 -16
  105. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-04-post-test-series.adoc +6 -16
  106. data/{assets/themes/j1/modules/mdiPreviewer/js → lib/starter_web/collections/posts/public/series/_posts/_includes/documents}/readme +0 -0
  107. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-20-minneapolis.adoc +5 -4
  108. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc +13 -3
  109. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-26-columbia-river.adoc +13 -3
  110. data/lib/starter_web/favicon.ico +0 -0
  111. data/lib/starter_web/index.html +1 -1
  112. data/lib/starter_web/package.json +3 -3
  113. data/lib/starter_web/pages/public/about/about_site.adoc +1827 -9
  114. data/lib/starter_web/pages/public/about/become_a_patron.adoc +26 -1
  115. data/lib/starter_web/pages/public/blog/navigator/archive.html +2 -0
  116. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +3 -1
  117. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +2 -0
  118. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +2 -0
  119. data/lib/starter_web/pages/public/blog/navigator/index.html +2 -0
  120. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/100_meet_and_greet_jekyll.adoc +3 -3
  121. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +6 -2
  122. data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +2 -3
  123. data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +1 -1
  124. data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +5 -4
  125. data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +1 -1
  126. data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +1 -1
  127. data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +1 -1
  128. data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +39 -19
  129. data/lib/starter_web/pages/public/learn/roundtrip/600_quicksearch.adoc +417 -0
  130. data/lib/starter_web/pages/public/learn/roundtrip/610_fam.adoc +2 -2
  131. data/lib/starter_web/pages/public/learn/roundtrip/_includes/attributes.asciidoc +3 -0
  132. data/lib/starter_web/pages/public/learn/where_to_go.adoc +1 -1
  133. data/lib/starter_web/pages/public/legal/en/000_copyright.adoc +1 -1
  134. data/lib/starter_web/pages/public/legal/en/100_impress.adoc +1 -1
  135. data/lib/starter_web/pages/public/legal/en/200_terms_of_use.adoc +1 -1
  136. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +1 -1
  137. data/lib/starter_web/pages/public/legal/en/400_license_agreement.adoc +1 -1
  138. data/lib/starter_web/pages/public/legal/en/500_support.adoc +1 -1
  139. data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +16 -5
  140. data/lib/starter_web/pages/public/previewer/_includes/attributes.asciidoc +5 -81
  141. data/lib/starter_web/pages/public/previewer/_includes/documents/rouge/100_language_examples.asciidoc +119 -0
  142. data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/100_absolute_sizes.asciidoc +1 -1
  143. data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/110_bs_grid_sizes.asciidoc +1 -1
  144. data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/120_relative_sizes.asciidoc +1 -1
  145. data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/200_rotate.asciidoc +1 -1
  146. data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/300_flip.asciidoc +1 -1
  147. data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/400_spin_pulsed.asciidoc +4 -4
  148. data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/500_bw_color_palette.asciidoc +1 -1
  149. data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/510_bs_color_palette.asciidoc +1 -1
  150. data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/600_md_color_palette.asciidoc +1 -1
  151. data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/601_md_color_palette_indigo.asciidoc +1 -1
  152. data/lib/starter_web/pages/public/previewer/_includes/tables/mdi_icons/602_md_color_palette_pink.asciidoc +1 -1
  153. data/lib/starter_web/pages/public/previewer/_includes/tables/rouge/200_rouge_attributes.asciidoc +41 -0
  154. data/lib/starter_web/pages/public/previewer/_includes/tables/rouge/300_supported_languages.asciidoc +857 -0
  155. data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/100_bs_sizes.asciidoc +1 -1
  156. data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/100_relative_sizes.asciidoc +1 -1
  157. data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/200_rotate.asciidoc +1 -1
  158. data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/300_flip.asciidoc +1 -1
  159. data/lib/starter_web/pages/public/previewer/_includes/tables/twitter_emoji/400_spin_pulsed.asciidoc +1 -1
  160. data/lib/starter_web/pages/public/previewer/bootstrap_theme.adoc +116 -78
  161. data/lib/starter_web/pages/public/previewer/iframer.adoc +1 -1
  162. data/lib/starter_web/pages/public/previewer/justified_gallery.html +1 -1
  163. data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +41 -108
  164. data/lib/starter_web/pages/public/previewer/rouge.adoc +38 -353
  165. data/lib/starter_web/pages/public/previewer/twitter_emoji_preview.adoc +2 -2
  166. data/lib/starter_web/utilsrv/_defaults/package.json +2 -2
  167. data/lib/starter_web/utilsrv/package.json +3 -3
  168. metadata +58 -22
  169. data/lib/starter_web/_plugins/simple_search_filter.rb +0 -32
  170. data/lib/starter_web/collections/posts/public/featured/_posts/_includes/documents/unsplash-badge.asciidoc +0 -31
  171. data/lib/starter_web/collections/posts/public/series/_posts/_includes/documents/100-docker-using-shared-folders.asciidoc +0 -430
  172. data/lib/starter_web/collections/posts/public/series/_posts/_includes/documents/loop.sh +0 -28
  173. data/lib/starter_web/pages/public/learn/roundtrip/600_lunr.adoc +0 -335
@@ -0,0 +1,8 @@
1
+ /*!
2
+ * justifiedGallery - v3.8.0
3
+ * http://miromannino.github.io/Justified-Gallery/
4
+ * Copyright (c) 2020 Miro Mannino
5
+ * Licensed under the MIT license.
6
+ */
7
+
8
+ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(t,i){return void 0===i&&(i="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(i),i}:e(jQuery)}(function(l){var r=function(t,i){this.settings=i,this.checkSettings(),this.imgAnalyzerTimeout=null,this.entries=null,this.buildingRow={entriesBuff:[],width:0,height:0,aspectRatio:0},this.lastFetchedEntry=null,this.lastAnalyzedIndex=-1,this.yield={every:2,flushed:0},this.border=0<=i.border?i.border:i.margins,this.maxRowHeight=this.retrieveMaxRowHeight(),this.suffixRanges=this.retrieveSuffixRanges(),this.offY=this.border,this.rows=0,this.spinner={phase:0,timeSlot:150,$el:l('<div class="jg-spinner"><span></span><span></span><span></span></div>'),intervalId:null},this.scrollBarOn=!1,this.checkWidthIntervalId=null,this.galleryWidth=t.width(),this.$gallery=t};r.prototype.getSuffix=function(t,i){var e,s;for(e=i<t?t:i,s=0;s<this.suffixRanges.length;s++)if(e<=this.suffixRanges[s])return this.settings.sizeRangeSuffixes[this.suffixRanges[s]];return this.settings.sizeRangeSuffixes[this.suffixRanges[s-1]]},r.prototype.removeSuffix=function(t,i){return t.substring(0,t.length-i.length)},r.prototype.endsWith=function(t,i){return-1!==t.indexOf(i,t.length-i.length)},r.prototype.getUsedSuffix=function(t){for(var i in this.settings.sizeRangeSuffixes)if(this.settings.sizeRangeSuffixes.hasOwnProperty(i)){if(0===this.settings.sizeRangeSuffixes[i].length)continue;if(this.endsWith(t,this.settings.sizeRangeSuffixes[i]))return this.settings.sizeRangeSuffixes[i]}return""},r.prototype.newSrc=function(t,i,e,s){var n;if(this.settings.thumbnailPath)n=this.settings.thumbnailPath(t,i,e,s);else{var r=t.match(this.settings.extension),o=null!==r?r[0]:"";n=t.replace(this.settings.extension,""),n=this.removeSuffix(n,this.getUsedSuffix(n)),n+=this.getSuffix(i,e)+o}return n},r.prototype.showImg=function(t,i){this.settings.cssAnimation?(t.addClass("jg-entry-visible"),i&&i()):(t.stop().fadeTo(this.settings.imagesAnimationDuration,1,i),t.find(this.settings.imgSelector).stop().fadeTo(this.settings.imagesAnimationDuration,1,i))},r.prototype.extractImgSrcFromImage=function(t){var i=t.data("safe-src"),e="data-safe-src";return void 0===i&&(i=t.attr("src"),e="src"),t.data("jg.originalSrc",i),t.data("jg.src",i),t.data("jg.originalSrcLoc",e),i},r.prototype.imgFromEntry=function(t){var i=t.find(this.settings.imgSelector);return 0===i.length?null:i},r.prototype.captionFromEntry=function(t){var i=t.find("> .jg-caption");return 0===i.length?null:i},r.prototype.displayEntry=function(t,i,e,s,n,r){t.width(s),t.height(r),t.css("top",e),t.css("left",i);var o=this.imgFromEntry(t);if(null!==o){o.css("width",s),o.css("height",n),o.css("margin-left",-Math.round(s/2)),o.css("margin-top",-Math.round(n/2));var a=o.data("jg.src");if(a){a=this.newSrc(a,s,n,o[0]),o.one("error",function(){this.resetImgSrc(o)});var h=function(){o.attr("src",a)};"skipped"===t.data("jg.loaded")&&a?this.onImageEvent(a,function(){this.showImg(t,h),t.data("jg.loaded",!0)}.bind(this)):this.showImg(t,h)}}else this.showImg(t);this.displayEntryCaption(t)},r.prototype.displayEntryCaption=function(t){var i=this.imgFromEntry(t);if(null!==i&&this.settings.captions){var e=this.captionFromEntry(t);if(null===e){var s=i.attr("alt");this.isValidCaption(s)||(s=t.attr("title")),this.isValidCaption(s)&&(e=l('<div class="jg-caption">'+s+"</div>"),t.append(e),t.data("jg.createdCaption",!0))}null!==e&&(this.settings.cssAnimation||e.stop().fadeTo(0,this.settings.captionSettings.nonVisibleOpacity),this.addCaptionEventsHandlers(t))}else this.removeCaptionEventsHandlers(t)},r.prototype.isValidCaption=function(t){return void 0!==t&&0<t.length},r.prototype.onEntryMouseEnterForCaption=function(t){var i=this.captionFromEntry(l(t.currentTarget));this.settings.cssAnimation?i.addClass("jg-caption-visible").removeClass("jg-caption-hidden"):i.stop().fadeTo(this.settings.captionSettings.animationDuration,this.settings.captionSettings.visibleOpacity)},r.prototype.onEntryMouseLeaveForCaption=function(t){var i=this.captionFromEntry(l(t.currentTarget));this.settings.cssAnimation?i.removeClass("jg-caption-visible").removeClass("jg-caption-hidden"):i.stop().fadeTo(this.settings.captionSettings.animationDuration,this.settings.captionSettings.nonVisibleOpacity)},r.prototype.addCaptionEventsHandlers=function(t){var i=t.data("jg.captionMouseEvents");void 0===i&&(i={mouseenter:l.proxy(this.onEntryMouseEnterForCaption,this),mouseleave:l.proxy(this.onEntryMouseLeaveForCaption,this)},t.on("mouseenter",void 0,void 0,i.mouseenter),t.on("mouseleave",void 0,void 0,i.mouseleave),t.data("jg.captionMouseEvents",i))},r.prototype.removeCaptionEventsHandlers=function(t){var i=t.data("jg.captionMouseEvents");void 0!==i&&(t.off("mouseenter",void 0,i.mouseenter),t.off("mouseleave",void 0,i.mouseleave),t.removeData("jg.captionMouseEvents"))},r.prototype.clearBuildingRow=function(){this.buildingRow.entriesBuff=[],this.buildingRow.aspectRatio=0,this.buildingRow.width=0},r.prototype.prepareBuildingRow=function(t,i){var e,s,n,r,o,a=!0,h=0,g=this.galleryWidth-2*this.border-(this.buildingRow.entriesBuff.length-1)*this.settings.margins,l=g/this.buildingRow.aspectRatio,u=this.settings.rowHeight,d=this.buildingRow.width/g>this.settings.justifyThreshold;if(i||t&&"hide"===this.settings.lastRow&&!d){for(e=0;e<this.buildingRow.entriesBuff.length;e++)s=this.buildingRow.entriesBuff[e],this.settings.cssAnimation?s.removeClass("jg-entry-visible"):(s.stop().fadeTo(0,.1),s.find("> img, > a > img").fadeTo(0,0));return-1}for(t&&!d&&"justify"!==this.settings.lastRow&&"hide"!==this.settings.lastRow&&(a=!1,0<this.rows&&(a=(u=(this.offY-this.border-this.settings.margins*this.rows)/this.rows)*this.buildingRow.aspectRatio/g>this.settings.justifyThreshold)),e=0;e<this.buildingRow.entriesBuff.length;e++)n=(s=this.buildingRow.entriesBuff[e]).data("jg.width")/s.data("jg.height"),o=a?(r=e===this.buildingRow.entriesBuff.length-1?g:l*n,l):(r=u*n,u),g-=Math.round(r),s.data("jg.jwidth",Math.round(r)),s.data("jg.jheight",Math.ceil(o)),(0===e||o<h)&&(h=o);return this.buildingRow.height=h,a},r.prototype.flushRow=function(t,i){var e,s,n,r=this.settings,o=this.border;if(s=this.prepareBuildingRow(t,i),i||t&&"hide"===r.lastRow&&-1===s)this.clearBuildingRow();else{if(this.maxRowHeight&&this.maxRowHeight<this.buildingRow.height&&(this.buildingRow.height=this.maxRowHeight),t&&("center"===r.lastRow||"right"===r.lastRow)){var a=this.galleryWidth-2*this.border-(this.buildingRow.entriesBuff.length-1)*r.margins;for(n=0;n<this.buildingRow.entriesBuff.length;n++)a-=(e=this.buildingRow.entriesBuff[n]).data("jg.jwidth");"center"===r.lastRow?o+=Math.round(a/2):"right"===r.lastRow&&(o+=a)}var h=this.buildingRow.entriesBuff.length-1;for(n=0;n<=h;n++)e=this.buildingRow.entriesBuff[this.settings.rtl?h-n:n],this.displayEntry(e,o,this.offY,e.data("jg.jwidth"),e.data("jg.jheight"),this.buildingRow.height),o+=e.data("jg.jwidth")+r.margins;this.galleryHeightToSet=this.offY+this.buildingRow.height+this.border,this.setGalleryTempHeight(this.galleryHeightToSet+this.getSpinnerHeight()),(!t||this.buildingRow.height<=r.rowHeight&&s)&&(this.offY+=this.buildingRow.height+r.margins,this.rows+=1,this.clearBuildingRow(),this.settings.triggerEvent.call(this,"jg.rowflush"))}};var i=0;r.prototype.rememberGalleryHeight=function(){i=this.$gallery.height(),this.$gallery.height(i)},r.prototype.setGalleryTempHeight=function(t){i=Math.max(t,i),this.$gallery.height(i)},r.prototype.setGalleryFinalHeight=function(t){i=t,this.$gallery.height(t)},r.prototype.checkWidth=function(){this.checkWidthIntervalId=setInterval(l.proxy(function(){if(this.$gallery.is(":visible")){var t=parseFloat(this.$gallery.width());Math.abs(t-this.galleryWidth)>this.settings.refreshSensitivity&&(this.galleryWidth=t,this.rewind(),this.rememberGalleryHeight(),this.startImgAnalyzer(!0))}},this),this.settings.refreshTime)},r.prototype.isSpinnerActive=function(){return null!==this.spinner.intervalId},r.prototype.getSpinnerHeight=function(){return this.spinner.$el.innerHeight()},r.prototype.stopLoadingSpinnerAnimation=function(){clearInterval(this.spinner.intervalId),this.spinner.intervalId=null,this.setGalleryTempHeight(this.$gallery.height()-this.getSpinnerHeight()),this.spinner.$el.detach()},r.prototype.startLoadingSpinnerAnimation=function(){var t=this.spinner,i=t.$el.find("span");clearInterval(t.intervalId),this.$gallery.append(t.$el),this.setGalleryTempHeight(this.offY+this.buildingRow.height+this.getSpinnerHeight()),t.intervalId=setInterval(function(){t.phase<i.length?i.eq(t.phase).fadeTo(t.timeSlot,1):i.eq(t.phase-i.length).fadeTo(t.timeSlot,0),t.phase=(t.phase+1)%(2*i.length)},t.timeSlot)},r.prototype.rewind=function(){this.lastFetchedEntry=null,this.lastAnalyzedIndex=-1,this.offY=this.border,this.rows=0,this.clearBuildingRow()},r.prototype.getSelectorWithoutSpinner=function(){return this.settings.selector+", div:not(.jg-spinner)"},r.prototype.getAllEntries=function(){var t=this.getSelectorWithoutSpinner();return this.$gallery.children(t).toArray()},r.prototype.updateEntries=function(t){var i;if(t&&null!=this.lastFetchedEntry){var e=this.getSelectorWithoutSpinner();i=l(this.lastFetchedEntry).nextAll(e).toArray()}else this.entries=[],i=this.getAllEntries();return 0<i.length&&(l.isFunction(this.settings.sort)?i=this.sortArray(i):this.settings.randomize&&(i=this.shuffleArray(i)),this.lastFetchedEntry=i[i.length-1],this.settings.filter?i=this.filterArray(i):this.resetFilters(i)),this.entries=this.entries.concat(i),!0},r.prototype.insertToGallery=function(t){var i=this;l.each(t,function(){l(this).appendTo(i.$gallery)})},r.prototype.shuffleArray=function(t){var i,e,s;for(i=t.length-1;0<i;i--)e=Math.floor(Math.random()*(i+1)),s=t[i],t[i]=t[e],t[e]=s;return this.insertToGallery(t),t},r.prototype.sortArray=function(t){return t.sort(this.settings.sort),this.insertToGallery(t),t},r.prototype.resetFilters=function(t){for(var i=0;i<t.length;i++)l(t[i]).removeClass("jg-filtered")},r.prototype.filterArray=function(t){var e=this.settings;if("string"===l.type(e.filter))return t.filter(function(t){var i=l(t);return i.is(e.filter)?(i.removeClass("jg-filtered"),!0):(i.addClass("jg-filtered").removeClass("jg-visible"),!1)});if(l.isFunction(e.filter)){for(var i=t.filter(e.filter),s=0;s<t.length;s++)-1===i.indexOf(t[s])?l(t[s]).addClass("jg-filtered").removeClass("jg-visible"):l(t[s]).removeClass("jg-filtered");return i}},r.prototype.resetImgSrc=function(t){"src"===t.data("jg.originalSrcLoc")?t.attr("src",t.data("jg.originalSrc")):t.attr("src","")},r.prototype.destroy=function(){clearInterval(this.checkWidthIntervalId),this.stopImgAnalyzerStarter(),l.each(this.getAllEntries(),l.proxy(function(t,i){var e=l(i);e.css("width",""),e.css("height",""),e.css("top",""),e.css("left",""),e.data("jg.loaded",void 0),e.removeClass("jg-entry jg-filtered jg-entry-visible");var s=this.imgFromEntry(e);s&&(s.css("width",""),s.css("height",""),s.css("margin-left",""),s.css("margin-top",""),this.resetImgSrc(s),s.data("jg.originalSrc",void 0),s.data("jg.originalSrcLoc",void 0),s.data("jg.src",void 0)),this.removeCaptionEventsHandlers(e);var n=this.captionFromEntry(e);e.data("jg.createdCaption")?(e.data("jg.createdCaption",void 0),null!==n&&n.remove()):null!==n&&n.fadeTo(0,1)},this)),this.$gallery.css("height",""),this.$gallery.removeClass("justified-gallery"),this.$gallery.data("jg.controller",void 0),this.settings.triggerEvent.call(this,"jg.destroy")},r.prototype.analyzeImages=function(t){for(var i=this.lastAnalyzedIndex+1;i<this.entries.length;i++){var e=l(this.entries[i]);if(!0===e.data("jg.loaded")||"skipped"===e.data("jg.loaded")){var s=this.galleryWidth-2*this.border-(this.buildingRow.entriesBuff.length-1)*this.settings.margins,n=e.data("jg.width")/e.data("jg.height");if(this.buildingRow.entriesBuff.push(e),this.buildingRow.aspectRatio+=n,this.buildingRow.width+=n*this.settings.rowHeight,this.lastAnalyzedIndex=i,s/(this.buildingRow.aspectRatio+n)<this.settings.rowHeight&&(this.flushRow(!1,0<this.settings.maxRowsCount&&this.rows===this.settings.maxRowsCount),++this.yield.flushed>=this.yield.every))return void this.startImgAnalyzer(t)}else if("error"!==e.data("jg.loaded"))return}0<this.buildingRow.entriesBuff.length&&this.flushRow(!0,0<this.settings.maxRowsCount&&this.rows===this.settings.maxRowsCount),this.isSpinnerActive()&&this.stopLoadingSpinnerAnimation(),this.stopImgAnalyzerStarter(),this.setGalleryFinalHeight(this.galleryHeightToSet),this.settings.triggerEvent.call(this,t?"jg.resize":"jg.complete")},r.prototype.stopImgAnalyzerStarter=function(){this.yield.flushed=0,null!==this.imgAnalyzerTimeout&&(clearTimeout(this.imgAnalyzerTimeout),this.imgAnalyzerTimeout=null)},r.prototype.startImgAnalyzer=function(t){var i=this;this.stopImgAnalyzerStarter(),this.imgAnalyzerTimeout=setTimeout(function(){i.analyzeImages(t)},.001)},r.prototype.onImageEvent=function(t,i,e){if(i||e){var s=new Image,n=l(s);i&&n.one("load",function(){n.off("load error"),i(s)}),e&&n.one("error",function(){n.off("load error"),e(s)}),s.src=t}},r.prototype.init=function(){var a=!1,h=!1,g=this;l.each(this.entries,function(t,i){var e=l(i),s=g.imgFromEntry(e);if(e.addClass("jg-entry"),!0!==e.data("jg.loaded")&&"skipped"!==e.data("jg.loaded"))if(null!==g.settings.rel&&e.attr("rel",g.settings.rel),null!==g.settings.target&&e.attr("target",g.settings.target),null!==s){var n=g.extractImgSrcFromImage(s);if(!1===g.settings.waitThumbnailsLoad||!n){var r=parseFloat(s.attr("width")),o=parseFloat(s.attr("height"));if("svg"===s.prop("tagName")&&(r=parseFloat(s[0].getBBox().width),o=parseFloat(s[0].getBBox().height)),!isNaN(r)&&!isNaN(o))return e.data("jg.width",r),e.data("jg.height",o),e.data("jg.loaded","skipped"),h=!0,g.startImgAnalyzer(!1),!0}e.data("jg.loaded",!1),a=!0,g.isSpinnerActive()||g.startLoadingSpinnerAnimation(),g.onImageEvent(n,function(t){e.data("jg.width",t.width),e.data("jg.height",t.height),e.data("jg.loaded",!0),g.startImgAnalyzer(!1)},function(){e.data("jg.loaded","error"),g.startImgAnalyzer(!1)})}else e.data("jg.loaded",!0),e.data("jg.width",e.width()|parseFloat(e.css("width"))|1),e.data("jg.height",e.height()|parseFloat(e.css("height"))|1)}),a||h||this.startImgAnalyzer(!1),this.checkWidth()},r.prototype.checkOrConvertNumber=function(t,i){if("string"===l.type(t[i])&&(t[i]=parseFloat(t[i])),"number"!==l.type(t[i]))throw i+" must be a number";if(isNaN(t[i]))throw"invalid number for "+i},r.prototype.checkSizeRangesSuffixes=function(){if("object"!==l.type(this.settings.sizeRangeSuffixes))throw"sizeRangeSuffixes must be defined and must be an object";var t=[];for(var i in this.settings.sizeRangeSuffixes)this.settings.sizeRangeSuffixes.hasOwnProperty(i)&&t.push(i);for(var e={0:""},s=0;s<t.length;s++)if("string"===l.type(t[s]))try{e[parseInt(t[s].replace(/^[a-z]+/,""),10)]=this.settings.sizeRangeSuffixes[t[s]]}catch(t){throw"sizeRangeSuffixes keys must contains correct numbers ("+t+")"}else e[t[s]]=this.settings.sizeRangeSuffixes[t[s]];this.settings.sizeRangeSuffixes=e},r.prototype.retrieveMaxRowHeight=function(){var t=null,i=this.settings.rowHeight;if("string"===l.type(this.settings.maxRowHeight))t=this.settings.maxRowHeight.match(/^[0-9]+%$/)?i*parseFloat(this.settings.maxRowHeight.match(/^([0-9]+)%$/)[1])/100:parseFloat(this.settings.maxRowHeight);else{if("number"!==l.type(this.settings.maxRowHeight)){if(!1===this.settings.maxRowHeight||null==this.settings.maxRowHeight)return null;throw"maxRowHeight must be a number or a percentage"}t=this.settings.maxRowHeight}if(isNaN(t))throw"invalid number for maxRowHeight";return t<i&&(t=i),t},r.prototype.checkSettings=function(){this.checkSizeRangesSuffixes(),this.checkOrConvertNumber(this.settings,"rowHeight"),this.checkOrConvertNumber(this.settings,"margins"),this.checkOrConvertNumber(this.settings,"border"),this.checkOrConvertNumber(this.settings,"maxRowsCount");var t=["justify","nojustify","left","center","right","hide"];if(-1===t.indexOf(this.settings.lastRow))throw"lastRow must be one of: "+t.join(", ");if(this.checkOrConvertNumber(this.settings,"justifyThreshold"),this.settings.justifyThreshold<0||1<this.settings.justifyThreshold)throw"justifyThreshold must be in the interval [0,1]";if("boolean"!==l.type(this.settings.cssAnimation))throw"cssAnimation must be a boolean";if("boolean"!==l.type(this.settings.captions))throw"captions must be a boolean";if(this.checkOrConvertNumber(this.settings.captionSettings,"animationDuration"),this.checkOrConvertNumber(this.settings.captionSettings,"visibleOpacity"),this.settings.captionSettings.visibleOpacity<0||1<this.settings.captionSettings.visibleOpacity)throw"captionSettings.visibleOpacity must be in the interval [0, 1]";if(this.checkOrConvertNumber(this.settings.captionSettings,"nonVisibleOpacity"),this.settings.captionSettings.nonVisibleOpacity<0||1<this.settings.captionSettings.nonVisibleOpacity)throw"captionSettings.nonVisibleOpacity must be in the interval [0, 1]";if(this.checkOrConvertNumber(this.settings,"imagesAnimationDuration"),this.checkOrConvertNumber(this.settings,"refreshTime"),this.checkOrConvertNumber(this.settings,"refreshSensitivity"),"boolean"!==l.type(this.settings.randomize))throw"randomize must be a boolean";if("string"!==l.type(this.settings.selector))throw"selector must be a string";if(!1!==this.settings.sort&&!l.isFunction(this.settings.sort))throw"sort must be false or a comparison function";if(!1!==this.settings.filter&&!l.isFunction(this.settings.filter)&&"string"!==l.type(this.settings.filter))throw"filter must be false, a string or a filter function"},r.prototype.retrieveSuffixRanges=function(){var t=[];for(var i in this.settings.sizeRangeSuffixes)this.settings.sizeRangeSuffixes.hasOwnProperty(i)&&t.push(parseInt(i,10));return t.sort(function(t,i){return i<t?1:t<i?-1:0}),t},r.prototype.updateSettings=function(t){this.settings=l.extend({},this.settings,t),this.checkSettings(),this.border=0<=this.settings.border?this.settings.border:this.settings.margins,this.maxRowHeight=this.retrieveMaxRowHeight(),this.suffixRanges=this.retrieveSuffixRanges()},r.prototype.defaults={sizeRangeSuffixes:{},thumbnailPath:void 0,rowHeight:120,maxRowHeight:!1,maxRowsCount:0,margins:1,border:-1,lastRow:"nojustify",justifyThreshold:.9,waitThumbnailsLoad:!0,captions:!0,cssAnimation:!0,imagesAnimationDuration:500,captionSettings:{animationDuration:500,visibleOpacity:.7,nonVisibleOpacity:0},rel:null,target:null,extension:/\.[^.\\/]+$/,refreshTime:200,refreshSensitivity:0,randomize:!1,rtl:!1,sort:!1,filter:!1,selector:"a",imgSelector:"> img, > a > img, > svg, > a > svg",triggerEvent:function(t){this.$gallery.trigger(t)}},l.fn.justifiedGallery=function(n){return this.each(function(t,i){var e=l(i);e.addClass("justified-gallery");var s=e.data("jg.controller");if(void 0===s){if(null!=n&&"object"!==l.type(n)){if("destroy"===n)return;throw"The argument must be an object"}s=new r(e,l.extend({},r.prototype.defaults,n)),e.data("jg.controller",s)}else if("norewind"===n);else{if("destroy"===n)return void s.destroy();s.updateSettings(n),s.rewind()}s.updateEntries("norewind"===n)&&s.init()})}});
@@ -0,0 +1,110 @@
1
+ /*!
2
+ * justifiedGallery - v4.0.0-alpha
3
+ * http://miromannino.github.io/Justified-Gallery/
4
+ * Copyright (c) 2019 Miro Mannino
5
+ * Licensed under the MIT license.
6
+ */
7
+ .justified-gallery {
8
+ width: 100%;
9
+ position: relative;
10
+ overflow: hidden;
11
+ }
12
+ .justified-gallery > a,
13
+ .justified-gallery > div,
14
+ .justified-gallery > figure {
15
+ position: absolute;
16
+ display: inline-block;
17
+ overflow: hidden;
18
+ /* background: #888888; To have gray placeholders while the gallery is loading with waitThumbnailsLoad = false */
19
+ filter: "alpha(opacity=10)";
20
+ opacity: 0.1;
21
+ margin: 0;
22
+ padding: 0;
23
+ }
24
+ .justified-gallery > a > img,
25
+ .justified-gallery > div > img,
26
+ .justified-gallery > figure > img,
27
+ .justified-gallery > a > a > img,
28
+ .justified-gallery > div > a > img,
29
+ .justified-gallery > figure > a > img,
30
+ .justified-gallery > a > svg,
31
+ .justified-gallery > div > svg,
32
+ .justified-gallery > figure > svg,
33
+ .justified-gallery > a > a > svg,
34
+ .justified-gallery > div > a > svg,
35
+ .justified-gallery > figure > a > svg {
36
+ position: absolute;
37
+ top: 50%;
38
+ left: 50%;
39
+ margin: 0;
40
+ padding: 0;
41
+ border: none;
42
+ filter: "alpha(opacity=0)";
43
+ opacity: 0;
44
+ }
45
+ .justified-gallery > a > .caption,
46
+ .justified-gallery > div > .caption,
47
+ .justified-gallery > figure > .caption {
48
+ display: none;
49
+ position: absolute;
50
+ bottom: 0;
51
+ padding: 5px;
52
+ background-color: #000000;
53
+ left: 0;
54
+ right: 0;
55
+ margin: 0;
56
+ color: white;
57
+ font-size: 12px;
58
+ font-weight: 300;
59
+ font-family: sans-serif;
60
+ }
61
+ .justified-gallery > a > .caption.caption-visible,
62
+ .justified-gallery > div > .caption.caption-visible,
63
+ .justified-gallery > figure > .caption.caption-visible {
64
+ display: initial;
65
+ filter: "alpha(opacity=70)";
66
+ opacity: 0.7;
67
+ -webkit-transition: opacity 500ms ease-in;
68
+ -moz-transition: opacity 500ms ease-in;
69
+ -o-transition: opacity 500ms ease-in;
70
+ transition: opacity 500ms ease-in;
71
+ }
72
+ .justified-gallery > .jg-entry-visible {
73
+ filter: "alpha(opacity=100)";
74
+ opacity: 1;
75
+ background: none;
76
+ }
77
+ .justified-gallery > .jg-entry-visible > img,
78
+ .justified-gallery > .jg-entry-visible > a > img,
79
+ .justified-gallery > .jg-entry-visible > svg,
80
+ .justified-gallery > .jg-entry-visible > a > svg {
81
+ filter: "alpha(opacity=100)";
82
+ opacity: 1;
83
+ -webkit-transition: opacity 500ms ease-in;
84
+ -moz-transition: opacity 500ms ease-in;
85
+ -o-transition: opacity 500ms ease-in;
86
+ transition: opacity 500ms ease-in;
87
+ }
88
+ .justified-gallery > .jg-filtered {
89
+ display: none;
90
+ }
91
+ .justified-gallery > .spinner {
92
+ position: absolute;
93
+ bottom: 0;
94
+ margin-left: -24px;
95
+ padding: 10px 0 10px 0;
96
+ left: 50%;
97
+ filter: "alpha(opacity=100)";
98
+ opacity: 1;
99
+ overflow: initial;
100
+ }
101
+ .justified-gallery > .spinner > span {
102
+ display: inline-block;
103
+ filter: "alpha(opacity=0)";
104
+ opacity: 0;
105
+ width: 8px;
106
+ height: 8px;
107
+ margin: 0 4px 0 4px;
108
+ background-color: #000;
109
+ border-radius: 6px;
110
+ }
@@ -0,0 +1,110 @@
1
+ /*!
2
+ * justifiedGallery - v4.0.0-alpha
3
+ * http://miromannino.github.io/Justified-Gallery/
4
+ * Copyright (c) 2019 Miro Mannino
5
+ * Licensed under the MIT license.
6
+ */
7
+ .justified-gallery {
8
+ width: 100%;
9
+ position: relative;
10
+ overflow: hidden;
11
+ }
12
+ .justified-gallery > a,
13
+ .justified-gallery > div,
14
+ .justified-gallery > figure {
15
+ position: absolute;
16
+ display: inline-block;
17
+ overflow: hidden;
18
+ /* background: #888888; To have gray placeholders while the gallery is loading with waitThumbnailsLoad = false */
19
+ filter: "alpha(opacity=10)";
20
+ opacity: 0.1;
21
+ margin: 0;
22
+ padding: 0;
23
+ }
24
+ .justified-gallery > a > img,
25
+ .justified-gallery > div > img,
26
+ .justified-gallery > figure > img,
27
+ .justified-gallery > a > a > img,
28
+ .justified-gallery > div > a > img,
29
+ .justified-gallery > figure > a > img,
30
+ .justified-gallery > a > svg,
31
+ .justified-gallery > div > svg,
32
+ .justified-gallery > figure > svg,
33
+ .justified-gallery > a > a > svg,
34
+ .justified-gallery > div > a > svg,
35
+ .justified-gallery > figure > a > svg {
36
+ position: absolute;
37
+ top: 50%;
38
+ left: 50%;
39
+ margin: 0;
40
+ padding: 0;
41
+ border: none;
42
+ filter: "alpha(opacity=0)";
43
+ opacity: 0;
44
+ }
45
+ .justified-gallery > a > .caption,
46
+ .justified-gallery > div > .caption,
47
+ .justified-gallery > figure > .caption {
48
+ display: none;
49
+ position: absolute;
50
+ bottom: 0;
51
+ padding: 5px;
52
+ background-color: #000000;
53
+ left: 0;
54
+ right: 0;
55
+ margin: 0;
56
+ color: white;
57
+ font-size: 12px;
58
+ font-weight: 300;
59
+ font-family: sans-serif;
60
+ }
61
+ .justified-gallery > a > .caption.caption-visible,
62
+ .justified-gallery > div > .caption.caption-visible,
63
+ .justified-gallery > figure > .caption.caption-visible {
64
+ display: initial;
65
+ filter: "alpha(opacity=70)";
66
+ opacity: 0.7;
67
+ -webkit-transition: opacity 500ms ease-in;
68
+ -moz-transition: opacity 500ms ease-in;
69
+ -o-transition: opacity 500ms ease-in;
70
+ transition: opacity 500ms ease-in;
71
+ }
72
+ .justified-gallery > .jg-entry-visible {
73
+ filter: "alpha(opacity=100)";
74
+ opacity: 1;
75
+ background: none;
76
+ }
77
+ .justified-gallery > .jg-entry-visible > img,
78
+ .justified-gallery > .jg-entry-visible > a > img,
79
+ .justified-gallery > .jg-entry-visible > svg,
80
+ .justified-gallery > .jg-entry-visible > a > svg {
81
+ filter: "alpha(opacity=100)";
82
+ opacity: 1;
83
+ -webkit-transition: opacity 500ms ease-in;
84
+ -moz-transition: opacity 500ms ease-in;
85
+ -o-transition: opacity 500ms ease-in;
86
+ transition: opacity 500ms ease-in;
87
+ }
88
+ .justified-gallery > .jg-filtered {
89
+ display: none;
90
+ }
91
+ .justified-gallery > .spinner {
92
+ position: absolute;
93
+ bottom: 0;
94
+ margin-left: -24px;
95
+ padding: 10px 0 10px 0;
96
+ left: 50%;
97
+ filter: "alpha(opacity=100)";
98
+ opacity: 1;
99
+ overflow: initial;
100
+ }
101
+ .justified-gallery > .spinner > span {
102
+ display: inline-block;
103
+ filter: "alpha(opacity=0)";
104
+ opacity: 0;
105
+ width: 8px;
106
+ height: 8px;
107
+ margin: 0 4px 0 4px;
108
+ background-color: #000;
109
+ border-radius: 6px;
110
+ }
@@ -1,9 +1,10 @@
1
1
  /*!
2
- * justifiedGallery - v4.0.0-alpha
2
+ * justifiedGallery - v3.8.1
3
3
  * http://miromannino.github.io/Justified-Gallery/
4
- * Copyright (c) 2019 Miro Mannino
4
+ * Copyright (c) 2020 Miro Mannino
5
5
  * Licensed under the MIT license.
6
6
  */
7
+
7
8
  .justified-gallery {
8
9
  width: 100%;
9
10
  position: relative;
@@ -42,9 +43,9 @@
42
43
  filter: "alpha(opacity=0)";
43
44
  opacity: 0;
44
45
  }
45
- .justified-gallery > a > .caption,
46
- .justified-gallery > div > .caption,
47
- .justified-gallery > figure > .caption {
46
+ .justified-gallery > a > .jg-caption,
47
+ .justified-gallery > div > .jg-caption,
48
+ .justified-gallery > figure > .jg-caption {
48
49
  display: none;
49
50
  position: absolute;
50
51
  bottom: 0;
@@ -58,9 +59,9 @@
58
59
  font-weight: 300;
59
60
  font-family: sans-serif;
60
61
  }
61
- .justified-gallery > a > .caption.caption-visible,
62
- .justified-gallery > div > .caption.caption-visible,
63
- .justified-gallery > figure > .caption.caption-visible {
62
+ .justified-gallery > a > .jg-caption.jg-caption-visible,
63
+ .justified-gallery > div > .jg-caption.jg-caption-visible,
64
+ .justified-gallery > figure > .jg-caption.jg-caption-visible {
64
65
  display: initial;
65
66
  filter: "alpha(opacity=70)";
66
67
  opacity: 0.7;
@@ -88,7 +89,7 @@
88
89
  .justified-gallery > .jg-filtered {
89
90
  display: none;
90
91
  }
91
- .justified-gallery > .spinner {
92
+ .justified-gallery > .jg-spinner {
92
93
  position: absolute;
93
94
  bottom: 0;
94
95
  margin-left: -24px;
@@ -98,7 +99,7 @@
98
99
  opacity: 1;
99
100
  overflow: initial;
100
101
  }
101
- .justified-gallery > .spinner > span {
102
+ .justified-gallery > .jg-spinner > span {
102
103
  display: inline-block;
103
104
  filter: "alpha(opacity=0)";
104
105
  opacity: 0;
@@ -1,110 +1,7 @@
1
1
  /*!
2
- * justifiedGallery - v4.0.0-alpha
2
+ * justifiedGallery - v3.8.1
3
3
  * http://miromannino.github.io/Justified-Gallery/
4
- * Copyright (c) 2019 Miro Mannino
4
+ * Copyright (c) 2020 Miro Mannino
5
5
  * Licensed under the MIT license.
6
6
  */
7
- .justified-gallery {
8
- width: 100%;
9
- position: relative;
10
- overflow: hidden;
11
- }
12
- .justified-gallery > a,
13
- .justified-gallery > div,
14
- .justified-gallery > figure {
15
- position: absolute;
16
- display: inline-block;
17
- overflow: hidden;
18
- /* background: #888888; To have gray placeholders while the gallery is loading with waitThumbnailsLoad = false */
19
- filter: "alpha(opacity=10)";
20
- opacity: 0.1;
21
- margin: 0;
22
- padding: 0;
23
- }
24
- .justified-gallery > a > img,
25
- .justified-gallery > div > img,
26
- .justified-gallery > figure > img,
27
- .justified-gallery > a > a > img,
28
- .justified-gallery > div > a > img,
29
- .justified-gallery > figure > a > img,
30
- .justified-gallery > a > svg,
31
- .justified-gallery > div > svg,
32
- .justified-gallery > figure > svg,
33
- .justified-gallery > a > a > svg,
34
- .justified-gallery > div > a > svg,
35
- .justified-gallery > figure > a > svg {
36
- position: absolute;
37
- top: 50%;
38
- left: 50%;
39
- margin: 0;
40
- padding: 0;
41
- border: none;
42
- filter: "alpha(opacity=0)";
43
- opacity: 0;
44
- }
45
- .justified-gallery > a > .caption,
46
- .justified-gallery > div > .caption,
47
- .justified-gallery > figure > .caption {
48
- display: none;
49
- position: absolute;
50
- bottom: 0;
51
- padding: 5px;
52
- background-color: #000000;
53
- left: 0;
54
- right: 0;
55
- margin: 0;
56
- color: white;
57
- font-size: 12px;
58
- font-weight: 300;
59
- font-family: sans-serif;
60
- }
61
- .justified-gallery > a > .caption.caption-visible,
62
- .justified-gallery > div > .caption.caption-visible,
63
- .justified-gallery > figure > .caption.caption-visible {
64
- display: initial;
65
- filter: "alpha(opacity=70)";
66
- opacity: 0.7;
67
- -webkit-transition: opacity 500ms ease-in;
68
- -moz-transition: opacity 500ms ease-in;
69
- -o-transition: opacity 500ms ease-in;
70
- transition: opacity 500ms ease-in;
71
- }
72
- .justified-gallery > .jg-entry-visible {
73
- filter: "alpha(opacity=100)";
74
- opacity: 1;
75
- background: none;
76
- }
77
- .justified-gallery > .jg-entry-visible > img,
78
- .justified-gallery > .jg-entry-visible > a > img,
79
- .justified-gallery > .jg-entry-visible > svg,
80
- .justified-gallery > .jg-entry-visible > a > svg {
81
- filter: "alpha(opacity=100)";
82
- opacity: 1;
83
- -webkit-transition: opacity 500ms ease-in;
84
- -moz-transition: opacity 500ms ease-in;
85
- -o-transition: opacity 500ms ease-in;
86
- transition: opacity 500ms ease-in;
87
- }
88
- .justified-gallery > .jg-filtered {
89
- display: none;
90
- }
91
- .justified-gallery > .spinner {
92
- position: absolute;
93
- bottom: 0;
94
- margin-left: -24px;
95
- padding: 10px 0 10px 0;
96
- left: 50%;
97
- filter: "alpha(opacity=100)";
98
- opacity: 1;
99
- overflow: initial;
100
- }
101
- .justified-gallery > .spinner > span {
102
- display: inline-block;
103
- filter: "alpha(opacity=0)";
104
- opacity: 0;
105
- width: 8px;
106
- height: 8px;
107
- margin: 0 4px 0 4px;
108
- background-color: #000;
109
- border-radius: 6px;
110
- }
7
+ .justified-gallery{width:100%;position:relative;overflow:hidden}.justified-gallery>a,.justified-gallery>div,.justified-gallery>figure{position:absolute;display:inline-block;overflow:hidden;filter:"alpha(opacity=10)";opacity:.1;margin:0;padding:0}.justified-gallery>a>img,.justified-gallery>div>img,.justified-gallery>figure>img,.justified-gallery>a>a>img,.justified-gallery>div>a>img,.justified-gallery>figure>a>img,.justified-gallery>a>svg,.justified-gallery>div>svg,.justified-gallery>figure>svg,.justified-gallery>a>a>svg,.justified-gallery>div>a>svg,.justified-gallery>figure>a>svg{position:absolute;top:50%;left:50%;margin:0;padding:0;border:0;filter:"alpha(opacity=0)";opacity:0}.justified-gallery>a>.jg-caption,.justified-gallery>div>.jg-caption,.justified-gallery>figure>.jg-caption{display:none;position:absolute;bottom:0;padding:5px;background-color:#000;left:0;right:0;margin:0;color:white;font-size:12px;font-weight:300;font-family:sans-serif}.justified-gallery>a>.jg-caption.jg-caption-visible,.justified-gallery>div>.jg-caption.jg-caption-visible,.justified-gallery>figure>.jg-caption.jg-caption-visible{display:initial;filter:"alpha(opacity=70)";opacity:.7;-webkit-transition:opacity 500ms ease-in;-moz-transition:opacity 500ms ease-in;-o-transition:opacity 500ms ease-in;transition:opacity 500ms ease-in}.justified-gallery>.jg-entry-visible{filter:"alpha(opacity=100)";opacity:1;background:0}.justified-gallery>.jg-entry-visible>img,.justified-gallery>.jg-entry-visible>a>img,.justified-gallery>.jg-entry-visible>svg,.justified-gallery>.jg-entry-visible>a>svg{filter:"alpha(opacity=100)";opacity:1;-webkit-transition:opacity 500ms ease-in;-moz-transition:opacity 500ms ease-in;-o-transition:opacity 500ms ease-in;transition:opacity 500ms ease-in}.justified-gallery>.jg-filtered{display:none}.justified-gallery>.jg-spinner{position:absolute;bottom:0;margin-left:-24px;padding:10px 0 10px 0;left:50%;filter:"alpha(opacity=100)";opacity:1;overflow:initial}.justified-gallery>.jg-spinner>span{display:inline-block;filter:"alpha(opacity=0)";opacity:0;width:8px;height:8px;margin:0 4px 0 4px;background-color:#000;border-radius:6px}
@@ -1,9 +1,10 @@
1
1
  /*!
2
- * justifiedGallery - v4.0.0-alpha
2
+ * justifiedGallery - v3.8.1
3
3
  * http://miromannino.github.io/Justified-Gallery/
4
- * Copyright (c) 2019 Miro Mannino
4
+ * Copyright (c) 2020 Miro Mannino
5
5
  * Licensed under the MIT license.
6
6
  */
7
+
7
8
  (function (factory) {
8
9
  if (typeof define === 'function' && define.amd) {
9
10
  // AMD. Register as an anonymous module.
@@ -40,10 +41,10 @@
40
41
  * @constructor
41
42
  */
42
43
  var JustifiedGallery = function ($gallery, settings) {
43
-
44
+
44
45
  this.settings = settings;
45
46
  this.checkSettings();
46
-
47
+
47
48
  this.imgAnalyzerTimeout = null;
48
49
  this.entries = null;
49
50
  this.buildingRow = {
@@ -73,9 +74,9 @@
73
74
  this.checkWidthIntervalId = null;
74
75
  this.galleryWidth = $gallery.width();
75
76
  this.$gallery = $gallery;
76
-
77
+
77
78
  };
78
-
79
+
79
80
  /** @returns {String} the best suffix given the width and the height */
80
81
  JustifiedGallery.prototype.getSuffix = function (width, height) {
81
82
  var longestSide, i;
@@ -87,7 +88,7 @@
87
88
  }
88
89
  return this.settings.sizeRangeSuffixes[this.suffixRanges[i - 1]];
89
90
  };
90
-
91
+
91
92
  /**
92
93
  * Remove the suffix from the string
93
94
  *
@@ -96,14 +97,14 @@
96
97
  JustifiedGallery.prototype.removeSuffix = function (str, suffix) {
97
98
  return str.substring(0, str.length - suffix.length);
98
99
  };
99
-
100
+
100
101
  /**
101
102
  * @returns {boolean} a boolean to say if the suffix is contained in the str or not
102
103
  */
103
104
  JustifiedGallery.prototype.endsWith = function (str, suffix) {
104
105
  return str.indexOf(suffix, str.length - suffix.length) !== -1;
105
106
  };
106
-
107
+
107
108
  /**
108
109
  * Get the used suffix of a particular url
109
110
  *
@@ -119,7 +120,7 @@
119
120
  }
120
121
  return '';
121
122
  };
122
-
123
+
123
124
  /**
124
125
  * Given an image src, with the width and the height, returns the new image src with the
125
126
  * best suffix to show the best quality thumbnail.
@@ -128,7 +129,7 @@
128
129
  */
129
130
  JustifiedGallery.prototype.newSrc = function (imageSrc, imgWidth, imgHeight, image) {
130
131
  var newImageSrc;
131
-
132
+
132
133
  if (this.settings.thumbnailPath) {
133
134
  newImageSrc = this.settings.thumbnailPath(imageSrc, imgWidth, imgHeight, image);
134
135
  } else {
@@ -138,10 +139,10 @@
138
139
  newImageSrc = this.removeSuffix(newImageSrc, this.getUsedSuffix(newImageSrc));
139
140
  newImageSrc += this.getSuffix(imgWidth, imgHeight) + ext;
140
141
  }
141
-
142
+
142
143
  return newImageSrc;
143
144
  };
144
-
145
+
145
146
  /**
146
147
  * Shows the images that is in the given entry
147
148
  *
@@ -157,7 +158,7 @@
157
158
  $entry.find(this.settings.imgSelector).stop().fadeTo(this.settings.imagesAnimationDuration, 1.0, callback);
158
159
  }
159
160
  };
160
-
161
+
161
162
  /**
162
163
  * Extract the image src form the image, looking from the 'safe-src', and if it can't be found, from the
163
164
  * 'src' attribute. It saves in the image data the 'jg.originalSrc' field, with the extracted src.
@@ -177,19 +178,19 @@
177
178
  $image.data('jg.originalSrcLoc', imageSrcLoc); // this is saved for the destroy method
178
179
  return imageSrc;
179
180
  };
180
-
181
+
181
182
  /** @returns {jQuery} the image in the given entry */
182
183
  JustifiedGallery.prototype.imgFromEntry = function ($entry) {
183
184
  var $img = $entry.find(this.settings.imgSelector);
184
185
  return $img.length === 0 ? null : $img;
185
186
  };
186
-
187
+
187
188
  /** @returns {jQuery} the caption in the given entry */
188
189
  JustifiedGallery.prototype.captionFromEntry = function ($entry) {
189
190
  var $caption = $entry.find('> .caption');
190
191
  return $caption.length === 0 ? null : $caption;
191
192
  };
192
-
193
+
193
194
  /**
194
195
  * Display the entry
195
196
  *
@@ -205,29 +206,29 @@
205
206
  $entry.height(rowHeight);
206
207
  $entry.css('top', y);
207
208
  $entry.css('left', x);
208
-
209
+
209
210
  var $image = this.imgFromEntry($entry);
210
211
  if ($image !== null) {
211
212
  $image.css('width', imgWidth);
212
213
  $image.css('height', imgHeight);
213
214
  $image.css('margin-left', - imgWidth / 2);
214
215
  $image.css('margin-top', - imgHeight / 2);
215
-
216
+
216
217
  // Image reloading for an high quality of thumbnails
217
218
  var imageSrc = $image.data('jg.src');
218
219
  if (imageSrc) {
219
220
  imageSrc = this.newSrc(imageSrc, imgWidth, imgHeight, $image[0]);
220
-
221
+
221
222
  $image.one('error', function () {
222
223
  this.resetImgSrc($image); //revert to the original thumbnail
223
224
  });
224
-
225
+
225
226
  var loadNewImage = function () {
226
- // if (imageSrc !== newImageSrc) {
227
+ // if (imageSrc !== newImageSrc) {
227
228
  $image.attr('src', imageSrc);
228
229
  // }
229
230
  };
230
-
231
+
231
232
  if ($entry.data('jg.loaded') === 'skipped') {
232
233
  this.onImageEvent(imageSrc, (function() {
233
234
  this.showImg($entry, loadNewImage); //load the new image after the fadeIn
@@ -236,16 +237,16 @@
236
237
  } else {
237
238
  this.showImg($entry, loadNewImage); //load the new image after the fadeIn
238
239
  }
239
-
240
+
240
241
  }
241
-
242
+
242
243
  } else {
243
244
  this.showImg($entry);
244
245
  }
245
-
246
+
246
247
  this.displayEntryCaption($entry);
247
248
  };
248
-
249
+
249
250
  /**
250
251
  * Display the entry caption. If the caption element doesn't exists, it creates the caption using the 'alt'
251
252
  * or the 'title' attributes.
@@ -256,7 +257,7 @@
256
257
  var $image = this.imgFromEntry($entry);
257
258
  if ($image !== null && this.settings.captions) {
258
259
  var $imgCaption = this.captionFromEntry($entry);
259
-
260
+
260
261
  // Create it if it doesn't exists
261
262
  if ($imgCaption === null) {
262
263
  var caption = $image.attr('alt');
@@ -267,7 +268,7 @@
267
268
  $entry.data('jg.createdCaption', true);
268
269
  }
269
270
  }
270
-
271
+
271
272
  // Create events (we check again the $imgCaption because it can be still inexistent)
272
273
  if ($imgCaption !== null) {
273
274
  if (!this.settings.cssAnimation) $imgCaption.stop().fadeTo(0, this.settings.captionSettings.nonVisibleOpacity);
@@ -277,7 +278,7 @@
277
278
  this.removeCaptionEventsHandlers($entry);
278
279
  }
279
280
  };
280
-
281
+
281
282
  /**
282
283
  * Validates the caption
283
284
  *
@@ -287,7 +288,7 @@
287
288
  JustifiedGallery.prototype.isValidCaption = function (caption) {
288
289
  return (typeof caption !== 'undefined' && caption.length > 0);
289
290
  };
290
-
291
+
291
292
  /**
292
293
  * The callback for the event 'mouseenter'. It assumes that the event currentTarget is an entry.
293
294
  * It shows the caption using jQuery (or using CSS if it is configured so)
@@ -303,7 +304,7 @@
303
304
  this.settings.captionSettings.visibleOpacity);
304
305
  }
305
306
  };
306
-
307
+
307
308
  /**
308
309
  * The callback for the event 'mouseleave'. It assumes that the event currentTarget is an entry.
309
310
  * It hides the caption using jQuery (or using CSS if it is configured so)
@@ -319,7 +320,7 @@
319
320
  this.settings.captionSettings.nonVisibleOpacity);
320
321
  }
321
322
  };
322
-
323
+
323
324
  /**
324
325
  * Add the handlers of the entry for the caption
325
326
  *
@@ -337,7 +338,7 @@
337
338
  $entry.data('jg.captionMouseEvents', captionMouseEvents);
338
339
  }
339
340
  };
340
-
341
+
341
342
  /**
342
343
  * Remove the handlers of the entry for the caption
343
344
  *
@@ -351,7 +352,7 @@
351
352
  $entry.removeData('jg.captionMouseEvents');
352
353
  }
353
354
  };
354
-
355
+
355
356
  /**
356
357
  * Clear the building row data to be used for a new row
357
358
  */
@@ -360,7 +361,7 @@
360
361
  this.buildingRow.aspectRatio = 0;
361
362
  this.buildingRow.width = 0;
362
363
  };
363
-
364
+
364
365
  /**
365
366
  * Justify the building row, preparing it to
366
367
  *
@@ -375,7 +376,7 @@
375
376
  var rowHeight = availableWidth / this.buildingRow.aspectRatio;
376
377
  var defaultRowHeight = this.settings.rowHeight;
377
378
  var justifiable = this.buildingRow.width / availableWidth > this.settings.justifyThreshold;
378
-
379
+
379
380
  //Skip the last row if we can't justify it and the lastRow == 'hide'
380
381
  if (isLastRow && this.settings.lastRow === 'hide' && !justifiable) {
381
382
  for (i = 0; i < this.buildingRow.entriesBuff.length; i++) {
@@ -389,21 +390,21 @@
389
390
  }
390
391
  return -1;
391
392
  }
392
-
393
+
393
394
  // With lastRow = nojustify, justify if is justificable (the images will not become too big)
394
395
  if (isLastRow && !justifiable && this.settings.lastRow !== 'justify' && this.settings.lastRow !== 'hide') {
395
396
  justify = false;
396
-
397
+
397
398
  if (this.rows > 0) {
398
399
  defaultRowHeight = (this.offY - this.border - this.settings.margins * this.rows) / this.rows;
399
400
  justify = defaultRowHeight * this.buildingRow.aspectRatio / availableWidth > this.settings.justifyThreshold;
400
401
  }
401
402
  }
402
-
403
+
403
404
  for (i = 0; i < this.buildingRow.entriesBuff.length; i++) {
404
405
  $entry = this.buildingRow.entriesBuff[i];
405
406
  imgAspectRatio = $entry.data('jg.width') / $entry.data('jg.height');
406
-
407
+
407
408
  if (justify) {
408
409
  newImgW = (i === this.buildingRow.entriesBuff.length - 1) ? availableWidth : rowHeight * imgAspectRatio;
409
410
  newImgH = rowHeight;
@@ -411,17 +412,17 @@
411
412
  newImgW = defaultRowHeight * imgAspectRatio;
412
413
  newImgH = defaultRowHeight;
413
414
  }
414
-
415
+
415
416
  availableWidth -= Math.round(newImgW);
416
417
  $entry.data('jg.jwidth', Math.round(newImgW));
417
418
  $entry.data('jg.jheight', Math.ceil(newImgH));
418
419
  if (i === 0 || minHeight > newImgH) minHeight = newImgH;
419
420
  }
420
-
421
+
421
422
  this.buildingRow.height = minHeight;
422
423
  return justify;
423
424
  };
424
-
425
+
425
426
  /**
426
427
  * Flush a row: justify it, modify the gallery height accordingly to the row height
427
428
  *
@@ -430,43 +431,43 @@
430
431
  JustifiedGallery.prototype.flushRow = function (isLastRow) {
431
432
  var settings = this.settings;
432
433
  var $entry, buildingRowRes, offX = this.border, i;
433
-
434
+
434
435
  buildingRowRes = this.prepareBuildingRow(isLastRow);
435
436
  if (isLastRow && settings.lastRow === 'hide' && buildingRowRes === -1) {
436
437
  this.clearBuildingRow();
437
438
  return;
438
439
  }
439
-
440
+
440
441
  if(this.maxRowHeight) {
441
442
  if(this.maxRowHeight < this.buildingRow.height) this.buildingRow.height = this.maxRowHeight;
442
443
  }
443
-
444
+
444
445
  //Align last (unjustified) row
445
446
  if (isLastRow && (settings.lastRow === 'center' || settings.lastRow === 'right')) {
446
447
  var availableWidth = this.galleryWidth - 2 * this.border - (this.buildingRow.entriesBuff.length - 1) * settings.margins;
447
-
448
+
448
449
  for (i = 0; i < this.buildingRow.entriesBuff.length; i++) {
449
450
  $entry = this.buildingRow.entriesBuff[i];
450
451
  availableWidth -= $entry.data('jg.jwidth');
451
452
  }
452
-
453
+
453
454
  if (settings.lastRow === 'center')
454
455
  offX += availableWidth / 2;
455
456
  else if (settings.lastRow === 'right')
456
457
  offX += availableWidth;
457
458
  }
458
-
459
+
459
460
  var lastEntryIdx = this.buildingRow.entriesBuff.length - 1;
460
461
  for (i = 0; i <= lastEntryIdx; i++) {
461
462
  $entry = this.buildingRow.entriesBuff[ this.settings.rtl ? lastEntryIdx - i : i ];
462
463
  this.displayEntry($entry, offX, this.offY, $entry.data('jg.jwidth'), $entry.data('jg.jheight'), this.buildingRow.height);
463
464
  offX += $entry.data('jg.jwidth') + settings.margins;
464
465
  }
465
-
466
+
466
467
  //Gallery Height
467
468
  this.galleryHeightToSet = this.offY + this.buildingRow.height + this.border;
468
469
  this.setGalleryTempHeight(this.galleryHeightToSet + this.getSpinnerHeight());
469
-
470
+
470
471
  if (!isLastRow || (this.buildingRow.height <= settings.rowHeight && buildingRowRes)) {
471
472
  //Ready for a new row
472
473
  this.offY += this.buildingRow.height + settings.margins;
@@ -475,63 +476,63 @@
475
476
  this.settings.triggerEvent.call(this, 'jg.rowflush');
476
477
  }
477
478
  };
478
-
479
-
479
+
480
+
480
481
  // Scroll position not restoring: https://github.com/miromannino/Justified-Gallery/issues/221
481
482
  var galleryPrevStaticHeight = 0;
482
-
483
+
483
484
  JustifiedGallery.prototype.rememberGalleryHeight = function () {
484
485
  galleryPrevStaticHeight = this.$gallery.height();
485
486
  this.$gallery.height(galleryPrevStaticHeight);
486
487
  };
487
-
488
+
488
489
  // grow only
489
490
  JustifiedGallery.prototype.setGalleryTempHeight = function (height) {
490
491
  galleryPrevStaticHeight = Math.max(height, galleryPrevStaticHeight);
491
492
  this.$gallery.height(galleryPrevStaticHeight);
492
493
  };
493
-
494
+
494
495
  JustifiedGallery.prototype.setGalleryFinalHeight = function (height) {
495
496
  galleryPrevStaticHeight = height;
496
497
  this.$gallery.height(height);
497
498
  };
498
-
499
+
499
500
  /**
500
501
  * Checks the width of the gallery container, to know if a new justification is needed
501
502
  */
502
503
  JustifiedGallery.prototype.checkWidth = function () {
503
504
  this.checkWidthIntervalId = setInterval($.proxy(function () {
504
-
505
+
505
506
  // if the gallery is not currently visible, abort.
506
507
  if (!this.$gallery.is(":visible")) return;
507
-
508
+
508
509
  var galleryWidth = parseFloat(this.$gallery.width());
509
510
  if (Math.abs(galleryWidth - this.galleryWidth) > this.settings.refreshSensitivity) {
510
511
  this.galleryWidth = galleryWidth;
511
512
  this.rewind();
512
-
513
+
513
514
  this.rememberGalleryHeight();
514
-
515
+
515
516
  // Restart to analyze
516
517
  this.startImgAnalyzer(true);
517
518
  }
518
519
  }, this), this.settings.refreshTime);
519
520
  };
520
-
521
+
521
522
  /**
522
523
  * @returns {boolean} a boolean saying if the spinner is active or not
523
524
  */
524
525
  JustifiedGallery.prototype.isSpinnerActive = function () {
525
526
  return this.spinner.intervalId !== null;
526
527
  };
527
-
528
+
528
529
  /**
529
530
  * @returns {int} the spinner height
530
531
  */
531
532
  JustifiedGallery.prototype.getSpinnerHeight = function () {
532
533
  return this.spinner.$el.innerHeight();
533
534
  };
534
-
535
+
535
536
  /**
536
537
  * Stops the spinner animation and modify the gallery height to exclude the spinner
537
538
  */
@@ -541,7 +542,7 @@
541
542
  this.setGalleryTempHeight(this.$gallery.height() - this.getSpinnerHeight());
542
543
  this.spinner.$el.detach();
543
544
  };
544
-
545
+
545
546
  /**
546
547
  * Starts the spinner animation
547
548
  */
@@ -560,7 +561,7 @@
560
561
  spinnerContext.phase = (spinnerContext.phase + 1) % ($spinnerPoints.length * 2);
561
562
  }, spinnerContext.timeSlot);
562
563
  };
563
-
564
+
564
565
  /**
565
566
  * Rewind the image analysis to start from the first entry.
566
567
  */
@@ -571,14 +572,14 @@
571
572
  this.rows = 0;
572
573
  this.clearBuildingRow();
573
574
  };
574
-
575
+
575
576
  /**
576
577
  * @returns {Array} all entries matched by `settings.selector`
577
578
  */
578
579
  JustifiedGallery.prototype.getAllEntries = function () {
579
580
  return this.$gallery.children(this.settings.selector).toArray();
580
581
  };
581
-
582
+
582
583
  /**
583
584
  * Update the entries searching it from the justified gallery HTML element
584
585
  *
@@ -587,16 +588,16 @@
587
588
  */
588
589
  JustifiedGallery.prototype.updateEntries = function (norewind) {
589
590
  var newEntries;
590
-
591
+
591
592
  if (norewind && this.lastFetchedEntry != null) {
592
593
  newEntries = $(this.lastFetchedEntry).nextAll(this.settings.selector).toArray();
593
594
  } else {
594
595
  this.entries = [];
595
596
  newEntries = this.getAllEntries();
596
597
  }
597
-
598
+
598
599
  if (newEntries.length > 0) {
599
-
600
+
600
601
  // Sort or randomize
601
602
  if ($.isFunction(this.settings.sort)) {
602
603
  newEntries = this.sortArray(newEntries);
@@ -604,20 +605,20 @@
604
605
  newEntries = this.shuffleArray(newEntries);
605
606
  }
606
607
  this.lastFetchedEntry = newEntries[newEntries.length - 1];
607
-
608
+
608
609
  // Filter
609
610
  if (this.settings.filter) {
610
611
  newEntries = this.filterArray(newEntries);
611
612
  } else {
612
613
  this.resetFilters(newEntries);
613
614
  }
614
-
615
+
615
616
  }
616
-
617
+
617
618
  this.entries = this.entries.concat(newEntries);
618
619
  return true;
619
620
  };
620
-
621
+
621
622
  /**
622
623
  * Apply the entries order to the DOM, iterating the entries and appending the images
623
624
  *
@@ -629,7 +630,7 @@
629
630
  $(this).appendTo(that.$gallery);
630
631
  });
631
632
  };
632
-
633
+
633
634
  /**
634
635
  * Shuffle the array using the Fisher-Yates shuffle algorithm
635
636
  *
@@ -647,7 +648,7 @@
647
648
  this.insertToGallery(a);
648
649
  return a;
649
650
  };
650
-
651
+
651
652
  /**
652
653
  * Sort the array using settings.comparator as comparator
653
654
  *
@@ -659,7 +660,7 @@
659
660
  this.insertToGallery(a);
660
661
  return a;
661
662
  };
662
-
663
+
663
664
  /**
664
665
  * Reset the filters removing the 'jg-filtered' class from all the entries
665
666
  *
@@ -668,7 +669,7 @@
668
669
  JustifiedGallery.prototype.resetFilters = function (a) {
669
670
  for (var i = 0; i < a.length; i++) $(a[i]).removeClass('jg-filtered');
670
671
  };
671
-
672
+
672
673
  /**
673
674
  * Filter the entries considering theirs classes (if a string has been passed) or using a function for filtering.
674
675
  *
@@ -702,7 +703,7 @@
702
703
  return filteredArr;
703
704
  }
704
705
  };
705
-
706
+
706
707
  /**
707
708
  * Revert the image src to the default value.
708
709
  */
@@ -713,7 +714,7 @@
713
714
  $img.attr('src', '');
714
715
  }
715
716
  }
716
-
717
+
717
718
  /**
718
719
  * Destroy the Justified Gallery instance.
719
720
  *
@@ -726,11 +727,11 @@
726
727
  JustifiedGallery.prototype.destroy = function () {
727
728
  clearInterval(this.checkWidthIntervalId);
728
729
  this.stopImgAnalyzerStarter();
729
-
730
+
730
731
  // Get fresh entries list since filtered entries are absent in `this.entries`
731
732
  $.each(this.getAllEntries(), $.proxy(function(_, entry) {
732
733
  var $entry = $(entry);
733
-
734
+
734
735
  // Reset entry style
735
736
  $entry.css('width', '');
736
737
  $entry.css('height', '');
@@ -738,7 +739,7 @@
738
739
  $entry.css('left', '');
739
740
  $entry.data('jg.loaded', undefined);
740
741
  $entry.removeClass('jg-entry jg-filtered jg-entry-visible');
741
-
742
+
742
743
  // Reset image style
743
744
  var $img = this.imgFromEntry($entry);
744
745
  if ($img) {
@@ -751,7 +752,7 @@
751
752
  $img.data('jg.originalSrcLoc', undefined);
752
753
  $img.data('jg.src', undefined);
753
754
  }
754
-
755
+
755
756
  // Remove caption
756
757
  this.removeCaptionEventsHandlers($entry);
757
758
  var $caption = this.captionFromEntry($entry);
@@ -762,15 +763,15 @@
762
763
  } else {
763
764
  if ($caption !== null) $caption.fadeTo(0, 1);
764
765
  }
765
-
766
+
766
767
  }, this));
767
-
768
+
768
769
  this.$gallery.css('height', '');
769
770
  this.$gallery.removeClass('justified-gallery');
770
771
  this.$gallery.data('jg.controller', undefined);
771
772
  this.settings.triggerEvent.call(this, 'jg.destroy');
772
773
  };
773
-
774
+
774
775
  /**
775
776
  * Analyze the images and builds the rows. It returns if it found an image that is not loaded.
776
777
  *
@@ -783,15 +784,15 @@
783
784
  var availableWidth = this.galleryWidth - 2 * this.border - (
784
785
  (this.buildingRow.entriesBuff.length - 1) * this.settings.margins);
785
786
  var imgAspectRatio = $entry.data('jg.width') / $entry.data('jg.height');
786
-
787
+
787
788
  this.buildingRow.entriesBuff.push($entry);
788
789
  this.buildingRow.aspectRatio += imgAspectRatio;
789
790
  this.buildingRow.width += imgAspectRatio * this.settings.rowHeight;
790
791
  this.lastAnalyzedIndex = i;
791
-
792
+
792
793
  if (availableWidth / (this.buildingRow.aspectRatio + imgAspectRatio) < this.settings.rowHeight) {
793
794
  this.flushRow(false);
794
-
795
+
795
796
  if(++this.yield.flushed >= this.yield.every) {
796
797
  this.startImgAnalyzer(isForResize);
797
798
  return;
@@ -801,25 +802,25 @@
801
802
  return;
802
803
  }
803
804
  }
804
-
805
+
805
806
  // Last row flush (the row is not full)
806
807
  if (this.buildingRow.entriesBuff.length > 0) this.flushRow(true);
807
-
808
+
808
809
  if (this.isSpinnerActive()) {
809
810
  this.stopLoadingSpinnerAnimation();
810
811
  }
811
-
812
+
812
813
  /* Stop, if there is, the timeout to start the analyzeImages.
813
814
  This is because an image can be set loaded, and the timeout can be set,
814
815
  but this image can be analyzed yet.
815
816
  */
816
817
  this.stopImgAnalyzerStarter();
817
-
818
+
818
819
  //On complete callback
819
820
  this.settings.triggerEvent.call(this, isForResize ? 'jg.resize' : 'jg.complete');
820
821
  this.setGalleryFinalHeight(this.galleryHeightToSet);
821
822
  };
822
-
823
+
823
824
  /**
824
825
  * Stops any ImgAnalyzer starter (that has an assigned timeout)
825
826
  */
@@ -830,7 +831,7 @@
830
831
  this.imgAnalyzerTimeout = null;
831
832
  }
832
833
  };
833
-
834
+
834
835
  /**
835
836
  * Starts the image analyzer. It is not immediately called to let the browser to update the view
836
837
  *
@@ -843,7 +844,7 @@
843
844
  that.analyzeImages(isForResize);
844
845
  }, 0.001); // we can't start it immediately due to a IE different behaviour
845
846
  };
846
-
847
+
847
848
  /**
848
849
  * Checks if the image is loaded or not using another image object. We cannot use the 'complete' image property,
849
850
  * because some browsers, with a 404 set complete = true.
@@ -854,7 +855,7 @@
854
855
  */
855
856
  JustifiedGallery.prototype.onImageEvent = function (imageSrc, onLoad, onError) {
856
857
  if (!onLoad && !onError) return;
857
-
858
+
858
859
  var memImage = new Image();
859
860
  var $memImage = $(memImage);
860
861
  if (onLoad) {
@@ -871,7 +872,7 @@
871
872
  }
872
873
  memImage.src = imageSrc;
873
874
  };
874
-
875
+
875
876
  /**
876
877
  * Init of Justified Gallery controlled
877
878
  * It analyzes all the entries starting theirs loading and calling the image analyzer (that works with loaded images)
@@ -881,23 +882,23 @@
881
882
  $.each(this.entries, function (index, entry) {
882
883
  var $entry = $(entry);
883
884
  var $image = that.imgFromEntry($entry);
884
-
885
+
885
886
  $entry.addClass('jg-entry');
886
-
887
+
887
888
  if ($entry.data('jg.loaded') !== true && $entry.data('jg.loaded') !== 'skipped') {
888
-
889
+
889
890
  // Link Rel global overwrite
890
891
  if (that.settings.rel !== null) $entry.attr('rel', that.settings.rel);
891
-
892
+
892
893
  // Link Target global overwrite
893
894
  if (that.settings.target !== null) $entry.attr('target', that.settings.target);
894
-
895
+
895
896
  if ($image !== null) {
896
-
897
+
897
898
  // Image src
898
899
  var imageSrc = that.extractImgSrcFromImage($image);
899
-
900
- /* If we have the height and the width, we don't wait that the image is loaded,
900
+
901
+ /* If we have the height and the width, we don't wait that the image is loaded,
901
902
  but we start directly with the justification */
902
903
  if (that.settings.waitThumbnailsLoad === false || !imageSrc) {
903
904
  var width = parseFloat($image.attr('width'));
@@ -915,13 +916,13 @@
915
916
  return true; // continue
916
917
  }
917
918
  }
918
-
919
+
919
920
  $entry.data('jg.loaded', false);
920
921
  imagesToLoad = true;
921
-
922
+
922
923
  // Spinner start
923
924
  if (!that.isSpinnerActive()) that.startLoadingSpinnerAnimation();
924
-
925
+
925
926
  that.onImageEvent(imageSrc, function (loadImg) { // image loaded
926
927
  $entry.data('jg.width', loadImg.width);
927
928
  $entry.data('jg.height', loadImg.height);
@@ -931,21 +932,21 @@
931
932
  $entry.data('jg.loaded', 'error');
932
933
  that.startImgAnalyzer(false);
933
934
  });
934
-
935
+
935
936
  } else {
936
937
  $entry.data('jg.loaded', true);
937
938
  $entry.data('jg.width', $entry.width() | parseFloat($entry.css('width')) | 1);
938
939
  $entry.data('jg.height', $entry.height() | parseFloat($entry.css('height')) | 1);
939
940
  }
940
-
941
+
941
942
  }
942
-
943
+
943
944
  });
944
-
945
+
945
946
  if (!imagesToLoad && !skippedImages) this.startImgAnalyzer(false);
946
947
  this.checkWidth();
947
948
  };
948
-
949
+
949
950
  /**
950
951
  * Checks that it is a valid number. If a string is passed it is converted to a number
951
952
  *
@@ -956,14 +957,14 @@
956
957
  if ($.type(settingContainer[settingName]) === 'string') {
957
958
  settingContainer[settingName] = parseFloat(settingContainer[settingName]);
958
959
  }
959
-
960
+
960
961
  if ($.type(settingContainer[settingName]) === 'number') {
961
962
  if (isNaN(settingContainer[settingName])) throw 'invalid number for ' + settingName;
962
963
  } else {
963
964
  throw settingName + ' must be a number';
964
965
  }
965
966
  };
966
-
967
+
967
968
  /**
968
969
  * Checks the sizeRangeSuffixes and, if necessary, converts
969
970
  * its keys from string (e.g. old settings with 'lt100') to int.
@@ -972,12 +973,12 @@
972
973
  if ($.type(this.settings.sizeRangeSuffixes) !== 'object') {
973
974
  throw 'sizeRangeSuffixes must be defined and must be an object';
974
975
  }
975
-
976
+
976
977
  var suffixRanges = [];
977
978
  for (var rangeIdx in this.settings.sizeRangeSuffixes) {
978
979
  if (this.settings.sizeRangeSuffixes.hasOwnProperty(rangeIdx)) suffixRanges.push(rangeIdx);
979
980
  }
980
-
981
+
981
982
  var newSizeRngSuffixes = {0: ''};
982
983
  for (var i = 0; i < suffixRanges.length; i++) {
983
984
  if ($.type(suffixRanges[i]) === 'string') {
@@ -991,10 +992,10 @@
991
992
  newSizeRngSuffixes[suffixRanges[i]] = this.settings.sizeRangeSuffixes[suffixRanges[i]];
992
993
  }
993
994
  }
994
-
995
+
995
996
  this.settings.sizeRangeSuffixes = newSizeRngSuffixes;
996
997
  };
997
-
998
+
998
999
  /**
999
1000
  * check and convert the maxRowHeight setting
1000
1001
  * requires rowHeight to be already set
@@ -1004,7 +1005,7 @@
1004
1005
  JustifiedGallery.prototype.retrieveMaxRowHeight = function () {
1005
1006
  var newMaxRowHeight = null;
1006
1007
  var rowHeight = this.settings.rowHeight;
1007
-
1008
+
1008
1009
  if ($.type(this.settings.maxRowHeight) === 'string') {
1009
1010
  if (this.settings.maxRowHeight.match(/^[0-9]+%$/)) {
1010
1011
  newMaxRowHeight = rowHeight * parseFloat(this.settings.maxRowHeight.match(/^([0-9]+)%$/)[1]) / 100;
@@ -1018,26 +1019,26 @@
1018
1019
  } else {
1019
1020
  throw 'maxRowHeight must be a number or a percentage';
1020
1021
  }
1021
-
1022
+
1022
1023
  // check if the converted value is not a number
1023
1024
  if (isNaN(newMaxRowHeight)) throw 'invalid number for maxRowHeight';
1024
-
1025
+
1025
1026
  // check values, maxRowHeight must be >= rowHeight
1026
1027
  if (newMaxRowHeight < rowHeight) newMaxRowHeight = rowHeight;
1027
-
1028
+
1028
1029
  return newMaxRowHeight;
1029
1030
  };
1030
-
1031
+
1031
1032
  /**
1032
1033
  * Checks the settings
1033
1034
  */
1034
1035
  JustifiedGallery.prototype.checkSettings = function () {
1035
1036
  this.checkSizeRangesSuffixes();
1036
-
1037
+
1037
1038
  this.checkOrConvertNumber(this.settings, 'rowHeight');
1038
1039
  this.checkOrConvertNumber(this.settings, 'margins');
1039
1040
  this.checkOrConvertNumber(this.settings, 'border');
1040
-
1041
+
1041
1042
  var lastRowModes = [
1042
1043
  'justify',
1043
1044
  'nojustify',
@@ -1049,7 +1050,7 @@
1049
1050
  if (lastRowModes.indexOf(this.settings.lastRow) === -1) {
1050
1051
  throw 'lastRow must be one of: ' + lastRowModes.join(', ');
1051
1052
  }
1052
-
1053
+
1053
1054
  this.checkOrConvertNumber(this.settings, 'justifyThreshold');
1054
1055
  if (this.settings.justifyThreshold < 0 || this.settings.justifyThreshold > 1) {
1055
1056
  throw 'justifyThreshold must be in the interval [0,1]';
@@ -1057,38 +1058,38 @@
1057
1058
  if ($.type(this.settings.cssAnimation) !== 'boolean') {
1058
1059
  throw 'cssAnimation must be a boolean';
1059
1060
  }
1060
-
1061
+
1061
1062
  if ($.type(this.settings.captions) !== 'boolean') throw 'captions must be a boolean';
1062
1063
  this.checkOrConvertNumber(this.settings.captionSettings, 'animationDuration');
1063
-
1064
+
1064
1065
  this.checkOrConvertNumber(this.settings.captionSettings, 'visibleOpacity');
1065
1066
  if (this.settings.captionSettings.visibleOpacity < 0 ||
1066
1067
  this.settings.captionSettings.visibleOpacity > 1) {
1067
1068
  throw 'captionSettings.visibleOpacity must be in the interval [0, 1]';
1068
1069
  }
1069
-
1070
+
1070
1071
  this.checkOrConvertNumber(this.settings.captionSettings, 'nonVisibleOpacity');
1071
1072
  if (this.settings.captionSettings.nonVisibleOpacity < 0 ||
1072
1073
  this.settings.captionSettings.nonVisibleOpacity > 1) {
1073
1074
  throw 'captionSettings.nonVisibleOpacity must be in the interval [0, 1]';
1074
1075
  }
1075
-
1076
+
1076
1077
  this.checkOrConvertNumber(this.settings, 'imagesAnimationDuration');
1077
1078
  this.checkOrConvertNumber(this.settings, 'refreshTime');
1078
1079
  this.checkOrConvertNumber(this.settings, 'refreshSensitivity');
1079
1080
  if ($.type(this.settings.randomize) !== 'boolean') throw 'randomize must be a boolean';
1080
1081
  if ($.type(this.settings.selector) !== 'string') throw 'selector must be a string';
1081
-
1082
+
1082
1083
  if (this.settings.sort !== false && !$.isFunction(this.settings.sort)) {
1083
1084
  throw 'sort must be false or a comparison function';
1084
1085
  }
1085
-
1086
+
1086
1087
  if (this.settings.filter !== false && !$.isFunction(this.settings.filter) &&
1087
1088
  $.type(this.settings.filter) !== 'string') {
1088
1089
  throw 'filter must be false, a string or a filter function';
1089
1090
  }
1090
1091
  };
1091
-
1092
+
1092
1093
  /**
1093
1094
  * It brings all the indexes from the sizeRangeSuffixes and it orders them. They are then sorted and returned.
1094
1095
  * @returns {Array} sorted suffix ranges
@@ -1101,7 +1102,7 @@
1101
1102
  suffixRanges.sort(function (a, b) { return a > b ? 1 : a < b ? -1 : 0; });
1102
1103
  return suffixRanges;
1103
1104
  };
1104
-
1105
+
1105
1106
  /**
1106
1107
  * Update the existing settings only changing some of them
1107
1108
  *
@@ -1111,14 +1112,14 @@
1111
1112
  // In this case Justified Gallery has been called again changing only some options
1112
1113
  this.settings = $.extend({}, this.settings, newSettings);
1113
1114
  this.checkSettings();
1114
-
1115
+
1115
1116
  // As reported in the settings: negative value = same as margins, 0 = disabled
1116
1117
  this.border = this.settings.border >= 0 ? this.settings.border : this.settings.margins;
1117
-
1118
+
1118
1119
  this.maxRowHeight = this.retrieveMaxRowHeight();
1119
1120
  this.suffixRanges = this.retrieveSuffixRanges();
1120
1121
  };
1121
-
1122
+
1122
1123
  JustifiedGallery.prototype.defaults = {
1123
1124
  sizeRangeSuffixes: { }, /* e.g. Flickr configuration
1124
1125
  {
@@ -1139,9 +1140,9 @@
1139
1140
  // can't exceed 3 * rowHeight)
1140
1141
  margins: 1,
1141
1142
  border: -1, // negative value = same as margins, 0 = disabled, any other value to set the border
1142
-
1143
+
1143
1144
  lastRow: 'nojustify', // … which is the same as 'left', or can be 'justify', 'center', 'right' or 'hide'
1144
-
1145
+
1145
1146
  justifyThreshold: 0.90, /* if row width / available space > 0.90 it will be always justified
1146
1147
  * (i.e. lastRow setting is not considered) */
1147
1148
  waitThumbnailsLoad: true,
@@ -1177,7 +1178,7 @@
1177
1178
  this.$gallery.trigger(event); // Consider that 'this' is this set to the JustifiedGallery object, so it can
1178
1179
  } // access to fields such as $gallery, useful to trigger events with jQuery.
1179
1180
  };
1180
-
1181
+
1181
1182
 
1182
1183
  /**
1183
1184
  * Justified Gallery plugin for jQuery
@@ -1226,4 +1227,4 @@
1226
1227
  });
1227
1228
  };
1228
1229
 
1229
- }));
1230
+ }));