j1-template 2021.1.0 → 2021.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/layouts/layout_metadata_generator.html +54 -39
  3. data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +1 -1
  4. data/_includes/themes/j1/modules/connectors/ads +3 -5
  5. data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +9 -5
  6. data/_includes/themes/j1/modules/connectors/analytics +4 -2
  7. data/_includes/themes/j1/modules/connectors/comments +7 -6
  8. data/_includes/themes/j1/modules/connectors/translator +3 -4
  9. data/_includes/themes/j1/modules/navigator/generator.html +4 -40
  10. data/_includes/themes/j1/modules/navigator/procedures/topsearch.proc +2 -2
  11. data/_includes/themes/j1/procedures/global/create_bs_button.proc +64 -22
  12. data/_includes/themes/j1/procedures/posts/collate_timeline.proc +14 -10
  13. data/_layouts/default.html +4 -7
  14. data/apps/public/cc/index.adoc +13 -4
  15. data/assets/data/authclient.html +234 -228
  16. data/assets/data/banner.html +34 -31
  17. data/assets/data/cookieconsent.html +249 -0
  18. data/assets/data/fam.html +5 -0
  19. data/assets/data/footer.html +4 -0
  20. data/assets/data/gallery_customizer.html +14 -4
  21. data/assets/data/menu.html +7 -2
  22. data/assets/data/mmenu.html +6 -2
  23. data/assets/data/mmenu_sidebar.html +5 -1
  24. data/assets/data/mmenu_toc.html +4 -0
  25. data/assets/data/panel.html +23 -15
  26. data/assets/data/quicklinks.html +24 -17
  27. data/assets/error_pages/HTTP204.html +2 -1
  28. data/assets/error_pages/HTTP400.html +2 -1
  29. data/assets/error_pages/HTTP401.html +2 -1
  30. data/assets/error_pages/HTTP403.html +2 -1
  31. data/assets/error_pages/HTTP404.html +2 -1
  32. data/assets/error_pages/HTTP500.html +2 -1
  33. data/assets/error_pages/HTTP501.html +2 -1
  34. data/assets/error_pages/HTTP502.html +2 -1
  35. data/assets/error_pages/HTTP503.html +2 -1
  36. data/assets/error_pages/HTTP520.html +2 -1
  37. data/assets/error_pages/HTTP521.html +2 -1
  38. data/assets/error_pages/HTTP533.html +2 -1
  39. data/assets/themes/j1/adapter/js/{cookiebar.js → cookieConsent.js} +102 -54
  40. data/assets/themes/j1/adapter/js/j1.js +53 -20
  41. data/assets/themes/j1/adapter/js/justifiedGalleryCustomizer.js +3 -2
  42. data/assets/themes/j1/adapter/js/mmenu.js +8 -4
  43. data/assets/themes/j1/adapter/js/navigator.js +77 -22
  44. data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.css +17 -14
  45. data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.min.css +1 -1
  46. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.css +3960 -240
  47. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css +1 -1
  48. data/assets/themes/j1/core/js/template.js +3 -9
  49. data/assets/themes/j1/core/js/template.js.map +1 -1
  50. data/assets/themes/j1/core/js/template.min.js +3 -9
  51. data/assets/themes/j1/core/js/template.min.js.map +1 -1
  52. data/assets/themes/j1/modules/_lightGallery/css/core/lg-fb-comment-box.css +58 -0
  53. data/assets/themes/j1/modules/_lightGallery/css/core/lg-fb-comment-box.min.css +5 -0
  54. data/assets/themes/j1/modules/_lightGallery/css/core/lg-transitions.css +778 -0
  55. data/assets/themes/j1/modules/_lightGallery/css/core/lg-transitions.min.css +5 -0
  56. data/assets/themes/j1/modules/_lightGallery/css/core/lightgallery.css +981 -0
  57. data/assets/themes/j1/modules/_lightGallery/css/core/lightgallery.min.css +5 -0
  58. data/assets/themes/j1/modules/_lightGallery/css/fonts/lg.eot +0 -0
  59. data/assets/themes/j1/modules/_lightGallery/css/fonts/lg.svg +47 -0
  60. data/assets/themes/j1/modules/_lightGallery/css/fonts/lg.ttf +0 -0
  61. data/assets/themes/j1/modules/_lightGallery/css/fonts/lg.woff +0 -0
  62. data/assets/themes/j1/modules/_lightGallery/css/img/loading.gif +0 -0
  63. data/assets/themes/j1/modules/_lightGallery/css/img/video-play.png +0 -0
  64. data/assets/themes/j1/modules/_lightGallery/css/img/vimeo-play.png +0 -0
  65. data/assets/themes/j1/modules/_lightGallery/css/img/youtube-play.png +0 -0
  66. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/animation-w.png +0 -0
  67. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/customize-w.png +0 -0
  68. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/dynamic-w.png +0 -0
  69. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/facebook-icon.svg +10 -0
  70. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/googleplus-icon.svg +30 -0
  71. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/html5-w.png +0 -0
  72. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/linked-in.png +0 -0
  73. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/module-w.png +0 -0
  74. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/play-button.png +0 -0
  75. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/responsive-w.png +0 -0
  76. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/thumb-w.png +0 -0
  77. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/touch-w.png +0 -0
  78. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/twitter-icon.svg +15 -0
  79. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/twitter.png +0 -0
  80. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/video1-w.png +0 -0
  81. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/zoom-w.png +0 -0
  82. data/assets/themes/j1/modules/_lightGallery/css/themes/icons/zoom.png +0 -0
  83. data/assets/themes/j1/modules/_lightGallery/css/themes/uno.css +262 -0
  84. data/assets/themes/j1/modules/_lightGallery/css/themes/uno.min.css +15 -0
  85. data/assets/themes/j1/modules/_lightGallery/js/core/lightgallery.js +1362 -0
  86. data/assets/themes/j1/modules/_lightGallery/js/core/lightgallery.min.js +4 -0
  87. data/assets/themes/j1/modules/_lightGallery/js/modules/j1/j1-video.js +402 -0
  88. data/assets/themes/j1/modules/_lightGallery/js/modules/j1/j1-video.min.js +8 -0
  89. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-autoplay.js +206 -0
  90. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-autoplay.min.js +5 -0
  91. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-fullscreen.js +126 -0
  92. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-fullscreen.min.js +5 -0
  93. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-hash.js +101 -0
  94. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-hash.min.js +5 -0
  95. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-pager.js +105 -0
  96. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-pager.min.js +5 -0
  97. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-share.js +107 -0
  98. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-share.min.js +5 -0
  99. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-thumbnail.js +478 -0
  100. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-thumbnail.min.js +5 -0
  101. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-video.js +342 -0
  102. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-video.min.js +5 -0
  103. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-zoom.js +527 -0
  104. data/assets/themes/j1/modules/_lightGallery/js/modules/lg-zoom.min.js +5 -0
  105. data/assets/themes/j1/modules/cookieConsent/LICENSE +21 -0
  106. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +286 -0
  107. data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +28 -0
  108. data/assets/themes/j1/modules/iframeResizer/examples/frame.absolute.html +4 -2
  109. data/assets/themes/j1/modules/iframeResizer/examples/frame.content.html +4 -3
  110. data/assets/themes/j1/modules/iframeResizer/examples/frame.hover.html +4 -2
  111. data/assets/themes/j1/modules/iframeResizer/examples/frame.nested.html +4 -2
  112. data/assets/themes/j1/modules/iframeResizer/examples/frame.textarea.html +4 -2
  113. data/assets/themes/j1/modules/iframeResizer/examples/frame.tolerance.html +4 -2
  114. data/assets/themes/j1/modules/iframeResizer/examples/index.html +2 -0
  115. data/assets/themes/j1/modules/iframeResizer/examples/two.html +4 -2
  116. data/assets/themes/j1/modules/lightGallery/js/core/j1/lightgallery-x.js +1368 -0
  117. data/assets/themes/j1/modules/lightGallery/js/core/j1/lightgallery-x.min.js +10 -0
  118. data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-x-video.js +344 -0
  119. data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-x-video.min.js +7 -0
  120. data/assets/themes/j1/modules/util/js/domready.js +146 -0
  121. data/assets/themes/j1/modules/util/js/gtag-opt-in.js +1 -0
  122. data/lib/j1/version.rb +1 -1
  123. data/lib/starter_web/Gemfile +1 -1
  124. data/lib/starter_web/_config.yml +74 -77
  125. data/lib/starter_web/_data/_defaults/resources.yml +11 -8
  126. data/lib/starter_web/_data/apps/defaults/justifiedGalleryCustomizer.yml +1 -0
  127. data/lib/starter_web/_data/blocks/banner.yml +30 -24
  128. data/lib/starter_web/_data/blocks/panel.yml +9 -7
  129. data/lib/starter_web/_data/builder/blog_navigator.yml +6 -1
  130. data/lib/starter_web/_data/j1_config.yml +2 -2
  131. data/lib/starter_web/_data/layouts/blog_archive.yml +9 -0
  132. data/lib/starter_web/_data/layouts/collection.yml +10 -0
  133. data/lib/starter_web/_data/layouts/default.yml +25 -59
  134. data/lib/starter_web/_data/layouts/home.yml +6 -5
  135. data/lib/starter_web/_data/layouts/page.yml +1 -1
  136. data/lib/starter_web/_data/modules/{cookiebar.yml → cookieconsent.yml} +4 -4
  137. data/lib/starter_web/_data/modules/defaults/authentication.yml +1 -0
  138. data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +135 -0
  139. data/lib/starter_web/_data/modules/defaults/navigator.yml +5 -2
  140. data/lib/starter_web/_data/modules/navigator.yml +24 -21
  141. data/lib/starter_web/_data/modules/navigator_menu.yml +2 -2
  142. data/lib/starter_web/_data/pages/builder.yml +7 -7
  143. data/lib/starter_web/_data/private.yml +6 -6
  144. data/lib/starter_web/_data/resources.yml +13 -8
  145. data/lib/starter_web/_includes/attributes.asciidoc +10 -1
  146. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  147. data/lib/starter_web/assets/images/modules/attics/christa-dodoo-1920x1280.jpg +0 -0
  148. data/lib/starter_web/assets/images/modules/attics/{cookies-1920x1200-bw.jpg → cookies-1920x1200.jpg} +0 -0
  149. data/lib/starter_web/assets/images/modules/attics/giammarco-boscaro-1920x1280.jpg +0 -0
  150. data/lib/starter_web/assets/images/modules/attics/lianhao-1920x1280.jpg +0 -0
  151. data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +3 -9
  152. data/lib/starter_web/collections/posts/public/featured/_posts/2020-01-01-about-cookies.adoc +4 -11
  153. data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-01-site-generators.adoc +1 -8
  154. data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-03-about-j1.adoc +2 -8
  155. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-test-series.adoc +2 -8
  156. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-test-series.adoc +2 -9
  157. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-test-series.adoc +2 -9
  158. data/lib/starter_web/collections/posts/public/series/_posts/2020-01-04-post-test-series.adoc +2 -9
  159. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-20-minneapolis.adoc +3 -1
  160. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc +3 -1
  161. data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-26-columbia-river.adoc +3 -1
  162. data/lib/starter_web/index.html +7 -13
  163. data/lib/starter_web/package.json +3 -3
  164. data/lib/starter_web/pages/public/asciidoc_skeletons/book/000_intro.adoc +7 -1
  165. data/lib/starter_web/pages/public/asciidoc_skeletons/book/100_chapter.adoc +5 -1
  166. data/lib/starter_web/pages/public/asciidoc_skeletons/book/200_chapter.adoc +6 -1
  167. data/lib/starter_web/pages/public/asciidoc_skeletons/book/900_references.adoc +5 -0
  168. data/lib/starter_web/pages/public/asciidoc_skeletons/book/book.adoc +6 -1
  169. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/100_chapter.asciidoc +1 -1
  170. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/200_chapter.asciidoc +1 -1
  171. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +6 -1
  172. data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +6 -1
  173. data/lib/starter_web/pages/public/blog/navigator/archive.html +40 -24
  174. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +48 -28
  175. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +45 -28
  176. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +41 -13
  177. data/lib/starter_web/pages/public/blog/navigator/index.html +1 -4
  178. data/lib/starter_web/pages/public/cookieConsent.adoc +93 -0
  179. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +1 -1
  180. data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.org.asciidoc +244 -0
  181. data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +1 -1
  182. data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +1 -1
  183. data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +1 -1
  184. data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +3 -2
  185. data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +1 -1
  186. data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +1 -1
  187. data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +1 -1
  188. data/lib/starter_web/pages/public/learn/roundtrip/600_quicksearch.adoc +1 -1
  189. data/lib/starter_web/pages/public/learn/where_to_go.adoc +2 -18
  190. data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +7 -5
  191. data/lib/starter_web/pages/public/legal/en/200_impress.adoc +7 -6
  192. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +111 -214
  193. data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +7 -5
  194. data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +7 -2
  195. data/lib/starter_web/pages/public/previewer/bootstrap_theme.adoc +1 -1
  196. data/lib/starter_web/pages/public/previewer/iframer.adoc +1 -1
  197. data/lib/starter_web/pages/public/previewer/justified_gallery.html +1 -1
  198. data/lib/starter_web/pages/public/previewer/md_color_palette.adoc +1 -1
  199. data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +1 -1
  200. data/lib/starter_web/pages/public/previewer/rouge.adoc +1 -1
  201. data/lib/starter_web/pages/public/previewer/twitter_emoji_preview.adoc +1 -1
  202. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  203. data/lib/starter_web/utilsrv/package.json +1 -1
  204. metadata +74 -14
  205. data/_includes/themes/j1/modules/connectors/analytic/google-analytics-legacy.html +0 -36
  206. data/assets/data/cookiebar.html +0 -281
  207. data/lib/starter_web/_data/_defaults/private.yml +0 -156
  208. data/lib/starter_web/_data/modules/defaults/cookiebar.yml +0 -132
  209. data/lib/starter_web/_data/private@default.yml +0 -119
  210. data/lib/starter_web/_data/private@localhost.yml +0 -156
  211. data/lib/starter_web/collections/posts/public/series/_posts/_includes/attributes.asciidoc +0 -37
  212. data/lib/starter_web/collections/posts/public/series/_posts/_includes/documents/readme +0 -0
  213. data/lib/starter_web/collections/posts/public/series/_posts/_includes/tables/debug_variables.asciidoc +0 -47
