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
@@ -37,15 +37,16 @@ regenerate: true
|
|
37
37
|
-------------------------------------------------------------------------------- {% endcomment %}
|
38
38
|
{% assign cookie_defaults = modules.defaults.cookies.defaults %}
|
39
39
|
{% assign cookie_settings = modules.cookies.settings %}
|
40
|
-
|
41
40
|
{% assign translator_defaults = modules.defaults.translator.defaults %}
|
42
41
|
{% assign translator_settings = modules.translator.settings %}
|
43
|
-
{% assign tracking_enabled = template_config.analytics.enabled %}
|
44
42
|
|
45
43
|
{% comment %} Set config options
|
46
44
|
-------------------------------------------------------------------------------- {% endcomment %}
|
47
|
-
{% assign translator_options = translator_defaults | merge: translator_settings %}
|
48
45
|
{% assign cookie_options = cookie_defaults | merge: cookie_settings %}
|
46
|
+
{% assign translator_options = translator_defaults | merge: translator_settings %}
|
47
|
+
|
48
|
+
{% comment %} Set variables
|
49
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
49
50
|
|
50
51
|
{% assign production = false %}
|
51
52
|
{% if environment == 'prod' or environment == 'production' %}
|
@@ -81,12 +82,8 @@ regenerate: true
|
|
81
82
|
// https://www.marghoobsuleman.com/image-dropdown/advanced-help
|
82
83
|
'use strict';
|
83
84
|
|
84
|
-
|
85
|
-
-------------------------------------------------------------------------------- {% endcomment %}
|
86
|
-
j1.adapter['translator'] = (function (j1, window) {
|
87
|
-
|
85
|
+
j1.adapter.translator = (function (j1, window) {
|
88
86
|
var environment = '{{environment}}';
|
89
|
-
var tracking_enabled = ('{{tracking_enabled}}' === 'true') ? true: false; // Analytics/GA enabled?
|
90
87
|
var moduleOptions = {};
|
91
88
|
var user_translate = {};
|
92
89
|
var _this;
|
@@ -106,69 +103,11 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
106
103
|
var translation_language;
|
107
104
|
var ddSourceLanguage;
|
108
105
|
var head;
|
109
|
-
var
|
106
|
+
var gtTranslateScript;
|
107
|
+
var gtCallbackScript;
|
110
108
|
var languageList;
|
111
109
|
var domainAttribute;
|
112
110
|
|
113
|
-
// ---------------------------------------------------------------------------
|
114
|
-
// helper functions
|
115
|
-
// ---------------------------------------------------------------------------
|
116
|
-
|
117
|
-
// ---------------------------------------------------------------------------
|
118
|
-
// setCookie()
|
119
|
-
// writes a FLAT cookie (not using an encoded JSON string)
|
120
|
-
// ---------------------------------------------------------------------------
|
121
|
-
// function setCookie(options /*cName, cValue, expDays*/) {
|
122
|
-
// var date = new Date();
|
123
|
-
// var timestamp_now = date.toISOString()
|
124
|
-
// var url = new liteURL(window.location.href);
|
125
|
-
// var baseUrl = url.origin;;
|
126
|
-
// var hostname = url.hostname;
|
127
|
-
// var domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
|
128
|
-
// var domain_enabled = '{{cookie_options.domain}}';
|
129
|
-
// var defaults = {};
|
130
|
-
// var settings;
|
131
|
-
// var document_cookie;
|
132
|
-
// var stringifiedAttributes = '';
|
133
|
-
//
|
134
|
-
// defaults = {
|
135
|
-
// name: '',
|
136
|
-
// path: '/',
|
137
|
-
// expires: 0,
|
138
|
-
// domain: true,
|
139
|
-
// samesite: 'Lax',
|
140
|
-
// http_only: false,
|
141
|
-
// secure: false
|
142
|
-
// };
|
143
|
-
// settings = $.extend(defaults, options);
|
144
|
-
//
|
145
|
-
// stringifiedAttributes += '; ' + 'path=' + settings.path;
|
146
|
-
//
|
147
|
-
// if (settings.expires > 0) {
|
148
|
-
// date.setTime(date.getTime() + (settings.expires * 24 * 60 * 60 * 1000));
|
149
|
-
// stringifiedAttributes += '; ' + 'expires=' + date.toUTCString();
|
150
|
-
// }
|
151
|
-
//
|
152
|
-
// if (domain != hostname) {
|
153
|
-
// // settings.domain = domain_enabled ? '.' + domain : hostname;
|
154
|
-
// settings.domain = domain_enabled ? domain : hostname;
|
155
|
-
// } else {
|
156
|
-
// settings.domain = hostname;
|
157
|
-
// }
|
158
|
-
// stringifiedAttributes += '; ' + 'domain=' + settings.domain;
|
159
|
-
//
|
160
|
-
// stringifiedAttributes += '; ' + 'SameSite=' + settings.samesite;
|
161
|
-
//
|
162
|
-
// if (settings.secure) {
|
163
|
-
// stringifiedAttributes += '; ' + 'secure=' + settings.secure;
|
164
|
-
// }
|
165
|
-
//
|
166
|
-
// // document_cookie = settings.name + '=' + settings.data + '; path=' + settings.path + '; ' + 'domain=' + settings.domain + '; ' + 'SameSite=' + settings.samesite + ';';
|
167
|
-
// document_cookie = settings.name + '=' + settings.data + stringifiedAttributes;
|
168
|
-
//
|
169
|
-
// document.cookie = document_cookie;
|
170
|
-
// };
|
171
|
-
|
172
111
|
// ---------------------------------------------------------------------------
|
173
112
|
// Main object
|
174
113
|
// ---------------------------------------------------------------------------
|
@@ -180,7 +119,15 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
180
119
|
init: function (options) {
|
181
120
|
|
182
121
|
// -----------------------------------------------------------------------
|
183
|
-
//
|
122
|
+
// Default module settings
|
123
|
+
// -----------------------------------------------------------------------
|
124
|
+
var settings = $.extend({
|
125
|
+
module_name: 'j1.adapter.translator',
|
126
|
+
generated: '{{site.time}}'
|
127
|
+
}, options);
|
128
|
+
|
129
|
+
// -----------------------------------------------------------------------
|
130
|
+
// Global variable settings
|
184
131
|
// -----------------------------------------------------------------------
|
185
132
|
_this = j1.adapter.translator;
|
186
133
|
logger = log4javascript.getLogger('j1.adapter.translator');
|
@@ -193,9 +140,11 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
193
140
|
translation_language = navigator_language.split('-')[0];
|
194
141
|
cookie_names = j1.getCookieNames();
|
195
142
|
head = document.getElementsByTagName('head')[0];
|
196
|
-
|
197
|
-
|
198
|
-
|
143
|
+
gtTranslateScript = document.createElement('script');
|
144
|
+
gtTranslateScript.id = 'gt-translate';
|
145
|
+
gtTranslateScript.src = '//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit';
|
146
|
+
gtCallbackScript = document.createElement('script');
|
147
|
+
gtCallbackScript.id = 'gt-callback';
|
199
148
|
|
200
149
|
user_translate = {
|
201
150
|
'translatorName': 'google',
|
@@ -210,14 +159,6 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
210
159
|
// initialize state flag
|
211
160
|
_this.state = 'pending';
|
212
161
|
|
213
|
-
// -----------------------------------------------------------------------
|
214
|
-
// Default module settings
|
215
|
-
// -----------------------------------------------------------------------
|
216
|
-
var settings = $.extend({
|
217
|
-
module_name: 'j1.adapter.translator',
|
218
|
-
generated: '{{site.time}}'
|
219
|
-
}, options);
|
220
|
-
|
221
162
|
{% comment %} Load module config from yml data
|
222
163
|
-------------------------------------------------------------------------- {% endcomment %}
|
223
164
|
// Load module DEFAULTS|CONFIG
|
@@ -229,6 +170,19 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
229
170
|
moduleOptions = j1.mergeData(moduleOptions, settings);
|
230
171
|
}
|
231
172
|
|
173
|
+
// add GT callback script dynamically in the head section
|
174
|
+
// -----------------------------------------------------------------------
|
175
|
+
gtCallbackScript.text = '\n';
|
176
|
+
gtCallbackScript.text += 'function googleTranslateElementInit() {' + '\n';
|
177
|
+
gtCallbackScript.text += ' var gtAPI = new google.translate.TranslateElement({' + '\n';
|
178
|
+
gtCallbackScript.text += ' pageLanguage: "{{translator_options.contentLanguage}}",' + '\n';
|
179
|
+
gtCallbackScript.text += ' layout: google.translate.TranslateElement.FloatPosition.TOP_LEFT' + '\n';
|
180
|
+
gtCallbackScript.text += ' },' + '\n';
|
181
|
+
gtCallbackScript.text += ' "google_translate_element");' + '\n';
|
182
|
+
gtCallbackScript.text += ' j1.adapter.translator.postTranslateElementInit(gtAPI);' + '\n';
|
183
|
+
gtCallbackScript.text += '}' + '\n';
|
184
|
+
document.head.appendChild(gtCallbackScript);
|
185
|
+
|
232
186
|
// -----------------------------------------------------------------------
|
233
187
|
// initializer
|
234
188
|
// -----------------------------------------------------------------------
|
@@ -246,25 +200,25 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
246
200
|
domainAttribute = '';
|
247
201
|
}
|
248
202
|
|
249
|
-
// load|initialize user translate cookie
|
250
|
-
if (j1.existsCookie(cookie_names.user_translate)) {
|
251
|
-
user_translate = j1.readCookie(cookie_names.user_translate);
|
252
|
-
} else {
|
253
|
-
logger.debug('\n' + 'write to cookie : ' + cookie_names.user_translate);
|
254
|
-
cookie_written = j1.writeCookie({
|
255
|
-
name: cookie_names.user_translate,
|
256
|
-
data: user_translate,
|
257
|
-
samesite: same_site,
|
258
|
-
secure: secure,
|
259
|
-
expires: expires
|
260
|
-
});
|
261
|
-
}
|
262
|
-
|
263
203
|
if ( j1.getState() === 'finished' ) {
|
264
204
|
_this.setState('started');
|
265
205
|
logger.info('\n' + 'state: ' + _this.getState());
|
266
206
|
logger.info('\n' + 'module is being initialized');
|
267
207
|
|
208
|
+
// load|initialize user translate cookie
|
209
|
+
if (j1.existsCookie(cookie_names.user_translate)) {
|
210
|
+
user_translate = j1.readCookie(cookie_names.user_translate);
|
211
|
+
} else {
|
212
|
+
logger.debug('\n' + 'write to cookie : ' + cookie_names.user_translate);
|
213
|
+
cookie_written = j1.writeCookie({
|
214
|
+
name: cookie_names.user_translate,
|
215
|
+
data: user_translate,
|
216
|
+
samesite: same_site,
|
217
|
+
secure: secure,
|
218
|
+
expires: expires
|
219
|
+
});
|
220
|
+
}
|
221
|
+
|
268
222
|
// hide the google translate element if exists
|
269
223
|
if ($('google_translate_element')) {
|
270
224
|
$('google_translate_element').hide();
|
@@ -335,7 +289,7 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
335
289
|
// enable|disable translation (after callback)
|
336
290
|
if (user_translate.analysis && user_translate.personalization && user_translate.translationEnabled) {
|
337
291
|
if (moduleOptions.translatorName === 'google') {
|
338
|
-
head.appendChild(
|
292
|
+
head.appendChild(gtTranslateScript);
|
339
293
|
if ($('google_translate_element')) {
|
340
294
|
$('google_translate_element').hide();
|
341
295
|
}
|
@@ -359,7 +313,7 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
359
313
|
|
360
314
|
clearInterval(dependencies_met_page_ready);
|
361
315
|
}
|
362
|
-
});
|
316
|
+
}, 25);
|
363
317
|
}, // END init
|
364
318
|
|
365
319
|
// -------------------------------------------------------------------------
|
@@ -19278,6 +19278,12 @@ a.timeline-list-unstyled:hover {
|
|
19278
19278
|
.hide {
|
19279
19279
|
display: none; }
|
19280
19280
|
|
19281
|
+
.border--solid {
|
19282
|
+
border: 1px solid #616161; }
|
19283
|
+
|
19284
|
+
.border--dotted {
|
19285
|
+
border: 1px dotted #616161; }
|
19286
|
+
|
19281
19287
|
.g-color-white-opacity-0_6, .g-color-white-opacity-0_6--hover:hover {
|
19282
19288
|
color: rgba(255, 255, 255, 0.6) !important; }
|
19283
19289
|
|