j1-template 2024.3.14 → 2024.3.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/assets/data/amplitude.html +111 -58
  3. data/assets/data/cookieconsent.html +8 -8
  4. data/assets/data/panel.html +4 -3
  5. data/assets/data/speak2me.html +11 -11
  6. data/assets/data/translator.html +29 -29
  7. data/assets/theme/j1/adapter/js/amplitude.js +112 -88
  8. data/assets/theme/j1/adapter/js/j1.js +4 -4
  9. data/assets/theme/j1/adapter/js/masonry.js +2 -2
  10. data/assets/theme/j1/adapter/js/themes.js +42 -4
  11. data/assets/theme/j1/adapter/js/videojs.js +212 -0
  12. data/assets/theme/j1/core/css/icon-fonts/mdib.css +24 -4
  13. data/assets/theme/j1/core/css/icon-fonts/mdib.css.map +1 -1
  14. data/assets/theme/j1/core/css/icon-fonts/mdib.min.css +1 -1
  15. data/assets/theme/j1/core/css/icon-fonts/mdib.min.css.map +1 -1
  16. data/assets/theme/j1/core/css/themes/unolight/bootstrap.css +9 -6
  17. data/assets/theme/j1/core/css/themes/unolight/bootstrap.css.map +1 -1
  18. data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
  19. data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css.map +1 -1
  20. data/assets/theme/j1/core/js/template.js +262 -275
  21. data/assets/theme/j1/core/js/template.min.js +7 -7
  22. data/assets/theme/j1/core/js/template.min.js.map +1 -1
  23. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.css +131 -24
  24. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.min.css +1 -1
  25. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.css +102 -76
  26. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.min.css +1 -1
  27. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.css +109 -78
  28. data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.min.css +1 -1
  29. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/artist.svg +78 -0
  30. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/mute.svg +52 -20
  31. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/next.svg +20 -39
  32. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/now-playing.svg +24 -38
  33. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist-hide.svg +85 -0
  34. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist-music.svg +85 -0
  35. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist-show.svg +85 -0
  36. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/playlist.svg +85 -0
  37. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/previous.svg +18 -37
  38. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-backward.svg +33 -30
  39. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-forward.svg +33 -29
  40. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/small/next.svg +55 -14
  41. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/small/previous.svg +56 -14
  42. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/volume.svg +38 -21
  43. data/assets/theme/j1/modules/amplitudejs/js/amplitude.map +20 -20
  44. data/assets/theme/j1/modules/amplitudejs/js/tech/youtube_example.js +211 -0
  45. data/assets/theme/j1/modules/gemini/js/gemini.js.map +1 -1
  46. data/assets/theme/j1/modules/jquery/js/jquery.min.map +1 -1
  47. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +206 -122
  48. data/assets/theme/j1/modules/videojs/assets/icons/custom-icons/next.svg +82 -0
  49. data/assets/theme/j1/modules/videojs/css/font/README.md +151 -0
  50. data/assets/theme/j1/modules/videojs/css/font/VideoJS.svg +150 -0
  51. data/assets/theme/j1/modules/videojs/css/font/video-js-cdn.css +2012 -0
  52. data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.0.css +32 -0
  53. data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.1.css +31 -0
  54. data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.css +31 -0
  55. data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.min.css +21 -0
  56. data/assets/theme/j1/modules/videojs/css/themes/uno.css +14 -3
  57. data/assets/theme/j1/modules/videojs/css/themes/uno.min.css +1 -1
  58. data/assets/theme/j1/modules/videojs/css/videojs.css +1 -0
  59. data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/LICENSE +13 -0
  60. data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/README.md +75 -0
  61. data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/autocaption.js +149 -0
  62. data/assets/theme/j1/modules/videojs/js/plugins/controls/autocaption/autocaption.min.js +21 -0
  63. data/assets/theme/j1/modules/videojs/js/plugins/controls/hotkeys/README.md +76 -30
  64. data/assets/theme/j1/modules/videojs/js/plugins/controls/hotkeys/hotkeys.js +64 -53
  65. data/assets/theme/j1/modules/videojs/js/plugins/controls/hotkeys/hotkeys.min.js +1 -1
  66. data/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/README.md +133 -0
  67. data/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/skipbuttons.js +137 -0
  68. data/assets/theme/j1/modules/videojs/js/plugins/controls/skipbuttons/skipbuttons.min.js +21 -0
  69. data/assets/theme/j1/modules/videojs/js/plugins/controls/zoom/zoom.js +15 -12
  70. data/assets/theme/j1/modules/videojs/js/plugins/players/dm/dailymotion.js +2 -2
  71. data/assets/theme/j1/modules/videojs/js/plugins/players/yt/youtube.js +43 -16
  72. data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.3/fastfilereaderext.so +0 -0
  73. data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.3/rubyeventmachine.so +0 -0
  74. data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.4/fastfilereaderext.so +0 -0
  75. data/lib/j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/3.4/rubyeventmachine.so +0 -0
  76. data/lib/j1/version.rb +1 -1
  77. data/lib/j1_app/j1_auth_manager/config.rb +0 -4
  78. data/lib/starter_web/Gemfile +45 -22
  79. data/lib/starter_web/README.md +5 -5
  80. data/lib/starter_web/_config.yml +4 -6
  81. data/lib/starter_web/_data/modules/amplitude.yml +67 -37
  82. data/lib/starter_web/_data/modules/defaults/amplitude.yml +1 -0
  83. data/lib/starter_web/_data/modules/defaults/gallery.yml +42 -0
  84. data/lib/starter_web/_data/modules/defaults/videojs.yml +107 -0
  85. data/lib/starter_web/_data/modules/gallery.yml +30 -14
  86. data/lib/starter_web/_data/modules/lazyLoader.yml +8 -8
  87. data/lib/starter_web/_data/modules/masonry.yml +15 -0
  88. data/lib/starter_web/_data/modules/masterslider.yml +6 -6
  89. data/lib/starter_web/_data/modules/videojs.yml +57 -0
  90. data/lib/starter_web/_data/resources.yml +9 -26
  91. data/lib/starter_web/_data/templates/feed.xml +1 -1
  92. data/lib/starter_web/_includes/tables/jekyll_variables.asciidoc +1 -0
  93. data/lib/starter_web/_plugins/asciidoctor/carousel-block.rb +2 -1
  94. data/lib/starter_web/_plugins/asciidoctor/dailymotion-block.rb +4 -1
  95. data/lib/starter_web/_plugins/asciidoctor/lightbox-block.rb +1 -1
  96. data/lib/starter_web/_plugins/asciidoctor/masterslider-block.rb +1 -1
  97. data/lib/starter_web/_plugins/asciidoctor/slick-block.rb +2 -1
  98. data/lib/starter_web/_plugins/asciidoctor/videojs-block.rb +145 -24
  99. data/lib/starter_web/_plugins/asciidoctor/vimeo-block.rb +4 -1
  100. data/lib/starter_web/_plugins/asciidoctor/wistia-block.rb +313 -0
  101. data/lib/starter_web/_plugins/asciidoctor/youtube-block.rb +192 -17
  102. data/lib/starter_web/_plugins/index/lunr.rb +1 -1
  103. data/lib/starter_web/assets/audio/cover/spontanorama/spontanorama.jpg +0 -0
  104. data/lib/starter_web/assets/audio/cover/spontanorama/src/spontanorama.png +0 -0
  105. data/lib/starter_web/assets/audio/cover/spontanorama/src/spontanorama.psd +0 -0
  106. data/lib/starter_web/package.json +1 -1
  107. data/lib/starter_web/pages/public/amplitude_yt_tester.adoc +20 -7
  108. data/lib/starter_web/pages/public/manuals/integrations/amplitudejs/amplitudejs-api.adoc +1 -1
  109. data/lib/starter_web/pages/public/manuals/integrations/videojs/youtube-api.adoc +1638 -0
  110. data/lib/starter_web/pages/public/tools/previewer/preview_bootstrap_theme.adoc +5 -6
  111. data/lib/starter_web/pages/public/tools/previewer/preview_videojs.adoc +203 -0
  112. data/lib/starter_web/pages/public/tour/asciidoc_extensions.adoc +1 -1
  113. data/lib/starter_web/pages/public/tour/bootstrap_themes.adoc +1 -1
  114. data/lib/starter_web/pages/public/tour/highlghter_rouge.adoc +1 -1
  115. data/lib/starter_web/pages/public/tour/modal_extentions.adoc +1 -1
  116. data/lib/starter_web/pages/public/tour/play_audio.adoc +30 -29
  117. data/lib/starter_web/pages/public/tour/play_video.adoc +65 -39
  118. data/lib/starter_web/pages/public/tour/present_images.adoc +17 -16
  119. data/lib/starter_web/pages/public/tour/quicksearch.adoc +1 -1
  120. data/lib/starter_web/pages/public/tour/responsive_tables.adoc +1 -1
  121. data/lib/starter_web/pages/public/tour/typography.adoc +1 -1
  122. metadata +37 -20
  123. data/assets/data/amplitude.28.html +0 -887
  124. data/assets/data/amplitude.29.html +0 -923
  125. data/assets/theme/j1/adapter/js/amplitude.23.js +0 -1165
  126. data/assets/theme/j1/adapter/js/amplitude.24.js +0 -1164
  127. data/assets/theme/j1/adapter/js/amplitude.25.js +0 -1268
  128. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/_pause.svg +0 -19
  129. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/_play.svg +0 -18
  130. data/assets/theme/j1/modules/amplitudejs/icons/player/dark/show-playlist.svg +0 -15
  131. data/assets/theme/j1/modules/jqueryScrollbar/LICENSE +0 -20
  132. data/assets/theme/j1/modules/jqueryScrollbar/README.md +0 -28
  133. data/assets/theme/j1/modules/jqueryScrollbar/css/scrollbar.css +0 -939
  134. data/assets/theme/j1/modules/jqueryScrollbar/css/scrollbar.min.css +0 -20
  135. data/assets/theme/j1/modules/jqueryScrollbar/js/scrollbar.js +0 -851
  136. data/assets/theme/j1/modules/jqueryScrollbar/js/scrollbar.min.js +0 -36
  137. data/assets/theme/j1/modules/jqueryScrollbar/sass/scrollbar.scss +0 -806
  138. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.0.js +0 -794
  139. data/lib/starter_web/_data/modules/lazyLoader.0.yml +0 -118
