j1-template 2023.9.2 → 2023.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (741) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/layouts/content_generator_collection.html +1 -1
  3. data/_includes/themes/j1/layouts/content_generator_news_panel_posts.html +1 -1
  4. data/_includes/themes/j1/layouts/content_generator_page.html +1 -1
  5. data/_includes/themes/j1/layouts/content_generator_post.html +1 -1
  6. data/_includes/themes/j1/layouts/content_generator_raw.html +1 -1
  7. data/_includes/themes/j1/layouts/layout_metadata_generator.html +1 -1
  8. data/_includes/themes/j1/layouts/layout_module_generator.html +1 -1
  9. data/_includes/themes/j1/layouts/layout_resource_generator.html +1 -1
  10. data/_includes/themes/j1/modules/attics/generator.html +1 -1
  11. data/_includes/themes/j1/modules/navigator/generator.html +1 -1
  12. data/_includes/themes/j1/modules/searcher/generator.html +1 -1
  13. data/_includes/themes/j1/modules/searcher/procedures/topsearch.proc +1 -1
  14. data/_includes/themes/j1/procedures/blocks/footer/boxes/about_box.proc +1 -1
  15. data/_includes/themes/j1/procedures/blocks/footer/boxes/contacts_box.proc +1 -1
  16. data/_includes/themes/j1/procedures/blocks/footer/boxes/issue.proc +1 -1
  17. data/_includes/themes/j1/procedures/blocks/footer/boxes/legal_statements.proc +1 -1
  18. data/_includes/themes/j1/procedures/blocks/footer/boxes/links_box.proc +1 -1
  19. data/_includes/themes/j1/procedures/blocks/footer/boxes/news_box.proc +1 -1
  20. data/_includes/themes/j1/procedures/blocks/footer/boxes/social_media_icons.proc +1 -1
  21. data/_includes/themes/j1/procedures/blocks/get_wave.proc +1 -1
  22. data/_includes/themes/j1/procedures/collections/create_collection_article_preview.proc +1 -1
  23. data/_includes/themes/j1/procedures/collections/pager.proc +1 -1
  24. data/_includes/themes/j1/procedures/global/attributes_loader.proc +1 -1
  25. data/_includes/themes/j1/procedures/global/collect_frontmatter_options.proc +1 -1
  26. data/_includes/themes/j1/procedures/global/collect_page_options.proc +1 -1
  27. data/_includes/themes/j1/procedures/global/create_bs_button.proc +1 -1
  28. data/_includes/themes/j1/procedures/global/create_word_cloud.proc +1 -1
  29. data/_includes/themes/j1/procedures/global/date-german.proc +1 -1
  30. data/_includes/themes/j1/procedures/global/get_category.proc +1 -1
  31. data/_includes/themes/j1/procedures/global/get_category_item.proc +1 -1
  32. data/_includes/themes/j1/procedures/global/get_documents_dir.proc +1 -1
  33. data/_includes/themes/j1/procedures/global/get_page_path.proc +1 -1
  34. data/_includes/themes/j1/procedures/global/get_page_url.proc +1 -1
  35. data/_includes/themes/j1/procedures/global/select_color.proc +1 -1
  36. data/_includes/themes/j1/procedures/global/select_font_size.proc +1 -1
  37. data/_includes/themes/j1/procedures/global/select_icon_size.proc +1 -1
  38. data/_includes/themes/j1/procedures/global/select_location.proc +1 -1
  39. data/_includes/themes/j1/procedures/global/set_base_vars_folders.proc +1 -1
  40. data/_includes/themes/j1/procedures/global/set_env_entry_document.proc +1 -1
  41. data/_includes/themes/j1/procedures/global/set_image_block.proc +1 -1
  42. data/_includes/themes/j1/procedures/global/setup.proc +1 -1
  43. data/_includes/themes/j1/procedures/layouts/content_writer.proc +1 -1
  44. data/_includes/themes/j1/procedures/layouts/default_writer.proc +1 -1
  45. data/_includes/themes/j1/procedures/layouts/module_writer.proc +1 -1
  46. data/_includes/themes/j1/procedures/layouts/resource_writer.proc +1 -1
  47. data/_includes/themes/j1/procedures/posts/collate_calendar.proc +1 -1
  48. data/_includes/themes/j1/procedures/posts/collate_list.proc +1 -1
  49. data/_includes/themes/j1/procedures/posts/collate_timeline.proc +1 -1
  50. data/_includes/themes/j1/procedures/posts/create_ad_block.proc +1 -1
  51. data/_includes/themes/j1/procedures/posts/create_series_header.proc +1 -1
  52. data/_includes/themes/j1/procedures/posts/pager.proc +1 -1
  53. data/_layouts/_home.html +1 -1
  54. data/_layouts/autopage_category.html +1 -1
  55. data/_layouts/autopage_collection.html +1 -1
  56. data/_layouts/autopage_collections_tags.html +1 -1
  57. data/_layouts/autopage_tags.html +1 -1
  58. data/_layouts/collection.html +1 -1
  59. data/_layouts/compress.html +1 -1
  60. data/_layouts/default.html +1 -1
  61. data/_layouts/home.html +1 -1
  62. data/_layouts/news_panel_posts.html +1 -1
  63. data/_layouts/page.html +1 -1
  64. data/_layouts/post.html +1 -1
  65. data/_layouts/raw.html +1 -1
  66. data/apps/public/cc/cc.yml +1 -1
  67. data/assets/data/authclient.html +2 -2
  68. data/assets/data/banner.html +5 -5
  69. data/assets/data/carousel.json +1 -1
  70. data/assets/data/cookieconsent.html +2 -2
  71. data/assets/data/fab.html +2 -2
  72. data/assets/data/footer.html +2 -2
  73. data/assets/data/galeries.html +240 -0
  74. data/assets/data/gallery_customizer.html +2 -2
  75. data/assets/data/iso-639-language-codes-flags.json +1 -1
  76. data/assets/data/iso-639-language-codes.json +1 -1
  77. data/assets/data/j1_config.json +1 -1
  78. data/assets/data/masonry.html +99 -86
  79. data/assets/data/masterslider.html +2 -2
  80. data/assets/data/mdi_icons.json +1 -1
  81. data/assets/data/mdil_icons.json +1 -1
  82. data/assets/data/menu.html +2 -2
  83. data/assets/data/mmenu.html +2 -2
  84. data/assets/data/mmenu_sidebar.html +2 -2
  85. data/assets/data/mmenu_toc.html +2 -2
  86. data/assets/data/panel.html +2 -2
  87. data/assets/data/particles.yml +1 -1
  88. data/assets/data/private.json +1 -1
  89. data/assets/data/quicklinks.html +2 -2
  90. data/assets/data/rtext_resizer.html +2 -2
  91. data/assets/data/slick.html +2 -2
  92. data/assets/data/speak2me.html +2 -2
  93. data/assets/data/themes.bootswatch.json +1 -1
  94. data/assets/data/themes.json +1 -1
  95. data/assets/data/translator.html +2 -2
  96. data/assets/error_pages/HTTP204.html +1 -1
  97. data/assets/error_pages/HTTP400.html +1 -1
  98. data/assets/error_pages/HTTP401.html +1 -1
  99. data/assets/error_pages/HTTP403.html +1 -1
  100. data/assets/error_pages/HTTP404.html +1 -1
  101. data/assets/error_pages/HTTP444.html +1 -1
  102. data/assets/error_pages/HTTP445.html +1 -1
  103. data/assets/error_pages/HTTP446.html +1 -1
  104. data/assets/error_pages/HTTP447.html +1 -1
  105. data/assets/error_pages/HTTP448.html +1 -1
  106. data/assets/error_pages/HTTP500.html +1 -1
  107. data/assets/error_pages/HTTP501.html +1 -1
  108. data/assets/error_pages/HTTP502.html +1 -1
  109. data/assets/error_pages/HTTP503.html +1 -1
  110. data/assets/themes/j1/adapter/js/advertising.js +2 -2
  111. data/assets/themes/j1/adapter/js/algolia.js +2 -2
  112. data/assets/themes/j1/adapter/js/analytics.js +2 -2
  113. data/assets/themes/j1/adapter/js/asciidoctor.js +2 -2
  114. data/assets/themes/j1/adapter/js/attic.js +2 -2
  115. data/assets/themes/j1/adapter/js/bmd.js +2 -2
  116. data/assets/themes/j1/adapter/js/carousel.js +2 -2
  117. data/assets/themes/j1/adapter/js/clipboard.js +2 -2
  118. data/assets/themes/j1/adapter/js/comments.js +2 -2
  119. data/assets/themes/j1/adapter/js/cookieConsent.js +1 -1
  120. data/assets/themes/j1/adapter/js/customFunctions.js +2 -2
  121. data/assets/themes/j1/adapter/js/customModule.js +2 -2
  122. data/assets/themes/j1/adapter/js/dropdowns.js +2 -2
  123. data/assets/themes/j1/adapter/js/fab.js +2 -2
  124. data/assets/themes/j1/adapter/js/framer.js +2 -2
  125. data/assets/themes/j1/adapter/js/gallery.js +324 -0
  126. data/assets/themes/j1/adapter/js/iconPicker.js +2 -2
  127. data/assets/themes/j1/adapter/js/j1.js +2 -2
  128. data/assets/themes/j1/adapter/js/lazyLoader.js +2 -2
  129. data/assets/themes/j1/adapter/js/{justifiedGallery.js → lightGallery.js} +54 -48
  130. data/assets/themes/j1/adapter/js/lightbox.js +2 -2
  131. data/assets/themes/j1/adapter/js/logger.js +2 -2
  132. data/assets/themes/j1/adapter/js/lunr.js +2 -2
  133. data/assets/themes/j1/adapter/js/masonry.js +80 -13
  134. data/assets/themes/j1/adapter/js/masterslider.js +2 -2
  135. data/assets/themes/j1/adapter/js/mmenu.js +2 -2
  136. data/assets/themes/j1/adapter/js/navigator.js +2 -2
  137. data/assets/themes/j1/adapter/js/particles.js +2 -2
  138. data/assets/themes/j1/adapter/js/rangeSlider.js +2 -2
  139. data/assets/themes/j1/adapter/js/rouge.js +2 -2
  140. data/assets/themes/j1/adapter/js/rtable.js +2 -2
  141. data/assets/themes/j1/adapter/js/rtextResizer.js +2 -2
  142. data/assets/themes/j1/adapter/js/scroller.js +2 -2
  143. data/assets/themes/j1/adapter/js/slick.js +1 -1
  144. data/assets/themes/j1/adapter/js/speak2me.js +2 -2
  145. data/assets/themes/j1/adapter/js/themeToggler.js +2 -2
  146. data/assets/themes/j1/adapter/js/themer.js +2 -2
  147. data/assets/themes/j1/adapter/js/toccer.js +2 -2
  148. data/assets/themes/j1/adapter/js/translator.js +1 -1
  149. data/assets/themes/j1/adapter/js/waves.js +2 -2
  150. data/assets/themes/j1/core/country-flags/css/theme/uno.css +1 -1
  151. data/assets/themes/j1/core/country-flags/css/theme/uno.min.css +1 -1
  152. data/assets/themes/j1/core/css/animate.css +2 -2
  153. data/assets/themes/j1/core/css/icon-fonts/fontawesome.css +2 -2
  154. data/assets/themes/j1/core/css/icon-fonts/iconify.css +5 -5
  155. data/assets/themes/j1/core/css/icon-fonts/mdi.css +9 -9
  156. data/assets/themes/j1/core/css/icon-fonts/mdib.css +7 -7
  157. data/assets/themes/j1/core/css/icon-fonts/mdil.css +10 -10
  158. data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.css +1 -1
  159. data/assets/themes/j1/core/css/themes/unodark/bootstrap.css +30 -30
  160. data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +99 -92
  161. data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
  162. data/assets/themes/j1/core/css/vendor.css +10 -10
  163. data/assets/themes/j1/core/js/template.js +159 -19
  164. data/assets/themes/j1/core/js/template.min.js +6 -6
  165. data/assets/themes/j1/core/js/template.min.js.map +1 -1
  166. data/assets/themes/j1/modules/backstretch/js/backstretch.js +1 -1
  167. data/assets/themes/j1/modules/backstretch/js/backstretch.min.js +1 -1
  168. data/assets/themes/j1/modules/bmd/js/bmd.js +1 -1
  169. data/assets/themes/j1/modules/bmd/js/bmd.min.js +1 -1
  170. data/assets/themes/j1/modules/bootstrap/js/bootstrap.js +2118 -2696
  171. data/assets/themes/j1/modules/bootstrap/js/bootstrap.js.map +1 -0
  172. data/assets/themes/j1/modules/bootstrap/js/bootstrap.min.js +3 -3
  173. data/assets/themes/j1/modules/bootstrap/js/bootstrap.min.js.map +1 -1
  174. data/assets/themes/j1/modules/carousel/css/carousel.css +1 -1
  175. data/assets/themes/j1/modules/carousel/css/carousel.min.css +1 -1
  176. data/assets/themes/j1/modules/carousel/css/carousel_transitions.css +1 -1
  177. data/assets/themes/j1/modules/carousel/css/carousel_transitions.min.css +1 -1
  178. data/assets/themes/j1/modules/carousel/css/theme/uno.css +1 -1
  179. data/assets/themes/j1/modules/carousel/css/theme/uno.min.css +1 -1
  180. data/assets/themes/j1/modules/clipboard/css/theme/uno.css +1 -1
  181. data/assets/themes/j1/modules/clipboard/css/theme/uno.min.css +1 -1
  182. data/assets/themes/j1/modules/dropdowns/css/theme/uno/dropdowns.css +1 -1
  183. data/assets/themes/j1/modules/dropdowns/css/theme/uno/dropdowns.min.css +1 -1
  184. data/assets/themes/j1/modules/dropdowns/js/cash.js +1 -1
  185. data/assets/themes/j1/modules/dropdowns/js/cash.min.js +1 -1
  186. data/assets/themes/j1/modules/dropdowns/js/dropdowns.js +1 -1
  187. data/assets/themes/j1/modules/dropdowns/js/dropdowns.min.js +1 -1
  188. data/assets/themes/j1/modules/fab/js/cash.js +1 -1
  189. data/assets/themes/j1/modules/fab/js/cash.min.js +1 -1
  190. data/assets/themes/j1/modules/fab/js/fab.js +1 -1
  191. data/assets/themes/j1/modules/fab/js/fab.min.js +1 -1
  192. data/assets/themes/j1/modules/iconPicker/css/universal-icon-picker.css +1 -1
  193. data/assets/themes/j1/modules/iconPicker/css/universal-icon-picker.min.css +1 -1
  194. data/assets/themes/j1/modules/iconPicker/js/universal-icon-picker.js +1 -1
  195. data/assets/themes/j1/modules/iconPicker/js/universal-icon-picker.min.js +1 -1
  196. data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.min.js +0 -1
  197. data/assets/themes/j1/modules/iframeResizer/js/resizer.min.js +0 -1
  198. data/assets/themes/j1/modules/jquery/js/extensions/hasClass.js +1 -1
  199. data/assets/themes/j1/modules/jquery/js/extensions/hasClass.min.js +1 -1
  200. data/assets/themes/j1/modules/jquery/js/extensions/removeClass.js +1 -1
  201. data/assets/themes/j1/modules/jquery/js/extensions/removeClass.min.js +1 -1
  202. data/assets/themes/j1/modules/justifiedGallery/css/theme/uno.css +1 -1
  203. data/assets/themes/j1/modules/justifiedGallery/css/theme/uno.min.css +1 -1
  204. data/assets/themes/j1/modules/lightGallery/css/lg-transitions.css +984 -0
  205. data/assets/themes/j1/modules/lightGallery/css/lg-transitions.min.css +26 -0
  206. data/assets/themes/j1/modules/lightGallery/css/lightgallery-bundle.css +1627 -0
  207. data/assets/themes/j1/modules/lightGallery/css/lightgallery-bundle.min.css +25 -0
  208. data/assets/themes/j1/modules/lightGallery/css/plugins/lg-autoplay.css +67 -0
  209. data/assets/themes/j1/modules/lightGallery/css/plugins/lg-comments.css +157 -0
  210. data/assets/themes/j1/modules/lightGallery/css/plugins/lg-fullscreen.css +32 -0
  211. data/assets/themes/j1/modules/lightGallery/css/plugins/lg-medium-zoom.css +40 -0
  212. data/assets/themes/j1/modules/lightGallery/css/plugins/lg-pager.css +115 -0
  213. data/assets/themes/j1/modules/lightGallery/css/plugins/lg-rotate.css +74 -0
  214. data/assets/themes/j1/modules/lightGallery/css/plugins/lg-share.css +168 -0
  215. data/assets/themes/j1/modules/lightGallery/css/plugins/lg-thumbnail.css +133 -0
  216. data/assets/themes/j1/modules/lightGallery/css/plugins/lg-video.css +169 -0
  217. data/assets/themes/j1/modules/lightGallery/css/plugins/lg-zoom.css +141 -0
  218. data/assets/themes/j1/modules/lightGallery/css/themes/uno/uno.css +109 -0
  219. data/assets/themes/j1/modules/lightGallery/css/themes/uno/uno.min.css +19 -0
  220. data/assets/themes/j1/modules/lightGallery/{css/fonts → fonts}/lg.svg +35 -28
  221. data/assets/themes/j1/modules/lightGallery/fonts/lg.ttf +0 -0
  222. data/assets/themes/j1/modules/lightGallery/fonts/lg.woff +0 -0
  223. data/assets/themes/j1/modules/lightGallery/fonts/lg.woff2 +0 -0
  224. data/assets/themes/j1/modules/lightGallery/img/loading.gif +0 -0
  225. data/assets/themes/j1/modules/lightGallery/js/lightgallery.js +2759 -0
  226. data/assets/themes/j1/modules/lightGallery/js/lightgallery.min.js +25 -0
  227. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-autoplay.js +275 -0
  228. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-autoplay.min.js +26 -0
  229. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-comment.js +230 -0
  230. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-comment.min.js +26 -0
  231. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-fullscreen.js +160 -0
  232. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-fullscreen.min.js +26 -0
  233. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-hash.js +223 -0
  234. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-hash.min.js +27 -0
  235. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-medium-zoom.js +157 -0
  236. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-medium-zoom.min.js +26 -0
  237. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-pager.js +164 -0
  238. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-pager.min.js +26 -0
  239. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-rotate.js +299 -0
  240. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-rotate.min.js +26 -0
  241. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-share.js +244 -0
  242. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-share.min.js +27 -0
  243. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-thumbnail.js +509 -0
  244. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-thumbnail.min.js +26 -0
  245. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-video.js +585 -0
  246. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-video.min.js +27 -0
  247. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-vimeo-thumbnail.js +207 -0
  248. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-vimeo-thumbnail.min.js +26 -0
  249. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-zoom.js +999 -0
  250. data/assets/themes/j1/modules/lightGallery/js/plugins/lg-zoom.min.js +26 -0
  251. data/assets/themes/j1/modules/lightbox/css/lightbox.css +1 -1
  252. data/assets/themes/j1/modules/lightbox/css/lightbox.min.css +1 -1
  253. data/assets/themes/j1/modules/lightbox/css/theme/uno.css +1 -1
  254. data/assets/themes/j1/modules/lightbox/css/theme/uno.min.css +1 -1
  255. data/assets/themes/j1/modules/lightbox/js/lightbox.js +1 -1
  256. data/assets/themes/j1/modules/lightbox/js/lightbox.min.js +1 -1
  257. data/assets/themes/j1/modules/lunr/js/j1.js +1 -1
  258. data/assets/themes/j1/modules/lunr/js/j1.min.js +1 -1
  259. data/assets/themes/j1/modules/masonry/js/utils/images_loaded.js +439 -0
  260. data/assets/themes/j1/modules/masonry/js/utils/images_loaded.min.js +12 -0
  261. data/assets/themes/j1/modules/masterslider/css/theme/uno.css +1 -1
  262. data/assets/themes/j1/modules/masterslider/css/theme/uno.min.css +1 -1
  263. data/assets/themes/j1/modules/mmenuLight/css/theme/uno/mmenu.css +1 -1
  264. data/assets/themes/j1/modules/mmenuLight/css/theme/uno/mmenu.min.css +1 -1
  265. data/assets/themes/j1/modules/mmenuLight/js/mmenu.js +1 -1
  266. data/assets/themes/j1/modules/mmenuLight/js/mmenu.min.js +1 -1
  267. data/assets/themes/j1/modules/mmenuLight/js/mmenu.polyfills.js +118 -0
  268. data/assets/themes/j1/modules/particles/skies/cavern1.png +0 -0
  269. data/assets/themes/j1/modules/particles/skies/cavern2.png +0 -0
  270. data/assets/themes/j1/modules/particles/skies/chrome.png +0 -0
  271. data/assets/themes/j1/modules/particles/skies/deep-space.jpg +0 -0
  272. data/assets/themes/j1/modules/particles/skies/deepblue.png +0 -0
  273. data/assets/themes/j1/modules/particles/skies/fire.png +0 -0
  274. data/assets/themes/j1/modules/particles/skies/fog.png +0 -0
  275. data/assets/themes/j1/modules/particles/skies/sky1.png +0 -0
  276. data/assets/themes/j1/modules/particles/skies/sky2.png +0 -0
  277. data/assets/themes/j1/modules/particles/skies/sky3.png +0 -0
  278. data/assets/themes/j1/modules/particles/skies/sky4.png +0 -0
  279. data/assets/themes/j1/modules/particles/skies/sky5.png +0 -0
  280. data/assets/themes/j1/modules/particles/skies/space1.png +0 -0
  281. data/assets/themes/j1/modules/particles/skies/space2.png +0 -0
  282. data/assets/themes/j1/modules/particles/skies/space3.png +0 -0
  283. data/assets/themes/j1/modules/particles/skies/starfield.png +0 -0
  284. data/assets/themes/j1/modules/particles/skies/sunorbit.png +0 -0
  285. data/assets/themes/j1/modules/particles/skies/sunset.png +0 -0
  286. data/assets/themes/j1/modules/particles/skies/toxic.png +0 -0
  287. data/assets/themes/j1/modules/particles/skies/underwater1.png +0 -0
  288. data/assets/themes/j1/modules/particles/skies/underwater2.png +0 -0
  289. data/assets/themes/j1/modules/particles/skies/underwater3.png +0 -0
  290. data/assets/themes/j1/modules/particles/skies/wtf.png +0 -0
  291. data/assets/themes/j1/modules/particles/sprites/slime.png +0 -0
  292. data/assets/themes/j1/modules/particles/sprites/slimeeyes.png +0 -0
  293. data/assets/themes/j1/modules/particles/sprites/snake.png +0 -0
  294. data/assets/themes/j1/modules/particles/sprites/snowflakes.png +0 -0
  295. data/assets/themes/j1/modules/particles/sprites/snowflakes_large.png +0 -0
  296. data/assets/themes/j1/modules/popper/js/popper.min.js +0 -1
  297. data/assets/themes/j1/modules/rangeSlider/css/theme/uno/nouislider.css +1 -1
  298. data/assets/themes/j1/modules/rangeSlider/css/theme/uno/nouislider.min.css +1 -1
  299. data/assets/themes/j1/modules/rouge/css/base16/theme.css +1 -1
  300. data/assets/themes/j1/modules/rouge/css/base16/theme.min.css +1 -1
  301. data/assets/themes/j1/modules/rouge/css/base16.dark/theme.css +1 -1
  302. data/assets/themes/j1/modules/rouge/css/base16.dark/theme.min.css +1 -1
  303. data/assets/themes/j1/modules/rouge/css/base16.light/theme.css +1 -1
  304. data/assets/themes/j1/modules/rouge/css/base16.light/theme.min.css +1 -1
  305. data/assets/themes/j1/modules/rouge/css/base16.monokai/theme.css +1 -1
  306. data/assets/themes/j1/modules/rouge/css/base16.monokai/theme.min.css +1 -1
  307. data/assets/themes/j1/modules/rouge/css/base16.monokai.dark/theme.css +1 -1
  308. data/assets/themes/j1/modules/rouge/css/base16.monokai.dark/theme.min.css +1 -1
  309. data/assets/themes/j1/modules/rouge/css/base16.monokai.light/theme.css +1 -1
  310. data/assets/themes/j1/modules/rouge/css/base16.monokai.light/theme.min.css +1 -1
  311. data/assets/themes/j1/modules/rouge/css/base16.solarized/theme.css +1 -1
  312. data/assets/themes/j1/modules/rouge/css/base16.solarized/theme.min.css +1 -1
  313. data/assets/themes/j1/modules/rouge/css/base16.solarized.dark/theme.css +1 -1
  314. data/assets/themes/j1/modules/rouge/css/base16.solarized.dark/theme.min.css +1 -1
  315. data/assets/themes/j1/modules/rouge/css/base16.solarized.light/theme.css +1 -1
  316. data/assets/themes/j1/modules/rouge/css/base16.solarized.light/theme.min.css +1 -1
  317. data/assets/themes/j1/modules/rouge/css/colorful/theme.css +1 -1
  318. data/assets/themes/j1/modules/rouge/css/colorful/theme.min.css +1 -1
  319. data/assets/themes/j1/modules/rouge/css/github/theme.css +1 -1
  320. data/assets/themes/j1/modules/rouge/css/github/theme.min.css +1 -1
  321. data/assets/themes/j1/modules/rouge/css/gruvbox/theme.css +1 -1
  322. data/assets/themes/j1/modules/rouge/css/gruvbox/theme.min.css +1 -1
  323. data/assets/themes/j1/modules/rouge/css/gruvbox.dark/theme.css +1 -1
  324. data/assets/themes/j1/modules/rouge/css/gruvbox.dark/theme.min.css +1 -1
  325. data/assets/themes/j1/modules/rouge/css/gruvbox.light/theme.css +1 -1
  326. data/assets/themes/j1/modules/rouge/css/gruvbox.light/theme.min.css +1 -1
  327. data/assets/themes/j1/modules/rouge/css/igorpro/theme.css +1 -1
  328. data/assets/themes/j1/modules/rouge/css/igorpro/theme.min.css +1 -1
  329. data/assets/themes/j1/modules/rouge/css/molokai/theme.css +1 -1
  330. data/assets/themes/j1/modules/rouge/css/molokai/theme.min.css +1 -1
  331. data/assets/themes/j1/modules/rouge/css/monokai/theme.css +1 -1
  332. data/assets/themes/j1/modules/rouge/css/monokai/theme.min.css +1 -1
  333. data/assets/themes/j1/modules/rouge/css/monokai.sublime/theme.css +1 -1
  334. data/assets/themes/j1/modules/rouge/css/monokai.sublime/theme.min.css +1 -1
  335. data/assets/themes/j1/modules/rouge/css/pastie/theme.css +1 -1
  336. data/assets/themes/j1/modules/rouge/css/pastie/theme.min.css +1 -1
  337. data/assets/themes/j1/modules/rouge/css/thankful_eyes/theme.css +1 -1
  338. data/assets/themes/j1/modules/rouge/css/thankful_eyes/theme.min.css +1 -1
  339. data/assets/themes/j1/modules/rouge/css/themes.txt +1 -1
  340. data/assets/themes/j1/modules/rouge/css/tulip/theme.css +1 -1
  341. data/assets/themes/j1/modules/rouge/css/tulip/theme.min.css +1 -1
  342. data/assets/themes/j1/modules/rouge/css/uno.dark/theme.css +1 -1
  343. data/assets/themes/j1/modules/rouge/css/uno.dark/theme.min.css +1 -1
  344. data/assets/themes/j1/modules/rouge/css/uno.light/theme.css +1 -1
  345. data/assets/themes/j1/modules/rouge/css/uno.light/theme.min.css +1 -1
  346. data/assets/themes/j1/modules/rouge/js/select.js +1 -1
  347. data/assets/themes/j1/modules/rtable/css/theme/uno/rtable.css +1 -1
  348. data/assets/themes/j1/modules/rtable/css/theme/uno/rtable.min.css +1 -1
  349. data/assets/themes/j1/modules/rtable/js/rtable.js +1 -1
  350. data/assets/themes/j1/modules/rtable/js/rtable.min.js +1 -1
  351. data/assets/themes/j1/modules/scroller/css/theme/uno.css +1 -1
  352. data/assets/themes/j1/modules/scroller/css/theme/uno.min.css +1 -1
  353. data/assets/themes/j1/modules/scroller/js/scroller.min.js +1 -1
  354. data/assets/themes/j1/modules/slick/lightbox/css/theme/uno.css +1 -1
  355. data/assets/themes/j1/modules/slick/lightbox/css/theme/uno.min.css +1 -1
  356. data/assets/themes/j1/modules/slick/lightbox/js/slick-lightbox.min.js +0 -1
  357. data/assets/themes/j1/modules/slick/slider/css/theme/uno.css +1 -1
  358. data/assets/themes/j1/modules/slick/slider/css/theme/uno.min.css +1 -1
  359. data/assets/themes/j1/modules/spinner/css/spin.css +1 -1
  360. data/assets/themes/j1/modules/spinner/css/spin.min.css +1 -1
  361. data/assets/themes/j1/modules/spinner/js/spin.js +1 -1
  362. data/assets/themes/j1/modules/spinner/js/spin.min.js +1 -1
  363. data/assets/themes/j1/modules/themeSwitcher/js/switcher.js +1 -1
  364. data/assets/themes/j1/modules/themeSwitcher/js/switcher.min.js +1 -1
  365. data/assets/themes/j1/modules/translator/css/translator.css +1 -1
  366. data/assets/themes/j1/modules/translator/css/translator.min.css +1 -1
  367. data/assets/themes/j1/modules/videojs/css/themes/city.css +74 -74
  368. data/assets/themes/j1/modules/videojs/css/themes/city.min.css +3 -4
  369. data/assets/themes/j1/modules/videojs/css/themes/fantasy.css +3 -3
  370. data/assets/themes/j1/modules/videojs/css/themes/fantasy.min.css +3 -4
  371. data/assets/themes/j1/modules/videojs/css/themes/forest.css +4 -3
  372. data/assets/themes/j1/modules/videojs/css/themes/forest.min.css +3 -4
  373. data/assets/themes/j1/modules/videojs/css/themes/sea.css +2 -2
  374. data/assets/themes/j1/modules/videojs/css/themes/sea.min.css +3 -4
  375. data/assets/themes/j1/modules/videojs/css/themes/uno.css +151 -0
  376. data/assets/themes/j1/modules/videojs/css/themes/uno.min.css +17 -0
  377. data/assets/themes/j1/modules/videojs/css/video-js.css +12 -0
  378. data/assets/themes/j1/modules/videojs/css/video-js.min.css +12 -0
  379. data/assets/themes/j1/modules/videojs/js/plugins/dm/LICENSE +19 -0
  380. data/assets/themes/j1/modules/videojs/js/plugins/dm/README.md +94 -0
  381. data/assets/themes/j1/modules/videojs/js/plugins/dm/api/README.md +7 -0
  382. data/assets/themes/j1/modules/videojs/js/plugins/dm/api/dailymotion.min.js +29 -0
  383. data/assets/themes/j1/modules/videojs/js/plugins/dm/api/dailymotion.player.min.js +80 -0
  384. data/assets/themes/j1/modules/videojs/js/plugins/dm/dailymotion.js +603 -0
  385. data/assets/themes/j1/modules/videojs/js/plugins/dm/dailymotion.min.js +16 -0
  386. data/assets/themes/j1/modules/videojs/js/plugins/dm/examples/dailymotion-controls.html +18 -0
  387. data/assets/themes/j1/modules/videojs/js/plugins/dm/examples/dailymotion-javascript.html +27 -0
  388. data/assets/themes/j1/modules/videojs/js/plugins/dm/examples/dailymotion-playlist.html +19 -0
  389. data/assets/themes/j1/modules/videojs/js/plugins/dm/examples/global-parameters.html +28 -0
  390. data/assets/themes/j1/modules/videojs/js/plugins/dm/examples/simple.html +20 -0
  391. data/assets/themes/j1/modules/videojs/js/plugins/dm/examples/switch.html +37 -0
  392. data/assets/themes/j1/modules/videojs/js/plugins/vm/LICENSE +21 -0
  393. data/assets/themes/j1/modules/videojs/js/plugins/vm/README.md +15 -0
  394. data/assets/themes/j1/modules/videojs/js/plugins/vm/api/README.md +1818 -0
  395. data/assets/themes/j1/modules/videojs/js/plugins/vm/api/player.min.js +23 -0
  396. data/assets/themes/j1/modules/videojs/js/plugins/vm/api/vimeo.js +3562 -0
  397. data/assets/themes/j1/modules/videojs/js/plugins/vm/api/vimeo.min.js +35 -0
  398. data/assets/themes/j1/modules/videojs/js/plugins/vm/examples/index.html +33 -0
  399. data/assets/themes/j1/modules/videojs/js/plugins/vm/examples/player/index.html +37 -0
  400. data/assets/themes/j1/modules/videojs/js/plugins/vm/vimeo.js +521 -0
  401. data/assets/themes/j1/modules/videojs/js/plugins/vm/vimeo.min.js +15 -0
  402. data/assets/themes/j1/modules/videojs/js/plugins/wt/api/Readme.txt +20 -0
  403. data/assets/themes/j1/modules/videojs/js/plugins/wt/api/WistiaPlayer.ts +1617 -0
  404. data/assets/themes/j1/modules/videojs/js/plugins/wt/api/wistia.min.js +2 -0
  405. data/assets/themes/j1/modules/videojs/js/plugins/wt/wistia.js +383 -0
  406. data/assets/themes/j1/modules/videojs/js/plugins/wt/wistia.min.js +18 -0
  407. data/assets/themes/j1/modules/videojs/js/plugins/yt/README.md +115 -0
  408. data/assets/themes/j1/modules/videojs/js/plugins/yt/api/youtube.min.js +20 -0
  409. data/assets/themes/j1/modules/videojs/js/plugins/yt/examples/global-parameters.html +32 -0
  410. data/assets/themes/j1/modules/videojs/js/plugins/yt/examples/simple.html +20 -0
  411. data/assets/themes/j1/modules/videojs/js/plugins/yt/examples/switch.html +37 -0
  412. data/assets/themes/j1/modules/videojs/js/plugins/yt/examples/youtube-controls.html +18 -0
  413. data/assets/themes/j1/modules/videojs/js/plugins/yt/examples/youtube-javascript.html +27 -0
  414. data/assets/themes/j1/modules/videojs/js/plugins/yt/examples/youtube-list.html +19 -0
  415. data/assets/themes/j1/modules/videojs/js/plugins/yt/examples/youtube-playlist.html +19 -0
  416. data/assets/themes/j1/modules/videojs/js/plugins/yt/youtube.js +832 -0
  417. data/assets/themes/j1/modules/videojs/js/plugins/yt/youtube.min.js +16 -0
  418. data/assets/themes/j1/modules/videojs/js/video.js +40610 -32915
  419. data/assets/themes/j1/modules/videojs/js/video.min.js +33 -20
  420. data/lib/j1/version.rb +1 -1
  421. data/lib/j1_app/j1_auth_manager/auth_manager.rb +1 -1
  422. data/lib/j1_app/j1_auth_manager/warden_omniauth.rb +1 -1
  423. data/lib/j1_app/omniauth/strategies/github.rb +1 -1
  424. data/lib/starter_web/Gemfile +3 -3
  425. data/lib/starter_web/README.md +5 -5
  426. data/lib/starter_web/_config.yml +2 -2
  427. data/lib/starter_web/_data/_defaults/categories.yml +1 -1
  428. data/lib/starter_web/_data/_defaults/colors.yml +1 -1
  429. data/lib/starter_web/_data/_defaults/font_sizes.yml +1 -1
  430. data/lib/starter_web/_data/_defaults/j1_config.yml +1 -1
  431. data/lib/starter_web/_data/_defaults/private.yml +1 -1
  432. data/lib/starter_web/_data/_defaults/resources.yml +1 -1
  433. data/lib/starter_web/_data/apps/defaults/justifiedGalleryCustomizer.yml +1 -1
  434. data/lib/starter_web/_data/apps/justifiedGalleryCustomizer.yml +1 -1
  435. data/lib/starter_web/_data/asciidoc2pdf/themes/j1-theme.yml +1 -1
  436. data/lib/starter_web/_data/blocks/banner.yml +1 -1
  437. data/lib/starter_web/_data/blocks/defaults/banner.yml +1 -1
  438. data/lib/starter_web/_data/blocks/defaults/footer.yml +1 -1
  439. data/lib/starter_web/_data/blocks/defaults/panel.yml +1 -1
  440. data/lib/starter_web/_data/blocks/footer.yml +2 -2
  441. data/lib/starter_web/_data/blocks/panel.yml +1 -1
  442. data/lib/starter_web/_data/categories.yml +1 -1
  443. data/lib/starter_web/_data/colors.yml +1 -1
  444. data/lib/starter_web/_data/font_sizes.yml +1 -1
  445. data/lib/starter_web/_data/j1_config.yml +1 -1
  446. data/lib/starter_web/_data/layouts/collection.yml +1 -1
  447. data/lib/starter_web/_data/layouts/default.yml +1 -1
  448. data/lib/starter_web/_data/layouts/home.yml +1 -1
  449. data/lib/starter_web/_data/layouts/news_panel_posts.yml +1 -1
  450. data/lib/starter_web/_data/layouts/page.yml +1 -1
  451. data/lib/starter_web/_data/layouts/post.yml +1 -1
  452. data/lib/starter_web/_data/layouts/raw.yml +1 -1
  453. data/lib/starter_web/_data/modules/advertising.yml +2 -2
  454. data/lib/starter_web/_data/modules/analytics.yml +1 -1
  455. data/lib/starter_web/_data/modules/attics.yml +1 -1
  456. data/lib/starter_web/_data/modules/authentication.yml +1 -1
  457. data/lib/starter_web/_data/modules/blog_navigator.yml +1 -1
  458. data/lib/starter_web/_data/modules/carousel.yml +1 -1
  459. data/lib/starter_web/_data/modules/comments.yml +1 -1
  460. data/lib/starter_web/_data/modules/cookieconsent.yml +1 -1
  461. data/lib/starter_web/_data/modules/cookies.yml +1 -1
  462. data/lib/starter_web/_data/modules/defaults/advertising.yml +1 -1
  463. data/lib/starter_web/_data/modules/defaults/analytics.yml +1 -1
  464. data/lib/starter_web/_data/modules/defaults/attics.yml +1 -1
  465. data/lib/starter_web/_data/modules/defaults/authentication.yml +1 -1
  466. data/lib/starter_web/_data/modules/defaults/blog_navigator.yml +1 -1
  467. data/lib/starter_web/_data/modules/defaults/carousel.yml +1 -1
  468. data/lib/starter_web/_data/modules/defaults/comments.yml +1 -1
  469. data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +1 -1
  470. data/lib/starter_web/_data/modules/defaults/cookies.yml +1 -1
  471. data/lib/starter_web/_data/modules/defaults/dropdowns.yml +1 -1
  472. data/lib/starter_web/_data/modules/defaults/fab.yml +1 -1
  473. data/lib/starter_web/_data/modules/defaults/framer.yml +1 -1
  474. data/lib/starter_web/_data/modules/defaults/{justifiedGallery.yml → gallery.yml} +18 -28
  475. data/lib/starter_web/_data/modules/defaults/iconPicker.yml +1 -1
  476. data/lib/starter_web/_data/modules/defaults/lazyLoader.yml +1 -1
  477. data/lib/starter_web/_data/modules/defaults/lightGallery.yml +8 -6
  478. data/lib/starter_web/_data/modules/defaults/lightbox.yml +1 -1
  479. data/lib/starter_web/_data/modules/defaults/log4javascript.yml +1 -1
  480. data/lib/starter_web/_data/modules/defaults/log4r.yml +1 -1
  481. data/lib/starter_web/_data/modules/defaults/lunr.yml +1 -1
  482. data/lib/starter_web/_data/modules/defaults/masonry.yml +53 -13
  483. data/lib/starter_web/_data/modules/defaults/masterslider.yml +1 -1
  484. data/lib/starter_web/_data/modules/defaults/navigator.yml +1 -1
  485. data/lib/starter_web/_data/modules/defaults/particles.yml +1 -1
  486. data/lib/starter_web/_data/modules/defaults/rangeSlider.yml +1 -1
  487. data/lib/starter_web/_data/modules/defaults/rtable.yml +1 -1
  488. data/lib/starter_web/_data/modules/defaults/scroller.yml +1 -1
  489. data/lib/starter_web/_data/modules/defaults/slick.yml +1 -1
  490. data/lib/starter_web/_data/modules/defaults/speak2me.yml +1 -1
  491. data/lib/starter_web/_data/modules/defaults/theme_toggler.yml +1 -1
  492. data/lib/starter_web/_data/modules/defaults/themer.yml +1 -1
  493. data/lib/starter_web/_data/modules/defaults/toccer.yml +1 -1
  494. data/lib/starter_web/_data/modules/defaults/translator.yml +1 -1
  495. data/lib/starter_web/_data/modules/defaults/waves.yml +1 -1
  496. data/lib/starter_web/_data/modules/dropdowns.yml +1 -1
  497. data/lib/starter_web/_data/modules/fab.yml +1 -1
  498. data/lib/starter_web/_data/modules/framer.yml +1 -1
  499. data/lib/starter_web/_data/modules/gallery.yml +873 -0
  500. data/lib/starter_web/_data/modules/iconPicker.yml +1 -1
  501. data/lib/starter_web/_data/modules/lazyLoader.yml +1 -1
  502. data/lib/starter_web/_data/modules/lightGallery.yml +8 -5
  503. data/lib/starter_web/_data/modules/lightbox.yml +1 -1
  504. data/lib/starter_web/_data/modules/log4javascript.yml +1 -1
  505. data/lib/starter_web/_data/modules/log4r.yml +1 -1
  506. data/lib/starter_web/_data/modules/lunr.yml +1 -1
  507. data/lib/starter_web/_data/modules/masonry.yml +401 -87
  508. data/lib/starter_web/_data/modules/masterslider.yml +1 -1
  509. data/lib/starter_web/_data/modules/navigator.yml +1 -1
  510. data/lib/starter_web/_data/modules/navigator_menu.yml +18 -4
  511. data/lib/starter_web/_data/modules/nbinteract.yml +1 -1
  512. data/lib/starter_web/_data/modules/particles.yml +1 -1
  513. data/lib/starter_web/_data/modules/rangeSlider.yml +1 -1
  514. data/lib/starter_web/_data/modules/rtable.yml +1 -1
  515. data/lib/starter_web/_data/modules/scroller.yml +1 -1
  516. data/lib/starter_web/_data/modules/slick.yml +1 -1
  517. data/lib/starter_web/_data/modules/speak2me.yml +1 -1
  518. data/lib/starter_web/_data/modules/theme_toggler.yml +1 -1
  519. data/lib/starter_web/_data/modules/themer.yml +1 -1
  520. data/lib/starter_web/_data/modules/toccer.yml +1 -1
  521. data/lib/starter_web/_data/modules/translator.yml +1 -1
  522. data/lib/starter_web/_data/modules/waves.yml +1 -1
  523. data/lib/starter_web/_data/plugins/defaults/feed.yml +1 -1
  524. data/lib/starter_web/_data/plugins/defaults/paginator.yml +1 -1
  525. data/lib/starter_web/_data/plugins/defaults/seo-tags.yml +1 -1
  526. data/lib/starter_web/_data/plugins/defaults/sitemap.yml +1 -1
  527. data/lib/starter_web/_data/plugins/feed.yml +1 -1
  528. data/lib/starter_web/_data/plugins/paginator.yml +1 -1
  529. data/lib/starter_web/_data/plugins/seo-tags.yml +1 -1
  530. data/lib/starter_web/_data/plugins/sitemap.yml +1 -1
  531. data/lib/starter_web/_data/private.yml +1 -1
  532. data/lib/starter_web/_data/resources.yml +190 -118
  533. data/lib/starter_web/_data/templates/feed.xml +2 -2
  534. data/lib/starter_web/_data/templates/robots.txt +1 -1
  535. data/lib/starter_web/_data/templates/seo-tags.html +1 -1
  536. data/lib/starter_web/_data/templates/sitemap.xml +1 -1
  537. data/lib/starter_web/_data/utilities/defaults/util_srv.yml +1 -1
  538. data/lib/starter_web/_data/utilities/util_srv.yml +1 -1
  539. data/lib/starter_web/_includes/custom/static/bs5_accordion.html +1 -1
  540. data/lib/starter_web/_includes/custom/templates/bs5_accordion.html +1 -1
  541. data/lib/starter_web/_includes/custom/templates/collection_panel.html +1 -1
  542. data/lib/starter_web/_includes/custom/templates/custom_header.html +1 -1
  543. data/lib/starter_web/_includes/custom/templates/people_panel.html +1 -1
  544. data/lib/starter_web/_includes/google/static/google_ad__your-slot-id.html +1 -1
  545. data/lib/starter_web/_includes/google/templates/google_ads.html +1 -1
  546. data/lib/starter_web/_plugins/asciidoctor/admonition-block-answer.rb +3 -2
  547. data/lib/starter_web/_plugins/asciidoctor/admonition-block-question.rb +7 -6
  548. data/lib/starter_web/_plugins/asciidoctor/banner.rb +8 -5
  549. data/lib/starter_web/_plugins/asciidoctor/callout.rb +10 -8
  550. data/lib/starter_web/_plugins/asciidoctor/carousel-block.rb +14 -8
  551. data/lib/starter_web/_plugins/asciidoctor/conum.rb +3 -1
  552. data/lib/starter_web/_plugins/asciidoctor/dailymotion-block.rb +83 -0
  553. data/lib/starter_web/_plugins/asciidoctor/fab-icon-inline.rb +8 -5
  554. data/lib/starter_web/_plugins/asciidoctor/fas-icon-inline.rb +8 -5
  555. data/lib/starter_web/_plugins/asciidoctor/flag-icon-inline.rb +8 -5
  556. data/lib/starter_web/_plugins/asciidoctor/gallery-block.rb +13 -7
  557. data/lib/starter_web/_plugins/asciidoctor/gist-block.rb +19 -15
  558. data/lib/starter_web/_plugins/asciidoctor/google-ad-block.rb +10 -5
  559. data/lib/starter_web/_plugins/asciidoctor/iconify-icon-inline.rb +8 -5
  560. data/lib/starter_web/_plugins/asciidoctor/lightbox-block.rb +24 -18
  561. data/lib/starter_web/_plugins/asciidoctor/lorem_inline.rb +5 -4
  562. data/lib/starter_web/_plugins/asciidoctor/masonry-block.rb +13 -7
  563. data/lib/starter_web/_plugins/asciidoctor/masterslider-block.rb +12 -6
  564. data/lib/starter_web/_plugins/asciidoctor/mdi-icon-inline.rb +2 -1
  565. data/lib/starter_web/_plugins/asciidoctor/mdib-icon-inline.rb +2 -1
  566. data/lib/starter_web/_plugins/asciidoctor/mdil-icon-inline.rb +2 -1
  567. data/lib/starter_web/_plugins/asciidoctor/panel.rb +9 -5
  568. data/lib/starter_web/_plugins/asciidoctor/placeholder-inline.rb +4 -3
  569. data/lib/starter_web/_plugins/asciidoctor/range-slider-block.rb +11 -6
  570. data/lib/starter_web/_plugins/asciidoctor/shout-block.rb +6 -7
  571. data/lib/starter_web/_plugins/asciidoctor/slick-block.rb +12 -6
  572. data/lib/starter_web/_plugins/asciidoctor/textbook-block.rb +9 -5
  573. data/lib/starter_web/_plugins/asciidoctor/twitter-emoji-inline.rb +4 -1
  574. data/lib/starter_web/_plugins/asciidoctor/video-block.rb +65 -0
  575. data/lib/starter_web/_plugins/asciidoctor/videojs-block.rb +82 -0
  576. data/lib/starter_web/_plugins/asciidoctor/vimeo-block.rb +82 -0
  577. data/lib/starter_web/_plugins/asciidoctor/wistia-block.rb +87 -0
  578. data/lib/starter_web/_plugins/asciidoctor/youtube-block.rb +95 -0
  579. data/lib/starter_web/_plugins/filter/debug.rb +1 -1
  580. data/lib/starter_web/_plugins/filter/encodeBase64.rb +1 -1
  581. data/lib/starter_web/_plugins/filter/encryptAES.rb +1 -1
  582. data/lib/starter_web/_plugins/filter/filters.rb +1 -1
  583. data/lib/starter_web/_plugins/filter/liquify.rb +1 -1
  584. data/lib/starter_web/_plugins/filter/minifyJS.rb +1 -1
  585. data/lib/starter_web/_plugins/filter/minifyJSON.rb +1 -1
  586. data/lib/starter_web/_plugins/filter/prettify.rb +1 -1
  587. data/lib/starter_web/_plugins/filter/xml_prettify.rb +1 -1
  588. data/lib/starter_web/_plugins/helper/symlink_watcher.rb +1 -1
  589. data/lib/starter_web/_plugins/i18n/date.rb +1 -1
  590. data/lib/starter_web/_plugins/index/lunr.rb +2 -2
  591. data/lib/starter_web/_plugins/seo/j1-feed.rb +1 -1
  592. data/lib/starter_web/_plugins/seo/j1-seo-tags.rb +1 -1
  593. data/lib/starter_web/_plugins/seo/j1-sitemap.rb +1 -1
  594. data/lib/starter_web/assets/images/icons/videojs/videojs-logo.png +0 -0
  595. data/lib/starter_web/assets/images/icons/videojs/videojs-poster.png +0 -0
  596. data/lib/starter_web/assets/images/modules/attics/1920x1280/isaac-davis.jpg +0 -0
  597. data/lib/starter_web/assets/videos/gallery/_video_james_carpool_caraoke_poster.jpg +0 -0
  598. data/lib/starter_web/assets/videos/gallery/html5/video1-poster.jpg +0 -0
  599. data/lib/starter_web/assets/videos/gallery/html5/video1.subtitles.vtt +39 -0
  600. data/lib/starter_web/assets/videos/gallery/html5/video2-poster.jpg +0 -0
  601. data/lib/starter_web/assets/videos/gallery/html5/303/237video2-poster.jpg +0 -0
  602. data/lib/starter_web/assets/videos/gallery/video1-poster.1920..jpg +0 -0
  603. data/lib/starter_web/assets/videos/gallery/video_adele_last_carpool_caraoke_poster.1920.jpg +0 -0
  604. data/lib/starter_web/assets/videos/gallery/video_adele_last_carpool_caraoke_poster.jpg +0 -0
  605. data/lib/starter_web/assets/videos/gallery/video_gaga-poster.jpg +0 -0
  606. data/lib/starter_web/assets/videos/gallery/video_james_carpool_caraoke_poster.jpg +0 -0
  607. data/lib/starter_web/collections/posts/public/featured/_posts/2023-10-18-url-types.adoc +98 -0
  608. data/lib/starter_web/config.ru +1 -1
  609. data/lib/starter_web/dot.gitattributes +1 -1
  610. data/lib/starter_web/dot.nojekyll +1 -1
  611. data/lib/starter_web/package.json +1 -1
  612. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/111_about_the_converter.asciidoc +5 -0
  613. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/112_getting_started.asciidoc +3 -0
  614. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/_includes/documents/100_converter/113_themes.asciidoc +1 -0
  615. data/lib/starter_web/pages/public/asciidoc_skeletons/documentation/documentation.adoc +11 -7
  616. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/100_chapter.asciidoc +27 -11
  617. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/_includes/documents/200_chapter.asciidoc +3 -0
  618. data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +12 -7
  619. data/lib/starter_web/pages/public/asciidoc_skeletons/simple-document/simple.adoc +14 -7
  620. data/lib/starter_web/pages/public/features/general.adoc +12 -1
  621. data/lib/starter_web/pages/public/features/template.adoc +37 -38
  622. data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_all_books.adoc +4 -3
  623. data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_biography.adoc +2 -3
  624. data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_fantasy.adoc +2 -2
  625. data/lib/starter_web/pages/public/learn/bookshelf/article_previewer/viewer_romance.adoc +2 -2
  626. data/lib/starter_web/pages/public/learn/bookshelf/jekyll_collections.adoc +6 -5
  627. data/lib/starter_web/pages/public/learn/roundtrip/_includes/attributes.asciidoc +1 -0
  628. data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/themes_rouge.asciidoc +4 -0
  629. data/lib/starter_web/pages/public/learn/roundtrip/asciidoc_extensions.adoc +6 -5
  630. data/lib/starter_web/pages/public/learn/roundtrip/bootstrap_themes.adoc +2 -0
  631. data/lib/starter_web/pages/public/learn/roundtrip/highlghter_rouge.adoc +7 -2
  632. data/lib/starter_web/pages/public/learn/roundtrip/icon_fonts.adoc +7 -2
  633. data/lib/starter_web/pages/public/learn/roundtrip/lunr_search.adoc +12 -3
  634. data/lib/starter_web/pages/public/learn/roundtrip/modal_extentions.adoc +4 -2
  635. data/lib/starter_web/pages/public/learn/roundtrip/present_images.adoc +49 -40
  636. data/lib/starter_web/pages/public/learn/roundtrip/present_videos.adoc +266 -65
  637. data/lib/starter_web/pages/public/learn/roundtrip/responsive_tables.adoc +5 -2
  638. data/lib/starter_web/pages/public/learn/roundtrip/typography.adoc +1 -0
  639. data/lib/starter_web/pages/public/learn/where_to_go.adoc +2 -1
  640. data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +3 -1
  641. data/lib/starter_web/pages/public/legal/en/200_impress.adoc +3 -1
  642. data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +595 -632
  643. data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +2 -2
  644. data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +3 -2
  645. data/lib/starter_web/pages/public/plans/plans.adoc +14 -5
  646. data/lib/starter_web/pages/public/tools/previewer/_includes/attributes.asciidoc +69 -0
  647. data/lib/starter_web/pages/public/tools/previewer/_includes/documents/readme +0 -0
  648. data/lib/starter_web/pages/public/tools/previewer/preview_bootstrap_theme.adoc +3093 -3093
  649. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  650. data/lib/starter_web/utilsrv/package.json +1 -1
  651. data/lib/starter_web/utilsrv/server.js +1 -1
  652. metadata +172 -94
  653. data/assets/data/galleries.json +0 -156
  654. data/assets/themes/j1/adapter/js/justifiedGalleryCustomizer.js +0 -360
  655. data/assets/themes/j1/modules/backstretch/js/v2.1.16/backstretch.js +0 -1694
  656. data/assets/themes/j1/modules/backstretch/js/v2.1.16/backstretch.min.js +0 -19
  657. data/assets/themes/j1/modules/iframeResizer/js/client/iframeResizer.contentWindow.map +0 -1
  658. data/assets/themes/j1/modules/iframeResizer/js/resizer.map +0 -1
  659. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.7.0/css/justifiedGallery.css +0 -110
  660. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.7.0/css/justifiedGallery.min.css +0 -110
  661. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.7.0/css/theme/uno.css +0 -23
  662. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.7.0/js/justifiedGallery.3.7.0.js +0 -1229
  663. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.7.0/js/justifiedGallery.js +0 -1229
  664. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.7.0/js/justifiedGallery.min.js +0 -8
  665. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.7.0/less/.csslintrc +0 -20
  666. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.7.0/less/justifiedGallery.less +0 -113
  667. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.8.0/css/justifiedGallery.css +0 -110
  668. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.8.0/css/justifiedGallery.min.css +0 -110
  669. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.8.0/js/justifiedGallery.js +0 -1245
  670. data/assets/themes/j1/modules/justifiedGallery/_versions/v3.8.0/js/justifiedGallery.min.js +0 -7
  671. data/assets/themes/j1/modules/justifiedGallery/css/_archived/justifiedGallery.css +0 -110
  672. data/assets/themes/j1/modules/justifiedGallery/css/_archived/justifiedGallery.min.css +0 -110
  673. data/assets/themes/j1/modules/lightGallery/css/core/lg-fb-comment-box.css +0 -58
  674. data/assets/themes/j1/modules/lightGallery/css/core/lg-fb-comment-box.min.css +0 -5
  675. data/assets/themes/j1/modules/lightGallery/css/core/lg-transitions.css +0 -778
  676. data/assets/themes/j1/modules/lightGallery/css/core/lg-transitions.min.css +0 -5
  677. data/assets/themes/j1/modules/lightGallery/css/core/lightgallery.css +0 -981
  678. data/assets/themes/j1/modules/lightGallery/css/core/lightgallery.min.css +0 -5
  679. data/assets/themes/j1/modules/lightGallery/css/fonts/lg.eot +0 -0
  680. data/assets/themes/j1/modules/lightGallery/css/fonts/lg.ttf +0 -0
  681. data/assets/themes/j1/modules/lightGallery/css/fonts/lg.woff +0 -0
  682. data/assets/themes/j1/modules/lightGallery/css/themes/uno.css +0 -262
  683. data/assets/themes/j1/modules/lightGallery/css/themes/uno.min.css +0 -15
  684. data/assets/themes/j1/modules/lightGallery/js/core/j1/lightgallery.js +0 -1375
  685. data/assets/themes/j1/modules/lightGallery/js/core/j1/lightgallery.min.js +0 -5
  686. data/assets/themes/j1/modules/lightGallery/js/core/lightgallery.js +0 -1362
  687. data/assets/themes/j1/modules/lightGallery/js/core/lightgallery.min.js +0 -4
  688. data/assets/themes/j1/modules/lightGallery/js/modules/lg-autoplay.js +0 -206
  689. data/assets/themes/j1/modules/lightGallery/js/modules/lg-autoplay.min.js +0 -5
  690. data/assets/themes/j1/modules/lightGallery/js/modules/lg-fullscreen.js +0 -126
  691. data/assets/themes/j1/modules/lightGallery/js/modules/lg-fullscreen.min.js +0 -5
  692. data/assets/themes/j1/modules/lightGallery/js/modules/lg-hash.js +0 -101
  693. data/assets/themes/j1/modules/lightGallery/js/modules/lg-hash.min.js +0 -5
  694. data/assets/themes/j1/modules/lightGallery/js/modules/lg-pager.js +0 -105
  695. data/assets/themes/j1/modules/lightGallery/js/modules/lg-pager.min.js +0 -5
  696. data/assets/themes/j1/modules/lightGallery/js/modules/lg-share.js +0 -107
  697. data/assets/themes/j1/modules/lightGallery/js/modules/lg-share.min.js +0 -5
  698. data/assets/themes/j1/modules/lightGallery/js/modules/lg-thumbnail.js +0 -486
  699. data/assets/themes/j1/modules/lightGallery/js/modules/lg-thumbnail.min.js +0 -7
  700. data/assets/themes/j1/modules/lightGallery/js/modules/lg-zoom.js +0 -527
  701. data/assets/themes/j1/modules/lightGallery/js/modules/lg-zoom.min.js +0 -5
  702. data/assets/themes/j1/modules/msDropdown/js/msDropdown.min.js.map +0 -1
  703. data/assets/themes/j1/modules/popper/js/popper.min.js.map +0 -1
  704. data/assets/themes/j1/modules/rangeSlider/js/15.5.1/nouislider.js +0 -2337
  705. data/assets/themes/j1/modules/rangeSlider/js/15.5.1/nouislider.min.js +0 -1
  706. data/assets/themes/j1/modules/rangeSlider/js/9.1.0/nouislider.js +0 -2534
  707. data/assets/themes/j1/modules/slick/lightbox/js/slick-lightbox.min.js.map +0 -1
  708. data/assets/themes/j1/modules/themeSwitcher/js/_unsued/switcher.1.js +0 -454
  709. data/assets/themes/j1/modules/vimeo/froogaloop/js/froogaloop2.js +0 -4
  710. data/assets/themes/j1/modules/vimeo/froogaloop/js/froogaloop2.min.js +0 -4
  711. data/assets/themes/j1/modules/vimeo/player/js/player.js +0 -2138
  712. data/assets/themes/j1/modules/vimeo/player/js/player.js.map +0 -1
  713. data/assets/themes/j1/modules/vimeo/player/js/player.min.js +0 -2
  714. data/assets/themes/j1/modules/vimeo/player/js/player.min.js.map +0 -1
  715. data/lib/starter_web/_data/modules/justifiedGallery.yml +0 -556
  716. data/lib/starter_web/assets/videos/gallery/vk/hai.jpg +0 -0
  717. data/lib/starter_web/assets/videos/gallery/vk/otter.jpg +0 -0
  718. /data/assets/themes/j1/modules/backstretch/{LICENSE-MIT → LICENSE} +0 -0
  719. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/animation-w.png +0 -0
  720. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/customize-w.png +0 -0
  721. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/dynamic-w.png +0 -0
  722. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/facebook-icon.svg +0 -0
  723. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/googleplus-icon.svg +0 -0
  724. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/html5-w.png +0 -0
  725. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/linked-in.png +0 -0
  726. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/module-w.png +0 -0
  727. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/play-button.png +0 -0
  728. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/responsive-w.png +0 -0
  729. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/thumb-w.png +0 -0
  730. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/touch-w.png +0 -0
  731. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/twitter-icon.svg +0 -0
  732. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/twitter.png +0 -0
  733. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/video1-w.png +0 -0
  734. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/zoom-w.png +0 -0
  735. /data/assets/themes/j1/modules/lightGallery/css/themes/{icons → uno/icons}/zoom.png +0 -0
  736. /data/assets/themes/j1/modules/lightGallery/{css/img → images}/loading.gif +0 -0
  737. /data/assets/themes/j1/modules/lightGallery/{css/img → img}/video-play.png +0 -0
  738. /data/assets/themes/j1/modules/lightGallery/{css/img → img}/vimeo-play.png +0 -0
  739. /data/assets/themes/j1/modules/lightGallery/{css/img → img}/youtube-play.png +0 -0
  740. /data/assets/themes/j1/modules/lightGallery/js/{modules → plugins}/j1/j1-video.js +0 -0
  741. /data/assets/themes/j1/modules/lightGallery/js/{modules → plugins}/j1/j1-video.min.js +0 -0
