compass-jquery-plugin 0.3.2.8 → 0.3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (542) hide show
  1. data/README.md +24 -6
  2. data/VERSION.yml +3 -3
  3. data/lib/jquery/gridify/grid_column.rb +6 -6
  4. data/lib/jquery/gridify/grid_options.rb +4 -4
  5. data/lib/jquery/mark_it_up.rb +2 -0
  6. data/lib/jquery/mobile.rb +0 -1
  7. data/templates/dynatree/jquery.dynatree.js +2896 -2880
  8. data/templates/dynatree/jquery.dynatree.min.js +55 -54
  9. data/templates/dynatree/jquery/dynatree/aero.scss +4 -2
  10. data/templates/dynatree/jquery/dynatree/aqua.scss +4 -2
  11. data/templates/dynatree/jquery/dynatree/crystal.scss +4 -2
  12. data/templates/dynatree/jquery/dynatree/xp.scss +5 -3
  13. data/templates/emulators/emulators/bb.playbook.landscape.png +0 -0
  14. data/templates/emulators/emulators/bb.playbook.landscape.scss +18 -0
  15. data/templates/emulators/emulators/bb.playbook.portrait.png +0 -0
  16. data/templates/emulators/emulators/bb.playbook.portrait.scss +18 -0
  17. data/templates/emulators/emulators/{blackberry.torch.landscape.png → bb.torch.landscape.png} +0 -0
  18. data/templates/emulators/emulators/{blackberry.torch.landscape.scss → bb.torch.landscape.scss} +1 -3
  19. data/templates/emulators/emulators/{blackberry.torch.portrait.png → bb.torch.portrait.png} +0 -0
  20. data/templates/emulators/emulators/{blackberry.torch.portrait.scss → bb.torch.portrait.scss} +1 -3
  21. data/templates/emulators/emulators/galaxy.ace.landscape.png +0 -0
  22. data/templates/emulators/emulators/galaxy.ace.landscape.scss +18 -0
  23. data/templates/emulators/emulators/galaxy.ace.portrait.png +0 -0
  24. data/templates/emulators/emulators/galaxy.ace.portrait.scss +18 -0
  25. data/templates/emulators/emulators/galaxy.s.landscape.scss +0 -2
  26. data/templates/emulators/emulators/galaxy.s.portrait.scss +0 -2
  27. data/templates/emulators/emulators/galaxy.s2.landscape.scss +0 -2
  28. data/templates/emulators/emulators/galaxy.s2.portrait.scss +0 -2
  29. data/templates/emulators/emulators/galaxy.tab.10.1.landscape.scss +0 -2
  30. data/templates/emulators/emulators/galaxy.tab.10.1.portrait.scss +0 -2
  31. data/templates/emulators/emulators/galaxy.tab.7.landscape.scss +0 -2
  32. data/templates/emulators/emulators/galaxy.tab.7.portrait.scss +0 -2
  33. data/templates/emulators/emulators/galaxy.tab.8.9.landscape.scss +0 -2
  34. data/templates/emulators/emulators/galaxy.tab.8.9.portrait.scss +0 -2
  35. data/templates/emulators/emulators/htc.sensation.landscape.png +0 -0
  36. data/templates/emulators/emulators/htc.sensation.landscape.scss +18 -0
  37. data/templates/emulators/emulators/htc.sensation.portrait.png +0 -0
  38. data/templates/emulators/emulators/htc.sensation.portrait.scss +18 -0
  39. data/templates/emulators/emulators/ipad.landscape.scss +0 -2
  40. data/templates/emulators/emulators/ipad.portrait.scss +0 -2
  41. data/templates/emulators/emulators/iphone.3.landscape.scss +0 -2
  42. data/templates/emulators/emulators/iphone.3.portrait.scss +0 -2
  43. data/templates/emulators/emulators/{iphone.4.landscape .scss → iphone.4.landscape.scss} +0 -2
  44. data/templates/emulators/emulators/iphone.4.portrait.scss +0 -2
  45. data/templates/emulators/emulators/palm.pre.2.landscape.scss +0 -2
  46. data/templates/emulators/emulators/palm.pre.2.portrait.scss +0 -2
  47. data/templates/emulators/manifest.rb +17 -5
  48. data/templates/graphics/highcharts/dark-blue.js +159 -159
  49. data/templates/graphics/highcharts/dark-green.js +159 -159
  50. data/templates/graphics/highcharts/gray.js +154 -154
  51. data/templates/graphics/highcharts/grid.js +84 -84
  52. data/templates/graphics/highcharts/highslide-config.js +2 -2
  53. data/templates/graphics/highcharts/highslide-full.js +3310 -3310
  54. data/templates/graphics/highcharts/skies.js +72 -72
  55. data/templates/graphics/jquery.ganttView.js +1550 -1550
  56. data/templates/graphics/jquery.highcharts.js +11277 -11285
  57. data/templates/graphics/jquery.sparkline.js +1072 -1072
  58. data/templates/ical/jquery.ical.js +7637 -7637
  59. data/templates/ical/jquery/ical.print.scss +3 -3
  60. data/templates/jqgrid/i18n/jqgrid/locale-ar.js +127 -127
  61. data/templates/jqgrid/i18n/jqgrid/locale-bg.js +131 -131
  62. data/templates/jqgrid/i18n/jqgrid/locale-bg1251.js +131 -131
  63. data/templates/jqgrid/i18n/jqgrid/locale-cat.js +128 -128
  64. data/templates/jqgrid/i18n/jqgrid/locale-cn.js +132 -132
  65. data/templates/jqgrid/i18n/jqgrid/locale-cs.js +129 -129
  66. data/templates/jqgrid/i18n/jqgrid/locale-da.js +128 -128
  67. data/templates/jqgrid/i18n/jqgrid/locale-de.js +134 -134
  68. data/templates/jqgrid/i18n/jqgrid/locale-el.js +127 -127
  69. data/templates/jqgrid/i18n/jqgrid/locale-en.js +128 -128
  70. data/templates/jqgrid/i18n/jqgrid/locale-es.js +129 -129
  71. data/templates/jqgrid/i18n/jqgrid/locale-fa.js +141 -141
  72. data/templates/jqgrid/i18n/jqgrid/locale-fi.js +128 -128
  73. data/templates/jqgrid/i18n/jqgrid/locale-fr.js +127 -127
  74. data/templates/jqgrid/i18n/jqgrid/locale-gl.js +127 -127
  75. data/templates/jqgrid/i18n/jqgrid/locale-he.js +128 -128
  76. data/templates/jqgrid/i18n/jqgrid/locale-hu.js +128 -128
  77. data/templates/jqgrid/i18n/jqgrid/locale-is.js +127 -127
  78. data/templates/jqgrid/i18n/jqgrid/locale-it.js +6 -6
  79. data/templates/jqgrid/i18n/jqgrid/locale-ja.js +153 -153
  80. data/templates/jqgrid/i18n/jqgrid/locale-lt.js +128 -128
  81. data/templates/jqgrid/i18n/jqgrid/locale-mne.js +134 -0
  82. data/templates/jqgrid/i18n/jqgrid/locale-mne.min.js +7 -0
  83. data/templates/jqgrid/i18n/jqgrid/locale-nl.js +145 -145
  84. data/templates/jqgrid/i18n/jqgrid/locale-no.js +12 -12
  85. data/templates/jqgrid/i18n/jqgrid/locale-pl.js +128 -128
  86. data/templates/jqgrid/i18n/jqgrid/locale-pt-br.js +128 -128
  87. data/templates/jqgrid/i18n/jqgrid/locale-pt.js +126 -126
  88. data/templates/jqgrid/i18n/jqgrid/locale-ro.js +140 -140
  89. data/templates/jqgrid/i18n/jqgrid/locale-ru.js +128 -128
  90. data/templates/jqgrid/i18n/jqgrid/locale-sk.js +128 -128
  91. data/templates/jqgrid/i18n/jqgrid/locale-sr.js +128 -128
  92. data/templates/jqgrid/i18n/jqgrid/locale-sv.js +128 -128
  93. data/templates/jqgrid/i18n/jqgrid/locale-tr.js +127 -127
  94. data/templates/jqgrid/i18n/jqgrid/locale-ua.js +128 -128
  95. data/templates/jqgrid/jquery.jqGrid.js +13477 -13443
  96. data/templates/jqgrid/jquery.jqGrid.min.js +292 -287
  97. data/templates/jqgrid/jquery/jqGrid.scss +13 -12
  98. data/templates/jqgrid/manifest.rb +2 -0
  99. data/templates/jqtouch/jquery.jqtouch.js +9601 -9556
  100. data/templates/jqtouch/jquery.jqtouch.min.js +3 -3
  101. data/templates/jqtouch/jquery/touch/default.scss +2 -2
  102. data/templates/jqtouch/jquery/touch/jqt.scss +2 -2
  103. data/templates/jqtouch/jquery/touch/jqtouch.scss +26 -5
  104. data/templates/jquery/amplify.store.js +211 -211
  105. data/templates/jquery/config/initializers/jquery.rb +2 -0
  106. data/templates/jquery/history.adapter.jquery.js +42 -36
  107. data/templates/jquery/history.html4.js +563 -563
  108. data/templates/jquery/history.html4.min.js +5 -5
  109. data/templates/jquery/history.js +1721 -1694
  110. data/templates/jquery/history.min.js +28 -27
  111. data/templates/jquery/i18n/jquery.ui/datepicker-af.js +20 -20
  112. data/templates/jquery/i18n/jquery.ui/datepicker-ar-DZ.js +18 -18
  113. data/templates/jquery/i18n/jquery.ui/datepicker-ar.js +19 -19
  114. data/templates/jquery/i18n/jquery.ui/datepicker-az.js +20 -20
  115. data/templates/jquery/i18n/jquery.ui/datepicker-bg.js +21 -21
  116. data/templates/jquery/i18n/jquery.ui/datepicker-bs.js +20 -20
  117. data/templates/jquery/i18n/jquery.ui/datepicker-ca.js +19 -19
  118. data/templates/jquery/i18n/jquery.ui/datepicker-cs.js +20 -20
  119. data/templates/jquery/i18n/jquery.ui/datepicker-da.js +20 -20
  120. data/templates/jquery/i18n/jquery.ui/datepicker-de.js +20 -20
  121. data/templates/jquery/i18n/jquery.ui/datepicker-el.js +20 -20
  122. data/templates/jquery/i18n/jquery.ui/datepicker-en-AU.js +19 -19
  123. data/templates/jquery/i18n/jquery.ui/datepicker-en-GB.js +20 -20
  124. data/templates/jquery/i18n/jquery.ui/datepicker-en-NZ.js +19 -19
  125. data/templates/jquery/i18n/jquery.ui/datepicker-eo.js +20 -20
  126. data/templates/jquery/i18n/jquery.ui/datepicker-es.js +19 -19
  127. data/templates/jquery/i18n/jquery.ui/datepicker-et.js +20 -20
  128. data/templates/jquery/i18n/jquery.ui/datepicker-eu.js +20 -20
  129. data/templates/jquery/i18n/jquery.ui/datepicker-fa.js +19 -19
  130. data/templates/jquery/i18n/jquery.ui/datepicker-fi.js +19 -19
  131. data/templates/jquery/i18n/jquery.ui/datepicker-fo.js +20 -20
  132. data/templates/jquery/i18n/jquery.ui/datepicker-fr-CH.js +20 -20
  133. data/templates/jquery/i18n/jquery.ui/datepicker-fr.js +20 -20
  134. data/templates/jquery/i18n/jquery.ui/datepicker-gl.js +19 -19
  135. data/templates/jquery/i18n/jquery.ui/datepicker-he.js +20 -20
  136. data/templates/jquery/i18n/jquery.ui/datepicker-hr.js +20 -20
  137. data/templates/jquery/i18n/jquery.ui/datepicker-hu.js +19 -19
  138. data/templates/jquery/i18n/jquery.ui/datepicker-hy.js +19 -19
  139. data/templates/jquery/i18n/jquery.ui/datepicker-id.js +19 -19
  140. data/templates/jquery/i18n/jquery.ui/datepicker-is.js +19 -19
  141. data/templates/jquery/i18n/jquery.ui/datepicker-it.js +19 -19
  142. data/templates/jquery/i18n/jquery.ui/datepicker-ja.js +20 -20
  143. data/templates/jquery/i18n/jquery.ui/datepicker-ko.js +19 -19
  144. data/templates/jquery/i18n/jquery.ui/datepicker-kz.js +19 -19
  145. data/templates/jquery/i18n/jquery.ui/datepicker-lt.js +19 -19
  146. data/templates/jquery/i18n/jquery.ui/datepicker-lv.js +19 -19
  147. data/templates/jquery/i18n/jquery.ui/datepicker-ml.js +20 -20
  148. data/templates/jquery/i18n/jquery.ui/datepicker-ms.js +19 -19
  149. data/templates/jquery/i18n/jquery.ui/datepicker-nl.js +20 -20
  150. data/templates/jquery/i18n/jquery.ui/datepicker-nl.min.js +1 -1
  151. data/templates/jquery/i18n/jquery.ui/datepicker-no.js +18 -18
  152. data/templates/jquery/i18n/jquery.ui/datepicker-pl.js +19 -19
  153. data/templates/jquery/i18n/jquery.ui/datepicker-pt-BR.js +19 -19
  154. data/templates/jquery/i18n/jquery.ui/datepicker-pt.js +19 -19
  155. data/templates/jquery/i18n/jquery.ui/datepicker-rm.js +17 -17
  156. data/templates/jquery/i18n/jquery.ui/datepicker-ro.js +20 -20
  157. data/templates/jquery/i18n/jquery.ui/datepicker-ru.js +19 -19
  158. data/templates/jquery/i18n/jquery.ui/datepicker-sk.js +19 -19
  159. data/templates/jquery/i18n/jquery.ui/datepicker-sk.min.js +1 -1
  160. data/templates/jquery/i18n/jquery.ui/datepicker-sl.js +19 -19
  161. data/templates/jquery/i18n/jquery.ui/datepicker-sq.js +20 -20
  162. data/templates/jquery/i18n/jquery.ui/datepicker-sr-SR.js +20 -20
  163. data/templates/jquery/i18n/jquery.ui/datepicker-sr.js +20 -20
  164. data/templates/jquery/i18n/jquery.ui/datepicker-sv.js +20 -20
  165. data/templates/jquery/i18n/jquery.ui/datepicker-ta.js +20 -20
  166. data/templates/jquery/i18n/jquery.ui/datepicker-th.js +20 -20
  167. data/templates/jquery/i18n/jquery.ui/datepicker-tj.js +19 -19
  168. data/templates/jquery/i18n/jquery.ui/datepicker-tr.js +19 -19
  169. data/templates/jquery/i18n/jquery.ui/datepicker-uk.js +19 -19
  170. data/templates/jquery/i18n/jquery.ui/datepicker-vi.js +20 -20
  171. data/templates/jquery/i18n/jquery.ui/datepicker-zh-CN.js +19 -19
  172. data/templates/jquery/i18n/jquery.ui/datepicker-zh-HK.js +19 -19
  173. data/templates/jquery/i18n/jquery.ui/datepicker-zh-TW.js +20 -20
  174. data/templates/jquery/jquery-ui.js +11913 -11882
  175. data/templates/jquery/jquery-ui.min.js +340 -339
  176. data/templates/jquery/jquery.bgiframe.js +27 -27
  177. data/templates/jquery/jquery.contextMenu.js +202 -202
  178. data/templates/jquery/jquery.cookie.js +26 -26
  179. data/templates/jquery/jquery.dotimeout.js +227 -227
  180. data/templates/jquery/jquery.dst.js +89 -89
  181. data/templates/jquery/jquery.easing.js +226 -0
  182. data/templates/jquery/jquery.easing.min.js +8 -0
  183. data/templates/jquery/jquery.farbtastic.js +294 -294
  184. data/templates/jquery/jquery.flashMessages.js +14 -14
  185. data/templates/jquery/jquery.form.js +761 -761
  186. data/templates/jquery/jquery.haml.js +247 -247
  187. data/templates/jquery/jquery.hotkeys.js +79 -79
  188. data/templates/jquery/jquery.js +1490 -928
  189. data/templates/jquery/jquery.layout.js +2454 -2454
  190. data/templates/jquery/jquery.mediahelpers.js +216 -0
  191. data/templates/jquery/jquery.mediahelpers.min.js +3 -0
  192. data/templates/jquery/jquery.min.js +177 -166
  193. data/templates/jquery/jquery.mousewheel.js +57 -57
  194. data/templates/jquery/jquery.offline.js +171 -171
  195. data/templates/jquery/jquery.pngFix.js +72 -72
  196. data/templates/jquery/jquery.rails.js +145 -145
  197. data/templates/jquery/jquery.replacetext.js +80 -80
  198. data/templates/jquery/jquery.themeswitchertool.js +195 -195
  199. data/templates/jquery/jquery.tmpl.js +460 -460
  200. data/templates/jquery/jquery.tmplPlus.js +78 -78
  201. data/templates/jquery/jquery.tokeninput.js +480 -475
  202. data/templates/jquery/jquery/ui/_theme.scss +14 -14
  203. data/templates/jquery/jquery/ui/black-tie/ui-icons_4ca300_256x240.png +0 -0
  204. data/templates/jquery/jquery/ui/black-tie/ui-icons_bbbbbb_256x240.png +0 -0
  205. data/templates/jquery/jquery/ui/black-tie/ui-icons_ededed_256x240.png +0 -0
  206. data/templates/jquery/jquery/ui/black-tie/ui-icons_ffcf29_256x240.png +0 -0
  207. data/templates/jquery/jquery/ui/vader/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  208. data/templates/jquery/jquery/ui/vader/ui-icons_bbbbbb_256x240.png +0 -0
  209. data/templates/jquery/jquery/ui/vader/ui-icons_c98000_256x240.png +0 -0
  210. data/templates/jquery/jquery/ui/vader/ui-icons_f29a00_256x240.png +0 -0
  211. data/templates/jquery/json.js +66 -66
  212. data/templates/jquery/json2.js +177 -177
  213. data/templates/jquery/manifest.rb +4 -0
  214. data/templates/jstree/jquery.jstree.js +5918 -5918
  215. data/templates/markitup/app/views/shared/_mark_it_up.parsed.preview.blue.html.haml +9 -0
  216. data/templates/markitup/app/views/shared/_mark_it_up.parsed.preview.html.haml +9 -0
  217. data/templates/markitup/app/views/shared/_mark_it_up.preview.blue.html.haml +8 -0
  218. data/templates/markitup/app/views/shared/_mark_it_up.preview.html.haml +8 -0
  219. data/templates/markitup/config/initializers/mark_it_up.rb +40 -0
  220. data/templates/markitup/jquery.markitup.js +586 -0
  221. data/templates/markitup/jquery.markitup.min.js +1 -0
  222. data/templates/markitup/jquery/markitup/preview/body.blue.png +0 -0
  223. data/templates/markitup/jquery/markitup/preview/bullet.blue.png +0 -0
  224. data/templates/markitup/jquery/markitup/preview/preview.blue.scss +58 -0
  225. data/templates/markitup/jquery/markitup/preview/preview.scss +7 -0
  226. data/templates/markitup/jquery/markitup/sets/bbcode.scss +34 -0
  227. data/templates/markitup/jquery/markitup/sets/bbcode/bold.png +0 -0
  228. data/templates/markitup/jquery/markitup/sets/bbcode/clean.png +0 -0
  229. data/templates/markitup/jquery/markitup/sets/bbcode/code.png +0 -0
  230. data/templates/markitup/jquery/markitup/sets/bbcode/fonts.png +0 -0
  231. data/templates/markitup/jquery/markitup/sets/bbcode/italic.png +0 -0
  232. data/templates/markitup/jquery/markitup/sets/bbcode/link.png +0 -0
  233. data/templates/markitup/jquery/markitup/sets/bbcode/list-bullet.png +0 -0
  234. data/templates/markitup/jquery/markitup/sets/bbcode/list-item.png +0 -0
  235. data/templates/markitup/jquery/markitup/sets/bbcode/list-numeric.png +0 -0
  236. data/templates/markitup/jquery/markitup/sets/bbcode/picture.png +0 -0
  237. data/templates/markitup/jquery/markitup/sets/bbcode/preview.png +0 -0
  238. data/templates/markitup/jquery/markitup/sets/bbcode/quotes.png +0 -0
  239. data/templates/markitup/jquery/markitup/sets/bbcode/stroke.png +0 -0
  240. data/templates/markitup/jquery/markitup/sets/bbcode/underline.png +0 -0
  241. data/templates/markitup/jquery/markitup/sets/css.scss +54 -0
  242. data/templates/markitup/jquery/markitup/sets/css/bold.png +0 -0
  243. data/templates/markitup/jquery/markitup/sets/css/css.png +0 -0
  244. data/templates/markitup/jquery/markitup/sets/css/italic.png +0 -0
  245. data/templates/markitup/jquery/markitup/sets/css/picture.png +0 -0
  246. data/templates/markitup/jquery/markitup/sets/css/stroke.png +0 -0
  247. data/templates/markitup/jquery/markitup/sets/css/tag.png +0 -0
  248. data/templates/markitup/jquery/markitup/sets/css/text_align_center.png +0 -0
  249. data/templates/markitup/jquery/markitup/sets/css/text_align_justify.png +0 -0
  250. data/templates/markitup/jquery/markitup/sets/css/text_align_left.png +0 -0
  251. data/templates/markitup/jquery/markitup/sets/css/text_align_right.png +0 -0
  252. data/templates/markitup/jquery/markitup/sets/css/text_indent.png +0 -0
  253. data/templates/markitup/jquery/markitup/sets/css/text_letterspacing.png +0 -0
  254. data/templates/markitup/jquery/markitup/sets/css/text_linespacing.png +0 -0
  255. data/templates/markitup/jquery/markitup/sets/css/text_lowercase.png +0 -0
  256. data/templates/markitup/jquery/markitup/sets/css/text_padding_bottom.png +0 -0
  257. data/templates/markitup/jquery/markitup/sets/css/text_padding_left.png +0 -0
  258. data/templates/markitup/jquery/markitup/sets/css/text_padding_right.png +0 -0
  259. data/templates/markitup/jquery/markitup/sets/css/text_padding_top.png +0 -0
  260. data/templates/markitup/jquery/markitup/sets/css/text_uppercase.png +0 -0
  261. data/templates/markitup/jquery/markitup/sets/default.scss +22 -0
  262. data/templates/markitup/jquery/markitup/sets/default/bold.png +0 -0
  263. data/templates/markitup/jquery/markitup/sets/default/clean.png +0 -0
  264. data/templates/markitup/jquery/markitup/sets/default/image.png +0 -0
  265. data/templates/markitup/jquery/markitup/sets/default/italic.png +0 -0
  266. data/templates/markitup/jquery/markitup/sets/default/link.png +0 -0
  267. data/templates/markitup/jquery/markitup/sets/default/picture.png +0 -0
  268. data/templates/markitup/jquery/markitup/sets/default/preview.png +0 -0
  269. data/templates/markitup/jquery/markitup/sets/default/stroke.png +0 -0
  270. data/templates/markitup/jquery/markitup/sets/dotclear.scss +38 -0
  271. data/templates/markitup/jquery/markitup/sets/dotclear/bold.png +0 -0
  272. data/templates/markitup/jquery/markitup/sets/dotclear/code.png +0 -0
  273. data/templates/markitup/jquery/markitup/sets/dotclear/h1.png +0 -0
  274. data/templates/markitup/jquery/markitup/sets/dotclear/h2.png +0 -0
  275. data/templates/markitup/jquery/markitup/sets/dotclear/h3.png +0 -0
  276. data/templates/markitup/jquery/markitup/sets/dotclear/h4.png +0 -0
  277. data/templates/markitup/jquery/markitup/sets/dotclear/h5.png +0 -0
  278. data/templates/markitup/jquery/markitup/sets/dotclear/h6.png +0 -0
  279. data/templates/markitup/jquery/markitup/sets/dotclear/italic.png +0 -0
  280. data/templates/markitup/jquery/markitup/sets/dotclear/link.png +0 -0
  281. data/templates/markitup/jquery/markitup/sets/dotclear/list-bullet.png +0 -0
  282. data/templates/markitup/jquery/markitup/sets/dotclear/list-numeric.png +0 -0
  283. data/templates/markitup/jquery/markitup/sets/dotclear/picture.png +0 -0
  284. data/templates/markitup/jquery/markitup/sets/dotclear/preview.png +0 -0
  285. data/templates/markitup/jquery/markitup/sets/dotclear/quotes.png +0 -0
  286. data/templates/markitup/jquery/markitup/sets/dotclear/stroke.png +0 -0
  287. data/templates/markitup/jquery/markitup/sets/dotclear/url.png +0 -0
  288. data/templates/markitup/jquery/markitup/sets/html.scss +42 -0
  289. data/templates/markitup/jquery/markitup/sets/html/bold.png +0 -0
  290. data/templates/markitup/jquery/markitup/sets/html/clean.png +0 -0
  291. data/templates/markitup/jquery/markitup/sets/html/h1.png +0 -0
  292. data/templates/markitup/jquery/markitup/sets/html/h2.png +0 -0
  293. data/templates/markitup/jquery/markitup/sets/html/h3.png +0 -0
  294. data/templates/markitup/jquery/markitup/sets/html/h4.png +0 -0
  295. data/templates/markitup/jquery/markitup/sets/html/h5.png +0 -0
  296. data/templates/markitup/jquery/markitup/sets/html/h6.png +0 -0
  297. data/templates/markitup/jquery/markitup/sets/html/image.png +0 -0
  298. data/templates/markitup/jquery/markitup/sets/html/italic.png +0 -0
  299. data/templates/markitup/jquery/markitup/sets/html/link.png +0 -0
  300. data/templates/markitup/jquery/markitup/sets/html/list-bullet.png +0 -0
  301. data/templates/markitup/jquery/markitup/sets/html/list-item.png +0 -0
  302. data/templates/markitup/jquery/markitup/sets/html/list-numeric.png +0 -0
  303. data/templates/markitup/jquery/markitup/sets/html/paragraph.png +0 -0
  304. data/templates/markitup/jquery/markitup/sets/html/picture.png +0 -0
  305. data/templates/markitup/jquery/markitup/sets/html/preview.png +0 -0
  306. data/templates/markitup/jquery/markitup/sets/html/stroke.png +0 -0
  307. data/templates/markitup/jquery/markitup/sets/markdown.scss +38 -0
  308. data/templates/markitup/jquery/markitup/sets/markdown/bold.png +0 -0
  309. data/templates/markitup/jquery/markitup/sets/markdown/code.png +0 -0
  310. data/templates/markitup/jquery/markitup/sets/markdown/h1.png +0 -0
  311. data/templates/markitup/jquery/markitup/sets/markdown/h2.png +0 -0
  312. data/templates/markitup/jquery/markitup/sets/markdown/h3.png +0 -0
  313. data/templates/markitup/jquery/markitup/sets/markdown/h4.png +0 -0
  314. data/templates/markitup/jquery/markitup/sets/markdown/h5.png +0 -0
  315. data/templates/markitup/jquery/markitup/sets/markdown/h6.png +0 -0
  316. data/templates/markitup/jquery/markitup/sets/markdown/italic.png +0 -0
  317. data/templates/markitup/jquery/markitup/sets/markdown/link.png +0 -0
  318. data/templates/markitup/jquery/markitup/sets/markdown/list-bullet.png +0 -0
  319. data/templates/markitup/jquery/markitup/sets/markdown/list-numeric.png +0 -0
  320. data/templates/markitup/jquery/markitup/sets/markdown/picture.png +0 -0
  321. data/templates/markitup/jquery/markitup/sets/markdown/preview.png +0 -0
  322. data/templates/markitup/jquery/markitup/sets/markdown/quotes.png +0 -0
  323. data/templates/markitup/jquery/markitup/sets/markmin.scss +38 -0
  324. data/templates/markitup/jquery/markitup/sets/markmin/bold.png +0 -0
  325. data/templates/markitup/jquery/markitup/sets/markmin/code.png +0 -0
  326. data/templates/markitup/jquery/markitup/sets/markmin/h1.png +0 -0
  327. data/templates/markitup/jquery/markitup/sets/markmin/h2.png +0 -0
  328. data/templates/markitup/jquery/markitup/sets/markmin/h3.png +0 -0
  329. data/templates/markitup/jquery/markitup/sets/markmin/h4.png +0 -0
  330. data/templates/markitup/jquery/markitup/sets/markmin/h5.png +0 -0
  331. data/templates/markitup/jquery/markitup/sets/markmin/h6.png +0 -0
  332. data/templates/markitup/jquery/markitup/sets/markmin/italic.png +0 -0
  333. data/templates/markitup/jquery/markitup/sets/markmin/link.png +0 -0
  334. data/templates/markitup/jquery/markitup/sets/markmin/list-bullet.png +0 -0
  335. data/templates/markitup/jquery/markitup/sets/markmin/list-numeric.png +0 -0
  336. data/templates/markitup/jquery/markitup/sets/markmin/picture.png +0 -0
  337. data/templates/markitup/jquery/markitup/sets/markmin/preview.png +0 -0
  338. data/templates/markitup/jquery/markitup/sets/markmin/quotes.png +0 -0
  339. data/templates/markitup/jquery/markitup/sets/rest.scss +38 -0
  340. data/templates/markitup/jquery/markitup/sets/rest/bold.png +0 -0
  341. data/templates/markitup/jquery/markitup/sets/rest/code.png +0 -0
  342. data/templates/markitup/jquery/markitup/sets/rest/h1.png +0 -0
  343. data/templates/markitup/jquery/markitup/sets/rest/h2.png +0 -0
  344. data/templates/markitup/jquery/markitup/sets/rest/h3.png +0 -0
  345. data/templates/markitup/jquery/markitup/sets/rest/h4.png +0 -0
  346. data/templates/markitup/jquery/markitup/sets/rest/h5.png +0 -0
  347. data/templates/markitup/jquery/markitup/sets/rest/italic.png +0 -0
  348. data/templates/markitup/jquery/markitup/sets/rest/link.png +0 -0
  349. data/templates/markitup/jquery/markitup/sets/rest/list-bullet.png +0 -0
  350. data/templates/markitup/jquery/markitup/sets/rest/list-numeric.png +0 -0
  351. data/templates/markitup/jquery/markitup/sets/rest/picture.png +0 -0
  352. data/templates/markitup/jquery/markitup/sets/rest/preview.png +0 -0
  353. data/templates/markitup/jquery/markitup/sets/rest/quotes.png +0 -0
  354. data/templates/markitup/jquery/markitup/sets/textile.scss +44 -0
  355. data/templates/markitup/jquery/markitup/sets/textile/bold.png +0 -0
  356. data/templates/markitup/jquery/markitup/sets/textile/code.png +0 -0
  357. data/templates/markitup/jquery/markitup/sets/textile/h1.png +0 -0
  358. data/templates/markitup/jquery/markitup/sets/textile/h2.png +0 -0
  359. data/templates/markitup/jquery/markitup/sets/textile/h3.png +0 -0
  360. data/templates/markitup/jquery/markitup/sets/textile/h4.png +0 -0
  361. data/templates/markitup/jquery/markitup/sets/textile/h5.png +0 -0
  362. data/templates/markitup/jquery/markitup/sets/textile/h6.png +0 -0
  363. data/templates/markitup/jquery/markitup/sets/textile/italic.png +0 -0
  364. data/templates/markitup/jquery/markitup/sets/textile/link.png +0 -0
  365. data/templates/markitup/jquery/markitup/sets/textile/list-bullet.png +0 -0
  366. data/templates/markitup/jquery/markitup/sets/textile/list-numeric.png +0 -0
  367. data/templates/markitup/jquery/markitup/sets/textile/paragraph.png +0 -0
  368. data/templates/markitup/jquery/markitup/sets/textile/picture.png +0 -0
  369. data/templates/markitup/jquery/markitup/sets/textile/preview.png +0 -0
  370. data/templates/markitup/jquery/markitup/sets/textile/quotes.png +0 -0
  371. data/templates/markitup/jquery/markitup/sets/textile/stroke.png +0 -0
  372. data/templates/markitup/jquery/markitup/sets/textile/table.png +0 -0
  373. data/templates/markitup/jquery/markitup/sets/texy.scss +40 -0
  374. data/templates/markitup/jquery/markitup/sets/texy/bold.png +0 -0
  375. data/templates/markitup/jquery/markitup/sets/texy/code.png +0 -0
  376. data/templates/markitup/jquery/markitup/sets/texy/disconnect.png +0 -0
  377. data/templates/markitup/jquery/markitup/sets/texy/h1.png +0 -0
  378. data/templates/markitup/jquery/markitup/sets/texy/h2.png +0 -0
  379. data/templates/markitup/jquery/markitup/sets/texy/h3.png +0 -0
  380. data/templates/markitup/jquery/markitup/sets/texy/h4.png +0 -0
  381. data/templates/markitup/jquery/markitup/sets/texy/h5.png +0 -0
  382. data/templates/markitup/jquery/markitup/sets/texy/h6.png +0 -0
  383. data/templates/markitup/jquery/markitup/sets/texy/italic.png +0 -0
  384. data/templates/markitup/jquery/markitup/sets/texy/link.png +0 -0
  385. data/templates/markitup/jquery/markitup/sets/texy/list-bullet.png +0 -0
  386. data/templates/markitup/jquery/markitup/sets/texy/list-numeric.png +0 -0
  387. data/templates/markitup/jquery/markitup/sets/texy/page_white_code.png +0 -0
  388. data/templates/markitup/jquery/markitup/sets/texy/picture.png +0 -0
  389. data/templates/markitup/jquery/markitup/sets/texy/preview.png +0 -0
  390. data/templates/markitup/jquery/markitup/sets/texy/quotes.png +0 -0
  391. data/templates/markitup/jquery/markitup/sets/texy/stroke.png +0 -0
  392. data/templates/markitup/jquery/markitup/sets/txt2tags.scss +44 -0
  393. data/templates/markitup/jquery/markitup/sets/txt2tags/bold.png +0 -0
  394. data/templates/markitup/jquery/markitup/sets/txt2tags/code.png +0 -0
  395. data/templates/markitup/jquery/markitup/sets/txt2tags/disconnect.png +0 -0
  396. data/templates/markitup/jquery/markitup/sets/txt2tags/h1.png +0 -0
  397. data/templates/markitup/jquery/markitup/sets/txt2tags/h2.png +0 -0
  398. data/templates/markitup/jquery/markitup/sets/txt2tags/h3.png +0 -0
  399. data/templates/markitup/jquery/markitup/sets/txt2tags/h4.png +0 -0
  400. data/templates/markitup/jquery/markitup/sets/txt2tags/h5.png +0 -0
  401. data/templates/markitup/jquery/markitup/sets/txt2tags/italic.png +0 -0
  402. data/templates/markitup/jquery/markitup/sets/txt2tags/link.png +0 -0
  403. data/templates/markitup/jquery/markitup/sets/txt2tags/list-bullet.png +0 -0
  404. data/templates/markitup/jquery/markitup/sets/txt2tags/list-numeric.png +0 -0
  405. data/templates/markitup/jquery/markitup/sets/txt2tags/picture.png +0 -0
  406. data/templates/markitup/jquery/markitup/sets/txt2tags/preview.png +0 -0
  407. data/templates/markitup/jquery/markitup/sets/txt2tags/quotes.png +0 -0
  408. data/templates/markitup/jquery/markitup/sets/txt2tags/stroke.png +0 -0
  409. data/templates/markitup/jquery/markitup/sets/txt2tags/underline.png +0 -0
  410. data/templates/markitup/jquery/markitup/sets/wiki.scss +42 -0
  411. data/templates/markitup/jquery/markitup/sets/wiki/bold.png +0 -0
  412. data/templates/markitup/jquery/markitup/sets/wiki/code.png +0 -0
  413. data/templates/markitup/jquery/markitup/sets/wiki/h1.png +0 -0
  414. data/templates/markitup/jquery/markitup/sets/wiki/h2.png +0 -0
  415. data/templates/markitup/jquery/markitup/sets/wiki/h3.png +0 -0
  416. data/templates/markitup/jquery/markitup/sets/wiki/h4.png +0 -0
  417. data/templates/markitup/jquery/markitup/sets/wiki/h5.png +0 -0
  418. data/templates/markitup/jquery/markitup/sets/wiki/h6.png +0 -0
  419. data/templates/markitup/jquery/markitup/sets/wiki/italic.png +0 -0
  420. data/templates/markitup/jquery/markitup/sets/wiki/link.png +0 -0
  421. data/templates/markitup/jquery/markitup/sets/wiki/list-bullet.png +0 -0
  422. data/templates/markitup/jquery/markitup/sets/wiki/list-numeric.png +0 -0
  423. data/templates/markitup/jquery/markitup/sets/wiki/picture.png +0 -0
  424. data/templates/markitup/jquery/markitup/sets/wiki/preview.png +0 -0
  425. data/templates/markitup/jquery/markitup/sets/wiki/quotes.png +0 -0
  426. data/templates/markitup/jquery/markitup/sets/wiki/stroke.png +0 -0
  427. data/templates/markitup/jquery/markitup/sets/wiki/table.png +0 -0
  428. data/templates/markitup/jquery/markitup/sets/wiki/url.png +0 -0
  429. data/templates/markitup/jquery/markitup/sets/xbbcode.scss +42 -0
  430. data/templates/markitup/jquery/markitup/sets/xbbcode/bold.png +0 -0
  431. data/templates/markitup/jquery/markitup/sets/xbbcode/clean.png +0 -0
  432. data/templates/markitup/jquery/markitup/sets/xbbcode/h1.png +0 -0
  433. data/templates/markitup/jquery/markitup/sets/xbbcode/h2.png +0 -0
  434. data/templates/markitup/jquery/markitup/sets/xbbcode/h3.png +0 -0
  435. data/templates/markitup/jquery/markitup/sets/xbbcode/h4.png +0 -0
  436. data/templates/markitup/jquery/markitup/sets/xbbcode/h5.png +0 -0
  437. data/templates/markitup/jquery/markitup/sets/xbbcode/h6.png +0 -0
  438. data/templates/markitup/jquery/markitup/sets/xbbcode/image.png +0 -0
  439. data/templates/markitup/jquery/markitup/sets/xbbcode/italic.png +0 -0
  440. data/templates/markitup/jquery/markitup/sets/xbbcode/link.png +0 -0
  441. data/templates/markitup/jquery/markitup/sets/xbbcode/list-bullet.png +0 -0
  442. data/templates/markitup/jquery/markitup/sets/xbbcode/list-item.png +0 -0
  443. data/templates/markitup/jquery/markitup/sets/xbbcode/list-numeric.png +0 -0
  444. data/templates/markitup/jquery/markitup/sets/xbbcode/paragraph.png +0 -0
  445. data/templates/markitup/jquery/markitup/sets/xbbcode/picture.png +0 -0
  446. data/templates/markitup/jquery/markitup/sets/xbbcode/preview.png +0 -0
  447. data/templates/markitup/jquery/markitup/sets/xbbcode/stroke.png +0 -0
  448. data/templates/markitup/jquery/markitup/skins/aqua.scss +136 -0
  449. data/templates/markitup/jquery/markitup/skins/aqua/bg-container-white.png +0 -0
  450. data/templates/markitup/jquery/markitup/skins/aqua/bg-container.png +0 -0
  451. data/templates/markitup/jquery/markitup/skins/aqua/bg-footer-white.png +0 -0
  452. data/templates/markitup/jquery/markitup/skins/aqua/bg-footer.png +0 -0
  453. data/templates/markitup/jquery/markitup/skins/aqua/bg-header-white.png +0 -0
  454. data/templates/markitup/jquery/markitup/skins/aqua/bg-header.png +0 -0
  455. data/templates/markitup/jquery/markitup/skins/aqua/handle.png +0 -0
  456. data/templates/markitup/jquery/markitup/skins/aqua/menu.png +0 -0
  457. data/templates/markitup/jquery/markitup/skins/aqua/spacer.gif +0 -0
  458. data/templates/markitup/jquery/markitup/skins/aqua/submenu.png +0 -0
  459. data/templates/markitup/jquery/markitup/skins/jtageditor.scss +141 -0
  460. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-container.png +0 -0
  461. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-bbcode.png +0 -0
  462. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-dotclear.png +0 -0
  463. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-html.png +0 -0
  464. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-markdown.png +0 -0
  465. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-textile.png +0 -0
  466. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-wiki.png +0 -0
  467. data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor.png +0 -0
  468. data/templates/markitup/jquery/markitup/skins/jtageditor/handle.png +0 -0
  469. data/templates/markitup/jquery/markitup/skins/jtageditor/menu.png +0 -0
  470. data/templates/markitup/jquery/markitup/skins/jtageditor/submenu.png +0 -0
  471. data/templates/markitup/jquery/markitup/skins/live.scss +135 -0
  472. data/templates/markitup/jquery/markitup/skins/live/bg-container.png +0 -0
  473. data/templates/markitup/jquery/markitup/skins/live/bg-footer.png +0 -0
  474. data/templates/markitup/jquery/markitup/skins/live/bg-header.png +0 -0
  475. data/templates/markitup/jquery/markitup/skins/live/editor.png +0 -0
  476. data/templates/markitup/jquery/markitup/skins/live/handle.png +0 -0
  477. data/templates/markitup/jquery/markitup/skins/live/menu.png +0 -0
  478. data/templates/markitup/jquery/markitup/skins/live/submenu.png +0 -0
  479. data/templates/markitup/jquery/markitup/skins/markitup.scss +150 -0
  480. data/templates/markitup/jquery/markitup/skins/markitup/bg-container.png +0 -0
  481. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-bbcode.png +0 -0
  482. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-dotclear.png +0 -0
  483. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-html.png +0 -0
  484. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-json.png +0 -0
  485. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-markdown.png +0 -0
  486. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-textile.png +0 -0
  487. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-wiki.png +0 -0
  488. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-xml.png +0 -0
  489. data/templates/markitup/jquery/markitup/skins/markitup/bg-editor.png +0 -0
  490. data/templates/markitup/jquery/markitup/skins/markitup/handle.png +0 -0
  491. data/templates/markitup/jquery/markitup/skins/markitup/menu.png +0 -0
  492. data/templates/markitup/jquery/markitup/skins/markitup/submenu.png +0 -0
  493. data/templates/markitup/jquery/markitup/skins/simple.scss +117 -0
  494. data/templates/markitup/jquery/markitup/skins/simple/handle.png +0 -0
  495. data/templates/markitup/jquery/markitup/skins/simple/menu.png +0 -0
  496. data/templates/markitup/jquery/markitup/skins/simple/submenu.png +0 -0
  497. data/templates/markitup/manifest.rb +311 -0
  498. data/templates/markitup/markitup/jquery.markitup.set.bbcode.js +40 -0
  499. data/templates/markitup/markitup/jquery.markitup.set.bbcode.min.js +3 -0
  500. data/templates/markitup/markitup/jquery.markitup.set.css.js +53 -0
  501. data/templates/markitup/markitup/jquery.markitup.set.css.min.js +5 -0
  502. data/templates/markitup/markitup/jquery.markitup.set.default.js +30 -0
  503. data/templates/markitup/markitup/jquery.markitup.set.default.min.js +2 -0
  504. data/templates/markitup/markitup/jquery.markitup.set.dotclear.js +38 -0
  505. data/templates/markitup/markitup/jquery.markitup.set.dotclear.min.js +3 -0
  506. data/templates/markitup/markitup/jquery.markitup.set.html.js +40 -0
  507. data/templates/markitup/markitup/jquery.markitup.set.html.min.js +4 -0
  508. data/templates/markitup/markitup/jquery.markitup.set.markdown.js +53 -0
  509. data/templates/markitup/markitup/jquery.markitup.set.markdown.min.js +3 -0
  510. data/templates/markitup/markitup/jquery.markitup.set.markmin.js +50 -0
  511. data/templates/markitup/markitup/jquery.markitup.set.markmin.min.js +3 -0
  512. data/templates/markitup/markitup/jquery.markitup.set.rest.js +52 -0
  513. data/templates/markitup/markitup/jquery.markitup.set.rest.min.js +3 -0
  514. data/templates/markitup/markitup/jquery.markitup.set.textile.js +58 -0
  515. data/templates/markitup/markitup/jquery.markitup.set.textile.min.js +4 -0
  516. data/templates/markitup/markitup/jquery.markitup.set.texy.js +52 -0
  517. data/templates/markitup/markitup/jquery.markitup.set.texy.min.js +4 -0
  518. data/templates/markitup/markitup/jquery.markitup.set.txt2tags.js +42 -0
  519. data/templates/markitup/markitup/jquery.markitup.set.txt2tags.min.js +3 -0
  520. data/templates/markitup/markitup/jquery.markitup.set.wiki.js +61 -0
  521. data/templates/markitup/markitup/jquery.markitup.set.wiki.min.js +4 -0
  522. data/templates/markitup/markitup/jquery.markitup.set.xbbcode.js +36 -0
  523. data/templates/markitup/markitup/jquery.markitup.set.xbbcode.min.js +4 -0
  524. data/templates/mobile/config/initializers/mobile.rb +2 -0
  525. data/templates/mobile/jquery.mobile.js +4545 -4454
  526. data/templates/mobile/jquery.mobile.min.js +16 -7
  527. data/templates/mobile/jquery/mobile/960.fluid.scss +191 -0
  528. data/templates/mobile/jquery/mobile/960.scss +213 -0
  529. data/templates/mobile/jquery/mobile/_base.scss +37 -20
  530. data/templates/mobile/jquery/mobile/default.scss +48 -56
  531. data/templates/mobile/jquery/mobile/valencia.scss +43 -44
  532. data/templates/mobile/manifest.rb +2 -0
  533. data/templates/ribbon/jquery.ribbon.js +195 -195
  534. data/templates/ribbon/jquery.ribbon.min.js +1 -1
  535. data/templates/ribbon/jquery/ribbon/office.scss +12 -12
  536. data/templates/ribbon/jquery/ribbon/windows7.scss +12 -12
  537. data/templates/secret_sauce/secret_sauce.js +8 -8
  538. data/templates/tools/flowplayer.js +897 -897
  539. data/templates/tools/jquery.tools.js +3647 -3647
  540. data/templates/tools/jquery.tools.min.js +47 -47
  541. data/templates/tools/swfobject.js +760 -760
  542. metadata +350 -22