@@ -557,6 +557,8 @@ settings:
557
557
  player:
558
558
  enabled: true
559
559
 
560
+ # VideoJS
561
+ # --------------------------------------------------------------------
560
562
  videojsPlayer:
561
563
  enabled: true
562
564
 
@@ -580,6 +582,12 @@ settings:
580
582
  options:
581
583
  volumeStep: 0.2
582
584
 
585
+ skipButtonsPlugin:
586
+ enabled: true
587
+ options:
588
+ forward: 15
589
+ backward: 15
590
+
583
591
  zoomPlugin:
584
592
  enabled: true
585
593
  options:
@@ -588,6 +596,8 @@ settings:
588
596
  rotate: 0
589
597
  zoom: 1
590
598
 
599
+ # Vimeo
600
+ # --------------------------------------------------------------------
591
601
  vimeoPlayer:
592
602
  enabled: true
593
603
  options:
@@ -597,6 +607,9 @@ settings:
597
607
  # portrait: 0
598
608
  # color: var(--md-gray-100)
599
609
 
610
+
611
+ # Wistia
612
+ # --------------------------------------------------------------------
600
613
  wistiaPlayer:
601
614
  enabled: true
602
615
  options:
@@ -605,6 +618,8 @@ settings:
605
618
  muted: false