@@ -6,8 +6,8 @@ regenerate: true
6
6
 
7
7
  {% comment %}
8
8
  # -----------------------------------------------------------------------------
9
- # ~/assets/themes/j1/adapter/js/cookiebar.js
10
- # Liquid template to create the Template Adapter for J1 Cookiebar
9
+ # ~/assets/themes/j1/adapter/js/cookieConsent.js
10
+ # Liquid template to create the Template Adapter for J1 CookieConsent
11
11
  #
12
12
  # Product/Info:
13
13
  # http://jekyll.one
@@ -27,17 +27,18 @@ regenerate: true
27
27
 
28
28
  {% comment %} Set config files
29
29
  -------------------------------------------------------------------------------- {% endcomment %}
30
- {% assign environment = site.environment %}
31
- {% assign modules = site.data.modules %}
30
+ {% assign environment = site.environment %}
31
+ {% assign modules = site.data.modules %}
32
32
 
33
33
  {% comment %} Set config data
34
34
  -------------------------------------------------------------------------------- {% endcomment %}
35
- {% assign cookiebar_settings = modules.cookiebar.settings %}
36
- {% assign cookiebar_defaults = modules.defaults.cookiebar.defaults %}
35
+ {% assign consent_defaults = modules.defaults.cookieconsent.defaults %}
36
+ {% assign consent_settings = modules.cookieconsent.settings %}
37
+ {% assign tracking_id = site.data.j1_config.analytics.google.tracking_id %}
37
38
 