@@ -4,85 +4,85 @@
4
4
  */
5
5
 
6
6
  Highcharts.theme = {
7
- colors: ["#514F78", "#42A07B", "#9B5E4A", "#72727F", "#1F949A", "#82914E", "#86777F", "#42A07B"],
8
- chart: {
9
- className: 'skies',
10
- borderWidth: 0,
11
- plotShadow: true,
12
- plotBackgroundImage: '/images/jquery/highcharts/skies.jpg',
13
- plotBackgroundColor: {
14
- linearGradient: [0, 0, 250, 500],
15
- stops: [
16
- [0, 'rgba(255, 255, 255, 1)'],
17
- [1, 'rgba(255, 255, 255, 0)']
18
- ]
19
- },
20
- plotBorderWidth: 1
21
- },
22
- title: {
7
+ colors: ["#514F78", "#42A07B", "#9B5E4A", "#72727F", "#1F949A", "#82914E", "#86777F", "#42A07B"],
8
+ chart: {
9
+ className: 'skies',
10
+ borderWidth: 0,
11
+ plotShadow: true,
12
+ plotBackgroundImage: '/images/jquery/highcharts/skies.jpg',
13
+ plotBackgroundColor: {
14
+ linearGradient: [0, 0, 250, 500],
15
+ stops: [
16
+ [0, 'rgba(255, 255, 255, 1)'],
17
+ [1, 'rgba(255, 255, 255, 0)']
18
+ ]
19
+ },
20
+ plotBorderWidth: 1
21
+ },
22
+ title: {
23
+ style: {
24
+ color: '#3E576F',
25
+ font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
26
+ }
27
+ },
28
+ subtitle: {
29
+ style: {
30
+ color: '#6D869F',
31
+ font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
32
+ }
33
+ },
34
+ xAxis: {
35
+ gridLineWidth: 0,
36
+ lineColor: '#C0D0E0',
37
+ tickColor: '#C0D0E0',
38
+ labels: {
23
39
  style: {
24
- color: '#3E576F',
25
- font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
40
+ color: '#666',
41
+ fontWeight: 'bold'
26
42
  }
27
- },
28
- subtitle: {
43
+ },
44
+ title: {
29
45
  style: {
30
- color: '#6D869F',
31
- font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
46
+ color: '#666',
47
+ font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
32
48
  }
33
- },
34
- xAxis: {
35
- gridLineWidth: 0,
36
- lineColor: '#C0D0E0',
37
- tickColor: '#C0D0E0',
38
- labels: {
39
- style: {
40
- color: '#666',
41
- fontWeight: 'bold'
42
- }
43
- },
44
- title: {
45
- style: {
46
- color: '#666',
47
- font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
48
- }
49
- }
50
- },
51
- yAxis: {
52
- alternateGridColor: 'rgba(255, 255, 255, .5)',
53
- lineColor: '#C0D0E0',
54
- tickColor: '#C0D0E0',
55
- tickWidth: 1,
56
- labels: {
57
- style: {
58
- color: '#666',
59
- fontWeight: 'bold'
60
- }
61
- },
62
- title: {
63
- style: {
64
- color: '#666',
65
- font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
66
- }
67
- }
68
- },
69
- legend: {
70
- itemStyle: {
71
- font: '9pt Trebuchet MS, Verdana, sans-serif',
72
- color: '#3E576F'
73
- },
74
- itemHoverStyle: {
75
- color: 'black'
76
- },
77
- itemHiddenStyle: {
78
- color: 'silver'
49
+ }
50
+ },
51
+ yAxis: {
52
+ alternateGridColor: 'rgba(255, 255, 255, .5)',
53
+ lineColor: '#C0D0E0',
54
+ tickColor: '#C0D0E0',
55
+ tickWidth: 1,
56
+ labels: {
57
+ style: {
58
+ color: '#666',
59
+ fontWeight: 'bold'
79
60
  }
80
- },
81
- labels: {
61
+ },
62
+ title: {
82
63
  style: {
83
- color: '#3E576F'
64
+ color: '#666',
65
+ font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
84
66
  }
85
- }
67
+ }
68
+ },
69
+ legend: {
70
+ itemStyle: {
71
+ font: '9pt Trebuchet MS, Verdana, sans-serif',
72
+ color: '#3E576F'
73
+ },
74
+ itemHoverStyle: {
75
+ color: 'black'
76
+ },
77
+ itemHiddenStyle: {
78
+ color: 'silver'
79
+ }
80
+ },
81
+ labels: {
82
+ style: {
83
+ color: '#3E576F'
84
+ }
85
+ }
86
86
  };
87
87
 
88
88
  // Apply the theme
@@ -7,1247 +7,1247 @@
7
7
  * @website: http://www.datejs.com/
8
8
  */
9
9
  Date.CultureInfo = {name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|aft(er)?|from|hence)/i,subtract:/^(\-|bef(ore)?|ago)/i,yesterday:/^yes(terday)?/i,today:/^t(od(ay)?)?/i,tomorrow:/^tom(orrow)?/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^mn|min(ute)?s?/i,hour:/^h(our)?s?/i,week:/^w(eek)?s?/i,month:/^m(onth)?s?/i,day:/^d(ay)?s?/i,year:/^y(ear)?s?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a(?!u|p)|p)/i},timezones:[
10
- {name:"UTC",offset:"-000"},
11
- {name:"GMT",offset:"-000"},
12
- {name:"EST",offset:"-0500"},
13
- {name:"EDT",offset:"-0400"},
14
- {name:"CST",offset:"-0600"},
15
- {name:"CDT",offset:"-0500"},
16
- {name:"MST",offset:"-0700"},
17
- {name:"MDT",offset:"-0600"},
18
- {name:"PST",offset:"-0800"},
19
- {name:"PDT",offset:"-0700"}
10
+ {name:"UTC",offset:"-000"},
11
+ {name:"GMT",offset:"-000"},
12
+ {name:"EST",offset:"-0500"},
13
+ {name:"EDT",offset:"-0400"},
14
+ {name:"CST",offset:"-0600"},
15
+ {name:"CDT",offset:"-0500"},
16
+ {name:"MST",offset:"-0700"},
17
+ {name:"MDT",offset:"-0600"},
18
+ {name:"PST",offset:"-0800"},
19
+ {name:"PDT",offset:"-0700"}
20
20
  ]};
