j1-template 2021.0.16 → 2021.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (428) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/blocks/footer/boxes/legal_statements.proc +4 -0
  3. data/_includes/themes/j1/layouts/layout_metadata_generator.html +54 -39
  4. data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +15 -7
  5. data/_includes/themes/j1/modules/connectors/ads +4 -6
  6. data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +1 -1
  7. data/_includes/themes/j1/modules/connectors/analytics +5 -4
  8. data/_includes/themes/j1/modules/connectors/comment/disqus.html +1 -1
  9. data/_includes/themes/j1/modules/connectors/comments +7 -6
  10. data/_includes/themes/j1/modules/connectors/translator +3 -4
  11. data/_includes/themes/j1/modules/navigator/generator.html +2 -38
  12. data/_includes/themes/j1/modules/navigator/generator.org.html +232 -0
  13. data/_includes/themes/j1/modules/navigator/procedures/topsearch.proc +2 -2
  14. data/_includes/themes/j1/procedures/global/create_bs_button.proc +64 -22
  15. data/_includes/themes/j1/procedures/posts/collate_timeline.proc +14 -10
  16. data/_layouts/default.html +11 -1
  17. data/apps/public/cc/index.adoc +13 -4
  18. data/assets/data/authclient.html +234 -228
  19. data/assets/data/banner.html +34 -31
  20. data/assets/data/cookiebar.html +205 -198
  21. data/assets/data/fam.html +5 -0
  22. data/assets/data/footer.html +4 -0
  23. data/assets/data/footer.new.1.html +256 -0
  24. data/assets/data/footer.new.2.html +256 -0
  25. data/assets/data/footer.org.html +249 -0
  26. data/assets/data/galleries.json +2 -2
  27. data/assets/data/gallery_customizer.html +16 -6
  28. data/assets/data/menu.html +7 -2
  29. data/assets/data/mmenu.html +6 -2
  30. data/assets/data/mmenu_sidebar.html +5 -1
  31. data/assets/data/mmenu_toc.html +4 -0
  32. data/assets/data/panel.html +23 -15
  33. data/assets/data/quicklinks.html +6 -1
  34. data/assets/error_pages/HTTP204.html +2 -1
  35. data/assets/error_pages/HTTP400.html +2 -1
  36. data/assets/error_pages/HTTP401.html +2 -1
  37. data/assets/error_pages/HTTP403.html +2 -1
  38. data/assets/error_pages/HTTP404.html +2 -1
  39. data/assets/error_pages/HTTP500.html +2 -1
  40. data/assets/error_pages/HTTP501.html +2 -1
  41. data/assets/error_pages/HTTP502.html +2 -1
  42. data/assets/error_pages/HTTP503.html +2 -1
  43. data/assets/error_pages/HTTP520.html +2 -1
  44. data/assets/error_pages/HTTP521.html +2 -1
  45. data/assets/error_pages/HTTP533.html +2 -1
  46. data/assets/themes/j1/adapter/js/asciidoctor.js +166 -0
  47. data/assets/themes/j1/adapter/js/carousel.js +24 -0
  48. data/assets/themes/j1/adapter/js/fam.js +0 -12
  49. data/assets/themes/j1/adapter/js/j1.js +48 -25
  50. data/assets/themes/j1/adapter/js/j1.new.js +1878 -0
  51. data/assets/themes/j1/adapter/js/j1.org.js +1874 -0
  52. data/assets/themes/j1/adapter/js/{jf_gallery.js → justifiedGallery.js} +9 -9
  53. data/assets/themes/j1/adapter/js/{gallery_customizer.js → justifiedGalleryCustomizer.js} +14 -13
  54. data/assets/themes/j1/adapter/js/logger.js +35 -23
  55. data/assets/themes/j1/adapter/js/mmenu.js +8 -4
  56. data/assets/themes/j1/adapter/js/navigator.js +77 -34
  57. data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.css +17 -14
  58. data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.min.css +1 -1
  59. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.css +3959 -239
  60. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css +1 -1
  61. data/assets/themes/j1/core/css/vendor.css +14 -2
  62. data/assets/themes/j1/core/css/vendor.min.css +1 -1
  63. data/assets/themes/j1/core/js/template.js +8 -2
  64. data/assets/themes/j1/core/js/template.js.map +1 -1
  65. data/assets/themes/j1/core/js/template.min.js +8 -2
  66. data/assets/themes/j1/core/js/template.min.js.map +1 -1
  67. data/assets/themes/j1/modules/_lightGallery/css/core/lg-fb-comment-box.css +58 -0
  68. data/assets/themes/j1/modules/_lightGallery/css/core/lg-fb-comment-box.min.css +5 -0
  69. data/assets/themes/j1/modules/_lightGallery/css/core/lg-transitions.css +778 -0
  70. data/assets/themes/j1/modules/_lightGallery/css/core/lg-transitions.min.css +5 -0
  71. data/assets/themes/j1/modules/_lightGallery/css/core/lightgallery.css +981 -0
  72. data/assets/themes/j1/modules/_lightGallery/css/core/lightgallery.min.css +5 -0
  73. data/assets/themes/j1/modules/_lightGallery/css/fonts/lg.eot +0 -0
  74. data/assets/themes/j1/modules/_lightGallery/css/fonts/lg.svg +47 -0
  75. data/assets/themes/j1/modules/_lightGallery/css/fonts/lg.ttf +0 -0
  76. data/assets/themes/j1/modules/_lightGallery/css/fonts/lg.woff +0 -0
  77. data/assets/themes/j1/modules/_lightGallery/css/img/loading.gif +0 -0
  78. data/assets/themes/j1/modules/_lightGallery/css/img/video-play.png +0 -0
  79. data/assets/themes/j1/modules/_lightGallery/css/img/vimeo-play.png +0 -0
  80. data/assets/themes/j1/modules/_lightGallery/css/img/youtube-play.png +0 -0
  81. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/animation-w.png +0 -0
  82. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/customize-w.png +0 -0
  83. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/dynamic-w.png +0 -0
  84. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/facebook-icon.svg +10 -0
  85. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/googleplus-icon.svg +30 -0
  86. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/html5-w.png +0 -0
  87. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/linked-in.png +0 -0
  88. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/module-w.png +0 -0
  89. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/play-button.png +0 -0
  90. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/responsive-w.png +0 -0
  91. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/thumb-w.png +0 -0
  92. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/touch-w.png +0 -0
  93. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/twitter-icon.svg +15 -0
  94. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/twitter.png +0 -0
  95. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/video1-w.png +0 -0
  96. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/zoom-w.png +0 -0
  97. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/zoom.png +0 -0
  98. data/assets/themes/j1/modules/_lightGallery/css/themes/uno.css +262 -0
  99. data/assets/themes/j1/modules/_lightGallery/css/themes/uno.min.css +15 -0
  100. data/assets/themes/j1/modules/_lightGallery/js/core/lightgallery.js +1362 -0
  101. data/assets/themes/j1/modules/_lightGallery/js/core/lightgallery.min.js +4 -0
  102. data/assets/themes/j1/modules/_lightGallery/js/modules/j1/j1-video.js +402 -0
  103. data/assets/themes/j1/modules/_lightGallery/js/modules/j1/j1-video.min.js +8 -0
  104. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-autoplay.js +206 -0
  105. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-autoplay.min.js +5 -0
  106. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-fullscreen.js +126 -0
  107. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-fullscreen.min.js +5 -0
  108. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-hash.js +101 -0
  109. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-hash.min.js +5 -0
  110. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-pager.js +105 -0
  111. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-pager.min.js +5 -0
  112. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-share.js +107 -0
  113. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-share.min.js +5 -0
  114. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-thumbnail.js +478 -0
  115. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-thumbnail.min.js +5 -0
  116. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-video.js +342 -0
  117. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-video.min.js +5 -0
  118. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-zoom.js +527 -0
  119. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-zoom.min.js +5 -0
  120. data/assets/themes/j1/modules/lightGallery/js/core/j1/lightgallery-x.js +1368 -0
  121. data/assets/themes/j1/modules/lightGallery/js/core/j1/lightgallery-x.min.js +10 -0
  122. data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-x-video.js +344 -0
  123. data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-x-video.min.js +7 -0
  124. data/assets/themes/j1/modules/log4javascript/docs/backwardsincompatibilities.html +90 -0
  125. data/assets/themes/j1/modules/log4javascript/docs/distribution.html +87 -0
  126. data/assets/themes/j1/modules/log4javascript/docs/index.html +190 -0
  127. data/assets/themes/j1/modules/log4javascript/docs/lite.html +182 -0
  128. data/assets/themes/j1/modules/log4javascript/docs/manual.html +3217 -0
  129. data/assets/themes/j1/modules/log4javascript/docs/manual_lite.html +383 -0
  130. data/assets/themes/j1/modules/log4javascript/docs/quickstart.html +230 -0
  131. data/assets/themes/j1/modules/log4javascript/docs/whatsnew.html +86 -0
  132. data/assets/themes/j1/modules/log4javascript/js/log4javascript.js +5826 -0
  133. data/assets/themes/j1/modules/{util/js/log4javascript.js → log4javascript/js/log4javascript.min.js} +17 -0
  134. data/exe/j1 +1 -1
  135. data/lib/j1/commands/generate.rb +32 -9
  136. data/lib/{patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/2.6 → j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/2.7}/fastfilereaderext.so +0 -0
  137. data/lib/{patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/2.6 → j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/2.7}/rubyeventmachine.so +0 -0
  138. data/lib/j1/patches/rubygems/execjs-2.7.0/lib/execjs/external_runtime.rb +246 -0
  139. data/lib/j1/version.rb +3 -3
  140. data/lib/j1_app.rb +1 -1
  141. data/lib/j1_app/j1_auth_manager/auth_manager.rb +8 -2
  142. data/lib/j1_app/j1_site_manager/static_site.no-cross-origin.rb +94 -0
  143. data/lib/j1_app/j1_site_manager/static_site.rb +13 -11
  144. data/lib/starter_web/Gemfile +20 -14
  145. data/lib/starter_web/_config.yml +77 -122
  146. data/lib/starter_web/_data/_defaults/j1_config.yml +460 -0
  147. data/lib/starter_web/_data/_defaults/resources.yml +626 -325
  148. data/lib/starter_web/_data/apps/defaults/{justified_gallery.yml → justifiedGallery.yml} +2 -2
  149. data/lib/starter_web/_data/apps/defaults/{gallery_customizer.yml → justifiedGalleryCustomizer.yml} +1 -0
  150. data/lib/starter_web/_data/apps/defaults/{light_gallery.yml → lightGallery.yml} +0 -0
  151. data/lib/starter_web/_data/apps/{justified_gallery.yml → justifiedGallery.yml} +7 -7
  152. data/lib/starter_web/_data/apps/{gallery_customizer.yml → justifiedGalleryCustomizer.yml} +0 -0
  153. data/lib/starter_web/_data/apps/{light_gallery.yml → lightGallery.yml} +0 -0
  154. data/lib/starter_web/_data/blocks/banner.yml +45 -51
  155. data/lib/starter_web/_data/blocks/footer.yml +15 -3
  156. data/lib/starter_web/_data/blocks/panel.yml +13 -13
  157. data/lib/starter_web/_data/builder/blog_navigator.yml +6 -1
  158. data/lib/starter_web/_data/j1_config.yml +8 -7
  159. data/lib/starter_web/_data/layouts/blog_archive.yml +9 -0
  160. data/lib/starter_web/_data/layouts/collection.yml +10 -0
  161. data/lib/starter_web/_data/layouts/default.yml +25 -59
  162. data/lib/starter_web/_data/layouts/home.yml +6 -5
  163. data/lib/starter_web/_data/layouts/page.yml +1 -1
  164. data/lib/starter_web/_data/modules/authentication.yml +11 -100
  165. data/lib/starter_web/_data/modules/defaults/authentication.yml +1 -0
  166. data/lib/starter_web/_data/modules/defaults/cookiebar.yml +1 -0
  167. data/lib/starter_web/_data/modules/defaults/log4javascript.yml +37 -40
  168. data/lib/starter_web/_data/modules/defaults/navigator.yml +5 -2
  169. data/lib/starter_web/_data/modules/defaults/quicksearch.yml +2 -0
  170. data/lib/starter_web/_data/modules/log4javascript.yml +11 -83
  171. data/lib/starter_web/_data/modules/navigator.yml +24 -21
  172. data/lib/starter_web/_data/modules/navigator_menu.yml +27 -8
  173. data/lib/starter_web/_data/modules/quicksearch.yml +2 -0
  174. data/lib/starter_web/_data/plugins/defaults/paginator.yml +15 -12
  175. data/lib/starter_web/_data/plugins/paginator.yml +5 -3
  176. data/lib/starter_web/_data/private.yml +29 -57
  177. data/lib/starter_web/_data/resources.yml +37 -17
  178. data/lib/starter_web/_data/utilities/defaults/util_srv.yml +49 -3
  179. data/lib/starter_web/_data/utilities/util_srv.yml +8 -65
  180. data/lib/starter_web/_includes/attributes.asciidoc +9 -6
  181. data/lib/starter_web/_plugins/asciidoctor-extensions/callout.rb +47 -5
  182. data/lib/starter_web/_plugins/asciidoctor-extensions/conum.rb +28 -1
  183. data/lib/starter_web/_plugins/lunr_index.rb +17 -2
  184. data/lib/starter_web/assets/images/collections/blog/featured/dynamic-web-access.png +0 -0
  185. data/lib/starter_web/assets/images/collections/blog/featured/jamstack-generators.gif +0 -0
  186. data/lib/starter_web/assets/images/collections/blog/featured/jamstack-generators.jpg +0 -0
  187. data/lib/starter_web/assets/images/collections/blog/featured/static-web-access.png +0 -0
  188. data/lib/starter_web/assets/images/modules/attics/christa-dodoo-1920x1280.jpg +0 -0
  189. data/lib/starter_web/assets/images/modules/attics/leon-1920x1280.jpg +0 -0
  190. data/lib/starter_web/assets/images/modules/attics/machine-generator-1920x1280.jpg +0 -0
  191. data/lib/starter_web/assets/images/modules/icons/j1/j1-256x256.gif +0 -0
  192. data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +42 -49
  193. data/lib/starter_web/collections/posts/public/featured/_posts/{2020-06-01-about-cookies.adoc → 2020-01-01-about-cookies.adoc} +37 -42
  194. data/lib/starter_web/collections/posts/public/featured/_posts/{2020-05-01-top-site-generators.adoc → 2021-03-01-site-generators.adoc} +51 -31
  195. data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-03-about-j1.adoc +119 -0
  196. data/lib/starter_web/collections/posts/public/featured/_posts/_includes/attributes.asciidoc +4 -0
  197. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-test-series.adoc +2 -8
  198. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-test-series.adoc +3 -10
  199. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-test-series.adoc +3 -10
  200. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-04-post-test-series.adoc +3 -10
  201. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-20-minneapolis.adoc +4 -2
  202. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc +4 -2
  203. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-26-columbia-river.adoc +4 -2
  204. data/lib/starter_web/dot.gitattributes +1 -1
  205. data/lib/starter_web/dot.gitignore +5 -1
  206. data/lib/starter_web/index.html +7 -13
  207. data/lib/starter_web/package.json +5 -4
  208. data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/gallery.asciidoc +1 -1
  209. data/lib/starter_web/pages/public/asciidoc_skeletons/book/000_intro.adoc +7 -1
  210. data/lib/starter_web/pages/public/asciidoc_skeletons/book/100_chapter.adoc +5 -1
  211. data/lib/starter_web/pages/public/asciidoc_skeletons/book/200_chapter.adoc +7 -2
  212. data/lib/starter_web/pages/public/asciidoc_skeletons/book/900_references.adoc +5 -0
  213. data/lib/starter_web/pages/public/asciidoc_skeletons/book/book.adoc +7 -2
  214. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/100_chapter.asciidoc +1 -1
  215. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/200_chapter.asciidoc +2 -2
  216. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +7 -2
  217. data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +6 -1
  218. data/lib/starter_web/pages/public/blog/navigator/archive.html +41 -25
  219. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +49 -29
  220. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +47 -30
  221. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +42 -14
  222. data/lib/starter_web/pages/public/blog/navigator/index.html +2 -5
  223. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +45 -48
  224. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.org.asciidoc +244 -0
  225. data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +21 -20
  226. data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +6 -2
  227. data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +39 -35
  228. data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +38 -36
  229. data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +16 -14
  230. data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +11 -9
  231. data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +30 -27
  232. data/lib/starter_web/pages/public/learn/roundtrip/600_quicksearch.adoc +50 -49
  233. data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/100_gistblock.asciidoc +1 -1
  234. data/lib/starter_web/pages/public/learn/where_to_go.adoc +33 -22
  235. data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +116 -0
  236. data/lib/starter_web/pages/public/legal/en/200_impress.adoc +82 -0
  237. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +77 -53
  238. data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +123 -0
  239. data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +85 -72
  240. data/lib/starter_web/pages/public/previewer/bootstrap_theme.adoc +1 -1
  241. data/lib/starter_web/pages/public/previewer/iframer.adoc +1 -1
  242. data/lib/starter_web/pages/public/previewer/justified_gallery.html +3 -3
  243. data/lib/starter_web/pages/public/previewer/md_color_palette.adoc +1 -1940
  244. data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +7 -9
  245. data/lib/starter_web/pages/public/previewer/rouge.adoc +1 -1
  246. data/lib/starter_web/pages/public/previewer/twitter_emoji_preview.adoc +1 -1
  247. data/lib/starter_web/utilsrv/_defaults/package.json +13 -9
  248. data/lib/starter_web/utilsrv/package.json +6 -2
  249. data/lib/starter_web/utilsrv/server.js +228 -55
  250. metadata +106 -216
  251. data/assets/data/menu.1.html +0 -505
  252. data/lib/starter_web/_data/_defaults/j1_light_gallery.yml +0 -110
  253. data/lib/starter_web/_data/_defaults/template_settings.yml +0 -258
  254. data/lib/starter_web/_data/plugins/defaults/notebooks.yml +0 -61
  255. data/lib/starter_web/_data/plugins/notebooks.yml +0 -70
  256. data/lib/starter_web/_data/private.yml@localhost +0 -199
  257. data/lib/starter_web/assets/images/collections/blog/featured/staticgen.jpg +0 -0
  258. data/lib/starter_web/assets/images/modules/attics/aditya-joshi-1920x1280.jpg +0 -0
  259. data/lib/starter_web/assets/images/modules/attics/alex-holyoake-1920x1280.jpg +0 -0
  260. data/lib/starter_web/assets/images/modules/attics/anaya-katlego-1920x1280.jpg +0 -0
  261. data/lib/starter_web/assets/images/modules/attics/antonella-lombardi-1920x1280.jpg +0 -0
  262. data/lib/starter_web/assets/images/modules/attics/antonino-visalli-1920x1280.jpg +0 -0
  263. data/lib/starter_web/assets/images/modules/attics/banner/docker-1280x600-bw.jpg +0 -0
  264. data/lib/starter_web/assets/images/modules/attics/banner/jekyll.1200x600-bw.jpg +0 -0
  265. data/lib/starter_web/assets/images/modules/attics/banner/signpost-1920x800-bw.jpg +0 -0
  266. data/lib/starter_web/assets/images/modules/attics/banner/water-journal-1280x600.jpg +0 -0
  267. data/lib/starter_web/assets/images/modules/attics/banner/write-1280x600-bw.jpg +0 -0
  268. data/lib/starter_web/assets/images/modules/attics/brandon-mowinkel-1920x1280.jpg +0 -0
  269. data/lib/starter_web/assets/images/modules/attics/daniel-jensen-1920x1280.jpg +0 -0
  270. data/lib/starter_web/assets/images/modules/attics/florian-olivo-1920x1280.jpg +0 -0
  271. data/lib/starter_web/assets/images/modules/attics/go-up-1920x1280-bw.jpg +0 -0
  272. data/lib/starter_web/assets/images/modules/attics/ian-schneider-1920x1280.jpg +0 -0
  273. data/lib/starter_web/assets/images/modules/attics/jason-rosewell-1920x1280.jpg +0 -0
  274. data/lib/starter_web/assets/images/modules/attics/joel-filipe-1920x1280.jpg +0 -0
  275. data/lib/starter_web/assets/images/modules/attics/lianhao-1920x1280.jpg +0 -0
  276. data/lib/starter_web/assets/images/modules/attics/library-1920x1280-bw.jpg +0 -0
  277. data/lib/starter_web/assets/images/modules/attics/mae-mue-1920x1280-v.jpg +0 -0
  278. data/lib/starter_web/assets/images/modules/attics/mae-mue-1920x1280.jpg +0 -0
  279. data/lib/starter_web/assets/images/modules/attics/markus-spiske-1920x1280.jpg +0 -0
  280. data/lib/starter_web/assets/images/modules/attics/markus-spiske.jpg +0 -0
  281. data/lib/starter_web/assets/images/modules/attics/markus-spiske3-1920x1280.jpg +0 -0
  282. data/lib/starter_web/assets/images/modules/attics/modules-apps-1920x1280.jpg +0 -0
  283. data/lib/starter_web/assets/images/modules/attics/nicola-styles-1920x1280.jpg +0 -0
  284. data/lib/starter_web/assets/images/modules/attics/no-time-1920x1280.jpg +0 -0
  285. data/lib/starter_web/assets/images/modules/attics/nousnou-iwasaki-1920x1280.jpg +0 -0
  286. data/lib/starter_web/assets/images/modules/attics/premium-1920x1280-bw.jpg +0 -0
  287. data/lib/starter_web/assets/images/modules/attics/responsive-text-1920x1280.jpg +0 -0
  288. data/lib/starter_web/assets/images/modules/attics/robert-v-ruggiero-1920x1280.jpg +0 -0
  289. data/lib/starter_web/assets/images/modules/attics/romain-vignes-1920x1280.jpg +0 -0
  290. data/lib/starter_web/assets/images/modules/attics/spider-web-1920x1200-bw.jpg +0 -0
  291. data/lib/starter_web/assets/images/modules/attics/the-place-1920x1280.jpg +0 -0
  292. data/lib/starter_web/assets/images/modules/icons/algolia/search-by-algolia.png +0 -0
  293. data/lib/starter_web/assets/images/modules/icons/d1/d1-256x256.png +0 -0
  294. data/lib/starter_web/assets/images/modules/icons/d1/d1-32x32.ico +0 -0
  295. data/lib/starter_web/assets/images/modules/icons/d1/d1-512x512.png +0 -0
  296. data/lib/starter_web/assets/images/modules/icons/d1/d1-64x64.png +0 -0
  297. data/lib/starter_web/assets/images/modules/icons/d1/d1.ico +0 -0
  298. data/lib/starter_web/assets/images/modules/icons/d1/favicon.ico +0 -0
  299. data/lib/starter_web/assets/images/modules/icons/d1/scalable/d1.svg +0 -2025
  300. data/lib/starter_web/assets/images/modules/icons/netlify/nf-logo.png +0 -0
  301. data/lib/starter_web/assets/images/modules/icons/p1/favicon.ico +0 -0
  302. data/lib/starter_web/assets/images/modules/icons/p1/p1-256x256.png +0 -0
  303. data/lib/starter_web/assets/images/modules/icons/p1/p1-32x32.ico +0 -0
  304. data/lib/starter_web/assets/images/modules/icons/p1/p1-512x512.png +0 -0
  305. data/lib/starter_web/assets/images/modules/icons/p1/p1-64x64.png +0 -0
  306. data/lib/starter_web/assets/images/modules/icons/p1/p1.ico +0 -0
  307. data/lib/starter_web/assets/images/modules/icons/p1/scalable/p1.svg +0 -2020
  308. data/lib/starter_web/assets/images/modules/icons/patreon/favicon-16x16.png +0 -0
  309. data/lib/starter_web/assets/images/modules/icons/patreon/favicon-32x32.png +0 -0
  310. data/lib/starter_web/assets/images/pages/j1_webhooks/000_browser_console-1280x600.jpg +0 -0
  311. data/lib/starter_web/assets/images/pages/j1_webhooks/001_smee_channel-1280x400.jpg +0 -0
  312. data/lib/starter_web/assets/images/pages/j1_webhooks/002_gh_repo_settings-1280x800.jpg +0 -0
  313. data/lib/starter_web/assets/images/pages/j1_webhooks/003_gh_webhook_settings-1280x1000.jpg +0 -0
  314. data/lib/starter_web/assets/images/pages/j1_webhooks/004_gh_webhook_settings-post-1280x600.jpg +0 -0
  315. data/lib/starter_web/assets/images/pages/j1_webhooks/005_smee_channel_ping_receive-1280x800.jpg +0 -0
  316. data/lib/starter_web/assets/images/pages/j1_webhooks/006_gh_redeliver_payload-1280x900.jpg +0 -0
  317. data/lib/starter_web/assets/images/pages/j1_webhooks/007_receive_redelivered_payload-1280x800.jpg +0 -0
  318. data/lib/starter_web/assets/images/pages/j1_webhooks/base/000_browser_console.jpg +0 -0
  319. data/lib/starter_web/assets/images/pages/j1_webhooks/base/000_smee_channel.jpg +0 -0
  320. data/lib/starter_web/assets/images/pages/j1_webhooks/base/002_gh_repo-settings.jpg +0 -0
  321. data/lib/starter_web/assets/images/pages/j1_webhooks/base/003_gh_webhook_settings.jpg +0 -0
  322. data/lib/starter_web/assets/images/pages/j1_webhooks/base/004_gh_webhook_settings-post.jpg +0 -0
  323. data/lib/starter_web/assets/images/pages/j1_webhooks/base/005_smee_channel_ping_received.jpg +0 -0
  324. data/lib/starter_web/assets/images/pages/j1_webhooks/base/006_gh_redeliver_payload.jpg +0 -0
  325. data/lib/starter_web/assets/images/pages/j1_webhooks/base/007_receive_redelivered_payload.jpg +0 -0
  326. data/lib/starter_web/assets/images/pages/j1_webhooks/base/webhook_flow.jpg +0 -0
  327. data/lib/starter_web/assets/images/pages/j1_webhooks/flows/webhook_flow-1920x1280.jpg +0 -0
  328. data/lib/starter_web/assets/images/pages/j1_webhooks/scaleable/webhook_flow.svg +0 -432
  329. data/lib/starter_web/assets/images/pages/j1_webhooks/uml/auth_mgmr_signin_request_flow.uxf +0 -632
  330. data/lib/starter_web/assets/images/pages/j1_webhooks/uml/webhook_flow.uxf +0 -648
  331. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/get-started-1920x1280-bw.jpg +0 -0
  332. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/130_layout_inheritance.png +0 -0
  333. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/content_inheritance.png +0 -0
  334. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/content_inheritance_thumb.png +0 -0
  335. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/html_layout.png +0 -0
  336. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/j1-quickstart-windows.png +0 -0
  337. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/j1-template-theme.jpg +0 -0
  338. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/j1_layout.png +0 -0
  339. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/jekyll-minima-theme.png +0 -0
  340. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/lane_inheritance.png +0 -0
  341. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/layout_inheritance.png +0 -0
  342. data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/preparations/msys_installation.jpg +0 -0
  343. data/lib/starter_web/assets/images/pages/log4j/apache-log4j-logo.png +0 -0
  344. data/lib/starter_web/assets/images/pages/log4r/code-1920x600.jpg +0 -0
  345. data/lib/starter_web/assets/images/pages/log4r/log4r-logo.png +0 -0
  346. data/lib/starter_web/assets/images/pages/log_expert/image_000.png +0 -0
  347. data/lib/starter_web/assets/images/pages/log_expert/image_001.png +0 -0
  348. data/lib/starter_web/assets/images/pages/log_expert/image_002.png +0 -0
  349. data/lib/starter_web/assets/images/pages/log_expert/image_003.png +0 -0
  350. data/lib/starter_web/assets/images/pages/log_expert/image_004.png +0 -0
  351. data/lib/starter_web/assets/images/pages/log_expert/image_005.png +0 -0
  352. data/lib/starter_web/assets/images/pages/log_expert/image_006.png +0 -0
  353. data/lib/starter_web/assets/images/pages/log_expert/image_007.png +0 -0
  354. data/lib/starter_web/assets/images/pages/log_expert/image_008.png +0 -0
  355. data/lib/starter_web/assets/images/pages/log_expert/image_009.png +0 -0
  356. data/lib/starter_web/assets/images/pages/log_expert/image_010.png +0 -0
  357. data/lib/starter_web/assets/images/pages/log_expert/image_011.png +0 -0
  358. data/lib/starter_web/assets/images/pages/log_expert/image_012.png +0 -0
  359. data/lib/starter_web/assets/images/pages/log_expert/image_013.png +0 -0
  360. data/lib/starter_web/assets/images/pages/log_expert/image_014.png +0 -0
  361. data/lib/starter_web/assets/images/pages/log_expert/image_015.png +0 -0
  362. data/lib/starter_web/assets/images/pages/log_expert/image_016.png +0 -0
  363. data/lib/starter_web/assets/images/pages/log_expert/image_017.png +0 -0
  364. data/lib/starter_web/assets/images/pages/log_expert/image_018.png +0 -0
  365. data/lib/starter_web/assets/images/pages/log_expert/image_019.png +0 -0
  366. data/lib/starter_web/assets/images/pages/log_expert/image_020.png +0 -0
  367. data/lib/starter_web/assets/images/pages/log_expert/image_021.png +0 -0
  368. data/lib/starter_web/assets/images/pages/log_expert/image_022.png +0 -0
  369. data/lib/starter_web/assets/images/pages/log_expert/image_023.png +0 -0
  370. data/lib/starter_web/assets/images/pages/log_expert/image_024.png +0 -0
  371. data/lib/starter_web/assets/images/pages/log_expert/image_025.png +0 -0
  372. data/lib/starter_web/assets/images/pages/log_expert/image_026.png +0 -0
  373. data/lib/starter_web/assets/images/pages/log_expert/image_027.png +0 -0
  374. data/lib/starter_web/assets/images/pages/log_expert/image_028.png +0 -0
  375. data/lib/starter_web/assets/images/pages/log_expert/image_029.png +0 -0
  376. data/lib/starter_web/assets/images/pages/log_expert/image_030.png +0 -0
  377. data/lib/starter_web/assets/images/pages/log_expert/image_031.png +0 -0
  378. data/lib/starter_web/assets/images/pages/log_expert/image_032.png +0 -0
  379. data/lib/starter_web/assets/images/pages/log_expert/image_033.png +0 -0
  380. data/lib/starter_web/assets/images/pages/log_expert/image_034.png +0 -0
  381. data/lib/starter_web/assets/images/pages/log_expert/image_035.png +0 -0
  382. data/lib/starter_web/assets/images/pages/log_expert/image_036.png +0 -0
  383. data/lib/starter_web/assets/images/pages/log_expert/image_037.png +0 -0
  384. data/lib/starter_web/assets/images/pages/log_expert/image_038.png +0 -0
  385. data/lib/starter_web/assets/images/pages/log_expert/image_039.png +0 -0
  386. data/lib/starter_web/assets/images/pages/log_expert/image_040.png +0 -0
  387. data/lib/starter_web/assets/images/pages/log_expert/image_041.png +0 -0
  388. data/lib/starter_web/assets/images/pages/log_expert/image_042.png +0 -0
  389. data/lib/starter_web/assets/images/pages/log_expert/image_043.png +0 -0
  390. data/lib/starter_web/assets/images/pages/log_expert/image_044.png +0 -0
  391. data/lib/starter_web/assets/images/pages/log_expert/image_045.png +0 -0
  392. data/lib/starter_web/assets/images/pages/log_expert/image_046.png +0 -0
  393. data/lib/starter_web/assets/images/pages/log_expert/image_047.png +0 -0
  394. data/lib/starter_web/assets/images/pages/log_expert/image_048.png +0 -0
  395. data/lib/starter_web/assets/images/pages/log_expert/image_049.png +0 -0
  396. data/lib/starter_web/assets/images/pages/log_expert/image_050.png +0 -0
  397. data/lib/starter_web/assets/images/pages/log_expert/image_051.png +0 -0
  398. data/lib/starter_web/assets/images/pages/log_expert/image_052.png +0 -0
  399. data/lib/starter_web/assets/images/pages/log_expert/image_053.png +0 -0
  400. data/lib/starter_web/assets/images/pages/log_expert/image_054.png +0 -0
  401. data/lib/starter_web/assets/images/pages/log_expert/image_055.png +0 -0
  402. data/lib/starter_web/assets/images/pages/log_expert/image_056.png +0 -0
  403. data/lib/starter_web/assets/images/pages/log_expert/image_057.png +0 -0
  404. data/lib/starter_web/assets/images/pages/material/apple-touch-icon.png +0 -0
  405. data/lib/starter_web/assets/images/pages/pen/jquery/jQuery-logo.png +0 -0
  406. data/lib/starter_web/assets/images/pages/pen/jquery/jquery-banner-1280x600.jpg +0 -0
  407. data/lib/starter_web/assets/images/pages/pen/jquery/jquery-banner-1920x800.jpg +0 -0
  408. data/lib/starter_web/assets/images/pages/pen/jquery/src/JQuery-Logo.svg +0 -122
  409. data/lib/starter_web/assets/images/pages/pen/jquery/src/banner.psd +0 -0
  410. data/lib/starter_web/assets/images/pages/winlogbeat/coordinate-map.png +0 -0
  411. data/lib/starter_web/assets/images/pages/winlogbeat/kibana-powershell.jpg +0 -0
  412. data/lib/starter_web/assets/images/pages/winlogbeat/option_ignore_outgoing.png +0 -0
  413. data/lib/starter_web/assets/images/pages/winlogbeat/winlogbeat-dashboard.png +0 -0
  414. data/lib/starter_web/assets/images/pages/writers_guide/1280px-PDCA_Process.png +0 -0
  415. data/lib/starter_web/assets/images/pages/writers_guide/annie-spratt-1920x1280.jpg +0 -0
  416. data/lib/starter_web/assets/images/pages/writers_guide/deming-cycle.png +0 -0
  417. data/lib/starter_web/assets/images/pages/writers_guide/humble-lamb-1920x1280.jpg +0 -0
  418. data/lib/starter_web/assets/images/pages/writers_guide/john-schnobrich-1920x1280.jpg +0 -0
  419. data/lib/starter_web/assets/images/pages/writers_guide/sigmund-1920x1280.jpg +0 -0
  420. data/lib/starter_web/collections/posts/public/series/_posts/_includes/attributes.asciidoc +0 -37
  421. data/lib/starter_web/collections/posts/public/series/_posts/_includes/documents/readme +0 -0
  422. data/lib/starter_web/collections/posts/public/series/_posts/_includes/tables/debug_variables.asciidoc +0 -47
  423. data/lib/starter_web/pages/protected/site_search.adoc +0 -180
  424. data/lib/starter_web/pages/public/asciidoc_skeletons/book/book.pdf +1 -5439
  425. data/lib/starter_web/pages/public/legal/en/000_copyright.adoc +0 -93
  426. data/lib/starter_web/pages/public/legal/en/100_impress.adoc +0 -55
  427. data/lib/starter_web/pages/public/legal/en/200_terms_of_use.adoc +0 -53
  428. data/lib/starter_web/pages/public/legal/en/eu/cookie.policy.asciidoc +0 -50
