j1-template 2020.0.11 → 2020.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (412) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/blocks/ads/ad.html +64 -0
  3. data/_includes/themes/j1/blocks/footer/boxes/about_box.proc +2 -2
  4. data/_includes/themes/j1/blocks/footer/boxes/links_box.proc +3 -3
  5. data/_includes/themes/j1/blocks/footer/boxes/news_box.proc +3 -3
  6. data/_includes/themes/j1/layouts/content_generator_blog_archive.html +3 -2
  7. data/_includes/themes/j1/layouts/content_generator_collection.html +3 -2
  8. data/_includes/themes/j1/layouts/content_generator_page.html +26 -25
  9. data/_includes/themes/j1/layouts/content_generator_post.html +13 -13
  10. data/_includes/themes/j1/layouts/layout_metadata_generator.html +134 -4
  11. data/_includes/themes/j1/modules/connectors/ad/custom-provider.html +6 -9
  12. data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +9 -6
  13. data/_includes/themes/j1/modules/connectors/ads +3 -6
  14. data/_includes/themes/j1/modules/navigator/generator.html +0 -1
  15. data/_includes/themes/j1/modules/navigator/procedures/topsearch.proc +5 -5
  16. data/_includes/themes/j1/procedures/global/create_word_cloud.proc +5 -2
  17. data/_includes/themes/j1/procedures/layouts/content_writer.proc +8 -9
  18. data/_includes/themes/j1/procedures/layouts/module_writer.proc +3 -13
  19. data/_includes/themes/j1/procedures/posts/collate_timeline.proc +14 -14
  20. data/_layouts/default.html +60 -59
  21. data/apps/public/cc/index.adoc +1 -5
  22. data/assets/data/authclient.html +48 -27
  23. data/assets/data/banner.html +23 -23
  24. data/assets/data/carousel.json +30 -21
  25. data/assets/data/cookiebar.html +277 -0
  26. data/assets/data/footer.html +14 -7
  27. data/assets/data/galleries.json +90 -81
  28. data/assets/data/gallery_customizer.html +21 -12
  29. data/assets/data/jupyter/notebooks/_html/template.full.head.html +10 -10
  30. data/assets/data/jupyter/notebooks/_html/visualisation.html +11 -11
  31. data/assets/data/jupyter/notebooks/html/template.html +7 -7
  32. data/assets/data/jupyter/notebooks/html/visualisation.ok.html +12 -12
  33. data/assets/data/jupyter/notebooks/visualisation.ipynb +1 -1
  34. data/assets/data/mdi_icons.json +55 -1
  35. data/assets/data/menu.html +16 -9
  36. data/assets/data/mmenu.html +48 -95
  37. data/assets/data/mmenu_sidebar.html +40 -44
  38. data/assets/data/mmenu_toc.html +20 -4
  39. data/assets/data/panel.html +44 -38
  40. data/assets/data/quicklinks.html +36 -20
  41. data/assets/data/search.json +165 -0
  42. data/assets/data/ssm.html +15 -4
  43. data/assets/data/themes.json +17 -6
  44. data/assets/data/twa_v1.json +54 -0
  45. data/assets/themes/j1/adapter/js/algolia.js +28 -17
  46. data/assets/themes/j1/adapter/js/attic.js +51 -40
  47. data/assets/themes/j1/adapter/js/carousel.js +27 -13
  48. data/assets/themes/j1/adapter/js/clipboard.js +232 -0
  49. data/assets/themes/j1/adapter/js/cookiebar.js +204 -0
  50. data/assets/themes/j1/adapter/js/framer.js +37 -21
  51. data/assets/themes/j1/adapter/js/gallery_customizer.js +230 -250
  52. data/assets/themes/j1/adapter/js/j1.js +563 -803
  53. data/assets/themes/j1/adapter/js/{justified_gallery.js → jf_gallery.js} +32 -22
  54. data/assets/themes/j1/adapter/js/lightbox.js +20 -10
  55. data/assets/themes/j1/adapter/js/logger.js +13 -6
  56. data/assets/themes/j1/adapter/js/mdb.js +164 -0
  57. data/assets/themes/j1/adapter/js/mmenu.js +60 -69
  58. data/assets/themes/j1/adapter/js/navigator.js +200 -169
  59. data/assets/themes/j1/adapter/js/searcher.js +30 -14
  60. data/assets/themes/j1/adapter/js/ssm.js +111 -88
  61. data/assets/themes/j1/adapter/js/themer.js +71 -103
  62. data/assets/themes/j1/adapter/js/toccer.js +30 -22
  63. data/assets/themes/j1/core/css/animate.css +2382 -0
  64. data/assets/themes/j1/core/css/animate.min.css +7 -0
  65. data/assets/themes/j1/core/css/fontawesome.css +4415 -0
  66. data/assets/themes/j1/core/css/fontawesome.min.css +1 -0
  67. data/assets/themes/j1/core/css/iconify-icons.css +4106 -0
  68. data/assets/themes/j1/core/css/iconify-icons.min.css +1 -0
  69. data/assets/themes/j1/core/css/material-design-icons.css +14532 -0
  70. data/assets/themes/j1/core/css/material-design-icons.min.css +1 -0
  71. data/assets/themes/j1/core/css/theme_extensions.css +326 -3004
  72. data/assets/themes/j1/core/css/theme_extensions.min.css +1 -1
  73. data/assets/themes/j1/core/css/twemoji.css +9485 -0
  74. data/assets/themes/j1/core/css/twemoji.min.css +1 -0
  75. data/assets/themes/j1/core/css/uno.css +453 -3039
  76. data/assets/themes/j1/core/css/uno.min.css +1 -1
  77. data/assets/themes/j1/core/css/vendor.css +884 -33335
  78. data/assets/themes/j1/core/css/vendor.min.css +2 -9
  79. data/assets/themes/j1/core/js/template.js +25 -416
  80. data/assets/themes/j1/core/js/template.js.map +1 -1
  81. data/assets/themes/j1/core/js/template.min.js +1 -1
  82. data/assets/themes/j1/modules/backstretch/js/backstretch.js +1695 -0
  83. data/assets/themes/j1/modules/backstretch/js/backstretch.min.js +21 -0
  84. data/assets/themes/j1/modules/backstretch/js/backstretch.min.js.org +1 -0
  85. data/assets/themes/j1/modules/bmd/css/bootstrap-material-design.css +12177 -0
  86. data/assets/themes/j1/modules/bmd/css/bootstrap-material-design.min.css +8 -0
  87. data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js +6930 -0
  88. data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js.map +1 -0
  89. data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.min.js +1 -0
  90. data/assets/themes/j1/modules/bootstrap/css/bootstrap.css +10278 -0
  91. data/assets/themes/j1/modules/bootstrap/css/bootstrap.css.map +1 -0
  92. data/assets/themes/j1/modules/bootstrap/css/bootstrap.min.css +7 -0
  93. data/assets/themes/j1/modules/bootstrap/css/bootstrap.min.css.map +1 -0
  94. data/assets/themes/j1/modules/bootstrap/js/bootstrap.js +4420 -0
  95. data/assets/themes/j1/modules/bootstrap/js/bootstrap.js.map +1 -0
  96. data/assets/themes/j1/modules/bootstrap/js/bootstrap.min.js +7 -0
  97. data/assets/themes/j1/modules/bootstrap/js/bootstrap.min.js.map +1 -0
  98. data/assets/themes/j1/modules/bsDatepicker/css/datepicker.css +203 -0
  99. data/assets/themes/j1/modules/bsDatepicker/css/theme/uno.css +235 -0
  100. data/assets/themes/j1/modules/bsDatepicker/js/datepicker.js +509 -0
  101. data/assets/themes/j1/modules/bsDatepicker/less/datepicker.less +122 -0
  102. data/assets/themes/j1/modules/bsThemeSwitcher/js/switcher.js +435 -0
  103. data/assets/themes/j1/modules/bsThemeSwitcher/js/switcher.min.js +20 -0
  104. data/assets/themes/j1/{extensions → modules}/carousel/css/carousel.css +1 -1
  105. data/assets/themes/j1/{extensions → modules}/carousel/css/carousel.min.css +1 -1
  106. data/assets/themes/j1/{extensions → modules}/carousel/css/carousel_transitions.css +1 -1
  107. data/assets/themes/j1/{extensions → modules}/carousel/css/carousel_transitions.min.css +1 -1
  108. data/assets/themes/j1/{extensions → modules}/carousel/css/theme/uno.css +1 -1
  109. data/assets/themes/j1/{extensions → modules}/carousel/css/theme/uno.min.css +1 -1
  110. data/assets/themes/j1/{extensions → modules}/carousel/images/ajax-loader.gif +0 -0
  111. data/assets/themes/j1/{extensions → modules}/carousel/images/grabbing.png +0 -0
  112. data/assets/themes/j1/{extensions → modules}/carousel/images/owl-logo.png +0 -0
  113. data/assets/themes/j1/{extensions → modules}/carousel/images/owl.video.play.png +0 -0
  114. data/assets/themes/j1/{extensions → modules}/carousel/js/carousel.js +0 -0
  115. data/assets/themes/j1/{extensions → modules}/carousel/js/carousel.min.js +0 -0
  116. data/assets/themes/j1/modules/clipboard/LICENSE +20 -0
  117. data/assets/themes/j1/modules/clipboard/css/theme/uno.css +52 -0
  118. data/assets/themes/j1/modules/clipboard/css/theme/uno.min.css +52 -0
  119. data/assets/themes/j1/modules/clipboard/js/clipboard.js +975 -0
  120. data/assets/themes/j1/modules/clipboard/js/clipboard.min.js +7 -0
  121. data/assets/themes/j1/{extensions/iconify → modules/iconifyAPI}/js/iconify.min.js +0 -0
  122. data/assets/themes/j1/modules/iframeResizer/LICENSE +21 -0
  123. data/assets/themes/j1/modules/iframeResizer/examples/frame.absolute.html +127 -0
  124. data/assets/themes/j1/modules/iframeResizer/examples/frame.content.html +157 -0
  125. data/assets/themes/j1/modules/iframeResizer/examples/frame.hover.html +68 -0
  126. data/assets/themes/j1/modules/iframeResizer/examples/frame.nested.html +100 -0
  127. data/assets/themes/j1/modules/iframeResizer/examples/frame.textarea.html +45 -0
  128. data/assets/themes/j1/modules/iframeResizer/examples/frame.tolerance.html +113 -0
  129. data/assets/themes/j1/modules/iframeResizer/examples/index.html +83 -0
  130. data/assets/themes/j1/modules/iframeResizer/examples/two.html +88 -0
  131. data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.js +1288 -0
  132. data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.map +1 -0
  133. data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.min.js +10 -0
  134. data/assets/themes/j1/modules/iframeResizer/js/iframeResizer.js +1390 -0
  135. data/assets/themes/j1/modules/iframeResizer/js/iframeResizer.map +1 -0
  136. data/assets/themes/j1/modules/iframeResizer/js/iframeResizer.min.js +9 -0
  137. data/assets/themes/j1/modules/jekyllSearch/js/simple-jekyll-search.js +468 -0
  138. data/assets/themes/j1/modules/jekyllSearch/js/simple-jekyll-search.min.js +6 -0
  139. data/assets/themes/j1/modules/jqMouseWheel/README.md +76 -0
  140. data/assets/themes/j1/modules/jqMouseWheel/js/jquery.mousewheel.js +221 -0
  141. data/assets/themes/j1/modules/jqMouseWheel/js/jquery.mousewheel.min.js +9 -0
  142. data/assets/themes/j1/modules/jquery/js/jquery.js +10869 -0
  143. data/assets/themes/j1/modules/jquery/js/jquery.min.js +2 -0
  144. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/LICENSE +0 -0
  145. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/README.md +0 -0
  146. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/css/justifiedGallery.css +0 -0
  147. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/css/justifiedGallery.min.css +0 -0
  148. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/css/theme/uno.css +1 -1
  149. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/js/justifiedGallery.3.7.0.js +0 -0
  150. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/js/justifiedGallery.js +0 -0
  151. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/js/justifiedGallery.min.js +0 -0
  152. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/less/.csslintrc +0 -0
  153. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v3.7.0/less/justifiedGallery.less +0 -0
  154. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v4.0.0/css/justifiedGallery.css +0 -0
  155. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v4.0.0/css/justifiedGallery.min.css +0 -0
  156. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v4.0.0/css/theme/uno.css +1 -1
  157. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v4.0.0/js/jquery.justifiedGallery.js +0 -0
  158. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/_versions/v4.0.0/js/jquery.justifiedGallery.min.js +0 -0
  159. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/css/justifiedGallery.css +0 -0
  160. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/css/justifiedGallery.min.css +0 -0
  161. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/css/theme/uno.css +1 -1
  162. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/css/theme/uno.min.css +1 -1
  163. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/js/justifiedGallery.js +0 -0
  164. data/assets/themes/j1/{extensions/justified_gallery → modules/justifiedGallery}/js/justifiedGallery.min.js +0 -0
  165. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/core/lg-fb-comment-box.css +0 -0
  166. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/core/lg-fb-comment-box.min.css +0 -0
  167. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/core/lg-transitions.css +0 -0
  168. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/core/lg-transitions.min.css +0 -0
  169. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/core/lightgallery.css +0 -0
  170. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/core/lightgallery.min.css +0 -0
  171. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/fonts/lg.eot +0 -0
  172. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/fonts/lg.svg +0 -0
  173. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/fonts/lg.ttf +0 -0
  174. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/fonts/lg.woff +0 -0
  175. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/img/loading.gif +0 -0
  176. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/img/video-play.png +0 -0
  177. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/img/vimeo-play.png +0 -0
  178. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/img/youtube-play.png +0 -0
  179. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/animation-w.png +0 -0
  180. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/customize-w.png +0 -0
  181. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/dynamic-w.png +0 -0
  182. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/facebook-icon.svg +0 -0
  183. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/googleplus-icon.svg +0 -0
  184. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/html5-w.png +0 -0
  185. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/linked-in.png +0 -0
  186. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/module-w.png +0 -0
  187. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/play-button.png +0 -0
  188. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/responsive-w.png +0 -0
  189. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/thumb-w.png +0 -0
  190. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/touch-w.png +0 -0
  191. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/twitter-icon.svg +0 -0
  192. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/twitter.png +0 -0
  193. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/video1-w.png +0 -0
  194. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/zoom-w.png +0 -0
  195. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/icons/zoom.png +0 -0
  196. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/uno.css +1 -1
  197. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/css/themes/uno.min.css +1 -1
  198. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/core/lightgallery.js +0 -0
  199. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/core/lightgallery.min.js +0 -0
  200. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/j1/j1-video.js +0 -0
  201. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/j1/j1-video.min.js +0 -0
  202. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-autoplay.js +0 -0
  203. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-autoplay.min.js +0 -0
  204. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-fullscreen.js +0 -0
  205. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-fullscreen.min.js +0 -0
  206. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-hash.js +0 -0
  207. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-hash.min.js +0 -0
  208. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-pager.js +0 -0
  209. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-pager.min.js +0 -0
  210. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-share.js +0 -0
  211. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-share.min.js +0 -0
  212. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-thumbnail.js +0 -0
  213. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-thumbnail.min.js +0 -0
  214. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-video.js +0 -0
  215. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-video.min.js +0 -0
  216. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-zoom.js +0 -0
  217. data/assets/themes/j1/{extensions/light_gallery → modules/lightGallery}/js/modules/lg-zoom.min.js +0 -0
  218. data/assets/themes/j1/modules/lightbox/LICENSE +22 -0
  219. data/assets/themes/j1/modules/lightbox/css/lightbox.css +224 -0
  220. data/assets/themes/j1/modules/lightbox/css/lightbox.min.css +21 -0
  221. data/assets/themes/j1/modules/lightbox/css/theme/uno.css +25 -0
  222. data/assets/themes/j1/modules/lightbox/css/theme/uno.min.css +26 -0
  223. data/assets/themes/j1/modules/lightbox/images/close.png +0 -0
  224. data/assets/themes/j1/modules/lightbox/images/loading.gif +0 -0
  225. data/assets/themes/j1/modules/lightbox/images/next.png +0 -0
  226. data/assets/themes/j1/modules/lightbox/images/prev.png +0 -0
  227. data/assets/themes/j1/modules/lightbox/js/lightbox.js +583 -0
  228. data/assets/themes/j1/modules/lightbox/js/lightbox.min.js +35 -0
  229. data/assets/themes/j1/modules/mmenuLight/css/mmenu.css +392 -0
  230. data/assets/themes/j1/modules/mmenuLight/css/mmenu.min.css +393 -0
  231. data/assets/themes/j1/modules/mmenuLight/css/theme/uno.css +178 -0
  232. data/assets/themes/j1/modules/mmenuLight/css/theme/uno.min.css +170 -0
  233. data/assets/themes/j1/modules/mmenuLight/js/mmenu.js +563 -0
  234. data/assets/themes/j1/modules/mmenuLight/js/mmenu.min.js +30 -0
  235. data/assets/themes/j1/modules/noUISlider/LICENSE +13 -0
  236. data/assets/themes/j1/modules/noUISlider/css/nouislider.css +260 -0
  237. data/assets/themes/j1/modules/noUISlider/css/nouislider.min.css +1 -0
  238. data/assets/themes/j1/modules/noUISlider/js/nouislider.js +2312 -0
  239. data/assets/themes/j1/modules/noUISlider/js/nouislider.min.js +3 -0
  240. data/assets/themes/j1/modules/polyfills/js/msie.js +140 -0
  241. data/assets/themes/j1/modules/popper/js/popper.js +2623 -0
  242. data/assets/themes/j1/modules/popper/js/popper.js.map +1 -0
  243. data/assets/themes/j1/modules/popper/js/popper.min.js +4 -0
  244. data/assets/themes/j1/modules/popper/js/popper.min.js.map +1 -0
  245. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.dark/theme.css +0 -0
  246. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.light/theme.css +0 -0
  247. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.monokai.dark/theme.css +0 -0
  248. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.monokai.light/theme.css +0 -0
  249. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.monokai/theme.css +0 -0
  250. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.solarized.dark/theme.css +0 -0
  251. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.solarized.light/theme.css +0 -0
  252. data/assets/themes/j1/{extensions → modules}/rouge/css/base16.solarized/theme.css +0 -0
  253. data/assets/themes/j1/{extensions → modules}/rouge/css/base16/theme.css +0 -0
  254. data/assets/themes/j1/{extensions → modules}/rouge/css/colorful/theme.css +0 -0
  255. data/assets/themes/j1/{extensions → modules}/rouge/css/github/theme.css +0 -0
  256. data/assets/themes/j1/{extensions → modules}/rouge/css/gruvbox.dark/theme.css +0 -0
  257. data/assets/themes/j1/{extensions → modules}/rouge/css/gruvbox.light/theme.css +0 -0
  258. data/assets/themes/j1/{extensions → modules}/rouge/css/gruvbox/theme.css +0 -0
  259. data/assets/themes/j1/{extensions → modules}/rouge/css/igorpro/theme.css +0 -0
  260. data/assets/themes/j1/{extensions → modules}/rouge/css/molokai/theme.css +0 -0
  261. data/assets/themes/j1/{extensions → modules}/rouge/css/monokai.sublime/theme.css +0 -0
  262. data/assets/themes/j1/{extensions → modules}/rouge/css/monokai/theme.css +0 -0
  263. data/assets/themes/j1/{extensions → modules}/rouge/css/pastie/theme.css +0 -0
  264. data/assets/themes/j1/{extensions → modules}/rouge/css/thankful_eyes/theme.css +0 -0
  265. data/assets/themes/j1/{extensions → modules}/rouge/css/tulip/theme.css +0 -0
  266. data/assets/themes/j1/modules/tocbot/css/theme/uno.css +89 -0
  267. data/assets/themes/j1/modules/tocbot/css/theme/uno.min.css +89 -0
  268. data/assets/themes/j1/modules/tocbot/css/tocbot.css +75 -0
  269. data/assets/themes/j1/modules/tocbot/css/tocbot.min.css +19 -0
  270. data/assets/themes/j1/modules/tocbot/js/tocbot.js +19 -0
  271. data/assets/themes/j1/modules/tocbot/js/tocbot.min.js +19 -0
  272. data/assets/themes/j1/modules/twemoji/js/LICENSE +21 -0
  273. data/assets/themes/j1/modules/twemoji/js/picker/LICENSE +21 -0
  274. data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.js +275 -0
  275. data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.min.js +275 -0
  276. data/assets/themes/j1/modules/twemoji/js/twemoji.js +589 -0
  277. data/assets/themes/j1/modules/twemoji/js/twemoji.min.js +25 -0
  278. data/assets/themes/j1/modules/util/js/js.cookie.js +163 -0
  279. data/assets/themes/j1/modules/util/js/lite-url.js +203 -0
  280. data/assets/themes/j1/modules/util/js/lite-url.min.js +7 -0
  281. data/assets/themes/j1/{extensions/log4javascript/log4javascript.min.js → modules/util/js/log4javascript.js} +0 -2
  282. data/assets/themes/j1/modules/util/js/platform.js +1260 -0
  283. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/city.css +0 -0
  284. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/city.min.css +0 -0
  285. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/fantasy.css +0 -0
  286. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/fantasy.min.css +0 -0
  287. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/forest.css +0 -0
  288. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/forest.min.css +0 -0
  289. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/sea.css +0 -0
  290. data/assets/themes/j1/{extensions → modules}/videojs/css/themes/sea.min.css +0 -0
  291. data/assets/themes/j1/{extensions → modules}/videojs/css/video-js.css +0 -0
  292. data/assets/themes/j1/{extensions → modules}/videojs/css/video-js.min.css +0 -0
  293. data/assets/themes/j1/{extensions → modules}/videojs/js/video.js +0 -0
  294. data/assets/themes/j1/{extensions → modules}/videojs/js/video.min.js +0 -0
  295. data/assets/themes/j1/{extensions → modules}/vimeo/froogaloop/js/froogaloop2.min.js +0 -0
  296. data/assets/themes/j1/{extensions → modules}/vimeo/player/js/player.js +0 -0
  297. data/assets/themes/j1/{extensions → modules}/vimeo/player/js/player.js.map +0 -0
  298. data/assets/themes/j1/{extensions → modules}/vimeo/player/js/player.min.js +0 -0
  299. data/assets/themes/j1/{extensions → modules}/vimeo/player/js/player.min.js.map +0 -0
  300. data/lib/j1/version.rb +1 -1
  301. data/lib/j1_app/j1_auth_manager/views/auth_manager_ui.erb +391 -389
  302. data/lib/starter_web/Gemfile +22 -13
  303. data/lib/starter_web/_config.yml +9 -8
  304. data/lib/starter_web/_data/_defaults/resources.yml +13 -13
  305. data/lib/starter_web/_data/blocks/banner.yml +23 -31
  306. data/lib/starter_web/_data/blocks/footer.yml +10 -3
  307. data/lib/starter_web/_data/blocks/panel.yml +21 -21
  308. data/lib/starter_web/_data/layouts/default.yml +10 -0
  309. data/lib/starter_web/_data/layouts/home.yml +7 -7
  310. data/lib/starter_web/_data/layouts/page.yml +15 -16
  311. data/lib/starter_web/_data/modules/advertising.yml +48 -0
  312. data/lib/starter_web/_data/modules/attics.yml +2 -38
  313. data/lib/starter_web/_data/modules/cookiebar.yml +2 -2
  314. data/lib/starter_web/_data/modules/defaults/attics.yml +16 -15
  315. data/lib/starter_web/_data/modules/defaults/authentication.yml +8 -9
  316. data/lib/starter_web/_data/modules/defaults/cookie_consent.yml +75 -12
  317. data/lib/starter_web/_data/modules/defaults/cookiebar.yml +101 -50
  318. data/lib/starter_web/_data/modules/defaults/jekyll_search.yml +12 -9
  319. data/lib/starter_web/_data/modules/defaults/navigator.yml +57 -21
  320. data/lib/starter_web/_data/modules/jekyll_search.yml +1 -20
  321. data/lib/starter_web/_data/modules/navigator.yml +1 -1
  322. data/lib/starter_web/_data/modules/navigator_menu.yml +6 -7
  323. data/lib/starter_web/_data/modules/themer.yml +10 -11
  324. data/lib/starter_web/_data/resources.yml +379 -174
  325. data/lib/starter_web/_data/template_settings.yml +96 -4
  326. data/lib/starter_web/_data/utilities/util_srv.yml +1 -1
  327. data/lib/starter_web/_plugins/asciidoctor-extensions/banner.rb +43 -0
  328. data/lib/starter_web/_plugins/asciidoctor-extensions/fab-icon-inline.rb +1 -1
  329. data/lib/starter_web/_plugins/asciidoctor-extensions/fas-icon-inline.rb +2 -2
  330. data/lib/starter_web/_plugins/asciidoctor-extensions/iconify-icon-inline.rb +2 -2
  331. data/lib/starter_web/_plugins/asciidoctor-extensions/mdi-icon-inline.rb +2 -2
  332. data/lib/starter_web/_plugins/asciidoctor-extensions/panel.rb +43 -0
  333. data/lib/starter_web/_plugins/asciidoctor-extensions/twitter-emoji-inline.rb +2 -2
  334. data/lib/starter_web/_plugins/{asciidoctor-extensions/lorem-inline.rb → lorem-inline.rb} +0 -0
  335. data/lib/starter_web/_plugins/minifyJS.rb +54 -0
  336. data/lib/starter_web/_plugins/minifyJSON.rb +47 -0
  337. data/lib/starter_web/assets/images/pages/material/apple-touch-icon.png +0 -0
  338. data/lib/starter_web/assets/videos/headers/still/underground-broadway.webp +0 -0
  339. data/lib/starter_web/assets/videos/headers/still/victoria-oskolovich-on-vimeo.webp +0 -0
  340. data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1-template.adoc.erb +3 -4
  341. data/lib/starter_web/collections/posts/public/featured/_posts/2018-05-01-confusion-about-base-url.adoc +1 -1
  342. data/lib/starter_web/collections/posts/public/featured/_posts/2019-05-01-top-open-source-static-site-generators.adoc +17 -17
  343. data/lib/starter_web/collections/posts/public/featured/_posts/2019-06-01-about-cookies.adoc +36 -40
  344. data/lib/starter_web/collections/posts/public/series/_posts/2018-11-01-docker-using-shared-folders.adoc +4 -6
  345. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-20-minneapolis.adoc +1 -3
  346. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc +3 -3
  347. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-26-columbia-river.adoc +4 -4
  348. data/lib/starter_web/index.html +12 -13
  349. data/lib/starter_web/package.json +10 -10
  350. data/lib/starter_web/pages/{public → protected}/site_search.adoc +2 -2
  351. data/lib/starter_web/pages/public/blog/navigator/archive.html +24 -18
  352. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +39 -34
  353. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +43 -30
  354. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +29 -29
  355. data/lib/starter_web/pages/public/blog/navigator/index.html +2 -2
  356. data/lib/starter_web/pages/public/learn/examples/floating_ad.adoc +221 -0
  357. data/lib/starter_web/pages/public/learn/examples/floating_div.adoc +33 -1
  358. data/lib/starter_web/pages/public/learn/kickstarter/web_in_a_day/100_meet_and_greet_jekyll.adoc +1 -0
  359. data/lib/starter_web/pages/public/learn/roundtrip/000_bs_tour.1.asciidoc +1 -2
  360. data/lib/starter_web/pages/public/learn/roundtrip/000_bs_tour.adoc +1 -2
  361. data/lib/starter_web/pages/public/learn/roundtrip/000_bs_tour_api.adoc +16 -18
  362. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/attributes.asciidoc +1 -1
  363. data/lib/starter_web/pages/public/learn/roundtrip/000_includes/documents/419_advanced_modals_html.asciidoc +5 -5
  364. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +2 -2
  365. data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +2 -2
  366. data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +7 -3
  367. data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +36 -45
  368. data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +1 -1
  369. data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +9 -10
  370. data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +39 -39
  371. data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +20 -22
  372. data/lib/starter_web/pages/public/{previewer/mdb_preview → learn/roundtrip/510_mdb_preview}/000_includes/attributes.asciidoc +0 -0
  373. data/lib/starter_web/pages/public/{previewer/mdb_preview → learn/roundtrip/510_mdb_preview}/000_includes/documents/100_buttons.asciidoc +0 -0
  374. data/lib/starter_web/pages/public/{previewer/mdb_preview → learn/roundtrip/510_mdb_preview}/mdb_previewer.adoc +2 -2
  375. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/attributes.asciidoc +1 -1
  376. data/lib/starter_web/pages/public/learn/vtutorials/000_includes/documents/419_advanced_modals_html.asciidoc +5 -5
  377. data/lib/starter_web/pages/public/learn/whats_up.adoc +2 -2
  378. data/lib/starter_web/pages/public/previewer/bootstrap_theme.adoc +11 -13
  379. data/lib/starter_web/pages/public/previewer/iframer.adoc +17 -15
  380. data/lib/starter_web/pages/public/previewer/justified_gallery.html +2 -2
  381. data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +2 -2
  382. data/lib/starter_web/pages/public/previewer/twitter_emoji_preview.adoc +3 -3
  383. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  384. data/lib/starter_web/utilsrv/package.json +1 -1
  385. metadata +255 -165
  386. data/assets/data/colors.json +0 -42
  387. data/assets/data/cookie_consent.html +0 -223
  388. data/assets/data/font_sizes.json +0 -42
  389. data/assets/data/messages.yml +0 -131
  390. data/assets/data/search.yml +0 -153
  391. data/assets/themes/j1/adapter/js/cookie_consent.js +0 -277
  392. data/assets/themes/j1/core/css/custom.scss +0 -28
  393. data/assets/themes/j1/core/css/globals.css +0 -14523
  394. data/assets/themes/j1/core/css/globals.min.css +0 -1
  395. data/assets/themes/j1/core/css/uno.scss +0 -28
  396. data/assets/themes/j1/core/css/vendor.scss +0 -28
  397. data/assets/themes/j1/extensions/iframe_resizer/examples/frame.absolute.html +0 -86
  398. data/assets/themes/j1/extensions/iframe_resizer/examples/frame.content.html +0 -58
  399. data/assets/themes/j1/extensions/iframe_resizer/examples/frame.hover.html +0 -51
  400. data/assets/themes/j1/extensions/iframe_resizer/examples/frame.nested.html +0 -68
  401. data/assets/themes/j1/extensions/iframe_resizer/examples/frame.textarea.html +0 -46
  402. data/assets/themes/j1/extensions/iframe_resizer/examples/frame.tolerance.html +0 -79
  403. data/assets/themes/j1/extensions/iframe_resizer/examples/index.html +0 -70
  404. data/assets/themes/j1/extensions/iframe_resizer/examples/two.html +0 -71
  405. data/assets/themes/j1/extensions/iframe_resizer/js/client/iframeResizer.contentWindow.js +0 -1104
  406. data/assets/themes/j1/extensions/iframe_resizer/js/client/iframeResizer.contentWindow.map +0 -1
  407. data/assets/themes/j1/extensions/iframe_resizer/js/client/iframeResizer.contentWindow.min.js +0 -10
  408. data/assets/themes/j1/extensions/log4javascript/log4javascript.js +0 -5826
  409. data/lib/starter_web/_data/modules/cookie_consent.yml +0 -128
  410. data/lib/starter_web/assets/videos/headers/still/underground-broadway.png +0 -0
  411. data/lib/starter_web/assets/videos/headers/still/victoria-oskolovich-on-vimeo.png +0 -0
  412. data/lib/starter_web/pages/public/clear_button.adoc +0 -121
