j1-template 2022.0.2 → 2022.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +3 -13
  3. data/_includes/themes/j1/modules/connectors/comment/hyvor.html +4 -5
  4. data/_includes/themes/j1/procedures/global/create_bs_button.proc +4 -4
  5. data/_includes/themes/j1/procedures/posts/pager.proc +2 -2
  6. data/_layouts/default.html +3 -11
  7. data/assets/data/private.json +1 -5
  8. data/assets/data/quicklinks.html +62 -47
  9. data/assets/themes/j1/adapter/js/cookieConsent.js +18 -13
  10. data/assets/themes/j1/adapter/js/j1.js +17 -17
  11. data/assets/themes/j1/adapter/js/translator.js +10 -6
  12. data/assets/themes/j1/core/js/template.js +139 -65
  13. data/assets/themes/j1/core/js/template.min.js +5 -5
  14. data/assets/themes/j1/core/js/template.min.js.map +1 -1
  15. data/assets/themes/j1/modules/cryptoJS/js/aes.js +35 -0
  16. data/assets/themes/j1/modules/cryptoJS/js/aes.min.js +35 -0
  17. data/assets/themes/j1/modules/cryptoJS/js/hmac-md5.js +21 -0
  18. data/assets/themes/j1/modules/cryptoJS/js/hmac-ripemd160.js +31 -0
  19. data/assets/themes/j1/modules/cryptoJS/js/hmac-sha1.js +17 -0
  20. data/assets/themes/j1/modules/cryptoJS/js/hmac-sha224.js +19 -0
  21. data/assets/themes/j1/modules/cryptoJS/js/hmac-sha256.js +18 -0
  22. data/assets/themes/j1/modules/cryptoJS/js/hmac-sha3.js +21 -0
  23. data/assets/themes/j1/modules/cryptoJS/js/hmac-sha384.js +27 -0
  24. data/assets/themes/j1/modules/cryptoJS/js/hmac-sha512.js +25 -0
  25. data/assets/themes/j1/modules/cryptoJS/js/md5.js +19 -0
  26. data/assets/themes/j1/modules/cryptoJS/js/pbkdf2.js +19 -0
  27. data/assets/themes/j1/modules/cryptoJS/js/rabbit-legacy.js +36 -0
  28. data/assets/themes/j1/modules/cryptoJS/js/rabbit.js +36 -0
  29. data/assets/themes/j1/modules/cryptoJS/js/rc4.js +33 -0
  30. data/assets/themes/j1/modules/cryptoJS/js/ripemd160.js +29 -0
  31. data/assets/themes/j1/modules/cryptoJS/js/sha1.js +15 -0
  32. data/assets/themes/j1/modules/cryptoJS/js/sha224.js +17 -0
  33. data/assets/themes/j1/modules/cryptoJS/js/sha256.js +16 -0
  34. data/assets/themes/j1/modules/cryptoJS/js/sha3.js +19 -0
  35. data/assets/themes/j1/modules/cryptoJS/js/sha384.js +25 -0
  36. data/assets/themes/j1/modules/cryptoJS/js/sha512.js +23 -0
  37. data/assets/themes/j1/modules/cryptoJS/js/tripledes.js +51 -0
  38. data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.2.js +460 -0
  39. data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.js +379 -353
  40. data/assets/themes/j1/modules/deeplAPI/js/deeplAPI.min.js +1 -1
  41. data/assets/themes/j1/modules/gtag-opt-in/js/gtag-opt-in.js +93 -1
  42. data/assets/themes/j1/modules/scroller/js/scroller.js +6 -6
  43. data/assets/themes/j1/modules/scroller/js/scroller.min.js +1 -1
  44. data/exe/j1 +6 -7
  45. data/lib/j1/commands/generate.rb +15 -16
  46. data/lib/j1/version.rb +3 -3
  47. data/lib/starter_web/Gemfile +7 -1
  48. data/lib/starter_web/_config.yml +1 -1
  49. data/lib/starter_web/_data/_defaults/private.yml +3 -2
  50. data/lib/starter_web/_data/builder/defaults/blog_navigator.yml +50 -44
  51. data/lib/starter_web/_data/modules/defaults/navigator.yml +31 -11
  52. data/lib/starter_web/_data/modules/translator.yml +3 -3
  53. data/lib/starter_web/_data/private.yml +3 -2
  54. data/lib/starter_web/_data/resources.yml +27 -2
  55. data/lib/starter_web/_includes/attributes.asciidoc +1 -1
  56. data/lib/starter_web/_plugins/encodeBase64.rb +46 -0
  57. data/lib/starter_web/_plugins/encryptAES.rb +53 -0
  58. data/lib/starter_web/_plugins/filters.rb +2 -1
  59. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  60. data/lib/starter_web/_plugins/minifyJSON.rb +2 -2
  61. data/lib/starter_web/package.json +1 -1
  62. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +1 -1
  63. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +1 -1
  64. data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +1 -1
  65. data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +0 -21
  66. data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +1 -1
  67. data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +1 -0
  68. data/lib/starter_web/pages/public/blog/navigator/archive.html +1 -1
  69. data/lib/starter_web/pages/public/learn/quickstart.adoc +1 -1
  70. data/lib/starter_web/pages/public/learn/where_to_go.adoc +1 -1
  71. data/lib/starter_web/pages/public/legal/de/100_copyright.adoc +1 -1
  72. data/lib/starter_web/pages/public/legal/de/100_impress.adoc +1 -1
  73. data/lib/starter_web/pages/public/legal/de/300_privacy.adoc +1 -1
  74. data/lib/starter_web/pages/public/legal/de/400_comment_policy.adoc +1 -1
  75. data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +1 -1
  76. data/lib/starter_web/pages/public/legal/en/200_impress.adoc +1 -1
  77. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +1 -1
  78. data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +1 -1
  79. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  80. data/lib/starter_web/utilsrv/package.json +1 -1
  81. metadata +29 -5
  82. data/lib/j1/commands/help.rb +0 -32
  83. data/lib/j1/commands/module.rb +0 -69