21
21
  (function() {
22
- var $D = Date,$P = $D.prototype,$C = $D.CultureInfo,p = function(s, l) {
23
- if (!l) {
24
- l = 2;
25
- }
26
- return("000" + s).slice(l * -1);
27
- };
28
- $P.clearTime = function() {
29
- this.setHours(0);
30
- this.setMinutes(0);
31
- this.setSeconds(0);
32
- this.setMilliseconds(0);
33
- return this;
34
- };
35
- $P.setTimeToNow = function() {
36
- var n = new Date();
37
- this.setHours(n.getHours());
38
- this.setMinutes(n.getMinutes());
39
- this.setSeconds(n.getSeconds());
40
- this.setMilliseconds(n.getMilliseconds());
41
- return this;
42
- };
43
- $D.today = function() {
44
- return new Date().clearTime();
45
- };
46
- $D.compare = function(date1, date2) {
47
- if (isNaN(date1) || isNaN(date2)) {
48
- throw new Error(date1 + " - " + date2);
49
- } else if (date1 instanceof Date && date2 instanceof Date) {
50
- return(date1 < date2) ? -1 : (date1 > date2) ? 1 : 0;
51
- } else {
52
- throw new TypeError(date1 + " - " + date2);
53
- }
54
- };
55
- $D.equals = function(date1, date2) {
56
- return(date1.compareTo(date2) === 0);
57
- };
58
- $D.getDayNumberFromName = function(name) {
59
- var n = $C.dayNames,m = $C.abbreviatedDayNames,o = $C.shortestDayNames,s = name.toLowerCase();
60
- for (var i = 0; i < n.length; i++) {
61
- if (n[i].toLowerCase() == s || m[i].toLowerCase() == s || o[i].toLowerCase() == s) {
62
- return i;
63
- }
64
- }
65
- return-1;
66
- };
67
- $D.getMonthNumberFromName = function(name) {
68
- var n = $C.monthNames,m = $C.abbreviatedMonthNames,s = name.toLowerCase();
69
- for (var i = 0; i < n.length; i++) {
70
- if (n[i].toLowerCase() == s || m[i].toLowerCase() == s) {
71
- return i;
72
- }
73
- }
74
- return-1;
75
- };
76
- $D.isLeapYear = function(year) {
77
- return((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);
78
- };
79
- $D.getDaysInMonth = function(year, month) {
80
- return[31,($D.isLeapYear(year) ? 29 : 28),31,30,31,30,31,31,30,31,30,31][month];
81
- };
82
- $D.getTimezoneAbbreviation = function(offset) {
83
- var z = $C.timezones,p;
84
- for (var i = 0; i < z.length; i++) {
85
- if (z[i].offset === offset) {
86
- return z[i].name;
87
- }
88
- }
89
- return null;
90
- };
91
- $D.getTimezoneOffset = function(name) {
92
- var z = $C.timezones,p;
93
- for (var i = 0; i < z.length; i++) {
94
- if (z[i].name === name.toUpperCase()) {
95
- return z[i].offset;
96
- }
97
- }
98
- return null;
99
- };
100
- $P.clone = function() {
101
- return new Date(this.getTime());
102
- };
103
- $P.compareTo = function(date) {
104
- return Date.compare(this, date);
105
- };
106
- $P.equals = function(date) {
107
- return Date.equals(this, date || new Date());
108
- };
109
- $P.between = function(start, end) {
110
- return this.getTime() >= start.getTime() && this.getTime() <= end.getTime();
111
- };
112
- $P.isAfter = function(date) {
113
- return this.compareTo(date || new Date()) === 1;
114
- };
115
- $P.isBefore = function(date) {
116
- return(this.compareTo(date || new Date()) === -1);
117
- };
118
- $P.isToday = function() {
119
- return this.isSameDay(new Date());
120
- };
121
- $P.isSameDay = function(date) {
122
- return this.clone().clearTime().equals(date.clone().clearTime());
123
- };
124
- $P.addMilliseconds = function(value) {
125
- this.setMilliseconds(this.getMilliseconds() + value);
126
- return this;
127
- };
128
- $P.addSeconds = function(value) {
129
- return this.addMilliseconds(value * 1000);
130
- };
131
- $P.addMinutes = function(value) {
132
- return this.addMilliseconds(value * 60000);
133
- };
134
- $P.addHours = function(value) {
135
- return this.addMilliseconds(value * 3600000);
136
- };
137
- $P.addDays = function(value) {
138
- this.setDate(this.getDate() + value);
139
- return this;
140
- };
141
- $P.addWeeks = function(value) {
142
- return this.addDays(value * 7);
143
- };
144
- $P.addMonths = function(value) {
145
- var n = this.getDate();
146
- this.setDate(1);
147
- this.setMonth(this.getMonth() + value);
148
- this.setDate(Math.min(n, $D.getDaysInMonth(this.getFullYear(), this.getMonth())));
149
- return this;
150
- };
151
- $P.addYears = function(value) {
152
- return this.addMonths(value * 12);
153
- };
154
- $P.add = function(config) {
155
- if (typeof config == "number") {
156
- this._orient = config;
157
- return this;
158
- }
159
- var x = config;
160
- if (x.milliseconds) {
161
- this.addMilliseconds(x.milliseconds);
162
- }
163
- if (x.seconds) {
164
- this.addSeconds(x.seconds);
165
- }
166
- if (x.minutes) {
167
- this.addMinutes(x.minutes);
168
- }
169
- if (x.hours) {
170
- this.addHours(x.hours);
171
- }
172
- if (x.weeks) {
173
- this.addWeeks(x.weeks);
174
- }
175
- if (x.months) {
176
- this.addMonths(x.months);
177
- }
178
- if (x.years) {
179
- this.addYears(x.years);
180
- }
181
- if (x.days) {
182
- this.addDays(x.days);
183
- }
184
- return this;
185
- };
186
- var $y,$m,$d;
187
- $P.getWeek = function() {
188
- var a,b,c,d,e,f,g,n,s,w;
189
- $y = (!$y) ? this.getFullYear() : $y;
190
- $m = (!$m) ? this.getMonth() + 1 : $m;
191
- $d = (!$d) ? this.getDate() : $d;
192
- if ($m <= 2) {
193
- a = $y - 1;
194
- b = (a / 4 | 0) - (a / 100 | 0) + (a / 400 | 0);
195
- c = ((a - 1) / 4 | 0) - ((a - 1) / 100 | 0) + ((a - 1) / 400 | 0);
196
- s = b - c;
197
- e = 0;
198
- f = $d - 1 + (31 * ($m - 1));
199
- } else {
200
- a = $y;
201
- b = (a / 4 | 0) - (a / 100 | 0) + (a / 400 | 0);
202
- c = ((a - 1) / 4 | 0) - ((a - 1) / 100 | 0) + ((a - 1) / 400 | 0);
203
- s = b - c;
204
- e = s + 1;
205
- f = $d + ((153 * ($m - 3) + 2) / 5) + 58 + s;
206
- }
207
- g = (a + b) % 7;
208
- d = (f + g - e) % 7;
209
- n = (f + 3 - d) | 0;
210
- if (n < 0) {
211
- w = 53 - ((g - s) / 5 | 0);
212
- } else if (n > 364 + s) {
213
- w = 1;
214
- } else {
215
- w = (n / 7 | 0) + 1;
216
- }
217
- $y = $m = $d = null;
218
- return w;
219
- };
220
- $P.getISOWeek = function() {
221
- $y = this.getUTCFullYear();
222
- $m = this.getUTCMonth() + 1;
223
- $d = this.getUTCDate();
224
- return p(this.getWeek());
225
- };
226
- $P.setWeek = function(n) {
227
- return this.moveToDayOfWeek(1).addWeeks(n - this.getWeek());
228
- };
229
- $D._validate = function(n, min, max, name) {
230
- if (typeof n == "undefined") {
231
- return false;
232
- } else if (typeof n != "number") {
233
- throw new TypeError(n + " is not a Number.");
234
- } else if (n < min || n > max) {
235
- throw new RangeError(n + " is not a valid value for " + name + ".");
236
- }
237
- return true;
238
- };
239
- $D.validateMillisecond = function(value) {
240
- return $D._validate(value, 0, 999, "millisecond");
241
- };
242
- $D.validateSecond = function(value) {
243
- return $D._validate(value, 0, 59, "second");
244
- };
245
- $D.validateMinute = function(value) {
246
- return $D._validate(value, 0, 59, "minute");
247
- };
248
- $D.validateHour = function(value) {
249
- return $D._validate(value, 0, 23, "hour");
250
- };
251
- $D.validateDay = function(value, year, month) {
252
- return $D._validate(value, 1, $D.getDaysInMonth(year, month), "day");
253
- };
254
- $D.validateMonth = function(value) {
255
- return $D._validate(value, 0, 11, "month");
256
- };
257
- $D.validateYear = function(value) {
258
- return $D._validate(value, 0, 9999, "year");
259
- };
260
- $P.set = function(config) {
261
- if ($D.validateMillisecond(config.millisecond)) {
262
- this.addMilliseconds(config.millisecond - this.getMilliseconds());
263
- }
264
- if ($D.validateSecond(config.second)) {
265
- this.addSeconds(config.second - this.getSeconds());
266
- }
267
- if ($D.validateMinute(config.minute)) {
268
- this.addMinutes(config.minute - this.getMinutes());
269
- }
270
- if ($D.validateHour(config.hour)) {
271
- this.addHours(config.hour - this.getHours());
272
- }
273
- if ($D.validateMonth(config.month)) {
274
- this.addMonths(config.month - this.getMonth());
275
- }
276
- if ($D.validateYear(config.year)) {
277
- this.addYears(config.year - this.getFullYear());
278
- }
279
- if ($D.validateDay(config.day, this.getFullYear(), this.getMonth())) {
280
- this.addDays(config.day - this.getDate());
281
- }
282
- if (config.timezone) {
283
- this.setTimezone(config.timezone);
284
- }
285
- if (config.timezoneOffset) {
286
- this.setTimezoneOffset(config.timezoneOffset);
287
- }
288
- if (config.week && $D._validate(config.week, 0, 53, "week")) {
289
- this.setWeek(config.week);
290
- }
291
- return this;
292
- };
293
- $P.moveToFirstDayOfMonth = function() {
294
- return this.set({day:1});
295
- };
296
- $P.moveToLastDayOfMonth = function() {
297
- return this.set({day:$D.getDaysInMonth(this.getFullYear(), this.getMonth())});
298
- };
299
- $P.moveToNthOccurrence = function(dayOfWeek, occurrence) {
300
- var shift = 0;
301
- if (occurrence > 0) {
302
- shift = occurrence - 1;
303
- }
304
- else if (occurrence === -1) {
305
- this.moveToLastDayOfMonth();
306
- if (this.getDay() !== dayOfWeek) {
307
- this.moveToDayOfWeek(dayOfWeek, -1);
308
- }
309
- return this;
310
- }
311
- return this.moveToFirstDayOfMonth().addDays(-1).moveToDayOfWeek(dayOfWeek, +1).addWeeks(shift);
312
- };
313
- $P.moveToDayOfWeek = function(dayOfWeek, orient) {
314
- var diff = (dayOfWeek - this.getDay() + 7 * (orient || +1)) % 7;
315
- return this.addDays((diff === 0) ? diff += 7 * (orient || +1) : diff);
316
- };
317
- $P.moveToMonth = function(month, orient) {
318
- var diff = (month - this.getMonth() + 12 * (orient || +1)) % 12;
319
- return this.addMonths((diff === 0) ? diff += 12 * (orient || +1) : diff);
320
- };
321
- $P.getOrdinalNumber = function() {
322
- return Math.ceil((this.clone().clearTime() - new Date(this.getFullYear(), 0, 1)) / 86400000) + 1;
323
- };
324
- $P.getTimezone = function() {
325
- return $D.getTimezoneAbbreviation(this.getUTCOffset());
326
- };
327
- $P.setTimezoneOffset = function(offset) {
328
- var here = this.getTimezoneOffset(),there = Number(offset) * -6 / 10;
329
- return this.addMinutes(there - here);
330
- };
331
- $P.setTimezone = function(offset) {
332
- return this.setTimezoneOffset($D.getTimezoneOffset(offset));
333
- };
334
- $P.hasDaylightSavingTime = function() {
335
- return(Date.today().set({month:0,day:1}).getTimezoneOffset() !== Date.today().set({month:6,day:1}).getTimezoneOffset());
336
- };
337
- $P.isDaylightSavingTime = function() {
338
- return(this.hasDaylightSavingTime() && new Date().getTimezoneOffset() === Date.today().set({month:6,day:1}).getTimezoneOffset());
339
- };
340
- $P.getUTCOffset = function() {
341
- var n = this.getTimezoneOffset() * -10 / 6,r;
342
- if (n < 0) {
343
- r = (n - 10000).toString();
344
- return r.charAt(0) + r.substr(2);
345
- } else {
346
- r = (n + 10000).toString();
347
- return"+" + r.substr(1);
348
- }
349
- };
350
- $P.getElapsed = function(date) {
351
- return(date || new Date()) - this;
352
- };
353
- if (!$P.toISOString) {
354
- $P.toISOString = function() {
355
- function f(n) {
356
- return n < 10 ? '0' + n : n;
357
- }
22
+ var $D = Date,$P = $D.prototype,$C = $D.CultureInfo,p = function(s, l) {
23
+ if (!l) {
24
+ l = 2;
25
+ }
26
+ return("000" + s).slice(l * -1);
27
+ };
28
+ $P.clearTime = function() {
29
+ this.setHours(0);
30
+ this.setMinutes(0);
31
+ this.setSeconds(0);
32
+ this.setMilliseconds(0);
33
+ return this;
34
+ };
35
+ $P.setTimeToNow = function() {
36
+ var n = new Date();
37
+ this.setHours(n.getHours());
38
+ this.setMinutes(n.getMinutes());
39
+ this.setSeconds(n.getSeconds());
40
+ this.setMilliseconds(n.getMilliseconds());
41
+ return this;
42
+ };
43
+ $D.today = function() {
44
+ return new Date().clearTime();
45
+ };
46
+ $D.compare = function(date1, date2) {
47
+ if (isNaN(date1) || isNaN(date2)) {
48
+ throw new Error(date1 + " - " + date2);
49
+ } else if (date1 instanceof Date && date2 instanceof Date) {
50
+ return(date1 < date2) ? -1 : (date1 > date2) ? 1 : 0;
51
+ } else {
52
+ throw new TypeError(date1 + " - " + date2);
53
+ }
54
+ };
55
+ $D.equals = function(date1, date2) {
56
+ return(date1.compareTo(date2) === 0);
57
+ };
58
+ $D.getDayNumberFromName = function(name) {
59
+ var n = $C.dayNames,m = $C.abbreviatedDayNames,o = $C.shortestDayNames,s = name.toLowerCase();
60
+ for (var i = 0; i < n.length; i++) {
61
+ if (n[i].toLowerCase() == s || m[i].toLowerCase() == s || o[i].toLowerCase() == s) {
62
+ return i;
63
+ }
64
+ }
65
+ return-1;
66
+ };
67
+ $D.getMonthNumberFromName = function(name) {
68
+ var n = $C.monthNames,m = $C.abbreviatedMonthNames,s = name.toLowerCase();
69
+ for (var i = 0; i < n.length; i++) {
70
+ if (n[i].toLowerCase() == s || m[i].toLowerCase() == s) {
71
+ return i;
72
+ }
73
+ }
74
+ return-1;
75
+ };
76
+ $D.isLeapYear = function(year) {
77
+ return((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);
78
+ };
79
+ $D.getDaysInMonth = function(year, month) {
80
+ return[31,($D.isLeapYear(year) ? 29 : 28),31,30,31,30,31,31,30,31,30,31][month];
81
+ };
82
+ $D.getTimezoneAbbreviation = function(offset) {
83
+ var z = $C.timezones,p;
84
+ for (var i = 0; i < z.length; i++) {
85
+ if (z[i].offset === offset) {
86
+ return z[i].name;
87
+ }
88
+ }
89
+ return null;
90
+ };
91
+ $D.getTimezoneOffset = function(name) {
92
+ var z = $C.timezones,p;
93
+ for (var i = 0; i < z.length; i++) {
94
+ if (z[i].name === name.toUpperCase()) {
95
+ return z[i].offset;
96
+ }
97
+ }
98
+ return null;
99
+ };
100
+ $P.clone = function() {
101
+ return new Date(this.getTime());
102
+ };
103
+ $P.compareTo = function(date) {
104
+ return Date.compare(this, date);
105
+ };
106
+ $P.equals = function(date) {
107
+ return Date.equals(this, date || new Date());
108
+ };
109
+ $P.between = function(start, end) {
110
+ return this.getTime() >= start.getTime() && this.getTime() <= end.getTime();
111
+ };
112
+ $P.isAfter = function(date) {
113
+ return this.compareTo(date || new Date()) === 1;
114
+ };
115
+ $P.isBefore = function(date) {
116
+ return(this.compareTo(date || new Date()) === -1);
117
+ };
118
+ $P.isToday = function() {
119
+ return this.isSameDay(new Date());
120
+ };
121
+ $P.isSameDay = function(date) {
122
+ return this.clone().clearTime().equals(date.clone().clearTime());
123
+ };
124
+ $P.addMilliseconds = function(value) {
125
+ this.setMilliseconds(this.getMilliseconds() + value);
126
+ return this;
127
+ };
128
+ $P.addSeconds = function(value) {
129
+ return this.addMilliseconds(value * 1000);
130
+ };
131
+ $P.addMinutes = function(value) {
132
+ return this.addMilliseconds(value * 60000);
133
+ };
134
+ $P.addHours = function(value) {
135
+ return this.addMilliseconds(value * 3600000);
136
+ };
137
+ $P.addDays = function(value) {
138
+ this.setDate(this.getDate() + value);
139
+ return this;
140
+ };
141
+ $P.addWeeks = function(value) {
142
+ return this.addDays(value * 7);
143
+ };
144
+ $P.addMonths = function(value) {
145
+ var n = this.getDate();
146
+ this.setDate(1);
147
+ this.setMonth(this.getMonth() + value);
148
+ this.setDate(Math.min(n, $D.getDaysInMonth(this.getFullYear(), this.getMonth())));
149
+ return this;
150
+ };
151
+ $P.addYears = function(value) {
152
+ return this.addMonths(value * 12);
153
+ };
154
+ $P.add = function(config) {
155
+ if (typeof config == "number") {
156
+ this._orient = config;
157
+ return this;
158
+ }
159
+ var x = config;
160
+ if (x.milliseconds) {
161
+ this.addMilliseconds(x.milliseconds);
162
+ }
163
+ if (x.seconds) {
164
+ this.addSeconds(x.seconds);
165
+ }
166
+ if (x.minutes) {
167
+ this.addMinutes(x.minutes);
168
+ }
169
+ if (x.hours) {
170
+ this.addHours(x.hours);
171
+ }
172
+ if (x.weeks) {
173
+ this.addWeeks(x.weeks);
174
+ }
175
+ if (x.months) {
176
+ this.addMonths(x.months);
177
+ }
178
+ if (x.years) {
179
+ this.addYears(x.years);
180
+ }
181
+ if (x.days) {
182
+ this.addDays(x.days);
183
+ }
184
+ return this;
185
+ };
186
+ var $y,$m,$d;
187
+ $P.getWeek = function() {
188
+ var a,b,c,d,e,f,g,n,s,w;
189
+ $y = (!$y) ? this.getFullYear() : $y;
190
+ $m = (!$m) ? this.getMonth() + 1 : $m;
191
+ $d = (!$d) ? this.getDate() : $d;
192
+ if ($m <= 2) {
193
+ a = $y - 1;
194
+ b = (a / 4 | 0) - (a / 100 | 0) + (a / 400 | 0);
195
+ c = ((a - 1) / 4 | 0) - ((a - 1) / 100 | 0) + ((a - 1) / 400 | 0);
196
+ s = b - c;
197
+ e = 0;
198
+ f = $d - 1 + (31 * ($m - 1));
199
+ } else {
200
+ a = $y;
201
+ b = (a / 4 | 0) - (a / 100 | 0) + (a / 400 | 0);
202
+ c = ((a - 1) / 4 | 0) - ((a - 1) / 100 | 0) + ((a - 1) / 400 | 0);
203
+ s = b - c;
204
+ e = s + 1;
205
+ f = $d + ((153 * ($m - 3) + 2) / 5) + 58 + s;
206
+ }
207
+ g = (a + b) % 7;
208
+ d = (f + g - e) % 7;
209
+ n = (f + 3 - d) | 0;
210
+ if (n < 0) {
211
+ w = 53 - ((g - s) / 5 | 0);
212
+ } else if (n > 364 + s) {
213
+ w = 1;
214
+ } else {
215
+ w = (n / 7 | 0) + 1;
216
+ }
217
+ $y = $m = $d = null;
218
+ return w;
219
+ };
220
+ $P.getISOWeek = function() {
221
+ $y = this.getUTCFullYear();
222
+ $m = this.getUTCMonth() + 1;
223
+ $d = this.getUTCDate();
224
+ return p(this.getWeek());
225
+ };
226
+ $P.setWeek = function(n) {
227
+ return this.moveToDayOfWeek(1).addWeeks(n - this.getWeek());
228
+ };
229
+ $D._validate = function(n, min, max, name) {
230
+ if (typeof n == "undefined") {
231
+ return false;
232
+ } else if (typeof n != "number") {
233
+ throw new TypeError(n + " is not a Number.");
234
+ } else if (n < min || n > max) {
235
+ throw new RangeError(n + " is not a valid value for " + name + ".");
236
+ }
237
+ return true;
238
+ };
239
+ $D.validateMillisecond = function(value) {
240
+ return $D._validate(value, 0, 999, "millisecond");
241
+ };
242
+ $D.validateSecond = function(value) {
243
+ return $D._validate(value, 0, 59, "second");
244
+ };
245
+ $D.validateMinute = function(value) {
246
+ return $D._validate(value, 0, 59, "minute");
247
+ };
248
+ $D.validateHour = function(value) {
249
+ return $D._validate(value, 0, 23, "hour");
250
+ };
251
+ $D.validateDay = function(value, year, month) {
252
+ return $D._validate(value, 1, $D.getDaysInMonth(year, month), "day");
253
+ };
254
+ $D.validateMonth = function(value) {
255
+ return $D._validate(value, 0, 11, "month");
256
+ };
257
+ $D.validateYear = function(value) {
258
+ return $D._validate(value, 0, 9999, "year");
259
+ };
260
+ $P.set = function(config) {
261
+ if ($D.validateMillisecond(config.millisecond)) {
262
+ this.addMilliseconds(config.millisecond - this.getMilliseconds());
263
+ }
264
+ if ($D.validateSecond(config.second)) {
265
+ this.addSeconds(config.second - this.getSeconds());
266
+ }
267
+ if ($D.validateMinute(config.minute)) {
268
+ this.addMinutes(config.minute - this.getMinutes());
269
+ }
270
+ if ($D.validateHour(config.hour)) {
271
+ this.addHours(config.hour - this.getHours());
272
+ }
273
+ if ($D.validateMonth(config.month)) {
274
+ this.addMonths(config.month - this.getMonth());
275
+ }
276
+ if ($D.validateYear(config.year)) {
277
+ this.addYears(config.year - this.getFullYear());
278
+ }
279
+ if ($D.validateDay(config.day, this.getFullYear(), this.getMonth())) {
280
+ this.addDays(config.day - this.getDate());
281
+ }
282
+ if (config.timezone) {
283
+ this.setTimezone(config.timezone);
284
+ }
285
+ if (config.timezoneOffset) {
286
+ this.setTimezoneOffset(config.timezoneOffset);
287
+ }
288
+ if (config.week && $D._validate(config.week, 0, 53, "week")) {
289
+ this.setWeek(config.week);
290
+ }
291
+ return this;
292
+ };
293
+ $P.moveToFirstDayOfMonth = function() {
294
+ return this.set({day:1});
295
+ };
296
+ $P.moveToLastDayOfMonth = function() {
297
+ return this.set({day:$D.getDaysInMonth(this.getFullYear(), this.getMonth())});
298
+ };
299
+ $P.moveToNthOccurrence = function(dayOfWeek, occurrence) {
300
+ var shift = 0;
301
+ if (occurrence > 0) {
302
+ shift = occurrence - 1;
303
+ }
304
+ else if (occurrence === -1) {
305
+ this.moveToLastDayOfMonth();
306
+ if (this.getDay() !== dayOfWeek) {
307
+ this.moveToDayOfWeek(dayOfWeek, -1);
308
+ }
309
+ return this;
310
+ }
311
+ return this.moveToFirstDayOfMonth().addDays(-1).moveToDayOfWeek(dayOfWeek, +1).addWeeks(shift);
312
+ };
313
+ $P.moveToDayOfWeek = function(dayOfWeek, orient) {
314
+ var diff = (dayOfWeek - this.getDay() + 7 * (orient || +1)) % 7;
315
+ return this.addDays((diff === 0) ? diff += 7 * (orient || +1) : diff);
316
+ };
317
+ $P.moveToMonth = function(month, orient) {
318
+ var diff = (month - this.getMonth() + 12 * (orient || +1)) % 12;
319
+ return this.addMonths((diff === 0) ? diff += 12 * (orient || +1) : diff);
320
+ };
321
+ $P.getOrdinalNumber = function() {
322
+ return Math.ceil((this.clone().clearTime() - new Date(this.getFullYear(), 0, 1)) / 86400000) + 1;
323
+ };
324
+ $P.getTimezone = function() {
325
+ return $D.getTimezoneAbbreviation(this.getUTCOffset());
326
+ };
327
+ $P.setTimezoneOffset = function(offset) {
328
+ var here = this.getTimezoneOffset(),there = Number(offset) * -6 / 10;
329
+ return this.addMinutes(there - here);
330
+ };
331
+ $P.setTimezone = function(offset) {
332
+ return this.setTimezoneOffset($D.getTimezoneOffset(offset));
333
+ };
334
+ $P.hasDaylightSavingTime = function() {
335
+ return(Date.today().set({month:0,day:1}).getTimezoneOffset() !== Date.today().set({month:6,day:1}).getTimezoneOffset());
336
+ };
337
+ $P.isDaylightSavingTime = function() {
338
+ return(this.hasDaylightSavingTime() && new Date().getTimezoneOffset() === Date.today().set({month:6,day:1}).getTimezoneOffset());
339
+ };
340
+ $P.getUTCOffset = function() {
341
+ var n = this.getTimezoneOffset() * -10 / 6,r;
342
+ if (n < 0) {
343
+ r = (n - 10000).toString();
344
+ return r.charAt(0) + r.substr(2);
345
+ } else {
346
+ r = (n + 10000).toString();
347
+ return"+" + r.substr(1);
348
+ }
349
+ };
350
+ $P.getElapsed = function(date) {
351
+ return(date || new Date()) - this;
352
+ };
353
+ if (!$P.toISOString) {
354
+ $P.toISOString = function() {
355
+ function f(n) {
356
+ return n < 10 ? '0' + n : n;
357
+ }
358
358
 
359
- return'"' + this.getUTCFullYear() + '-' +
360
- f(this.getUTCMonth() + 1) + '-' +
361
- f(this.getUTCDate()) + 'T' +
362
- f(this.getUTCHours()) + ':' +
363
- f(this.getUTCMinutes()) + ':' +
364
- f(this.getUTCSeconds()) + 'Z"';
365
- };
366
- }
367
- $P._toString = $P.toString;
368
- $P.toString = function(format) {
369
- var x = this;
370
- if (format && format.length == 1) {
371
- var c = $C.formatPatterns;
372
- x.t = x.toString;
373
- switch (format) {case"d":return x.t(c.shortDate);case"D":return x.t(c.longDate);case"F":return x.t(c.fullDateTime);case"m":return x.t(c.monthDay);case"r":return x.t(c.rfc1123);case"s":return x.t(c.sortableDateTime);case"t":return x.t(c.shortTime);case"T":return x.t(c.longTime);case"u":return x.t(c.universalSortableDateTime);case"y":return x.t(c.yearMonth);
374
- }
375
- }
376
- var ord = function(n) {
377
- switch (n * 1) {case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";
378
- }
379
- };
380
- return format ? format.replace(/(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)/g, function(m) {
381
- if (m.charAt(0) === "\\") {
382
- return m.replace("\\", "");
383
- }
384
- x.h = x.getHours;
385
- switch (m) {case"hh":return p(x.h() < 13 ? (x.h() === 0 ? 12 : x.h()) : (x.h() - 12));case"h":return x.h() < 13 ? (x.h() === 0 ? 12 : x.h()) : (x.h() - 12);case"HH":return p(x.h());case"H":return x.h();case"mm":return p(x.getMinutes());case"m":return x.getMinutes();case"ss":return p(x.getSeconds());case"s":return x.getSeconds();case"yyyy":return p(x.getFullYear(), 4);case"yy":return p(x.getFullYear());case"dddd":return $C.dayNames[x.getDay()];case"ddd":return $C.abbreviatedDayNames[x.getDay()];case"dd":return p(x.getDate());case"d":return x.getDate();case"MMMM":return $C.monthNames[x.getMonth()];case"MMM":return $C.abbreviatedMonthNames[x.getMonth()];case"MM":return p((x.getMonth() + 1));case"M":return x.getMonth() + 1;case"t":return x.h() < 12 ? $C.amDesignator.substring(0, 1) : $C.pmDesignator.substring(0, 1);case"tt":return x.h() < 12 ? $C.amDesignator : $C.pmDesignator;case"S":return ord(x.getDate());default:return m;
386
- }
387
- }) : this._toString();
388
- };
359
+ return'"' + this.getUTCFullYear() + '-' +
360
+ f(this.getUTCMonth() + 1) + '-' +
361
+ f(this.getUTCDate()) + 'T' +
362
+ f(this.getUTCHours()) + ':' +
363
+ f(this.getUTCMinutes()) + ':' +
364
+ f(this.getUTCSeconds()) + 'Z"';
365
+ };
366
+ }
367
+ $P._toString = $P.toString;
368
+ $P.toString = function(format) {
369
+ var x = this;
370
+ if (format && format.length == 1) {
371
+ var c = $C.formatPatterns;
372
+ x.t = x.toString;
373
+ switch (format) {case"d":return x.t(c.shortDate);case"D":return x.t(c.longDate);case"F":return x.t(c.fullDateTime);case"m":return x.t(c.monthDay);case"r":return x.t(c.rfc1123);case"s":return x.t(c.sortableDateTime);case"t":return x.t(c.shortTime);case"T":return x.t(c.longTime);case"u":return x.t(c.universalSortableDateTime);case"y":return x.t(c.yearMonth);
374
+ }
375
+ }
376
+ var ord = function(n) {
377
+ switch (n * 1) {case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";
378
+ }
379
+ };
380
+ return format ? format.replace(/(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)/g, function(m) {
381
+ if (m.charAt(0) === "\\") {
382
+ return m.replace("\\", "");
383
+ }
384
+ x.h = x.getHours;
385
+ switch (m) {case"hh":return p(x.h() < 13 ? (x.h() === 0 ? 12 : x.h()) : (x.h() - 12));case"h":return x.h() < 13 ? (x.h() === 0 ? 12 : x.h()) : (x.h() - 12);case"HH":return p(x.h());case"H":return x.h();case"mm":return p(x.getMinutes());case"m":return x.getMinutes();case"ss":return p(x.getSeconds());case"s":return x.getSeconds();case"yyyy":return p(x.getFullYear(), 4);case"yy":return p(x.getFullYear());case"dddd":return $C.dayNames[x.getDay()];case"ddd":return $C.abbreviatedDayNames[x.getDay()];case"dd":return p(x.getDate());case"d":return x.getDate();case"MMMM":return $C.monthNames[x.getMonth()];case"MMM":return $C.abbreviatedMonthNames[x.getMonth()];case"MM":return p((x.getMonth() + 1));case"M":return x.getMonth() + 1;case"t":return x.h() < 12 ? $C.amDesignator.substring(0, 1) : $C.pmDesignator.substring(0, 1);case"tt":return x.h() < 12 ? $C.amDesignator : $C.pmDesignator;case"S":return ord(x.getDate());default:return m;
386
+ }
387
+ }) : this._toString();
388
+ };
389
389
  }());
390
390
  (function() {
391
- var $D = Date,$P = $D.prototype,$C = $D.CultureInfo,$N = Number.prototype;
392
- $P._orient = +1;
393
- $P._nth = null;
394
- $P._is = false;
395
- $P._same = false;
396
- $P._isSecond = false;
397
- $N._dateElement = "day";
398
- $P.next = function() {
399
- this._orient = +1;
400
- return this;
401
- };
402
- $D.next = function() {
403
- return $D.today().next();
404
- };
405
- $P.last = $P.prev = $P.previous = function() {
406
- this._orient = -1;
407
- return this;
408
- };
409
- $D.last = $D.prev = $D.previous = function() {
410
- return $D.today().last();
411
- };
412
- $P.is = function() {
413
- this._is = true;
391
+ var $D = Date,$P = $D.prototype,$C = $D.CultureInfo,$N = Number.prototype;
392
+ $P._orient = +1;
393
+ $P._nth = null;
394
+ $P._is = false;
395
+ $P._same = false;
396
+ $P._isSecond = false;
397
+ $N._dateElement = "day";
398
+ $P.next = function() {
399
+ this._orient = +1;
400
+ return this;
401
+ };
402
+ $D.next = function() {
403
+ return $D.today().next();
404
+ };
405
+ $P.last = $P.prev = $P.previous = function() {
406
+ this._orient = -1;
407
+ return this;
408
+ };
409
+ $D.last = $D.prev = $D.previous = function() {
410
+ return $D.today().last();
411
+ };
412
+ $P.is = function() {
413
+ this._is = true;
414
+ return this;
415
+ };
416
+ $P.same = function() {
417
+ this._same = true;
418
+ this._isSecond = false;
419
+ return this;
420
+ };
421
+ $P.today = function() {
422
+ return this.same().day();
423
+ };
424
+ $P.weekday = function() {
425
+ if (this._is) {
426
+ this._is = false;
427
+ return(!this.is().sat() && !this.is().sun());
428
+ }
429
+ return false;
430
+ };
431
+ $P.at = function(time) {
432
+ return(typeof time === "string") ? $D.parse(this.toString("d") + " " + time) : this.set(time);
433
+ };
434
+ $N.fromNow = $N.after = function(date) {
435
+ var c = {};
436
+ c[this._dateElement] = this;
437
+ return((!date) ? new Date() : date.clone()).add(c);
438
+ };
439
+ $N.ago = $N.before = function(date) {
440
+ var c = {};
441
+ c[this._dateElement] = this * -1;
442
+ return((!date) ? new Date() : date.clone()).add(c);
443
+ };
444
+ var dx = ("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),mx = ("january february march april may june july august september october november december").split(/\s/),px = ("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),pxf = ("Milliseconds Seconds Minutes Hours Date Week Month FullYear").split(/\s/),nth = ("final first second third fourth fifth").split(/\s/),de;
445
+ $P.toObject = function() {
446
+ var o = {};
447
+ for (var i = 0; i < px.length; i++) {
448
+ o[px[i].toLowerCase()] = this["get" + pxf[i]]();
449
+ }
450
+ return o;
451
+ };
452
+ $D.fromObject = function(config) {
453
+ config.week = null;
454
+ return Date.today().set(config);
455
+ };
456
+ var df = function(n) {
457
+ return function() {
458
+ if (this._is) {
459
+ this._is = false;
460
+ return this.getDay() == n;
461
+ }
462
+ if (this._nth !== null) {
463
+ if (this._isSecond) {
464
+ this.addSeconds(this._orient * -1);
465
+ }
466
+ this._isSecond = false;
467
+ var ntemp = this._nth;
468
+ this._nth = null;
469
+ var temp = this.clone().moveToLastDayOfMonth();
470
+ this.moveToNthOccurrence(n, ntemp);
471
+ if (this > temp) {
472
+ throw new RangeError($D.getDayName(n) + " does not occur " + ntemp + " times in the month of " + $D.getMonthName(temp.getMonth()) + " " + temp.getFullYear() + ".");
473
+ }
414
474
  return this;
415
- };
416
- $P.same = function() {
417
- this._same = true;
475
+ }
476
+ return this.moveToDayOfWeek(n, this._orient);
477
+ };
478
+ };
479
+ var sdf = function(n) {
480
+ return function() {
481
+ var t = $D.today(),shift = n - t.getDay();
482
+ if (n === 0 && $C.firstDayOfWeek === 1 && t.getDay() !== 0) {
483
+ shift = shift + 7;
484
+ }
485
+ return t.addDays(shift);
486
+ };
487
+ };
488
+ for (var i = 0; i < dx.length; i++) {
489
+ $D[dx[i].toUpperCase()] = $D[dx[i].toUpperCase().substring(0, 3)] = i;
490
+ $D[dx[i]] = $D[dx[i].substring(0, 3)] = sdf(i);
491
+ $P[dx[i]] = $P[dx[i].substring(0, 3)] = df(i);
492
+ }
493
+ var mf = function(n) {
494
+ return function() {
495
+ if (this._is) {
496
+ this._is = false;
497
+ return this.getMonth() === n;
498
+ }
499
+ return this.moveToMonth(n, this._orient);
500
+ };
501
+ };
502
+ var smf = function(n) {
503
+ return function() {
504
+ return $D.today().set({month:n,day:1});
505
+ };
506
+ };
507
+ for (var j = 0; j < mx.length; j++) {
508
+ $D[mx[j].toUpperCase()] = $D[mx[j].toUpperCase().substring(0, 3)] = j;
509
+ $D[mx[j]] = $D[mx[j].substring(0, 3)] = smf(j);
510
+ $P[mx[j]] = $P[mx[j].substring(0, 3)] = mf(j);
511
+ }
512
+ var ef = function(j) {
513
+ return function() {
514
+ if (this._isSecond) {
418
515
  this._isSecond = false;
419
516
  return this;
420
- };
421
- $P.today = function() {
422
- return this.same().day();
423
- };
424
- $P.weekday = function() {
425
- if (this._is) {
426
- this._is = false;
427
- return(!this.is().sat() && !this.is().sun());
428
- }
429
- return false;
430
- };
431
- $P.at = function(time) {
432
- return(typeof time === "string") ? $D.parse(this.toString("d") + " " + time) : this.set(time);
433
- };
434
- $N.fromNow = $N.after = function(date) {
435
- var c = {};
436
- c[this._dateElement] = this;
437
- return((!date) ? new Date() : date.clone()).add(c);
438
- };
439
- $N.ago = $N.before = function(date) {
440
- var c = {};
441
- c[this._dateElement] = this * -1;
442
- return((!date) ? new Date() : date.clone()).add(c);
443
- };
444
- var dx = ("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),mx = ("january february march april may june july august september october november december").split(/\s/),px = ("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),pxf = ("Milliseconds Seconds Minutes Hours Date Week Month FullYear").split(/\s/),nth = ("final first second third fourth fifth").split(/\s/),de;
445
- $P.toObject = function() {
446
- var o = {};
447
- for (var i = 0; i < px.length; i++) {
448
- o[px[i].toLowerCase()] = this["get" + pxf[i]]();
517
+ }
518
+ if (this._same) {
519
+ this._same = this._is = false;
520
+ var o1 = this.toObject(),o2 = (arguments[0] || new Date()).toObject(),v = "",k = j.toLowerCase();
521
+ for (var m = (px.length - 1); m > -1; m--) {
522
+ v = px[m].toLowerCase();
523
+ if (o1[v] != o2[v]) {
524
+ return false;
525
+ }
526
+ if (k == v) {
527
+ break;
528
+ }
449
529
  }
450
- return o;
451
- };
452
- $D.fromObject = function(config) {
453
- config.week = null;
454
- return Date.today().set(config);
455
- };
456
- var df = function(n) {
457
- return function() {
458
- if (this._is) {
459
- this._is = false;
460
- return this.getDay() == n;
461
- }
462
- if (this._nth !== null) {
463
- if (this._isSecond) {
464
- this.addSeconds(this._orient * -1);
465
- }
466
- this._isSecond = false;
467
- var ntemp = this._nth;
468
- this._nth = null;
469
- var temp = this.clone().moveToLastDayOfMonth();
470
- this.moveToNthOccurrence(n, ntemp);
471
- if (this > temp) {
472
- throw new RangeError($D.getDayName(n) + " does not occur " + ntemp + " times in the month of " + $D.getMonthName(temp.getMonth()) + " " + temp.getFullYear() + ".");
473
- }
474
- return this;
475
- }
476
- return this.moveToDayOfWeek(n, this._orient);
477
- };
478
- };
479
- var sdf = function(n) {
480
- return function() {
481
- var t = $D.today(),shift = n - t.getDay();
482
- if (n === 0 && $C.firstDayOfWeek === 1 && t.getDay() !== 0) {
483
- shift = shift + 7;
484
- }
485
- return t.addDays(shift);
486
- };
487
- };
488
- for (var i = 0; i < dx.length; i++) {
489
- $D[dx[i].toUpperCase()] = $D[dx[i].toUpperCase().substring(0, 3)] = i;
490
- $D[dx[i]] = $D[dx[i].substring(0, 3)] = sdf(i);
491
- $P[dx[i]] = $P[dx[i].substring(0, 3)] = df(i);
492
- }
493
- var mf = function(n) {
494
- return function() {
495
- if (this._is) {
496
- this._is = false;
497
- return this.getMonth() === n;
498
- }
499
- return this.moveToMonth(n, this._orient);
500
- };
501
- };
502
- var smf = function(n) {
503
- return function() {
504
- return $D.today().set({month:n,day:1});
505
- };
506
- };
507
- for (var j = 0; j < mx.length; j++) {
508
- $D[mx[j].toUpperCase()] = $D[mx[j].toUpperCase().substring(0, 3)] = j;
509
- $D[mx[j]] = $D[mx[j].substring(0, 3)] = smf(j);
510
- $P[mx[j]] = $P[mx[j].substring(0, 3)] = mf(j);
511
- }
512
- var ef = function(j) {
513
- return function() {
514
- if (this._isSecond) {
515
- this._isSecond = false;
516
- return this;
517
- }
518
- if (this._same) {
519
- this._same = this._is = false;
520
- var o1 = this.toObject(),o2 = (arguments[0] || new Date()).toObject(),v = "",k = j.toLowerCase();
521
- for (var m = (px.length - 1); m > -1; m--) {
522
- v = px[m].toLowerCase();
523
- if (o1[v] != o2[v]) {
524
- return false;
525
- }
526
- if (k == v) {
527
- break;
528
- }
529
- }
530
- return true;
531
- }
532
- if (j.substring(j.length - 1) != "s") {
533
- j += "s";
534
- }
535
- return this["add" + j](this._orient);
536
- };
537
- };
538
- var nf = function(n) {
539
- return function() {
540
- this._dateElement = n;
541
- return this;
542
- };
543
- };
544
- for (var k = 0; k < px.length; k++) {
545
- de = px[k].toLowerCase();
546
- $P[de] = $P[de + "s"] = ef(px[k]);
547
- $N[de] = $N[de + "s"] = nf(de);
548
- }
549
- $P._ss = ef("Second");
550
- var nthfn = function(n) {
551
- return function(dayOfWeek) {
552
- if (this._same) {
553
- return this._ss(arguments[0]);
554
- }
555
- if (dayOfWeek || dayOfWeek === 0) {
556
- return this.moveToNthOccurrence(dayOfWeek, n);
557
- }
558
- this._nth = n;
559
- if (n === 2 && (dayOfWeek === undefined || dayOfWeek === null)) {
560
- this._isSecond = true;
561
- return this.addSeconds(this._orient);
562
- }
563
- return this;
564
- };
565
- };
566
- for (var l = 0; l < nth.length; l++) {
567
- $P[nth[l]] = (l === 0) ? nthfn(-1) : nthfn(l);
568
- }
530
+ return true;
531
+ }
532
+ if (j.substring(j.length - 1) != "s") {
533
+ j += "s";
534
+ }
535
+ return this["add" + j](this._orient);
536
+ };
537
+ };
538
+ var nf = function(n) {
539
+ return function() {
540
+ this._dateElement = n;
541
+ return this;
542
+ };
543
+ };
544
+ for (var k = 0; k < px.length; k++) {
545
+ de = px[k].toLowerCase();
546
+ $P[de] = $P[de + "s"] = ef(px[k]);
547
+ $N[de] = $N[de + "s"] = nf(de);
548
+ }
549
+ $P._ss = ef("Second");
550
+ var nthfn = function(n) {
551
+ return function(dayOfWeek) {
552
+ if (this._same) {
553
+ return this._ss(arguments[0]);
554
+ }
555
+ if (dayOfWeek || dayOfWeek === 0) {
556
+ return this.moveToNthOccurrence(dayOfWeek, n);
557
+ }
558
+ this._nth = n;
559
+ if (n === 2 && (dayOfWeek === undefined || dayOfWeek === null)) {
560
+ this._isSecond = true;
561
+ return this.addSeconds(this._orient);
562
+ }
563
+ return this;
564
+ };
565
+ };
566
+ for (var l = 0; l < nth.length; l++) {
567
+ $P[nth[l]] = (l === 0) ? nthfn(-1) : nthfn(l);
568
+ }
569
569
  }());
570
570
  (function() {
571
- Date.Parsing = {Exception:function(s) {
572
- this.message = "Parse error at '" + s.substring(0, 10) + " ...'";
573
- }};
574
- var $P = Date.Parsing;
575
- var _ = $P.Operators = {rtoken:function(r) {
576
- return function(s) {
577
- var mx = s.match(r);
578
- if (mx) {
579
- return([mx[0],s.substring(mx[0].length)]);
580
- } else {
581
- throw new $P.Exception(s);
582
- }
583
- };
584
- },token:function(s) {
585
- return function(s) {
586
- return _.rtoken(new RegExp("^\s*" + s + "\s*"))(s);
587
- };
588
- },stoken:function(s) {
589
- return _.rtoken(new RegExp("^" + s));
590
- },until:function(p) {
591
- return function(s) {
592
- var qx = [],rx = null;
593
- while (s.length) {
594
- try {
595
- rx = p.call(this, s);
596
- } catch(e) {
597
- qx.push(rx[0]);
598
- s = rx[1];
599
- continue;
600
- }
601
- break;
602
- }
603
- return[qx,s];
604
- };
605
- },many:function(p) {
606
- return function(s) {
607
- var rx = [],r = null;
608
- while (s.length) {
609
- try {
610
- r = p.call(this, s);
611
- } catch(e) {
612
- return[rx,s];
613
- }
614
- rx.push(r[0]);
615
- s = r[1];
616
- }
617
- return[rx,s];
618
- };
619
- },optional:function(p) {
620
- return function(s) {
621
- var r = null;
622
- try {
623
- r = p.call(this, s);
624
- } catch(e) {
625
- return[null,s];
626
- }
627
- return[r[0],r[1]];
628
- };
629
- },not:function(p) {
630
- return function(s) {
631
- try {
632
- p.call(this, s);
633
- } catch(e) {
634
- return[null,s];
635
- }
636
- throw new $P.Exception(s);
637
- };
638
- },ignore:function(p) {
639
- return p ? function(s) {
640
- var r = null;
641
- r = p.call(this, s);
642
- return[null,r[1]];
643
- } : null;
644
- },product:function() {
645
- var px = arguments[0],qx = Array.prototype.slice.call(arguments, 1),rx = [];
646
- for (var i = 0; i < px.length; i++) {
647
- rx.push(_.each(px[i], qx));
648
- }
649
- return rx;
650
- },cache:function(rule) {
651
- var cache = {},r = null;
652
- return function(s) {
653
- try {
654
- r = cache[s] = (cache[s] || rule.call(this, s));
655
- } catch(e) {
656
- r = cache[s] = e;
657
- }
658
- if (r instanceof $P.Exception) {
659
- throw r;
660
- } else {
661
- return r;
662
- }
663
- };
664
- },any:function() {
665
- var px = arguments;
666
- return function(s) {
667
- var r = null;
668
- for (var i = 0; i < px.length; i++) {
669
- if (px[i] == null) {
670
- continue;
671
- }
672
- try {
673
- r = (px[i].call(this, s));
674
- } catch(e) {
675
- r = null;
676
- }
677
- if (r) {
678
- return r;
679
- }
680
- }
681
- throw new $P.Exception(s);
682
- };
683
- },each:function() {
684
- var px = arguments;
685
- return function(s) {
686
- var rx = [],r = null;
687
- for (var i = 0; i < px.length; i++) {
688
- if (px[i] == null) {
689
- continue;
690
- }
691
- try {
692
- r = (px[i].call(this, s));
693
- } catch(e) {
694
- throw new $P.Exception(s);
695
- }
696
- rx.push(r[0]);
697
- s = r[1];
698
- }
699
- return[rx,s];
700
- };
701
- },all:function() {
702
- var px = arguments,_ = _;
703
- return _.each(_.optional(px));
704
- },sequence:function(px, d, c) {
705
- d = d || _.rtoken(/^\s*/);
706
- c = c || null;
707
- if (px.length == 1) {
708
- return px[0];
709
- }
710
- return function(s) {
711
- var r = null,q = null;
712
- var rx = [];
713
- for (var i = 0; i < px.length; i++) {
714
- try {
715
- r = px[i].call(this, s);
716
- } catch(e) {
717
- break;
718
- }
719
- rx.push(r[0]);
720
- try {
721
- q = d.call(this, r[1]);
722
- } catch(ex) {
723
- q = null;
724
- break;
725
- }
726
- s = q[1];
727
- }
728
- if (!r) {
729
- throw new $P.Exception(s);
730
- }
731
- if (q) {
732
- throw new $P.Exception(q[1]);
733
- }
734
- if (c) {
735
- try {
736
- r = c.call(this, r[1]);
737
- } catch(ey) {
738
- throw new $P.Exception(r[1]);
739
- }
740
- }
741
- return[rx,(r ? r[1] : s)];
742
- };
743
- },between:function(d1, p, d2) {
744
- d2 = d2 || d1;
745
- var _fn = _.each(_.ignore(d1), p, _.ignore(d2));
746
- return function(s) {
747
- var rx = _fn.call(this, s);
748
- return[
749
- [rx[0][0],r[0][2]],
750
- rx[1]
751
- ];
752
- };
753
- },list:function(p, d, c) {
754
- d = d || _.rtoken(/^\s*/);
755
- c = c || null;
756
- return(p instanceof Array ? _.each(_.product(p.slice(0, -1), _.ignore(d)), p.slice(-1), _.ignore(c)) : _.each(_.many(_.each(p, _.ignore(d))), px, _.ignore(c)));
757
- },set:function(px, d, c) {
758
- d = d || _.rtoken(/^\s*/);
759
- c = c || null;
760
- return function(s) {
761
- var r = null,p = null,q = null,rx = null,best = [
762
- [],
763
- s
764
- ],last = false;
765
- for (var i = 0; i < px.length; i++) {
766
- q = null;
767
- p = null;
768
- r = null;
769
- last = (px.length == 1);
770
- try {
771
- r = px[i].call(this, s);
772
- } catch(e) {
773
- continue;
774
- }
775
- rx = [
776
- [r[0]],
777
- r[1]
778
- ];
779
- if (r[1].length > 0 && !last) {
780
- try {
781
- q = d.call(this, r[1]);
782
- } catch(ex) {
783
- last = true;
784
- }
785
- } else {
786
- last = true;
787
- }
788
- if (!last && q[1].length === 0) {
789
- last = true;
790
- }
791
- if (!last) {
792
- var qx = [];
793
- for (var j = 0; j < px.length; j++) {
794
- if (i != j) {
795
- qx.push(px[j]);
796
- }
797
- }
798
- p = _.set(qx, d).call(this, q[1]);
799
- if (p[0].length > 0) {
800
- rx[0] = rx[0].concat(p[0]);
801
- rx[1] = p[1];
802
- }
803
- }
804
- if (rx[1].length < best[1].length) {
805
- best = rx;
806
- }
807
- if (best[1].length === 0) {
808
- break;
809
- }
810
- }
811
- if (best[0].length === 0) {
812
- return best;
813
- }
814
- if (c) {
815
- try {
816
- q = c.call(this, best[1]);
817
- } catch(ey) {
818
- throw new $P.Exception(best[1]);
819
- }
820
- best[1] = q[1];
821
- }
822
- return best;
823
- };
824
- },forward:function(gr, fname) {
825
- return function(s) {
826
- return gr[fname].call(this, s);
827
- };
828
- },replace:function(rule, repl) {
829
- return function(s) {
830
- var r = rule.call(this, s);
831
- return[repl,r[1]];
832
- };
833
- },process:function(rule, fn) {
834
- return function(s) {
835
- var r = rule.call(this, s);
836
- return[fn.call(this, r[0]),r[1]];
837
- };
838
- },min:function(min, rule) {
839
- return function(s) {
840
- var rx = rule.call(this, s);
841
- if (rx[0].length < min) {
842
- throw new $P.Exception(s);
843
- }
844
- return rx;
845
- };
846
- }};
847
- var _generator = function(op) {
848
- return function() {
849
- var args = null,rx = [];
850
- if (arguments.length > 1) {
851
- args = Array.prototype.slice.call(arguments);
852
- } else if (arguments[0]instanceof Array) {
853
- args = arguments[0];
854
- }
855
- if (args) {
856
- for (var i = 0, px = args.shift(); i < px.length; i++) {
857
- args.unshift(px[i]);
858
- rx.push(op.apply(null, args));
859
- args.shift();
860
- return rx;
861
- }
862
- } else {
863
- return op.apply(null, arguments);
864
- }
865
- };
866
- };
867
- var gx = "optional not ignore cache".split(/\s/);
868
- for (var i = 0; i < gx.length; i++) {
869
- _[gx[i]] = _generator(_[gx[i]]);
870
- }
871
- var _vector = function(op) {
872
- return function() {
873
- if (arguments[0]instanceof Array) {
874
- return op.apply(null, arguments[0]);
875
- } else {
876
- return op.apply(null, arguments);
877
- }
878
- };
879
- };
880
- var vx = "each any all".split(/\s/);
881
- for (var j = 0; j < vx.length; j++) {
882
- _[vx[j]] = _vector(_[vx[j]]);
571
+ Date.Parsing = {Exception:function(s) {
572
+ this.message = "Parse error at '" + s.substring(0, 10) + " ...'";
573
+ }};
574
+ var $P = Date.Parsing;
575
+ var _ = $P.Operators = {rtoken:function(r) {
576
+ return function(s) {
577
+ var mx = s.match(r);
578
+ if (mx) {
579
+ return([mx[0],s.substring(mx[0].length)]);
580
+ } else {
581
+ throw new $P.Exception(s);
582
+ }
583
+ };
584
+ },token:function(s) {
585
+ return function(s) {
586
+ return _.rtoken(new RegExp("^\s*" + s + "\s*"))(s);
587
+ };
588
+ },stoken:function(s) {
589
+ return _.rtoken(new RegExp("^" + s));
590
+ },until:function(p) {
591
+ return function(s) {
592
+ var qx = [],rx = null;
593
+ while (s.length) {
594
+ try {
595
+ rx = p.call(this, s);
596
+ } catch(e) {
597
+ qx.push(rx[0]);
598
+ s = rx[1];
599
+ continue;
600
+ }
601
+ break;
602
+ }
603
+ return[qx,s];
604
+ };
605
+ },many:function(p) {
606
+ return function(s) {
607
+ var rx = [],r = null;
608
+ while (s.length) {
609
+ try {
610
+ r = p.call(this, s);
611
+ } catch(e) {
612
+ return[rx,s];
613
+ }
614
+ rx.push(r[0]);
615
+ s = r[1];
616
+ }
617
+ return[rx,s];
618
+ };
619
+ },optional:function(p) {
620
+ return function(s) {
621
+ var r = null;
622
+ try {
623
+ r = p.call(this, s);
624
+ } catch(e) {
625
+ return[null,s];
626
+ }
627
+ return[r[0],r[1]];
628
+ };
629
+ },not:function(p) {
630
+ return function(s) {
631
+ try {
632
+ p.call(this, s);
633
+ } catch(e) {
634
+ return[null,s];
635
+ }
636
+ throw new $P.Exception(s);
637
+ };
638
+ },ignore:function(p) {
639
+ return p ? function(s) {
640
+ var r = null;
641
+ r = p.call(this, s);
642
+ return[null,r[1]];
643
+ } : null;
644
+ },product:function() {
645
+ var px = arguments[0],qx = Array.prototype.slice.call(arguments, 1),rx = [];
646
+ for (var i = 0; i < px.length; i++) {
647
+ rx.push(_.each(px[i], qx));
883
648
  }
884
- }());
885
- (function() {
886
- var $D = Date,$P = $D.prototype,$C = $D.CultureInfo;
887
- var flattenAndCompact = function(ax) {
888
- var rx = [];
889
- for (var i = 0; i < ax.length; i++) {
890
- if (ax[i]instanceof Array) {
891
- rx = rx.concat(flattenAndCompact(ax[i]));
892
- } else {
893
- if (ax[i]) {
894
- rx.push(ax[i]);
895
- }
896
- }
897
- }
898
- return rx;
899
- };
900
- $D.Grammar = {};
901
- $D.Translator = {hour:function(s) {
902
- return function() {
903
- this.hour = Number(s);
904
- };
905
- },minute:function(s) {
906
- return function() {
907
- this.minute = Number(s);
908
- };
909
- },second:function(s) {
910
- return function() {
911
- this.second = Number(s);
912
- };
913
- },meridian:function(s) {
914
- return function() {
915
- this.meridian = s.slice(0, 1).toLowerCase();
916
- };
917
- },timezone:function(s) {
918
- return function() {
919
- var n = s.replace(/[^\d\+\-]/g, "");
920
- if (n.length) {
921
- this.timezoneOffset = Number(n);
922
- } else {
923
- this.timezone = s.toLowerCase();
924
- }
925
- };
926
- },day:function(x) {
927
- var s = x[0];
928
- return function() {
929
- this.day = Number(s.match(/\d+/)[0]);
930
- };
931
- },month:function(s) {
932
- return function() {
933
- this.month = (s.length == 3) ? "jan feb mar apr may jun jul aug sep oct nov dec".indexOf(s) / 4 : Number(s) - 1;
934
- };
935
- },year:function(s) {
936
- return function() {
937
- var n = Number(s);
938
- this.year = ((s.length > 2) ? n : (n + (((n + 2000) < $C.twoDigitYearMax) ? 2000 : 1900)));
939
- };
940
- },rday:function(s) {
941
- return function() {
942
- switch (s) {case"yesterday":this.days = -1;break;case"tomorrow":this.days = 1;break;case"today":this.days = 0;break;case"now":this.days = 0;this.now = true;break;
943
- }
944
- };
945
- },finishExact:function(x) {
946
- x = (x instanceof Array) ? x : [x];
947
- for (var i = 0; i < x.length; i++) {
948
- if (x[i]) {
949
- x[i].call(this);
950
- }
951
- }
952
- var now = new Date();
953
- if ((this.hour || this.minute) && (!this.month && !this.year && !this.day)) {
954
- this.day = now.getDate();
955
- }
956
- if (!this.year) {
957
- this.year = now.getFullYear();
958
- }
959
- if (!this.month && this.month !== 0) {
960
- this.month = now.getMonth();
961
- }
962
- if (!this.day) {
963
- this.day = 1;
964
- }
965
- if (!this.hour) {
966
- this.hour = 0;
967
- }
968
- if (!this.minute) {
969
- this.minute = 0;
970
- }
971
- if (!this.second) {
972
- this.second = 0;
973
- }
974
- if (this.meridian && this.hour) {
975
- if (this.meridian == "p" && this.hour < 12) {
976
- this.hour = this.hour + 12;
977
- } else if (this.meridian == "a" && this.hour == 12) {
978
- this.hour = 0;
979
- }
980
- }
981
- if (this.day > $D.getDaysInMonth(this.year, this.month)) {
982
- throw new RangeError(this.day + " is not a valid value for days.");
983
- }
984
- var r = new Date(this.year, this.month, this.day, this.hour, this.minute, this.second);
985
- if (this.timezone) {
986
- r.set({timezone:this.timezone});
987
- } else if (this.timezoneOffset) {
988
- r.set({timezoneOffset:this.timezoneOffset});
989
- }
649
+ return rx;
650
+ },cache:function(rule) {
651
+ var cache = {},r = null;
652
+ return function(s) {
653
+ try {
654
+ r = cache[s] = (cache[s] || rule.call(this, s));
655
+ } catch(e) {
656
+ r = cache[s] = e;
657
+ }
658
+ if (r instanceof $P.Exception) {
659
+ throw r;
660
+ } else {
990
661
  return r;
991
- },finish:function(x) {
992
- x = (x instanceof Array) ? flattenAndCompact(x) : [x];
993
- if (x.length === 0) {
994
- return null;
995
- }
996
- for (var i = 0; i < x.length; i++) {
997
- if (typeof x[i] == "function") {
998
- x[i].call(this);
999
- }
1000
- }
1001
- var today = $D.today();
1002
- if (this.now && !this.unit && !this.operator) {
1003
- return new Date();
1004
- } else if (this.now) {
1005
- today = new Date();
1006
- }
1007
- var expression = !!(this.days && this.days !== null || this.orient || this.operator);
1008
- var gap,mod,orient;
1009
- orient = ((this.orient == "past" || this.operator == "subtract") ? -1 : 1);
1010
- if (!this.now && "hour minute second".indexOf(this.unit) != -1) {
1011
- today.setTimeToNow();
1012
- }
1013
- if (this.month || this.month === 0) {
1014
- if ("year day hour minute second".indexOf(this.unit) != -1) {
1015
- this.value = this.month + 1;
1016
- this.month = null;
1017
- expression = true;
1018
- }
1019
- }
1020
- if (!expression && this.weekday && !this.day && !this.days) {
1021
- var temp = Date[this.weekday]();
1022
- this.day = temp.getDate();
1023
- if (!this.month) {
1024
- this.month = temp.getMonth();
1025
- }
1026
- this.year = temp.getFullYear();
1027
- }
1028
- if (expression && this.weekday && this.unit != "month") {
1029
- this.unit = "day";
1030
- gap = ($D.getDayNumberFromName(this.weekday) - today.getDay());
1031
- mod = 7;
1032
- this.days = gap ? ((gap + (orient * mod)) % mod) : (orient * mod);
1033
- }
1034
- if (this.month && this.unit == "day" && this.operator) {
1035
- this.value = (this.month + 1);
1036
- this.month = null;
1037
- }
1038
- if (this.value != null && this.month != null && this.year != null) {
1039
- this.day = this.value * 1;
1040
- }
1041
- if (this.month && !this.day && this.value) {
1042
- today.set({day:this.value * 1});
1043
- if (!expression) {
1044
- this.day = this.value * 1;
1045
- }
1046
- }
1047
- if (!this.month && this.value && this.unit == "month" && !this.now) {
1048
- this.month = this.value;
1049
- expression = true;
1050
- }
1051
- if (expression && (this.month || this.month === 0) && this.unit != "year") {
1052
- this.unit = "month";
1053
- gap = (this.month - today.getMonth());
1054
- mod = 12;
1055
- this.months = gap ? ((gap + (orient * mod)) % mod) : (orient * mod);
1056
- this.month = null;
1057
- }
1058
- if (!this.unit) {
1059
- this.unit = "day";
1060
- }
1061
- if (!this.value && this.operator && this.operator !== null && this[this.unit + "s"] && this[this.unit + "s"] !== null) {
1062
- this[this.unit + "s"] = this[this.unit + "s"] + ((this.operator == "add") ? 1 : -1) + (this.value || 0) * orient;
1063
- } else if (this[this.unit + "s"] == null || this.operator != null) {
1064
- if (!this.value) {
1065
- this.value = 1;
1066
- }
1067
- this[this.unit + "s"] = this.value * orient;
1068
- }
1069
- if (this.meridian && this.hour) {
1070
- if (this.meridian == "p" && this.hour < 12) {
1071
- this.hour = this.hour + 12;
1072
- } else if (this.meridian == "a" && this.hour == 12) {
1073
- this.hour = 0;
1074
- }
1075
- }
1076
- if (this.weekday && !this.day && !this.days) {
1077
- var temp = Date[this.weekday]();
1078
- this.day = temp.getDate();
1079
- if (temp.getMonth() !== today.getMonth()) {
1080
- this.month = temp.getMonth();
1081
- }
1082
- }
1083
- if ((this.month || this.month === 0) && !this.day) {
1084
- this.day = 1;
1085
- }
1086
- if (!this.orient && !this.operator && this.unit == "week" && this.value && !this.day && !this.month) {
1087
- return Date.today().setWeek(this.value);
1088
- }
1089
- if (expression && this.timezone && this.day && this.days) {
1090
- this.day = this.days;
1091
- }
1092
- return(expression) ? today.add(this) : today.set(this);
1093
- }};
1094
- var _ = $D.Parsing.Operators,g = $D.Grammar,t = $D.Translator,_fn;
1095
- g.datePartDelimiter = _.rtoken(/^([\s\-\.\,\/\x27]+)/);
1096
- g.timePartDelimiter = _.stoken(":");
1097
- g.whiteSpace = _.rtoken(/^\s*/);
1098
- g.generalDelimiter = _.rtoken(/^(([\s\,]|at|@|on)+)/);
1099
- var _C = {};
1100
- g.ctoken = function(keys) {
1101
- var fn = _C[keys];
1102
- if (!fn) {
1103
- var c = $C.regexPatterns;
1104
- var kx = keys.split(/\s+/),px = [];
1105
- for (var i = 0; i < kx.length; i++) {
1106
- px.push(_.replace(_.rtoken(c[kx[i]]), kx[i]));
1107
- }
1108
- fn = _C[keys] = _.any.apply(null, px);
1109
- }
1110
- return fn;
1111
- };
1112
- g.ctoken2 = function(key) {
1113
- return _.rtoken($C.regexPatterns[key]);
1114
- };
1115
- g.h = _.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/), t.hour));
1116
- g.hh = _.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/), t.hour));
1117
- g.H = _.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/), t.hour));
1118
- g.HH = _.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/), t.hour));
1119
- g.m = _.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/), t.minute));
1120
- g.mm = _.cache(_.process(_.rtoken(/^[0-5][0-9]/), t.minute));
1121
- g.s = _.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/), t.second));
1122
- g.ss = _.cache(_.process(_.rtoken(/^[0-5][0-9]/), t.second));
1123
- g.hms = _.cache(_.sequence([g.H,g.m,g.s], g.timePartDelimiter));
1124
- g.t = _.cache(_.process(g.ctoken2("shortMeridian"), t.meridian));
1125
- g.tt = _.cache(_.process(g.ctoken2("longMeridian"), t.meridian));
1126
- g.z = _.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/), t.timezone));
1127
- g.zz = _.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/), t.timezone));
1128
- g.zzz = _.cache(_.process(g.ctoken2("timezone"), t.timezone));
1129
- g.timeSuffix = _.each(_.ignore(g.whiteSpace), _.set([g.tt,g.zzz]));
1130
- g.time = _.each(_.optional(_.ignore(_.stoken("T"))), g.hms, g.timeSuffix);
1131
- g.d = _.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/), _.optional(g.ctoken2("ordinalSuffix"))), t.day));
1132
- g.dd = _.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/), _.optional(g.ctoken2("ordinalSuffix"))), t.day));
1133
- g.ddd = g.dddd = _.cache(_.process(g.ctoken("sun mon tue wed thu fri sat"), function(s) {
1134
- return function() {
1135
- this.weekday = s;
1136
- };
1137
- }));
1138
- g.M = _.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/), t.month));
1139
- g.MM = _.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/), t.month));
1140
- g.MMM = g.MMMM = _.cache(_.process(g.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"), t.month));
1141
- g.y = _.cache(_.process(_.rtoken(/^(\d\d?)/), t.year));
1142
- g.yy = _.cache(_.process(_.rtoken(/^(\d\d)/), t.year));
1143
- g.yyy = _.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/), t.year));
1144
- g.yyyy = _.cache(_.process(_.rtoken(/^(\d\d\d\d)/), t.year));
1145
- _fn = function() {
1146
- return _.each(_.any.apply(null, arguments), _.not(g.ctoken2("timeContext")));
662
+ }
1147
663
  };
