j1-template 2020.0.19 → 2020.0.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (506) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/blocks/ads/ad.html +2 -2
  3. data/_includes/themes/j1/blocks/footer/boxes/about_box.proc +1 -1
  4. data/_includes/themes/j1/blocks/footer/boxes/links_box.proc +3 -3
  5. data/_includes/themes/j1/blocks/footer/boxes/news_box.proc +1 -1
  6. data/_includes/themes/j1/blocks/footer/generator.html +2 -2
  7. data/_includes/themes/j1/layouts/content_generator_blog_archive.html +11 -11
  8. data/_includes/themes/j1/layouts/content_generator_collection.html +2 -2
  9. data/_includes/themes/j1/layouts/content_generator_page.html +4 -4
  10. data/_includes/themes/j1/layouts/content_generator_post.html +64 -162
  11. data/_includes/themes/j1/layouts/layout_metadata_generator.html +2 -2
  12. data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +15 -1
  13. data/_includes/themes/j1/modules/connectors/ads +2 -2
  14. data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +2 -4
  15. data/_includes/themes/j1/modules/connectors/analytics +2 -2
  16. data/_includes/themes/j1/modules/connectors/comment/disqus.html +38 -25
  17. data/_includes/themes/j1/modules/connectors/comments +2 -2
  18. data/_includes/themes/j1/modules/connectors/translator +2 -2
  19. data/_includes/themes/j1/modules/navigator/generator.html +17 -8
  20. data/_includes/themes/j1/modules/navigator/procedures/topsearch.proc +36 -26
  21. data/_includes/themes/j1/procedures/global/attributes_loader.proc +117 -0
  22. data/_includes/themes/j1/procedures/global/create_bs_button.proc +4 -3
  23. data/_includes/themes/j1/procedures/global/create_word_cloud.proc +17 -13
  24. data/_includes/themes/j1/procedures/global/get_documents_dir.proc +1 -1
  25. data/_includes/themes/j1/procedures/global/set_env_entry_document.proc +3 -3
  26. data/_includes/themes/j1/procedures/global/setup.proc +9 -9
  27. data/_includes/themes/j1/procedures/layouts/content_writer.proc +1 -2
  28. data/_includes/themes/j1/procedures/layouts/module_writer.proc +1 -1
  29. data/_includes/themes/j1/procedures/posts/collate_calendar.proc +1 -1
  30. data/_includes/themes/j1/procedures/posts/collate_list.proc +1 -1
  31. data/_includes/themes/j1/procedures/posts/collate_timeline.proc +18 -17
  32. data/_includes/themes/j1/procedures/posts/create_series_header.proc +9 -5
  33. data/_layouts/default.html +3 -3
  34. data/_layouts/home.html +2 -2
  35. data/apps/public/cc/cc.yml +37 -38
  36. data/assets/data/authclient.html +2 -2
  37. data/assets/data/banner.html +25 -21
  38. data/assets/data/carousel.json +1 -1
  39. data/assets/data/cookiebar.html +17 -13
  40. data/assets/data/fam.html +124 -0
  41. data/assets/data/footer.html +1 -1
  42. data/assets/data/galleries.json +1 -1
  43. data/assets/data/gallery_customizer.html +19 -7
  44. data/assets/data/mdi_icons.json +1 -1
  45. data/assets/data/menu.html +2 -2
  46. data/assets/data/mmenu.html +2 -2
  47. data/assets/data/mmenu_sidebar.html +4 -4
  48. data/assets/data/mmenu_toc.html +1 -1
  49. data/assets/data/panel.html +113 -67
  50. data/assets/data/quicklinks.html +16 -16
  51. data/assets/data/themes.json +9 -9
  52. data/assets/data/twa_v1.json +1 -1
  53. data/assets/error_pages/HTTP204.html +1 -0
  54. data/assets/error_pages/HTTP400.html +3 -2
  55. data/assets/error_pages/HTTP401.html +3 -2
  56. data/assets/error_pages/HTTP403.html +3 -2
  57. data/assets/error_pages/HTTP404.html +3 -2
  58. data/assets/error_pages/HTTP500.html +3 -2
  59. data/assets/error_pages/HTTP501.html +3 -2
  60. data/assets/error_pages/HTTP502.html +3 -2
  61. data/assets/error_pages/HTTP503.html +3 -2
  62. data/assets/error_pages/HTTP520.html +3 -2
  63. data/assets/error_pages/HTTP521.html +3 -2
  64. data/assets/error_pages/HTTP533.html +3 -2
  65. data/assets/themes/j1/adapter/js/algolia.js +2 -2
  66. data/assets/themes/j1/adapter/js/attic.js +2 -2
  67. data/assets/themes/j1/adapter/js/{mdb.js → bmd.js} +11 -11
  68. data/assets/themes/j1/adapter/js/carousel.js +6 -6
  69. data/assets/themes/j1/adapter/js/clipboard.js +3 -3
  70. data/assets/themes/j1/adapter/js/cookiebar.js +1 -1
  71. data/assets/themes/j1/adapter/js/{ssm.js → fam.js} +275 -148
  72. data/assets/themes/j1/adapter/js/framer.js +74 -62
  73. data/assets/themes/j1/adapter/js/gallery_customizer.js +4 -3
  74. data/assets/themes/j1/adapter/js/j1.js +25 -19
  75. data/assets/themes/j1/adapter/js/jf_gallery.js +4 -4
  76. data/assets/themes/j1/adapter/js/lightbox.js +2 -2
  77. data/assets/themes/j1/adapter/js/logger.js +2 -2
  78. data/assets/themes/j1/adapter/js/{searcher.js → lunr_search.js} +68 -65
  79. data/assets/themes/j1/adapter/js/mmenu.js +16 -10
  80. data/assets/themes/j1/adapter/js/navigator.js +81 -60
  81. data/assets/themes/j1/adapter/js/rouge.js +246 -0
  82. data/assets/themes/j1/adapter/js/rtable.js +181 -0
  83. data/assets/themes/j1/adapter/js/themer.js +63 -110
  84. data/assets/themes/j1/adapter/js/toccer.js +72 -32
  85. data/assets/themes/j1/core/css/animate.css +15 -15
  86. data/assets/themes/j1/core/css/bootstrap.css +0 -14
  87. data/assets/themes/j1/core/css/custom.scss +28 -0
  88. data/assets/themes/j1/core/css/globals.css +14523 -0
  89. data/assets/themes/j1/core/css/globals.min.css +1 -0
  90. data/assets/themes/j1/core/css/globals.scss +28 -0
  91. data/assets/themes/j1/core/css/{icons-fontawesome.css → icon-fonts/fontawesome.css} +17 -17
  92. data/assets/themes/j1/core/css/{icons-fontawesome.min.css → icon-fonts/fontawesome.min.css} +0 -0
  93. data/assets/themes/j1/core/css/{icons-iconify.css → icon-fonts/iconify.css} +15 -15
  94. data/assets/themes/j1/core/css/{icons-iconify.min.css → icon-fonts/iconify.min.css} +0 -0
  95. data/assets/themes/j1/core/css/{icons-materialdesign.css → icon-fonts/materialdesign.css} +17 -17
  96. data/assets/themes/j1/core/css/{icons-materialdesign.min.css → icon-fonts/materialdesign.min.css} +0 -0
  97. data/assets/themes/j1/core/css/{icons-twemoji.css → icon-fonts/twemoji.css} +18 -18
  98. data/assets/themes/j1/core/css/{icons-twemoji.min.css → icon-fonts/twemoji.min.css} +0 -0
  99. data/assets/themes/j1/core/css/{theme-extensions.css → theme_extensions.css} +3625 -1816
  100. data/assets/themes/j1/core/css/theme_extensions.min.css +1 -0
  101. data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.css +7171 -0
  102. data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.min.css +6 -0
  103. data/assets/themes/j1/core/css/{uno-dark.css → themes/uno-dark/bootstrap.css} +548 -316
  104. data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.min.css +6 -0
  105. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.css +22519 -0
  106. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css +8 -0
  107. data/assets/themes/j1/core/css/uno.css +5284 -15518
  108. data/assets/themes/j1/core/css/uno.min.css +1 -8
  109. data/assets/themes/j1/core/css/uno.scss +28 -0
  110. data/assets/themes/j1/core/css/vendor.css +102 -73
  111. data/assets/themes/j1/core/css/vendor.min.css +1 -1
  112. data/assets/themes/j1/core/css/vendor.scss +28 -0
  113. data/assets/themes/j1/core/js/template.js +6 -11
  114. data/assets/themes/j1/core/js/template.js.map +1 -1
  115. data/assets/themes/j1/core/js/template.min.js +1 -1
  116. data/assets/themes/j1/modules/backstretch/js/backstretch.js +12 -13
  117. data/assets/themes/j1/modules/backstretch/js/backstretch.min.js +12 -13
  118. data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.full.js +6930 -0
  119. data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js +6 -0
  120. data/assets/themes/j1/modules/carousel/css/carousel.css +8 -9
  121. data/assets/themes/j1/modules/carousel/css/carousel.min.css +7 -9
  122. data/assets/themes/j1/modules/carousel/css/carousel_transitions.css +7 -8
  123. data/assets/themes/j1/modules/carousel/css/carousel_transitions.min.css +7 -9
  124. data/assets/themes/j1/modules/carousel/css/theme/uno.css +39 -48
  125. data/assets/themes/j1/modules/carousel/css/theme/uno.min.css +8 -9
  126. data/assets/themes/j1/modules/cash/js/cash.js +1374 -0
  127. data/assets/themes/j1/modules/cash/js/cash.min.js +42 -0
  128. data/assets/themes/j1/modules/clipboard/css/theme/uno.css +9 -9
  129. data/assets/themes/j1/modules/clipboard/css/theme/uno.min.css +8 -45
  130. data/assets/themes/j1/modules/fam/css/uno/fam.css +369 -0
  131. data/assets/themes/j1/modules/fam/js/fam.js +477 -0
  132. data/assets/themes/j1/modules/iframeResizer/examples/frame.nested.html +1 -1
  133. data/assets/themes/j1/modules/iframeResizer/js/{iframeResizer.js → resizer.js} +0 -0
  134. data/assets/themes/j1/modules/iframeResizer/js/{iframeResizer.map → resizer.map} +0 -0
  135. data/assets/themes/j1/modules/iframeResizer/js/{iframeResizer.min.js → resizer.min.js} +0 -0
  136. data/assets/themes/j1/modules/jquery/js/jquery.js +7 -4
  137. data/assets/themes/j1/modules/jquery/js/jquery.min.js +2 -2
  138. data/assets/themes/j1/modules/jquery/js/require.js +2145 -0
  139. data/assets/themes/j1/modules/jquery/js/require.min.js +5 -0
  140. data/assets/themes/j1/modules/justifiedGallery/css/theme/uno.css +13 -13
  141. data/assets/themes/j1/modules/justifiedGallery/css/theme/uno.min.css +8 -31
  142. data/assets/themes/j1/modules/lightGallery/css/themes/uno.css +7 -8
  143. data/assets/themes/j1/modules/lightGallery/css/themes/uno.min.css +8 -10
  144. data/assets/themes/j1/modules/lightbox/css/lightbox.css +11 -12
  145. data/assets/themes/j1/modules/lightbox/css/lightbox.min.css +11 -12
  146. data/assets/themes/j1/modules/lightbox/css/theme/uno.css +7 -7
  147. data/assets/themes/j1/modules/lightbox/css/theme/uno.min.css +7 -8
  148. data/assets/themes/j1/modules/lightbox/js/lightbox.js +12 -13
  149. data/assets/themes/j1/modules/lightbox/js/lightbox.min.js +11 -27
  150. data/assets/themes/j1/modules/lunrSearch/css/lunr_search.css +32 -0
  151. data/assets/themes/j1/modules/lunrSearch/css/lunr_search.min.css +25 -0
  152. data/assets/themes/j1/modules/lunrSearch/js/dateformat.js +125 -0
  153. data/assets/themes/j1/modules/lunrSearch/js/dateformat.min.js +14 -0
  154. data/assets/themes/j1/modules/lunrSearch/js/lunr.js +3475 -0
  155. data/assets/themes/j1/modules/lunrSearch/js/lunr.min.js +51 -0
  156. data/assets/themes/j1/modules/lunrSearch/js/lunr_search.js +184 -0
  157. data/assets/themes/j1/modules/lunrSearch/js/lunr_search.min.js +17 -0
  158. data/assets/themes/j1/modules/lunrSearch/js/mustache.js +772 -0
  159. data/assets/themes/j1/modules/lunrSearch/js/mustache.min.js +772 -0
  160. data/assets/themes/j1/modules/lunrSearch/js/uri.js +2340 -0
  161. data/assets/themes/j1/modules/lunrSearch/js/uri.min.js +93 -0
  162. data/assets/themes/j1/modules/materialize/js/anime.js +1283 -0
  163. data/assets/themes/j1/modules/materialize/js/anime.min.js +34 -0
  164. data/assets/themes/j1/modules/materialize/js/autocomplete.js +450 -0
  165. data/assets/themes/j1/modules/materialize/js/buttons.js +409 -0
  166. data/assets/themes/j1/modules/materialize/js/cards.js +40 -0
  167. data/assets/themes/j1/modules/materialize/js/carousel.js +717 -0
  168. data/assets/themes/j1/modules/materialize/js/cash-dom.js +1044 -0
  169. data/assets/themes/j1/modules/materialize/js/cash.js +960 -0
  170. data/assets/themes/j1/modules/materialize/js/characterCounter.js +136 -0
  171. data/assets/themes/j1/modules/materialize/js/chips.js +481 -0
  172. data/assets/themes/j1/modules/materialize/js/collapsible.js +275 -0
  173. data/assets/themes/j1/modules/materialize/js/component.js +44 -0
  174. data/assets/themes/j1/modules/materialize/js/datepicker.js +975 -0
  175. data/assets/themes/j1/modules/materialize/js/dropdown.js +617 -0
  176. data/assets/themes/j1/modules/materialize/js/forms.js +275 -0
  177. data/assets/themes/j1/modules/materialize/js/global.js +427 -0
  178. data/assets/themes/j1/modules/materialize/js/materialbox.js +453 -0
  179. data/assets/themes/j1/modules/materialize/js/modal.js +382 -0
  180. data/assets/themes/j1/modules/materialize/js/parallax.js +138 -0
  181. data/assets/themes/j1/modules/materialize/js/pushpin.js +145 -0
  182. data/assets/themes/j1/modules/materialize/js/range.js +263 -0
  183. data/assets/themes/j1/modules/materialize/js/ripple.js +335 -0
  184. data/assets/themes/j1/modules/materialize/js/scrollspy.js +295 -0
  185. data/assets/themes/j1/modules/materialize/js/select.js +432 -0
  186. data/assets/themes/j1/modules/materialize/js/sidenav.js +580 -0
  187. data/assets/themes/j1/modules/materialize/js/slider.js +359 -0
  188. data/assets/themes/j1/modules/materialize/js/tabs.js +402 -0
  189. data/assets/themes/j1/modules/materialize/js/tapTarget.js +314 -0
  190. data/assets/themes/j1/modules/materialize/js/timepicker.js +647 -0
  191. data/assets/themes/j1/modules/materialize/js/toasts.js +310 -0
  192. data/assets/themes/j1/modules/materialize/js/tooltip.js +303 -0
  193. data/assets/themes/j1/modules/materialize/js/waves.js +335 -0
  194. data/assets/themes/j1/modules/materialize/scss/components/_badges.scss +55 -0
  195. data/assets/themes/j1/modules/materialize/scss/components/_buttons.scss +322 -0
  196. data/assets/themes/j1/modules/materialize/scss/components/_cards.scss +195 -0
  197. data/assets/themes/j1/modules/materialize/scss/components/_carousel.scss +90 -0
  198. data/assets/themes/j1/modules/materialize/scss/components/_chips.scss +90 -0
  199. data/assets/themes/j1/modules/materialize/scss/components/_collapsible.scss +91 -0
  200. data/assets/themes/j1/modules/materialize/scss/components/_color-classes.scss +32 -0
  201. data/assets/themes/j1/modules/materialize/scss/components/_color-variables.scss +370 -0
  202. data/assets/themes/j1/modules/materialize/scss/components/_datepicker.scss +191 -0
  203. data/assets/themes/j1/modules/materialize/scss/components/_dropdown.scss +85 -0
  204. data/assets/themes/j1/modules/materialize/scss/components/_global.scss +769 -0
  205. data/assets/themes/j1/modules/materialize/scss/components/_grid.scss +156 -0
  206. data/assets/themes/j1/modules/materialize/scss/components/_icons-material-design.scss +5 -0
  207. data/assets/themes/j1/modules/materialize/scss/components/_materialbox.scss +43 -0
  208. data/assets/themes/j1/modules/materialize/scss/components/_modal.scss +94 -0
  209. data/assets/themes/j1/modules/materialize/scss/components/_navbar.scss +208 -0
  210. data/assets/themes/j1/modules/materialize/scss/components/_normalize.scss +447 -0
  211. data/assets/themes/j1/modules/materialize/scss/components/_preloader.scss +334 -0
  212. data/assets/themes/j1/modules/materialize/scss/components/_pulse.scss +34 -0
  213. data/assets/themes/j1/modules/materialize/scss/components/_sidenav.scss +216 -0
  214. data/assets/themes/j1/modules/materialize/scss/components/_slider.scss +92 -0
  215. data/assets/themes/j1/modules/materialize/scss/components/_table_of_contents.scss +33 -0
  216. data/assets/themes/j1/modules/materialize/scss/components/_tabs.scss +99 -0
  217. data/assets/themes/j1/modules/materialize/scss/components/_tapTarget.scss +103 -0
  218. data/assets/themes/j1/modules/materialize/scss/components/_timepicker.scss +183 -0
  219. data/assets/themes/j1/modules/materialize/scss/components/_toast.scss +58 -0
  220. data/assets/themes/j1/modules/materialize/scss/components/_tooltip.scss +32 -0
  221. data/assets/themes/j1/modules/materialize/scss/components/_transitions.scss +13 -0
  222. data/assets/themes/j1/modules/materialize/scss/components/_typography.scss +60 -0
  223. data/assets/themes/j1/modules/materialize/scss/components/_variables.scss +349 -0
  224. data/assets/themes/j1/modules/materialize/scss/components/_waves.scss +114 -0
  225. data/assets/themes/j1/modules/materialize/scss/components/forms/_checkboxes.scss +200 -0
  226. data/assets/themes/j1/modules/materialize/scss/components/forms/_file-input.scss +44 -0
  227. data/assets/themes/j1/modules/materialize/scss/components/forms/_forms.scss +22 -0
  228. data/assets/themes/j1/modules/materialize/scss/components/forms/_input-fields.scss +354 -0
  229. data/assets/themes/j1/modules/materialize/scss/components/forms/_radio-buttons.scss +115 -0
  230. data/assets/themes/j1/modules/materialize/scss/components/forms/_range.scss +161 -0
  231. data/assets/themes/j1/modules/materialize/scss/components/forms/_select.scss +180 -0
  232. data/assets/themes/j1/modules/materialize/scss/components/forms/_switches.scss +89 -0
  233. data/assets/themes/j1/modules/materialize/scss/materialize.scss +41 -0
  234. data/assets/themes/j1/modules/mmenuLight/css/mmenu.css +11 -11
  235. data/assets/themes/j1/modules/mmenuLight/css/theme/uno.min.css +37 -11
  236. data/assets/themes/j1/modules/popper/js/popper.js +1 -1
  237. data/assets/themes/j1/modules/popper/js/popper.js.map +1 -1
  238. data/assets/themes/j1/modules/popper/js/popper.min.js.map +1 -1
  239. data/assets/themes/j1/modules/rouge/js/select.js +25 -0
  240. data/assets/themes/j1/modules/rtable/LICENSE +22 -0
  241. data/assets/themes/j1/modules/rtable/README.md +418 -0
  242. data/assets/themes/j1/modules/rtable/css/tablesaw.stackonly.css +148 -0
  243. data/assets/themes/j1/modules/rtable/css/theme/uno.css +191 -0
  244. data/assets/themes/j1/modules/rtable/css/theme/uno.min.css +191 -0
  245. data/assets/themes/j1/modules/rtable/js/rtable.js +692 -0
  246. data/assets/themes/j1/modules/rtable/js/rtable.min.js +690 -0
  247. data/assets/themes/j1/modules/rtable/js/tablesaw-init.js +18 -0
  248. data/assets/themes/j1/modules/rtable/js/tablesaw.stackonly.js +2371 -0
  249. data/assets/themes/j1/modules/{bsThemeSwitcher → themeSwitcher}/js/switcher.js +15 -17
  250. data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +26 -0
  251. data/assets/themes/j1/modules/twemoji/css/picker/twemoji-picker.css +1 -1
  252. data/assets/themes/j1/modules/twemoji/css/picker/twemoji-picker.min.css +1 -1
  253. data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.js +2 -2
  254. data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.min.js +2 -257
  255. data/assets/themes/j1/modules/twemoji/js/twemoji.js +11 -11
  256. data/assets/themes/j1/modules/twemoji/js/twemoji.min.js +11 -12
  257. data/lib/j1/commands/generate.rb +6 -6
  258. data/lib/j1/version.rb +1 -1
  259. data/lib/j1_app/j1_auth_manager/config.rb +2 -2
  260. data/lib/starter_web/Gemfile +12 -16
  261. data/lib/starter_web/_config.yml +162 -22
  262. data/lib/starter_web/_data/apps/carousel.yml +10 -10
  263. data/lib/starter_web/_data/apps/justified_gallery.yml +44 -10
  264. data/lib/starter_web/_data/blocks/banner.yml +32 -27
  265. data/lib/starter_web/_data/blocks/defaults/banner.yml +14 -13
  266. data/lib/starter_web/_data/blocks/defaults/footer.yml +1 -1
  267. data/lib/starter_web/_data/blocks/defaults/panel.yml +3 -2
  268. data/lib/starter_web/_data/blocks/footer.yml +1 -1
  269. data/lib/starter_web/_data/blocks/panel.yml +24 -25
  270. data/lib/starter_web/_data/{template_settings.yml → j1_config.yml} +64 -11
  271. data/lib/starter_web/_data/layouts/home.yml +20 -10
  272. data/lib/starter_web/_data/layouts/page.yml +10 -0
  273. data/lib/starter_web/_data/layouts/post.yml +10 -0
  274. data/lib/starter_web/_data/modules/defaults/cookiebar.yml +3 -1
  275. data/lib/starter_web/_data/modules/defaults/{ssm.yml → fam.yml} +12 -15
  276. data/lib/starter_web/_data/modules/defaults/lunr_search.yml +171 -0
  277. data/lib/starter_web/_data/modules/defaults/navigator.yml +5 -5
  278. data/lib/starter_web/_data/modules/defaults/themer.yml +8 -13
  279. data/lib/starter_web/_data/modules/defaults/toccer.yml +4 -2
  280. data/lib/starter_web/_data/modules/fam.yml +158 -0
  281. data/lib/starter_web/_data/modules/{back2top.yml → lunr_search.yml} +15 -9
  282. data/lib/starter_web/_data/modules/navigator.yml +2 -2
  283. data/lib/starter_web/_data/modules/navigator_menu.yml +16 -10
  284. data/lib/starter_web/_data/modules/themer.yml +0 -18
  285. data/lib/starter_web/_data/modules/toccer.yml +0 -73
  286. data/lib/starter_web/_data/resources.yml +195 -67
  287. data/lib/starter_web/_includes/attributes.asciidoc +194 -0
  288. data/lib/starter_web/_includes/breadcrumbs.html +11 -0
  289. data/lib/starter_web/_includes/documents/licenses/mit.asciidoc +19 -0
  290. data/lib/starter_web/{collections/posts/private → _includes/documents}/readme +0 -0
  291. data/lib/starter_web/_includes/tables/jekyll_variables.asciidoc +45 -0
  292. data/lib/starter_web/_includes/tables/template_variables.asciidoc +46 -0
  293. data/lib/starter_web/_plugins/debug.rb +0 -1
  294. data/lib/starter_web/_plugins/filters.rb +0 -1
  295. data/lib/starter_web/_plugins/{lorem-inline.rb → lorem_inline.rb} +1 -2
  296. data/lib/starter_web/_plugins/lunr_index.rb +313 -0
  297. data/lib/starter_web/_plugins/prettify.rb +0 -3
  298. data/lib/starter_web/_plugins/simple_search_filter.rb +0 -1
  299. data/lib/starter_web/_plugins/symlink_watcher.rb +2 -3
  300. data/lib/starter_web/assets/images/modules/attics/banner/lunr-banner-1280x800.jpg +0 -0
  301. data/lib/starter_web/assets/images/modules/attics/katie-moum-1920x1280.jpg +0 -0
  302. data/lib/starter_web/assets/images/modules/attics/tldr-1920x800.jpg +0 -0
  303. data/lib/starter_web/assets/images/pages/winlogbeat/coordinate-map.png +0 -0
  304. data/lib/starter_web/assets/images/pages/winlogbeat/kibana-powershell.jpg +0 -0
  305. data/lib/starter_web/assets/images/pages/winlogbeat/option_ignore_outgoing.png +0 -0
  306. data/lib/starter_web/assets/images/pages/winlogbeat/winlogbeat-dashboard.png +0 -0
  307. data/lib/starter_web/collections/posts/{protected → private/_posts}/readme +0 -0
  308. data/{assets/README.md → lib/starter_web/collections/posts/protected/_posts/readme} +0 -0
  309. data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1-template.adoc.erb +77 -80
  310. data/lib/starter_web/collections/posts/public/featured/_posts/2018-05-01-confusion-about-base-url.adoc +21 -10
  311. data/lib/starter_web/collections/posts/public/featured/_posts/2019-05-01-top-open-source-static-site-generators.adoc +41 -31
  312. data/lib/starter_web/collections/posts/public/featured/_posts/2019-06-01-about-cookies.adoc +32 -27
  313. data/lib/starter_web/collections/posts/public/featured/_posts/_includes/attributes.asciidoc +38 -0
  314. data/lib/starter_web/collections/posts/public/featured/_posts/_includes/documents/readme +0 -0
  315. data/lib/starter_web/collections/posts/public/featured/_posts/{000_includes → _includes/documents}/unsplash-badge.asciidoc +0 -0
  316. data/lib/starter_web/collections/posts/public/featured/_posts/_includes/tables/readme +0 -0
  317. data/lib/starter_web/collections/posts/public/series/_posts/2018-11-01-docker-using-shared-folders.adoc +494 -502
  318. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-test-series.adoc +144 -0
  319. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-test-series.adoc +146 -0
  320. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-test-series.adoc +146 -0
  321. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-04-post-test-series.adoc +146 -0
  322. data/lib/starter_web/collections/posts/public/{featured/_posts/000_includes → series/_posts/_includes}/attributes.asciidoc +8 -18
  323. data/lib/starter_web/collections/posts/public/series/_posts/{000_includes → _includes}/documents/100-docker-using-shared-folders.asciidoc +0 -0
  324. data/lib/starter_web/collections/posts/public/series/_posts/{000_includes → _includes}/documents/loop.sh +0 -0
  325. data/lib/starter_web/collections/posts/public/series/_posts/{000_includes → _includes}/tables/debug_variables.asciidoc +0 -0
  326. data/lib/starter_web/collections/posts/public/test_posts/_posts/2020-09-11-test_post.adoc +218 -0
  327. data/lib/starter_web/collections/posts/public/{wikipedia/_posts/000_includes → test_posts/_posts/_includes}/attributes.asciidoc +9 -21
  328. data/lib/starter_web/collections/posts/public/test_posts/_posts/_includes/documents/readme +0 -0
  329. data/lib/starter_web/collections/posts/public/{wikipedia/_posts/000_includes → test_posts/_posts/_includes}/tables/debug_variables.asciidoc +0 -0
  330. data/lib/starter_web/collections/posts/public/test_posts/_posts/_includes/tables/readme +0 -0
  331. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-20-minneapolis.adoc +16 -8
  332. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc +2 -7
  333. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-26-columbia-river.adoc +2 -6
  334. data/lib/starter_web/collections/posts/public/wikipedia/_posts/_includes/attributes.asciidoc +37 -0
  335. data/lib/starter_web/collections/posts/public/wikipedia/_posts/_includes/documents/readme +0 -0
  336. data/lib/starter_web/collections/posts/public/wikipedia/_posts/_includes/tables/readme +0 -0
  337. data/lib/starter_web/index.html +16 -10
  338. data/lib/starter_web/package.json +5 -2
  339. data/lib/starter_web/pages/protected/site_search.adoc +8 -19
  340. data/lib/starter_web/pages/public/about/about_site.adoc +0 -2
  341. data/lib/starter_web/pages/public/about/become_a_patron.adoc +1 -3
  342. data/lib/starter_web/pages/public/blog/navigator/archive.html +34 -9
  343. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +40 -16
  344. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +32 -8
  345. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +8 -4
  346. data/lib/starter_web/pages/public/blog/navigator/index.html +6 -3
  347. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/100_meet_and_greet_jekyll.adoc +15 -21
  348. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/200_preparations.adoc +32 -27
  349. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/300_first_awesome_web.adoc +32 -27
  350. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/{000_includes → _includes}/attributes.asciidoc +15 -13
  351. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/_includes/documents/100_meet_and_greet_jekyll.asciidoc +31 -0
  352. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/{000_includes → _includes}/documents/200_preparations.asciidoc +0 -0
  353. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/{000_includes → _includes}/documents/300_first_awesome_web.asciidoc +0 -0
  354. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/{000_includes → _includes}/parts.asciidoc +1 -1
  355. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/_includes/tables/debug_variables.asciidoc +48 -0
  356. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/_includes/tables/readme +0 -0
  357. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +76 -111
  358. data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +37 -45
  359. data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +51 -63
  360. data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +74 -80
  361. data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +64 -84
  362. data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +34 -42
  363. data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +281 -91
  364. data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +138 -52
  365. data/lib/starter_web/pages/public/learn/roundtrip/600_lunr.adoc +236 -0
  366. data/lib/starter_web/pages/public/learn/roundtrip/610_fam.adoc +294 -0
  367. data/lib/starter_web/pages/public/learn/roundtrip/{000_includes → _includes}/attributes.asciidoc +10 -29
  368. data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/100_gistblock.asciidoc +28 -0
  369. data/lib/starter_web/pages/public/learn/roundtrip/{000_includes → _includes}/documents/410_bottom_info.asciidoc +2 -2
  370. data/lib/starter_web/pages/public/learn/roundtrip/{000_includes → _includes}/documents/410_bottom_left_warning.asciidoc +2 -2
  371. data/lib/starter_web/pages/public/learn/roundtrip/{000_includes → _includes}/documents/410_bottom_right_danger.asciidoc +2 -2
  372. data/lib/starter_web/pages/public/learn/roundtrip/{000_includes → _includes}/documents/410_central_success.asciidoc +2 -2
  373. data/lib/starter_web/pages/public/learn/roundtrip/{000_includes → _includes}/documents/410_full_height_left_info.asciidoc +2 -2
  374. data/lib/starter_web/pages/public/learn/roundtrip/{000_includes → _includes}/documents/410_full_height_right_success.asciidoc +2 -2
  375. data/lib/starter_web/pages/public/learn/roundtrip/{000_includes → _includes}/documents/410_table_3_column.asciidoc +1 -1
  376. data/lib/starter_web/pages/public/learn/roundtrip/{000_includes → _includes}/documents/410_top_info.asciidoc +2 -2
  377. data/lib/starter_web/pages/public/learn/roundtrip/{000_includes → _includes}/documents/410_top_left_info.asciidoc +2 -2
  378. data/lib/starter_web/pages/public/learn/roundtrip/{000_includes → _includes}/documents/410_top_right_success.asciidoc +2 -2
  379. data/lib/starter_web/pages/public/learn/roundtrip/{000_includes → _includes}/documents/419_advanced_modals_demo.asciidoc +16 -16
  380. data/lib/starter_web/pages/public/learn/roundtrip/_includes/tables/readme +0 -0
  381. data/lib/starter_web/pages/public/learn/{whats_up.adoc → where_to_go.adoc} +31 -46
  382. data/lib/starter_web/pages/public/legal/de/100_impress.adoc +3 -2
  383. data/lib/starter_web/pages/public/legal/de/200_terms_of_use.adoc +2 -1
  384. data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +7 -12
  385. data/lib/starter_web/pages/public/legal/de/400_license_agreement.adoc +2 -1
  386. data/lib/starter_web/pages/public/legal/de/500_support.adoc +2 -1
  387. data/lib/starter_web/pages/public/legal/en/000_copyright.adoc +32 -28
  388. data/lib/starter_web/pages/public/legal/en/100_impress.adoc +12 -8
  389. data/lib/starter_web/pages/public/legal/en/200_terms_of_use.adoc +17 -12
  390. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +38 -36
  391. data/lib/starter_web/pages/public/legal/en/400_license_agreement.adoc +15 -6
  392. data/lib/starter_web/pages/public/legal/en/500_support.adoc +12 -4
  393. data/lib/starter_web/pages/public/legal/en/eu/cookie.policy.asciidoc +1 -1
  394. data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +68 -68
  395. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/attributes.asciidoc +22 -8
  396. data/lib/starter_web/pages/public/previewer/_includes/documents/licenses/mit.asciidoc +19 -0
  397. data/lib/starter_web/pages/public/previewer/_includes/documents/readme +0 -0
  398. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/mdi_icons/100_absolute_sizes.asciidoc +1 -1
  399. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/mdi_icons/110_bs_grid_sizes.asciidoc +1 -1
  400. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/mdi_icons/120_relative_sizes.asciidoc +1 -1
  401. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/mdi_icons/200_rotate.asciidoc +1 -1
  402. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/mdi_icons/300_flip.asciidoc +1 -1
  403. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/mdi_icons/400_spin_pulsed.asciidoc +1 -1
  404. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/mdi_icons/500_bw_color_palette.asciidoc +1 -1
  405. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/mdi_icons/510_bs_color_palette.asciidoc +1 -1
  406. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/mdi_icons/600_md_color_palette.asciidoc +1 -1
  407. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/mdi_icons/601_md_color_palette_indigo.asciidoc +1 -1
  408. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/mdi_icons/602_md_color_palette_pink.asciidoc +1 -1
  409. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/twitter_emoji/100_bs_sizes.asciidoc +1 -1
  410. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/twitter_emoji/100_relative_sizes.asciidoc +1 -1
  411. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/twitter_emoji/200_rotate.asciidoc +1 -1
  412. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/twitter_emoji/300_flip.asciidoc +1 -1
  413. data/lib/starter_web/pages/public/previewer/{000_includes → _includes}/tables/twitter_emoji/400_spin_pulsed.asciidoc +1 -1
  414. data/lib/starter_web/pages/public/previewer/bootstrap_theme.adoc +860 -595
  415. data/lib/starter_web/pages/public/previewer/iframer.adoc +48 -41
  416. data/lib/starter_web/pages/public/previewer/justified_gallery.html +15 -7
  417. data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +21 -26
  418. data/lib/starter_web/pages/public/previewer/rouge.adoc +205 -0
  419. data/lib/starter_web/pages/public/previewer/twitter_emoji_preview.adoc +21 -27
  420. data/lib/starter_web/pages/public/test_pages/_includes/attributes.asciidoc +49 -0
  421. data/lib/starter_web/pages/public/{learn/roundtrip/000_includes → test_pages/_includes}/documents/100_gistblock.asciidoc +0 -0
  422. data/lib/starter_web/pages/public/test_pages/_includes/tables/000_bem_specifiers.asciidoc +22 -0
  423. data/lib/starter_web/pages/public/test_pages/_includes/tables/000_specifier_examples.asciidoc +56 -0
  424. data/lib/starter_web/pages/public/test_pages/breadcrumbs_tester.adoc +62 -0
  425. data/lib/starter_web/pages/public/test_pages/carousel_captions.adoc +1045 -0
  426. data/lib/starter_web/pages/public/test_pages/deck_of_posts.adoc +165 -0
  427. data/lib/starter_web/pages/public/test_pages/floating_actions_button.adoc +523 -0
  428. data/lib/starter_web/pages/public/{learn/examples → test_pages}/floating_ad.adoc +8 -21
  429. data/lib/starter_web/pages/public/{learn/examples → test_pages}/floating_div.adoc +25 -38
  430. data/lib/starter_web/pages/public/test_pages/lunr_tester.adoc +89 -0
  431. data/lib/starter_web/pages/public/{000_nav_pagination_tester.adoc → test_pages/nav_pagination_tester.adoc} +9 -22
  432. data/lib/starter_web/pages/public/test_pages/page_attribute_tester.adoc +196 -0
  433. data/lib/starter_web/pages/public/test_pages/responsive_images.adoc +213 -0
  434. data/lib/starter_web/pages/public/test_pages/responsive_tables.adoc +210 -0
  435. data/lib/starter_web/pages/public/test_pages/toccer_tester.adoc +2245 -0
  436. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_includes/attributes.asciidoc +0 -0
  437. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_includes/documents/100_gistblock.asciidoc +0 -0
  438. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_includes/documents/410_bottom_info.asciidoc +0 -0
  439. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_includes/documents/410_bottom_left_warning.asciidoc +0 -0
  440. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_includes/documents/410_bottom_right_danger.asciidoc +0 -0
  441. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_includes/documents/410_central_success.asciidoc +0 -0
  442. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_includes/documents/410_full_height_left_info.asciidoc +0 -0
  443. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_includes/documents/410_full_height_right_success.asciidoc +0 -0
  444. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_includes/documents/410_table_3_column.asciidoc +1 -1
  445. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_includes/documents/410_top_info.asciidoc +0 -0
  446. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_includes/documents/410_top_left_info.asciidoc +0 -0
  447. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_includes/documents/410_top_right_success.asciidoc +0 -0
  448. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_includes/documents/419_advanced_modals_html.asciidoc +0 -0
  449. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/000_test_youtube_video.adoc +0 -0
  450. data/lib/starter_web/pages/public/{learn → test_pages}/vtutorials/100_basic_video.adoc +0 -0
  451. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  452. data/lib/starter_web/utilsrv/package.json +1 -1
  453. metadata +261 -146
  454. data/assets/data/jupyter/notebooks/_html/template.full.head.html +0 -75
  455. data/assets/data/jupyter/notebooks/_html/visualisation.html +0 -968
  456. data/assets/data/jupyter/notebooks/html/template.html +0 -50
  457. data/assets/data/jupyter/notebooks/html/visualisation.ok.html +0 -949
  458. data/assets/data/jupyter/notebooks/tutorial.ipynb +0 -169
  459. data/assets/data/jupyter/notebooks/visualisation.ipynb +0 -9413
  460. data/assets/data/search.json +0 -165
  461. data/assets/data/ssm.html +0 -242
  462. data/assets/themes/j1/adapter/js/back2top.js +0 -233
  463. data/assets/themes/j1/core/css/theme-extensions.min.css +0 -1
  464. data/assets/themes/j1/core/css/uno-dark.min.css +0 -6
  465. data/assets/themes/j1/modules/backstretch/js/backstretch.min.js.org +0 -1
  466. data/assets/themes/j1/modules/bootstrap/css/bootstrap.css +0 -10278
  467. data/assets/themes/j1/modules/bootstrap/css/bootstrap.css.map +0 -1
  468. data/assets/themes/j1/modules/bootstrap/css/bootstrap.min.css +0 -7
  469. data/assets/themes/j1/modules/bootstrap/css/bootstrap.min.css.map +0 -1
  470. data/assets/themes/j1/modules/bootstrap/js/bootstrap.js +0 -4420
  471. data/assets/themes/j1/modules/bootstrap/js/bootstrap.js.map +0 -1
  472. data/assets/themes/j1/modules/bootstrap/js/bootstrap.min.js +0 -7
  473. data/assets/themes/j1/modules/bootstrap/js/bootstrap.min.js.map +0 -1
  474. data/assets/themes/j1/modules/bsDatepicker/css/datepicker.css +0 -203
  475. data/assets/themes/j1/modules/bsDatepicker/css/theme/uno.css +0 -235
  476. data/assets/themes/j1/modules/bsDatepicker/js/datepicker.js +0 -509
  477. data/assets/themes/j1/modules/bsDatepicker/less/datepicker.less +0 -122
  478. data/assets/themes/j1/modules/bsThemeSwitcher/js/switcher.min.js +0 -20
  479. data/assets/themes/j1/modules/jekyllSearch/js/simple-jekyll-search.js +0 -468
  480. data/assets/themes/j1/modules/jekyllSearch/js/simple-jekyll-search.min.js +0 -6
  481. data/assets/themes/j1/modules/jqMouseWheel/README.md +0 -76
  482. data/assets/themes/j1/modules/jqMouseWheel/js/jquery.mousewheel.js +0 -221
  483. data/assets/themes/j1/modules/jqMouseWheel/js/jquery.mousewheel.min.js +0 -9
  484. data/assets/themes/j1/modules/noUISlider/LICENSE +0 -13
  485. data/assets/themes/j1/modules/noUISlider/css/nouislider.css +0 -260
  486. data/assets/themes/j1/modules/noUISlider/css/nouislider.min.css +0 -1
  487. data/assets/themes/j1/modules/noUISlider/js/nouislider.js +0 -2312
  488. data/assets/themes/j1/modules/noUISlider/js/nouislider.min.js +0 -3
  489. data/assets/themes/j1/modules/polyfills/js/msie.js +0 -140
  490. data/assets/themes/j1/modules/tocbot/css/theme/uno.css +0 -89
  491. data/assets/themes/j1/modules/tocbot/css/theme/uno.min.css +0 -89
  492. data/assets/themes/j1/modules/tocbot/css/tocbot.css +0 -75
  493. data/assets/themes/j1/modules/tocbot/css/tocbot.min.css +0 -19
  494. data/assets/themes/j1/modules/tocbot/js/tocbot.js +0 -19
  495. data/assets/themes/j1/modules/tocbot/js/tocbot.min.js +0 -19
  496. data/lib/starter_web/_data/modules/defaults/back2top.yml +0 -146
  497. data/lib/starter_web/_data/modules/defaults/cookie_consent.yml +0 -132
  498. data/lib/starter_web/_data/modules/defaults/stickybits.yml +0 -36
  499. data/lib/starter_web/_data/modules/ssm.yml +0 -142
  500. data/lib/starter_web/assets/images/modules/attics/welcome-1920x1280-bw.jpg +0 -0
  501. data/lib/starter_web/collections/posts/public/series/_posts/000_includes/attributes.asciidoc +0 -66
  502. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/000_includes/documents/100_meet_and_greet_jekyll.asciidoc +0 -31
  503. data/lib/starter_web/pages/public/learn/roundtrip/510_mdb_preview/000_includes/attributes.asciidoc +0 -69
  504. data/lib/starter_web/pages/public/learn/roundtrip/510_mdb_preview/000_includes/documents/100_buttons.asciidoc +0 -170
  505. data/lib/starter_web/pages/public/learn/roundtrip/510_mdb_preview/mdb_previewer.adoc +0 -52
  506. data/lib/starter_web/pages/public/learn/roundtrip/bs_tour.js +0 -98
