locomotivecms 3.0.1 → 3.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (576) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -2
  3. data/app/api/locomotive/api.rb +4 -0
  4. data/app/api/locomotive/api/entities/site_entity.rb +8 -0
  5. data/app/api/locomotive/api/forms/site_form.rb +1 -1
  6. data/app/api/locomotive/api/helpers/params_helper.rb +14 -3
  7. data/app/api/locomotive/api/middlewares/logger_middleware.rb +1 -3
  8. data/app/api/locomotive/api/resources/current_site_resource.rb +3 -1
  9. data/app/api/locomotive/api/resources/page_resource.rb +2 -2
  10. data/app/api/locomotive/api/resources/site_resource.rb +4 -0
  11. data/app/assets/images/locomotive/blank.png +0 -0
  12. data/app/assets/images/locomotive/icons/flags/bf.png +0 -0
  13. data/app/assets/images/locomotive/icons/flags/bg.png +0 -0
  14. data/app/assets/images/locomotive/icons/flags/cs.png +0 -0
  15. data/app/assets/images/locomotive/icons/flags/de.png +0 -0
  16. data/app/assets/images/locomotive/icons/flags/en.png +0 -0
  17. data/app/assets/images/locomotive/icons/flags/es.png +0 -0
  18. data/app/assets/images/locomotive/icons/flags/et.png +0 -0
  19. data/app/assets/images/locomotive/icons/flags/fr.png +0 -0
  20. data/app/assets/images/locomotive/icons/flags/it.png +0 -0
  21. data/app/assets/images/locomotive/icons/flags/ja.png +0 -0
  22. data/app/assets/images/locomotive/icons/flags/lt.png +0 -0
  23. data/app/assets/images/locomotive/icons/flags/mg.png +0 -0
  24. data/app/assets/images/locomotive/icons/flags/nb.png +0 -0
  25. data/app/assets/images/locomotive/icons/flags/nl.png +0 -0
  26. data/app/assets/images/locomotive/icons/flags/pl.png +0 -0
  27. data/app/assets/images/locomotive/icons/flags/pt-BR.png +0 -0
  28. data/app/assets/images/locomotive/icons/flags/pt.png +0 -0
  29. data/app/assets/images/locomotive/icons/flags/ru.png +0 -0
  30. data/app/assets/images/locomotive/icons/flags/sk.png +0 -0
  31. data/app/assets/images/locomotive/icons/flags/sr.png +0 -0
  32. data/app/assets/images/locomotive/icons/flags/sv.png +0 -0
  33. data/app/assets/images/locomotive/icons/flags/zh-CN.png +0 -0
  34. data/app/assets/javascripts/locomotive.js +3 -1
  35. data/app/assets/javascripts/locomotive/utils/core_ext.js +10 -0
  36. data/app/assets/javascripts/locomotive/utils/wysihtml5.js.coffee +0 -16
  37. data/app/assets/javascripts/locomotive/views/application_view.js.coffee +20 -3
  38. data/app/assets/javascripts/locomotive/views/current_site/edit_view.js.coffee +7 -0
  39. data/app/assets/javascripts/locomotive/views/current_site_metafields/index_view.js.coffee +7 -0
  40. data/app/assets/javascripts/locomotive/views/editable_elements/edit_view.js.coffee +2 -2
  41. data/app/assets/javascripts/locomotive/views/editable_elements/iframe_view.js.coffee +10 -0
  42. data/app/assets/javascripts/locomotive/views/editable_elements/index_view.js.coffee +11 -6
  43. data/app/assets/javascripts/locomotive/views/editable_elements/text_highlighter_view.js.coffee +6 -1
  44. data/app/assets/javascripts/locomotive/views/inputs/file_view.js.coffee +1 -8
  45. data/app/assets/javascripts/locomotive/views/inputs/image_view.js.coffee +84 -0
  46. data/app/assets/javascripts/locomotive/views/inputs/rte/edit_table_view.js.coffee +2 -0
  47. data/app/assets/javascripts/locomotive/views/inputs/rte/file_view.js.coffee +5 -3
  48. data/app/assets/javascripts/locomotive/views/inputs/rte/image_view.js.coffee +14 -0
  49. data/app/assets/javascripts/locomotive/views/inputs/rte/link_view.js.coffee +9 -3
  50. data/app/assets/javascripts/locomotive/views/inputs/rte/table_view.js.coffee +7 -2
  51. data/app/assets/javascripts/locomotive/views/inputs/rte_view.js.coffee.erb +19 -6
  52. data/app/assets/javascripts/locomotive/views/inputs/simple_image_view.js.coffee +17 -40
  53. data/app/assets/javascripts/locomotive/views/shared/drawer_view.js.coffee +8 -6
  54. data/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee +30 -8
  55. data/app/assets/javascripts/locomotive/views/shared/sidebar_view.js.coffee +31 -2
  56. data/app/assets/stylesheets/locomotive/account.scss +14 -10
  57. data/app/assets/stylesheets/locomotive/application.scss +101 -24
  58. data/app/assets/stylesheets/locomotive/live_editing_error.scss +48 -4
  59. data/app/assets/stylesheets/locomotive/live_editing_iframe.scss +0 -2
  60. data/app/assets/stylesheets/locomotive/new/_actionbar.scss +83 -0
  61. data/app/assets/stylesheets/locomotive/{account → new}/_brand.scss +0 -0
  62. data/app/assets/stylesheets/locomotive/new/_content.scss +65 -0
  63. data/app/assets/stylesheets/locomotive/new/_drawer.scss +53 -0
  64. data/app/assets/stylesheets/locomotive/new/_files.scss +124 -0
  65. data/app/assets/stylesheets/locomotive/{account → new}/_forms.scss +0 -0
  66. data/app/assets/stylesheets/locomotive/{account → new}/_keyframes.scss +0 -0
  67. data/app/assets/stylesheets/locomotive/{account → new}/_navigation.scss +85 -0
  68. data/app/assets/stylesheets/locomotive/{account → new}/_navs.scss +0 -0
  69. data/app/assets/stylesheets/locomotive/{account → new}/_notify.scss +0 -0
  70. data/app/assets/stylesheets/locomotive/{account → new}/_public.scss +0 -0
  71. data/app/assets/stylesheets/locomotive/new/_sidebar.scss +177 -0
  72. data/app/assets/stylesheets/locomotive/new/_transitions.scss +96 -0
  73. data/app/assets/stylesheets/locomotive/{account → new}/_type.scss +0 -0
  74. data/app/assets/stylesheets/locomotive/{account → new}/_variables.scss +0 -0
  75. data/app/assets/stylesheets/locomotive/{components → old}/_activity_feed.scss +0 -0
  76. data/app/assets/stylesheets/locomotive/{base → old}/_buttons.scss +0 -0
  77. data/app/assets/stylesheets/locomotive/{components → old}/_content_assets.scss +49 -48
  78. data/app/assets/stylesheets/locomotive/{components → old}/_dashboard.scss +0 -0
  79. data/app/assets/stylesheets/locomotive/{components → old}/_developers.scss +0 -0
  80. data/app/assets/stylesheets/locomotive/{components → old}/_list.scss +15 -21
  81. data/app/assets/stylesheets/locomotive/old/_live_editing.scss +37 -0
  82. data/app/assets/stylesheets/locomotive/{components → old}/_main.scss +4 -14
  83. data/app/assets/stylesheets/locomotive/{base → old}/_nav.scss +0 -0
  84. data/app/assets/stylesheets/locomotive/old/_scrollable.scss +11 -0
  85. data/app/assets/stylesheets/locomotive/{components/misc/_nav.scss → old/_search_bars.scss} +8 -14
  86. data/app/assets/stylesheets/locomotive/{components → old}/_translations.scss +0 -0
  87. data/app/assets/stylesheets/locomotive/{globals → old}/_variables.scss +47 -12
  88. data/app/assets/stylesheets/locomotive/{base → old}/form/_array_input.scss +20 -27
  89. data/app/assets/stylesheets/locomotive/{base → old}/form/_base.scss +1 -0
  90. data/app/assets/stylesheets/locomotive/{base → old}/form/_code.scss +0 -0
  91. data/app/assets/stylesheets/locomotive/{base → old}/form/_color_input.scss +0 -0
  92. data/app/assets/stylesheets/locomotive/{base → old}/form/_document_picker.scss +0 -0
  93. data/app/assets/stylesheets/locomotive/{base → old}/form/_file_input.scss +14 -20
  94. data/app/assets/stylesheets/locomotive/{base → old}/form/_link.scss +0 -0
  95. data/app/assets/stylesheets/locomotive/{base → old}/form/_markdown.scss +0 -0
  96. data/app/assets/stylesheets/locomotive/{base → old}/form/_popover.scss +0 -0
  97. data/app/assets/stylesheets/locomotive/{base → old}/form/_rte.scss +8 -0
  98. data/app/assets/stylesheets/locomotive/{base → old}/form/_select2.scss +35 -0
  99. data/app/assets/stylesheets/locomotive/{base → old}/form/_tags.scss +0 -0
  100. data/app/assets/stylesheets/locomotive/{base → old}/form/_toggle.scss +4 -10
  101. data/app/controllers/locomotive/content_entries_controller.rb +1 -1
  102. data/app/controllers/locomotive/current_site_metafields_controller.rb +34 -0
  103. data/app/controllers/locomotive/custom_fields/select_options_controller.rb +4 -0
  104. data/app/controllers/locomotive/pages_controller.rb +1 -1
  105. data/app/helpers/locomotive/base_helper.rb +13 -0
  106. data/app/helpers/locomotive/current_site_metafields_helper.rb +126 -0
  107. data/app/helpers/locomotive/my_account_helper.rb +1 -1
  108. data/app/helpers/locomotive/shared/pages_helper.rb +4 -0
  109. data/app/helpers/locomotive/sites_helper.rb +9 -11
  110. data/app/inputs/locomotive/file_input.rb +3 -3
  111. data/app/inputs/locomotive/image_input.rb +97 -0
  112. data/app/inputs/locomotive/rte_input.rb +2 -1
  113. data/app/inputs/locomotive/simple_image_input.rb +5 -68
  114. data/app/models/locomotive/concerns/site/metafields.rb +96 -0
  115. data/app/models/locomotive/editable_text.rb +2 -1
  116. data/app/models/locomotive/site.rb +1 -0
  117. data/app/policies/locomotive/page_policy.rb +6 -0
  118. data/app/services/locomotive/content_entry_service.rb +3 -0
  119. data/app/services/locomotive/site_metafields_service.rb +39 -0
  120. data/app/views/locomotive/current_site/edit.html.slim +3 -0
  121. data/app/views/locomotive/current_site_metafields/form/_panes.html.slim +19 -0
  122. data/app/views/locomotive/current_site_metafields/form/_tabs.html.slim +6 -0
  123. data/app/views/locomotive/current_site_metafields/index.html.slim +26 -0
  124. data/app/views/locomotive/editable_elements/_form.html.slim +1 -1
  125. data/app/views/locomotive/layouts/application.html.slim +22 -19
  126. data/app/views/locomotive/layouts/live_editing.html.slim +19 -30
  127. data/app/views/locomotive/pages/form/_main.html.slim +3 -0
  128. data/app/views/locomotive/shared/_account_navigation.slim +9 -2
  129. data/app/views/locomotive/shared/_head.html.slim +4 -0
  130. data/app/views/locomotive/shared/_locale_picker_link.html.slim +1 -1
  131. data/app/views/locomotive/shared/_navigation.html.slim +30 -0
  132. data/app/views/locomotive/shared/_sidebar.html.slim +42 -26
  133. data/app/views/locomotive/shared/rte/_toolbar.html.slim +76 -68
  134. data/app/views/locomotive/shared/sidebar/_content_types.html.slim +11 -11
  135. data/app/views/locomotive/shared/sidebar/_link.html.slim +0 -3
  136. data/app/views/locomotive/shared/sidebar/_page.html.slim +8 -13
  137. data/app/views/locomotive/shared/sidebar/_pages.html.slim +4 -7
  138. data/app/views/locomotive/sites/index.html.slim +0 -1
  139. data/config/locales/carrierwave.cs.yml +4 -0
  140. data/config/locales/carrierwave.de.yml +4 -0
  141. data/config/locales/cs.yml +318 -0
  142. data/config/locales/de.yml +318 -0
  143. data/config/locales/default.cs.yml +13 -0
  144. data/config/locales/default.de.yml +13 -0
  145. data/config/locales/default.fr.yml +13 -1
  146. data/config/locales/devise.cs.yml +61 -0
  147. data/config/locales/devise.de.yml +61 -0
  148. data/config/locales/devise.fr.yml +61 -1
  149. data/config/locales/el.yml +0 -2
  150. data/config/locales/en.yml +9 -0
  151. data/config/locales/flash.cs.yml +79 -0
  152. data/config/locales/flash.de.yml +79 -0
  153. data/config/locales/flash.en.yml +4 -0
  154. data/config/locales/flash.fr.yml +82 -1
  155. data/config/locales/fr.yml +323 -0
  156. data/config/locales/inputs.cs.yml +19 -0
  157. data/config/locales/inputs.de.yml +19 -0
  158. data/config/locales/inputs.fr.yml +19 -1
  159. data/config/locales/mongoid.cs.yml +47 -0
  160. data/config/locales/mongoid.de.yml +38 -0
  161. data/config/locales/mongoid.fr.yml +35 -0
  162. data/config/locales/simple_form.cs.yml +152 -0
  163. data/config/locales/simple_form.de.yml +36 -0
  164. data/config/locales/simple_form.el.yml +0 -1
  165. data/config/locales/simple_form.fr.yml +153 -1
  166. data/config/routes.rb +4 -0
  167. data/lib/generators/locomotive/install/templates/locomotive.rb +2 -2
  168. data/lib/locomotive/configuration.rb +1 -1
  169. data/lib/locomotive/dependencies.rb +1 -0
  170. data/lib/locomotive/engine.rb +0 -1
  171. data/lib/locomotive/middlewares/site.rb +1 -1
  172. data/lib/locomotive/mongoid/patches.rb +8 -0
  173. data/lib/locomotive/steam/middlewares/page_editing.rb +1 -1
  174. data/lib/locomotive/version.rb +1 -1
  175. data/spec/dummy/config/initializers/locomotive.rb +1 -1
  176. data/spec/models/locomotive/concerns/site/metafields_spec.rb +121 -0
  177. data/spec/requests/locomotive/steam/cache_spec.rb +1 -1
  178. data/vendor/assets/components/locomotive/eonasdan-bootstrap-datetimepicker/bootstrap-datetimepicker.css +5 -0
  179. data/vendor/assets/components/locomotive/eonasdan-bootstrap-datetimepicker/bootstrap-datetimepicker.js +9 -0
  180. data/vendor/assets/components/locomotive/moment-timezone/moment-timezone.js +7 -0
  181. data/vendor/assets/components/locomotive/moment/moment.js +3606 -0
  182. data/vendor/assets/components/locomotive/select2/select2.js +0 -3
  183. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/CONTRIBUTING.md +38 -0
  184. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/Gruntfile.js +191 -0
  185. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/LICENSE +21 -0
  186. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/README.md +37 -0
  187. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/bower.json +35 -0
  188. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker-standalone.css +103 -0
  189. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css +373 -0
  190. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css +5 -0
  191. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js +9 -0
  192. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/component.json +9 -0
  193. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/composer.json +28 -0
  194. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/docs/ChangeLog.md +222 -0
  195. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/docs/ContributorsGuide.md +126 -0
  196. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/docs/Events.md +96 -0
  197. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/docs/Extras.md +95 -0
  198. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/docs/FAQ.md +22 -0
  199. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/docs/Functions.md +670 -0
  200. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/docs/Installing.md +161 -0
  201. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/docs/Options.md +473 -0
  202. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/docs/Version 4 Changelog.md +6 -0
  203. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/docs/Version 4 Contributors guide.md +6 -0
  204. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/docs/index.md +592 -0
  205. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/mkdocs.yml +17 -0
  206. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/package.json +43 -0
  207. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js +2552 -0
  208. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/src/less/_bootstrap-datetimepicker.less +352 -0
  209. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/src/less/bootstrap-datetimepicker-build.less +17 -0
  210. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/src/nuget/Bootstrap.v3.Datetimepicker.CSS.nuspec +34 -0
  211. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/src/nuget/Bootstrap.v3.Datetimepicker.nuspec +34 -0
  212. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/src/nuget/NuGet.exe +0 -0
  213. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/src/nuget/install.ps1 +2 -0
  214. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/src/sass/_bootstrap-datetimepicker.scss +343 -0
  215. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/src/sass/bootstrap-datetimepicker-build.scss +16 -0
  216. data/vendor/assets/components/locomotive_sources/eonasdan-bootstrap-datetimepicker/tasks/bump_version.js +88 -0
  217. data/vendor/assets/components/locomotive_sources/moment-timezone/LICENSE +20 -0
  218. data/vendor/assets/components/locomotive_sources/moment-timezone/README.md +36 -0
  219. data/vendor/assets/components/locomotive_sources/moment-timezone/bower.json +18 -0
  220. data/vendor/assets/components/locomotive_sources/moment-timezone/builds/moment-timezone-with-data-2010-2020.js +1189 -0
  221. data/vendor/assets/components/locomotive_sources/moment-timezone/builds/moment-timezone-with-data-2010-2020.min.js +7 -0
  222. data/vendor/assets/components/locomotive_sources/moment-timezone/builds/moment-timezone-with-data.js +1189 -0
  223. data/vendor/assets/components/locomotive_sources/moment-timezone/builds/moment-timezone-with-data.min.js +7 -0
  224. data/vendor/assets/components/locomotive_sources/moment-timezone/builds/moment-timezone.min.js +6 -0
  225. data/vendor/assets/components/locomotive_sources/moment-timezone/changelog.md +101 -0
  226. data/vendor/assets/components/locomotive_sources/moment-timezone/composer.json +43 -0
  227. data/vendor/assets/components/locomotive_sources/moment-timezone/data/meta/latest.json +5012 -0
  228. data/vendor/assets/components/locomotive_sources/moment-timezone/data/packed/latest.json +590 -0
  229. data/vendor/assets/components/locomotive_sources/moment-timezone/data/unpacked/latest.json +124081 -0
  230. data/vendor/assets/components/locomotive_sources/moment-timezone/moment-timezone-utils.js +316 -0
  231. data/vendor/assets/components/locomotive_sources/moment-timezone/moment-timezone.js +599 -0
  232. data/vendor/assets/components/locomotive_sources/moment/CHANGELOG.md +496 -0
  233. data/vendor/assets/components/locomotive_sources/moment/LICENSE +22 -0
  234. data/vendor/assets/components/locomotive_sources/moment/README.md +58 -0
  235. data/vendor/assets/components/locomotive_sources/moment/bower.json +22 -0
  236. data/vendor/assets/components/locomotive_sources/moment/locale/af.js +73 -0
  237. data/vendor/assets/components/locomotive_sources/moment/locale/ar-ma.js +59 -0
  238. data/vendor/assets/components/locomotive_sources/moment/locale/ar-sa.js +103 -0
  239. data/vendor/assets/components/locomotive_sources/moment/locale/ar-tn.js +57 -0
  240. data/vendor/assets/components/locomotive_sources/moment/locale/ar.js +136 -0
  241. data/vendor/assets/components/locomotive_sources/moment/locale/az.js +104 -0
  242. data/vendor/assets/components/locomotive_sources/moment/locale/be.js +134 -0
  243. data/vendor/assets/components/locomotive_sources/moment/locale/bg.js +90 -0
  244. data/vendor/assets/components/locomotive_sources/moment/locale/bn.js +113 -0
  245. data/vendor/assets/components/locomotive_sources/moment/locale/bo.js +110 -0
  246. data/vendor/assets/components/locomotive_sources/moment/locale/br.js +107 -0
  247. data/vendor/assets/components/locomotive_sources/moment/locale/bs.js +141 -0
  248. data/vendor/assets/components/locomotive_sources/moment/locale/ca.js +79 -0
  249. data/vendor/assets/components/locomotive_sources/moment/locale/cs.js +171 -0
  250. data/vendor/assets/components/locomotive_sources/moment/locale/cv.js +63 -0
  251. data/vendor/assets/components/locomotive_sources/moment/locale/cy.js +79 -0
  252. data/vendor/assets/components/locomotive_sources/moment/locale/da.js +60 -0
  253. data/vendor/assets/components/locomotive_sources/moment/locale/de-at.js +77 -0
  254. data/vendor/assets/components/locomotive_sources/moment/locale/de.js +76 -0
  255. data/vendor/assets/components/locomotive_sources/moment/locale/dv.js +99 -0
  256. data/vendor/assets/components/locomotive_sources/moment/locale/el.js +98 -0
  257. data/vendor/assets/components/locomotive_sources/moment/locale/en-au.js +66 -0
  258. data/vendor/assets/components/locomotive_sources/moment/locale/en-ca.js +63 -0
  259. data/vendor/assets/components/locomotive_sources/moment/locale/en-gb.js +67 -0
  260. data/vendor/assets/components/locomotive_sources/moment/locale/en-ie.js +67 -0
  261. data/vendor/assets/components/locomotive_sources/moment/locale/en-nz.js +66 -0
  262. data/vendor/assets/components/locomotive_sources/moment/locale/eo.js +73 -0
  263. data/vendor/assets/components/locomotive_sources/moment/locale/es.js +79 -0
  264. data/vendor/assets/components/locomotive_sources/moment/locale/et.js +80 -0
  265. data/vendor/assets/components/locomotive_sources/moment/locale/eu.js +64 -0
  266. data/vendor/assets/components/locomotive_sources/moment/locale/fa.js +105 -0
  267. data/vendor/assets/components/locomotive_sources/moment/locale/fi.js +107 -0
  268. data/vendor/assets/components/locomotive_sources/moment/locale/fo.js +60 -0
  269. data/vendor/assets/components/locomotive_sources/moment/locale/fr-ca.js +58 -0
  270. data/vendor/assets/components/locomotive_sources/moment/locale/fr-ch.js +62 -0
  271. data/vendor/assets/components/locomotive_sources/moment/locale/fr.js +62 -0
  272. data/vendor/assets/components/locomotive_sources/moment/locale/fy.js +71 -0
  273. data/vendor/assets/components/locomotive_sources/moment/locale/gd.js +76 -0
  274. data/vendor/assets/components/locomotive_sources/moment/locale/gl.js +75 -0
  275. data/vendor/assets/components/locomotive_sources/moment/locale/he.js +82 -0
  276. data/vendor/assets/components/locomotive_sources/moment/locale/hi.js +123 -0
  277. data/vendor/assets/components/locomotive_sources/moment/locale/hr.js +143 -0
  278. data/vendor/assets/components/locomotive_sources/moment/locale/hu.js +109 -0
  279. data/vendor/assets/components/locomotive_sources/moment/locale/hy-am.js +95 -0
  280. data/vendor/assets/components/locomotive_sources/moment/locale/id.js +83 -0
  281. data/vendor/assets/components/locomotive_sources/moment/locale/is.js +127 -0
  282. data/vendor/assets/components/locomotive_sources/moment/locale/it.js +70 -0
  283. data/vendor/assets/components/locomotive_sources/moment/locale/ja.js +65 -0
  284. data/vendor/assets/components/locomotive_sources/moment/locale/jv.js +83 -0
  285. data/vendor/assets/components/locomotive_sources/moment/locale/ka.js +89 -0
  286. data/vendor/assets/components/locomotive_sources/moment/locale/kk.js +87 -0
  287. data/vendor/assets/components/locomotive_sources/moment/locale/km.js +58 -0
  288. data/vendor/assets/components/locomotive_sources/moment/locale/ko.js +68 -0
  289. data/vendor/assets/components/locomotive_sources/moment/locale/lb.js +134 -0
  290. data/vendor/assets/components/locomotive_sources/moment/locale/lo.js +69 -0
  291. data/vendor/assets/components/locomotive_sources/moment/locale/lt.js +115 -0
  292. data/vendor/assets/components/locomotive_sources/moment/locale/lv.js +96 -0
  293. data/vendor/assets/components/locomotive_sources/moment/locale/me.js +109 -0
  294. data/vendor/assets/components/locomotive_sources/moment/locale/mk.js +90 -0
  295. data/vendor/assets/components/locomotive_sources/moment/locale/ml.js +71 -0
  296. data/vendor/assets/components/locomotive_sources/moment/locale/mr.js +158 -0
  297. data/vendor/assets/components/locomotive_sources/moment/locale/ms-my.js +82 -0
  298. data/vendor/assets/components/locomotive_sources/moment/locale/ms.js +82 -0
  299. data/vendor/assets/components/locomotive_sources/moment/locale/my.js +93 -0
  300. data/vendor/assets/components/locomotive_sources/moment/locale/nb.js +61 -0
  301. data/vendor/assets/components/locomotive_sources/moment/locale/ne.js +121 -0
  302. data/vendor/assets/components/locomotive_sources/moment/locale/nl.js +71 -0
  303. data/vendor/assets/components/locomotive_sources/moment/locale/nn.js +60 -0
  304. data/vendor/assets/components/locomotive_sources/moment/locale/pl.js +105 -0
  305. data/vendor/assets/components/locomotive_sources/moment/locale/pt-br.js +60 -0
  306. data/vendor/assets/components/locomotive_sources/moment/locale/pt.js +64 -0
  307. data/vendor/assets/components/locomotive_sources/moment/locale/ro.js +74 -0
  308. data/vendor/assets/components/locomotive_sources/moment/locale/ru.js +166 -0
  309. data/vendor/assets/components/locomotive_sources/moment/locale/se.js +61 -0
  310. data/vendor/assets/components/locomotive_sources/moment/locale/si.js +66 -0
  311. data/vendor/assets/components/locomotive_sources/moment/locale/sk.js +150 -0
  312. data/vendor/assets/components/locomotive_sources/moment/locale/sl.js +160 -0
  313. data/vendor/assets/components/locomotive_sources/moment/locale/sq.js +69 -0
  314. data/vendor/assets/components/locomotive_sources/moment/locale/sr-cyrl.js +108 -0
  315. data/vendor/assets/components/locomotive_sources/moment/locale/sr.js +108 -0
  316. data/vendor/assets/components/locomotive_sources/moment/locale/sv.js +67 -0
  317. data/vendor/assets/components/locomotive_sources/moment/locale/sw.js +58 -0
  318. data/vendor/assets/components/locomotive_sources/moment/locale/ta.js +129 -0
  319. data/vendor/assets/components/locomotive_sources/moment/locale/te.js +88 -0
  320. data/vendor/assets/components/locomotive_sources/moment/locale/th.js +65 -0
  321. data/vendor/assets/components/locomotive_sources/moment/locale/tl-ph.js +62 -0
  322. data/vendor/assets/components/locomotive_sources/moment/locale/tlh.js +119 -0
  323. data/vendor/assets/components/locomotive_sources/moment/locale/tr.js +90 -0
  324. data/vendor/assets/components/locomotive_sources/moment/locale/tzl.js +87 -0
  325. data/vendor/assets/components/locomotive_sources/moment/locale/tzm-latn.js +58 -0
  326. data/vendor/assets/components/locomotive_sources/moment/locale/tzm.js +58 -0
  327. data/vendor/assets/components/locomotive_sources/moment/locale/uk.js +146 -0
  328. data/vendor/assets/components/locomotive_sources/moment/locale/uz.js +58 -0
  329. data/vendor/assets/components/locomotive_sources/moment/locale/vi.js +66 -0
  330. data/vendor/assets/components/locomotive_sources/moment/locale/zh-cn.js +127 -0
  331. data/vendor/assets/components/locomotive_sources/moment/locale/zh-tw.js +101 -0
  332. data/vendor/assets/components/locomotive_sources/moment/min/locales.js +7548 -0
  333. data/vendor/assets/components/locomotive_sources/moment/min/locales.min.js +72 -0
  334. data/vendor/assets/components/locomotive_sources/moment/min/moment-with-locales.js +11144 -0
  335. data/vendor/assets/components/locomotive_sources/moment/min/moment-with-locales.min.js +74 -0
  336. data/vendor/assets/components/locomotive_sources/moment/min/moment.min.js +7 -0
  337. data/vendor/assets/components/locomotive_sources/moment/min/tests.js +46196 -0
  338. data/vendor/assets/components/locomotive_sources/moment/moment.js +3606 -0
  339. data/vendor/assets/components/locomotive_sources/moment/src/lib/create/check-overflow.js +34 -0
  340. data/vendor/assets/components/locomotive_sources/moment/src/lib/create/date-from-array.js +21 -0
  341. data/vendor/assets/components/locomotive_sources/moment/src/lib/create/from-anything.js +101 -0
  342. data/vendor/assets/components/locomotive_sources/moment/src/lib/create/from-array.js +136 -0
  343. data/vendor/assets/components/locomotive_sources/moment/src/lib/create/from-object.js +16 -0
  344. data/vendor/assets/components/locomotive_sources/moment/src/lib/create/from-string-and-array.js +50 -0
  345. data/vendor/assets/components/locomotive_sources/moment/src/lib/create/from-string-and-format.js +104 -0
  346. data/vendor/assets/components/locomotive_sources/moment/src/lib/create/from-string.js +120 -0
  347. data/vendor/assets/components/locomotive_sources/moment/src/lib/create/local.js +5 -0
  348. data/vendor/assets/components/locomotive_sources/moment/src/lib/create/parsing-flags.js +22 -0
  349. data/vendor/assets/components/locomotive_sources/moment/src/lib/create/utc.js +5 -0
  350. data/vendor/assets/components/locomotive_sources/moment/src/lib/create/valid.js +37 -0
  351. data/vendor/assets/components/locomotive_sources/moment/src/lib/duration/abs.js +18 -0
  352. data/vendor/assets/components/locomotive_sources/moment/src/lib/duration/add-subtract.js +21 -0
  353. data/vendor/assets/components/locomotive_sources/moment/src/lib/duration/as.js +55 -0
  354. data/vendor/assets/components/locomotive_sources/moment/src/lib/duration/bubble.js +61 -0
  355. data/vendor/assets/components/locomotive_sources/moment/src/lib/duration/constructor.js +41 -0
  356. data/vendor/assets/components/locomotive_sources/moment/src/lib/duration/create.js +117 -0
  357. data/vendor/assets/components/locomotive_sources/moment/src/lib/duration/duration.js +12 -0
  358. data/vendor/assets/components/locomotive_sources/moment/src/lib/duration/get.js +25 -0
  359. data/vendor/assets/components/locomotive_sources/moment/src/lib/duration/humanize.js +64 -0
  360. data/vendor/assets/components/locomotive_sources/moment/src/lib/duration/iso-string.js +52 -0
  361. data/vendor/assets/components/locomotive_sources/moment/src/lib/duration/prototype.js +48 -0
  362. data/vendor/assets/components/locomotive_sources/moment/src/lib/format/format.js +92 -0
  363. data/vendor/assets/components/locomotive_sources/moment/src/lib/locale/calendar.js +15 -0
  364. data/vendor/assets/components/locomotive_sources/moment/src/lib/locale/constructor.js +2 -0
  365. data/vendor/assets/components/locomotive_sources/moment/src/lib/locale/en.js +15 -0
  366. data/vendor/assets/components/locomotive_sources/moment/src/lib/locale/formats.js +23 -0
  367. data/vendor/assets/components/locomotive_sources/moment/src/lib/locale/invalid.js +5 -0
  368. data/vendor/assets/components/locomotive_sources/moment/src/lib/locale/lists.js +48 -0
  369. data/vendor/assets/components/locomotive_sources/moment/src/lib/locale/locale.js +35 -0
  370. data/vendor/assets/components/locomotive_sources/moment/src/lib/locale/locales.js +118 -0
  371. data/vendor/assets/components/locomotive_sources/moment/src/lib/locale/ordinal.js +7 -0
  372. data/vendor/assets/components/locomotive_sources/moment/src/lib/locale/pre-post-format.js +3 -0
  373. data/vendor/assets/components/locomotive_sources/moment/src/lib/locale/prototype.js +76 -0
  374. data/vendor/assets/components/locomotive_sources/moment/src/lib/locale/relative.js +29 -0
  375. data/vendor/assets/components/locomotive_sources/moment/src/lib/locale/set.js +16 -0
  376. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/add-subtract.js +52 -0
  377. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/calendar.js +21 -0
  378. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/clone.js +5 -0
  379. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/compare.js +57 -0
  380. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/constructor.js +74 -0
  381. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/creation-data.js +9 -0
  382. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/diff.js +61 -0
  383. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/format.js +28 -0
  384. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/from.js +17 -0
  385. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/get-set.js +43 -0
  386. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/locale.js +34 -0
  387. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/min-max.js +63 -0
  388. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/moment.js +28 -0
  389. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/now.js +3 -0
  390. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/prototype.js +149 -0
  391. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/start-end-of.js +52 -0
  392. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/to-type.js +34 -0
  393. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/to.js +17 -0
  394. data/vendor/assets/components/locomotive_sources/moment/src/lib/moment/valid.js +15 -0
  395. data/vendor/assets/components/locomotive_sources/moment/src/lib/parse/regex.js +54 -0
  396. data/vendor/assets/components/locomotive_sources/moment/src/lib/parse/token.js +32 -0
  397. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/aliases.js +29 -0
  398. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/constants.js +9 -0
  399. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/day-of-month.js +32 -0
  400. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/day-of-week.js +162 -0
  401. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/day-of-year.js +32 -0
  402. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/hour.js +129 -0
  403. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/millisecond.js +64 -0
  404. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/minute.js +24 -0
  405. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/month.js +209 -0
  406. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/offset.js +219 -0
  407. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/quarter.js +27 -0
  408. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/second.js +24 -0
  409. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/timestamp.js +20 -0
  410. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/timezone.js +16 -0
  411. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/units.js +20 -0
  412. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/week-calendar-utils.js +65 -0
  413. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/week-year.js +101 -0
  414. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/week.js +61 -0
  415. data/vendor/assets/components/locomotive_sources/moment/src/lib/units/year.js +70 -0
  416. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/abs-ceil.js +7 -0
  417. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/abs-floor.js +7 -0
  418. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/compare-arrays.js +16 -0
  419. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/defaults.js +10 -0
  420. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/deprecate.js +33 -0
  421. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/extend.js +19 -0
  422. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/has-own-prop.js +3 -0
  423. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/hooks.js +13 -0
  424. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/is-array.js +3 -0
  425. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/is-date.js +3 -0
  426. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/is-function.js +3 -0
  427. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/is-undefined.js +3 -0
  428. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/map.js +7 -0
  429. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/to-int.js +12 -0
  430. data/vendor/assets/components/locomotive_sources/moment/src/lib/utils/zero-fill.js +7 -0
  431. data/vendor/assets/components/locomotive_sources/moment/src/locale/af.js +63 -0
  432. data/vendor/assets/components/locomotive_sources/moment/src/locale/ar-ma.js +50 -0
  433. data/vendor/assets/components/locomotive_sources/moment/src/locale/ar-sa.js +94 -0
  434. data/vendor/assets/components/locomotive_sources/moment/src/locale/ar-tn.js +48 -0
  435. data/vendor/assets/components/locomotive_sources/moment/src/locale/ar.js +127 -0
  436. data/vendor/assets/components/locomotive_sources/moment/src/locale/az.js +95 -0
  437. data/vendor/assets/components/locomotive_sources/moment/src/locale/be.js +125 -0
  438. data/vendor/assets/components/locomotive_sources/moment/src/locale/bg.js +81 -0
  439. data/vendor/assets/components/locomotive_sources/moment/src/locale/bn.js +104 -0
  440. data/vendor/assets/components/locomotive_sources/moment/src/locale/bo.js +101 -0
  441. data/vendor/assets/components/locomotive_sources/moment/src/locale/br.js +98 -0
  442. data/vendor/assets/components/locomotive_sources/moment/src/locale/bs.js +132 -0
  443. data/vendor/assets/components/locomotive_sources/moment/src/locale/ca.js +70 -0
  444. data/vendor/assets/components/locomotive_sources/moment/src/locale/cs.js +162 -0
  445. data/vendor/assets/components/locomotive_sources/moment/src/locale/cv.js +53 -0
  446. data/vendor/assets/components/locomotive_sources/moment/src/locale/cy.js +70 -0
  447. data/vendor/assets/components/locomotive_sources/moment/src/locale/da.js +51 -0
  448. data/vendor/assets/components/locomotive_sources/moment/src/locale/de-at.js +67 -0
  449. data/vendor/assets/components/locomotive_sources/moment/src/locale/de.js +66 -0
  450. data/vendor/assets/components/locomotive_sources/moment/src/locale/dv.js +89 -0
  451. data/vendor/assets/components/locomotive_sources/moment/src/locale/el.js +86 -0
  452. data/vendor/assets/components/locomotive_sources/moment/src/locale/en-au.js +57 -0
  453. data/vendor/assets/components/locomotive_sources/moment/src/locale/en-ca.js +54 -0
  454. data/vendor/assets/components/locomotive_sources/moment/src/locale/en-gb.js +58 -0
  455. data/vendor/assets/components/locomotive_sources/moment/src/locale/en-ie.js +58 -0
  456. data/vendor/assets/components/locomotive_sources/moment/src/locale/en-nz.js +56 -0
  457. data/vendor/assets/components/locomotive_sources/moment/src/locale/eo.js +64 -0
  458. data/vendor/assets/components/locomotive_sources/moment/src/locale/es.js +70 -0
  459. data/vendor/assets/components/locomotive_sources/moment/src/locale/et.js +71 -0
  460. data/vendor/assets/components/locomotive_sources/moment/src/locale/eu.js +55 -0
  461. data/vendor/assets/components/locomotive_sources/moment/src/locale/fa.js +96 -0
  462. data/vendor/assets/components/locomotive_sources/moment/src/locale/fi.js +98 -0
  463. data/vendor/assets/components/locomotive_sources/moment/src/locale/fo.js +51 -0
  464. data/vendor/assets/components/locomotive_sources/moment/src/locale/fr-ca.js +49 -0
  465. data/vendor/assets/components/locomotive_sources/moment/src/locale/fr-ch.js +53 -0
  466. data/vendor/assets/components/locomotive_sources/moment/src/locale/fr.js +53 -0
  467. data/vendor/assets/components/locomotive_sources/moment/src/locale/fy.js +62 -0
  468. data/vendor/assets/components/locomotive_sources/moment/src/locale/gd.js +67 -0
  469. data/vendor/assets/components/locomotive_sources/moment/src/locale/gl.js +66 -0
  470. data/vendor/assets/components/locomotive_sources/moment/src/locale/he.js +73 -0
  471. data/vendor/assets/components/locomotive_sources/moment/src/locale/hi.js +114 -0
  472. data/vendor/assets/components/locomotive_sources/moment/src/locale/hr.js +134 -0
  473. data/vendor/assets/components/locomotive_sources/moment/src/locale/hu.js +100 -0
  474. data/vendor/assets/components/locomotive_sources/moment/src/locale/hy-am.js +86 -0
  475. data/vendor/assets/components/locomotive_sources/moment/src/locale/id.js +74 -0
  476. data/vendor/assets/components/locomotive_sources/moment/src/locale/is.js +118 -0
  477. data/vendor/assets/components/locomotive_sources/moment/src/locale/it.js +61 -0
  478. data/vendor/assets/components/locomotive_sources/moment/src/locale/ja.js +56 -0
  479. data/vendor/assets/components/locomotive_sources/moment/src/locale/jv.js +73 -0
  480. data/vendor/assets/components/locomotive_sources/moment/src/locale/ka.js +80 -0
  481. data/vendor/assets/components/locomotive_sources/moment/src/locale/kk.js +77 -0
  482. data/vendor/assets/components/locomotive_sources/moment/src/locale/km.js +49 -0
  483. data/vendor/assets/components/locomotive_sources/moment/src/locale/ko.js +59 -0
  484. data/vendor/assets/components/locomotive_sources/moment/src/locale/lb.js +125 -0
  485. data/vendor/assets/components/locomotive_sources/moment/src/locale/lo.js +60 -0
  486. data/vendor/assets/components/locomotive_sources/moment/src/locale/lt.js +106 -0
  487. data/vendor/assets/components/locomotive_sources/moment/src/locale/lv.js +87 -0
  488. data/vendor/assets/components/locomotive_sources/moment/src/locale/me.js +99 -0
  489. data/vendor/assets/components/locomotive_sources/moment/src/locale/mk.js +81 -0
  490. data/vendor/assets/components/locomotive_sources/moment/src/locale/ml.js +62 -0
  491. data/vendor/assets/components/locomotive_sources/moment/src/locale/mr.js +149 -0
  492. data/vendor/assets/components/locomotive_sources/moment/src/locale/ms-my.js +73 -0
  493. data/vendor/assets/components/locomotive_sources/moment/src/locale/ms.js +73 -0
  494. data/vendor/assets/components/locomotive_sources/moment/src/locale/my.js +84 -0
  495. data/vendor/assets/components/locomotive_sources/moment/src/locale/nb.js +52 -0
  496. data/vendor/assets/components/locomotive_sources/moment/src/locale/ne.js +112 -0
  497. data/vendor/assets/components/locomotive_sources/moment/src/locale/nl.js +62 -0
  498. data/vendor/assets/components/locomotive_sources/moment/src/locale/nn.js +51 -0
  499. data/vendor/assets/components/locomotive_sources/moment/src/locale/pl.js +95 -0
  500. data/vendor/assets/components/locomotive_sources/moment/src/locale/pt-br.js +51 -0
  501. data/vendor/assets/components/locomotive_sources/moment/src/locale/pt.js +55 -0
  502. data/vendor/assets/components/locomotive_sources/moment/src/locale/ro.js +65 -0
  503. data/vendor/assets/components/locomotive_sources/moment/src/locale/ru.js +156 -0
  504. data/vendor/assets/components/locomotive_sources/moment/src/locale/se.js +51 -0
  505. data/vendor/assets/components/locomotive_sources/moment/src/locale/si.js +56 -0
  506. data/vendor/assets/components/locomotive_sources/moment/src/locale/sk.js +141 -0
  507. data/vendor/assets/components/locomotive_sources/moment/src/locale/sl.js +150 -0
  508. data/vendor/assets/components/locomotive_sources/moment/src/locale/sq.js +60 -0
  509. data/vendor/assets/components/locomotive_sources/moment/src/locale/sr-cyrl.js +99 -0
  510. data/vendor/assets/components/locomotive_sources/moment/src/locale/sr.js +99 -0
  511. data/vendor/assets/components/locomotive_sources/moment/src/locale/sv.js +58 -0
  512. data/vendor/assets/components/locomotive_sources/moment/src/locale/sw.js +49 -0
  513. data/vendor/assets/components/locomotive_sources/moment/src/locale/ta.js +120 -0
  514. data/vendor/assets/components/locomotive_sources/moment/src/locale/te.js +78 -0
  515. data/vendor/assets/components/locomotive_sources/moment/src/locale/th.js +56 -0
  516. data/vendor/assets/components/locomotive_sources/moment/src/locale/tl-ph.js +53 -0
  517. data/vendor/assets/components/locomotive_sources/moment/src/locale/tlh.js +109 -0
  518. data/vendor/assets/components/locomotive_sources/moment/src/locale/tr.js +81 -0
  519. data/vendor/assets/components/locomotive_sources/moment/src/locale/tzl.js +78 -0
  520. data/vendor/assets/components/locomotive_sources/moment/src/locale/tzm-latn.js +49 -0
  521. data/vendor/assets/components/locomotive_sources/moment/src/locale/tzm.js +49 -0
  522. data/vendor/assets/components/locomotive_sources/moment/src/locale/uk.js +137 -0
  523. data/vendor/assets/components/locomotive_sources/moment/src/locale/uz.js +49 -0
  524. data/vendor/assets/components/locomotive_sources/moment/src/locale/vi.js +57 -0
  525. data/vendor/assets/components/locomotive_sources/moment/src/locale/zh-cn.js +118 -0
  526. data/vendor/assets/components/locomotive_sources/moment/src/locale/zh-tw.js +91 -0
  527. data/vendor/assets/components/locomotive_sources/moment/src/moment.js +71 -0
  528. data/vendor/assets/components/locomotive_sources/moment/templates/amd-named.js +7 -0
  529. data/vendor/assets/components/locomotive_sources/moment/templates/amd.js +7 -0
  530. data/vendor/assets/components/locomotive_sources/moment/templates/default.js +5 -0
  531. data/vendor/assets/components/locomotive_sources/moment/templates/globals.js +5 -0
  532. data/vendor/assets/components/locomotive_sources/moment/templates/locale-header.js +6 -0
  533. data/vendor/assets/components/locomotive_sources/moment/templates/test-header.js +6 -0
  534. data/vendor/assets/javascripts/locomotive/vendor.js +1 -2
  535. data/vendor/assets/stylesheets/locomotive/wysihtml5_editor.css +1 -1
  536. metadata +458 -100
  537. data/app/assets/stylesheets/locomotive/account/_files.scss +0 -125
  538. data/app/assets/stylesheets/locomotive/base/_all.scss +0 -6
  539. data/app/assets/stylesheets/locomotive/base/_fonts.scss +0 -27
  540. data/app/assets/stylesheets/locomotive/base/_form.scss +0 -18
  541. data/app/assets/stylesheets/locomotive/base/_iframe.scss +0 -4
  542. data/app/assets/stylesheets/locomotive/base/_typography.scss +0 -6
  543. data/app/assets/stylesheets/locomotive/base/form/_api_key.scss +0 -24
  544. data/app/assets/stylesheets/locomotive/base/form/_date.scss +0 -11
  545. data/app/assets/stylesheets/locomotive/components/_drawer.scss +0 -24
  546. data/app/assets/stylesheets/locomotive/components/_header.scss +0 -3
  547. data/app/assets/stylesheets/locomotive/components/_live_editing.scss +0 -95
  548. data/app/assets/stylesheets/locomotive/components/_misc.scss +0 -3
  549. data/app/assets/stylesheets/locomotive/components/_sidebar.scss +0 -5
  550. data/app/assets/stylesheets/locomotive/components/_sites.scss +0 -130
  551. data/app/assets/stylesheets/locomotive/components/_transitions.scss +0 -149
  552. data/app/assets/stylesheets/locomotive/components/header/_account.scss +0 -63
  553. data/app/assets/stylesheets/locomotive/components/header/_base.scss +0 -91
  554. data/app/assets/stylesheets/locomotive/components/header/_responsive.scss +0 -34
  555. data/app/assets/stylesheets/locomotive/components/misc/_modal.scss +0 -13
  556. data/app/assets/stylesheets/locomotive/components/misc/_notify.scss +0 -25
  557. data/app/assets/stylesheets/locomotive/components/sidebar/_base.scss +0 -58
  558. data/app/assets/stylesheets/locomotive/components/sidebar/_content_types.scss +0 -30
  559. data/app/assets/stylesheets/locomotive/components/sidebar/_link.scss +0 -36
  560. data/app/assets/stylesheets/locomotive/components/sidebar/_my_account.scss +0 -21
  561. data/app/assets/stylesheets/locomotive/components/sidebar/_pages_tree.scss +0 -108
  562. data/app/assets/stylesheets/locomotive/globals/_mixins.scss +0 -34
  563. data/app/assets/stylesheets/locomotive/layouts/_live_editing.scss +0 -33
  564. data/app/assets/stylesheets/locomotive/layouts/_main.scss +0 -62
  565. data/app/assets/stylesheets/locomotive/layouts/_not_logged_in.scss +0 -33
  566. data/app/assets/stylesheets/locomotive/layouts/_responsive.scss +0 -12
  567. data/app/views/locomotive/shared/_header.html.slim +0 -30
  568. data/app/views/locomotive/shared/_sidebar_without_site.html.slim +0 -5
  569. data/app/views/locomotive/shared/header/_account.html.slim +0 -4
  570. data/app/views/locomotive/shared/header/_account_menu.html.slim +0 -5
  571. data/app/views/locomotive/shared/header/_brand.html.slim +0 -3
  572. data/app/views/locomotive/shared/header/_site.html.slim +0 -8
  573. data/app/views/locomotive/shared/sidebar/_my_account.html.slim +0 -8
  574. data/vendor/assets/javascripts/locomotive/bootstrap-datetimepicker.js +0 -1395
  575. data/vendor/assets/javascripts/locomotive/moment.js +0 -2808
  576. data/vendor/assets/stylesheets/locomotive/bootstrap-datetimepicker.css +0 -235