@@ -1,2534 +0,0 @@
1
- /*!
2
- * Materialize 1.0.0 (http://materializecss.com)
3
- * Copyright 2014-2015 Materialize
4
- * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
5
- */
6
-
7
- // wNumb - JavaScript Number & Money formatting
8
- // See: https://github.com/leongersen/wnumb
9
- //
10
- /*
11
- (function(){function r(b){return b.split("").reverse().join("")}function s(b,f,c){if((b[f]||b[c])&&b[f]===b[c])throw Error(f);}function v(b,f,c,d,e,p,q,k,l,h,n,a){q=a;var m,g=n="";p&&(a=p(a));if("number"!==typeof a||!isFinite(a))return!1;b&&0===parseFloat(a.toFixed(b))&&(a=0);0>a&&(m=!0,a=Math.abs(a));b&&(p=Math.pow(10,b),a=(Math.round(a*p)/p).toFixed(b));a=a.toString();-1!==a.indexOf(".")&&(b=a.split("."),a=b[0],c&&(n=c+b[1]));f&&(a=r(a).match(/.{1,3}/g),a=r(a.join(r(f))));m&&k&&(g+=k);d&&(g+=d);
12
- m&&l&&(g+=l);g=g+a+n;e&&(g+=e);h&&(g=h(g,q));return g}function w(b,f,c,d,e,h,q,k,l,r,n,a){var m;b="";n&&(a=n(a));if(!a||"string"!==typeof a)return!1;k&&a.substring(0,k.length)===k&&(a=a.replace(k,""),m=!0);d&&a.substring(0,d.length)===d&&(a=a.replace(d,""));l&&a.substring(0,l.length)===l&&(a=a.replace(l,""),m=!0);e&&a.slice(-1*e.length)===e&&(a=a.slice(0,-1*e.length));f&&(a=a.split(f).join(""));c&&(a=a.replace(c,"."));m&&(b+="-");b=Number((b+a).replace(/[^0-9\.\-.]/g,""));q&&(b=q(b));return"number"===
13
- typeof b&&isFinite(b)?b:!1}function x(b){var f,c,d,e={};for(f=0;f<h.length;f+=1)c=h[f],d=b[c],void 0===d?e[c]="negative"!==c||e.negativeBefore?"mark"===c&&"."!==e.thousand?".":!1:"-":"decimals"===c?0<d&&8>d&&(e[c]=d):"encoder"===c||"decoder"===c||"edit"===c||"undo"===c?"function"===typeof d&&(e[c]=d):"string"===typeof d&&(e[c]=d);s(e,"mark","thousand");s(e,"prefix","negative");s(e,"prefix","negativeBefore");return e}function u(b,f,c){var d,e=[];for(d=0;d<h.length;d+=1)e.push(b[h[d]]);e.push(c);return f.apply("",
14
- e)}function t(b){if(!(this instanceof t))return new t(b);"object"===typeof b&&(b=x(b),this.to=function(f){return u(b,v,f)},this.from=function(f){return u(b,w,f)})}var h="decimals thousand mark prefix postfix encoder decoder negativeBefore negative edit undo".split(" ");window.wNumb=t})();
15
- */
16
-
17
- (function(factory) {
18
- if (typeof define === "function" && define.amd) {
19
- // AMD. Register as an anonymous module.
20
- define([], factory);
21
- } else if (typeof exports === "object") {
22
- // Node/CommonJS
23
- module.exports = factory();
24
- } else {
25
- // Browser globals
26
- window.wNumb = factory();
27
- }
28
- })(function() {
29
- "use strict";
30
-
31
- var FormatOptions = [
32
- "decimals",
33
- "thousand",
34
- "mark",
35
- "prefix",
36
- "suffix",
37
- "encoder",
38
- "decoder",
39
- "negativeBefore",
40
- "negative",
41
- "edit",
42
- "undo"
43
- ];
44
-
45
- // General
46
-
47
- // Reverse a string
48
- function strReverse(a) {
49
- return a
50
- .split("")
51
- .reverse()
52
- .join("");
53
- }
54
-
55
- // Check if a string starts with a specified prefix.
56
- function strStartsWith(input, match) {
57
- return input.substring(0, match.length) === match;
58
- }
59
-
60
- // Check is a string ends in a specified suffix.
61
- function strEndsWith(input, match) {
62
- return input.slice(-1 * match.length) === match;
63
- }
64
-
65
- // Throw an error if formatting options are incompatible.
66
- function throwEqualError(F, a, b) {
67
- if ((F[a] || F[b]) && F[a] === F[b]) {
68
- throw new Error(a);
69
- }
70
- }
71
-
72
- // Check if a number is finite and not NaN
73
- function isValidNumber(input) {
74
- return typeof input === "number" && isFinite(input);
75
- }
76
-
77
- // Provide rounding-accurate toFixed method.
78
- // Borrowed: http://stackoverflow.com/a/21323330/775265
79
- function toFixed(value, exp) {
80
- value = value.toString().split("e");
81
- value = Math.round(+(value[0] + "e" + (value[1] ? +value[1] + exp : exp)));
82
- value = value.toString().split("e");
83
- return (+(value[0] + "e" + (value[1] ? +value[1] - exp : -exp))).toFixed(exp);
84
- }
85
-
86
- // Formatting
87
-
88
- // Accept a number as input, output formatted string.
89
- function formatTo(
90
- decimals,
91
- thousand,
92
- mark,
93
- prefix,
94
- suffix,
95
- encoder,
96
- decoder,
97
- negativeBefore,
98
- negative,
99
- edit,
100
- undo,
101
- input
102
- ) {
103
- var originalInput = input,
104
- inputIsNegative,
105
- inputPieces,
106
- inputBase,
107
- inputDecimals = "",
108
- output = "";
109
-
110
- // Apply user encoder to the input.
111
- // Expected outcome: number.
112
- if (encoder) {
113
- input = encoder(input);
114
- }
115
-
116
- // Stop if no valid number was provided, the number is infinite or NaN.
117
- if (!isValidNumber(input)) {
118
- return false;
119
- }
120
-
121
- // Rounding away decimals might cause a value of -0
122
- // when using very small ranges. Remove those cases.
123
- if (decimals !== false && parseFloat(input.toFixed(decimals)) === 0) {
124
- input = 0;
125
- }
126
-
127
- // Formatting is done on absolute numbers,
128
- // decorated by an optional negative symbol.
129
- if (input < 0) {
130
- inputIsNegative = true;
131
- input = Math.abs(input);
132
- }
133
-
134
- // Reduce the number of decimals to the specified option.
135
- if (decimals !== false) {
136
- input = toFixed(input, decimals);
137
- }
138
-
139
- // Transform the number into a string, so it can be split.
140
- input = input.toString();
141
-
142
- // Break the number on the decimal separator.
143
- if (input.indexOf(".") !== -1) {
144
- inputPieces = input.split(".");
145
-
146
- inputBase = inputPieces[0];
147
-
148
- if (mark) {
149
- inputDecimals = mark + inputPieces[1];
150
- }
151
- } else {
152
- // If it isn't split, the entire number will do.
153
- inputBase = input;
154
- }
155
-
156
- // Group numbers in sets of three.
157
- if (thousand) {
158
- inputBase = strReverse(inputBase).match(/.{1,3}/g);
159
- inputBase = strReverse(inputBase.join(strReverse(thousand)));
160
- }
161
-
162
- // If the number is negative, prefix with negation symbol.
163
- if (inputIsNegative && negativeBefore) {
164
- output += negativeBefore;
165
- }
166
-
167
- // Prefix the number
168
- if (prefix) {
169
- output += prefix;
170
- }
171
-
172
- // Normal negative option comes after the prefix. Defaults to '-'.
173
- if (inputIsNegative && negative) {
174
- output += negative;
175
- }
176
-
177
- // Append the actual number.
178
- output += inputBase;
179
- output += inputDecimals;
180
-
181
- // Apply the suffix.
182
- if (suffix) {
183
- output += suffix;
184
- }
185
-
186
- // Run the output through a user-specified post-formatter.
187
- if (edit) {
188
- output = edit(output, originalInput);
189
- }
190
-
191
- // All done.
192
- return output;
193
- }
194
-
195
- // Accept a sting as input, output decoded number.
196
- function formatFrom(
197
- decimals,
198
- thousand,
199
- mark,
200
- prefix,
201
- suffix,
202
- encoder,
203
- decoder,
204
- negativeBefore,
205
- negative,
206
- edit,
207
- undo,
208
- input
209
- ) {
210
- var originalInput = input,
211
- inputIsNegative,
212
- output = "";
213
-
214
- // User defined pre-decoder. Result must be a non empty string.
215
- if (undo) {
216
- input = undo(input);
217
- }
218
-
219
- // Test the input. Can't be empty.
220
- if (!input || typeof input !== "string") {
221
- return false;
222
- }
223
-
224
- // If the string starts with the negativeBefore value: remove it.
225
- // Remember is was there, the number is negative.
226
- if (negativeBefore && strStartsWith(input, negativeBefore)) {
227
- input = input.replace(negativeBefore, "");
228
- inputIsNegative = true;
229
- }
230
-
231
- // Repeat the same procedure for the prefix.
232
- if (prefix && strStartsWith(input, prefix)) {
233
- input = input.replace(prefix, "");
234
- }
235
-
236
- // And again for negative.
237
- if (negative && strStartsWith(input, negative)) {
238
- input = input.replace(negative, "");
239
- inputIsNegative = true;
240
- }
241
-
242
- // Remove the suffix.
243
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice
244
- if (suffix && strEndsWith(input, suffix)) {
245
- input = input.slice(0, -1 * suffix.length);
246
- }
247
-
248
- // Remove the thousand grouping.
249
- if (thousand) {
250
- input = input.split(thousand).join("");
251
- }
252
-
253
- // Set the decimal separator back to period.
254
- if (mark) {
255
- input = input.replace(mark, ".");
256
- }
257
-
258
- // Prepend the negative symbol.
259
- if (inputIsNegative) {
260
- output += "-";
261
- }
262
-
263
- // Add the number
264
- output += input;
265
-
266
- // Trim all non-numeric characters (allow '.' and '-');
267
- output = output.replace(/[^0-9\.\-.]/g, "");
268
-
269
- // The value contains no parse-able number.
270
- if (output === "") {
271
- return false;
272
- }
273
-
274
- // Covert to number.
275
- output = Number(output);
276
-
277
- // Run the user-specified post-decoder.
278
- if (decoder) {
279
- output = decoder(output);
280
- }
281
-
282
- // Check is the output is valid, otherwise: return false.
283
- if (!isValidNumber(output)) {
284
- return false;
285
- }
286
-
287
- return output;
288
- }
289
-
290
- // Framework
291
-
292
- // Validate formatting options
293
- function validate(inputOptions) {
294
- var i,
295
- optionName,
296
- optionValue,
297
- filteredOptions = {};
298
-
299
- if (inputOptions["suffix"] === undefined) {
300
- inputOptions["suffix"] = inputOptions["postfix"];
301
- }
302
-
303
- for (i = 0; i < FormatOptions.length; i += 1) {
304
- optionName = FormatOptions[i];
305
- optionValue = inputOptions[optionName];
306
-
307
- if (optionValue === undefined) {
308
- // Only default if negativeBefore isn't set.
309
- if (optionName === "negative" && !filteredOptions.negativeBefore) {
310
- filteredOptions[optionName] = "-";
311
- // Don't set a default for mark when 'thousand' is set.
312
- } else if (optionName === "mark" && filteredOptions.thousand !== ".") {
313
- filteredOptions[optionName] = ".";
314
- } else {
315
- filteredOptions[optionName] = false;
316
- }
317
-
318
- // Floating points in JS are stable up to 7 decimals.
319
- } else if (optionName === "decimals") {
320
- if (optionValue >= 0 && optionValue < 8) {
321
- filteredOptions[optionName] = optionValue;
322
- } else {
323
- throw new Error(optionName);
324
- }
325
-
326
- // These options, when provided, must be functions.
327
- } else if (
328
- optionName === "encoder" ||
329
- optionName === "decoder" ||
330
- optionName === "edit" ||
331
- optionName === "undo"
332
- ) {
333
- if (typeof optionValue === "function") {
334
- filteredOptions[optionName] = optionValue;
335
- } else {
336
- throw new Error(optionName);
337
- }
338
-
339
- // Other options are strings.
340
- } else {
341
- if (typeof optionValue === "string") {
342
- filteredOptions[optionName] = optionValue;
343
- } else {
344
- throw new Error(optionName);
345
- }
346
- }
347
- }
348
-
349
- // Some values can't be extracted from a
350
- // string if certain combinations are present.
351
- throwEqualError(filteredOptions, "mark", "thousand");
352
- throwEqualError(filteredOptions, "prefix", "negative");
353
- throwEqualError(filteredOptions, "prefix", "negativeBefore");
354
-
355
- return filteredOptions;
356
- }
357
-
358
- // Pass all options as function arguments
359
- function passAll(options, method, input) {
360
- var i,
361
- args = [];
362
-
363
- // Add all options in order of FormatOptions
364
- for (i = 0; i < FormatOptions.length; i += 1) {
365
- args.push(options[FormatOptions[i]]);
366
- }
367
-
368
- // Append the input, then call the method, presenting all
369
- // options as arguments.
370
- args.push(input);
371
- return method.apply("", args);
372
- }
373
-
374
- function wNumb(options) {
375
- if (!(this instanceof wNumb)) {
376
- return new wNumb(options);
377
- }
378
-
379
- if (typeof options !== "object") {
380
- return;
381
- }
382
-
383
- options = validate(options);
384
-
385
- // Call 'formatTo' with proper arguments.
386
- this.to = function(input) {
387
- return passAll(options, formatTo, input);
388
- };
389
-
390
- // Call 'formatFrom' with proper arguments.
391
- this.from = function(input) {
392
- return passAll(options, formatFrom, input);
393
- };
394
- }
395
-
396
- return wNumb;
397
- });
398
-
399
-
400
- /*! nouislider - 9.1.0 - 2016-12-10 16:00:32 */
401
-
402
- (function (factory) {
403
-
404
- if ( typeof define === 'function' && define.amd ) {
405
-
406
- // AMD. Register as an anonymous module.
407
- define([], factory);
408
-
409
- } else if ( typeof exports === 'object' ) {
410
-
411
- // Node/CommonJS
412
- module.exports = factory();
413
-
414
- } else {
415
-
416
- // Browser globals
417
- window.noUiSlider = factory();
418
- }
419
-
420
- }(function( ){
421
-
422
- 'use strict';
423
-
424
-
425
- // Creates a node, adds it to target, returns the new node.
426
- function addNodeTo ( target, className ) {
427
- var div = document.createElement('div');
428
- addClass(div, className);
429
- target.appendChild(div);
430
- return div;
431
- }
432
-
433
- // Removes duplicates from an array.
434
- function unique ( array ) {
435
- return array.filter(function(a){
436
- return !this[a] ? this[a] = true : false;
437
- }, {});
438
- }
439
-
440
- // Round a value to the closest 'to'.
441
- function closest ( value, to ) {
442
- return Math.round(value / to) * to;
443
- }
444
-
445
- // Current position of an element relative to the document.
446
- function offset ( elem, orientation ) {
447
-
448
- var rect = elem.getBoundingClientRect(),
449
- doc = elem.ownerDocument,
450
- docElem = doc.documentElement,
451
- pageOffset = getPageOffset();
452
-
453
- // getBoundingClientRect contains left scroll in Chrome on Android.
454
- // I haven't found a feature detection that proves this. Worst case
455
- // scenario on mis-match: the 'tap' feature on horizontal sliders breaks.
456
- if ( /webkit.*Chrome.*Mobile/i.test(navigator.userAgent) ) {
457
- pageOffset.x = 0;
458
- }
459
-
460
- return orientation ? (rect.top + pageOffset.y - docElem.clientTop) : (rect.left + pageOffset.x - docElem.clientLeft);
461
- }
462
-
463
- // Checks whether a value is numerical.
464
- function isNumeric ( a ) {
465
- return typeof a === 'number' && !isNaN( a ) && isFinite( a );
466
- }
467
-
468
- // Sets a class and removes it after [duration] ms.
469
- function addClassFor ( element, className, duration ) {
470
- if (duration > 0) {
471
- addClass(element, className);
472
- setTimeout(function(){
473
- removeClass(element, className);
474
- }, duration);
475
- }
476
- }
477
-
478
- // Limits a value to 0 - 100
479
- function limit ( a ) {
480
- return Math.max(Math.min(a, 100), 0);
481
- }
482
-
483
- // Wraps a variable as an array, if it isn't one yet.
484
- // Note that an input array is returned by reference!
485
- function asArray ( a ) {
486
- return Array.isArray(a) ? a : [a];
487
- }
488
-
489
- // Counts decimals
490
- function countDecimals ( numStr ) {
491
- numStr = String(numStr);
492
- var pieces = numStr.split(".");
493
- return pieces.length > 1 ? pieces[1].length : 0;
494
- }
495
-
496
- // http://youmightnotneedjquery.com/#add_class
497
- function addClass ( el, className ) {
498
- if ( el.classList ) {
499
- el.classList.add(className);
500
- } else {
501
- el.className += ' ' + className;
502
- }
503
- }
504
-
505
- // http://youmightnotneedjquery.com/#remove_class
506
- function removeClass ( el, className ) {
507
- if ( el.classList ) {
508
- el.classList.remove(className);
509
- } else {
510
- el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
511
- }
512
- }
513
-
514
- // https://plainjs.com/javascript/attributes/adding-removing-and-testing-for-classes-9/
515
- function hasClass ( el, className ) {
516
- return el.classList ? el.classList.contains(className) : new RegExp('\\b' + className + '\\b').test(el.className);
517
- }
518
-
519
- // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY#Notes
520
- function getPageOffset ( ) {
521
-
522
- var supportPageOffset = window.pageXOffset !== undefined,
523
- isCSS1Compat = ((document.compatMode || "") === "CSS1Compat"),
524
- x = supportPageOffset ? window.pageXOffset : isCSS1Compat ? document.documentElement.scrollLeft : document.body.scrollLeft,
525
- y = supportPageOffset ? window.pageYOffset : isCSS1Compat ? document.documentElement.scrollTop : document.body.scrollTop;
526
-
527
- return {
528
- x: x,
529
- y: y
530
- };
531
- }
532
-
533
- // we provide a function to compute constants instead
534
- // of accessing window.* as soon as the module needs it
535
- // so that we do not compute anything if not needed
536
- function getActions ( ) {
537
-
538
- // Determine the events to bind. IE11 implements pointerEvents without
539
- // a prefix, which breaks compatibility with the IE10 implementation.
540
- return window.navigator.pointerEnabled ? {
541
- start: 'pointerdown',
542
- move: 'pointermove',
543
- end: 'pointerup'
544
- } : window.navigator.msPointerEnabled ? {
545
- start: 'MSPointerDown',
546
- move: 'MSPointerMove',
547
- end: 'MSPointerUp'
548
- } : {
549
- start: 'mousedown touchstart',
550
- move: 'mousemove touchmove',
551
- end: 'mouseup touchend'
552
- };
553
- }
554
-
555
-
556
- // Value calculation
557
-
558
- // Determine the size of a sub-range in relation to a full range.
559
- function subRangeRatio ( pa, pb ) {
560
- return (100 / (pb - pa));
561
- }
562
-
563
- // (percentage) How many percent is this value of this range?
564
- function fromPercentage ( range, value ) {
565
- return (value * 100) / ( range[1] - range[0] );
566
- }
567
-
568
- // (percentage) Where is this value on this range?
569
- function toPercentage ( range, value ) {
570
- return fromPercentage( range, range[0] < 0 ?
571
- value + Math.abs(range[0]) :
572
- value - range[0] );
573
- }
574
-
575
- // (value) How much is this percentage on this range?
576
- function isPercentage ( range, value ) {
577
- return ((value * ( range[1] - range[0] )) / 100) + range[0];
578
- }
579
-
580
-
581
- // Range conversion
582
-
583
- function getJ ( value, arr ) {
584
-
585
- var j = 1;
586
-
587
- while ( value >= arr[j] ){
588
- j += 1;
589
- }
590
-
591
- return j;
592
- }
593
-
594
- // (percentage) Input a value, find where, on a scale of 0-100, it applies.
595
- function toStepping ( xVal, xPct, value ) {
596
-
597
- if ( value >= xVal.slice(-1)[0] ){
598
- return 100;
599
- }
600
-
601
- var j = getJ( value, xVal ), va, vb, pa, pb;
602
-
603
- va = xVal[j-1];
604
- vb = xVal[j];
605
- pa = xPct[j-1];
606
- pb = xPct[j];
607
-
608
- return pa + (toPercentage([va, vb], value) / subRangeRatio (pa, pb));
609
- }
610
-
611
- // (value) Input a percentage, find where it is on the specified range.
612
- function fromStepping ( xVal, xPct, value ) {
613
-
614
- // There is no range group that fits 100
615
- if ( value >= 100 ){
616
- return xVal.slice(-1)[0];
617
- }
618
-
619
- var j = getJ( value, xPct ), va, vb, pa, pb;
620
-
621
- va = xVal[j-1];
622
- vb = xVal[j];
623
- pa = xPct[j-1];
624
- pb = xPct[j];
625
-
626
- return isPercentage([va, vb], (value - pa) * subRangeRatio (pa, pb));
627
- }
628
-
629
- // (percentage) Get the step that applies at a certain value.
630
- function getStep ( xPct, xSteps, snap, value ) {
631
-
632
- if ( value === 100 ) {
633
- return value;
634
- }
635
-
636
- var j = getJ( value, xPct ), a, b;
637
-
638
- // If 'snap' is set, steps are used as fixed points on the slider.
639
- if ( snap ) {
640
-
641
- a = xPct[j-1];
642
- b = xPct[j];
643
-
644
- // Find the closest position, a or b.
645
- if ((value - a) > ((b-a)/2)){
646
- return b;
647
- }
648
-
649
- return a;
650
- }
651
-
652
- if ( !xSteps[j-1] ){
653
- return value;
654
- }
655
-
656
- return xPct[j-1] + closest(
657
- value - xPct[j-1],
658
- xSteps[j-1]
659
- );
660
- }
661
-
662
-
663
- // Entry parsing
664
-
665
- function handleEntryPoint ( index, value, that ) {
666
-
667
- var percentage;
668
-
669
- // Wrap numerical input in an array.
670
- if ( typeof value === "number" ) {
671
- value = [value];
672
- }
673
-
674
- // Reject any invalid input, by testing whether value is an array.
675
- if ( Object.prototype.toString.call( value ) !== '[object Array]' ){
676
- throw new Error("noUiSlider: 'range' contains invalid value.");
677
- }
678
-
679
- // Covert min/max syntax to 0 and 100.
680
- if ( index === 'min' ) {
681
- percentage = 0;
682
- } else if ( index === 'max' ) {
683
- percentage = 100;
684
- } else {
685
- percentage = parseFloat( index );
686
- }
687
-
688
- // Check for correct input.
689
- if ( !isNumeric( percentage ) || !isNumeric( value[0] ) ) {
690
- throw new Error("noUiSlider: 'range' value isn't numeric.");
691
- }
692
-
693
- // Store values.
694
- that.xPct.push( percentage );
695
- that.xVal.push( value[0] );
696
-
697
- // NaN will evaluate to false too, but to keep
698
- // logging clear, set step explicitly. Make sure
699
- // not to override the 'step' setting with false.
700
- if ( !percentage ) {
701
- if ( !isNaN( value[1] ) ) {
702
- that.xSteps[0] = value[1];
703
- }
704
- } else {
705
- that.xSteps.push( isNaN(value[1]) ? false : value[1] );
706
- }
707
-
708
- that.xHighestCompleteStep.push(0);
709
- }
710
-
711
- function handleStepPoint ( i, n, that ) {
712
-
713
- // Ignore 'false' stepping.
714
- if ( !n ) {
715
- return true;
716
- }
717
-
718
- // Factor to range ratio
719
- that.xSteps[i] = fromPercentage([
720
- that.xVal[i]
721
- ,that.xVal[i+1]
722
- ], n) / subRangeRatio (
723
- that.xPct[i],
724
- that.xPct[i+1] );
725
-
726
- var totalSteps = (that.xVal[i+1] - that.xVal[i]) / that.xNumSteps[i];
727
- var highestStep = Math.ceil(Number(totalSteps.toFixed(3)) - 1);
728
- var step = that.xVal[i] + (that.xNumSteps[i] * highestStep);
729
-
730
- that.xHighestCompleteStep[i] = step;
731
- }
732
-
733
-
734
- // Interface
735
-
736
- // The interface to Spectrum handles all direction-based
737
- // conversions, so the above values are unaware.
738
-
739
- function Spectrum ( entry, snap, direction, singleStep ) {
740
-
741
- this.xPct = [];
742
- this.xVal = [];
743
- this.xSteps = [ singleStep || false ];
744
- this.xNumSteps = [ false ];
745
- this.xHighestCompleteStep = [];
746
-
747
- this.snap = snap;
748
- this.direction = direction;
749
-
750
- var index, ordered = [ /* [0, 'min'], [1, '50%'], [2, 'max'] */ ];
751
-
752
- // Map the object keys to an array.
753
- for ( index in entry ) {
754
- if ( entry.hasOwnProperty(index) ) {
755
- ordered.push([entry[index], index]);
756
- }
757
- }
758
-
759
- // Sort all entries by value (numeric sort).
760
- if ( ordered.length && typeof ordered[0][0] === "object" ) {
761
- ordered.sort(function(a, b) { return a[0][0] - b[0][0]; });
762
- } else {
763
- ordered.sort(function(a, b) { return a[0] - b[0]; });
764
- }
765
-
766
-
767
- // Convert all entries to subranges.
768
- for ( index = 0; index < ordered.length; index++ ) {
769
- handleEntryPoint(ordered[index][1], ordered[index][0], this);
770
- }
771
-
772
- // Store the actual step values.
773
- // xSteps is sorted in the same order as xPct and xVal.
774
- this.xNumSteps = this.xSteps.slice(0);
775
-
776
- // Convert all numeric steps to the percentage of the subrange they represent.
777
- for ( index = 0; index < this.xNumSteps.length; index++ ) {
778
- handleStepPoint(index, this.xNumSteps[index], this);
779
- }
780
- }
781
-
782
- Spectrum.prototype.getMargin = function ( value ) {
783
-
784
- var step = this.xNumSteps[0];
785
-
786
- if ( step && ((value / step) % 1) !== 0 ) {
787
- throw new Error("noUiSlider: 'limit', 'margin' and 'padding' must be divisible by step.");
788
- }
789
-
790
- return this.xPct.length === 2 ? fromPercentage(this.xVal, value) : false;
791
- };
792
-
793
- Spectrum.prototype.toStepping = function ( value ) {
794
-
795
- value = toStepping( this.xVal, this.xPct, value );
796
-
797
- return value;
798
- };
799
-
800
- Spectrum.prototype.fromStepping = function ( value ) {
801
-
802
- return fromStepping( this.xVal, this.xPct, value );
803
- };
804
-
805
- Spectrum.prototype.getStep = function ( value ) {
806
-
807
- value = getStep(this.xPct, this.xSteps, this.snap, value );
808
-
809
- return value;
810
- };
811
-
812
- Spectrum.prototype.getNearbySteps = function ( value ) {
813
-
814
- var j = getJ(value, this.xPct);
815
-
816
- return {
817
- stepBefore: { startValue: this.xVal[j-2], step: this.xNumSteps[j-2], highestStep: this.xHighestCompleteStep[j-2] },
818
- thisStep: { startValue: this.xVal[j-1], step: this.xNumSteps[j-1], highestStep: this.xHighestCompleteStep[j-1] },
819
- stepAfter: { startValue: this.xVal[j-0], step: this.xNumSteps[j-0], highestStep: this.xHighestCompleteStep[j-0] }
820
- };
821
- };
822
-
823
- Spectrum.prototype.countStepDecimals = function () {
824
- var stepDecimals = this.xNumSteps.map(countDecimals);
825
- return Math.max.apply(null, stepDecimals);
826
- };
827
-
828
- // Outside testing
829
- Spectrum.prototype.convert = function ( value ) {
830
- return this.getStep(this.toStepping(value));
831
- };
832
-
833
- /* Every input option is tested and parsed. This'll prevent
834
- endless validation in internal methods. These tests are
835
- structured with an item for every option available. An
836
- option can be marked as required by setting the 'r' flag.
837
- The testing function is provided with three arguments:
838
- - The provided value for the option;
839
- - A reference to the options object;
840
- - The name for the option;
841
-
842
- The testing function returns false when an error is detected,
843
- or true when everything is OK. It can also modify the option
844
- object, to make sure all values can be correctly looped elsewhere. */
845
-
846
- var defaultFormatter = { 'to': function( value ){
847
- return value !== undefined && value.toFixed(2);
848
- }, 'from': Number };
849
-
850
- function testStep ( parsed, entry ) {
851
-
852
- if ( !isNumeric( entry ) ) {
853
- throw new Error("noUiSlider: 'step' is not numeric.");
854
- }
855
-
856
- // The step option can still be used to set stepping
857
- // for linear sliders. Overwritten if set in 'range'.
858
- parsed.singleStep = entry;
859
- }
860
-
861
- function testRange ( parsed, entry ) {
862
-
863
- // Filter incorrect input.
864
- if ( typeof entry !== 'object' || Array.isArray(entry) ) {
865
- throw new Error("noUiSlider: 'range' is not an object.");
866
- }
867
-
868
- // Catch missing start or end.
869
- if ( entry.min === undefined || entry.max === undefined ) {
870
- throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");
871
- }
872
-
873
- // Catch equal start or end.
874
- if ( entry.min === entry.max ) {
875
- throw new Error("noUiSlider: 'range' 'min' and 'max' cannot be equal.");
876
- }
877
-
878
- parsed.spectrum = new Spectrum(entry, parsed.snap, parsed.dir, parsed.singleStep);
879
- }
880
-
881
- function testStart ( parsed, entry ) {
882
-
883
- entry = asArray(entry);
884
-
885
- // Validate input. Values aren't tested, as the public .val method
886
- // will always provide a valid location.
887
- if ( !Array.isArray( entry ) || !entry.length ) {
888
- throw new Error("noUiSlider: 'start' option is incorrect.");
889
- }
890
-
891
- // Store the number of handles.
892
- parsed.handles = entry.length;
893
-
894
- // When the slider is initialized, the .val method will
895
- // be called with the start options.
896
- parsed.start = entry;
897
- }
898
-
899
- function testSnap ( parsed, entry ) {
900
-
901
- // Enforce 100% stepping within subranges.
902
- parsed.snap = entry;
903
-
904
- if ( typeof entry !== 'boolean' ){
905
- throw new Error("noUiSlider: 'snap' option must be a boolean.");
906
- }
907
- }
908
-
909
- function testAnimate ( parsed, entry ) {
910
-
911
- // Enforce 100% stepping within subranges.
912
- parsed.animate = entry;
913
-
914
- if ( typeof entry !== 'boolean' ){
915
- throw new Error("noUiSlider: 'animate' option must be a boolean.");
916
- }
917
- }
918
-
919
- function testAnimationDuration ( parsed, entry ) {
920
-
921
- parsed.animationDuration = entry;
922
-
923
- if ( typeof entry !== 'number' ){
924
- throw new Error("noUiSlider: 'animationDuration' option must be a number.");
925
- }
926
- }
927
-
928
- function testConnect ( parsed, entry ) {
929
-
930
- var connect = [false];
931
- var i;
932
-
933
- // Map legacy options
934
- if ( entry === 'lower' ) {
935
- entry = [true, false];
936
- }
937
-
938
- else if ( entry === 'upper' ) {
939
- entry = [false, true];
940
- }
941
-
942
- // Handle boolean options
943
- if ( entry === true || entry === false ) {
944
-
945
- for ( i = 1; i < parsed.handles; i++ ) {
946
- connect.push(entry);
947
- }
948
-
949
- connect.push(false);
950
- }
951
-
952
- // Reject invalid input
953
- else if ( !Array.isArray( entry ) || !entry.length || entry.length !== parsed.handles + 1 ) {
954
- throw new Error("noUiSlider: 'connect' option doesn't match handle count.");
955
- }
956
-
957
- else {
958
- connect = entry;
959
- }
960
-
961
- parsed.connect = connect;
962
- }
963
-
964
- function testOrientation ( parsed, entry ) {
965
-
966
- // Set orientation to an a numerical value for easy
967
- // array selection.
968
- switch ( entry ){
969
- case 'horizontal':
970
- parsed.ort = 0;
971
- break;
972
- case 'vertical':
973
- parsed.ort = 1;
974
- break;
975
- default:
976
- throw new Error("noUiSlider: 'orientation' option is invalid.");
977
- }
978
- }
979
-
980
- function testMargin ( parsed, entry ) {
981
-
982
- if ( !isNumeric(entry) ){
983
- throw new Error("noUiSlider: 'margin' option must be numeric.");
984
- }
985
-
986
- // Issue #582
987
- if ( entry === 0 ) {
988
- return;
989
- }
990
-
991
- parsed.margin = parsed.spectrum.getMargin(entry);
992
-
993
- if ( !parsed.margin ) {
994
- throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.");
995
- }
996
- }
997
-
998
- function testLimit ( parsed, entry ) {
999
-
1000
- if ( !isNumeric(entry) ){
1001
- throw new Error("noUiSlider: 'limit' option must be numeric.");
1002
- }
1003
-
1004
- parsed.limit = parsed.spectrum.getMargin(entry);
1005
-
1006
- if ( !parsed.limit || parsed.handles < 2 ) {
1007
- throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.");
1008
- }
1009
- }
1010
-
1011
- function testPadding ( parsed, entry ) {
1012
-
1013
- if ( !isNumeric(entry) ){
1014
- throw new Error("noUiSlider: 'padding' option must be numeric.");
1015
- }
1016
-
1017
- if ( entry === 0 ) {
1018
- return;
1019
- }
1020
-
1021
- parsed.padding = parsed.spectrum.getMargin(entry);
1022
-
1023
- if ( !parsed.padding ) {
1024
- throw new Error("noUiSlider: 'padding' option is only supported on linear sliders.");
1025
- }
1026
-
1027
- if ( parsed.padding < 0 ) {
1028
- throw new Error("noUiSlider: 'padding' option must be a positive number.");
1029
- }
1030
-
1031
- if ( parsed.padding >= 50 ) {
1032
- throw new Error("noUiSlider: 'padding' option must be less than half the range.");
1033
- }
1034
- }
1035
-
1036
- function testDirection ( parsed, entry ) {
1037
-
1038
- // Set direction as a numerical value for easy parsing.
1039
- // Invert connection for RTL sliders, so that the proper
1040
- // handles get the connect/background classes.
1041
- switch ( entry ) {
1042
- case 'ltr':
1043
- parsed.dir = 0;
1044
- break;
1045
- case 'rtl':
1046
- parsed.dir = 1;
1047
- break;
1048
- default:
1049
- throw new Error("noUiSlider: 'direction' option was not recognized.");
1050
- }
1051
- }
1052
-
1053
- function testBehaviour ( parsed, entry ) {
1054
-
1055
- // Make sure the input is a string.
1056
- if ( typeof entry !== 'string' ) {
1057
- throw new Error("noUiSlider: 'behaviour' must be a string containing options.");
1058
- }
1059
-
1060
- // Check if the string contains any keywords.
1061
- // None are required.
1062
- var tap = entry.indexOf('tap') >= 0;
1063
- var drag = entry.indexOf('drag') >= 0;
1064
- var fixed = entry.indexOf('fixed') >= 0;
1065
- var snap = entry.indexOf('snap') >= 0;
1066
- var hover = entry.indexOf('hover') >= 0;
1067
-
1068
- if ( fixed ) {
1069
-
1070
- if ( parsed.handles !== 2 ) {
1071
- throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");
1072
- }
1073
-
1074
- // Use margin to enforce fixed state
1075
- testMargin(parsed, parsed.start[1] - parsed.start[0]);
1076
- }
1077
-
1078
- parsed.events = {
1079
- tap: tap || snap,
1080
- drag: drag,
1081
- fixed: fixed,
1082
- snap: snap,
1083
- hover: hover
1084
- };
1085
- }
1086
-
1087
- function testTooltips ( parsed, entry ) {
1088
-
1089
- if ( entry === false ) {
1090
- return;
1091
- }
1092
-
1093
- else if ( entry === true ) {
1094
-
1095
- parsed.tooltips = [];
1096
-
1097
- for ( var i = 0; i < parsed.handles; i++ ) {
1098
- parsed.tooltips.push(true);
1099
- }
1100
- }
1101
-
1102
- else {
1103
-
1104
- parsed.tooltips = asArray(entry);
1105
-
1106
- if ( parsed.tooltips.length !== parsed.handles ) {
1107
- throw new Error("noUiSlider: must pass a formatter for all handles.");
1108
- }
1109
-
1110
- parsed.tooltips.forEach(function(formatter){
1111
- if ( typeof formatter !== 'boolean' && (typeof formatter !== 'object' || typeof formatter.to !== 'function') ) {
1112
- throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.");
1113
- }
1114
- });
1115
- }
1116
- }
1117
-
1118
- function testFormat ( parsed, entry ) {
1119
-
1120
- parsed.format = entry;
1121
-
1122
- // Any object with a to and from method is supported.
1123
- if ( typeof entry.to === 'function' && typeof entry.from === 'function' ) {
1124
- return true;
1125
- }
1126
-
1127
- throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.");
1128
- }
1129
-
1130
- function testCssPrefix ( parsed, entry ) {
1131
-
1132
- if ( entry !== undefined && typeof entry !== 'string' && entry !== false ) {
1133
- throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");
1134
- }
1135
-
1136
- parsed.cssPrefix = entry;
1137
- }
1138
-
1139
- function testCssClasses ( parsed, entry ) {
1140
-
1141
- if ( entry !== undefined && typeof entry !== 'object' ) {
1142
- throw new Error("noUiSlider: 'cssClasses' must be an object.");
1143
- }
1144
-
1145
- if ( typeof parsed.cssPrefix === 'string' ) {
1146
- parsed.cssClasses = {};
1147
-
1148
- for ( var key in entry ) {
1149
- if ( !entry.hasOwnProperty(key) ) { continue; }
1150
-
1151
- parsed.cssClasses[key] = parsed.cssPrefix + entry[key];
1152
- }
1153
- } else {
1154
- parsed.cssClasses = entry;
1155
- }
1156
- }
1157
-
1158
- function testUseRaf ( parsed, entry ) {
1159
- if ( entry === true || entry === false ) {
1160
- parsed.useRequestAnimationFrame = entry;
1161
- } else {
1162
- throw new Error("noUiSlider: 'useRequestAnimationFrame' option should be true (default) or false.");
1163
- }
1164
- }
1165
-
1166
- // Test all developer settings and parse to assumption-safe values.
1167
- function testOptions ( options ) {
1168
-
1169
- // To prove a fix for #537, freeze options here.
1170
- // If the object is modified, an error will be thrown.
1171
- // Object.freeze(options);
1172
-
1173
- var parsed = {
1174
- margin: 0,
1175
- limit: 0,
1176
- padding: 0,
1177
- animate: true,
1178
- animationDuration: 300,
1179
- format: defaultFormatter
1180
- };
1181
-
1182
- // Tests are executed in the order they are presented here.
1183
- var tests = {
1184
- 'step': { r: false, t: testStep },
1185
- 'start': { r: true, t: testStart },
1186
- 'connect': { r: true, t: testConnect },
1187
- 'direction': { r: true, t: testDirection },
1188
- 'snap': { r: false, t: testSnap },
1189
- 'animate': { r: false, t: testAnimate },
1190
- 'animationDuration': { r: false, t: testAnimationDuration },
1191
- 'range': { r: true, t: testRange },
1192
- 'orientation': { r: false, t: testOrientation },
1193
- 'margin': { r: false, t: testMargin },
1194
- 'limit': { r: false, t: testLimit },
1195
- 'padding': { r: false, t: testPadding },
1196
- 'behaviour': { r: true, t: testBehaviour },
1197
- 'format': { r: false, t: testFormat },
1198
- 'tooltips': { r: false, t: testTooltips },
1199
- 'cssPrefix': { r: false, t: testCssPrefix },
1200
- 'cssClasses': { r: false, t: testCssClasses },
1201
- 'useRequestAnimationFrame': { r: false, t: testUseRaf }
1202
- };
1203
-
1204
- var defaults = {
1205
- 'connect': false,
1206
- 'direction': 'ltr',
1207
- 'behaviour': 'tap',
1208
- 'orientation': 'horizontal',
1209
- 'cssPrefix' : 'noUi-',
1210
- 'cssClasses': {
1211
- target: 'target',
1212
- base: 'base',
1213
- origin: 'origin',
1214
- handle: 'handle',
1215
- handleTouchArea: 'handle-touch-area',
1216
- handleLower: 'handle-lower',
1217
- handleUpper: 'handle-upper',
1218
- horizontal: 'horizontal',
1219
- vertical: 'vertical',
1220
- background: 'background',
1221
- connect: 'connect',
1222
- ltr: 'ltr',
1223
- rtl: 'rtl',
1224
- draggable: 'draggable',
1225
- drag: 'state-drag',
1226
- tap: 'state-tap',
1227
- active: 'active',
1228
- tooltip: 'tooltip',
1229
- pips: 'pips',
1230
- pipsHorizontal: 'pips-horizontal',
1231
- pipsVertical: 'pips-vertical',
1232
- marker: 'marker',
1233
- markerHorizontal: 'marker-horizontal',
1234
- markerVertical: 'marker-vertical',
1235
- markerNormal: 'marker-normal',
1236
- markerLarge: 'marker-large',
1237
- markerSub: 'marker-sub',
1238
- value: 'value',
1239
- valueHorizontal: 'value-horizontal',
1240
- valueVertical: 'value-vertical',
1241
- valueNormal: 'value-normal',
1242
- valueLarge: 'value-large',
1243
- valueSub: 'value-sub'
1244
- },
1245
- 'useRequestAnimationFrame': true
1246
- };
1247
-
1248
- // Run all options through a testing mechanism to ensure correct
1249
- // input. It should be noted that options might get modified to
1250
- // be handled properly. E.g. wrapping integers in arrays.
1251
- Object.keys(tests).forEach(function( name ){
1252
-
1253
- // If the option isn't set, but it is required, throw an error.
1254
- if ( options[name] === undefined && defaults[name] === undefined ) {
1255
-
1256
- if ( tests[name].r ) {
1257
- throw new Error("noUiSlider: '" + name + "' is required.");
1258
- }
1259
-
1260
- return true;
1261
- }
1262
-
1263
- tests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );
1264
- });
1265
-
1266
- // Forward pips options
1267
- parsed.pips = options.pips;
1268
-
1269
- var styles = [['left', 'top'], ['right', 'bottom']];
1270
-
1271
- // Pre-define the styles.
1272
- parsed.style = styles[parsed.dir][parsed.ort];
1273
- parsed.styleOposite = styles[parsed.dir?0:1][parsed.ort];
1274
-
1275
- return parsed;
1276
- }
1277
-
1278
-
1279
- function closure ( target, options, originalOptions ){
1280
-
1281
- var actions = getActions( );
1282
-
1283
- // All variables local to 'closure' are prefixed with 'scope_'
1284
- var scope_Target = target;
1285
- var scope_Locations = [];
1286
- var scope_Base;
1287
- var scope_Handles;
1288
- var scope_HandleNumbers = [];
1289
- var scope_ActiveHandle = false;
1290
- var scope_Connects;
1291
- var scope_Spectrum = options.spectrum;
1292
- var scope_Values = [];
1293
- var scope_Events = {};
1294
- var scope_Self;
1295
-
1296
-
1297
- // Append a origin to the base
1298
- function addOrigin ( base, handleNumber ) {
1299
-
1300
- var origin = addNodeTo(base, options.cssClasses.origin);
1301
- var handle = addNodeTo(origin, options.cssClasses.handle);
1302
- addNodeTo(handle, options.cssClasses.handleTouchArea);
1303
-
1304
- handle.setAttribute('data-handle', handleNumber);
1305
-
1306
- if ( handleNumber === 0 ) {
1307
- addClass(handle, options.cssClasses.handleLower);
1308
- }
1309
-
1310
- else if ( handleNumber === options.handles - 1 ) {
1311
- addClass(handle, options.cssClasses.handleUpper);
1312
- }
1313
-
1314
- return origin;
1315
- }
1316
-
1317
- // Insert nodes for connect elements
1318
- function addConnect ( base, add ) {
1319
-
1320
- if ( !add ) {
1321
- return false;
1322
- }
1323
-
1324
- return addNodeTo(base, options.cssClasses.connect);
1325
- }
1326
-
1327
- // Add handles to the slider base.
1328
- function addElements ( connectOptions, base ) {
1329
-
1330
- scope_Handles = [];
1331
- scope_Connects = [];
1332
-
1333
- scope_Connects.push(addConnect(base, connectOptions[0]));
1334
-
1335
- // [::::O====O====O====]
1336
- // connectOptions = [0, 1, 1, 1]
1337
-
1338
- for ( var i = 0; i < options.handles; i++ ) {
1339
- // Keep a list of all added handles.
1340
- scope_Handles.push(addOrigin(base, i));
1341
- scope_HandleNumbers[i] = i;
1342
- scope_Connects.push(addConnect(base, connectOptions[i + 1]));
1343
- }
1344
- }
1345
-
1346
- // Initialize a single slider.
1347
- function addSlider ( target ) {
1348
-
1349
- // Apply classes and data to the target.
1350
- addClass(target, options.cssClasses.target);
1351
-
1352
- if ( options.dir === 0 ) {
1353
- addClass(target, options.cssClasses.ltr);
1354
- } else {
1355
- addClass(target, options.cssClasses.rtl);
1356
- }
1357
-
1358
- if ( options.ort === 0 ) {
1359
- addClass(target, options.cssClasses.horizontal);
1360
- } else {
1361
- addClass(target, options.cssClasses.vertical);
1362
- }
1363
-
1364
- scope_Base = addNodeTo(target, options.cssClasses.base);
1365
- }
1366
-
1367
-
1368
- function addTooltip ( handle, handleNumber ) {
1369
-
1370
- if ( !options.tooltips[handleNumber] ) {
1371
- return false;
1372
- }
1373
-
1374
- return addNodeTo(handle.firstChild, options.cssClasses.tooltip);
1375
- }
1376
-
1377
- // The tooltips option is a shorthand for using the 'update' event.
1378
- function tooltips ( ) {
1379
-
1380
- // Tooltips are added with options.tooltips in original order.
1381
- var tips = scope_Handles.map(addTooltip);
1382
-
1383
- bindEvent('update', function(values, handleNumber, unencoded) {
1384
-
1385
- if ( !tips[handleNumber] ) {
1386
- return;
1387
- }
1388
-
1389
- var formattedValue = values[handleNumber];
1390
-
1391
- if ( options.tooltips[handleNumber] !== true ) {
1392
- formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]);
1393
- }
1394
-
1395
- tips[handleNumber].innerHTML = '<span>' + formattedValue + '</span>';
1396
- });
1397
- }
1398
-
1399
-
1400
- function getGroup ( mode, values, stepped ) {
1401
-
1402
- // Use the range.
1403
- if ( mode === 'range' || mode === 'steps' ) {
1404
- return scope_Spectrum.xVal;
1405
- }
1406
-
1407
- if ( mode === 'count' ) {
1408
-
1409
- // Divide 0 - 100 in 'count' parts.
1410
- var spread = ( 100 / (values-1) ), v, i = 0;
1411
- values = [];
1412
-
1413
- // List these parts and have them handled as 'positions'.
1414
- while ((v=i++*spread) <= 100 ) {
1415
- values.push(v);
1416
- }
1417
-
1418
- mode = 'positions';
1419
- }
1420
-
1421
- if ( mode === 'positions' ) {
1422
-
1423
- // Map all percentages to on-range values.
1424
- return values.map(function( value ){
1425
- return scope_Spectrum.fromStepping( stepped ? scope_Spectrum.getStep( value ) : value );
1426
- });
1427
- }
1428
-
1429
- if ( mode === 'values' ) {
1430
-
1431
- // If the value must be stepped, it needs to be converted to a percentage first.
1432
- if ( stepped ) {
1433
-
1434
- return values.map(function( value ){
1435
-
1436
- // Convert to percentage, apply step, return to value.
1437
- return scope_Spectrum.fromStepping( scope_Spectrum.getStep( scope_Spectrum.toStepping( value ) ) );
1438
- });
1439
-
1440
- }
1441
-
1442
- // Otherwise, we can simply use the values.
1443
- return values;
1444
- }
1445
- }
1446
-
1447
- function generateSpread ( density, mode, group ) {
1448
-
1449
- function safeIncrement(value, increment) {
1450
- // Avoid floating point variance by dropping the smallest decimal places.
1451
- return (value + increment).toFixed(7) / 1;
1452
- }
1453
-
1454
- var indexes = {},
1455
- firstInRange = scope_Spectrum.xVal[0],
1456
- lastInRange = scope_Spectrum.xVal[scope_Spectrum.xVal.length-1],
1457
- ignoreFirst = false,
1458
- ignoreLast = false,
1459
- prevPct = 0;
1460
-
1461
- // Create a copy of the group, sort it and filter away all duplicates.
1462
- group = unique(group.slice().sort(function(a, b){ return a - b; }));
1463
-
1464
- // Make sure the range starts with the first element.
1465
- if ( group[0] !== firstInRange ) {
1466
- group.unshift(firstInRange);
1467
- ignoreFirst = true;
1468
- }
1469
-
1470
- // Likewise for the last one.
1471
- if ( group[group.length - 1] !== lastInRange ) {
1472
- group.push(lastInRange);
1473
- ignoreLast = true;
1474
- }
1475
-
1476
- group.forEach(function ( current, index ) {
1477
-
1478
- // Get the current step and the lower + upper positions.
1479
- var step, i, q,
1480
- low = current,
1481
- high = group[index+1],
1482
- newPct, pctDifference, pctPos, type,
1483
- steps, realSteps, stepsize;
1484
-
1485
- // When using 'steps' mode, use the provided steps.
1486
- // Otherwise, we'll step on to the next subrange.
1487
- if ( mode === 'steps' ) {
1488
- step = scope_Spectrum.xNumSteps[ index ];
1489
- }
1490
-
1491
- // Default to a 'full' step.
1492
- if ( !step ) {
1493
- step = high-low;
1494
- }
1495
-
1496
- // Low can be 0, so test for false. If high is undefined,
1497
- // we are at the last subrange. Index 0 is already handled.
1498
- if ( low === false || high === undefined ) {
1499
- return;
1500
- }
1501
-
1502
- // Make sure step isn't 0, which would cause an infinite loop (#654)
1503
- step = Math.max(step, 0.0000001);
1504
-
1505
- // Find all steps in the subrange.
1506
- for ( i = low; i <= high; i = safeIncrement(i, step) ) {
1507
-
1508
- // Get the percentage value for the current step,
1509
- // calculate the size for the subrange.
1510
- newPct = scope_Spectrum.toStepping( i );
1511
- pctDifference = newPct - prevPct;
1512
-
1513
- steps = pctDifference / density;
1514
- realSteps = Math.round(steps);
1515
-
1516
- // This ratio represents the ammount of percentage-space a point indicates.
1517
- // For a density 1 the points/percentage = 1. For density 2, that percentage needs to be re-devided.
1518
- // Round the percentage offset to an even number, then divide by two
1519
- // to spread the offset on both sides of the range.
1520
- stepsize = pctDifference/realSteps;
1521
-
1522
- // Divide all points evenly, adding the correct number to this subrange.
1523
- // Run up to <= so that 100% gets a point, event if ignoreLast is set.
1524
- for ( q = 1; q <= realSteps; q += 1 ) {
1525
-
1526
- // The ratio between the rounded value and the actual size might be ~1% off.
1527
- // Correct the percentage offset by the number of points
1528
- // per subrange. density = 1 will result in 100 points on the
1529
- // full range, 2 for 50, 4 for 25, etc.
1530
- pctPos = prevPct + ( q * stepsize );
1531
- indexes[pctPos.toFixed(5)] = ['x', 0];
1532
- }
1533
-
1534
- // Determine the point type.
1535
- type = (group.indexOf(i) > -1) ? 1 : ( mode === 'steps' ? 2 : 0 );
1536
-
1537
- // Enforce the 'ignoreFirst' option by overwriting the type for 0.
1538
- if ( !index && ignoreFirst ) {
1539
- type = 0;
1540
- }
1541
-
1542
- if ( !(i === high && ignoreLast)) {
1543
- // Mark the 'type' of this point. 0 = plain, 1 = real value, 2 = step value.
1544
- indexes[newPct.toFixed(5)] = [i, type];
1545
- }
1546
-
1547
- // Update the percentage count.
1548
- prevPct = newPct;
1549
- }
1550
- });
1551
-
1552
- return indexes;
1553
- }
1554
-
1555
- function addMarking ( spread, filterFunc, formatter ) {
1556
-
1557
- var element = document.createElement('div'),
1558
- out = '',
1559
- valueSizeClasses = [
1560
- options.cssClasses.valueNormal,
1561
- options.cssClasses.valueLarge,
1562
- options.cssClasses.valueSub
1563
- ],
1564
- markerSizeClasses = [
1565
- options.cssClasses.markerNormal,
1566
- options.cssClasses.markerLarge,
1567
- options.cssClasses.markerSub
1568
- ],
1569
- valueOrientationClasses = [
1570
- options.cssClasses.valueHorizontal,
1571
- options.cssClasses.valueVertical
1572
- ],
1573
- markerOrientationClasses = [
1574
- options.cssClasses.markerHorizontal,
1575
- options.cssClasses.markerVertical
1576
- ];
1577
-
1578
- addClass(element, options.cssClasses.pips);
1579
- addClass(element, options.ort === 0 ? options.cssClasses.pipsHorizontal : options.cssClasses.pipsVertical);
1580
-
1581
- function getClasses( type, source ){
1582
- var a = source === options.cssClasses.value,
1583
- orientationClasses = a ? valueOrientationClasses : markerOrientationClasses,
1584
- sizeClasses = a ? valueSizeClasses : markerSizeClasses;
1585
-
1586
- return source + ' ' + orientationClasses[options.ort] + ' ' + sizeClasses[type];
1587
- }
1588
-
1589
- function getTags( offset, source, values ) {
1590
- return 'class="' + getClasses(values[1], source) + '" style="' + options.style + ': ' + offset + '%"';
1591
- }
1592
-
1593
- function addSpread ( offset, values ){
1594
-
1595
- // Apply the filter function, if it is set.
1596
- values[1] = (values[1] && filterFunc) ? filterFunc(values[0], values[1]) : values[1];
1597
-
1598
- // Add a marker for every point
1599
- out += '<div ' + getTags(offset, options.cssClasses.marker, values) + '></div>';
1600
-
1601
- // Values are only appended for points marked '1' or '2'.
1602
- if ( values[1] ) {
1603
- out += '<div ' + getTags(offset, options.cssClasses.value, values) + '>' + formatter.to(values[0]) + '</div>';
1604
- }
1605
- }
1606
-
1607
- // Append all points.
1608
- Object.keys(spread).forEach(function(a){
1609
- addSpread(a, spread[a]);
1610
- });
1611
-
1612
- element.innerHTML = out;
1613
-
1614
- return element;
1615
- }
1616
-
1617
- function pips ( grid ) {
1618
-
1619
- var mode = grid.mode,
1620
- density = grid.density || 1,
1621
- filter = grid.filter || false,
1622
- values = grid.values || false,
1623
- stepped = grid.stepped || false,
1624
- group = getGroup( mode, values, stepped ),
1625
- spread = generateSpread( density, mode, group ),
1626
- format = grid.format || {
1627
- to: Math.round
1628
- };
1629
-
1630
- return scope_Target.appendChild(addMarking(
1631
- spread,
1632
- filter,
1633
- format
1634
- ));
1635
- }
1636
-
1637
-
1638
- // Shorthand for base dimensions.
1639
- function baseSize ( ) {
1640
- var rect = scope_Base.getBoundingClientRect(), alt = 'offset' + ['Width', 'Height'][options.ort];
1641
- return options.ort === 0 ? (rect.width||scope_Base[alt]) : (rect.height||scope_Base[alt]);
1642
- }
1643
-
1644
- // Handler for attaching events trough a proxy.
1645
- function attachEvent ( events, element, callback, data ) {
1646
-
1647
- // This function can be used to 'filter' events to the slider.
1648
- // element is a node, not a nodeList
1649
-
1650
- var method = function ( e ){
1651
-
1652
- if ( scope_Target.hasAttribute('disabled') ) {
1653
- return false;
1654
- }
1655
-
1656
- // Stop if an active 'tap' transition is taking place.
1657
- if ( hasClass(scope_Target, options.cssClasses.tap) ) {
1658
- return false;
1659
- }
1660
-
1661
- e = fixEvent(e, data.pageOffset);
1662
-
1663
- // Handle reject of multitouch
1664
- if ( !e ) {
1665
- return false;
1666
- }
1667
-
1668
- // Ignore right or middle clicks on start #454
1669
- if ( events === actions.start && e.buttons !== undefined && e.buttons > 1 ) {
1670
- return false;
1671
- }
1672
-
1673
- // Ignore right or middle clicks on start #454
1674
- if ( data.hover && e.buttons ) {
1675
- return false;
1676
- }
1677
-
1678
- e.calcPoint = e.points[ options.ort ];
1679
-
1680
- // Call the event handler with the event [ and additional data ].
1681
- callback ( e, data );
1682
- };
1683
-
1684
- var methods = [];
1685
-
1686
- // Bind a closure on the target for every event type.
1687
- events.split(' ').forEach(function( eventName ){
1688
- element.addEventListener(eventName, method, false);
1689
- methods.push([eventName, method]);
1690
- });
1691
-
1692
- return methods;
1693
- }
1694
-
1695
- // Provide a clean event with standardized offset values.
1696
- function fixEvent ( e, pageOffset ) {
1697
-
1698
- // Prevent scrolling and panning on touch events, while
1699
- // attempting to slide. The tap event also depends on this.
1700
- e.preventDefault();
1701
-
1702
- // Filter the event to register the type, which can be
1703
- // touch, mouse or pointer. Offset changes need to be
1704
- // made on an event specific basis.
1705
- var touch = e.type.indexOf('touch') === 0;
1706
- var mouse = e.type.indexOf('mouse') === 0;
1707
- var pointer = e.type.indexOf('pointer') === 0;
1708
- var x;
1709
- var y;
1710
-
1711
- // IE10 implemented pointer events with a prefix;
1712
- if ( e.type.indexOf('MSPointer') === 0 ) {
1713
- pointer = true;
1714
- }
1715
-
1716
- if ( touch ) {
1717
-
1718
- // Fix bug when user touches with two or more fingers on mobile devices.
1719
- // It's useful when you have two or more sliders on one page,
1720
- // that can be touched simultaneously.
1721
- // #649, #663, #668
1722
- if ( e.touches.length > 1 ) {
1723
- return false;
1724
- }
1725
-
1726
- // noUiSlider supports one movement at a time,
1727
- // so we can select the first 'changedTouch'.
1728
- x = e.changedTouches[0].pageX;
1729
- y = e.changedTouches[0].pageY;
1730
- }
1731
-
1732
- pageOffset = pageOffset || getPageOffset();
1733
-
1734
- if ( mouse || pointer ) {
1735
- x = e.clientX + pageOffset.x;
1736
- y = e.clientY + pageOffset.y;
1737
- }
1738
-
1739
- e.pageOffset = pageOffset;
1740
- e.points = [x, y];
1741
- e.cursor = mouse || pointer; // Fix #435
1742
-
1743
- return e;
1744
- }
1745
-
1746
- // Translate a coordinate in the document to a percentage on the slider
1747
- function calcPointToPercentage ( calcPoint ) {
1748
- var location = calcPoint - offset(scope_Base, options.ort);
1749
- var proposal = ( location * 100 ) / baseSize();
1750
- return options.dir ? 100 - proposal : proposal;
1751
- }
1752
-
1753
- // Find handle closest to a certain percentage on the slider
1754
- function getClosestHandle ( proposal ) {
1755
-
1756
- var closest = 100;
1757
- var handleNumber = false;
1758
-
1759
- scope_Handles.forEach(function(handle, index){
1760
-
1761
- // Disabled handles are ignored
1762
- if ( handle.hasAttribute('disabled') ) {
1763
- return;
1764
- }
1765
-
1766
- var pos = Math.abs(scope_Locations[index] - proposal);
1767
-
1768
- if ( pos < closest ) {
1769
- handleNumber = index;
1770
- closest = pos;
1771
- }
1772
- });
1773
-
1774
- return handleNumber;
1775
- }
1776
-
1777
- // Moves handle(s) by a percentage
1778
- // (bool, % to move, [% where handle started, ...], [index in scope_Handles, ...])
1779
- function moveHandles ( upward, proposal, locations, handleNumbers ) {
1780
-
1781
- var proposals = locations.slice();
1782
-
1783
- var b = [!upward, upward];
1784
- var f = [upward, !upward];
1785
-
1786
- // Copy handleNumbers so we don't change the dataset
1787
- handleNumbers = handleNumbers.slice();
1788
-
1789
- // Check to see which handle is 'leading'.
1790
- // If that one can't move the second can't either.
1791
- if ( upward ) {
1792
- handleNumbers.reverse();
1793
- }
1794
-
1795
- // Step 1: get the maximum percentage that any of the handles can move
1796
- if ( handleNumbers.length > 1 ) {
1797
-
1798
- handleNumbers.forEach(function(handleNumber, o) {
1799
-
1800
- var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o]);
1801
-
1802
- // Stop if one of the handles can't move.
1803
- if ( to === false ) {
1804
- proposal = 0;
1805
- } else {
1806
- proposal = to - proposals[handleNumber];
1807
- proposals[handleNumber] = to;
1808
- }
1809
- });
1810
- }
1811
-
1812
- // If using one handle, check backward AND forward
1813
- else {
1814
- b = f = [true];
1815
- }
1816
-
1817
- var state = false;
1818
-
1819
- // Step 2: Try to set the handles with the found percentage
1820
- handleNumbers.forEach(function(handleNumber, o) {
1821
- state = setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o]) || state;
1822
- });
1823
-
1824
- // Step 3: If a handle moved, fire events
1825
- if ( state ) {
1826
- handleNumbers.forEach(function(handleNumber){
1827
- fireEvent('update', handleNumber);
1828
- fireEvent('slide', handleNumber);
1829
- });
1830
- }
1831
- }
1832
-
1833
- // External event handling
1834
- function fireEvent ( eventName, handleNumber, tap ) {
1835
-
1836
- Object.keys(scope_Events).forEach(function( targetEvent ) {
1837
-
1838
- var eventType = targetEvent.split('.')[0];
1839
-
1840
- if ( eventName === eventType ) {
1841
- scope_Events[targetEvent].forEach(function( callback ) {
1842
-
1843
- callback.call(
1844
- // Use the slider public API as the scope ('this')
1845
- scope_Self,
1846
- // Return values as array, so arg_1[arg_2] is always valid.
1847
- scope_Values.map(options.format.to),
1848
- // Handle index, 0 or 1
1849
- handleNumber,
1850
- // Unformatted slider values
1851
- scope_Values.slice(),
1852
- // Event is fired by tap, true or false
1853
- tap || false,
1854
- // Left offset of the handle, in relation to the slider
1855
- scope_Locations.slice()
1856
- );
1857
- });
1858
- }
1859
- });
1860
- }
1861
-
1862
-
1863
- // Fire 'end' when a mouse or pen leaves the document.
1864
- function documentLeave ( event, data ) {
1865
- if ( event.type === "mouseout" && event.target.nodeName === "HTML" && event.relatedTarget === null ){
1866
- eventEnd (event, data);
1867
- }
1868
- }
1869
-
1870
- // Handle movement on document for handle and range drag.
1871
- function eventMove ( event, data ) {
1872
-
1873
- // Fix #498
1874
- // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).
1875
- // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero
1876
- // IE9 has .buttons and .which zero on mousemove.
1877
- // Firefox breaks the spec MDN defines.
1878
- if ( navigator.appVersion.indexOf("MSIE 9") === -1 && event.buttons === 0 && data.buttonsProperty !== 0 ) {
1879
- return eventEnd(event, data);
1880
- }
1881
-
1882
- // Check if we are moving up or down
1883
- var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint);
1884
-
1885
- // Convert the movement into a percentage of the slider width/height
1886
- var proposal = (movement * 100) / data.baseSize;
1887
-
1888
- moveHandles(movement > 0, proposal, data.locations, data.handleNumbers);
1889
- }
1890
-
1891
- // Unbind move events on document, call callbacks.
1892
- function eventEnd ( event, data ) {
1893
-
1894
- // The handle is no longer active, so remove the class.
1895
- if ( scope_ActiveHandle ) {
1896
- removeClass(scope_ActiveHandle, options.cssClasses.active);
1897
- scope_ActiveHandle = false;
1898
- }
1899
-
1900
- // Remove cursor styles and text-selection events bound to the body.
1901
- if ( event.cursor ) {
1902
- document.body.style.cursor = '';
1903
- document.body.removeEventListener('selectstart', document.body.noUiListener);
1904
- }
1905
-
1906
- // Unbind the move and end events, which are added on 'start'.
1907
- document.documentElement.noUiListeners.forEach(function( c ) {
1908
- document.documentElement.removeEventListener(c[0], c[1]);
1909
- });
1910
-
1911
- // Remove dragging class.
1912
- removeClass(scope_Target, options.cssClasses.drag);
1913
-
1914
- setZindex();
1915
-
1916
- data.handleNumbers.forEach(function(handleNumber){
1917
- fireEvent('set', handleNumber);
1918
- fireEvent('change', handleNumber);
1919
- fireEvent('end', handleNumber);
1920
- });
1921
- }
1922
-
1923
- // Bind move events on document.
1924
- function eventStart ( event, data ) {
1925
-
1926
- if ( data.handleNumbers.length === 1 ) {
1927
-
1928
- var handle = scope_Handles[data.handleNumbers[0]];
1929
-
1930
- // Ignore 'disabled' handles
1931
- if ( handle.hasAttribute('disabled') ) {
1932
- return false;
1933
- }
1934
-
1935
- // Mark the handle as 'active' so it can be styled.
1936
- scope_ActiveHandle = handle.children[0];
1937
- addClass(scope_ActiveHandle, options.cssClasses.active);
1938
- }
1939
-
1940
- // Fix #551, where a handle gets selected instead of dragged.
1941
- event.preventDefault();
1942
-
1943
- // A drag should never propagate up to the 'tap' event.
1944
- event.stopPropagation();
1945
-
1946
- // Attach the move and end events.
1947
- var moveEvent = attachEvent(actions.move, document.documentElement, eventMove, {
1948
- startCalcPoint: event.calcPoint,
1949
- baseSize: baseSize(),
1950
- pageOffset: event.pageOffset,
1951
- handleNumbers: data.handleNumbers,
1952
- buttonsProperty: event.buttons,
1953
- locations: scope_Locations.slice()
1954
- });
1955
-
1956
- var endEvent = attachEvent(actions.end, document.documentElement, eventEnd, {
1957
- handleNumbers: data.handleNumbers
1958
- });
1959
-
1960
- var outEvent = attachEvent("mouseout", document.documentElement, documentLeave, {
1961
- handleNumbers: data.handleNumbers
1962
- });
1963
-
1964
- document.documentElement.noUiListeners = moveEvent.concat(endEvent, outEvent);
1965
-
1966
- // Text selection isn't an issue on touch devices,
1967
- // so adding cursor styles can be skipped.
1968
- if ( event.cursor ) {
1969
-
1970
- // Prevent the 'I' cursor and extend the range-drag cursor.
1971
- document.body.style.cursor = getComputedStyle(event.target).cursor;
1972
-
1973
- // Mark the target with a dragging state.
1974
- if ( scope_Handles.length > 1 ) {
1975
- addClass(scope_Target, options.cssClasses.drag);
1976
- }
1977
-
1978
- var f = function(){
1979
- return false;
1980
- };
1981
-
1982
- document.body.noUiListener = f;
1983
-
1984
- // Prevent text selection when dragging the handles.
1985
- document.body.addEventListener('selectstart', f, false);
1986
- }
1987
-
1988
- data.handleNumbers.forEach(function(handleNumber){
1989
- fireEvent('start', handleNumber);
1990
- });
1991
- }
1992
-
1993
- // Move closest handle to tapped location.
1994
- function eventTap ( event ) {
1995
-
1996
- // The tap event shouldn't propagate up
1997
- event.stopPropagation();
1998
-
1999
- var proposal = calcPointToPercentage(event.calcPoint);
2000
- var handleNumber = getClosestHandle(proposal);
2001
-
2002
- // Tackle the case that all handles are 'disabled'.
2003
- if ( handleNumber === false ) {
2004
- return false;
2005
- }
2006
-
2007
- // Flag the slider as it is now in a transitional state.
2008
- // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that.
2009
- if ( !options.events.snap ) {
2010
- addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);
2011
- }
2012
-
2013
- setHandle(handleNumber, proposal, true, true);
2014
-
2015
- setZindex();
2016
-
2017
- fireEvent('slide', handleNumber, true);
2018
- fireEvent('set', handleNumber, true);
2019
- fireEvent('change', handleNumber, true);
2020
- fireEvent('update', handleNumber, true);
2021
-
2022
- if ( options.events.snap ) {
2023
- eventStart(event, { handleNumbers: [handleNumber] });
2024
- }
2025
- }
2026
-
2027
- // Fires a 'hover' event for a hovered mouse/pen position.
2028
- function eventHover ( event ) {
2029
-
2030
- var proposal = calcPointToPercentage(event.calcPoint);
2031
-
2032
- var to = scope_Spectrum.getStep(proposal);
2033
- var value = scope_Spectrum.fromStepping(to);
2034
-
2035
- Object.keys(scope_Events).forEach(function( targetEvent ) {
2036
- if ( 'hover' === targetEvent.split('.')[0] ) {
2037
- scope_Events[targetEvent].forEach(function( callback ) {
2038
- callback.call( scope_Self, value );
2039
- });
2040
- }
2041
- });
2042
- }
2043
-
2044
- // Attach events to several slider parts.
2045
- function bindSliderEvents ( behaviour ) {
2046
-
2047
- // Attach the standard drag event to the handles.
2048
- if ( !behaviour.fixed ) {
2049
-
2050
- scope_Handles.forEach(function( handle, index ){
2051
-
2052
- // These events are only bound to the visual handle
2053
- // element, not the 'real' origin element.
2054
- attachEvent ( actions.start, handle.children[0], eventStart, {
2055
- handleNumbers: [index]
2056
- });
2057
- });
2058
- }
2059
-
2060
- // Attach the tap event to the slider base.
2061
- if ( behaviour.tap ) {
2062
- attachEvent (actions.start, scope_Base, eventTap, {});
2063
- }
2064
-
2065
- // Fire hover events
2066
- if ( behaviour.hover ) {
2067
- attachEvent (actions.move, scope_Base, eventHover, { hover: true });
2068
- }
2069
-
2070
- // Make the range draggable.
2071
- if ( behaviour.drag ){
2072
-
2073
- scope_Connects.forEach(function( connect, index ){
2074
-
2075
- if ( connect === false || index === 0 || index === scope_Connects.length - 1 ) {
2076
- return;
2077
- }
2078
-
2079
- var handleBefore = scope_Handles[index - 1];
2080
- var handleAfter = scope_Handles[index];
2081
- var eventHolders = [connect];
2082
-
2083
- addClass(connect, options.cssClasses.draggable);
2084
-
2085
- // When the range is fixed, the entire range can
2086
- // be dragged by the handles. The handle in the first
2087
- // origin will propagate the start event upward,
2088
- // but it needs to be bound manually on the other.
2089
- if ( behaviour.fixed ) {
2090
- eventHolders.push(handleBefore.children[0]);
2091
- eventHolders.push(handleAfter.children[0]);
2092
- }
2093
-
2094
- eventHolders.forEach(function( eventHolder ) {
2095
- attachEvent ( actions.start, eventHolder, eventStart, {
2096
- handles: [handleBefore, handleAfter],
2097
- handleNumbers: [index - 1, index]
2098
- });
2099
- });
2100
- });
2101
- }
2102
- }
2103
-
2104
-
2105
- // Split out the handle positioning logic so the Move event can use it, too
2106
- function checkHandlePosition ( reference, handleNumber, to, lookBackward, lookForward ) {
2107
-
2108
- // For sliders with multiple handles, limit movement to the other handle.
2109
- // Apply the margin option by adding it to the handle positions.
2110
- if ( scope_Handles.length > 1 ) {
2111
-
2112
- if ( lookBackward && handleNumber > 0 ) {
2113
- to = Math.max(to, reference[handleNumber - 1] + options.margin);
2114
- }
2115
-
2116
- if ( lookForward && handleNumber < scope_Handles.length - 1 ) {
2117
- to = Math.min(to, reference[handleNumber + 1] - options.margin);
2118
- }
2119
- }
2120
-
2121
- // The limit option has the opposite effect, limiting handles to a
2122
- // maximum distance from another. Limit must be > 0, as otherwise
2123
- // handles would be unmoveable.
2124
- if ( scope_Handles.length > 1 && options.limit ) {
2125
-
2126
- if ( lookBackward && handleNumber > 0 ) {
2127
- to = Math.min(to, reference[handleNumber - 1] + options.limit);
2128
- }
2129
-
2130
- if ( lookForward && handleNumber < scope_Handles.length - 1 ) {
2131
- to = Math.max(to, reference[handleNumber + 1] - options.limit);
2132
- }
2133
- }
2134
-
2135
- // The padding option keeps the handles a certain distance from the
2136
- // edges of the slider. Padding must be > 0.
2137
- if ( options.padding ) {
2138
-
2139
- if ( handleNumber === 0 ) {
2140
- to = Math.max(to, options.padding);
2141
- }
2142
-
2143
- if ( handleNumber === scope_Handles.length - 1 ) {
2144
- to = Math.min(to, 100 - options.padding);
2145
- }
2146
- }
2147
-
2148
- to = scope_Spectrum.getStep(to);
2149
-
2150
- // Limit percentage to the 0 - 100 range
2151
- to = limit(to);
2152
-
2153
- // Return false if handle can't move
2154
- if ( to === reference[handleNumber] ) {
2155
- return false;
2156
- }
2157
-
2158
- return to;
2159
- }
2160
-
2161
- function toPct ( pct ) {
2162
- return pct + '%';
2163
- }
2164
-
2165
- // Updates scope_Locations and scope_Values, updates visual state
2166
- function updateHandlePosition ( handleNumber, to ) {
2167
-
2168
- // Update locations.
2169
- scope_Locations[handleNumber] = to;
2170
-
2171
- // Convert the value to the slider stepping/range.
2172
- scope_Values[handleNumber] = scope_Spectrum.fromStepping(to);
2173
-
2174
- // Called synchronously or on the next animationFrame
2175
- var stateUpdate = function() {
2176
- scope_Handles[handleNumber].style[options.style] = toPct(to);
2177
- updateConnect(handleNumber);
2178
- updateConnect(handleNumber + 1);
2179
- };
2180
-
2181
- // Set the handle to the new position.
2182
- // Use requestAnimationFrame for efficient painting.
2183
- // No significant effect in Chrome, Edge sees dramatic performace improvements.
2184
- // Option to disable is useful for unit tests, and single-step debugging.
2185
- if ( window.requestAnimationFrame && options.useRequestAnimationFrame ) {
2186
- window.requestAnimationFrame(stateUpdate);
2187
- } else {
2188
- stateUpdate();
2189
- }
2190
- }
2191
-
2192
- function setZindex ( ) {
2193
-
2194
- scope_HandleNumbers.forEach(function(handleNumber){
2195
- // Handles before the slider middle are stacked later = higher,
2196
- // Handles after the middle later is lower
2197
- // [[7] [8] .......... | .......... [5] [4]
2198
- var dir = (scope_Locations[handleNumber] > 50 ? -1 : 1);
2199
- var zIndex = 3 + (scope_Handles.length + (dir * handleNumber));
2200
- scope_Handles[handleNumber].childNodes[0].style.zIndex = zIndex;
2201
- });
2202
- }
2203
-
2204
- // Test suggested values and apply margin, step.
2205
- function setHandle ( handleNumber, to, lookBackward, lookForward ) {
2206
-
2207
- to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward);
2208
-
2209
- if ( to === false ) {
2210
- return false;
2211
- }
2212
-
2213
- updateHandlePosition(handleNumber, to);
2214
-
2215
- return true;
2216
- }
2217
-
2218
- // Updates style attribute for connect nodes
2219
- function updateConnect ( index ) {
2220
-
2221
- // Skip connects set to false
2222
- if ( !scope_Connects[index] ) {
2223
- return;
2224
- }
2225
-
2226
- var l = 0;
2227
- var h = 100;
2228
-
2229
- if ( index !== 0 ) {
2230
- l = scope_Locations[index - 1];
2231
- }
2232
-
2233
- if ( index !== scope_Connects.length - 1 ) {
2234
- h = scope_Locations[index];
2235
- }
2236
-
2237
- scope_Connects[index].style[options.style] = toPct(l);
2238
- scope_Connects[index].style[options.styleOposite] = toPct(100 - h);
2239
- }
2240
-
2241
- // ...
2242
- function setValue ( to, handleNumber ) {
2243
-
2244
- // Setting with null indicates an 'ignore'.
2245
- // Inputting 'false' is invalid.
2246
- if ( to === null || to === false ) {
2247
- return;
2248
- }
2249
-
2250
- // If a formatted number was passed, attemt to decode it.
2251
- if ( typeof to === 'number' ) {
2252
- to = String(to);
2253
- }
2254
-
2255
- to = options.format.from(to);
2256
-
2257
- // Request an update for all links if the value was invalid.
2258
- // Do so too if setting the handle fails.
2259
- if ( to !== false && !isNaN(to) ) {
2260
- setHandle(handleNumber, scope_Spectrum.toStepping(to), false, false);
2261
- }
2262
- }
2263
-
2264
- // Set the slider value.
2265
- function valueSet ( input, fireSetEvent ) {
2266
-
2267
- var values = asArray(input);
2268
- var isInit = scope_Locations[0] === undefined;
2269
-
2270
- // Event fires by default
2271
- fireSetEvent = (fireSetEvent === undefined ? true : !!fireSetEvent);
2272
-
2273
- values.forEach(setValue);
2274
-
2275
- // Animation is optional.
2276
- // Make sure the initial values were set before using animated placement.
2277
- if ( options.animate && !isInit ) {
2278
- addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration);
2279
- }
2280
-
2281
- // Now that all base values are set, apply constraints
2282
- scope_HandleNumbers.forEach(function(handleNumber){
2283
- setHandle(handleNumber, scope_Locations[handleNumber], true, false);
2284
- });
2285
-
2286
- setZindex();
2287
-
2288
- scope_HandleNumbers.forEach(function(handleNumber){
2289
-
2290
- fireEvent('update', handleNumber);
2291
-
2292
- // Fire the event only for handles that received a new value, as per #579
2293
- if ( values[handleNumber] !== null && fireSetEvent ) {
2294
- fireEvent('set', handleNumber);
2295
- }
2296
- });
2297
- }
2298
-
2299
- // Reset slider to initial values
2300
- function valueReset ( fireSetEvent ) {
2301
- valueSet(options.start, fireSetEvent);
2302
- }
2303
-
2304
- // Get the slider value.
2305
- function valueGet ( ) {
2306
-
2307
- var values = scope_Values.map(options.format.to);
2308
-
2309
- // If only one handle is used, return a single value.
2310
- if ( values.length === 1 ){
2311
- return values[0];
2312
- }
2313
-
2314
- return values;
2315
- }
2316
-
2317
- // Removes classes from the root and empties it.
2318
- function destroy ( ) {
2319
-
2320
- for ( var key in options.cssClasses ) {
2321
- if ( !options.cssClasses.hasOwnProperty(key) ) { continue; }
2322
- removeClass(scope_Target, options.cssClasses[key]);
2323
- }
2324
-
2325
- while (scope_Target.firstChild) {
2326
- scope_Target.removeChild(scope_Target.firstChild);
2327
- }
2328
-
2329
- delete scope_Target.noUiSlider;
2330
- }
2331
-
2332
- // Get the current step size for the slider.
2333
- function getCurrentStep ( ) {
2334
-
2335
- // Check all locations, map them to their stepping point.
2336
- // Get the step point, then find it in the input list.
2337
- return scope_Locations.map(function( location, index ){
2338
-
2339
- var nearbySteps = scope_Spectrum.getNearbySteps( location );
2340
- var value = scope_Values[index];
2341
- var increment = nearbySteps.thisStep.step;
2342
- var decrement = null;
2343
-
2344
- // If the next value in this step moves into the next step,
2345
- // the increment is the start of the next step - the current value
2346
- if ( increment !== false ) {
2347
- if ( value + increment > nearbySteps.stepAfter.startValue ) {
2348
- increment = nearbySteps.stepAfter.startValue - value;
2349
- }
2350
- }
2351
-
2352
-
2353
- // If the value is beyond the starting point
2354
- if ( value > nearbySteps.thisStep.startValue ) {
2355
- decrement = nearbySteps.thisStep.step;
2356
- }
2357
-
2358
- else if ( nearbySteps.stepBefore.step === false ) {
2359
- decrement = false;
2360
- }
2361
-
2362
- // If a handle is at the start of a step, it always steps back into the previous step first
2363
- else {
2364
- decrement = value - nearbySteps.stepBefore.highestStep;
2365
- }
2366
-
2367
-
2368
- // Now, if at the slider edges, there is not in/decrement
2369
- if ( location === 100 ) {
2370
- increment = null;
2371
- }
2372
-
2373
- else if ( location === 0 ) {
2374
- decrement = null;
2375
- }
2376
-
2377
- // As per #391, the comparison for the decrement step can have some rounding issues.
2378
- var stepDecimals = scope_Spectrum.countStepDecimals();
2379
-
2380
- // Round per #391
2381
- if ( increment !== null && increment !== false ) {
2382
- increment = Number(increment.toFixed(stepDecimals));
2383
- }
2384
-
2385
- if ( decrement !== null && decrement !== false ) {
2386
- decrement = Number(decrement.toFixed(stepDecimals));
2387
- }
2388
-
2389
- return [decrement, increment];
2390
- });
2391
- }
2392
-
2393
- // Attach an event to this slider, possibly including a namespace
2394
- function bindEvent ( namespacedEvent, callback ) {
2395
- scope_Events[namespacedEvent] = scope_Events[namespacedEvent] || [];
2396
- scope_Events[namespacedEvent].push(callback);
2397
-
2398
- // If the event bound is 'update,' fire it immediately for all handles.
2399
- if ( namespacedEvent.split('.')[0] === 'update' ) {
2400
- scope_Handles.forEach(function(a, index){
2401
- fireEvent('update', index);
2402
- });
2403
- }
2404
- }
2405
-
2406
- // Undo attachment of event
2407
- function removeEvent ( namespacedEvent ) {
2408
-
2409
- var event = namespacedEvent && namespacedEvent.split('.')[0];
2410
- var namespace = event && namespacedEvent.substring(event.length);
2411
-
2412
- Object.keys(scope_Events).forEach(function( bind ){
2413
-
2414
- var tEvent = bind.split('.')[0],
2415
- tNamespace = bind.substring(tEvent.length);
2416
-
2417
- if ( (!event || event === tEvent) && (!namespace || namespace === tNamespace) ) {
2418
- delete scope_Events[bind];
2419
- }
2420
- });
2421
- }
2422
-
2423
- // Updateable: margin, limit, padding, step, range, animate, snap
2424
- function updateOptions ( optionsToUpdate, fireSetEvent ) {
2425
-
2426
- // Spectrum is created using the range, snap, direction and step options.
2427
- // 'snap' and 'step' can be updated, 'direction' cannot, due to event binding.
2428
- // If 'snap' and 'step' are not passed, they should remain unchanged.
2429
- var v = valueGet();
2430
-
2431
- var updateAble = ['margin', 'limit', 'padding', 'range', 'animate', 'snap', 'step', 'format'];
2432
-
2433
- // Only change options that we're actually passed to update.
2434
- updateAble.forEach(function(name){
2435
- if ( optionsToUpdate[name] !== undefined ) {
2436
- originalOptions[name] = optionsToUpdate[name];
2437
- }
2438
- });
2439
-
2440
- var newOptions = testOptions(originalOptions);
2441
-
2442
- // Load new options into the slider state
2443
- updateAble.forEach(function(name){
2444
- if ( optionsToUpdate[name] !== undefined ) {
2445
- options[name] = newOptions[name];
2446
- }
2447
- });
2448
-
2449
- // Save current spectrum direction as testOptions in testRange call
2450
- // doesn't rely on current direction
2451
- newOptions.spectrum.direction = scope_Spectrum.direction;
2452
- scope_Spectrum = newOptions.spectrum;
2453
-
2454
- // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677)
2455
- options.margin = newOptions.margin;
2456
- options.limit = newOptions.limit;
2457
- options.padding = newOptions.padding;
2458
-
2459
- // Invalidate the current positioning so valueSet forces an update.
2460
- scope_Locations = [];
2461
- valueSet(optionsToUpdate.start || v, fireSetEvent);
2462
- }
2463
-
2464
- // Throw an error if the slider was already initialized.
2465
- if ( scope_Target.noUiSlider ) {
2466
- throw new Error('Slider was already initialized.');
2467
- }
2468
-
2469
- // Create the base element, initialise HTML and set classes.
2470
- // Add handles and connect elements.
2471
- addSlider(scope_Target);
2472
- addElements(options.connect, scope_Base);
2473
-
2474
- scope_Self = {
2475
- destroy: destroy,
2476
- steps: getCurrentStep,
2477
- on: bindEvent,
2478
- off: removeEvent,
2479
- get: valueGet,
2480
- set: valueSet,
2481
- reset: valueReset,
2482
- // Exposed for unit testing, don't use this in your application.
2483
- __moveHandles: function(a, b, c) { moveHandles(a, b, scope_Locations, c); },
2484
- options: originalOptions, // Issue #600, #678
2485
- updateOptions: updateOptions,
2486
- target: scope_Target, // Issue #597
2487
- pips: pips // Issue #594
2488
- };
2489
-
2490
- // Attach user events.
2491
- bindSliderEvents(options.events);
2492
-
2493
- // Use the public value method to set the start values.
2494
- valueSet(options.start);
2495
-
2496
- if ( options.pips ) {
2497
- pips(options.pips);
2498
- }
2499
-
2500
- if ( options.tooltips ) {
2501
- tooltips();
2502
- }
2503
-
2504
- return scope_Self;
2505
-
2506
- }
2507
-
2508
-
2509
- // Run the standard initializer
2510
- function initialize ( target, originalOptions ) {
2511
-
2512
- if ( !target.nodeName ) {
2513
- throw new Error('noUiSlider.create requires a single element.');
2514
- }
2515
-
2516
- if (originalOptions.tooltips === undefined) {
2517
- originalOptions.tooltips = true;
2518
- }
2519
-
2520
- // Test the options and create the slider environment;
2521
- var options = testOptions( originalOptions, target );
2522
- var api = closure( target, options, originalOptions );
2523
-
2524
- target.noUiSlider = api;
2525
-
2526
- return api;
2527
- }
2528
-
2529
- // Use an object instead of a function for future expansibility;
2530
- return {
2531
- create: initialize
2532
- };
2533
-
2534
- }));