@@ -1,5 +1,5 @@
1
1
  ---
2
- regenerate: true
2
+ regenerate: true
3
3
  ---
4
4
 
5
5
  {% capture cache %}
@@ -17,8 +17,6 @@ regenerate: true
17
17
  # J1 Template is licensed under the MIT License.
18
18
  # For details, see https://jekyll.one
19
19
  # -----------------------------------------------------------------------------
20
- # TODO: jadams, 2019-01-20: Isolate drawer, switch from BME code
21
- # -----------------------------------------------------------------------------
22
20
  # Test data:
23
21
  # {{ liquid_var | debug }}
24
22
  # -----------------------------------------------------------------------------
@@ -76,6 +74,11 @@ regenerate: true
76
74
 
77
75
  {% assign hideOnReload = modules.themer_options.hideOnReload %}
78
76
 
77
+ {% assign production = false %}
78
+ {% if environment == 'prod' or environment == 'production' %}
79
+ {% assign production = true %}
80
+ {% endif %}
81
+
79
82
  /*
80
83
  # -----------------------------------------------------------------------------
81
84
  # ~/assets/themes/j1/adapter/js/j1_template.js
@@ -101,6 +104,8 @@ regenerate: true
101
104
  // ESLint shimming
102
105
  // -----------------------------------------------------------------------------
103
106
  /* eslint indent: "off" */
