j1-template 2024.3.22 → 2024.3.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. checksums.yaml +4 -4
  2. data/assets/data/{galeries.html → gallery_app.html} +4 -4
  3. data/assets/theme/bla +0 -0
  4. data/assets/theme/j1/adapter/js/amplitude.js +144 -52
  5. data/assets/theme/j1/adapter/js/gallery.js +1 -1
  6. data/assets/theme/j1/adapter/js/themes.js +41 -69
  7. data/assets/theme/j1/core/css/themes/unolight/bootstrap.css +19 -52
  8. data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
  9. data/assets/theme/j1/modules/amplitudejs/js/tech/ytp.js +466 -396
  10. data/assets/theme/j1/modules/lightGallery/!v2.7.2/css/lg-transitions.css +984 -0
  11. data/assets/theme/j1/modules/lightGallery/!v2.7.2/css/lg-transitions.min.css +26 -0
  12. data/assets/theme/j1/modules/lightGallery/!v2.7.2/css/lightgallery-bundle.css +1627 -0
  13. data/assets/theme/j1/modules/lightGallery/!v2.7.2/css/lightgallery-bundle.min.css +25 -0
  14. data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/uno.css +1 -1
  15. data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/uno.min.css +1 -1
  16. data/assets/theme/j1/modules/lightGallery/!v2.7.2/fonts/lg.svg +54 -0
  17. data/assets/theme/j1/modules/lightGallery/!v2.7.2/fonts/lg.ttf +0 -0
  18. data/assets/theme/j1/modules/lightGallery/!v2.7.2/fonts/lg.woff +0 -0
  19. data/assets/theme/j1/modules/lightGallery/!v2.7.2/fonts/lg.woff2 +0 -0
  20. data/assets/theme/j1/modules/lightGallery/!v2.7.2/images/loading.gif +0 -0
  21. data/assets/theme/j1/modules/lightGallery/!v2.7.2/img/loading.gif +0 -0
  22. data/assets/theme/j1/modules/lightGallery/!v2.7.2/img/video-play.png +0 -0
  23. data/assets/theme/j1/modules/lightGallery/!v2.7.2/img/vimeo-play.png +0 -0
  24. data/assets/theme/j1/modules/lightGallery/!v2.7.2/img/youtube-play.png +0 -0
  25. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/lightgallery.js +2782 -0
  26. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/lightgallery.min.js +26 -0
  27. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/parser/webvtt/LICENSE.md +44 -0
  28. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/parser/webvtt/README.md +37 -0
  29. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/parser/webvtt/parser.js +890 -0
  30. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/parser/webvtt/parser.min.js +8 -0
  31. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/j1/lg-video.1.js +585 -0
  32. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-autoplay.js +275 -0
  33. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-autoplay.min.js +26 -0
  34. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-comment.js +230 -0
  35. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-comment.min.js +26 -0
  36. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-fullscreen.js +160 -0
  37. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-fullscreen.min.js +26 -0
  38. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-hash.js +223 -0
  39. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-hash.min.js +27 -0
  40. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-medium-zoom.js +157 -0
  41. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-medium-zoom.min.js +26 -0
  42. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-pager.js +164 -0
  43. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-pager.min.js +26 -0
  44. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-rotate.js +299 -0
  45. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-rotate.min.js +26 -0
  46. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-share.js +244 -0
  47. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-share.min.js +27 -0
  48. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-thumbnail.js +509 -0
  49. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-thumbnail.min.js +26 -0
  50. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-video.js +909 -0
  51. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-video.min.js +26 -0
  52. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-vimeo-thumbnail.js +207 -0
  53. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-vimeo-thumbnail.min.js +26 -0
  54. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-zoom.js +999 -0
  55. data/assets/theme/j1/modules/lightGallery/!v2.7.2/js/plugins/lg-zoom.min.js +26 -0
  56. data/assets/theme/j1/modules/lightGallery/css/lg-transitions.css +3 -126
  57. data/assets/theme/j1/modules/lightGallery/css/lg-transitions.min.css +3 -10
  58. data/assets/theme/j1/modules/lightGallery/css/lightgallery-bundle.css +70 -237
  59. data/assets/theme/j1/modules/lightGallery/css/lightgallery-bundle.min.css +4 -10
  60. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/animation-w.png +0 -0
  61. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/customize-w.png +0 -0
  62. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/dynamic-w.png +0 -0
  63. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/facebook-icon.svg +10 -0
  64. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/googleplus-icon.svg +30 -0
  65. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/html5-w.png +0 -0
  66. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/linked-in.png +0 -0
  67. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/module-w.png +0 -0
  68. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/play-button-hover.svg +94 -0
  69. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/play-button.png +0 -0
  70. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/play-button.svg +93 -0
  71. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/responsive-w.png +0 -0
  72. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/thumb-w.png +0 -0
  73. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/touch-w.png +0 -0
  74. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/twitter-icon.svg +15 -0
  75. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/twitter.png +0 -0
  76. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/video1-w.png +0 -0
  77. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/zoom-w.png +0 -0
  78. data/assets/theme/j1/modules/lightGallery/css/theme/uno/icons/zoom.png +0 -0
  79. data/assets/theme/j1/modules/lightGallery/css/theme/uno/uno.css +276 -0
  80. data/assets/theme/j1/modules/lightGallery/css/theme/uno/uno.min.css +17 -0
  81. data/assets/theme/j1/modules/lightGallery/js/lightgallery.js +163 -120
  82. data/assets/theme/j1/modules/lightGallery/js/lightgallery.min.js +6 -6
  83. data/assets/theme/j1/modules/lightGallery/js/plugins/j1/lg-thumbnail.0.js +495 -0
  84. data/assets/theme/j1/modules/lightGallery/js/plugins/j1/lg-thumbnail.1.js +513 -0
  85. data/assets/theme/j1/modules/lightGallery/js/plugins/j1/lg-video.0.js +553 -0
  86. data/assets/theme/j1/modules/lightGallery/js/plugins/j1/lg-video.1.js +1 -1
  87. data/assets/theme/j1/modules/lightGallery/js/plugins/j1/lg-video.2.js +914 -0
  88. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-autoplay.js +4 -4
  89. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-autoplay.min.js +5 -5
  90. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-comment.js +5 -5
  91. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-comment.min.js +6 -6
  92. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-fullscreen.js +4 -4
  93. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-fullscreen.min.js +5 -5
  94. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-hash.js +4 -4
  95. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-hash.min.js +5 -6
  96. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-medium-zoom.js +5 -5
  97. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-medium-zoom.min.js +6 -6
  98. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-pager.js +4 -4
  99. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-pager.min.js +5 -5
  100. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-relative-caption.js +179 -0
  101. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-relative-caption.min.js +32 -0
  102. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-rotate.js +4 -4
  103. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-rotate.min.js +6 -6
  104. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-share.js +4 -4
  105. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-share.min.js +6 -7
  106. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-thumbnail.js +27 -20
  107. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-thumbnail.min.js +5 -5
  108. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +77 -125
  109. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.min.js +6 -6
  110. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-vimeo-thumbnail.js +4 -4
  111. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-vimeo-thumbnail.min.js +5 -5
  112. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-zoom.js +11 -5
  113. data/assets/theme/j1/modules/lightGallery/js/plugins/lg-zoom.min.js +5 -5
  114. data/assets/theme/j1/modules/themeSwitcher/js/switcher.js +13 -12
  115. data/assets/theme/j1/modules/videoPlayer/tiktoc/README.md +1 -0
  116. data/assets/theme/j1/modules/videojs/!v8.12.0/css/font/README.md +151 -0
  117. data/assets/theme/j1/modules/videojs/!v8.12.0/css/font/VideoJS.svg +150 -0
  118. data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/city.css +147 -0
  119. data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/city.min.css +5 -0
  120. data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/fantasy.css +113 -0
  121. data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/fantasy.min.css +5 -0
  122. data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/forest.css +166 -0
  123. data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/forest.min.css +5 -0
  124. data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/sea.css +72 -0
  125. data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/sea.min.css +5 -0
  126. data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/uno.css +311 -0
  127. data/assets/theme/j1/modules/videojs/!v8.12.0/css/themes/uno.min.css +19 -0
  128. data/assets/theme/j1/modules/videojs/!v8.12.0/css/videojs.css +1686 -0
  129. data/assets/theme/j1/modules/videojs/!v8.12.0/css/videojs.min.css +13 -0
  130. data/assets/theme/j1/modules/videojs/!v8.12.0/js/video.js +65226 -0
  131. data/assets/theme/j1/modules/videojs/!v8.12.0/js/video.min.js +55 -0
  132. data/assets/theme/j1/modules/videojs/assets/README.md +1 -0
  133. data/assets/theme/j1/modules/videojs/assets/icons/speedometer-medium.svg +35 -0
  134. data/assets/theme/j1/modules/videojs/css/font/VideoJS.ttf +0 -0
  135. data/assets/theme/j1/modules/videojs/css/font/VideoJS.woff +0 -0
  136. data/assets/theme/j1/modules/videojs/css/themes/uno.css +157 -22
  137. data/assets/theme/j1/modules/videojs/css/themes/uno.min.css +1 -1
  138. data/assets/theme/j1/modules/videojs/css/videojs.css +674 -316
  139. data/assets/theme/j1/modules/videojs/css/videojs.min.css +4 -3
  140. data/assets/theme/j1/modules/videojs/js/video.js +15893 -12288
  141. data/assets/theme/j1/modules/videojs/js/video.min.js +22 -23
  142. data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/!examples/index.html +31 -0
  143. data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/LICENSE +19 -0
  144. data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/README.md +69 -0
  145. data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/css/aspect-ratio-panel.css +2 -0
  146. data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/css/aspect-ratio-panel.min.css +2 -0
  147. data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/js/aspect-ratio-panel.js +339 -0
  148. data/assets/theme/j1/modules/videojs/plugins/controls/aspect-ratio-panel/js/aspect-ratio-panel.min.js +2 -0
  149. data/assets/theme/j1/modules/videojs/{js/plugins/controls/autocaption → plugins/controls/autocaption/js}/autocaption.js +0 -5
  150. data/assets/theme/j1/modules/videojs/plugins/controls/persist-settings/!examples/index.html +29 -0
  151. data/assets/theme/j1/modules/videojs/plugins/controls/persist-settings/LICENSE +19 -0
  152. data/assets/theme/j1/modules/videojs/plugins/controls/persist-settings/README.md +90 -0
  153. data/assets/theme/j1/modules/videojs/plugins/controls/persist-settings/js/videojs-persist.js +120 -0
  154. data/assets/theme/j1/modules/videojs/plugins/controls/persist-settings/js/videojs-persist.min.js +2 -0
  155. data/assets/theme/j1/modules/videojs/plugins/controls/playbackrate-adjuster/!examples/index.html +37 -0
  156. data/assets/theme/j1/modules/videojs/plugins/controls/playbackrate-adjuster/LICENSE +19 -0
  157. data/assets/theme/j1/modules/videojs/plugins/controls/playbackrate-adjuster/README.md +61 -0
  158. data/assets/theme/j1/modules/videojs/plugins/controls/playbackrate-adjuster/js/playbackrate-adjuster.js +94 -0
  159. data/assets/theme/j1/modules/videojs/plugins/controls/playbackrate-adjuster/js/playbackrate-adjuster.min.js +20 -0
  160. data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/skipbuttons/README.md +25 -11
  161. data/assets/theme/j1/modules/videojs/{css/plugins/controls → plugins/controls/zoom/css}/zoom.css +7 -6
  162. data/assets/theme/j1/modules/videojs/plugins/controls/zoom/css/zoom.min.css +22 -0
  163. data/assets/theme/j1/modules/videojs/{js/plugins/players/dm → plugins/players/dm/js}/dailymotion.js +1 -1
  164. data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.0.js +521 -0
  165. data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.1.js +605 -0
  166. data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.3.js +643 -0
  167. data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.4.js +583 -0
  168. data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.5.js +665 -0
  169. data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.6.js +642 -0
  170. data/assets/theme/j1/modules/videojs/plugins/players/vm/!unused/vimeo.7.js +673 -0
  171. data/assets/theme/j1/modules/videojs/{js/plugins/players/vm/api → plugins/players/vm/api/js}/vimeo.js +1 -1
  172. data/assets/theme/j1/modules/videojs/{js/plugins/players/vm/api → plugins/players/vm/api/js}/vimeo.min.js +1 -1
  173. data/assets/theme/j1/modules/videojs/{js/plugins/players/vm → plugins/players/vm/js}/vimeo.js +4 -5
  174. data/assets/theme/j1/modules/videojs/plugins/players/vm/js/vimeo.min.js +28 -0
  175. data/assets/theme/j1/modules/videojs/plugins/players/wt/!unused/wistia.0.js +395 -0
  176. data/assets/theme/j1/modules/videojs/plugins/players/wt/!unused/wistia.1.js +401 -0
  177. data/lib/j1/version.rb +1 -1
  178. data/lib/starter_web/README.md +5 -5
  179. data/lib/starter_web/_config.yml +1 -1
  180. data/lib/starter_web/_data/modules/amplitude_playlists.yml +16 -1
  181. data/lib/starter_web/_data/modules/defaults/gallery.yml +3 -3
  182. data/lib/starter_web/_data/modules/gallery.yml +83 -87
  183. data/lib/starter_web/_data/modules/navigator_menu.yml +3 -3
  184. data/lib/starter_web/_data/resources.yml +16 -12
  185. data/lib/starter_web/_data/templates/feed.xml +1 -1
  186. data/lib/starter_web/_plugins/asciidoctor/videojs-block.rb +50 -30
  187. data/lib/starter_web/_plugins/asciidoctor/youtube-block.rb +37 -23
  188. data/lib/starter_web/_plugins/index/lunr.rb +1 -1
  189. data/lib/starter_web/assets/video/poster/vimeo/fall_2011.jpg +0 -0
  190. data/lib/starter_web/package.json +1 -1
  191. data/lib/starter_web/pages/public/tools/tester/videojs_macro_tester.adoc +282 -0
  192. data/lib/starter_web/pages/public/tour/video_data.adoc +1 -0
  193. metadata +221 -106
  194. data/assets/data/swiper_app.2.html +0 -757
  195. data/assets/data/swiper_app.4.html +0 -769
  196. data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.0.css +0 -32
  197. data/assets/theme/j1/modules/videojs/css/plugins/controls/skipbuttons.1.css +0 -31
  198. data/assets/theme/j1/modules/videojs/css/plugins/controls/zoom.min.css +0 -21
  199. data/assets/theme/j1/modules/videojs/js/plugins/players/vm/vimeo.min.js +0 -16
  200. data/assets/theme/j1/modules/videojs/js/plugins/players/wt/api/src/WistiaPlayer.ts +0 -1617
  201. data/lib/starter_web/assets/video/poster/vimeo/stay_colorful.jpg +0 -0
  202. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/animation-w.png +0 -0
  203. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/customize-w.png +0 -0
  204. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/dynamic-w.png +0 -0
  205. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/facebook-icon.svg +0 -0
  206. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/googleplus-icon.svg +0 -0
  207. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/html5-w.png +0 -0
  208. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/linked-in.png +0 -0
  209. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/module-w.png +0 -0
  210. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/play-button-hover.svg +0 -0
  211. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/play-button.png +0 -0
  212. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/play-button.svg +0 -0
  213. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/responsive-w.png +0 -0
  214. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/thumb-w.png +0 -0
  215. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/touch-w.png +0 -0
  216. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/twitter-icon.svg +0 -0
  217. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/twitter.png +0 -0
  218. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/video1-w.png +0 -0
  219. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/zoom-w.png +0 -0
  220. /data/assets/theme/j1/modules/lightGallery/{css → !v2.7.2/css}/themes/uno/icons/zoom.png +0 -0
  221. /data/assets/theme/j1/modules/lightGallery/{js → !v2.7.2/js}/plugins/j1/j1-video.js +0 -0
  222. /data/assets/theme/j1/modules/lightGallery/{js → !v2.7.2/js}/plugins/j1/j1-video.min.js +0 -0
  223. /data/assets/theme/j1/modules/videoPlayer/dailymotion/js/{!readme → README.md} +0 -0
  224. /data/assets/theme/j1/modules/videoPlayer/tiktoc/{js/player.min.js → player.min.js} +0 -0
  225. /data/assets/theme/j1/modules/videoPlayer/vimeo/js/{!readme → README.md} +0 -0
  226. /data/assets/theme/j1/modules/videoPlayer/wistia/js/{!readme → README.md} +0 -0
  227. /data/assets/theme/j1/modules/videojs/{css → !v8.12.0/css}/font/video-js-cdn.css +0 -0
  228. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/autocaption/LICENSE +0 -0
  229. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/autocaption/README.md +0 -0
  230. /data/assets/theme/j1/modules/videojs/{js/plugins/controls/autocaption → plugins/controls/autocaption/js}/autocaption.min.js +0 -0
  231. /data/assets/theme/j1/modules/videojs/{js/plugins/controls/hotkeys/examples → plugins/controls/hotkeys/!examples}/example.html +0 -0
  232. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/hotkeys/LICENSE.md +0 -0
  233. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/hotkeys/README.md +0 -0
  234. /data/assets/theme/j1/modules/videojs/{js/plugins/controls/hotkeys → plugins/controls/hotkeys/js}/hotkeys.js +0 -0
  235. /data/assets/theme/j1/modules/videojs/{js/plugins/controls/hotkeys → plugins/controls/hotkeys/js}/hotkeys.min.js +0 -0
  236. /data/assets/theme/j1/modules/videojs/{css/plugins/controls → plugins/controls/skipbuttons/css}/skipbuttons.css +0 -0
  237. /data/assets/theme/j1/modules/videojs/{css/plugins/controls → plugins/controls/skipbuttons/css}/skipbuttons.min.css +0 -0
  238. /data/assets/theme/j1/modules/videojs/{js/plugins/controls/skipbuttons → plugins/controls/skipbuttons/js}/skipbuttons.js +0 -0
  239. /data/assets/theme/j1/modules/videojs/{js/plugins/controls/skipbuttons → plugins/controls/skipbuttons/js}/skipbuttons.min.js +0 -0
  240. /data/assets/theme/j1/modules/videojs/{js/plugins/controls/zoom/examples → plugins/controls/zoom/!examples}/index.html +0 -0
  241. /data/assets/theme/j1/modules/videojs/{js/plugins/controls/zoom/examples → plugins/controls/zoom/!examples}/index.js +0 -0
  242. /data/assets/theme/j1/modules/videojs/{js/plugins/controls/zoom/examples → plugins/controls/zoom/!examples}/styles.css +0 -0
  243. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/zoom/LICENSE.md +0 -0
  244. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/controls/zoom/README.md +0 -0
  245. /data/assets/theme/j1/modules/videojs/{js/plugins/controls/zoom → plugins/controls/zoom/js}/zoom.js +0 -0
  246. /data/assets/theme/j1/modules/videojs/{js/plugins/controls/zoom → plugins/controls/zoom/js}/zoom.min.js +0 -0
  247. /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/examples → plugins/players/dm/!examples}/dailymotion-controls.html +0 -0
  248. /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/examples → plugins/players/dm/!examples}/dailymotion-javascript.html +0 -0
  249. /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/examples → plugins/players/dm/!examples}/dailymotion-playlist.html +0 -0
  250. /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/examples → plugins/players/dm/!examples}/global-parameters.html +0 -0
  251. /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/examples → plugins/players/dm/!examples}/simple.html +0 -0
  252. /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/examples → plugins/players/dm/!examples}/switch.html +0 -0
  253. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/dm/LICENSE +0 -0
  254. /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/doc → plugins/players/dm}/README.md +0 -0
  255. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/dm/api/LICENSE +0 -0
  256. /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/api/doc → plugins/players/dm/api}/README.md +0 -0
  257. /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/api → plugins/players/dm/api/js}/dailymotion.sdk.js +0 -0
  258. /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm/api → plugins/players/dm/api/js}/dailymotion.sdk.min.js +0 -0
  259. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/dm/icon/scalable/dailymotion.svg +0 -0
  260. /data/assets/theme/j1/modules/videojs/{js/plugins/players/dm → plugins/players/dm/js}/dailymotion.min.js +0 -0
  261. /data/assets/theme/j1/modules/videojs/{js/plugins/players/vm/examples → plugins/players/vm/!examples}/index.html +0 -0
  262. /data/assets/theme/j1/modules/videojs/{js/plugins/players/vm/examples → plugins/players/vm/!examples}/player/index.html +0 -0
  263. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/vm/LICENSE +0 -0
  264. /data/assets/theme/j1/modules/videojs/{js/plugins/players/vm/doc → plugins/players/vm}/README.md +0 -0
  265. /data/assets/theme/j1/modules/videojs/{js/plugins/players/vm/api/doc → plugins/players/vm/api}/README.md +0 -0
  266. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/vm/api/css/embed.player.css +0 -0
  267. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/vm/api/css/embed.player.uno.css +0 -0
  268. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/vm/api/css/player.css +0 -0
  269. /data/assets/theme/j1/modules/videojs/{js/plugins/players/wt/doc → plugins/players/wt}/README.md +0 -0
  270. /data/assets/theme/j1/modules/videojs/{js/plugins/players/wt/api/doc/Readme.txt → plugins/players/wt/api/README.md} +0 -0
  271. /data/assets/theme/j1/modules/videojs/{js/plugins/players/wt/api → plugins/players/wt/api/js}/wistia.min.js +0 -0
  272. /data/assets/theme/j1/modules/videojs/{js/plugins/players/wt → plugins/players/wt/js}/wistia.js +0 -0
  273. /data/assets/theme/j1/modules/videojs/{js/plugins/players/wt → plugins/players/wt/js}/wistia.min.js +0 -0
  274. /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/global-parameters.html +0 -0
  275. /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/simple.html +0 -0
  276. /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/switch.html +0 -0
  277. /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/youtube-controls.html +0 -0
  278. /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/youtube-javascript.html +0 -0
  279. /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/youtube-list.html +0 -0
  280. /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/examples → plugins/players/yt/!examples}/youtube-playlist.html +0 -0
  281. /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/v3.0.0 → plugins/players/yt/!v3.0.0}/youtube.js +0 -0
  282. /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/v3.0.0 → plugins/players/yt/!v3.0.0}/youtube.min.js +0 -0
  283. /data/assets/theme/j1/modules/videojs/{js/plugins → plugins}/players/yt/LICENSE +0 -0
  284. /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/doc → plugins/players/yt}/README.md +0 -0
  285. /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt/api → plugins/players/yt/api/js}/youtube.min.js +0 -0
  286. /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt → plugins/players/yt/js}/youtube.js +0 -0
  287. /data/assets/theme/j1/modules/videojs/{js/plugins/players/yt → plugins/players/yt/js}/youtube.min.js +0 -0