1148
- g.day = _fn(g.d, g.dd);
1149
- g.month = _fn(g.M, g.MMM);
1150
- g.year = _fn(g.yyyy, g.yy);
1151
- g.orientation = _.process(g.ctoken("past future"), function(s) {
1152
- return function() {
1153
- this.orient = s;
1154
- };
1155
- });
1156
- g.operator = _.process(g.ctoken("add subtract"), function(s) {
1157
- return function() {
1158
- this.operator = s;
1159
- };
1160
- });
1161
- g.rday = _.process(g.ctoken("yesterday tomorrow today now"), t.rday);
1162
- g.unit = _.process(g.ctoken("second minute hour day week month year"), function(s) {
1163
- return function() {
1164
- this.unit = s;
1165
- };
1166
- });
1167
- g.value = _.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/), function(s) {
1168
- return function() {
1169
- this.value = s.replace(/\D/g, "");
1170
- };
1171
- });
1172
- g.expression = _.set([g.rday,g.operator,g.value,g.unit,g.orientation,g.ddd,g.MMM]);
1173
- _fn = function() {
1174
- return _.set(arguments, g.datePartDelimiter);
1175
- };
1176
- g.mdy = _fn(g.ddd, g.month, g.day, g.year);
1177
- g.ymd = _fn(g.ddd, g.year, g.month, g.day);
1178
- g.dmy = _fn(g.ddd, g.day, g.month, g.year);
1179
- g.date = function(s) {
1180
- return((g[$C.dateElementOrder] || g.mdy).call(this, s));
1181
- };
1182
- g.format = _.process(_.many(_.any(_.process(_.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/), function(fmt) {
1183
- if (g[fmt]) {
1184
- return g[fmt];
1185
- } else {
1186
- throw $D.Parsing.Exception(fmt);
664
+ },any:function() {
665
+ var px = arguments;
666
+ return function(s) {
667
+ var r = null;
668
+ for (var i = 0; i < px.length; i++) {
669
+ if (px[i] == null) {
670
+ continue;
1187
671
  }
1188
- }), _.process(_.rtoken(/^[^dMyhHmstz]+/), function(s) {
1189
- return _.ignore(_.stoken(s));
1190
- }))), function(rules) {
1191
- return _.process(_.each.apply(null, rules), t.finishExact);
1192
- });
1193
- var _F = {};
1194
- var _get = function(f) {
1195
- return _F[f] = (_F[f] || g.format(f)[0]);
1196
- };
1197
- g.formats = function(fx) {
1198
- if (fx instanceof Array) {
1199
- var rx = [];
1200
- for (var i = 0; i < fx.length; i++) {
1201
- rx.push(_get(fx[i]));
1202
- }
1203
- return _.any.apply(null, rx);
1204
- } else {
1205
- return _get(fx);
1206
- }
1207
- };
1208
- g._formats = g.formats(["\"yyyy-MM-ddTHH:mm:ssZ\"","yyyy-MM-ddTHH:mm:ssZ","yyyy-MM-ddTHH:mm:ssz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mmZ","yyyy-MM-ddTHH:mmz","yyyy-MM-ddTHH:mm","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","MMddyyyy","ddMMyyyy","Mddyyyy","ddMyyyy","Mdyyyy","dMyyyy","yyyy","Mdyy","dMyy","d"]);
1209
- g._start = _.process(_.set([g.date,g.time,g.expression], g.generalDelimiter, g.whiteSpace), t.finish);
1210
- g.start = function(s) {
1211
672
  try {
1212
- var r = g._formats.call({}, s);
1213
- if (r[1].length === 0) {
1214
- return r;
1215
- }
673
+ r = (px[i].call(this, s));
1216
674
  } catch(e) {
675
+ r = null;
1217
676
  }
1218
- return g._start.call({}, s);
1219
- };
1220
- $D._parse = $D.parse;
1221
- $D.parse = function(s) {
1222
- var r = null;
1223
- if (!s) {
1224
- return null;
677
+ if (r) {
678
+ return r;
1225
679
  }
1226
- if (s instanceof Date) {
1227
- return s;
680
+ }
681
+ throw new $P.Exception(s);
682
+ };
683
+ },each:function() {
684
+ var px = arguments;
685
+ return function(s) {
686
+ var rx = [],r = null;
687
+ for (var i = 0; i < px.length; i++) {
688
+ if (px[i] == null) {
689
+ continue;
1228
690
  }
1229
691
  try {
1230
- r = $D.Grammar.start.call({}, s.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"));
692
+ r = (px[i].call(this, s));
693
+ } catch(e) {
694
+ throw new $P.Exception(s);
695
+ }
696
+ rx.push(r[0]);
697
+ s = r[1];
698
+ }
699
+ return[rx,s];
700
+ };
701
+ },all:function() {
702
+ var px = arguments,_ = _;
703
+ return _.each(_.optional(px));
704
+ },sequence:function(px, d, c) {
705
+ d = d || _.rtoken(/^\s*/);
706
+ c = c || null;
707
+ if (px.length == 1) {
708
+ return px[0];
709
+ }
710
+ return function(s) {
711
+ var r = null,q = null;
712
+ var rx = [];
713
+ for (var i = 0; i < px.length; i++) {
714
+ try {
715
+ r = px[i].call(this, s);
1231
716
  } catch(e) {
1232
- return null;
717
+ break;
1233
718
  }
1234
- return((r[1].length === 0) ? r[0] : null);
1235
- };
1236
- $D.getParseFunction = function(fx) {
1237
- var fn = $D.Grammar.formats(fx);
1238
- return function(s) {
1239
- var r = null;
1240
- try {
1241
- r = fn.call({}, s);
1242
- } catch(e) {
1243
- return null;
1244
- }
1245
- return((r[1].length === 0) ? r[0] : null);
1246
- };
1247
- };
1248
- $D.parseExact = function(s, fx) {
1249
- return $D.getParseFunction(fx)(s);
719
+ rx.push(r[0]);
720
+ try {
721
+ q = d.call(this, r[1]);
722
+ } catch(ex) {
723
+ q = null;
724
+ break;
725
+ }
726
+ s = q[1];
727
+ }
728
+ if (!r) {
729
+ throw new $P.Exception(s);
730
+ }
731
+ if (q) {
732
+ throw new $P.Exception(q[1]);
733
+ }
734
+ if (c) {
735
+ try {
736
+ r = c.call(this, r[1]);
737
+ } catch(ey) {
738
+ throw new $P.Exception(r[1]);
739
+ }
740
+ }
741
+ return[rx,(r ? r[1] : s)];
742
+ };
743
+ },between:function(d1, p, d2) {
744
+ d2 = d2 || d1;
745
+ var _fn = _.each(_.ignore(d1), p, _.ignore(d2));
746
+ return function(s) {
747
+ var rx = _fn.call(this, s);
748
+ return[
749
+ [rx[0][0],r[0][2]],
750
+ rx[1]
751
+ ];
752
+ };
753
+ },list:function(p, d, c) {
754
+ d = d || _.rtoken(/^\s*/);
755
+ c = c || null;
756
+ return(p instanceof Array ? _.each(_.product(p.slice(0, -1), _.ignore(d)), p.slice(-1), _.ignore(c)) : _.each(_.many(_.each(p, _.ignore(d))), px, _.ignore(c)));
757
+ },set:function(px, d, c) {
758
+ d = d || _.rtoken(/^\s*/);
759
+ c = c || null;
760
+ return function(s) {
761
+ var r = null,p = null,q = null,rx = null,best = [
762
+ [],
763
+ s
764
+ ],last = false;
765
+ for (var i = 0; i < px.length; i++) {
766
+ q = null;
767
+ p = null;
768
+ r = null;
769
+ last = (px.length == 1);
770
+ try {
771
+ r = px[i].call(this, s);
772
+ } catch(e) {
773
+ continue;
774
+ }
775
+ rx = [
776
+ [r[0]],
777
+ r[1]
778
+ ];
779
+ if (r[1].length > 0 && !last) {
780
+ try {
781
+ q = d.call(this, r[1]);
782
+ } catch(ex) {
783
+ last = true;
784
+ }
785
+ } else {
786
+ last = true;
787
+ }
788
+ if (!last && q[1].length === 0) {
789
+ last = true;
790
+ }
791
+ if (!last) {
792
+ var qx = [];
793
+ for (var j = 0; j < px.length; j++) {
794
+ if (i != j) {
795
+ qx.push(px[j]);
796
+ }
797
+ }
798
+ p = _.set(qx, d).call(this, q[1]);
799
+ if (p[0].length > 0) {
800
+ rx[0] = rx[0].concat(p[0]);
801
+ rx[1] = p[1];
802
+ }
803
+ }
804
+ if (rx[1].length < best[1].length) {
805
+ best = rx;
806
+ }
807
+ if (best[1].length === 0) {
808
+ break;
809
+ }
810
+ }
811
+ if (best[0].length === 0) {
812
+ return best;
813
+ }
814
+ if (c) {
815
+ try {
816
+ q = c.call(this, best[1]);
817
+ } catch(ey) {
818
+ throw new $P.Exception(best[1]);
819
+ }
820
+ best[1] = q[1];
821
+ }
822
+ return best;
823
+ };
824
+ },forward:function(gr, fname) {
825
+ return function(s) {
826
+ return gr[fname].call(this, s);
827
+ };
828
+ },replace:function(rule, repl) {
829
+ return function(s) {
830
+ var r = rule.call(this, s);
831
+ return[repl,r[1]];
832
+ };
833
+ },process:function(rule, fn) {
834
+ return function(s) {
835
+ var r = rule.call(this, s);
836
+ return[fn.call(this, r[0]),r[1]];
837
+ };
838
+ },min:function(min, rule) {
839
+ return function(s) {
840
+ var rx = rule.call(this, s);
841
+ if (rx[0].length < min) {
842
+ throw new $P.Exception(s);
843
+ }
844
+ return rx;
845
+ };
846
+ }};
847
+ var _generator = function(op) {
848
+ return function() {
849
+ var args = null,rx = [];
850
+ if (arguments.length > 1) {
851
+ args = Array.prototype.slice.call(arguments);
852
+ } else if (arguments[0]instanceof Array) {
853
+ args = arguments[0];
854
+ }
855
+ if (args) {
856
+ for (var i = 0, px = args.shift(); i < px.length; i++) {
857
+ args.unshift(px[i]);
858
+ rx.push(op.apply(null, args));
859
+ args.shift();
860
+ return rx;
861
+ }
862
+ } else {
863
+ return op.apply(null, arguments);
864
+ }
865
+ };
866
+ };
867
+ var gx = "optional not ignore cache".split(/\s/);
868
+ for (var i = 0; i < gx.length; i++) {
869
+ _[gx[i]] = _generator(_[gx[i]]);
870
+ }
871
+ var _vector = function(op) {
872
+ return function() {
873
+ if (arguments[0]instanceof Array) {
874
+ return op.apply(null, arguments[0]);
875
+ } else {
876
+ return op.apply(null, arguments);
877
+ }
878
+ };
879
+ };
880
+ var vx = "each any all".split(/\s/);
881
+ for (var j = 0; j < vx.length; j++) {
882
+ _[vx[j]] = _vector(_[vx[j]]);
883
+ }
884
+ }());
885
+ (function() {
886
+ var $D = Date,$P = $D.prototype,$C = $D.CultureInfo;
887
+ var flattenAndCompact = function(ax) {
888
+ var rx = [];
889
+ for (var i = 0; i < ax.length; i++) {
890
+ if (ax[i]instanceof Array) {
891
+ rx = rx.concat(flattenAndCompact(ax[i]));
892
+ } else {
893
+ if (ax[i]) {
894
+ rx.push(ax[i]);
895
+ }
896
+ }
897
+ }
898
+ return rx;
899
+ };
900
+ $D.Grammar = {};
901
+ $D.Translator = {hour:function(s) {
902
+ return function() {
903
+ this.hour = Number(s);
904
+ };
905
+ },minute:function(s) {
906
+ return function() {
907
+ this.minute = Number(s);
908
+ };
909
+ },second:function(s) {
910
+ return function() {
911
+ this.second = Number(s);
912
+ };
913
+ },meridian:function(s) {
914
+ return function() {
915
+ this.meridian = s.slice(0, 1).toLowerCase();
916
+ };
917
+ },timezone:function(s) {
918
+ return function() {
919
+ var n = s.replace(/[^\d\+\-]/g, "");
920
+ if (n.length) {
921
+ this.timezoneOffset = Number(n);
922
+ } else {
923
+ this.timezone = s.toLowerCase();
924
+ }
925
+ };
926
+ },day:function(x) {
927
+ var s = x[0];
928
+ return function() {
929
+ this.day = Number(s.match(/\d+/)[0]);
930
+ };
931
+ },month:function(s) {
932
+ return function() {
933
+ this.month = (s.length == 3) ? "jan feb mar apr may jun jul aug sep oct nov dec".indexOf(s) / 4 : Number(s) - 1;
934
+ };
935
+ },year:function(s) {
936
+ return function() {
937
+ var n = Number(s);
938
+ this.year = ((s.length > 2) ? n : (n + (((n + 2000) < $C.twoDigitYearMax) ? 2000 : 1900)));
939
+ };
940
+ },rday:function(s) {
941
+ return function() {
942
+ switch (s) {case"yesterday":this.days = -1;break;case"tomorrow":this.days = 1;break;case"today":this.days = 0;break;case"now":this.days = 0;this.now = true;break;
943
+ }
944
+ };
945
+ },finishExact:function(x) {
946
+ x = (x instanceof Array) ? x : [x];
947
+ for (var i = 0; i < x.length; i++) {
948
+ if (x[i]) {
949
+ x[i].call(this);
950
+ }
951
+ }
952
+ var now = new Date();
953
+ if ((this.hour || this.minute) && (!this.month && !this.year && !this.day)) {
954
+ this.day = now.getDate();
955
+ }
956
+ if (!this.year) {
957
+ this.year = now.getFullYear();
958
+ }
959
+ if (!this.month && this.month !== 0) {
960
+ this.month = now.getMonth();
961
+ }
962
+ if (!this.day) {
963
+ this.day = 1;
964
+ }
965
+ if (!this.hour) {
966
+ this.hour = 0;
967
+ }
968
+ if (!this.minute) {
969
+ this.minute = 0;
970
+ }
971
+ if (!this.second) {
972
+ this.second = 0;
973
+ }
974
+ if (this.meridian && this.hour) {
975
+ if (this.meridian == "p" && this.hour < 12) {
976
+ this.hour = this.hour + 12;
977
+ } else if (this.meridian == "a" && this.hour == 12) {
978
+ this.hour = 0;
979
+ }
980
+ }
981
+ if (this.day > $D.getDaysInMonth(this.year, this.month)) {
982
+ throw new RangeError(this.day + " is not a valid value for days.");
983
+ }
984
+ var r = new Date(this.year, this.month, this.day, this.hour, this.minute, this.second);
985
+ if (this.timezone) {
986
+ r.set({timezone:this.timezone});
987
+ } else if (this.timezoneOffset) {
988
+ r.set({timezoneOffset:this.timezoneOffset});
989
+ }
990
+ return r;
991
+ },finish:function(x) {
992
+ x = (x instanceof Array) ? flattenAndCompact(x) : [x];
993
+ if (x.length === 0) {
994
+ return null;
995
+ }
996
+ for (var i = 0; i < x.length; i++) {
997
+ if (typeof x[i] == "function") {
998
+ x[i].call(this);
999
+ }
1000
+ }
1001
+ var today = $D.today();
1002
+ if (this.now && !this.unit && !this.operator) {
1003
+ return new Date();
1004
+ } else if (this.now) {
1005
+ today = new Date();
1006
+ }
1007
+ var expression = !!(this.days && this.days !== null || this.orient || this.operator);
1008
+ var gap,mod,orient;
1009
+ orient = ((this.orient == "past" || this.operator == "subtract") ? -1 : 1);
1010
+ if (!this.now && "hour minute second".indexOf(this.unit) != -1) {
1011
+ today.setTimeToNow();
1012
+ }
1013
+ if (this.month || this.month === 0) {
1014
+ if ("year day hour minute second".indexOf(this.unit) != -1) {
1015
+ this.value = this.month + 1;
1016
+ this.month = null;
1017
+ expression = true;
1018
+ }
1019
+ }
1020
+ if (!expression && this.weekday && !this.day && !this.days) {
1021
+ var temp = Date[this.weekday]();
1022
+ this.day = temp.getDate();
1023
+ if (!this.month) {
1024
+ this.month = temp.getMonth();
1025
+ }
1026
+ this.year = temp.getFullYear();
1027
+ }
1028
+ if (expression && this.weekday && this.unit != "month") {
1029
+ this.unit = "day";
1030
+ gap = ($D.getDayNumberFromName(this.weekday) - today.getDay());
1031
+ mod = 7;
1032
+ this.days = gap ? ((gap + (orient * mod)) % mod) : (orient * mod);
1033
+ }
1034
+ if (this.month && this.unit == "day" && this.operator) {
1035
+ this.value = (this.month + 1);
1036
+ this.month = null;
1037
+ }
1038
+ if (this.value != null && this.month != null && this.year != null) {
1039
+ this.day = this.value * 1;
1040
+ }
1041
+ if (this.month && !this.day && this.value) {
1042
+ today.set({day:this.value * 1});
1043
+ if (!expression) {
1044
+ this.day = this.value * 1;
1045
+ }
1046
+ }
1047
+ if (!this.month && this.value && this.unit == "month" && !this.now) {
1048
+ this.month = this.value;
1049
+ expression = true;
1050
+ }
1051
+ if (expression && (this.month || this.month === 0) && this.unit != "year") {
1052
+ this.unit = "month";
1053
+ gap = (this.month - today.getMonth());
1054
+ mod = 12;
1055
+ this.months = gap ? ((gap + (orient * mod)) % mod) : (orient * mod);
1056
+ this.month = null;
1057
+ }
1058
+ if (!this.unit) {
1059
+ this.unit = "day";
1060
+ }
1061
+ if (!this.value && this.operator && this.operator !== null && this[this.unit + "s"] && this[this.unit + "s"] !== null) {
1062
+ this[this.unit + "s"] = this[this.unit + "s"] + ((this.operator == "add") ? 1 : -1) + (this.value || 0) * orient;
1063
+ } else if (this[this.unit + "s"] == null || this.operator != null) {
1064
+ if (!this.value) {
1065
+ this.value = 1;
1066
+ }
1067
+ this[this.unit + "s"] = this.value * orient;
1068
+ }
1069
+ if (this.meridian && this.hour) {
1070
+ if (this.meridian == "p" && this.hour < 12) {
1071
+ this.hour = this.hour + 12;
1072
+ } else if (this.meridian == "a" && this.hour == 12) {
1073
+ this.hour = 0;
1074
+ }
1075
+ }
1076
+ if (this.weekday && !this.day && !this.days) {
1077
+ var temp = Date[this.weekday]();
1078
+ this.day = temp.getDate();
1079
+ if (temp.getMonth() !== today.getMonth()) {
1080
+ this.month = temp.getMonth();
1081
+ }
1082
+ }
1083
+ if ((this.month || this.month === 0) && !this.day) {
1084
+ this.day = 1;
1085
+ }
1086
+ if (!this.orient && !this.operator && this.unit == "week" && this.value && !this.day && !this.month) {
1087
+ return Date.today().setWeek(this.value);
1088
+ }
1089
+ if (expression && this.timezone && this.day && this.days) {
1090
+ this.day = this.days;
1091
+ }
1092
+ return(expression) ? today.add(this) : today.set(this);
1093
+ }};
1094
+ var _ = $D.Parsing.Operators,g = $D.Grammar,t = $D.Translator,_fn;
1095
+ g.datePartDelimiter = _.rtoken(/^([\s\-\.\,\/\x27]+)/);
1096
+ g.timePartDelimiter = _.stoken(":");
1097
+ g.whiteSpace = _.rtoken(/^\s*/);
1098
+ g.generalDelimiter = _.rtoken(/^(([\s\,]|at|@|on)+)/);
1099
+ var _C = {};
1100
+ g.ctoken = function(keys) {
1101
+ var fn = _C[keys];
1102
+ if (!fn) {
1103
+ var c = $C.regexPatterns;
1104
+ var kx = keys.split(/\s+/),px = [];
1105
+ for (var i = 0; i < kx.length; i++) {
1106
+ px.push(_.replace(_.rtoken(c[kx[i]]), kx[i]));
1107
+ }
1108
+ fn = _C[keys] = _.any.apply(null, px);
1109
+ }
1110
+ return fn;
1111
+ };
1112
+ g.ctoken2 = function(key) {
1113
+ return _.rtoken($C.regexPatterns[key]);
1114
+ };
1115
+ g.h = _.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/), t.hour));
1116
+ g.hh = _.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/), t.hour));
1117
+ g.H = _.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/), t.hour));
1118
+ g.HH = _.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/), t.hour));
1119
+ g.m = _.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/), t.minute));
1120
+ g.mm = _.cache(_.process(_.rtoken(/^[0-5][0-9]/), t.minute));
1121
+ g.s = _.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/), t.second));
1122
+ g.ss = _.cache(_.process(_.rtoken(/^[0-5][0-9]/), t.second));
1123
+ g.hms = _.cache(_.sequence([g.H,g.m,g.s], g.timePartDelimiter));
1124
+ g.t = _.cache(_.process(g.ctoken2("shortMeridian"), t.meridian));
1125
+ g.tt = _.cache(_.process(g.ctoken2("longMeridian"), t.meridian));
1126
+ g.z = _.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/), t.timezone));
1127
+ g.zz = _.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/), t.timezone));
1128
+ g.zzz = _.cache(_.process(g.ctoken2("timezone"), t.timezone));
1129
+ g.timeSuffix = _.each(_.ignore(g.whiteSpace), _.set([g.tt,g.zzz]));
1130
+ g.time = _.each(_.optional(_.ignore(_.stoken("T"))), g.hms, g.timeSuffix);
1131
+ g.d = _.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/), _.optional(g.ctoken2("ordinalSuffix"))), t.day));
1132
+ g.dd = _.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/), _.optional(g.ctoken2("ordinalSuffix"))), t.day));
1133
+ g.ddd = g.dddd = _.cache(_.process(g.ctoken("sun mon tue wed thu fri sat"), function(s) {
1134
+ return function() {
1135
+ this.weekday = s;
1136
+ };
1137
+ }));
1138
+ g.M = _.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/), t.month));
1139
+ g.MM = _.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/), t.month));
1140
+ g.MMM = g.MMMM = _.cache(_.process(g.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"), t.month));
1141
+ g.y = _.cache(_.process(_.rtoken(/^(\d\d?)/), t.year));
1142
+ g.yy = _.cache(_.process(_.rtoken(/^(\d\d)/), t.year));
1143
+ g.yyy = _.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/), t.year));
1144
+ g.yyyy = _.cache(_.process(_.rtoken(/^(\d\d\d\d)/), t.year));
1145
+ _fn = function() {
1146
+ return _.each(_.any.apply(null, arguments), _.not(g.ctoken2("timeContext")));
1147
+ };
1148
+ g.day = _fn(g.d, g.dd);
1149
+ g.month = _fn(g.M, g.MMM);
1150
+ g.year = _fn(g.yyyy, g.yy);
1151
+ g.orientation = _.process(g.ctoken("past future"), function(s) {
1152
+ return function() {
1153
+ this.orient = s;
1154
+ };
1155
+ });
1156
+ g.operator = _.process(g.ctoken("add subtract"), function(s) {
1157
+ return function() {
1158
+ this.operator = s;
1159
+ };
1160
+ });
1161
+ g.rday = _.process(g.ctoken("yesterday tomorrow today now"), t.rday);
1162
+ g.unit = _.process(g.ctoken("second minute hour day week month year"), function(s) {
1163
+ return function() {
1164
+ this.unit = s;
1165
+ };
1166
+ });
1167
+ g.value = _.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/), function(s) {
1168
+ return function() {
1169
+ this.value = s.replace(/\D/g, "");
1170
+ };
1171
+ });
1172
+ g.expression = _.set([g.rday,g.operator,g.value,g.unit,g.orientation,g.ddd,g.MMM]);
1173
+ _fn = function() {
1174
+ return _.set(arguments, g.datePartDelimiter);
1175
+ };
1176
+ g.mdy = _fn(g.ddd, g.month, g.day, g.year);
1177
+ g.ymd = _fn(g.ddd, g.year, g.month, g.day);
1178
+ g.dmy = _fn(g.ddd, g.day, g.month, g.year);
1179
+ g.date = function(s) {
1180
+ return((g[$C.dateElementOrder] || g.mdy).call(this, s));
1181
+ };
1182
+ g.format = _.process(_.many(_.any(_.process(_.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/), function(fmt) {
1183
+ if (g[fmt]) {
1184
+ return g[fmt];
1185
+ } else {
1186
+ throw $D.Parsing.Exception(fmt);
1187
+ }
1188
+ }), _.process(_.rtoken(/^[^dMyhHmstz]+/), function(s) {
1189
+ return _.ignore(_.stoken(s));
1190
+ }))), function(rules) {
1191
+ return _.process(_.each.apply(null, rules), t.finishExact);
1192
+ });
1193
+ var _F = {};
1194
+ var _get = function(f) {
1195
+ return _F[f] = (_F[f] || g.format(f)[0]);
1196
+ };
1197
+ g.formats = function(fx) {
1198
+ if (fx instanceof Array) {
1199
+ var rx = [];
1200
+ for (var i = 0; i < fx.length; i++) {
1201
+ rx.push(_get(fx[i]));
1202
+ }
1203
+ return _.any.apply(null, rx);
1204
+ } else {
1205
+ return _get(fx);
1206
+ }
1207
+ };
1208
+ g._formats = g.formats(["\"yyyy-MM-ddTHH:mm:ssZ\"","yyyy-MM-ddTHH:mm:ssZ","yyyy-MM-ddTHH:mm:ssz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mmZ","yyyy-MM-ddTHH:mmz","yyyy-MM-ddTHH:mm","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","MMddyyyy","ddMMyyyy","Mddyyyy","ddMyyyy","Mdyyyy","dMyyyy","yyyy","Mdyy","dMyy","d"]);
1209
+ g._start = _.process(_.set([g.date,g.time,g.expression], g.generalDelimiter, g.whiteSpace), t.finish);
1210
+ g.start = function(s) {
1211
+ try {
1212
+ var r = g._formats.call({}, s);
1213
+ if (r[1].length === 0) {
1214
+ return r;
1215
+ }
1216
+ } catch(e) {
1217
+ }
1218
+ return g._start.call({}, s);
1219
+ };
1220
+ $D._parse = $D.parse;
1221
+ $D.parse = function(s) {
1222
+ var r = null;
1223
+ if (!s) {
1224
+ return null;
1225
+ }
1226
+ if (s instanceof Date) {
1227
+ return s;
1228
+ }
1229
+ try {
1230
+ r = $D.Grammar.start.call({}, s.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"));
1231
+ } catch(e) {
1232
+ return null;
1233
+ }
1234
+ return((r[1].length === 0) ? r[0] : null);
1235
+ };
1236
+ $D.getParseFunction = function(fx) {
1237
+ var fn = $D.Grammar.formats(fx);
1238
+ return function(s) {
1239
+ var r = null;
1240
+ try {
1241
+ r = fn.call({}, s);
1242
+ } catch(e) {
1243
+ return null;
1244
+ }
1245
+ return((r[1].length === 0) ? r[0] : null);
1250
1246
  };
1247
+ };
1248
+ $D.parseExact = function(s, fx) {
1249
+ return $D.getParseFunction(fx)(s);
1250
+ };
1251
1251
  }());