@@ -1,36 +0,0 @@
1
- .sidebar {
2
-
3
- .link {
4
-
5
- a {
6
- display: block;
7
- overflow: auto;
8
- height: $sidebar_link_height;
9
- line-height: $sidebar_link_height;
10
- }
11
-
12
- .text {
13
- @include transition(all 0.3s ease-in-out);
14
- color: $sidebar_link_color;
15
- }
16
-
17
- .icon {
18
- margin-right: 5px;
19
- font-size: 14px;
20
- color: $sidebar_link_icon_color;
21
- }
22
-
23
- .arrow {
24
- float: right;
25
- font-size: 22px;
26
- position: relative;
27
- top: -2px;
28
-
29
- i {
30
- color: $sidebar_link_arrow_color;
31
- }
32
- }
33
-
34
- }
35
-
36
- }
@@ -1,21 +0,0 @@
1
- .sidebar {
2
-
3
- section.my-account {
4
-
5
- a {
6
-
7
- .img-circle {
8
- width: 30px;
9
- height: 30px;
10
- }
11
-
12
- span {
13
- margin-left: 10px;
14
- font-size: 16px;
15
- }
16
-
17
- }
18
-
19
- }
20
-
21
- }
@@ -1,108 +0,0 @@
1
- $pt_icon_color: #636666;
2
- $pt_border_color: #4a4d4d;
3
- $pt_new_link_color: #949999;
4
- $pt_placeholder_color: #2f2f2f;
5
- $pt_warning_color: #f89406;
6
-
7
- .sidebar {
8
-
9
- .pages-tree {
10
-
11
- ul {
12
- list-style: none outside none;
13
- padding: 0px;
14
-
15
- &.root {
16
- padding-top: 0px;
17
- padding-left: ($grid-gutter-width / 2);
18
- padding-right: ($grid-gutter-width / 2);
19
- margin-top: 13px;
20
- }
21
-
22
- a {
23
- padding-left: 0px;
24
- padding-right: 0px;
25
- }
26
-
27
- li {
28
- margin: 9px 0px;
29
-
30
- .icon {
31
- @include user-select(none);
32
-
33
- margin-left: 1px;
34
- margin-right: 5px;
35
-
36
- &, > * {
37
- color: $pt_icon_color;
38
- }
39
-
40
- &.draggable {
41
- cursor: move;
42
- }
43
-
44
- &.on {
45
- color: #fff;
46
- }
47
- }
48
-
49
- &.unpublished > a {
50
- font-style: italic;
51
- }
52
-
53
- .untranslated {
54
- margin-left: 5px;
55
- color: $pt_warning_color;
56
- }
57
-
58
- .fold-unfold {
59
- @include user-select(none);
60
-
61
- margin-left: 8px;
62
-
63
- i {
64
- color: $pt_icon_color;
65
- display: none;
66
- position: relative;
67
- cursor: pointer;
68
- font-size: 14px;
69
-
70
- &.unfolded { top: -1px; }
71
- &.folded { top: 3px; }
72
- }
73
-
74
- &.folded .folded, &.unfolded .unfolded { display: inline; }
75
- }
76
-
77
- &.new-entry, &.list-entries, &.new-page {
78
- a {
79
- margin-left: 1px;
80
- color: $pt_new_link_color;
81
- text-transform: capitalize;
82
-
83
- .text {
84
- @include transition(all 0.3s ease-in-out);
85
- color: $pt_new_link_color;
86
- }
87
- }
88
- }
89
- }
90
-
91
- ul.leaves {
92
- margin-left: 5px;
93
- padding: 0px 14px 0px;
94
- border-left: 1px solid $pt_border_color;
95
- }
96
-
97
- .sortable-placeholder {
98
- background-color: $pt_placeholder_color;
99
- height: 20px;
100
- border-radius: 10px;
101
- border: none;
102
- }
103
-
104
- }
105
-
106
- }
107
-
108
- }
@@ -1,34 +0,0 @@
1
- @mixin full-space {
2
- position: absolute;
3
- top: 0;
4
- right: 0;
5
- bottom: 0;
6
- left: 0;
7
- }
8
-
9
- @mixin locomotive_gradient {
10
- background: linear-gradient(to bottom, $background_gradient_start 60px, $background_gradient_start 20%, $background_gradient_end);
11
- background-position: left top;
12
- background-repeat: no-repeat;
13
- background-size: 100%;
14
- }
15
-
16
- @mixin draggable {
17
- @include user-select(none);
18
- cursor: move;
19
- }
20
-
21
- @mixin control-window-button {
22
- position: absolute;
23
- top: 0;
24
- right: 0;
25
- z-index: 991;
26
- width: $control_window_button_size;
27
- height: $control_window_button_size;
28
- font-size: 15px;
29
- line-height: $control_window_button_size;
30
- color: $control_window_button_color;
31
- text-align: center;
32
- cursor: pointer;
33
- background: $control_window_background_color;
34
- }
@@ -1,33 +0,0 @@
1
- body.live-editing {
2
-
3
- .slide-sidebar {
4
-
5
- }
6
-
7
- .preview {
8
- position: absolute;
9
- top: 0px;
10
- bottom: 0px;
11
- left: 0px;
12
- right: $live_editing_content_width;
13
- }
14
-
15
- .content {
16
- left: auto;
17
- right: 0px;
18
- width: $live_editing_content_width;
19
-
20
- .inner {
21
- position: absolute;
22
- top: 0px;
23
- left: 0px;
24
- right: 0px;
25
- bottom: 0px;
26
- }
27
- }
28
-
29
- &.sidebar-closed .content {
30
- left: auto;
31
- }
32
-
33
- }
@@ -1,62 +0,0 @@
1
- body {
2
- overflow: hidden;
3
- }
4
-
5
- .wrapper {
6
- position: relative;
7
- }
8
-
9
- body.without-site {
10
-
11
- .sidebar {
12
- left: -$sidebar_width;
13
- }
14
-
15
- }
16
-
17
- .sidebar {
18
- position: absolute;
19
- top: 0px;
20
- left: 0px;
21
- right: 0px;
22
- bottom: 0px;
23
- width: $sidebar_width;
24
- }
25
-
26
- .content {
27
- position: absolute;
28
- top: 0px;
29
- left: $sidebar_width;
30
- right: 0px;
31
- bottom: 0px;
32
- }
33
-
34
- .drawer {
35
- position: absolute;
36
- top: 0px;
37
- right: 0px;
38
- bottom: 0px;
39
- width: 100%;
40
- z-index: 990;
41
-
42
- &.small-width-drawer {
43
- width: $drawer_width;
44
- }
45
-
46
- > .inner {
47
- height: 100%;
48
- }
49
- }
50
-
51
- .scrollable {
52
- position: absolute;
53
- top: 0px;
54
- right: 0px;
55
- bottom: 0px;
56
- left: 0px;
57
- overflow: auto;
58
-
59
- > .main {
60
- height: 100%;
61
- }
62
- }
@@ -1,33 +0,0 @@
1
- @import "../globals/variables";
2
- @import "../globals/mixins";
3
-
4
- html {
5
- background-color: $background_gradient_end;
6
- }
7
-
8
- body,
9
- html {
10
- height: 100%;
11
- }
12
-
13
- body {
14
- @include locomotive_gradient;
15
- padding-bottom: 20px;
16
- }
17
-
18
- .wrapper {
19
- height: 100%;
20
- .main {
21
- @include full-space();
22
- @include make-row();
23
- right: $grid-gutter-width;
24
- left: $grid-gutter-width;
25
- .content {
26
- display: flex;
27
- flex-direction: column;
28
- align-items: center;
29
- justify-content: center;
30
- height: 100%;
31
- }
32
- }
33
- }
@@ -1,12 +0,0 @@
1
- @media (max-width: $screen-sm-min) {
2
-
3
- .sidebar {
4
- z-index: 10;
5
- left: -$sidebar_width;
6
- }
7
-
8
- .content {
9
- left: 0px;
10
- }
11
-
12
- }
@@ -1,30 +0,0 @@
1
- .header
2
- nav.navbar.navbar-default role='navigation'
3
- .container-fluid
4
- .navbar-header
5
- button type='button' class='navbar-toggle'
6
- span.sr-only Toggle navigation
7
- .icon-bar
8
- .icon-bar
9
- .icon-bar
10
-
11
- .navbar-brand.hidden-xs
12
- = render 'locomotive/shared/header/brand'
13
-
14
- ul.nav.navbar-nav.navbar-site.visible-xs
15
- li
16
- = render 'locomotive/shared/header/site'
17
-
18
- .navbar-collapse#account-menu-collapse.hidden-xs
19
- ul.nav.navbar-nav.navbar-site
20
- li
21
- = render 'locomotive/shared/header/site'
22
-
23
- ul.nav.navbar-nav.navbar-right.account-menu-wrapper
24
- li.dropdown
25
- = render 'locomotive/shared/header/account'
26
-
27
- ul.dropdown-menu.dropdown-menu-right role='menu'
28
- = render 'locomotive/shared/header/account_menu'
29
-
30
- = render 'locomotive/shared/main_app_header'
@@ -1,5 +0,0 @@
1
- = render 'locomotive/shared/sidebar/my_account'
2
-
3
- = render 'locomotive/shared/sidebar/link', icon: 'fa-suitcase', label: t(:sites, scope: 'locomotive.shared.header'), url: sites_path
4
-
5
- = render 'locomotive/shared/sidebar/link', icon: 'fa-sign-out', label: t(:logout, scope: 'locomotive.shared.header'), url: sign_out_path, data: { method: 'delete' }
@@ -1,4 +0,0 @@
1
- = link_to '#', id: 'navigation-dropdown', class: 'dropdown-toggle', data: { toggle: 'dropdown' }, aria: { haspopup: 'true', expanded: 'false' } do
2
- = image_tag account_avatar_url(current_locomotive_account), class: 'img-circle', alt: current_locomotive_account.name_was
3
- span= current_locomotive_account.name_was
4
- span.caret
@@ -1,5 +0,0 @@
1
- li= link_to t(:sites, scope: 'locomotive.shared.header'), sites_path
2
- li= link_to t(:account, scope: 'locomotive.shared.header'), edit_my_account_path(_location: request.fullpath)
3
- li= link_to t(:help, scope: 'locomotive.shared.header'), 'http://locomotive-v3.readme.io', target: '_blank'
4
- li class="divider"
5
- li= link_to t(:logout, scope: 'locomotive.shared.header'), sign_out_path, data: { method: 'delete' }
@@ -1,3 +0,0 @@
1
- span.default><
2
- = link_to sites_path do
3
- = image_tag 'locomotive/logo-white.png'
@@ -1,8 +0,0 @@
1
- - if (_title = yield(:site_title)).present?
2
- .navbar-text
3
- = _title
4
- - else
5
- = link_to current_site.name_was, dashboard_path(current_site)
6
- = link_to preview_path(current_site), target: 'blank' do
7
- span.arrow
8
- i.fa.fa-external-link
@@ -1,8 +0,0 @@
1
- section.link.my-account.visible-xs-block
2
-
3
- = link_to edit_my_account_url(_location: request.fullpath) do
4
-
5
- = image_tag account_avatar_url(current_locomotive_account, '60x60#'), class: 'img-circle', alt: @current_locomotive_account.name_was
6
-
7
- span.text
8
- = current_locomotive_account.name_was
@@ -1,1395 +0,0 @@
1
- /*
2
- //! version : 3.1.1
3
- =========================================================
4
- bootstrap-datetimepicker.js
5
- https://github.com/Eonasdan/bootstrap-datetimepicker
6
- =========================================================
7
- The MIT License (MIT)
8
-
9
- Copyright (c) 2014 Jonathan Peterson
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in
19
- all copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
- THE SOFTWARE.
28
- */
29
- ;(function (root, factory) {
30
- 'use strict';
31
- if (typeof define === 'function' && define.amd) {
32
- // AMD is used - Register as an anonymous module.
33
- define(['jquery', 'moment'], factory);
34
- } else {
35
- // AMD is not used - Attempt to fetch dependencies from scope.
36
- if (!jQuery) {
37
- throw new Error('bootstrap-datetimepicker requires jQuery to be loaded first');
38
- }
39
- if (!moment) {
40
- throw new Error('bootstrap-datetimepicker requires moment.js to be loaded first');
41
- }
42
- factory(root.jQuery, moment);
43
- }
44
- }(this, function ($, moment) {
45
- 'use strict';
46
- if (typeof moment === 'undefined') {
47
- throw new Error('momentjs is required');
48
- }
49
-
50
- var dpgId = 0,
51
-
52
- DateTimePicker = function (element, options) {
53
- var defaults = $.fn.datetimepicker.defaults,
54
-
55
- icons = {
56
- time: 'glyphicon glyphicon-time',
57
- date: 'glyphicon glyphicon-calendar',
58
- up: 'glyphicon glyphicon-chevron-up',
59
- down: 'glyphicon glyphicon-chevron-down'
60
- },
61
-
62
- picker = this,
63
- errored = false,
64
- dDate,
65
-
66
- init = function () {
67
- var icon = false, localeData, rInterval;
68
- picker.options = $.extend({}, defaults, options);
69
- picker.options.icons = $.extend({}, icons, picker.options.icons);
70
-
71
- picker.element = $(element);
72
-
73
- dataToOptions();
74
-
75
- if (!(picker.options.pickTime || picker.options.pickDate)) {
76
- throw new Error('Must choose at least one picker');
77
- }
78
-
79
- picker.id = dpgId++;
80
- moment.locale(picker.options.language);
81
- picker.date = moment();
82
- picker.unset = false;
83
- picker.isInput = picker.element.is('input');
84
- picker.component = false;
85
-
86
- if (picker.element.hasClass('input-group')) {
87
- if (picker.element.find('.datepickerbutton').size() === 0) {//in case there is more then one 'input-group-addon' Issue #48
88
- picker.component = picker.element.find('[class^="input-group-"]');
89
- }
90
- else {
91
- picker.component = picker.element.find('.datepickerbutton');
92
- }
93
- }
94
- picker.format = picker.options.format;
95
-
96
- localeData = moment().localeData();
97
-
98
- if (!picker.format) {
99
- picker.format = (picker.options.pickDate ? localeData.longDateFormat('L') : '');
100
- if (picker.options.pickDate && picker.options.pickTime) {
101
- picker.format += ' ';
102
- }
103
- picker.format += (picker.options.pickTime ? localeData.longDateFormat('LT') : '');
104
- if (picker.options.useSeconds) {
105
- if (localeData.longDateFormat('LT').indexOf(' A') !== -1) {
106
- picker.format = picker.format.split(' A')[0] + ':ss A';
107
- }
108
- else {
109
- picker.format += ':ss';
110
- }
111
- }
112
- }
113
-
114
- if (picker.options.use24hours !== undefined) {
115
- picker.use24hours = picker.options.use24hours
116
- } else {
117
- picker.use24hours = (picker.format.toLowerCase().indexOf('a') < 0 && picker.format.indexOf('h') < 0);
118
- }
119
-
120
- // if (picker.options.use24hours == undefined) {
121
- // picker.use24hours = (picker.format.toLowerCase().indexOf('a') < 0 && picker.format.indexOf('h') < 0);
122
- // }
123
-
124
- if (picker.component) {
125
- icon = picker.component.find('span');
126
- }
127
-
128
- if (picker.options.pickTime) {
129
- if (icon) {
130
- icon.addClass(picker.options.icons.time);
131
- }
132
- }
133
- if (picker.options.pickDate) {
134
- if (icon) {
135
- icon.removeClass(picker.options.icons.time);
136
- icon.addClass(picker.options.icons.date);
137
- }
138
- }
139
-
140
- picker.options.widgetParent =
141
- typeof picker.options.widgetParent === 'string' && picker.options.widgetParent ||
142
- picker.element.parents().filter(function () {
143
- return 'scroll' === $(this).css('overflow-y');
144
- }).get(0) ||
145
- 'body';
146
-
147
- picker.widget = $(getTemplate()).appendTo(picker.options.widgetParent);
148
-
149
- picker.minViewMode = picker.options.minViewMode || 0;
150
- if (typeof picker.minViewMode === 'string') {
151
- switch (picker.minViewMode) {
152
- case 'months':
153
- picker.minViewMode = 1;
154
- break;
155
- case 'years':
156
- picker.minViewMode = 2;
157
- break;
158
- default:
159
- picker.minViewMode = 0;
160
- break;
161
- }
162
- }
163
- picker.viewMode = picker.options.viewMode || 0;
164
- if (typeof picker.viewMode === 'string') {
165
- switch (picker.viewMode) {
166
- case 'months':
167
- picker.viewMode = 1;
168
- break;
169
- case 'years':
170
- picker.viewMode = 2;
171
- break;
172
- default:
173
- picker.viewMode = 0;
174
- break;
175
- }
176
- }
177
-
178
- picker.viewMode = Math.max(picker.viewMode, picker.minViewMode);
179
-
180
- picker.options.disabledDates = indexGivenDates(picker.options.disabledDates);
181
- picker.options.enabledDates = indexGivenDates(picker.options.enabledDates);
182
-
183
- picker.startViewMode = picker.viewMode;
184
- picker.setMinDate(picker.options.minDate);
185
- picker.setMaxDate(picker.options.maxDate);
186
- fillDow();
187
- fillMonths();
188
- fillHours();
189
- fillMinutes();
190
- fillSeconds();
191
- update();
192
- showMode();
193
- attachDatePickerEvents();
194
- if (picker.options.defaultDate !== '' && getPickerInput().val() === '') {
195
- picker.setValue(picker.options.defaultDate);
196
- }
197
- if (picker.options.minuteStepping !== 1) {
198
- rInterval = picker.options.minuteStepping;
199
- picker.date.minutes((Math.round(picker.date.minutes() / rInterval) * rInterval) % 60).seconds(0);
200
- }
201
- },
202
-
203
- getPickerInput = function () {
204
- var input;
205
-
206
- if (picker.isInput) {
207
- return picker.element;
208
- }
209
- input = picker.element.find('.datepickerinput');
210
- if (input.size() === 0) {
211
- input = picker.element.find('input');
212
- }
213
- else if (!input.is('input')) {
214
- throw new Error('CSS class "datepickerinput" cannot be applied to non input element');
215
- }
216
- return input;
217
- },
218
-
219
- dataToOptions = function () {
220
- var eData;
221
- if (picker.element.is('input')) {
222
- eData = picker.element.data();
223
- }
224
- else {
225
- eData = picker.element.find('input').data();
226
- }
227
- if (eData.dateFormat !== undefined) {
228
- picker.options.format = eData.dateFormat;
229
- }
230
- if (eData.datePickdate !== undefined) {
231
- picker.options.pickDate = eData.datePickdate;
232
- }
233
- if (eData.datePicktime !== undefined) {
234
- picker.options.pickTime = eData.datePicktime;
235
- }
236
- if (eData.dateUseminutes !== undefined) {
237
- picker.options.useMinutes = eData.dateUseminutes;
238
- }
239
- if (eData.dateUseseconds !== undefined) {
240
- picker.options.useSeconds = eData.dateUseseconds;
241
- }
242
- if (eData.dateUsecurrent !== undefined) {
243
- picker.options.useCurrent = eData.dateUsecurrent;
244
- }
245
- if (eData.calendarWeeks !== undefined) {
246
- picker.options.calendarWeeks = eData.calendarWeeks;
247
- }
248
- if (eData.dateMinutestepping !== undefined) {
249
- picker.options.minuteStepping = eData.dateMinutestepping;
250
- }
251
- if (eData.dateMindate !== undefined) {
252
- picker.options.minDate = eData.dateMindate;
253
- }
254
- if (eData.dateMaxdate !== undefined) {
255
- picker.options.maxDate = eData.dateMaxdate;
256
- }
257
- if (eData.dateShowtoday !== undefined) {
258
- picker.options.showToday = eData.dateShowtoday;
259
- }
260
- if (eData.dateCollapse !== undefined) {
261
- picker.options.collapse = eData.dateCollapse;
262
- }
263
- if (eData.dateLanguage !== undefined) {
264
- picker.options.language = eData.dateLanguage;
265
- }
266
- if (eData.dateDefaultdate !== undefined) {
267
- picker.options.defaultDate = eData.dateDefaultdate;
268
- }
269
- if (eData.dateDisableddates !== undefined) {
270
- picker.options.disabledDates = eData.dateDisableddates;
271
- }
272
- if (eData.dateEnableddates !== undefined) {
273
- picker.options.enabledDates = eData.dateEnableddates;
274
- }
275
- if (eData.dateIcons !== undefined) {
276
- picker.options.icons = eData.dateIcons;
277
- }
278
- if (eData.dateUsestrict !== undefined) {
279
- picker.options.useStrict = eData.dateUsestrict;
280
- }
281
- if (eData.dateDirection !== undefined) {
282
- picker.options.direction = eData.dateDirection;
283
- }
284
- if (eData.dateSidebyside !== undefined) {
285
- picker.options.sideBySide = eData.dateSidebyside;
286
- }
287
- if (eData.dateDaysofweekdisabled !== undefined) {
288
- picker.options.daysOfWeekDisabled = eData.dateDaysofweekdisabled;
289
- }
290
- if (eData.use24hours !== undefined) {
291
- picker.options.use24hours = eData.use24hours;
292
- }
293
- // $.each(defaults, function (key) {
294
- // var attributeName = 'date' + key.charAt(0).toUpperCase() + key.slice(1);
295
- // if (eData[attributeName] !== undefined) {
296
- // picker.options[key] = eData[attributeName];
297
- // }
298
- // });
299
- },
300
-
301
- place = function () {
302
- var position = 'absolute',
303
- offset = picker.component ? picker.component.offset() : picker.element.offset(),
304
- $window = $(window),
305
- parentOffset = $(picker.options.widgetParent).offset(),
306
- placePosition;
307
-
308
- picker.width = picker.component ? picker.component.outerWidth() : picker.element.outerWidth();
309
- offset.top = offset.top + picker.element.outerHeight() - parentOffset.top;
310
-
311
- if (picker.options.direction === 'up') {
312
- placePosition = 'top';
313
- } else if (picker.options.direction === 'bottom') {
314
- placePosition = 'bottom';
315
- } else if (picker.options.direction === 'auto') {
316
- if ((offset.top + picker.widget.height() + parentOffset.top > $window.height() + $window.scrollTop()) && (picker.widget.height() + picker.element.outerHeight() < offset.top)) {
317
- placePosition = 'top';
318
- } else {
319
- placePosition = 'bottom';
320
- }
321
- }
322
- if (placePosition === 'top') {
323
- offset.bottom = $window.height() - offset.top + 3; // + picker.element.outerHeight() + 3;
324
- picker.widget.addClass('top').removeClass('bottom');
325
- } else {
326
- offset.top += 1;
327
- picker.widget.addClass('bottom').removeClass('top');
328
- }
329
-
330
- if (picker.options.width !== undefined) {
331
- picker.widget.width(picker.options.width);
332
- }
333
-
334
- if (picker.options.orientation === 'left') {
335
- picker.widget.addClass('left-oriented');
336
- offset.left = offset.left - picker.widget.width() + 20;
337
- }
338
-
339
- if (isInFixed()) {
340
- position = 'fixed';
341
- offset.top -= $window.scrollTop();
342
- offset.left -= $window.scrollLeft();
343
- }
344
-
345
- if ($window.width() < offset.left + picker.widget.outerWidth()) {
346
- offset.right = $window.width() - offset.left - picker.width;
347
- offset.left = 'auto';
348
- picker.widget.addClass('pull-right');
349
- } else {
350
- offset.right = 'auto';
351
- picker.widget.removeClass('pull-right');
352
- }
353
-
354
- if (placePosition === 'top') {
355
- picker.widget.css({
356
- position: position,
357
- bottom: offset.bottom,
358
- top: 'auto',
359
- left: offset.left,
360
- right: offset.right
361
- });
362
- } else {
363
- picker.widget.css({
364
- position: position,
365
- top: offset.top,
366
- bottom: 'auto',
367
- left: offset.left,
368
- right: offset.right
369
- });
370
- }
371
- },
372
-
373
- notifyChange = function (oldDate, eventType) {
374
- if (moment(picker.date).isSame(moment(oldDate)) && !errored) {
375
- return;
376
- }
377
- errored = false;
378
- picker.element.trigger({
379
- type: 'dp.change',
380
- date: moment(picker.date),
381
- oldDate: moment(oldDate)
382
- });
383
-
384
- if (eventType !== 'change') {
385
- picker.element.change();
386
- }
387
- },
388
-
389
- notifyError = function (date) {
390
- errored = true;
391
- picker.element.trigger({
392
- type: 'dp.error',
393
- date: moment(date, picker.format, picker.options.useStrict)
394
- });
395
- },
396
-
397
- update = function (newDate) {
398
- moment.locale(picker.options.language);
399
- var dateStr = newDate;
400
- if (!dateStr) {
401
- dateStr = getPickerInput().val();
402
- if (dateStr) {
403
- picker.date = moment(dateStr, picker.format, picker.options.useStrict);
404
- }
405
- if (!picker.date) {
406
- picker.date = moment();
407
- }
408
- }
409
- picker.viewDate = moment(picker.date).startOf('month');
410
- fillDate();
411
- fillTime();
412
- },
413
-
414
- fillDow = function () {
415
- moment.locale(picker.options.language);
416
- var html = $('<tr>'), weekdaysMin = moment.weekdaysMin(), i;
417
- if (picker.options.calendarWeeks === true) {
418
- html.append('<th class="cw">#</th>');
419
- }
420
- if (moment().localeData()._week.dow === 0) { // starts on Sunday
421
- for (i = 0; i < 7; i++) {
422
- html.append('<th class="dow">' + weekdaysMin[i] + '</th>');
423
- }
424
- } else {
425
- for (i = 1; i < 8; i++) {
426
- if (i === 7) {
427
- html.append('<th class="dow">' + weekdaysMin[0] + '</th>');
428
- } else {
429
- html.append('<th class="dow">' + weekdaysMin[i] + '</th>');
430
- }
431
- }
432
- }
433
- picker.widget.find('.datepicker-days thead').append(html);
434
- },
435
-
436
- fillMonths = function () {
437
- moment.locale(picker.options.language);
438
- var html = '', i, monthsShort = moment.monthsShort();
439
- for (i = 0; i < 12; i++) {
440
- html += '<span class="month">' + monthsShort[i] + '</span>';
441
- }
442
- picker.widget.find('.datepicker-months td').append(html);
443
- },
444
-
445
- fillDate = function () {
446
- if (!picker.options.pickDate) {
447
- return;
448
- }
449
- moment.locale(picker.options.language);
450
- var year = picker.viewDate.year(),
451
- month = picker.viewDate.month(),
452
- startYear = picker.options.minDate.year(),
453
- startMonth = picker.options.minDate.month(),
454
- endYear = picker.options.maxDate.year(),
455
- endMonth = picker.options.maxDate.month(),
456
- currentDate,
457
- prevMonth, nextMonth, html = [], row, clsName, i, days, yearCont, currentYear, months = moment.months();
458
-
459
- picker.widget.find('.datepicker-days').find('.disabled').removeClass('disabled');
460
- picker.widget.find('.datepicker-months').find('.disabled').removeClass('disabled');
461
- picker.widget.find('.datepicker-years').find('.disabled').removeClass('disabled');
462
-
463
- picker.widget.find('.datepicker-days th:eq(1)').text(
464
- months[month] + ' ' + year);
465
-
466
- prevMonth = moment(picker.viewDate, picker.format, picker.options.useStrict).subtract(1, 'months');
467
- days = prevMonth.daysInMonth();
468
- prevMonth.date(days).startOf('week');
469
- if ((year === startYear && month <= startMonth) || year < startYear) {
470
- picker.widget.find('.datepicker-days th:eq(0)').addClass('disabled');
471
- }
472
- if ((year === endYear && month >= endMonth) || year > endYear) {
473
- picker.widget.find('.datepicker-days th:eq(2)').addClass('disabled');
474
- }
475
-
476
- nextMonth = moment(prevMonth).add(42, 'd');
477
- while (prevMonth.isBefore(nextMonth)) {
478
- if (prevMonth.weekday() === moment().startOf('week').weekday()) {
479
- row = $('<tr>');
480
- html.push(row);
481
- if (picker.options.calendarWeeks === true) {
482
- row.append('<td class="cw">' + prevMonth.week() + '</td>');
483
- }
484
- }
485
- clsName = '';
486
- if (prevMonth.year() < year || (prevMonth.year() === year && prevMonth.month() < month)) {
487
- clsName += ' old';
488
- } else if (prevMonth.year() > year || (prevMonth.year() === year && prevMonth.month() > month)) {
489
- clsName += ' new';
490
- }
491
- if (prevMonth.isSame(moment({y: picker.date.year(), M: picker.date.month(), d: picker.date.date()}))) {
492
- clsName += ' active';
493
- }
494
- if (isInDisableDates(prevMonth, 'day') || !isInEnableDates(prevMonth)) {
495
- clsName += ' disabled';
496
- }
497
- if (picker.options.showToday === true) {
498
- if (prevMonth.isSame(moment(), 'day')) {
499
- clsName += ' today';
500
- }
501
- }
502
- if (picker.options.daysOfWeekDisabled) {
503
- for (i = 0; i < picker.options.daysOfWeekDisabled.length; i++) {
504
- if (prevMonth.day() === picker.options.daysOfWeekDisabled[i]) {
505
- clsName += ' disabled';
506
- break;
507
- }
508
- }
509
- }
510
- row.append('<td class="day' + clsName + '">' + prevMonth.date() + '</td>');
511
-
512
- currentDate = prevMonth.date();
513
- prevMonth.add(1, 'd');
514
-
515
- if (currentDate === prevMonth.date()) {
516
- prevMonth.add(1, 'd');
517
- }
518
- }
519
- picker.widget.find('.datepicker-days tbody').empty().append(html);
520
- currentYear = picker.date.year();
521
- months = picker.widget.find('.datepicker-months').find('th:eq(1)').text(year).end().find('span').removeClass('active');
522
- if (currentYear === year) {
523
- months.eq(picker.date.month()).addClass('active');
524
- }
525
- if (year - 1 < startYear) {
526
- picker.widget.find('.datepicker-months th:eq(0)').addClass('disabled');
527
- }
528
- if (year + 1 > endYear) {
529
- picker.widget.find('.datepicker-months th:eq(2)').addClass('disabled');
530
- }
531
- for (i = 0; i < 12; i++) {
532
- if ((year === startYear && startMonth > i) || (year < startYear)) {
533
- $(months[i]).addClass('disabled');
534
- } else if ((year === endYear && endMonth < i) || (year > endYear)) {
535
- $(months[i]).addClass('disabled');
536
- }
537
- }
538
-
539
- html = '';
540
- year = parseInt(year / 10, 10) * 10;
541
- yearCont = picker.widget.find('.datepicker-years').find(
542
- 'th:eq(1)').text(year + '-' + (year + 9)).parents('table').find('td');
543
- picker.widget.find('.datepicker-years').find('th').removeClass('disabled');
544
- if (startYear > year) {
545
- picker.widget.find('.datepicker-years').find('th:eq(0)').addClass('disabled');
546
- }
547
- if (endYear < year + 9) {
548
- picker.widget.find('.datepicker-years').find('th:eq(2)').addClass('disabled');
549
- }
550
- year -= 1;
551
- for (i = -1; i < 11; i++) {
552
- html += '<span class="year' + (i === -1 || i === 10 ? ' old' : '') + (currentYear === year ? ' active' : '') + ((year < startYear || year > endYear) ? ' disabled' : '') + '">' + year + '</span>';
553
- year += 1;
554
- }
555
- yearCont.html(html);
556
- },
557
-
558
- fillHours = function () {
559
- moment.locale(picker.options.language);
560
- var table = picker.widget.find('.timepicker .timepicker-hours table'), html = '', current, i, j;
561
- table.parent().hide();
562
- if (picker.use24hours) {
563
- current = 0;
564
- for (i = 0; i < 6; i += 1) {
565
- html += '<tr>';
566
- for (j = 0; j < 4; j += 1) {
567
- html += '<td class="hour">' + padLeft(current.toString()) + '</td>';
568
- current++;
569
- }
570
- html += '</tr>';
571
- }
572
- }
573
- else {
574
- current = 1;
575
- for (i = 0; i < 3; i += 1) {
576
- html += '<tr>';
577
- for (j = 0; j < 4; j += 1) {
578
- html += '<td class="hour">' + padLeft(current.toString()) + '</td>';
579
- current++;
580
- }
581
- html += '</tr>';
582
- }
583
- }
584
- table.html(html);
585
- },
586
-
587
- fillMinutes = function () {
588
- var table = picker.widget.find('.timepicker .timepicker-minutes table'), html = '', current = 0, i, j, step = picker.options.minuteStepping;
589
- table.parent().hide();
590
- if (step === 1) {
591
- step = 5;
592
- }
593
- for (i = 0; i < Math.ceil(60 / step / 4) ; i++) {
594
- html += '<tr>';
595
- for (j = 0; j < 4; j += 1) {
596
- if (current < 60) {
597
- html += '<td class="minute">' + padLeft(current.toString()) + '</td>';
598
- current += step;
599
- } else {
600
- html += '<td></td>';
601
- }
602
- }
603
- html += '</tr>';
604
- }
605
- table.html(html);
606
- },
607
-
608
- fillSeconds = function () {
609
- var table = picker.widget.find('.timepicker .timepicker-seconds table'), html = '', current = 0, i, j;
610
- table.parent().hide();
611
- for (i = 0; i < 3; i++) {
612
- html += '<tr>';
613
- for (j = 0; j < 4; j += 1) {
614
- html += '<td class="second">' + padLeft(current.toString()) + '</td>';
615
- current += 5;
616
- }
617
- html += '</tr>';
618
- }
619
- table.html(html);
620
- },
621
-
622
- fillTime = function () {
623
- if (!picker.date) {
624
- return;
625
- }
626
- var timeComponents = picker.widget.find('.timepicker span[data-time-component]'),
627
- hour = picker.date.hours(),
628
- period = picker.date.format('A');
629
- if (!picker.use24hours) {
630
- if (hour === 0) {
631
- hour = 12;
632
- } else if (hour !== 12) {
633
- hour = hour % 12;
634
- }
635
- picker.widget.find('.timepicker [data-action=togglePeriod]').text(period);
636
- }
637
- timeComponents.filter('[data-time-component=hours]').text(padLeft(hour));
638
- timeComponents.filter('[data-time-component=minutes]').text(padLeft(picker.date.minutes()));
639
- timeComponents.filter('[data-time-component=seconds]').text(padLeft(picker.date.second()));
640
- },
641
-
642
- click = function (e) {
643
- e.stopPropagation();
644
- e.preventDefault();
645
- picker.unset = false;
646
- var target = $(e.target).closest('span, td, th'), month, year, step, day, oldDate = moment(picker.date);
647
- if (target.length === 1) {
648
- if (!target.is('.disabled')) {
649
- switch (target[0].nodeName.toLowerCase()) {
650
- case 'th':
651
- switch (target[0].className) {
652
- case 'picker-switch':
653
- showMode(1);
654
- break;
655
- case 'prev':
656
- case 'next':
657
- step = dpGlobal.modes[picker.viewMode].navStep;
658
- if (target[0].className === 'prev') {
659
- step = step * -1;
660
- }
661
- picker.viewDate.add(step, dpGlobal.modes[picker.viewMode].navFnc);
662
- fillDate();
663
- break;
664
- }
665
- break;
666
- case 'span':
667
- if (target.is('.month')) {
668
- month = target.parent().find('span').index(target);
669
- picker.viewDate.month(month);
670
- } else {
671
- year = parseInt(target.text(), 10) || 0;
672
- picker.viewDate.year(year);
673
- }
674
- if (picker.viewMode === picker.minViewMode) {
675
- picker.date = moment({
676
- y: picker.viewDate.year(),
677
- M: picker.viewDate.month(),
678
- d: picker.viewDate.date(),
679
- h: picker.date.hours(),
680
- m: picker.date.minutes(),
681
- s: picker.date.seconds()
682
- });
683
- set();
684
- notifyChange(oldDate, e.type);
685
- }
686
- showMode(-1);
687
- fillDate();
688
- break;
689
- case 'td':
690
- if (target.is('.day')) {
691
- day = parseInt(target.text(), 10) || 1;
692
- month = picker.viewDate.month();
693
- year = picker.viewDate.year();
694
- if (target.is('.old')) {
695
- if (month === 0) {
696
- month = 11;
697
- year -= 1;
698
- } else {
699
- month -= 1;
700
- }
701
- } else if (target.is('.new')) {
702
- if (month === 11) {
703
- month = 0;
704
- year += 1;
705
- } else {
706
- month += 1;
707
- }
708
- }
709
- picker.date = moment({
710
- y: year,
711
- M: month,
712
- d: day,
713
- h: picker.date.hours(),
714
- m: picker.date.minutes(),
715
- s: picker.date.seconds()
716
- }
717
- );
718
- picker.viewDate = moment({
719
- y: year, M: month, d: Math.min(28, day)
720
- });
721
- fillDate();
722
- set();
723
- notifyChange(oldDate, e.type);
724
- }
725
- break;
726
- }
727
- }
728
- }
729
- },
730
-
731
- actions = {
732
- incrementHours: function () {
733
- checkDate('add', 'hours', 1);
734
- },
735
-
736
- incrementMinutes: function () {
737
- checkDate('add', 'minutes', picker.options.minuteStepping);
738
- },
739
-
740
- incrementSeconds: function () {
741
- checkDate('add', 'seconds', 1);
742
- },
743
-
744
- decrementHours: function () {
745
- checkDate('subtract', 'hours', 1);
746
- },
747
-
748
- decrementMinutes: function () {
749
- checkDate('subtract', 'minutes', picker.options.minuteStepping);
750
- },
751
-
752
- decrementSeconds: function () {
753
- checkDate('subtract', 'seconds', 1);
754
- },
755
-
756
- togglePeriod: function () {
757
- var hour = picker.date.hours();
758
- if (hour >= 12) {
759
- hour -= 12;
760
- } else {
761
- hour += 12;
762
- }
763
- picker.date.hours(hour);
764
- },
765
-
766
- showPicker: function () {
767
- picker.widget.find('.timepicker > div:not(.timepicker-picker)').hide();
768
- picker.widget.find('.timepicker .timepicker-picker').show();
769
- },
770
-
771
- showHours: function () {
772
- picker.widget.find('.timepicker .timepicker-picker').hide();
773
- picker.widget.find('.timepicker .timepicker-hours').show();
774
- },
775
-
776
- showMinutes: function () {
777
- picker.widget.find('.timepicker .timepicker-picker').hide();
778
- picker.widget.find('.timepicker .timepicker-minutes').show();
779
- },
780
-
781
- showSeconds: function () {
782
- picker.widget.find('.timepicker .timepicker-picker').hide();
783
- picker.widget.find('.timepicker .timepicker-seconds').show();
784
- },
785
-
786
- selectHour: function (e) {
787
- var hour = parseInt($(e.target).text(), 10);
788
- if (!picker.use24hours) {
789
- if (picker.date.hours() >= 12) {
790
- if (hour !== 12) {
791
- hour += 12;
792
- }
793
- } else {
794
- if (hour === 12) {
795
- hour = 0;
796
- }
797
- }
798
- }
799
- picker.date.hours(hour);
800
- actions.showPicker.call(picker);
801
- },
802
-
803
- selectMinute: function (e) {
804
- picker.date.minutes(parseInt($(e.target).text(), 10));
805
- actions.showPicker.call(picker);
806
- },
807
-
808
- selectSecond: function (e) {
809
- picker.date.seconds(parseInt($(e.target).text(), 10));
810
- actions.showPicker.call(picker);
811
- }
812
- },
813
-
814
- doAction = function (e) {
815
- var oldDate = moment(picker.date),
816
- action = $(e.currentTarget).data('action'),
817
- rv = actions[action].apply(picker, arguments);
818
- stopEvent(e);
819
- if (!picker.date) {
820
- picker.date = moment({y: 1970});
821
- }
822
- set();
823
- fillTime();
824
- notifyChange(oldDate, e.type);
825
- return rv;
826
- },
827
-
828
- stopEvent = function (e) {
829
- e.stopPropagation();
830
- e.preventDefault();
831
- },
832
-
833
- keydown = function (e) {
834
- if (e.keyCode === 27) { // allow escape to hide picker
835
- picker.hide();
836
- }
837
- },
838
-
839
- change = function (e) {
840
- moment.locale(picker.options.language);
841
- var input = $(e.target), oldDate = moment(picker.date), newDate = moment(input.val(), picker.format, picker.options.useStrict);
842
- if (newDate.isValid() && !isInDisableDates(newDate) && isInEnableDates(newDate)) {
843
- update();
844
- picker.setValue(newDate);
845
- notifyChange(oldDate, e.type);
846
- set();
847
- }
848
- else {
849
- picker.viewDate = oldDate;
850
- picker.unset = true;
851
- notifyChange(oldDate, e.type);
852
- notifyError(newDate);
853
- }
854
- },
855
-
856
- showMode = function (dir) {
857
- if (dir) {
858
- picker.viewMode = Math.max(picker.minViewMode, Math.min(2, picker.viewMode + dir));
859
- }
860
- picker.widget.find('.datepicker > div').hide().filter('.datepicker-' + dpGlobal.modes[picker.viewMode].clsName).show();
861
- },
862
-
863
- attachDatePickerEvents = function () {
864
- var $this, $parent, expanded, closed, collapseData;
865
- picker.widget.on('click', '.datepicker *', $.proxy(click, this)); // this handles date picker clicks
866
- picker.widget.on('click', '[data-action]', $.proxy(doAction, this)); // this handles time picker clicks
867
- picker.widget.on('mousedown', $.proxy(stopEvent, this));
868
- picker.element.on('keydown', $.proxy(keydown, this));
869
- if (picker.options.pickDate && picker.options.pickTime) {
870
- picker.widget.on('click.togglePicker', '.accordion-toggle', function (e) {
871
- e.stopPropagation();
872
- $this = $(this);
873
- $parent = $this.closest('ul');
874
- expanded = $parent.find('.in');
875
- closed = $parent.find('.collapse:not(.in)');
876
-
877
- if (expanded && expanded.length) {
878
- collapseData = expanded.data('collapse');
879
- if (collapseData && collapseData.transitioning) {
880
- return;
881
- }
882
- expanded.collapse('hide');
883
- closed.collapse('show');
884
- $this.find('span').toggleClass(picker.options.icons.time + ' ' + picker.options.icons.date);
885
- if (picker.component) {
886
- picker.component.find('span').toggleClass(picker.options.icons.time + ' ' + picker.options.icons.date);
887
- }
888
- }
889
- });
890
- }
891
- if (picker.isInput) {
892
- picker.element.on({
893
- 'click': $.proxy(picker.show, this),
894
- 'focus': $.proxy(picker.show, this),
895
- 'change': $.proxy(change, this),
896
- 'blur': $.proxy(picker.hide, this)
897
- });
898
- } else {
899
- picker.element.on({
900
- 'change': $.proxy(change, this)
901
- }, 'input');
902
- if (picker.component) {
903
- picker.component.on('click', $.proxy(picker.show, this));
904
- picker.component.on('mousedown', $.proxy(stopEvent, this));
905
- } else {
906
- picker.element.on('click', $.proxy(picker.show, this));
907
- }
908
- }
909
- },
910
-
911
- attachDatePickerGlobalEvents = function () {
912
- $(window).on(
913
- 'resize.datetimepicker' + picker.id, $.proxy(place, this));
914
- if (!picker.isInput) {
915
- $(document).on(
916
- 'mousedown.datetimepicker' + picker.id, $.proxy(picker.hide, this));
917
- }
918
- },
919
-
920
- detachDatePickerEvents = function () {
921
- picker.widget.off('click', '.datepicker *', picker.click);
922
- picker.widget.off('click', '[data-action]');
923
- picker.widget.off('mousedown', picker.stopEvent);
924
- if (picker.options.pickDate && picker.options.pickTime) {
925
- picker.widget.off('click.togglePicker');
926
- }
927
- if (picker.isInput) {
928
- picker.element.off({
929
- 'focus': picker.show,
930
- 'change': picker.change,
931
- 'click': picker.show,
932
- 'blur' : picker.hide
933
- });
934
- } else {
935
- picker.element.off({
936
- 'change': picker.change
937
- }, 'input');
938
- if (picker.component) {
939
- picker.component.off('click', picker.show);
940
- picker.component.off('mousedown', picker.stopEvent);
941
- } else {
942
- picker.element.off('click', picker.show);
943
- }
944
- }
945
- },
946
-
947
- detachDatePickerGlobalEvents = function () {
948
- $(window).off('resize.datetimepicker' + picker.id);
949
- if (!picker.isInput) {
950
- $(document).off('mousedown.datetimepicker' + picker.id);
951
- }
952
- },
953
-
954
- isInFixed = function () {
955
- if (picker.element) {
956
- var parents = picker.element.parents(), inFixed = false, i;
957
- for (i = 0; i < parents.length; i++) {
958
- if ($(parents[i]).css('position') === 'fixed') {
959
- inFixed = true;
960
- break;
961
- }
962
- }
963
- return inFixed;
964
- } else {
965
- return false;
966
- }
967
- },
968
-
969
- set = function () {
970
- moment.locale(picker.options.language);
971
- var formatted = '';
972
- if (!picker.unset) {
973
- formatted = moment(picker.date).format(picker.format);
974
- }
975
- getPickerInput().val(formatted);
976
- picker.element.data('date', formatted);
977
- if (!picker.options.pickTime) {
978
- picker.hide();
979
- }
980
- },
981
-
982
- checkDate = function (direction, unit, amount) {
983
- moment.locale(picker.options.language);
984
- var newDate;
985
- if (direction === 'add') {
986
- newDate = moment(picker.date);
987
- if (newDate.hours() === 23) {
988
- newDate.add(amount, unit);
989
- }
990
- newDate.add(amount, unit);
991
- }
992
- else {
993
- newDate = moment(picker.date).subtract(amount, unit);
994
- }
995
- if (isInDisableDates(moment(newDate.subtract(amount, unit))) || isInDisableDates(newDate)) {
996
- notifyError(newDate.format(picker.format));
997
- return;
998
- }
999
-
1000
- if (direction === 'add') {
1001
- picker.date.add(amount, unit);
1002
- }
1003
- else {
1004
- picker.date.subtract(amount, unit);
1005
- }
1006
- picker.unset = false;
1007
- },
1008
-
1009
- isInDisableDates = function (date, timeUnit) {
1010
- moment.locale(picker.options.language);
1011
- var maxDate = moment(picker.options.maxDate, picker.format, picker.options.useStrict),
1012
- minDate = moment(picker.options.minDate, picker.format, picker.options.useStrict);
1013
-
1014
- if (timeUnit) {
1015
- maxDate = maxDate.endOf(timeUnit);
1016
- minDate = minDate.startOf(timeUnit);
1017
- }
1018
-
1019
- if (date.isAfter(maxDate) || date.isBefore(minDate)) {
1020
- return true;
1021
- }
1022
- if (picker.options.disabledDates === false) {
1023
- return false;
1024
- }
1025
- return picker.options.disabledDates[date.format('YYYY-MM-DD')] === true;
1026
- },
1027
- isInEnableDates = function (date) {
1028
- moment.locale(picker.options.language);
1029
- if (picker.options.enabledDates === false) {
1030
- return true;
1031
- }
1032
- return picker.options.enabledDates[date.format('YYYY-MM-DD')] === true;
1033
- },
1034
-
1035
- indexGivenDates = function (givenDatesArray) {
1036
- // Store given enabledDates and disabledDates as keys.
1037
- // This way we can check their existence in O(1) time instead of looping through whole array.
1038
- // (for example: picker.options.enabledDates['2014-02-27'] === true)
1039
- var givenDatesIndexed = {}, givenDatesCount = 0, i;
1040
- for (i = 0; i < givenDatesArray.length; i++) {
1041
- if (moment.isMoment(givenDatesArray[i]) || givenDatesArray[i] instanceof Date) {
1042
- dDate = moment(givenDatesArray[i]);
1043
- } else {
1044
- dDate = moment(givenDatesArray[i], picker.format, picker.options.useStrict);
1045
- }
1046
- if (dDate.isValid()) {
1047
- givenDatesIndexed[dDate.format('YYYY-MM-DD')] = true;
1048
- givenDatesCount++;
1049
- }
1050
- }
1051
- if (givenDatesCount > 0) {
1052
- return givenDatesIndexed;
1053
- }
1054
- return false;
1055
- },
1056
-
1057
- padLeft = function (string) {
1058
- string = string.toString();
1059
- if (string.length >= 2) {
1060
- return string;
1061
- }
1062
- return '0' + string;
1063
- },
1064
-
1065
- getTemplate = function () {
1066
- var
1067
- headTemplate =
1068
- '<thead>' +
1069
- '<tr>' +
1070
- '<th class="prev">&lsaquo;</th><th colspan="' + (picker.options.calendarWeeks ? '6' : '5') + '" class="picker-switch"></th><th class="next">&rsaquo;</th>' +
1071
- '</tr>' +
1072
- '</thead>',
1073
- contTemplate =
1074
- '<tbody><tr><td colspan="' + (picker.options.calendarWeeks ? '8' : '7') + '"></td></tr></tbody>',
1075
- template = '<div class="datepicker-days">' +
1076
- '<table class="table-condensed">' + headTemplate + '<tbody></tbody></table>' +
1077
- '</div>' +
1078
- '<div class="datepicker-months">' +
1079
- '<table class="table-condensed">' + headTemplate + contTemplate + '</table>' +
1080
- '</div>' +
1081
- '<div class="datepicker-years">' +
1082
- '<table class="table-condensed">' + headTemplate + contTemplate + '</table>' +
1083
- '</div>',
1084
- ret = '';
1085
- if (picker.options.pickDate && picker.options.pickTime) {
1086
- ret = '<div class="bootstrap-datetimepicker-widget' + (picker.options.sideBySide ? ' timepicker-sbs' : '') + (picker.use24hours ? ' usetwentyfour' : '') + ' dropdown-menu" style="z-index:9999 !important;">';
1087
- if (picker.options.sideBySide) {
1088
- ret += '<div class="row">' +
1089
- '<div class="col-sm-6 datepicker">' + template + '</div>' +
1090
- '<div class="col-sm-6 timepicker">' + tpGlobal.getTemplate() + '</div>' +
1091
- '</div>';
1092
- } else {
1093
- ret += '<ul class="list-unstyled">' +
1094
- '<li' + (picker.options.collapse ? ' class="collapse in"' : '') + '>' +
1095
- '<div class="datepicker">' + template + '</div>' +
1096
- '</li>' +
1097
- '<li class="picker-switch accordion-toggle"><a class="btn" style="width:100%"><span class="' + picker.options.icons.time + '"></span></a></li>' +
1098
- '<li' + (picker.options.collapse ? ' class="collapse"' : '') + '>' +
1099
- '<div class="timepicker">' + tpGlobal.getTemplate() + '</div>' +
1100
- '</li>' +
1101
- '</ul>';
1102
- }
1103
- ret += '</div>';
1104
- return ret;
1105
- }
1106
- if (picker.options.pickTime) {
1107
- return (
1108
- '<div class="bootstrap-datetimepicker-widget dropdown-menu">' +
1109
- '<div class="timepicker">' + tpGlobal.getTemplate() + '</div>' +
1110
- '</div>'
1111
- );
1112
- }
1113
- return (
1114
- '<div class="bootstrap-datetimepicker-widget dropdown-menu">' +
1115
- '<div class="datepicker">' + template + '</div>' +
1116
- '</div>'
1117
- );
1118
- },
1119
-
1120
- dpGlobal = {
1121
- modes: [
1122
- {
1123
- clsName: 'days',
1124
- navFnc: 'month',
1125
- navStep: 1
1126
- },
1127
- {
1128
- clsName: 'months',
1129
- navFnc: 'year',
1130
- navStep: 1
1131
- },
1132
- {
1133
- clsName: 'years',
1134
- navFnc: 'year',
1135
- navStep: 10
1136
- }
1137
- ]
1138
- },
1139
-
1140
- tpGlobal = {
1141
- hourTemplate: '<span data-action="showHours" data-time-component="hours" class="timepicker-hour"></span>',
1142
- minuteTemplate: '<span data-action="showMinutes" data-time-component="minutes" class="timepicker-minute"></span>',
1143
- secondTemplate: '<span data-action="showSeconds" data-time-component="seconds" class="timepicker-second"></span>'
1144
- };
1145
-
1146
- tpGlobal.getTemplate = function () {
1147
- return (
1148
- '<div class="timepicker-picker">' +
1149
- '<table class="table-condensed">' +
1150
- '<tr>' +
1151
- '<td><a href="#" class="btn" data-action="incrementHours"><span class="' + picker.options.icons.up + '"></span></a></td>' +
1152
- '<td class="separator"></td>' +
1153
- '<td>' + (picker.options.useMinutes ? '<a href="#" class="btn" data-action="incrementMinutes"><span class="' + picker.options.icons.up + '"></span></a>' : '') + '</td>' +
1154
- (picker.options.useSeconds ?
1155
- '<td class="separator"></td><td><a href="#" class="btn" data-action="incrementSeconds"><span class="' + picker.options.icons.up + '"></span></a></td>' : '') +
1156
- (picker.use24hours ? '' : '<td class="separator"></td>') +
1157
- '</tr>' +
1158
- '<tr>' +
1159
- '<td>' + tpGlobal.hourTemplate + '</td> ' +
1160
- '<td class="separator">:</td>' +
1161
- '<td>' + (picker.options.useMinutes ? tpGlobal.minuteTemplate : '<span class="timepicker-minute">00</span>') + '</td> ' +
1162
- (picker.options.useSeconds ?
1163
- '<td class="separator">:</td><td>' + tpGlobal.secondTemplate + '</td>' : '') +
1164
- (picker.use24hours ? '' : '<td class="separator"></td>' +
1165
- '<td><button type="button" class="btn btn-primary" data-action="togglePeriod"></button></td>') +
1166
- '</tr>' +
1167
- '<tr>' +
1168
- '<td><a href="#" class="btn" data-action="decrementHours"><span class="' + picker.options.icons.down + '"></span></a></td>' +
1169
- '<td class="separator"></td>' +
1170
- '<td>' + (picker.options.useMinutes ? '<a href="#" class="btn" data-action="decrementMinutes"><span class="' + picker.options.icons.down + '"></span></a>' : '') + '</td>' +
1171
- (picker.options.useSeconds ?
1172
- '<td class="separator"></td><td><a href="#" class="btn" data-action="decrementSeconds"><span class="' + picker.options.icons.down + '"></span></a></td>' : '') +
1173
- (picker.use24hours ? '' : '<td class="separator"></td>') +
1174
- '</tr>' +
1175
- '</table>' +
1176
- '</div>' +
1177
- '<div class="timepicker-hours" data-action="selectHour">' +
1178
- '<table class="table-condensed"></table>' +
1179
- '</div>' +
1180
- '<div class="timepicker-minutes" data-action="selectMinute">' +
1181
- '<table class="table-condensed"></table>' +
1182
- '</div>' +
1183
- (picker.options.useSeconds ?
1184
- '<div class="timepicker-seconds" data-action="selectSecond"><table class="table-condensed"></table></div>' : '')
1185
- );
1186
- };
1187
-
1188
- picker.destroy = function () {
1189
- detachDatePickerEvents();
1190
- detachDatePickerGlobalEvents();
1191
- picker.widget.remove();
1192
- picker.element.removeData('DateTimePicker');
1193
- if (picker.component) {
1194
- picker.component.removeData('DateTimePicker');
1195
- }
1196
- };
1197
-
1198
- picker.show = function (e) {
1199
- if (picker.options.useCurrent) {
1200
- if (getPickerInput().val() === '') {
1201
- if (picker.options.minuteStepping !== 1) {
1202
- var mDate = moment(),
1203
- rInterval = picker.options.minuteStepping;
1204
- mDate.minutes((Math.round(mDate.minutes() / rInterval) * rInterval) % 60).seconds(0);
1205
- picker.setValue(mDate.format(picker.format));
1206
- } else {
1207
- picker.setValue(moment().format(picker.format));
1208
- }
1209
- notifyChange('', e.type);
1210
- }
1211
- }
1212
- // if this is a click event on the input field and picker is already open don't hide it
1213
- if (e && e.type === 'click' && picker.isInput && picker.widget.hasClass('picker-open')) {
1214
- return;
1215
- }
1216
- if (picker.widget.hasClass('picker-open')) {
1217
- picker.widget.hide();
1218
- picker.widget.removeClass('picker-open');
1219
- }
1220
- else {
1221
- picker.widget.show();
1222
- picker.widget.addClass('picker-open');
1223
- }
1224
- picker.height = picker.component ? picker.component.outerHeight() : picker.element.outerHeight();
1225
- place();
1226
- picker.element.trigger({
1227
- type: 'dp.show',
1228
- date: moment(picker.date)
1229
- });
1230
- attachDatePickerGlobalEvents();
1231
- if (e) {
1232
- stopEvent(e);
1233
- }
1234
- };
1235
-
1236
- picker.disable = function () {
1237
- var input = picker.element.find('input');
1238
- if (input.prop('disabled')) {
1239
- return;
1240
- }
1241
- input.prop('disabled', true);
1242
- detachDatePickerEvents();
1243
- };
1244
-
1245
- picker.enable = function () {
1246
- var input = picker.element.find('input');
1247
- if (!input.prop('disabled')) {
1248
- return;
1249
- }
1250
- input.prop('disabled', false);
1251
- attachDatePickerEvents();
1252
- };
1253
-
1254
- picker.hide = function () {
1255
- // Ignore event if in the middle of a picker transition
1256
- var collapse = picker.widget.find('.collapse'), i, collapseData;
1257
- for (i = 0; i < collapse.length; i++) {
1258
- collapseData = collapse.eq(i).data('collapse');
1259
- if (collapseData && collapseData.transitioning) {
1260
- return;
1261
- }
1262
- }
1263
- picker.widget.hide();
1264
- picker.widget.removeClass('picker-open');
1265
- picker.viewMode = picker.startViewMode;
1266
- showMode();
1267
- picker.element.trigger({
1268
- type: 'dp.hide',
1269
- date: moment(picker.date)
1270
- });
1271
- detachDatePickerGlobalEvents();
1272
- };
1273
-
1274
- picker.setValue = function (newDate) {
1275
- moment.locale(picker.options.language);
1276
- if (!newDate) {
1277
- picker.unset = true;
1278
- set();
1279
- } else {
1280
- picker.unset = false;
1281
- }
1282
- if (!moment.isMoment(newDate)) {
1283
- newDate = (newDate instanceof Date) ? moment(newDate) : moment(newDate, picker.format, picker.options.useStrict);
1284
- } else {
1285
- newDate = newDate.locale(picker.options.language);
1286
- }
1287
- if (newDate.isValid()) {
1288
- picker.date = newDate;
1289
- set();
1290
- picker.viewDate = moment({y: picker.date.year(), M: picker.date.month()});
1291
- fillDate();
1292
- fillTime();
1293
- }
1294
- else {
1295
- notifyError(newDate);
1296
- }
1297
- };
1298
-
1299
- picker.getDate = function () {
1300
- if (picker.unset) {
1301
- return null;
1302
- }
1303
- return moment(picker.date);
1304
- };
1305
-
1306
- picker.setDate = function (date) {
1307
- var oldDate = moment(picker.date);
1308
- if (!date) {
1309
- picker.setValue(null);
1310
- } else {
1311
- picker.setValue(date);
1312
- }
1313
- notifyChange(oldDate, 'function');
1314
- };
1315
-
1316
- picker.setDisabledDates = function (dates) {
1317
- picker.options.disabledDates = indexGivenDates(dates);
1318
- if (picker.viewDate) {
1319
- update();
1320
- }
1321
- };
1322
-
1323
- picker.setEnabledDates = function (dates) {
1324
- picker.options.enabledDates = indexGivenDates(dates);
1325
- if (picker.viewDate) {
1326
- update();
1327
- }
1328
- };
1329
-
1330
- picker.setMaxDate = function (date) {
1331
- if (date === undefined) {
1332
- return;
1333
- }
1334
- if (moment.isMoment(date) || date instanceof Date) {
1335
- picker.options.maxDate = moment(date);
1336
- } else {
1337
- picker.options.maxDate = moment(date, picker.format, picker.options.useStrict);
1338
- }
1339
- if (picker.viewDate) {
1340
- update();
1341
- }
1342
- };
1343
-
1344
- picker.setMinDate = function (date) {
1345
- if (date === undefined) {
1346
- return;
1347
- }
1348
- if (moment.isMoment(date) || date instanceof Date) {
1349
- picker.options.minDate = moment(date);
1350
- } else {
1351
- picker.options.minDate = moment(date, picker.format, picker.options.useStrict);
1352
- }
1353
- if (picker.viewDate) {
1354
- update();
1355
- }
1356
- };
1357
-
1358
- init();
1359
- };
1360
-
1361
- $.fn.datetimepicker = function (options) {
1362
- return this.each(function () {
1363
- var $this = $(this),
1364
- data = $this.data('DateTimePicker');
1365
- if (!data) {
1366
- $this.data('DateTimePicker', new DateTimePicker(this, options));
1367
- }
1368
- });
1369
- };
1370
-
1371
- $.fn.datetimepicker.defaults = {
1372
- format: false,
1373
- pickDate: true,
1374
- pickTime: true,
1375
- useMinutes: true,
1376
- useSeconds: false,
1377
- useCurrent: true,
1378
- calendarWeeks: false,
1379
- minuteStepping: 1,
1380
- minDate: moment({y: 1900}),
1381
- maxDate: moment().add(100, 'y'),
1382
- showToday: true,
1383
- collapse: true,
1384
- language: moment.locale(),
1385
- defaultDate: '',
1386
- disabledDates: false,
1387
- enabledDates: false,
1388
- icons: {},
1389
- useStrict: false,
1390
- direction: 'auto',
1391
- sideBySide: false,
1392
- daysOfWeekDisabled: [],
1393
- widgetParent: false
1394
- };
1395
- }));