j1-template 2021.1.12 → 2021.1.17
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/blocks/footer/boxes/issue.proc +28 -5
- data/_includes/themes/j1/blocks/footer/boxes/legal_statements.proc +66 -23
- data/_includes/themes/j1/blocks/footer/boxes/links_box.proc +0 -1
- data/_includes/themes/j1/blocks/footer/boxes/news_box.proc +16 -1
- data/_includes/themes/j1/layouts/content_generator_app.html +1 -1
- data/_includes/themes/j1/layouts/content_generator_blog_archive.html +197 -219
- data/_includes/themes/j1/layouts/content_generator_collection.html +4 -2
- data/_includes/themes/j1/layouts/content_generator_page.html +4 -1
- data/_includes/themes/j1/layouts/content_generator_post.html +31 -23
- data/_includes/themes/j1/layouts/content_generator_raw.html +1 -1
- data/_includes/themes/j1/layouts/layout_metadata_generator.html +82 -4
- data/_includes/themes/j1/modules/connectors/comment/commento.html +31 -0
- data/_includes/themes/j1/modules/connectors/comment/custom-provider.html +7 -8
- data/_includes/themes/j1/modules/connectors/comment/disqus.html +12 -54
- data/_includes/themes/j1/modules/connectors/comment/facebook.html +7 -8
- data/_includes/themes/j1/modules/connectors/comment/hyvor.html +33 -0
- data/_includes/themes/j1/modules/connectors/comment/just-comments.html +31 -0
- data/_includes/themes/j1/modules/connectors/comments +3 -0
- data/_includes/themes/j1/procedures/posts/collate_timeline.proc +27 -5
- data/_includes/themes/j1/procedures/posts/pager.proc +123 -0
- data/_layouts/default.html +52 -1
- data/assets/data/cookieconsent.html +0 -2
- data/assets/data/disqus.js +81 -0
- data/assets/data/hyvor.js +72 -0
- data/assets/data/menu.html +1 -1
- data/assets/data/mmenu_toc.html +20 -1
- data/assets/data/panel.html +28 -7
- data/assets/error_pages/HTTP204.html +2 -1
- data/assets/error_pages/HTTP400.html +2 -1
- data/assets/error_pages/HTTP401.html +2 -1
- data/assets/error_pages/HTTP403.html +2 -1
- data/assets/error_pages/HTTP404.html +2 -1
- data/assets/error_pages/HTTP444.html +93 -0
- data/assets/error_pages/HTTP500.html +2 -1
- data/assets/error_pages/HTTP501.html +2 -1
- data/assets/error_pages/HTTP502.html +2 -1
- data/assets/error_pages/HTTP503.html +2 -1
- data/assets/themes/j1/adapter/js/algolia.js +10 -10
- data/assets/themes/j1/adapter/js/asciidoctor.js +6 -6
- data/assets/themes/j1/adapter/js/attic.js +17 -17
- data/assets/themes/j1/adapter/js/bmd.js +6 -6
- data/assets/themes/j1/adapter/js/carousel.js +10 -10
- data/assets/themes/j1/adapter/js/clipboard.js +10 -10
- data/assets/themes/j1/adapter/js/cookieConsent.js +54 -27
- data/assets/themes/j1/adapter/js/fam.js +34 -34
- data/assets/themes/j1/adapter/js/framer.js +6 -6
- data/assets/themes/j1/adapter/js/j1.js +444 -259
- data/assets/themes/j1/adapter/js/justifiedGallery.js +11 -11
- data/assets/themes/j1/adapter/js/justifiedGalleryCustomizer.js +19 -19
- data/assets/themes/j1/adapter/js/lightbox.js +6 -6
- data/assets/themes/j1/adapter/js/logger.js +7 -7
- data/assets/themes/j1/adapter/js/mmenu.js +25 -25
- data/assets/themes/j1/adapter/js/navigator.js +55 -48
- data/assets/themes/j1/adapter/js/quicksearch.js +6 -6
- data/assets/themes/j1/adapter/js/rouge.js +7 -7
- data/assets/themes/j1/adapter/js/rtable.js +6 -6
- data/assets/themes/j1/adapter/js/themer.js +35 -41
- data/assets/themes/j1/adapter/js/toccer.js +9 -9
- data/assets/themes/j1/modules/backstretch/js/backstretch.js +3 -3
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +27 -20
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +2 -2
- data/assets/themes/j1/modules/lunrSearch/js/quicksearch.js +1 -1
- data/assets/themes/j1/modules/themeSwitcher/js/switcher.js +74 -55
- data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +75 -57
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +4 -5
- data/lib/starter_web/_config.yml +42 -24
- data/lib/starter_web/_data/blocks/footer.yml +52 -20
- data/lib/starter_web/_data/blocks/panel.yml +4 -4
- data/lib/starter_web/_data/builder/blog_navigator.yml +9 -192
- data/lib/starter_web/_data/builder/defaults/blog_navigator.yml +389 -0
- data/lib/starter_web/_data/j1_config.yml +66 -41
- data/lib/starter_web/_data/locales/be.yml +269 -0
- data/lib/starter_web/_data/locales/cs.yml +218 -0
- data/lib/starter_web/_data/locales/da.yml +213 -0
- data/lib/starter_web/_data/locales/de.yml +222 -0
- data/lib/starter_web/_data/locales/el.yml +215 -0
- data/lib/starter_web/_data/locales/en.yml +215 -0
- data/lib/starter_web/_data/locales/es.yml +219 -0
- data/lib/starter_web/_data/locales/et.yml +207 -0
- data/lib/starter_web/_data/locales/fi.yml +211 -0
- data/lib/starter_web/_data/locales/fr.yml +219 -0
- data/lib/starter_web/_data/locales/hr.yml +240 -0
- data/lib/starter_web/_data/locales/hu.yml +196 -0
- data/lib/starter_web/_data/locales/it.yml +215 -0
- data/lib/starter_web/_data/locales/lv.yml +233 -0
- data/lib/starter_web/_data/locales/nl.yml +213 -0
- data/lib/starter_web/_data/locales/pl.yml +241 -0
- data/lib/starter_web/_data/locales/pt.yml +217 -0
- data/lib/starter_web/_data/locales/readme +4 -0
- data/lib/starter_web/_data/locales/ro.yml +209 -0
- data/lib/starter_web/_data/locales/ru.yml +269 -0
- data/lib/starter_web/_data/locales/sk.yml +211 -0
- data/lib/starter_web/_data/locales/sl.yml +209 -0
- data/lib/starter_web/_data/locales/sv.yml +207 -0
- data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +10 -10
- data/lib/starter_web/_data/modules/defaults/themer.yml +1 -0
- data/lib/starter_web/_data/modules/themer.yml +1 -0
- data/lib/starter_web/_data/plugins/defaults/paginator.yml +7 -6
- data/lib/starter_web/_data/plugins/paginator.yml +3 -0
- data/lib/starter_web/_includes/attributes.asciidoc +1 -1
- data/lib/starter_web/_plugins/date-i18n.rb +67 -0
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/assets/images/modules/attics/markus-spiske-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/matthew-dockery-1920x1280.jpg +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/2020-01-01-about-cookies.adoc +1 -1
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-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-test-series.adoc +2 -2
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-test-series.adoc +2 -2
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-test-series.adoc +2 -2
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-04-post-test-series.adoc +2 -2
- data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-20-minneapolis.adoc +1 -1
- data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc +1 -1
- data/lib/starter_web/index.html +3 -3
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/book.adoc +3 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +3 -0
- data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +3 -0
- data/lib/starter_web/pages/public/blog/navigator/archive.html +80 -12
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +94 -26
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +81 -12
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +95 -37
- data/lib/starter_web/pages/public/blog/navigator/index.html +4 -0
- data/lib/starter_web/pages/public/cookieConsent.adoc +3 -0
- data/lib/starter_web/pages/public/learn/quickstart.adoc +473 -0
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +0 -1
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +2 -1
- data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +0 -2
- data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +0 -2
- data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +0 -1
- data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +0 -1
- data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +0 -1
- data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +0 -1
- data/lib/starter_web/pages/public/learn/roundtrip/600_quicksearch.adoc +0 -1
- data/lib/starter_web/pages/public/learn/where_to_go.adoc +0 -1
- data/lib/starter_web/pages/public/legal/de/100_copyright.adoc +116 -0
- data/lib/starter_web/pages/public/legal/de/100_impress.adoc +94 -0
- data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +320 -0
- data/lib/starter_web/pages/public/legal/de/400_comment_policy.adoc +123 -0
- data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +3 -1
- data/lib/starter_web/pages/public/legal/en/200_impress.adoc +3 -1
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +81 -20
- data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +34 -16
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +41 -4
- data/_includes/themes/j1/procedures/global/pager.proc +0 -79
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.org.asciidoc +0 -244
@@ -127,8 +127,8 @@ j1.adapter['toccer'] = (function () {
|
|
127
127
|
|
128
128
|
// initialize state flag
|
129
129
|
_this.setState('started');
|
130
|
-
logger.info('state: ' + _this.getState());
|
131
|
-
logger.info('
|
130
|
+
logger.info('\n' + 'state: ' + _this.getState());
|
131
|
+
logger.info('\n' + 'module is being initialized');
|
132
132
|
|
133
133
|
// create settings object from frontmatterOptions
|
134
134
|
var frontmatterOptions = options != null ? $.extend({}, options) : {};
|
@@ -175,9 +175,9 @@ j1.adapter['toccer'] = (function () {
|
|
175
175
|
_this.initToccerCore(settings);
|
176
176
|
_this.setState('finished');
|
177
177
|
|
178
|
-
logger.info('state: ' + _this.getState());
|
179
|
-
logger.info('module initialized successfully');
|
180
|
-
logger.info('met dependencies for: j1');
|
178
|
+
logger.info('\n' + 'state: ' + _this.getState());
|
179
|
+
logger.info('\n' + 'module initialized successfully');
|
180
|
+
logger.info('\n' + 'met dependencies for: j1');
|
181
181
|
clearInterval(dependencies_met_navigator);
|
182
182
|
}
|
183
183
|
}, 25);
|
@@ -219,7 +219,7 @@ j1.adapter['toccer'] = (function () {
|
|
219
219
|
scrollOffset = scrollOffset + moduleOptions.scrollSmoothOffset
|
220
220
|
|
221
221
|
_this.setState('running');
|
222
|
-
logger.info('state: ' + _this.getState());
|
222
|
+
logger.info('\n' + 'state: ' + _this.getState());
|
223
223
|
|
224
224
|
// tocbot get fired if HTML portion is loaded (AJAX load finished)
|
225
225
|
//
|
@@ -256,7 +256,7 @@ j1.adapter['toccer'] = (function () {
|
|
256
256
|
throttleTimeout: moduleOptions.throttleTimeout
|
257
257
|
});
|
258
258
|
/* eslint-enable */
|
259
|
-
logger.info('met dependencies for:
|
259
|
+
logger.info('\n' + 'met dependencies for: loadHTML');
|
260
260
|
clearInterval(dependencies_met_ajax_load_finished);
|
261
261
|
} // END AJAX load finished
|
262
262
|
}, 25); // END dependencies_met_ajax_load_finished
|
@@ -323,7 +323,7 @@ j1.adapter['toccer'] = (function () {
|
|
323
323
|
messageHandler: function (sender, message) {
|
324
324
|
var json_message = JSON.stringify(message, undefined, 2);
|
325
325
|
|
326
|
-
logText = 'received message from ' + sender + ': ' + json_message;
|
326
|
+
logText = '\n' + 'received message from ' + sender + ': ' + json_message;
|
327
327
|
logger.debug(logText);
|
328
328
|
|
329
329
|
// -----------------------------------------------------------------------
|
@@ -333,7 +333,7 @@ j1.adapter['toccer'] = (function () {
|
|
333
333
|
//
|
334
334
|
// Place handling of command|action here
|
335
335
|
//
|
336
|
-
logger.info(message.text);
|
336
|
+
logger.info('\n' + message.text);
|
337
337
|
}
|
338
338
|
|
339
339
|
//
|
@@ -861,12 +861,12 @@
|
|
861
861
|
|
862
862
|
// jadams, 2017-12-07: Added log for testing
|
863
863
|
if(this.options.debug) {
|
864
|
-
logText = 'resize: boxHeight x boxWidth: ' + boxHeight + ' x ' + boxWidth;
|
864
|
+
logText = '\n' + 'resize: boxHeight x boxWidth: ' + boxHeight + ' x ' + boxWidth;
|
865
865
|
logger.debug(logText);
|
866
866
|
}
|
867
867
|
|
868
868
|
if ( boxHeight == 0 || boxWidth == 0 ) {
|
869
|
-
logText = 'Kacke am Schuh';
|
869
|
+
logText = '\n' + 'Kacke am Schuh';
|
870
870
|
logger.warn(logText);
|
871
871
|
}
|
872
872
|
|
@@ -1083,7 +1083,7 @@
|
|
1083
1083
|
if ($(myID).is(':visible')) {
|
1084
1084
|
// clear interval checking
|
1085
1085
|
clearInterval(isVisible);
|
1086
|
-
logger.info('container visible on id: ' + myID);
|
1086
|
+
logger.info('\n' + 'container visible on id: ' + myID);
|
1087
1087
|
that.resize();
|
1088
1088
|
}
|
1089
1089
|
}, 50); // END 'isVisible'
|
@@ -38,16 +38,18 @@
|
|
38
38
|
// -----------------------------------------------------------------------------
|
39
39
|
|
40
40
|
function BootstrapCookieConsent(props) {
|
41
|
+
var logger = log4javascript.getLogger('j1.core.bsCookieConsent');
|
42
|
+
var modalId = 'bccs-modal';
|
43
|
+
var self = this;
|
44
|
+
var detailedSettingsShown = false;
|
45
|
+
var url = new liteURL(window.location.href);
|
46
|
+
var secure = (url.protocol.includes('https')) ? true : false;
|
41
47
|
var logText;
|
42
48
|
var current_page;
|
43
49
|
var whitelisted;
|
44
|
-
var logger = log4javascript.getLogger('j1.core.bsCookieConsent');
|
45
|
-
var modalId = "bccs-modal"
|
46
|
-
var self = this
|
47
|
-
var detailedSettingsShown = false
|
48
50
|
|
49
|
-
logger.info('
|
50
|
-
logger.info('state: started');
|
51
|
+
logger.info('\n' + 'initializing core module: started');
|
52
|
+
logger.info('\n' + 'state: started');
|
51
53
|
|
52
54
|
this.props = {
|
53
55
|
autoShowDialog: true, // disable autoShowModal on the privacy policy and legal notice pages, to make these pages readable
|
@@ -59,7 +61,8 @@ function BootstrapCookieConsent(props) {
|
|
59
61
|
postSelectionCallback: undefined, // callback function, called after the user has made his selection
|
60
62
|
whitelisted: [], // pages NO consent modal page is issued
|
61
63
|
xhr_data_element: "", // container for the language-specific consent modal taken from /assets/data/cookieconsent.html
|
62
|
-
sameSite: "Strict"
|
64
|
+
sameSite: "Strict", // restrict consent cookie to first-party, do NOT send cookie to other domains
|
65
|
+
secure: false //
|
63
66
|
}
|
64
67
|
|
65
68
|
for (var property in props) {
|
@@ -76,7 +79,7 @@ function BootstrapCookieConsent(props) {
|
|
76
79
|
}
|
77
80
|
|
78
81
|
var Cookie = {
|
79
|
-
set: function (name, value, days, samesite) {
|
82
|
+
set: function (name, value, days, samesite, secure) {
|
80
83
|
var value_encoded = window.btoa(value);
|
81
84
|
var expires = "";
|
82
85
|
if (days) {
|
@@ -84,7 +87,11 @@ function BootstrapCookieConsent(props) {
|
|
84
87
|
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
85
88
|
expires = "; expires=" + date.toUTCString();
|
86
89
|
}
|
87
|
-
|
90
|
+
if (secure) {
|
91
|
+
document.cookie = name + "=" + (value_encoded || '') + expires + '; Path=/; SameSite=' + samesite + '; ' + 'secure=' + secure + ';';
|
92
|
+
} else {
|
93
|
+
document.cookie = name + "=" + (value_encoded || '') + expires + '; Path=/; SameSite=' + samesite + ';';
|
94
|
+
}
|
88
95
|
},
|
89
96
|
get: function (name) {
|
90
97
|
var nameEQ = name + "=";
|
@@ -119,7 +126,7 @@ function BootstrapCookieConsent(props) {
|
|
119
126
|
|
120
127
|
self.modal = document.getElementById(modalId);
|
121
128
|
if (!self.modal) {
|
122
|
-
logger.info('
|
129
|
+
logger.info('\n' + 'load consent modal');
|
123
130
|
self.modal = document.createElement("div");
|
124
131
|
self.modal.id = modalId;
|
125
132
|
self.modal.setAttribute("class", "modal fade");
|
@@ -140,7 +147,7 @@ function BootstrapCookieConsent(props) {
|
|
140
147
|
var templateUrl = self.props.contentURL + '/' + 'index.html';
|
141
148
|
$.get(templateUrl)
|
142
149
|
.done(function (data) {
|
143
|
-
logger.info('
|
150
|
+
logger.info('\n' + 'loading consent modal: successfully');
|
144
151
|
self.modal.innerHTML = data;
|
145
152
|
self.modal.innerHTML = $('#' + self.props.xhr_data_element).eq(0).html();
|
146
153
|
|
@@ -154,7 +161,7 @@ function BootstrapCookieConsent(props) {
|
|
154
161
|
self.$buttonSave = $("#bccs-buttonSave");
|
155
162
|
self.$buttonAgreeAll = $("#bccs-buttonAgreeAll");
|
156
163
|
|
157
|
-
logger.info('
|
164
|
+
logger.info('\n' + 'load/initialze options from cookie');
|
158
165
|
|
159
166
|
updateButtons();
|
160
167
|
updateOptionsFromCookie();
|
@@ -167,7 +174,7 @@ function BootstrapCookieConsent(props) {
|
|
167
174
|
updateButtons();
|
168
175
|
});
|
169
176
|
|
170
|
-
logger.info('
|
177
|
+
logger.info('\n' + 'initialze event handler');
|
171
178
|
|
172
179
|
self.$buttonDoNotAgree.click(function () {
|
173
180
|
doNotAgree();
|
@@ -187,8 +194,8 @@ function BootstrapCookieConsent(props) {
|
|
187
194
|
});
|
188
195
|
})
|
189
196
|
.fail(function () {
|
190
|
-
logger.error('
|
191
|
-
logger.
|
197
|
+
logger.error('\n' + 'loading consent modal: failed');
|
198
|
+
logger.warn('\n' + 'probably no `contentURL` set');
|
192
199
|
})
|
193
200
|
} else {
|
194
201
|
self.$modal.modal("show")
|
@@ -239,12 +246,12 @@ function BootstrapCookieConsent(props) {
|
|
239
246
|
}
|
240
247
|
|
241
248
|
function agreeAll() {
|
242
|
-
Cookie.set(self.props.cookieName, JSON.stringify(gatherOptions(true)), self.props.cookieStorageDays, self.props.sameSite);
|
249
|
+
Cookie.set(self.props.cookieName, JSON.stringify(gatherOptions(true)), self.props.cookieStorageDays, self.props.sameSite, self.props.secure);
|
243
250
|
self.$modal.modal("hide");
|
244
251
|
}
|
245
252
|
|
246
253
|
function doNotAgree() {
|
247
|
-
Cookie.set(self.props.cookieName, JSON.stringify(gatherOptions(false)), self.props.cookieStorageDays, self.props.sameSite);
|
254
|
+
Cookie.set(self.props.cookieName, JSON.stringify(gatherOptions(false)), self.props.cookieStorageDays, self.props.sameSite, self.props.secure);
|
248
255
|
|
249
256
|
// jadams, 2021-07-15: all cookies NOT longer supported by j1.expireCookie
|
250
257
|
// TODO: Create loop over all cookies found in page
|
@@ -257,7 +264,7 @@ function BootstrapCookieConsent(props) {
|
|
257
264
|
}
|
258
265
|
|
259
266
|
function saveSettings() {
|
260
|
-
Cookie.set(self.props.cookieName, JSON.stringify(gatherOptions()), self.props.cookieStorageDays, self.props.sameSite);
|
267
|
+
Cookie.set(self.props.cookieName, JSON.stringify(gatherOptions()), self.props.cookieStorageDays, self.props.sameSite, self.props.secure);
|
261
268
|
self.$modal.modal("hide");
|
262
269
|
}
|
263
270
|
|
@@ -271,8 +278,8 @@ function BootstrapCookieConsent(props) {
|
|
271
278
|
// API functions
|
272
279
|
// ---------------------------------------------------------------------------
|
273
280
|
|
274
|
-
logger.info('
|
275
|
-
logger.info('state: finished');
|
281
|
+
logger.info('\n' + 'initializing core module finished');
|
282
|
+
logger.info('\n' + 'state: finished');
|
276
283
|
|
277
284
|
// show the consent dialog (modal)
|
278
285
|
// ---------------------------------------------------------------------------
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
# -----------------------------------------------------------------------------
|
3
|
-
# ~/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js
|
3
|
+
# ~/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js
|
4
4
|
# Provides JS Core for J1 Module BS Cookie Consent
|
5
5
|
#
|
6
6
|
# Product/Info:
|
@@ -24,4 +24,4 @@
|
|
24
24
|
# outside of J1 Template!
|
25
25
|
# -----------------------------------------------------------------------------
|
26
26
|
*/
|
27
|
-
|
27
|
+
function BootstrapCookieConsent(c){var t=log4javascript.getLogger("j1.core.bsCookieConsent");var r="bccs-modal";var o=this;var p=false;var d=new liteURL(window.location.href);var m=(d.protocol.includes("https"))?true:false;var h;var f;var s;t.info("\ninitializing core module: started");t.info("\nstate: started");this.props={autoShowDialog:true,language:navigator.language,languages:["en","de"],contentURL:"./content",cookieName:"cookie-consent-settings",cookieStorageDays:365,postSelectionCallback:undefined,whitelisted:[],xhr_data_element:"",sameSite:"Strict",secure:false};for(var e in c){this.props[e]=c[e]}this.language=this.props.language;if(this.language.indexOf("-")!==-1){this.language=this.language.split("-")[0]}if(!this.props.languages.includes(this.language)){this.language=this.props.languages[0]}var g={set:function(w,y,B,x,z){var A=window.btoa(y);var u="";if(B){var v=new Date();v.setTime(v.getTime()+(B*24*60*60*1000));u="; expires="+v.toUTCString()}if(z){document.cookie=w+"="+(A||"")+u+"; Path=/; SameSite="+x+"; secure="+z+";"}else{document.cookie=w+"="+(A||"")+u+"; Path=/; SameSite="+x+";"}},get:function(v){var y=v+"=";var u=document.cookie.split(";");for(var w=0;w<u.length;w++){var A=u[w];while(A.charAt(0)===" "){A=A.substring(1,A.length)}if(A.indexOf(y)===0){var z=A.substring(y.length,A.length);var x=window.atob(z);return x}}return undefined}};var l={documentReady:function(u){if(document.readyState!=="loading"){u()}else{document.addEventListener("DOMContentLoaded",u)}}};function k(u){l.documentReady(function(){o.modal=document.getElementById(r);if(!o.modal){t.info("\nload consent modal");o.modal=document.createElement("div");o.modal.id=r;o.modal.setAttribute("class","modal fade");o.modal.setAttribute("tabindex","-1");o.modal.setAttribute("role","dialog");o.modal.setAttribute("aria-labelledby",r);document.body.append(o.modal);o.$modal=$(o.modal);if(o.props.postSelectionCallback){o.$modal.on("hidden.bs.modal",function(){o.props.postSelectionCallback()})}var v=o.props.contentURL+"/index.html";$.get(v).done(function(w){t.info("\nloading consent modal: successfully");o.modal.innerHTML=w;o.modal.innerHTML=$("#"+o.props.xhr_data_element).eq(0).html();$(o.modal).modal({backdrop:"static",keyboard:false});o.$buttonDoNotAgree=$("#bccs-buttonDoNotAgree");o.$buttonAgree=$("#bccs-buttonAgree");o.$buttonSave=$("#bccs-buttonSave");o.$buttonAgreeAll=$("#bccs-buttonAgreeAll");t.info("\nload/initialze options from cookie");j();i();$("#bccs-options").on("hide.bs.collapse",function(){p=false;j()}).on("show.bs.collapse",function(){p=true;j()});t.info("\ninitialze event handler");o.$buttonDoNotAgree.click(function(){b()});o.$buttonAgree.click(function(){n()});o.$buttonSave.click(function(){$("#bccs-options").collapse("hide");q();i()});o.$buttonAgreeAll.click(function(){$("#bccs-options").collapse("hide");n();i()})}).fail(function(){t.error("\nloading consent modal: failed");t.warn("\nprobably no `contentURL` set")})}else{o.$modal.modal("show")}}.bind(this))}function i(){var w=o.getSettings();if(w){for(var v in w){var u=o.$modal.find("#bccs-options .bccs-option[data-name='"+v+"'] input[type='checkbox']");u.prop("checked",w[v])}}}function j(){if(p){o.$buttonDoNotAgree.hide();o.$buttonAgree.hide();o.$buttonSave.show();o.$buttonAgreeAll.show()}else{o.$buttonDoNotAgree.show();o.$buttonAgree.show();o.$buttonSave.hide();o.$buttonAgreeAll.hide()}}function a(v){var u=o.$modal.find("#bccs-options .bccs-option");var x={};for(var y=0;y<u.length;y++){var A=u[y];var w=A.getAttribute("data-name");if(w==="necessary"){x[w]=true}else{if(v===undefined){var z=$(A).find("input[type='checkbox']");x[w]=z.prop("checked")}else{x[w]=!!v}}}return x}function n(){g.set(o.props.cookieName,JSON.stringify(a(true)),o.props.cookieStorageDays,o.props.sameSite,o.props.secure);o.$modal.modal("hide")}function b(){g.set(o.props.cookieName,JSON.stringify(a(false)),o.props.cookieStorageDays,o.props.sameSite,o.props.secure);o.$modal.modal("hide");j1.goHome()}function q(){g.set(o.props.cookieName,JSON.stringify(a()),o.props.cookieStorageDays,o.props.sameSite,o.props.secure);o.$modal.modal("hide")}s=(this.props.whitelisted.indexOf(window.location.pathname)>-1);if(g.get(this.props.cookieName)===undefined&&this.props.autoShowDialog&&!s){k()}t.info("\ninitializing core module finished");t.info("\nstate: finished");this.showDialog=function(){s=(this.props.whitelisted.indexOf(window.location.pathname)>-1);if(!s){k()}};this.getSettings=function(v){var u=g.get(o.props.cookieName);if(u){var w=JSON.parse(g.get(o.props.cookieName));if(v===undefined){return w}else{if(w){return w[v]}else{return false}}}else{return undefined}}};
|
@@ -154,7 +154,7 @@
|
|
154
154
|
//
|
155
155
|
if (docs.length > 0) {
|
156
156
|
var logger = log4javascript.getLogger("j1.searcher");
|
157
|
-
var log_text = 'cleanup tags and categories';
|
157
|
+
var log_text = '\n' + 'cleanup tags and categories';
|
158
158
|
logger.info(log_text);
|
159
159
|
$('.sr-tags').each(function() {
|
160
160
|
var sr_tags = $(this).html().replace(/^\s+(.*)(\s+·\s+$)/, "$1");
|
@@ -47,16 +47,21 @@
|
|
47
47
|
|
48
48
|
var old = $.fn.bootstrapThemeSwitcher;
|
49
49
|
|
50
|
-
var cookie_names
|
51
|
-
|
50
|
+
var cookie_names = j1.getCookieNames();
|
51
|
+
var gaCookies = j1.findCookie('_ga');
|
52
|
+
var j1Cookies = j1.findCookie('j1');
|
53
|
+
var url = new liteURL(window.location.href);
|
54
|
+
var hostname = url.hostname;
|
55
|
+
var domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
|
56
|
+
var secure = (url.protocol.includes('https')) ? true : false;
|
52
57
|
|
53
58
|
var logger = log4javascript.getLogger('j1.core.switcher');
|
54
59
|
var logText;
|
55
60
|
|
56
61
|
var user_state_detected;
|
57
|
-
var
|
58
|
-
var
|
59
|
-
var
|
62
|
+
var user_state = {};
|
63
|
+
var user_state_json;
|
64
|
+
var user_state_cookie;
|
60
65
|
|
61
66
|
// Constructor
|
62
67
|
// ---------------------------------------------------------------------------
|
@@ -75,13 +80,13 @@
|
|
75
80
|
// ---------------------------------------------------------------------------
|
76
81
|
BootstrapThemeSwitcher.prototype = {
|
77
82
|
clear: function () {
|
78
|
-
logger.debug('bootstrapThemeSwitcher.clear');
|
83
|
+
logger.debug('\n' + 'bootstrapThemeSwitcher.clear');
|
79
84
|
return this.$element.each(function () {
|
80
85
|
this.$element.empty();
|
81
86
|
});
|
82
87
|
},
|
83
88
|
update: function () {
|
84
|
-
logger.debug('bootstrapThemeSwitcher.update');
|
89
|
+
logger.debug('\n' + 'bootstrapThemeSwitcher.update');
|
85
90
|
this.getThemes();
|
86
91
|
},
|
87
92
|
|
@@ -112,27 +117,29 @@
|
|
112
117
|
// -------------------------------------------------------------------------
|
113
118
|
switchTheme: function (name, cssFile) {
|
114
119
|
|
115
|
-
var $this
|
116
|
-
var settings
|
120
|
+
var $this = $(this);
|
121
|
+
var settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, $this.data('bootstrapThemeSwitcher'));
|
122
|
+
var id = settings.cssThemeLink;
|
123
|
+
var debug = settings.debug;
|
124
|
+
var includeCSS = this.settings.includeBootswatch;
|
117
125
|
var themeName;
|
118
126
|
var theme_css;
|
119
|
-
var theme_extension_css;
|
120
|
-
|
121
|
-
var id = settings.cssThemeLink;
|
122
|
-
var debug = settings.debug;
|
123
|
-
var includeCSS = this.settings.includeBootswatch;
|
124
127
|
|
125
128
|
// detect|set user state cookie
|
126
|
-
user_state_detected = j1.existsCookie (
|
129
|
+
user_state_detected = j1.existsCookie (cookie_names.user_state);
|
127
130
|
if ( user_state_detected ) {
|
128
|
-
logger.debug('cookie found:
|
129
|
-
|
131
|
+
logger.debug('\n' + 'cookie found: ' + cookie_names.user_state);
|
132
|
+
user_state = j1.readCookie(cookie_names.user_state);
|
130
133
|
} else {
|
131
|
-
logger.error('cookie not found:
|
134
|
+
logger.error('\n' + 'cookie not found: ' + cookie_names.user_state);
|
135
|
+
logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
136
|
+
j1Cookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
137
|
+
logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
138
|
+
gaCookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
132
139
|
}
|
133
140
|
|
134
|
-
themeName
|
135
|
-
theme_css
|
141
|
+
themeName = user_state.theme_name;
|
142
|
+
theme_css = user_state.theme_css;
|
136
143
|
|
137
144
|
if (typeof cssFile === 'undefined') { cssFile = this.settings.defaultCssFile; }
|
138
145
|
if (typeof name === 'undefined') { name = cssFile; }
|
@@ -141,32 +148,36 @@
|
|
141
148
|
if (settings.saveToCookie) {
|
142
149
|
if ( typeof Cookies === 'undefined' ) {
|
143
150
|
if ( debug === 'true' ) {
|
144
|
-
logger.error('cookies library not present');
|
151
|
+
logger.error('\n' + 'cookies library not present');
|
145
152
|
}
|
146
153
|
return false;
|
147
154
|
}
|
148
155
|
|
149
|
-
|
150
|
-
|
156
|
+
user_state.theme_name = name;
|
157
|
+
user_state.theme_css = cssFile;
|
151
158
|
|
152
|
-
if (!(
|
153
|
-
|
154
|
-
|
159
|
+
if (!(user_state.theme_name.includes('Uno') || user_state.theme_name == 'Bootstrap')) {
|
160
|
+
user_state.theme_author = 'Bootswatch';
|
161
|
+
user_state.theme_author_url = 'https://bootswatch.com/';
|
155
162
|
} else {
|
156
|
-
|
157
|
-
|
163
|
+
user_state.theme_author = 'J1 Team';
|
164
|
+
user_state.theme_author_url = 'https://jekyll.one/';
|
158
165
|
}
|
159
166
|
|
167
|
+
logger.debug('\n' + 'write to cookie : ' + cookie_names.user_state);
|
160
168
|
j1.writeCookie({
|
161
|
-
name:
|
162
|
-
data:
|
169
|
+
name: cookie_names.user_state,
|
170
|
+
data: user_state,
|
171
|
+
samesite: 'Strict',
|
172
|
+
secure: secure,
|
173
|
+
expires: 365
|
163
174
|
});
|
164
175
|
|
165
176
|
// reload current page (skip cache)
|
166
177
|
location.reload(true);
|
167
178
|
} else {
|
168
|
-
logger.
|
169
|
-
logger.warn('selected theme not activated: ' + name);
|
179
|
+
logger.debug('\n' + 'write to cookie : disabled');
|
180
|
+
logger.warn('\n' + 'selected theme not activated: ' + name);
|
170
181
|
} // END if saveToCookie
|
171
182
|
|
172
183
|
}, // END switchTheme
|
@@ -177,24 +188,28 @@
|
|
177
188
|
loadThemeFromCookie: function (options) {
|
178
189
|
|
179
190
|
if ( typeof Cookies === 'undefined' ) {
|
180
|
-
logger.error('cookies library not present');
|
191
|
+
logger.error('\n' + 'cookies library not present');
|
181
192
|
return false;
|
182
193
|
}
|
183
194
|
|
184
195
|
var settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, options);
|
185
196
|
|
186
197
|
// detect|set user state cookie
|
187
|
-
user_state_detected = j1.existsCookie (
|
198
|
+
user_state_detected = j1.existsCookie (cookie_names.user_state);
|
188
199
|
|
189
200
|
if ( user_state_detected ) {
|
190
|
-
logger.info('cookie found:
|
191
|
-
|
201
|
+
logger.info('\n' + 'cookie found: ' + cookie_names.user_state);
|
202
|
+
user_state = j1.readCookie(cookie_names.user_state);
|
192
203
|
} else {
|
193
|
-
logger.error('cookie not found:
|
204
|
+
logger.error('\n' + 'cookie not found: ' + cookie_names.user_state);
|
205
|
+
logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
206
|
+
j1Cookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
207
|
+
logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
208
|
+
gaCookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
194
209
|
}
|
195
210
|
|
196
|
-
var themeName =
|
197
|
-
var themeCss =
|
211
|
+
var themeName = user_state.theme_name;
|
212
|
+
var themeCss = user_state.theme_css;
|
198
213
|
this.switchTheme(themeName, themeCss);
|
199
214
|
|
200
215
|
}, // END loadThemeFromCookie
|
@@ -214,11 +229,11 @@
|
|
214
229
|
// -------------------------------------------------------------------------
|
215
230
|
addThemesToControl: function() {
|
216
231
|
if (typeof this.$element === 'undefined') {
|
217
|
-
logger.error('bootstrapThemeSelector|addThemesToControl: Element is undefined');
|
232
|
+
logger.error('\n' + 'bootstrapThemeSelector|addThemesToControl: Element is undefined');
|
218
233
|
return false;
|
219
234
|
}
|
220
235
|
if (typeof this.themesList === 'undefined') {
|
221
|
-
logger.error('bootstrapThemeSelector|addThemesToControl: Themes is undefined');
|
236
|
+
logger.error('\n' + 'bootstrapThemeSelector|addThemesToControl: Themes is undefined');
|
222
237
|
return false;
|
223
238
|
}
|
224
239
|
|
@@ -247,25 +262,29 @@
|
|
247
262
|
var base = this;
|
248
263
|
|
249
264
|
if (this.$element.is('ul')) {
|
250
|
-
var $this
|
251
|
-
var settings
|
252
|
-
var id
|
265
|
+
var $this = $(this);
|
266
|
+
var settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, $this.data('bootstrapThemeSwitcher'));
|
267
|
+
var id = settings.cssThemeLink;
|
268
|
+
var debug = settings.debug;
|
253
269
|
var themeName;
|
254
|
-
var debug = settings.debug;
|
255
270
|
|
256
271
|
// detect|set user state cookie
|
257
|
-
user_state_detected = j1.existsCookie (
|
272
|
+
user_state_detected = j1.existsCookie (cookie_names.user_state);
|
258
273
|
if ( user_state_detected ) {
|
259
|
-
logger.debug('
|
260
|
-
|
274
|
+
logger.debug('\n' + 'user state cookie found');
|
275
|
+
user_state = j1.readCookie(cookie_names.user_state);
|
261
276
|
} else {
|
262
|
-
logger.error('
|
277
|
+
logger.error('\n' + 'user state NOT cookie found');
|
278
|
+
logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
279
|
+
j1Cookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
280
|
+
logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
281
|
+
gaCookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
263
282
|
}
|
264
283
|
|
265
|
-
themeName =
|
284
|
+
themeName = user_state.theme_name;
|
266
285
|
|
267
286
|
if ( debug === 'true' ) {
|
268
|
-
logger.debug('bootstrapThemeSelector: UL element selected');
|
287
|
+
logger.debug('\n' + 'bootstrapThemeSelector: UL element selected');
|
269
288
|
}
|
270
289
|
this.$element.empty();
|
271
290
|
|
@@ -305,7 +324,7 @@
|
|
305
324
|
});
|
306
325
|
|
307
326
|
} else if (this.$element.is('select')) {
|
308
|
-
logger.debug('bootstrapThemeSelector: SELECT element selected');
|
327
|
+
logger.debug('\n' + 'bootstrapThemeSelector: SELECT element selected');
|
309
328
|
this.$element.empty();
|
310
329
|
|
311
330
|
var optionSelectedMarker;
|
@@ -327,8 +346,8 @@
|
|
327
346
|
|
328
347
|
} else {
|
329
348
|
// no container found to add Theme list
|
330
|
-
logger.info('bootstrapThemeSelector: no UL or SELECT element found');
|
331
|
-
logger.error('bootstrapThemeSelector: failed');
|
349
|
+
logger.info('\n' + 'bootstrapThemeSelector: no UL or SELECT element found');
|
350
|
+
logger.error('\n' + 'bootstrapThemeSelector: failed');
|
332
351
|
// console.warn('bootstrapThemeSelector only works with ul or select elements');
|
333
352
|
}
|
334
353
|
}, // END addThemesToControl
|
@@ -351,7 +370,7 @@
|
|
351
370
|
base.addThemesToControl();
|
352
371
|
},
|
353
372
|
error: function (jqXHR, textStatus, errorThrown) {
|
354
|
-
logger.error('
|
373
|
+
logger.error('\n' + 'failed to retrieve the local feed from: \'' + base.settings.localFeed + '\'');
|
355
374
|
}
|
356
375
|
});
|
357
376
|
} else {
|