j1-template 2021.3.1 → 2022.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/_includes/themes/j1/blocks/ads/ad.html +14 -14
- data/_includes/themes/j1/layouts/content_generator_news_panel_posts.html +4 -4
- data/_includes/themes/j1/layouts/content_generator_post.html +4 -4
- data/_includes/themes/j1/modules/navigator/generator.html +9 -11
- data/_includes/themes/j1/modules/search/docsearch.html +1 -1
- data/_includes/themes/j1/procedures/global/create_bs_button.proc +5 -5
- data/_includes/themes/j1/procedures/global/create_word_cloud.proc +5 -3
- data/_includes/themes/j1/procedures/layouts/module_writer.proc +1 -1
- data/_includes/themes/j1/procedures/posts/collate_timeline.proc +3 -3
- data/_includes/themes/j1/procedures/posts/create_series_header.proc +1 -1
- data/_layouts/default.html +66 -22
- data/_layouts/home.html +1 -1
- data/_layouts/raw.html +2 -1
- data/assets/data/article_navigator/index.html +1 -1
- data/assets/data/authclient.html +11 -11
- data/assets/data/banner.html +7 -25
- data/assets/data/cookieconsent.html +20 -20
- data/assets/data/{fam.html → fab.html} +42 -24
- data/assets/data/gallery_customizer.html +6 -6
- data/assets/data/menu.html +55 -55
- data/assets/data/mmenu.html +53 -53
- data/assets/data/panel.html +17 -23
- data/assets/data/private.json +5 -1
- data/assets/data/quicklinks.html +7 -8
- data/assets/data/rtext_resizer.html +1 -1
- data/assets/data/themes.bootswatch.json +75 -0
- data/assets/data/themes.json +6 -6
- data/assets/data/translator.html +23 -23
- data/assets/error_pages/HTTP445.html +110 -0
- data/assets/themes/j1/adapter/js/bmd.js +1 -1
- data/assets/themes/j1/adapter/js/clipboard.js +1 -1
- data/assets/themes/j1/adapter/js/cookieConsent.js +7 -1
- data/assets/themes/j1/adapter/js/{fam.js → fab.js} +121 -116
- data/assets/themes/j1/adapter/js/j1.js +242 -174
- data/assets/themes/j1/adapter/js/mmenu.js +18 -24
- data/assets/themes/j1/adapter/js/navigator.js +6 -4
- data/assets/themes/j1/adapter/js/themer.js +13 -4
- data/assets/themes/j1/adapter/js/toccer.js +37 -76
- data/assets/themes/j1/adapter/js/translator.js +6 -0
- data/assets/themes/j1/core/country-flags/css/theme/uno.min.css +15 -0
- data/assets/themes/j1/core/css/animate.min.css +1 -1
- data/assets/themes/j1/core/css/icon-fonts/fontawesome.min.css +1 -1
- data/assets/themes/j1/core/css/icon-fonts/materialdesign-light.min.css +1 -1
- data/assets/themes/j1/core/css/icon-fonts/materialdesign.min.css +1 -1
- data/assets/themes/j1/core/css/icon-fonts/mdi.css +22307 -0
- data/assets/themes/j1/core/css/icon-fonts/mdi.min.css +1 -0
- data/assets/themes/j1/core/css/icon-fonts/mdil.css +1222 -0
- data/assets/themes/j1/core/css/icon-fonts/mdil.min.css +1 -0
- data/assets/themes/j1/core/css/icon-fonts/twemoji.css +4 -0
- data/assets/themes/j1/core/css/icon-fonts/twemoji.min.css +1 -1
- data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.css +5341 -4730
- data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.min.css +3 -1
- data/assets/themes/j1/core/css/themes/theme_vapor/bootstrap.css +8301 -0
- data/assets/themes/j1/core/css/themes/theme_vapor/bootstrap.min.css +3 -0
- data/assets/themes/j1/core/css/themes/{uno-dark → unodark}/bootstrap.css +5284 -4646
- data/assets/themes/j1/core/css/themes/unodark/bootstrap.min.css +3 -0
- data/assets/themes/j1/core/css/themes/{uno-light → unolight}/bootstrap.css +12188 -12734
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +23 -0
- data/assets/themes/j1/core/css/vendor.css +2 -28
- data/assets/themes/j1/core/css/vendor.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +8201 -10407
- data/assets/themes/j1/core/js/template.min.js +20 -30
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/backstretch/js/backstretch.min.js +1 -1
- data/assets/themes/j1/modules/bmd/js/bmd.js +2280 -0
- data/assets/themes/j1/modules/bmd/js/bmd.min.js +20 -0
- data/assets/themes/j1/modules/bootstrap/js/bootstrap.js +5072 -0
- data/assets/themes/j1/modules/bootstrap/js/bootstrap.min.js +7 -0
- data/assets/themes/j1/modules/bootstrap/js/bootstrap.min.js.map +1 -0
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +19 -17
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.min.js +1 -1
- data/assets/themes/j1/modules/datatables/js/datatables.js +1 -1
- data/assets/themes/j1/modules/datatables/js/datatables.min.js +5 -5
- data/assets/themes/j1/modules/{fam/css/theme/uno/fam.css → fab/css/theme/uno/fab.css} +32 -28
- data/assets/themes/j1/modules/{fam/css/theme/uno/fam.min.css → fab/css/theme/uno/fab.min.css} +3 -3
- data/assets/themes/j1/modules/{materialize → fab}/js/cash.js +20 -2
- data/assets/themes/j1/modules/{fam/js/fam.js → fab/js/fab.js} +4 -2
- data/assets/themes/j1/modules/{util → gtag-opt-in}/js/gtag-opt-in.js +15 -1
- data/assets/themes/j1/modules/gtag-opt-in/js/gtag-opt-in.min.js +15 -0
- data/assets/themes/j1/modules/iframeResizer/examples/frame.absolute.html +3 -3
- data/assets/themes/j1/modules/iframeResizer/examples/frame.content.html +6 -6
- data/assets/themes/j1/modules/iframeResizer/examples/frame.tolerance.html +2 -2
- data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.js +1 -1
- data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.min.js +1 -1
- data/assets/themes/j1/modules/iframeResizer/js/resizer.min.js +1 -1
- data/assets/themes/j1/modules/jquery/js/jquery.js +2 -2
- data/assets/themes/j1/modules/jquery/js/jquery.min.js +1 -1
- data/assets/themes/j1/modules/jquery/js/jqueryUI.js +7 -7
- data/assets/themes/j1/modules/jquery/js/jqueryUI.min.js +3 -3
- data/assets/themes/j1/modules/lightGallery/js/core/j1/lightgallery-x.min.js +1 -1
- data/assets/themes/j1/modules/lightGallery/js/core/lightgallery.min.js +1 -1
- data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-video.min.js +1 -1
- data/assets/themes/j1/modules/lightGallery/js/modules/j1/j1-x-video.min.js +1 -1
- data/assets/themes/j1/modules/lightGallery/js/modules/lg-thumbnail.min.js +4 -1
- data/assets/themes/j1/modules/lightbox/js/lightbox.js +1 -1
- data/assets/themes/j1/modules/lightbox/js/lightbox.min.js +1 -1
- data/assets/themes/j1/modules/lunrSearch/js/mustache.js +1 -1
- data/assets/themes/j1/modules/lunrSearch/js/mustache.min.js +1 -1
- data/assets/themes/j1/modules/lunrSearch/js/uri.js +1 -1
- data/assets/themes/j1/modules/lunrSearch/js/uri.min.js +7 -7
- data/assets/themes/j1/modules/materialize/js/autocomplete.js +1 -1
- data/assets/themes/j1/modules/materialize/js/bin/materialize.js +12374 -0
- data/assets/themes/j1/modules/materialize/js/bin/materialize.min.js +6 -0
- data/assets/themes/j1/modules/materialize/js/global.js +1 -1
- data/assets/themes/j1/modules/materialize/js/select.js +1 -1
- data/assets/themes/j1/modules/materialize/js/{tapTarget.js → tapTarget.cash.js} +1 -1
- data/assets/themes/j1/modules/materialize/js/tapTarget.jQuery.js +187 -0
- data/assets/themes/j1/modules/mdiPreviewer/js/previewer.min.js +1 -1
- data/assets/themes/j1/modules/mdilPreviewer/js/previewer.min.js +1 -1
- data/assets/themes/j1/modules/msDropdown/css/themes/uno/msDropdown.css +278 -0
- data/assets/themes/j1/modules/popper/js/popper.js +1670 -2346
- data/assets/themes/j1/modules/popper/js/popper.min.js +6 -4
- data/assets/themes/j1/modules/popper/js/popper.min.js.map +1 -1
- data/assets/themes/j1/modules/scroller/js/scroller.js +2 -2
- data/assets/themes/j1/modules/scroller/js/scroller.min.js +1 -1
- data/assets/themes/j1/modules/themeSwitcher/js/switcher.js +8 -8
- data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +1 -431
- data/assets/themes/j1/modules/translator/js/translator.js +6 -2
- data/assets/themes/j1/modules/translator/js/translator.min.js +1 -1
- data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.js +3 -3
- data/assets/themes/j1/modules/twemoji/js/picker/twemoji-picker.min.js +1 -1
- data/assets/themes/j1/modules/videojs/js/video.min.js +2 -2
- data/lib/j1/version.rb +3 -3
- data/lib/starter_web/Gemfile +2 -2
- data/lib/starter_web/_config.yml +21 -24
- data/lib/starter_web/_data/_defaults/j1_config.yml +1 -1
- data/lib/starter_web/_data/{private.default.yml → _defaults/private.yml} +2 -0
- data/lib/starter_web/_data/_defaults/resources.yml +1 -1
- data/lib/starter_web/_data/blocks/banner.yml +71 -68
- data/lib/starter_web/_data/blocks/defaults/banner.yml +5 -5
- data/lib/starter_web/_data/blocks/defaults/panel.yml +3 -3
- data/lib/starter_web/_data/blocks/panel.yml +171 -73
- data/lib/starter_web/_data/builder/defaults/blog_navigator.yml +42 -35
- data/lib/starter_web/_data/j1_config.yml +3 -3
- data/lib/starter_web/_data/layouts/article_navigator.yml +1 -1
- data/lib/starter_web/_data/layouts/blog_archive.yml +1 -1
- data/lib/starter_web/_data/layouts/collection.yml +1 -1
- data/lib/starter_web/_data/layouts/default.yml +1 -1
- data/lib/starter_web/_data/layouts/home.yml +6 -26
- data/lib/starter_web/_data/layouts/news_panel_posts.yml +1 -1
- data/lib/starter_web/_data/layouts/page.yml +1 -1
- data/lib/starter_web/_data/layouts/post.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/attics.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/{fam.yml → fab.yml} +8 -7
- data/lib/starter_web/_data/modules/defaults/navigator.yml +3 -0
- data/lib/starter_web/_data/modules/defaults/rtable.yml +2 -1
- data/lib/starter_web/_data/modules/defaults/scoller.yml +33 -0
- data/lib/starter_web/_data/modules/defaults/themer.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/toccer.yml +5 -4
- data/lib/starter_web/_data/modules/{fam.yml → fab.yml} +31 -31
- data/lib/starter_web/_data/modules/scroller.yml +2 -2
- data/lib/starter_web/_data/modules/toccer.yml +3 -5
- data/lib/starter_web/_data/private.yml +3 -1
- data/lib/starter_web/_data/resources.yml +48 -34
- data/lib/starter_web/_includes/attributes.asciidoc +121 -122
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/assets/images/pages/roundtrip/500_themes/themes-menu-1280x800.jpg +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +1 -4
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-01-01-about-cookies.adoc +2 -2
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-02-01-site-generators.adoc +2 -2
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-03-about-j1.adoc +2 -2
- 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 +2 -2
- data/lib/starter_web/index.html +1 -1
- data/lib/starter_web/package.json +4 -10
- data/lib/starter_web/pages/_test_pages/100_side-bar-tester.adoc +244 -0
- data/lib/starter_web/pages/_test_pages/_includes/attributes.asciidoc +110 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/100_gistblock.asciidoc +28 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_info.asciidoc +14 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_left_warning.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_bottom_right_danger.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_central_success.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_full_height_left_info.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_full_height_right_success.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_table_bs_modal_examples.asciidoc +47 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_info.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_left_info.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/410_top_right_success.asciidoc +11 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/419_advanced_modals_demo.asciidoc +337 -0
- data/lib/starter_web/pages/_test_pages/_includes/documents/tables/bs_modal_examples.asciidoc +47 -0
- data/lib/starter_web/pages/_test_pages/accordion-01-tester.adoc +220 -0
- data/lib/starter_web/pages/_test_pages/accordion-02-tester.adoc +177 -0
- data/lib/starter_web/pages/_test_pages/accordion-03-tester.adoc +148 -0
- data/lib/starter_web/pages/_test_pages/attribute-changes-01-tester.adoc +226 -0
- data/lib/starter_web/pages/_test_pages/backdrop-tester.adoc +109 -0
- data/lib/starter_web/pages/_test_pages/button-tester-1.adoc +127 -0
- data/lib/starter_web/pages/_test_pages/card-tester.adoc +128 -0
- data/lib/starter_web/pages/_test_pages/cookieConsent.adoc +96 -0
- data/lib/starter_web/pages/_test_pages/deepl.0.adoc +258 -0
- data/lib/starter_web/pages/_test_pages/deepl.adoc +204 -0
- data/lib/starter_web/pages/_test_pages/desandro-button.adoc +171 -0
- data/lib/starter_web/pages/_test_pages/desandro.adoc +147 -0
- data/lib/starter_web/pages/_test_pages/flipcard-1-tester.adoc +308 -0
- data/lib/starter_web/pages/_test_pages/formular-01-tester.adoc +167 -0
- data/lib/starter_web/pages/_test_pages/formular-02-tester.adoc +727 -0
- data/lib/starter_web/pages/_test_pages/google-translate-tester.0.adoc +113 -0
- data/lib/starter_web/pages/_test_pages/google-translate-tester.1.adoc +233 -0
- data/lib/starter_web/pages/_test_pages/google-translate-tester.3.adoc +149 -0
- data/lib/starter_web/pages/_test_pages/google-translate-tester.4.adoc +239 -0
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-2.adoc +183 -0
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-3.adoc +235 -0
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-4.adoc +222 -0
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester-5.adoc +119 -0
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester.1.adoc +236 -0
- data/lib/starter_web/pages/_test_pages/infinite-scroll-tester.adoc +225 -0
- data/lib/starter_web/pages/_test_pages/list-group-tester.adoc +265 -0
- data/lib/starter_web/pages/_test_pages/tictok.adoc +127 -0
- data/lib/starter_web/pages/public/about/about_site.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/000_intro.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/100_converter.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/200_themes.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.a2p +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 +26 -5
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +3 -3
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +3 -3
- data/lib/starter_web/pages/public/blog/navigator/archive.html +3 -3
- data/lib/starter_web/pages/public/blog/navigator/index.html +1 -1
- data/lib/starter_web/pages/public/learn/quickstart.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +6 -7
- data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +3 -3
- data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +2 -2
- data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +4 -4
- data/lib/starter_web/pages/public/learn/roundtrip/600_quicksearch.adoc +13 -11
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/attributes.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_bottom_info.asciidoc +3 -3
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_bottom_left_warning.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_bottom_right_danger.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_central_success.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_full_height_left_info.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_full_height_right_success.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_top_info.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_top_left_info.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/410_top_right_success.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/419_advanced_modals_demo.asciidoc +51 -51
- data/lib/starter_web/pages/public/learn/where_to_go.adoc +2 -2
- data/lib/starter_web/pages/public/legal/de/100_copyright.adoc +2 -2
- data/lib/starter_web/pages/public/legal/de/100_impress.adoc +2 -2
- data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +6 -6
- data/lib/starter_web/pages/public/legal/de/400_comment_policy.adoc +2 -2
- data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +2 -2
- data/lib/starter_web/pages/public/legal/en/200_impress.adoc +2 -2
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +5 -6
- data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +2 -2
- data/lib/starter_web/pages/public/manuals/dropdown-help.adoc +1 -1
- data/lib/starter_web/pages/public/panels/intro_panel/_includes/attributes.asciidoc +55 -0
- data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +53 -5
- data/lib/starter_web/pages/public/previewer/preview_bootstrap_theme.adoc +1688 -686
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +2 -1
- metadata +80 -29
- data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.min.css +0 -1
- data/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css +0 -1
- data/assets/themes/j1/modules/bmd/css/bootstrap-material-design.css +0 -12177
- data/assets/themes/j1/modules/bmd/css/bootstrap-material-design.min.css +0 -8
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.full.js +0 -6930
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js +0 -6936
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.js.map +0 -1
- data/assets/themes/j1/modules/bmd/js/bootstrap-material-design.min.js +0 -1
- data/assets/themes/j1/modules/popper/js/popper.js.map +0 -1
- data/assets/themes/j1/modules/util/js/domready.js +0 -146
- data/lib/starter_web/_data/_defaults/j1_config.1.yml +0 -478
- data/lib/starter_web/_data/_defaults/private.default.yml +0 -119
- data/lib/starter_web/_data/blocks/defaults/panel.1.yml +0 -256
- data/lib/starter_web/_data/blocks/defaults/panel.2.yml +0 -250
|
@@ -85,14 +85,14 @@
|
|
|
85
85
|
// initialize infinite scroll
|
|
86
86
|
if ( options.type === 'infiniteScroll') {
|
|
87
87
|
logger.info('\n' + 'processing mode: ' + options.type);
|
|
88
|
-
logger.info('\n' + 'loading items from path: ' + options.pagePath + "#
|
|
88
|
+
logger.info('\n' + 'loading items from path: ' + options.pagePath + "#");
|
|
89
89
|
logger.info('\n' + 'monitoring element set to: ' + this.scroller);
|
|
90
90
|
_this.registerScrollEvent(options);
|
|
91
91
|
}
|
|
92
92
|
// initialize show on scroll
|
|
93
93
|
if ( options.type === 'showOnScroll') {
|
|
94
94
|
logger.info('\n' + 'processing mode: ' + options.type);
|
|
95
|
-
logger.info('\n' + 'loading items from path: ' + options.pagePath + "#
|
|
95
|
+
logger.info('\n' + 'loading items from path: ' + options.pagePath + "#");
|
|
96
96
|
logger.info('\n' + 'monitoring element set to: ' + this.scroller);
|
|
97
97
|
_this.registerScrollEvent(options);
|
|
98
98
|
}
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
# For details, see https://jekyll.one
|
|
13
13
|
# -----------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
(function(e,c,a,g){var d="scroller",f={type:"infiniteScroll",scrollOffset:100,elementScroll:false,firstPage:2,lastPage:false,infoLastPage:false,loadStatus:false,onInit:function(){},onBeforeLoad:function(){},onAfterLoad:function(){}};function b(i,h){this.element=i;this.settings=e.extend({},f,h);this.settings.elementID="#"+this.element.id;this.init(this.settings)}e.extend(b.prototype,{init:function(i){var m=this;var h=log4javascript.getLogger("");h.info("\ninitializing plugin: started");h.info("\nstate: started");if(i.elementScroll){m.scroller=m.element}else{m.scroller=c}if(i.loadStatus){var l='<div class="loader-ellips" style="display: none"> <span class="loader-ellips__dot"></span> <span class="loader-ellips__dot"></span> <span class="loader-ellips__dot"></span> <span class="loader-ellips__dot"></span> </div>';e(l).insertAfter(i.elementID)}if(i.infoLastPage){var j=i.lastPageInfo;e(j).insertAfter(i.elementID)}var k=setInterval(function(){if(j1.getState()==="finished"){if(i.type==="infiniteScroll"){h.info("\nprocessing mode: "+i.type);h.info("\nloading items from path: "+i.pagePath+"#
|
|
15
|
+
(function(e,c,a,g){var d="scroller",f={type:"infiniteScroll",scrollOffset:100,elementScroll:false,firstPage:2,lastPage:false,infoLastPage:false,loadStatus:false,onInit:function(){},onBeforeLoad:function(){},onAfterLoad:function(){}};function b(i,h){this.element=i;this.settings=e.extend({},f,h);this.settings.elementID="#"+this.element.id;this.init(this.settings)}e.extend(b.prototype,{init:function(i){var m=this;var h=log4javascript.getLogger("");h.info("\ninitializing plugin: started");h.info("\nstate: started");if(i.elementScroll){m.scroller=m.element}else{m.scroller=c}if(i.loadStatus){var l='<div class="loader-ellips" style="display: none"> <span class="loader-ellips__dot"></span> <span class="loader-ellips__dot"></span> <span class="loader-ellips__dot"></span> <span class="loader-ellips__dot"></span> </div>';e(l).insertAfter(i.elementID)}if(i.infoLastPage){var j=i.lastPageInfo;e(j).insertAfter(i.elementID)}var k=setInterval(function(){if(j1.getState()==="finished"){if(i.type==="infiniteScroll"){h.info("\nprocessing mode: "+i.type);h.info("\nloading items from path: "+i.pagePath+"#");h.info("\nmonitoring element set to: "+this.scroller);m.registerScrollEvent(i)}if(i.type==="showOnScroll"){h.info("\nprocessing mode: "+i.type);h.info("\nloading items from path: "+i.pagePath+"#");h.info("\nmonitoring element set to: "+this.scroller);m.registerScrollEvent(i)}h.info("\ninitializing plugin: finished");h.info("\nstate: finished");clearInterval(k)}})},isInViewport:function(n,m){if(n.length==0){return}var j=jQuery(c);var q=j.scrollTop();var i=j.height();var k=q+i;var l=jQuery(n);var o=l.offset().top+m;var p=l.height();var h=o+p;return(o>=q&&o<k)||(h>q&&h<=k)||(p>i&&o<=q&&h>=k)},isBottomReached:function(s){var n=this;var h,p;var m=e(s.elementID).height();if(n.settings.elementScroll){var j=e(c);var r=j.scrollTop();var i=j.height();var l=r+i-s.scrollOffset;var k=e(s.elementID);var o=k.offset().top+m;var q=k.height();h=o+q;return(o>=r&&o<l)||(h>r&&h<=l)||(q>i&&o<=r&&h>=l)}else{return(c.innerHeight+c.pageYOffset+s.scrollOffset>=a.body.offsetHeight)}},registerScrollEvent:function(i){var j=this;var h=log4javascript.getLogger("");if(i.type==="infiniteScroll"){h.info("\nregister scroll event of type: "+i.type);j[i.id]=function(l){var k=j.settings;if(j.isBottomReached(k)){if(k.firstPage>k.lastPage){h.info("\nlast page detected on: "+k.lastPage);c.removeEventListener("scroll",j[k.id]);h.info("\nscroll event: removed");if(k.infoLastPage){j.infoLastPage(k)}return false}j.getNewPost(k)}};c.addEventListener("scroll",j[i.id]);h.info("\nscroll event: registered")}if(i.type==="showOnScroll"){h.info("\nregister scroll event of type: "+i.type);j[i.id]=function(k){if(j.isInViewport(e("#"+i.id),i.scrollOffset)){h.info("\nspecified container is in view: "+i.id);e("."+i.id).show(i.showDelay);h.info("\nremove eventHandler");c.removeEventListener("scroll",j[i.id])}};c.addEventListener("scroll",j[i.id])}},getNewPost:function(i){var k=this;var h=log4javascript.getLogger("");h.info("\ntrigger loading ");if(this.itemsLoaded===false){return false}this.itemsLoaded=false;if(i.loadStatus){h.info("\nshow: spinner");e(".loader-ellips").show()}var j=new XMLHttpRequest();j.onreadystatechange=function(){if(j.readyState==XMLHttpRequest.DONE){if(j.status==200){i.firstPage++;var l=k.getChildItemsByAjaxHTML(i,j.responseText);k.appendNewItems(l);h.info("\nloading new items: successful");if(i.loadStatus){h.info("\nhide: spinner");e(".loader-ellips").hide()}k.itemsLoaded=true}else{if(i.loadStatus){h.info("\nhide: spinner");e(".loader-ellips").hide()}h.error("\nloading new items failed, HTTP response: "+j.status);k.itemsLoaded=false}}};h.info("\nloading new items from path: "+i.pagePath+i.firstPage);j.open("GET",location.origin+i.pagePath+i.firstPage+"/index.html",true);j.send()},getChildItemsByAjaxHTML:function(j,i){var l=a.createElement("html");var h=log4javascript.getLogger("");h.info("\nload new items");l.innerHTML=i;var k=l.querySelectorAll(j.elementID+" > *");return k},appendNewItems:function(h){var l=this;var i=log4javascript.getLogger("");var k=j1.getCookieNames();var j=j1.readCookie(k.user_translate);i.info("\nappend new items");h.forEach(function(m){l.element.appendChild(m)});if(j.translationEnabled){i.info("\ntranslation enabled: "+j.translationEnabled);i.warn("\nskipped processing of dropcaps")}else{i.info("\npost processing: createDropCap");j1.core.createDropCap()}},infoLastPage:function(i){var j=this;var h=log4javascript.getLogger("");h.info("\nshow: infoLastPage");e(".page-scroll-last").show()}});e.fn[d]=function(h){return this.each(function(){if(!e.data(this,"plugin_"+d)){e.data(this,"plugin_"+d,new b(this,h))}})}})(jQuery,window,document);
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
|
-
(function ($, window, document, undefined) {
|
|
46
|
+
;(function ($, window, document, undefined) {
|
|
47
47
|
|
|
48
48
|
var old = $.fn.bootstrapThemeSwitcher;
|
|
49
49
|
|
|
@@ -133,9 +133,9 @@
|
|
|
133
133
|
} else {
|
|
134
134
|
logger.error('\n' + 'cookie not found: ' + cookie_names.user_state);
|
|
135
135
|
logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
|
136
|
-
j1Cookies.forEach(item
|
|
136
|
+
j1Cookies.forEach(function (item) {console.log('j1.core.switcher: ' + item);});
|
|
137
137
|
logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
|
138
|
-
gaCookies.forEach(item
|
|
138
|
+
gaCookies.forEach(function (item) {console.log('j1.core.switcher: ' + item);});
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
themeName = user_state.theme_name;
|
|
@@ -203,9 +203,9 @@
|
|
|
203
203
|
} else {
|
|
204
204
|
logger.error('\n' + 'cookie not found: ' + cookie_names.user_state);
|
|
205
205
|
logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
|
206
|
-
j1Cookies.forEach(item
|
|
206
|
+
j1Cookies.forEach(function (item) {console.log('j1.core.switcher: ' + item);});
|
|
207
207
|
logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
|
208
|
-
gaCookies.forEach(item
|
|
208
|
+
gaCookies.forEach(function (item) {console.log('j1.core.switcher: ' + item);});
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
var themeName = user_state.theme_name;
|
|
@@ -276,9 +276,9 @@
|
|
|
276
276
|
} else {
|
|
277
277
|
logger.error('\n' + 'user state NOT cookie found');
|
|
278
278
|
logger.debug('\n' + 'j1 cookies found:' + j1Cookies.length);
|
|
279
|
-
j1Cookies.forEach(item
|
|
279
|
+
j1Cookies.forEach(function (item) {console.log('j1.core.switcher: ' + item);});
|
|
280
280
|
logger.debug('\n' + 'ga cookies found:' + gaCookies.length);
|
|
281
|
-
gaCookies.forEach(item
|
|
281
|
+
gaCookies.forEach(function (item) {console.log('j1.core.switcher: ' + item);});
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
themeName = user_state.theme_name;
|
|
@@ -309,7 +309,7 @@
|
|
|
309
309
|
}
|
|
310
310
|
var li = $('<li />')
|
|
311
311
|
.attr('class',cssClass)
|
|
312
|
-
.append('<a href="#
|
|
312
|
+
.append('<a href="#"><i class="mdi mdi-view-quilt mdi-18px mr-2" style="color: ' +iconColor+ '"></i>' +value.name+ '</a>')
|
|
313
313
|
.on('click', function () {
|
|
314
314
|
if (settings.loadFromBootswatch) {
|
|
315
315
|
base.switchTheme(value.name, value.css);
|
|
@@ -19,434 +19,4 @@
|
|
|
19
19
|
# The original version cannot be used with J1 for theme menu creation!
|
|
20
20
|
# -----------------------------------------------------------------------------
|
|
21
21
|
*/
|
|
22
|
-
'
|
|
23
|
-
|
|
24
|
-
// -----------------------------------------------------------------------------
|
|
25
|
-
// ESLint shimming
|
|
26
|
-
// -----------------------------------------------------------------------------
|
|
27
|
-
/* eslint indent: "off" */
|
|
28
|
-
/* eslint no-console: ["error", { allow: ["log", "warn", "error"] }] */
|
|
29
|
-
/* eslint no-unused-vars: "off" */
|
|
30
|
-
/* eslint no-undef: "off" */
|
|
31
|
-
/* eslint no-useless-escape: "off" */
|
|
32
|
-
/* eslint no-prototype-builtins: "off" */
|
|
33
|
-
/* eslint no-shadow-restricted-names: "off" */
|
|
34
|
-
/* global jQuery */
|
|
35
|
-
/* global Cookies */
|
|
36
|
-
// -----------------------------------------------------------------------------
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* jQuery Twitter Bootstrap Theme Switcher v1.1.5
|
|
40
|
-
* https://github.com/jguadagno/bootstrapThemeSwitcher
|
|
41
|
-
*
|
|
42
|
-
* Copyright 2014, Joseph Guadagno
|
|
43
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
(function ($, window, document, undefined) {
|
|
47
|
-
|
|
48
|
-
var old = $.fn.bootstrapThemeSwitcher;
|
|
49
|
-
|
|
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;
|
|
57
|
-
|
|
58
|
-
var logger = log4javascript.getLogger('j1.core.switcher');
|
|
59
|
-
var logText;
|
|
60
|
-
|
|
61
|
-
var user_state_detected;
|
|
62
|
-
var user_state = {};
|
|
63
|
-
var user_state_json;
|
|
64
|
-
var user_state_cookie;
|
|
65
|
-
|
|
66
|
-
// Constructor
|
|
67
|
-
// ---------------------------------------------------------------------------
|
|
68
|
-
var BootstrapThemeSwitcher = function (element, options) {
|
|
69
|
-
|
|
70
|
-
this.$element = $(element);
|
|
71
|
-
this.settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, options);
|
|
72
|
-
this.themesList = [];
|
|
73
|
-
|
|
74
|
-
// loading local themes
|
|
75
|
-
this.getThemes();
|
|
76
|
-
return this;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// Prototype
|
|
80
|
-
// ---------------------------------------------------------------------------
|
|
81
|
-
BootstrapThemeSwitcher.prototype = {
|
|
82
|
-
clear: function () {
|
|
83
|
-
logger.debug('\n' + 'bootstrapThemeSwitcher.clear');
|
|
84
|
-
return this.$element.each(function () {
|
|
85
|
-
this.$element.empty();
|
|
86
|
-
});
|
|
87
|
-
},
|
|
88
|
-
update: function () {
|
|
89
|
-
logger.debug('\n' + 'bootstrapThemeSwitcher.update');
|
|
90
|
-
this.getThemes();
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
// -------------------------------------------------------------------------
|
|
94
|
-
// checkStyleSheetByName
|
|
95
|
-
// -------------------------------------------------------------------------
|
|
96
|
-
checkStyleSheetByName: function (name) {
|
|
97
|
-
var found = false;
|
|
98
|
-
var test = '\/' + name + '\/';
|
|
99
|
-
var re = new RegExp(test, 'i');
|
|
100
|
-
|
|
101
|
-
for(var i = 0; i < document.styleSheets.length; i++){
|
|
102
|
-
if(re.test(document.styleSheets[i].href)){
|
|
103
|
-
found=true;
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return found;
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
// -------------------------------------------------------------------------
|
|
111
|
-
// switchTheme
|
|
112
|
-
// -------------------------------------------------------------------------
|
|
113
|
-
// NOTE:
|
|
114
|
-
// For J1 template, switchTheme set only the cookies contents. The theme
|
|
115
|
-
// switch is done by a page reload. The reload triggers the theme_generator
|
|
116
|
-
// to load theme CSS from cookies, finally.
|
|
117
|
-
// -------------------------------------------------------------------------
|
|
118
|
-
switchTheme: function (name, cssFile) {
|
|
119
|
-
|
|
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;
|
|
125
|
-
var themeName;
|
|
126
|
-
var theme_css;
|
|
127
|
-
|
|
128
|
-
// detect|set user state cookie
|
|
129
|
-
user_state_detected = j1.existsCookie (cookie_names.user_state);
|
|
130
|
-
if ( user_state_detected ) {
|
|
131
|
-
logger.debug('\n' + 'cookie found: ' + cookie_names.user_state);
|
|
132
|
-
user_state = j1.readCookie(cookie_names.user_state);
|
|
133
|
-
} else {
|
|
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));
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
themeName = user_state.theme_name;
|
|
142
|
-
theme_css = user_state.theme_css;
|
|
143
|
-
|
|
144
|
-
if (typeof cssFile === 'undefined') { cssFile = this.settings.defaultCssFile; }
|
|
145
|
-
if (typeof name === 'undefined') { name = cssFile; }
|
|
146
|
-
|
|
147
|
-
// check if theme is to be saved to cookie
|
|
148
|
-
if (settings.saveToCookie) {
|
|
149
|
-
if ( typeof Cookies === 'undefined' ) {
|
|
150
|
-
if ( debug === 'true' ) {
|
|
151
|
-
logger.error('\n' + 'cookies library not present');
|
|
152
|
-
}
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
user_state.theme_name = name;
|
|
157
|
-
user_state.theme_css = cssFile;
|
|
158
|
-
|
|
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/';
|
|
162
|
-
} else {
|
|
163
|
-
user_state.theme_author = 'J1 Team';
|
|
164
|
-
user_state.theme_author_url = 'https://jekyll.one/';
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
logger.debug('\n' + 'write to cookie : ' + cookie_names.user_state);
|
|
168
|
-
j1.writeCookie({
|
|
169
|
-
name: cookie_names.user_state,
|
|
170
|
-
data: user_state,
|
|
171
|
-
samesite: 'Strict',
|
|
172
|
-
secure: secure,
|
|
173
|
-
expires: 365
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
// reload current page (skip cache)
|
|
177
|
-
location.reload(true);
|
|
178
|
-
} else {
|
|
179
|
-
logger.debug('\n' + 'write to cookie : disabled');
|
|
180
|
-
logger.warn('\n' + 'selected theme not activated: ' + name);
|
|
181
|
-
} // END if saveToCookie
|
|
182
|
-
|
|
183
|
-
}, // END switchTheme
|
|
184
|
-
|
|
185
|
-
// -------------------------------------------------------------------------
|
|
186
|
-
// loadThemeFromCookie
|
|
187
|
-
// -------------------------------------------------------------------------
|
|
188
|
-
loadThemeFromCookie: function (options) {
|
|
189
|
-
|
|
190
|
-
if ( typeof Cookies === 'undefined' ) {
|
|
191
|
-
logger.error('\n' + 'cookies library not present');
|
|
192
|
-
return false;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
var settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, options);
|
|
196
|
-
|
|
197
|
-
// detect|set user state cookie
|
|
198
|
-
user_state_detected = j1.existsCookie (cookie_names.user_state);
|
|
199
|
-
|
|
200
|
-
if ( user_state_detected ) {
|
|
201
|
-
logger.info('\n' + 'cookie found: ' + cookie_names.user_state);
|
|
202
|
-
user_state = j1.readCookie(cookie_names.user_state);
|
|
203
|
-
} else {
|
|
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));
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
var themeName = user_state.theme_name;
|
|
212
|
-
var themeCss = user_state.theme_css;
|
|
213
|
-
this.switchTheme(themeName, themeCss);
|
|
214
|
-
|
|
215
|
-
}, // END loadThemeFromCookie
|
|
216
|
-
|
|
217
|
-
// -------------------------------------------------------------------------
|
|
218
|
-
// addTheme
|
|
219
|
-
// -------------------------------------------------------------------------
|
|
220
|
-
addTheme: function(name, cssFile, start, deleteCount) {
|
|
221
|
-
if (typeof start === 'undefined') { start = 0; }
|
|
222
|
-
if (typeof deleteCount === 'undefined') { deleteCount = 0; }
|
|
223
|
-
this.themesList.splice(start, deleteCount, {name: name, css: cssFile});
|
|
224
|
-
this.addThemesToControl();
|
|
225
|
-
}, // END addTheme
|
|
226
|
-
|
|
227
|
-
// -------------------------------------------------------------------------
|
|
228
|
-
// addThemesToControl
|
|
229
|
-
// -------------------------------------------------------------------------
|
|
230
|
-
addThemesToControl: function() {
|
|
231
|
-
if (typeof this.$element === 'undefined') {
|
|
232
|
-
logger.error('\n' + 'bootstrapThemeSelector|addThemesToControl: Element is undefined');
|
|
233
|
-
return false;
|
|
234
|
-
}
|
|
235
|
-
if (typeof this.themesList === 'undefined') {
|
|
236
|
-
logger.error('\n' + 'bootstrapThemeSelector|addThemesToControl: Themes is undefined');
|
|
237
|
-
return false;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// if BootSwatch excludes are set
|
|
241
|
-
if(this.settings.excludeBootswatch){
|
|
242
|
-
var excludeBootswatchs;
|
|
243
|
-
// split the string on ,
|
|
244
|
-
if(this.settings.excludeBootswatch.indexOf(',') !== -1){
|
|
245
|
-
excludeBootswatchs = this.settings.excludeBootswatch.replace(/ /g, '').split(',');
|
|
246
|
-
} else {
|
|
247
|
-
excludeBootswatchs = [];
|
|
248
|
-
excludeBootswatchs.push(this.settings.excludeBootswatch);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
var tempThemeList = this.themesList;
|
|
252
|
-
$.each(tempThemeList, function (i, value) {
|
|
253
|
-
if(value && value.name){
|
|
254
|
-
if( $.inArray( value.name, excludeBootswatchs ) !== -1 ){
|
|
255
|
-
tempThemeList.splice(i,1);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
this.themesList = tempThemeList;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
var base = this;
|
|
263
|
-
|
|
264
|
-
if (this.$element.is('ul')) {
|
|
265
|
-
var $this = $(this);
|
|
266
|
-
var settings = $.extend({}, $.fn.bootstrapThemeSwitcher.defaults, $this.data('bootstrapThemeSwitcher'));
|
|
267
|
-
var id = settings.cssThemeLink;
|
|
268
|
-
var debug = settings.debug;
|
|
269
|
-
var themeName;
|
|
270
|
-
|
|
271
|
-
// detect|set user state cookie
|
|
272
|
-
user_state_detected = j1.existsCookie (cookie_names.user_state);
|
|
273
|
-
if ( user_state_detected ) {
|
|
274
|
-
logger.debug('\n' + 'user state cookie found');
|
|
275
|
-
user_state = j1.readCookie(cookie_names.user_state);
|
|
276
|
-
} else {
|
|
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));
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
themeName = user_state.theme_name;
|
|
285
|
-
|
|
286
|
-
if ( debug === 'true' ) {
|
|
287
|
-
logger.debug('\n' + 'bootstrapThemeSelector: UL element selected');
|
|
288
|
-
}
|
|
289
|
-
this.$element.empty();
|
|
290
|
-
|
|
291
|
-
var cssClass;
|
|
292
|
-
var iconColor = '#9E9E9E';
|
|
293
|
-
$.each(this.themesList, function (i, value) {
|
|
294
|
-
// Use DIFFERENT class for MobileMenu
|
|
295
|
-
//if (base.$element[0].id.includes('MMenu')) {
|
|
296
|
-
if (base.$element[0].id.includes('mmenu')) {
|
|
297
|
-
cssClass = 'mmenu-item';
|
|
298
|
-
} else {
|
|
299
|
-
cssClass = 'dropdown-item';
|
|
300
|
-
}
|
|
301
|
-
// Add class "active" to the current theme selected
|
|
302
|
-
if ( value.name === themeName ) {
|
|
303
|
-
// if (base.$element[0].id.includes('MMenu')) {
|
|
304
|
-
if (base.$element[0].id.includes('mmenu')) {
|
|
305
|
-
cssClass = 'mmenu-item active';
|
|
306
|
-
} else {
|
|
307
|
-
cssClass = 'dropdown-item active';
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
var li = $('<li />')
|
|
311
|
-
.attr('class',cssClass)
|
|
312
|
-
.append('<a href="#void"><i class="mdi mdi-view-quilt mdi-18px mr-2" style="color: ' +iconColor+ '"></i>' +value.name+ '</a>')
|
|
313
|
-
.on('click', function () {
|
|
314
|
-
if (settings.loadFromBootswatch) {
|
|
315
|
-
base.switchTheme(value.name, value.css);
|
|
316
|
-
} else {
|
|
317
|
-
base.switchTheme(value.name, value.cssCdn);
|
|
318
|
-
}
|
|
319
|
-
// remove previous "active" class and apply to latest clicked element
|
|
320
|
-
$(this).parent().find('li').removeClass('active');
|
|
321
|
-
$(this).addClass('active');
|
|
322
|
-
});
|
|
323
|
-
base.$element.append(li);
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
} else if (this.$element.is('select')) {
|
|
327
|
-
logger.debug('\n' + 'bootstrapThemeSelector: SELECT element selected');
|
|
328
|
-
this.$element.empty();
|
|
329
|
-
|
|
330
|
-
var optionSelectedMarker;
|
|
331
|
-
$.each(this.themesList, function (i, value) {
|
|
332
|
-
optionSelectedMarker = null;
|
|
333
|
-
if ( value.name === themeName ) {
|
|
334
|
-
optionSelectedMarker = 'selected';
|
|
335
|
-
}
|
|
336
|
-
if (settings.loadFromBootswatch) {
|
|
337
|
-
base.$element.append('<option ' + optionSelectedMarker + ' value=\'' + value.css + '\'>' + value.name + '</option>');
|
|
338
|
-
} else {
|
|
339
|
-
base.$element.append('<option ' + optionSelectedMarker + ' value=\'' + value.cssCdn + '\'>' + value.name + '</option>');
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
|
-
this.$element.on('change', function () {
|
|
343
|
-
var optionSelected = $('option:selected', this);
|
|
344
|
-
base.switchTheme(optionSelected.text(), optionSelected.val());
|
|
345
|
-
});
|
|
346
|
-
|
|
347
|
-
} else {
|
|
348
|
-
// no container found to add Theme list
|
|
349
|
-
logger.info('\n' + 'bootstrapThemeSelector: no UL or SELECT element found');
|
|
350
|
-
logger.error('\n' + 'bootstrapThemeSelector: failed');
|
|
351
|
-
// console.warn('bootstrapThemeSelector only works with ul or select elements');
|
|
352
|
-
}
|
|
353
|
-
}, // END addThemesToControl
|
|
354
|
-
|
|
355
|
-
// -------------------------------------------------------------------------
|
|
356
|
-
// getThemes
|
|
357
|
-
// -------------------------------------------------------------------------
|
|
358
|
-
getThemes: function() {
|
|
359
|
-
var base = this;
|
|
360
|
-
|
|
361
|
-
if (this.settings.localFeed !== null && this.settings.localFeed !== '') {
|
|
362
|
-
// Deferred loading themes from local themes (json file)
|
|
363
|
-
$.ajax({
|
|
364
|
-
url: this.settings.localFeed,
|
|
365
|
-
// jadams 2016-10-10: removed the setting for sychronous XMLHttpRequest
|
|
366
|
-
// async: false,
|
|
367
|
-
dataType: 'json',
|
|
368
|
-
success: function (data) {
|
|
369
|
-
base.themesList = data.themes;
|
|
370
|
-
base.addThemesToControl();
|
|
371
|
-
},
|
|
372
|
-
error: function (jqXHR, textStatus, errorThrown) {
|
|
373
|
-
logger.error('\n' + 'failed to retrieve the local feed from: \'' + base.settings.localFeed + '\'');
|
|
374
|
-
}
|
|
375
|
-
});
|
|
376
|
-
} else {
|
|
377
|
-
// Deferred loading remote themes from Bootswatch API
|
|
378
|
-
// -----------------------------------------------------------------------
|
|
379
|
-
$.ajax({
|
|
380
|
-
url: this.settings.bootswatchApiUrl + '/' + this.settings.bootswatchApiVersion + '.json',
|
|
381
|
-
// jadams 2016-10-10: removed the setting for sychronous XMLHttpRequest
|
|
382
|
-
// async: false,
|
|
383
|
-
dataType: 'json',
|
|
384
|
-
success: function (data) {
|
|
385
|
-
if (typeof data.themes === 'undefined') {
|
|
386
|
-
return null;
|
|
387
|
-
}
|
|
388
|
-
base.themesList = data.themes;
|
|
389
|
-
base.themesList.splice(0,0, {name: 'default', css: base.settings.defaultCssFile});
|
|
390
|
-
base.addThemesToControl();
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
}, // END getThemes
|
|
395
|
-
|
|
396
|
-
// -------------------------------------------------------------------------
|
|
397
|
-
// themes
|
|
398
|
-
// -------------------------------------------------------------------------
|
|
399
|
-
themes : function (newThemeList) {
|
|
400
|
-
if (typeof newThemeList === 'undefined') {
|
|
401
|
-
return this.themesList;
|
|
402
|
-
}
|
|
403
|
-
else {
|
|
404
|
-
// TODO: Set the associated control.
|
|
405
|
-
this.themesList = newThemeList;
|
|
406
|
-
}
|
|
407
|
-
} // END themes
|
|
408
|
-
|
|
409
|
-
}; // END prototype
|
|
410
|
-
|
|
411
|
-
// Plugin definition
|
|
412
|
-
// ---------------------------------------------------------------------------
|
|
413
|
-
$.fn.bootstrapThemeSwitcher = function (option) {
|
|
414
|
-
var methodReturn;
|
|
415
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
416
|
-
var $this = $(this);
|
|
417
|
-
var data = $this.data('bootstrapThemeSwitcher');
|
|
418
|
-
var options = typeof option === 'object' && option;
|
|
419
|
-
|
|
420
|
-
if (!data) {
|
|
421
|
-
$this.data('bootstrapThemeSwitcher', (data = new BootstrapThemeSwitcher(this, options) ));
|
|
422
|
-
}
|
|
423
|
-
if (typeof option === 'string') {
|
|
424
|
-
methodReturn = data[ option ].apply(data, args);
|
|
425
|
-
}
|
|
426
|
-
return ( typeof methodReturn === 'undefined' ) ? $this : methodReturn;
|
|
427
|
-
};
|
|
428
|
-
|
|
429
|
-
$.fn.bootstrapThemeSwitcher.defaults = {
|
|
430
|
-
debug: false,
|
|
431
|
-
saveToCookie: true,
|
|
432
|
-
cssThemeLink: 'bootstrapTheme',
|
|
433
|
-
cookieThemeName: 'bootstrapTheme.name',
|
|
434
|
-
cookieThemeCss: 'boostrapTheme.css',
|
|
435
|
-
cookieExpiration: 365,
|
|
436
|
-
cookiePath: '/',
|
|
437
|
-
defaultCssFile: 'https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css',
|
|
438
|
-
bootswatchApiUrl: 'https://bootswatch.com/api/',
|
|
439
|
-
bootswatchApiVersion: '4',
|
|
440
|
-
loadFromBootswatch: true,
|
|
441
|
-
localFeed: '',
|
|
442
|
-
excludeBootswatch: ''
|
|
443
|
-
};
|
|
444
|
-
|
|
445
|
-
$.fn.bootstrapThemeSwitcher.Constructor = BootstrapThemeSwitcher;
|
|
446
|
-
|
|
447
|
-
$.fn.bootstrapThemeSwitcher.noConflict = function () {
|
|
448
|
-
$.fn.BootstrapThemeSwitcher = old;
|
|
449
|
-
return this;
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
})(jQuery, window, document);
|
|
22
|
+
;(function(d,h,o,g){var b=d.fn.bootstrapThemeSwitcher;var e=j1.getCookieNames();var p=j1.findCookie("_ga");var q=j1.findCookie("j1");var f=new liteURL(h.location.href);var j=f.hostname;var s=j.substring(j.lastIndexOf(".",j.lastIndexOf(".")-1)+1);var l=(f.protocol.includes("https"))?true:false;var r=log4javascript.getLogger("j1.core.switcher");var i;var c;var m={};var k;var a;var n=function(u,t){this.$element=d(u);this.settings=d.extend({},d.fn.bootstrapThemeSwitcher.defaults,t);this.themesList=[];this.getThemes();return this};n.prototype={clear:function(){r.debug("\nbootstrapThemeSwitcher.clear");return this.$element.each(function(){this.$element.empty()})},update:function(){r.debug("\nbootstrapThemeSwitcher.update");this.getThemes()},checkStyleSheetByName:function(t){var w=false;var x="/"+t+"/";var v=new RegExp(x,"i");for(var u=0;u<o.styleSheets.length;u++){if(v.test(o.styleSheets[u].href)){w=true;break}}return w},switchTheme:function(t,z){var A=d(this);var w=d.extend({},d.fn.bootstrapThemeSwitcher.defaults,A.data("bootstrapThemeSwitcher"));var v=w.cssThemeLink;var u=w.debug;var y=this.settings.includeBootswatch;var x;var B;c=j1.existsCookie(e.user_state);if(c){r.debug("\ncookie found: "+e.user_state);m=j1.readCookie(e.user_state)}else{r.error("\ncookie not found: "+e.user_state);r.debug("\nj1 cookies found:"+q.length);q.forEach(function(C){console.log("j1.core.switcher: "+C)});r.debug("\nga cookies found:"+p.length);p.forEach(function(C){console.log("j1.core.switcher: "+C)})}x=m.theme_name;B=m.theme_css;if(typeof z==="undefined"){z=this.settings.defaultCssFile}if(typeof t==="undefined"){t=z}if(w.saveToCookie){if(typeof Cookies==="undefined"){if(u==="true"){r.error("\ncookies library not present")}return false}m.theme_name=t;m.theme_css=z;if(!(m.theme_name.includes("Uno")||m.theme_name=="Bootstrap")){m.theme_author="Bootswatch";m.theme_author_url="https://bootswatch.com/"}else{m.theme_author="J1 Team";m.theme_author_url="https://jekyll.one/"}r.debug("\nwrite to cookie : "+e.user_state);j1.writeCookie({name:e.user_state,data:m,samesite:"Strict",secure:l,expires:365});location.reload(true)}else{r.debug("\nwrite to cookie : disabled");r.warn("\nselected theme not activated: "+t)}},loadThemeFromCookie:function(t){if(typeof Cookies==="undefined"){r.error("\ncookies library not present");return false}var u=d.extend({},d.fn.bootstrapThemeSwitcher.defaults,t);c=j1.existsCookie(e.user_state);if(c){r.info("\ncookie found: "+e.user_state);m=j1.readCookie(e.user_state)}else{r.error("\ncookie not found: "+e.user_state);r.debug("\nj1 cookies found:"+q.length);q.forEach(function(x){console.log("j1.core.switcher: "+x)});r.debug("\nga cookies found:"+p.length);p.forEach(function(x){console.log("j1.core.switcher: "+x)})}var w=m.theme_name;var v=m.theme_css;this.switchTheme(w,v)},addTheme:function(u,t,w,v){if(typeof w==="undefined"){w=0}if(typeof v==="undefined"){v=0}this.themesList.splice(w,v,{name:u,css:t});this.addThemesToControl()},addThemesToControl:function(){if(typeof this.$element==="undefined"){r.error("\nbootstrapThemeSelector|addThemesToControl: Element is undefined");return false}if(typeof this.themesList==="undefined"){r.error("\nbootstrapThemeSelector|addThemesToControl: Themes is undefined");return false}if(this.settings.excludeBootswatch){var A;if(this.settings.excludeBootswatch.indexOf(",")!==-1){A=this.settings.excludeBootswatch.replace(/ /g,"").split(",")}else{A=[];A.push(this.settings.excludeBootswatch)}var w=this.themesList;d.each(w,function(E,F){if(F&&F.name){if(d.inArray(F.name,A)!==-1){w.splice(E,1)}}});this.themesList=w}var v=this;if(this.$element.is("ul")){var B=d(this);var x=d.extend({},d.fn.bootstrapThemeSwitcher.defaults,B.data("bootstrapThemeSwitcher"));var u=x.cssThemeLink;var t=x.debug;var y;c=j1.existsCookie(e.user_state);if(c){r.debug("\nuser state cookie found");m=j1.readCookie(e.user_state)}else{r.error("\nuser state NOT cookie found");r.debug("\nj1 cookies found:"+q.length);q.forEach(function(E){console.log("j1.core.switcher: "+E)});r.debug("\nga cookies found:"+p.length);p.forEach(function(E){console.log("j1.core.switcher: "+E)})}y=m.theme_name;if(t==="true"){r.debug("\nbootstrapThemeSelector: UL element selected")}this.$element.empty();var D;var C="#9E9E9E";d.each(this.themesList,function(F,G){if(v.$element[0].id.includes("mmenu")){D="mmenu-item"}else{D="dropdown-item"}if(G.name===y){if(v.$element[0].id.includes("mmenu")){D="mmenu-item active"}else{D="dropdown-item active"}}var E=d("<li />").attr("class",D).append('<a href="#"><i class="mdi mdi-view-quilt mdi-18px mr-2" style="color: '+C+'"></i>'+G.name+"</a>").on("click",function(){if(x.loadFromBootswatch){v.switchTheme(G.name,G.css)}else{v.switchTheme(G.name,G.cssCdn)}d(this).parent().find("li").removeClass("active");d(this).addClass("active")});v.$element.append(E)})}else{if(this.$element.is("select")){r.debug("\nbootstrapThemeSelector: SELECT element selected");this.$element.empty();var z;d.each(this.themesList,function(E,F){z=null;if(F.name===y){z="selected"}if(x.loadFromBootswatch){v.$element.append("<option "+z+" value='"+F.css+"'>"+F.name+"</option>")}else{v.$element.append("<option "+z+" value='"+F.cssCdn+"'>"+F.name+"</option>")}});this.$element.on("change",function(){var E=d("option:selected",this);v.switchTheme(E.text(),E.val())})}else{r.info("\nbootstrapThemeSelector: no UL or SELECT element found");r.error("\nbootstrapThemeSelector: failed")}}},getThemes:function(){var t=this;if(this.settings.localFeed!==null&&this.settings.localFeed!==""){d.ajax({url:this.settings.localFeed,dataType:"json",success:function(u){t.themesList=u.themes;t.addThemesToControl()},error:function(u,w,v){r.error("\nfailed to retrieve the local feed from: '"+t.settings.localFeed+"'")}})}else{d.ajax({url:this.settings.bootswatchApiUrl+"/"+this.settings.bootswatchApiVersion+".json",dataType:"json",success:function(u){if(typeof u.themes==="undefined"){return null}t.themesList=u.themes;t.themesList.splice(0,0,{name:"default",css:t.settings.defaultCssFile});t.addThemesToControl()}})}},themes:function(t){if(typeof t==="undefined"){return this.themesList}else{this.themesList=t}}};d.fn.bootstrapThemeSwitcher=function(v){var x;var u=Array.prototype.slice.call(arguments,1);var y=d(this);var w=y.data("bootstrapThemeSwitcher");var t=typeof v==="object"&&v;if(!w){y.data("bootstrapThemeSwitcher",(w=new n(this,t)))}if(typeof v==="string"){x=w[v].apply(w,u)}return(typeof x==="undefined")?y:x};d.fn.bootstrapThemeSwitcher.defaults={debug:false,saveToCookie:true,cssThemeLink:"bootstrapTheme",cookieThemeName:"bootstrapTheme.name",cookieThemeCss:"boostrapTheme.css",cookieExpiration:365,cookiePath:"/",defaultCssFile:"https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css",bootswatchApiUrl:"https://bootswatch.com/api/",bootswatchApiVersion:"4",loadFromBootswatch:true,localFeed:"",excludeBootswatch:""};d.fn.bootstrapThemeSwitcher.Constructor=n;d.fn.bootstrapThemeSwitcher.noConflict=function(){d.fn.BootstrapThemeSwitcher=b;return this}})(jQuery,window,document);
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
# See: https://github.com/jekyll-one/J1 Template/blob/master/LICENSE
|
|
13
13
|
# -----------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
'use strict';
|
|
16
15
|
|
|
17
16
|
// -----------------------------------------------------------------------------
|
|
18
17
|
// ESLint shimming
|
|
@@ -25,8 +24,8 @@
|
|
|
25
24
|
/* eslint JSUnfilteredForInLoop: "off" */
|
|
26
25
|
// -----------------------------------------------------------------------------
|
|
27
26
|
|
|
27
|
+
'use strict';
|
|
28
28
|
function Translator(props) {
|
|
29
|
-
|
|
30
29
|
// ---------------------------------------------------------------------------
|
|
31
30
|
// global vars
|
|
32
31
|
// ---------------------------------------------------------------------------
|
|
@@ -267,8 +266,11 @@ function Translator(props) {
|
|
|
267
266
|
self.modal = document.getElementById(self.props.dialogContainerID);
|
|
268
267
|
if (!self.modal) {
|
|
269
268
|
logger.info('\n' + 'load consent modal');
|
|
269
|
+
|
|
270
270
|
self.modal = document.createElement('div');
|
|
271
271
|
self.modal.id = self.props.dialogContainerID;
|
|
272
|
+
self.modal.style.display = 'none';
|
|
273
|
+
|
|
272
274
|
self.modal.setAttribute('class', 'modal fade');
|
|
273
275
|
self.modal.setAttribute('tabindex', '-1');
|
|
274
276
|
self.modal.setAttribute('role', 'dialog');
|
|
@@ -368,6 +370,7 @@ function Translator(props) {
|
|
|
368
370
|
logger.info('\n' + 'loading consent modal: successfully');
|
|
369
371
|
self.modal.innerHTML = data;
|
|
370
372
|
self.modal.innerHTML = $('#' + self.props.xhrDataElement).eq(0).html();
|
|
373
|
+
self.modal.style.display = 'block';
|
|
371
374
|
|
|
372
375
|
$(self.modal).modal({
|
|
373
376
|
backdrop: 'static',
|
|
@@ -411,6 +414,7 @@ function Translator(props) {
|
|
|
411
414
|
$('#google-options').collapse('hide');
|
|
412
415
|
agreeAll();
|
|
413
416
|
});
|
|
417
|
+
self.$modal.modal('show');
|
|
414
418
|
})
|
|
415
419
|
.fail(function () {
|
|
416
420
|
logger.error('\n' + 'loading translator dialog (modal): failed');
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
# See: https://github.com/jekyll-one/J1 Template/blob/master/LICENSE
|
|
13
13
|
# -----------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
function Translator(d){var p=this;var u=log4javascript.getLogger("j1.core.translator");var l=new liteURL(window.location.href);var c=(l.protocol.includes("https"))?true:false;var q=false;var g;var s;this.props={contentURL:"/assets/data/translator",cookieName:"j1.user.state",cookieConsentName:"j1.user.consent",cookieStorageDays:365,cookieSameSite:"Strict",cookieSecure:c,translationEnabled:false,disableLanguageSelector:false,translatorName:"google",translationLanguages:"all",translationLanguage:"auto",translateAllPages:true,hideSuggestionBox:true,hidePoweredBy:true,hideTopFrame:true,dialogLanguage:"content",dialogLanguages:["en","de"],dialogContainerID:"translator-modal",xhrDataElement:"",postSelectionCallback:"",};for(var e in d){this.props[e]=d[e]}if(this.props.dialogLanguage.indexOf("-")!==-1){this.props.dialogLanguage=this.props.dialogLanguage.split("-")[0]}if(!this.props.dialogLanguages.includes(this.props.dialogLanguage)){this.props.dialogLanguage=this.props.dialogLanguages[0]}this.props.xhrDataElement=this.props.xhrDataElement+"-"+this.props.dialogLanguage;u.info("\ninitializing core module: started");u.info("\nstate: started");var f={set:function(x,z,C,y,A){var B=window.btoa(z);var v="";if(C){var w=new Date();w.setTime(w.getTime()+(C*24*60*60*1000));v="; expires="+w.toUTCString()}if(A){document.cookie=x+"="+(B||"")+v+"; Path=/; SameSite="+y+"; secure="+A+";"}else{document.cookie=x+"="+(B||"")+v+"; Path=/; SameSite="+y+";"}},get:function(w){var z=w+"=";var v=document.cookie.split(";");for(var x=0;x<v.length;x++){var B=v[x];while(B.charAt(0)===" "){B=B.substring(1,B.length)}if(B.indexOf(z)===0){var A=B.substring(z.length,B.length);var y=window.atob(A);return y}}return undefined}};var n={documentReady:function(v){if(document.readyState!=="loading"){v()}else{document.addEventListener("DOMContentLoaded",v)}}};function t(){var v={};var w=false;var x=0;var y=arguments.length;if(Object.prototype.toString.call(arguments[0])==="[object Boolean]"){w=arguments[0];x++}var A=function(B){for(var C in B){if(Object.prototype.hasOwnProperty.call(B,C)){if(w&&Object.prototype.toString.call(B[C])==="[object Object]"){v[C]=t(true,v[C],B[C])}else{v[C]=B[C]}}}};for(;x<y;x++){var z=arguments[x];A(z)}return v}function h(A,x){var v=Array.prototype.slice.call(arguments,2);var z=A.split(".");var y=z.pop();for(var w=0;w<z.length;w++){x=x[z[w]]}return x[y].apply(x,v)}function j(w){var v;var x=t({size:0,width:250,multiple:false,selectedIndex:1,enableAutoFilter:false,visibleRows:null,},w);v="#"+x.selector;$.ajax({url:x.url,dataType:"json",success:function(A){var z=[];if(p.props.translationLanguages.includes("all")){z=A[x.elm]}else{for(var y=0;y<A[x.elm].length;y++){if(p.props.translationLanguages.includes(A[x.elm][y].value)){z.push(A[x.elm][y])}}}if(x.visibleRows>z.length){x.visibleRows=z.length}MsDropdown.make(v,{byJson:{data:z,name:x.name,size:x.size,width:x.width,multiple:x.multiple,},enableAutoFilter:x.enableAutoFilter,visibleRows:x.visibleRows,})},error:function(y,A,z){u.error("\nfailed to retrieve JSON data from: "+x.url)}})}function m(){n.documentReady(function(){p.modal=document.getElementById(p.props.dialogContainerID);if(!p.modal){u.info("\nload consent modal");p.modal=document.createElement("div");p.modal.id=p.props.dialogContainerID;p.modal.setAttribute("class","modal fade");p.modal.setAttribute("tabindex","-1");p.modal.setAttribute("role","dialog");p.modal.setAttribute("aria-labelledby",p.props.dialogContainerID);document.body.append(p.modal);p.$modal=$(p.modal);p.$modal.on("show.bs.modal",function(){var w;var x;u.info("\nshow.bs.modal: entered");$.when(j({url:"/assets/data/iso-639-language-codes-flags.json",elm:"iso-639-languages",selector:"dropdownJSON",width:400,visibleRows:8,})).then(function(y){u.info("\ncreating msDropdown from JSON data: finished")})});p.$modal.on("shown.bs.modal",function(){var w;var x;x=setInterval(function(){if(typeof document.getElementById("dropdownJSON").msDropdown!=="undefined"){w=document.getElementById("dropdownJSON").msDropdown;if(!w.length){u.error("\nno msDropdown found in translation dialog");p.$modal.hide()}else{if(p.props.translationLanguage==="auto"){g=navigator.language||navigator.userLanguage;s=g.split("-")[0]}else{s=p.props.translationLanguage}w.selectedIndex=$("#dropdownJSON option[value="+s+"]").index();if(p.props.disableLanguageSelector){w.disabled=true}$("#dropdownJSON").show();$("body").addClass("stop-scrolling");u.info("\nmsDropdown successfully loaded in translation dialog");clearInterval(x)}}},25)});p.$modal.on("hidden.bs.modal",function(){$("body").removeClass("stop-scrolling");h(p.props.postSelectionCallback,window)});var v=p.props.contentURL+"/index.html";$.get(v).done(function(w){u.info("\nloading consent modal: successfully");p.modal.innerHTML=w;p.modal.innerHTML=$("#"+p.props.xhrDataElement).eq(0).html();$(p.modal).modal({backdrop:"static",keyboard:false});p.$buttonDoNotAgree=$("#translator-buttonDoNotAgree");p.$buttonAgree=$("#translator-buttonAgree");p.$buttonSave=$("#translator-buttonSave");p.$buttonAgreeAll=$("#translator-buttonAgreeAll");u.info("\nload/initialze options from cookie");k();i();$("#google-options").on("hide.bs.collapse",function(){q=false;k()}).on("show.bs.collapse",function(){q=true;k()});u.info("\ninitialze button event handler");p.$buttonDoNotAgree.click(function(){b()});p.$buttonAgree.click(function(){o()});p.$buttonSave.click(function(){$("#google-options").collapse("hide");r();i()});p.$buttonAgreeAll.click(function(){$("#google-options").collapse("hide");o()})}).fail(function(){u.error("\nloading translator dialog (modal): failed");u.warn("\nprobably no|wrong `contentURL` set")})}else{p.$modal.modal("show")}}.bind(this))}function i(){var x=p.getSettings();if(x){for(var w in x){var v=p.$modal.find("#google-options .translator-option[data-name="+w+'] input[type="checkbox"]');v.prop("checked",x[w])}}}function k(){if(q){p.$buttonDoNotAgree.hide();p.$buttonAgree.hide();p.$buttonSave.show();p.$buttonAgreeAll.show()}else{p.$buttonDoNotAgree.show();p.$buttonAgree.show();p.$buttonSave.hide();p.$buttonAgreeAll.hide()}}function a(w){var v=p.$modal.find("#google-options .translator-option");var y={};for(var z=0;z<v.length;z++){var B=v[z];var x=B.getAttribute("data-name");if(x==="necessary"){y[x]=true}else{if(w===undefined){var A=$(B).find('input[type="checkbox"]');y[x]=A.prop("checked")}else{y[x]=!!w}}}return y}function o(){var w=a(true);var v={};v=JSON.parse(f.get(p.props.cookieConsentName));v.analysis=w.analysis;v.personalization=w.personalization;f.set(p.props.cookieConsentName,JSON.stringify(v),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);f.set(p.props.cookieName,JSON.stringify(w),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);p.$modal.modal("hide")}function b(){var v=a();v.translationEnabled=false;f.set(p.props.cookieName,JSON.stringify(v),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);p.$modal.modal("hide")}function r(){var w;var v={};w=a();v=JSON.parse(f.get(p.props.cookieConsentName));v.analysis=w.analysis;v.personalization=w.personalization;f.set(p.props.cookieConsentName,JSON.stringify(v),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);f.set(p.props.cookieName,JSON.stringify(a()),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);p.$modal.modal("hide")}this.showDialog=function(){m()};this.getSettings=function(w){var v=f.get(p.props.cookieName);if(v){var x=JSON.parse(f.get(p.props.cookieName));if(w===undefined){return x}else{if(x){return x[w]}else{return false}}}else{return undefined}};u.info("\ninitializing core module finished");u.info("\nstate: finished")};
|
|
15
|
+
"use strict";function Translator(d){var p=this;var u=log4javascript.getLogger("j1.core.translator");var l=new liteURL(window.location.href);var c=(l.protocol.includes("https"))?true:false;var q=false;var g;var s;this.props={contentURL:"/assets/data/translator",cookieName:"j1.user.state",cookieConsentName:"j1.user.consent",cookieStorageDays:365,cookieSameSite:"Strict",cookieSecure:c,translationEnabled:false,disableLanguageSelector:false,translatorName:"google",translationLanguages:"all",translationLanguage:"auto",translateAllPages:true,hideSuggestionBox:true,hidePoweredBy:true,hideTopFrame:true,dialogLanguage:"content",dialogLanguages:["en","de"],dialogContainerID:"translator-modal",xhrDataElement:"",postSelectionCallback:"",};for(var e in d){this.props[e]=d[e]}if(this.props.dialogLanguage.indexOf("-")!==-1){this.props.dialogLanguage=this.props.dialogLanguage.split("-")[0]}if(!this.props.dialogLanguages.includes(this.props.dialogLanguage)){this.props.dialogLanguage=this.props.dialogLanguages[0]}this.props.xhrDataElement=this.props.xhrDataElement+"-"+this.props.dialogLanguage;u.info("\ninitializing core module: started");u.info("\nstate: started");var f={set:function(x,z,C,y,A){var B=window.btoa(z);var v="";if(C){var w=new Date();w.setTime(w.getTime()+(C*24*60*60*1000));v="; expires="+w.toUTCString()}if(A){document.cookie=x+"="+(B||"")+v+"; Path=/; SameSite="+y+"; secure="+A+";"}else{document.cookie=x+"="+(B||"")+v+"; Path=/; SameSite="+y+";"}},get:function(w){var z=w+"=";var v=document.cookie.split(";");for(var x=0;x<v.length;x++){var B=v[x];while(B.charAt(0)===" "){B=B.substring(1,B.length)}if(B.indexOf(z)===0){var A=B.substring(z.length,B.length);var y=window.atob(A);return y}}return undefined}};var n={documentReady:function(v){if(document.readyState!=="loading"){v()}else{document.addEventListener("DOMContentLoaded",v)}}};function t(){var v={};var w=false;var x=0;var y=arguments.length;if(Object.prototype.toString.call(arguments[0])==="[object Boolean]"){w=arguments[0];x++}var A=function(B){for(var C in B){if(Object.prototype.hasOwnProperty.call(B,C)){if(w&&Object.prototype.toString.call(B[C])==="[object Object]"){v[C]=t(true,v[C],B[C])}else{v[C]=B[C]}}}};for(;x<y;x++){var z=arguments[x];A(z)}return v}function h(A,x){var v=Array.prototype.slice.call(arguments,2);var z=A.split(".");var y=z.pop();for(var w=0;w<z.length;w++){x=x[z[w]]}return x[y].apply(x,v)}function j(w){var v;var x=t({size:0,width:250,multiple:false,selectedIndex:1,enableAutoFilter:false,visibleRows:null,},w);v="#"+x.selector;$.ajax({url:x.url,dataType:"json",success:function(A){var z=[];if(p.props.translationLanguages.includes("all")){z=A[x.elm]}else{for(var y=0;y<A[x.elm].length;y++){if(p.props.translationLanguages.includes(A[x.elm][y].value)){z.push(A[x.elm][y])}}}if(x.visibleRows>z.length){x.visibleRows=z.length}MsDropdown.make(v,{byJson:{data:z,name:x.name,size:x.size,width:x.width,multiple:x.multiple,},enableAutoFilter:x.enableAutoFilter,visibleRows:x.visibleRows,})},error:function(y,A,z){u.error("\nfailed to retrieve JSON data from: "+x.url)}})}function m(){n.documentReady(function(){p.modal=document.getElementById(p.props.dialogContainerID);if(!p.modal){u.info("\nload consent modal");p.modal=document.createElement("div");p.modal.id=p.props.dialogContainerID;p.modal.style.display="none";p.modal.setAttribute("class","modal fade");p.modal.setAttribute("tabindex","-1");p.modal.setAttribute("role","dialog");p.modal.setAttribute("aria-labelledby",p.props.dialogContainerID);document.body.append(p.modal);p.$modal=$(p.modal);p.$modal.on("show.bs.modal",function(){var w;var x;u.info("\nshow.bs.modal: entered");$.when(j({url:"/assets/data/iso-639-language-codes-flags.json",elm:"iso-639-languages",selector:"dropdownJSON",width:400,visibleRows:8,})).then(function(y){u.info("\ncreating msDropdown from JSON data: finished")})});p.$modal.on("shown.bs.modal",function(){var w;var x;x=setInterval(function(){if(typeof document.getElementById("dropdownJSON").msDropdown!=="undefined"){w=document.getElementById("dropdownJSON").msDropdown;if(!w.length){u.error("\nno msDropdown found in translation dialog");p.$modal.hide()}else{if(p.props.translationLanguage==="auto"){g=navigator.language||navigator.userLanguage;s=g.split("-")[0]}else{s=p.props.translationLanguage}w.selectedIndex=$("#dropdownJSON option[value="+s+"]").index();if(p.props.disableLanguageSelector){w.disabled=true}$("#dropdownJSON").show();$("body").addClass("stop-scrolling");u.info("\nmsDropdown successfully loaded in translation dialog");clearInterval(x)}}},25)});p.$modal.on("hidden.bs.modal",function(){$("body").removeClass("stop-scrolling");h(p.props.postSelectionCallback,window)});var v=p.props.contentURL+"/index.html";$.get(v).done(function(w){u.info("\nloading consent modal: successfully");p.modal.innerHTML=w;p.modal.innerHTML=$("#"+p.props.xhrDataElement).eq(0).html();p.modal.style.display="block";$(p.modal).modal({backdrop:"static",keyboard:false});p.$buttonDoNotAgree=$("#translator-buttonDoNotAgree");p.$buttonAgree=$("#translator-buttonAgree");p.$buttonSave=$("#translator-buttonSave");p.$buttonAgreeAll=$("#translator-buttonAgreeAll");u.info("\nload/initialze options from cookie");k();i();$("#google-options").on("hide.bs.collapse",function(){q=false;k()}).on("show.bs.collapse",function(){q=true;k()});u.info("\ninitialze button event handler");p.$buttonDoNotAgree.click(function(){b()});p.$buttonAgree.click(function(){o()});p.$buttonSave.click(function(){$("#google-options").collapse("hide");r();i()});p.$buttonAgreeAll.click(function(){$("#google-options").collapse("hide");o()});p.$modal.modal("show")}).fail(function(){u.error("\nloading translator dialog (modal): failed");u.warn("\nprobably no|wrong `contentURL` set")})}else{p.$modal.modal("show")}}.bind(this))}function i(){var x=p.getSettings();if(x){for(var w in x){var v=p.$modal.find("#google-options .translator-option[data-name="+w+'] input[type="checkbox"]');v.prop("checked",x[w])}}}function k(){if(q){p.$buttonDoNotAgree.hide();p.$buttonAgree.hide();p.$buttonSave.show();p.$buttonAgreeAll.show()}else{p.$buttonDoNotAgree.show();p.$buttonAgree.show();p.$buttonSave.hide();p.$buttonAgreeAll.hide()}}function a(w){var v=p.$modal.find("#google-options .translator-option");var y={};for(var z=0;z<v.length;z++){var B=v[z];var x=B.getAttribute("data-name");if(x==="necessary"){y[x]=true}else{if(w===undefined){var A=$(B).find('input[type="checkbox"]');y[x]=A.prop("checked")}else{y[x]=!!w}}}return y}function o(){var w=a(true);var v={};v=JSON.parse(f.get(p.props.cookieConsentName));v.analysis=w.analysis;v.personalization=w.personalization;f.set(p.props.cookieConsentName,JSON.stringify(v),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);f.set(p.props.cookieName,JSON.stringify(w),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);p.$modal.modal("hide")}function b(){var v=a();v.translationEnabled=false;f.set(p.props.cookieName,JSON.stringify(v),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);p.$modal.modal("hide")}function r(){var w;var v={};w=a();v=JSON.parse(f.get(p.props.cookieConsentName));v.analysis=w.analysis;v.personalization=w.personalization;f.set(p.props.cookieConsentName,JSON.stringify(v),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);f.set(p.props.cookieName,JSON.stringify(a()),p.props.cookieStorageDays,p.props.sameSite,p.props.secure);p.$modal.modal("hide")}this.showDialog=function(){m()};this.getSettings=function(w){var v=f.get(p.props.cookieName);if(v){var x=JSON.parse(f.get(p.props.cookieName));if(w===undefined){return x}else{if(x){return x[w]}else{return false}}}else{return undefined}};u.info("\ninitializing core module finished");u.info("\nstate: finished")};
|