j1-template 2024.3.13 → 2024.3.14
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/layouts/content_generator_news_panel_posts.html +1 -1
- data/_includes/themes/j1/layouts/layout_resource_generator.html +1 -4
- data/_includes/themes/j1/procedures/blocks/footer/boxes/social_media_icons.proc +24 -23
- data/_includes/themes/j1/procedures/layouts/content_writer.proc +4 -3
- data/_includes/themes/j1/procedures/layouts/default_writer.proc +37 -6
- data/_includes/themes/j1/procedures/layouts/module_writer.proc +31 -95
- data/_includes/themes/j1/procedures/layouts/resource_writer.proc +51 -29
- data/assets/data/amplitude.28.html +887 -0
- data/assets/data/amplitude.29.html +923 -0
- data/assets/data/amplitude.html +311 -46
- data/assets/data/banner.html +9 -7
- data/assets/data/masterslider.html +128 -7
- data/assets/data/panel.html +16 -65
- data/assets/theme/j1/adapter/js/amplitude.23.js +1165 -0
- data/assets/theme/j1/adapter/js/amplitude.24.js +1164 -0
- data/assets/theme/j1/adapter/js/amplitude.25.js +1268 -0
- data/assets/theme/j1/adapter/js/amplitude.js +294 -117
- data/assets/theme/j1/adapter/js/attic.js +14 -11
- data/assets/theme/j1/adapter/js/docsearch.js +2 -2
- data/assets/theme/j1/adapter/js/fab.js +2 -2
- data/assets/theme/j1/adapter/js/j1.js +8 -8
- data/assets/theme/j1/adapter/js/lazyLoader.js +60 -10
- data/assets/theme/j1/adapter/js/masonry.js +1 -1
- data/assets/theme/j1/adapter/js/masterslider.js +2 -2
- data/assets/theme/j1/adapter/js/particles.js +2 -2
- data/assets/theme/j1/adapter/js/scroller.js +2 -2
- data/assets/theme/j1/adapter/js/slick.js +2 -2
- data/assets/theme/j1/adapter/js/themes.js +1 -1
- data/assets/theme/j1/adapter/js/translator.js +2 -2
- data/assets/theme/j1/adapter/js/waves.js +1 -1
- data/assets/theme/j1/core/css/animate.css +1634 -1070
- data/assets/theme/j1/core/css/animate.css.map +1 -0
- data/assets/theme/j1/core/css/animate.min.css +2 -1
- data/assets/theme/j1/core/css/animate.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/fontawesome.css +3060 -1538
- data/assets/theme/j1/core/css/icon-fonts/fontawesome.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/fontawesome.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/fontawesome.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/iconify.css +2308 -1153
- data/assets/theme/j1/core/css/icon-fonts/iconify.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/iconify.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/iconify.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdi.css +16716 -8423
- data/assets/theme/j1/core/css/icon-fonts/mdi.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdi.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/mdi.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdib.css +5554 -2766
- data/assets/theme/j1/core/css/icon-fonts/mdib.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdib.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/mdib.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdil.css +742 -441
- data/assets/theme/j1/core/css/icon-fonts/mdil.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdil.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/mdil.min.css.map +1 -0
- data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.css +6552 -3980
- data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.css.map +1 -0
- data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.min.css +2 -5
- data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.min.css.map +1 -0
- data/assets/theme/j1/core/css/themes/unodark/bootstrap.css +6818 -4131
- data/assets/theme/j1/core/css/themes/unodark/bootstrap.css.map +1 -0
- data/assets/theme/j1/core/css/themes/unodark/bootstrap.min.css +2 -5
- data/assets/theme/j1/core/css/themes/unodark/bootstrap.min.css.map +1 -0
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.css +18568 -11577
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.css.map +1 -0
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css +2 -35
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css.map +1 -0
- data/assets/theme/j1/core/css/vendor.css +1771 -1043
- data/assets/theme/j1/core/css/vendor.css.map +1 -0
- data/assets/theme/j1/core/css/vendor.min.css +2 -1
- data/assets/theme/j1/core/css/vendor.min.css.map +1 -0
- data/assets/theme/j1/core/js/template.js +399 -447
- data/assets/theme/j1/core/js/template.min.js +7 -7
- data/assets/theme/j1/core/js/template.min.js.map +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.css +4 -2
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.css +39 -4
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.css +57 -17
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/icons/player/blue/pause.png +0 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/blue/play.png +0 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/blue/play.svg +87 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-backward.svg +60 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-forward.svg +59 -0
- data/assets/theme/j1/modules/amplitudejs/js/amplitude.js +65 -21
- data/assets/theme/j1/modules/amplitudejs/js/amplitude.min.js +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/tech/ytp.js +113 -0
- data/assets/theme/j1/modules/iconPicker/js/universal-icon-picker.js +471 -471
- data/assets/theme/j1/modules/j1LazyLoader/LICENSE +21 -0
- data/assets/theme/j1/modules/j1LazyLoader/js/j1Lazy.js +870 -0
- data/assets/theme/j1/modules/js-cookies/js/js.cookie.js +3 -3
- data/assets/theme/j1/modules/lazyCssLoader/js/main.0.js +166 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/main.1.js +65 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/main.js +66 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/plugins/examplePlugin.js +13 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/plugins/my-plugin.js +25 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/plugins/plugin-interface.js +9 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/plugins/pluginA.js +46 -0
- data/assets/theme/j1/modules/lazyLoader/js/plugins/README.md +324 -0
- data/assets/theme/j1/modules/lazyLoader/js/plugins/jquery.lazy.picture.js +188 -0
- data/assets/theme/j1/modules/lightGallery/js/lightgallery.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.0.js +794 -0
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +151 -67
- data/assets/theme/j1/modules/slimSelect/js/select.js +1 -1
- data/assets/theme/j1/modules/slimSelect/js/select.min.js +3 -3
- data/assets/theme/j1/modules/themeSwitcher/js/switcher.js +2 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/dm/dailymotion.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/dm/icon/scalable/dailymotion.svg +62 -0
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/v3.0.0/youtube.js +832 -0
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/v3.0.0/youtube.min.js +17 -0
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/youtube.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/video.js +2 -2
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/README.md +577 -560
- data/lib/starter_web/_config.yml +2 -2
- data/lib/starter_web/_data/blocks/footer.yml +10 -5
- data/lib/starter_web/_data/blocks/panel.yml +2 -2
- data/lib/starter_web/_data/layouts/default.yml +14 -3
- data/lib/starter_web/_data/modules/amplitude.yml +145 -0
- data/lib/starter_web/_data/modules/defaults/amplitude.yml +29 -7
- data/lib/starter_web/_data/modules/defaults/lazyLoader.yml +2 -2
- data/lib/starter_web/_data/modules/gallery.yml +136 -0
- data/lib/starter_web/_data/modules/lazyLoader.0.yml +118 -0
- data/lib/starter_web/_data/modules/lazyLoader.yml +68 -31
- data/lib/starter_web/_data/modules/masonry.yml +4 -4
- data/lib/starter_web/_data/modules/masterslider.yml +118 -12
- data/lib/starter_web/_data/modules/navigator_menu.yml +831 -803
- data/lib/starter_web/_data/resources.yml +154 -190
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_includes/attributes.asciidoc +1 -0
- data/lib/starter_web/_plugins/asciidoctor/amplitude-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/dailymotion-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/gallery-block.rb +4 -2
- data/lib/starter_web/_plugins/asciidoctor/masonry-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/videojs-block.rb +58 -46
- data/lib/starter_web/_plugins/asciidoctor/vimeo-block.rb +26 -19
- data/lib/starter_web/_plugins/asciidoctor/youtube-block.rb +30 -40
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/assets/image/icons/lanus/favicon.ico +0 -0
- data/lib/starter_web/assets/image/icons/lanus/lanus-512x512.png +0 -0
- data/lib/starter_web/assets/image/icons/lanus/lanus.ico +0 -0
- data/lib/starter_web/assets/image/icons/lanus/lanus.png +0 -0
- data/lib/starter_web/assets/image/icons/lanus/scalable/lanus.svg +76 -0
- data/lib/starter_web/assets/image/icons/lanus/scalable/lanus_sw.svg +62 -0
- data/lib/starter_web/assets/image/modules/icons/social/scalable/icon-twitter-x-28 - social.svg +86 -0
- data/lib/starter_web/assets/image/modules/icons/social/scalable/icon-twitter-x-28.svg +64 -0
- data/lib/starter_web/assets/image/modules/icons/social/scalable/icon-twitter-x.svg +1 -0
- data/lib/starter_web/assets/image/modules/icons/social/twitter_x.png +0 -0
- data/lib/starter_web/package.json +7 -18
- data/lib/starter_web/pages/public/amplitude_yt_tester.adoc +218 -0
- data/lib/starter_web/pages/public/features/template.adoc +18 -8
- data/lib/starter_web/pages/public/features/template.asciidoc +758 -0
- data/lib/starter_web/pages/public/lazy_loader_tester.adoc +402 -0
- data/lib/starter_web/pages/public/manuals/ytdl/man.adoc +3020 -0
- data/lib/starter_web/pages/public/manuals/ytdl/man.md +2378 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/attributes.asciidoc +0 -16
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/amplitudejs.large.css.asciidoc +505 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.hover.html +69 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.nested.html +75 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.textarea.html +57 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/my.content.html +112 -0
- data/lib/starter_web/pages/public/tools/previewer/preview_amplitudejs.adoc +172 -0
- data/lib/starter_web/pages/public/tour/_includes/attributes.asciidoc +2 -2
- data/lib/starter_web/pages/public/tour/_includes/documents/419_advanced_modals_demo.asciidoc +16 -16
- data/lib/starter_web/pages/public/tour/asciidoc_extensions.adoc +13 -3
- data/lib/starter_web/pages/public/tour/bootstrap_themes.adoc +12 -3
- data/lib/starter_web/pages/public/tour/highlghter_rouge.adoc +13 -3
- data/lib/starter_web/pages/public/tour/icon_fonts.adoc +12 -3
- data/lib/starter_web/pages/public/tour/modal_extentions.adoc +12 -6
- data/lib/starter_web/pages/public/tour/{playback_audio.adoc → play_audio.adoc} +207 -188
- data/lib/starter_web/pages/public/tour/{playback_video.adoc → play_video.adoc} +49 -51
- data/lib/starter_web/pages/public/tour/present_images.adoc +27 -5
- data/lib/starter_web/pages/public/tour/quicksearch.adoc +13 -3
- data/lib/starter_web/pages/public/tour/responsive_tables.adoc +13 -4
- data/lib/starter_web/pages/public/tour/typography.adoc +12 -3
- metadata +90 -22
- /data/assets/theme/j1/modules/{lazyLoader → j1LazyLoader/js}/plugins/README.md +0 -0
- /data/assets/theme/j1/modules/{lazyLoader/plugins/jquery.lazy.picture.js → j1LazyLoader/js/plugins/picture.js} +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.ajax.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.ajax.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.av.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.av.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.iframe.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.iframe.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.noop.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.noop.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.picture.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.script.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.script.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.vimeo.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.vimeo.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.youtube.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.youtube.min.js +0 -0
@@ -169,8 +169,8 @@ j1.adapter.attic = ((j1, window) => {
|
|
169
169
|
// jadams, 2023-05-12: page visible while loading the attic
|
170
170
|
// cause high numbers for cumulative layout shift (CLS)
|
171
171
|
//
|
172
|
-
logger.debug('\n' + 'hide attic on initialization');
|
173
|
-
$('#no_flicker').css('display', 'none');
|
172
|
+
// logger.debug('\n' + 'hide attic on initialization');
|
173
|
+
// $('#no_flicker').css('display', 'none');
|
174
174
|
}
|
175
175
|
|
176
176
|
_this.createAllAttics();
|
@@ -664,15 +664,18 @@ j1.adapter.attic = ((j1, window) => {
|
|
664
664
|
|
665
665
|
// start RUNNER on page 'ready'|module state 'initialized'
|
666
666
|
//
|
667
|
-
$(() => {
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
});
|
667
|
+
// $(() => {
|
668
|
+
// var dependencies_met_attic_ready = setInterval (() => {
|
669
|
+
// if (_this.getState() === 'initialized') {
|
670
|
+
// logger.info('\n' + 'initialize attic on id {{attic_id}}: started');
|
671
|
+
// {{attic_id}}_runner (atticOptions);
|
672
|
+
// clearInterval(dependencies_met_attic_ready);
|
673
|
+
// }
|
674
|
+
// }, 10);
|
675
|
+
// });
|
676
|
+
|
677
|
+
logger.info('\n' + 'initialize attic on id {{attic_id}}: started');
|
678
|
+
{{attic_id}}_runner (atticOptions);
|
676
679
|
|
677
680
|
} // END apply CSS styles|start ATTIC RUNNER
|
678
681
|
|
@@ -146,9 +146,9 @@ var timeSeconds;
|
|
146
146
|
var pageState = $('#content').css("display");
|
147
147
|
var pageVisible = (pageState === 'block') ? true : false;
|
148
148
|
var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
|
149
|
-
var atticFinished = (j1.adapter.attic.getState() === 'finished') ? true: false;
|
149
|
+
// var atticFinished = (j1.adapter.attic.getState() === 'finished') ? true: false;
|
150
150
|
|
151
|
-
if (j1CoreFinished && pageVisible
|
151
|
+
if (j1CoreFinished && pageVisible) {
|
152
152
|
startTimeModule = Date.now();
|
153
153
|
|
154
154
|
_this.setState('started');
|
@@ -160,9 +160,9 @@ j1.adapter.fab = ((j1, window) => {
|
|
160
160
|
var pageState = $('#content').css("display");
|
161
161
|
var pageVisible = (pageState === 'block') ? true : false;
|
162
162
|
var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
|
163
|
-
var atticFinished = (j1.adapter.attic.getState() === 'finished') ? true: false;
|
163
|
+
// var atticFinished = (j1.adapter.attic.getState() === 'finished') ? true: false;
|
164
164
|
|
165
|
-
if (pageVisible && j1CoreFinished
|
165
|
+
if (pageVisible && j1CoreFinished) {
|
166
166
|
startTimeModule = Date.now();
|
167
167
|
|
168
168
|
_this.setState('started');
|
@@ -564,9 +564,9 @@ var j1 = ((options) => {
|
|
564
564
|
var pageState = $('#no_flicker').css("display");
|
565
565
|
var pageVisible = (pageState == 'block') ? true : false;
|
566
566
|
var j1CoreFinished = (j1.getState() == 'finished') ? true : false;
|
567
|
-
var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true: false;
|
567
|
+
// var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true: false;
|
568
568
|
|
569
|
-
if (j1CoreFinished && pageVisible
|
569
|
+
if (j1CoreFinished && pageVisible) {
|
570
570
|
startTimeModule = Date.now();
|
571
571
|
|
572
572
|
banner_blocks = document.querySelectorAll('[id^="banner"]').length;
|
@@ -732,9 +732,9 @@ var j1 = ((options) => {
|
|
732
732
|
var pageState = $('#no_flicker').css("display");
|
733
733
|
var pageVisible = (pageState == 'block') ? true : false;
|
734
734
|
var j1CoreFinished = (j1.getState() == 'finished') ? true : false;
|
735
|
-
var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true: false;
|
735
|
+
// var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true: false;
|
736
736
|
|
737
|
-
if (pageVisible
|
737
|
+
if (pageVisible) {
|
738
738
|
startTimeModule = Date.now();
|
739
739
|
|
740
740
|
logger.info('\n' + 'page is being initialized');
|
@@ -1355,9 +1355,9 @@ var j1 = ((options) => {
|
|
1355
1355
|
var pageState = $('#no_flicker').css("display");
|
1356
1356
|
var pageVisible = (pageState == 'block') ? true: false;
|
1357
1357
|
var j1CoreFinished = (j1.getState() == 'finished') ? true : false;
|
1358
|
-
var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true: false;
|
1358
|
+
// var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true: false;
|
1359
1359
|
|
1360
|
-
if (j1CoreFinished && pageVisible
|
1360
|
+
if (j1CoreFinished && pageVisible) {
|
1361
1361
|
setTimeout(() => {
|
1362
1362
|
// scroll to an anchor in current page if given in URL
|
1363
1363
|
j1.scrollToAnchor();
|
@@ -1552,9 +1552,9 @@ var j1 = ((options) => {
|
|
1552
1552
|
var pageState = $('#no_flicker').css("display");
|
1553
1553
|
var pageVisible = (pageState == 'block') ? true: false;
|
1554
1554
|
var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
|
1555
|
-
var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true: false;
|
1555
|
+
// var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true: false;
|
1556
1556
|
|
1557
|
-
if (j1CoreFinished && pageVisible
|
1557
|
+
if (j1CoreFinished && pageVisible) {
|
1558
1558
|
setTimeout(() => {
|
1559
1559
|
// scroll to an anchor in current page if given in URL
|
1560
1560
|
j1.scrollToAnchor();
|
@@ -6,8 +6,8 @@ regenerate: true
|
|
6
6
|
|
7
7
|
{% comment %}
|
8
8
|
# -----------------------------------------------------------------------------
|
9
|
-
# ~/assets/theme/j1/adapter/js/
|
10
|
-
# Liquid template to adapt the
|
9
|
+
# ~/assets/theme/j1/adapter/js/lazyLoader.js
|
10
|
+
# Liquid template to adapt the J1 lazyLoader module
|
11
11
|
#
|
12
12
|
# Product/Info:
|
13
13
|
# https://jekyll.one
|
@@ -58,7 +58,7 @@ regenerate: true
|
|
58
58
|
/*
|
59
59
|
# -----------------------------------------------------------------------------
|
60
60
|
# ~/assets/theme/j1/adapter/js/lazyLoader.js
|
61
|
-
# J1 Adapter for the lazyLoader module
|
61
|
+
# J1 Adapter for the J1 lazyLoader module
|
62
62
|
#
|
63
63
|
# Product/Info:
|
64
64
|
# https://jekyll.one
|
@@ -77,7 +77,7 @@ regenerate: true
|
|
77
77
|
// -----------------------------------------------------------------------------
|
78
78
|
/* eslint indent: "off" */
|
79
79
|
// -----------------------------------------------------------------------------
|
80
|
-
|
80
|
+
`use strict`;
|
81
81
|
j1.adapter.lazyLoader = ((j1, window) => {
|
82
82
|
|
83
83
|
{% comment %} Set global variables
|
@@ -175,15 +175,65 @@ var timeSeconds;
|
|
175
175
|
//
|
176
176
|
registerLoaders: () => {
|
177
177
|
{% for loader in lazy_loader_options.loaders %} {% if loader.enabled %}
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
178
|
+
|
179
|
+
{% if loader.type == 'css' %}
|
180
|
+
_this.cssLoader().observe({
|
181
|
+
src: '{{loader.src}}',
|
182
|
+
selector: '{{loader.selector}}',
|
183
|
+
rootMargin: '{{loader.rootMargin}}'
|
184
|
+
});
|
185
|
+
logger.info('\n' + 'register lazy loading for: {{loader.description}}');
|
186
|
+
{% endif %}
|
187
|
+
|
184
188
|
{% endif %} {% endfor %}
|
185
189
|
}, // END registerLoaders
|
186
190
|
|
191
|
+
// -------------------------------------------------------------------------
|
192
|
+
// cssLoader()
|
193
|
+
// Lazy load CSS to speed up page rendering
|
194
|
+
//
|
195
|
+
cssLoader: () => {
|
196
|
+
let options = {};
|
197
|
+
|
198
|
+
const observe = (opt) => {
|
199
|
+
options = opt;
|
200
|
+
|
201
|
+
(('IntersectionObserver' in window) ? cssObserver : doNothing) ();
|
202
|
+
}
|
203
|
+
|
204
|
+
const doNothing = () => {
|
205
|
+
observe = false;
|
206
|
+
}
|
207
|
+
|
208
|
+
const cssDomLink = () => {
|
209
|
+
let link = document.createElement('link');
|
210
|
+
let id = 'lazy' + options.selector;
|
211
|
+
link.id = id.replace('.', '_');;
|
212
|
+
link.rel = 'stylesheet';
|
213
|
+
link.type = 'text/css';
|
214
|
+
link.href = options.src;
|
215
|
+
document.head.appendChild(link);
|
216
|
+
logger.info('\n' + 'lazy load of type ' + link.rel + ': ' + link.href);
|
217
|
+
}
|
218
|
+
|
219
|
+
const cssObserver = () => {
|
220
|
+
let selectors = document.querySelectorAll(options.selector);
|
221
|
+
let observer = new IntersectionObserver((entry, observer) => {
|
222
|
+
if (entry[0].intersectionRatio > 0) {
|
223
|
+
cssDomLink();
|
224
|
+
sessionStorage[options.selector] = true;
|
225
|
+
observer.disconnect();
|
226
|
+
}
|
227
|
+
}, { rootMargin: options.rootMargin });
|
228
|
+
|
229
|
+
selectors.forEach(selector => {
|
230
|
+
observer.observe(selector);
|
231
|
+
});
|
232
|
+
}
|
233
|
+
|
234
|
+
return { observe };
|
235
|
+
},
|
236
|
+
|
187
237
|
// -------------------------------------------------------------------------
|
188
238
|
// messageHandler()
|
189
239
|
// manage messages send from other J1 modules
|
@@ -153,7 +153,7 @@ j1.adapter.masonry = ((j1, window) => {
|
|
153
153
|
var pageState = $('#content').css("display");
|
154
154
|
var pageVisible = (pageState === 'block') ? true: false;
|
155
155
|
var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
|
156
|
-
var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
156
|
+
// var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
157
157
|
|
158
158
|
if (j1CoreFinished && pageVisible) {
|
159
159
|
startTimeModule = Date.now();
|
@@ -164,9 +164,9 @@ j1.adapter.masterslider = ((j1, window) => {
|
|
164
164
|
var pageVisible = (pageState === 'block') ? true : false;
|
165
165
|
var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
|
166
166
|
var dataLoaded = (_this.getState() === 'data_loaded') ? true : false;
|
167
|
-
var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
167
|
+
// var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
168
168
|
|
169
|
-
if (pageVisible && j1CoreFinished && dataLoaded
|
169
|
+
if (pageVisible && j1CoreFinished && dataLoaded) {
|
170
170
|
startTimeModule = Date.now();
|
171
171
|
|
172
172
|
_this.setState('started');
|
@@ -146,9 +146,9 @@ j1.adapter.particles = ((j1, window) => {
|
|
146
146
|
var pageState = $('#content').css("display");
|
147
147
|
var pageVisible = (pageState === 'block') ? true : false;
|
148
148
|
var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
|
149
|
-
var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
149
|
+
// var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
150
150
|
|
151
|
-
if (j1CoreFinished && pageVisible
|
151
|
+
if (j1CoreFinished && pageVisible) {
|
152
152
|
startTimeModule = Date.now();
|
153
153
|
|
154
154
|
var obj;
|
@@ -150,9 +150,9 @@ j1.adapter.scroller = ((j1, window) => {
|
|
150
150
|
var pageState = $('#content').css("display");
|
151
151
|
var pageVisible = (pageState === 'block') ? true: false;
|
152
152
|
var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
|
153
|
-
var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
153
|
+
// var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
154
154
|
|
155
|
-
if (j1CoreFinished && pageVisible
|
155
|
+
if (j1CoreFinished && pageVisible) {
|
156
156
|
startTimeModule = Date.now();
|
157
157
|
|
158
158
|
_this.setState('started');
|
@@ -179,9 +179,9 @@ j1.adapter.slick = ((j1, window) => {
|
|
179
179
|
var pageState = $('#content').css("display");
|
180
180
|
var pageVisible = (pageState == 'block') ? true : false;
|
181
181
|
var j1CoreFinished = (j1.getState() == 'finished') ? true : false;
|
182
|
-
var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
182
|
+
// var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
183
183
|
|
184
|
-
if (j1CoreFinished && pageVisible
|
184
|
+
if (j1CoreFinished && pageVisible) {
|
185
185
|
startTimeModule = Date.now();
|
186
186
|
|
187
187
|
_this.setState('started');
|
@@ -242,7 +242,7 @@ j1.adapter.themes = (function (j1, window) {
|
|
242
242
|
// var pageState = $('#no_flicker').css("display");
|
243
243
|
var pageVisible = (pageState === 'block') ? true : false;
|
244
244
|
var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
|
245
|
-
|
245
|
+
// var atticFinished = (j1.adapter.attic.getState() === 'finished') ? true: false;
|
246
246
|
// var userStateDetected = j1.existsCookie(cookie_names.user_state);
|
247
247
|
|
248
248
|
// counter how often the check should be done for the existence
|
@@ -197,9 +197,9 @@ j1.adapter.translator = (function (j1, window) {
|
|
197
197
|
var pageState = $('#content').css("display");
|
198
198
|
var pageVisible = (pageState == 'block') ? true: false;
|
199
199
|
var j1CoreFinished = (j1.getState() == 'finished') ? true : false;
|
200
|
-
var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
200
|
+
// var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
201
201
|
|
202
|
-
if (j1CoreFinished && pageVisible
|
202
|
+
if (j1CoreFinished && pageVisible) {
|
203
203
|
|
204
204
|
var expires = '{{cookie_options.expires}}';
|
205
205
|
var same_site = '{{cookie_options.same_site}}';
|
@@ -157,7 +157,7 @@ j1.adapter.waves = ((j1, window) => {
|
|
157
157
|
var pageState = $('#content').css("display");
|
158
158
|
var pageVisible = (pageState === 'block') ? true : false;
|
159
159
|
var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
|
160
|
-
var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
160
|
+
// var atticFinished = (j1.adapter.attic.getState() == 'finished') ? true : false;
|
161
161
|
|
162
162
|
if (j1CoreFinished && pageVisible) {
|
163
163
|
startTimeModule = Date.now();
|