j1-template 2024.1.5 → 2024.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/layouts/content_generator_page.html +0 -34
  3. data/_includes/themes/j1/modules/searcher/generator.html +4 -1
  4. data/_includes/themes/j1/modules/searcher/procedures/topsearch.proc +59 -56
  5. data/assets/data/authclient.html +1 -8
  6. data/assets/data/banner.html +1 -7
  7. data/assets/data/fab.html +2 -13
  8. data/assets/data/footer.html +0 -3
  9. data/assets/data/galeries.html +2 -13
  10. data/assets/data/gemini-ui.html +74 -21
  11. data/assets/data/iframes.html +1 -4
  12. data/assets/data/masonry.html +1 -13
  13. data/assets/data/masterslider.html +10 -21
  14. data/assets/data/menu.html +6 -14
  15. data/assets/data/mmenu.html +6 -5
  16. data/assets/data/mmenu_toc.html +2 -1
  17. data/assets/data/panel.html +4 -11
  18. data/assets/data/particles.yml +8 -8
  19. data/assets/data/quicklinks.html +4 -23
  20. data/assets/data/rtext_resizer.html +3 -1
  21. data/assets/data/slick.html +9 -11
  22. data/assets/data/translator.html +0 -1
  23. data/assets/themes/j1/adapter/js/advertising.js +143 -182
  24. data/assets/themes/j1/adapter/js/algolia.js +61 -54
  25. data/assets/themes/j1/adapter/js/analytics.js +68 -52
  26. data/assets/themes/j1/adapter/js/asciidoctor.js +32 -20
  27. data/assets/themes/j1/adapter/js/attic.js +75 -69
  28. data/assets/themes/j1/adapter/js/bmd.js +44 -26
  29. data/assets/themes/j1/adapter/js/carousel.js +117 -92
  30. data/assets/themes/j1/adapter/js/chatbot.js +77 -35
  31. data/assets/themes/j1/adapter/js/clipboard.js +67 -49
  32. data/assets/themes/j1/adapter/js/comments.js +93 -70
  33. data/assets/themes/j1/adapter/js/cookieConsent.js +157 -159
  34. data/assets/themes/j1/adapter/js/customFunctions.js +52 -35
  35. data/assets/themes/j1/adapter/js/customModule.js +61 -50
  36. data/assets/themes/j1/adapter/js/docsearch.js +55 -34
  37. data/assets/themes/j1/adapter/js/dropdowns.js +66 -52
  38. data/assets/themes/j1/adapter/js/fab.js +124 -109
  39. data/assets/themes/j1/adapter/js/gallery.js +68 -49
  40. data/assets/themes/j1/adapter/js/gemini.js +961 -301
  41. data/assets/themes/j1/adapter/js/iconPicker.js +76 -54
  42. data/assets/themes/j1/adapter/js/iconPickerPage.js +279 -0
  43. data/assets/themes/j1/adapter/js/iframer.js +84 -63
  44. data/assets/themes/j1/adapter/js/j1.js +605 -542
  45. data/assets/themes/j1/adapter/js/lazyLoader.js +43 -24
  46. data/assets/themes/j1/adapter/js/lightbox.js +53 -52
  47. data/assets/themes/j1/adapter/js/logger.js +78 -66
  48. data/assets/themes/j1/adapter/js/lunr.js +684 -86
  49. data/assets/themes/j1/adapter/js/masonry.js +84 -68
  50. data/assets/themes/j1/adapter/js/masterslider.js +136 -137
  51. data/assets/themes/j1/adapter/js/mmenu.js +102 -66
  52. data/assets/themes/j1/adapter/js/navigator.js +291 -356
  53. data/assets/themes/j1/adapter/js/particles.js +62 -40
  54. data/assets/themes/j1/adapter/js/rangeSlider.js +66 -48
  55. data/assets/themes/j1/adapter/js/rouge.js +63 -44
  56. data/assets/themes/j1/adapter/js/rtable.js +56 -40
  57. data/assets/themes/j1/adapter/js/rtextResizer.js +57 -44
  58. data/assets/themes/j1/adapter/js/scroller.js +170 -133
  59. data/assets/themes/j1/adapter/js/slick.js +99 -97
  60. data/assets/themes/j1/adapter/js/slimSelect.js +288 -0
  61. data/assets/themes/j1/adapter/js/speak2me.js +124 -128
  62. data/assets/themes/j1/adapter/js/themeToggler.js +118 -97
  63. data/assets/themes/j1/adapter/js/{themer.js → themes.js} +144 -113
  64. data/assets/themes/j1/adapter/js/toccer.js +88 -54
  65. data/assets/themes/j1/adapter/js/translator.js +74 -70
  66. data/assets/themes/j1/adapter/js/waves.js +75 -58
  67. data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +29 -11
  68. data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +2 -2
  69. data/assets/themes/j1/core/js/template.js +474 -420
  70. data/assets/themes/j1/core/js/template.min.js +7 -7
  71. data/assets/themes/j1/core/js/template.min.js.map +1 -1
  72. data/assets/themes/j1/modules/carousel/css/theme/uno.css +4 -4
  73. data/assets/themes/j1/modules/carousel/css/theme/uno.min.css +1 -1
  74. data/assets/themes/j1/modules/clipboard/js/clipboard.js +0 -1
  75. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +27 -21
  76. data/assets/themes/j1/modules/iconPicker/css/theme/uno.css +58 -0
  77. data/assets/themes/j1/modules/iconPicker/css/theme/uno.min.css +16 -0
  78. data/assets/themes/j1/modules/iconPicker/js/universal-icon-picker.0.js +493 -0
  79. data/assets/themes/j1/modules/iconPicker/js/universal-icon-picker.js +7 -7
  80. data/assets/themes/j1/modules/js-cookies/js/js.cookie.js +147 -0
  81. data/assets/themes/j1/modules/js-cookies/js/js.cookie.min.js +2 -0
  82. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-video.js +4 -4
  83. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-video.min.js +2 -10
  84. data/assets/themes/j1/modules/lunr/css/j1.css +12 -6
  85. data/assets/themes/j1/modules/lunr/css/j1.min.css +1 -1
  86. data/assets/themes/j1/modules/lunr/js/j1.js +46 -43
  87. data/assets/themes/j1/modules/lunr/js/j1.min.js +1 -1
  88. data/assets/themes/j1/modules/masterslider/js/masterslider.js +1 -1
  89. data/assets/themes/j1/modules/scroller/js/scroller.js +64 -74
  90. data/assets/themes/j1/modules/scroller/js/scroller.min.js +1 -1
  91. data/assets/themes/j1/modules/slick/slider/css/theme/uno.css +4 -4
  92. data/assets/themes/j1/modules/slick/slider/css/theme/uno.min.css +1 -1
  93. data/assets/themes/j1/modules/slimSelect/js/select.js +1865 -1821
  94. data/assets/themes/j1/modules/slimSelect/js/select.min.js +2 -1
  95. data/assets/themes/j1/modules/themeSwitcher/js/switcher.js +87 -89
  96. data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +1 -1
  97. data/assets/themes/j1/modules/videojs/js/plugins/vm/api/player.min.js +5 -7
  98. data/assets/themes/j1/modules/videojs/js/plugins/vm/api/v2.20.1/player.min.js +23 -0
  99. data/lib/j1/version.rb +1 -1
  100. data/lib/starter_web/Gemfile +2 -2
  101. data/lib/starter_web/README.md +5 -5
  102. data/lib/starter_web/_config.yml +1 -1
  103. data/lib/starter_web/_data/blocks/_panel.yml +775 -0
  104. data/lib/starter_web/_data/blocks/panel.yml +53 -53
  105. data/lib/starter_web/_data/j1_config.yml +3 -2
  106. data/lib/starter_web/_data/layouts/default.yml +0 -2
  107. data/lib/starter_web/_data/modules/_scroller.yml +102 -0
  108. data/lib/starter_web/_data/modules/carousel.yml +3 -3
  109. data/lib/starter_web/_data/modules/defaults/attics.yml +5 -5
  110. data/lib/starter_web/_data/modules/defaults/docsearch.yml +1 -1
  111. data/lib/starter_web/_data/modules/defaults/gemini.yml +204 -46
  112. data/lib/starter_web/_data/modules/defaults/{iconPicker.yml → icon_picker.yml} +6 -12
  113. data/lib/starter_web/_data/modules/defaults/lunr.yml +20 -5
  114. data/lib/starter_web/_data/modules/defaults/masterslider.yml +4 -4
  115. data/lib/starter_web/_data/modules/defaults/navigator.yml +20 -24
  116. data/lib/starter_web/_data/modules/defaults/particles.yml +3 -3
  117. data/lib/starter_web/_data/modules/defaults/slim_select.yml +54 -0
  118. data/lib/starter_web/_data/modules/defaults/{themer.yml → themes.yml} +10 -10
  119. data/lib/starter_web/_data/modules/defaults/toccer.yml +1 -1
  120. data/lib/starter_web/_data/modules/gallery.yml +33 -38
  121. data/lib/starter_web/_data/modules/gemini.yml +42 -3
  122. data/lib/starter_web/_data/modules/{iconPicker.yml → icon_picker.yml} +31 -3
  123. data/lib/starter_web/_data/modules/lunr.yml +12 -1
  124. data/lib/starter_web/_data/modules/masonry.yml +37 -38
  125. data/lib/starter_web/_data/modules/masterslider.yml +78 -95
  126. data/lib/starter_web/_data/modules/navigator_menu.yml +12 -20
  127. data/lib/starter_web/_data/modules/particles.yml +3 -3
  128. data/lib/starter_web/_data/modules/scroller.yml +3 -3
  129. data/lib/starter_web/_data/modules/slim_select.yml +110 -0
  130. data/lib/starter_web/_data/modules/{themer.yml → themes.yml} +4 -4
  131. data/lib/starter_web/_data/resources.yml +83 -47
  132. data/lib/starter_web/_data/templates/feed.xml +1 -1
  133. data/lib/starter_web/_includes/attributes.asciidoc +354 -355
  134. data/lib/starter_web/_plugins/asciidoctor/gemini-ui-block.rb +1 -1
  135. data/lib/starter_web/_plugins/asciidoctor/slim-select-block.rb +45 -0
  136. data/lib/starter_web/_plugins/index/lunr.rb +1 -1
  137. data/lib/starter_web/collections/asciidoc_skeletons/simple-post/_posts/yyyy-mm-dd-your-post-name.asciidoc +5 -2
  138. data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +3 -3
  139. data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.adoc +9 -9
  140. data/lib/starter_web/collections/posts/public/featured/_posts/2021-02-01-static-site-generators.adoc +4 -4
  141. data/lib/starter_web/collections/posts/public/featured/_posts/2022-02-01-about-j1.adoc +3 -2
  142. data/lib/starter_web/collections/posts/public/featured/_posts/2023-10-18-url-types.adoc +12 -12
  143. data/lib/starter_web/package.json +1 -1
  144. data/lib/starter_web/pages/public/about/features.adoc +1 -1
  145. data/lib/starter_web/pages/public/about/reporting_issues.adoc +1 -0
  146. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/attributes.asciidoc +44 -44
  147. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +1 -0
  148. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/attributes.asciidoc +12 -12
  149. data/lib/starter_web/pages/public/blog/navigator/archive/allview.html +1 -1
  150. data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/attributes.asciidoc +42 -28
  151. data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/highlghter_rouge.adoc +1 -0
  152. data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/lunr_search.adoc +1 -0
  153. data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/present_audio_video.adoc +18 -2
  154. data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/present_images.adoc +43 -50
  155. data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +6 -11
  156. data/lib/starter_web/pages/public/legal/en/200_impress.adoc +4 -11
  157. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +5 -12
  158. data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +5 -10
  159. data/lib/starter_web/pages/public/tools/previewer/_includes/attributes.asciidoc +10 -9
  160. data/lib/starter_web/pages/public/tools/previewer/preview_bootstrap_theme.adoc +77 -75
  161. metadata +52 -46
  162. data/lib/starter_web/pages/public/manuals/integrations/gemini/_includes/attributes.asciidoc +0 -47
  163. data/lib/starter_web/pages/public/manuals/integrations/gemini/_includes/documents/preview_google_adsense.asciidoc +0 -448
  164. data/lib/starter_web/pages/public/manuals/integrations/gemini/_includes/documents/readme +0 -0
  165. data/lib/starter_web/pages/public/manuals/integrations/gemini/_includes/tables/readme +0 -0
  166. data/lib/starter_web/pages/public/manuals/integrations/gemini/gemini.adoc +0 -525
  167. data/lib/starter_web/pages/public/manuals/integrations/gemini/security.asccidoc +0 -274
  168. data/lib/starter_web/pages/public/manuals/integrations/gemini/security.hrml +0 -560
  169. /data/lib/starter_web/pages/public/{legal/learn → learn}/bookshelf/article_previewer/viewer_biography.adoc +0 -0
  170. /data/lib/starter_web/pages/public/{legal/learn → learn}/bookshelf/article_previewer/viewer_fantasy.adoc +0 -0
  171. /data/lib/starter_web/pages/public/{legal/learn → learn}/bookshelf/article_previewer/viewer_romance.adoc +0 -0
  172. /data/lib/starter_web/pages/public/{legal/learn → learn}/bookshelf/jekyll_collections.adoc +0 -0
  173. /data/lib/starter_web/pages/public/{legal/learn → learn}/bookshelf/viewer_all_books.adoc +0 -0
  174. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/100_gistblock.asciidoc +0 -0
  175. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/410_bottom_info.asciidoc +0 -0
  176. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/410_bottom_left_warning.asciidoc +0 -0
  177. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/410_bottom_right_danger.asciidoc +0 -0
  178. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/410_central_success.asciidoc +0 -0
  179. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/410_full_height_left_info.asciidoc +0 -0
  180. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/410_full_height_right_success.asciidoc +0 -0
  181. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/410_table_bs_modal_examples.asciidoc +0 -0
  182. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/410_top_info.asciidoc +0 -0
  183. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/410_top_left_info.asciidoc +0 -0
  184. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/410_top_right_success.asciidoc +0 -0
  185. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/419_advanced_modals_demo.asciidoc +0 -0
  186. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/tables/bs_modal_examples.asciidoc +0 -0
  187. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/themes_bootstrap.asciidoc +0 -0
  188. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/_includes/documents/themes_rouge.asciidoc +0 -0
  189. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/asciidoc_extensions.adoc +0 -0
  190. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/bootstrap_themes.adoc +0 -0
  191. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/icon_fonts.adoc +0 -0
  192. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/modal_extentions.adoc +0 -0
  193. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/responsive_tables.adoc +0 -0
  194. /data/lib/starter_web/pages/public/{legal/learn → learn}/roundtrip/typography.adoc +0 -0
  195. /data/lib/starter_web/pages/public/{legal/learn → learn}/where_to_go.adoc +0 -0