@@ -238,6 +238,7 @@ var j1 = (function () {
238
238
  var logger = log4javascript.getLogger('j1.init');
239
239
  var url = new liteURL(window.location.href);
240
240
  var baseUrl = url.origin;
241
+ // moment not used anymore
241
242
  // var epoch = Math.floor(Date.now()/1000);
242
243
  // var timestamp_now = moment.unix(epoch).format('YYYY-MM-DD HH:mm:ss');
243
244
  var date = new Date();
@@ -275,6 +276,7 @@ var j1 = (function () {
275
276
  var cookie_names = j1.getCookieNames();
276
277
  var cookie_user_state_name = cookie_names.user_state;
277
278
  var cookie_user_session_name = cookie_names.user_session;
279
+ // moment not used anymore
278
280
  // var epoch = Math.floor(Date.now()/1000);
279
281
  // var timestamp_now = moment.unix(epoch).format('YYYY-MM-DD HH:mm:ss');
280
282
  var date = new Date();
@@ -284,14 +286,19 @@ var j1 = (function () {
284
286
  var url;
285
287
  var baseUrl;
286
288
 
287
- user_state.session_active = false;
288
- user_state.last_session_ts = timestamp_now;
289
+ // update cookie only, if (already) exists
290
+ //
291
+ if (user_state) {
292
+ user_state.session_active = false;
293
+ user_state.last_session_ts = timestamp_now;
294
+
295
+ j1.writeCookie({
296
+ name: cookie_user_state_name,
297
+ data: user_state,
298
+ expires: 365
299
+ });
300
+ }
289
301
 
290
- j1.writeCookie({
291
- name: cookie_user_state_name,
292
- data: user_state,
293
- expires: 365
294
- });
295
302
  });
296
303
 
297
304
  // -----------------------------------------------------------------------
@@ -502,7 +509,7 @@ var j1 = (function () {
502
509
  var cb_load_closure = function(banner_id) {
503
510
  return function ( responseTxt, statusTxt, xhr ) {
504
511
  if ( statusTxt == 'success' ) {
505
- var logger = log4javascript.getLogger('j1.xhrData');
512
+ var logger = log4javascript.getLogger('j1.adapter.xhrData');
506
513
  logText = 'loading banner completed on id: ' +banner_id;
507
514
  logger.info(logText);
508
515
  j1.setXhrDataState(banner_id, statusTxt);
@@ -579,7 +586,8 @@ var j1 = (function () {
579
586
  if (selector.length) {
580
587
  logText = 'loading banner on id: ' +banner[i];
581
588
  logger.info(logText);
582
- var banner_data_path = '{{banner_data_path}} ' + id + ' > *';
589
+ // var banner_data_path = '{{banner_data_path}} ' + id + ' > *';
590
+ var banner_data_path = '{{banner_data_path}} ' + id;
583
591
  selector.load(banner_data_path, cb_load_closure(id));
584
592
  }
585
593
  } // END for
@@ -612,7 +620,7 @@ var j1 = (function () {
612
620
  -------------------------------------------------------------------------- {% endcomment %}
613
621
  var cb_load_closure = function(panel_id) {
614
622
  return function ( responseTxt, statusTxt, xhr ) {
615
- var logger = log4javascript.getLogger('j1.xhrData');
623
+ var logger = log4javascript.getLogger('j1.adapter.xhrData');
616
624
  if ( statusTxt == 'success' ) {
617
625
  logText = 'loading panel completed on id: ' +panel_id;
618
626
  logger.info(logText);
@@ -682,7 +690,8 @@ var j1 = (function () {
682
690
  if ( selector.length ) {
683
691
  logText = 'loading panel on id: ' +panel[i];
684
692
  logger.info(logText);
685
- var panel_data_path = '{{panel_data_path}} ' + id + ' > *';
693
+ // var panel_data_path = '{{panel_data_path}} ' + id + ' > *';
694
+ var panel_data_path = '{{panel_data_path}} ' + id;
686
695
  selector.load(panel_data_path, cb_load_closure(id));
687
696
  }
688
697
  } // END for
@@ -708,7 +717,7 @@ var j1 = (function () {
708
717
 
709
718
  var cb_load_closure = function(footer_id) {
710
719
  return function ( responseTxt, statusTxt, xhr ) {
711
- var logger = log4javascript.getLogger('j1.xhrData');
720
+ var logger = log4javascript.getLogger('j1.adapter.xhrData');
712
721
  if ( statusTxt == 'success' ) {
713
722
  logText = 'footer loaded successfully on id: ' + footer_id;
714
723
  logger.info(logText);
@@ -742,7 +751,8 @@ var j1 = (function () {
742
751
  var id = '#' + '{{footer_id}}';
743
752
  var selector = $(id);
744
753
  if ( selector.length ) {
745
- var footer_data_path = '{{footer_data_path}}';
754
+ // var footer_data_path = '{{footer_data_path}} ' + id + ' > *';
755
+ var footer_data_path = '{{footer_data_path}} ' + id;
746
756
  selector.load(footer_data_path, cb_load_closure(id));
747
757
  } else {
748
758
  logText = 'data not loaded';
@@ -765,7 +775,7 @@ var j1 = (function () {
765
775
  // to load the current state from the middleware (skipped in WEB mode)
766
776
  // -------------------------------------------------------------------------
767
777
  displayPage: function (options) {
768
- var logger = log4javascript.getLogger('j1.displayPage');
778
+ var logger = log4javascript.getLogger('j1.adapter.displayPage');
769
779
  var flickerTimeout = {{template_config.flicker_timeout}};
770
780
  var url = new liteURL(window.location.href);
771
781
  var baseUrl = url.origin;
@@ -1110,7 +1120,7 @@ var j1 = (function () {
1110
1120
  // specified by xhr_container_id, xhr_data_path (options)
1111
1121
  // -------------------------------------------------------------------------
1112
1122
  xhrData: function (options, mod, status) {
1113
- var logger = log4javascript.getLogger('j1.xhrData');
1123
+ var logger = log4javascript.getLogger('j1.adapter.xhrData');
1114
1124
  var selector = $('#' + options.xhr_container_id);
1115
1125
  var state = status;
1116
1126
  var observer_options = {
@@ -1124,7 +1134,7 @@ var j1 = (function () {
1124
1134
 
1125
1135
  var cb_load_closure = function(mod, id) {
1126
1136
  return function (responseTxt, statusTxt, xhr) {
1127
- var logger = log4javascript.getLogger('j1.xhrData');
1137
+ var logger = log4javascript.getLogger('j1.adapter.xhrData');
1128
1138
  if ( statusTxt === 'success' ) {
1129
1139
  // jadams, 2020-07-21: intermediate state should DISABLED
1130
1140
  // if (state) {
@@ -1154,15 +1164,20 @@ var j1 = (function () {
1154
1164
  }
1155
1165
  };
1156
1166
  };
1167
+
1157
1168
  // see: https://stackoverflow.com/questions/20420577/detect-added-element-to-dom-with-mutation-observer
1169
+ //
1158
1170
  var html_data_path;
1159
1171
  var id = '#' + options.xhr_container_id;
1172
+ var container = '#' + options.xhr_container_id + '_container';
1160
1173
  var $selector = $(id);
1161
1174
 
1162
1175
  if ( $selector.length ) {
1163
1176
  if (options.xhr_data_element) {
1164
- html_data_path = options.xhr_data_path + ' #' + options.xhr_data_element + ' > *';
1177
+ html_data_path = options.xhr_data_path + ' #' + options.xhr_data_element;
1178
+ logger.info('XHR data element found: ' + options.xhr_data_element);
1165
1179
  } else {
1180
+ logger.warn('no XHR data element found. HTML data loaded full page.');
1166
1181
  html_data_path = options.xhr_data_path + ' > *';
1167
1182
  }
1168
1183
  $selector.load( html_data_path, cb_load_closure( mod, id ) );
@@ -1246,6 +1261,12 @@ var j1 = (function () {
1246
1261
  // Config to use this attribute should be configurable
1247
1262
  // (what config file?).
1248
1263
  // Disabled use for now in general.
1264
+ //
1265
+ // The SameSite attribute of the Set-Cookie HTTP response header
1266
+ // allows you to declare if your cookie should be restricted to a
1267
+ // first-party or same-site context. Cookies with SameSite=None
1268
+ // must now also specify the Secure attribute (they require a secure
1269
+ // context/HTTPS).
1249
1270
  // -------------------------------------------------------------------------
1250
1271
  //
1251
1272
  writeCookie: function (options /*name, data, [path, expires, SameSite, secure]*/) {
@@ -1255,10 +1276,12 @@ var j1 = (function () {
1255
1276
  expires: 0,
1256
1277
  path: '/',
1257
1278
  // SameSite: 'Strict',
1279
+ // SameSite: 'Lax',
1280
+ http_only: false,
1258
1281
  secure: false
1259
1282
  };
1260
1283
  var settings = $.extend(defaults, options);
1261
-
1284
+ // moment not used anymore
1262
1285
  // var epoch = Math.floor(Date.now()/1000);
1263
1286
  // var timestamp_now = moment.unix(epoch).format('YYYY-MM-DD HH:mm:ss');
1264
1287
  var date = new Date();
@@ -1277,11 +1300,11 @@ var j1 = (function () {
1277
1300
  if (settings.expires > 0) {
1278
1301
  Cookies.set(settings.name, data_encoded, {
1279
1302
  expires: settings.expires,
1280
- // SameSite: settings.SameSite
1303
+ SameSite: settings.SameSite
1281
1304
  });
1282
1305
  } else {
1283
1306
  Cookies.set(settings.name, data_encoded, {
1284
- // SameSite: settings.SameSite
1307
+ SameSite: settings.SameSite
1285
1308
  });
1286
1309
  }
1287
1310
  } else {
@@ -1291,11 +1314,11 @@ var j1 = (function () {
1291
1314
  if (settings.expires > 0) {
1292
1315
  Cookies.set(settings.name, data_encoded, {
1293
1316
  expires: settings.expires,
1294
- // SameSite: settings.SameSite
1317
+ SameSite: settings.SameSite
1295
1318
  });
1296
1319
  } else {
1297
1320
  Cookies.set(settings.name, data_encoded, {
1298
- // SameSite: settings.SameSite
1321
+ SameSite: settings.SameSite
1299
1322
  });
1300
1323
  }
1301
1324
  }
@@ -1793,8 +1816,8 @@ var j1 = (function () {
1793
1816
  }, // END checkUserAgent
1794
1817
 
1795
1818
  // -------------------------------------------------------------------------
1796
- // checkUserAgent()
1797
- // Returns the name (UA) of the web browser
1819
+ // generateId()
1820
+ // Generate a unique (thread) id used by the logger
1798
1821
  // -------------------------------------------------------------------------
1799
1822
  generateId: function (length) {
1800
1823
  var result = '';
@@ -1804,7 +1827,7 @@ var j1 = (function () {
1804
1827
  result += characters.charAt(Math.floor(Math.random() * charactersLength));
1805
1828
  }
1806
1829
  return result;
1807
- }, // END checkUserAgent
1830
+ }, // END generateId
1808
1831
 
1809
1832
  // -------------------------------------------------------------------------
1810
1833
  // getTrue()
@@ -0,0 +1,1878 @@
1
+ ---
2
+ regenerate: true
3
+ ---
4
+
5
+ {% capture cache %}
6
+
7
+ {% comment %}
8
+ # -----------------------------------------------------------------------------
9
+ # ~/assets/themes/j1/core/js/j1.js
10
+ # Liquid template to initialize J1 Template Core functions
11
+ #
12
+ # Product/Info:
13
+ # https://jekyll.one
14
+ #
15
+ # Copyright (C) 2021 Juergen Adams
16
+ #
17
+ # J1 Template is licensed under the MIT License.
18
+ # For details, see https://jekyll.one
19
+ # -----------------------------------------------------------------------------
20
+ # Test data:
21
+ # {{ liquid_var | debug }}
22
+ # -----------------------------------------------------------------------------
23
+ {% endcomment %}
24
+
25
+ {% comment %} Liquid procedures
26
+ -------------------------------------------------------------------------------- {% endcomment %}
27
+
28
+ {% comment %} Set global settings
29
+ -------------------------------------------------------------------------------- {% endcomment %}
30
+ {% assign environment = site.environment %}
31
+ {% assign template_version = site.version %}
32
+
33
+ {% if site.permalink == 'none' %}
34
+ {% capture page_url %}{{ site.url }}.html{% endcapture %}
35
+ {% else %}
36
+ {% capture page_url %}{{ site.url }}{% endcapture %}
37
+ {% endif %}
38
+
39
+ {% comment %} Process YML config data
40
+ ================================================================================ {% endcomment %}
41
+
42
+ {% comment %} Set config files
43
+ -------------------------------------------------------------------------------- {% endcomment %}
44
+ {% assign template_config = site.data.j1_config %}
45
+ {% assign blocks = site.data.blocks %}
46
+ {% assign modules = site.data.modules %}
47
+
48
+ {% comment %} Set config data
49
+ -------------------------------------------------------------------------------- {% endcomment %}
50
+ {% assign banner_config_defaults = blocks.defaults.banner.defaults %}
51
+ {% assign banner_config_settings = blocks.banner.settings %}
52
+ {% assign panel_config_defaults = blocks.defaults.panel.defaults %}
53
+ {% assign panel_config_settings = blocks.panel.settings %}
54
+ {% assign footer_config_defaults = blocks.defaults.footer.defaults %}
55
+ {% assign toccer_defaults = modules.defaults.toccer.defaults %}
56
+ {% assign toccer_settings = modules.toccer.settings %}
57
+ {% assign themer_defaults = modules.defaults.themer.defaults %}
58
+ {% assign themer_settings = modules.themer.settings %}
59
+
60
+ {% assign authentication_defaults = modules.defaults.authentication.defaults %}
61
+ {% assign authentication_settings = modules.authentication.settings %}
62
+
63
+ {% comment %} Set config options
64
+ -------------------------------------------------------------------------------- {% endcomment %}
65
+ {% assign toccer_options = toccer_defaults | merge: toccer_settings %}
66
+ {% assign themer_options = themer_defaults | merge: themer_settings %}
67
+
68
+ {% assign authentication_options = authentication_defaults | merge: authentication_settings %}
69
+
70
+ {% assign footer_id = footer_config_defaults.container-id %}
71
+ {% assign footer_data_path = footer_config_defaults.data_path %}
72
+ {% assign banner_data_path = banner_config_defaults.data_path %}
73
+ {% assign panel_data_path = panel_config_defaults.data_path %}
74
+
75
+ {% assign hideOnReload = modules.themer_options.hideOnReload %}
76
+
77
+ {% assign production = false %}
78
+ {% if environment == 'prod' or environment == 'production' %}
79
+ {% assign production = true %}
80
+ {% endif %}
81
+
82
+ /*
83
+ # -----------------------------------------------------------------------------
84
+ # ~/assets/themes/j1/adapter/js/j1_template.js
85
+ # JS Adapter for J1 Template
86
+ #
87
+ # Product/Info:
88
+ # https://jekyll.one
89
+ #
90
+ # Copyright (C) 2021 Juergen Adams
91
+ #
92
+ # J1 Template is licensed under the MIT License.
93
+ # For details, see https://jekyll.one
94
+ # -----------------------------------------------------------------------------
95
+ # TODO:
96
+ # MANAGE themeExtensionCss is to be checked
97
+ #
98
+ # -----------------------------------------------------------------------------
99
+ # Adapter generated: {{site.time}}
100
+ # -----------------------------------------------------------------------------
101
+ */
102
+
103
+ // -----------------------------------------------------------------------------
104
+ // ESLint shimming
105
+ // -----------------------------------------------------------------------------
106
+ /* eslint indent: "off" */
107
+ /* eslint quotes: "off" */
108
+ /* eslint semi: "off" */
109
+ // -----------------------------------------------------------------------------
110
+ 'use strict';
111
+
112
+ var j1 = (function () {
113
+
114
+ // ---------------------------------------------------------------------------
115
+ // globals
116
+ // ---------------------------------------------------------------------------
117
+ var rePager = new RegExp('navigator|dateview|tagview|archive');
118
+ var environment = '{{environment}}';
119
+ var moduleOptions = {};
120
+ var j1_runtime_data = {};
121
+
122
+ // Status information
123
+ var state = 'not_started';
124
+ var mode = 'not_detected';
125
+
126
+ var current_user_data;
127
+ var current_page;
128
+ var previous_page;
129
+ var last_pager;
130
+ var last_pager_url;
131
+ var app_detected;
132
+ var user_session_detected;
133
+
134
+ // Connector settings
135
+ var translation_enabled = {{template_config.translation.enabled}};
136
+
137
+ // Theme information
138
+ var themeName;
139
+ var themeCss;
140
+ var themeExtensionCss = environment === 'production' ? '/assets/themes/j1/core/css/themes/theme-extensions.min.css' : '/assets/themes/j1/core/css/themes/theme-extensions.css';
141
+
142
+ // Pathes of J1 data files
143
+ var colors_data_path = '{{template_config.colors_data_path}}';
144
+ var font_size_data_path = '{{template_config.font_size_data_path}}';
145
+ var runtime_data_path = '{{template_config.runtime_data_path}}';
146
+ var message_catalog_data_path = '{{template_config.message_catalog_data_path}}';
147
+
148
+ // Logger
149
+ var logger;
150
+ var logText;
151
+
152
+ var _this;
153
+ var settings;
154
+ var json_data;
155
+ var ep;
156
+ var baseUrl;
157
+ var referrer;
158
+
159
+ // var default_theme_css = environment === 'production' ? '/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css' : '/assets/themes/j1/core/css/themes/uno-light/bootstrap.css';
160
+ // // TODO: check what property is used default_theme|default_theme_name ?
161
+ // var default_theme_display_name = 'Uno (light)';
162
+ // var default_theme_name = 'uno-light';
163
+ // var default_theme_author = 'J1 Team';
164
+ // var default_theme_link = 'https://jekyll.one/';
165
+ var default_white_listed_pages = [];
166
+
167
+ var cookie_names = {
168
+ 'app_session': '{{template_config.cookies.app_session}}',
169
+ 'user_session': '{{template_config.cookies.user_session}}',
170
+ 'user_state': '{{template_config.cookies.user_state}}'
171
+ };
172
+
173
+ // user SESSION cookie (initial values)
174
+ var user_session = {
175
+ 'mode': 'web',
176
+ 'writer': 'web',
177
+ 'locale': navigator.language || navigator.userLanguage,
178
+ 'user_name': '{{template_config.user.user_name}}',
179
+ 'provider': '{{template_config.user.provider}}',
180
+ 'provider_membership': '{{template_config.user.provider_membership}}',
181
+ 'provider_permissions': 'public,{{template_config.user.provider_permissions}}',
182
+ 'provider_site_url': '{{template_config.user.provider_site_url}}',
183
+ 'provider_home_url': '{{template_config.user.provider_home_url}}',
184
+ 'provider_blog_url': '{{template_config.user.provider_blog_url}}',
185
+ 'provider_member_url': '{{template_config.user.provider_member_url}}',
186
+ 'provider_privacy_url': '{{template_config.user.provider_privacy_url}}',
187
+ 'requested_page': 'na',
188
+ 'previous_page': 'na',
189
+ 'last_pager': '/pages/public/blog/navigator/'
190
+ };
191
+
192
+ // user STATE cookie (initial values)
193
+ var user_state = {
194
+ 'theme_css': "",
195
+ 'theme_name': "",
196
+ 'theme_author': "",
197
+ 'theme_version': '{{site.version}}',
198
+ 'cookies_accepted': 'pending',
199
+ 'whitelistedPages': default_white_listed_pages,
200
+ 'deleteOnDecline': false,
201
+ 'showConsentOnPending': false,
202
+ 'stopScrolling': true,
203
+ 'session_active': false,
204
+ 'last_session_ts': '',
205
+ 'cc_authenticated': false
206
+ };
207
+
208
+ // ---------------------------------------------------------------------------
209
+ // helper functions
210
+ // ---------------------------------------------------------------------------
211
+
212
+ function executeFunctionByName(functionName, context /*, args */) {
213
+ // See: https://stackoverflow.com/questions/359788/how-to-execute-a-javascript-function-when-i-have-its-name-as-a-string
214
+ //
215
+ var args = Array.prototype.slice.call(arguments, 2);
216
+ var namespaces = functionName.split('.');
217
+ var func = namespaces.pop();
218
+ for(var i = 0; i < namespaces.length; i++) {
219
+ context = context[namespaces[i]];
220
+ }
221
+ return context[func].apply(context, args);
222
+ }
223
+
224
+ // ---------------------------------------------------------------------------
225
+ // main object
226
+ // ---------------------------------------------------------------------------
227
+ return {
228
+
229
+ // -------------------------------------------------------------------------
230
+ // init()
231
+ // initializer
232
+ // -------------------------------------------------------------------------
233
+ init: function (options) {
234
+
235
+ // -----------------------------------------------------------------------
236
+ // global var (function)
237
+ // -----------------------------------------------------------------------
238
+ var logger = log4javascript.getLogger('j1.init');
239
+ var url = new liteURL(window.location.href);
240
+ var baseUrl = url.origin;
241
+ // moment not used anymore
242
+ // var epoch = Math.floor(Date.now()/1000);
243
+ // var timestamp_now = moment.unix(epoch).format('YYYY-MM-DD HH:mm:ss');
244
+ var date = new Date();
245
+ var timestamp_now = date.toISOString();
246
+ var curr_state = 'started';
247
+ // var date = new Date();
248
+ // var my_timestamp = date.toISOString();
249
+
250
+
251
+ // -----------------------------------------------------------------------
252
+ // options loader
253
+ // -----------------------------------------------------------------------
254
+ var settings = $.extend(
255
+ {
256
+ foo: 'foo_option',
257
+ bar: 'bar_option'
258
+ },
259
+ options
260
+ );
261
+
262
+ // -----------------------------------------------------------------------
263
+ // status settings
264
+ // save status into the adapter object for (later) global access
265
+ // -----------------------------------------------------------------------
266
+ j1['xhrDataState'] = {};
267
+ j1['xhrDOMState'] = {};
268
+
269
+ // -----------------------------------------------------------------------
270
+ // session ON_CLOSE event
271
+ // wrapup if ALL browser windows get closed. Update user STATE
272
+ // cookie on window CLOSE.
273
+ // see: https://stackoverflow.com/questions/3888902/detect-browser-or-tab-closing
274
+ // -----------------------------------------------------------------------
275
+ window.addEventListener('beforeunload', function (event) {
276
+ var cookie_names = j1.getCookieNames();
277
+ var cookie_user_state_name = cookie_names.user_state;
278
+ var cookie_user_session_name = cookie_names.user_session;
279
+ // moment not used anymore
280
+ // var epoch = Math.floor(Date.now()/1000);
281
+ // var timestamp_now = moment.unix(epoch).format('YYYY-MM-DD HH:mm:ss');
282
+ var date = new Date();
283
+ var timestamp_now = date.toISOString();
284
+ var user_state = j1.readCookie(cookie_user_state_name);
285
+ var ep_status;
286
+ var url;
287
+ var baseUrl;
288
+
289
+ // update cookie only, if (already) exists
290
+ //
291
+ if (user_state) {
292
+ user_state.session_active = false;
293
+ user_state.last_session_ts = timestamp_now;
294
+
295
+ j1.writeCookie({
296
+ name: cookie_user_state_name,
297
+ data: user_state,
298
+ expires: 365
299
+ });
300
+ }
301
+
302
+ });
303
+
304
+ // -----------------------------------------------------------------------
305
+ // initialize|load (existing) user cookies
306
+ // -----------------------------------------------------------------------
307
+ user_session.created = timestamp_now;
308
+ user_session.timestamp = timestamp_now;
309
+
310
+ user_session = j1.existsCookie(cookie_names.user_session)
311
+ ? j1.readCookie(cookie_names.user_session)
312
+ : j1.writeCookie({
313
+ name: cookie_names.user_session,
314
+ data: user_session,
315
+ });
316
+
317
+ user_state = j1.existsCookie(cookie_names.user_state)
318
+ ? j1.readCookie(cookie_names.user_state)
319
+ : j1.writeCookie({
320
+ name: cookie_names.user_state,
321
+ data: user_state,
322
+ expires: 365
323
+ });
324
+
325
+ user_state.session_active = true;
326
+ j1.writeCookie({
327
+ name: cookie_names.user_state,
328
+ data: user_state,
329
+ expires: 365
330
+ });
331
+
332
+ // detect middleware (mode 'app') and update user session cookie
333
+ // -----------------------------------------------------------------------
334
+ // if (user_session.mode === 'na' || user_session.mode === 'app') {
335
+ if (user_session.mode === 'app') {
336
+ var url = new liteURL(window.location.href);
337
+ var ep_status = baseUrl + '/status' + '?page=' + window.location.pathname;
338
+ var detectTimeout = 50;
339
+
340
+ baseUrl = url.origin;
341
+
342
+ // see: https://stackoverflow.com/questions/3709597/wait-until-all-jquery-ajax-requests-are-done
343
+ $.when (
344
+ $.ajax(ep_status)
345
+ )
346
+ .then(function(data) {
347
+ var logger = log4javascript.getLogger('j1.init');
348
+ user_session = j1.readCookie(cookie_names.user_session);
349
+ user_session.mode = 'app';
350
+ user_session.requested_page = window.location.pathname;
351
+ user_session.timestamp = timestamp_now;
352
+ user_session = j1.mergeData(user_session, data);
353
+ logText = 'mode detected: ' + user_session.mode;
354
+
355
+ logger.info(logText);
356
+ logger.info('update user session cookie');
357
+ j1.writeCookie({
358
+ name: cookie_names.user_session,
359
+ data: user_session
360
+ });
361
+ j1.setState(curr_state);
362
+ logger.info('state: ' + j1.getState());
363
+
364
+
365
+
366
+
367
+ var dependencies_met_page_displayed = setInterval (function () {
368
+ if (j1.getState() == 'finished') {
369
+ if (j1.authEnabled()) {
370
+ if (user_session.authenticated === 'true') {
371
+ // set signout
372
+ logger.info('show signout icon');
373
+ $('#navLinkSignInOut').attr('data-target','#modalOmniSignOut');
374
+ $('#iconSignInOut').removeClass('mdi-login').addClass('mdi-logout');
375
+ } else {
376
+ // set signin
377
+ logger.info('show signin icon');
378
+ $('#navLinkSignInOut').attr('data-target','#modalOmniSignIn');
379
+ $('#iconSignInOut').removeClass('mdi-logout').addClass('mdi-login');
380
+ }
381
+ logger.info('authentication detected as: ' + user_session.authenticated);
382
+ $('#quickLinksSignInOutButton').css('display', 'block');
383
+ logger.info('met dependencies for: j1');
384
+ clearInterval(dependencies_met_page_displayed);
385
+ }
386
+ }
387
+ }, 25); // END dependencies_met_page_displayed
388
+ })
389
+ .catch(function(error) {
390
+ // jadams, 2018-08-31: Why a hell a setTimeout is needed ???
391
+ setTimeout (function() {
392
+ var logger = log4javascript.getLogger('j1.init');
393
+ user_session = j1.readCookie(cookie_names.user_session);
394
+ user_session.mode = 'web';
395
+ user_session.requested_page = window.location.pathname;
396
+ user_session.timestamp = timestamp_now;
397
+ logText = 'mode detected: ' + user_session.mode;
398
+
399
+ logger.info(logText);
400
+ j1.writeCookie({
401
+ name: cookie_names.user_session,
402
+ data: user_session
403
+ });
404
+ j1.setState(curr_state);
405
+ logger.info('state: ' + j1.getState());
406
+ }, detectTimeout);
407
+ });
408
+ } else { // app mode
409
+ state = 'started';
410
+ logger.info('state: ' + state);
411
+ logger.info('page is being initialized');
412
+ }
413
+
414
+ // jadams: for testing only
415
+ // display page
416
+ // $('#no_flicker').css('display', 'block');
417
+
418
+ state = 'started';
419
+ logger.info('state: ' + state);
420
+ logger.info('page is being initialized');
421
+
422
+ if ( settings.scrollbar === 'false' ) {
423
+ $('body').addClass('hide-scrollbar');
424
+ $('html').addClass('hide-scrollbar-moz');
425
+ }
426
+
427
+ logger.info('read user state from cookie');
428
+ user_session = j1.readCookie(cookie_names.user_session);
429
+
430
+ // process|update user state cookie
431
+ themeName = user_session.theme_name;
432
+ themeCss = user_session.theme_css;
433
+ themeExtensionCss = user_session.theme_extension_css;
434
+
435
+ // save last page access
436
+ // see: https://stackoverflow.com/questions/3528324/how-to-get-the-previous-url-in-javascript
437
+ // see: https://developer.mozilla.org/de/docs/Web/API/Window/history
438
+ //
439
+ user_session.timestamp = timestamp_now;
440
+ referrer = new liteURL(document.referrer);
441
+ current_page = window.location.pathname;
442
+ user_session.requested_page = current_page;
443
+ user_session.previous_page = referrer.search === '' ?
444
+ (referrer.pathname === '' ? current_page : referrer.pathname) :
445
+ (user_session.previous_page === '' || user_session.previous_page === 'na'
446
+ ? '/'
447
+ : user_session.previous_page
448
+ );
449
+
450
+ // calculate last 'pager' if any
451
+ if (rePager.test(user_session.previous_page)) {
452
+ last_pager = user_session.previous_page;
453
+ user_session.last_pager = last_pager;
454
+ } else {
455
+ last_pager = user_session.last_pager;
456
+ }
457
+
458
+ // jadams: for testing only
459
+ // display page
460
+ //$('#no_flicker').css('display', 'block');
461
+
462
+ logger.info('update user session cookie');
463
+ j1.writeCookie({
464
+ name: cookie_names.user_session,
465
+ data: user_session
466
+ });
467
+
468
+ // initialize page resources for blocks
469
+ // (asynchronous, should be rewitten to xhrData)
470
+ j1.initBanner(settings);
471
+ j1.initPanel(settings);
472
+ j1.initFooter(settings);
473
+
474
+ state = 'running';
475
+ logger.info('state: ' + state);
476
+ logger.info(logText);
477
+
478
+ user_session.timestamp = timestamp_now;
479
+ j1.writeCookie({
480
+ name: cookie_names.user_session,
481
+ data: user_session
482
+ });
483
+
484
+ // -----------------------------------------------------------------------
485
+ // additional BS helpers from j1.core
486
+ // -----------------------------------------------------------------------
487
+ j1.core.bsFormClearButton();
488
+
489
+ // finalize and display page
490
+ j1.displayPage();
491
+
492
+ }, // END init
493
+
494
+ // -------------------------------------------------------------------------
495
+ // initBanner()
496
+ // AJAX fetcher to load and place all banner used for a page
497
+ // -------------------------------------------------------------------------
498
+ initBanner: function (options) {
499
+ var logger = log4javascript.getLogger('j1.initBanner');
500
+ var banner = [];
501
+ var bannerOptions = [];
502
+ var mod = 'j1';
503
+ var logText;
504
+
505
+ {% comment %}
506
+ Closure to pass additional data (e.g. #banner_id) to AJAX load callback
507
+ See: http://stackoverflow.com/questions/939032/jquery-pass-more-parameters-into-callback
508
+ -------------------------------------------------------------------------- {% endcomment %}
509
+ var cb_load_closure = function(banner_id) {
510
+ return function ( responseTxt, statusTxt, xhr ) {
511
+ if ( statusTxt == 'success' ) {
512
+ var logger = log4javascript.getLogger('j1.adapter.xhrData');
513
+ logText = 'loading banner completed on id: ' +banner_id;
514
+ logger.info(logText);
515
+ j1.setXhrDataState(banner_id, statusTxt);
516
+ j1.setXhrDomState(banner_id, statusTxt);
517
+ logger.info('XHR data loaded in the DOM: ' + banner_id);
518
+ }
519
+ if ( statusTxt == 'error' ) {
520
+ logText = 'loading banner failed on id: ' +banner_id+ ', error: ' + xhr.status + ': ' + xhr.statusText;
521
+ logger.error(logText);
522
+ j1.setXhrDataState(banner_id, statusTxt);
523
+ j1.setXhrDomState(banner_id, statusTxt);
524
+ // Set|Log status
525
+ state = 'failed';
526
+ logger.error('state: ' + state);
527
+ }
528
+ };
529
+ };
530
+
531
+ {% comment %} Collect all banner id|s configured
532
+ -------------------------------------------------------------------------- {% endcomment %}
533
+ {% for items in banner_config_settings %}
534
+ {% assign key = items[0] %}
535
+ {% assign value = items[1] %}
536
+
537
+ {% if key == 'divider' %} {% assign banner_config = value %} {% endif %}
538
+ {% if key == 'teaser' %} {% assign banner_config = value %} {% endif %}
539
+ {% if key == 'image' %} {% assign banner_config = value %} {% endif %}
540
+ {% if key == 'parallax' %} {% assign banner_config = value %} {% endif %}
541
+ {% if key == 'exception' %} {% assign banner_config = value %} {% endif %}
542
+
543
+ {% for items in banner_config %}
544
+ {% for banners in items %}
545
+
546
+ {% for banner in banners %}
547
+ {% for item in banner %}
548
+ {% assign key = item[0] %}
549
+ {% assign value = item[1] %}
550
+
551
+ {% if key and debug %} item:value {{key}}:{{value}} {% endif %}
552
+
553
+ {% if key == 'id' %} {% assign id = value %} {% endif %}
554
+ {% if key == 'enabled' %} {% assign enabled = value %} {% endif %}
555
+ {% endfor %}
556
+ {% endfor %}
557
+
558
+ {% if id and enabled %}
559
+
560
+ {% comment %} Register current banner
561
+ -------------------------------------------------------------------- {% endcomment %}
562
+ banner.push('{{id}}');
563
+ {% endif %}
564
+
565
+ {% endfor %} {% comment %} END banners {% endcomment %}
566
+
567
+ {% comment %} Reset (Liquid) element variables
568
+ ---------------------------------------------------------------------- {% endcomment %}
569
+ {% assign id = nil %}
570
+ {% assign enabled = nil %}
571
+ {% assign banner_config = nil %}
572
+
573
+ {% endfor %} {% comment %} END banner_config {% endcomment %}
574
+ {% endfor %} {% comment %} END banner_config_settings {% endcomment %}
575
+
576
+ {% comment %} REGISTER exceptions container
577
+ -------------------------------------------------------------------------- {% endcomment %}
578
+ banner.push('exception_container');
579
+
580
+ {% comment %} LOAD all banner registered
581
+ -------------------------------------------------------------------------- {% endcomment %}
582
+ if ( banner.length ) {
583
+ for (var i in banner) {
584
+ var id = '#' + banner[i];
585
+ var selector = $(id);
586
+ if (selector.length) {
587
+ logText = 'loading banner on id: ' +banner[i];
588
+ logger.info(logText);
589
+ // var banner_data_path = '{{banner_data_path}} ' + id + ' > *';
590
+ var banner_data_path = '{{banner_data_path}} ' + id;
591
+ selector.load(banner_data_path, cb_load_closure(id));
592
+ }
593
+ } // END for
594
+ } else {
595
+ logText = 'no banner found in site';
596
+ logger.info(logText);
597
+ return false;
598
+ }
599
+ return true;
600
+ }, // END initBanner
601
+
602
+ // -------------------------------------------------------------------------
603
+ // initPanel()
604
+ // AJAX fetcher to load and place all panel used for a page
605
+ // -------------------------------------------------------------------------
606
+ // ToDo:
607
+ initPanel: function ( options ) {
608
+ var logger = log4javascript.getLogger('j1.initPanel');
609
+ var panel = [];
610
+ var mod = 'j1';
611
+ var logText;
612
+
613
+ {% comment %} Closure to pass additional data (e.g. panel_id) to AJAX load callback
614
+ See: http://stackoverflow.com/questions/939032/jquery-pass-more-parameters-into-callback
615
+ -------------------------------------------------------------------------- {% endcomment %}
616
+
617
+ {% comment %} NOTE
618
+ strategy for MutationObserver callbacks to monitor DOM changes
619
+ needs to be checked if multiple containers are chenaged in a row
620
+ -------------------------------------------------------------------------- {% endcomment %}
621
+ var cb_load_closure = function(panel_id) {
622
+ return function ( responseTxt, statusTxt, xhr ) {
623
+ var logger = log4javascript.getLogger('j1.adapter.xhrData');
624
+ if ( statusTxt == 'success' ) {
625
+ logText = 'loading panel completed on id: ' +panel_id;
626
+ logger.info(logText);
627
+ j1.setXhrDataState(panel_id, statusTxt);
628
+ j1.setXhrDomState(panel_id, statusTxt);
629
+ logger.info('XHR data loaded in the DOM: ' + panel_id);
630
+ }
631
+ if ( statusTxt == 'error' ) {
632
+ logText = 'loading panel failed on id: ' +panel_id+ ', error ' + xhr.status + ': ' + xhr.statusText;
633
+ logger.error(logText);
634
+ j1.setXhrDataState(panel_id, statusTxt);
635
+ j1.setXhrDomState(panel_id, statusTxt);
636
+ // Set|Log status
637
+ state = 'Error';
638
+ logger.error('state: ' + state);
639
+ }
640
+ };
641
+ };
642
+
643
+ {% comment %} Collect all panel id|s configured
644
+ -------------------------------------------------------------------------- {% endcomment %}
645
+ {% for items in panel_config_settings %}
646
+ {% assign key = items[0] %}
647
+ {% assign value = items[1] %}
648
+
649
+ {% if key == 'intro' %} {% assign panel_config = value %} {% endif %}
650
+ {% if key == 'service' %} {% assign panel_config = value %} {% endif %}
651
+ {% if key == 'step' %} {% assign panel_config = value %} {% endif %}
652
+ {% if key == 'news' %} {% assign panel_config = value %} {% endif %}
653
+ {% if key == 'exception' %} {% assign panel_config = value %} {% endif %}
654
+
655
+ {% for items in panel_config %}
656
+ {% for panels in items %}
657
+
658
+ {% for panel in panels %}
659
+ {% for item in panel %}
660
+ {% assign key = item[0] %}
661
+ {% assign value = item[1] %}
662
+
663
+ {% if key and debug %} item:value {{key}}:{{value}} {% endif %}
664
+
665
+ {% if key == 'id' %} {% assign id = value %} {% endif %}
666
+ {% if key == 'enabled' %} {% assign enabled = value %} {% endif %}
667
+ {% endfor %}
668
+ {% endfor %}
669
+
670
+ {% comment %} Register current panel
671
+ -------------------------------------------------------------------------- {% endcomment %}
672
+ {% if id and enabled %}
673
+ panel.push('{{id}}');
674
+ {% endif %}
675
+
676
+ {% comment %} Reset (Liquid) element variables
677
+ -------------------------------------------------------------------------- {% endcomment %}
678
+ {% assign id = nil %}
679
+ {% assign enabled = nil %}
680
+ {% assign panel_config = nil %}
681
+
682
+ {% endfor %} {% comment %} END panels {% endcomment %}
683
+ {% endfor %} {% comment %} END panel_config {% endcomment %}
684
+ {% endfor %} {% comment %} END panel_config_settings {% endcomment %}
685
+
686
+ if (panel.length) {
687
+ for (var i in panel) {
688
+ var id = '#' + panel[i];
689
+ var selector = $(id);
690
+ if ( selector.length ) {
691
+ logText = 'loading panel on id: ' +panel[i];
692
+ logger.info(logText);
693
+ // var panel_data_path = '{{panel_data_path}} ' + id + ' > *';
694
+ var panel_data_path = '{{panel_data_path}} ' + id;
695
+ selector.load(panel_data_path, cb_load_closure(id));
696
+ }
697
+ } // END for
698
+ } else {
699
+ logText = 'no panel found in site';
700
+ logger.info(logText);
701
+ return false;
702
+ }
703
+ return true;
704
+ }, // END initPanel
705
+
706
+ // -------------------------------------------------------------------------
707
+ // initFooter()
708
+ // AJAX fetcher to load and place the footer used for a page
709
+ // -------------------------------------------------------------------------
710
+ initFooter: function ( options ) {
711
+ var logger = log4javascript.getLogger('j1.initFooter');
712
+ var mod = 'j1';
713
+ var logText;
714
+
715
+ logText = 'loading footer started';
716
+ logger.info(logText);
717
+
718
+ var cb_load_closure = function(footer_id) {
719
+ return function ( responseTxt, statusTxt, xhr ) {
720
+ var logger = log4javascript.getLogger('j1.adapter.xhrData');
721
+ if ( statusTxt == 'success' ) {
722
+ logText = 'footer loaded successfully on id: ' + footer_id;
723
+ logger.info(logText);
724
+ j1.setXhrDataState(footer_id, statusTxt);
725
+ j1.setXhrDomState(footer_id, statusTxt);
726
+ logger.info('XHR data loaded in the DOM: ' + footer_id);
727
+
728
+ // jadams, 2020-07-21: intermediate state DISABLED
729
+ // state = 'footer_loaded';
730
+ // logger.info('set state for module ' + mod + ': ' + state);
731
+ // executeFunctionByName(mod + '.setState', window, state);
732
+
733
+ logText = 'initialization finished';
734
+ logger.info(logText);
735
+ }
736
+ if ( statusTxt == 'error' ) {
737
+ logText = 'loading footer failed on id: ' +footer_id+ ', error ' + xhr.status + ': ' + xhr.statusText;
738
+ logger.error(logText);
739
+ j1.setXhrDataState(footer_id, statusTxt);
740
+ j1.setXhrDomState(footer_id, statusTxt);
741
+
742
+ // Set|Log status
743
+ state = 'failed';
744
+ logger.error('state: ' + state);
745
+ logText = 'initialization finished';
746
+ logger.info(logText);
747
+ }
748
+ };
749
+ };
750
+
751
+ var id = '#' + '{{footer_id}}';
752
+ var selector = $(id);
753
+ if ( selector.length ) {
754
+ // var footer_data_path = '{{footer_data_path}} ' + id + ' > *';
755
+ var footer_data_path = '{{footer_data_path}} ' + id;
756
+ selector.load(footer_data_path, cb_load_closure(id));
757
+ } else {
758
+ logText = 'data not loaded';
759
+ logger.warn(logText);
760
+ j1.setXhrDataState(id, 'not loaded');
761
+ j1.setXhrDomState(id, 'pending');
762
+ return false;
763
+ }
764
+ return true;
765
+ }, // END initFooter
766
+
767
+ // -------------------------------------------------------------------------
768
+ // displayPage
769
+ // show the page after timeout of {{flickerTimeout}} ms
770
+ // -------------------------------------------------------------------------
771
+ // NOTE:
772
+ // jadams, 2019-08-21: for unknown reason, the user state data
773
+ // (read from cookie) seems not correct (or loaded too late).
774
+ // To make correct data sure for APP mode, a status request is done
775
+ // to load the current state from the middleware (skipped in WEB mode)
776
+ // -------------------------------------------------------------------------
777
+ displayPage: function (options) {
778
+ var logger = log4javascript.getLogger('j1.adapter.displayPage');
779
+ var flickerTimeout = {{template_config.flicker_timeout}};
780
+ var url = new liteURL(window.location.href);
781
+ var baseUrl = url.origin;
782
+ var ep_status = baseUrl + '/status' + '?page=' + window.location.pathname;
783
+ var user_session = j1.readCookie(cookie_names.user_session);
784
+ var user_state = j1.readCookie(cookie_names.user_state);
785
+ var current_url = new liteURL(window.location.href);
786
+ var providerPermissions = {};
787
+ var provider;
788
+ var previous_page;
789
+ var appDetected;
790
+ var categoryAllowed;
791
+
792
+ logger.info('finalize page');
793
+ j1.setCss();
794
+
795
+ logText= 'loading page partials: started';
796
+ logger.info(logText);
797
+
798
+ if (j1.appDetected()) { // app mode
799
+ logger.info('mode detected: app');
800
+
801
+ $.when ($.ajax(ep_status))
802
+ .then(function(data) {
803
+ var logger = log4javascript.getLogger('j1.displayPage');
804
+
805
+ user_session = j1.mergeData(user_session, data);
806
+
807
+ user_session.current_page = current_url.pathname;
808
+ j1.writeCookie({
809
+ name: cookie_names.user_session,
810
+ data: user_session
811
+ });
812
+
813
+ providerPermissions = user_session.provider_permissions;
814
+ categoryAllowed = providerPermissions.includes(user_session.page_permission);
815
+
816
+ // check protected pages (applies for APP only)
817
+ // make sure that protected pages are ALWAYS checked for permissions
818
+ // -------------------------------------------------------------------
819
+ if (
820
+ j1.authEnabled() &&
821
+ user_session.page_permission !== 'public' &&
822
+ categoryAllowed === false
823
+ ){
824
+ // redirect to middleware|page_authentication
825
+ if (data.authenticated === 'true') {
826
+ var ep_post_authentication = baseUrl + '/post_authentication';
827
+ window.location.href = ep_post_authentication;
828
+ } else if (j1.authEnabled()) {
829
+ var ep_page_validation = baseUrl + '/page_validation?page=' + window.location.pathname;
830
+ window.location.href = ep_page_validation;
831
+ return false;
832
+ }
833
+ } // END check protected pages
834
+
835
+ // show the page delayed
836
+ setTimeout (function() {
837
+ // display page
838
+ $('#no_flicker').css('display', 'block');
839
+
840
+ // show|hide cookie icon (should MOVED to Cookiebar ???)
841
+ if (user_state.cookies_accepted === 'accepted') {
842
+ // Display cookie icon
843
+ logText = 'show cookie icon';
844
+ logger.info(logText);
845
+ $('#quickLinksCookieButton').css('display', 'block');
846
+ } else {
847
+ logText = 'hide cookie icon';
848
+ logger.info(logText);
849
+ // Display cookie icon
850
+ $('#quickLinksCookieButton').css('display', 'none');
851
+ }
852
+
853
+ // show|hide translator icon
854
+ if (translation_enabled) {
855
+ logger.info('translator detected: google');
856
+ logger.info('initialize language selector');
857
+ $('.goog-te-combo').addClass('form-control');
858
+ }
859
+
860
+ // show cc icon
861
+ // $('#quickLinksControlCenterButton').css('display', 'block');
862
+
863
+ if (j1.authEnabled()) {
864
+ if (user_session.authenticated === 'true') {
865
+ // set signout
866
+ logger.info('show signout icon');
867
+ $('#navLinkSignInOut').attr('data-target','#modalOmniSignOut');
868
+ $('#iconSignInOut').removeClass('mdi-login').addClass('mdi-logout');
869
+ } else {
870
+ // set signin
871
+ logger.info('show signin icon');
872
+ $('#navLinkSignInOut').attr('data-target','#modalOmniSignIn');
873
+ $('#iconSignInOut').removeClass('mdi-logout').addClass('mdi-login');
874
+ }
875
+ logger.info('authentication detected as: ' + user_session.authenticated);
876
+ $('#quickLinksSignInOutButton').css('display', 'block');
877
+ }
878
+
879
+ // if the page requested contains an anchor element,
880
+ // do a smooth scroll to
881
+ j1.scrollTo();
882
+
883
+ if (user_session.previous_page !== user_session.current_page) {
884
+ logText = 'page change detected';
885
+ logger.info(logText);
886
+ logText = 'previous page: ' + user_session.previous_page;
887
+ logger.info(logText);
888
+ logText = 'current page: ' + user_session.current_page;
889
+ logger.info(logText);
890
+ }
891
+
892
+ // update sidebar for changed theme data
893
+ logger.info('update sidebar');
894
+ user_state = j1.readCookie(cookie_names.user_state);
895
+ current_user_data = j1.mergeData(user_session, user_state);
896
+ j1.core.navigator.updateSidebar(current_user_data);
897
+
898
+ // Set|Log status
899
+ state = 'finished';
900
+ logText = 'state: ' + state;
901
+ logger.info(logText);
902
+ logText = 'page finalized successfully';
903
+ logger.info(logText);
904
+
905
+ }, flickerTimeout);
906
+ }); // END APP mode
907
+ } else { // web mode
908
+ // show the page delayed
909
+ setTimeout (function() {
910
+ j1.setState('finished');
911
+ logger.info('state: finished');
912
+ logger.info('page initialization: finished');
913
+
914
+ // display page
915
+ $('#no_flicker').css('display', 'block');
916
+
917
+ logger.info('mode detected: web');
918
+ logger.info('hide signin icon');
919
+ $('#quickLinksSignInOutButton').css('display', 'none');
920
+
921
+ user_session.current_page = current_url.pathname;
922
+ j1.writeCookie({
923
+ name: cookie_names.user_session,
924
+ data: user_session
925
+ });
926
+
927
+ // show|hide translator icon
928
+ if (translation_enabled) {
929
+ logger.info('translator detected: google');
930
+ logger.info('initialize language selector');
931
+ $('.goog-te-combo').addClass('form-control');
932
+ }
933
+
934
+ // show|hide cookie icon (should MOVED to Cookiebar ???)
935
+ if (user_state.cookies_accepted === 'accepted') {
936
+ // Display cookie icon
937
+ logText = 'show cookie icon';
938
+ logger.info(logText);
939
+ $('#quickLinksCookieButton').css('display', 'block');
940
+ } else {
941
+ logText = 'hide cookie icon';
942
+ logger.info(logText);
943
+ // Display cookie icon
944
+ $('#quickLinksCookieButton').css('display', 'none');
945
+ }
946
+
947
+ // If the page requested contains an anchor element,
948
+ // do a smooth scroll to
949
+ j1.scrollTo();
950
+
951
+ if (user_session.previous_page !== user_session.current_page) {
952
+ logText = 'page change detected';
953
+ logger.info(logText);
954
+ logText = 'previous page: ' + user_session.previous_page;
955
+ logger.info(logText);
956
+ logText = 'current page: ' + user_session.current_page;
957
+ logger.info(logText);
958
+ }
959
+
960
+ // update sidebar for changed theme data
961
+ logger.info('update sidebar');
962
+ user_state = j1.readCookie(cookie_names.user_state);
963
+ current_user_data = j1.mergeData(user_session, user_state);
964
+ j1.core.navigator.updateSidebar(current_user_data);
965
+
966
+ // set|log status
967
+ state = 'finished';
968
+ logText = 'state: ' + state;
969
+ logger.info(logText);
970
+ logText = 'page finalized successfully';
971
+ logger.info(logText);
972
+
973
+ }, flickerTimeout);
974
+ } // END WEB mode
975
+ }, // END displayPage
976
+
977
+ // -------------------------------------------------------------------------
978
+ // Helper functions
979
+ // -------------------------------------------------------------------------
980
+
981
+ // -------------------------------------------------------------------------
982
+ // mergeData()
983
+ // merge two objects (properties) and returns the resulting object
984
+ // see: https://stackoverflow.com/questions/43109229/merge-default-options-containing-object-with-json-object
985
+ // TODO: Improve comment, give synopsis and example
986
+ // -------------------------------------------------------------------------
987
+ mergeData: function () {
988
+ var a = [].slice.call(arguments), o = a.shift();
989
+
990
+ for(var i=0,l=a.length; i<l; i++){
991
+ for(var p in a[i]){
992
+ o[p] = a[i][p];
993
+ }
994
+ }
995
+ return o;
996
+ }, // END mergeData
997
+
998
+ // -------------------------------------------------------------------------
999
+ // getPrevPage()
1000
+ // Returns the last vistited page
1001
+ // -------------------------------------------------------------------------
1002
+ getPrevPage: function () {
1003
+ return previous_page;
1004
+ }, // END getPrevPage
1005
+
1006
+ // -------------------------------------------------------------------------
1007
+ // getLanguage()
1008
+ // Returns the preferred language taken form window.navigator
1009
+ // See:
1010
+ // https://stackoverflow.com/questions/1043339/javascript-for-detecting-browser-language-preference
1011
+ // -------------------------------------------------------------------------
1012
+ getLanguage: function () {
1013
+ var language = navigator.languages ? navigator.languages[0] : (navigator.language || navigator.userLanguage);
1014
+ }, // END getLanguage
1015
+
1016
+ // -------------------------------------------------------------------------
1017
+ // getTemplateVersion()
1018
+ // Returns the template version taken from site config (_config.yml)
1019
+ // -------------------------------------------------------------------------
1020
+ getTemplateVersion: function () {
1021
+ return '{{template_version}}';
1022
+ }, // END getTemplateVersion
1023
+
1024
+ // -------------------------------------------------------------------------
1025
+ // scrollTo()
1026
+ // Scrolls smooth to any anchor referenced by an page URL on
1027
+ // e.g. a page reload. Values for delay|offset are taken from
1028
+ // TOCCER module
1029
+ // -------------------------------------------------------------------------
1030
+ scrollTo: function () {
1031
+ var anchor = window.location.href.split('#')[1];
1032
+ var anchor_id = '#' + anchor;
1033
+ var selector;
1034
+
1035
+ var logger = log4javascript.getLogger('j1.scrollTo');
1036
+
1037
+ var toccerScrollDuration = {{toccer_options.scrollSmoothDuration}};
1038
+ var toccerScrollOffset = {{toccer_options.scrollSmoothOffset}};
1039
+
1040
+ // calculate offset for correct (smooth) scroll position
1041
+ //
1042
+ var $pagehead = $('.attic');
1043
+ var $navbar = $('nav.navbar');
1044
+ var $adblock = $('#adblock');
1045
+
1046
+ var navbarType = $navbar.hasClass('navbar-fixed') ? 'fixed' : 'scrolled';
1047
+ var fontSize = $('body').css('font-size').replace('px','');
1048
+ var start = window.pageYOffset;
1049
+
1050
+ var l = parseInt(fontSize);
1051
+
1052
+ var h = $pagehead.length ? $pagehead.height() : 0;
1053
+ var n = $navbar.length ? $navbar.height() : 0;
1054
+ var a = $adblock.length ? $adblock.height() : 0;
1055
+
1056
+ var scrollOffset = navbarType == 'fixed' ? -1*(n + a + l) : -1*(h + n + a + l);
1057
+
1058
+ // static offset, to be checked why this is needed
1059
+ //
1060
+ scrollOffset = scrollOffset + toccerScrollOffset;
1061
+
1062
+ if (anchor_id && anchor_id !== '#') {
1063
+ // scroll only, if an anchor is given with URL
1064
+ selector = $(anchor_id);
1065
+ if (selector.length) {
1066
+ j1.core.scrollSmooth.scroll( anchor_id, {
1067
+ duration: toccerScrollDuration,
1068
+ offset: scrollOffset,
1069
+ callback: null
1070
+ });
1071
+ } else {
1072
+ // scroll the page one pixel back and forth (trigger)
1073
+ // to get the right position for the Toccer and adjust the
1074
+ // Navigator to display the (tranparent) navbar correctly
1075
+ //
1076
+ $(window).scrollTop($(window).scrollTop()+1);
1077
+ $(window).scrollTop($(window).scrollTop()-1);
1078
+ } // END if anchor_id
1079
+ } else if (anchor_id === '#') {
1080
+ logger.info('bound click event to "#", suppress default action');
1081
+ $(window).scrollTop($(window).scrollTop()+1);
1082
+ $(window).scrollTop($(window).scrollTop()-1);
1083
+ return false;
1084
+ }
1085
+ }, // END scrollTo
1086
+
1087
+ // -------------------------------------------------------------------------
1088
+ // authEnabled()
1089
+ // Returns the state of the authentication module
1090
+ // -------------------------------------------------------------------------
1091
+ authEnabled: function () {
1092
+ var logger = log4javascript.getLogger('j1.authentication');
1093
+ var authEnabled = {{authentication_options.j1_auth.enabled}};
1094
+
1095
+ return authEnabled;
1096
+ }, // END authEnabled
1097
+
1098
+ // -------------------------------------------------------------------------
1099
+ // appDetected()
1100
+ // Returns true if a web session cookie exists
1101
+ // -------------------------------------------------------------------------
1102
+ appDetected: function () {
1103
+ var user_session;
1104
+ var cookieExists = j1.existsCookie(cookie_names.user_session);
1105
+ var detected = false;
1106
+
1107
+ if (cookieExists) {
1108
+ user_session = j1.readCookie(cookie_names.user_session);
1109
+ detected = user_session.mode === 'app' ? true : false;
1110
+ } else {
1111
+ // detected = 'unknown';
1112
+ detected = false;
1113
+ }
1114
+ return detected;
1115
+ }, // END appDetected
1116
+
1117
+ // -------------------------------------------------------------------------
1118
+ // xhrData()
1119
+ // Load data asychronously using XHR|jQuery on an HTML element (e.g. <div>)
1120
+ // specified by xhr_container_id, xhr_data_path (options)
1121
+ // -------------------------------------------------------------------------
1122
+ xhrData: function (options, mod, status) {
1123
+ var logger = log4javascript.getLogger('j1.adapter.xhrData');
1124
+ var selector = $('#' + options.xhr_container_id);
1125
+ var state = status;
1126
+ var observer_options = {
1127
+ attributes: false,
1128
+ childList: true,
1129
+ characterData: false,
1130
+ subtree: true
1131
+ };
1132
+ var observer;
1133
+ var logText;
1134
+
1135
+ var cb_load_closure = function(mod, id) {
1136
+ return function (responseTxt, statusTxt, xhr) {
1137
+ var logger = log4javascript.getLogger('j1.adapter.xhrData');
1138
+ if ( statusTxt === 'success' ) {
1139
+ // jadams, 2020-07-21: intermediate state should DISABLED
1140
+ // if (state) {
1141
+ // logger.info('set state for ' +mod+ ' to: ' + state);
1142
+ // executeFunctionByName(mod + '.setState', window, state);
1143
+ // }
1144
+ j1.setXhrDataState(id, statusTxt);
1145
+ j1.setXhrDomState(id, 'pending');
1146
+
1147
+ logText = 'data loaded successfully on id: ' +id;
1148
+ logger.info(logText);
1149
+ state = true;
1150
+ }
1151
+ if ( statusTxt === 'error' ) {
1152
+ // jadams, 2020-07-21: to be checked why id could be UNDEFINED
1153
+ if (typeof(id) != "undefined") {
1154
+ state = 'failed';
1155
+ logger.info('set state for ' +mod+ ' to: ' + state);
1156
+ // jadams, 2020-07-21: intermediate state should DISABLED
1157
+ // executeFunctionByName(mod + '.setState', window, state);
1158
+ j1.setXhrDataState(id, statusTxt);
1159
+ j1.setXhrDomState(id, 'pending');
1160
+ logText = 'loading data failed on id: ' +id+ ', error ' + xhr.status + ': ' + xhr.statusText;
1161
+ logger.error(logText);
1162
+ state = false;
1163
+ }
1164
+ }
1165
+ };
1166
+ };
1167
+ // see: https://stackoverflow.com/questions/20420577/detect-added-element-to-dom-with-mutation-observer
1168
+ var html_data_path;
1169
+ var id = '#' + options.xhr_container_id;
1170
+ var $selector = $(id);
1171
+
1172
+ if ( $selector.length ) {
1173
+ if (options.xhr_data_element) {
1174
+ html_data_path = options.xhr_data_path + ' #' + options.xhr_data_element + ' > *';
1175
+ // html_data_path = options.xhr_data_path + ' #' + options.xhr_data_element;
1176
+ } else {
1177
+ html_data_path = options.xhr_data_path + ' > *';
1178
+ }
1179
+ $selector.load( html_data_path, cb_load_closure( mod, id ) );
1180
+
1181
+ var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
1182
+ var xhrObserver = new MutationObserver (mutationHandler);
1183
+ var obsConfig = {
1184
+ childList: true,
1185
+ characterData: false,
1186
+ attributes: false,
1187
+ subtree: false };
1188
+
1189
+ selector.each(function(){
1190
+ xhrObserver.observe(this, obsConfig);
1191
+ } );
1192
+
1193
+ function mutationHandler (mutationRecords) {
1194
+ mutationRecords.forEach ( function (mutation) {
1195
+ if (mutation.addedNodes.length) {
1196
+ logger.info('XHR data loaded in the DOM: ' + id);
1197
+ j1.setXhrDomState(id, 'success');
1198
+ }
1199
+ });
1200
+ }
1201
+ } else {
1202
+ // jadams, 2020-07-21: To be clarified why a id is "undefined"
1203
+ if (id != '#undefined') {
1204
+ logText = 'data not loaded on id:' + id;
1205
+ logger.warn(logText);
1206
+ j1.setXhrDataState(id, 'not loaded');
1207
+ j1.setXhrDomState(id, 'not loaded');
1208
+ // Set processing state to 'finished' to complete module load
1209
+ state = 'finished';
1210
+ logger.info('state: ' + state);
1211
+ // jadams, 2020-07-21: intermediate state should DISABLED
1212
+ // executeFunctionByName(mod + '.setState', window, state);
1213
+ state = false;
1214
+ }
1215
+ }
1216
+ return state;
1217
+ }, // END xhrData
1218
+
1219
+ // -------------------------------------------------------------------------
1220
+ // readCookie()
1221
+ // -------------------------------------------------------------------------
1222
+ readCookie: function (name) {
1223
+ var data;
1224
+ var data_json;
1225
+ var cookieExists = j1.existsCookie(name);
1226
+
1227
+ if (cookieExists) {
1228
+ data_json = window.atob(Cookies.get(name));
1229
+ data = JSON.parse(data_json);
1230
+
1231
+ if (data) {
1232
+ return data;
1233
+ } else {
1234
+ return false;
1235
+ }
1236
+ } else {
1237
+ return false;
1238
+ }
1239
+ }, // END readCookie
1240
+
1241
+ // -------------------------------------------------------------------------
1242
+ // writeCookie()
1243
+ // Write 'data' to a cookie 'name'. If not exists, the cookie gets
1244
+ // created. Returns 'true' if cookie was written, otherwise 'false'.
1245
+ // -------------------------------------------------------------------------
1246
+ // NOTE:
1247
+ // https://web.dev/samesite-cookies-explained/
1248
+ // https://developer.mozilla.org/de/docs/Web/HTTP/Headers/Set-Cookie/SameSite
1249
+ // https://www.smarketer.de/blog/chrome-update-80-cookies/
1250
+ // -------------------------------------------------------------------------
1251
+ // TODO:
1252
+ // Change attribute "Secure" to true, if HTTPS is used.
1253
+ // Checks and config changes are to be done.
1254
+ // -------------------------------------------------------------------------
1255
+ // TODO:
1256
+ // Handling of attribute "SameSite".
1257
+ // Config to use this attribute should be configurable
1258
+ // (what config file?).
1259
+ // Disabled use for now in general.
1260
+ //
1261
+ // The SameSite attribute of the Set-Cookie HTTP response header
1262
+ // allows you to declare if your cookie should be restricted to a
1263
+ // first-party or same-site context. Cookies with SameSite=None
1264
+ // must now also specify the Secure attribute (they require a secure
1265
+ // context/HTTPS).
1266
+ // -------------------------------------------------------------------------
1267
+ //
1268
+ writeCookie: function (options /*name, data, [path, expires, SameSite, secure]*/) {
1269
+ var defaults = {
1270
+ data: {},
1271
+ name: '',
1272
+ expires: 0,
1273
+ path: '/',
1274
+ // SameSite: 'Strict',
1275
+ // SameSite: 'Lax',
1276
+ http_only: false,
1277
+ secure: false
1278
+ };
1279
+ var settings = $.extend(defaults, options);
1280
+ // moment not used anymore
1281
+ // var epoch = Math.floor(Date.now()/1000);
1282
+ // var timestamp_now = moment.unix(epoch).format('YYYY-MM-DD HH:mm:ss');
1283
+ var date = new Date();
1284
+ var timestamp_now = date.toISOString();
1285
+ var cookie_data = {};
1286
+ var data_json;
1287
+ var data_encoded;
1288
+
1289
+ if (j1.existsCookie(settings.name)) {
1290
+ cookie_data = j1.readCookie(settings.name);
1291
+ cookie_data.timestamp = timestamp_now;
1292
+ cookie_data = j1.mergeData(cookie_data, settings.data);
1293
+ data_json = JSON.stringify( cookie_data );
1294
+ data_encoded = window.btoa(data_json);
1295
+
1296
+ if (settings.expires > 0) {
1297
+ Cookies.set(settings.name, data_encoded, {
1298
+ expires: settings.expires,
1299
+ SameSite: settings.SameSite
1300
+ });
1301
+ } else {
1302
+ Cookies.set(settings.name, data_encoded, {
1303
+ SameSite: settings.SameSite
1304
+ });
1305
+ }
1306
+ } else {
1307
+ cookie_data = settings.data;
1308
+ data_json = JSON.stringify(settings.data);
1309
+ data_encoded = window.btoa(data_json);
1310
+ if (settings.expires > 0) {
1311
+ Cookies.set(settings.name, data_encoded, {
1312
+ expires: settings.expires,
1313
+ SameSite: settings.SameSite
1314
+ });
1315
+ } else {
1316
+ Cookies.set(settings.name, data_encoded, {
1317
+ SameSite: settings.SameSite
1318
+ });
1319
+ }
1320
+ }
1321
+
1322
+ if (j1.existsCookie(settings.name)) {
1323
+ return cookie_data;
1324
+ } else {
1325
+ return false;
1326
+ }
1327
+
1328
+ }, // END writeCookie
1329
+
1330
+ // -------------------------------------------------------------------------
1331
+ // Clears all given cookies by name (except cookies set to httpOnly).
1332
+ // For all cookies the expire date is set in the past, those cookies
1333
+ // are 'session' cookies. All session cookies are deleted (automatically)
1334
+ // by the browser if the last session (browser window) is closed.
1335
+ // See: https://stackoverflow.com/questions/179355/clearing-all-cookies-with-javascript
1336
+ // -------------------------------------------------------------------------
1337
+ removeCookie: function (options /*name [, path]*/) {
1338
+ var cookieExists;
1339
+ var defaults = {
1340
+ name: '',
1341
+ path: '/'
1342
+ };
1343
+ var settings = $.extend(defaults, options);
1344
+
1345
+ Cookies.remove(settings.name, { path: settings.path });
1346
+
1347
+ }, // END removeCookie
1348
+
1349
+ // -------------------------------------------------------------------------
1350
+ // Clears all given cookies by name (except cookies set to httpOnly).
1351
+ // For all cookies the expire date is set in the past, those cookies
1352
+ // are 'session' cookies. All session cookies are deleted (automatically)
1353
+ // by the browser if the last session (browser window) is closed.
1354
+ // See: https://stackoverflow.com/questions/179355/clearing-all-cookies-with-javascript
1355
+ // -------------------------------------------------------------------------
1356
+ deleteCookie: function (options) {
1357
+ var name = options;
1358
+ var all_cookies = document.cookie.split('; ');
1359
+
1360
+ if ( name === 'all' ) {
1361
+ for (var c = 0; c < all_cookies.length; c++) {
1362
+ var d = window.location.hostname.split('.');
1363
+ while (d.length > 0) {
1364
+ var cookieBase = encodeURIComponent(all_cookies[c].split(';')[0].split('=')[0]) + '=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain=' + d.join('.') + ' ;path=';
1365
+ var p = location.pathname.split('/');
1366
+ document.cookie = cookieBase + '/';
1367
+ while (p.length > 0) {
1368
+ document.cookie = cookieBase + p.join('/');
1369
+ p.pop();
1370
+ };
1371
+ d.shift();
1372
+ }
1373
+ }
1374
+ } else {
1375
+ document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:00 GMT';
1376
+ }
1377
+
1378
+ return true;
1379
+ }, // END deleteCookie
1380
+
1381
+ // -------------------------------------------------------------------------
1382
+ // returns true if a given cookie exists
1383
+ // -------------------------------------------------------------------------
1384
+ existsCookie: function (name) {
1385
+ var dc = document.cookie;
1386
+ var prefix = name + '=';
1387
+ var begin = dc.indexOf('; ' + prefix);
1388
+ var end = dc.length; // default to end of the string
1389
+ var cookieExists = false;
1390
+ var cookieContent = '';
1391
+
1392
+ // found, and not in first position
1393
+ if (begin !== -1) {
1394
+ // exclude the "; "
1395
+ begin += 2;
1396
+ } else {
1397
+ //see if cookie is in first position
1398
+ begin = dc.indexOf(prefix);
1399
+ // not found at all or found as a portion of another cookie name
1400
+ if (begin === -1 || begin !== 0 ) return false;
1401
+ }
1402
+
1403
+ // if ";" is found somewhere after the prefix position then "end" is
1404
+ // that position, otherwise it defaults to the end of the string
1405
+ if (dc.indexOf(';', begin) !== -1) {
1406
+ end = dc.indexOf(';', begin);
1407
+ }
1408
+
1409
+ cookieContent = decodeURI(dc.substring(begin + prefix.length, end) ).replace(/"/g, '');
1410
+ cookieExists = cookieContent.length ? true : false;
1411
+
1412
+ return cookieExists;
1413
+ }, // END existsCookie
1414
+
1415
+ // -------------------------------------------------------------------------
1416
+ // Resolve MACROs
1417
+ //
1418
+ // See:
1419
+ // https://stackoverflow.com/questions/5376431/wildcards-in-jquery-selectors
1420
+ // https://stackoverflow.com/questions/16400072/jquery-each-only-affects-last-element
1421
+ // https://dzone.com/articles/why-does-javascript-loop-only-use-last-value
1422
+ // https://stackoverflow.com/questions/179713/how-to-change-the-href-for-a-hyperlink-using-jquery
1423
+ // https://stackoverflow.com/questions/5223/length-of-a-javascript-object
1424
+ // -------------------------------------------------------------------------
1425
+ resolveMacros: function (user_data) {
1426
+ var logger = log4javascript.getLogger('j1.resolveMacros');
1427
+
1428
+ var sidebarLoaded = setInterval(function() {
1429
+ if ($('#sidebar_mmenu').length) {
1430
+ if (Object.keys(user_data).length) {
1431
+ $('[id^=macro-]').each(function() {
1432
+
1433
+ $('#macro-provider').each(function() {
1434
+ var $this = $(this);
1435
+ var $html = $this.html();
1436
+ $this.html($html.replace('??provider', user_data.provider));
1437
+ this.href = this.href.replace(/.*\/??provider-site-url/, user_data.provider_site_url);
1438
+ });
1439
+ $('#macro-user-name').each(function() {
1440
+ var $this = $(this);
1441
+ var $html = $this.html();
1442
+ $this.html($html.replace('??user-name', user_data.user_name));
1443
+ this.href = this.href.replace(/.*\/??provider_member_url/, user_data.provider_member_url);
1444
+ });
1445
+ $('#macro-provider-permissions').each(function() {
1446
+ var $this = $(this);
1447
+ var $html = $this.html();
1448
+ $this.html($html.replace('??provider-permissions', user_data.provider_permissions));
1449
+ this.href = this.href.replace(/.*\/??provider_member_url/, user_data.provider_member_url);
1450
+ });
1451
+ $('#macro-provider-membership').each(function() {
1452
+ var $this = $(this);
1453
+ var $html = $this.html();
1454
+ $this.html($html.replace('??provider-membership', user_data.provider_membership));
1455
+ this.href = this.href.replace(/.*\/??provider_member_url/, user_data.provider_member_url);
1456
+ });
1457
+ $('#macro-cookie-state').each(function() {
1458
+ var $this = $(this);
1459
+ var $html = $this.html();
1460
+ $this.html($html.replace('??cookie-state', user_data.cookies_accepted));
1461
+ this.href = this.href.replace(/.*\/??provider_privacy_url/, user_data.provider_privacy_url);
1462
+ });
1463
+ $('#macro-theme-name').each(function() {
1464
+ var $this = $(this);
1465
+ var $html = $this.html();
1466
+ $this.html($html.replace('??theme-name', user_data.theme_name));
1467
+ });
1468
+ $('#macro-theme-author').each(function() {
1469
+ var $this = $(this);
1470
+ var $html = $this.html();
1471
+ $this.html($html.replace('??theme-author', user_data.theme_author));
1472
+ this.href = this.href.replace(/.*\/??theme-author-url/, user_data.theme_author_url);
1473
+ });
1474
+ $('#macro-theme-version').each(function() {
1475
+ var $this = $(this);
1476
+ var $html = $this.html();
1477
+ $this.html($html.replace('??theme-version', user_data.theme_version));
1478
+ });
1479
+
1480
+ });
1481
+ logger.info('met dependencies for: sidebarLoaded');
1482
+ clearInterval(sidebarLoaded);
1483
+ return true;
1484
+ } else {
1485
+ logger.error('no user data provided');
1486
+ clearInterval(sidebarLoaded);
1487
+ return false;
1488
+ }
1489
+ }
1490
+ }, 25); // END 'sidebarLoaded'
1491
+ }, // END resolveMacros
1492
+
1493
+ // -------------------------------------------------------------------------
1494
+ // Update MACROs
1495
+ // Update the values, NOT the placeholders
1496
+ // -------------------------------------------------------------------------
1497
+ updateMacros: function (user_data) {
1498
+ var logger = log4javascript.getLogger('j1.updateMacros');
1499
+
1500
+ var sidebarLoaded = setInterval(function() {
1501
+ if ($('#sidebar_mmenu').length) {
1502
+
1503
+ if (Object.keys(user_data).length) {
1504
+ $('[id^=macro-]').each(function() {
1505
+
1506
+ $('#macro-provider').each(function() {
1507
+ var $this = $(this);
1508
+ var $html = $this.html();
1509
+ $this.html($html.replace(/Provider:.*/, 'Provider: ' + user_data.provider));
1510
+ $('#macro-provider').attr('href', user_data.provider_site_url);
1511
+ });
1512
+ $('#macro-user-name').each(function() {
1513
+ var $this = $(this);
1514
+ var $html = $this.html();
1515
+ $this.html($html.replace(/User:.*/, 'User: ' + user_data.user_name));
1516
+ $('#macro-user-name').attr('href', user_data.provider_member_url);
1517
+ });
1518
+ $('#macro-provider-permissions').each(function() {
1519
+ var $this = $(this);
1520
+ var $html = $this.html();
1521
+ // $this.html($html.replace(/public|protected|private|blocked/, user_data.provider_permissions));
1522
+ $this.html($html.replace(/public.*|protected.*|private.*|blocked.*/, user_data.provider_permissions));
1523
+ $('#macro-provider-permissions').attr('href', user_data.provider_member_url);
1524
+ });
1525
+ $('#macro-provider-membership').each(function() {
1526
+ var $this = $(this);
1527
+ var $html = $this.html();
1528
+ $this.html($html.replace(/guest|member/, user_data.provider_membership));
1529
+ $('#macro-provider-membership').attr('href', user_data.provider_member_url);
1530
+ });
1531
+ $('#macro-cookie-state').each(function() {
1532
+ var $this = $(this);
1533
+ var $html = $this.html();
1534
+ $this.html($html.replace(/accepted|declined|pending/, user_data.cookies_accepted));
1535
+ $('#macro-cookie-state').attr('href', user_data.provider_privacy_url);
1536
+ });
1537
+
1538
+ });
1539
+ logger.info('met dependencies for: sidebarLoaded');
1540
+ clearInterval(sidebarLoaded);
1541
+ return true;
1542
+ } else {
1543
+ logger.error('no user data provided');
1544
+ clearInterval(sidebarLoaded);
1545
+ return false;
1546
+ }
1547
+ }
1548
+ }, 25); // END 'sidebarLoaded'
1549
+ }, // END updateMacros
1550
+
1551
+ // -------------------------------------------------------------------------
1552
+ // getMessage
1553
+ // Get a log message from the log message catalog object
1554
+ // -------------------------------------------------------------------------
1555
+ getMessage: function (level, message, property) {
1556
+ var message = j1.messages[level][message]['message'][property];
1557
+
1558
+ return message;
1559
+ }, // END getMessage
1560
+
1561
+ // -------------------------------------------------------------------------
1562
+ // logger
1563
+ // Log a message
1564
+ // -------------------------------------------------------------------------
1565
+ logger: function (logger, level, message) {
1566
+ var logger = log4javascript.getLogger(logger);
1567
+
1568
+ logger[level](message);
1569
+
1570
+ return true;
1571
+ }, // END logger
1572
+
1573
+ // -------------------------------------------------------------------------
1574
+ // Send message
1575
+ // -------------------------------------------------------------------------
1576
+ sendMessage: function ( sender, receiver, message ) {
1577
+ var logger = log4javascript.getLogger('j1.sendMessage');
1578
+ // var json_message = JSON.stringify(message, undefined, 2); // multiline
1579
+ var json_message = JSON.stringify(message);
1580
+
1581
+ if ( receiver === 'j1' ) {
1582
+ logText = 'send message from ' + sender + ' to' + receiver + ': ' + json_message;
1583
+ logger.debug(logText);
1584
+ executeFunctionByName('j1' + '.messageHandler', window, sender, message);
1585
+ } else {
1586
+ logText = 'send message from ' + sender + ' to ' + receiver + ': ' + json_message;
1587
+ logger.debug(logText);
1588
+ //executeFunctionByName('j1.' + receiver + '.messageHandler', window, sender, message)
1589
+ executeFunctionByName(receiver + '.messageHandler', window, sender, message);
1590
+ }
1591
+
1592
+ }, // END sendMessage
1593
+
1594
+ // -------------------------------------------------------------------------
1595
+ // messageHandler: MessageHandler for J1 CookieConsent module
1596
+ // Manage messages send from other J1 modules
1597
+ // -------------------------------------------------------------------------
1598
+ messageHandler: function ( sender, message ) {
1599
+ // var json_message = JSON.stringify(message, undefined, 2); // multiline
1600
+ var json_message = JSON.stringify(message);
1601
+
1602
+ logText = 'received message from ' + sender + ': ' + json_message;
1603
+ logger.debug(logText);
1604
+
1605
+ // -----------------------------------------------------------------------
1606
+ // Process commands|actions
1607
+ // -----------------------------------------------------------------------
1608
+ if ( message.type === 'command' && message.action === 'module_initialized' ) {
1609
+ _this.setState('finished');
1610
+ logger.info(message.text);
1611
+ }
1612
+
1613
+ //
1614
+ // Place handling of other command|action here
1615
+ //
1616
+
1617
+ return true;
1618
+ }, // END messageHandler
1619
+
1620
+ // -------------------------------------------------------------------------
1621
+ // getStyleValue:
1622
+ // Returns the value of a style from a css class definition
1623
+ // example: j1.getStyleValue('uno-primary', 'background-color')
1624
+ getStyleValue: function (className, style) {
1625
+ var elementId = 'test-' + className,
1626
+ testElement = document.getElementById(elementId),
1627
+ val;
1628
+
1629
+ if (testElement === null) {
1630
+ testElement = document.createElement('div');
1631
+ testElement.className = className;
1632
+ testElement.style.display = 'none';
1633
+ document.body.appendChild(testElement);
1634
+ }
1635
+ val = $(testElement).css(style);
1636
+ document.body.removeChild(testElement);
1637
+
1638
+ return val;
1639
+ }, // END getStyleValue
1640
+
1641
+ // -------------------------------------------------------------------------
1642
+ // getStyleSheetLoaded:
1643
+ // NOTE:
1644
+ // EXAMPLE: getStyleSheetLoaded('bootstrap');
1645
+ //
1646
+ getStyleSheetLoaded: function (styleSheet) {
1647
+ // var styleSheet = styleSheetName.toLowerCase() + '.css';
1648
+ var sheets = document.styleSheets, stylesheet = sheets[(sheets.length - 1)];
1649
+
1650
+ // find CSS file 'styleSheetName' in document
1651
+ for(var i in document.styleSheets) {
1652
+ if(sheets[i].href && sheets[i].href.indexOf(styleSheet) > -1) {
1653
+ return true;;
1654
+ }
1655
+ }
1656
+ },
1657
+
1658
+ // -------------------------------------------------------------------------
1659
+ // Returns the names of cookies used for J1 Template
1660
+ // -------------------------------------------------------------------------
1661
+ getCookieNames: function () {
1662
+ return cookie_names;
1663
+ }, // end getCookieNames
1664
+
1665
+ // -------------------------------------------------------------------------
1666
+ // Set dynamic styles
1667
+ // -------------------------------------------------------------------------
1668
+ setCss: function () {
1669
+ var logger = log4javascript.getLogger('j1.setCss');
1670
+ var bg_primary = j1.getStyleValue('bg-primary', 'background-color');
1671
+ var bg_secondary = j1.getStyleValue('bg-secondary', 'background-color');
1672
+
1673
+ logger.info('set color scheme for selected theme');
1674
+
1675
+ // globals
1676
+ // -----------------------------------------------------------------------
1677
+ $('head').append('<style>.g-bg-primary { background-color: ' +bg_primary+ ' !important; }</style>');
1678
+
1679
+ // Set color of timeline bullet
1680
+ // -----------------------------------------------------------------------
1681
+ // $('head').append('<style>.tmicon { background: ' +bg_primary+ ' !important; }</style>');
1682
+ // $('head').append('<style>.timeline-panel:after { border-left-color: ' +bg_primary+ ' !important; }</style>');
1683
+ // $('head').append('<style>.timeline-panel:after { border-right-color: ' +bg_primary+ ' !important; }</style>');
1684
+
1685
+ // mdi icons
1686
+ // -----------------------------------------------------------------------
1687
+ $('head').append('<style>.iconify-md-bg-primary { color: ' +bg_primary+ ' !important; }</style>');
1688
+ $('head').append('<style>.fa-md-bg-primary { color: ' +bg_primary+ ' !important; }</style>');
1689
+ $('head').append('<style>.fas-md-bg-primary { color: ' +bg_primary+ ' !important; }</style>');
1690
+ $('head').append('<style>.mdi-md-bg-primary { color: ' +bg_primary+ ' !important; }</style>');
1691
+
1692
+ // asciidoc
1693
+ // -----------------------------------------------------------------------
1694
+ var admonitionblock_note_color = bg_primary;
1695
+ var admonitionblock_tip_color = j1.getStyleValue('btn-success', 'background-color');
1696
+ var admonitionblock_important_color = j1.getStyleValue('btn-info', 'background-color');
1697
+ var admonitionblock_warning_color = j1.getStyleValue('icon-warning', 'color');
1698
+ var admonitionblock_caution_color = j1.getStyleValue('btn-danger', 'background-color');
1699
+
1700
+ $('head').append('<style>.icon-note { color: ' +admonitionblock_note_color+ ' !important; }</style>');
1701
+ $('head').append('<style>.icon-tip { color: ' +admonitionblock_tip_color+ ' !important; }</style>');
1702
+ $('head').append('<style>.icon-important { color: ' +admonitionblock_important_color+ ' !important; }</style>');
1703
+ $('head').append('<style>.icon-warning { color: ' +admonitionblock_warning_color+ ' !important; }</style>');
1704
+ $('head').append('<style>.icon-caution { color: ' +admonitionblock_caution_color+ ' !important; }</style>');
1705
+
1706
+ // bs base styles (2020-09-20: diabled. Taken for BS CSS code)
1707
+ // -----------------------------------------------------------------------
1708
+ // $('head').append('<style>code { color: ' +bg_secondary+ ' !important; }</style>');
1709
+
1710
+ // bs tool tips
1711
+ // -----------------------------------------------------------------------
1712
+ $('head').append('<style>.tooltip-inner { background-color: ' +bg_primary+ ' !important; }</style>');
1713
+ // $('head').append('<style>.tooltip-arrow { background-color: ' +bg_primary+ ' !important; }</style>');
1714
+ $('head').append('<style>.bs-tooltip-auto[x-placement^=bottom] .arrow::before, .bs-tooltip-bottom .arrow::before { border-bottom-color: ' +bg_primary+ ' !important; }</style>');
1715
+
1716
+ // asciidoc results viewer
1717
+ // -----------------------------------------------------------------------
1718
+ $('head').append('<style>.btn-viewer:hover { background-color: ' +bg_primary+ ' !important; }</style>');
1719
+
1720
+ // extended modals
1721
+ // -----------------------------------------------------------------------
1722
+ // var tabs_pills_link_color_active = j1.setColorData('md_blue'); // j1.getStyleValue('btn-info', 'background-color');
1723
+ // var tabs_pills_link_color_hover = j1.setColorData('md_gray_300'); // j1.getStyleValue('btn-secondary', 'background-color');
1724
+
1725
+ // var tabs_pills_link_color_active = 'mdi-blue';
1726
+ // var tabs_pills_link_color_hover = 'mdi-gray-300';
1727
+
1728
+ // nav module
1729
+ // -----------------------------------------------------------------------
1730
+ // $('head').append('<style>.nav-link:hover { background-color: ' +tabs_pills_link_color_hover+ ' !important; }</style>');
1731
+ // $('head').append('<style>.nav-link.active { background-color: ' +tabs_pills_link_color_active+ ' !important; }</style>');
1732
+
1733
+ return true;
1734
+ }, // END setCss
1735
+
1736
+ // -------------------------------------------------------------------------
1737
+ // setState()
1738
+ // Set the current (processing) state of the module
1739
+ // -------------------------------------------------------------------------
1740
+ setState: function (stat) {
1741
+ state = stat;
1742
+ }, // end setState
1743
+
1744
+ // -------------------------------------------------------------------------
1745
+ // getState()
1746
+ // Returns the current (processing) state of the module
1747
+ // -------------------------------------------------------------------------
1748
+ getState: function () {
1749
+ return state;
1750
+ }, // end getState
1751
+
1752
+ // -------------------------------------------------------------------------
1753
+ // setXhrDataState()
1754
+ // Set the final (loading) state of an element (partial) loaded via Xhr
1755
+ // -------------------------------------------------------------------------
1756
+ setXhrDataState: function (obj, stat) {
1757
+ j1.xhrDataState[obj] = stat;
1758
+ }, // END setXhrDataState
1759
+
1760
+ // -------------------------------------------------------------------------
1761
+ // getXhrDataState()
1762
+ // Returns the final (loading) state of an element (partial) loaded via Xhr
1763
+ // -------------------------------------------------------------------------
1764
+ getXhrDataState: function (obj) {
1765
+ return j1.xhrDataState[obj];
1766
+ }, // END getXhrDataState
1767
+
1768
+ // -------------------------------------------------------------------------
1769
+ // setXhrDomState()
1770
+ // Set the state of an element loaded via Xhr that is
1771
+ // successfully added to the DOM
1772
+ // -------------------------------------------------------------------------
1773
+ setXhrDomState: function (obj, stat) {
1774
+ j1.xhrDOMState[obj] = stat;
1775
+ }, // END setXhrDomState
1776
+
1777
+ // -------------------------------------------------------------------------
1778
+ // getXhrDataState()
1779
+ // Returns the state of an element loaded via Xhr that is
1780
+ // successfully added to the DOM
1781
+ // -------------------------------------------------------------------------
1782
+ getXhrDOMState: function (obj) {
1783
+ return j1.xhrDOMState[obj];
1784
+ }, // END getXhrDOMState
1785
+
1786
+ // -------------------------------------------------------------------------
1787
+ // setMode()
1788
+ // Set the current mode of the site (web|app)
1789
+ // -------------------------------------------------------------------------
1790
+ setMode: function (mod) {
1791
+ mode = mod;
1792
+ }, // END setMode
1793
+
1794
+ // -------------------------------------------------------------------------
1795
+ // getMode()
1796
+ // Returns the current mode of the site (web|app)
1797
+ // -------------------------------------------------------------------------
1798
+ getMode: function () {
1799
+ return mode;
1800
+ }, // END getMode
1801
+
1802
+ // -------------------------------------------------------------------------
1803
+ // checkUserAgent()
1804
+ // Returns the name (UA) of the web browser
1805
+ // -------------------------------------------------------------------------
1806
+ checkUserAgent: function () {
1807
+ if (navigator.userAgent.search(ua_name) >= 0) {
1808
+ return true;
1809
+ } else {
1810
+ return false;
1811
+ }
1812
+ }, // END checkUserAgent
1813
+
1814
+ // -------------------------------------------------------------------------
1815
+ // generateId()
1816
+ // Generate a unique (thread) id used by the logger
1817
+ // -------------------------------------------------------------------------
1818
+ generateId: function (length) {
1819
+ var result = '';
1820
+ var characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
1821
+ var charactersLength = characters.length;
1822
+ for ( var i = 0; i < length; i++ ) {
1823
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
1824
+ }
1825
+ return result;
1826
+ }, // END generateId
1827
+
1828
+ // -------------------------------------------------------------------------
1829
+ // getTrue()
1830
+ // Returns always true (for testing purposes)
1831
+ // -------------------------------------------------------------------------
1832
+ getTrue: function () {
1833
+ return true;
1834
+ }, // END isTrue
1835
+
1836
+ // -------------------------------------------------------------------------
1837
+ // getFalse()
1838
+ // Returns always false (for testing purposes)
1839
+ // -------------------------------------------------------------------------
1840
+ getFalse: function () {
1841
+ return false;
1842
+ }, // END isTrue
1843
+
1844
+ // -------------------------------------------------------------------------
1845
+ // goHome()
1846
+ // Redirect current page to the browser homepage
1847
+ // -------------------------------------------------------------------------
1848
+ goHome: function () {
1849
+ // most browsers
1850
+ if (typeof window.home == 'function') {
1851
+ window.home();
1852
+ } else if (document.all) {
1853
+ // for IE
1854
+ window.location.href = 'about:home';
1855
+ } else {
1856
+ window.location.href = 'about:blank';
1857
+ }
1858
+ }, // END gohome
1859
+
1860
+ // -------------------------------------------------------------------------
1861
+ // goBack()
1862
+ // Redirect current page to last visited page (referrer)
1863
+ // -------------------------------------------------------------------------
1864
+ goBack: function () {
1865
+ // where visitor has come from
1866
+ window.location.href = document.referrer;
1867
+ } // END goBack
1868
+
1869
+ }; // END j1 (return)
1870
+ }) (j1, window);
1871
+
1872
+ {% endcapture %}
1873
+ {% if production %}
1874
+ {{ cache | minifyJS }}
1875
+ {% else %}
1876
+ {{ cache | strip_empty_lines }}
1877
+ {% endif %}
1878
+ {% assign cache = nil %}