adminlte_rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (324) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/.travis.yml +5 -0
  4. data/CODE_OF_CONDUCT.md +74 -0
  5. data/Gemfile +6 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +51 -0
  8. data/Rakefile +10 -0
  9. data/adminlte_rails.gemspec +27 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/lib/adminlte_rails.rb +5 -0
  13. data/lib/adminlte_rails/engine.rb +7 -0
  14. data/lib/adminlte_rails/version.rb +3 -0
  15. data/vendor/assets/javascripts/adminlte.js +3 -0
  16. data/vendor/assets/javascripts/adminlte.min.js +3 -0
  17. data/vendor/assets/javascripts/adminlte/adminlte.js +1129 -0
  18. data/vendor/assets/javascripts/adminlte/adminlte.min.js +14 -0
  19. data/vendor/assets/javascripts/adminlte/plugins/bootstrap-colorpicker/bootstrap-colorpicker.js +1319 -0
  20. data/vendor/assets/javascripts/adminlte/plugins/bootstrap-colorpicker/bootstrap-colorpicker.min.js +5 -0
  21. data/vendor/assets/javascripts/adminlte/plugins/bootstrap-datepicker/bootstrap-datepicker.js +2030 -0
  22. data/vendor/assets/javascripts/adminlte/plugins/bootstrap-datepicker/bootstrap-datepicker.min.js +8 -0
  23. data/vendor/assets/javascripts/adminlte/plugins/bootstrap-daterangepicker/bootstrap-daterangepicker.js +1653 -0
  24. data/vendor/assets/javascripts/adminlte/plugins/bootstrap-slider/bootstrap-slider.js +427 -0
  25. data/vendor/assets/javascripts/adminlte/plugins/bootstrap-timepicker/bootstrap-timepicker.js +1177 -0
  26. data/vendor/assets/javascripts/adminlte/plugins/bootstrap/bootstrap.js +2377 -0
  27. data/vendor/assets/javascripts/adminlte/plugins/bootstrap/bootstrap.min.js +7 -0
  28. data/vendor/assets/javascripts/adminlte/plugins/jquery/jquery.js +10364 -0
  29. data/vendor/assets/javascripts/adminlte/plugins/jquery/jquery.min.js +2 -0
  30. data/vendor/assets/javascripts/adminlte/plugins/select2/.bower.json +24 -0
  31. data/vendor/assets/javascripts/adminlte/plugins/select2/.editorconfig +6 -0
  32. data/vendor/assets/javascripts/adminlte/plugins/select2/.github/CONTRIBUTING.md +203 -0
  33. data/vendor/assets/javascripts/adminlte/plugins/select2/.github/ISSUE_TEMPLATE.md +20 -0
  34. data/vendor/assets/javascripts/adminlte/plugins/select2/.github/PULL_REQUEST_TEMPLATE.md +13 -0
  35. data/vendor/assets/javascripts/adminlte/plugins/select2/.gitignore +3 -0
  36. data/vendor/assets/javascripts/adminlte/plugins/select2/.jshintignore +4 -0
  37. data/vendor/assets/javascripts/adminlte/plugins/select2/.jshintrc +25 -0
  38. data/vendor/assets/javascripts/adminlte/plugins/select2/.travis.yml +22 -0
  39. data/vendor/assets/javascripts/adminlte/plugins/select2/CHANGELOG.md +272 -0
  40. data/vendor/assets/javascripts/adminlte/plugins/select2/Gruntfile.js +380 -0
  41. data/vendor/assets/javascripts/adminlte/plugins/select2/LICENSE.md +21 -0
  42. data/vendor/assets/javascripts/adminlte/plugins/select2/README.md +123 -0
  43. data/vendor/assets/javascripts/adminlte/plugins/select2/bower.json +13 -0
  44. data/vendor/assets/javascripts/adminlte/plugins/select2/component.json +19 -0
  45. data/vendor/assets/javascripts/adminlte/plugins/select2/composer.json +25 -0
  46. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/css/select2.css +484 -0
  47. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/css/select2.min.css +1 -0
  48. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/af.js +3 -0
  49. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/ar.js +3 -0
  50. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/az.js +3 -0
  51. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/bg.js +3 -0
  52. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/bs.js +3 -0
  53. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/ca.js +3 -0
  54. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/cs.js +3 -0
  55. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/da.js +3 -0
  56. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/de.js +3 -0
  57. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/dsb.js +3 -0
  58. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/el.js +3 -0
  59. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/en.js +3 -0
  60. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/es.js +3 -0
  61. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/et.js +3 -0
  62. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/eu.js +3 -0
  63. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/fa.js +3 -0
  64. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/fi.js +3 -0
  65. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/fr.js +3 -0
  66. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/gl.js +3 -0
  67. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/he.js +3 -0
  68. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/hi.js +3 -0
  69. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/hr.js +3 -0
  70. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/hsb.js +3 -0
  71. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/hu.js +3 -0
  72. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/hy.js +3 -0
  73. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/id.js +3 -0
  74. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/is.js +3 -0
  75. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/it.js +3 -0
  76. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/ja.js +3 -0
  77. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/km.js +3 -0
  78. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/ko.js +3 -0
  79. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/lt.js +3 -0
  80. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/lv.js +3 -0
  81. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/mk.js +3 -0
  82. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/ms.js +3 -0
  83. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/nb.js +3 -0
  84. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/nl.js +3 -0
  85. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/pl.js +3 -0
  86. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/ps.js +3 -0
  87. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/pt-BR.js +3 -0
  88. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/pt.js +3 -0
  89. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/ro.js +3 -0
  90. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/ru.js +3 -0
  91. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/sk.js +3 -0
  92. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/sl.js +3 -0
  93. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/sr-Cyrl.js +3 -0
  94. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/sr.js +3 -0
  95. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/sv.js +3 -0
  96. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/th.js +3 -0
  97. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/tr.js +3 -0
  98. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/uk.js +3 -0
  99. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/vi.js +3 -0
  100. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/zh-CN.js +3 -0
  101. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/i18n/zh-TW.js +3 -0
  102. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/select2.full.js +6457 -0
  103. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/select2.full.min.js +1 -0
  104. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/select2.js +5746 -0
  105. data/vendor/assets/javascripts/adminlte/plugins/select2/dist/js/select2.min.js +1 -0
  106. data/vendor/assets/javascripts/adminlte/plugins/select2/docs/README.md +1 -0
  107. data/vendor/assets/javascripts/adminlte/plugins/select2/docs/announcements-4.0.html +12 -0
  108. data/vendor/assets/javascripts/adminlte/plugins/select2/docs/community.html +12 -0
  109. data/vendor/assets/javascripts/adminlte/plugins/select2/docs/examples.html +12 -0
  110. data/vendor/assets/javascripts/adminlte/plugins/select2/docs/index.html +12 -0
  111. data/vendor/assets/javascripts/adminlte/plugins/select2/docs/options-old.html +12 -0
  112. data/vendor/assets/javascripts/adminlte/plugins/select2/docs/options.html +12 -0
  113. data/vendor/assets/javascripts/adminlte/plugins/select2/package.json +73 -0
  114. data/vendor/assets/javascripts/adminlte/plugins/select2/select2.jquery.json +32 -0
  115. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/banner.end.js +6 -0
  116. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/banner.start.js +6 -0
  117. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/jquery.mousewheel.shim.js +6 -0
  118. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/jquery.select2.js +57 -0
  119. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/jquery.shim.js +14 -0
  120. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/compat/containerCss.js +56 -0
  121. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/compat/dropdownCss.js +56 -0
  122. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/compat/initSelection.js +42 -0
  123. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/compat/inputData.js +127 -0
  124. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/compat/matcher.js +42 -0
  125. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/compat/query.js +26 -0
  126. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/compat/utils.js +43 -0
  127. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/core.js +612 -0
  128. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/data/ajax.js +109 -0
  129. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/data/array.js +79 -0
  130. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/data/base.js +40 -0
  131. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/data/maximumInputLength.js +31 -0
  132. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/data/maximumSelectionLength.js +31 -0
  133. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/data/minimumInputLength.js +30 -0
  134. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/data/select.js +285 -0
  135. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/data/tags.js +128 -0
  136. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/data/tokenizer.js +116 -0
  137. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/defaults.js +396 -0
  138. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/diacritics.js +847 -0
  139. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/dropdown.js +42 -0
  140. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/dropdown/attachBody.js +222 -0
  141. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/dropdown/attachContainer.js +18 -0
  142. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/dropdown/closeOnSelect.js +35 -0
  143. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/dropdown/hidePlaceholder.js +42 -0
  144. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/dropdown/infiniteScroll.js +89 -0
  145. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/dropdown/minimumResultsForSearch.js +39 -0
  146. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/dropdown/search.js +101 -0
  147. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/dropdown/selectOnClose.js +50 -0
  148. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/dropdown/stopPropagation.js +38 -0
  149. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/af.js +44 -0
  150. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/ar.js +30 -0
  151. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/az.js +27 -0
  152. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/bg.js +47 -0
  153. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/bs.js +55 -0
  154. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/ca.js +52 -0
  155. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/cs.js +61 -0
  156. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/da.js +36 -0
  157. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/de.js +40 -0
  158. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/dsb.js +48 -0
  159. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/el.js +52 -0
  160. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/en.js +44 -0
  161. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/es.js +52 -0
  162. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/et.js +53 -0
  163. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/eu.js +51 -0
  164. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/fa.js +38 -0
  165. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/fi.js +30 -0
  166. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/fr.js +33 -0
  167. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/gl.js +39 -0
  168. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/he.js +56 -0
  169. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/hi.js +39 -0
  170. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/hr.js +44 -0
  171. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/hsb.js +48 -0
  172. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/hu.js +30 -0
  173. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/hy.js +38 -0
  174. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/id.js +30 -0
  175. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/is.js +41 -0
  176. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/it.js +48 -0
  177. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/ja.js +36 -0
  178. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/km.js +36 -0
  179. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/ko.js +36 -0
  180. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/lt.js +52 -0
  181. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/lv.js +51 -0
  182. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/mk.js +47 -0
  183. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/ms.js +30 -0
  184. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/nb.js +32 -0
  185. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/nl.js +43 -0
  186. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/pl.js +45 -0
  187. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/ps.js +45 -0
  188. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/pt-BR.js +46 -0
  189. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/pt.js +40 -0
  190. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/ro.js +46 -0
  191. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/ru.js +58 -0
  192. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/sk.js +59 -0
  193. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/sl.js +54 -0
  194. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/sr-Cyrl.js +55 -0
  195. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/sr.js +55 -0
  196. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/sv.js +37 -0
  197. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/th.js +36 -0
  198. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/tr.js +36 -0
  199. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/uk.js +43 -0
  200. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/vi.js +37 -0
  201. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/zh-CN.js +36 -0
  202. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/i18n/zh-TW.js +33 -0
  203. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/keys.js +25 -0
  204. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/options.js +122 -0
  205. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/results.js +523 -0
  206. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/selection/allowClear.js +97 -0
  207. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/selection/base.js +158 -0
  208. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/selection/clickMask.js +29 -0
  209. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/selection/eventRelay.js +45 -0
  210. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/selection/multiple.js +109 -0
  211. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/selection/placeholder.js +49 -0
  212. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/selection/search.js +222 -0
  213. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/selection/single.js +99 -0
  214. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/selection/stopPropagation.js +38 -0
  215. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/translation.js +36 -0
  216. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/select2/utils.js +276 -0
  217. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/wrapper.end.js +12 -0
  218. data/vendor/assets/javascripts/adminlte/plugins/select2/src/js/wrapper.start.js +38 -0
  219. data/vendor/assets/javascripts/adminlte/plugins/select2/src/scss/_dropdown.scss +73 -0
  220. data/vendor/assets/javascripts/adminlte/plugins/select2/src/scss/_multiple.scss +35 -0
  221. data/vendor/assets/javascripts/adminlte/plugins/select2/src/scss/_single.scss +34 -0
  222. data/vendor/assets/javascripts/adminlte/plugins/select2/src/scss/core.scss +48 -0
  223. data/vendor/assets/javascripts/adminlte/plugins/select2/src/scss/mixins/_gradients.scss +13 -0
  224. data/vendor/assets/javascripts/adminlte/plugins/select2/src/scss/theme/classic/_defaults.scss +34 -0
  225. data/vendor/assets/javascripts/adminlte/plugins/select2/src/scss/theme/classic/_multiple.scss +93 -0
  226. data/vendor/assets/javascripts/adminlte/plugins/select2/src/scss/theme/classic/_single.scss +124 -0
  227. data/vendor/assets/javascripts/adminlte/plugins/select2/src/scss/theme/classic/layout.scss +64 -0
  228. data/vendor/assets/javascripts/adminlte/plugins/select2/src/scss/theme/default/_multiple.scss +98 -0
  229. data/vendor/assets/javascripts/adminlte/plugins/select2/src/scss/theme/default/_single.scss +83 -0
  230. data/vendor/assets/javascripts/adminlte/plugins/select2/src/scss/theme/default/layout.scss +97 -0
  231. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/a11y/search-tests.js +51 -0
  232. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/a11y/selection-tests.js +154 -0
  233. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/data/array-tests.js +318 -0
  234. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/data/base-tests.js +29 -0
  235. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/data/inputData-tests.js +158 -0
  236. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/data/maximumInputLength-tests.js +138 -0
  237. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/data/maximumSelectionLength-tests.js +202 -0
  238. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/data/minimumInputLength-tests.js +138 -0
  239. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/data/select-tests.js +489 -0
  240. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/data/tags-tests.js +276 -0
  241. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/data/tokenizer-tests.js +219 -0
  242. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/dropdown/dropdownCss-tests.js +104 -0
  243. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/dropdown/positioning-tests.js +177 -0
  244. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/dropdown/selectOnClose-tests.js +137 -0
  245. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/dropdown/stopPropagation-tests.js +33 -0
  246. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/helpers.js +46 -0
  247. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/integration.html +21 -0
  248. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/integration/dom-changes.js +257 -0
  249. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/integration/jquery-calls.js +30 -0
  250. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/integration/select2-methods.js +139 -0
  251. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/options/ajax-tests.js +32 -0
  252. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/options/data-tests.js +44 -0
  253. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/options/deprecated-tests.js +250 -0
  254. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/options/translation-tests.js +28 -0
  255. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/options/width-tests.js +66 -0
  256. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/results/focusing-tests.js +138 -0
  257. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/selection/allowClear-tests.js +218 -0
  258. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/selection/containerCss-tests.js +104 -0
  259. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/selection/multiple-tests.js +149 -0
  260. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/selection/placeholder-tests.js +74 -0
  261. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/selection/search-tests.js +191 -0
  262. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/selection/single-tests.js +117 -0
  263. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/selection/stopPropagation-tests.js +33 -0
  264. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/unit.html +95 -0
  265. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/utils/decorator-tests.js +189 -0
  266. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/utils/escapeMarkup-tests.js +36 -0
  267. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/vendor/jquery-1.7.2.js +9404 -0
  268. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/vendor/qunit-1.23.1.css +305 -0
  269. data/vendor/assets/javascripts/adminlte/plugins/select2/tests/vendor/qunit-1.23.1.js +4334 -0
  270. data/vendor/assets/javascripts/adminlte/plugins/select2/vendor/jquery-2.1.0.js +9111 -0
  271. data/vendor/assets/stylesheets/adminlte.min.scss +27 -0
  272. data/vendor/assets/stylesheets/adminlte.scss +6 -0
  273. data/vendor/assets/stylesheets/adminlte/adminlte.css +4977 -0
  274. data/vendor/assets/stylesheets/adminlte/adminlte.min.css +7 -0
  275. data/vendor/assets/stylesheets/adminlte/fonts/FontAwesome.otf +0 -0
  276. data/vendor/assets/stylesheets/adminlte/fonts/fontawesome-webfont.eot +0 -0
  277. data/vendor/assets/stylesheets/adminlte/fonts/fontawesome-webfont.svg +2671 -0
  278. data/vendor/assets/stylesheets/adminlte/fonts/fontawesome-webfont.ttf +0 -0
  279. data/vendor/assets/stylesheets/adminlte/fonts/fontawesome-webfont.woff +0 -0
  280. data/vendor/assets/stylesheets/adminlte/fonts/fontawesome-webfont.woff2 +0 -0
  281. data/vendor/assets/stylesheets/adminlte/fonts/glyphicons-halflings-regular.eot +0 -0
  282. data/vendor/assets/stylesheets/adminlte/fonts/glyphicons-halflings-regular.svg +288 -0
  283. data/vendor/assets/stylesheets/adminlte/fonts/glyphicons-halflings-regular.ttf +0 -0
  284. data/vendor/assets/stylesheets/adminlte/fonts/glyphicons-halflings-regular.woff +0 -0
  285. data/vendor/assets/stylesheets/adminlte/fonts/glyphicons-halflings-regular.woff2 +0 -0
  286. data/vendor/assets/stylesheets/adminlte/plugins/bootstrap-colorpicker/bootstrap-colorpicker.css +230 -0
  287. data/vendor/assets/stylesheets/adminlte/plugins/bootstrap-datepicker/bootstrap-datepicker.css +477 -0
  288. data/vendor/assets/stylesheets/adminlte/plugins/bootstrap-datepicker/bootstrap-datepicker.standalone.css +510 -0
  289. data/vendor/assets/stylesheets/adminlte/plugins/bootstrap-datepicker/bootstrap-datepicker3.css +684 -0
  290. data/vendor/assets/stylesheets/adminlte/plugins/bootstrap-datepicker/bootstrap-datepicker3.standalone.css +713 -0
  291. data/vendor/assets/stylesheets/adminlte/plugins/bootstrap-daterangepicker/bootstrap-daterangepicker.css +269 -0
  292. data/vendor/assets/stylesheets/adminlte/plugins/bootstrap-slider/bootstrap-slider.css +178 -0
  293. data/vendor/assets/stylesheets/adminlte/plugins/bootstrap-timepicker/bootstrap-timepicker.less +172 -0
  294. data/vendor/assets/stylesheets/adminlte/plugins/bootstrap/bootstrap.css.map +1 -0
  295. data/vendor/assets/stylesheets/adminlte/plugins/bootstrap/bootstrap.scss +6757 -0
  296. data/vendor/assets/stylesheets/adminlte/plugins/font-awesome/font-awesome.scss +2341 -0
  297. data/vendor/assets/stylesheets/adminlte/plugins/select2/select2.css +484 -0
  298. data/vendor/assets/stylesheets/adminlte/skins/_all-skins.css +1781 -0
  299. data/vendor/assets/stylesheets/adminlte/skins/_all-skins.min.css +1 -0
  300. data/vendor/assets/stylesheets/adminlte/skins/skin-black-light.css +171 -0
  301. data/vendor/assets/stylesheets/adminlte/skins/skin-black-light.min.css +1 -0
  302. data/vendor/assets/stylesheets/adminlte/skins/skin-black.css +161 -0
  303. data/vendor/assets/stylesheets/adminlte/skins/skin-black.min.css +1 -0
  304. data/vendor/assets/stylesheets/adminlte/skins/skin-blue-light.css +163 -0
  305. data/vendor/assets/stylesheets/adminlte/skins/skin-blue-light.min.css +1 -0
  306. data/vendor/assets/stylesheets/adminlte/skins/skin-blue.css +142 -0
  307. data/vendor/assets/stylesheets/adminlte/skins/skin-blue.min.css +1 -0
  308. data/vendor/assets/stylesheets/adminlte/skins/skin-green-light.css +152 -0
  309. data/vendor/assets/stylesheets/adminlte/skins/skin-green-light.min.css +1 -0
  310. data/vendor/assets/stylesheets/adminlte/skins/skin-green.css +134 -0
  311. data/vendor/assets/stylesheets/adminlte/skins/skin-green.min.css +1 -0
  312. data/vendor/assets/stylesheets/adminlte/skins/skin-purple-light.css +152 -0
  313. data/vendor/assets/stylesheets/adminlte/skins/skin-purple-light.min.css +1 -0
  314. data/vendor/assets/stylesheets/adminlte/skins/skin-purple.css +134 -0
  315. data/vendor/assets/stylesheets/adminlte/skins/skin-purple.min.css +1 -0
  316. data/vendor/assets/stylesheets/adminlte/skins/skin-red-light.css +152 -0
  317. data/vendor/assets/stylesheets/adminlte/skins/skin-red-light.min.css +1 -0
  318. data/vendor/assets/stylesheets/adminlte/skins/skin-red.css +134 -0
  319. data/vendor/assets/stylesheets/adminlte/skins/skin-red.min.css +1 -0
  320. data/vendor/assets/stylesheets/adminlte/skins/skin-yellow-light.css +152 -0
  321. data/vendor/assets/stylesheets/adminlte/skins/skin-yellow-light.min.css +1 -0
  322. data/vendor/assets/stylesheets/adminlte/skins/skin-yellow.css +134 -0
  323. data/vendor/assets/stylesheets/adminlte/skins/skin-yellow.min.css +1 -0
  324. metadata +408 -0
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * Bootstrap Colorpicker v2.5.1
3
+ * https://itsjavi.com/bootstrap-colorpicker/
4
+ */
5
+ !function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):jQuery&&!jQuery.fn.colorpicker&&b(jQuery)}(this,function(a){"use strict";var b=function(c,d,e,f,g){this.fallbackValue=e?e&&"undefined"!=typeof e.h?e:this.value={h:0,s:0,b:0,a:1}:null,this.fallbackFormat=f?f:"rgba",this.hexNumberSignPrefix=g===!0,this.value=this.fallbackValue,this.origFormat=null,this.predefinedColors=d?d:{},this.colors=a.extend({},b.webColors,this.predefinedColors),c&&("undefined"!=typeof c.h?this.value=c:this.setColor(String(c))),this.value||(this.value={h:0,s:0,b:0,a:1})};b.webColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32",transparent:"transparent"},b.prototype={constructor:b,colors:{},predefinedColors:{},getValue:function(){return this.value},setValue:function(a){this.value=a},_sanitizeNumber:function(a){return"number"==typeof a?a:isNaN(a)||null===a||""===a||void 0===a?1:""===a?0:"undefined"!=typeof a.toLowerCase?(a.match(/^\./)&&(a="0"+a),Math.ceil(100*parseFloat(a))/100):1},isTransparent:function(a){return!(!a||!("string"==typeof a||a instanceof String))&&(a=a.toLowerCase().trim(),"transparent"===a||a.match(/#?00000000/)||a.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/))},rgbaIsTransparent:function(a){return 0===a.r&&0===a.g&&0===a.b&&0===a.a},setColor:function(a){if(a=a.toLowerCase().trim()){if(this.isTransparent(a))return this.value={h:0,s:0,b:0,a:0},!0;var b=this.parse(a);b?(this.value=this.value={h:b.h,s:b.s,b:b.b,a:b.a},this.origFormat||(this.origFormat=b.format)):this.fallbackValue&&(this.value=this.fallbackValue)}return!1},setHue:function(a){this.value.h=1-a},setSaturation:function(a){this.value.s=a},setBrightness:function(a){this.value.b=1-a},setAlpha:function(a){this.value.a=Math.round(parseInt(100*(1-a),10)/100*100)/100},toRGB:function(a,b,c,d){0===arguments.length&&(a=this.value.h,b=this.value.s,c=this.value.b,d=this.value.a),a*=360;var e,f,g,h,i;return a=a%360/60,i=c*b,h=i*(1-Math.abs(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],{r:Math.round(255*e),g:Math.round(255*f),b:Math.round(255*g),a:d}},toHex:function(a,b,c,d){0===arguments.length&&(a=this.value.h,b=this.value.s,c=this.value.b,d=this.value.a);var e=this.toRGB(a,b,c,d);if(this.rgbaIsTransparent(e))return"transparent";var f=(this.hexNumberSignPrefix?"#":"")+((1<<24)+(parseInt(e.r)<<16)+(parseInt(e.g)<<8)+parseInt(e.b)).toString(16).slice(1);return f},toHSL:function(a,b,c,d){0===arguments.length&&(a=this.value.h,b=this.value.s,c=this.value.b,d=this.value.a);var e=a,f=(2-b)*c,g=b*c;return g/=f>0&&f<=1?f:2-f,f/=2,g>1&&(g=1),{h:isNaN(e)?0:e,s:isNaN(g)?0:g,l:isNaN(f)?0:f,a:isNaN(d)?0:d}},toAlias:function(a,b,c,d){var e,f=0===arguments.length?this.toHex():this.toHex(a,b,c,d),g="alias"===this.origFormat?f:this.toString(this.origFormat,!1);for(var h in this.colors)if(e=this.colors[h].toLowerCase().trim(),e===f||e===g)return h;return!1},RGBtoHSB:function(a,b,c,d){a/=255,b/=255,c/=255;var e,f,g,h;return g=Math.max(a,b,c),h=g-Math.min(a,b,c),e=0===h?null:g===a?(b-c)/h:g===b?(c-a)/h+2:(a-b)/h+4,e=(e+360)%6*60/360,f=0===h?0:h/g,{h:this._sanitizeNumber(e),s:f,b:g,a:this._sanitizeNumber(d)}},HueToRGB:function(a,b,c){return c<0?c+=1:c>1&&(c-=1),6*c<1?a+(b-a)*c*6:2*c<1?b:3*c<2?a+(b-a)*(2/3-c)*6:a},HSLtoRGB:function(a,b,c,d){b<0&&(b=0);var e;e=c<=.5?c*(1+b):c+b-c*b;var f=2*c-e,g=a+1/3,h=a,i=a-1/3,j=Math.round(255*this.HueToRGB(f,e,g)),k=Math.round(255*this.HueToRGB(f,e,h)),l=Math.round(255*this.HueToRGB(f,e,i));return[j,k,l,this._sanitizeNumber(d)]},parse:function(b){if(0===arguments.length)return!1;var c,d,e=this,f=!1,g="undefined"!=typeof this.colors[b];return g&&(b=this.colors[b].toLowerCase().trim()),a.each(this.stringParsers,function(a,h){var i=h.re.exec(b);return c=i&&h.parse.apply(e,[i]),!c||(f={},d=g?"alias":h.format?h.format:e.getValidFallbackFormat(),f=d.match(/hsla?/)?e.RGBtoHSB.apply(e,e.HSLtoRGB.apply(e,c)):e.RGBtoHSB.apply(e,c),f instanceof Object&&(f.format=d),!1)}),f},getValidFallbackFormat:function(){var a=["rgba","rgb","hex","hsla","hsl"];return this.origFormat&&a.indexOf(this.origFormat)!==-1?this.origFormat:this.fallbackFormat&&a.indexOf(this.fallbackFormat)!==-1?this.fallbackFormat:"rgba"},toString:function(a,c){a=a||this.origFormat||this.fallbackFormat,c=c||!1;var d=!1;switch(a){case"rgb":return d=this.toRGB(),this.rgbaIsTransparent(d)?"transparent":"rgb("+d.r+","+d.g+","+d.b+")";case"rgba":return d=this.toRGB(),"rgba("+d.r+","+d.g+","+d.b+","+d.a+")";case"hsl":return d=this.toHSL(),"hsl("+Math.round(360*d.h)+","+Math.round(100*d.s)+"%,"+Math.round(100*d.l)+"%)";case"hsla":return d=this.toHSL(),"hsla("+Math.round(360*d.h)+","+Math.round(100*d.s)+"%,"+Math.round(100*d.l)+"%,"+d.a+")";case"hex":return this.toHex();case"alias":return d=this.toAlias(),d===!1?this.toString(this.getValidFallbackFormat()):c&&!(d in b.webColors)&&d in this.predefinedColors?this.predefinedColors[d]:d;default:return d}},stringParsers:[{re:/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/,format:"rgb",parse:function(a){return[a[1],a[2],a[3],1]}},{re:/rgb\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,format:"rgb",parse:function(a){return[2.55*a[1],2.55*a[2],2.55*a[3],1]}},{re:/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(a){return[a[1],a[2],a[3],a[4]]}},{re:/rgba\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(a){return[2.55*a[1],2.55*a[2],2.55*a[3],a[4]]}},{re:/hsl\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,format:"hsl",parse:function(a){return[a[1]/360,a[2]/100,a[3]/100,a[4]]}},{re:/hsla\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"hsla",parse:function(a){return[a[1]/360,a[2]/100,a[3]/100,a[4]]}},{re:/#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,format:"hex",parse:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),1]}},{re:/#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,format:"hex",parse:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16),1]}}],colorNameToHex:function(a){return"undefined"!=typeof this.colors[a.toLowerCase()]&&this.colors[a.toLowerCase()]}};var c={horizontal:!1,inline:!1,color:!1,format:!1,input:"input",container:!1,component:".add-on, .input-group-addon",fallbackColor:!1,fallbackFormat:"hex",hexNumberSignPrefix:!0,sliders:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setHue"},alpha:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setAlpha"}},slidersHorz:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:100,maxTop:0,callLeft:"setHue",callTop:!1},alpha:{maxLeft:100,maxTop:0,callLeft:"setAlpha",callTop:!1}},template:'<div class="colorpicker dropdown-menu"><div class="colorpicker-saturation"><i><b></b></i></div><div class="colorpicker-hue"><i></i></div><div class="colorpicker-alpha"><i></i></div><div class="colorpicker-color"><div /></div><div class="colorpicker-selectors"></div></div>',align:"right",customClass:null,colorSelectors:null},d=function(b,d){this.element=a(b).addClass("colorpicker-element"),this.options=a.extend(!0,{},c,this.element.data(),d),this.component=this.options.component,this.component=this.component!==!1&&this.element.find(this.component),this.component&&0===this.component.length&&(this.component=!1),this.container=this.options.container===!0?this.element:this.options.container,this.container=this.container!==!1&&a(this.container),this.input=this.element.is("input")?this.element:!!this.options.input&&this.element.find(this.options.input),this.input&&0===this.input.length&&(this.input=!1),this.color=this.createColor(this.options.color!==!1?this.options.color:this.getValue()),this.format=this.options.format!==!1?this.options.format:this.color.origFormat,this.options.color!==!1&&(this.updateInput(this.color),this.updateData(this.color));var e=this.picker=a(this.options.template);if(this.options.customClass&&e.addClass(this.options.customClass),this.options.inline?e.addClass("colorpicker-inline colorpicker-visible"):e.addClass("colorpicker-hidden"),this.options.horizontal&&e.addClass("colorpicker-horizontal"),["rgba","hsla","alias"].indexOf(this.format)===-1&&this.options.format!==!1&&"transparent"!==this.getValue()||e.addClass("colorpicker-with-alpha"),"right"===this.options.align&&e.addClass("colorpicker-right"),this.options.inline===!0&&e.addClass("colorpicker-no-arrow"),this.options.colorSelectors){var f=this,g=f.picker.find(".colorpicker-selectors");g.length>0&&(a.each(this.options.colorSelectors,function(b,c){var d=a("<i />").addClass("colorpicker-selectors-color").css("background-color",c).data("class",b).data("alias",b);d.on("mousedown.colorpicker touchstart.colorpicker",function(b){b.preventDefault(),f.setValue("alias"===f.format?a(this).data("alias"):a(this).css("background-color"))}),g.append(d)}),g.show().addClass("colorpicker-visible"))}e.on("mousedown.colorpicker touchstart.colorpicker",a.proxy(function(a){a.target===a.currentTarget&&a.preventDefault()},this)),e.find(".colorpicker-saturation, .colorpicker-hue, .colorpicker-alpha").on("mousedown.colorpicker touchstart.colorpicker",a.proxy(this.mousedown,this)),e.appendTo(this.container?this.container:a("body")),this.input!==!1&&(this.input.on({"keyup.colorpicker":a.proxy(this.keyup,this)}),this.input.on({"change.colorpicker":a.proxy(this.change,this)}),this.component===!1&&this.element.on({"focus.colorpicker":a.proxy(this.show,this)}),this.options.inline===!1&&this.element.on({"focusout.colorpicker":a.proxy(this.hide,this)})),this.component!==!1&&this.component.on({"click.colorpicker":a.proxy(this.show,this)}),this.input===!1&&this.component===!1&&this.element.on({"click.colorpicker":a.proxy(this.show,this)}),this.input!==!1&&this.component!==!1&&"color"===this.input.attr("type")&&this.input.on({"click.colorpicker":a.proxy(this.show,this),"focus.colorpicker":a.proxy(this.show,this)}),this.update(),a(a.proxy(function(){this.element.trigger("create")},this))};d.Color=b,d.prototype={constructor:d,destroy:function(){this.picker.remove(),this.element.removeData("colorpicker","color").off(".colorpicker"),this.input!==!1&&this.input.off(".colorpicker"),this.component!==!1&&this.component.off(".colorpicker"),this.element.removeClass("colorpicker-element"),this.element.trigger({type:"destroy"})},reposition:function(){if(this.options.inline!==!1||this.options.container)return!1;var a=this.container&&this.container[0]!==window.document.body?"position":"offset",b=this.component||this.element,c=b[a]();"right"===this.options.align&&(c.left-=this.picker.outerWidth()-b.outerWidth()),this.picker.css({top:c.top+b.outerHeight(),left:c.left})},show:function(b){this.isDisabled()||(this.picker.addClass("colorpicker-visible").removeClass("colorpicker-hidden"),this.reposition(),a(window).on("resize.colorpicker",a.proxy(this.reposition,this)),!b||this.hasInput()&&"color"!==this.input.attr("type")||b.stopPropagation&&b.preventDefault&&(b.stopPropagation(),b.preventDefault()),!this.component&&this.input||this.options.inline!==!1||a(window.document).on({"mousedown.colorpicker":a.proxy(this.hide,this)}),this.element.trigger({type:"showPicker",color:this.color}))},hide:function(b){return("undefined"==typeof b||!b.target||!(a(b.currentTarget).parents(".colorpicker").length>0||a(b.target).parents(".colorpicker").length>0))&&(this.picker.addClass("colorpicker-hidden").removeClass("colorpicker-visible"),a(window).off("resize.colorpicker",this.reposition),a(window.document).off({"mousedown.colorpicker":this.hide}),this.update(),void this.element.trigger({type:"hidePicker",color:this.color}))},updateData:function(a){return a=a||this.color.toString(this.format,!1),this.element.data("color",a),a},updateInput:function(a){return a=a||this.color.toString(this.format,!1),this.input!==!1&&(this.input.prop("value",a),this.input.trigger("change")),a},updatePicker:function(a){"undefined"!=typeof a&&(this.color=this.createColor(a));var b=this.options.horizontal===!1?this.options.sliders:this.options.slidersHorz,c=this.picker.find("i");if(0!==c.length)return this.options.horizontal===!1?(b=this.options.sliders,c.eq(1).css("top",b.hue.maxTop*(1-this.color.value.h)).end().eq(2).css("top",b.alpha.maxTop*(1-this.color.value.a))):(b=this.options.slidersHorz,c.eq(1).css("left",b.hue.maxLeft*(1-this.color.value.h)).end().eq(2).css("left",b.alpha.maxLeft*(1-this.color.value.a))),c.eq(0).css({top:b.saturation.maxTop-this.color.value.b*b.saturation.maxTop,left:this.color.value.s*b.saturation.maxLeft}),this.picker.find(".colorpicker-saturation").css("backgroundColor",(this.options.hexNumberSignPrefix?"":"#")+this.color.toHex(this.color.value.h,1,1,1)),this.picker.find(".colorpicker-alpha").css("backgroundColor",(this.options.hexNumberSignPrefix?"":"#")+this.color.toHex()),this.picker.find(".colorpicker-color, .colorpicker-color div").css("backgroundColor",this.color.toString(this.format,!0)),a},updateComponent:function(a){var b;if(b="undefined"!=typeof a?this.createColor(a):this.color,this.component!==!1){var c=this.component.find("i").eq(0);c.length>0?c.css({backgroundColor:b.toString(this.format,!0)}):this.component.css({backgroundColor:b.toString(this.format,!0)})}return b.toString(this.format,!1)},update:function(a){var b;return this.getValue(!1)===!1&&a!==!0||(b=this.updateComponent(),this.updateInput(b),this.updateData(b),this.updatePicker()),b},setValue:function(a){this.color=this.createColor(a),this.update(!0),this.element.trigger({type:"changeColor",color:this.color,value:a})},createColor:function(a){return new b(a?a:null,this.options.colorSelectors,this.options.fallbackColor?this.options.fallbackColor:this.color,this.options.fallbackFormat,this.options.hexNumberSignPrefix)},getValue:function(a){a="undefined"==typeof a?this.options.fallbackColor:a;var b;return b=this.hasInput()?this.input.val():this.element.data("color"),void 0!==b&&""!==b&&null!==b||(b=a),b},hasInput:function(){return this.input!==!1},isDisabled:function(){return!!this.hasInput()&&this.input.prop("disabled")===!0},disable:function(){return!!this.hasInput()&&(this.input.prop("disabled",!0),this.element.trigger({type:"disable",color:this.color,value:this.getValue()}),!0)},enable:function(){return!!this.hasInput()&&(this.input.prop("disabled",!1),this.element.trigger({type:"enable",color:this.color,value:this.getValue()}),!0)},currentSlider:null,mousePointer:{left:0,top:0},mousedown:function(b){!b.pageX&&!b.pageY&&b.originalEvent&&b.originalEvent.touches&&(b.pageX=b.originalEvent.touches[0].pageX,b.pageY=b.originalEvent.touches[0].pageY),b.stopPropagation(),b.preventDefault();var c=a(b.target),d=c.closest("div"),e=this.options.horizontal?this.options.slidersHorz:this.options.sliders;if(!d.is(".colorpicker")){if(d.is(".colorpicker-saturation"))this.currentSlider=a.extend({},e.saturation);else if(d.is(".colorpicker-hue"))this.currentSlider=a.extend({},e.hue);else{if(!d.is(".colorpicker-alpha"))return!1;this.currentSlider=a.extend({},e.alpha)}var f=d.offset();this.currentSlider.guide=d.find("i")[0].style,this.currentSlider.left=b.pageX-f.left,this.currentSlider.top=b.pageY-f.top,this.mousePointer={left:b.pageX,top:b.pageY},a(window.document).on({"mousemove.colorpicker":a.proxy(this.mousemove,this),"touchmove.colorpicker":a.proxy(this.mousemove,this),"mouseup.colorpicker":a.proxy(this.mouseup,this),"touchend.colorpicker":a.proxy(this.mouseup,this)}).trigger("mousemove")}return!1},mousemove:function(a){!a.pageX&&!a.pageY&&a.originalEvent&&a.originalEvent.touches&&(a.pageX=a.originalEvent.touches[0].pageX,a.pageY=a.originalEvent.touches[0].pageY),a.stopPropagation(),a.preventDefault();var b=Math.max(0,Math.min(this.currentSlider.maxLeft,this.currentSlider.left+((a.pageX||this.mousePointer.left)-this.mousePointer.left))),c=Math.max(0,Math.min(this.currentSlider.maxTop,this.currentSlider.top+((a.pageY||this.mousePointer.top)-this.mousePointer.top)));return this.currentSlider.guide.left=b+"px",this.currentSlider.guide.top=c+"px",this.currentSlider.callLeft&&this.color[this.currentSlider.callLeft].call(this.color,b/this.currentSlider.maxLeft),this.currentSlider.callTop&&this.color[this.currentSlider.callTop].call(this.color,c/this.currentSlider.maxTop),this.options.format!==!1||"setAlpha"!==this.currentSlider.callTop&&"setAlpha"!==this.currentSlider.callLeft||(1!==this.color.value.a?(this.format="rgba",this.color.origFormat="rgba"):(this.format="hex",this.color.origFormat="hex")),this.update(!0),this.element.trigger({type:"changeColor",color:this.color}),!1},mouseup:function(b){return b.stopPropagation(),b.preventDefault(),a(window.document).off({"mousemove.colorpicker":this.mousemove,"touchmove.colorpicker":this.mousemove,"mouseup.colorpicker":this.mouseup,"touchend.colorpicker":this.mouseup}),!1},change:function(a){this.keyup(a)},keyup:function(a){38===a.keyCode?(this.color.value.a<1&&(this.color.value.a=Math.round(100*(this.color.value.a+.01))/100),this.update(!0)):40===a.keyCode?(this.color.value.a>0&&(this.color.value.a=Math.round(100*(this.color.value.a-.01))/100),this.update(!0)):(this.color=this.createColor(this.input.val()),this.color.origFormat&&this.options.format===!1&&(this.format=this.color.origFormat),this.getValue(!1)!==!1&&(this.updateData(),this.updateComponent(),this.updatePicker())),this.element.trigger({type:"changeColor",color:this.color,value:this.input.val()})}},a.colorpicker=d,a.fn.colorpicker=function(b){var c=Array.prototype.slice.call(arguments,1),e=1===this.length,f=null,g=this.each(function(){var e=a(this),g=e.data("colorpicker"),h="object"==typeof b?b:{};g||(g=new d(this,h),e.data("colorpicker",g)),"string"==typeof b?a.isFunction(g[b])?f=g[b].apply(g,c):(c.length&&(g[b]=c[0]),f=g[b]):f=e});return e?f:g},a.fn.colorpicker.constructor=d});
@@ -0,0 +1,2030 @@
1
+ /*!
2
+ * Datepicker for Bootstrap v1.7.1 (https://github.com/uxsolutions/bootstrap-datepicker)
3
+ *
4
+ * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
5
+ */
6
+
7
+ (function(factory){
8
+ if (typeof define === "function" && define.amd) {
9
+ define(["jquery"], factory);
10
+ } else if (typeof exports === 'object') {
11
+ factory(require('jquery'));
12
+ } else {
13
+ factory(jQuery);
14
+ }
15
+ }(function($, undefined){
16
+ function UTCDate(){
17
+ return new Date(Date.UTC.apply(Date, arguments));
18
+ }
19
+ function UTCToday(){
20
+ var today = new Date();
21
+ return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());
22
+ }
23
+ function isUTCEquals(date1, date2) {
24
+ return (
25
+ date1.getUTCFullYear() === date2.getUTCFullYear() &&
26
+ date1.getUTCMonth() === date2.getUTCMonth() &&
27
+ date1.getUTCDate() === date2.getUTCDate()
28
+ );
29
+ }
30
+ function alias(method, deprecationMsg){
31
+ return function(){
32
+ if (deprecationMsg !== undefined) {
33
+ $.fn.datepicker.deprecated(deprecationMsg);
34
+ }
35
+
36
+ return this[method].apply(this, arguments);
37
+ };
38
+ }
39
+ function isValidDate(d) {
40
+ return d && !isNaN(d.getTime());
41
+ }
42
+
43
+ var DateArray = (function(){
44
+ var extras = {
45
+ get: function(i){
46
+ return this.slice(i)[0];
47
+ },
48
+ contains: function(d){
49
+ // Array.indexOf is not cross-browser;
50
+ // $.inArray doesn't work with Dates
51
+ var val = d && d.valueOf();
52
+ for (var i=0, l=this.length; i < l; i++)
53
+ // Use date arithmetic to allow dates with different times to match
54
+ if (0 <= this[i].valueOf() - val && this[i].valueOf() - val < 1000*60*60*24)
55
+ return i;
56
+ return -1;
57
+ },
58
+ remove: function(i){
59
+ this.splice(i,1);
60
+ },
61
+ replace: function(new_array){
62
+ if (!new_array)
63
+ return;
64
+ if (!$.isArray(new_array))
65
+ new_array = [new_array];
66
+ this.clear();
67
+ this.push.apply(this, new_array);
68
+ },
69
+ clear: function(){
70
+ this.length = 0;
71
+ },
72
+ copy: function(){
73
+ var a = new DateArray();
74
+ a.replace(this);
75
+ return a;
76
+ }
77
+ };
78
+
79
+ return function(){
80
+ var a = [];
81
+ a.push.apply(a, arguments);
82
+ $.extend(a, extras);
83
+ return a;
84
+ };
85
+ })();
86
+
87
+
88
+ // Picker object
89
+
90
+ var Datepicker = function(element, options){
91
+ $.data(element, 'datepicker', this);
92
+ this._process_options(options);
93
+
94
+ this.dates = new DateArray();
95
+ this.viewDate = this.o.defaultViewDate;
96
+ this.focusDate = null;
97
+
98
+ this.element = $(element);
99
+ this.isInput = this.element.is('input');
100
+ this.inputField = this.isInput ? this.element : this.element.find('input');
101
+ this.component = this.element.hasClass('date') ? this.element.find('.add-on, .input-group-addon, .btn') : false;
102
+ if (this.component && this.component.length === 0)
103
+ this.component = false;
104
+ this.isInline = !this.component && this.element.is('div');
105
+
106
+ this.picker = $(DPGlobal.template);
107
+
108
+ // Checking templates and inserting
109
+ if (this._check_template(this.o.templates.leftArrow)) {
110
+ this.picker.find('.prev').html(this.o.templates.leftArrow);
111
+ }
112
+
113
+ if (this._check_template(this.o.templates.rightArrow)) {
114
+ this.picker.find('.next').html(this.o.templates.rightArrow);
115
+ }
116
+
117
+ this._buildEvents();
118
+ this._attachEvents();
119
+
120
+ if (this.isInline){
121
+ this.picker.addClass('datepicker-inline').appendTo(this.element);
122
+ }
123
+ else {
124
+ this.picker.addClass('datepicker-dropdown dropdown-menu');
125
+ }
126
+
127
+ if (this.o.rtl){
128
+ this.picker.addClass('datepicker-rtl');
129
+ }
130
+
131
+ if (this.o.calendarWeeks) {
132
+ this.picker.find('.datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear')
133
+ .attr('colspan', function(i, val){
134
+ return Number(val) + 1;
135
+ });
136
+ }
137
+
138
+ this._process_options({
139
+ startDate: this._o.startDate,
140
+ endDate: this._o.endDate,
141
+ daysOfWeekDisabled: this.o.daysOfWeekDisabled,
142
+ daysOfWeekHighlighted: this.o.daysOfWeekHighlighted,
143
+ datesDisabled: this.o.datesDisabled
144
+ });
145
+
146
+ this._allow_update = false;
147
+ this.setViewMode(this.o.startView);
148
+ this._allow_update = true;
149
+
150
+ this.fillDow();
151
+ this.fillMonths();
152
+
153
+ this.update();
154
+
155
+ if (this.isInline){
156
+ this.show();
157
+ }
158
+ };
159
+
160
+ Datepicker.prototype = {
161
+ constructor: Datepicker,
162
+
163
+ _resolveViewName: function(view){
164
+ $.each(DPGlobal.viewModes, function(i, viewMode){
165
+ if (view === i || $.inArray(view, viewMode.names) !== -1){
166
+ view = i;
167
+ return false;
168
+ }
169
+ });
170
+
171
+ return view;
172
+ },
173
+
174
+ _resolveDaysOfWeek: function(daysOfWeek){
175
+ if (!$.isArray(daysOfWeek))
176
+ daysOfWeek = daysOfWeek.split(/[,\s]*/);
177
+ return $.map(daysOfWeek, Number);
178
+ },
179
+
180
+ _check_template: function(tmp){
181
+ try {
182
+ // If empty
183
+ if (tmp === undefined || tmp === "") {
184
+ return false;
185
+ }
186
+ // If no html, everything ok
187
+ if ((tmp.match(/[<>]/g) || []).length <= 0) {
188
+ return true;
189
+ }
190
+ // Checking if html is fine
191
+ var jDom = $(tmp);
192
+ return jDom.length > 0;
193
+ }
194
+ catch (ex) {
195
+ return false;
196
+ }
197
+ },
198
+
199
+ _process_options: function(opts){
200
+ // Store raw options for reference
201
+ this._o = $.extend({}, this._o, opts);
202
+ // Processed options
203
+ var o = this.o = $.extend({}, this._o);
204
+
205
+ // Check if "de-DE" style date is available, if not language should
206
+ // fallback to 2 letter code eg "de"
207
+ var lang = o.language;
208
+ if (!dates[lang]){
209
+ lang = lang.split('-')[0];
210
+ if (!dates[lang])
211
+ lang = defaults.language;
212
+ }
213
+ o.language = lang;
214
+
215
+ // Retrieve view index from any aliases
216
+ o.startView = this._resolveViewName(o.startView);
217
+ o.minViewMode = this._resolveViewName(o.minViewMode);
218
+ o.maxViewMode = this._resolveViewName(o.maxViewMode);
219
+
220
+ // Check view is between min and max
221
+ o.startView = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, o.startView));
222
+
223
+ // true, false, or Number > 0
224
+ if (o.multidate !== true){
225
+ o.multidate = Number(o.multidate) || false;
226
+ if (o.multidate !== false)
227
+ o.multidate = Math.max(0, o.multidate);
228
+ }
229
+ o.multidateSeparator = String(o.multidateSeparator);
230
+
231
+ o.weekStart %= 7;
232
+ o.weekEnd = (o.weekStart + 6) % 7;
233
+
234
+ var format = DPGlobal.parseFormat(o.format);
235
+ if (o.startDate !== -Infinity){
236
+ if (!!o.startDate){
237
+ if (o.startDate instanceof Date)
238
+ o.startDate = this._local_to_utc(this._zero_time(o.startDate));
239
+ else
240
+ o.startDate = DPGlobal.parseDate(o.startDate, format, o.language, o.assumeNearbyYear);
241
+ }
242
+ else {
243
+ o.startDate = -Infinity;
244
+ }
245
+ }
246
+ if (o.endDate !== Infinity){
247
+ if (!!o.endDate){
248
+ if (o.endDate instanceof Date)
249
+ o.endDate = this._local_to_utc(this._zero_time(o.endDate));
250
+ else
251
+ o.endDate = DPGlobal.parseDate(o.endDate, format, o.language, o.assumeNearbyYear);
252
+ }
253
+ else {
254
+ o.endDate = Infinity;
255
+ }
256
+ }
257
+
258
+ o.daysOfWeekDisabled = this._resolveDaysOfWeek(o.daysOfWeekDisabled||[]);
259
+ o.daysOfWeekHighlighted = this._resolveDaysOfWeek(o.daysOfWeekHighlighted||[]);
260
+
261
+ o.datesDisabled = o.datesDisabled||[];
262
+ if (!$.isArray(o.datesDisabled)) {
263
+ o.datesDisabled = o.datesDisabled.split(',');
264
+ }
265
+ o.datesDisabled = $.map(o.datesDisabled, function(d){
266
+ return DPGlobal.parseDate(d, format, o.language, o.assumeNearbyYear);
267
+ });
268
+
269
+ var plc = String(o.orientation).toLowerCase().split(/\s+/g),
270
+ _plc = o.orientation.toLowerCase();
271
+ plc = $.grep(plc, function(word){
272
+ return /^auto|left|right|top|bottom$/.test(word);
273
+ });
274
+ o.orientation = {x: 'auto', y: 'auto'};
275
+ if (!_plc || _plc === 'auto')
276
+ ; // no action
277
+ else if (plc.length === 1){
278
+ switch (plc[0]){
279
+ case 'top':
280
+ case 'bottom':
281
+ o.orientation.y = plc[0];
282
+ break;
283
+ case 'left':
284
+ case 'right':
285
+ o.orientation.x = plc[0];
286
+ break;
287
+ }
288
+ }
289
+ else {
290
+ _plc = $.grep(plc, function(word){
291
+ return /^left|right$/.test(word);
292
+ });
293
+ o.orientation.x = _plc[0] || 'auto';
294
+
295
+ _plc = $.grep(plc, function(word){
296
+ return /^top|bottom$/.test(word);
297
+ });
298
+ o.orientation.y = _plc[0] || 'auto';
299
+ }
300
+ if (o.defaultViewDate instanceof Date || typeof o.defaultViewDate === 'string') {
301
+ o.defaultViewDate = DPGlobal.parseDate(o.defaultViewDate, format, o.language, o.assumeNearbyYear);
302
+ } else if (o.defaultViewDate) {
303
+ var year = o.defaultViewDate.year || new Date().getFullYear();
304
+ var month = o.defaultViewDate.month || 0;
305
+ var day = o.defaultViewDate.day || 1;
306
+ o.defaultViewDate = UTCDate(year, month, day);
307
+ } else {
308
+ o.defaultViewDate = UTCToday();
309
+ }
310
+ },
311
+ _events: [],
312
+ _secondaryEvents: [],
313
+ _applyEvents: function(evs){
314
+ for (var i=0, el, ch, ev; i < evs.length; i++){
315
+ el = evs[i][0];
316
+ if (evs[i].length === 2){
317
+ ch = undefined;
318
+ ev = evs[i][1];
319
+ } else if (evs[i].length === 3){
320
+ ch = evs[i][1];
321
+ ev = evs[i][2];
322
+ }
323
+ el.on(ev, ch);
324
+ }
325
+ },
326
+ _unapplyEvents: function(evs){
327
+ for (var i=0, el, ev, ch; i < evs.length; i++){
328
+ el = evs[i][0];
329
+ if (evs[i].length === 2){
330
+ ch = undefined;
331
+ ev = evs[i][1];
332
+ } else if (evs[i].length === 3){
333
+ ch = evs[i][1];
334
+ ev = evs[i][2];
335
+ }
336
+ el.off(ev, ch);
337
+ }
338
+ },
339
+ _buildEvents: function(){
340
+ var events = {
341
+ keyup: $.proxy(function(e){
342
+ if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1)
343
+ this.update();
344
+ }, this),
345
+ keydown: $.proxy(this.keydown, this),
346
+ paste: $.proxy(this.paste, this)
347
+ };
348
+
349
+ if (this.o.showOnFocus === true) {
350
+ events.focus = $.proxy(this.show, this);
351
+ }
352
+
353
+ if (this.isInput) { // single input
354
+ this._events = [
355
+ [this.element, events]
356
+ ];
357
+ }
358
+ // component: input + button
359
+ else if (this.component && this.inputField.length) {
360
+ this._events = [
361
+ // For components that are not readonly, allow keyboard nav
362
+ [this.inputField, events],
363
+ [this.component, {
364
+ click: $.proxy(this.show, this)
365
+ }]
366
+ ];
367
+ }
368
+ else {
369
+ this._events = [
370
+ [this.element, {
371
+ click: $.proxy(this.show, this),
372
+ keydown: $.proxy(this.keydown, this)
373
+ }]
374
+ ];
375
+ }
376
+ this._events.push(
377
+ // Component: listen for blur on element descendants
378
+ [this.element, '*', {
379
+ blur: $.proxy(function(e){
380
+ this._focused_from = e.target;
381
+ }, this)
382
+ }],
383
+ // Input: listen for blur on element
384
+ [this.element, {
385
+ blur: $.proxy(function(e){
386
+ this._focused_from = e.target;
387
+ }, this)
388
+ }]
389
+ );
390
+
391
+ if (this.o.immediateUpdates) {
392
+ // Trigger input updates immediately on changed year/month
393
+ this._events.push([this.element, {
394
+ 'changeYear changeMonth': $.proxy(function(e){
395
+ this.update(e.date);
396
+ }, this)
397
+ }]);
398
+ }
399
+
400
+ this._secondaryEvents = [
401
+ [this.picker, {
402
+ click: $.proxy(this.click, this)
403
+ }],
404
+ [this.picker, '.prev, .next', {
405
+ click: $.proxy(this.navArrowsClick, this)
406
+ }],
407
+ [this.picker, '.day:not(.disabled)', {
408
+ click: $.proxy(this.dayCellClick, this)
409
+ }],
410
+ [$(window), {
411
+ resize: $.proxy(this.place, this)
412
+ }],
413
+ [$(document), {
414
+ 'mousedown touchstart': $.proxy(function(e){
415
+ // Clicked outside the datepicker, hide it
416
+ if (!(
417
+ this.element.is(e.target) ||
418
+ this.element.find(e.target).length ||
419
+ this.picker.is(e.target) ||
420
+ this.picker.find(e.target).length ||
421
+ this.isInline
422
+ )){
423
+ this.hide();
424
+ }
425
+ }, this)
426
+ }]
427
+ ];
428
+ },
429
+ _attachEvents: function(){
430
+ this._detachEvents();
431
+ this._applyEvents(this._events);
432
+ },
433
+ _detachEvents: function(){
434
+ this._unapplyEvents(this._events);
435
+ },
436
+ _attachSecondaryEvents: function(){
437
+ this._detachSecondaryEvents();
438
+ this._applyEvents(this._secondaryEvents);
439
+ },
440
+ _detachSecondaryEvents: function(){
441
+ this._unapplyEvents(this._secondaryEvents);
442
+ },
443
+ _trigger: function(event, altdate){
444
+ var date = altdate || this.dates.get(-1),
445
+ local_date = this._utc_to_local(date);
446
+
447
+ this.element.trigger({
448
+ type: event,
449
+ date: local_date,
450
+ viewMode: this.viewMode,
451
+ dates: $.map(this.dates, this._utc_to_local),
452
+ format: $.proxy(function(ix, format){
453
+ if (arguments.length === 0){
454
+ ix = this.dates.length - 1;
455
+ format = this.o.format;
456
+ } else if (typeof ix === 'string'){
457
+ format = ix;
458
+ ix = this.dates.length - 1;
459
+ }
460
+ format = format || this.o.format;
461
+ var date = this.dates.get(ix);
462
+ return DPGlobal.formatDate(date, format, this.o.language);
463
+ }, this)
464
+ });
465
+ },
466
+
467
+ show: function(){
468
+ if (this.inputField.prop('disabled') || (this.inputField.prop('readonly') && this.o.enableOnReadonly === false))
469
+ return;
470
+ if (!this.isInline)
471
+ this.picker.appendTo(this.o.container);
472
+ this.place();
473
+ this.picker.show();
474
+ this._attachSecondaryEvents();
475
+ this._trigger('show');
476
+ if ((window.navigator.msMaxTouchPoints || 'ontouchstart' in document) && this.o.disableTouchKeyboard) {
477
+ $(this.element).blur();
478
+ }
479
+ return this;
480
+ },
481
+
482
+ hide: function(){
483
+ if (this.isInline || !this.picker.is(':visible'))
484
+ return this;
485
+ this.focusDate = null;
486
+ this.picker.hide().detach();
487
+ this._detachSecondaryEvents();
488
+ this.setViewMode(this.o.startView);
489
+
490
+ if (this.o.forceParse && this.inputField.val())
491
+ this.setValue();
492
+ this._trigger('hide');
493
+ return this;
494
+ },
495
+
496
+ destroy: function(){
497
+ this.hide();
498
+ this._detachEvents();
499
+ this._detachSecondaryEvents();
500
+ this.picker.remove();
501
+ delete this.element.data().datepicker;
502
+ if (!this.isInput){
503
+ delete this.element.data().date;
504
+ }
505
+ return this;
506
+ },
507
+
508
+ paste: function(e){
509
+ var dateString;
510
+ if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.types
511
+ && $.inArray('text/plain', e.originalEvent.clipboardData.types) !== -1) {
512
+ dateString = e.originalEvent.clipboardData.getData('text/plain');
513
+ } else if (window.clipboardData) {
514
+ dateString = window.clipboardData.getData('Text');
515
+ } else {
516
+ return;
517
+ }
518
+ this.setDate(dateString);
519
+ this.update();
520
+ e.preventDefault();
521
+ },
522
+
523
+ _utc_to_local: function(utc){
524
+ if (!utc) {
525
+ return utc;
526
+ }
527
+
528
+ var local = new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000));
529
+
530
+ if (local.getTimezoneOffset() !== utc.getTimezoneOffset()) {
531
+ local = new Date(utc.getTime() + (local.getTimezoneOffset() * 60000));
532
+ }
533
+
534
+ return local;
535
+ },
536
+ _local_to_utc: function(local){
537
+ return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000));
538
+ },
539
+ _zero_time: function(local){
540
+ return local && new Date(local.getFullYear(), local.getMonth(), local.getDate());
541
+ },
542
+ _zero_utc_time: function(utc){
543
+ return utc && UTCDate(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate());
544
+ },
545
+
546
+ getDates: function(){
547
+ return $.map(this.dates, this._utc_to_local);
548
+ },
549
+
550
+ getUTCDates: function(){
551
+ return $.map(this.dates, function(d){
552
+ return new Date(d);
553
+ });
554
+ },
555
+
556
+ getDate: function(){
557
+ return this._utc_to_local(this.getUTCDate());
558
+ },
559
+
560
+ getUTCDate: function(){
561
+ var selected_date = this.dates.get(-1);
562
+ if (selected_date !== undefined) {
563
+ return new Date(selected_date);
564
+ } else {
565
+ return null;
566
+ }
567
+ },
568
+
569
+ clearDates: function(){
570
+ this.inputField.val('');
571
+ this.update();
572
+ this._trigger('changeDate');
573
+
574
+ if (this.o.autoclose) {
575
+ this.hide();
576
+ }
577
+ },
578
+
579
+ setDates: function(){
580
+ var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
581
+ this.update.apply(this, args);
582
+ this._trigger('changeDate');
583
+ this.setValue();
584
+ return this;
585
+ },
586
+
587
+ setUTCDates: function(){
588
+ var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
589
+ this.setDates.apply(this, $.map(args, this._utc_to_local));
590
+ return this;
591
+ },
592
+
593
+ setDate: alias('setDates'),
594
+ setUTCDate: alias('setUTCDates'),
595
+ remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead'),
596
+
597
+ setValue: function(){
598
+ var formatted = this.getFormattedDate();
599
+ this.inputField.val(formatted);
600
+ return this;
601
+ },
602
+
603
+ getFormattedDate: function(format){
604
+ if (format === undefined)
605
+ format = this.o.format;
606
+
607
+ var lang = this.o.language;
608
+ return $.map(this.dates, function(d){
609
+ return DPGlobal.formatDate(d, format, lang);
610
+ }).join(this.o.multidateSeparator);
611
+ },
612
+
613
+ getStartDate: function(){
614
+ return this.o.startDate;
615
+ },
616
+
617
+ setStartDate: function(startDate){
618
+ this._process_options({startDate: startDate});
619
+ this.update();
620
+ this.updateNavArrows();
621
+ return this;
622
+ },
623
+
624
+ getEndDate: function(){
625
+ return this.o.endDate;
626
+ },
627
+
628
+ setEndDate: function(endDate){
629
+ this._process_options({endDate: endDate});
630
+ this.update();
631
+ this.updateNavArrows();
632
+ return this;
633
+ },
634
+
635
+ setDaysOfWeekDisabled: function(daysOfWeekDisabled){
636
+ this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});
637
+ this.update();
638
+ return this;
639
+ },
640
+
641
+ setDaysOfWeekHighlighted: function(daysOfWeekHighlighted){
642
+ this._process_options({daysOfWeekHighlighted: daysOfWeekHighlighted});
643
+ this.update();
644
+ return this;
645
+ },
646
+
647
+ setDatesDisabled: function(datesDisabled){
648
+ this._process_options({datesDisabled: datesDisabled});
649
+ this.update();
650
+ return this;
651
+ },
652
+
653
+ place: function(){
654
+ if (this.isInline)
655
+ return this;
656
+ var calendarWidth = this.picker.outerWidth(),
657
+ calendarHeight = this.picker.outerHeight(),
658
+ visualPadding = 10,
659
+ container = $(this.o.container),
660
+ windowWidth = container.width(),
661
+ scrollTop = this.o.container === 'body' ? $(document).scrollTop() : container.scrollTop(),
662
+ appendOffset = container.offset();
663
+
664
+ var parentsZindex = [0];
665
+ this.element.parents().each(function(){
666
+ var itemZIndex = $(this).css('z-index');
667
+ if (itemZIndex !== 'auto' && Number(itemZIndex) !== 0) parentsZindex.push(Number(itemZIndex));
668
+ });
669
+ var zIndex = Math.max.apply(Math, parentsZindex) + this.o.zIndexOffset;
670
+ var offset = this.component ? this.component.parent().offset() : this.element.offset();
671
+ var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);
672
+ var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);
673
+ var left = offset.left - appendOffset.left;
674
+ var top = offset.top - appendOffset.top;
675
+
676
+ if (this.o.container !== 'body') {
677
+ top += scrollTop;
678
+ }
679
+
680
+ this.picker.removeClass(
681
+ 'datepicker-orient-top datepicker-orient-bottom '+
682
+ 'datepicker-orient-right datepicker-orient-left'
683
+ );
684
+
685
+ if (this.o.orientation.x !== 'auto'){
686
+ this.picker.addClass('datepicker-orient-' + this.o.orientation.x);
687
+ if (this.o.orientation.x === 'right')
688
+ left -= calendarWidth - width;
689
+ }
690
+ // auto x orientation is best-placement: if it crosses a window
691
+ // edge, fudge it sideways
692
+ else {
693
+ if (offset.left < 0) {
694
+ // component is outside the window on the left side. Move it into visible range
695
+ this.picker.addClass('datepicker-orient-left');
696
+ left -= offset.left - visualPadding;
697
+ } else if (left + calendarWidth > windowWidth) {
698
+ // the calendar passes the widow right edge. Align it to component right side
699
+ this.picker.addClass('datepicker-orient-right');
700
+ left += width - calendarWidth;
701
+ } else {
702
+ if (this.o.rtl) {
703
+ // Default to right
704
+ this.picker.addClass('datepicker-orient-right');
705
+ } else {
706
+ // Default to left
707
+ this.picker.addClass('datepicker-orient-left');
708
+ }
709
+ }
710
+ }
711
+
712
+ // auto y orientation is best-situation: top or bottom, no fudging,
713
+ // decision based on which shows more of the calendar
714
+ var yorient = this.o.orientation.y,
715
+ top_overflow;
716
+ if (yorient === 'auto'){
717
+ top_overflow = -scrollTop + top - calendarHeight;
718
+ yorient = top_overflow < 0 ? 'bottom' : 'top';
719
+ }
720
+
721
+ this.picker.addClass('datepicker-orient-' + yorient);
722
+ if (yorient === 'top')
723
+ top -= calendarHeight + parseInt(this.picker.css('padding-top'));
724
+ else
725
+ top += height;
726
+
727
+ if (this.o.rtl) {
728
+ var right = windowWidth - (left + width);
729
+ this.picker.css({
730
+ top: top,
731
+ right: right,
732
+ zIndex: zIndex
733
+ });
734
+ } else {
735
+ this.picker.css({
736
+ top: top,
737
+ left: left,
738
+ zIndex: zIndex
739
+ });
740
+ }
741
+ return this;
742
+ },
743
+
744
+ _allow_update: true,
745
+ update: function(){
746
+ if (!this._allow_update)
747
+ return this;
748
+
749
+ var oldDates = this.dates.copy(),
750
+ dates = [],
751
+ fromArgs = false;
752
+ if (arguments.length){
753
+ $.each(arguments, $.proxy(function(i, date){
754
+ if (date instanceof Date)
755
+ date = this._local_to_utc(date);
756
+ dates.push(date);
757
+ }, this));
758
+ fromArgs = true;
759
+ } else {
760
+ dates = this.isInput
761
+ ? this.element.val()
762
+ : this.element.data('date') || this.inputField.val();
763
+ if (dates && this.o.multidate)
764
+ dates = dates.split(this.o.multidateSeparator);
765
+ else
766
+ dates = [dates];
767
+ delete this.element.data().date;
768
+ }
769
+
770
+ dates = $.map(dates, $.proxy(function(date){
771
+ return DPGlobal.parseDate(date, this.o.format, this.o.language, this.o.assumeNearbyYear);
772
+ }, this));
773
+ dates = $.grep(dates, $.proxy(function(date){
774
+ return (
775
+ !this.dateWithinRange(date) ||
776
+ !date
777
+ );
778
+ }, this), true);
779
+ this.dates.replace(dates);
780
+
781
+ if (this.o.updateViewDate) {
782
+ if (this.dates.length)
783
+ this.viewDate = new Date(this.dates.get(-1));
784
+ else if (this.viewDate < this.o.startDate)
785
+ this.viewDate = new Date(this.o.startDate);
786
+ else if (this.viewDate > this.o.endDate)
787
+ this.viewDate = new Date(this.o.endDate);
788
+ else
789
+ this.viewDate = this.o.defaultViewDate;
790
+ }
791
+
792
+ if (fromArgs){
793
+ // setting date by clicking
794
+ this.setValue();
795
+ this.element.change();
796
+ }
797
+ else if (this.dates.length){
798
+ // setting date by typing
799
+ if (String(oldDates) !== String(this.dates) && fromArgs) {
800
+ this._trigger('changeDate');
801
+ this.element.change();
802
+ }
803
+ }
804
+ if (!this.dates.length && oldDates.length) {
805
+ this._trigger('clearDate');
806
+ this.element.change();
807
+ }
808
+
809
+ this.fill();
810
+ return this;
811
+ },
812
+
813
+ fillDow: function(){
814
+ if (this.o.showWeekDays) {
815
+ var dowCnt = this.o.weekStart,
816
+ html = '<tr>';
817
+ if (this.o.calendarWeeks){
818
+ html += '<th class="cw">&#160;</th>';
819
+ }
820
+ while (dowCnt < this.o.weekStart + 7){
821
+ html += '<th class="dow';
822
+ if ($.inArray(dowCnt, this.o.daysOfWeekDisabled) !== -1)
823
+ html += ' disabled';
824
+ html += '">'+dates[this.o.language].daysMin[(dowCnt++)%7]+'</th>';
825
+ }
826
+ html += '</tr>';
827
+ this.picker.find('.datepicker-days thead').append(html);
828
+ }
829
+ },
830
+
831
+ fillMonths: function(){
832
+ var localDate = this._utc_to_local(this.viewDate);
833
+ var html = '';
834
+ var focused;
835
+ for (var i = 0; i < 12; i++){
836
+ focused = localDate && localDate.getMonth() === i ? ' focused' : '';
837
+ html += '<span class="month' + focused + '">' + dates[this.o.language].monthsShort[i] + '</span>';
838
+ }
839
+ this.picker.find('.datepicker-months td').html(html);
840
+ },
841
+
842
+ setRange: function(range){
843
+ if (!range || !range.length)
844
+ delete this.range;
845
+ else
846
+ this.range = $.map(range, function(d){
847
+ return d.valueOf();
848
+ });
849
+ this.fill();
850
+ },
851
+
852
+ getClassNames: function(date){
853
+ var cls = [],
854
+ year = this.viewDate.getUTCFullYear(),
855
+ month = this.viewDate.getUTCMonth(),
856
+ today = UTCToday();
857
+ if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){
858
+ cls.push('old');
859
+ } else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){
860
+ cls.push('new');
861
+ }
862
+ if (this.focusDate && date.valueOf() === this.focusDate.valueOf())
863
+ cls.push('focused');
864
+ // Compare internal UTC date with UTC today, not local today
865
+ if (this.o.todayHighlight && isUTCEquals(date, today)) {
866
+ cls.push('today');
867
+ }
868
+ if (this.dates.contains(date) !== -1)
869
+ cls.push('active');
870
+ if (!this.dateWithinRange(date)){
871
+ cls.push('disabled');
872
+ }
873
+ if (this.dateIsDisabled(date)){
874
+ cls.push('disabled', 'disabled-date');
875
+ }
876
+ if ($.inArray(date.getUTCDay(), this.o.daysOfWeekHighlighted) !== -1){
877
+ cls.push('highlighted');
878
+ }
879
+
880
+ if (this.range){
881
+ if (date > this.range[0] && date < this.range[this.range.length-1]){
882
+ cls.push('range');
883
+ }
884
+ if ($.inArray(date.valueOf(), this.range) !== -1){
885
+ cls.push('selected');
886
+ }
887
+ if (date.valueOf() === this.range[0]){
888
+ cls.push('range-start');
889
+ }
890
+ if (date.valueOf() === this.range[this.range.length-1]){
891
+ cls.push('range-end');
892
+ }
893
+ }
894
+ return cls;
895
+ },
896
+
897
+ _fill_yearsView: function(selector, cssClass, factor, year, startYear, endYear, beforeFn){
898
+ var html = '';
899
+ var step = factor / 10;
900
+ var view = this.picker.find(selector);
901
+ var startVal = Math.floor(year / factor) * factor;
902
+ var endVal = startVal + step * 9;
903
+ var focusedVal = Math.floor(this.viewDate.getFullYear() / step) * step;
904
+ var selected = $.map(this.dates, function(d){
905
+ return Math.floor(d.getUTCFullYear() / step) * step;
906
+ });
907
+
908
+ var classes, tooltip, before;
909
+ for (var currVal = startVal - step; currVal <= endVal + step; currVal += step) {
910
+ classes = [cssClass];
911
+ tooltip = null;
912
+
913
+ if (currVal === startVal - step) {
914
+ classes.push('old');
915
+ } else if (currVal === endVal + step) {
916
+ classes.push('new');
917
+ }
918
+ if ($.inArray(currVal, selected) !== -1) {
919
+ classes.push('active');
920
+ }
921
+ if (currVal < startYear || currVal > endYear) {
922
+ classes.push('disabled');
923
+ }
924
+ if (currVal === focusedVal) {
925
+ classes.push('focused');
926
+ }
927
+
928
+ if (beforeFn !== $.noop) {
929
+ before = beforeFn(new Date(currVal, 0, 1));
930
+ if (before === undefined) {
931
+ before = {};
932
+ } else if (typeof before === 'boolean') {
933
+ before = {enabled: before};
934
+ } else if (typeof before === 'string') {
935
+ before = {classes: before};
936
+ }
937
+ if (before.enabled === false) {
938
+ classes.push('disabled');
939
+ }
940
+ if (before.classes) {
941
+ classes = classes.concat(before.classes.split(/\s+/));
942
+ }
943
+ if (before.tooltip) {
944
+ tooltip = before.tooltip;
945
+ }
946
+ }
947
+
948
+ html += '<span class="' + classes.join(' ') + '"' + (tooltip ? ' title="' + tooltip + '"' : '') + '>' + currVal + '</span>';
949
+ }
950
+
951
+ view.find('.datepicker-switch').text(startVal + '-' + endVal);
952
+ view.find('td').html(html);
953
+ },
954
+
955
+ fill: function(){
956
+ var d = new Date(this.viewDate),
957
+ year = d.getUTCFullYear(),
958
+ month = d.getUTCMonth(),
959
+ startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
960
+ startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,
961
+ endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,
962
+ endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,
963
+ todaytxt = dates[this.o.language].today || dates['en'].today || '',
964
+ cleartxt = dates[this.o.language].clear || dates['en'].clear || '',
965
+ titleFormat = dates[this.o.language].titleFormat || dates['en'].titleFormat,
966
+ tooltip,
967
+ before;
968
+ if (isNaN(year) || isNaN(month))
969
+ return;
970
+ this.picker.find('.datepicker-days .datepicker-switch')
971
+ .text(DPGlobal.formatDate(d, titleFormat, this.o.language));
972
+ this.picker.find('tfoot .today')
973
+ .text(todaytxt)
974
+ .css('display', this.o.todayBtn === true || this.o.todayBtn === 'linked' ? 'table-cell' : 'none');
975
+ this.picker.find('tfoot .clear')
976
+ .text(cleartxt)
977
+ .css('display', this.o.clearBtn === true ? 'table-cell' : 'none');
978
+ this.picker.find('thead .datepicker-title')
979
+ .text(this.o.title)
980
+ .css('display', typeof this.o.title === 'string' && this.o.title !== '' ? 'table-cell' : 'none');
981
+ this.updateNavArrows();
982
+ this.fillMonths();
983
+ var prevMonth = UTCDate(year, month, 0),
984
+ day = prevMonth.getUTCDate();
985
+ prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7);
986
+ var nextMonth = new Date(prevMonth);
987
+ if (prevMonth.getUTCFullYear() < 100){
988
+ nextMonth.setUTCFullYear(prevMonth.getUTCFullYear());
989
+ }
990
+ nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
991
+ nextMonth = nextMonth.valueOf();
992
+ var html = [];
993
+ var weekDay, clsName;
994
+ while (prevMonth.valueOf() < nextMonth){
995
+ weekDay = prevMonth.getUTCDay();
996
+ if (weekDay === this.o.weekStart){
997
+ html.push('<tr>');
998
+ if (this.o.calendarWeeks){
999
+ // ISO 8601: First week contains first thursday.
1000
+ // ISO also states week starts on Monday, but we can be more abstract here.
1001
+ var
1002
+ // Start of current week: based on weekstart/current date
1003
+ ws = new Date(+prevMonth + (this.o.weekStart - weekDay - 7) % 7 * 864e5),
1004
+ // Thursday of this week
1005
+ th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),
1006
+ // First Thursday of year, year from thursday
1007
+ yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay()) % 7 * 864e5),
1008
+ // Calendar week: ms between thursdays, div ms per day, div 7 days
1009
+ calWeek = (th - yth) / 864e5 / 7 + 1;
1010
+ html.push('<td class="cw">'+ calWeek +'</td>');
1011
+ }
1012
+ }
1013
+ clsName = this.getClassNames(prevMonth);
1014
+ clsName.push('day');
1015
+
1016
+ var content = prevMonth.getUTCDate();
1017
+
1018
+ if (this.o.beforeShowDay !== $.noop){
1019
+ before = this.o.beforeShowDay(this._utc_to_local(prevMonth));
1020
+ if (before === undefined)
1021
+ before = {};
1022
+ else if (typeof before === 'boolean')
1023
+ before = {enabled: before};
1024
+ else if (typeof before === 'string')
1025
+ before = {classes: before};
1026
+ if (before.enabled === false)
1027
+ clsName.push('disabled');
1028
+ if (before.classes)
1029
+ clsName = clsName.concat(before.classes.split(/\s+/));
1030
+ if (before.tooltip)
1031
+ tooltip = before.tooltip;
1032
+ if (before.content)
1033
+ content = before.content;
1034
+ }
1035
+
1036
+ //Check if uniqueSort exists (supported by jquery >=1.12 and >=2.2)
1037
+ //Fallback to unique function for older jquery versions
1038
+ if ($.isFunction($.uniqueSort)) {
1039
+ clsName = $.uniqueSort(clsName);
1040
+ } else {
1041
+ clsName = $.unique(clsName);
1042
+ }
1043
+
1044
+ html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + ' data-date="' + prevMonth.getTime().toString() + '">' + content + '</td>');
1045
+ tooltip = null;
1046
+ if (weekDay === this.o.weekEnd){
1047
+ html.push('</tr>');
1048
+ }
1049
+ prevMonth.setUTCDate(prevMonth.getUTCDate() + 1);
1050
+ }
1051
+ this.picker.find('.datepicker-days tbody').html(html.join(''));
1052
+
1053
+ var monthsTitle = dates[this.o.language].monthsTitle || dates['en'].monthsTitle || 'Months';
1054
+ var months = this.picker.find('.datepicker-months')
1055
+ .find('.datepicker-switch')
1056
+ .text(this.o.maxViewMode < 2 ? monthsTitle : year)
1057
+ .end()
1058
+ .find('tbody span').removeClass('active');
1059
+
1060
+ $.each(this.dates, function(i, d){
1061
+ if (d.getUTCFullYear() === year)
1062
+ months.eq(d.getUTCMonth()).addClass('active');
1063
+ });
1064
+
1065
+ if (year < startYear || year > endYear){
1066
+ months.addClass('disabled');
1067
+ }
1068
+ if (year === startYear){
1069
+ months.slice(0, startMonth).addClass('disabled');
1070
+ }
1071
+ if (year === endYear){
1072
+ months.slice(endMonth+1).addClass('disabled');
1073
+ }
1074
+
1075
+ if (this.o.beforeShowMonth !== $.noop){
1076
+ var that = this;
1077
+ $.each(months, function(i, month){
1078
+ var moDate = new Date(year, i, 1);
1079
+ var before = that.o.beforeShowMonth(moDate);
1080
+ if (before === undefined)
1081
+ before = {};
1082
+ else if (typeof before === 'boolean')
1083
+ before = {enabled: before};
1084
+ else if (typeof before === 'string')
1085
+ before = {classes: before};
1086
+ if (before.enabled === false && !$(month).hasClass('disabled'))
1087
+ $(month).addClass('disabled');
1088
+ if (before.classes)
1089
+ $(month).addClass(before.classes);
1090
+ if (before.tooltip)
1091
+ $(month).prop('title', before.tooltip);
1092
+ });
1093
+ }
1094
+
1095
+ // Generating decade/years picker
1096
+ this._fill_yearsView(
1097
+ '.datepicker-years',
1098
+ 'year',
1099
+ 10,
1100
+ year,
1101
+ startYear,
1102
+ endYear,
1103
+ this.o.beforeShowYear
1104
+ );
1105
+
1106
+ // Generating century/decades picker
1107
+ this._fill_yearsView(
1108
+ '.datepicker-decades',
1109
+ 'decade',
1110
+ 100,
1111
+ year,
1112
+ startYear,
1113
+ endYear,
1114
+ this.o.beforeShowDecade
1115
+ );
1116
+
1117
+ // Generating millennium/centuries picker
1118
+ this._fill_yearsView(
1119
+ '.datepicker-centuries',
1120
+ 'century',
1121
+ 1000,
1122
+ year,
1123
+ startYear,
1124
+ endYear,
1125
+ this.o.beforeShowCentury
1126
+ );
1127
+ },
1128
+
1129
+ updateNavArrows: function(){
1130
+ if (!this._allow_update)
1131
+ return;
1132
+
1133
+ var d = new Date(this.viewDate),
1134
+ year = d.getUTCFullYear(),
1135
+ month = d.getUTCMonth(),
1136
+ startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
1137
+ startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,
1138
+ endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,
1139
+ endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,
1140
+ prevIsDisabled,
1141
+ nextIsDisabled,
1142
+ factor = 1;
1143
+ switch (this.viewMode){
1144
+ case 0:
1145
+ prevIsDisabled = year <= startYear && month <= startMonth;
1146
+ nextIsDisabled = year >= endYear && month >= endMonth;
1147
+ break;
1148
+ case 4:
1149
+ factor *= 10;
1150
+ /* falls through */
1151
+ case 3:
1152
+ factor *= 10;
1153
+ /* falls through */
1154
+ case 2:
1155
+ factor *= 10;
1156
+ /* falls through */
1157
+ case 1:
1158
+ prevIsDisabled = Math.floor(year / factor) * factor <= startYear;
1159
+ nextIsDisabled = Math.floor(year / factor) * factor + factor >= endYear;
1160
+ break;
1161
+ }
1162
+
1163
+ this.picker.find('.prev').toggleClass('disabled', prevIsDisabled);
1164
+ this.picker.find('.next').toggleClass('disabled', nextIsDisabled);
1165
+ },
1166
+
1167
+ click: function(e){
1168
+ e.preventDefault();
1169
+ e.stopPropagation();
1170
+
1171
+ var target, dir, day, year, month;
1172
+ target = $(e.target);
1173
+
1174
+ // Clicked on the switch
1175
+ if (target.hasClass('datepicker-switch') && this.viewMode !== this.o.maxViewMode){
1176
+ this.setViewMode(this.viewMode + 1);
1177
+ }
1178
+
1179
+ // Clicked on today button
1180
+ if (target.hasClass('today') && !target.hasClass('day')){
1181
+ this.setViewMode(0);
1182
+ this._setDate(UTCToday(), this.o.todayBtn === 'linked' ? null : 'view');
1183
+ }
1184
+
1185
+ // Clicked on clear button
1186
+ if (target.hasClass('clear')){
1187
+ this.clearDates();
1188
+ }
1189
+
1190
+ if (!target.hasClass('disabled')){
1191
+ // Clicked on a month, year, decade, century
1192
+ if (target.hasClass('month')
1193
+ || target.hasClass('year')
1194
+ || target.hasClass('decade')
1195
+ || target.hasClass('century')) {
1196
+ this.viewDate.setUTCDate(1);
1197
+
1198
+ day = 1;
1199
+ if (this.viewMode === 1){
1200
+ month = target.parent().find('span').index(target);
1201
+ year = this.viewDate.getUTCFullYear();
1202
+ this.viewDate.setUTCMonth(month);
1203
+ } else {
1204
+ month = 0;
1205
+ year = Number(target.text());
1206
+ this.viewDate.setUTCFullYear(year);
1207
+ }
1208
+
1209
+ this._trigger(DPGlobal.viewModes[this.viewMode - 1].e, this.viewDate);
1210
+
1211
+ if (this.viewMode === this.o.minViewMode){
1212
+ this._setDate(UTCDate(year, month, day));
1213
+ } else {
1214
+ this.setViewMode(this.viewMode - 1);
1215
+ this.fill();
1216
+ }
1217
+ }
1218
+ }
1219
+
1220
+ if (this.picker.is(':visible') && this._focused_from){
1221
+ this._focused_from.focus();
1222
+ }
1223
+ delete this._focused_from;
1224
+ },
1225
+
1226
+ dayCellClick: function(e){
1227
+ var $target = $(e.currentTarget);
1228
+ var timestamp = $target.data('date');
1229
+ var date = new Date(timestamp);
1230
+
1231
+ if (this.o.updateViewDate) {
1232
+ if (date.getUTCFullYear() !== this.viewDate.getUTCFullYear()) {
1233
+ this._trigger('changeYear', this.viewDate);
1234
+ }
1235
+
1236
+ if (date.getUTCMonth() !== this.viewDate.getUTCMonth()) {
1237
+ this._trigger('changeMonth', this.viewDate);
1238
+ }
1239
+ }
1240
+ this._setDate(date);
1241
+ },
1242
+
1243
+ // Clicked on prev or next
1244
+ navArrowsClick: function(e){
1245
+ var $target = $(e.currentTarget);
1246
+ var dir = $target.hasClass('prev') ? -1 : 1;
1247
+ if (this.viewMode !== 0){
1248
+ dir *= DPGlobal.viewModes[this.viewMode].navStep * 12;
1249
+ }
1250
+ this.viewDate = this.moveMonth(this.viewDate, dir);
1251
+ this._trigger(DPGlobal.viewModes[this.viewMode].e, this.viewDate);
1252
+ this.fill();
1253
+ },
1254
+
1255
+ _toggle_multidate: function(date){
1256
+ var ix = this.dates.contains(date);
1257
+ if (!date){
1258
+ this.dates.clear();
1259
+ }
1260
+
1261
+ if (ix !== -1){
1262
+ if (this.o.multidate === true || this.o.multidate > 1 || this.o.toggleActive){
1263
+ this.dates.remove(ix);
1264
+ }
1265
+ } else if (this.o.multidate === false) {
1266
+ this.dates.clear();
1267
+ this.dates.push(date);
1268
+ }
1269
+ else {
1270
+ this.dates.push(date);
1271
+ }
1272
+
1273
+ if (typeof this.o.multidate === 'number')
1274
+ while (this.dates.length > this.o.multidate)
1275
+ this.dates.remove(0);
1276
+ },
1277
+
1278
+ _setDate: function(date, which){
1279
+ if (!which || which === 'date')
1280
+ this._toggle_multidate(date && new Date(date));
1281
+ if ((!which && this.o.updateViewDate) || which === 'view')
1282
+ this.viewDate = date && new Date(date);
1283
+
1284
+ this.fill();
1285
+ this.setValue();
1286
+ if (!which || which !== 'view') {
1287
+ this._trigger('changeDate');
1288
+ }
1289
+ this.inputField.trigger('change');
1290
+ if (this.o.autoclose && (!which || which === 'date')){
1291
+ this.hide();
1292
+ }
1293
+ },
1294
+
1295
+ moveDay: function(date, dir){
1296
+ var newDate = new Date(date);
1297
+ newDate.setUTCDate(date.getUTCDate() + dir);
1298
+
1299
+ return newDate;
1300
+ },
1301
+
1302
+ moveWeek: function(date, dir){
1303
+ return this.moveDay(date, dir * 7);
1304
+ },
1305
+
1306
+ moveMonth: function(date, dir){
1307
+ if (!isValidDate(date))
1308
+ return this.o.defaultViewDate;
1309
+ if (!dir)
1310
+ return date;
1311
+ var new_date = new Date(date.valueOf()),
1312
+ day = new_date.getUTCDate(),
1313
+ month = new_date.getUTCMonth(),
1314
+ mag = Math.abs(dir),
1315
+ new_month, test;
1316
+ dir = dir > 0 ? 1 : -1;
1317
+ if (mag === 1){
1318
+ test = dir === -1
1319
+ // If going back one month, make sure month is not current month
1320
+ // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)
1321
+ ? function(){
1322
+ return new_date.getUTCMonth() === month;
1323
+ }
1324
+ // If going forward one month, make sure month is as expected
1325
+ // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)
1326
+ : function(){
1327
+ return new_date.getUTCMonth() !== new_month;
1328
+ };
1329
+ new_month = month + dir;
1330
+ new_date.setUTCMonth(new_month);
1331
+ // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11
1332
+ new_month = (new_month + 12) % 12;
1333
+ }
1334
+ else {
1335
+ // For magnitudes >1, move one month at a time...
1336
+ for (var i=0; i < mag; i++)
1337
+ // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...
1338
+ new_date = this.moveMonth(new_date, dir);
1339
+ // ...then reset the day, keeping it in the new month
1340
+ new_month = new_date.getUTCMonth();
1341
+ new_date.setUTCDate(day);
1342
+ test = function(){
1343
+ return new_month !== new_date.getUTCMonth();
1344
+ };
1345
+ }
1346
+ // Common date-resetting loop -- if date is beyond end of month, make it
1347
+ // end of month
1348
+ while (test()){
1349
+ new_date.setUTCDate(--day);
1350
+ new_date.setUTCMonth(new_month);
1351
+ }
1352
+ return new_date;
1353
+ },
1354
+
1355
+ moveYear: function(date, dir){
1356
+ return this.moveMonth(date, dir*12);
1357
+ },
1358
+
1359
+ moveAvailableDate: function(date, dir, fn){
1360
+ do {
1361
+ date = this[fn](date, dir);
1362
+
1363
+ if (!this.dateWithinRange(date))
1364
+ return false;
1365
+
1366
+ fn = 'moveDay';
1367
+ }
1368
+ while (this.dateIsDisabled(date));
1369
+
1370
+ return date;
1371
+ },
1372
+
1373
+ weekOfDateIsDisabled: function(date){
1374
+ return $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1;
1375
+ },
1376
+
1377
+ dateIsDisabled: function(date){
1378
+ return (
1379
+ this.weekOfDateIsDisabled(date) ||
1380
+ $.grep(this.o.datesDisabled, function(d){
1381
+ return isUTCEquals(date, d);
1382
+ }).length > 0
1383
+ );
1384
+ },
1385
+
1386
+ dateWithinRange: function(date){
1387
+ return date >= this.o.startDate && date <= this.o.endDate;
1388
+ },
1389
+
1390
+ keydown: function(e){
1391
+ if (!this.picker.is(':visible')){
1392
+ if (e.keyCode === 40 || e.keyCode === 27) { // allow down to re-show picker
1393
+ this.show();
1394
+ e.stopPropagation();
1395
+ }
1396
+ return;
1397
+ }
1398
+ var dateChanged = false,
1399
+ dir, newViewDate,
1400
+ focusDate = this.focusDate || this.viewDate;
1401
+ switch (e.keyCode){
1402
+ case 27: // escape
1403
+ if (this.focusDate){
1404
+ this.focusDate = null;
1405
+ this.viewDate = this.dates.get(-1) || this.viewDate;
1406
+ this.fill();
1407
+ }
1408
+ else
1409
+ this.hide();
1410
+ e.preventDefault();
1411
+ e.stopPropagation();
1412
+ break;
1413
+ case 37: // left
1414
+ case 38: // up
1415
+ case 39: // right
1416
+ case 40: // down
1417
+ if (!this.o.keyboardNavigation || this.o.daysOfWeekDisabled.length === 7)
1418
+ break;
1419
+ dir = e.keyCode === 37 || e.keyCode === 38 ? -1 : 1;
1420
+ if (this.viewMode === 0) {
1421
+ if (e.ctrlKey){
1422
+ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear');
1423
+
1424
+ if (newViewDate)
1425
+ this._trigger('changeYear', this.viewDate);
1426
+ } else if (e.shiftKey){
1427
+ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth');
1428
+
1429
+ if (newViewDate)
1430
+ this._trigger('changeMonth', this.viewDate);
1431
+ } else if (e.keyCode === 37 || e.keyCode === 39){
1432
+ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveDay');
1433
+ } else if (!this.weekOfDateIsDisabled(focusDate)){
1434
+ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveWeek');
1435
+ }
1436
+ } else if (this.viewMode === 1) {
1437
+ if (e.keyCode === 38 || e.keyCode === 40) {
1438
+ dir = dir * 4;
1439
+ }
1440
+ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth');
1441
+ } else if (this.viewMode === 2) {
1442
+ if (e.keyCode === 38 || e.keyCode === 40) {
1443
+ dir = dir * 4;
1444
+ }
1445
+ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear');
1446
+ }
1447
+ if (newViewDate){
1448
+ this.focusDate = this.viewDate = newViewDate;
1449
+ this.setValue();
1450
+ this.fill();
1451
+ e.preventDefault();
1452
+ }
1453
+ break;
1454
+ case 13: // enter
1455
+ if (!this.o.forceParse)
1456
+ break;
1457
+ focusDate = this.focusDate || this.dates.get(-1) || this.viewDate;
1458
+ if (this.o.keyboardNavigation) {
1459
+ this._toggle_multidate(focusDate);
1460
+ dateChanged = true;
1461
+ }
1462
+ this.focusDate = null;
1463
+ this.viewDate = this.dates.get(-1) || this.viewDate;
1464
+ this.setValue();
1465
+ this.fill();
1466
+ if (this.picker.is(':visible')){
1467
+ e.preventDefault();
1468
+ e.stopPropagation();
1469
+ if (this.o.autoclose)
1470
+ this.hide();
1471
+ }
1472
+ break;
1473
+ case 9: // tab
1474
+ this.focusDate = null;
1475
+ this.viewDate = this.dates.get(-1) || this.viewDate;
1476
+ this.fill();
1477
+ this.hide();
1478
+ break;
1479
+ }
1480
+ if (dateChanged){
1481
+ if (this.dates.length)
1482
+ this._trigger('changeDate');
1483
+ else
1484
+ this._trigger('clearDate');
1485
+ this.inputField.trigger('change');
1486
+ }
1487
+ },
1488
+
1489
+ setViewMode: function(viewMode){
1490
+ this.viewMode = viewMode;
1491
+ this.picker
1492
+ .children('div')
1493
+ .hide()
1494
+ .filter('.datepicker-' + DPGlobal.viewModes[this.viewMode].clsName)
1495
+ .show();
1496
+ this.updateNavArrows();
1497
+ this._trigger('changeViewMode', new Date(this.viewDate));
1498
+ }
1499
+ };
1500
+
1501
+ var DateRangePicker = function(element, options){
1502
+ $.data(element, 'datepicker', this);
1503
+ this.element = $(element);
1504
+ this.inputs = $.map(options.inputs, function(i){
1505
+ return i.jquery ? i[0] : i;
1506
+ });
1507
+ delete options.inputs;
1508
+
1509
+ this.keepEmptyValues = options.keepEmptyValues;
1510
+ delete options.keepEmptyValues;
1511
+
1512
+ datepickerPlugin.call($(this.inputs), options)
1513
+ .on('changeDate', $.proxy(this.dateUpdated, this));
1514
+
1515
+ this.pickers = $.map(this.inputs, function(i){
1516
+ return $.data(i, 'datepicker');
1517
+ });
1518
+ this.updateDates();
1519
+ };
1520
+ DateRangePicker.prototype = {
1521
+ updateDates: function(){
1522
+ this.dates = $.map(this.pickers, function(i){
1523
+ return i.getUTCDate();
1524
+ });
1525
+ this.updateRanges();
1526
+ },
1527
+ updateRanges: function(){
1528
+ var range = $.map(this.dates, function(d){
1529
+ return d.valueOf();
1530
+ });
1531
+ $.each(this.pickers, function(i, p){
1532
+ p.setRange(range);
1533
+ });
1534
+ },
1535
+ dateUpdated: function(e){
1536
+ // `this.updating` is a workaround for preventing infinite recursion
1537
+ // between `changeDate` triggering and `setUTCDate` calling. Until
1538
+ // there is a better mechanism.
1539
+ if (this.updating)
1540
+ return;
1541
+ this.updating = true;
1542
+
1543
+ var dp = $.data(e.target, 'datepicker');
1544
+
1545
+ if (dp === undefined) {
1546
+ return;
1547
+ }
1548
+
1549
+ var new_date = dp.getUTCDate(),
1550
+ keep_empty_values = this.keepEmptyValues,
1551
+ i = $.inArray(e.target, this.inputs),
1552
+ j = i - 1,
1553
+ k = i + 1,
1554
+ l = this.inputs.length;
1555
+ if (i === -1)
1556
+ return;
1557
+
1558
+ $.each(this.pickers, function(i, p){
1559
+ if (!p.getUTCDate() && (p === dp || !keep_empty_values))
1560
+ p.setUTCDate(new_date);
1561
+ });
1562
+
1563
+ if (new_date < this.dates[j]){
1564
+ // Date being moved earlier/left
1565
+ while (j >= 0 && new_date < this.dates[j]){
1566
+ this.pickers[j--].setUTCDate(new_date);
1567
+ }
1568
+ } else if (new_date > this.dates[k]){
1569
+ // Date being moved later/right
1570
+ while (k < l && new_date > this.dates[k]){
1571
+ this.pickers[k++].setUTCDate(new_date);
1572
+ }
1573
+ }
1574
+ this.updateDates();
1575
+
1576
+ delete this.updating;
1577
+ },
1578
+ destroy: function(){
1579
+ $.map(this.pickers, function(p){ p.destroy(); });
1580
+ $(this.inputs).off('changeDate', this.dateUpdated);
1581
+ delete this.element.data().datepicker;
1582
+ },
1583
+ remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead')
1584
+ };
1585
+
1586
+ function opts_from_el(el, prefix){
1587
+ // Derive options from element data-attrs
1588
+ var data = $(el).data(),
1589
+ out = {}, inkey,
1590
+ replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])');
1591
+ prefix = new RegExp('^' + prefix.toLowerCase());
1592
+ function re_lower(_,a){
1593
+ return a.toLowerCase();
1594
+ }
1595
+ for (var key in data)
1596
+ if (prefix.test(key)){
1597
+ inkey = key.replace(replace, re_lower);
1598
+ out[inkey] = data[key];
1599
+ }
1600
+ return out;
1601
+ }
1602
+
1603
+ function opts_from_locale(lang){
1604
+ // Derive options from locale plugins
1605
+ var out = {};
1606
+ // Check if "de-DE" style date is available, if not language should
1607
+ // fallback to 2 letter code eg "de"
1608
+ if (!dates[lang]){
1609
+ lang = lang.split('-')[0];
1610
+ if (!dates[lang])
1611
+ return;
1612
+ }
1613
+ var d = dates[lang];
1614
+ $.each(locale_opts, function(i,k){
1615
+ if (k in d)
1616
+ out[k] = d[k];
1617
+ });
1618
+ return out;
1619
+ }
1620
+
1621
+ var old = $.fn.datepicker;
1622
+ var datepickerPlugin = function(option){
1623
+ var args = Array.apply(null, arguments);
1624
+ args.shift();
1625
+ var internal_return;
1626
+ this.each(function(){
1627
+ var $this = $(this),
1628
+ data = $this.data('datepicker'),
1629
+ options = typeof option === 'object' && option;
1630
+ if (!data){
1631
+ var elopts = opts_from_el(this, 'date'),
1632
+ // Preliminary otions
1633
+ xopts = $.extend({}, defaults, elopts, options),
1634
+ locopts = opts_from_locale(xopts.language),
1635
+ // Options priority: js args, data-attrs, locales, defaults
1636
+ opts = $.extend({}, defaults, locopts, elopts, options);
1637
+ if ($this.hasClass('input-daterange') || opts.inputs){
1638
+ $.extend(opts, {
1639
+ inputs: opts.inputs || $this.find('input').toArray()
1640
+ });
1641
+ data = new DateRangePicker(this, opts);
1642
+ }
1643
+ else {
1644
+ data = new Datepicker(this, opts);
1645
+ }
1646
+ $this.data('datepicker', data);
1647
+ }
1648
+ if (typeof option === 'string' && typeof data[option] === 'function'){
1649
+ internal_return = data[option].apply(data, args);
1650
+ }
1651
+ });
1652
+
1653
+ if (
1654
+ internal_return === undefined ||
1655
+ internal_return instanceof Datepicker ||
1656
+ internal_return instanceof DateRangePicker
1657
+ )
1658
+ return this;
1659
+
1660
+ if (this.length > 1)
1661
+ throw new Error('Using only allowed for the collection of a single element (' + option + ' function)');
1662
+ else
1663
+ return internal_return;
1664
+ };
1665
+ $.fn.datepicker = datepickerPlugin;
1666
+
1667
+ var defaults = $.fn.datepicker.defaults = {
1668
+ assumeNearbyYear: false,
1669
+ autoclose: false,
1670
+ beforeShowDay: $.noop,
1671
+ beforeShowMonth: $.noop,
1672
+ beforeShowYear: $.noop,
1673
+ beforeShowDecade: $.noop,
1674
+ beforeShowCentury: $.noop,
1675
+ calendarWeeks: false,
1676
+ clearBtn: false,
1677
+ toggleActive: false,
1678
+ daysOfWeekDisabled: [],
1679
+ daysOfWeekHighlighted: [],
1680
+ datesDisabled: [],
1681
+ endDate: Infinity,
1682
+ forceParse: true,
1683
+ format: 'mm/dd/yyyy',
1684
+ keepEmptyValues: false,
1685
+ keyboardNavigation: true,
1686
+ language: 'en',
1687
+ minViewMode: 0,
1688
+ maxViewMode: 4,
1689
+ multidate: false,
1690
+ multidateSeparator: ',',
1691
+ orientation: "auto",
1692
+ rtl: false,
1693
+ startDate: -Infinity,
1694
+ startView: 0,
1695
+ todayBtn: false,
1696
+ todayHighlight: false,
1697
+ updateViewDate: true,
1698
+ weekStart: 0,
1699
+ disableTouchKeyboard: false,
1700
+ enableOnReadonly: true,
1701
+ showOnFocus: true,
1702
+ zIndexOffset: 10,
1703
+ container: 'body',
1704
+ immediateUpdates: false,
1705
+ title: '',
1706
+ templates: {
1707
+ leftArrow: '&#x00AB;',
1708
+ rightArrow: '&#x00BB;'
1709
+ },
1710
+ showWeekDays: true
1711
+ };
1712
+ var locale_opts = $.fn.datepicker.locale_opts = [
1713
+ 'format',
1714
+ 'rtl',
1715
+ 'weekStart'
1716
+ ];
1717
+ $.fn.datepicker.Constructor = Datepicker;
1718
+ var dates = $.fn.datepicker.dates = {
1719
+ en: {
1720
+ days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
1721
+ daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1722
+ daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
1723
+ months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
1724
+ monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
1725
+ today: "Today",
1726
+ clear: "Clear",
1727
+ titleFormat: "MM yyyy"
1728
+ }
1729
+ };
1730
+
1731
+ var DPGlobal = {
1732
+ viewModes: [
1733
+ {
1734
+ names: ['days', 'month'],
1735
+ clsName: 'days',
1736
+ e: 'changeMonth'
1737
+ },
1738
+ {
1739
+ names: ['months', 'year'],
1740
+ clsName: 'months',
1741
+ e: 'changeYear',
1742
+ navStep: 1
1743
+ },
1744
+ {
1745
+ names: ['years', 'decade'],
1746
+ clsName: 'years',
1747
+ e: 'changeDecade',
1748
+ navStep: 10
1749
+ },
1750
+ {
1751
+ names: ['decades', 'century'],
1752
+ clsName: 'decades',
1753
+ e: 'changeCentury',
1754
+ navStep: 100
1755
+ },
1756
+ {
1757
+ names: ['centuries', 'millennium'],
1758
+ clsName: 'centuries',
1759
+ e: 'changeMillennium',
1760
+ navStep: 1000
1761
+ }
1762
+ ],
1763
+ validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
1764
+ nonpunctuation: /[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,
1765
+ parseFormat: function(format){
1766
+ if (typeof format.toValue === 'function' && typeof format.toDisplay === 'function')
1767
+ return format;
1768
+ // IE treats \0 as a string end in inputs (truncating the value),
1769
+ // so it's a bad format delimiter, anyway
1770
+ var separators = format.replace(this.validParts, '\0').split('\0'),
1771
+ parts = format.match(this.validParts);
1772
+ if (!separators || !separators.length || !parts || parts.length === 0){
1773
+ throw new Error("Invalid date format.");
1774
+ }
1775
+ return {separators: separators, parts: parts};
1776
+ },
1777
+ parseDate: function(date, format, language, assumeNearby){
1778
+ if (!date)
1779
+ return undefined;
1780
+ if (date instanceof Date)
1781
+ return date;
1782
+ if (typeof format === 'string')
1783
+ format = DPGlobal.parseFormat(format);
1784
+ if (format.toValue)
1785
+ return format.toValue(date, format, language);
1786
+ var fn_map = {
1787
+ d: 'moveDay',
1788
+ m: 'moveMonth',
1789
+ w: 'moveWeek',
1790
+ y: 'moveYear'
1791
+ },
1792
+ dateAliases = {
1793
+ yesterday: '-1d',
1794
+ today: '+0d',
1795
+ tomorrow: '+1d'
1796
+ },
1797
+ parts, part, dir, i, fn;
1798
+ if (date in dateAliases){
1799
+ date = dateAliases[date];
1800
+ }
1801
+ if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(date)){
1802
+ parts = date.match(/([\-+]\d+)([dmwy])/gi);
1803
+ date = new Date();
1804
+ for (i=0; i < parts.length; i++){
1805
+ part = parts[i].match(/([\-+]\d+)([dmwy])/i);
1806
+ dir = Number(part[1]);
1807
+ fn = fn_map[part[2].toLowerCase()];
1808
+ date = Datepicker.prototype[fn](date, dir);
1809
+ }
1810
+ return Datepicker.prototype._zero_utc_time(date);
1811
+ }
1812
+
1813
+ parts = date && date.match(this.nonpunctuation) || [];
1814
+
1815
+ function applyNearbyYear(year, threshold){
1816
+ if (threshold === true)
1817
+ threshold = 10;
1818
+
1819
+ // if year is 2 digits or less, than the user most likely is trying to get a recent century
1820
+ if (year < 100){
1821
+ year += 2000;
1822
+ // if the new year is more than threshold years in advance, use last century
1823
+ if (year > ((new Date()).getFullYear()+threshold)){
1824
+ year -= 100;
1825
+ }
1826
+ }
1827
+
1828
+ return year;
1829
+ }
1830
+
1831
+ var parsed = {},
1832
+ setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],
1833
+ setters_map = {
1834
+ yyyy: function(d,v){
1835
+ return d.setUTCFullYear(assumeNearby ? applyNearbyYear(v, assumeNearby) : v);
1836
+ },
1837
+ m: function(d,v){
1838
+ if (isNaN(d))
1839
+ return d;
1840
+ v -= 1;
1841
+ while (v < 0) v += 12;
1842
+ v %= 12;
1843
+ d.setUTCMonth(v);
1844
+ while (d.getUTCMonth() !== v)
1845
+ d.setUTCDate(d.getUTCDate()-1);
1846
+ return d;
1847
+ },
1848
+ d: function(d,v){
1849
+ return d.setUTCDate(v);
1850
+ }
1851
+ },
1852
+ val, filtered;
1853
+ setters_map['yy'] = setters_map['yyyy'];
1854
+ setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];
1855
+ setters_map['dd'] = setters_map['d'];
1856
+ date = UTCToday();
1857
+ var fparts = format.parts.slice();
1858
+ // Remove noop parts
1859
+ if (parts.length !== fparts.length){
1860
+ fparts = $(fparts).filter(function(i,p){
1861
+ return $.inArray(p, setters_order) !== -1;
1862
+ }).toArray();
1863
+ }
1864
+ // Process remainder
1865
+ function match_part(){
1866
+ var m = this.slice(0, parts[i].length),
1867
+ p = parts[i].slice(0, m.length);
1868
+ return m.toLowerCase() === p.toLowerCase();
1869
+ }
1870
+ if (parts.length === fparts.length){
1871
+ var cnt;
1872
+ for (i=0, cnt = fparts.length; i < cnt; i++){
1873
+ val = parseInt(parts[i], 10);
1874
+ part = fparts[i];
1875
+ if (isNaN(val)){
1876
+ switch (part){
1877
+ case 'MM':
1878
+ filtered = $(dates[language].months).filter(match_part);
1879
+ val = $.inArray(filtered[0], dates[language].months) + 1;
1880
+ break;
1881
+ case 'M':
1882
+ filtered = $(dates[language].monthsShort).filter(match_part);
1883
+ val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
1884
+ break;
1885
+ }
1886
+ }
1887
+ parsed[part] = val;
1888
+ }
1889
+ var _date, s;
1890
+ for (i=0; i < setters_order.length; i++){
1891
+ s = setters_order[i];
1892
+ if (s in parsed && !isNaN(parsed[s])){
1893
+ _date = new Date(date);
1894
+ setters_map[s](_date, parsed[s]);
1895
+ if (!isNaN(_date))
1896
+ date = _date;
1897
+ }
1898
+ }
1899
+ }
1900
+ return date;
1901
+ },
1902
+ formatDate: function(date, format, language){
1903
+ if (!date)
1904
+ return '';
1905
+ if (typeof format === 'string')
1906
+ format = DPGlobal.parseFormat(format);
1907
+ if (format.toDisplay)
1908
+ return format.toDisplay(date, format, language);
1909
+ var val = {
1910
+ d: date.getUTCDate(),
1911
+ D: dates[language].daysShort[date.getUTCDay()],
1912
+ DD: dates[language].days[date.getUTCDay()],
1913
+ m: date.getUTCMonth() + 1,
1914
+ M: dates[language].monthsShort[date.getUTCMonth()],
1915
+ MM: dates[language].months[date.getUTCMonth()],
1916
+ yy: date.getUTCFullYear().toString().substring(2),
1917
+ yyyy: date.getUTCFullYear()
1918
+ };
1919
+ val.dd = (val.d < 10 ? '0' : '') + val.d;
1920
+ val.mm = (val.m < 10 ? '0' : '') + val.m;
1921
+ date = [];
1922
+ var seps = $.extend([], format.separators);
1923
+ for (var i=0, cnt = format.parts.length; i <= cnt; i++){
1924
+ if (seps.length)
1925
+ date.push(seps.shift());
1926
+ date.push(val[format.parts[i]]);
1927
+ }
1928
+ return date.join('');
1929
+ },
1930
+ headTemplate: '<thead>'+
1931
+ '<tr>'+
1932
+ '<th colspan="7" class="datepicker-title"></th>'+
1933
+ '</tr>'+
1934
+ '<tr>'+
1935
+ '<th class="prev">'+defaults.templates.leftArrow+'</th>'+
1936
+ '<th colspan="5" class="datepicker-switch"></th>'+
1937
+ '<th class="next">'+defaults.templates.rightArrow+'</th>'+
1938
+ '</tr>'+
1939
+ '</thead>',
1940
+ contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
1941
+ footTemplate: '<tfoot>'+
1942
+ '<tr>'+
1943
+ '<th colspan="7" class="today"></th>'+
1944
+ '</tr>'+
1945
+ '<tr>'+
1946
+ '<th colspan="7" class="clear"></th>'+
1947
+ '</tr>'+
1948
+ '</tfoot>'
1949
+ };
1950
+ DPGlobal.template = '<div class="datepicker">'+
1951
+ '<div class="datepicker-days">'+
1952
+ '<table class="table-condensed">'+
1953
+ DPGlobal.headTemplate+
1954
+ '<tbody></tbody>'+
1955
+ DPGlobal.footTemplate+
1956
+ '</table>'+
1957
+ '</div>'+
1958
+ '<div class="datepicker-months">'+
1959
+ '<table class="table-condensed">'+
1960
+ DPGlobal.headTemplate+
1961
+ DPGlobal.contTemplate+
1962
+ DPGlobal.footTemplate+
1963
+ '</table>'+
1964
+ '</div>'+
1965
+ '<div class="datepicker-years">'+
1966
+ '<table class="table-condensed">'+
1967
+ DPGlobal.headTemplate+
1968
+ DPGlobal.contTemplate+
1969
+ DPGlobal.footTemplate+
1970
+ '</table>'+
1971
+ '</div>'+
1972
+ '<div class="datepicker-decades">'+
1973
+ '<table class="table-condensed">'+
1974
+ DPGlobal.headTemplate+
1975
+ DPGlobal.contTemplate+
1976
+ DPGlobal.footTemplate+
1977
+ '</table>'+
1978
+ '</div>'+
1979
+ '<div class="datepicker-centuries">'+
1980
+ '<table class="table-condensed">'+
1981
+ DPGlobal.headTemplate+
1982
+ DPGlobal.contTemplate+
1983
+ DPGlobal.footTemplate+
1984
+ '</table>'+
1985
+ '</div>'+
1986
+ '</div>';
1987
+
1988
+ $.fn.datepicker.DPGlobal = DPGlobal;
1989
+
1990
+
1991
+ /* DATEPICKER NO CONFLICT
1992
+ * =================== */
1993
+
1994
+ $.fn.datepicker.noConflict = function(){
1995
+ $.fn.datepicker = old;
1996
+ return this;
1997
+ };
1998
+
1999
+ /* DATEPICKER VERSION
2000
+ * =================== */
2001
+ $.fn.datepicker.version = '1.7.1';
2002
+
2003
+ $.fn.datepicker.deprecated = function(msg){
2004
+ var console = window.console;
2005
+ if (console && console.warn) {
2006
+ console.warn('DEPRECATED: ' + msg);
2007
+ }
2008
+ };
2009
+
2010
+
2011
+ /* DATEPICKER DATA-API
2012
+ * ================== */
2013
+
2014
+ $(document).on(
2015
+ 'focus.datepicker.data-api click.datepicker.data-api',
2016
+ '[data-provide="datepicker"]',
2017
+ function(e){
2018
+ var $this = $(this);
2019
+ if ($this.data('datepicker'))
2020
+ return;
2021
+ e.preventDefault();
2022
+ // component click requires us to explicitly show it
2023
+ datepickerPlugin.call($this, 'show');
2024
+ }
2025
+ );
2026
+ $(function(){
2027
+ datepickerPlugin.call($('[data-provide="datepicker-inline"]'));
2028
+ });
2029
+
2030
+ }));