j1-template 2022.0.9 → 2022.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/themes/j1/modules/ads/google_ad_content_home.html +11 -0
- data/_includes/themes/j1/modules/ads/google_ad_top_home.html +11 -0
- data/apps/public/cc/index.adoc +0 -1
- data/assets/data/article_navigator/index.html +0 -1
- data/assets/data/news_panel_posts/index.html +0 -1
- data/assets/error_pages/HTTP445.html +5 -4
- data/assets/error_pages/HTTP446.html +2 -2
- data/assets/error_pages/HTTP447.html +110 -0
- data/assets/error_pages/HTTP448.html +111 -0
- data/assets/themes/j1/adapter/js/advertising.js +442 -0
- data/assets/themes/j1/adapter/js/algolia.js +10 -13
- data/assets/themes/j1/adapter/js/analytics.js +259 -0
- data/assets/themes/j1/adapter/js/asciidoctor.js +10 -13
- data/assets/themes/j1/adapter/js/attic.js +10 -5
- data/assets/themes/j1/adapter/js/bmd.js +10 -14
- data/assets/themes/j1/adapter/js/carousel.js +10 -13
- data/assets/themes/j1/adapter/js/clipboard.js +9 -10
- data/assets/themes/j1/adapter/js/comments.js +407 -0
- data/assets/themes/j1/adapter/js/cookieConsent.js +107 -84
- data/assets/themes/j1/adapter/js/fab.js +11 -11
- data/assets/themes/j1/adapter/js/framer.js +59 -64
- data/assets/themes/j1/adapter/js/j1.js +203 -258
- data/assets/themes/j1/adapter/js/justifiedGallery.js +12 -14
- data/assets/themes/j1/adapter/js/justifiedGalleryCustomizer.js +10 -13
- data/assets/themes/j1/adapter/js/lightbox.js +12 -9
- data/assets/themes/j1/adapter/js/logger.js +11 -5
- data/assets/themes/j1/adapter/js/mmenu.js +11 -12
- data/assets/themes/j1/adapter/js/navigator.js +13 -12
- data/assets/themes/j1/adapter/js/quicksearch.js +10 -13
- data/assets/themes/j1/adapter/js/rouge.js +11 -14
- data/assets/themes/j1/adapter/js/rtable.js +10 -13
- data/assets/themes/j1/adapter/js/rtextResizer.js +10 -13
- data/assets/themes/j1/adapter/js/scroller.js +14 -12
- data/assets/themes/j1/adapter/js/themer.js +12 -3
- data/assets/themes/j1/adapter/js/toccer.js +10 -13
- data/assets/themes/j1/adapter/js/translator.js +50 -96
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +6 -0
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +13 -5
- data/assets/themes/j1/core/js/template.min.js +1 -1
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/advertising/js/google/adInitializer.js +127 -0
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +11 -2
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +1 -1
- data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.2.js +1 -1
- data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.js +1 -1
- data/assets/themes/j1/modules/scroller/js/scroller.js +1 -1
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/_config.yml +1 -13
- data/lib/starter_web/_data/apps/carousel.yml +2 -2
- data/lib/starter_web/_data/apps/defaults/carousel.yml +3 -2
- data/lib/starter_web/_data/apps/defaults/justifiedGallery.yml +2 -2
- data/lib/starter_web/_data/apps/defaults/justifiedGalleryCustomizer.yml +2 -2
- data/lib/starter_web/_data/apps/defaults/lightGallery.yml +2 -2
- data/lib/starter_web/_data/apps/defaults/lightbox.yml +2 -2
- data/lib/starter_web/_data/apps/justifiedGallery.yml +2 -2
- data/lib/starter_web/_data/apps/justifiedGalleryCustomizer.yml +2 -2
- data/lib/starter_web/_data/apps/lightGallery.yml +2 -2
- data/lib/starter_web/_data/apps/lightbox.yml +2 -2
- data/lib/starter_web/_data/blocks/banner.yml +3 -2
- data/lib/starter_web/_data/blocks/defaults/banner.yml +9 -0
- data/lib/starter_web/_data/blocks/defaults/footer.yml +9 -0
- data/lib/starter_web/_data/blocks/defaults/panel.yml +9 -0
- data/lib/starter_web/_data/blocks/footer.yml +3 -2
- data/lib/starter_web/_data/blocks/panel.yml +3 -2
- data/lib/starter_web/_data/builder/blog_navigator.yml +3 -2
- data/lib/starter_web/_data/builder/defaults/blog_navigator.yml +8 -8
- data/lib/starter_web/_data/j1_config.yml +0 -116
- data/lib/starter_web/_data/layouts/default.yml +21 -21
- data/lib/starter_web/_data/layouts/home.ads.yml +262 -0
- data/lib/starter_web/_data/layouts/home.no-ads.yml +262 -0
- data/lib/starter_web/_data/layouts/home.yml +24 -0
- data/lib/starter_web/_data/layouts/page.yml +7 -18
- data/lib/starter_web/_data/layouts/post.yml +0 -11
- data/lib/starter_web/_data/modules/advertising.yml +139 -12
- data/lib/starter_web/_data/modules/analytics.yml +99 -0
- data/lib/starter_web/_data/modules/attics.yml +3 -2
- data/lib/starter_web/_data/modules/comments.yml +55 -0
- data/lib/starter_web/_data/modules/cookieconsent.yml +2 -1
- data/lib/starter_web/_data/modules/cookies.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/advertising.yml +105 -0
- data/lib/starter_web/_data/modules/defaults/analytics.yml +93 -0
- data/lib/starter_web/_data/modules/defaults/attics.yml +3 -2
- data/lib/starter_web/_data/modules/defaults/authentication.yml +51 -48
- data/lib/starter_web/_data/modules/defaults/comments.yml +114 -0
- data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +3 -3
- data/lib/starter_web/_data/modules/defaults/cookies.yml +105 -26
- data/lib/starter_web/_data/modules/defaults/fab.yml +4 -2
- data/lib/starter_web/_data/modules/defaults/framer.yml +2 -3
- data/lib/starter_web/_data/modules/defaults/log4javascript.yml +3 -2
- data/lib/starter_web/_data/modules/defaults/log4r.yml +2 -2
- data/lib/starter_web/_data/modules/defaults/navigator.yml +4 -2
- data/lib/starter_web/_data/modules/defaults/quicksearch.yml +4 -3
- data/lib/starter_web/_data/modules/defaults/rtable.yml +3 -2
- data/lib/starter_web/_data/modules/defaults/scoller.yml +3 -2
- data/lib/starter_web/_data/modules/defaults/themer.yml +119 -118
- data/lib/starter_web/_data/modules/defaults/toccer.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/translator.yml +1 -1
- data/lib/starter_web/_data/modules/fab.yml +3 -2
- data/lib/starter_web/_data/modules/framer.yml +3 -4
- data/lib/starter_web/_data/modules/log4r.yml +2 -2
- data/lib/starter_web/_data/modules/navigator.yml +4 -2
- data/lib/starter_web/_data/modules/quicksearch.yml +3 -3
- data/lib/starter_web/_data/modules/rtable.yml +3 -3
- data/lib/starter_web/_data/modules/scroller.yml +2 -3
- data/lib/starter_web/_data/modules/themer.yml +2 -3
- data/lib/starter_web/_data/modules/toccer.yml +3 -3
- data/lib/starter_web/_data/modules/translator.yml +1 -1
- data/lib/starter_web/_data/plugins/defaults/paginator.yml +2 -2
- data/lib/starter_web/_data/plugins/paginator.yml +2 -2
- data/lib/starter_web/_data/resources.yml +447 -290
- data/lib/starter_web/_includes/attributes.asciidoc +1 -1
- data/lib/starter_web/_includes/themes/j1/modules/ads/google_ad_content_home.html +11 -0
- data/lib/starter_web/_includes/themes/j1/modules/ads/google_ad_top_home.html +11 -0
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.adoc +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.ads.asciidoc +196 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.comments.asciidoc +182 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-02-01-site-generators.adoc +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-03-about-j1.adoc +1 -1
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-wiki-series.adoc +1 -1
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-wiki-series.adoc +1 -1
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-wiki-series.adoc +1 -1
- data/lib/starter_web/index.html +0 -4
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +0 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +0 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +0 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +0 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +0 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +0 -1
- data/lib/starter_web/pages/public/blog/navigator/archive.html +0 -1
- data/lib/starter_web/pages/public/blog/navigator/index.html +0 -1
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +4 -3
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.ads.asciidoc +265 -0
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.base.asciidoc +237 -0
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.comments.asciidoc +237 -0
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +62 -0
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/google-ad.js +130 -0
- data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +0 -1
- data/lib/starter_web/pages/public/legal/en/200_impress.adoc +0 -1
- data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +0 -1
- data/lib/starter_web/pages/public/manuals/dropdown-help.adoc +23 -2
- data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +100 -166
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +25 -70
- data/_includes/themes/j1/blocks/ads/ad.html +0 -64
- data/_includes/themes/j1/modules/boards/news_pin_board.html +0 -183
- data/_includes/themes/j1/modules/connectors/ad/custom-provider.html +0 -30
- data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +0 -62
- data/_includes/themes/j1/modules/connectors/ads +0 -56
- data/_includes/themes/j1/modules/connectors/analytic/custom-provider.html +0 -32
- data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +0 -30
- data/_includes/themes/j1/modules/connectors/analytics +0 -60
- data/_includes/themes/j1/modules/connectors/comment/commento.html +0 -31
- data/_includes/themes/j1/modules/connectors/comment/custom-provider.html +0 -30
- data/_includes/themes/j1/modules/connectors/comment/disqus.html +0 -32
- data/_includes/themes/j1/modules/connectors/comment/facebook.html +0 -30
- data/_includes/themes/j1/modules/connectors/comment/hyvor.html +0 -32
- data/_includes/themes/j1/modules/connectors/comment/just-comments.html +0 -31
- data/_includes/themes/j1/modules/connectors/comments +0 -64
- data/_includes/themes/j1/modules/connectors/sharing +0 -29
- data/_includes/themes/j1/modules/connectors/survey/custom-provider.html +0 -30
- data/_includes/themes/j1/modules/connectors/survey/jotform.html +0 -32
- data/_includes/themes/j1/modules/connectors/surveys +0 -58
- data/_includes/themes/j1/modules/connectors/translator +0 -58
- data/_includes/themes/j1/modules/connectors/translators/custom-translator.html +0 -32
- data/_includes/themes/j1/modules/connectors/translators/google-translator.html +0 -53
- data/_includes/themes/j1/modules/search/algolia.html +0 -181
- data/_includes/themes/j1/modules/search/docsearch.html +0 -42
- data/assets/data/disqus.js +0 -81
- data/assets/data/hyvor.js +0 -72
- data/lib/starter_web/pages/_test_pages/100_side-bar-tester.adoc +0 -244
- data/lib/starter_web/pages/_test_pages/_includes/attributes.asciidoc +0 -110
- data/lib/starter_web/pages/_test_pages/_includes/documents/100_gistblock.asciidoc +0 -28
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_info.asciidoc +0 -14
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_left_warning.asciidoc +0 -11
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_right_danger.asciidoc +0 -11
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_central_success.asciidoc +0 -11
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_full_height_left_info.asciidoc +0 -11
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_full_height_right_success.asciidoc +0 -11
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_table_bs_modal_examples.asciidoc +0 -47
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_info.asciidoc +0 -11
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_left_info.asciidoc +0 -11
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_right_success.asciidoc +0 -11
- data/lib/starter_web/pages/_test_pages/_includes/documents/419_advanced_modals_demo.asciidoc +0 -337
- data/lib/starter_web/pages/_test_pages/_includes/documents/tables/bs_modal_examples.asciidoc +0 -47
- data/lib/starter_web/pages/_test_pages/accordion-01-tester.adoc +0 -220
- data/lib/starter_web/pages/_test_pages/accordion-02-tester.adoc +0 -177
- data/lib/starter_web/pages/_test_pages/accordion-03-tester.adoc +0 -148
- data/lib/starter_web/pages/_test_pages/attribute-changes-01-tester.adoc +0 -226
- data/lib/starter_web/pages/_test_pages/backdrop-tester.adoc +0 -109
- data/lib/starter_web/pages/_test_pages/button-tester-1.adoc +0 -127
- data/lib/starter_web/pages/_test_pages/card-tester.adoc +0 -128
- data/lib/starter_web/pages/_test_pages/cookieConsent.adoc +0 -96
- data/lib/starter_web/pages/_test_pages/deepl.0.adoc +0 -258
- data/lib/starter_web/pages/_test_pages/deepl.adoc +0 -204
- data/lib/starter_web/pages/_test_pages/desandro-button.adoc +0 -171
- data/lib/starter_web/pages/_test_pages/desandro.adoc +0 -147
- data/lib/starter_web/pages/_test_pages/flipcard-1-tester.adoc +0 -308
- data/lib/starter_web/pages/_test_pages/formular-01-tester.adoc +0 -167
- data/lib/starter_web/pages/_test_pages/formular-02-tester.adoc +0 -727
- data/lib/starter_web/pages/_test_pages/google-translate-tester.0.adoc +0 -113
- data/lib/starter_web/pages/_test_pages/google-translate-tester.1.adoc +0 -231
- data/lib/starter_web/pages/_test_pages/google-translate-tester.3.adoc +0 -149
- data/lib/starter_web/pages/_test_pages/google-translate-tester.4.adoc +0 -237
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-2.adoc +0 -183
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-3.adoc +0 -235
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-4.adoc +0 -222
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-5.adoc +0 -119
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester.1.adoc +0 -236
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester.adoc +0 -225
- data/lib/starter_web/pages/_test_pages/list-group-tester.adoc +0 -265
- data/lib/starter_web/pages/_test_pages/tictok.adoc +0 -127
@@ -0,0 +1,407 @@
|
|
1
|
+
---
|
2
|
+
regenerate: true
|
3
|
+
---
|
4
|
+
|
5
|
+
{% capture cache %}
|
6
|
+
|
7
|
+
{% comment %}
|
8
|
+
# -----------------------------------------------------------------------------
|
9
|
+
# ~/assets/themes/j1/adapter/js/comments.js
|
10
|
+
# Liquid template to adapt the Comments module
|
11
|
+
#
|
12
|
+
# Product/Info:
|
13
|
+
# https://jekyll.one
|
14
|
+
# Copyright (C) 2021 Juergen Adams
|
15
|
+
#
|
16
|
+
# J1 Template is licensed under the MIT License.
|
17
|
+
# For details, see https://jekyll.one
|
18
|
+
# -----------------------------------------------------------------------------
|
19
|
+
# Test data:
|
20
|
+
# {{ liquid_var | debug }}
|
21
|
+
# comments_options: {{ comments_options | 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 asset_path = "/assets/themes/j1" %}
|
32
|
+
|
33
|
+
{% comment %} Process YML config data
|
34
|
+
================================================================================ {% endcomment %}
|
35
|
+
|
36
|
+
{% comment %} Set config files
|
37
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
38
|
+
{% assign template_config = site.data.j1_config %}
|
39
|
+
{% assign blocks = site.data.blocks %}
|
40
|
+
{% assign modules = site.data.modules %}
|
41
|
+
|
42
|
+
{% comment %} Set config data (settings only)
|
43
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
44
|
+
{% assign comments_defaults = modules.defaults.comments.defaults %}
|
45
|
+
{% assign comments_settings = modules.comments.settings %}
|
46
|
+
|
47
|
+
{% comment %} Set config options (settings only)
|
48
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
49
|
+
{% assign comments_options = comments_defaults | merge: comments_settings %}
|
50
|
+
|
51
|
+
{% comment %} Variables
|
52
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
53
|
+
{% assign comments = comments_options.enabled %}
|
54
|
+
{% assign comments_provider = comments_options.provider %}
|
55
|
+
|
56
|
+
{% if comments_provider == 'disqus' %}
|
57
|
+
{% assign site_id = comments_options.disqus.site_id %}
|
58
|
+
{% elsif comments_provider == 'hyvor' %}
|
59
|
+
{% assign site_id = comments_options.hyvor.site_id %}
|
60
|
+
{% elsif comments_provider == 'commento' %}
|
61
|
+
{% assign site_id = comments_options.commento.site_id %}
|
62
|
+
{% elsif comments_provider == 'just-comments' %}
|
63
|
+
{% assign site_id = comments_options.just-comments.site_id %}
|
64
|
+
{% elsif comments_provider == 'facebook' %}
|
65
|
+
{% assign site_id = comments_options.facebook.site_id %}
|
66
|
+
{% else %}
|
67
|
+
{% assign site_id = false %}
|
68
|
+
{% endif %}
|
69
|
+
|
70
|
+
{% comment %} language detection
|
71
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
72
|
+
{% if site.language == "en" %}
|
73
|
+
{% assign language = "en" %}
|
74
|
+
{% elsif site.language == "de"%}
|
75
|
+
{% assign language = "de" %}
|
76
|
+
{% else %}
|
77
|
+
{% assign language = "en" %}
|
78
|
+
{% endif %}
|
79
|
+
|
80
|
+
{% if language == "en" %}
|
81
|
+
{% assign comments_headline = comments_options.comments_headline.en %}
|
82
|
+
{% endif %}
|
83
|
+
|
84
|
+
{% if language == "de" %}
|
85
|
+
{% assign comments_headline = comments_options.comments_headline.de %}
|
86
|
+
{% endif %}
|
87
|
+
|
88
|
+
{% assign production = false %}
|
89
|
+
{% if environment == 'prod' or environment == 'production' %}
|
90
|
+
{% assign production = true %}
|
91
|
+
{% endif %}
|
92
|
+
|
93
|
+
/*
|
94
|
+
# -----------------------------------------------------------------------------
|
95
|
+
# ~/assets/themes/j1/adapter/js/comments.js
|
96
|
+
# J1 Adapter for the comments module
|
97
|
+
#
|
98
|
+
# Product/Info:
|
99
|
+
# https://jekyll.one
|
100
|
+
#
|
101
|
+
# Copyright (C) 2021 Juergen Adams
|
102
|
+
#
|
103
|
+
# J1 Template is licensed under the MIT License.
|
104
|
+
# For details, see https://jekyll.one
|
105
|
+
# -----------------------------------------------------------------------------
|
106
|
+
# Adapter generated: {{site.time}}
|
107
|
+
# -----------------------------------------------------------------------------
|
108
|
+
*/
|
109
|
+
|
110
|
+
// -----------------------------------------------------------------------------
|
111
|
+
// ESLint shimming
|
112
|
+
// -----------------------------------------------------------------------------
|
113
|
+
/* eslint indent: "off" */
|
114
|
+
// -----------------------------------------------------------------------------
|
115
|
+
'use strict';
|
116
|
+
j1.adapter.comments = (function (j1, window) {
|
117
|
+
|
118
|
+
{% comment %} Set global variables
|
119
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
120
|
+
var environment = '{{environment}}';
|
121
|
+
var date = new Date();
|
122
|
+
var timestamp_now = date.toISOString();
|
123
|
+
var comments_provider = '{{comments_provider}}';
|
124
|
+
var dqApiScript = document.createElement('script');
|
125
|
+
var hvApiScript = document.createElement('script');
|
126
|
+
var hvCallbackScript = document.createElement('script');
|
127
|
+
var providerID = '{{site_id}}';
|
128
|
+
var validProviderID = (providerID.includes('your')) ? false : true;
|
129
|
+
var comments_headline = '{{comments_headline}}';
|
130
|
+
var cookie_names = j1.getCookieNames();
|
131
|
+
var user_consent;
|
132
|
+
var _this;
|
133
|
+
var logger;
|
134
|
+
var logText;
|
135
|
+
|
136
|
+
// ---------------------------------------------------------------------------
|
137
|
+
// Main object
|
138
|
+
// ---------------------------------------------------------------------------
|
139
|
+
return {
|
140
|
+
|
141
|
+
// -------------------------------------------------------------------------
|
142
|
+
// init()
|
143
|
+
// adapter initializer
|
144
|
+
// -------------------------------------------------------------------------
|
145
|
+
init: function (options) {
|
146
|
+
|
147
|
+
{% if comments %}
|
148
|
+
// [INFO ] [j1.adapter.comments ] [ detected comments provider (j1_config): {{comments_provider}}} ]
|
149
|
+
// [INFO ] [j1.adapter.comments ] [ start processing load region head, layout: {{page.layout}} ]
|
150
|
+
|
151
|
+
// -----------------------------------------------------------------------
|
152
|
+
// Default module settings
|
153
|
+
// -----------------------------------------------------------------------
|
154
|
+
var settings = $.extend({
|
155
|
+
module_name: 'j1.adapter.comments',
|
156
|
+
generated: '{{site.time}}'
|
157
|
+
}, options);
|
158
|
+
|
159
|
+
// -----------------------------------------------------------------------
|
160
|
+
// Global variable settings
|
161
|
+
// -----------------------------------------------------------------------
|
162
|
+
|
163
|
+
{% if site_id %}
|
164
|
+
|
165
|
+
_this = j1.adapter.comments;
|
166
|
+
logger = log4javascript.getLogger('j1.adapter.comments');
|
167
|
+
|
168
|
+
{% case comments_provider %}
|
169
|
+
{% when "hyvor" %}
|
170
|
+
// [INFO ] [j1.adapter.comments ] [ place provider: Hyvor Talk ]
|
171
|
+
|
172
|
+
var dependencies_met_page_ready = setInterval(function() {
|
173
|
+
if (j1.getState() == 'finished') {
|
174
|
+
|
175
|
+
if (!validProviderID) {
|
176
|
+
logger.warn('\n' + 'invalid site id detected for Hyvor Talk: ' + providerID);
|
177
|
+
logger.info('\n' + 'skip initialization for provider: ' + comments_provider);
|
178
|
+
clearInterval(dependencies_met_page_ready);
|
179
|
+
return false;
|
180
|
+
}
|
181
|
+
|
182
|
+
// initialize state flag, issue init message
|
183
|
+
// -------------------------------------------------------------------
|
184
|
+
_this.setState('started');
|
185
|
+
logger.info('\n' + 'state: ' + _this.getState());
|
186
|
+
logger.info('\n' + 'module is being initialized for provider: ' + comments_provider);
|
187
|
+
|
188
|
+
// place|remove initialization code
|
189
|
+
// -------------------------------------------------------------------
|
190
|
+
user_consent = j1.readCookie(cookie_names.user_consent);
|
191
|
+
if (user_consent.personalization) {
|
192
|
+
// enable Hyvor Talk
|
193
|
+
// -----------------------------------------------------------------
|
194
|
+
$('#main-content').append('<h2 id="leave-a-comment" class="mt-4">{{comments_headline}}</h2>');
|
195
|
+
logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
|
196
|
+
logger.info('\n' + 'enable comments provider' + ' {{comments_provider}} on siteID: ' + providerID);
|
197
|
+
|
198
|
+
// add Hyvor Talk Web API
|
199
|
+
// NOTE: don't change the script id
|
200
|
+
// -----------------------------------------------------------------
|
201
|
+
hvApiScript.id = 'hyvor-embed';
|
202
|
+
hvApiScript.src = '//talk.hyvor.com/web-api/embed.js';
|
203
|
+
hvApiScript.async = true;
|
204
|
+
document.head.appendChild(hvApiScript);
|
205
|
+
|
206
|
+
// add Hyvor Talk callback script
|
207
|
+
// -----------------------------------------------------------------
|
208
|
+
hvCallbackScript.id = 'hyvor-callback';
|
209
|
+
hvCallbackScript.text = '\n';
|
210
|
+
hvCallbackScript.text += 'var HYVOR_TALK_WEBSITE = ' + providerID + '\n';
|
211
|
+
hvCallbackScript.text += 'var HYVOR_TALK_CONFIG = {' + '\n';
|
212
|
+
hvCallbackScript.text += ' url: false,' + '\n';
|
213
|
+
hvCallbackScript.text += ' id: false' + '\n';
|
214
|
+
hvCallbackScript.text += ' };' + '\n';
|
215
|
+
document.head.appendChild(hvCallbackScript);
|
216
|
+
|
217
|
+
// add Hyvor Talk comment container
|
218
|
+
// NOTE: don't change the div id
|
219
|
+
// -----------------------------------------------------------------
|
220
|
+
$('#main-content').append('<div id="hyvor-talk-view"></div>');
|
221
|
+
|
222
|
+
// add recommended title to the comments iframe for SEO optimization
|
223
|
+
// -------------------------------------------------------------------
|
224
|
+
var dependencies_met_load_provider_finished = setInterval (function () {
|
225
|
+
if ($('#hyvor-talk-view').children().length) {
|
226
|
+
$('#hyvor-talk-iframe').prop('title', 'Hyvor comments iframe');
|
227
|
+
clearInterval(dependencies_met_load_provider_finished);
|
228
|
+
}
|
229
|
+
}, 25);
|
230
|
+
} else {
|
231
|
+
// disable Hyvor Talk
|
232
|
+
// -----------------------------------------------------------------
|
233
|
+
logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
|
234
|
+
logger.warn('\n' + 'disable Hyvor Talk on site id: ' + providerID);
|
235
|
+
|
236
|
+
// remove Hyvor Talk resources
|
237
|
+
// -----------------------------------------------------------------
|
238
|
+
$('#leave-a-comment').remove();
|
239
|
+
$('#hyvor-embed').remove();
|
240
|
+
$('#hyvor-callback').remove();
|
241
|
+
$('#hyvor-talk-view').remove();
|
242
|
+
}
|
243
|
+
clearInterval(dependencies_met_page_ready);
|
244
|
+
} // END if getState 'finished'
|
245
|
+
}, 25);
|
246
|
+
|
247
|
+
{% when "disqus" %}
|
248
|
+
// [INFO ] [j1.adapter.comments ] [ place provider: Disqus ]
|
249
|
+
var dependencies_met_page_ready = setInterval(function() {
|
250
|
+
if (j1.getState() == 'finished') {
|
251
|
+
|
252
|
+
if (!validProviderID) {
|
253
|
+
logger.warn('\n' + 'invalid short name detected for Disqus: ' + providerID);
|
254
|
+
logger.info('\n' + 'skip initialization for provider: ' + comments_provider);
|
255
|
+
clearInterval(dependencies_met_page_ready);
|
256
|
+
return;
|
257
|
+
}
|
258
|
+
|
259
|
+
// initialize state flag, issue init message
|
260
|
+
// -------------------------------------------------------------------
|
261
|
+
_this.setState('started');
|
262
|
+
logger.info('\n' + 'state: ' + _this.getState());
|
263
|
+
logger.info('\n' + 'module is being initialized for provider: ' + comments_provider);
|
264
|
+
|
265
|
+
// place|remove initialization code
|
266
|
+
// -------------------------------------------------------------------
|
267
|
+
user_consent = j1.readCookie(cookie_names.user_consent);
|
268
|
+
if (user_consent.personalization) {
|
269
|
+
$('#main-content').append('<h2 id="leave-a-comment" class="mt-4">{{comments_headline}}</h2>');
|
270
|
+
logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
|
271
|
+
logger.info('\n' + 'enable comments provider' + ' {{comments_provider}} on short name: ' + providerID);
|
272
|
+
|
273
|
+
// old Disqus Web API init
|
274
|
+
// -----------------------------------------------------------------
|
275
|
+
// var disqus_shortname = '{{site_id}}';
|
276
|
+
// // -----------------------------------------------------------------
|
277
|
+
// // RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE
|
278
|
+
// // SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
|
279
|
+
// // LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT:
|
280
|
+
// // https://disqus.com/admin/universalcode/#configuration-variables
|
281
|
+
// // -----------------------------------------------------------------
|
282
|
+
// //
|
283
|
+
// // var disqus_config = function () {
|
284
|
+
// // this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
|
285
|
+
// // Replace PAGE_IDENTIFIER with your page's unique
|
286
|
+
// // identifier variable
|
287
|
+
// // this.page.identifier = PAGE_IDENTIFIER;
|
288
|
+
// // };
|
289
|
+
// //
|
290
|
+
// // DON'T EDIT BELOW THIS LINE
|
291
|
+
// // -----------------------------------------------------------------
|
292
|
+
// (function() {
|
293
|
+
// var d = document,
|
294
|
+
// s = d.createElement('script');
|
295
|
+
// s.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
296
|
+
// s.setAttribute('data-timestamp', +new Date());
|
297
|
+
// (d.head || d.body).appendChild(s);
|
298
|
+
// })();
|
299
|
+
|
300
|
+
// add|initialize Disqus Web API
|
301
|
+
// -----------------------------------------------------------------
|
302
|
+
dqApiScript.id = 'dq-web-api';
|
303
|
+
dqApiScript.src = '//' + providerID + '.disqus.com/embed.js";'
|
304
|
+
dqApiScript.setAttribute("data-timestamp", '"' + timestamp_now + '"');
|
305
|
+
document.head.appendChild(dqApiScript);
|
306
|
+
|
307
|
+
// add Disqus comment container
|
308
|
+
// -----------------------------------------------------------------
|
309
|
+
$('#main-content').append('<div id="disqus_thread"></div>');
|
310
|
+
} else {
|
311
|
+
logger.info('\n' + 'user consent on comments: ' + user_consent.personalization);
|
312
|
+
logger.warn('\n' + 'disable comments provider' + ' {{comments_provider}} on short name: ' + providerID);
|
313
|
+
$('#leave-a-comment').remove();
|
314
|
+
$('#dq-web-api').remove();
|
315
|
+
$('#hdisqus_thread').remove();
|
316
|
+
}
|
317
|
+
|
318
|
+
// add recommended title to the comments iframe for SEO optimization
|
319
|
+
// -------------------------------------------------------------------
|
320
|
+
// var dependencies_met_load_provider_finished = setInterval (function () {
|
321
|
+
// if ($('#disqus_thread').children().length) {
|
322
|
+
// $('#hyvor-talk-iframe').prop('title', 'Disqus comments iframe');
|
323
|
+
// clearInterval(dependencies_met_load_provider_finished);
|
324
|
+
// }
|
325
|
+
// }, 25);
|
326
|
+
|
327
|
+
clearInterval(dependencies_met_page_ready);
|
328
|
+
} // END if getState 'finished'
|
329
|
+
}, 25);
|
330
|
+
|
331
|
+
{% endcase %}
|
332
|
+
// [INFO ] [j1.adapter.comments ] [ end processing ]
|
333
|
+
{% else %}
|
334
|
+
var dependencies_met_page_ready = setInterval(function() {
|
335
|
+
if (j1.getState() == 'finished') {
|
336
|
+
logger = log4javascript.getLogger('j1.adapter.comments');
|
337
|
+
logger.warn('\n' + 'provider or site ID for comment services wrong or not set');
|
338
|
+
clearInterval(dependencies_met_page_ready);
|
339
|
+
}
|
340
|
+
}, 25);
|
341
|
+
{% endif %}
|
342
|
+
|
343
|
+
{% else %}
|
344
|
+
var dependencies_met_page_ready = setInterval(function() {
|
345
|
+
if (j1.getState() == 'finished') {
|
346
|
+
logger = log4javascript.getLogger('j1.adapter.comments');
|
347
|
+
logger.info('\n' + 'comment services: disabled');
|
348
|
+
clearInterval(dependencies_met_page_ready);
|
349
|
+
}
|
350
|
+
}, 25);
|
351
|
+
{% endif %}
|
352
|
+
return;
|
353
|
+
}, // END init
|
354
|
+
|
355
|
+
// -------------------------------------------------------------------------
|
356
|
+
// messageHandler()
|
357
|
+
// manage messages send from other J1 modules
|
358
|
+
// -------------------------------------------------------------------------
|
359
|
+
messageHandler: function (sender, message) {
|
360
|
+
var json_message = JSON.stringify(message, undefined, 2);
|
361
|
+
|
362
|
+
logText = '\n' + 'received message from ' + sender + ': ' + json_message;
|
363
|
+
logger.debug(logText);
|
364
|
+
|
365
|
+
// -----------------------------------------------------------------------
|
366
|
+
// Process commands|actions
|
367
|
+
// -----------------------------------------------------------------------
|
368
|
+
if (message.type === 'command' && message.action === 'module_initialized') {
|
369
|
+
//
|
370
|
+
// Place handling of command|action here
|
371
|
+
//
|
372
|
+
logger.info('\n' + message.text);
|
373
|
+
}
|
374
|
+
|
375
|
+
//
|
376
|
+
// Place handling of other command|action here
|
377
|
+
//
|
378
|
+
|
379
|
+
return true;
|
380
|
+
}, // END messageHandler
|
381
|
+
|
382
|
+
// -------------------------------------------------------------------------
|
383
|
+
// setState()
|
384
|
+
// Sets the current (processing) state of the module
|
385
|
+
// -------------------------------------------------------------------------
|
386
|
+
setState: function (stat) {
|
387
|
+
_this.state = stat;
|
388
|
+
}, // END setState
|
389
|
+
|
390
|
+
// -------------------------------------------------------------------------
|
391
|
+
// getState()
|
392
|
+
// Returns the current (processing) state of the module
|
393
|
+
// -------------------------------------------------------------------------
|
394
|
+
getState: function () {
|
395
|
+
return _this.state;
|
396
|
+
} // END getState
|
397
|
+
|
398
|
+
}; // END return
|
399
|
+
})(j1, window);
|
400
|
+
|
401
|
+
{% endcapture %}
|
402
|
+
{% if production %}
|
403
|
+
{{ cache | minifyJS }}
|
404
|
+
{% else %}
|
405
|
+
{{ cache | strip_empty_lines }}
|
406
|
+
{% endif %}
|
407
|
+
{% assign cache = nil %}
|