j1-template 2021.1.4 → 2021.1.9

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