606
619
  qualityControl: false
607
620
 
621
+ # Youtube
622
+ # --------------------------------------------------------------------
608
623
  youTubePlayer:
609
624
  enabled: true
610
625
  options:
@@ -298,8 +298,8 @@ settings:
298
298
 
299
299
  thumblist:
300
300
  enabled: true
301
- width: 140
302
- height: 80
301
+ height: 180
302
+ width: 250
303
303
  type: thumbs
304
304
  autohide: false
305
305
  dir: v
@@ -310,8 +310,8 @@ settings:
310
310
  #
311
311
  options:
312
312
 
313
- width: 1200
314
- height: 600
313
+ width: 1000
314
+ height: 500
315
315
 
316
316
  # ------------------------------------------------------------------------
317
317
  # Slides
@@ -653,8 +653,8 @@ settings:
653
653
 
654
654
  thumblist:
655
655
  enabled: true
656
- height: 160
657
- width: 240
656
+ height: 180
657
+ width: 280
658
658
  type: tabs
659
659
  autohide: false
660
660
  dir: v
@@ -0,0 +1,57 @@
1
+ # ------------------------------------------------------------------------------
2
+ # ~/_data/modules/videojs.yml
3
+ # User configuration settings for J1 VideoJS module
4
+ #
5
+ # Product/Info:
6
+ # https://jekyll.one
7
+ #
8
+ # Copyright (C) 2023, 2024 Juergen Adams
9
+ #
10
+ # J1 Template is licensed under the MIT License.
11
+ # See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE
12
+ # -----------------------------------------------------------------------------
13
+
14
+ # ------------------------------------------------------------------------------
15
+ # Description
16
+ #
17
+ description:
18
+ title: J1 VideoJS
19
+ scope: User settings
20
+ location: _data/modules/videojs.yml
21
+
22
+ # ------------------------------------------------------------------------------
23
+ # User configuration settings
24
+ #
25
+ settings:
26
+
27
+ # ----------------------------------------------------------------------------
28
+ # VideoJS settings
29
+ # ----------------------------------------------------------------------------
30
+ playbackRates:
31
+ enabled: true
32
+
33
+ # ----------------------------------------------------------------------------
34
+ # VideoJS Plugin settings
35
+ # ----------------------------------------------------------------------------
36
+ plugins:
37
+
38
+ hotKeys:
39
+ enabled: true
40
+
41
+ # Plugin options
42
+ # ------------------------------------------------------------------------
43
+ enableInactiveFocus: false # mutiple players on same page: reassign focus to the player when the control bar fades out
44
+ # hotkeysFocusElementFilter: 'e => e.tagName.toLowerCase() === "body"'
45
+
46
+ skipButtons:
47
+ enabled: true
48
+
49
+ # Plugin options
50
+ # ------------------------------------------------------------------------
51
+ surroundPlayButton: true # surround buttons side-by-side the play button
52
+
53
+ zoomButtons:
54
+ enabled: true
55
+
56
+ # ------------------------------------------------------------------------------
57
+ # END config
@@ -356,7 +356,9 @@ resources:
356
356
  data:
357
357
  css: [
358
358
  core/css/themes/unolight/bootstrap,
359
+ core/css/icon-fonts/fontawesome,
359
360
  core/css/icon-fonts/mdib,
361
+
360
362
  core/css/vendor
361
363
  ]
362
364
  files: [ adapter/js/j1.js ]
@@ -1319,6 +1321,7 @@ resources:
1319
1321
  data:
1320
1322
  css: [
1321
1323
  modules/videojs/css/videojs,
1324
+ modules/videojs/css/plugins/controls/skipbuttons,
1322
1325
  modules/videojs/css/plugins/controls/zoom,
1323
1326
  modules/videojs/css/themes/city,
1324
1327
  modules/videojs/css/themes/fantasy,
@@ -1326,18 +1329,19 @@ resources:
1326
1329
  modules/videojs/css/themes/sea,
1327
1330
  modules/videojs/css/themes/uno
1328
1331
  ]
1329
- files: []
1332
+ files: [ adapter/js/videojs.js ]
1330
1333
  js: [
1331
1334
  modules/videojs/js/video,
1335
+ modules/videojs/js/plugins/controls/autocaption/autocaption,
1332
1336
  modules/videojs/js/plugins/controls/hotkeys/hotkeys,
1337
+ modules/videojs/js/plugins/controls/skipbuttons/skipbuttons,
1333
1338
  modules/videojs/js/plugins/controls/zoom/zoom,
1334
1339
  modules/videojs/js/plugins/players/dm/dailymotion,
1340
+ modules/videojs/js/plugins/players/wt/wistia,
1335
1341
  modules/videojs/js/plugins/players/vm/vimeo,
1336
1342
  modules/videojs/js/plugins/players/yt/youtube
1337
-
1338
-
1339
1343
  ]
1340
- init_function: []
1344
+ init_function: [ j1.adapter.videojs.init]
1341
1345
 
1342
1346
  # ----------------------------------------------------------------------------
1343
1347
  # TikToc Player, Version v1.0.11
@@ -1917,26 +1921,5 @@ resources:
1917
1921
  js: [ modules/amplitudejs/js/amplitude ]
1918
1922
  init_function: [ j1.adapter.amplitude.init ]
1919
1923
 