38
39
  {% comment %} Set config options
39
40
  -------------------------------------------------------------------------------- {% endcomment %}
40
- {% assign cookiebar_options = cookiebar_defaults | merge: cookiebar_settings %}
41
+ {% assign consent_options = consent_defaults | merge: consent_settings %}
41
42
 
42
43
  {% assign production = false %}
43
44
  {% if environment == 'prod' or environment == 'production' %}
@@ -46,21 +47,20 @@ regenerate: true
46
47
 
47
48
  /*
48
49
  # -----------------------------------------------------------------------------
49
- # ~/assets/themes/j1/adapter/js/cookiebar.js
50
- # JS Adapter for Cookiebar
50
+ # ~/assets/themes/j1/adapter/js/cookieConsent.js
51
+ # JS Adapter for J1 CookieConsent
51
52
  #
52
- # Product/Info:
53
- # http://jekyll.one
54
- # http://www.primebox.co.uk/projects/jquery-cookiebar/
53
+ # Product/Info:
54
+ # https://shaack.com
55
+ # http://jekyll.one
55
56
  #
56
- # Copyright (C) 2021 Juergen Adams
57
- # Copyright (C) 2016 Ant Parsons (primebox.co.uk)
58
- #
59
- # J1 Template is licensed under the MIT License.
60
- # For details, see https://jekyll.one
61
- # jQuery Cookibar is licensed under Creative Commons Attribution 3.0 Unported License.
62
- # For details, see http://www.primebox.co.uk/projects/jquery-cookiebar/
57
+ # Copyright (C) 2020 Stefan Haack
58
+ # Copyright (C) 2021 Juergen Adams
63
59
  #
60
+ # bootstrap-cookie-banner is licensed under MIT License.
61
+ # See: https://github.com/shaack/bootstrap-cookie-banner/blob/master/LICENSE
62
+ # J1 Template is licensed under MIT License.
63
+ # See: https://github.com/jekyll-one/J1 Template/blob/master/LICENSE
64
64
  # -----------------------------------------------------------------------------
65
65
  # Adapter generated: {{site.time}}
66
66
  # -----------------------------------------------------------------------------
@@ -76,14 +76,15 @@ regenerate: true
76
76
 
77
77
  {% comment %} Main
78
78
  --------------------------------------------------------------- {% endcomment %}
79
- j1.adapter['cookiebar'] = (function (j1, window) {
79
+ j1.adapter['cookieConsent'] = (function (j1, window) {
80
80
 
81
81
  var environment = '{{environment}}';
82
82
  var moduleOptions = {};
83
83
  var _this;
84
+ var $modal;
85
+ var user_cookie;
84
86
  var logger;
85
87
  var logText;
86
-
87
88
  // ---------------------------------------------------------------------------
88
89
  // Helper functions
89
90
  // ---------------------------------------------------------------------------
@@ -98,11 +99,20 @@ j1.adapter['cookiebar'] = (function (j1, window) {
98
99
  // -------------------------------------------------------------------------
99
100
  init: function (options) {
100
101
 
102
+ // -----------------------------------------------------------------------
103
+ // globals
104
+ // -----------------------------------------------------------------------
105
+ _this = j1.adapter.cookieConsent;
106
+ logger = log4javascript.getLogger('j1.adapter.cookieConsent');
107
+
108
+ // initialize state flag
109
+ _this.state = 'pending';
110
+
101
111
  // -----------------------------------------------------------------------
102
112
  // Default module settings
103
113
  // -----------------------------------------------------------------------
104
114
  var settings = $.extend({
105
- module_name: 'j1.adapter.algolia',
115
+ module_name: 'j1.adapter.cookieConsent',
106
116
  generated: '{{site.time}}'
107
117
  }, options);
108
118
 
@@ -110,7 +120,7 @@ j1.adapter['cookiebar'] = (function (j1, window) {
110
120
  -------------------------------------------------------------------------- {% endcomment %}
111
121
  // Load module DEFAULTS|CONFIG
112
122
  /* eslint-disable */