107
+ /* eslint quotes: "off" */
108
+ /* eslint semi: "off" */
104
109
  // -----------------------------------------------------------------------------
105
110
  'use strict';
106
111
 
@@ -222,7 +227,8 @@ var j1 = (function () {
222
227
  return {
223
228
 
224
229
  // -------------------------------------------------------------------------
225
- // Initializer
230
+ // init()
231
+ // initializer
226
232
  // -------------------------------------------------------------------------
227
233
  init: function (options) {
228
234
 
@@ -230,11 +236,16 @@ var j1 = (function () {
230
236
  // global var (function)
231
237
  // -----------------------------------------------------------------------
232
238
  var logger = log4javascript.getLogger('j1.init');
233
- var url = new parseURL(window.location.href);
239
+ var url = new liteURL(window.location.href);
234
240
  var baseUrl = url.origin;
235
- var epoch = Math.floor(Date.now()/1000);
236
- var timestamp_now = moment.unix(epoch).format('YYYY-MM-DD HH:mm:ss');
241
+ // var epoch = Math.floor(Date.now()/1000);
242
+ // var timestamp_now = moment.unix(epoch).format('YYYY-MM-DD HH:mm:ss');
243
+ var date = new Date();
244
+ var timestamp_now = date.toISOString();
237
245
  var curr_state = 'started';
246
+ // var date = new Date();
247
+ // var my_timestamp = date.toISOString();
248
+
238
249
 
239
250
  // -----------------------------------------------------------------------
240
251
  // options loader
@@ -247,46 +258,27 @@ var j1 = (function () {
247
258
  options
248
259
  );
249
260
 
250
- // catch senseless detect url 404 errors (middleware /status)
251
- // See: https://stackoverflow.com/questions/4687235/jquery-get-or-post-to-catch-page-load-error-eg-404
252
- $.ajaxSetup({
253
- // called on `$.get()`, `$.post()`, `$.ajax()`
254
- statusCode : {
255
- // raised on response status code 404
256
- 404 : function (jqxhr, textStatus, errorThrown) {
257
- var interval_count = 0;
258
- var max_count = 10;
259
- var dependencies_met_logger = setInterval(function() {
260
- interval_count += 1;
261
- if ( j1.adapter.logger.getState() == 'finished' ) {
262
- var logger = log4javascript.getLogger('j1.init');
263
- clearInterval(dependencies_met_logger);
264
- if(jqxhr.responseText.indexOf('GET /status') > -1) {
265
- logger.info('no middleware found on url /status: ignored');
266
- logger.info('continue on mode: web');
267
- }
268
- if (interval_count > max_count) {
269
- logger.warn('dependency check failed for module: logger');
270
- logger.warn('continue on initializer unchecked');
271
- j1.adapter.navigator.init();
272
- }
273
- }
274
- }, 25);
275
- }
276
- }
277
- });
261
+ // -----------------------------------------------------------------------
262
+ // status settings
263
+ // save status into the adapter object for (later) global access
264
+ // -----------------------------------------------------------------------
265
+ j1['xhrDataState'] = {};
266
+ j1['xhrDOMState'] = {};
278
267
 
279
268
  // -----------------------------------------------------------------------
280
- // Session ON_CLOSE event
281
- // Update user STATE cookie|Remove user SESSION cookie on window CLOSE
282
- // See: https://stackoverflow.com/questions/3888902/detect-browser-or-tab-closing
269
+ // session ON_CLOSE event
270
+ // wrapup if ALL browser windows get closed. Update user STATE
271
+ // cookie on window CLOSE.
272
+ // see: https://stackoverflow.com/questions/3888902/detect-browser-or-tab-closing
283
273
  // -----------------------------------------------------------------------
284
274
  window.addEventListener('beforeunload', function (event) {
285
275
  var cookie_names = j1.getCookieNames();
286
276
  var cookie_user_state_name = cookie_names.user_state;
287
277
  var cookie_user_session_name = cookie_names.user_session;
288
- var epoch = Math.floor(Date.now()/1000);
289
- var timestamp_now = moment.unix(epoch).format('YYYY-MM-DD HH:mm:ss');
278
+ // var epoch = Math.floor(Date.now()/1000);
279
+ // var timestamp_now = moment.unix(epoch).format('YYYY-MM-DD HH:mm:ss');
280
+ var date = new Date();
281
+ var timestamp_now = date.toISOString();
290
282
  var user_state = j1.readCookie(cookie_user_state_name);
291
283
  var ep_status;
292
284
  var url;
@@ -303,7 +295,7 @@ var j1 = (function () {
303
295
  });
304
296
 
305
297
  // -----------------------------------------------------------------------
306
- // Initialize|Load (existing) user cookies
298
+ // initialize|load (existing) user cookies
307
299
  // -----------------------------------------------------------------------
308
300
  user_session.created = timestamp_now;
309
301
  user_session.timestamp = timestamp_now;
@@ -330,17 +322,20 @@ var j1 = (function () {
330
322
  expires: 365
331
323
  });
332
324
 
333
- // Detect middleware (mode 'app') and update user session cookie
325
+ // detect middleware (mode 'app') and update user session cookie
334
326
  // -----------------------------------------------------------------------
335
327
  // if (user_session.mode === 'na' || user_session.mode === 'app') {
336
328
  if (user_session.mode === 'na') {
337
- var url = new parseURL(window.location.href);
329
+ var url = new liteURL(window.location.href);
338
330
  var ep_status = baseUrl + '/status' + '?page=' + window.location.pathname;
339
331
  var detectTimeout = 50;
340
332
 
341
333
  baseUrl = url.origin;
342
334
 
343
- $.when ($.ajax(ep_status))
335
+ // see: https://stackoverflow.com/questions/3709597/wait-until-all-jquery-ajax-requests-are-done
336
+ $.when (
337
+ $.ajax(ep_status)
338
+ )
344
339
  .then(function(data) {
345
340
  var logger = log4javascript.getLogger('j1.init');
346
341
  user_session = j1.readCookie(cookie_names.user_session);
@@ -358,6 +353,31 @@ var j1 = (function () {
358
353
  });
359
354
  j1.setState(curr_state);
360
355
  logger.info('state: ' + j1.getState());
356
+
357
+
358
+
359
+
360
+ var dependencies_met_page_displayed = setInterval (function () {
361
+ if (j1.getState() == 'finished') {
362
+ if (j1.authEnabled()) {
363
+ if (user_session.authenticated === 'true') {
364
+ // set signout
365
+ logger.info('show signout icon');
366
+ $('#navLinkSignInOut').attr('data-target','#modalOmniSignOut');
367
+ $('#iconSignInOut').removeClass('mdi-login').addClass('mdi-logout');
368
+ } else {
369
+ // set signin
370
+ logger.info('show signin icon');
371
+ $('#navLinkSignInOut').attr('data-target','#modalOmniSignIn');
372
+ $('#iconSignInOut').removeClass('mdi-logout').addClass('mdi-login');
373
+ }
374
+ logger.info('authentication detected as: ' + user_session.authenticated);
375
+ $('#quickLinksSignInOutButton').css('display', 'block');
376
+
377
+ clearInterval(dependencies_met_page_displayed);
378
+ }
379
+ }
380
+ }, 25); // END dependencies_met_page_displayed
361
381
  })
362
382
  .catch(function(error) {
363
383
  // jadams, 2018-08-31: Why a hell a setTimeout is needed ???
@@ -378,153 +398,80 @@ var j1 = (function () {
378
398
  logger.info('state: ' + j1.getState());
379
399
  }, detectTimeout);
380
400
  });
381
- } else {
401
+ } else { // app mode
382
402
  state = 'started';
383
403
  logger.info('state: ' + state);
384
404
  logger.info('page is being initialized');
385
405
  }
386
406
 
387
- {% comment %} Deferred data loads
388
- See: https://stackoverflow.com/questions/3709597/wait-until-all-jquery-ajax-requests-are-done
389
- Load J1 Template data objects 'asychronously'
390
- -------------------------------------------------------------------------- {% endcomment %}
407
+ // jadams: for testing only
408
+ // display page
409
+ // $('#no_flicker').css('display', 'block');
391
410
 
392
- // -----------------------------------------------------------------------
393
- // data loader (should be rewitten to xhrData() )
394
- // -----------------------------------------------------------------------
395
- $.when (
396
- j1.getColorData(colors_data_path),
397
- j1.getFontSizeData(font_size_data_path),
398
- j1.getMessageCatalog(message_catalog_data_path))
399
- .done (function(colorData, fontSizes, messageCatalog, runtime) {
400
- j1.colors = colorData[0];
401
- j1.fonts = fontSizes[0];
402
-
403
- // set logger for callback|anonymous
404
- //
405
- var logger = log4javascript.getLogger('j1.init');
406
-
407
- logText = j1.getMessage('info', 'getState', 'text');
408
- logText = logText + j1.getMessage('info', 'getState', 'data_objects');
409
- logText = logText + j1.getMessage('info', 'getState', 'finished');
410
- j1.logger('j1.init', 'info', logText);
411
-
412
- logText = j1.getMessage('info', 'setState', 'text');
413
- logText = logText + j1.getMessage('info', 'setState', 'started');
414
- j1.logger('j1.init', 'info', logText);
415
- executeFunctionByName('j1.setState', window, state);
416
-
417
- // set logger for callback|anonymous
418
- var logger = log4javascript.getLogger('j1.init');
419
-
420
- if ( settings.scrollbar === 'false' ) {
421
- $('body').addClass('hide-scrollbar');
422
- $('html').addClass('hide-scrollbar-moz');
423
- }
411
+ state = 'started';
412
+ logger.info('state: ' + state);
413
+ logger.info('page is being initialized');
424
414
 
425
- logger.info('read user state from cookie');
426
- user_session = j1.readCookie(cookie_names.user_session);
415
+ if ( settings.scrollbar === 'false' ) {
416
+ $('body').addClass('hide-scrollbar');
417
+ $('html').addClass('hide-scrollbar-moz');
418
+ }
427
419
 
428
- // process|update UserState
429
- //
430
- themeName = user_session.theme_name;
431
- themeCss = user_session.theme_css;
432
- themeExtensionCss = user_session.theme_extension_css;
433
-
434
- // save last page access
435
- // See: https://stackoverflow.com/questions/3528324/how-to-get-the-previous-url-in-javascript
436
- // See: https://developer.mozilla.org/de/docs/Web/API/Window/history
437
- //
438
- user_session.timestamp = timestamp_now;
439
- referrer = new parseURL(document.referrer);
440
- current_page = window.location.pathname;
441
- user_session.requested_page = current_page;
442
- user_session.previous_page = referrer.search === '' ?
443
- (referrer.pathname === '' ? current_page : referrer.pathname) :
444
- (user_session.previous_page === '' || user_session.previous_page === 'na'
445
- ? '/'
446
- : user_session.previous_page
447
- );
448
-
449
- // calculate last 'pager' if any
450
- //
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
- }
420
+ logger.info('read user state from cookie');
421
+ user_session = j1.readCookie(cookie_names.user_session);
457
422
 
458
- logger.info('update user session cookie');
459
- j1.writeCookie({
460
- name: cookie_names.user_session,
461
- data: user_session
462
- });
423
+ // process|update user state cookie
424
+ themeName = user_session.theme_name;
425
+ themeCss = user_session.theme_css;
426
+ themeExtensionCss = user_session.theme_extension_css;
463
427
 
464
- // ---------------------------------------------------------------------
465
- // Initialize page resources for global modules (sequential asynchronous)
466
- // (should be rewitten to xhrData() )
467
- // ---------------------------------------------------------------------
468
- $.when (
469
- j1.initBanner(settings),
470
- j1.initPanel(settings),
471
- j1.initFooter(settings) )
472
- .then (function (initBanner_response, initPanel_response, initFooter_response) {
473
- var logger = log4javascript.getLogger('j1.init');
474
-
475
- // Wait for LAST thenable (footer) in chain finishes
476
- var footerLoaded = setInterval(function() {
477
- if ( j1.getState() == 'footer_loaded') {
478
- // clear interval checking
479
- clearInterval(footerLoaded);
480
- logger.info('loading data completed');
481
-
482
- // Continue to run initializers
483
- //
484
- state = j1.getMessage('info', 'setState', 'running');
485
- logText = j1.getMessage('info', 'setState', 'text');
486
- logText = logText + j1.getMessage('info', 'setState', 'running');
487
- j1.logger('j1.init', 'info', logText);
488
-
489
- user_session.timestamp = timestamp_now;
490
- j1.writeCookie({
491
- name: cookie_names.user_session,
492
- data: user_session
493
- });
428
+ // save last page access
429
+ // see: https://stackoverflow.com/questions/3528324/how-to-get-the-previous-url-in-javascript
430
+ // see: https://developer.mozilla.org/de/docs/Web/API/Window/history
431
+ //
432
+ user_session.timestamp = timestamp_now;
433
+ referrer = new liteURL(document.referrer);
434
+ current_page = window.location.pathname;
435
+ user_session.requested_page = current_page;
436
+ user_session.previous_page = referrer.search === '' ?
437
+ (referrer.pathname === '' ? current_page : referrer.pathname) :
438
+ (user_session.previous_page === '' || user_session.previous_page === 'na'
439
+ ? '/'
440
+ : user_session.previous_page
441
+ );
442
+
443
+ // calculate last 'pager' if any
444
+ if (rePager.test(user_session.previous_page)) {
445
+ last_pager = user_session.previous_page;
446
+ user_session.last_pager = last_pager;
447
+ } else {
448
+ last_pager = user_session.last_pager;
449
+ }
494
450
 
495
- // ---------------------------------------------------------------
496
- // Finalize|Display page (sequential asynchronous)
497
- // NOTE:
498
- // jadams 2019-01-20: for MDB, enabled only drawer, switch
499
- // and ripples
500
- // ---------------------------------------------------------------
501
- $.when (
502
- j1.initMDB(settings),
503
- j1.initClipboard(settings))
504
- .then (function () {
505
- j1.displayPage();
506
- })
507
- .catch(function(error) {
508
- var logger = log4javascript.getLogger('j1.init');
509
- json_data = JSON.stringify(error, undefined, 2);
510
- logText = 'deferred: ' + json_data;
511
- logger.error(logText);
512
- });
513
- }
514
- }, 25); // END 'footerLoaded'
515
- }) // END load global modules
516
- .catch(function(error) {
517
- var logger = log4javascript.getLogger('j1.init');
518
- json_data = JSON.stringify(error, undefined, 2);
519
- logText = 'deferred: ' + json_data;
520
- logger.error(logText);
521
- });
522
- }) // END load global data objects
523
- .catch(function(error) {
524
- var logger = log4javascript.getLogger('j1.init');
525
- json_data = JSON.stringify(error, undefined, 2);
526
- logText = 'deferred: ' + json_data;
527
- logger.error(logText);
451
+ // jadams: for testing only
452
+ // display page
453
+ //$('#no_flicker').css('display', 'block');
454
+
455
+ logger.info('update user session cookie');
456
+ j1.writeCookie({
457
+ name: cookie_names.user_session,
458
+ data: user_session
459
+ });
460
+
461
+ // initialize page resources for blocks
462
+ // (asynchronous, should be rewitten to xhrData)
463
+ j1.initBanner(settings);
464
+ j1.initPanel(settings);
465
+ j1.initFooter(settings);
466
+
467
+ state = 'running';
468
+ logger.info('state: ' + state);
469
+ logger.info(logText);
470
+
471
+ user_session.timestamp = timestamp_now;
472
+ j1.writeCookie({
473
+ name: cookie_names.user_session,
474
+ data: user_session
528
475
  });
529
476
 
530
477
  // -----------------------------------------------------------------------
@@ -532,17 +479,21 @@ var j1 = (function () {
532
479
  // -----------------------------------------------------------------------
533
480
  j1.core.bsFormClearButton();
534
481
 
482
+ // finalize and display page
483
+ j1.displayPage();
484
+
535
485
  }, // END init
536
486
 
537
487
  // -------------------------------------------------------------------------
538
- // initBanner
488
+ // initBanner()
539
489
  // AJAX fetcher to load and place all banner used for a page
540
490
  // -------------------------------------------------------------------------
541
491
  initBanner: function (options) {
542
- var logger = log4javascript.getLogger('j1.initBanner');
543
- var banner = [];
544
- var bannerOptions = [];
545
- var mod = 'j1';
492
+ var logger = log4javascript.getLogger('j1.initBanner');
493
+ var banner = [];
494
+ var bannerOptions = [];
495
+ var mod = 'j1';
496
+ var logText;
546
497
 
547
498
  {% comment %}
548
499
  Closure to pass additional data (e.g. #banner_id) to AJAX load callback
@@ -551,12 +502,19 @@ var j1 = (function () {
551
502
  var cb_load_closure = function(banner_id) {
552
503
  return function ( responseTxt, statusTxt, xhr ) {
553
504
  if ( statusTxt == 'success' ) {
505
+ var logger = log4javascript.getLogger('j1.xhrData');
554
506
  logText = 'loading banner completed on id: ' +banner_id;
507
+ $(banner_id).addClass("mutated");
555
508
  logger.info(logText);
509
+ j1.setXhrDataState(banner_id, statusTxt);
510
+ j1.setXhrDomState(banner_id, statusTxt);
511
+ logger.info('XHR data loaded in the DOM: ' + banner_id);
556
512
  }
557
513
  if ( statusTxt == 'error' ) {
558
514
  logText = 'loading banner failed on id: ' +banner_id+ ', error: ' + xhr.status + ': ' + xhr.statusText;
559
515
  logger.error(logText);
516
+ j1.setXhrDataState(banner_id, statusTxt);
517
+ j1.setXhrDomState(banner_id, statusTxt);
560
518
  // Set|Log status
561
519
  state = 'failed';
562
520
  logger.error('state: ' + state);
@@ -584,30 +542,14 @@ var j1 = (function () {
584
542
  {% assign key = item[0] %}
585
543
  {% assign value = item[1] %}
586
544
 
587
- {% if key and debug %} item:value {{key}}:{{value}} {% endif %}
545
+ {% if key and debug %} item:value {{key}}:{{value}} {% endif %}
588
546
 
589
547
  {% if key == 'id' %} {% assign id = value %} {% endif %}
590
548
  {% if key == 'enabled' %} {% assign enabled = value %} {% endif %}
591
- {% if key == 'background_color_1' %} {% assign background_color_1 = value %} {% endif %}
592
- {% if key == 'background_color_2' %} {% assign background_color_2 = value %} {% endif %}
593
549
  {% endfor %}
594
550
  {% endfor %}
595
551
 
596
552
  {% if id and enabled %}
597
- {% comment %} Add CSS styles for current banner to section <HEAD>
598
- -------------------------------------------------------------------- {% endcomment %}
599
- {% if background_color_1 and background_color_2 %}
600
- var banner_backround_style = '';
601
- // Initialze banner background gradient/colors
602
- banner_backround_style += '<style> .{{id}}-background { ';
603
- banner_backround_style += 'background-image: -webkit-gradient(linear, left top, left bottom, from( ' +j1.setColorData('{{background_color_1}}')+ ' ), to( ' +j1.setColorData('{{background_color_2}}')+ ' ));';
604
- banner_backround_style += 'background-image: -webkit-linear-gradient(top, ' +j1.setColorData('{{background_color_1}}')+ ' 0%, ' +j1.setColorData('{{background_color_2}}')+ ' 100%);';
605
- banner_backround_style += 'background-image: -o-linear-gradient(top, ' +j1.setColorData('{{background_color_1}}')+ ' 0%, ' +j1.setColorData('{{background_color_2}}')+ ' 100%);';
606
- banner_backround_style += 'background-image: linear-gradient(to bottom, ' +j1.setColorData('{{background_color_1}}')+' 0%, ' +j1.setColorData('{{background_color_2}}')+ ' 100%);';
607
- banner_backround_style += 'filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="' +j1.setColorData('{{background_color_1}}')+ '", endColorstr="' +j1.setColorData('{{background_color_2}}')+ '", GradientType=0);';
608
- banner_backround_style += '} </style>';
609
- $('head').append( banner_backround_style );
610
- {% endif %}
611
553
 
612
554
  {% comment %} Register current banner
613
555
  -------------------------------------------------------------------- {% endcomment %}
@@ -620,8 +562,6 @@ var j1 = (function () {
620
562
  ---------------------------------------------------------------------- {% endcomment %}
621
563
  {% assign id = nil %}
622
564
  {% assign enabled = nil %}
623
- {% assign background_color_1 = nil %}
624
- {% assign background_color_2 = nil %}
625
565
  {% assign banner_config = nil %}
626
566
 
627
567
  {% endfor %} {% comment %} END banner_config {% endcomment %}
@@ -641,39 +581,51 @@ var j1 = (function () {
641
581
  logText = 'loading banner on id: ' +banner[i];
642
582
  logger.info(logText);
643
583
  var banner_data_path = '{{banner_data_path}} ' + id + ' > *';
644
- selector.load( banner_data_path, cb_load_closure( id ) );
584
+ selector.load(banner_data_path, cb_load_closure(id));
645
585
  }
646
- }
586
+ } // END for
647
587
  } else {
648
588
  logText = 'no banner found in site';
649
589
  logger.info(logText);
590
+ return false;
650
591
  }
651
-
652
592
  return true;
653
593
  }, // END initBanner
654
594
 
655
595
  // -------------------------------------------------------------------------
656
- // initPanel
596
+ // initPanel()
657
597
  // AJAX fetcher to load and place all panel used for a page
658
598
  // -------------------------------------------------------------------------
659
599
  // ToDo:
660
600
  initPanel: function ( options ) {
661
- var logger = log4javascript.getLogger('j1.initPanel');
662
- var panel = [];
663
- var mod = 'j1';
601
+ var logger = log4javascript.getLogger('j1.initPanel');
602
+ var panel = [];
603
+ var mod = 'j1';
604
+ var logText;
664
605
 
665
606
  {% comment %} Closure to pass additional data (e.g. panel_id) to AJAX load callback
666
607
  See: http://stackoverflow.com/questions/939032/jquery-pass-more-parameters-into-callback
667
608
  -------------------------------------------------------------------------- {% endcomment %}
609
+
610
+ {% comment %} NOTE
611
+ strategy for MutationObserver callbacks to monitor DOM changes
612
+ needs to be checked if multiple containers are chenaged in a row
613
+ -------------------------------------------------------------------------- {% endcomment %}
668
614
  var cb_load_closure = function(panel_id) {
669
615
  return function ( responseTxt, statusTxt, xhr ) {
616
+ var logger = log4javascript.getLogger('j1.xhrData');
670
617
  if ( statusTxt == 'success' ) {
671
618
  logText = 'loading panel completed on id: ' +panel_id;
672
619
  logger.info(logText);
620
+ j1.setXhrDataState(panel_id, statusTxt);
621
+ j1.setXhrDomState(panel_id, statusTxt);
622
+ logger.info('XHR data loaded in the DOM: ' + panel_id);
673
623
  }
674
624
  if ( statusTxt == 'error' ) {
675
625
  logText = 'loading panel failed on id: ' +panel_id+ ', error ' + xhr.status + ': ' + xhr.statusText;
676
626
  logger.error(logText);
627
+ j1.setXhrDataState(panel_id, statusTxt);
628
+ j1.setXhrDomState(panel_id, statusTxt);
677
629
  // Set|Log status
678
630
  state = 'Error';
679
631
  logger.error('state: ' + state);
@@ -724,7 +676,7 @@ var j1 = (function () {
724
676
  {% endfor %} {% comment %} END panel_config {% endcomment %}
725
677
  {% endfor %} {% comment %} END panel_config_settings {% endcomment %}
726
678
 
727
- if ( panel.length ) {
679
+ if (panel.length) {
728
680
  for (var i in panel) {
729
681
  var id = '#' + panel[i];
730
682
  var selector = $(id);
@@ -732,37 +684,44 @@ var j1 = (function () {
732
684
  logText = 'loading panel on id: ' +panel[i];
733
685
  logger.info(logText);
734
686
  var panel_data_path = '{{panel_data_path}} ' + id + ' > *';
735
- selector.load( panel_data_path, cb_load_closure( id ) );
687
+ selector.load(panel_data_path, cb_load_closure(id));
736
688
  }
737
- }
689
+ } // END for
738
690
  } else {
739
691
  logText = 'no panel found in site';
740
692
  logger.info(logText);
693
+ return false;
741
694
  }
742
-
743
695
  return true;
744
696
  }, // END initPanel
745
697
 
746
698
  // -------------------------------------------------------------------------
747
- // initFooter
699
+ // initFooter()
748
700
  // AJAX fetcher to load and place the footer used for a page
749
701
  // -------------------------------------------------------------------------
750
702
  initFooter: function ( options ) {
751
- var logger = log4javascript.getLogger('j1.initFooter');
752
- var mod = 'j1';
703
+ var logger = log4javascript.getLogger('j1.initFooter');
704
+ var mod = 'j1';
705
+ var logText;
753
706
 
754
- logText = 'initialization started';
707
+ logText = 'loading footer started';
755
708
  logger.info(logText);
756
709
 
757
710
  var cb_load_closure = function(footer_id) {
758
711
  return function ( responseTxt, statusTxt, xhr ) {
712
+ var logger = log4javascript.getLogger('j1.xhrData');
759
713
  if ( statusTxt == 'success' ) {
760
714
  logText = 'footer loaded successfully on id: ' + footer_id;
761
715
  logger.info(logText);
716
+ $(footer_id).addClass("mutated");
717
+ j1.setXhrDataState(footer_id, statusTxt);
718
+ j1.setXhrDomState(footer_id, statusTxt);
719
+ logger.info('XHR data loaded in the DOM: ' + footer_id);
762
720
 
763
- state = 'footer_loaded';
764
- logger.info('set state for module ' + mod + ': ' + state);
765
- executeFunctionByName(mod + '.setState', window, state);
721
+ // jadams, 2020-07-21: intermediate state DISABLED
722
+ // state = 'footer_loaded';
723
+ // logger.info('set state for module ' + mod + ': ' + state);
724
+ // executeFunctionByName(mod + '.setState', window, state);
766
725
 
767
726
  logText = 'initialization finished';
768
727
  logger.info(logText);
@@ -770,6 +729,9 @@ var j1 = (function () {
770
729
  if ( statusTxt == 'error' ) {
771
730
  logText = 'loading footer failed on id: ' +footer_id+ ', error ' + xhr.status + ': ' + xhr.statusText;
772
731
  logger.error(logText);
732
+ j1.setXhrDataState(footer_id, statusTxt);
733
+ j1.setXhrDomState(footer_id, statusTxt);
734
+
773
735
  // Set|Log status
774
736
  state = 'failed';
775
737
  logger.error('state: ' + state);
@@ -783,73 +745,20 @@ var j1 = (function () {
783
745
  var selector = $(id);
784
746
  if ( selector.length ) {
785
747
  var footer_data_path = '{{footer_data_path}}';
786
- // var footer_data_path = '{{footer_data_path}}' + id + ' > *';
787
- selector.load( footer_data_path, cb_load_closure( id ) );
748
+ selector.load(footer_data_path, cb_load_closure(id));
749
+ } else {
750
+ logText = 'data not loaded';
751
+ logger.warn(logText);
752
+ j1.setXhrDataState(id, 'not loaded');
753
+ j1.setXhrDomState(id, 'pending');
754
+ return false;
788
755
  }
789
-
790
756
  return true;
791
757
  }, // END initFooter
792
758
 
793
- // -------------------------------------------------------------------------
794
- // initClipboard
795
- // Create copy-to-clipboard for all pages
796
- // -------------------------------------------------------------------------
797
- initClipboard: function ( options ) {
798
- var logger = log4javascript.getLogger('j1.initClipboard');
799
-
800
- logText = 'initialization started';
801
- logger.info(logText);
802
-
803
- // insert copy to clipboard button before all elements having a
804
- // class of ".highlight" assigned to (e.g. Asciidoc source blocks)
805
- $('.highlight').each(function () {
806
- // Check if no clipboard should be applied
807
- var isNoClip = $(this).closest('.noclip');
808
- if ( isNoClip.length == 0) {
809
- var btnHtml = '<div class="j1-clipboard"><span class="btn-clipboard j1-tooltip" data-toggle="tooltip" data-placement="left" title="Copy to clipboard">Copy</span></div>';
810
- var bumms = $(this).closest('.noclip');
811
- $(this).before(btnHtml);
812
- $('.btn-clipboard').tooltip();
813
- }
814
- });
815
- var clipboard = new Clipboard( '.btn-clipboard', {
816
- target: function target(trigger) {
817
- return trigger.parentNode.nextElementSibling;
818
- }
819
- });
820
-
821
- // Manage clipboard events
822
- clipboard.on('success', function (e) {
823
- $(e.trigger).attr('title', 'copied!').tooltip('_fixTitle').tooltip('show').attr('title', 'Copy to clipboard').tooltip('_fixTitle');
824
- var logger = log4javascript.getLogger('j1.initClipboard');
825
- var logText = 'initialization copy-to-clipboard sucessfull';
826
- logger.debug(logText);
827
- /* Cleanup clipped data for trailing numbers */
828
- var splitted = e.text.split('\n');
829
- var concat;
830
- var i;
831
- for (i=0; i<splitted.length; i++) {
832
- concat += splitted[i].replace(/^\s+\d+/, '');
833
- }
834
- e.clearSelection();
835
- });
836
- clipboard.on('error', function (e) {
837
- var fallbackMsg = /Mac/i.test(navigator.userAgent) ? 'press \u2318 to copy' : 'press ctrl-c to copy';
838
- logger = log4javascript.getLogger('j1.initClipboard');
839
- logText = 'initialization copy-to-clipboard failed, fallback used.';
840
- logger.warn(logText);
841
- $(e.trigger).attr('title', fallbackMsg).tooltip('_fixTitle').tooltip('show').attr('title', 'copy to clipboard').tooltip('_fixTitle');
842
- });
843
-
844
- logText = 'initialization finished';
845
- logger.info(logText);
846
-
847
- return true;
848
- }, // END initClipboard
849
-
850
759
  // -------------------------------------------------------------------------
851
760
  // displayPage
852
- // Show the page after timeout of {{hideOnReload}} ms
761
+ // show the page after timeout of {{flickerTimeout}} ms
853
762
  // -------------------------------------------------------------------------
854
763
  // NOTE:
855
764
  // jadams, 2019-08-21: for unknown reason, the user state data
@@ -860,24 +769,25 @@ var j1 = (function () {
860
769
  displayPage: function (options) {
861
770
  var logger = log4javascript.getLogger('j1.displayPage');
862
771
  var flickerTimeout = {{template_config.flicker_timeout}};
863
- var url = new parseURL(window.location.href);
772
+ var url = new liteURL(window.location.href);
864
773
  var baseUrl = url.origin;
865
774
  var ep_status = baseUrl + '/status' + '?page=' + window.location.pathname;
866
775
  var user_session = j1.readCookie(cookie_names.user_session);
867
776
  var user_state = j1.readCookie(cookie_names.user_state);
868
- var current_url = new parseURL(window.location.href);
777
+ var current_url = new liteURL(window.location.href);
869
778
  var providerPermissions = {};
870
779
  var provider;
871
780
  var previous_page;
872
781
  var appDetected;
873
782
  var categoryAllowed;
874
783
 
875
-
876
784
  logger.info('finalize page');
877
785
  j1.setCss();
878
786
 
879
- if (j1.appDetected()) {
880
- // APP mode
787
+ logText= 'loading page partials: started';
788
+ logger.info(logText);
789
+
790
+ if (j1.appDetected()) { // app mode
881
791
  logger.info('mode detected: app');
882
792
 
883
793
  $.when ($.ajax(ep_status))
@@ -895,13 +805,14 @@ var j1 = (function () {
895
805
  providerPermissions = user_session.provider_permissions;
896
806
  categoryAllowed = providerPermissions.includes(user_session.page_permission);
897
807
 
898
- // Make sure that protected pages are ALWAYS checked for permissions
808
+ // check protected pages (applies for APP only)
809
+ // make sure that protected pages are ALWAYS checked for permissions
899
810
  // -------------------------------------------------------------------
900
811
  if (
901
812
  j1.authEnabled() &&
902
813
  user_session.page_permission !== 'public' &&
903
- categoryAllowed === false)
904
- {
814
+ categoryAllowed === false
815
+ ){
905
816
  // redirect to middleware|page_authentication
906
817
  if (data.authenticated === 'true') {
907
818
  var ep_post_authentication = baseUrl + '/post_authentication';
@@ -913,20 +824,21 @@ var j1 = (function () {
913
824
  }
914
825
  } // END check protected pages
915
826
 
827
+ // show the page delayed
916
828
  setTimeout (function() {
917
- // Display page
829
+ // display page
918
830
  $('#no_flicker').css('display', 'block');
919
831
 
920
- // show|hide cookie icon
832
+ // show|hide cookie icon (should MOVED to Cookiebar ???)
921
833
  if (user_state.cookies_accepted === 'accepted') {
922
- // show cookie icon
834
+ // Display cookie icon
923
835
  logText = 'show cookie icon';
924
836
  logger.info(logText);
925
837
  $('#quickLinksCookieButton').css('display', 'block');
926
838
  } else {
927
839
  logText = 'hide cookie icon';
928
840
  logger.info(logText);
929
- // hide cookie icon
841
+ // Display cookie icon
930
842
  $('#quickLinksCookieButton').css('display', 'none');
931
843
  }
932
844
 
@@ -938,9 +850,8 @@ var j1 = (function () {
938
850
  }
939
851
 
940
852
  // show cc icon
941
- $('#quickLinksControlCenterButton').css('display', 'block');
853
+ // $('#quickLinksControlCenterButton').css('display', 'block');
942
854
 
943
- // show|hide signin|out icon
944
855
  if (j1.authEnabled()) {
945
856
  if (user_session.authenticated === 'true') {
946
857
  // set signout
@@ -957,7 +868,7 @@ var j1 = (function () {
957
868
  $('#quickLinksSignInOutButton').css('display', 'block');
958
869
  }
959
870
 
960
- // If the page requested contains an anchor element,
871
+ // if the page requested contains an anchor element,
961
872
  // do a smooth scroll to
962
873
  j1.scrollTo();
963
874
 
@@ -970,7 +881,7 @@ var j1 = (function () {
970
881
  logger.info(logText);
971
882
  }
972
883
 
973
- // update sidebar for changed consent|theme data
884
+ // update sidebar for changed theme data
974
885
  logger.info('update sidebar');
975
886
  user_state = j1.readCookie(cookie_names.user_state);
976
887
  current_user_data = j1.mergeData(user_session, user_state);
@@ -984,99 +895,85 @@ var j1 = (function () {
984
895
  logger.info(logText);
985
896
 
986
897
  }, flickerTimeout);
987
- });
988
- // END APP mode
989
- } else {
990
- // web mode
898
+ }); // END APP mode
899
+ } else { // web mode
900
+ // show the page delayed
991
901
  setTimeout (function() {
992
- // Display page
902
+ j1.setState('finished');
903
+ logger.info('state: finished');
904
+ logger.info('page initialization: finished');
905
+
906
+ // display page
993
907
  $('#no_flicker').css('display', 'block');
994
- logger.info('mode detected: web');
995
- logger.info('hide signin icon');
996
- $('#quickLinksSignInOutButton').css('display', 'none');
908
+ logger.info('mode detected: web');
909
+ logger.info('hide signin icon');
910
+ $('#quickLinksSignInOutButton').css('display', 'none');
997
911
 
998
- user_session.current_page = current_url.pathname;
999
- j1.writeCookie({
912
+ user_session.current_page = current_url.pathname;
913
+ j1.writeCookie({
1000
914
  name: cookie_names.user_session,
1001
915
  data: user_session
1002
- });
1003
-
1004
- // show|hide translator icon
1005
- if (translation_enabled) {
1006
- logger.info('translator detected: google');
1007
- logger.info('initialize language selector');
1008
- $('.goog-te-combo').addClass('form-control');
1009
- }
1010
-
1011
- // show|hide cookie icon
1012
- if (user_state.cookies_accepted === 'accepted') {
1013
- // Display cookie icon
1014
- logText = 'show cookie icon';
1015
- logger.info(logText);
1016
- $('#quickLinksCookieButton').css('display', 'block');
1017
- } else {
1018
- logText = 'hide cookie icon';
1019
- logger.info(logText);
1020
- // Display cookie icon
1021
- $('#quickLinksCookieButton').css('display', 'none');
1022
- }
1023
-
1024
- // If the page requested contains an anchor element,
1025
- // do a smooth scroll to
1026
- j1.scrollTo();
1027
-
1028
- if (user_session.previous_page !== user_session.current_page) {
1029
- logText = 'page change detected';
1030
- logger.info(logText);
1031
- logText = 'previous page: ' + user_session.previous_page;
1032
- logger.info(logText);
1033
- logText = 'current page: ' + user_session.current_page;
1034
- logger.info(logText);
1035
- }
916
+ });
1036
917
 
1037
- // update sidebar for changed consent|theme data
1038
- logger.info('update sidebar');
1039
- user_state = j1.readCookie(cookie_names.user_state);
1040
- current_user_data = j1.mergeData(user_session, user_state);
1041
- j1.core.navigator.updateSidebar(current_user_data);
918
+ // show|hide translator icon
919
+ if (translation_enabled) {
920
+ logger.info('translator detected: google');
921
+ logger.info('initialize language selector');
922
+ $('.goog-te-combo').addClass('form-control');
923
+ }
1042
924
 
1043
- // Set|Log status
1044
- state = 'finished';
1045
- logText = 'state: ' + state;
925
+ // show|hide cookie icon (should MOVED to Cookiebar ???)
926
+ if (user_state.cookies_accepted === 'accepted') {
927
+ // Display cookie icon
928
+ logText = 'show cookie icon';
1046
929
  logger.info(logText);
1047
- logText = 'page finalized successfully';
930
+ $('#quickLinksCookieButton').css('display', 'block');
931
+ } else {
932
+ logText = 'hide cookie icon';
1048
933
  logger.info(logText);
934
+ // Display cookie icon
935
+ $('#quickLinksCookieButton').css('display', 'none');
936
+ }
1049
937
 
1050
- }, flickerTimeout);
1051
- } // END WEB mode
1052
- }, // END displayPage
938
+ // If the page requested contains an anchor element,
939
+ // do a smooth scroll to
940
+ j1.scrollTo();
1053
941
 
1054
- // -------------------------------------------------------------------------
1055
- // Initialize BS Material Design
1056
- // -------------------------------------------------------------------------
1057
- // ToDo:
1058
- initMDB: function (options) {
1059
- var logger;
942
+ if (user_session.previous_page !== user_session.current_page) {
943
+ logText = 'page change detected';
944
+ logger.info(logText);
945
+ logText = 'previous page: ' + user_session.previous_page;
946
+ logger.info(logText);
947
+ logText = 'current page: ' + user_session.current_page;
948
+ logger.info(logText);
949
+ }
1060
950
 
1061
- logger = log4javascript.getLogger('j1.initMDB');
1062
- logText = 'material design is being started';
1063
- logger.info(logText);
951
+ // update sidebar for changed theme data
952
+ logger.info('update sidebar');
953
+ user_state = j1.readCookie(cookie_names.user_state);
954
+ current_user_data = j1.mergeData(user_session, user_state);
955
+ j1.core.navigator.updateSidebar(current_user_data);
1064
956
 
1065
- $('body').bootstrapMaterialDesign();
1066
- //new WOW().init();
957
+ // set|log status
958
+ state = 'finished';
959
+ logText = 'state: ' + state;
960
+ logger.info(logText);
961
+ logText = 'page finalized successfully';
962
+ logger.info(logText);
1067
963
 
1068
- var logText = 'initializing material design finished';
1069
- logger.info(logText);
1070
- }, // END initMDB
964
+ }, flickerTimeout);
965
+ } // END WEB mode
966
+ }, // END displayPage
1071
967
 
1072
968
  // -------------------------------------------------------------------------
1073
969
  // Helper functions
1074
970
  // -------------------------------------------------------------------------
1075
971
 
1076
972
  // -------------------------------------------------------------------------
1077
- // Merge two objects (properties) and returns the resulting object
1078
- // TODO: Improve comment, give synopsis and example
1079
- // See: https://stackoverflow.com/questions/43109229/merge-default-options-containing-object-with-json-object
973
+ // mergeData()
974
+ // merge two objects (properties) and returns the resulting object
975
+ // see: https://stackoverflow.com/questions/43109229/merge-default-options-containing-object-with-json-object
976
+ // TODO: Improve comment, give synopsis and example
1080
977
  // -------------------------------------------------------------------------
1081
978
  mergeData: function () {
1082
979
  var a = [].slice.call(arguments), o = a.shift();
@@ -1090,29 +987,33 @@ var j1 = (function () {
1090
987
  }, // END mergeData
1091
988
 
1092
989
  // -------------------------------------------------------------------------
1093
- // returns the last vistited page
990
+ // getPrevPage()
991
+ // Returns the last vistited page
1094
992
  // -------------------------------------------------------------------------
1095
993
  getPrevPage: function () {
1096
994
  return previous_page;
1097
995
  }, // END getPrevPage
1098
996
 
1099
997
  // -------------------------------------------------------------------------
1100
- // returns the preferred language taken form window.navigator
1101
- // See:
1102
- // https://stackoverflow.com/questions/1043339/javascript-for-detecting-browser-language-preference
998
+ // getLanguage()
999
+ // Returns the preferred language taken form window.navigator
1000
+ // See:
1001
+ // https://stackoverflow.com/questions/1043339/javascript-for-detecting-browser-language-preference
1103
1002
  // -------------------------------------------------------------------------
1104
1003
  getLanguage: function () {
1105
1004
  var language = navigator.languages ? navigator.languages[0] : (navigator.language || navigator.userLanguage);
1106
1005
  }, // END getLanguage
1107
1006
 
1108
1007
  // -------------------------------------------------------------------------
1109
- // returns the template version taken from site config (_config.yml)
1008
+ // getTemplateVersion()
1009
+ // Returns the template version taken from site config (_config.yml)
1110
1010
  // -------------------------------------------------------------------------
1111
1011
  getTemplateVersion: function () {
1112
1012
  return '{{template_version}}';
1113
1013
  }, // END getTemplateVersion
1114
1014
 
1115
1015
  // -------------------------------------------------------------------------
1016
+ // scrollTo()
1116
1017
  // Scrolls smooth to any anchor referenced by an page URL on
1117
1018
  // e.g. a page reload. Values for delay|offset are taken from
1118
1019
  // TOCCER module
@@ -1143,7 +1044,7 @@ var j1 = (function () {
1143
1044
  }, // END scrollTo
1144
1045
 
1145
1046
  // -------------------------------------------------------------------------
1146
- // authEnabled:
1047
+ // authEnabled()
1147
1048
  // Returns the state of the authentication module
1148
1049
  // -------------------------------------------------------------------------
1149
1050
  authEnabled: function () {
@@ -1154,7 +1055,7 @@ var j1 = (function () {
1154
1055
  }, // END authEnabled
1155
1056
 
1156
1057
  // -------------------------------------------------------------------------
1157
- // appDetected:
1058
+ // appDetected()
1158
1059
  // Returns true if a web session cookie exists
1159
1060
  // -------------------------------------------------------------------------
1160
1061
  appDetected: function () {
@@ -1173,280 +1074,102 @@ var j1 = (function () {
1173
1074
  }, // END appDetected
1174
1075
 
1175
1076
  // -------------------------------------------------------------------------
1176
- // xhrData:
1177
- // Load data asychronously using XHR on a DIV container
1178
- // specified (from options: xhr_data_path)
1077
+ // xhrData()
1078
+ // Load data asychronously using XHR|jQuery on an HTML element (e.g. <div>)
1079
+ // specified by xhr_container_id, xhr_data_path (options)
1179
1080
  // -------------------------------------------------------------------------
1180
- xhrData: function (mod, options, status) {
1181
- var logger = log4javascript.getLogger('j1.xhrData');
1182
- var state = status;
1081
+ xhrData: function (options, mod, status) {
1082
+ var logger = log4javascript.getLogger('j1.xhrData');
1083
+ var selector = $('#' + options.xhr_container_id);
1084
+ var state = status;
1085
+ var observer_options = {
1086
+ attributes: false,
1087
+ childList: true,
1088
+ characterData: false,
1089
+ subtree: true
1090
+ };
1091
+ var observer;
1183
1092
  var logText;
1184
1093
 
1185
1094
  var cb_load_closure = function(mod, id) {
1186
1095
  return function (responseTxt, statusTxt, xhr) {
1096
+ var logger = log4javascript.getLogger('j1.xhrData');
1187
1097
  if ( statusTxt === 'success' ) {
1188
- if (state) {
1189
- logger.info('set state for ' +mod+ ' to: ' + state);
1190
- executeFunctionByName(mod + '.setState', window, state);
1191
- }
1098
+ // jadams, 2020-07-21: intermediate state should DISABLED
1099
+ // if (state) {
1100
+ // logger.info('set state for ' +mod+ ' to: ' + state);
1101
+ // executeFunctionByName(mod + '.setState', window, state);
1102
+ // }
1103
+ j1.setXhrDataState(id, statusTxt);
1104
+ j1.setXhrDomState(id, 'pending');
1105
+
1192
1106
  logText = 'data loaded successfully on id: ' +id;
1193
1107
  logger.info(logText);
1108
+ state = true;
1194
1109
  }
1195
1110
  if ( statusTxt === 'error' ) {
1196
- state = 'failed';
1197
- logger.info('set state for ' +mod+ ' to: ' + state);
1198
- executeFunctionByName(mod + '.setState', window, state);
1199
- logText = 'loading data failed on id: ' +id+ ', error ' + xhr.status + ': ' + xhr.statusText;
1200
- logger.error(logText);
1111
+ // jadams, 2020-07-21: to be checked why id could be UNDEFINED
1112
+ if (typeof(id) != "undefined") {
1113
+ state = 'failed';
1114
+ logger.info('set state for ' +mod+ ' to: ' + state);
1115
+ // jadams, 2020-07-21: intermediate state should DISABLED
1116
+ // executeFunctionByName(mod + '.setState', window, state);
1117
+ j1.setXhrDataState(id, statusTxt);
1118
+ j1.setXhrDomState(id, 'pending');
1119
+ logText = 'loading data failed on id: ' +id+ ', error ' + xhr.status + ': ' + xhr.statusText;
1120
+ logger.error(logText);
1121
+ state = false;
1122
+ }
1201
1123
  }
1202
1124
  };
1203
1125
  };
1204
-
1126
+ // see: https://stackoverflow.com/questions/20420577/detect-added-element-to-dom-with-mutation-observer
1205
1127
  var id = '#' + options.xhr_container_id;
1206
- var selector = $(id);
1207
-
1208
- if ( selector.length ) {
1209
- var modal_html_data_path = options.xhr_data_path + ' > *';
1210
- selector.load( modal_html_data_path, cb_load_closure( mod, id ) );
1211
- return true;
1212
- } else {
1213
- logText = 'data not loaded';
1214
- logger.warn(logText);
1215
- // Set processing state to 'finished' to complete module load
1216
- state = 'finished';
1217
- logger.info('state: ' + state);
1218
- executeFunctionByName(mod + '.setState', window, state);
1219
- return false;
1220
- }
1221
- }, // END xhrData
1222
-
1223
- // -------------------------------------------------------------------------
1224
- // xhrApi: XMLHttpRequest (XHR) based async server API request
1225
- // Request an REST API at 'url', using verb 'type' of response type 'type'
1226
- // -------------------------------------------------------------------------
1227
- xhrApi: function (url, request_type, data_type) {
1228
- var logger = log4javascript.getLogger('j1.xhrApi');
1229
- var type = typeof request_type == 'undefined' || request_type == '' ? 'GET' : request_type;
1230
- var data_type = typeof data_type == 'undefined' || data_type == '' ? 'json' : data_type;
1231
-
1232
- return $.ajax({
1233
- url: url,
1234
- type: type,
1235
- dataType: data_type,
1236
- success: function(data) {
1237
- if (typeof data == 'string') {
1238
- return JSON.parse(data);
1239
- }
1240
- if (typeof data == 'object') {
1241
- return data;
1242
- }
1243
- },
1244
- error: function(error) {
1245
- logger.error('xhr request failed: ' + error.statusText);
1246
- }
1247
- });
1248
-
1249
- }, // END xhrApi
1250
-
1251
- // -------------------------------------------------------------------------
1252
- // getRuntimeData: Returns the j1_runtime data object
1253
- //
1254
- // -------------------------------------------------------------------------
1255
- getRuntimeData: function (data_path) {
1256
- var logger = log4javascript.getLogger('j1.getRuntimeData');
1257
- var logText;
1258
-
1259
- return $.ajax({
1260
- url: data_path,
1261
- success: function (contents) {
1262
- logText = 'data loaded successfully';
1263
- logger.info(logText);
1264
- state = 'runtime_data_loaded_success';
1265
- logger.info('state: ' + state);
1266
- executeFunctionByName('j1.setState', window, state);
1267
- },
1268
- error: function (err) {
1269
- logText = 'runtime data not loaded: ' + err;
1270
- logger.warn(logText);
1271
- state = 'runtime_data_loaded_failed';
1272
- logger.info('state: ' + state);
1273
- executeFunctionByName('j1.setState', window, state);
1274
- return false;
1275
- }
1276
- });
1277
-
1278
- }, // END getRuntimeData
1279
-
1280
- // -------------------------------------------------------------------------
1281
- // getColorData: Returns the j1_colors object
1282
- // Load color definitions from colors_data_path
1283
- // -------------------------------------------------------------------------
1284
- getColorData: function (data_path) {
1285
- var logger = log4javascript.getLogger('j1.getColorData');
1286
- var j1_colors = {};
1287
-
1288
- return $.ajax({
1289
- url: data_path,
1290
- success: function (data) {
1291
- var logText = 'color data loaded successfully';
1292
- logger.info(logText);
1293
- state = 'color_data_loaded_success';
1294
- logger.info('state: ' + state);
1295
- executeFunctionByName('j1.setState', window, state);
1296
-
1297
- if (typeof data == 'string') {
1298
- j1_colors = JSON.parse(data);
1299
- }
1300
- if (typeof data == 'object') {
1301
- j1_colors = data;
1302
- }
1303
- },
1304
- error: function (data) {
1305
- var logText = 'color data not loaded';
1306
- logger.warn(logText);
1307
- state = 'color_data_loaded_failed';
1308
- logger.info('state: ' + state);
1309
- executeFunctionByName('j1.setState', window, state);
1310
- return false;
1311
- }
1312
- });
1313
-
1314
- }, // END getColorData
1315
-
1316
- // -------------------------------------------------------------------------
1317
- // setColorData:
1318
- //
1319
- // -------------------------------------------------------------------------
1320
- setColorData: function (color) {
1321
-
1322
- if ( typeof color != 'undefined' ) {
1323
- var reHex = /^#[A-Fa-f0-9]+$/;
1324
- var reRGBA = /^rgba/;
1325
- var isHex = color.match(reHex);
1326
- var isRGBA = color.match(reRGBA);
1327
-
1328
- if ( typeof j1.colors[color] != 'undefined' ) {
1329
- return j1.colors[color];
1330
- } else if (isHex) {
1331
- return color;
1332
- } else if (isRGBA) {
1333
- return color;
1334
- } else {
1335
- return false;
1128
+ var $selector = $(id);
1129
+ if ( $selector.length ) {
1130
+ var html_data_path = options.xhr_data_path + ' > *';
1131
+ $selector.load( html_data_path, cb_load_closure( mod, id ) );
1132
+
1133
+ var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
1134
+ var xhrObserver = new MutationObserver (mutationHandler);
1135
+ var obsConfig = {
1136
+ childList: true,
1137
+ characterData: false,
1138
+ attributes: false,
1139
+ subtree: false };
1140
+
1141
+ selector.each(function(){
1142
+ xhrObserver.observe(this, obsConfig);
1143
+ } );
1144
+
1145
+ function mutationHandler (mutationRecords) {
1146
+ mutationRecords.forEach ( function (mutation) {
1147
+ if (mutation.addedNodes.length) {
1148
+ logger.info('XHR data loaded in the DOM: ' + id);
1149
+ j1.setXhrDomState(id, 'success');
1150
+ }
1151
+ });
1336
1152
  }
1337
1153
  } else {
1338
- return false;
1339
- }
1340
-
1341
- }, // END setColorData
1342
-
1343
- // -------------------------------------------------------------------------
1344
- // getFontSizeData: Returns the j1_font_sizes object
1345
- // Load loadFontSize definitions from font_size_data_path
1346
- // -------------------------------------------------------------------------
1347
- getFontSizeData: function (data_path) {
1348
- var logger = log4javascript.getLogger('j1.getFontSizeData');
1349
- var j1_font_sizes = {};
1350
-
1351
- return $.ajax({
1352
- url: data_path,
1353
- success: function (data) {
1354
- var logText = 'font size data loaded successfully';
1355
- logger.info(logText);
1356
- state = 'fontsize_data_loaded_success';
1357
- logger.info('state: ' + state);
1358
- executeFunctionByName('j1.setState', window, state);
1359
-
1360
- if (typeof data == 'string') {
1361
- j1_font_sizes = JSON.parse(data);
1362
- }
1363
- if (typeof data == 'object') {
1364
- j1_font_sizes = data;
1365
- }
1366
- },
1367
- error: function (data) {
1368
- var logText = 'font size data not loaded';
1154
+ // jadams, 2020-07-21: To be clarified why a id is "undefined"
1155
+ if (id != '#undefined') {
1156
+ logText = 'data not loaded on id:' + id;
1369
1157
  logger.warn(logText);
1370
- state = 'fontsize_data_loaded_failed';
1158
+ j1.setXhrDataState(id, 'not loaded');
1159
+ j1.setXhrDomState(id, 'not loaded');
1160
+ // Set processing state to 'finished' to complete module load
1161
+ state = 'finished';
1371
1162
  logger.info('state: ' + state);
1372
- executeFunctionByName('j1.setState', window, state);
1373
- return false;
1374
- }
1375
- });
1376
-
1377
- }, // END getFontSizeData
1378
-
1379
- // -------------------------------------------------------------------------
1380
- // getFontSize: Returns the CSS value for a 'logical' fontsize
1381
- // out of the j1_font_sizes object
1382
- // -------------------------------------------------------------------------
1383
- setFontSize: function (size) {
1384
-
1385
- if ( typeof size != 'undefined' ) {
1386
- var reCSS = /\bpx\b|\brem\b|\bem\b|\%|\binherit\b|\binitial\b|\bunset\b/;
1387
- var isCSS = size.match(reCSS);
1388
-
1389
- if ( typeof j1.fonts[size] != 'undefined' ) {
1390
- return j1.fonts[size];
1391
- } else if (isCSS) {
1392
- return size;
1393
- } else {
1394
- return false;
1163
+ // jadams, 2020-07-21: intermediate state should DISABLED
1164
+ // executeFunctionByName(mod + '.setState', window, state);
1165
+ state = false;
1395
1166
  }
1396
- } else {
1397
- return false;
1398
1167
  }
1399
-
1400
- }, // END getFontSize
1401
-
1402
- // -------------------------------------------------------------------------
1403
- // loadMessageCatalog
1404
- // Loads the message catalog object
1405
- // -------------------------------------------------------------------------
1406
- getMessageCatalog: function (data_path /*, request_type, data_type*/) {
1407
- var logger = log4javascript.getLogger('j1.loadMessageCatalog');
1408
- var message_catalog = {};
1409
- var type = typeof request_type == 'undefined' || request_type == '' ? 'GET' : request_type;
1410
- var data_type = typeof data_type == 'undefined' || data_type == '' ? 'text' : data_type;
1411
- var messageData;
1412
- var logBase;
1413
- var logText;
1414
- var property;
1415
-
1416
- return $.ajax({
1417
- url: data_path,
1418
- type: type,
1419
- dataType: data_type,
1420
- success: function (data) {
1421
- messageData = yaml.safeLoad(data);
1422
- for (property in messageData) {
1423
- if (messageData.hasOwnProperty(property)) {
1424
- message_catalog[property] = {};
1425
- messageData[property].forEach((element) => {
1426
- var key = Object.keys(element)[0];
1427
- var value = element[Object.keys(element)[0]];
1428
- message_catalog[property][key] = value;
1429
- });
1430
- }
1431
- }
1432
- j1.messages = message_catalog;
1433
- logBase = message_catalog.info.getData.message;
1434
- logText = logBase.text + logBase.message_catalog + logBase.finished;
1435
- logger.info(logText);
1436
- },
1437
- error: function(data) {
1438
- var json_data = JSON.stringify(data, undefined, 2);
1439
- logBase = message_catalog.error.getData.message;
1440
- logText = logBase.text + logBase.xhr + ': ' + json_data;
1441
- logger.error(logText);
1442
- }
1443
- });
1444
-
1445
- }, // END getMessageCatalog
1168
+ return state;
1169
+ }, // END xhrData
1446
1170
 
1447
1171
  // -------------------------------------------------------------------------
1448
- // readCookie:
1449
- //
1172
+ // readCookie()
1450
1173
  // -------------------------------------------------------------------------
1451
1174
  readCookie: function (name) {
1452
1175
  var data;
@@ -1468,7 +1191,7 @@ var j1 = (function () {
1468
1191
  }, // END readCookie
1469
1192
 
1470
1193
  // -------------------------------------------------------------------------
1471
- // writeCookie:
1194
+ // writeCookie()
1472
1195
  // Write 'data' to a cookie 'name'. If not exists, the cookie gets
1473
1196
  // created. Returns 'true' if cookie was written, otherwise 'false'.
1474
1197
  //
@@ -1482,18 +1205,21 @@ var j1 = (function () {
1482
1205
  };
1483
1206
  var settings = $.extend(defaults, options);
1484
1207
 
1485
- var epoch = Math.floor(Date.now()/1000);
1486
- var timestamp = moment.unix(epoch).format('YYYY-MM-DD hh:mm:ss');
1208
+ // var epoch = Math.floor(Date.now()/1000);
1209
+ // var timestamp_now = moment.unix(epoch).format('YYYY-MM-DD HH:mm:ss');
1210
+ var date = new Date();
1211
+ var timestamp_now = date.toISOString();
1487
1212
  var cookie_data = {};
1488
1213
  var data_json;
1489
1214
  var data_encoded;
1490
1215
 
1491
1216
  if (j1.existsCookie(settings.name)) {
1492
- cookie_data = j1.readCookie(settings.name);
1493
- cookie_data.timestamp = timestamp;
1494
- cookie_data = j1.mergeData(cookie_data, settings.data);
1495
- data_json = JSON.stringify( cookie_data );
1496
- data_encoded = window.btoa(data_json);
1217
+ cookie_data = j1.readCookie(settings.name);
1218
+ cookie_data.timestamp = timestamp_now;
1219
+ cookie_data = j1.mergeData(cookie_data, settings.data);
1220
+ data_json = JSON.stringify( cookie_data );
1221
+ data_encoded = window.btoa(data_json);
1222
+
1497
1223
  if (settings.expires > 0) {
1498
1224
  Cookies.set(settings.name, data_encoded, { expires: settings.expires });
1499
1225
  } else {
@@ -1616,63 +1342,68 @@ var j1 = (function () {
1616
1342
  resolveMacros: function (user_data) {
1617
1343
  var logger = log4javascript.getLogger('j1.resolveMacros');
1618
1344
 
1619
- if (Object.keys(user_data).length) {
1620
- $('[id^=macro-]').each(function() {
1621
-
1622
- $('#macro-provider').each(function() {
1623
- var $this = $(this);
1624
- var $html = $this.html();
1625
- $this.html($html.replace('??provider', user_data.provider));
1626
- this.href = this.href.replace(/.*\/??provider-site-url/, user_data.provider_site_url);
1627
- });
1628
- $('#macro-user-name').each(function() {
1629
- var $this = $(this);
1630
- var $html = $this.html();
1631
- $this.html($html.replace('??user-name', user_data.user_name));
1632
- this.href = this.href.replace(/.*\/??provider_member_url/, user_data.provider_member_url);
1633
- });
1634
- $('#macro-provider-permissions').each(function() {
1635
- var $this = $(this);
1636
- var $html = $this.html();
1637
- $this.html($html.replace('??provider-permissions', user_data.provider_permissions));
1638
- this.href = this.href.replace(/.*\/??provider_member_url/, user_data.provider_member_url);
1639
- });
1640
- $('#macro-provider-membership').each(function() {
1641
- var $this = $(this);
1642
- var $html = $this.html();
1643
- $this.html($html.replace('??provider-membership', user_data.provider_membership));
1644
- this.href = this.href.replace(/.*\/??provider_member_url/, user_data.provider_member_url);
1645
- });
1646
- $('#macro-cookie-state').each(function() {
1647
- var $this = $(this);
1648
- var $html = $this.html();
1649
- $this.html($html.replace('??cookie-state', user_data.cookies_accepted));
1650
- this.href = this.href.replace(/.*\/??provider_privacy_url/, user_data.provider_privacy_url);
1651
- });
1652
- $('#macro-theme-name').each(function() {
1653
- var $this = $(this);
1654
- var $html = $this.html();
1655
- $this.html($html.replace('??theme-name', user_data.theme_name));
1656
- });
1657
- $('#macro-theme-author').each(function() {
1658
- var $this = $(this);
1659
- var $html = $this.html();
1660
- $this.html($html.replace('??theme-author', user_data.theme_author));
1661
- this.href = this.href.replace(/.*\/??theme-author-url/, user_data.theme_author_url);
1662
- });
1663
- $('#macro-theme-version').each(function() {
1664
- var $this = $(this);
1665
- var $html = $this.html();
1666
- $this.html($html.replace('??theme-version', user_data.theme_version));
1667
- });
1345
+ var sidebarLoaded = setInterval(function() {
1346
+ if ($('#sidebar_mmenu').length) {
1347
+ if (Object.keys(user_data).length) {
1348
+ $('[id^=macro-]').each(function() {
1668
1349
 
1669
- });
1670
- return true;
1671
- } else {
1672
- logger.error('no user data provided');
1673
- return false;
1674
- }
1350
+ $('#macro-provider').each(function() {
1351
+ var $this = $(this);
1352
+ var $html = $this.html();
1353
+ $this.html($html.replace('??provider', user_data.provider));
1354
+ this.href = this.href.replace(/.*\/??provider-site-url/, user_data.provider_site_url);
1355
+ });
1356
+ $('#macro-user-name').each(function() {
1357
+ var $this = $(this);
1358
+ var $html = $this.html();
1359
+ $this.html($html.replace('??user-name', user_data.user_name));
1360
+ this.href = this.href.replace(/.*\/??provider_member_url/, user_data.provider_member_url);
1361
+ });
1362
+ $('#macro-provider-permissions').each(function() {
1363
+ var $this = $(this);
1364
+ var $html = $this.html();
1365
+ $this.html($html.replace('??provider-permissions', user_data.provider_permissions));
1366
+ this.href = this.href.replace(/.*\/??provider_member_url/, user_data.provider_member_url);
1367
+ });
1368
+ $('#macro-provider-membership').each(function() {
1369
+ var $this = $(this);
1370
+ var $html = $this.html();
1371
+ $this.html($html.replace('??provider-membership', user_data.provider_membership));
1372
+ this.href = this.href.replace(/.*\/??provider_member_url/, user_data.provider_member_url);
1373
+ });
1374
+ $('#macro-cookie-state').each(function() {
1375
+ var $this = $(this);
1376
+ var $html = $this.html();
1377
+ $this.html($html.replace('??cookie-state', user_data.cookies_accepted));
1378
+ this.href = this.href.replace(/.*\/??provider_privacy_url/, user_data.provider_privacy_url);
1379
+ });
1380
+ $('#macro-theme-name').each(function() {
1381
+ var $this = $(this);
1382
+ var $html = $this.html();
1383
+ $this.html($html.replace('??theme-name', user_data.theme_name));
1384
+ });
1385
+ $('#macro-theme-author').each(function() {
1386
+ var $this = $(this);
1387
+ var $html = $this.html();
1388
+ $this.html($html.replace('??theme-author', user_data.theme_author));
1389
+ this.href = this.href.replace(/.*\/??theme-author-url/, user_data.theme_author_url);
1390
+ });
1391
+ $('#macro-theme-version').each(function() {
1392
+ var $this = $(this);
1393
+ var $html = $this.html();
1394
+ $this.html($html.replace('??theme-version', user_data.theme_version));
1395
+ });
1675
1396
 
1397
+ });
1398
+ clearInterval(sidebarLoaded);
1399
+ return true;
1400
+ } else {
1401
+ logger.error('no user data provided');
1402
+ clearInterval(sidebarLoaded);
1403
+ return false;
1404
+ }
1405
+ }
1406
+ }, 25); // END 'sidebarLoaded'
1676
1407
  }, // END resolveMacros
1677
1408
 
1678
1409
  // -------------------------------------------------------------------------
@@ -1682,48 +1413,54 @@ var j1 = (function () {
1682
1413
  updateMacros: function (user_data) {
1683
1414
  var logger = log4javascript.getLogger('j1.updateMacros');
1684
1415
 
1685
- if (Object.keys(user_data).length) {
1686
- $('[id^=macro-]').each(function() {
1416
+ var sidebarLoaded = setInterval(function() {
1417
+ if ($('#sidebar_mmenu').length) {
1687
1418
 
1688
- $('#macro-provider').each(function() {
1689
- var $this = $(this);
1690
- var $html = $this.html();
1691
- $this.html($html.replace(/Provider:.*/, 'Provider: ' + user_data.provider));
1692
- $('#macro-provider').attr('href', user_data.provider_site_url);
1693
- });
1694
- $('#macro-user-name').each(function() {
1695
- var $this = $(this);
1696
- var $html = $this.html();
1697
- $this.html($html.replace(/User:.*/, 'User: ' + user_data.user_name));
1698
- $('#macro-user-name').attr('href', user_data.provider_member_url);
1699
- });
1700
- $('#macro-provider-permissions').each(function() {
1701
- var $this = $(this);
1702
- var $html = $this.html();
1703
- // $this.html($html.replace(/public|protected|private|blocked/, user_data.provider_permissions));
1704
- $this.html($html.replace(/public.*|protected.*|private.*|blocked.*/, user_data.provider_permissions));
1705
- $('#macro-provider-permissions').attr('href', user_data.provider_member_url);
1706
- });
1707
- $('#macro-provider-membership').each(function() {
1708
- var $this = $(this);
1709
- var $html = $this.html();
1710
- $this.html($html.replace(/guest|member/, user_data.provider_membership));
1711
- $('#macro-provider-membership').attr('href', user_data.provider_member_url);
1712
- });
1713
- $('#macro-cookie-state').each(function() {
1714
- var $this = $(this);
1715
- var $html = $this.html();
1716
- $this.html($html.replace(/accepted|declined|pending/, user_data.cookies_accepted));
1717
- $('#macro-cookie-state').attr('href', user_data.provider_privacy_url);
1718
- });
1419
+ if (Object.keys(user_data).length) {
1420
+ $('[id^=macro-]').each(function() {
1719
1421
 
1720
- });
1721
- return true;
1722
- } else {
1723
- logger.error('no user data provided');
1724
- return false;
1725
- }
1422
+ $('#macro-provider').each(function() {
1423
+ var $this = $(this);
1424
+ var $html = $this.html();
1425
+ $this.html($html.replace(/Provider:.*/, 'Provider: ' + user_data.provider));
1426
+ $('#macro-provider').attr('href', user_data.provider_site_url);
1427
+ });
1428
+ $('#macro-user-name').each(function() {
1429
+ var $this = $(this);
1430
+ var $html = $this.html();
1431
+ $this.html($html.replace(/User:.*/, 'User: ' + user_data.user_name));
1432
+ $('#macro-user-name').attr('href', user_data.provider_member_url);
1433
+ });
1434
+ $('#macro-provider-permissions').each(function() {
1435
+ var $this = $(this);
1436
+ var $html = $this.html();
1437
+ // $this.html($html.replace(/public|protected|private|blocked/, user_data.provider_permissions));
1438
+ $this.html($html.replace(/public.*|protected.*|private.*|blocked.*/, user_data.provider_permissions));
1439
+ $('#macro-provider-permissions').attr('href', user_data.provider_member_url);
1440
+ });
1441
+ $('#macro-provider-membership').each(function() {
1442
+ var $this = $(this);
1443
+ var $html = $this.html();
1444
+ $this.html($html.replace(/guest|member/, user_data.provider_membership));
1445
+ $('#macro-provider-membership').attr('href', user_data.provider_member_url);
1446
+ });
1447
+ $('#macro-cookie-state').each(function() {
1448
+ var $this = $(this);
1449
+ var $html = $this.html();
1450
+ $this.html($html.replace(/accepted|declined|pending/, user_data.cookies_accepted));
1451
+ $('#macro-cookie-state').attr('href', user_data.provider_privacy_url);
1452
+ });
1726
1453
 
1454
+ });
1455
+ clearInterval(sidebarLoaded);
1456
+ return true;
1457
+ } else {
1458
+ logger.error('no user data provided');
1459
+ clearInterval(sidebarLoaded);
1460
+ return false;
1461
+ }
1462
+ }
1463
+ }, 25); // END 'sidebarLoaded'
1727
1464
  }, // END updateMacros
1728
1465
 
1729
1466
  // -------------------------------------------------------------------------
@@ -1748,49 +1485,6 @@ var j1 = (function () {
1748
1485
  return true;
1749
1486
  }, // END logger
1750
1487
 
1751
- // -------------------------------------------------------------------------
1752
- // getBaseUrl
1753
- // -------------------------------------------------------------------------
1754
- // getBaseUrl: function () {
1755
- // var myUrl = window.location.href;
1756
- // var ua = platform.name.toLowerCase();
1757
- // var reURL = new RegExp('(http[s]?:\/\/)?([^\/]+)(.*)');
1758
- // var baseUrl;
1759
- // //var reGroups;
1760
- //
1761
- // // NOTE: named capture groups NOT supported by FF + IE11
1762
- // // if ( ua === 'chrome' ) {
1763
- // // reURL = new RegExp('(?<prot>http[s]?:\/\/)?(?<host>[^\/]+)(?<path>.*)');
1764
- // // reGroups = myUrl.match(reURL).groups;
1765
- // // baseUrl = reGroups.prot + reGroups.host;
1766
- // // } else {
1767
- // // reURL = new RegExp('(http[s]?:\/\/)?([^\/]+)(.*)');
1768
- // // myUrl.match(reURL);
1769
- // // baseUrl = RegExp.$1 + RegExp.$2 + RegExp.$3;
1770
- // // }
1771
- //
1772
- // myUrl.match(reURL);
1773
- // // baseUrl = RegExp.$1 + RegExp.$2 + RegExp.$3;
1774
- // baseUrl = RegExp.$1 + RegExp.$2;
1775
- //
1776
- // return baseUrl;
1777
- // }, // END getBaseUrl
1778
-
1779
- // -------------------------------------------------------------------------
1780
- // getPath
1781
- // See: https://stackoverflow.com/questions/27745/getting-parts-of-a-url-regex
1782
- // -------------------------------------------------------------------------
1783
- // getPath: function ( myUrl ) {
1784
- // var url = new parseURL(myUrl)
1785
- // // var reURL = new RegExp('(http[s]?:\/\/)?([^\/]+)(.*)');
1786
- // // var path;
1787
- // //
1788
- // // myUrl.match(reURL);
1789
- // path = url.path;
1790
- //
1791
- // return path;
1792
- // }, // END getPath
1793
-
1794
1488
  // -------------------------------------------------------------------------
1795
1489
  // Send message
1796
1490
  // -------------------------------------------------------------------------
@@ -1840,8 +1534,8 @@ var j1 = (function () {
1840
1534
 
1841
1535
  // -------------------------------------------------------------------------
1842
1536
  // getStyleValue:
1843
- // returns the value of a style from a css class definition
1844
- // example: j1.getStyleValue('bg-primary', 'background-color')
1537
+ // Returns the value of a style from a css class definition
1538
+ // example: j1.getStyleValue('uno-primary', 'background-color')
1845
1539
  getStyleValue: function (className, style) {
1846
1540
  var elementId = 'test-' + className,
1847
1541
  testElement = document.getElementById(elementId),
@@ -1888,13 +1582,13 @@ var j1 = (function () {
1888
1582
 
1889
1583
  // asciidoc
1890
1584
  // -----------------------------------------------------------------------
1891
- var admonitionblock_note_color = bg_primary;
1585
+ var admonitionblock_note_color = '#0D47A1'; // md-blue-900, was: bg_primary;
1892
1586
  var admonitionblock_tip_color = j1.getStyleValue('btn-success', 'background-color');
1893
1587
  var admonitionblock_important_color = j1.getStyleValue('btn-warning', 'background-color');
1894
1588
  var admonitionblock_warning_color = j1.getStyleValue('icon-warning', 'color');
1895
1589
  var admonitionblock_caution_color = j1.getStyleValue('btn-danger', 'background-color');
1896
1590
 
1897
- $('head').append('<style>.icon-note { color: ' +bg_primary+ ' !important; }</style>');
1591
+ $('head').append('<style>.icon-note { color: ' +admonitionblock_note_color+ ' !important; }</style>');
1898
1592
  $('head').append('<style>.icon-tip { color: ' +admonitionblock_tip_color+ ' !important; }</style>');
1899
1593
  $('head').append('<style>.icon-important { color: ' +admonitionblock_important_color+ ' !important; }</style>');
1900
1594
  $('head').append('<style>.icon-warning { color: ' +admonitionblock_warning_color+ ' !important; }</style>');
@@ -1912,58 +1606,93 @@ var j1 = (function () {
1912
1606
  // -----------------------------------------------------------------------
1913
1607
  $('head').append('<style>.btn-viewer:hover { background-color: ' +bg_primary+ ' !important; }</style>');
1914
1608
 
1915
- // clipboard
1916
- // -----------------------------------------------------------------------
1917
- $('head').append('<style>.btn-clipboard:hover { background-color: ' +bg_primary+ ' !important; }</style>');
1918
-
1919
1609
  // extended modals
1920
1610
  // -----------------------------------------------------------------------
1921
- var tabs_pills_link_color_active = j1.setColorData('md_blue'); // j1.getStyleValue('btn-info', 'background-color');
1922
- var tabs_pills_link_color_hover = j1.setColorData('md_gray_300'); // j1.getStyleValue('btn-secondary', 'background-color');
1611
+ // var tabs_pills_link_color_active = j1.setColorData('md_blue'); // j1.getStyleValue('btn-info', 'background-color');
1612
+ // var tabs_pills_link_color_hover = j1.setColorData('md_gray_300'); // j1.getStyleValue('btn-secondary', 'background-color');
1613
+
1614
+ // var tabs_pills_link_color_active = 'mdi-blue';
1615
+ // var tabs_pills_link_color_hover = 'mdi-gray-300';
1923
1616
 
1924
1617
  // nav module
1925
1618
  // -----------------------------------------------------------------------
1926
- $('head').append('<style>.nav-link:hover { background-color: ' +tabs_pills_link_color_hover+ ' !important; }</style>');
1927
- $('head').append('<style>.nav-link.active { background-color: ' +tabs_pills_link_color_active+ ' !important; }</style>');
1619
+ // $('head').append('<style>.nav-link:hover { background-color: ' +tabs_pills_link_color_hover+ ' !important; }</style>');
1620
+ // $('head').append('<style>.nav-link.active { background-color: ' +tabs_pills_link_color_active+ ' !important; }</style>');
1928
1621
 
1929
1622
  return true;
1930
1623
  }, // END setCss
1931
1624
 
1932
1625
  // -------------------------------------------------------------------------
1933
- // Set the current (processing) state of the module
1626
+ // setState()
1627
+ // Set the current (processing) state of the module
1934
1628
  // -------------------------------------------------------------------------
1935
1629
  setState: function (stat) {
1936
- state= stat;
1937
- //j1.state stat;
1630
+ state = stat;
1938
1631
  }, // end setState
1939
1632
 
1940
1633
  // -------------------------------------------------------------------------
1941
- // Returns the current (processing) state of the module
1634
+ // getState()
1635
+ // Returns the current (processing) state of the module
1942
1636
  // -------------------------------------------------------------------------
1943
1637
  getState: function () {
1944
- // return j1.state;
1945
1638
  return state;
1946
1639
  }, // end getState
1947
1640
 
1948
1641
  // -------------------------------------------------------------------------
1949
- // Set the current mode of the site (web|app)
1642
+ // setXhrDataState()
1643
+ // Set the final (loading) state of an element (partial) loaded via Xhr
1644
+ // -------------------------------------------------------------------------
1645
+ setXhrDataState: function (obj, stat) {
1646
+ j1.xhrDataState[obj] = stat;
1647
+ }, // END setXhrDataState
1648
+
1649
+ // -------------------------------------------------------------------------
1650
+ // getXhrDataState()
1651
+ // Returns the final (loading) state of an element (partial) loaded via Xhr
1652
+ // -------------------------------------------------------------------------
1653
+ getXhrDataState: function (obj) {
1654
+ return j1.xhrDataState[obj];
1655
+ }, // END getXhrDataState
1656
+
1657
+ // -------------------------------------------------------------------------
1658
+ // setXhrDomState()
1659
+ // Set the state of an element loaded via Xhr that is
1660
+ // successfully added to the DOM
1661
+ // -------------------------------------------------------------------------
1662
+ setXhrDomState: function (obj, stat) {
1663
+ j1.xhrDOMState[obj] = stat;
1664
+ }, // END setXhrDomState
1665
+
1666
+ // -------------------------------------------------------------------------
1667
+ // getXhrDataState()
1668
+ // Returns the state of an element loaded via Xhr that is
1669
+ // successfully added to the DOM
1670
+ // -------------------------------------------------------------------------
1671
+ getXhrDOMState: function (obj) {
1672
+ return j1.xhrDOMState[obj];
1673
+ }, // END getXhrDOMState
1674
+
1675
+ // -------------------------------------------------------------------------
1676
+ // setMode()
1677
+ // Set the current mode of the site (web|app)
1950
1678
  // -------------------------------------------------------------------------
1951
1679
  setMode: function (mod) {
1952
1680
  mode = mod;
1953
1681
  }, // END setMode
1954
1682
 
1955
1683
  // -------------------------------------------------------------------------
1956
- // Return the current mode of the site (web|app)
1684
+ // getMode()
1685
+ // Returns the current mode of the site (web|app)
1957
1686
  // -------------------------------------------------------------------------
1958
1687
  getMode: function () {
1959
1688
  return mode;
1960
1689
  }, // END getMode
1961
1690
 
1962
1691
  // -------------------------------------------------------------------------
1963
- // getUserAgent
1964
- // Return the name of the web browser
1692
+ // checkUserAgent()
1693
+ // Returns the name (UA) of the web browser
1965
1694
  // -------------------------------------------------------------------------
1966
- checkUserAgent: function (ua_name) {
1695
+ checkUserAgent: function () {
1967
1696
  if (navigator.userAgent.search(ua_name) >= 0) {
1968
1697
  return true;
1969
1698
  } else {
@@ -1972,21 +1701,38 @@ var j1 = (function () {
1972
1701
  }, // END checkUserAgent
1973
1702
 
1974
1703
  // -------------------------------------------------------------------------
1975
- // Return always true (for testing purposes)
1704
+ // checkUserAgent()
1705
+ // Returns the name (UA) of the web browser
1706
+ // -------------------------------------------------------------------------
1707
+ generateId: function (length) {
1708
+ var result = '';
1709
+ var characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
1710
+ var charactersLength = characters.length;
1711
+ for ( var i = 0; i < length; i++ ) {
1712
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
1713
+ }
1714
+ return result;
1715
+ }, // END checkUserAgent
1716
+
1717
+ // -------------------------------------------------------------------------
1718
+ // getTrue()
1719
+ // Returns always true (for testing purposes)
1976
1720
  // -------------------------------------------------------------------------
1977
1721
  getTrue: function () {
1978
1722
  return true;
1979
1723
  }, // END isTrue
1980
1724
 
1981
1725
  // -------------------------------------------------------------------------
1982
- // Return always false (for testing purposes)
1726
+ // getFalse()
1727
+ // Returns always false (for testing purposes)
1983
1728
  // -------------------------------------------------------------------------
1984
1729
  getFalse: function () {
1985
1730
  return false;
1986
1731
  }, // END isTrue
1987
1732
 
1988
1733
  // -------------------------------------------------------------------------
1989
- // Return users to their browser homepage
1734
+ // goHome()
1735
+ // Redirect current page to the browser homepage
1990
1736
  // -------------------------------------------------------------------------
1991
1737
  goHome: function () {
1992
1738
  // most browsers
@@ -1998,10 +1744,24 @@ var j1 = (function () {
1998
1744
  } else {
1999
1745
  window.location.href = 'about:blank';
2000
1746
  }
2001
- } // END gohome
1747
+ }, // END gohome
1748
+
1749
+ // -------------------------------------------------------------------------
1750
+ // goBack()
1751
+ // Redirect current page to last visited page (referrer)
1752
+ // -------------------------------------------------------------------------
1753
+ goBack: function () {
1754
+ // where visitor has come from
1755
+ window.location.href = document.referrer;
1756
+ } // END goBack
1757
+
2002
1758
  }; // END j1 (return)
2003
1759
  }) (j1, window);
2004
1760
 
2005
1761
  {% endcapture %}
2006
- {{ cache | strip_empty_lines }}
1762
+ {% if production %}
1763
+ {{ cache | minifyJS }}
1764
+ {% else %}
1765
+ {{ cache | strip_empty_lines }}
1766
+ {% endif %}
2007
1767
  {% assign cache = nil %}