@@ -547,9 +547,9 @@
547
547
 
548
548
  // zoom and chapter tracks only available for HTML5 video
549
549
  //
550
- if (videoInfo.html5) {
550
+ if (this.core.galleryItems[this.core.index].video !== undefined && videoInfo.html5) {
551
551
  videoData = JSON.parse(this.core.galleryItems[this.core.index].video);
552
- if (videoData.tracks.length > 0) {
552
+ if (videoData.tracks !== undefined && videoData.tracks.length > 0) {
553
553
  for (var i=0; i<videoData.tracks.length; i++) {
554
554
  if (videoData.tracks[i].kind == 'chapters') {
555
555
  trackSrc = videoData.tracks[i].src;
@@ -567,7 +567,7 @@
567
567
 
568
568
  // jadams, 2024-01-22: added video start position
569
569
  // ---------------------------------------------------------------
570
- if (this.settings.videojsOptions.videoStart) {
570
+ if (zoomPlugin !== undefined && this.settings.videojsOptions.videoStart) {
571
571
  videoStart = this.settings.videojsOptions.videoStart[index];
572
572
  videojsPlayer.on("play", function() {
573
573
  var startFromSecond = new Date('1970-01-01T' + videoStart + 'Z').getTime() / 1000;
@@ -576,7 +576,7 @@
576
576
  }); // END on "play"
577
577
  } // END if videoStart
578
578
 
579
- if (zoomPlugin != undefined && zoomPlugin.enabled) {
579
+ if (zoomPlugin !== undefined && zoomPlugin.enabled) {
580
580
  zoomPlugin.settings = __assign(__assign({}, zoomPluginDefaults), zoomPlugin.options);
581
581
  videojsPlayer.zoomPlugin({
582
582
  moveX: zoomPlugin.settings.moveX,
@@ -22,13 +22,5 @@
22
22
  * Copyright (c) 2020 Sachin Neravath;
23
23
  * @license GPLv3
24
24
  */
25
-
26
- /*!
27
- * lightgallery | 2.7.2 | September 20th 2023
28
- * http://www.lightgalleryjs.com/
29
- * Copyright (c) 2020 Sachin Neravath;
30
- * @license GPLv3
31
- */
32
-
33
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).lgVideo=t()}(this,(function(){"use strict";
34
- var e=new URL(window.location.href).origin,t=function(){return t=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},t.apply(this,arguments)},i={autoplayFirstVideo:!0,htmlPlayerParams:!1,youTubePlayerParams:!1,vimeoPlayerParams:!1,dailymotionPlayerParams:!1,wistiaPlayerParams:!1,tiktokPlayerParams:!1,gotoNextSlideOnVideoEnd:!0,autoplayVideoOnSlide:!1,videojs:!1,videojsTheme:"",videojsOptions:{}},o="lgHasVideo",s="lgSlideItemLoad",n="lgBeforeSlide",r="lgAfterSlide",a="lgPosterClick",l=function(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")},d=function(i,o){if(!i.youtube)return"";var s=i.youtube[2]?function(e){return e.slice(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var i=t.map(decodeURIComponent),o=i[0],s=i[1];return e[o]=s,e}),{})}(i.youtube[2]):"",n=o||{},r=t(t(t({},{autoplay:0,controls:1,enablejsapi:1,hl:"en",loop:0,mute:1,wmode:"opaque",origin:e}),n),s);return"?"+l(r)},c=function(){function e(e){return this.core=e,this.settings=t(t({},i),this.core.settings),this}return e.prototype.init=function(){var e=this;this.core.LGel.on(o+".video",this.onHasVideo.bind(this)),this.core.LGel.on(a+".video",(function(){var t=e.core.getSlideItem(e.core.index);e.loadVideoOnPosterClick(t)})),this.core.LGel.on(s+".video",this.onSlideItemLoad.bind(this)),this.core.LGel.on(n+".video",this.onBeforeSlide.bind(this)),this.core.LGel.on(r+".video",this.onAfterSlide.bind(this))},e.prototype.onSlideItemLoad=function(e){var t=this,i=e.detail,o=i.isFirstSlide,s=i.index;this.settings.autoplayFirstVideo&&o&&s===this.core.index&&setTimeout((function(){t.loadAndPlayVideo(s)}),200),!o&&this.settings.autoplayVideoOnSlide&&s===this.core.index&&this.loadAndPlayVideo(s)},e.prototype.onHasVideo=function(e){var t=e.detail,i=t.index,o=t.src,s=t.html5Video;if(t.hasPoster)this.core.getSlideItem(i);else this.appendVideos(this.core.getSlideItem(i),{src:o,addClass:"lg-object",index:i,html5Video:s}),this.gotoNextSlideOnVideoEnd(o,i)},e.prototype.onBeforeSlide=function(e){if(this.core.lGalleryOn){var t=e.detail.prevIndex;this.pauseVideo(t)}},e.prototype.onAfterSlide=function(e){var t=this,i=e.detail,o=i.index,s=i.prevIndex,n=this.core.getSlideItem(o);this.settings.autoplayVideoOnSlide&&o!==s&&n.hasClass("lg-complete")&&setTimeout((function(){t.loadAndPlayVideo(o)}),100)},e.prototype.loadAndPlayVideo=function(e){var t=this.core.getSlideItem(e);this.core.galleryItems[e].poster?this.loadVideoOnPosterClick(t,!0):this.playVideo(e)},e.prototype.playVideo=function(e){this.controlVideo(e,"play")},e.prototype.pauseVideo=function(e){this.controlVideo(e,"pause")},e.prototype.getVideoHtml=function(e,t,i,o){var s="",n=this.core.galleryItems[i].__slideVideoInfo||{},r=this.core.galleryItems[i],a=r.title||r.alt;a=a?'title="'+a+'"':"";var c='allowtransparency="true"\n frameborder="0"\n scrolling="no"\n allowfullscreen\n mozallowfullscreen\n webkitallowfullscreen\n msallowfullscreen';if(n.youtube){var u="lg-youtube"+i,f=d(n,this.settings.youTubePlayerParams),m=function(e){return e.includes("youtube-nocookie.com")}(e);s='<iframe allow="autoplay" id='+u+' class="lg-video-object lg-youtube '+t+'" '+a+' src="'+(m?"//www.youtube-nocookie.com/":"//www.youtube.com/")+"embed/"+(n.youtube[1]+f)+'" '+c+"></iframe>"}else if(n.vimeo){u="lg-vimeo"+i;var h=function(e,t){if(!t||!t.vimeo)return"";var i=t.vimeo[2]||"",o=e&&0!==Object.keys(e).length?"&"+l(e):"",s=((t.vimeo[0].split("/").pop()||"").split("?")[0]||"").split("#")[0],n=t.vimeo[1]!==s;return n&&(i=i.replace("/"+s,"")),"?autoplay=0&muted=1"+(n?"&h="+s:"")+o+("?"==i[0]?"&"+i.slice(1):i||"")}(this.settings.vimeoPlayerParams,n);s='<iframe allow="autoplay" id='+u+' class="lg-video-object lg-vimeo '+t+'" '+a+' src="//player.vimeo.com/video/'+(n.vimeo[1]+h)+'" '+c+"></iframe>"}else if(n.wistia){var g="lg-wistia"+i;h=(h=l(this.settings.wistiaPlayerParams))?"?"+h:"",s='<iframe allow="autoplay" id="'+g+'" src="//fast.wistia.net/embed/iframe/'+(n.wistia[4]+h)+'" '+a+' class="wistia_embed lg-video-object lg-wistia '+t+'" name="wistia_embed" '+c+"></iframe>"}else if(n.dailymotion){var v="lg-dailymotion"+i;h=(h=l(this.settings.dailymotionPlayerParams))?"?"+h:"",s='<iframe allow="autoplay" id="'+v+'" src="//www.dailymotion.com/embed/video/'+(n.dailymotion[1]+h)+'" '+a+' class="dailymotion_embed lg-video-object lg-dailymotion '+t+'" name="dailymotion_embed" '+c+"></iframe>"}else if(n.tiktoc){h=function(e,t){if(!t||!t.tiktok)return"";var i=t.tiktok[2]||"",o=e&&0!==Object.keys(e).length?"&"+l(e):"",s=((t.tiktok[0].split("/").pop()||"").split("?")[0]||"").split("#")[0];return t.tiktok[1]!==s&&(i=i.replace("/"+s,"")),"?autoplay=0&muted=1"+o+("?"==i[0]?"&"+i.slice(1):i||"")}(this.settings.TicTocPlayerParams);s='<iframe allow="autoplay" id='+u+' class="lg-video-object lg-tictoc '+t+'" '+a+' src="//tiktok.com/embed/'+n.tiktoc[1]+'" '+a+c+"></iframe>"}else if(n.html5){for(var p="",y=0;y<o.source.length;y++)p+='<source src="'+o.source[y].src+'" type="'+o.source[y].type+'">';if(o.tracks){var w=function(e){var t="",i=o.tracks[e];Object.keys(i||{}).forEach((function(e){t+=e+'="'+i[e]+'" '})),p+="<track "+t+">"};for(y=0;y<o.tracks.length;y++)w(y)}var b="",V=o.attributes||{};Object.keys(V||{}).forEach((function(e){b+=e+'="'+V[e]+'" '})),s='<video class="lg-video-object lg-html5 '+(this.settings.videojs&&this.settings.videojsTheme?this.settings.videojsTheme+" ":"")+" "+(this.settings.videojs?" video-js":"")+'" '+b+">\n "+p+"\n Your browser does not support HTML5 video.\n </video>"}return s},e.prototype.appendVideos=function(e,t){var i,o=this.getVideoHtml(t.src,t.addClass,t.index,t.html5Video);e.find(".lg-video-cont").append(o);var s=e.find(".lg-video-object").first();if(t.html5Video&&s.on("mousedown.lg.video",(function(e){e.stopPropagation()})),this.settings.videojs&&(null===(i=this.core.galleryItems[t.index].__slideVideoInfo)||void 0===i?void 0:i.html5))try{return videojs(s.get(),this.settings.videojsOptions)}catch(e){console.warn("lightGallery: Make sure you have included videojs")}},e.prototype.gotoNextSlideOnVideoEnd=function(e,t){var i=this,o=this.core.getSlideItem(t).find(".lg-video-object").first(),s=this.core.galleryItems[t].__slideVideoInfo||{};if(this.settings.gotoNextSlideOnVideoEnd)if(s.html5)o.on("ended",(function(){i.core.goToNextSlide()}));else if(s.vimeo)try{new Vimeo.Player(o.get()).on("ended",(function(){i.core.goToNextSlide()}))}catch(e){console.warn("lightGallery: Make sure you have included //github.com/vimeo/player.js")}else if(s.wistia)try{window._wq=window._wq||[],window._wq.push({id:o.attr("id"),onReady:function(e){e.bind("end",(function(){i.core.goToNextSlide()}))}})}catch(e){console.warn("lightGallery: Make sure you have included //fast.wistia.com/assets/external/E-v1.js")}},e.prototype.controlVideo=function(e,i){var o,s,n,r,a,l,d,c,u,f=!1;if(n=this.core.galleryItems[e].__slideVideoInfo||{},s=this.core.getSlideItem(e).find(".lg-video-object").first(),n.html5){if((a=JSON.parse(this.core.galleryItems[this.core.index].video)).tracks.length>0)for(var m=0;m<a.tracks.length;m++)"chapters"==a.tracks[m].kind&&(o=a.tracks[m].src,f=!0);l=s.selector.id,d=videojs(l);var h=this.settings.videojsOptions.zoomPlugin;this.settings.videojsOptions.videoStart&&(r=this.settings.videojsOptions.videoStart[e],d.on("play",(function(){var e=new Date("1970-01-01T"+r+"Z").getTime()/1e3;d.currentTime(e)}))),null!=h&&h.enabled&&(h.settings=t(t({},{moveX:0,moveY:0,rotate:0,zoom:1}),h.options),d.zoomPlugin({moveX:h.settings.moveX,moveY:h.settings.moveY,rotate:h.settings.rotate,zoom:h.settings.zoom}))}if(f){var g=new WebVTTParser,v=[];function p(e){for(var t,i=g.parse(e,"metadata"),o=0;o<i.cues.length;o++)t={time:i.cues[o].startTime,label:i.cues[o].text},v.push(t)}c=o,u=p,new WebVTTParser,$.ajax({url:c,type:"GET",success:u,error:function(e){JSON.stringify(e,void 0,2)}}),d.on("play",(function(){d.currentTime(r);var e=d.duration(),t=$(d.controlBar.progressControl.children_[0].el_);setTimeout((function(){var i=setInterval((function(){if(v.length){for(var o=0;o<v.length;o++){var s=v[o].time/e*100+"%",n=v[o].time,r=$('<div class="vjs-chapter-marker" style="left: '+s+'" data-time="'+n+'"> <span>'+v[o].label+"</span></div>");r.click((function(){d.currentTime($(this).data("time"))})),t.append(r)}clearInterval(i)}}),10)}),1e3)}))}if(s.get())if(n.youtube)try{s.get().contentWindow.postMessage('{"event":"command","func":"'+i+'Video","args":""}',"*")}catch(y){console.error("lightGallery:- "+y)}else if(n.vimeo)try{new Vimeo.Player(s.get())[i]()}catch(w){console.warn("lightGallery: Make sure you have included //github.com/vimeo/player.js")}else if(n.html5)if(this.settings.videojs)try{videojs(s.get())[i]()}catch(b){console.warn("lightGallery: Make sure you have included videojs")}else s.get()[i]();else if(n.wistia)try{window._wq=window._wq||[],window._wq.push({id:s.attr("id"),onReady:function(e){e[i]()}})}catch(V){console.warn("lightGallery: Make sure you have included //fast.wistia.com/assets/external/E-v1.js")}},e.prototype.loadVideoOnPosterClick=function(e,t){var i=this;if(e.hasClass("lg-video-loaded"))t&&this.playVideo(this.core.index);else if(e.hasClass("lg-has-video"))this.playVideo(this.core.index);else{e.addClass("lg-has-video");var o=void 0,s=this.core.galleryItems[this.core.index].src,n=this.core.galleryItems[this.core.index].video;n&&(o="string"==typeof n?JSON.parse(n):n);var r=this.appendVideos(e,{src:s,addClass:"",index:this.core.index,html5Video:o});this.gotoNextSlideOnVideoEnd(s,this.core.index);var a=e.find(".lg-object").first().get();e.find(".lg-video-cont").first().append(a),e.addClass("lg-video-loading"),r&&r.ready((function(){r.on("loadedmetadata",(function(){i.onVideoLoadAfterPosterClick(e,i.core.index)}))})),e.find(".lg-video-object").first().on("load.lg error.lg loadedmetadata.lg",(function(){setTimeout((function(){i.onVideoLoadAfterPosterClick(e,i.core.index)}),50)}))}},e.prototype.onVideoLoadAfterPosterClick=function(e,t){e.addClass("lg-video-loaded"),this.playVideo(t)},e.prototype.destroy=function(){this.core.LGel.off(".lg.video"),this.core.LGel.off(".video")},e}();return c}));
25
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).lgVideo=t()}(this,function(){"use strict";
26
+ var e=new URL(window.location.href).origin,t=function(){return(t=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},i={autoplayFirstVideo:!0,htmlPlayerParams:!1,youTubePlayerParams:!1,vimeoPlayerParams:!1,dailymotionPlayerParams:!1,wistiaPlayerParams:!1,tiktokPlayerParams:!1,gotoNextSlideOnVideoEnd:!0,autoplayVideoOnSlide:!1,videojs:!1,videojsTheme:"",videojsOptions:{}},o="lgHasVideo",s="lgSlideItemLoad",n="lgBeforeSlide",r="lgAfterSlide",a="lgPosterClick",l=function(e){return Object.keys(e).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")},d=function(i,o){if(!i.youtube)return"";var s=i.youtube[2]?i.youtube[2].slice(1).split("&").map(function(e){return e.split("=")}).reduce(function(e,t){var i=t.map(decodeURIComponent),o=i[0],s=i[1];return e[o]=s,e},{}):"",n=o||{},r=t(t(t({},{autoplay:0,controls:1,enablejsapi:1,hl:"en",loop:0,mute:1,wmode:"opaque",origin:e}),n),s);return"?"+l(r)};return function(){function e(e){return this.core=e,this.settings=t(t({},i),this.core.settings),this}return e.prototype.init=function(){var e=this;this.core.LGel.on(o+".video",this.onHasVideo.bind(this)),this.core.LGel.on(a+".video",function(){var t=e.core.getSlideItem(e.core.index);e.loadVideoOnPosterClick(t)}),this.core.LGel.on(s+".video",this.onSlideItemLoad.bind(this)),this.core.LGel.on(n+".video",this.onBeforeSlide.bind(this)),this.core.LGel.on(r+".video",this.onAfterSlide.bind(this))},e.prototype.onSlideItemLoad=function(e){var t=this,i=e.detail,o=i.isFirstSlide,s=i.index;this.settings.autoplayFirstVideo&&o&&s===this.core.index&&setTimeout(function(){t.loadAndPlayVideo(s)},200),!o&&this.settings.autoplayVideoOnSlide&&s===this.core.index&&this.loadAndPlayVideo(s)},e.prototype.onHasVideo=function(e){var t=e.detail,i=t.index,o=t.src,s=t.html5Video;if(t.hasPoster)this.core.getSlideItem(i);else this.appendVideos(this.core.getSlideItem(i),{src:o,addClass:"lg-object",index:i,html5Video:s}),this.gotoNextSlideOnVideoEnd(o,i)},e.prototype.onBeforeSlide=function(e){if(this.core.lGalleryOn){var t=e.detail.prevIndex;this.pauseVideo(t)}},e.prototype.onAfterSlide=function(e){var t=this,i=e.detail,o=i.index,s=i.prevIndex,n=this.core.getSlideItem(o);this.settings.autoplayVideoOnSlide&&o!==s&&n.hasClass("lg-complete")&&setTimeout(function(){t.loadAndPlayVideo(o)},100)},e.prototype.loadAndPlayVideo=function(e){var t=this.core.getSlideItem(e);this.core.galleryItems[e].poster?this.loadVideoOnPosterClick(t,!0):this.playVideo(e)},e.prototype.playVideo=function(e){this.controlVideo(e,"play")},e.prototype.pauseVideo=function(e){this.controlVideo(e,"pause")},e.prototype.getVideoHtml=function(e,t,i,o){var s="",n=this.core.galleryItems[i].__slideVideoInfo||{},r=this.core.galleryItems[i],a=r.title||r.alt;a=a?'title="'+a+'"':"";var c='allowtransparency="true"\n frameborder="0"\n scrolling="no"\n allowfullscreen\n mozallowfullscreen\n webkitallowfullscreen\n msallowfullscreen';if(n.youtube){var u="lg-youtube"+i,f=d(n,this.settings.youTubePlayerParams);s='<iframe allow="autoplay" id='+u+' class="lg-video-object lg-youtube '+t+'" '+a+' src="'+(e.includes("youtube-nocookie.com")?"//www.youtube-nocookie.com/":"//www.youtube.com/")+"embed/"+(n.youtube[1]+f)+'" '+c+"></iframe>"}else if(n.vimeo){u="lg-vimeo"+i;var h=function(e,t){if(!t||!t.vimeo)return"";var i=t.vimeo[2]||"",o=e&&0!==Object.keys(e).length?"&"+l(e):"",s=((t.vimeo[0].split("/").pop()||"").split("?")[0]||"").split("#")[0],n=t.vimeo[1]!==s;return n&&(i=i.replace("/"+s,"")),"?autoplay=0&muted=1"+(n?"&h="+s:"")+o+(i="?"==i[0]?"&"+i.slice(1):i||"")}(this.settings.vimeoPlayerParams,n);s='<iframe allow="autoplay" id='+u+' class="lg-video-object lg-vimeo '+t+'" '+a+' src="//player.vimeo.com/video/'+(n.vimeo[1]+h)+'" '+c+"></iframe>"}else if(n.wistia){var m="lg-wistia"+i;h=(h=l(this.settings.wistiaPlayerParams))?"?"+h:"",s='<iframe allow="autoplay" id="'+m+'" src="//fast.wistia.net/embed/iframe/'+(n.wistia[4]+h)+'" '+a+' class="wistia_embed lg-video-object lg-wistia '+t+'" name="wistia_embed" '+c+"></iframe>"}else if(n.dailymotion){var v="lg-dailymotion"+i;h=(h=l(this.settings.dailymotionPlayerParams))?"?"+h:"",s='<iframe allow="autoplay" id="'+v+'" src="//www.dailymotion.com/embed/video/'+(n.dailymotion[1]+h)+'" '+a+' class="dailymotion_embed lg-video-object lg-dailymotion '+t+'" name="dailymotion_embed" '+c+"></iframe>"}else if(n.tiktoc){h=function(e,t){if(!t||!t.tiktok)return"";var i=t.tiktok[2]||"",o=e&&0!==Object.keys(e).length?"&"+l(e):"",s=((t.tiktok[0].split("/").pop()||"").split("?")[0]||"").split("#")[0];return t.tiktok[1]!==s&&(i=i.replace("/"+s,"")),"?autoplay=0&muted=1"+o+(i="?"==i[0]?"&"+i.slice(1):i||"")}(this.settings.TicTocPlayerParams);s='<iframe allow="autoplay" id='+u+' class="lg-video-object lg-tictoc '+t+'" '+a+' src="//tiktok.com/embed/'+n.tiktoc[1]+'" '+a+c+"></iframe>"}else if(n.html5){for(var g="",p=0;p<o.source.length;p++)g+='<source src="'+o.source[p].src+'" type="'+o.source[p].type+'">';if(o.tracks){var y=function(e){var t="",i=o.tracks[e];Object.keys(i||{}).forEach(function(e){t+=e+'="'+i[e]+'" '}),g+="<track "+t+">"};for(p=0;p<o.tracks.length;p++)y(p)}var w="",b=o.attributes||{};Object.keys(b||{}).forEach(function(e){w+=e+'="'+b[e]+'" '}),s='<video class="lg-video-object lg-html5 '+(this.settings.videojs&&this.settings.videojsTheme?this.settings.videojsTheme+" ":"")+" "+(this.settings.videojs?" video-js":"")+'" '+w+">\n "+g+"\n Your browser does not support HTML5 video.\n </video>"}return s},e.prototype.appendVideos=function(e,t){var i,o=this.getVideoHtml(t.src,t.addClass,t.index,t.html5Video);e.find(".lg-video-cont").append(o);var s=e.find(".lg-video-object").first();if(t.html5Video&&s.on("mousedown.lg.video",function(e){e.stopPropagation()}),this.settings.videojs&&(null===(i=this.core.galleryItems[t.index].__slideVideoInfo)||void 0===i?void 0:i.html5))try{return videojs(s.get(),this.settings.videojsOptions)}catch(e){console.warn("lightGallery: Make sure you have included videojs")}},e.prototype.gotoNextSlideOnVideoEnd=function(e,t){var i=this,o=this.core.getSlideItem(t).find(".lg-video-object").first(),s=this.core.galleryItems[t].__slideVideoInfo||{};if(this.settings.gotoNextSlideOnVideoEnd)if(s.html5)o.on("ended",function(){i.core.goToNextSlide()});else if(s.vimeo)try{new Vimeo.Player(o.get()).on("ended",function(){i.core.goToNextSlide()})}catch(e){console.warn("lightGallery: Make sure you have included //github.com/vimeo/player.js")}else if(s.wistia)try{window._wq=window._wq||[],window._wq.push({id:o.attr("id"),onReady:function(e){e.bind("end",function(){i.core.goToNextSlide()})}})}catch(e){console.warn("lightGallery: Make sure you have included //fast.wistia.com/assets/external/E-v1.js")}},e.prototype.controlVideo=function(e,i){var o,s,n,r,a,l,d,c=!1;if(n=this.core.galleryItems[e].__slideVideoInfo||{},s=this.core.getSlideItem(e).find(".lg-video-object").first(),void 0!==this.core.galleryItems[this.core.index].video&&n.html5){if(void 0!==(a=JSON.parse(this.core.galleryItems[this.core.index].video)).tracks&&a.tracks.length>0)for(var u=0;u<a.tracks.length;u++)"chapters"==a.tracks[u].kind&&(o=a.tracks[u].src,c=!0);var f;l=s.selector.id,d=videojs(l),void 0!==(f=this.settings.videojsOptions.zoomPlugin)&&this.settings.videojsOptions.videoStart&&(r=this.settings.videojsOptions.videoStart[e],d.on("play",function(){var e=new Date("1970-01-01T"+r+"Z").getTime()/1e3;d.currentTime(e)})),void 0!==f&&f.enabled&&(f.settings=t(t({},{moveX:0,moveY:0,rotate:0,zoom:1}),f.options),d.zoomPlugin({moveX:f.settings.moveX,moveY:f.settings.moveY,rotate:f.settings.rotate,zoom:f.settings.zoom}))}if(c){var h=new WebVTTParser,m=[];!function(e,t){new WebVTTParser;$.ajax({url:e,type:"GET",success:t,error:function(e){JSON.stringify(e,void 0,2)}})}(o,function(e){for(var t,i=h.parse(e,"metadata"),o=0;o<i.cues.length;o++)t={time:i.cues[o].startTime,label:i.cues[o].text},m.push(t)}),d.on("play",function(){d.currentTime(r);var e=d.duration(),t=$(d.controlBar.progressControl.children_[0].el_);setTimeout(function(){var i=setInterval(function(){if(m.length){for(var o=0;o<m.length;o++){var s=m[o].time/e*100+"%",n=m[o].time,r=$('<div class="vjs-chapter-marker" style="left: '+s+'" data-time="'+n+'"> <span>'+m[o].label+"</span></div>");r.click(function(){d.currentTime($(this).data("time"))}),t.append(r)}clearInterval(i)}},10)},1e3)})}if(s.get())if(n.youtube)try{s.get().contentWindow.postMessage('{"event":"command","func":"'+i+'Video","args":""}',"*")}catch(e){console.error("lightGallery:- "+e)}else if(n.vimeo)try{new Vimeo.Player(s.get())[i]()}catch(e){console.warn("lightGallery: Make sure you have included //github.com/vimeo/player.js")}else if(n.html5)if(this.settings.videojs)try{videojs(s.get())[i]()}catch(e){console.warn("lightGallery: Make sure you have included videojs")}else s.get()[i]();else if(n.wistia)try{window._wq=window._wq||[],window._wq.push({id:s.attr("id"),onReady:function(e){e[i]()}})}catch(e){console.warn("lightGallery: Make sure you have included //fast.wistia.com/assets/external/E-v1.js")}},e.prototype.loadVideoOnPosterClick=function(e,t){var i=this;if(e.hasClass("lg-video-loaded"))t&&this.playVideo(this.core.index);else if(e.hasClass("lg-has-video"))this.playVideo(this.core.index);else{e.addClass("lg-has-video");var o=void 0,s=this.core.galleryItems[this.core.index].src,n=this.core.galleryItems[this.core.index].video;n&&(o="string"==typeof n?JSON.parse(n):n);var r=this.appendVideos(e,{src:s,addClass:"",index:this.core.index,html5Video:o});this.gotoNextSlideOnVideoEnd(s,this.core.index);var a=e.find(".lg-object").first().get();e.find(".lg-video-cont").first().append(a),e.addClass("lg-video-loading"),r&&r.ready(function(){r.on("loadedmetadata",function(){i.onVideoLoadAfterPosterClick(e,i.core.index)})}),e.find(".lg-video-object").first().on("load.lg error.lg loadedmetadata.lg",function(){setTimeout(function(){i.onVideoLoadAfterPosterClick(e,i.core.index)},50)})}},e.prototype.onVideoLoadAfterPosterClick=function(e,t){e.addClass("lg-video-loaded"),this.playVideo(t)},e.prototype.destroy=function(){this.core.LGel.off(".lg.video"),this.core.LGel.off(".video")},e}()});
@@ -19,14 +19,20 @@
19
19
  background-color: unset;
20
20
  overflow-y: scroll!important;
21
21
  margin-top: .25rem;
22
- /* margin-right: 3rem; */
23
22
  margin-bottom: .25rem;
24
- /* margin-left: 1rem; */
25
23
  }
26
24
 
27
25
  p.result-item-text {
28
- font-size: .875rem;
29
- margin-bottom: .5rem;
30
- text-align: justify;
31
- line-height: 1.25rem;
26
+ font-size: .875rem;
27
+ margin-bottom: .5rem;
28
+ text-align: justify;
29
+ line-height: 1.25rem;
30
+ }
31
+
32
+ span#clear-topsearch > i:hover {
33
+ color: var(--md-gray-500) !important;
34
+ }
35
+
36
+ span#send-to-history > i:hover {
37
+ color: var(--md-gray-500) !important;
32
38
  }
@@ -12,4 +12,4 @@
12
12
  # See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
13
13
  # -----------------------------------------------------------------------------
14
14
  */
15
- .search-results{max-height:450px;width:98%;background-color:unset;overflow-y:scroll!important;margin-top:.25rem;margin-bottom:.25rem}p.result-item-text{font-size:.875rem;margin-bottom:.5rem;text-align:justify;line-height:1.25rem}
15
+ .search-results{max-height:450px;width:98%;background-color:unset;overflow-y:scroll !important;margin-top:.25rem;margin-bottom:.25rem}p.result-item-text{font-size:.875rem;margin-bottom:.5rem;text-align:justify;line-height:1.25rem}span#clear-topsearch>i:hover{color:#424242 !important}span#send-to-history>i:hover{color:#424242 !important}
@@ -16,14 +16,13 @@
16
16
  # -----------------------------------------------------------------------------
17
17
  */
18
18
  'use strict';
19
+ ;(function ($) {
19
20
 
20
- (function($) {
21
-
22
- var debounce = function(fn) {
21
+ var debounce = function (fn) {
23
22
  var timeout;
24
23
  var slice = Array.prototype.slice;
25
24
 
26
- return function() {
25
+ return function () {
27
26
  var args = slice.call(arguments),
28
27
  ctx = this;
29
28
 
@@ -36,37 +35,38 @@
36
35
  };
37
36
 
38
37
  // parse a date in yyyy-mm-dd format
39
- var parseDate = function(input) {
38
+ var parseDate = function (input) {
40
39
  var parts = input.match(/(\d+)/g);
41
40
  return new Date(parts[0], parts[1]-1, parts[2]); // months are 0-based
42
41
  };
43
42
 
44
- var LunrSearch = (function() {
43
+ var LunrSearch = (function () {
45
44
  function LunrSearch(elem, options) {
46
- this.$elem = elem;
47
- this.$results = $(options.results);
48
- this.indexData = options.index_file;
49
- this.template = this.compileTemplate($(options.template));
50
- this.titleMsg = options.titleMsg;
51
- this.emptyMsg = options.emptyMsg;
52
- this.onAfterResultShow = options.onAfterResultShow;
45
+ this.$elem = elem;
46
+ this.$results = $(options.results);
47
+ this.indexData = options.index_file;
48
+ this.template = this.compileTemplate($(options.template));
49
+ this.titleMsg = options.titleMsg;
50
+ this.emptyMsg = options.emptyMsg;
51
+ this.onResultShown = options.onResultShown;
53
52
 
54
53
  this.initialize();
55
54
  }
56
55
 
57
- LunrSearch.prototype.initialize = function() {
56
+ LunrSearch.prototype.initialize = function () {
58
57
  var self = this;
59
58
 
60
- this.loadIndexData(function(data) {
61
- self.docs = $.map(data.docs, self.createEntry);
59
+ this.loadIndexData(function (data) {
60
+ self.docs = $.map(data.docs, self.createEntry);
62
61
  self.index = lunr.Index.load(data.index);
62
+
63
63
  self.populateSearchFromQuery();
64
64
  self.bindKeypress();
65
65
  });
66
66
  };
67
67
 
68
68
  // compile search results template
69
- LunrSearch.prototype.compileTemplate = function($template) {
69
+ LunrSearch.prototype.compileTemplate = function ($template) {
70
70
  var template = $template.text();
71
71
  Mustache.parse(template);
72
72
  return function (view, partials) {
@@ -75,11 +75,11 @@
75
75
  };
76
76
 
77
77
  // load the search index data
78
- LunrSearch.prototype.loadIndexData = function(callback) {
78
+ LunrSearch.prototype.loadIndexData = function (callback) {
79
79
  $.getJSON(this.indexData, callback);
80
80
  };
81
81
 
82
- LunrSearch.prototype.createEntry = function(raw, index) {
82
+ LunrSearch.prototype.createEntry = function (raw, index) {
83
83
  var entry = $.extend({
84
84
  id: index + 1
85
85
  }, raw);
@@ -87,12 +87,12 @@
87
87
  // include pub date for posts
88
88
  if (raw.date) {
89
89
  $.extend(entry, {
90
- date: parseDate(raw.date),
91
- pubdate: function() {
90
+ date: parseDate(raw.date),
91
+ pubdate: function () {
92
92
  // HTML5 pubdate
93
93
  return dateFormat(parseDate(raw.date), 'yyyy-mm-dd');
94
94
  },
95
- displaydate: function() {
95
+ displaydate: function () {
96
96
  // only for posts (e.g. Oct 12, 2012)
97
97
  return dateFormat(parseDate(raw.date), 'mmm dd, yyyy');
98
98
  }
@@ -102,11 +102,11 @@
102
102
  return entry;
103
103
  };
104
104
 
105
- LunrSearch.prototype.bindKeypress = function() {
106
- var self = this;
105
+ LunrSearch.prototype.bindKeypress = function () {
106
+ var self = this;
107
107
  var oldValue = this.$elem.val();
108
108
 
109
- this.$elem.bind('keyup', debounce(function() {
109
+ this.$elem.bind('keyup', debounce(function () {
110
110
  var newValue = self.$elem.val();
111
111
  if (newValue !== oldValue) {
112
112
  self.search(newValue);
@@ -116,34 +116,36 @@
116
116
  }));
117
117
  };
118
118
 
119
- LunrSearch.prototype.search = function(query) {
119
+ LunrSearch.prototype.search = function (query) {
120
120
  var docs = this.docs;
121
121
 
122
122
  if (query.length < 3) {
123
123
  this.$results.hide().empty();
124
124
  } else {
125
- var results = $.map(this.index.search(query), function(result) {
125
+ var results = $.map(this.index.search(query), function (result) {
126
126
  return $.grep(docs, function(entry) {
127
127
  return entry.id === parseInt(result.ref, 10); })[0];
128
128
  });
129
129
 
130
130
  this.displayResults(results);
131
- this.onAfterResultShow();
131
+ this.onResultShown();
132
132
  }
133
133
  };
134
134
 
135
- LunrSearch.prototype.displayResults = function(docs) {
135
+ LunrSearch.prototype.displayResults = function (docs) {
136
136
  var $results = this.$results;
137
137
 
138
138
  $results.empty();
139
139
 
140
140
  if (docs.length === 0) {
141
- $results.append( this.emptyMsg );
141
+ $results.append(this.emptyMsg);
142
142
  } else {
143
143
  if (this.titleMsg && 0 !== this.titleMsg.length) {
144
- $results.append( this.titleMsg );
144
+ $results.append(this.titleMsg);
145
145
  }
146
- $results.append(this.template({docs: docs}));
146
+ $results.append(this.template({
147
+ docs: docs
148
+ }));
147
149
  }
148
150
 
149
151
  $results.show();
@@ -159,11 +161,11 @@
159
161
  logger.info(log_text);
160
162
 
161
163
  // Remove unwanted trailing (dot) delimiters
162
- $('.sr-tags').each(function() {
164
+ $('.sr-tags').each(function () {
163
165
  sr_tags = $(this).html().replace(/^\s+(.*)(\s+·\s+$)/, "$1");
164
166
  $(this).text(sr_tags);
165
167
  });
166
- $('.sr-categories').each(function() {
168
+ $('.sr-categories').each(function () {
167
169
  sr_categories = $(this).html().replace(/^(.*)(\s+·\s+$)/, "$1");
168
170
  $(this).text(sr_categories);
169
171
  });
@@ -171,8 +173,8 @@
171
173
  };
172
174
 
173
175
  // Populate the search input with 'q' querystring parameter if set
174
- LunrSearch.prototype.populateSearchFromQuery = function() {
175
- var uri = new URI(window.location.search.toString());
176
+ LunrSearch.prototype.populateSearchFromQuery = function () {
177
+ var uri = new URI(window.location.search.toString());
176
178
  var queryString = uri.search(true);
177
179
 
178
180
  if (queryString.hasOwnProperty('q')) {
@@ -184,7 +186,7 @@
184
186
  return LunrSearch;
185
187
  })();
186
188
 
187
- $.fn.lunrSearch = function(options) {
189
+ $.fn.lunrSearch = function (options) {
188
190
  // apply default options
189
191
  options = $.extend({}, $.fn.lunrSearch.defaults, options);
190
192
 
@@ -196,11 +198,12 @@
196
198
 
197
199
  // configuration defaults
198
200
  $.fn.lunrSearch.defaults = {
199
- index_file: ' /assets/data/lunr-index.json', // url for the .json file containing search index data
200
- results: '#search-results', // selector for containing search results element
201
- template: '#search-results-template', // selector for Mustache.js template
202
- titleMsg: '<h1>Search results<h1>', // message attached in front of results
203
- emptyMsg: '<p>Nothing found.</p>', // shown message if search returns no results
204
- onAfterResultShow: function() {} // a hook to process the page after the search results have been shown
201
+ index_file: '/assets/data/lunr-index.json', // url for the .json file containing search index data
202
+ results: '#search-results', // selector for containing search results element
203
+ template: '#search-results-template', // selector for Mustache.js template
204
+ titleMsg: '<h1>Search results<h1>', // message attached in front of results
205
+ emptyMsg: '<p>Nothing found.</p>', // shown message if search returns no results
206
+ onResultShown: function () {} // a callback to process the page after the search results have been shown
205
207
  };
208
+
206
209
  })(jQuery);
@@ -14,4 +14,4 @@
14
14
  # TODO:
15
15
  # -----------------------------------------------------------------------------
16
16
  */
17
- "use strict";(function(c){var b=function(e){var f;var g=Array.prototype.slice;return function(){var i=g.call(arguments),h=this;clearTimeout(f);f=setTimeout(function(){e.apply(h,i)},100)}};var d=function(e){var f=e.match(/(\d+)/g);return new Date(f[0],f[1]-1,f[2])};var a=(function(){function e(g,f){this.$elem=g;this.$results=c(f.results);this.indexData=f.index_file;this.template=this.compileTemplate(c(f.template));this.titleMsg=f.titleMsg;this.emptyMsg=f.emptyMsg;this.onAfterResultShow=f.onAfterResultShow;this.initialize()}e.prototype.initialize=function(){var f=this;this.loadIndexData(function(g){f.docs=c.map(g.docs,f.createEntry);f.index=lunr.Index.load(g.index);f.populateSearchFromQuery();f.bindKeypress()})};e.prototype.compileTemplate=function(f){var g=f.text();Mustache.parse(g);return function(h,i){return Mustache.render(g,h,i)}};e.prototype.loadIndexData=function(f){c.getJSON(this.indexData,f)};e.prototype.createEntry=function(g,f){var h=c.extend({id:f+1},g);if(g.date){c.extend(h,{date:d(g.date),pubdate:function(){return dateFormat(d(g.date),"yyyy-mm-dd")},displaydate:function(){return dateFormat(d(g.date),"mmm dd, yyyy")}})}return h};e.prototype.bindKeypress=function(){var f=this;var g=this.$elem.val();this.$elem.bind("keyup",b(function(){var h=f.$elem.val();if(h!==g){f.search(h)}g=h}))};e.prototype.search=function(g){var h=this.docs;if(g.length<3){this.$results.hide().empty()}else{var f=c.map(this.index.search(g),function(i){return c.grep(h,function(j){return j.id===parseInt(i.ref,10)})[0]});this.displayResults(f);this.onAfterResultShow()}};e.prototype.displayResults=function(k){var g=this.$results;g.empty();if(k.length===0){g.append(this.emptyMsg)}else{if(this.titleMsg&&0!==this.titleMsg.length){g.append(this.titleMsg)}g.append(this.template({docs:k}))}g.show();if(k.length>0){var i=log4javascript.getLogger("j1.searcher");var h="\ncleanup tags and categories";var f;var j;i.info(h);c(".sr-tags").each(function(){j=c(this).html().replace(/^\s+(.*)(\s+·\s+$)/,"$1");c(this).text(j)});c(".sr-categories").each(function(){f=c(this).html().replace(/^(.*)(\s+·\s+$)/,"$1");c(this).text(f)})}};e.prototype.populateSearchFromQuery=function(){var f=new URI(window.location.search.toString());var g=f.search(true);if(g.hasOwnProperty("q")){this.$elem.val(g.q);this.search(g.q.toString())}};return e})();c.fn.lunrSearch=function(e){e=c.extend({},c.fn.lunrSearch.defaults,e);new a(this,e);return this};c.fn.lunrSearch.defaults={index_file:" /assets/data/lunr-index.json",results:"#search-results",template:"#search-results-template",titleMsg:"<h1>Search results<h1>",emptyMsg:"<p>Nothing found.</p>",onAfterResultShow:function(){}}})(jQuery);
17
+ "use strict";!function(t){var e=function(t){var e=t.match(/(\d+)/g);return new Date(e[0],e[1]-1,e[2])},n=function(){function n(e,n){this.$elem=e,this.$results=t(n.results),this.indexData=n.index_file,this.template=this.compileTemplate(t(n.template)),this.titleMsg=n.titleMsg,this.emptyMsg=n.emptyMsg,this.onResultShown=n.onResultShown,this.initialize()}return n.prototype.initialize=function(){var e=this;this.loadIndexData(function(n){e.docs=t.map(n.docs,e.createEntry),e.index=lunr.Index.load(n.index),e.populateSearchFromQuery(),e.bindKeypress()})},n.prototype.compileTemplate=function(t){var e=t.text();return Mustache.parse(e),function(t,n){return Mustache.render(e,t,n)}},n.prototype.loadIndexData=function(e){t.getJSON(this.indexData,e)},n.prototype.createEntry=function(n,s){var i=t.extend({id:s+1},n);return n.date&&t.extend(i,{date:e(n.date),pubdate:function(){return dateFormat(e(n.date),"yyyy-mm-dd")},displaydate:function(){return dateFormat(e(n.date),"mmm dd, yyyy")}}),i},n.prototype.bindKeypress=function(){var t,e,n,s=this,i=this.$elem.val();this.$elem.bind("keyup",(t=function(){var t=s.$elem.val();t!==i&&s.search(t),i=t},n=Array.prototype.slice,function(){var s=n.call(arguments),i=this;clearTimeout(e),e=setTimeout(function(){t.apply(i,s)},100)}))},n.prototype.search=function(e){var n=this.docs;if(e.length<3)this.$results.hide().empty();else{var s=t.map(this.index.search(e),function(e){return t.grep(n,function(t){return t.id===parseInt(e.ref,10)})[0]});this.displayResults(s),this.onResultShown()}},n.prototype.displayResults=function(e){var n=this.$results;if(n.empty(),0===e.length?n.append(this.emptyMsg):(this.titleMsg&&0!==this.titleMsg.length&&n.append(this.titleMsg),n.append(this.template({docs:e}))),n.show(),e.length>0){var s,i;log4javascript.getLogger("j1.lunr").info("\npost cleanup of tags and categories"),t(".sr-tags").each(function(){i=t(this).html().replace(/^\s+(.*)(\s+·\s+$)/,"$1"),t(this).text(i)}),t(".sr-categories").each(function(){s=t(this).html().replace(/^(.*)(\s+·\s+$)/,"$1"),t(this).text(s)})}},n.prototype.populateSearchFromQuery=function(){var t=new URI(window.location.search.toString()).search(!0);t.hasOwnProperty("q")&&(this.$elem.val(t.q),this.search(t.q.toString()))},n}();t.fn.lunrSearch=function(e){return e=t.extend({},t.fn.lunrSearch.defaults,e),new n(this,e),this},t.fn.lunrSearch.defaults={index_file:"/assets/data/lunr-index.json",results:"#search-results",template:"#search-results-template",titleMsg:"<h1>Search results<h1>",emptyMsg:"<p>Nothing found.</p>",onResultShown:function(){}}}(jQuery);
@@ -2581,7 +2581,7 @@ MSSliderEvent.DESTROY = 'ms_destroy';
2581
2581
 
2582
2582
  "use strict";
2583
2583
 
2584
- window.MasterSlider = function(){
2584
+ window.MasterSlider = function() {
2585
2585
 
2586
2586
  // Default Options
2587
2587
  this.options = {