@@ -2438,7 +2438,11 @@ module.exports = function navigator(options) {
2438
2438
  init: function init(defaultOptions, menuOptions) {
2439
2439
  logger = log4javascript.getLogger('j1.core.navigator');
2440
2440
  logText = 'core is being initialized';
2441
- logger.info(logText);
2441
+ logger.info(logText); // -----------------------------------------------------------------------
2442
+ // Create a Wrapper for the nav system
2443
+ // -----------------------------------------------------------------------
2444
+
2445
+ $('body').wrapInner('<div id="wrapper-inner" class="wrapper"></div>');
2442
2446
  this.manageDropdownMenu(defaultOptions, menuOptions);
2443
2447
  this.navbarSticky();
2444
2448
  this.eventHandler(defaultOptions); // jadams, 2021-07-03: initialize events early
@@ -2456,6 +2460,12 @@ module.exports = function navigator(options) {
2456
2460
  var defaultOptions = options;
2457
2461
  var logger = log4javascript.getLogger('j1.core.navigator.eventHandler');
2458
2462
  var $getNav = $('nav.navbar.navigator');
2463
+ var scrollDuration = 300;
2464
+ var page_link;
2465
+ var classname;
2466
+ var nav_link;
2467
+ var anchor_id;
2468
+ var scrollOffset;
2459
2469
  var json_data; // jadams: unused code (for now).: manages HTML5 server side events
2460
2470
  // for incoming messages from Git Server send e.g. on a 'pull request'
2461
2471
  // NOTE: used for ControlCenter (cc) functionality only !!!
@@ -2496,12 +2506,72 @@ module.exports = function navigator(options) {
2496
2506
  // 'scroll-to-top'
2497
2507
  // See:
2498
2508
  // https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault
2509
+ // https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation
2499
2510
  // https://stackoverflow.com/questions/134845/which-href-value-should-i-use-for-javascript-links-or-javascriptvoid0
2500
2511
  //
2501
2512
 
2502
2513
  $('a[href="#"]').click(function (e) {
2503
- logger.debug('\n' + 'click event on href "#" detected: prevent default action');
2504
- e.preventDefault ? e.preventDefault() : e.returnValue = false;
2514
+ page_link = document.querySelector('[id="' + decodeURI(anchor_id).split('#').join('') + '"]') ? true : false;
2515
+ anchor_id = e.target.hash ? e.target.hash : false;
2516
+ classname = e.target.className ? e.target.className : '';
2517
+ nav_link = classname.includes('nav-');
2518
+
2519
+ if (!nav_link || page_link) {
2520
+ logger.debug('\n' + 'click event on href "#" detected: prevent default action');
2521
+ e.preventDefault ? e.preventDefault() : e.returnValue = false;
2522
+ }
2523
+ }); // -----------------------------------------------------------------------
2524
+ // In-page smooth scroll
2525
+ // -----------------------------------------------------------------------
2526
+ // bind click event to all headlines generated by AsciiDoctor
2527
+ // for smooth-scroll (in-page)
2528
+ //
2529
+
2530
+ $('.sect1, .sect2 .sect3, .sect4, .sect5, .sect6').on('click', function (e) {
2531
+ page_link = document.querySelector('[id="' + decodeURI(anchor_id).split('#').join('') + '"]') ? true : false;
2532
+ anchor_id = e.target.hash ? e.target.hash : false;
2533
+ classname = e.target.className ? e.target.className : '';
2534
+ nav_link = classname.includes('nav-link'); // skip BS nav links
2535
+
2536
+ scrollOffset = j1.getScrollOffset();
2537
+
2538
+ if (anchor_id && !nav_link || page_link) {
2539
+ logger.debug('\n' + 'click event on headline detected: ' + anchor_id);
2540
+ $('html, body').animate({
2541
+ scrollTop: $(anchor_id).offset().top + scrollOffset
2542
+ }, scrollDuration);
2543
+ e.preventDefault ? e.preventDefault() : e.returnValue = false;
2544
+ }
2545
+ }); // bind click event to all HTML elements of class '.badge' (Bootstrap)
2546
+ // for smooth-scroll (in-page) to a '<div>' element
2547
+ //
2548
+
2549
+ $('.badge').on('click', function (e) {
2550
+ anchor_id = e.target.hash ? e.target.hash : false;
2551
+ scrollOffset = 100;
2552
+
2553
+ if (anchor_id) {
2554
+ logger.debug('\n' + 'click event on badge detected: ' + anchor_id);
2555
+ $('html, body').animate({
2556
+ scrollTop: $(anchor_id).offset().top - scrollOffset // NOTE: diffeent scrollOffset
2557
+
2558
+ }, scrollDuration);
2559
+ event.stopPropagation();
2560
+ }
2561
+ }); // bind click event to all HTML elements of class '.badge-tag' (j1)
2562
+ // for smooth-scroll (in-page)
2563
+
2564
+ $('.badge-tag').on('click', function (e) {
2565
+ anchor_id = e.target.hash ? e.target.hash : false;
2566
+ scrollOffset = j1.getScrollOffset();
2567
+
2568
+ if (anchor_id) {
2569
+ logger.debug('\n' + 'click event on badge-tag detected: ' + anchor_id);
2570
+ $('html, body').animate({
2571
+ scrollTop: $(anchor_id).offset().top + scrollOffset
2572
+ }, scrollDuration);
2573
+ event.stopPropagation();
2574
+ }
2505
2575
  }); // jadams: test code for jQuery plugin 'regex'
2506
2576
  // -----------------------------------------------------------------------
2507
2577
  // $('a:contains("?#")').click(function(e) {
@@ -2615,87 +2685,91 @@ module.exports = function navigator(options) {
2615
2685
  }
2616
2686
  });
2617
2687
  } // -----------------------------------------------------------------------
2618
- // Toggle Search
2688
+ // Manage events for all quicklinks
2619
2689
  // https://stackoverflow.com/questions/178325/how-do-i-check-if-an-element-is-hidden-in-jquery
2620
2690
  // https://stackoverflow.com/questions/4770025/how-to-disable-scrolling-temporarily
2621
2691
  // https://stackoverflow.com/questions/5963669/whats-the-difference-between-event-stoppropagation-and-event-preventdefault
2622
2692
  // -----------------------------------------------------------------------
2623
- // $('nav.navbar.navigator .attr-nav').each(function() {
2624
2693
 
2625
2694
 
2626
2695
  $('.attr-nav').each(function () {
2627
- logger.debug('register OPEN event|s for QuickSearch');
2628
- $('li.search > a', this).on('click', function (e) {
2629
- // e.preventDefault(); // don't do the default browser action
2630
- logger.debug('manage search action OPEN');
2631
- $('html,body').animate({
2632
- scrollTop: 0
2633
- }, 0);
2634
- $('.top-search').slideToggle('slow', 'swing', function () {
2635
- if ($('.top-search').is(':visible')) {
2636
- // disable scrolling (desktop)
2637
- $('body').addClass('stop-scrolling'); // disable scrolling (mobile)
2638
-
2639
- $('body').bind('touchmove', function (e) {
2640
- e.preventDefault();
2641
- }); // disable navbar
2642
-
2643
- $('#' + defaultOptions.nav_bar.container_id).hide();
2644
- } else {
2645
- // enable scrolling (desktop)
2646
- $('body').removeClass('stop-scrolling'); // enable scrolling (mobile)
2696
+ // ---------------------------------------------------------------------
2697
+ // QuickSearch
2698
+ //
2699
+ if ($('li.quicksearch')) {
2700
+ logger.debug('register OPEN event for QuickSearch');
2701
+ $('li.quicksearch > a', this).on('click', function (e) {
2702
+ e.preventDefault(); // don't do the default browser action
2647
2703
 
2648
- $('body').unbind('touchmove'); // enable navbar
2704
+ logger.debug('manage search action OPEN');
2705
+ $('html,body').animate({
2706
+ scrollTop: 0
2707
+ }, 0);
2708
+ $('.top-search').slideToggle('slow', 'swing', function () {
2709
+ if ($('.top-search').is(':visible')) {
2710
+ // disable scrolling (desktop)
2711
+ $('body').addClass('stop-scrolling'); // disable scrolling (mobile)
2649
2712
 
2650
- $('#' + defaultOptions.nav_bar.container_id).show();
2651
- }
2652
- }); // e.stopPropagation(); // don't bubble up the event
2653
- });
2654
- });
2655
- logger.debug('register CLOSE event|s for QuickSearch');
2656
- $('.input-group-addon.close-search').on('click', function (e) {
2657
- e.preventDefault(); // don't do the default browser action
2713
+ $('body').bind('touchmove', function (e) {
2714
+ e.preventDefault();
2715
+ }); // disable navbar
2658
2716
 
2659
- logger.debug('manage search action CLOSE');
2660
- $('.top-search').slideUp('slow', 'swing');
2661
- $('html,body').animate({
2662
- scrollTop: 0
2663
- }, 0); // enable scrolling (desktop)
2717
+ $('#' + defaultOptions.nav_bar.container_id).hide();
2718
+ } else {
2719
+ // enable scrolling (desktop)
2720
+ $('body').removeClass('stop-scrolling'); // enable scrolling (mobile)
2664
2721
 
2665
- $('body').removeClass('stop-scrolling'); // enable scrolling (mobile)
2722
+ $('body').unbind('touchmove'); // enable navbar
2666
2723
 
2667
- $('body').unbind('touchmove'); // enable navbar
2724
+ $('#' + defaultOptions.nav_bar.container_id).show();
2725
+ }
2726
+ });
2727
+ e.stopPropagation(); // don't bubble up the event
2728
+ });
2729
+ logger.debug('register CLOSE event for QuickSearch');
2730
+ $('.input-group-addon.close-search').on('click', function (e) {
2731
+ e.preventDefault(); // don't do the default browser action
2668
2732
 
2669
- $('#' + defaultOptions.nav_bar.container_id).show();
2670
- e.stopPropagation(); // don't bubble up the event
2671
- }); // -----------------------------------------------------------------------
2672
- // Toggle Translator SHOW|HIDE
2673
- // -----------------------------------------------------------------------
2733
+ logger.debug('manage search action CLOSE');
2734
+ $('.top-search').slideUp('slow', 'swing');
2735
+ $('html,body').animate({
2736
+ scrollTop: 0
2737
+ }, 0); // enable scrolling (desktop)
2674
2738
 
2675
- $('nav.navbar.navigator .attr-nav').each(function () {
2676
- logger.debug('register SHOW|HIDE event|s for J1 Translator');
2677
- $('li.translator > a', this).on('click', function (e) {
2678
- // e.preventDefault(); // don't do the default browser action
2679
- // window.location.reload(true);
2680
- logger.debug('toggle translator icon SHOW|HIDE'); // See: https://api.jquery.com/toggle/
2681
- // With no parameters, the .toggle() method simply toggles the visibility of elements
2739
+ $('body').removeClass('stop-scrolling'); // enable scrolling (mobile)
2682
2740
 
2683
- $('#google_translate_element').toggle();
2741
+ $('body').unbind('touchmove'); // enable navbar
2684
2742
 
2685
- if ($('#google_translate_element').css('display') !== 'none') {
2686
- $('html,body').animate({
2687
- scrollTop: 0
2688
- }, 'slow');
2689
- } // e.stopPropagation(); // don't bubble up the event
2743
+ $('#' + defaultOptions.nav_bar.container_id).show();
2744
+ e.stopPropagation(); // don't bubble up the event
2745
+ });
2746
+ } // END QuickSearch
2747
+ // ---------------------------------------------------------------------
2748
+ // Translator
2749
+ //
2690
2750
 
2691
- });
2692
- }); // -----------------------------------------------------------------------
2693
- // Wrapper
2694
- // -----------------------------------------------------------------------
2695
2751
 
2696
- $('body').wrapInner('<div class=\'wrapper\'></div>');
2752
+ if ($('li.translate')) {
2753
+ logger.debug('register SHOW event for J1 Translator');
2754
+ $('li.translate > a', this).on('click', function (e) {
2755
+ j1.translator.showDialog();
2756
+ });
2757
+ } // END Translator
2758
+ // ---------------------------------------------------------------------
2759
+ // CookieConsent
2760
+ //
2761
+
2762
+
2763
+ if ($('li.cookie-consent')) {
2764
+ logger.debug('register SHOW event for J1 CookieConsent');
2765
+ $('li.cookie-consent > a', this).on('click', function (e) {
2766
+ j1.cookieConsent.showDialog();
2767
+ });
2768
+ } // END CookieConsent
2769
+
2770
+ }); // End manage events for all quicklinks
2697
2771
  },
2698
- // end event
2772
+ // END eventHandler
2699
2773
  // -------------------------------------------------------------------------
2700
2774
  // Manage the Menu Dropdowns for Desktop|Mobile
2701
2775
  // -------------------------------------------------------------------------