1920
- # ----------------------------------------------------------------------------
1921
- # jqueryScrollbar
1922
- #
1923
- - name: J1 jqueryScrollbar
1924
- resource:
1925
- enabled: false
1926
-
1927
- id: scrollbars
1928
- comment: Module jqueryScrollbar
1929
- region: body-footer
1930
- layout: [ home, page, post ]
1931
- required: always
1932
- script_load: defer
1933
- pass_init_data: false
1934
-
1935
- data:
1936
- css: [ modules/jqueryScrollbar/css/scrollbar ]
1937
- files: []
1938
- js: [ modules/jqueryScrollbar/js/scrollbar ]
1939
- init_function: []
1940
-
1941
1924
  # ------------------------------------------------------------------------------
1942
- # END config
1925
+ # END config
@@ -57,7 +57,7 @@
57
57
  <id>{{ page.url | absolute_url | xml_escape }}</id>
58
58
  <post_limited>{{ limit_posts }}</post_limited>
59
59
  <template_name>J1 Theme</template_name>
60
- <template_version>2024.3.14</template_version>
60
+ <template_version>2024.3.16</template_version>
61
61
 
62
62
  {% assign title = site.title | default: site.name %}
63
63
  {% if page.collection != "posts" %}
@@ -1,3 +1,4 @@
1
+
1
2
  .Jekyll variables (Liquid)
2
3
  [cols="3,3a,6a", subs=+macros, options="header", width="100%", role="rtable mt-3"]
3
4
  |===
@@ -35,7 +35,8 @@ Asciidoctor::Extensions.register do
35
35
 
36
36
  def process parent, target, attributes
37
37
 