@@ -0,0 +1,890 @@
1
+ // https://github.com/w3c/webvtt.js
2
+ //
3
+ // Any copyright is dedicated to the Public Domain.
4
+ // http://creativecommons.org/publicdomain/zero/1.0/
5
+
6
+ // Not intended to be fast, but if you can make it faster, please help out!
7
+
8
+ (function () {
9
+ var defaultCueSettings = {
10
+ direction:"horizontal",
11
+ snapToLines:true,
12
+ linePosition:"auto",
13
+ lineAlign:"start",
14
+ textPosition:"auto",
15
+ positionAlign:"auto",
16
+ size:100,
17
+ alignment:"center",
18
+ };
19
+
20
+ var WebVTTParser = function(entities) {
21
+ if (!entities) {
22
+ entities = {
23
+ "&amp": "&",
24
+ "&lt": "<",
25
+ "&gt": ">",
26
+ "&lrm": "\u200e",
27
+ "&rlm": "\u200f",
28
+ "&nbsp": "\u00A0"
29
+ }
30
+ }
31
+ this.entities = entities
32
+ this.parse = function(input, mode) {
33
+ // global search and replace for \0
34
+ input = input.replace(/\0/g, '\uFFFD');
35
+ var NEWLINE = /\r\n|\r|\n/,
36
+ startTime = Date.now(),
37
+ linePos = 0,
38
+ lines = input.split(NEWLINE),
39
+ alreadyCollected = false,
40
+ styles = [],
41
+ cues = [],
42
+ errors = []
43
+ function err(message, col) {
44
+ errors.push({message:message, line:linePos+1, col:col})
45
+ }
46
+
47
+ var line = lines[linePos],
48
+ lineLength = line.length,
49
+ signature = "WEBVTT",
50
+ bom = 0,
51
+ signature_length = signature.length
52
+
53
+ /* Byte order mark */
54
+ if (line[0] === "\ufeff") {
55
+ bom = 1
56
+ signature_length += 1
57
+ }
58
+ /* SIGNATURE */
59
+ if (
60
+ lineLength < signature_length ||
61
+ line.indexOf(signature) !== 0+bom ||
62
+ lineLength > signature_length &&
63
+ line[signature_length] !== " " &&
64
+ line[signature_length] !== "\t"
65
+ ) {
66
+ err("No valid signature. (File needs to start with \"WEBVTT\".)")
67
+ }
68
+
69
+ linePos++
70
+
71
+ /* HEADER */
72
+ while(lines[linePos] != "" && lines[linePos] != undefined) {
73
+ err("No blank line after the signature.")
74
+ if(lines[linePos].indexOf("-->") != -1) {
75
+ alreadyCollected = true
76
+ break
77
+ }
78
+ linePos++
79
+ }
80
+
81
+ /* CUE LOOP */
82
+ while(lines[linePos] != undefined) {
83
+ var cue
84
+ while(!alreadyCollected && lines[linePos] == "") {
85
+ linePos++
86
+ }
87
+ if(!alreadyCollected && lines[linePos] == undefined)
88
+ break
89
+
90
+ /* CUE CREATION */
91
+ cue = Object.assign({}, defaultCueSettings, {
92
+ id:"",
93
+ startTime:0,
94
+ endTime:0,
95
+ pauseOnExit:false,
96
+ direction:"horizontal",
97
+ snapToLines:true,
98
+ linePosition:"auto",
99
+ lineAlign:"start",
100
+ textPosition:"auto",
101
+ positionAlign:"auto",
102
+ size:100,
103
+ alignment:"center",
104
+ text:"",
105
+ tree:null
106
+ })
107
+
108
+ var parseTimings = true
109
+
110
+ if(lines[linePos].indexOf("-->") == -1) {
111
+ cue.id = lines[linePos]
112
+
113
+ /* COMMENTS
114
+ Not part of the specification's parser as these would just be ignored. However,
115
+ we want them to be conforming and not get "Cue identifier cannot be standalone".
116
+ */
117
+ if(/^NOTE($|[ \t])/.test(cue.id)) { // .startsWith fails in Chrome
118
+ linePos++
119
+ while(lines[linePos] != "" && lines[linePos] != undefined) {
120
+ if(lines[linePos].indexOf("-->") != -1)
121
+ err("Cannot have timestamp in a comment.")
122
+ linePos++
123
+ }
124
+ continue
125
+ }
126
+
127
+ /* STYLES */
128
+ if(/^STYLE($|[ \t])/.test(cue.id)) {
129
+ var style = []
130
+ var invalid = false
131
+ linePos++
132
+ while(lines[linePos] != "" && lines[linePos] != undefined) {
133
+ if(lines[linePos].indexOf("-->") != -1) {
134
+ err("Cannot have timestamp in a style block.")
135
+ invalid = true
136
+ }
137
+ style.push(lines[linePos])
138
+ linePos++
139
+ }
140
+ if(cues.length) {
141
+ err("Style blocks cannot appear after the first cue.")
142
+ continue
143
+ }
144
+ if (!invalid) {
145
+ styles.push(style.join('\n'))
146
+ }
147
+ continue
148
+ }
149
+
150
+ linePos++
151
+
152
+ if(lines[linePos] == "" || lines[linePos] == undefined) {
153
+ err("Cue identifier cannot be standalone.")
154
+ continue
155
+ }
156
+
157
+ if(lines[linePos].indexOf("-->") == -1) {
158
+ parseTimings = false
159
+ err("Cue identifier needs to be followed by timestamp.")
160
+ continue
161
+ }
162
+ }
163
+
164
+ /* TIMINGS */
165
+ alreadyCollected = false
166
+ var timings = new WebVTTCueTimingsAndSettingsParser(lines[linePos], err)
167
+ var previousCueStart = 0
168
+ if(cues.length > 0) {
169
+ previousCueStart = cues[cues.length-1].startTime
170
+ }
171
+ if(parseTimings && !timings.parse(cue, previousCueStart)) {
172
+ /* BAD CUE */
173
+
174
+ cue = null
175
+ linePos++
176
+
177
+ /* BAD CUE LOOP */
178
+ while(lines[linePos] != "" && lines[linePos] != undefined) {
179
+ if(lines[linePos].indexOf("-->") != -1) {
180
+ alreadyCollected = true
181
+ break
182
+ }
183
+ linePos++
184
+ }
185
+ continue
186
+ }
187
+ linePos++
188
+
189
+ /* CUE TEXT LOOP */
190
+ while(lines[linePos] != "" && lines[linePos] != undefined) {
191
+ if(lines[linePos].indexOf("-->") != -1) {
192
+ err("Blank line missing before cue.")
193
+ alreadyCollected = true
194
+ break
195
+ }
196
+ if(cue.text != "")
197
+ cue.text += "\n"
198
+ cue.text += lines[linePos]
199
+ linePos++
200
+ }
201
+
202
+ /* CUE TEXT PROCESSING */
203
+ var cuetextparser = new WebVTTCueTextParser(cue.text, err, mode, entities)
204
+ cue.tree = cuetextparser.parse(cue.startTime, cue.endTime)
205
+ cues.push(cue)
206
+ }
207
+ cues.sort(function(a, b) {
208
+ if (a.startTime < b.startTime)
209
+ return -1
210
+ if (a.startTime > b.startTime)
211
+ return 1
212
+ if (a.endTime > b.endTime)
213
+ return -1
214
+ if (a.endTime < b.endTime)
215
+ return 1
216
+ return 0
217
+ })
218
+ /* END */
219
+ return {cues:cues, errors:errors, time:Date.now()-startTime, styles: styles}
220
+ }
221
+ }
222
+
223
+ var WebVTTCueTimingsAndSettingsParser = function(line, errorHandler) {
224
+ var SPACE = /[\u0020\t\f]/,
225
+ NOSPACE = /[^\u0020\t\f]/,
226
+ line = line,
227
+ pos = 0,
228
+ err = function(message) {
229
+ errorHandler(message, pos+1)
230
+ },
231
+ spaceBeforeSetting = true
232
+ function skip(pattern) {
233
+ while(
234
+ line[pos] != undefined &&
235
+ pattern.test(line[pos])
236
+ ) {
237
+ pos++
238
+ }
239
+ }
240
+ function collect(pattern) {
241
+ var str = ""
242
+ while(
243
+ line[pos] != undefined &&
244
+ pattern.test(line[pos])
245
+ ) {
246
+ str += line[pos]
247
+ pos++
248
+ }
249
+ return str
250
+ }
251
+ /* http://dev.w3.org/html5/webvtt/#collect-a-webvtt-timestamp */
252
+ function timestamp() {
253
+ var units = "minutes",
254
+ val1,
255
+ val2,
256
+ val3,
257
+ val4
258
+ // 3
259
+ if(line[pos] == undefined) {
260
+ err("No timestamp found.")
261
+ return
262
+ }
263
+ // 4
264
+ if(!/\d/.test(line[pos])) {
265
+ err("Timestamp must start with a character in the range 0-9.")
266
+ return
267
+ }
268
+ // 5-7
269
+ val1 = collect(/\d/)
270
+ if(val1.length > 2 || parseInt(val1, 10) > 59) {
271
+ units = "hours"
272
+ }
273
+ // 8
274
+ if(line[pos] != ":") {
275
+ err("No time unit separator found.")
276
+ return
277
+ }
278
+ pos++
279
+ // 9-11
280
+ val2 = collect(/\d/)
281
+ if(val2.length != 2) {
282
+ err("Must be exactly two digits.")
283
+ return
284
+ }
285
+ // 12
286
+ if(units == "hours" || line[pos] == ":") {
287
+ if(line[pos] != ":") {
288
+ err("No seconds found or minutes is greater than 59.")
289
+ return
290
+ }
291
+ pos++
292
+ val3 = collect(/\d/)
293
+ if(val3.length != 2) {
294
+ err("Must be exactly two digits.")
295
+ return
296
+ }
297
+ } else {
298
+ if (val1.length != 2) {
299
+ err("Must be exactly two digits.")
300
+ return
301
+ }
302
+ val3 = val2
303
+ val2 = val1
304
+ val1 = "0"
305
+ }
306
+ // 13
307
+ if(line[pos] != ".") {
308
+ err("No decimal separator (\".\") found.")
309
+ return
310
+ }
311
+ pos++
312
+ // 14-16
313
+ val4 = collect(/\d/)
314
+ if(val4.length != 3) {
315
+ err("Milliseconds must be given in three digits.")
316
+ return
317
+ }
318
+ // 17
319
+ if(parseInt(val2, 10) > 59) {
320
+ err("You cannot have more than 59 minutes.")
321
+ return
322
+ }
323
+ if(parseInt(val3, 10) > 59) {
324
+ err("You cannot have more than 59 seconds.")
325
+ return
326
+ }
327
+ return parseInt(val1, 10) * 60 * 60 + parseInt(val2, 10) * 60 + parseInt(val3, 10) + parseInt(val4, 10) / 1000
328
+ }
329
+
330
+ /* http://dev.w3.org/html5/webvtt/#parse-the-webvtt-settings */
331
+ function parseSettings(input, cue) {
332
+ var settings = input.split(SPACE),
333
+ seen = []
334
+ for(var i=0; i < settings.length; i++) {
335
+ if(settings[i] == "")
336
+ continue
337
+
338
+ var index = settings[i].indexOf(':'),
339
+ setting = settings[i].slice(0, index),
340
+ value = settings[i].slice(index + 1)
341
+
342
+ if(seen.indexOf(setting) != -1) {
343
+ err("Duplicate setting.")
344
+ }
345
+ seen.push(setting)
346
+
347
+ if(value == "") {
348
+ err("No value for setting defined.")
349
+ return
350
+ }
351
+
352
+ if(setting == "vertical") { // writing direction
353
+ if(value != "rl" && value != "lr") {
354
+ err("Writing direction can only be set to 'rl' or 'rl'.")
355
+ continue
356
+ }
357
+ cue.direction = value
358
+ } else if(setting == "line") { // line position and optionally line alignment
359
+ if (/,/.test(value)) {
360
+ var comp = value.split(',')
361
+ value = comp[0]
362
+ var lineAlign = comp[1]
363
+ }
364
+ if(!/^[-\d](\d*)(\.\d+)?%?$/.test(value)) {
365
+ err("Line position takes a number or percentage.")
366
+ continue
367
+ }
368
+ if(value.indexOf("-", 1) != -1) {
369
+ err("Line position can only have '-' at the start.")
370
+ continue
371
+ }
372
+ if(value.indexOf("%") != -1 && value.indexOf("%") != value.length-1) {
373
+ err("Line position can only have '%' at the end.")
374
+ continue
375
+ }
376
+ if(value[0] == "-" && value[value.length-1] == "%") {
377
+ err("Line position cannot be a negative percentage.")
378
+ continue
379
+ }
380
+ var numVal = value;
381
+ var isPercent = false;
382
+ if(value[value.length-1] == "%") {
383
+ isPercent = true;
384
+ numVal = value.slice(0, value.length-1)
385
+ if(parseInt(value, 10) > 100) {
386
+ err("Line position cannot be >100%.")
387
+ continue
388
+ }
389
+ }
390
+ if (numVal === '' || isNaN(numVal) || !isFinite(numVal)) {
391
+ err("Line position needs to be a number")
392
+ continue
393
+ }
394
+ if (lineAlign !== undefined) {
395
+ if (!["start", "center", "end"].includes(lineAlign)) {
396
+ err("Line alignment needs to be one of start, center or end")
397
+ continue
398
+ }
399
+ cue.lineAlign = lineAlign
400
+ }
401
+ cue.snapToLines = !isPercent;
402
+ cue.linePosition = parseFloat(numVal)
403
+ if (parseFloat(numVal).toString() !== numVal) {
404
+ cue.nonSerializable = true;
405
+ }
406
+ } else if(setting == "position") { // text position and optional positionAlign
407
+ if (/,/.test(value)) {
408
+ var comp = value.split(',')
409
+ value = comp[0]
410
+ var positionAlign = comp[1]
411
+ }
412
+ if(value[value.length-1] != "%") {
413
+ err("Text position must be a percentage.")
414
+ continue
415
+ }
416
+ if(parseInt(value, 10) > 100 || parseInt(value, 10) < 0) {
417
+ err("Text position needs to be between 0 and 100%.")
418
+ continue
419
+ }
420
+ numVal = value.slice(0, value.length-1)
421
+ if (numVal === '' || isNaN(numVal) || !isFinite(numVal)) {
422
+ err("Line position needs to be a number")
423
+ continue
424
+ }
425
+ if (positionAlign !== undefined) {
426
+ if (!["line-left", "center", "line-right"].includes(positionAlign)) {
427
+ err("Position alignment needs to be one of line-left, center or line-right")
428
+ continue
429
+ }
430
+ cue.positionAlign = positionAlign
431
+ }
432
+ cue.textPosition = parseFloat(numVal)
433
+ } else if(setting == "size") { // size
434
+ if(value[value.length-1] != "%") {
435
+ err("Size must be a percentage.")
436
+ continue
437
+ }
438
+ if(parseInt(value, 10) > 100) {
439
+ err("Size cannot be >100%.")
440
+ continue
441
+ }
442
+ var size = value.slice(0, value.length -1)
443
+ if (size === undefined || size === "" || isNaN(size)) {
444
+ err("Size needs to be a number")
445
+ size = 100
446
+ continue
447
+ } else {
448
+ size = parseFloat(size)
449
+ if (size < 0 || size > 100) {
450
+ err("Size needs to be between 0 and 100%.")
451
+ continue;
452
+ }
453
+ }
454
+ cue.size = size
455
+ } else if(setting == "align") { // alignment
456
+ var alignValues = ["start", "center", "end", "left", "right"]
457
+ if(alignValues.indexOf(value) == -1) {
458
+ err("Alignment can only be set to one of " + alignValues.join(", ") + ".")
459
+ continue
460
+ }
461
+ cue.alignment = value
462
+ } else {
463
+ err("Invalid setting.")
464
+ }
465
+ }
466
+ }
467
+
468
+ this.parse = function(cue, previousCueStart) {
469
+ skip(SPACE)
470
+ cue.startTime = timestamp()
471
+ if(cue.startTime == undefined) {
472
+ return
473
+ }
474
+ if(cue.startTime < previousCueStart) {
475
+ err("Start timestamp is not greater than or equal to start timestamp of previous cue.")
476
+ }
477
+ if(NOSPACE.test(line[pos])) {
478
+ err("Timestamp not separated from '-->' by whitespace.")
479
+ }
480
+ skip(SPACE)
481
+ // 6-8
482
+ if(line[pos] != "-") {
483
+ err("No valid timestamp separator found.")
484
+ return
485
+ }
486
+ pos++
487
+ if(line[pos] != "-") {
488
+ err("No valid timestamp separator found.")
489
+ return
490
+ }
491
+ pos++
492
+ if(line[pos] != ">") {
493
+ err("No valid timestamp separator found.")
494
+ return
495
+ }
496
+ pos++
497
+ if(NOSPACE.test(line[pos])) {
498
+ err("'-->' not separated from timestamp by whitespace.")
499
+ }
500
+ skip(SPACE)
501
+ cue.endTime = timestamp()
502
+ if(cue.endTime == undefined) {
503
+ return
504
+ }
505
+ if(cue.endTime <= cue.startTime) {
506
+ err("End timestamp is not greater than start timestamp.")
507
+ }
508
+
509
+ if(NOSPACE.test(line[pos])) {
510
+ spaceBeforeSetting = false
511
+ }
512
+ skip(SPACE)
513
+ parseSettings(line.substring(pos), cue)
514
+ return true
515
+ }
516
+ this.parseTimestamp = function() {
517
+ var ts = timestamp()
518
+ if(line[pos] != undefined) {
519
+ err("Timestamp must not have trailing characters.")
520
+ return
521
+ }
522
+ return ts
523
+ }
524
+ }
525
+
526
+ var WebVTTCueTextParser = function(line, errorHandler, mode, entities) {
527
+ this.entities = entities
528
+ var self = this
529
+ var line = line,
530
+ pos = 0,
531
+ err = function(message) {
532
+ if(mode == "metadata")
533
+ return
534
+ errorHandler(message, pos+1)
535
+ }
536
+
537
+ this.parse = function(cueStart, cueEnd) {
538
+ function removeCycles(tree) {
539
+ const cyclelessTree = {...tree};
540
+ if (tree.children) {
541
+ cyclelessTree.children = tree.children.map(removeCycles);
542
+ }
543
+ if (cyclelessTree.parent) {
544
+ delete cyclelessTree.parent;
545
+ }
546
+ return cyclelessTree;
547
+ }
548
+
549
+ var result = {children:[]},
550
+ current = result,
551
+ timestamps = []
552
+
553
+ function attach(token) {
554
+ current.children.push({type:"object", name:token[1], classes:token[2], children:[], parent:current})
555
+ current = current.children[current.children.length-1]
556
+ }
557
+ function inScope(name) {
558
+ var node = current
559
+ while(node) {
560
+ if(node.name == name)
561
+ return true
562
+ node = node.parent
563
+ }
564
+ return
565
+ }
566
+
567
+ while(line[pos] != undefined) {
568
+ var token = nextToken()
569
+ if(token[0] == "text") {
570
+ current.children.push({type:"text", value:token[1], parent:current})
571
+ } else if(token[0] == "start tag") {
572
+ if(mode == "chapters")
573
+ err("Start tags not allowed in chapter title text.")
574
+ var name = token[1]
575
+ if(name != "v" && name != "lang" && token[3] != "") {
576
+ err("Only <v> and <lang> can have an annotation.")
577
+ }
578
+ if(
579
+ name == "c" ||
580
+ name == "i" ||
581
+ name == "b" ||
582
+ name == "u" ||
583
+ name == "ruby"
584
+ ) {
585
+ attach(token)
586
+ } else if(name == "rt" && current.name == "ruby") {
587
+ attach(token)
588
+ } else if(name == "v") {
589
+ if(inScope("v")) {
590
+ err("<v> cannot be nested inside itself.")
591
+ }
592
+ attach(token)
593
+ current.value = token[3] // annotation
594
+ if(!token[3]) {
595
+ err("<v> requires an annotation.")
596
+ }
597
+ } else if(name == "lang") {
598
+ attach(token)
599
+ current.value = token[3] // language
600
+ } else {
601
+ err("Incorrect start tag.")
602
+ }
603
+ } else if(token[0] == "end tag") {
604
+ if(mode == "chapters")
605
+ err("End tags not allowed in chapter title text.")
606
+ // XXX check <ruby> content
607
+ if(token[1] == current.name) {
608
+ current = current.parent
609
+ } else if(token[1] == "ruby" && current.name == "rt") {
610
+ current = current.parent.parent
611
+ } else {
612
+ err("Incorrect end tag.")
613
+ }
614
+ } else if(token[0] == "timestamp") {
615
+ if(mode == "chapters")
616
+ err("Timestamp not allowed in chapter title text.")
617
+ var timings = new WebVTTCueTimingsAndSettingsParser(token[1], err),
618
+ timestamp = timings.parseTimestamp()
619
+ if(timestamp != undefined) {
620
+ if(timestamp <= cueStart || timestamp >= cueEnd) {
621
+ err("Timestamp must be between start timestamp and end timestamp.")
622
+ }
623
+ if(timestamps.length > 0 && timestamps[timestamps.length-1] >= timestamp) {
624
+ err("Timestamp must be greater than any previous timestamp.")
625
+ }
626
+ current.children.push({type:"timestamp", value:timestamp, parent:current})
627
+ timestamps.push(timestamp)
628
+ }
629
+ }
630
+ }
631
+ while(current.parent) {
632
+ if(current.name != "v") {
633
+ err("Required end tag missing.")
634
+ }
635
+ current = current.parent
636
+ }
637
+ return removeCycles(result)
638
+ }
639
+
640
+ function nextToken() {
641
+ var state = "data",
642
+ result = "",
643
+ buffer = "",
644
+ classes = []
645
+ while(line[pos-1] != undefined || pos == 0) {
646
+ var c = line[pos]
647
+ if(state == "data") {
648
+ if(c == "&") {
649
+ buffer = c
650
+ state = "escape"
651
+ } else if(c == "<" && result == "") {
652
+ state = "tag"
653
+ } else if(c == "<" || c == undefined) {
654
+ return ["text", result]
655
+ } else {
656
+ result += c
657
+ }
658
+ } else if(state == "escape") {
659
+ if(c == "<" || c == undefined) {
660
+ err("Incorrect escape.")
661
+ let m;
662
+ if (m = buffer.match(/^&#([0-9]+)$/)) {
663
+ result += String.fromCharCode(m[1])
664
+ } else {
665
+ if(self.entities[buffer]) {
666
+ result += self.entities[buffer]
667
+ } else {
668
+ result += buffer
669
+ }
670
+ }
671
+ return ["text", result]
672
+ } else if(c == "&") {
673
+ err("Incorrect escape.")
674
+ result += buffer
675
+ buffer = c
676
+ } else if(/[a-z#0-9]/i.test(c)) {
677
+ buffer += c
678
+ } else if(c == ";") {
679
+ let m;
680
+ if (m = buffer.match(/^&#(x?[0-9]+)$/)) {
681
+ // we prepend "0" so that x20 be interpreted as hexadecim (0x20)
682
+ result += String.fromCharCode("0" + m[1])
683
+ } else if(self.entities[buffer + c]) {
684
+ result += self.entities[buffer + c]
685
+ } else if (m = Object.keys(entities).find(n => buffer.startsWith(n))) { // partial match
686
+ result += self.entities[m] + buffer.slice(m.length) + c
687
+ } else {
688
+ err("Incorrect escape.")
689
+ result += buffer + ";"
690
+ }
691
+ state = "data"
692
+ } else {
693
+ err("Incorrect escape.")
694
+ result += buffer + c
695
+ state = "data"
696
+ }
697
+ } else if(state == "tag") {
698
+ if(c == "\t" || c == "\n" || c == "\f" || c == " ") {
699
+ state = "start tag annotation"
700
+ } else if(c == ".") {
701
+ state = "start tag class"
702
+ } else if(c == "/") {
703
+ state = "end tag"
704
+ } else if(/\d/.test(c)) {
705
+ result = c
706
+ state = "timestamp tag"
707
+ } else if(c == ">" || c == undefined) {
708
+ if(c == ">") {
709
+ pos++
710
+ }
711
+ return ["start tag", "", [], ""]
712
+ } else {
713
+ result = c
714
+ state = "start tag"
715
+ }
716
+ } else if(state == "start tag") {
717
+ if(c == "\t" || c == "\f" || c == " ") {
718
+ state = "start tag annotation"
719
+ } else if(c == "\n") {
720
+ buffer = c
721
+ state = "start tag annotation"
722
+ } else if(c == ".") {
723
+ state = "start tag class"
724
+ } else if(c == ">" || c == undefined) {
725
+ if(c == ">") {
726
+ pos++
727
+ }
728
+ return ["start tag", result, [], ""]
729
+ } else {
730
+ result += c
731
+ }
732
+ } else if(state == "start tag class") {
733
+ if(c == "\t" || c == "\f" || c == " ") {
734
+ if (buffer) {
735
+ classes.push(buffer)
736
+ }
737
+ buffer = ""
738
+ state = "start tag annotation"
739
+ } else if(c == "\n") {
740
+ if (buffer) {
741
+ classes.push(buffer)
742
+ }
743
+ buffer = c
744
+ state = "start tag annotation"
745
+ } else if(c == ".") {
746
+ if (buffer) {
747
+ classes.push(buffer)
748
+ }
749
+ buffer = ""
750
+ } else if(c == ">" || c == undefined) {
751
+ if(c == ">") {
752
+ pos++
753
+ }
754
+ if (buffer) {
755
+ classes.push(buffer)
756
+ }
757
+ return ["start tag", result, classes, ""]
758
+ } else {
759
+ buffer += c
760
+ }
761
+ } else if(state == "start tag annotation") {
762
+ if(c == ">" || c == undefined) {
763
+ if(c == ">") {
764
+ pos++
765
+ }
766
+ buffer = buffer.split(/[\u0020\t\f\r\n]+/).filter(function(item) { if(item) return true }).join(" ")
767
+ return ["start tag", result, classes, buffer]
768
+ } else {
769
+ buffer +=c
770
+ }
771
+ } else if(state == "end tag") {
772
+ if(c == ">" || c == undefined) {
773
+ if(c == ">") {
774
+ pos++
775
+ }
776
+ return ["end tag", result]
777
+ } else {
778
+ result += c
779
+ }
780
+ } else if(state == "timestamp tag") {
781
+ if(c == ">" || c == undefined) {
782
+ if(c == ">") {
783
+ pos++
784
+ }
785
+ return ["timestamp", result]
786
+ } else {
787
+ result += c
788
+ }
789
+ } else {
790
+ err("Never happens.") // The joke is it might.
791
+ }
792
+ // 8
793
+ pos++
794
+ }
795
+ }
796
+ }
797
+
798
+ var WebVTTSerializer = function() {
799
+ function serializeTimestamp(seconds) {
800
+ const ms = ("00" + (seconds - Math.floor(seconds)).toFixed(3)*1000).slice(-3);
801
+ let h = 0, m = 0, s = 0;
802
+ if (seconds >= 3600) {
803
+ h = Math.floor(seconds/3600);
804
+ }
805
+ m = Math.floor((seconds - 3600*h) / 60);
806
+ s = Math.floor(seconds - 3600*h - 60*m);
807
+ return (h ? h + ":" : "") + ("" + m).padStart(2, "0") + ":" + ("" + s).padStart(2, "0") + "." + ms;
808
+ }
809
+ function serializeCueSettings(cue) {
810
+ var result = ""
811
+ const nonDefaultSettings = Object.keys(defaultCueSettings).filter(s => cue[s] !== defaultCueSettings[s]);
812
+ if (nonDefaultSettings.includes("direction")) {
813
+ result+= " vertical:" + cue.direction
814
+ }
815
+ if (nonDefaultSettings.includes("alignment")) {
816
+ result+= " align:" + cue.alignment
817
+ }
818
+ if (nonDefaultSettings.includes("size")) {
819
+ result+= " size:" + cue.size + "%"
820
+ }
821
+ if (nonDefaultSettings.includes("lineAlign") || nonDefaultSettings.includes("linePosition")) {
822
+ result += " line:" + cue.linePosition + (cue.snapToLines ? "" : "%") + (cue.lineAlign && cue.lineAlign != defaultCueSettings.lineAlign ? "," + cue.lineAlign : "")
823
+ }
824
+ if (nonDefaultSettings.includes("textPosition") || nonDefaultSettings.includes("positionAlign")) {
825
+ result += " position:" + cue.textPosition + "%" + (cue.positionAlign && cue.positionAlign !== defaultCueSettings.positionAlign ? "," + cue.positionAlign : "")
826
+ }
827
+ return result
828
+ }
829
+ function serializeTree(tree) {
830
+ var result = ""
831
+ for (var i = 0; i < tree.length; i++) {
832
+ var node = tree[i]
833
+ if(node.type == "text") {
834
+ result += node.value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
835
+ } else if(node.type == "object") {
836
+ result += "<" + node.name
837
+ if(node.classes) {
838
+ for(var y = 0; y < node.classes.length; y++) {
839
+ result += "." + node.classes[y]
840
+ }
841
+ }
842
+ if(node.value) {
843
+ result += " " + node.value
844
+ }
845
+ result += ">"
846
+ if(node.children)
847
+ result += serializeTree(node.children)
848
+ result += "</" + node.name + ">"
849
+ } else if(node.type == "timestamp") {
850
+ result += "<" + serializeTimestamp(node.value) + ">"
851
+ } else {
852
+ result += "<" + node.value + ">"
853
+ }
854
+ }
855
+ return result
856
+ }
857
+ function serializeCue(cue) {
858
+ return (cue.id !== undefined ? cue.id + "\n" : "")
859
+ + serializeTimestamp(cue.startTime)
860
+ + " --> "
861
+ + serializeTimestamp(cue.endTime)
862
+ + serializeCueSettings(cue)
863
+ + "\n" + serializeTree(cue.tree.children) + "\n\n"
864
+ }
865
+ function serializeStyle(style) {
866
+ return "STYLE\n" + style + "\n\n"
867
+ }
868
+ this.serialize = function(cues, styles) {
869
+ var result = "WEBVTT\n\n"
870
+ if (styles) {
871
+ for(var i=0;i<styles.length;i++) {
872
+ result += serializeStyle(styles[i])
873
+ }
874
+ }
875
+ for(var i=0;i<cues.length;i++) {
876
+ result += serializeCue(cues[i])
877
+ }
878
+ return result
879
+ }
880
+ }
881
+
882
+ function exportify(object) {
883
+ object.WebVTTParser = WebVTTParser
884
+ object.WebVTTCueTimingsAndSettingsParser = WebVTTCueTimingsAndSettingsParser
885
+ object.WebVTTCueTextParser = WebVTTCueTextParser
886
+ object.WebVTTSerializer = WebVTTSerializer
887
+ }
888
+ if (typeof window !== 'undefined') exportify(window);
889
+ if (typeof exports !== 'undefined') exportify(exports);
890
+ })()