113
- moduleOptions = $.extend({}, {{cookiebar_options | replace: '=>', ':' | replace: 'nil', '""'}});
123
+ moduleOptions = $.extend({}, {{consent_options | replace: '=>', ':' | replace: 'nil', '""'}});
114
124
  /* eslint-enable */
115
125
 
116
126
  if (typeof settings !== 'undefined') {
@@ -120,46 +130,32 @@ j1.adapter['cookiebar'] = (function (j1, window) {
120
130
  // -----------------------------------------------------------------------
121
131
  // initializer
122
132
  // -----------------------------------------------------------------------
123
- _this = j1.adapter.cookiebar;
124
- logger = log4javascript.getLogger('j1.adapter.cookiebar');
125
-
126
133
  _this.setState('started');
127
134
  logger.info('state: ' + _this.getState());
128
135
  logger.info('module is being initialized');
129
136
 
130
- j1.core.cookiebar.init({
131
- expireDays: {{ cookiebar_options.expireDays | json }},
132
- renewOnVisit: {{ cookiebar_options.renewOnVisit | json }},
133
- forceShow: {{ cookiebar_options.forceShow | json }},
134
- domain: {{ cookiebar_options.domain | json }},
135
- referrer: {{ cookiebar_options.referrer | json }}
137
+ j1.cookieConsent = new BootstrapCookieConsent({
138
+ contentURL: moduleOptions.contentURL,
139
+ cookieName: moduleOptions.cookieName,
140
+ language: moduleOptions.language,
141
+ whitelisted: moduleOptions.whitelisted,
142
+ reloadPageOnChange: moduleOptions.reloadCurrentPage,
143
+ xhr_data_element: moduleOptions.xhr_data_element + '-' + moduleOptions.language,
144
+ postSelectionCallback: function () {
145
+ j1.adapter.cookieConsent.cbCookie()
146
+ }
136
147
  });
137
148
 
138
- j1.xhrData(moduleOptions, 'j1.adapter.cookiebar', 'data_loaded');
139
-
140
- // ---------------------------------------------------------------------
141
- // Initialize events if all modals loaded
142
- // ---------------------------------------------------------------------
143
- var dependencies_met_modals_loaded = setInterval (function () {
144
- if (j1.xhrDataState['#{{cookiebar_options.xhr_container_id}}'] == 'success') {
145
- logger.info('load HTML data (AJAX): finished');
146
- j1.core.cookiebar.eventHandler(moduleOptions);
149
+ var dependencies_met_page_ready = setInterval (function (options) {
150
+ if ( j1.cookieConsent && j1.getState() === 'finished' ) {
147
151
  _this.setState('finished');
148
152
  logger.info('state: ' + _this.getState());
149
- logger.info('initializing module finished');
150
- clearInterval(dependencies_met_modals_loaded);
151
- logger.info('met dependencies for: xhrData');
153
+ logger.debug('module initialized successfully');
154
+ clearInterval(dependencies_met_page_ready);
152
155
  }
153
- if (j1.xhrDataState['#{{cookiebar_options.xhr_container_id}}'] == 'not loaded') {
154
- logger.error('load HTML data (AJAX): failed');
155
- _this.setState('finished');
156
- logger.info('state: ' + _this.getState());
157
- logger.info('initializing module finished');
158
- clearInterval(dependencies_met_modals_loaded);
159
- }
160
- }, 25); // END dependencies_met_modals_loaded
161
- }, // END init
156
+ });
162
157
 
158
+ }, // END init
163
159
 
164
160
  // -------------------------------------------------------------------------
165
161
  // messageHandler: MessageHandler for J1 CookieConsent module
@@ -202,7 +198,59 @@ j1.adapter['cookiebar'] = (function (j1, window) {
202
198
  // -------------------------------------------------------------------------
203
199
  getState: function () {
204
200
  return _this.state;
205
- } // END getState
201
+ }, // END getState
202
+
203
+ // -------------------------------------------------------------------------
204
+ // cbCookie()
205
+ // Callback function called by CookieConsent module after the user has
206
+ // made his selection
207
+ // -------------------------------------------------------------------------
208
+ // TODO:
209
+ // If ONLY required setting selected, make j1.user.consent
210
+ // a SESSION cookie!!!
211
+ // -------------------------------------------------------------------------
212
+ cbCookie: function () {
213
+ var gaCookies = j1.findCookie('_ga');
214
+ var user_cookie = j1.readCookie('j1.user.consent');
215
+ var json = JSON.stringify(user_cookie);
216
+
217
+ logger.info('Entered post selection callback from CookieConsent');
218
+ logger.info('Current values from CookieConsent: ' + json);
219
+
220
+ // gaCookies.forEach(item => console.log('cookieConsent: ' + item));
221
+
222
+ // Manage Google Analytics OptIn/Out
223
+ // See: https://github.com/luciomartinez/gtag-opt-in/wiki
224
+ //
225
+ GTagOptIn.register('{{tracking_id}}');
226
+ if (user_cookie.analyses) {
227
+ logger.info('Enable: GA');
228
+ GTagOptIn.optIn();
229
+ } else {
230
+ logger.warn('Disable: GA');
231
+ GTagOptIn.optOut();
232
+ var gaCookies = j1.findCookie('_ga');
233
+ gaCookies.forEach(function (item) {
234
+ logger.warn('Delete GA cookie: ' + item);
235
+ j1.removeCookie({
236
+ name: item,
237
+ path: '/'
238
+ });
239
+ });
240
+ }
241
+
242
+ // enable cookie button if not visible
243
+ //
244
+ if ($('#quickLinksCookieButton').css('display') === 'none') {
245
+ $('#quickLinksCookieButton').css('display', 'block');
246
+ }
247
+
248
+ // reload page after selection
249
+ //
250
+ // $('#no_flicker').css('display', 'none');
251
+ location.reload();
252
+
253
+ } // END cbCookie
206
254
 
207
255
  }; // END return
208
256
  })(j1, window);
@@ -23,7 +23,7 @@ regenerate: true
23
23
  {% endcomment %}
24
24
 
25
25
  {% comment %} Liquid procedures
26
- -------------------------------------------------------------------------------- {% endcomment %}
26
+ ------------------------------------------------------------------------------- {% endcomment %}
27
27
 
28
28
  {% comment %} Set global settings
29
29
  -------------------------------------------------------------------------------- {% endcomment %}
@@ -132,12 +132,14 @@ var j1 = (function () {
132
132
  var user_session_detected;
133
133
 
134
134
  // Connector settings
135
- var translation_enabled = {{template_config.translation.enabled}};
135
+ var translation_enabled = {{template_config.translation.enabled}};
136
136
 
137
137
  // Theme information
138
138
  var themeName;
139
139
  var themeCss;
140
- var themeExtensionCss = environment === 'production' ? '/assets/themes/j1/core/css/themes/theme-extensions.min.css' : '/assets/themes/j1/core/css/themes/theme-extensions.css';
140
+ var themeExtensionCss = environment === 'production'
141
+ ? '/assets/themes/j1/core/css/themes/theme-extensions.min.css'
142
+ : '/assets/themes/j1/core/css/themes/theme-extensions.css';
141
143
 
142
144
  // Pathes of J1 data files
143
145
  var colors_data_path = '{{template_config.colors_data_path}}';
@@ -162,12 +164,13 @@ var j1 = (function () {
162
164
  // var default_theme_name = 'uno-light';
163
165
  // var default_theme_author = 'J1 Team';
164
166
  // var default_theme_link = 'https://jekyll.one/';
165
- var default_white_listed_pages = [];
167
+ // var default_white_listed_pages = [];
166
168
 
167
169
  var cookie_names = {
168
170
  'app_session': '{{template_config.cookies.app_session}}',
169
171
  'user_session': '{{template_config.cookies.user_session}}',
170
- 'user_state': '{{template_config.cookies.user_state}}'
172
+ 'user_state': '{{template_config.cookies.user_state}}',
173
+ 'user_consent': 'j1.user.consent'
171
174
  };
172
175
 
173
176
  // user SESSION cookie (initial values)
@@ -190,19 +193,29 @@ var j1 = (function () {
190
193
  };
191
194
 
192
195
  // user STATE cookie (initial values)
196
+ // var user_state = {
197
+ // 'theme_css': "",
198
+ // 'theme_name': "",
199
+ // 'theme_author': "",
200
+ // 'theme_version': '{{site.version}}',
201
+ // 'cookies_accepted': 'pending',
202
+ // 'whitelistedPages': default_white_listed_pages,
203
+ // 'deleteOnDecline': false,
204
+ // 'showConsentOnPending': false,
205
+ // 'stopScrolling': true,
206
+ // 'session_active': false,
207
+ // 'last_session_ts': '',
208
+ // 'cc_authenticated': false
209
+ // };
210
+
193
211
  var user_state = {
194
212
  'theme_css': "",
195
213
  'theme_name': "",
196
214
  'theme_author': "",
197
215
  'theme_version': '{{site.version}}',
198
- 'cookies_accepted': 'pending',
199
- 'whitelistedPages': default_white_listed_pages,
200
- 'deleteOnDecline': false,
201
- 'showConsentOnPending': false,
202
216
  'stopScrolling': true,
203
217
  'session_active': false,
204
- 'last_session_ts': '',
205
- 'cc_authenticated': false
218
+ 'last_session_ts': ''
206
219
  };
207
220
 
208
221
  // ---------------------------------------------------------------------------
@@ -586,7 +599,8 @@ var j1 = (function () {
586
599
  if (selector.length) {
587
600
  logText = 'loading banner on id: ' +banner[i];
588
601
  logger.info(logText);
589
- var banner_data_path = '{{banner_data_path}} ' + id + ' > *';
602
+ // var banner_data_path = '{{banner_data_path}} ' + id + ' > *';
603
+ var banner_data_path = '{{banner_data_path}} ' + id;
590
604
  selector.load(banner_data_path, cb_load_closure(id));
591
605
  }
592
606
  } // END for
@@ -689,7 +703,8 @@ var j1 = (function () {
689
703
  if ( selector.length ) {
690
704
  logText = 'loading panel on id: ' +panel[i];
691
705
  logger.info(logText);
692
- var panel_data_path = '{{panel_data_path}} ' + id + ' > *';
706
+ // var panel_data_path = '{{panel_data_path}} ' + id + ' > *';
707
+ var panel_data_path = '{{panel_data_path}} ' + id;
693
708
  selector.load(panel_data_path, cb_load_closure(id));
694
709
  }
695
710
  } // END for
@@ -749,7 +764,8 @@ var j1 = (function () {
749
764
  var id = '#' + '{{footer_id}}';
750
765
  var selector = $(id);
751
766
  if ( selector.length ) {
752
- var footer_data_path = '{{footer_data_path}}';
767
+ // var footer_data_path = '{{footer_data_path}} ' + id + ' > *';
768
+ var footer_data_path = '{{footer_data_path}} ' + id;
753
769
  selector.load(footer_data_path, cb_load_closure(id));
754
770
  } else {
755
771
  logText = 'data not loaded';
@@ -835,7 +851,7 @@ var j1 = (function () {
835
851
  $('#no_flicker').css('display', 'block');
836
852
 
837
853
  // show|hide cookie icon (should MOVED to Cookiebar ???)
838
- if (user_state.cookies_accepted === 'accepted') {
854
+ if (j1.existsCookie(cookie_names.user_consent)) {
839
855
  // Display cookie icon
840
856
  logText = 'show cookie icon';
841
857
  logger.info(logText);
@@ -929,7 +945,7 @@ var j1 = (function () {
929
945
  }
930
946
 
931
947
  // show|hide cookie icon (should MOVED to Cookiebar ???)
932
- if (user_state.cookies_accepted === 'accepted') {
948
+ if (j1.existsCookie(cookie_names.user_consent)) {
933
949
  // Display cookie icon
934
950
  logText = 'show cookie icon';
935
951
  logger.info(logText);
@@ -1161,15 +1177,20 @@ var j1 = (function () {
1161
1177
  }
1162
1178
  };
1163
1179
  };
1180
+
1164
1181
  // see: https://stackoverflow.com/questions/20420577/detect-added-element-to-dom-with-mutation-observer
1182
+ //
1165
1183
  var html_data_path;
1166
1184
  var id = '#' + options.xhr_container_id;
1185
+ var container = '#' + options.xhr_container_id + '_container';
1167
1186
  var $selector = $(id);
1168
1187
 
1169
1188
  if ( $selector.length ) {
1170
1189
  if (options.xhr_data_element) {
1171
- html_data_path = options.xhr_data_path + ' #' + options.xhr_data_element + ' > *';
1190
+ html_data_path = options.xhr_data_path + ' #' + options.xhr_data_element;
1191
+ logger.info('XHR data element found: ' + options.xhr_data_element);
1172
1192
  } else {
1193
+ logger.warn('no XHR data element found. HTML data loaded full page.');
1173
1194
  html_data_path = options.xhr_data_path + ' > *';
1174
1195
  }
1175
1196
  $selector.load( html_data_path, cb_load_closure( mod, id ) );
@@ -1234,6 +1255,19 @@ var j1 = (function () {
1234
1255
  }
1235
1256
  }, // END readCookie
1236
1257
 
1258
+ // -------------------------------------------------------------------------
1259
+ // findCookie()
1260
+ // Search for cookies (names) in the page header that matches
1261
+ // a given regex string. Returns all names found as an array.
1262
+ // -------------------------------------------------------------------------
1263
+ // See: https://stackoverflow.com/questions/52287989/javascript-cookie-remove-or-delete-with-regex-regular-expression
1264
+ // -------------------------------------------------------------------------
1265
+ findCookie: function (regex) {
1266
+ var r=[];
1267
+ document.cookie.replace(new RegExp(regex + "[^= ]*", "g"), function(a){ r.push(a.trim()); });
1268
+ return r;
1269
+ }, // END findCookie
1270
+
1237
1271
  // -------------------------------------------------------------------------
1238
1272
  // writeCookie()
1239
1273
  // Write 'data' to a cookie 'name'. If not exists, the cookie gets
@@ -1268,7 +1302,7 @@ var j1 = (function () {
1268
1302
  expires: 0,
1269
1303
  path: '/',
1270
1304
  // SameSite: 'Strict',
1271
- SameSite: 'Lax',
1305
+ // SameSite: 'Lax',
1272
1306
  http_only: false,
1273
1307
  secure: false
1274
1308
  };
@@ -1349,8 +1383,7 @@ var j1 = (function () {
1349
1383
  // by the browser if the last session (browser window) is closed.
1350
1384
  // See: https://stackoverflow.com/questions/179355/clearing-all-cookies-with-javascript
1351
1385
  // -------------------------------------------------------------------------
1352
- deleteCookie: function (options) {
1353
- var name = options;
1386
+ deleteCookie: function (name) {
1354
1387
  var all_cookies = document.cookie.split('; ');
1355
1388
 
1356
1389
  if ( name === 'all' ) {
@@ -152,8 +152,9 @@ j1.adapter['justifiedGalleryCustomizer'] = (function (j1, window) {
152
152
  // data loader
153
153
  // ---------------------------------------------------------------------
154
154
  j1.xhrData ({
155
- xhr_container_id: customizerOptions.xhr_container_id,
156
- xhr_data_path: customizerOptions.xhr_data_path },
155
+ xhr_container_id: customizerOptions.xhr_container_id,
156
+ xhr_data_path: customizerOptions.xhr_data_path,
157
+ xhr_data_element: customizerOptions.xhr_data_element },
157
158
  'j1.adapter.gallery_customizer',
158
159
  'null'
159
160
  );
@@ -209,13 +209,17 @@ j1.adapter['mmenu'] = (function (j1, window) {
209
209
  to
210
210
  {% if forloop.last %}'data_loaded'{% else %}'data_loaded'{% endif %}){% if forloop.last %}{% else %},{% endif %}
211
211
  -------------------------------------------------------------------------- {% endcomment %}
212
+
212
213
  {% for item in nav_mmenu_options.menus %} {% if item.menu.enabled %}
213
- {% assign menu_id = item.menu.xhr_container_id %}
214
- {% assign xhr_data_path = item.menu.xhr_data_path %}
214
+
215
+ {% assign menu_id = item.menu.xhr_container_id %}
216
+ {% assign xhr_data_path = item.menu.xhr_data_path %}
217
+ {% assign xhr_data_element = item.menu.xhr_data_element %}
215
218
 
216
219
  j1.xhrData ({
217
- xhr_container_id: '{{menu_id}}',
218
- xhr_data_path: '{{xhr_data_path}}'},
220
+ xhr_container_id: '{{menu_id}}',
221
+ xhr_data_path: '{{xhr_data_path}}',
222
+ xhr_data_element: '{{xhr_data_element}}' },
219
223
  'j1.adapter.mmenu',
220
224
  {% if forloop.last %}'data_loaded'{% else %}'null'{% endif %}){% if forloop.last %};{% else %};{% endif %}
221
225