1252
1252
 
1253
1253
 
@@ -1278,392 +1278,392 @@ Date.CultureInfo = {name:"en-US",englishName:"English (United States)",nativeNam
1278
1278
 
1279
1279
  (function (jQuery) {
1280
1280
 
1281
- jQuery.fn.ganttView = function () {
1281
+ jQuery.fn.ganttView = function () {
1282
1282
 
1283
- var args = Array.prototype.slice.call(arguments);
1283
+ var args = Array.prototype.slice.call(arguments);
1284
1284
 
1285
- if (args.length == 1 && typeof(args[0]) == "object") {
1286
- build.call(this, args[0]);
1287
- }
1285
+ if (args.length == 1 && typeof(args[0]) == "object") {
1286
+ build.call(this, args[0]);
1287
+ }
1288
1288
 
1289
- if (args.length == 2 && typeof(args[0]) == "string") {
1290
- handleMethod.call(this, args[0], args[1]);
1291
- }
1292
- };
1289
+ if (args.length == 2 && typeof(args[0]) == "string") {
1290
+ handleMethod.call(this, args[0], args[1]);
1291
+ }
1292
+ };
1293
1293
 
1294
- function build(options) {
1294
+ function build(options) {
1295
1295
 
1296
- var els = this;
1297
- var defaults = {
1298
- showWeekends: true,
1299
- cellWidth: 21,
1300
- cellHeight: 31,
1301
- slideWidth: 400,
1302
- vHeaderWidth: 100,
1303
- behavior: {
1304
- clickable: true,
1305
- draggable: true,
1306
- resizable: true
1307
- }
1308
- };
1296
+ var els = this;
1297
+ var defaults = {
1298
+ showWeekends: true,
1299
+ cellWidth: 21,
1300
+ cellHeight: 31,
1301
+ slideWidth: 400,
1302
+ vHeaderWidth: 100,
1303
+ behavior: {
1304
+ clickable: true,
1305
+ draggable: true,
1306
+ resizable: true
1307
+ }
1308
+ };
1309
1309
 
1310
- var opts = jQuery.extend(true, defaults, options);
1310
+ var opts = jQuery.extend(true, defaults, options);
1311
1311
 
1312
- if (opts.data) {
1313
- build();
1314
- } else if (opts.dataUrl) {
1315
- jQuery.getJSON(opts.dataUrl, function (data) {
1316
- opts.data = data;
1317
- build();
1318
- });
1319
- }
1312
+ if (opts.data) {
1313
+ build();
1314
+ } else if (opts.dataUrl) {
1315
+ jQuery.getJSON(opts.dataUrl, function (data) {
1316
+ opts.data = data;
1317
+ build();
1318
+ });
1319
+ }
1320
1320
 
1321
- function build() {
1321
+ function build() {
1322
1322
 
1323
- var minDays = Math.floor((opts.slideWidth / opts.cellWidth) + 5);
1324
- var startEnd = DateUtils.getBoundaryDatesFromData(opts.data, minDays);
1325
- opts.start = startEnd[0];
1326
- opts.end = startEnd[1];
1323
+ var minDays = Math.floor((opts.slideWidth / opts.cellWidth) + 5);
1324
+ var startEnd = DateUtils.getBoundaryDatesFromData(opts.data, minDays);
1325
+ opts.start = startEnd[0];
1326
+ opts.end = startEnd[1];
1327
1327
 
1328
- els.each(function () {
1328
+ els.each(function () {
1329
1329
 
1330
- var container = jQuery(this);
1331
- var div = jQuery("<div>", { "class": "ganttview" });
1332
- new Chart(div, opts).render();
1333
- container.append(div);
1330
+ var container = jQuery(this);
1331
+ var div = jQuery("<div>", { "class": "ganttview" });
1332
+ new Chart(div, opts).render();
1333
+ container.append(div);
1334
1334
 
1335
- var w = jQuery("div.ganttview-vtheader", container).outerWidth() +
1336
- jQuery("div.ganttview-slide-container", container).outerWidth();
1337
- container.css("width", (w + 2) + "px");
1335
+ var w = jQuery("div.ganttview-vtheader", container).outerWidth() +
1336
+ jQuery("div.ganttview-slide-container", container).outerWidth();
1337
+ container.css("width", (w + 2) + "px");
1338
1338
 
1339
- new Behavior(container, opts).apply();
1340
- });
1341
- }
1339
+ new Behavior(container, opts).apply();
1340
+ });
1342
1341
  }
1342
+ }
1343
1343
 
1344
- function handleMethod(method, value) {
1344
+ function handleMethod(method, value) {
1345
1345
 
1346
- if (method == "setSlideWidth") {
1347
- var div = $("div.ganttview", this);
1348
- div.each(function () {
1349
- var vtWidth = $("div.ganttview-vtheader", div).outerWidth();
1350
- $(div).width(vtWidth + value + 1);
1351
- $("div.ganttview-slide-container", this).width(value);
1352
- });
1353
- }
1346
+ if (method == "setSlideWidth") {
1347
+ var div = $("div.ganttview", this);
1348
+ div.each(function () {
1349
+ var vtWidth = $("div.ganttview-vtheader", div).outerWidth();
1350
+ $(div).width(vtWidth + value + 1);
1351
+ $("div.ganttview-slide-container", this).width(value);
1352
+ });
1354
1353
  }
1354
+ }
1355
1355
 
1356
- var Chart = function(div, opts) {
1356
+ var Chart = function(div, opts) {
1357
1357
 
1358
- function render() {
1359
- addVtHeader(div, opts.data, opts.cellHeight);
1358
+ function render() {
1359
+ addVtHeader(div, opts.data, opts.cellHeight);
1360
1360
 
1361
- var slideDiv = jQuery("<div>", {
1362
- "class": "ganttview-slide-container",
1363
- "css": { "width": opts.slideWidth + "px" }
1364
- });
1361
+ var slideDiv = jQuery("<div>", {
1362
+ "class": "ganttview-slide-container",
1363
+ "css": { "width": opts.slideWidth + "px" }
1364
+ });
1365
1365
 
1366
- dates = getDates(opts.start, opts.end);
1367
- addHzHeader(slideDiv, dates, opts.cellWidth);
1368
- addGrid(slideDiv, opts.data, dates, opts.cellWidth, opts.showWeekends);
1369
- addBlockContainers(slideDiv, opts.data);
1370
- addBlocks(slideDiv, opts.data, opts.cellWidth, opts.start);
1371
- div.append(slideDiv);
1372
- applyLastClass(div.parent());
1373
- }
1366
+ dates = getDates(opts.start, opts.end);
1367
+ addHzHeader(slideDiv, dates, opts.cellWidth);
1368
+ addGrid(slideDiv, opts.data, dates, opts.cellWidth, opts.showWeekends);
1369
+ addBlockContainers(slideDiv, opts.data);
1370
+ addBlocks(slideDiv, opts.data, opts.cellWidth, opts.start);
1371
+ div.append(slideDiv);
1372
+ applyLastClass(div.parent());
1373
+ }
1374
1374
 
1375
- var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
1375
+ var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
1376
1376
 
1377
- // Creates a 3 dimensional array [year][month][day] of every day
1378
- // between the given start and end dates
1379
- function getDates(start, end) {
1380
- var dates = [];
1381
- dates[start.getFullYear()] = [];
1382
- dates[start.getFullYear()][start.getMonth()] = [start]
1383
- var last = start;
1384
- while (last.compareTo(end) == -1) {
1385
- var next = last.clone().addDays(1);
1386
- if (!dates[next.getFullYear()]) {
1387
- dates[next.getFullYear()] = [];
1388
- }
1389
- if (!dates[next.getFullYear()][next.getMonth()]) {
1390
- dates[next.getFullYear()][next.getMonth()] = [];
1391
- }
1392
- dates[next.getFullYear()][next.getMonth()].push(next);
1393
- last = next;
1394
- }
1395
- return dates;
1396
- }
1397
-
1398
- function addVtHeader(div, data, cellHeight) {
1399
- var headerDiv = jQuery("<div>", { "class": "ganttview-vtheader" });
1400
- for (var i = 0; i < data.length; i++) {
1401
- var itemDiv = jQuery("<div>", { "class": "ganttview-vtheader-item" });
1402
- itemDiv.append(jQuery("<div>", {
1403
- "class": "ganttview-vtheader-item-name",
1404
- "css": { "height": (data[i].series.length * cellHeight) + "px" }
1405
- }).append(data[i].name));
1406
- var seriesDiv = jQuery("<div>", { "class": "ganttview-vtheader-series" });
1407
- for (var j = 0; j < data[i].series.length; j++) {
1408
- seriesDiv.append(jQuery("<div>", { "class": "ganttview-vtheader-series-name" })
1409
- .append(data[i].series[j].name));
1410
- }
1411
- itemDiv.append(seriesDiv);
1412
- headerDiv.append(itemDiv);
1413
- }
1414
- div.append(headerDiv);
1415
- }
1377
+ // Creates a 3 dimensional array [year][month][day] of every day
1378
+ // between the given start and end dates
1379
+ function getDates(start, end) {
1380
+ var dates = [];
1381
+ dates[start.getFullYear()] = [];
1382
+ dates[start.getFullYear()][start.getMonth()] = [start]
1383
+ var last = start;
1384
+ while (last.compareTo(end) == -1) {
1385
+ var next = last.clone().addDays(1);
1386
+ if (!dates[next.getFullYear()]) {
1387
+ dates[next.getFullYear()] = [];
1388
+ }
1389
+ if (!dates[next.getFullYear()][next.getMonth()]) {
1390
+ dates[next.getFullYear()][next.getMonth()] = [];
1391
+ }
1392
+ dates[next.getFullYear()][next.getMonth()].push(next);
1393
+ last = next;
1394
+ }
1395
+ return dates;
1396
+ }
1416
1397
 
1417
- function addHzHeader(div, dates, cellWidth) {
1418
- var headerDiv = jQuery("<div>", { "class": "ganttview-hzheader" });
1419
- var monthsDiv = jQuery("<div>", { "class": "ganttview-hzheader-months" });
1420
- var daysDiv = jQuery("<div>", { "class": "ganttview-hzheader-days" });
1421
- var totalW = 0;
1422
- for (var y in dates) {
1423
- for (var m in dates[y]) {
1424
- var w = dates[y][m].length * cellWidth;
1425
- totalW = totalW + w;
1426
- monthsDiv.append(jQuery("<div>", {
1427
- "class": "ganttview-hzheader-month",
1428
- "css": { "width": (w - 1) + "px" }
1429
- }).append(monthNames[m] + "/" + y));
1430
- for (var d in dates[y][m]) {
1431
- daysDiv.append(jQuery("<div>", { "class": "ganttview-hzheader-day" })
1432
- .append(dates[y][m][d].getDate()));
1433
- }
1434
- }
1435
- }
1436
- monthsDiv.css("width", totalW + "px");
1437
- daysDiv.css("width", totalW + "px");
1438
- headerDiv.append(monthsDiv).append(daysDiv);
1439
- div.append(headerDiv);
1440
- }
1398
+ function addVtHeader(div, data, cellHeight) {
1399
+ var headerDiv = jQuery("<div>", { "class": "ganttview-vtheader" });
1400
+ for (var i = 0; i < data.length; i++) {
1401
+ var itemDiv = jQuery("<div>", { "class": "ganttview-vtheader-item" });
1402
+ itemDiv.append(jQuery("<div>", {
1403
+ "class": "ganttview-vtheader-item-name",
1404
+ "css": { "height": (data[i].series.length * cellHeight) + "px" }
1405
+ }).append(data[i].name));
1406
+ var seriesDiv = jQuery("<div>", { "class": "ganttview-vtheader-series" });
1407
+ for (var j = 0; j < data[i].series.length; j++) {
1408
+ seriesDiv.append(jQuery("<div>", { "class": "ganttview-vtheader-series-name" })
1409
+ .append(data[i].series[j].name));
1410
+ }
1411
+ itemDiv.append(seriesDiv);
1412
+ headerDiv.append(itemDiv);
1413
+ }
1414
+ div.append(headerDiv);
1415
+ }
1441
1416
 
1442
- function addGrid(div, data, dates, cellWidth, showWeekends) {
1443
- var gridDiv = jQuery("<div>", { "class": "ganttview-grid" });
1444
- var rowDiv = jQuery("<div>", { "class": "ganttview-grid-row" });
1445
- for (var y in dates) {
1446
- for (var m in dates[y]) {
1447
- for (var d in dates[y][m]) {
1448
- var cellDiv = jQuery("<div>", { "class": "ganttview-grid-row-cell" });
1449
- if (DateUtils.isWeekend(dates[y][m][d]) && showWeekends) {
1450
- cellDiv.addClass("ganttview-weekend");
1451
- }
1452
- rowDiv.append(cellDiv);
1453
- }
1454
- }
1455
- }
1456
- var w = jQuery("div.ganttview-grid-row-cell", rowDiv).length * cellWidth;
1457
- rowDiv.css("width", w + "px");
1458
- gridDiv.css("width", w + "px");
1459
- for (var i = 0; i < data.length; i++) {
1460
- for (var j = 0; j < data[i].series.length; j++) {
1461
- gridDiv.append(rowDiv.clone());
1462
- }
1463
- }
1464
- div.append(gridDiv);
1465
- }
1417
+ function addHzHeader(div, dates, cellWidth) {
1418
+ var headerDiv = jQuery("<div>", { "class": "ganttview-hzheader" });
1419
+ var monthsDiv = jQuery("<div>", { "class": "ganttview-hzheader-months" });
1420
+ var daysDiv = jQuery("<div>", { "class": "ganttview-hzheader-days" });
1421
+ var totalW = 0;
1422
+ for (var y in dates) {
1423
+ for (var m in dates[y]) {
1424
+ var w = dates[y][m].length * cellWidth;
1425
+ totalW = totalW + w;
1426
+ monthsDiv.append(jQuery("<div>", {
1427
+ "class": "ganttview-hzheader-month",
1428
+ "css": { "width": (w - 1) + "px" }
1429
+ }).append(monthNames[m] + "/" + y));
1430
+ for (var d in dates[y][m]) {
1431
+ daysDiv.append(jQuery("<div>", { "class": "ganttview-hzheader-day" })
1432
+ .append(dates[y][m][d].getDate()));
1433
+ }
1434
+ }
1435
+ }
1436
+ monthsDiv.css("width", totalW + "px");
1437
+ daysDiv.css("width", totalW + "px");
1438
+ headerDiv.append(monthsDiv).append(daysDiv);
1439
+ div.append(headerDiv);
1440
+ }
1466
1441
 
1467
- function addBlockContainers(div, data) {
1468
- var blocksDiv = jQuery("<div>", { "class": "ganttview-blocks" });
1469
- for (var i = 0; i < data.length; i++) {
1470
- for (var j = 0; j < data[i].series.length; j++) {
1471
- blocksDiv.append(jQuery("<div>", { "class": "ganttview-block-container" }));
1472
- }
1473
- }
1474
- div.append(blocksDiv);
1475
- }
1442
+ function addGrid(div, data, dates, cellWidth, showWeekends) {
1443
+ var gridDiv = jQuery("<div>", { "class": "ganttview-grid" });
1444
+ var rowDiv = jQuery("<div>", { "class": "ganttview-grid-row" });
1445
+ for (var y in dates) {
1446
+ for (var m in dates[y]) {
1447
+ for (var d in dates[y][m]) {
1448
+ var cellDiv = jQuery("<div>", { "class": "ganttview-grid-row-cell" });
1449
+ if (DateUtils.isWeekend(dates[y][m][d]) && showWeekends) {
1450
+ cellDiv.addClass("ganttview-weekend");
1451
+ }
1452
+ rowDiv.append(cellDiv);
1453
+ }
1454
+ }
1455
+ }
1456
+ var w = jQuery("div.ganttview-grid-row-cell", rowDiv).length * cellWidth;
1457
+ rowDiv.css("width", w + "px");
1458
+ gridDiv.css("width", w + "px");
1459
+ for (var i = 0; i < data.length; i++) {
1460
+ for (var j = 0; j < data[i].series.length; j++) {
1461
+ gridDiv.append(rowDiv.clone());
1462
+ }
1463
+ }
1464
+ div.append(gridDiv);
1465
+ }
1476
1466
 
1477
- function addBlocks(div, data, cellWidth, start) {
1478
- var rows = jQuery("div.ganttview-blocks div.ganttview-block-container", div);
1479
- var rowIdx = 0;
1480
- for (var i = 0; i < data.length; i++) {
1481
- for (var j = 0; j < data[i].series.length; j++) {
1482
- var series = data[i].series[j];
1483
- var size = DateUtils.daysBetween(series.start, series.end) + 1;
1484
- var offset = DateUtils.daysBetween(start, series.start);
1485
- var block = jQuery("<div>", {
1486
- "class": "ganttview-block",
1487
- "title": series.name + ", " + size + " days",
1488
- "css": {
1489
- "width": ((size * cellWidth) - 9) + "px",
1490
- "margin-left": ((offset * cellWidth) + 3) + "px"
1491
- }
1492
- });
1493
- addBlockData(block, data[i], series);
1494
- if (data[i].series[j].color) {
1495
- block.css("background-color", data[i].series[j].color);
1496
- }
1497
- block.append(jQuery("<div>", { "class": "ganttview-block-text" }).text(size));
1498
- jQuery(rows[rowIdx]).append(block);
1499
- rowIdx = rowIdx + 1;
1500
- }
1501
- }
1502
- }
1467
+ function addBlockContainers(div, data) {
1468
+ var blocksDiv = jQuery("<div>", { "class": "ganttview-blocks" });
1469
+ for (var i = 0; i < data.length; i++) {
1470
+ for (var j = 0; j < data[i].series.length; j++) {
1471
+ blocksDiv.append(jQuery("<div>", { "class": "ganttview-block-container" }));
1472
+ }
1473
+ }
1474
+ div.append(blocksDiv);
1475
+ }
1503
1476
 
1504
- function addBlockData(block, data, series) {
1505
- // This allows custom attributes to be added to the series data objects
1506
- // and makes them available to the 'data' argument of click, resize, and drag handlers
1507
- var blockData = { id: data.id, name: data.name };
1508
- jQuery.extend(blockData, series);
1509
- block.data("block-data", blockData);
1510
- }
1477
+ function addBlocks(div, data, cellWidth, start) {
1478
+ var rows = jQuery("div.ganttview-blocks div.ganttview-block-container", div);
1479
+ var rowIdx = 0;
1480
+ for (var i = 0; i < data.length; i++) {
1481
+ for (var j = 0; j < data[i].series.length; j++) {
1482
+ var series = data[i].series[j];
1483
+ var size = DateUtils.daysBetween(series.start, series.end) + 1;
1484
+ var offset = DateUtils.daysBetween(start, series.start);
1485
+ var block = jQuery("<div>", {
1486
+ "class": "ganttview-block",
1487
+ "title": series.name + ", " + size + " days",
1488
+ "css": {
1489
+ "width": ((size * cellWidth) - 9) + "px",
1490
+ "margin-left": ((offset * cellWidth) + 3) + "px"
1491
+ }
1492
+ });
1493
+ addBlockData(block, data[i], series);
1494
+ if (data[i].series[j].color) {
1495
+ block.css("background-color", data[i].series[j].color);
1496
+ }
1497
+ block.append(jQuery("<div>", { "class": "ganttview-block-text" }).text(size));
1498
+ jQuery(rows[rowIdx]).append(block);
1499
+ rowIdx = rowIdx + 1;
1500
+ }
1501
+ }
1502
+ }
1511
1503
 
1512
- function applyLastClass(div) {
1513
- jQuery("div.ganttview-grid-row div.ganttview-grid-row-cell:last-child", div).addClass("last");
1514
- jQuery("div.ganttview-hzheader-days div.ganttview-hzheader-day:last-child", div).addClass("last");
1515
- jQuery("div.ganttview-hzheader-months div.ganttview-hzheader-month:last-child", div).addClass("last");
1516
- }
1504
+ function addBlockData(block, data, series) {
1505
+ // This allows custom attributes to be added to the series data objects
1506
+ // and makes them available to the 'data' argument of click, resize, and drag handlers
1507
+ var blockData = { id: data.id, name: data.name };
1508
+ jQuery.extend(blockData, series);
1509
+ block.data("block-data", blockData);
1510
+ }
1517
1511
 
1518
- return {
1519
- render: render
1520
- };
1512
+ function applyLastClass(div) {
1513
+ jQuery("div.ganttview-grid-row div.ganttview-grid-row-cell:last-child", div).addClass("last");
1514
+ jQuery("div.ganttview-hzheader-days div.ganttview-hzheader-day:last-child", div).addClass("last");
1515
+ jQuery("div.ganttview-hzheader-months div.ganttview-hzheader-month:last-child", div).addClass("last");
1521
1516
  }
1522
1517
 
1523
- var Behavior = function (div, opts) {
1518
+ return {
1519
+ render: render
1520
+ };
1521
+ }
1524
1522
 
1525
- function apply() {
1523
+ var Behavior = function (div, opts) {
1526
1524
 
1527
- if (opts.behavior.clickable) {
1528
- bindBlockClick(div, opts.behavior.onClick);
1529
- }
1525
+ function apply() {
1530
1526
 
1531
- if (opts.behavior.resizable) {
1532
- bindBlockResize(div, opts.cellWidth, opts.start, opts.behavior.onResize);
1533
- }
1527
+ if (opts.behavior.clickable) {
1528
+ bindBlockClick(div, opts.behavior.onClick);
1529
+ }
1534
1530
 
1535
- if (opts.behavior.draggable) {
1536
- bindBlockDrag(div, opts.cellWidth, opts.start, opts.behavior.onDrag);
1537
- }
1538
- }
1531
+ if (opts.behavior.resizable) {
1532
+ bindBlockResize(div, opts.cellWidth, opts.start, opts.behavior.onResize);
1533
+ }
1539
1534
 
1540
- function bindBlockClick(div, callback) {
1541
- jQuery("div.ganttview-block", div).live("click", function () {
1542
- if (callback) {
1543
- callback(jQuery(this).data("block-data"));
1544
- }
1545
- });
1546
- }
1535
+ if (opts.behavior.draggable) {
1536
+ bindBlockDrag(div, opts.cellWidth, opts.start, opts.behavior.onDrag);
1537
+ }
1538
+ }
1547
1539
 
1548
- function bindBlockResize(div, cellWidth, startDate, callback) {
1549
- jQuery("div.ganttview-block", div).resizable({
1550
- grid: cellWidth,
1551
- handles: "e,w",
1552
- stop: function () {
1553
- var block = jQuery(this);
1554
- updateDataAndPosition(div, block, cellWidth, startDate);
1555
- if (callback) {
1556
- callback(block.data("block-data"));
1557
- }
1558
- }
1559
- });
1540
+ function bindBlockClick(div, callback) {
1541
+ jQuery("div.ganttview-block", div).live("click", function () {
1542
+ if (callback) {
1543
+ callback(jQuery(this).data("block-data"));
1560
1544
  }
1545
+ });
1546
+ }
1561
1547
 
1562
- function bindBlockDrag(div, cellWidth, startDate, callback) {
1563
- jQuery("div.ganttview-block", div).draggable({
1564
- axis: "x",
1565
- grid: [cellWidth, cellWidth],
1566
- stop: function () {
1567
- var block = jQuery(this);
1568
- updateDataAndPosition(div, block, cellWidth, startDate);
1569
- if (callback) {
1570
- callback(block.data("block-data"));
1571
- }
1572
- }
1573
- });
1574
- }
1548
+ function bindBlockResize(div, cellWidth, startDate, callback) {
1549
+ jQuery("div.ganttview-block", div).resizable({
1550
+ grid: cellWidth,
1551
+ handles: "e,w",
1552
+ stop: function () {
1553
+ var block = jQuery(this);
1554
+ updateDataAndPosition(div, block, cellWidth, startDate);
1555
+ if (callback) {
1556
+ callback(block.data("block-data"));
1557
+ }
1558
+ }
1559
+ });
1560
+ }
1575
1561
 
1576
- function updateDataAndPosition(div, block, cellWidth, startDate) {
1577
- var container = jQuery("div.ganttview-slide-container", div);
1578
- var scroll = container.scrollLeft();
1579
- var offset = block.offset().left - container.offset().left - 1 + scroll;
1562
+ function bindBlockDrag(div, cellWidth, startDate, callback) {
1563
+ jQuery("div.ganttview-block", div).draggable({
1564
+ axis: "x",
1565
+ grid: [cellWidth, cellWidth],
1566
+ stop: function () {
1567
+ var block = jQuery(this);
1568
+ updateDataAndPosition(div, block, cellWidth, startDate);
1569
+ if (callback) {
1570
+ callback(block.data("block-data"));
1571
+ }
1572
+ }
1573
+ });
1574
+ }
1580
1575
 
1581
- // Set new start date
1582
- var daysFromStart = Math.round(offset / cellWidth);
1583
- var newStart = startDate.clone().addDays(daysFromStart);
1584
- block.data("block-data").start = newStart;
1576
+ function updateDataAndPosition(div, block, cellWidth, startDate) {
1577
+ var container = jQuery("div.ganttview-slide-container", div);
1578
+ var scroll = container.scrollLeft();
1579
+ var offset = block.offset().left - container.offset().left - 1 + scroll;
1585
1580
 
1586
- // Set new end date
1587
- var width = block.outerWidth();
1588
- var numberOfDays = Math.round(width / cellWidth) - 1;
1589
- block.data("block-data").end = newStart.clone().addDays(numberOfDays);
1590
- jQuery("div.ganttview-block-text", block).text(numberOfDays + 1);
1581
+ // Set new start date
1582
+ var daysFromStart = Math.round(offset / cellWidth);
1583
+ var newStart = startDate.clone().addDays(daysFromStart);
1584
+ block.data("block-data").start = newStart;
1591
1585
 
1592
- // Remove top and left properties to avoid incorrect block positioning,
1593
- // set position to relative to keep blocks relative to scrollbar when scrolling
1594
- block.css("top", "").css("left", "")
1595
- .css("position", "relative").css("margin-left", offset + "px");
1596
- }
1586
+ // Set new end date
1587
+ var width = block.outerWidth();
1588
+ var numberOfDays = Math.round(width / cellWidth) - 1;
1589
+ block.data("block-data").end = newStart.clone().addDays(numberOfDays);
1590
+ jQuery("div.ganttview-block-text", block).text(numberOfDays + 1);
1597
1591
 
1598
- return {
1599
- apply: apply
1600
- };
1592
+ // Remove top and left properties to avoid incorrect block positioning,
1593
+ // set position to relative to keep blocks relative to scrollbar when scrolling
1594
+ block.css("top", "").css("left", "")
1595
+ .css("position", "relative").css("margin-left", offset + "px");
1601
1596
  }
1602
1597
 
1603
- var ArrayUtils = {
1604
-
1605
- contains: function (arr, obj) {
1606
- var has = false;
1607
- for (var i = 0; i < arr.length; i++) {
1608
- if (arr[i] == obj) {
1609
- has = true;
1610
- }
1611
- }
1612
- return has;
1613
- }
1598
+ return {
1599
+ apply: apply
1614
1600
  };
1601
+ }
1615
1602
 
1616
- var DateUtils = {
1603
+ var ArrayUtils = {
1617
1604
 
1618
- daysBetween: function (start, end) {
1619
- if (!start || !end) {
1620
- return 0;
1621
- }
1622
- start = Date.parse(start);
1623
- end = Date.parse(end);
1624
- if (start.getYear() == 1901 || end.getYear() == 8099) {
1625
- return 0;
1626
- }
1627
- var count = 0, date = start.clone();
1628
- while (date.compareTo(end) == -1) {
1629
- count = count + 1;
1630
- date.addDays(1);
1631
- }
1632
- return count;
1633
- },
1605
+ contains: function (arr, obj) {
1606
+ var has = false;
1607
+ for (var i = 0; i < arr.length; i++) {
1608
+ if (arr[i] == obj) {
1609
+ has = true;
1610
+ }
1611
+ }
1612
+ return has;
1613
+ }
1614
+ };
1634
1615
 
1635
- isWeekend: function (date) {
1636
- return date.getDay() % 6 == 0;
1637
- },
1616
+ var DateUtils = {
1638
1617
 
1639
- getBoundaryDatesFromData: function (data, minDays) {
1640
- var minStart = new Date();
1641
- maxEnd = new Date();
1642
- for (var i = 0; i < data.length; i++) {
1643
- for (var j = 0; j < data[i].series.length; j++) {
1644
- var start = Date.parse(data[i].series[j].start);
1645
- var end = Date.parse(data[i].series[j].end)
1646
- if (i == 0 && j == 0) {
1647
- minStart = start;
1648
- maxEnd = end;
1649
- }
1650
- if (minStart.compareTo(start) == 1) {
1651
- minStart = start;
1652
- }
1653
- if (maxEnd.compareTo(end) == -1) {
1654
- maxEnd = end;
1655
- }
1656
- }
1657
- }
1618
+ daysBetween: function (start, end) {
1619
+ if (!start || !end) {
1620
+ return 0;
1621
+ }
1622
+ start = Date.parse(start);
1623
+ end = Date.parse(end);
1624
+ if (start.getYear() == 1901 || end.getYear() == 8099) {
1625
+ return 0;
1626
+ }
1627
+ var count = 0, date = start.clone();
1628
+ while (date.compareTo(end) == -1) {
1629
+ count = count + 1;
1630
+ date.addDays(1);
1631
+ }
1632
+ return count;
1633
+ },
1658
1634
 
1659
- // Insure that the width of the chart is at least the slide width to avoid empty
1660
- // whitespace to the right of the grid
1661
- if (DateUtils.daysBetween(minStart, maxEnd) < minDays) {
1662
- maxEnd = minStart.clone().addDays(minDays);
1663
- }
1635
+ isWeekend: function (date) {
1636
+ return date.getDay() % 6 == 0;
1637
+ },
1664
1638
 
1665
- return [minStart, maxEnd];
1666
- }
1667
- };
1639
+ getBoundaryDatesFromData: function (data, minDays) {
1640
+ var minStart = new Date();
1641
+ maxEnd = new Date();
1642
+ for (var i = 0; i < data.length; i++) {
1643
+ for (var j = 0; j < data[i].series.length; j++) {
1644
+ var start = Date.parse(data[i].series[j].start);
1645
+ var end = Date.parse(data[i].series[j].end)
1646
+ if (i == 0 && j == 0) {
1647
+ minStart = start;
1648
+ maxEnd = end;
1649
+ }
1650
+ if (minStart.compareTo(start) == 1) {
1651
+ minStart = start;
1652
+ }
1653
+ if (maxEnd.compareTo(end) == -1) {
1654
+ maxEnd = end;
1655
+ }
1656
+ }
1657
+ }
1658
+
1659
+ // Insure that the width of the chart is at least the slide width to avoid empty
1660
+ // whitespace to the right of the grid
1661
+ if (DateUtils.daysBetween(minStart, maxEnd) < minDays) {
1662
+ maxEnd = minStart.clone().addDays(minDays);
1663
+ }
1664
+
1665
+ return [minStart, maxEnd];
1666
+ }
1667
+ };
1668
1668
 
1669
1669
  })(jQuery);