@@ -0,0 +1,409 @@
1
+ (function($, anim) {
2
+ 'use strict';
3
+
4
+ let _defaults = {
5
+ direction: 'top',
6
+ hoverEnabled: true,
7
+ toolbarEnabled: false
8
+ };
9
+
10
+ $.fn.reverse = [].reverse;
11
+
12
+ // jadams, 2020-10-10, added class from main (materialize.js)
13
+ //
14
+ class Component {
15
+ /**
16
+ * Generic constructor for all components
17
+ * @constructor
18
+ * @param {Element} el
19
+ * @param {Object} options
20
+ */
21
+ constructor(classDef, el, options) {
22
+ // Display error if el is valid HTML Element
23
+ if (!(el instanceof Element)) {
24
+ console.error(Error(el + ' is not an HTML Element'));
25
+ }
26
+
27
+ // If exists, destroy and reinitialize in child
28
+ let ins = classDef.getInstance(el);
29
+ if (!!ins) {
30
+ ins.destroy();
31
+ }
32
+
33
+ this.el = el;
34
+ this.$el = cash(el);
35
+ }
36
+
37
+ /**
38
+ * Initializes components
39
+ * @param {class} classDef
40
+ * @param {Element | NodeList | jQuery} els
41
+ * @param {Object} options
42
+ */
43
+ static init(classDef, els, options) {
44
+ let instances = null;
45
+ if (els instanceof Element) {
46
+ instances = new classDef(els, options);
47
+ } else if (!!els && (els.jquery || els.cash || els instanceof NodeList)) {
48
+ let instancesArr = [];
49
+ for (let i = 0; i < els.length; i++) {
50
+ instancesArr.push(new classDef(els[i], options));
51
+ }
52
+ instances = instancesArr;
53
+ }
54
+ return instances;
55
+ }
56
+ }
57
+
58
+ /**
59
+ * @class
60
+ *
61
+ */
62
+ class FloatingActionButton extends Component {
63
+ /**
64
+ * Construct FloatingActionButton instance
65
+ * @constructor
66
+ * @param {Element} el
67
+ * @param {Object} options
68
+ */
69
+ constructor(el, options) {
70
+ super(FloatingActionButton, el, options);
71
+ this.el.M_FloatingActionButton = this;
72
+
73
+ /**
74
+ * Options for the fab
75
+ * @member FloatingActionButton#options
76
+ * @prop {Boolean} [direction] - Direction fab menu opens
77
+ * @prop {Boolean} [hoverEnabled=true] - Enable hover vs click
78
+ * @prop {Boolean} [toolbarEnabled=false] - Enable toolbar transition
79
+ */
80
+ this.options = $.extend({}, FloatingActionButton.defaults, options);
81
+
82
+ this.isOpen = false;
83
+ this.$anchor = this.$el.children('a').first();
84
+ this.$menu = this.$el.children('ul').first();
85
+ this.$floatingBtns = this.$el.find('ul .btn-floating');
86
+ this.$floatingBtnsReverse = this.$el.find('ul .btn-floating').reverse();
87
+ this.offsetY = 0;
88
+ this.offsetX = 0;
89
+
90
+ this.$el.addClass(`direction-${this.options.direction}`);
91
+ if (this.options.direction === 'top') {
92
+ this.offsetY = 40;
93
+ } else if (this.options.direction === 'right') {
94
+ this.offsetX = -40;
95
+ } else if (this.options.direction === 'bottom') {
96
+ this.offsetY = -40;
97
+ } else {
98
+ this.offsetX = 40;
99
+ }
100
+ this._setupEventHandlers();
101
+ }
102
+
103
+ static get defaults() {
104
+ return _defaults;
105
+ }
106
+
107
+ static init(els, options) {
108
+ return super.init(this, els, options);
109
+ }
110
+
111
+ /**
112
+ * Get Instance
113
+ */
114
+ static getInstance(el) {
115
+ let domElem = !!el.jquery ? el[0] : el;
116
+ return domElem.M_FloatingActionButton;
117
+ }
118
+
119
+ /**
120
+ * Teardown component
121
+ */
122
+ destroy() {
123
+ this._removeEventHandlers();
124
+ this.el.M_FloatingActionButton = undefined;
125
+ }
126
+
127
+ /**
128
+ * Setup Event Handlers
129
+ */
130
+ _setupEventHandlers() {
131
+ this._handleFABClickBound = this._handleFABClick.bind(this);
132
+ this._handleOpenBound = this.open.bind(this);
133
+ this._handleCloseBound = this.close.bind(this);
134
+
135
+ if (this.options.hoverEnabled && !this.options.toolbarEnabled) {
136
+ this.el.addEventListener('mouseenter', this._handleOpenBound);
137
+ this.el.addEventListener('mouseleave', this._handleCloseBound);
138
+ } else {
139
+ this.el.addEventListener('click', this._handleFABClickBound);
140
+ }
141
+ }
142
+
143
+ /**
144
+ * Remove Event Handlers
145
+ */
146
+ _removeEventHandlers() {
147
+ if (this.options.hoverEnabled && !this.options.toolbarEnabled) {
148
+ this.el.removeEventListener('mouseenter', this._handleOpenBound);
149
+ this.el.removeEventListener('mouseleave', this._handleCloseBound);
150
+ } else {
151
+ this.el.removeEventListener('click', this._handleFABClickBound);
152
+ }
153
+ }
154
+
155
+ /**
156
+ * Handle FAB Click
157
+ */
158
+ _handleFABClick() {
159
+ if (this.isOpen) {
160
+ this.close();
161
+ } else {
162
+ this.open();
163
+ }
164
+ }
165
+
166
+ /**
167
+ * Handle Document Click
168
+ * @param {Event} e
169
+ */
170
+ _handleDocumentClick(e) {
171
+ if (!$(e.target).closest(this.$menu).length) {
172
+ this.close();
173
+ }
174
+ }
175
+
176
+ /**
177
+ * Open FAB
178
+ */
179
+ open() {
180
+ if (this.isOpen) {
181
+ return;
182
+ }
183
+
184
+ if (this.options.toolbarEnabled) {
185
+ this._animateInToolbar();
186
+ } else {
187
+ this._animateInFAB();
188
+ }
189
+ this.isOpen = true;
190
+ }
191
+
192
+ /**
193
+ * Close FAB
194
+ */
195
+ close() {
196
+ if (!this.isOpen) {
197
+ return;
198
+ }
199
+
200
+ if (this.options.toolbarEnabled) {
201
+ window.removeEventListener('scroll', this._handleCloseBound, true);
202
+ document.body.removeEventListener('click', this._handleDocumentClickBound, true);
203
+ this._animateOutToolbar();
204
+ } else {
205
+ this._animateOutFAB();
206
+ }
207
+ this.isOpen = false;
208
+ }
209
+
210
+ /**
211
+ * Classic FAB Menu open
212
+ */
213
+ _animateInFAB() {
214
+ this.$el.addClass('active');
215
+
216
+ let time = 0;
217
+ this.$floatingBtnsReverse.each((el) => {
218
+ anim({
219
+ targets: el,
220
+ opacity: 1,
221
+ scale: [0.4, 1],
222
+ translateY: [this.offsetY, 0],
223
+ translateX: [this.offsetX, 0],
224
+ duration: 275,
225
+ delay: time,
226
+ easing: 'easeInOutQuad'
227
+ });
228
+ time += 40;
229
+ });
230
+ }
231
+
232
+ /**
233
+ * Classic FAB Menu close
234
+ */
235
+ _animateOutFAB() {
236
+ this.$floatingBtnsReverse.each((el) => {
237
+ anim.remove(el);
238
+ anim({
239
+ targets: el,
240
+ opacity: 0,
241
+ scale: 0.4,
242
+ translateY: this.offsetY,
243
+ translateX: this.offsetX,
244
+ duration: 175,
245
+ easing: 'easeOutQuad',
246
+ complete: () => {
247
+ this.$el.removeClass('active');
248
+ }
249
+ });
250
+ });
251
+ }
252
+
253
+ /**
254
+ * Toolbar transition Menu open
255
+ */
256
+ _animateInToolbar() {
257
+ let scaleFactor;
258
+ let windowWidth = window.innerWidth;
259
+ let windowHeight = window.innerHeight;
260
+ let btnRect = this.el.getBoundingClientRect();
261
+ let backdrop = $('<div class="fab-backdrop"></div>');
262
+ let fabColor = this.$anchor.css('background-color');
263
+
264
+ this.$anchor.append(backdrop);
265
+
266
+ this.offsetX = btnRect.left - windowWidth / 2 + btnRect.width / 2;
267
+ this.offsetY = windowHeight - btnRect.bottom;
268
+ scaleFactor = windowWidth / backdrop[0].clientWidth;
269
+ this.btnBottom = btnRect.bottom;
270
+ this.btnLeft = btnRect.left;
271
+ this.btnWidth = btnRect.width;
272
+
273
+ // Set initial state
274
+ this.$el.addClass('active');
275
+ this.$el.css({
276
+ 'text-align': 'center',
277
+ width: '100%',
278
+ bottom: 0,
279
+ left: 0,
280
+ transform: 'translateX(' + this.offsetX + 'px)',
281
+ transition: 'none'
282
+ });
283
+ this.$anchor.css({
284
+ transform: 'translateY(' + -this.offsetY + 'px)',
285
+ transition: 'none'
286
+ });
287
+ backdrop.css({
288
+ 'background-color': fabColor
289
+ });
290
+
291
+ setTimeout(() => {
292
+ this.$el.css({
293
+ transform: '',
294
+ transition:
295
+ 'transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s'
296
+ });
297
+ this.$anchor.css({
298
+ overflow: 'visible',
299
+ transform: '',
300
+ transition: 'transform .2s'
301
+ });
302
+
303
+ setTimeout(() => {
304
+ this.$el.css({
305
+ overflow: 'hidden',
306
+ 'background-color': fabColor
307
+ });
308
+ backdrop.css({
309
+ transform: 'scale(' + scaleFactor + ')',
310
+ transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
311
+ });
312
+ this.$menu
313
+ .children('li')
314
+ .children('a')
315
+ .css({
316
+ opacity: 1
317
+ });
318
+
319
+ // Scroll to close
320
+ this._handleDocumentClickBound = this._handleDocumentClick.bind(this);
321
+ window.addEventListener('scroll', this._handleCloseBound, true);
322
+ document.body.addEventListener('click', this._handleDocumentClickBound, true);
323
+ }, 100);
324
+ }, 0);
325
+ }
326
+
327
+ /**
328
+ * Toolbar transition Menu close
329
+ */
330
+ _animateOutToolbar() {
331
+ let windowWidth = window.innerWidth;
332
+ let windowHeight = window.innerHeight;
333
+ let backdrop = this.$el.find('.fab-backdrop');
334
+ let fabColor = this.$anchor.css('background-color');
335
+
336
+ this.offsetX = this.btnLeft - windowWidth / 2 + this.btnWidth / 2;
337
+ this.offsetY = windowHeight - this.btnBottom;
338
+
339
+ // Hide backdrop
340
+ this.$el.removeClass('active');
341
+ this.$el.css({
342
+ 'background-color': 'transparent',
343
+ transition: 'none'
344
+ });
345
+ this.$anchor.css({
346
+ transition: 'none'
347
+ });
348
+ backdrop.css({
349
+ transform: 'scale(0)',
350
+ 'background-color': fabColor
351
+ });
352
+ this.$menu
353
+ .children('li')
354
+ .children('a')
355
+ .css({
356
+ opacity: ''
357
+ });
358
+
359
+ setTimeout(() => {
360
+ backdrop.remove();
361
+
362
+ // Set initial state.
363
+ this.$el.css({
364
+ 'text-align': '',
365
+ width: '',
366
+ bottom: '',
367
+ left: '',
368
+ overflow: '',
369
+ 'background-color': '',
370
+ transform: 'translate3d(' + -this.offsetX + 'px,0,0)'
371
+ });
372
+ this.$anchor.css({
373
+ overflow: '',
374
+ transform: 'translate3d(0,' + this.offsetY + 'px,0)'
375
+ });
376
+
377
+ setTimeout(() => {
378
+ this.$el.css({
379
+ transform: 'translate3d(0,0,0)',
380
+ transition: 'transform .2s'
381
+ });
382
+ this.$anchor.css({
383
+ transform: 'translate3d(0,0,0)',
384
+ transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
385
+ });
386
+ }, 20);
387
+ }, 200);
388
+ }
389
+ }
390
+
391
+ // jadams, 2020-10-10: moved to j1 name space
392
+ //
393
+ // M.FloatingActionButton = FloatingActionButton;
394
+ j1.FloatingActionButton = FloatingActionButton;
395
+
396
+ // jadams, 2020-10-10: check how to transform function to jQuery
397
+ //
398
+ // if (M.jQueryLoaded) {
399
+ // M.initializeJqueryWrapper(
400
+ // FloatingActionButton,
401
+ // 'floatingActionButton',
402
+ // 'M_FloatingActionButton'
403
+ // );
404
+ // }
405
+
406
+ // jadams, 2020-10-10: TODO: check if anime could be a replacement
407
+ // for (huge) animate.css
408
+
409
+ })(cash, j1.anime);
@@ -0,0 +1,40 @@
1
+ (function($, anim) {
2
+ $(document).on('click', '.card', function(e) {
3
+ if ($(this).children('.card-reveal').length) {
4
+ var $card = $(e.target).closest('.card');
5
+ if ($card.data('initialOverflow') === undefined) {
6
+ $card.data(
7
+ 'initialOverflow',
8
+ $card.css('overflow') === undefined ? '' : $card.css('overflow')
9
+ );
10
+ }
11
+ let $cardReveal = $(this).find('.card-reveal');
12
+ if (
13
+ $(e.target).is($('.card-reveal .card-title')) ||
14
+ $(e.target).is($('.card-reveal .card-title i'))
15
+ ) {
16
+ // Make Reveal animate down and display none
17
+ anim({
18
+ targets: $cardReveal[0],
19
+ translateY: 0,
20
+ duration: 225,
21
+ easing: 'easeInOutQuad',
22
+ complete: function(anim) {
23
+ let el = anim.animatables[0].target;
24
+ $(el).css({ display: 'none' });
25
+ $card.css('overflow', $card.data('initialOverflow'));
26
+ }
27
+ });
28
+ } else if ($(e.target).is($('.card .activator')) || $(e.target).is($('.card .activator i'))) {
29
+ $card.css('overflow', 'hidden');
30
+ $cardReveal.css({ display: 'block' });
31
+ anim({
32
+ targets: $cardReveal[0],
33
+ translateY: '-100%',
34
+ duration: 300,
35
+ easing: 'easeInOutQuad'
36
+ });
37
+ }
38
+ }
39
+ });
40
+ })(cash, M.anime);
@@ -0,0 +1,717 @@
1
+ (function($) {
2
+ 'use strict';
3
+
4
+ let _defaults = {
5
+ duration: 200, // ms
6
+ dist: -100, // zoom scale TODO: make this more intuitive as an option
7
+ shift: 0, // spacing for center image
8
+ padding: 0, // Padding between non center items
9
+ numVisible: 5, // Number of visible items in carousel
10
+ fullWidth: false, // Change to full width styles
11
+ indicators: false, // Toggle indicators
12
+ noWrap: false, // Don't wrap around and cycle through items.
13
+ onCycleTo: null // Callback for when a new slide is cycled to.
14
+ };
15
+
16
+ /**
17
+ * @class
18
+ *
19
+ */
20
+ class Carousel extends Component {
21
+ /**
22
+ * Construct Carousel instance
23
+ * @constructor
24
+ * @param {Element} el
25
+ * @param {Object} options
26
+ */
27
+ constructor(el, options) {
28
+ super(Carousel, el, options);
29
+
30
+ this.el.M_Carousel = this;
31
+
32
+ /**
33
+ * Options for the carousel
34
+ * @member Carousel#options
35
+ * @prop {Number} duration
36
+ * @prop {Number} dist
37
+ * @prop {Number} shift
38
+ * @prop {Number} padding
39
+ * @prop {Number} numVisible
40
+ * @prop {Boolean} fullWidth
41
+ * @prop {Boolean} indicators
42
+ * @prop {Boolean} noWrap
43
+ * @prop {Function} onCycleTo
44
+ */
45
+ this.options = $.extend({}, Carousel.defaults, options);
46
+
47
+ // Setup
48
+ this.hasMultipleSlides = this.$el.find('.carousel-item').length > 1;
49
+ this.showIndicators = this.options.indicators && this.hasMultipleSlides;
50
+ this.noWrap = this.options.noWrap || !this.hasMultipleSlides;
51
+ this.pressed = false;
52
+ this.dragged = false;
53
+ this.offset = this.target = 0;
54
+ this.images = [];
55
+ this.itemWidth = this.$el
56
+ .find('.carousel-item')
57
+ .first()
58
+ .innerWidth();
59
+ this.itemHeight = this.$el
60
+ .find('.carousel-item')
61
+ .first()
62
+ .innerHeight();
63
+ this.dim = this.itemWidth * 2 + this.options.padding || 1; // Make sure dim is non zero for divisions.
64
+ this._autoScrollBound = this._autoScroll.bind(this);
65
+ this._trackBound = this._track.bind(this);
66
+
67
+ // Full Width carousel setup
68
+ if (this.options.fullWidth) {
69
+ this.options.dist = 0;
70
+ this._setCarouselHeight();
71
+
72
+ // Offset fixed items when indicators.
73
+ if (this.showIndicators) {
74
+ this.$el.find('.carousel-fixed-item').addClass('with-indicators');
75
+ }
76
+ }
77
+
78
+ // Iterate through slides
79
+ this.$indicators = $('<ul class="indicators"></ul>');
80
+ this.$el.find('.carousel-item').each((el, i) => {
81
+ this.images.push(el);
82
+ if (this.showIndicators) {
83
+ let $indicator = $('<li class="indicator-item"></li>');
84
+
85
+ // Add active to first by default.
86
+ if (i === 0) {
87
+ $indicator[0].classList.add('active');
88
+ }
89
+
90
+ this.$indicators.append($indicator);
91
+ }
92
+ });
93
+ if (this.showIndicators) {
94
+ this.$el.append(this.$indicators);
95
+ }
96
+ this.count = this.images.length;
97
+
98
+ // Cap numVisible at count
99
+ this.options.numVisible = Math.min(this.count, this.options.numVisible);
100
+
101
+ // Setup cross browser string
102
+ this.xform = 'transform';
103
+ ['webkit', 'Moz', 'O', 'ms'].every((prefix) => {
104
+ var e = prefix + 'Transform';
105
+ if (typeof document.body.style[e] !== 'undefined') {
106
+ this.xform = e;
107
+ return false;
108
+ }
109
+ return true;
110
+ });
111
+
112
+ this._setupEventHandlers();
113
+ this._scroll(this.offset);
114
+ }
115
+
116
+ static get defaults() {
117
+ return _defaults;
118
+ }
119
+
120
+ static init(els, options) {
121
+ return super.init(this, els, options);
122
+ }
123
+
124
+ /**
125
+ * Get Instance
126
+ */
127
+ static getInstance(el) {
128
+ let domElem = !!el.jquery ? el[0] : el;
129
+ return domElem.M_Carousel;
130
+ }
131
+
132
+ /**
133
+ * Teardown component
134
+ */
135
+ destroy() {
136
+ this._removeEventHandlers();
137
+ this.el.M_Carousel = undefined;
138
+ }
139
+
140
+ /**
141
+ * Setup Event Handlers
142
+ */
143
+ _setupEventHandlers() {
144
+ this._handleCarouselTapBound = this._handleCarouselTap.bind(this);
145
+ this._handleCarouselDragBound = this._handleCarouselDrag.bind(this);
146
+ this._handleCarouselReleaseBound = this._handleCarouselRelease.bind(this);
147
+ this._handleCarouselClickBound = this._handleCarouselClick.bind(this);
148
+
149
+ if (typeof window.ontouchstart !== 'undefined') {
150
+ this.el.addEventListener('touchstart', this._handleCarouselTapBound);
151
+ this.el.addEventListener('touchmove', this._handleCarouselDragBound);
152
+ this.el.addEventListener('touchend', this._handleCarouselReleaseBound);
153
+ }
154
+
155
+ this.el.addEventListener('mousedown', this._handleCarouselTapBound);
156
+ this.el.addEventListener('mousemove', this._handleCarouselDragBound);
157
+ this.el.addEventListener('mouseup', this._handleCarouselReleaseBound);
158
+ this.el.addEventListener('mouseleave', this._handleCarouselReleaseBound);
159
+ this.el.addEventListener('click', this._handleCarouselClickBound);
160
+
161
+ if (this.showIndicators && this.$indicators) {
162
+ this._handleIndicatorClickBound = this._handleIndicatorClick.bind(this);
163
+ this.$indicators.find('.indicator-item').each((el, i) => {
164
+ el.addEventListener('click', this._handleIndicatorClickBound);
165
+ });
166
+ }
167
+
168
+ // Resize
169
+ let throttledResize = M.throttle(this._handleResize, 200);
170
+ this._handleThrottledResizeBound = throttledResize.bind(this);
171
+
172
+ window.addEventListener('resize', this._handleThrottledResizeBound);
173
+ }
174
+
175
+ /**
176
+ * Remove Event Handlers
177
+ */
178
+ _removeEventHandlers() {
179
+ if (typeof window.ontouchstart !== 'undefined') {
180
+ this.el.removeEventListener('touchstart', this._handleCarouselTapBound);
181
+ this.el.removeEventListener('touchmove', this._handleCarouselDragBound);
182
+ this.el.removeEventListener('touchend', this._handleCarouselReleaseBound);
183
+ }
184
+ this.el.removeEventListener('mousedown', this._handleCarouselTapBound);
185
+ this.el.removeEventListener('mousemove', this._handleCarouselDragBound);
186
+ this.el.removeEventListener('mouseup', this._handleCarouselReleaseBound);
187
+ this.el.removeEventListener('mouseleave', this._handleCarouselReleaseBound);
188
+ this.el.removeEventListener('click', this._handleCarouselClickBound);
189
+
190
+ if (this.showIndicators && this.$indicators) {
191
+ this.$indicators.find('.indicator-item').each((el, i) => {
192
+ el.removeEventListener('click', this._handleIndicatorClickBound);
193
+ });
194
+ }
195
+
196
+ window.removeEventListener('resize', this._handleThrottledResizeBound);
197
+ }
198
+
199
+ /**
200
+ * Handle Carousel Tap
201
+ * @param {Event} e
202
+ */
203
+ _handleCarouselTap(e) {
204
+ // Fixes firefox draggable image bug
205
+ if (e.type === 'mousedown' && $(e.target).is('img')) {
206
+ e.preventDefault();
207
+ }
208
+ this.pressed = true;
209
+ this.dragged = false;
210
+ this.verticalDragged = false;
211
+ this.reference = this._xpos(e);
212
+ this.referenceY = this._ypos(e);
213
+
214
+ this.velocity = this.amplitude = 0;
215
+ this.frame = this.offset;
216
+ this.timestamp = Date.now();
217
+ clearInterval(this.ticker);
218
+ this.ticker = setInterval(this._trackBound, 100);
219
+ }
220
+
221
+ /**
222
+ * Handle Carousel Drag
223
+ * @param {Event} e
224
+ */
225
+ _handleCarouselDrag(e) {
226
+ let x, y, delta, deltaY;
227
+ if (this.pressed) {
228
+ x = this._xpos(e);
229
+ y = this._ypos(e);
230
+ delta = this.reference - x;
231
+ deltaY = Math.abs(this.referenceY - y);
232
+ if (deltaY < 30 && !this.verticalDragged) {
233
+ // If vertical scrolling don't allow dragging.
234
+ if (delta > 2 || delta < -2) {
235
+ this.dragged = true;
236
+ this.reference = x;
237
+ this._scroll(this.offset + delta);
238
+ }
239
+ } else if (this.dragged) {
240
+ // If dragging don't allow vertical scroll.
241
+ e.preventDefault();
242
+ e.stopPropagation();
243
+ return false;
244
+ } else {
245
+ // Vertical scrolling.
246
+ this.verticalDragged = true;
247
+ }
248
+ }
249
+
250
+ if (this.dragged) {
251
+ // If dragging don't allow vertical scroll.
252
+ e.preventDefault();
253
+ e.stopPropagation();
254
+ return false;
255
+ }
256
+ }
257
+
258
+ /**
259
+ * Handle Carousel Release
260
+ * @param {Event} e
261
+ */
262
+ _handleCarouselRelease(e) {
263
+ if (this.pressed) {
264
+ this.pressed = false;
265
+ } else {
266
+ return;
267
+ }
268
+
269
+ clearInterval(this.ticker);
270
+ this.target = this.offset;
271
+ if (this.velocity > 10 || this.velocity < -10) {
272
+ this.amplitude = 0.9 * this.velocity;
273
+ this.target = this.offset + this.amplitude;
274
+ }
275
+ this.target = Math.round(this.target / this.dim) * this.dim;
276
+
277
+ // No wrap of items.
278
+ if (this.noWrap) {
279
+ if (this.target >= this.dim * (this.count - 1)) {
280
+ this.target = this.dim * (this.count - 1);
281
+ } else if (this.target < 0) {
282
+ this.target = 0;
283
+ }
284
+ }
285
+ this.amplitude = this.target - this.offset;
286
+ this.timestamp = Date.now();
287
+ requestAnimationFrame(this._autoScrollBound);
288
+
289
+ if (this.dragged) {
290
+ e.preventDefault();
291
+ e.stopPropagation();
292
+ }
293
+ return false;
294
+ }
295
+
296
+ /**
297
+ * Handle Carousel CLick
298
+ * @param {Event} e
299
+ */
300
+ _handleCarouselClick(e) {
301
+ // Disable clicks if carousel was dragged.
302
+ if (this.dragged) {
303
+ e.preventDefault();
304
+ e.stopPropagation();
305
+ return false;
306
+ } else if (!this.options.fullWidth) {
307
+ let clickedIndex = $(e.target)
308
+ .closest('.carousel-item')
309
+ .index();
310
+ let diff = this._wrap(this.center) - clickedIndex;
311
+
312
+ // Disable clicks if carousel was shifted by click
313
+ if (diff !== 0) {
314
+ e.preventDefault();
315
+ e.stopPropagation();
316
+ }
317
+ this._cycleTo(clickedIndex);
318
+ }
319
+ }
320
+
321
+ /**
322
+ * Handle Indicator CLick
323
+ * @param {Event} e
324
+ */
325
+ _handleIndicatorClick(e) {
326
+ e.stopPropagation();
327
+
328
+ let indicator = $(e.target).closest('.indicator-item');
329
+ if (indicator.length) {
330
+ this._cycleTo(indicator.index());
331
+ }
332
+ }
333
+
334
+ /**
335
+ * Handle Throttle Resize
336
+ * @param {Event} e
337
+ */
338
+ _handleResize(e) {
339
+ if (this.options.fullWidth) {
340
+ this.itemWidth = this.$el
341
+ .find('.carousel-item')
342
+ .first()
343
+ .innerWidth();
344
+ this.imageHeight = this.$el.find('.carousel-item.active').height();
345
+ this.dim = this.itemWidth * 2 + this.options.padding;
346
+ this.offset = this.center * 2 * this.itemWidth;
347
+ this.target = this.offset;
348
+ this._setCarouselHeight(true);
349
+ } else {
350
+ this._scroll();
351
+ }
352
+ }
353
+
354
+ /**
355
+ * Set carousel height based on first slide
356
+ * @param {Booleam} imageOnly - true for image slides
357
+ */
358
+ _setCarouselHeight(imageOnly) {
359
+ let firstSlide = this.$el.find('.carousel-item.active').length
360
+ ? this.$el.find('.carousel-item.active').first()
361
+ : this.$el.find('.carousel-item').first();
362
+ let firstImage = firstSlide.find('img').first();
363
+ if (firstImage.length) {
364
+ if (firstImage[0].complete) {
365
+ // If image won't trigger the load event
366
+ let imageHeight = firstImage.height();
367
+ if (imageHeight > 0) {
368
+ this.$el.css('height', imageHeight + 'px');
369
+ } else {
370
+ // If image still has no height, use the natural dimensions to calculate
371
+ let naturalWidth = firstImage[0].naturalWidth;
372
+ let naturalHeight = firstImage[0].naturalHeight;
373
+ let adjustedHeight = this.$el.width() / naturalWidth * naturalHeight;
374
+ this.$el.css('height', adjustedHeight + 'px');
375
+ }
376
+ } else {
377
+ // Get height when image is loaded normally
378
+ firstImage.one('load', (el, i) => {
379
+ this.$el.css('height', el.offsetHeight + 'px');
380
+ });
381
+ }
382
+ } else if (!imageOnly) {
383
+ let slideHeight = firstSlide.height();
384
+ this.$el.css('height', slideHeight + 'px');
385
+ }
386
+ }
387
+
388
+ /**
389
+ * Get x position from event
390
+ * @param {Event} e
391
+ */
392
+ _xpos(e) {
393
+ // touch event
394
+ if (e.targetTouches && e.targetTouches.length >= 1) {
395
+ return e.targetTouches[0].clientX;
396
+ }
397
+
398
+ // mouse event
399
+ return e.clientX;
400
+ }
401
+
402
+ /**
403
+ * Get y position from event
404
+ * @param {Event} e
405
+ */
406
+ _ypos(e) {
407
+ // touch event
408
+ if (e.targetTouches && e.targetTouches.length >= 1) {
409
+ return e.targetTouches[0].clientY;
410
+ }
411
+
412
+ // mouse event
413
+ return e.clientY;
414
+ }
415
+
416
+ /**
417
+ * Wrap index
418
+ * @param {Number} x
419
+ */
420
+ _wrap(x) {
421
+ return x >= this.count ? x % this.count : x < 0 ? this._wrap(this.count + x % this.count) : x;
422
+ }
423
+
424
+ /**
425
+ * Tracks scrolling information
426
+ */
427
+ _track() {
428
+ let now, elapsed, delta, v;
429
+
430
+ now = Date.now();
431
+ elapsed = now - this.timestamp;
432
+ this.timestamp = now;
433
+ delta = this.offset - this.frame;
434
+ this.frame = this.offset;
435
+
436
+ v = 1000 * delta / (1 + elapsed);
437
+ this.velocity = 0.8 * v + 0.2 * this.velocity;
438
+ }
439
+
440
+ /**
441
+ * Auto scrolls to nearest carousel item.
442
+ */
443
+ _autoScroll() {
444
+ let elapsed, delta;
445
+
446
+ if (this.amplitude) {
447
+ elapsed = Date.now() - this.timestamp;
448
+ delta = this.amplitude * Math.exp(-elapsed / this.options.duration);
449
+ if (delta > 2 || delta < -2) {
450
+ this._scroll(this.target - delta);
451
+ requestAnimationFrame(this._autoScrollBound);
452
+ } else {
453
+ this._scroll(this.target);
454
+ }
455
+ }
456
+ }
457
+
458
+ /**
459
+ * Scroll to target
460
+ * @param {Number} x
461
+ */
462
+ _scroll(x) {
463
+ // Track scrolling state
464
+ if (!this.$el.hasClass('scrolling')) {
465
+ this.el.classList.add('scrolling');
466
+ }
467
+ if (this.scrollingTimeout != null) {
468
+ window.clearTimeout(this.scrollingTimeout);
469
+ }
470
+ this.scrollingTimeout = window.setTimeout(() => {
471
+ this.$el.removeClass('scrolling');
472
+ }, this.options.duration);
473
+
474
+ // Start actual scroll
475
+ let i,
476
+ half,
477
+ delta,
478
+ dir,
479
+ tween,
480
+ el,
481
+ alignment,
482
+ zTranslation,
483
+ tweenedOpacity,
484
+ centerTweenedOpacity;
485
+ let lastCenter = this.center;
486
+ let numVisibleOffset = 1 / this.options.numVisible;
487
+
488
+ this.offset = typeof x === 'number' ? x : this.offset;
489
+ this.center = Math.floor((this.offset + this.dim / 2) / this.dim);
490
+ delta = this.offset - this.center * this.dim;
491
+ dir = delta < 0 ? 1 : -1;
492
+ tween = -dir * delta * 2 / this.dim;
493
+ half = this.count >> 1;
494
+
495
+ if (this.options.fullWidth) {
496
+ alignment = 'translateX(0)';
497
+ centerTweenedOpacity = 1;
498
+ } else {
499
+ alignment = 'translateX(' + (this.el.clientWidth - this.itemWidth) / 2 + 'px) ';
500
+ alignment += 'translateY(' + (this.el.clientHeight - this.itemHeight) / 2 + 'px)';
501
+ centerTweenedOpacity = 1 - numVisibleOffset * tween;
502
+ }
503
+
504
+ // Set indicator active
505
+ if (this.showIndicators) {
506
+ let diff = this.center % this.count;
507
+ let activeIndicator = this.$indicators.find('.indicator-item.active');
508
+ if (activeIndicator.index() !== diff) {
509
+ activeIndicator.removeClass('active');
510
+ this.$indicators
511
+ .find('.indicator-item')
512
+ .eq(diff)[0]
513
+ .classList.add('active');
514
+ }
515
+ }
516
+
517
+ // center
518
+ // Don't show wrapped items.
519
+ if (!this.noWrap || (this.center >= 0 && this.center < this.count)) {
520
+ el = this.images[this._wrap(this.center)];
521
+
522
+ // Add active class to center item.
523
+ if (!$(el).hasClass('active')) {
524
+ this.$el.find('.carousel-item').removeClass('active');
525
+ el.classList.add('active');
526
+ }
527
+ let transformString = `${alignment} translateX(${-delta / 2}px) translateX(${dir *
528
+ this.options.shift *
529
+ tween *
530
+ i}px) translateZ(${this.options.dist * tween}px)`;
531
+ this._updateItemStyle(el, centerTweenedOpacity, 0, transformString);
532
+ }
533
+
534
+ for (i = 1; i <= half; ++i) {
535
+ // right side
536
+ if (this.options.fullWidth) {
537
+ zTranslation = this.options.dist;
538
+ tweenedOpacity = i === half && delta < 0 ? 1 - tween : 1;
539
+ } else {
540
+ zTranslation = this.options.dist * (i * 2 + tween * dir);
541
+ tweenedOpacity = 1 - numVisibleOffset * (i * 2 + tween * dir);
542
+ }
543
+ // Don't show wrapped items.
544
+ if (!this.noWrap || this.center + i < this.count) {
545
+ el = this.images[this._wrap(this.center + i)];
546
+ let transformString = `${alignment} translateX(${this.options.shift +
547
+ (this.dim * i - delta) / 2}px) translateZ(${zTranslation}px)`;
548
+ this._updateItemStyle(el, tweenedOpacity, -i, transformString);
549
+ }
550
+
551
+ // left side
552
+ if (this.options.fullWidth) {
553
+ zTranslation = this.options.dist;
554
+ tweenedOpacity = i === half && delta > 0 ? 1 - tween : 1;
555
+ } else {
556
+ zTranslation = this.options.dist * (i * 2 - tween * dir);
557
+ tweenedOpacity = 1 - numVisibleOffset * (i * 2 - tween * dir);
558
+ }
559
+ // Don't show wrapped items.
560
+ if (!this.noWrap || this.center - i >= 0) {
561
+ el = this.images[this._wrap(this.center - i)];
562
+ let transformString = `${alignment} translateX(${-this.options.shift +
563
+ (-this.dim * i - delta) / 2}px) translateZ(${zTranslation}px)`;
564
+ this._updateItemStyle(el, tweenedOpacity, -i, transformString);
565
+ }
566
+ }
567
+
568
+ // center
569
+ // Don't show wrapped items.
570
+ if (!this.noWrap || (this.center >= 0 && this.center < this.count)) {
571
+ el = this.images[this._wrap(this.center)];
572
+ let transformString = `${alignment} translateX(${-delta / 2}px) translateX(${dir *
573
+ this.options.shift *
574
+ tween}px) translateZ(${this.options.dist * tween}px)`;
575
+ this._updateItemStyle(el, centerTweenedOpacity, 0, transformString);
576
+ }
577
+
578
+ // onCycleTo callback
579
+ let $currItem = this.$el.find('.carousel-item').eq(this._wrap(this.center));
580
+ if (lastCenter !== this.center && typeof this.options.onCycleTo === 'function') {
581
+ this.options.onCycleTo.call(this, $currItem[0], this.dragged);
582
+ }
583
+
584
+ // One time callback
585
+ if (typeof this.oneTimeCallback === 'function') {
586
+ this.oneTimeCallback.call(this, $currItem[0], this.dragged);
587
+ this.oneTimeCallback = null;
588
+ }
589
+ }
590
+
591
+ /**
592
+ * Cycle to target
593
+ * @param {Element} el
594
+ * @param {Number} opacity
595
+ * @param {Number} zIndex
596
+ * @param {String} transform
597
+ */
598
+ _updateItemStyle(el, opacity, zIndex, transform) {
599
+ el.style[this.xform] = transform;
600
+ el.style.zIndex = zIndex;
601
+ el.style.opacity = opacity;
602
+ el.style.visibility = 'visible';
603
+ }
604
+
605
+ /**
606
+ * Cycle to target
607
+ * @param {Number} n
608
+ * @param {Function} callback
609
+ */
610
+ _cycleTo(n, callback) {
611
+ let diff = this.center % this.count - n;
612
+
613
+ // Account for wraparound.
614
+ if (!this.noWrap) {
615
+ if (diff < 0) {
616
+ if (Math.abs(diff + this.count) < Math.abs(diff)) {
617
+ diff += this.count;
618
+ }
619
+ } else if (diff > 0) {
620
+ if (Math.abs(diff - this.count) < diff) {
621
+ diff -= this.count;
622
+ }
623
+ }
624
+ }
625
+
626
+ this.target = this.dim * Math.round(this.offset / this.dim);
627
+ // Next
628
+ if (diff < 0) {
629
+ this.target += this.dim * Math.abs(diff);
630
+
631
+ // Prev
632
+ } else if (diff > 0) {
633
+ this.target -= this.dim * diff;
634
+ }
635
+
636
+ // Set one time callback
637
+ if (typeof callback === 'function') {
638
+ this.oneTimeCallback = callback;
639
+ }
640
+
641
+ // Scroll
642
+ if (this.offset !== this.target) {
643
+ this.amplitude = this.target - this.offset;
644
+ this.timestamp = Date.now();
645
+ requestAnimationFrame(this._autoScrollBound);
646
+ }
647
+ }
648
+
649
+ /**
650
+ * Cycle to next item
651
+ * @param {Number} [n]
652
+ */
653
+ next(n) {
654
+ if (n === undefined || isNaN(n)) {
655
+ n = 1;
656
+ }
657
+
658
+ let index = this.center + n;
659
+ if (index >= this.count || index < 0) {
660
+ if (this.noWrap) {
661
+ return;
662
+ }
663
+
664
+ index = this._wrap(index);
665
+ }
666
+ this._cycleTo(index);
667
+ }
668
+
669
+ /**
670
+ * Cycle to previous item
671
+ * @param {Number} [n]
672
+ */
673
+ prev(n) {
674
+ if (n === undefined || isNaN(n)) {
675
+ n = 1;
676
+ }
677
+
678
+ let index = this.center - n;
679
+ if (index >= this.count || index < 0) {
680
+ if (this.noWrap) {
681
+ return;
682
+ }
683
+
684
+ index = this._wrap(index);
685
+ }
686
+
687
+ this._cycleTo(index);
688
+ }
689
+
690
+ /**
691
+ * Cycle to nth item
692
+ * @param {Number} [n]
693
+ * @param {Function} callback
694
+ */
695
+ set(n, callback) {
696
+ if (n === undefined || isNaN(n)) {
697
+ n = 0;
698
+ }
699
+
700
+ if (n > this.count || n < 0) {
701
+ if (this.noWrap) {
702
+ return;
703
+ }
704
+
705
+ n = this._wrap(n);
706
+ }
707
+
708
+ this._cycleTo(n, callback);
709
+ }
710
+ }
711
+
712
+ M.Carousel = Carousel;
713
+
714
+ if (M.jQueryLoaded) {
715
+ M.initializeJqueryWrapper(Carousel, 'carousel', 'M_Carousel');
716
+ }
717
+ })(cash);