38
- title_html = (attributes.has_key? 'title') ? %(<div class="carousel-title">#{attributes['title']}</div>\n) : nil
38
+ title_html = (attributes.has_key? 'title') ? %(<div class="carousel-title"> <i class="mdib mdib-view-carousel mdib-24px mr-2"></i> #{attributes['title']} </div>\n) : nil
39
+
39
40
  html = %(
40
41
  <div class="#{attributes['role']}">
41
42
  #{title_html}
@@ -47,7 +47,7 @@ Asciidoctor::Extensions.register do
47
47
  chars = [('a'..'z'), ('A'..'Z'), ('0'..'9')].map(&:to_a).flatten
48
48
  video_id = (0...11).map { chars[rand(chars.length)] }.join
49
49
 
50
- title_html = (attributes.has_key? 'title') ? %(<div class="video-title"> <i class="mdib mdib-youtube-tv mdib-24px mr-2"></i> #{attributes['title']} </div>\n) : nil
50
+ title_html = (attributes.has_key? 'title') ? %(<div class="video-title"> <i class="mdib mdib-video mdib-24px mr-2"></i> #{attributes['title']} </div>\n) : nil
51
51
  poster_image = (poster = attributes['poster']) ? %(#{poster}) : nil
52
52
  theme_name = (theme = attributes['theme']) ? %(#{theme}) : nil
53
53
  caption_enabled = (caption = attributes['caption']) ? true : false
@@ -121,6 +121,9 @@ Asciidoctor::Extensions.register do
121
121
  var vjs_player = document.getElementById("#{video_id}");
122
122
 
123
123
  vjs_player.addEventListener('click', function(event) {
124
+ event.preventDefault();
125
+ event.stopPropagation();
126
+
124
127
  var scrollOffset = (window.innerWidth >= 720) ? -130 : -110;
125
128
 
126
129
  // scroll player to top position
@@ -43,8 +43,8 @@ Asciidoctor::Extensions.register do
43
43
  html_block = Builder::XmlMarkup.new(:indent => 2)
44
44
  imagesdir = parent.attr 'imagesdir'
45
45
  images_hash = Hash[*attributes['image_data'].split(',')]
46
+ title_html = (attributes.has_key? 'title') ? %(<div class="lightbox-title"> <i class="mdib mdib-lightbulb-on mdib-24px mr-2"></i> #{attributes['title']} </div>\n) : nil
46
47
 
47
- title_html = (attributes.has_key? 'title') ? %(<div class="lightbox-title">#{attributes['title']}</div>\n) : nil
48
48
  role = (attributes.has_key? 'role') ? role : ''
49
49
  grouped = (attributes.has_key? 'group') ? true : false
50
50
 
@@ -37,7 +37,7 @@ Asciidoctor::Extensions.register do
37
37
 
38
38
  def process parent, target, attributes
39
39
 
40
- title_html = (attributes.has_key? 'title') ? %(<div class="carousel-title">#{attributes['title']}</div>\n) : nil
40
+ title_html = (attributes.has_key? 'title') ? %(<div class="carousel-title"> <i class="mdib mdib-view-carousel mdib-24px mr-2"></i> #{attributes['title']} </div>\n) : nil
41
41
  html = %(
42
42
  <div class="#{attributes['role']}">
43
43
  #{title_html}
@@ -38,7 +38,8 @@ Asciidoctor::Extensions.register do
38
38
 
39
39
  def process parent, target, attributes
40
40
 
41
- title_html = (attributes.has_key? 'title') ? %(<div class="carousel-title">#{attributes['title']}</div>\n) : nil
41
+ # title_html = (attributes.has_key? 'title') ? %(<div class="carousel-title">#{attributes['title']}</div>\n) : nil
42
+ title_html = (attributes.has_key? 'title') ? %(<div class="carousel-title"> <i class="mdib mdib-view-carousel mdib-24px mr-2"></i> #{attributes['title']} </div>\n) : nil
42
43
  html = %(
43
44
  <div class="#{attributes['role']}">
44
45
  #{title_html}
@@ -47,10 +47,30 @@ Asciidoctor::Extensions.register do
47
47
 
48
48
  def process parent, target, attributes
49
49
 
50
+ # ========================================================================
51
+ # load VideoJS configuration data (as NOT available in the website)
52
+ # ------------------------------------------------------------------------
53
+ #
54
+ current_path = File.expand_path(Dir.getwd)
55
+ default_config_path = File.join(current_path, '/_data/modules/defaults')
56
+ user_config_path = File.join(current_path, '/_data/modules')
57
+
58
+ videojs_config_file_name = 'videojs.yml'
59
+ videojs_default_config_file = File.join(default_config_path, videojs_config_file_name)
60
+ videojs_user_config_file = File.join(user_config_path, videojs_config_file_name)
61
+
62
+ videojsDefaultSettings = YAML::load(File.open(videojs_default_config_file))
63
+ videojsUserSettings = YAML::load(File.open(videojs_user_config_file))
64
+ videojsDefaultSettingsJson = videojsDefaultSettings.to_json;
65
+ videojsUserSettingsJson = videojsUserSettings.to_json;
66
+
67
+ # ========================================================================
68
+ # set plugin specific data
69
+ # ------------------------------------------------------------------------
50
70
  chars = [('a'..'z'), ('A'..'Z'), ('0'..'9')].map(&:to_a).flatten
51
71
  video_id = (0...11).map { chars[rand(chars.length)] }.join
52
72
 
53
- title_html = (attributes.has_key? 'title') ? %(<div class="video-title"> <i class="mdib mdib-youtube-tv mdib-24px mr-2"></i> #{attributes['title']} </div>\n) : nil
73
+ title_html = (attributes.has_key? 'title') ? %(<div class="video-title"> <i class="mdib mdib-video mdib-24px mr-2"></i> #{attributes['title']} </div>\n) : nil
54
74
  poster_image = (poster = attributes['poster']) ? %(#{poster}) : nil
55
75
  theme_name = (theme = attributes['theme']) ? %(#{theme}) : nil
56
76
  caption_enabled = (caption = attributes['caption']) ? true : false
@@ -74,6 +94,10 @@ Asciidoctor::Extensions.register do
74
94
  }],
75
95
  "controlBar": {
76
96
  "pictureInPictureToggle": false,
97
+ "skipButtons": {
98
+ "backward": 15,
99
+ "forward": 15
100
+ },
77
101
  "volumePanel": {
78
102
  "inline": false
79
103
  }
@@ -85,6 +109,36 @@ Asciidoctor::Extensions.register do
85
109
  <script>
86
110
  $(function() {
87
111
 
112
+ // =================================================================
113
+ // take over VideoJS configuration data (JSON data from Ruby)
114
+ // -----------------------------------------------------------------
115
+ var videojsDefaultConfigJson = '#{videojsDefaultSettingsJson}';
116
+ var videojsUserConfigJson = '#{videojsUserSettingsJson}';
117
+
118
+ // create config objects from JSON data
119
+ var videojsDefaultSettings = JSON.parse(videojsDefaultConfigJson);
120
+ var videojsUserSettings = JSON.parse(videojsUserConfigJson);
121
+
122
+ // merge config objects (jQuery)
123
+ var videojsConfig = $.extend(true, {}, videojsDefaultSettings.defaults, videojsUserSettings.settings);
124
+
125
+ // =================================================================
126
+ // VideoJS player settings
127
+ // -----------------------------------------------------------------
128
+ const vjsPlayerType = 'native';
129
+ const vjsPlaybackRates = videojsConfig.playbackRates.values;
130
+
131
+ // =================================================================
132
+ // VideoJS plugin settings
133
+ // -----------------------------------------------------------------
134
+ const piAutoCaption = videojsConfig.plugins.autoCaption;
135
+ const piHotKeys = videojsConfig.plugins.hotKeys;
136
+ const piSkipButtons = videojsConfig.plugins.skipButtons;
137
+ const piZoomButtons = videojsConfig.plugins.zoomButtons;
138
+
139
+ // =================================================================
140
+ // helper functions
141
+ // -----------------------------------------------------------------
88
142
  function addCaptionAfterImage(imageSrc) {
89
143
  const image = document.querySelector(`img[src="${imageSrc}"]`);
90
144
 
@@ -101,59 +155,126 @@ Asciidoctor::Extensions.register do
101
155
  }
102
156
  }
103
157
 
158
+ // =================================================================
159
+ // initialize the VideoJS player (on page ready)
160
+ // -----------------------------------------------------------------
104
161
  var dependencies_met_page_ready = setInterval (function (options) {
105
162
  var pageState = $('#content').css("display");
106
163
  var pageVisible = (pageState == 'block') ? true : false;
107
164
  var j1CoreFinished = (j1.getState() === 'finished') ? true : false;
108
165
 
109
166
  if (j1CoreFinished && pageVisible) {
167
+ var vjs_player = document.getElementById("#{video_id}");
168
+ var appliedOnce = false;
110
169
 
170
+ // add|skip captions (on poster image)
111
171
  if ('#{caption_enabled}' === 'true') {
112
172
  addCaptionAfterImage('#{poster_image}');
113
173
  }
114
174
 
115
- var appliedOnce = false;
175
+ // set VideoJS player settings
116
176
  videojs("#{video_id}").ready(function() {
117
- var videojsPlayer = this;
177
+ var vjsPlayer = this;
118
178
 
119
- // add playbackRates
120
- videojsPlayer.playbackRates([0.5, 1, 1.5, 2]);
179
+ // add|skip playbackRates
180
+ //
181
+ if (videojsConfig.playbackRates.enabled) {
182
+ vjsPlayer.playbackRates(vjsPlaybackRates);
183
+ }
121
184
 
122
- // add hotkeys plugin
123
- videojsPlayer.hotkeys({
124
- enableModifiersForNumbers: false
125
- });
185
+ // add|skip hotKeys plugin
186
+ //
187
+ if (piHotKeys.enabled) {
188
+ vjsPlayer.hotKeys({
189
+ volumeStep: piHotKeys.volumeStep,
190
+ seekStep: piHotKeys.seekStep,
191
+ enableMute: piHotKeys.enableMute,
192
+ enableFullscreen: piHotKeys.enableFullscreen,
193
+ enableNumbers: piHotKeys.enableNumbers,
194
+ enableVolumeScroll: piHotKeys.enableVolumeScroll,
195
+ enableHoverScroll: piHotKeys.enableHoverScroll,
196
+ alwaysCaptureHotkeys: piHotKeys.alwaysCaptureHotkeys,
197
+ captureDocumentHotkeys: piHotKeys.captureDocumentHotkeys,
198
+ documentHotkeysFocusElementFilter: e => e.tagName.toLowerCase() === "body",
126
199
 
127
- // add zoom plugin
128
- videojsPlayer.zoomPlugin({
129
- moveX: 0,
130
- moveY: 0,
131
- rotate: 0,
132
- zoom: 1
133
- });
200
+ // Mimic VLC seek behavior (default to: 15)
201
+ seekStep: function(e) {
202
+ if (e.ctrlKey && e.altKey) {
203
+ return 5*60;
204
+ } else if (e.ctrlKey) {
205
+ return 60;
206
+ } else if (e.altKey) {
207
+ return 10;
208
+ } else {
209
+ return 15;
210
+ }
211
+ },
134
212
 
135
- // set start position of current video
213
+ // Enhance existing simple hotkey by complex hotkeys
214
+ fullscreenKey: function(e) {
215
+ // fullscreen with the F key or Ctrl+Enter
216
+ return ((e.which === 70) || (e.ctrlKey && e.which === 13));
217
+ },
218
+
219
+ });
220
+ }
221
+
222
+ // add|skip skipButtons plugin
223
+ if (piSkipButtons.enabled) {
224
+ var backwardIndex = piSkipButtons.backward;
225
+ var forwardIndex = piSkipButtons.forwardIndex;
226
+
227
+ // property 'surroundPlayButton' takes precendence
228
+ //
229
+ if (piSkipButtons.surroundPlayButton) {
230
+ var backwardIndex = 0;
231
+ var forwardIndex = 1;
232
+ }
233
+
234
+ vjsPlayer.skipButtons({
235
+ backwardIndex: backwardIndex,
236
+ forwardIndex: forwardIndex,
237
+ backward: piSkipButtons.backward,
238
+ forward: piSkipButtons.forward,
239
+ });
240
+ }
241
+
242
+ // add|skip zoomButtons plugin
243
+ //
244
+ if (piZoomButtons.enabled && vjsPlayerType === 'native') {
245
+ vjsPlayer.zoomButtons({
246
+ moveX: piZoomButtons.moveX,
247
+ moveY: piZoomButtons.moveY,
248
+ rotate: piZoomButtons.rotate,
249
+ zoom: piZoomButtons.zoom
250
+ });
251
+ }
252
+
253
+ // set start position of current video (on play)
136
254
  // -----------------------------------------------------------
137
- videojsPlayer.on("play", function() {
255
+ vjsPlayer.on("play", function() {
138
256
  var startFromSecond = new Date('1970-01-01T' + "#{attributes['start']}" + 'Z').getTime() / 1000;
139
257
  if (!appliedOnce) {
140
- videojsPlayer.currentTime(startFromSecond);
258
+ vjsPlayer.currentTime(startFromSecond);
141
259
  appliedOnce = true;
142
260
  }
143
261
  });
262
+
144
263
  });
145
264
 
146
- // scroll to player top position
265
+ // scroll page to player top position
147
266
  // -------------------------------------------------------------
148
267
  var vjs_player = document.getElementById("#{video_id}");
149
268
 
150
269
  vjs_player.addEventListener('click', function(event) {
151
- var scrollOffset = (window.innerWidth >= 720) ? -130 : -110;
152
-
153
- // scroll player to top position
154
270
  const targetDiv = document.getElementById("#{video_id}");
155
- const targetDivPosition = targetDiv.offsetTop;
271
+ const targetDivPosition = targetDiv.offsetTop;
272
+ var scrollOffset = (window.innerWidth >= 720) ? -130 : -110;
273
+
274
+ // scroll page to the players top position
275
+ // -------------------------------------------------------------
156
276
  window.scrollTo(0, targetDivPosition + scrollOffset);
277
+
157
278
  }); // END EventListener 'click'
158
279
 
159
280
  clearInterval(dependencies_met_page_ready);
@@ -48,7 +48,7 @@ Asciidoctor::Extensions.register do
48
48
  chars = [('a'..'z'), ('A'..'Z'), ('0'..'9')].map(&:to_a).flatten
49
49
  video_id = (0...11).map {chars[rand(chars.length)]}.join
50
50
 
51
- title_html = (attributes.has_key? 'title') ? %(<div class="video-title"> <i class="mdib mdib-youtube-tv mdib-24px mr-2"></i> #{attributes['title']} </div>\n) : nil
51
+ title_html = (attributes.has_key? 'title') ? %(<div class="video-title"> <i class="mdib mdib-video mdib-24px mr-2"></i> #{attributes['title']} </div>\n) : nil
52
52
  poster_image = (poster = attributes['poster']) ? %(#{poster}) : nil
53
53
  theme_name = (theme = attributes['theme']) ? %(#{theme}) : nil
54
54
  caption_enabled = (caption = attributes['caption']) ? true : false
@@ -121,6 +121,9 @@ Asciidoctor::Extensions.register do
121
121
  var vjs_player = document.getElementById("#{video_id}");
122
122
 
123
123
  vjs_player.addEventListener('click', function(event) {
124
+ event.preventDefault();
125
+ event.stopPropagation();
126
+
124
127
  var scrollOffset = (window.innerWidth >= 720) ? -130 : -110;
125
128
 
126
129
  // scroll player to top position