j1-template 2022.0.2 → 2022.0.3
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/connectors/analytic/google-analytics.html +3 -13
- data/_includes/themes/j1/modules/connectors/comment/hyvor.html +4 -5
- data/_includes/themes/j1/procedures/global/create_bs_button.proc +4 -4
- data/assets/data/private.json +1 -5
- data/assets/themes/j1/adapter/js/cookieConsent.js +12 -9
- data/assets/themes/j1/adapter/js/j1.js +17 -17
- data/assets/themes/j1/adapter/js/translator.js +4 -2
- data/assets/themes/j1/core/js/template.js +59 -0
- data/assets/themes/j1/core/js/template.min.js +5 -5
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/cryptoJS/js/aes.js +35 -0
- data/assets/themes/j1/modules/cryptoJS/js/aes.min.js +35 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-md5.js +21 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-ripemd160.js +31 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-sha1.js +17 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-sha224.js +19 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-sha256.js +18 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-sha3.js +21 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-sha384.js +27 -0
- data/assets/themes/j1/modules/cryptoJS/js/hmac-sha512.js +25 -0
- data/assets/themes/j1/modules/cryptoJS/js/md5.js +19 -0
- data/assets/themes/j1/modules/cryptoJS/js/pbkdf2.js +19 -0
- data/assets/themes/j1/modules/cryptoJS/js/rabbit-legacy.js +36 -0
- data/assets/themes/j1/modules/cryptoJS/js/rabbit.js +36 -0
- data/assets/themes/j1/modules/cryptoJS/js/rc4.js +33 -0
- data/assets/themes/j1/modules/cryptoJS/js/ripemd160.js +29 -0
- data/assets/themes/j1/modules/cryptoJS/js/sha1.js +15 -0
- data/assets/themes/j1/modules/cryptoJS/js/sha224.js +17 -0
- data/assets/themes/j1/modules/cryptoJS/js/sha256.js +16 -0
- data/assets/themes/j1/modules/cryptoJS/js/sha3.js +19 -0
- data/assets/themes/j1/modules/cryptoJS/js/sha384.js +25 -0
- data/assets/themes/j1/modules/cryptoJS/js/sha512.js +23 -0
- data/assets/themes/j1/modules/cryptoJS/js/tripledes.js +51 -0
- data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.2.js +460 -0
- data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.js +379 -353
- data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.min.js +1 -1
- data/assets/themes/j1/modules/gtag-opt-in/js/gtag-opt-in.js +93 -1
- data/assets/themes/j1/modules/scroller/js/scroller.js +6 -6
- data/assets/themes/j1/modules/scroller/js/scroller.min.js +1 -1
- data/exe/j1 +6 -7
- data/lib/j1/commands/generate.rb +15 -16
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +7 -1
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/_defaults/private.yml +3 -2
- data/lib/starter_web/_data/builder/defaults/_blog_navigator.yml +396 -0
- data/lib/starter_web/_data/builder/defaults/blog_navigator.yml +48 -42
- data/lib/starter_web/_data/modules/translator.yml +3 -3
- data/lib/starter_web/_data/private.yml +3 -2
- data/lib/starter_web/_data/resources.yml +27 -2
- data/lib/starter_web/_includes/attributes.asciidoc +1 -1
- data/lib/starter_web/_plugins/encodeBase64.rb +46 -0
- data/lib/starter_web/_plugins/encryptAES.rb +53 -0
- data/lib/starter_web/_plugins/filters.rb +2 -1
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/_plugins/minifyJSON.rb +2 -2
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +0 -21
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +1 -0
- data/lib/starter_web/pages/public/blog/navigator/archive.html +1 -1
- data/lib/starter_web/pages/public/learn/quickstart.adoc +1 -1
- data/lib/starter_web/pages/public/learn/where_to_go.adoc +1 -1
- data/lib/starter_web/pages/public/legal/de/100_copyright.adoc +1 -1
- data/lib/starter_web/pages/public/legal/de/100_impress.adoc +1 -1
- data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +1 -1
- data/lib/starter_web/pages/public/legal/de/400_comment_policy.adoc +1 -1
- data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +1 -1
- data/lib/starter_web/pages/public/legal/en/200_impress.adoc +1 -1
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +1 -1
- data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +1 -1
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +30 -5
- data/lib/j1/commands/help.rb +0 -32
- data/lib/j1/commands/module.rb +0 -69
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa9b2f1b29b6e4875eec6816f91adb606ba0094f1157d9959792618c065a727e
|
4
|
+
data.tar.gz: cf47cba9bbd587ce4101b1925609b7c146f583712bf232cc98282a5761c34c2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b56d12a6e1b05d37900b1ef121f761fc3adaabac028a355b980d2d3ac41094d91a520350d2d2bab721bb60d76fa69618388bbb45e4190cb933bf18505219c9e
|
7
|
+
data.tar.gz: e2694227b059a9f5c52da1c46da80e29d3315b2dda0a87a3442adb70d301835090b0436a1ce516669001285744a468c3b2a85e49429dff2effcf47abc8d34f04
|
@@ -25,16 +25,6 @@
|
|
25
25
|
|
26
26
|
{% comment %} Main
|
27
27
|
-------------------------------------------------------------------------------- {% endcomment %}
|
28
|
-
|
29
|
-
<!-- load the GA library -->
|
30
|
-
<script async src="https://www.googletagmanager.com/gtag/js?id={{tracking_id}}"></script>
|
31
|
-
|
32
|
-
<!-- GA depends on the cookie consent and is enabled/disabled on OptIn/Out-->
|
33
|
-
<!--
|
34
|
-
<script>
|
35
|
-
window.dataLayer = window.dataLayer || [];
|
36
|
-
function gtag(){dataLayer.push(arguments);}
|
37
|
-
gtag('js', new Date());
|
38
|
-
gtag('config', '{{tracking_id}}');
|
39
|
-
</script>
|
40
|
-
-->
|
28
|
+
<!-- [INFO ] [j1.modules.connectors.analytics ] [ GA depends on the cookie consent and is enabled/disabled dynamically on OptIn/Out ] -->
|
29
|
+
<!-- [INFO ] [j1.modules.connectors.analytics ] [ if analytics enabled, load the GA library statically by default ] -->
|
30
|
+
<script async id="google-tag-manager" src="https://www.googletagmanager.com/gtag/js?id={{tracking_id}}"></script>
|
@@ -23,11 +23,10 @@
|
|
23
23
|
{% comment %} Variables
|
24
24
|
-------------------------------------------------------------------------------- {% endcomment %}
|
25
25
|
|
26
|
-
|
27
26
|
{% comment %} Main
|
27
|
+
<!-- thread container places dynamically by j1 adapter
|
28
28
|
-------------------------------------------------------------------------------- {% endcomment %}
|
29
|
-
<!-- [INFO ] [j1.modules.connectors.hyvor ] [ place the thread container: start ] -->
|
30
|
-
<div id="hyvor-talk-view"></div>
|
31
29
|
<!-- [INFO ] [j1.modules.connectors.hyvor ] [ connector depends on the cookie consent (personalization) ] -->
|
32
|
-
<!-- [INFO ] [j1.modules.connectors.hyvor ] [ connector
|
33
|
-
<!-- [INFO ] [j1.modules.connectors.hyvor ] [
|
30
|
+
<!-- [INFO ] [j1.modules.connectors.hyvor ] [ connector is enabled/disabled dynamically by j1 adapter on OptIn/Out ] -->
|
31
|
+
<!-- [INFO ] [j1.modules.connectors.hyvor ] [ thread container disabled, placed dynamically by j1 adapter ] -->
|
32
|
+
<!-- div id="hyvor-talk-view"></div -->
|
@@ -79,7 +79,7 @@
|
|
79
79
|
{% if button_tagline %}
|
80
80
|
{% if button_href and button_target %}
|
81
81
|
{% capture bs_button_html %}
|
82
|
-
<a id="
|
82
|
+
<a id="{{button_id}}" href="{{button_href}}" target="{{button_target}}" rel="noopener" class="{{button_class}}" style="{{button_style}}">
|
83
83
|
<i class="{{icon_family}} {{icon_family}}-{{button_icon}} {{icon_family}}-{{button_icon_size}} {{icon_family}}-{{button_icon_color}} mr-3"></i>
|
84
84
|
<span class="float-right text-left mt-2">
|
85
85
|
{{button_title}}
|
@@ -89,7 +89,7 @@
|
|
89
89
|
{% endcapture %}
|
90
90
|
{% elsif button_href %}
|
91
91
|
{% capture bs_button_html %}
|
92
|
-
<a id="
|
92
|
+
<a id="{{button_id}}" href="{{button_href}}" class="{{button_class}}" style="{{button_style}}">
|
93
93
|
<i class="{{icon_family}} {{icon_family}}-{{button_icon}} {{icon_family}}-{{button_icon_size}} {{icon_family}}-{{button_icon_color}} mr-3"></i>
|
94
94
|
<span class="float-right text-left mt-2">
|
95
95
|
{{button_title}}
|
@@ -103,7 +103,7 @@
|
|
103
103
|
{% else %}
|
104
104
|
{% if button_href and button_target %}
|
105
105
|
{% capture bs_button_html %}
|
106
|
-
<a id="
|
106
|
+
<a id="{{button_id}}" href="{{button_href}}" target="{{button_target}}" rel="noopener" class="{{button_class}}" style="{{button_style}}">
|
107
107
|
<i class="{{icon_family}} {{icon_family}}-{{button_icon}} {{icon_family}}-{{button_icon_size}} {{icon_family}}-{{button_icon_color}} mr-1"></i>
|
108
108
|
<span class="float-right text-left">
|
109
109
|
{{button_title}}
|
@@ -112,7 +112,7 @@
|
|
112
112
|
{% endcapture %}
|
113
113
|
{% elsif button_href %}
|
114
114
|
{% capture bs_button_html %}
|
115
|
-
<a id="
|
115
|
+
<a id="{{button_id}}" href="{{button_href}}" class="{{button_class}}" style="{{button_style}}">
|
116
116
|
<i class="{{icon_family}} {{icon_family}}-{{button_icon}} {{icon_family}}-{{button_icon_size}} {{icon_family}}-{{button_icon_color}} mr-1"></i>
|
117
117
|
<span class="float-right text-left">
|
118
118
|
{{button_title}}
|
data/assets/data/private.json
CHANGED
@@ -267,15 +267,18 @@ j1.adapter['cookieConsent'] = (function (j1, window) {
|
|
267
267
|
$('#quickLinksCookieButton').css('display', 'block');
|
268
268
|
}
|
269
269
|
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
270
|
+
// jadams, 2021-11-29: disabled additional logs to verify the existance
|
271
|
+
// of J1 and GA cookies (testing only)
|
272
|
+
//
|
273
|
+
// logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
274
|
+
// j1Cookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
275
|
+
// logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
276
|
+
// gaCookies.forEach(item => console.log('j1.core.switcher: ' + item));
|
277
|
+
//
|
278
|
+
// if (user_agent.includes('iPad')) {
|
279
|
+
// logger.warn('\n' + 'product detected : ' + platform.product);
|
280
|
+
// logger.warn('\n' + 'skip deleting (unwanted) cookies for this platform');
|
281
|
+
// }
|
279
282
|
|
280
283
|
// Manage Google Analytics OptIn/Out
|
281
284
|
// See: https://github.com/luciomartinez/gtag-opt-in/wiki
|
@@ -776,7 +776,7 @@ var j1 = (function () {
|
|
776
776
|
}
|
777
777
|
} else {
|
778
778
|
logText = '\n' + 'no banner found in site';
|
779
|
-
logger.
|
779
|
+
logger.debug(logText);
|
780
780
|
return false;
|
781
781
|
}
|
782
782
|
return true;
|
@@ -879,7 +879,7 @@ var j1 = (function () {
|
|
879
879
|
}
|
880
880
|
} else {
|
881
881
|
logText = '\n' + 'no panel found in site';
|
882
|
-
logger.
|
882
|
+
logger.debug(logText);
|
883
883
|
return false;
|
884
884
|
}
|
885
885
|
return true;
|
@@ -931,7 +931,7 @@ var j1 = (function () {
|
|
931
931
|
selector.load(footer_data_path, cb_load_closure(id));
|
932
932
|
} else {
|
933
933
|
logText = '\n' + 'data not loaded';
|
934
|
-
logger.
|
934
|
+
logger.debug(logText);
|
935
935
|
j1.setXhrDataState(id, 'not loaded');
|
936
936
|
j1.setXhrDomState(id, 'pending');
|
937
937
|
return false;
|
@@ -1041,8 +1041,8 @@ var j1 = (function () {
|
|
1041
1041
|
setTimeout (function() {
|
1042
1042
|
// Manage providers for personalization OptIn/Out (Comments|Ads)
|
1043
1043
|
if (!user_consent.personalization) {
|
1044
|
-
logger.
|
1045
|
-
logger.
|
1044
|
+
logger.debug('\n' + 'disable comment provider: ' + comment_provider);
|
1045
|
+
logger.debug('\n' + 'personalization not allowed, privacy settings for personalization: ' + user_consent.personalization);
|
1046
1046
|
$('#leave-a-comment').remove();
|
1047
1047
|
if (comment_provider === 'disqus') {
|
1048
1048
|
$('#dsq-count-scr').remove();
|
@@ -1079,7 +1079,7 @@ var j1 = (function () {
|
|
1079
1079
|
// no dropcaps if translation enabled
|
1080
1080
|
if (user_translate.translationEnabled) {
|
1081
1081
|
logger.info('\n' + 'translation enabled: ' + user_translate.translationEnabled);
|
1082
|
-
logger.
|
1082
|
+
logger.debug('\n' + 'skipped processing of dropcaps');
|
1083
1083
|
} else {
|
1084
1084
|
// initialize dropcaps
|
1085
1085
|
logger.info('\n' + 'post processing: createDropCap');
|
@@ -1107,7 +1107,7 @@ var j1 = (function () {
|
|
1107
1107
|
logger.info('\n' + 'tracking disabled, tracking id found: ' + tracking_id);
|
1108
1108
|
}
|
1109
1109
|
} else {
|
1110
|
-
logger.
|
1110
|
+
logger.debug('\n' + 'tracking not allowed, privacy settings for analysis: ' + user_consent.analysis);
|
1111
1111
|
}
|
1112
1112
|
|
1113
1113
|
// show|hide cookie icon (should MOVED to Cookiebar ???)
|
@@ -1155,8 +1155,8 @@ var j1 = (function () {
|
|
1155
1155
|
// for GDPR compliance, themes feature may disabled on
|
1156
1156
|
// privacy settings
|
1157
1157
|
if (!user_consent.personalization) {
|
1158
|
-
logger.
|
1159
|
-
logger.
|
1158
|
+
logger.debug('\n' + 'disable themes feature because of privacy settings');
|
1159
|
+
logger.debug('\n' + 'personalization not allowed, privacy settings for personalization: ' + user_consent.personalization);
|
1160
1160
|
$("#themes_menu").hide();
|
1161
1161
|
} else {
|
1162
1162
|
$("#themes_menu").show();
|
@@ -1198,8 +1198,8 @@ var j1 = (function () {
|
|
1198
1198
|
|
1199
1199
|
// Manage providers for personalization OptIn/Out (Comments|Ads)
|
1200
1200
|
if (!user_consent.personalization) {
|
1201
|
-
logger.
|
1202
|
-
logger.
|
1201
|
+
logger.debug('\n' + 'disable comment provider: ' + comment_provider);
|
1202
|
+
logger.debug('\n' + 'personalization not allowed, privacy settings for personalization: ' + user_consent.personalization);
|
1203
1203
|
$('#leave-a-comment').remove();
|
1204
1204
|
if (comment_provider === 'disqus') {
|
1205
1205
|
$('#dsq-count-scr').remove();
|
@@ -1260,7 +1260,7 @@ var j1 = (function () {
|
|
1260
1260
|
// no dropcaps if translation enabled
|
1261
1261
|
if (user_translate.translationEnabled) {
|
1262
1262
|
logger.info('\n' + 'translation enabled: ' + user_translate.translationEnabled);
|
1263
|
-
logger.
|
1263
|
+
logger.debug('\n' + 'skipped processing of dropcaps');
|
1264
1264
|
} else {
|
1265
1265
|
// initialize dropcaps
|
1266
1266
|
logger.info('\n' + 'post processing: createDropCap');
|
@@ -1289,7 +1289,7 @@ var j1 = (function () {
|
|
1289
1289
|
logger.info('\n' + 'tracking disabled, tracking id found: ' + tracking_id);
|
1290
1290
|
}
|
1291
1291
|
} else {
|
1292
|
-
logger.
|
1292
|
+
logger.debug('\n' + 'tracking not allowed, privacy settings for analysis: ' + user_consent.analysis);
|
1293
1293
|
}
|
1294
1294
|
|
1295
1295
|
logger.info('\n' + 'mode detected: web');
|
@@ -1338,8 +1338,8 @@ var j1 = (function () {
|
|
1338
1338
|
// for GDPR compliance, themes feature may disabled on
|
1339
1339
|
// privacy settings
|
1340
1340
|
if (!user_consent.personalization) {
|
1341
|
-
logger.
|
1342
|
-
logger.
|
1341
|
+
logger.debug('\n' + 'disable themes feature because of privacy settings');
|
1342
|
+
logger.debug('\n' + 'personalization not allowed, privacy settings for personalization: ' + user_consent.personalization);
|
1343
1343
|
$("#themes_menu").hide();
|
1344
1344
|
} else {
|
1345
1345
|
$("#themes_menu").show();
|
@@ -1594,7 +1594,7 @@ var j1 = (function () {
|
|
1594
1594
|
if (options.xhr_data_element !== '') {
|
1595
1595
|
logger.info('\n' + 'XHR data element found: ' + options.xhr_data_element);
|
1596
1596
|
} else {
|
1597
|
-
logger.
|
1597
|
+
logger.debug('\n' + 'no XHR data element found, loading data aborted');
|
1598
1598
|
return;
|
1599
1599
|
}
|
1600
1600
|
|
@@ -1626,7 +1626,7 @@ var j1 = (function () {
|
|
1626
1626
|
// failsafe - prevent XHR load errors
|
1627
1627
|
if (id != '#undefined') {
|
1628
1628
|
logText = '\n' + 'data not loaded on id:' + id;
|
1629
|
-
logger.
|
1629
|
+
logger.debug(logText);
|
1630
1630
|
j1.setXhrDataState(id, 'not loaded');
|
1631
1631
|
j1.setXhrDomState(id, 'not loaded');
|
1632
1632
|
// Set processing state to 'finished' to complete module load
|
@@ -98,7 +98,6 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
98
98
|
var secure;
|
99
99
|
var logText;
|
100
100
|
var cookie_written;
|
101
|
-
var modal_language;
|
102
101
|
var navigator_language;
|
103
102
|
var translation_language;
|
104
103
|
var ddSourceLanguage;
|
@@ -171,7 +170,6 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
171
170
|
domain = hostname.substring(hostname.lastIndexOf('.', hostname.lastIndexOf('.') - 1) + 1);
|
172
171
|
cookie_domain = (domain.includes('.')) ? '.' + domain : domain;
|
173
172
|
secure = (url.protocol.includes('https')) ? true : false;
|
174
|
-
modal_language = "{{site.language}}";
|
175
173
|
navigator_language = navigator.language || navigator.userLanguage; // userLanguage for MS IE compatibility
|
176
174
|
translation_language = navigator_language.split('-')[0];
|
177
175
|
cookie_names = j1.getCookieNames();
|
@@ -270,6 +268,10 @@ j1.adapter['translator'] = (function (j1, window) {
|
|
270
268
|
expires: 365
|
271
269
|
});
|
272
270
|
|
271
|
+
if (moduleOptions.dialogLanguage === 'auto') {
|
272
|
+
moduleOptions.dialogLanguage = '{{contentLanguage}}';
|
273
|
+
}
|
274
|
+
|
273
275
|
j1.translator = new Translator({
|
274
276
|
contentURL: moduleOptions.contentURL, // dialog content (modals) for all supported languages
|
275
277
|
cookieName: moduleOptions.cookieName, // the name of the User State Cookie (primary data)
|
@@ -2456,6 +2456,12 @@ module.exports = function navigator(options) {
|
|
2456
2456
|
var defaultOptions = options;
|
2457
2457
|
var logger = log4javascript.getLogger('j1.core.navigator.eventHandler');
|
2458
2458
|
var $getNav = $('nav.navbar.navigator');
|
2459
|
+
var scrollDuration = 300;
|
2460
|
+
var page_link;
|
2461
|
+
var classname;
|
2462
|
+
var nav_link;
|
2463
|
+
var anchor_id;
|
2464
|
+
var scrollOffset;
|
2459
2465
|
var json_data; // jadams: unused code (for now).: manages HTML5 server side events
|
2460
2466
|
// for incoming messages from Git Server send e.g. on a 'pull request'
|
2461
2467
|
// NOTE: used for ControlCenter (cc) functionality only !!!
|
@@ -2496,12 +2502,65 @@ module.exports = function navigator(options) {
|
|
2496
2502
|
// 'scroll-to-top'
|
2497
2503
|
// See:
|
2498
2504
|
// https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault
|
2505
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation
|
2499
2506
|
// https://stackoverflow.com/questions/134845/which-href-value-should-i-use-for-javascript-links-or-javascriptvoid0
|
2500
2507
|
//
|
2501
2508
|
|
2502
2509
|
$('a[href="#"]').click(function (e) {
|
2503
2510
|
logger.debug('\n' + 'click event on href "#" detected: prevent default action');
|
2504
2511
|
e.preventDefault ? e.preventDefault() : e.returnValue = false;
|
2512
|
+
}); // -----------------------------------------------------------------------
|
2513
|
+
// In-page smooth scroll
|
2514
|
+
// -----------------------------------------------------------------------
|
2515
|
+
// bind click event to all headlines generated by AsciiDoctor
|
2516
|
+
// for smooth-scroll (in-page)
|
2517
|
+
//
|
2518
|
+
|
2519
|
+
$('.sect1, .sect2 .sect3, .sect4, .sect5, .sect6').on('click', function (e) {
|
2520
|
+
page_link = document.querySelector('[id="' + decodeURI(anchor_id).split('#').join('') + '"]') ? true : false;
|
2521
|
+
anchor_id = e.target.hash ? e.target.hash : false;
|
2522
|
+
classname = e.target.className ? e.target.className : '';
|
2523
|
+
nav_link = classname.includes('nav-link'); // skip BS nav links
|
2524
|
+
|
2525
|
+
scrollOffset = j1.getScrollOffset();
|
2526
|
+
|
2527
|
+
if (anchor_id && !nav_link || page_link) {
|
2528
|
+
logger.debug('\n' + 'click event on headline detected: ' + anchor_id);
|
2529
|
+
$('html, body').animate({
|
2530
|
+
scrollTop: $(anchor_id).offset().top + scrollOffset
|
2531
|
+
}, scrollDuration);
|
2532
|
+
e.preventDefault ? e.preventDefault() : e.returnValue = false;
|
2533
|
+
}
|
2534
|
+
}); // bind click event to all HTML elements of class '.badge' (Bootstrap)
|
2535
|
+
// for smooth-scroll (in-page) to a '<div>' element
|
2536
|
+
//
|
2537
|
+
|
2538
|
+
$('.badge').on('click', function (e) {
|
2539
|
+
anchor_id = e.target.hash ? e.target.hash : false;
|
2540
|
+
scrollOffset = 100;
|
2541
|
+
|
2542
|
+
if (anchor_id) {
|
2543
|
+
logger.debug('\n' + 'click event on badge detected: ' + anchor_id);
|
2544
|
+
$('html, body').animate({
|
2545
|
+
scrollTop: $(anchor_id).offset().top - scrollOffset // NOTE: diffeent scrollOffset
|
2546
|
+
|
2547
|
+
}, scrollDuration);
|
2548
|
+
event.stopPropagation();
|
2549
|
+
}
|
2550
|
+
}); // bind click event to all HTML elements of class '.badge-tag' (j1)
|
2551
|
+
// for smooth-scroll (in-page)
|
2552
|
+
|
2553
|
+
$('.badge-tag').on('click', function (e) {
|
2554
|
+
anchor_id = e.target.hash ? e.target.hash : false;
|
2555
|
+
scrollOffset = j1.getScrollOffset();
|
2556
|
+
|
2557
|
+
if (anchor_id) {
|
2558
|
+
logger.debug('\n' + 'click event on badge-tag detected: ' + anchor_id);
|
2559
|
+
$('html, body').animate({
|
2560
|
+
scrollTop: $(anchor_id).offset().top + scrollOffset
|
2561
|
+
}, scrollDuration);
|
2562
|
+
event.stopPropagation();
|
2563
|
+
}
|
2505
2564
|
}); // jadams: test code for jQuery plugin 'regex'
|
2506
2565
|
// -----------------------------------------------------------------------
|
2507
2566
|
// $('a:contains("?#")').click(function(e) {
|