j1-template 2020.0.2 → 2020.0.7
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_blog_archive.html +22 -18
- data/_includes/themes/j1/layouts/content_generator_collection.html +15 -12
- data/_includes/themes/j1/layouts/content_generator_page.html +16 -17
- data/_includes/themes/j1/layouts/content_generator_post.html +21 -26
- data/_includes/themes/j1/modules/navigator/generator.html +62 -40
- data/{lib/starter_web/apps/public/cc → apps/public/cc/cc.yml} +0 -0
- data/apps/public/cc/index.adoc +107 -0
- data/assets/data/menu.html +6 -5
- data/assets/data/mmenu.html +455 -0
- data/assets/data/{sidebar.html → mmenu_sidebar.html} +24 -18
- data/assets/data/mmenu_toc.html +45 -0
- data/assets/data/quicklinks.html +9 -4
- data/assets/data/ssm.html +227 -0
- data/assets/error_pages/HTTP204.html +3 -3
- data/assets/themes/j1/adapter/js/algolia.js +321 -0
- data/{lib/starter_web/assets → assets}/themes/j1/adapter/js/attic.js +4 -4
- data/{lib/starter_web/assets → assets}/themes/j1/adapter/js/carousel.js +3 -3
- data/{lib/starter_web/assets → assets}/themes/j1/adapter/js/cookie_consent.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/adapter/js/framer.js +3 -3
- data/{lib/starter_web/assets → assets}/themes/j1/adapter/js/gallery_customizer.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/adapter/js/j1.js +15 -38
- data/{lib/starter_web/assets → assets}/themes/j1/adapter/js/justified_gallery.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/adapter/js/lightbox.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/adapter/js/logger.js +0 -0
- data/assets/themes/j1/adapter/js/mmenu.js +452 -0
- data/{lib/starter_web/assets → assets}/themes/j1/adapter/js/navigator.js +50 -50
- data/{lib/starter_web/assets → assets}/themes/j1/adapter/js/searcher.js +0 -0
- data/assets/themes/j1/adapter/js/ssm.js +507 -0
- data/{lib/starter_web/assets → assets}/themes/j1/adapter/js/themer.js +1 -1
- data/{lib/starter_web/assets → assets}/themes/j1/adapter/js/toccer.js +42 -44
- data/assets/themes/j1/core/css/bootstrap.css +116 -93
- data/assets/themes/j1/core/css/bootstrap.min.css +4 -4
- data/assets/themes/j1/core/css/globals.css +1 -1
- data/assets/themes/j1/core/css/theme_extensions.css +690 -137
- data/assets/themes/j1/core/css/theme_extensions.min.css +1 -1
- data/assets/themes/j1/core/css/uno.css +690 -137
- data/assets/themes/j1/core/css/uno.min.css +1 -1
- data/assets/themes/j1/core/css/vendor.css +134 -105
- data/assets/themes/j1/core/css/vendor.min.css +4 -4
- data/assets/themes/j1/core/js/template.js +306 -24
- data/assets/themes/j1/core/js/template.js.map +1 -1
- data/assets/themes/j1/core/js/template.min.js +1 -1
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/carousel/css/carousel.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/carousel/css/carousel.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/carousel/css/carousel_transitions.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/carousel/css/carousel_transitions.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/carousel/css/theme/uno.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/carousel/css/theme/uno.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/carousel/images/ajax-loader.gif +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/carousel/images/grabbing.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/carousel/images/owl-logo.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/carousel/images/owl.video.play.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/carousel/js/carousel.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/carousel/js/carousel.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/iconify/js/iconify.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/iframe_resizer/examples/frame.absolute.html +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/iframe_resizer/examples/frame.content.html +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/iframe_resizer/examples/frame.hover.html +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/iframe_resizer/examples/frame.nested.html +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/iframe_resizer/examples/frame.textarea.html +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/iframe_resizer/examples/frame.tolerance.html +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/iframe_resizer/examples/index.html +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/iframe_resizer/examples/two.html +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/iframe_resizer/js/client/iframeResizer.contentWindow.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/iframe_resizer/js/client/iframeResizer.contentWindow.map +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/iframe_resizer/js/client/iframeResizer.contentWindow.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/LICENSE +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/README.md +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/_versions/v3.7.0/css/justifiedGallery.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/_versions/v3.7.0/css/justifiedGallery.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/_versions/v3.7.0/css/theme/uno.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/_versions/v3.7.0/js/justifiedGallery.3.7.0.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/_versions/v3.7.0/js/justifiedGallery.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/_versions/v3.7.0/js/justifiedGallery.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/_versions/v3.7.0/less/.csslintrc +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/_versions/v3.7.0/less/justifiedGallery.less +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/_versions/v4.0.0/css/justifiedGallery.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/_versions/v4.0.0/css/justifiedGallery.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/_versions/v4.0.0/css/theme/uno.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/_versions/v4.0.0/js/jquery.justifiedGallery.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/_versions/v4.0.0/js/jquery.justifiedGallery.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/css/justifiedGallery.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/css/justifiedGallery.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/css/theme/uno.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/css/theme/uno.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/js/justifiedGallery.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/justified_gallery/js/justifiedGallery.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/core/lg-fb-comment-box.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/core/lg-fb-comment-box.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/core/lg-transitions.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/core/lg-transitions.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/core/lightgallery.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/core/lightgallery.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/fonts/lg.eot +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/fonts/lg.svg +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/fonts/lg.ttf +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/fonts/lg.woff +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/img/loading.gif +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/img/video-play.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/img/vimeo-play.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/img/youtube-play.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/animation-w.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/customize-w.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/dynamic-w.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/facebook-icon.svg +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/googleplus-icon.svg +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/html5-w.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/linked-in.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/module-w.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/play-button.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/responsive-w.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/thumb-w.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/touch-w.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/twitter-icon.svg +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/twitter.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/video1-w.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/zoom-w.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/icons/zoom.png +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/uno.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/css/themes/uno.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/core/lightgallery.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/core/lightgallery.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/j1/j1-video.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/j1/j1-video.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-autoplay.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-autoplay.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-fullscreen.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-fullscreen.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-hash.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-hash.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-pager.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-pager.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-share.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-share.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-thumbnail.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-thumbnail.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-video.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-video.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-zoom.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/light_gallery/js/modules/lg-zoom.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/log4javascript/log4javascript.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/log4javascript/log4javascript.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/base16.dark/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/base16.light/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/base16.monokai.dark/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/base16.monokai.light/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/base16.monokai/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/base16.solarized.dark/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/base16.solarized.light/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/base16.solarized/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/base16/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/colorful/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/github/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/gruvbox.dark/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/gruvbox.light/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/gruvbox/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/igorpro/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/molokai/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/monokai.sublime/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/monokai/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/pastie/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/thankful_eyes/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/rouge/css/tulip/theme.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/videojs/css/themes/city.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/videojs/css/themes/city.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/videojs/css/themes/fantasy.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/videojs/css/themes/fantasy.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/videojs/css/themes/forest.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/videojs/css/themes/forest.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/videojs/css/themes/sea.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/videojs/css/themes/sea.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/videojs/css/video-js.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/videojs/css/video-js.min.css +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/videojs/js/video.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/videojs/js/video.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/vimeo/froogaloop/js/froogaloop2.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/vimeo/player/js/player.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/vimeo/player/js/player.js.map +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/vimeo/player/js/player.min.js +0 -0
- data/{lib/starter_web/assets → assets}/themes/j1/extensions/vimeo/player/js/player.min.js.map +0 -0
- data/lib/j1/version.rb +1 -1
- data/lib/j1_app/j1_auth_manager/auth_manager.rb +8 -0
- data/lib/starter_web/Gemfile +2 -2
- data/lib/starter_web/_config.yml +12 -139
- data/lib/starter_web/_data/modules/authentication.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/navigator.yml +25 -24
- data/lib/starter_web/_data/modules/defaults/ssm.yml +50 -0
- data/lib/starter_web/_data/modules/defaults/toccer.yml +14 -15
- data/lib/starter_web/_data/modules/navigator.yml +164 -97
- data/lib/starter_web/_data/modules/ssm.yml +133 -0
- data/lib/starter_web/_data/modules/toccer.yml +20 -62
- data/lib/starter_web/_data/resources.yml +68 -51
- data/lib/starter_web/_data/template_settings.yml +13 -13
- data/lib/starter_web/_plugins/uglify.rb +41 -0
- data/lib/starter_web/assets/images/modules/icons/j1/{j1..ico → j1.ico} +0 -0
- data/lib/starter_web/collections/posts/public/{jekyll → featured}/_posts/2018-05-01-confusion-about-base-url.adoc +0 -0
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/about/about_site.adoc +3 -3
- data/lib/starter_web/pages/public/about/become_a_patron.adoc +9 -11
- data/lib/starter_web/pages/public/learn/floating_sidebar.adoc +199 -0
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +3 -3
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +6 -7
- data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +5 -5
- data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +22 -24
- data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +27 -30
- data/lib/starter_web/pages/public/learn/whats_up.adoc +12 -11
- data/lib/starter_web/pages/public/legal/en/500_support.adoc +1 -1
- data/lib/starter_web/pages/public/previewer/000_includes/tables/mdi_icons/200_rotate.asciidoc +1 -1
- data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +2 -3
- data/lib/starter_web/pages/public/previewer/twitter_emoji_preview.adoc +3 -3
- data/lib/starter_web/pages/public/site_search.adoc +196 -0
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +169 -164
- data/assets/themes/j1/core/css/globals.scss +0 -28
- data/lib/starter_web/_data/modules/back2top.yml +0 -40
- data/lib/starter_web/_data/modules/defaults/back2top.yml +0 -147
- data/lib/starter_web/_data/modules/defaults/smooth_scroll.yml +0 -169
- data/lib/starter_web/_data/modules/smooth_scroll.yml +0 -169
- data/lib/starter_web/assets/themes/j1/adapter/js/back2top.js +0 -227
- data/lib/starter_web/assets/themes/j1/adapter/js/scroller.js +0 -177
@@ -26,6 +26,11 @@ regenerate: true
|
|
26
26
|
# Example: var str = JSON.stringify(obj, null, 2); // spacing level = 2
|
27
27
|
# See: https://stackoverflow.com/questions/4810841/how-can-i-pretty-print-json-using-javascript
|
28
28
|
# -----------------------------------------------------------------------------
|
29
|
+
# NOTE:
|
30
|
+
# jadams, 2020-06-21:
|
31
|
+
# J1 Navigator needs a general revision on BS4 code and functionalities
|
32
|
+
# Current, only base function are tested with BS4 (was coded for BS3)
|
33
|
+
# -----------------------------------------------------------------------------
|
29
34
|
{% endcomment %}
|
30
35
|
|
31
36
|
{% comment %} Liquid procedures
|
@@ -67,8 +72,6 @@ regenerate: true
|
|
67
72
|
{% assign nav_quicklinks_settings = navigator_settings.nav_quicklinks %}
|
68
73
|
{% assign nav_topsearch_defaults = navigator_defaults.nav_topsearch %}
|
69
74
|
{% assign nav_topsearch_settings = navigator_settings.nav_topsearch %}
|
70
|
-
{% assign nav_sidebar_defaults = navigator_defaults.nav_sidebar %}
|
71
|
-
{% assign nav_sidebar_settings = navigator_settings.nav_sidebar %}
|
72
75
|
{% assign nav_authclient_defaults = authentication_defaults.auth_client %}
|
73
76
|
{% assign nav_authclient_settings = authentication_settings.auth_client %}
|
74
77
|
|
@@ -79,12 +82,10 @@ regenerate: true
|
|
79
82
|
{% assign nav_menu_options = nav_menu_defaults | merge: nav_menu_settings %}
|
80
83
|
{% assign quicklinks_options = nav_quicklinks_defaults | merge: nav_quicklinks_settings %}
|
81
84
|
{% assign topsearch_options = nav_topsearch_defaults | merge: nav_topsearch_settings %}
|
82
|
-
{% assign sidebar_options = nav_sidebar_defaults | merge: nav_sidebar_settings %}
|
83
85
|
{% assign authclient_options = nav_authclient_defaults | merge: nav_authclient_settings %}
|
84
86
|
|
85
87
|
{% assign nav_bar_id = navigator_defaults.nav_bar.id %}
|
86
88
|
{% assign nav_menu_id = navigator_defaults.nav_menu.id %}
|
87
|
-
{% assign nav_sidebar_id = navigator_defaults.nav_sidebar.id %}
|
88
89
|
{% assign nav_quicklinks_id = navigator_defaults.nav_quicklinks.id %}
|
89
90
|
{% assign nav_navbar_media_breakpoint = navigator_defaults.nav_bar.media_breakpoint %}
|
90
91
|
{% assign authclient_modals_id = navigator_defaults.nav_authclient.xhr_container_id %}
|
@@ -137,14 +138,12 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
137
138
|
|
138
139
|
var nav_menu_id = '{{nav_menu_id}}';
|
139
140
|
var nav_quicklinks_id = '{{nav_quicklinks_id}}';
|
140
|
-
var nav_sidebar_id = '{{nav_sidebar_id}}';
|
141
141
|
var authclient_modals_id = '{{authclient_modals_id}}';
|
142
142
|
|
143
143
|
var colors_data_path = '{{template_config.colors_data_path}}';
|
144
144
|
var font_size_data_path = '{{template_config.font_size_data_path}}';
|
145
145
|
var nav_menu_data_path = '{{nav_menu_options.data_path}}';
|
146
146
|
var nav_quicklinks_data_path = '{{quicklinks_options.data_path}}';
|
147
|
-
var nav_sidebar_data_path = '{{sidebar_options.data_path}}';
|
148
147
|
var authclient_modals_data_path = '{{authclient_options.xhr_data_path}}';
|
149
148
|
|
150
149
|
var cookie_names = j1.getCookieNames();
|
@@ -201,13 +200,11 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
201
200
|
var navMenuConfig = {};
|
202
201
|
var navQuicklinksConfig = {};
|
203
202
|
var navTopsearchConfig = {};
|
204
|
-
var navSidebarConfig = {};
|
205
203
|
var navAuthClientConfig = {};
|
206
204
|
var navBarOptions = {};
|
207
205
|
var navMenuOptions = {};
|
208
206
|
var navQuicklinksOptions = {};
|
209
207
|
var navTopsearchOptions = {};
|
210
|
-
var navSidebarOptions = {};
|
211
208
|
var navAuthClientOptions = {};
|
212
209
|
var navAuthMAnagerConfig = {};
|
213
210
|
|
@@ -216,7 +213,6 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
216
213
|
navMenuConfig = $.extend({}, {{nav_menu_options | replace: '=>', ':' }});
|
217
214
|
navQuicklinksConfig = $.extend({}, {{quicklinks_options | replace: '=>', ':' }});
|
218
215
|
navTopsearchConfig = $.extend({}, {{topsearch_options | replace: '=>', ':' }});
|
219
|
-
navSidebarConfig = $.extend({}, {{sidebar_options | replace: '=>', ':' }});
|
220
216
|
navAuthClientConfig = $.extend({}, {{authclient_options | replace: '=>', ':' }});
|
221
217
|
|
222
218
|
navAuthMAnagerConfig = $.extend({}, {{authentication_options | replace: '=>', ':' }});
|
@@ -229,7 +225,6 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
229
225
|
navMenuOptions = j1.mergeData(navMenuConfig, navDefaults.nav_menu);
|
230
226
|
navQuicklinksOptions = j1.mergeData(navQuicklinksConfig, navDefaults.nav_quicklinks);
|
231
227
|
navTopsearchOptions = j1.mergeData(navTopsearchConfig, navDefaults.nav_topsearch);
|
232
|
-
navSidebarOptions = j1.mergeData(navSidebarConfig, navDefaults.nav_sidebar);
|
233
228
|
navAuthClientConfig = j1.mergeData(navAuthClientConfig, navDefaults.nav_authclient);
|
234
229
|
|
235
230
|
// save config settings into the navigator object for global access
|
@@ -239,7 +234,6 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
239
234
|
j1.adapter.navigator['navMenuOptions'] = navMenuOptions;
|
240
235
|
j1.adapter.navigator['navQuicklinksOptions'] = navQuicklinksOptions;
|
241
236
|
j1.adapter.navigator['navTopsearchOptions'] = navTopsearchOptions;
|
242
|
-
j1.adapter.navigator['navSidebarOptions'] = navSidebarOptions;
|
243
237
|
j1.adapter.navigator['navAuthClientConfig'] = navAuthClientConfig;
|
244
238
|
j1.adapter.navigator['navAuthManagerConfig'] = navAuthMAnagerConfig;
|
245
239
|
|
@@ -250,35 +244,48 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
250
244
|
logger.info('state: ' + _this.getState());
|
251
245
|
logger.info('module is being initialized');
|
252
246
|
|
247
|
+
// -----------------------------------------------------------------------
|
248
|
+
// Load HTML data (AJAX)
|
249
|
+
// -----------------------------------------------------------------------
|
250
|
+
// jadams, 202-06-24: Promise (chain) if $.when seems NOT to work correctly.
|
251
|
+
// It semms a chain using .then will be a better solution to make it sure
|
252
|
+
// that the last Deferred set the state to 'data_loaded'.
|
253
|
+
// Found the final state randomly set to 'null' what prevent the module
|
254
|
+
// to run mmenuInitializer.
|
255
|
+
// Workaround: Set 'data_loaded' to be returned by all Deferred in
|
256
|
+
// the chain.
|
257
|
+
// See: https://stackoverflow.com/questions/5436327/jquery-deferreds-and-promises-then-vs-done
|
258
|
+
//
|
253
259
|
// -----------------------------------------------------------------------
|
254
260
|
// data loader
|
255
261
|
// -----------------------------------------------------------------------
|
256
262
|
logger.info('run deferred data load');
|
257
263
|
$.when (
|
258
|
-
j1.xhrData (//
|
259
|
-
'j1.adapter.navigator', {
|
260
|
-
xhr_container_id: navSidebarOptions.xhr_container_id,
|
261
|
-
xhr_data_path: navSidebarOptions.xhr_data_path },
|
262
|
-
null),
|
263
|
-
j1.xhrData (// quicklinks
|
264
|
+
j1.xhrData ( // quicklinks
|
264
265
|
'j1.adapter.navigator', {
|
265
266
|
xhr_container_id: navQuicklinksOptions.xhr_container_id,
|
266
267
|
xhr_data_path: navQuicklinksOptions.xhr_data_path },
|
267
268
|
null),
|
268
|
-
j1.xhrData (// authclient
|
269
|
+
j1.xhrData ( // authclient
|
269
270
|
'j1.adapter.navigator', {
|
270
271
|
xhr_container_id: navAuthClientConfig.xhr_container_id,
|
271
272
|
xhr_data_path: navAuthClientConfig.xhr_data_path },
|
272
273
|
null),
|
273
|
-
j1.xhrData (// menubar
|
274
|
+
j1.xhrData ( // menubar
|
274
275
|
'j1.adapter.navigator', {
|
275
276
|
xhr_container_id: navMenuOptions.xhr_container_id,
|
276
277
|
xhr_data_path: navMenuOptions.xhr_data_path },
|
277
278
|
'data_loaded'))
|
278
|
-
.done (function (
|
279
|
+
.done (function (quickLinks, authclient, menuBar) {
|
279
280
|
// ---------------------------------------------------------------------
|
280
281
|
// core initializer
|
281
282
|
// ---------------------------------------------------------------------
|
283
|
+
|
284
|
+
// Make sure that Load HTML data (AJAX) is finished
|
285
|
+
// setTimeout (function() {
|
286
|
+
// _this.setState('data_loaded');
|
287
|
+
// }, 150);
|
288
|
+
|
282
289
|
var dependencies_met_navigator_core = setInterval (function () {
|
283
290
|
if (_this.getState() === 'data_loaded') {
|
284
291
|
_this.setState('processing');
|
@@ -325,8 +332,7 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
325
332
|
logger.info('apply styles');
|
326
333
|
_this.setCSS (
|
327
334
|
navBarOptions, navMenuOptions,
|
328
|
-
navQuicklinksOptions, navTopsearchOptions
|
329
|
-
navSidebarOptions
|
335
|
+
navQuicklinksOptions, navTopsearchOptions
|
330
336
|
);
|
331
337
|
|
332
338
|
logger.info('init auth client');
|
@@ -340,27 +346,28 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
340
346
|
}
|
341
347
|
}, 25); // END 'dependencies_met_navigator_core'
|
342
348
|
|
343
|
-
//
|
344
|
-
// Register event 'reset on resize'
|
345
|
-
//
|
349
|
+
// --------------------------------------------------------------------
|
350
|
+
// Register event 'reset on resize' to call j1.core.navigator on
|
351
|
+
// manageDropdownMenu to manage the (current) NAV menu for
|
352
|
+
// desktop or mobile
|
353
|
+
// ---------------------------------------------------------------------
|
346
354
|
$(window).on('resize', function() {
|
347
355
|
j1.core.navigator.manageDropdownMenu(navDefaults, navMenuOptions);
|
348
356
|
|
357
|
+
// Hide|Close topSearch on resize event
|
349
358
|
$('.top-search').slideUp();
|
359
|
+
|
360
|
+
// Manage sticky NAV bars
|
350
361
|
setTimeout (function(){
|
351
362
|
j1.core.navigator.navbarSticky();
|
352
363
|
}, 500);
|
353
364
|
|
354
|
-
//
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
$('.navbar-collapse').removeClass('in');
|
362
|
-
$('.navbar-collapse').removeClass('on');
|
363
|
-
$('.navbar-collapse').removeClass('bounceIn');
|
365
|
+
// jadams, 2020-06-21: unclear|forgotten what I'm doing here!
|
366
|
+
// Looks like the old BS3 implementation
|
367
|
+
//
|
368
|
+
// $('.navbar-collapse').removeClass('in');
|
369
|
+
// $('.navbar-collapse').removeClass('on');
|
370
|
+
// $('.navbar-collapse').removeClass('bounceIn');
|
364
371
|
});
|
365
372
|
|
366
373
|
return true;
|
@@ -369,12 +376,12 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
369
376
|
|
370
377
|
// -------------------------------------------------------------------------
|
371
378
|
// Initialize JS portion for the dialogs (modals) used by J1AuthClient
|
372
|
-
// NOTE: Currently cookie
|
379
|
+
// NOTE: Currently cookie updates NOT processed at the NAV module
|
373
380
|
// All updates on Cookies are managed by Cookie Consent.
|
374
381
|
// To be considered to re-add cookie updates for the auth state
|
375
382
|
// -------------------------------------------------------------------------
|
376
383
|
initAuthClient: function(auth_config) {
|
377
|
-
var logger
|
384
|
+
var logger = log4javascript.getLogger('j1.adapter.navigator.initAuthClient');
|
378
385
|
var user_session = j1.readCookie(cookie_user_session_name);
|
379
386
|
|
380
387
|
_this.modalEventHandler(auth_config);
|
@@ -502,7 +509,7 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
502
509
|
logger.info(logText);
|
503
510
|
logText = 'initiate signout for provider: ' +provider;
|
504
511
|
logger.info(logText);
|
505
|
-
|
512
|
+
|
506
513
|
var route = '/authentication?request=signout&provider=' + provider + '&provider_signout=' + signOut.providerSignOut; // + '/logout/';
|
507
514
|
logText = 'call middleware on route : ' +route;
|
508
515
|
logger.info(logText);
|
@@ -526,7 +533,7 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
526
533
|
// setCSS
|
527
534
|
// Set dynamic CSS styles
|
528
535
|
// -------------------------------------------------------------------------
|
529
|
-
setCSS: function (navBarOptions, navMenuOptions, navQuicklinksOptions, navTopsearchOptions
|
536
|
+
setCSS: function (navBarOptions, navMenuOptions, navQuicklinksOptions, navTopsearchOptions) {
|
530
537
|
var logger = log4javascript.getLogger("j1.adapter.navigator.setCSS");
|
531
538
|
var gridBreakpoint_lg = '992px';
|
532
539
|
var gridBreakpoint_md = '768px';
|
@@ -571,9 +578,6 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
571
578
|
navTopsearchOptions.input_color = j1.setColorData(navTopsearchOptions.input_color);
|
572
579
|
navTopsearchOptions.background_color = j1.setColorData(navTopsearchOptions.background_color);
|
573
580
|
|
574
|
-
{% comment %} Set|Resolve navSidebarOptions
|
575
|
-
-------------------------------------------------------------------------- {% endcomment %}
|
576
|
-
navSidebarOptions.background_color = j1.setColorData(navSidebarOptions.background_color);
|
577
581
|
|
578
582
|
{% comment %} Set dymanic styles
|
579
583
|
-------------------------------------------------------------------------- {% endcomment %}
|
@@ -595,14 +599,14 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
595
599
|
$('head').append("<style>@media (min-width: " +gridBreakpoint_lg+ ") { nav.navbar.navigator.navbar-scrolled.light { background-color: " +bg_scrolled+ " !important; } }</style>");
|
596
600
|
|
597
601
|
// Menubar collapsed (mobile)
|
598
|
-
|
602
|
+
// $('head').append('<style>.navbar-collapse.collapse.show { background-color: ' +bg_scrolled+ ' !important; }</style>');
|
599
603
|
|
600
604
|
|
601
605
|
/* Navbar media-queries, LARGE Window|Desktop (>= 1024) */
|
602
606
|
/* jadams: Oversized menu bar fixed by: overflow: hidden */
|
603
607
|
// $('head').append("<style>@media (max-width: " +gridBreakpoint_lg+ ") { nav.navbar.navigator { background-color: " +navBarOptions.background_color_collapsed+ " !important; overflow: hidden; } }</style>");
|
604
|
-
|
605
|
-
|
608
|
+
// $('head').append("<style>@media (max-width: " +gridBreakpoint_lg+ ") { nav.navbar.navigator { background-color: " +bg_collapsed+ " !important; overflow: hidden; } }</style>");
|
609
|
+
// $('head').append("<style>@media (max-width: 1023px) { row { margin-left: 0 !important; margin-right: 0 !important; } }</style>");
|
606
610
|
|
607
611
|
{% comment %} navQuicklinks styles
|
608
612
|
-------------------------------------------------------------------------- {% endcomment %}
|
@@ -670,10 +674,6 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
670
674
|
$('head').append("<style>.top-search .input-group-addon { color: " +navTopsearchOptions.input_color+ " !important; }</style>");
|
671
675
|
$('head').append("<style>.top-search .input.form-control { color: " +navTopsearchOptions.input_color+ " !important; }</style>");
|
672
676
|
|
673
|
-
{% comment %} navSidebar styles
|
674
|
-
-------------------------------------------------------------------------- {% endcomment %}
|
675
|
-
$('head').append("<style>.side { background-color: " +navSidebarOptions.background_color+ " !important; }</style>");
|
676
|
-
|
677
677
|
return true;
|
678
678
|
}, // END setCSS
|
679
679
|
|
@@ -779,4 +779,4 @@ j1.adapter['navigator'] = (function (j1, window) {
|
|
779
779
|
|
780
780
|
{% endcapture %}
|
781
781
|
{{ cache | strip_empty_lines }}
|
782
|
-
{% assign cache = nil %}
|
782
|
+
{% assign cache = nil %}
|
File without changes
|
@@ -0,0 +1,507 @@
|
|
1
|
+
---
|
2
|
+
regenerate: true
|
3
|
+
---
|
4
|
+
|
5
|
+
{% capture cache %}
|
6
|
+
|
7
|
+
{% comment %}
|
8
|
+
# -----------------------------------------------------------------------------
|
9
|
+
# ~/assets/themes/j1/adapter/js/ssm.js
|
10
|
+
# Liquid template to adapt SSM Core functions
|
11
|
+
#
|
12
|
+
# Product/Info:
|
13
|
+
# https://jekyll.one
|
14
|
+
#
|
15
|
+
# Copyright (C) 2020 Juergen Adams
|
16
|
+
#
|
17
|
+
# J1 Template is licensed under the MIT License.
|
18
|
+
# For details, see https://jekyll.one
|
19
|
+
# -----------------------------------------------------------------------------
|
20
|
+
# Test data:
|
21
|
+
# {{ liquid_var | debug }}
|
22
|
+
# -----------------------------------------------------------------------------
|
23
|
+
{% endcomment %}
|
24
|
+
|
25
|
+
{% comment %} Liquid var initialization
|
26
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
27
|
+
|
28
|
+
{% comment %} Set config files
|
29
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
30
|
+
{% assign site_config = site %}
|
31
|
+
{% assign template_config = site.data.template_settings %}
|
32
|
+
{% assign modules = site.data.modules %}
|
33
|
+
|
34
|
+
{% comment %} Set config data
|
35
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
36
|
+
{% assign toccer_defaults = modules.defaults.toccer.defaults %}
|
37
|
+
{% assign toccer_settings = modules.toccer.settings %}
|
38
|
+
{% assign ssm_settings = modules.ssm.settings %}
|
39
|
+
{% assign ssm_defaults = modules.defaults.ssm.defaults %}
|
40
|
+
|
41
|
+
{% comment %} Set config options
|
42
|
+
-------------------------------------------------------------------------------- {% endcomment %}
|
43
|
+
{% assign toccer_options = toccer_defaults | merge: toccer_settings %}
|
44
|
+
{% assign ssm_options = ssm_defaults | merge: ssm_settings %}
|
45
|
+
|
46
|
+
/*
|
47
|
+
# -----------------------------------------------------------------------------
|
48
|
+
# ~/assets/themes/j1/adapter/js/ssm.js
|
49
|
+
# JS Adapter for J1 SSM (Sticky Side Menu)
|
50
|
+
#
|
51
|
+
# Product/Info:
|
52
|
+
# {{site.data.template_settings.theme_author_url}}
|
53
|
+
#
|
54
|
+
# Copyright (C) 2020 Juergen Adams
|
55
|
+
#
|
56
|
+
# J1 Template is licensed under the MIT License.
|
57
|
+
# For details, see {{site.data.template_settings.theme_author_url}}
|
58
|
+
# -----------------------------------------------------------------------------
|
59
|
+
# Adapter generated: {{site.time}}
|
60
|
+
# -----------------------------------------------------------------------------
|
61
|
+
*/
|
62
|
+
'use strict';
|
63
|
+
|
64
|
+
j1.adapter['ssm'] = (function (j1, window) {
|
65
|
+
|
66
|
+
// ---------------------------------------------------------------------------
|
67
|
+
// globals
|
68
|
+
// ---------------------------------------------------------------------------
|
69
|
+
var environment = '{{environment}}';
|
70
|
+
var dclFinished = false;
|
71
|
+
var moduleOptions = {};
|
72
|
+
var cookie_names = j1.getCookieNames();
|
73
|
+
var user_state;
|
74
|
+
var user_session;
|
75
|
+
var user_data;
|
76
|
+
var sect1Nodes;
|
77
|
+
var sect12Nodes;
|
78
|
+
var _this;
|
79
|
+
var logger;
|
80
|
+
var logText;
|
81
|
+
|
82
|
+
// ---------------------------------------------------------------------------
|
83
|
+
// helper functions
|
84
|
+
// ---------------------------------------------------------------------------
|
85
|
+
|
86
|
+
|
87
|
+
// ---------------------------------------------------------------------------
|
88
|
+
// main object
|
89
|
+
// ---------------------------------------------------------------------------
|
90
|
+
return {
|
91
|
+
|
92
|
+
// -------------------------------------------------------------------------
|
93
|
+
// module initializer
|
94
|
+
// -------------------------------------------------------------------------
|
95
|
+
init: function (options) {
|
96
|
+
|
97
|
+
// create seetings object from frontmatterOptions
|
98
|
+
var frontmatterOptions = options != null ? $.extend({}, options) : {};
|
99
|
+
|
100
|
+
// initialize state flag
|
101
|
+
j1.adapter.ssm.state = 'pending';
|
102
|
+
|
103
|
+
// -----------------------------------------------------------------------
|
104
|
+
// defaults
|
105
|
+
// -----------------------------------------------------------------------
|
106
|
+
var settings = $.extend({
|
107
|
+
module_name: 'j1.adapter.ssm',
|
108
|
+
generated: '{{site.time}}'
|
109
|
+
}, options);
|
110
|
+
|
111
|
+
// -----------------------------------------------------------------------
|
112
|
+
// globals
|
113
|
+
// -----------------------------------------------------------------------
|
114
|
+
_this = j1.adapter.ssm;
|
115
|
+
logger = log4javascript.getLogger('j1.adapter.ssm');
|
116
|
+
sect12Nodes = $("[class$='sect1'],[class$='sect2'");
|
117
|
+
sect1Nodes = $("[class$='sect1']");
|
118
|
+
|
119
|
+
// -----------------------------------------------------------------------
|
120
|
+
// options loader
|
121
|
+
// -----------------------------------------------------------------------
|
122
|
+
var ssmMenuOptions = $.extend({}, {{nav_ssm_options | replace: '=>', ':' }});
|
123
|
+
var ssmOptions = $.extend({}, {{ssm_options | replace: 'nil', 'null' | replace: '=>', ':' }});
|
124
|
+
var xhr_data_path;
|
125
|
+
var menu_id;
|
126
|
+
|
127
|
+
// Load (individual) frontmatter options (currently NOT used)
|
128
|
+
//
|
129
|
+
if (options != null) { var frontmatterOptions = $.extend({}, options) }
|
130
|
+
|
131
|
+
if (typeof frontmatterOptions !== 'undefined') {
|
132
|
+
moduleOptions = j1.mergeData(ssmOptions, frontmatterOptions);
|
133
|
+
}
|
134
|
+
|
135
|
+
// save config settings into the mmenu object for global access
|
136
|
+
//
|
137
|
+
j1.adapter.ssm['moduleOptions'] = moduleOptions;
|
138
|
+
|
139
|
+
_this.setState('started');
|
140
|
+
logger.info('state: ' + _this.getState());
|
141
|
+
logger.info('module is being initialized');
|
142
|
+
|
143
|
+
// jadams, 2020-06-24: Set max_count to 100 what cause to wait 2.5s
|
144
|
+
// for J1 Navigator to finish (init)
|
145
|
+
//
|
146
|
+
var interval_count = 0;
|
147
|
+
var max_count = 100;
|
148
|
+
|
149
|
+
var dependencies_met_navigator = setInterval(function() {
|
150
|
+
interval_count += 1;
|
151
|
+
if ( j1.adapter.navigator.getState() == 'finished' ) {
|
152
|
+
logger.info('dependencies of module navigator met for: mmenu');
|
153
|
+
logger.info('dependencies of module navigator met after: ' + interval_count * 25 + ' ms');
|
154
|
+
j1.core.ssm.init (moduleOptions);
|
155
|
+
_this.ssmLoader(moduleOptions);
|
156
|
+
clearInterval(dependencies_met_navigator);
|
157
|
+
}
|
158
|
+
if (interval_count > max_count) {
|
159
|
+
logger.warn('dependency check failed for module: navigator');
|
160
|
+
logger.warn('dependencies of module navigator met after: ' + interval_count * 25 + ' ms');
|
161
|
+
j1.core.ssm.init (moduleOptions);
|
162
|
+
_this.ssmLoader(moduleOptions);
|
163
|
+
clearInterval(dependencies_met_navigator);
|
164
|
+
}
|
165
|
+
}, 25);
|
166
|
+
|
167
|
+
}, // END init
|
168
|
+
|
169
|
+
// -------------------------------------------------------------------------
|
170
|
+
// SSM Loader
|
171
|
+
// -------------------------------------------------------------------------
|
172
|
+
ssmLoader: function (ssmOptions) {
|
173
|
+
var menu_id;
|
174
|
+
var xhr_data_path;
|
175
|
+
|
176
|
+
_this.setState('loading');
|
177
|
+
logger.info('status: ' + _this.getState());
|
178
|
+
logger.info('load HTML data for ssm');
|
179
|
+
|
180
|
+
{% assign id_list = "" %}
|
181
|
+
|
182
|
+
$.when (
|
183
|
+
{% assign menu_id = ssm_options.xhr_container_id %}
|
184
|
+
{% assign xhr_data_path = ssm_options.xhr_data_path %}
|
185
|
+
j1.xhrData (
|
186
|
+
'j1.adapter.ssm', {
|
187
|
+
xhr_container_id: "{{menu_id}}",
|
188
|
+
xhr_data_path: "{{xhr_data_path}}" },
|
189
|
+
'data_loaded')
|
190
|
+
).done (function (ssm) {
|
191
|
+
// ---------------------------------------------------------------------
|
192
|
+
// Initialize MMenu Navs and Drawers
|
193
|
+
// ---------------------------------------------------------------------
|
194
|
+
var dependencies_met_mmenu_initialized = setInterval (function () {
|
195
|
+
if (ssm) {
|
196
|
+
if (j1.getState() === 'finished') {
|
197
|
+
// if ( j1.adapter.navigator.getState() == 'finished' ) {
|
198
|
+
logger.info('load HTML data (AJAX): finished');
|
199
|
+
_this.setState('processing');
|
200
|
+
logger.info('status: ' + _this.getState());
|
201
|
+
logger.info('initialize ssm menu');
|
202
|
+
if ( ssmOptions.mode === 'icon') {
|
203
|
+
logger.info('icon mode detected');
|
204
|
+
}
|
205
|
+
_this.scrollSpy(ssmOptions);
|
206
|
+
_this.buttonInitializer(ssmOptions);
|
207
|
+
clearInterval(dependencies_met_mmenu_initialized);
|
208
|
+
}
|
209
|
+
} else {
|
210
|
+
logger.error('initialize ssm failed, HTML data NOT loaded');
|
211
|
+
}
|
212
|
+
}, 25); // END dependencies_met_mmenu_loaded
|
213
|
+
}); // END done
|
214
|
+
}, // END dataLoader
|
215
|
+
|
216
|
+
// -------------------------------------------------------------------------
|
217
|
+
// Button Initializer
|
218
|
+
// -------------------------------------------------------------------------
|
219
|
+
buttonInitializer: function (ssmOptions) {
|
220
|
+
var eventHandler;
|
221
|
+
|
222
|
+
{% for item in ssm_options.items %} {% if item.enabled %}
|
223
|
+
|
224
|
+
{% comment %} Identify the menu (item) type
|
225
|
+
-------------------------------------------------------------------------- {% endcomment %}
|
226
|
+
{% if item.sublevel %}
|
227
|
+
{% assign menu_type = 'sublevel_menu' %}
|
228
|
+
{% else %}
|
229
|
+
{% assign menu_type = 'top_level_item' %}
|
230
|
+
{% endif %}
|
231
|
+
|
232
|
+
{% if menu_type == 'top_level_item' %}
|
233
|
+
{% assign button_id = item.id %}
|
234
|
+
|
235
|
+
// Create an eventhandler instance if id exists: {{button_id}}
|
236
|
+
if ($('#{{button_id}}').length) {
|
237
|
+
eventHandler = "{{item.event_handler}}"
|
238
|
+
|
239
|
+
// check if eventhandler configured is a SINGLE word
|
240
|
+
if (eventHandler.split(" ").length == 1) {
|
241
|
+
logger.info('register pre-configured eventhandler {{item.event_handler}} on id: {{button_id}}');
|
242
|
+
$('#{{button_id}}').each(function(e) {
|
243
|
+
var $this = $(this);
|
244
|
+
$this.on('click', function(e) {
|
245
|
+
j1.adapter.ssm.{{item.event_handler}}(sect1Nodes);
|
246
|
+
});
|
247
|
+
});
|
248
|
+
} else {
|
249
|
+
logger.info('register custom eventhandler on id: {{button_id}}');
|
250
|
+
}
|
251
|
+
|
252
|
+
} // END items (buttons)
|
253
|
+
{% endif %} // menu_type 'top_level_item'
|
254
|
+
{% endif %} // ENDIF button_id enabled
|
255
|
+
{% endfor %} // ENDFOR items
|
256
|
+
}, // END buttonInitializer
|
257
|
+
|
258
|
+
// -------------------------------------------------------------------------
|
259
|
+
// Eventhandler
|
260
|
+
|
261
|
+
// -------------------------------------------------------------------------
|
262
|
+
// open mobile menu
|
263
|
+
// -------------------------------------------------------------------------
|
264
|
+
open_mmenu: function (id) {
|
265
|
+
logger.info('eventhandler fired on id: ' + id );
|
266
|
+
}, // END open_mmenu
|
267
|
+
|
268
|
+
// -------------------------------------------------------------------------
|
269
|
+
// scroll to previous section
|
270
|
+
// -------------------------------------------------------------------------
|
271
|
+
scroll_previous_section: function (nodes) {
|
272
|
+
var previous_header_id;
|
273
|
+
var currentNode;
|
274
|
+
var prev_node;
|
275
|
+
var anchor_id;
|
276
|
+
|
277
|
+
var index = 0;
|
278
|
+
var maxNode = $(nodes).length - 1;
|
279
|
+
var $toc = $("#sidebar");
|
280
|
+
var current_header_id = $toc.find(".is-active-link").attr('href');
|
281
|
+
|
282
|
+
// logger.info('eventhandler fired on id: ' + id );
|
283
|
+
|
284
|
+
nodes.each(function() {
|
285
|
+
currentNode = $(this).find(current_header_id);
|
286
|
+
if (currentNode.length) {
|
287
|
+
if (index > maxNode) {
|
288
|
+
return false
|
289
|
+
} else {
|
290
|
+
prev_node = (index > 0) ? nodes[index-1] : nodes[index];
|
291
|
+
previous_header_id = $(prev_node).find(":header").first()[0].id;
|
292
|
+
anchor_id = '#' + previous_header_id;
|
293
|
+
|
294
|
+
$('a[href*="' + current_header_id + '"]').removeClass('is-active-link');
|
295
|
+
$('a[href*="' + previous_header_id + '"]').addClass('is-active-link');
|
296
|
+
|
297
|
+
j1.core.scrollSmooth.scroll( anchor_id, {
|
298
|
+
duration: {{toccer_options.scrollSmoothDuration}},
|
299
|
+
offset: {{toccer_options.scrollSmoothOffset}},
|
300
|
+
callback: null
|
301
|
+
});
|
302
|
+
return false;
|
303
|
+
}
|
304
|
+
}
|
305
|
+
(index < maxNode) ? index++ : index;
|
306
|
+
});
|
307
|
+
}, // END scroll_previous_section
|
308
|
+
|
309
|
+
// -------------------------------------------------------------------------
|
310
|
+
// scroll to next section
|
311
|
+
// -------------------------------------------------------------------------
|
312
|
+
scroll_next_section: function (nodes) {
|
313
|
+
var next_header_id;
|
314
|
+
var currentNode;
|
315
|
+
var nextNode;
|
316
|
+
var anchor_id;
|
317
|
+
|
318
|
+
var index = 0;
|
319
|
+
var maxNode = $(nodes).length -1;
|
320
|
+
var $toc = $("#sidebar");
|
321
|
+
var current_header_id = $toc.find(".is-active-link").attr('href');
|
322
|
+
|
323
|
+
// logger.info('eventhandler fired on id: ' + id );
|
324
|
+
|
325
|
+
nodes.each(function() {
|
326
|
+
currentNode = $(this).find(current_header_id);
|
327
|
+
if (currentNode.length) {
|
328
|
+
if (index == maxNode) {
|
329
|
+
return false
|
330
|
+
} else {
|
331
|
+
nextNode = nodes[index+1];
|
332
|
+
next_header_id = $(nextNode).closest().find(":header").first();
|
333
|
+
next_header_id = $(nextNode).find(":header").first()[0].id;
|
334
|
+
anchor_id = '#' + next_header_id;
|
335
|
+
|
336
|
+
$('a[href*="' + current_header_id + '"]').removeClass('is-active-link');
|
337
|
+
$('a[href*="' + next_header_id + '"]').addClass('is-active-link');
|
338
|
+
|
339
|
+
j1.core.scrollSmooth.scroll( anchor_id, {
|
340
|
+
duration: {{toccer_options.scrollSmoothDuration}},
|
341
|
+
offset: {{toccer_options.scrollSmoothOffset}},
|
342
|
+
callback: null
|
343
|
+
});
|
344
|
+
return false;
|
345
|
+
}
|
346
|
+
}
|
347
|
+
(index < maxNode) ? index++ : index;
|
348
|
+
});
|
349
|
+
}, // END scroll_next_section
|
350
|
+
|
351
|
+
// -------------------------------------------------------------------------
|
352
|
+
// scroll to top
|
353
|
+
// -------------------------------------------------------------------------
|
354
|
+
scroll_to_top: function () {
|
355
|
+
var dest = 0;
|
356
|
+
|
357
|
+
// logger.info('eventhandler fired on id: ' + id );
|
358
|
+
|
359
|
+
$('html, body').animate({
|
360
|
+
scrollTop: dest
|
361
|
+
}, 500);
|
362
|
+
}, // END scroll_top
|
363
|
+
|
364
|
+
// -------------------------------------------------------------------------
|
365
|
+
// scroll to bottom
|
366
|
+
// -------------------------------------------------------------------------
|
367
|
+
scroll_to_bottom: function () {
|
368
|
+
var $page = $(document);
|
369
|
+
var $footer = $('#j1_footer');
|
370
|
+
var f = $footer.length ? $footer.outerHeight() : 0;
|
371
|
+
var pageHeight = $page.height() - f - 400;
|
372
|
+
var pageHeightOuter = $page.outerHeight()
|
373
|
+
|
374
|
+
// logger.info('eventhandler fired on id: ' + id );
|
375
|
+
|
376
|
+
$('html, body').animate({
|
377
|
+
scrollTop: pageHeight
|
378
|
+
}, 500);
|
379
|
+
}, // END scroll_bottom
|
380
|
+
|
381
|
+
// -------------------------------------------------------------------------
|
382
|
+
// scroll to comments (Disqus)
|
383
|
+
// -------------------------------------------------------------------------
|
384
|
+
scroll_to_comments: function () {
|
385
|
+
// logger.info('eventhandler fired on id: ' + id );
|
386
|
+
}, // END scroll_comments
|
387
|
+
|
388
|
+
// -------------------------------------------------------------------------
|
389
|
+
// create generic alert
|
390
|
+
// -------------------------------------------------------------------------
|
391
|
+
alert_me: function (id) {
|
392
|
+
// logger.info('eventhandler fired on id: ' + id );
|
393
|
+
alert ("Hello world!");
|
394
|
+
}, // END alert_me
|
395
|
+
// -------------------------------------------------------------------------
|
396
|
+
// messageHandler
|
397
|
+
// Manage messages (paylods) send from other J1 modules
|
398
|
+
// -------------------------------------------------------------------------
|
399
|
+
messageHandler: function (sender, message) {
|
400
|
+
// var json_message = JSON.stringify(message, undefined, 2); // multiline
|
401
|
+
var json_message = JSON.stringify(message);
|
402
|
+
|
403
|
+
logText = 'received message from ' + sender + ': ' + json_message;
|
404
|
+
logger.debug(logText);
|
405
|
+
|
406
|
+
// -----------------------------------------------------------------------
|
407
|
+
// Process commands|actions
|
408
|
+
// -----------------------------------------------------------------------
|
409
|
+
if (message.type === 'command' && message.action === 'module_initialized') {
|
410
|
+
//
|
411
|
+
// Place handling of command|action here
|
412
|
+
//
|
413
|
+
logger.info(message.text);
|
414
|
+
}
|
415
|
+
if (message.type === 'command' && message.action === 'status') {
|
416
|
+
logger.info('messageHandler: received - ' + message.action);
|
417
|
+
}
|
418
|
+
|
419
|
+
//
|
420
|
+
// Place handling of other command|action here
|
421
|
+
//
|
422
|
+
|
423
|
+
return true;
|
424
|
+
}, // END messageHandler
|
425
|
+
|
426
|
+
// -------------------------------------------------------------------------
|
427
|
+
// setState
|
428
|
+
// Set the current (processing) state of the module
|
429
|
+
// -------------------------------------------------------------------------
|
430
|
+
setState: function (stat) {
|
431
|
+
j1.adapter.ssm.state = stat;
|
432
|
+
}, // END setState
|
433
|
+
|
434
|
+
// -------------------------------------------------------------------------
|
435
|
+
// getState
|
436
|
+
// Returns the current (processing) state of the module
|
437
|
+
// -------------------------------------------------------------------------
|
438
|
+
getState: function () {
|
439
|
+
return j1.adapter.ssm.state;
|
440
|
+
}, // END state
|
441
|
+
|
442
|
+
// -------------------------------------------------------------------------
|
443
|
+
// Manage (top) position and sizes (@media breakpoints) of the
|
444
|
+
// SSM container depending on the size of the page header (attic)
|
445
|
+
// -------------------------------------------------------------------------
|
446
|
+
scrollSpy: function (options) {
|
447
|
+
logger = log4javascript.getLogger('j1.adapter.ssm.scrollSpy');
|
448
|
+
|
449
|
+
$(window).scroll(function(event){
|
450
|
+
var $navbar = $('nav.navbar');
|
451
|
+
var $pagehead = $('.attic');
|
452
|
+
var $main_content = $('.js-toc-content');
|
453
|
+
var $adblock = $('#adblock');
|
454
|
+
var $footer = $('#j1_footer');
|
455
|
+
var $ssmContainer = $('#ssm-container');
|
456
|
+
var $page = $(document);
|
457
|
+
|
458
|
+
var offset = 0;
|
459
|
+
var pageOffset = -120;
|
460
|
+
var scrollPos = $(document).scrollTop();
|
461
|
+
var pageHeight = $page.height()
|
462
|
+
var pageHeightOuter = $page.outerHeight()
|
463
|
+
|
464
|
+
// var m = parseInt(pagehead.css('margin-bottom'), 10);
|
465
|
+
var m = $main_content.offset().top;
|
466
|
+
var s = $ssmContainer.length ? $ssmContainer.height() : 0;
|
467
|
+
var f = $footer.length ? $footer.outerHeight() : 0;
|
468
|
+
var n = $navbar.length ? $navbar.height() : 0;
|
469
|
+
// var h = $pagehead.length ? $pagehead.outerHeight() : 0;
|
470
|
+
var a = $adblock.length ? $adblock.outerHeight() : 0;
|
471
|
+
|
472
|
+
// var o = n + h + a + offset;
|
473
|
+
// var o = n + m + offset;
|
474
|
+
var o = n + offset;
|
475
|
+
|
476
|
+
// space above the (fixed) ssm container
|
477
|
+
var showSsmPos = m + pageOffset;
|
478
|
+
|
479
|
+
// space below the (fixed) ssm container
|
480
|
+
var hideSsmPos = pageHeight - s - f + pageOffset;
|
481
|
+
|
482
|
+
// set the top position of ssm container for navbar modes
|
483
|
+
// e.g. "sticky" (navbar-fixed)
|
484
|
+
if($navbar.hasClass('navbar-fixed')){
|
485
|
+
$('#ssm-container').css('top', o);
|
486
|
+
} else {
|
487
|
+
$('#ssm-container').css('top', m);
|
488
|
+
}
|
489
|
+
|
490
|
+
// show|hide ssm container on scroll position in page
|
491
|
+
//
|
492
|
+
( scrollPos >= showSsmPos ) && ( scrollPos <= hideSsmPos )
|
493
|
+
? $ssmContainer.css('display','block')
|
494
|
+
: $ssmContainer.css('display','none');
|
495
|
+
|
496
|
+
logger.debug('content pos detected as: ' + m + 'px');
|
497
|
+
logger.debug('scroll pos detected as: ' + scrollPos + 'px');
|
498
|
+
}); // END setTop on scroll
|
499
|
+
|
500
|
+
} // END scrollSpy
|
501
|
+
|
502
|
+
}; // END return
|
503
|
+
})(j1, window);
|
504
|
+
|
505
|
+
{% endcapture %}
|
506
|
+
{{ cache | strip_empty_lines }}
|
507
|
+
{% assign cache = nil %}
|