spiderfw 0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (638) hide show
  1. data/README +4 -0
  2. data/Rakefile +74 -0
  3. data/apps/cas_server/_init.rb +23 -0
  4. data/apps/cas_server/config/options.rb +9 -0
  5. data/apps/cas_server/controllers/mixins/cas_login_mixin.rb +353 -0
  6. data/apps/cas_server/lib/cas.rb +329 -0
  7. data/apps/cas_server/lib/utils.rb +30 -0
  8. data/apps/cas_server/models/login_ticket.rb +11 -0
  9. data/apps/cas_server/models/mixins/consumable.rb +10 -0
  10. data/apps/cas_server/models/proxy_granting_ticket.rb +12 -0
  11. data/apps/cas_server/models/proxy_ticket.rb +12 -0
  12. data/apps/cas_server/models/service_ticket.rb +22 -0
  13. data/apps/cas_server/models/ticket.rb +20 -0
  14. data/apps/cas_server/models/ticket_granting_ticket.rb +15 -0
  15. data/apps/cas_server/views/logout.shtml +3 -0
  16. data/apps/core/admin/_init.rb +23 -0
  17. data/apps/core/admin/admin.rb +17 -0
  18. data/apps/core/admin/controllers/admin_controller.rb +15 -0
  19. data/apps/core/admin/views/index.shtml +1 -0
  20. data/apps/core/admin/views/spider_admin.layout.shtml +23 -0
  21. data/apps/core/admin/widgets/admin_menu/admin_menu.rb +17 -0
  22. data/apps/core/auth/_init.rb +42 -0
  23. data/apps/core/auth/controllers/login_controller.rb +94 -0
  24. data/apps/core/auth/controllers/mixins/auth_helper.rb +114 -0
  25. data/apps/core/auth/controllers/mixins/http_basic_auth.rb +24 -0
  26. data/apps/core/auth/controllers/mixins/http_digest_auth.rb +26 -0
  27. data/apps/core/auth/lib/authenticable.rb +86 -0
  28. data/apps/core/auth/lib/authenticator.rb +11 -0
  29. data/apps/core/auth/lib/digest_authenticator.rb +44 -0
  30. data/apps/core/auth/lib/login_authenticator.rb +27 -0
  31. data/apps/core/auth/models/digest_user.rb +34 -0
  32. data/apps/core/auth/models/group.rb +22 -0
  33. data/apps/core/auth/models/login_user.rb +15 -0
  34. data/apps/core/auth/models/mixins/access_control.rb +71 -0
  35. data/apps/core/auth/models/mixins/authentication_tracking.rb +19 -0
  36. data/apps/core/auth/models/super_user.rb +8 -0
  37. data/apps/core/auth/models/user.rb +15 -0
  38. data/apps/core/auth/po/it/spider_auth.po +33 -0
  39. data/apps/core/auth/po/spider_auth.pot +31 -0
  40. data/apps/core/auth/views/login.shtml +25 -0
  41. data/apps/core/components/_init.rb +21 -0
  42. data/apps/core/components/po/it/spider_components.po +52 -0
  43. data/apps/core/components/po/spider_components.pot +53 -0
  44. data/apps/core/components/public/css/admin.css +73 -0
  45. data/apps/core/components/public/css/crud.css +58 -0
  46. data/apps/core/components/public/css/img/add.gif +0 -0
  47. data/apps/core/components/public/css/img/ajax-loader.gif +0 -0
  48. data/apps/core/components/public/css/img/back.gif +0 -0
  49. data/apps/core/components/public/css/img/bg_header.png +0 -0
  50. data/apps/core/components/public/css/img/body_bg.jpg +0 -0
  51. data/apps/core/components/public/css/img/gray_gradient.gif +0 -0
  52. data/apps/core/components/public/css/img/li_bg.png +0 -0
  53. data/apps/core/components/public/css/img/li_bg_active.png +0 -0
  54. data/apps/core/components/public/css/img/li_bg_hover.png +0 -0
  55. data/apps/core/components/public/css/img/logo.png +0 -0
  56. data/apps/core/components/public/css/img/menu_bg.png +0 -0
  57. data/apps/core/components/public/css/img/menu_bottom.png +0 -0
  58. data/apps/core/components/public/css/img/menu_top.png +0 -0
  59. data/apps/core/components/public/css/img/section-bottom.jpg +0 -0
  60. data/apps/core/components/public/css/list.css +7 -0
  61. data/apps/core/components/public/css/menu.css +47 -0
  62. data/apps/core/components/public/css/spider.css +9 -0
  63. data/apps/core/components/public/css/switcher.css +13 -0
  64. data/apps/core/components/public/css/table.css +99 -0
  65. data/apps/core/components/public/js/inheritance.js +71 -0
  66. data/apps/core/components/public/js/jquery/jquery-1.3.2.js +4376 -0
  67. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  68. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  69. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  70. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  71. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  72. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  73. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  74. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  75. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
  76. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  77. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
  78. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
  79. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  80. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/jquery-ui-1.7.2.custom.css +406 -0
  81. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  82. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  83. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  84. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  85. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  86. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  87. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  88. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  89. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  90. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  91. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  92. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  93. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  94. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  95. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/jquery-ui-1.7.2.custom.css +406 -0
  96. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/AUTHORS.txt +30 -0
  97. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/GPL-LICENSE.txt +278 -0
  98. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/MIT-LICENSE.txt +25 -0
  99. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/ChangeLog.txt +20 -0
  100. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/META.json +32 -0
  101. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.js +100 -0
  102. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.min.js +10 -0
  103. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.pack.js +10 -0
  104. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/test/index.html +197 -0
  105. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.js +97 -0
  106. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.min.js +10 -0
  107. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.pack.js +10 -0
  108. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.zip +0 -0
  109. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/jsdiff/jsdiff.js +159 -0
  110. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/qunit/testrunner.js +780 -0
  111. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/qunit/testsuite.css +120 -0
  112. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/simulate/jquery.simulate.js +152 -0
  113. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/jquery-1.3.2.js +4376 -0
  114. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  115. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  116. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  117. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  118. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  119. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  120. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  121. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  122. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_222222_256x240.png +0 -0
  123. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
  124. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_454545_256x240.png +0 -0
  125. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_888888_256x240.png +0 -0
  126. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
  127. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.accordion.css +9 -0
  128. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.all.css +2 -0
  129. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.base.css +8 -0
  130. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.core.css +37 -0
  131. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.datepicker.css +62 -0
  132. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.dialog.css +13 -0
  133. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.progressbar.css +4 -0
  134. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.resizable.css +13 -0
  135. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.slider.css +17 -0
  136. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.tabs.css +11 -0
  137. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.theme.css +245 -0
  138. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  139. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  140. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  141. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  142. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  143. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  144. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  145. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  146. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  147. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  148. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  149. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  150. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  151. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  152. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/jquery-ui-1.7.2.custom.css +406 -0
  153. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.accordion.css +9 -0
  154. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.all.css +2 -0
  155. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.base.css +8 -0
  156. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.core.css +37 -0
  157. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.datepicker.css +62 -0
  158. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.dialog.css +13 -0
  159. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.progressbar.css +4 -0
  160. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.resizable.css +13 -0
  161. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.slider.css +17 -0
  162. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.tabs.css +11 -0
  163. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.theme.css +247 -0
  164. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.blind.js +49 -0
  165. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.bounce.js +78 -0
  166. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.clip.js +54 -0
  167. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.core.js +545 -0
  168. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.drop.js +50 -0
  169. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.explode.js +79 -0
  170. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.fold.js +56 -0
  171. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.highlight.js +48 -0
  172. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.pulsate.js +56 -0
  173. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.scale.js +180 -0
  174. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.shake.js +57 -0
  175. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.slide.js +50 -0
  176. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.transfer.js +45 -0
  177. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/jquery-ui-i18n.js +771 -0
  178. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ar.js +20 -0
  179. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-bg.js +20 -0
  180. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ca.js +19 -0
  181. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-cs.js +19 -0
  182. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-da.js +19 -0
  183. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-de.js +19 -0
  184. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-el.js +19 -0
  185. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-eo.js +19 -0
  186. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-es.js +19 -0
  187. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-fa.js +19 -0
  188. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-fi.js +19 -0
  189. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-fr.js +19 -0
  190. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-he.js +19 -0
  191. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-hr.js +19 -0
  192. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-hu.js +19 -0
  193. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-hy.js +19 -0
  194. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-id.js +19 -0
  195. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-is.js +19 -0
  196. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-it.js +19 -0
  197. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ja.js +20 -0
  198. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ko.js +19 -0
  199. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-lt.js +19 -0
  200. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-lv.js +19 -0
  201. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ms.js +19 -0
  202. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-nl.js +19 -0
  203. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-no.js +19 -0
  204. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-pl.js +19 -0
  205. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-pt-BR.js +19 -0
  206. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ro.js +22 -0
  207. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ru.js +19 -0
  208. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sk.js +19 -0
  209. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sl.js +20 -0
  210. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sq.js +19 -0
  211. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sr-SR.js +19 -0
  212. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sr.js +19 -0
  213. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sv.js +19 -0
  214. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-th.js +19 -0
  215. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-tr.js +19 -0
  216. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-uk.js +25 -0
  217. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-zh-CN.js +19 -0
  218. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-zh-TW.js +19 -0
  219. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/jquery-ui-1.7.2.custom.js +9133 -0
  220. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.accordion.js +477 -0
  221. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.core.js +519 -0
  222. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.datepicker.js +1636 -0
  223. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.dialog.js +671 -0
  224. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.draggable.js +766 -0
  225. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.droppable.js +282 -0
  226. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.progressbar.js +116 -0
  227. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.resizable.js +800 -0
  228. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.selectable.js +257 -0
  229. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.slider.js +558 -0
  230. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.sortable.js +1019 -0
  231. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.tabs.js +685 -0
  232. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/version.txt +1 -0
  233. data/apps/core/components/public/js/jquery/jquery-ui/index.html +367 -0
  234. data/apps/core/components/public/js/jquery/jquery-ui/js/jquery-1.3.2.min.js +19 -0
  235. data/apps/core/components/public/js/jquery/jquery-ui/js/jquery-ui-1.7.2.custom.min.js +298 -0
  236. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/changelog.txt +27 -0
  237. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.css +48 -0
  238. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.js +808 -0
  239. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.min.js +13 -0
  240. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.pack.js +12 -0
  241. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.ajaxQueue.js +116 -0
  242. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.bgiframe.min.js +10 -0
  243. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.js +3558 -0
  244. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/thickbox-compressed.js +10 -0
  245. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/thickbox.css +163 -0
  246. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/todo +166 -0
  247. data/apps/core/components/public/js/jquery/plugins/jquery.form.js +653 -0
  248. data/apps/core/components/public/js/jquery/plugins/jquery.query-2.1.6.js +224 -0
  249. data/apps/core/components/public/js/jquery/plugins/jquery.url.js +214 -0
  250. data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.js +187 -0
  251. data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.min.js +1 -0
  252. data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.spider.1.0.js +193 -0
  253. data/apps/core/components/public/js/jquery/plugins/treeview/changelog.txt +35 -0
  254. data/apps/core/components/public/js/jquery/plugins/treeview/images/ajax-loader.gif +0 -0
  255. data/apps/core/components/public/js/jquery/plugins/treeview/images/file.gif +0 -0
  256. data/apps/core/components/public/js/jquery/plugins/treeview/images/folder-closed.gif +0 -0
  257. data/apps/core/components/public/js/jquery/plugins/treeview/images/folder.gif +0 -0
  258. data/apps/core/components/public/js/jquery/plugins/treeview/images/minus.gif +0 -0
  259. data/apps/core/components/public/js/jquery/plugins/treeview/images/plus.gif +0 -0
  260. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-black-line.gif +0 -0
  261. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-black.gif +0 -0
  262. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-default-line.gif +0 -0
  263. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-default.gif +0 -0
  264. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-famfamfam-line.gif +0 -0
  265. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-famfamfam.gif +0 -0
  266. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-gray-line.gif +0 -0
  267. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-gray.gif +0 -0
  268. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-red-line.gif +0 -0
  269. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-red.gif +0 -0
  270. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.async.js +110 -0
  271. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.css +74 -0
  272. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.edit.js +37 -0
  273. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.js +256 -0
  274. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.min.js +15 -0
  275. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.pack.js +16 -0
  276. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.sortable.js +386 -0
  277. data/apps/core/components/public/js/jquery/plugins/treeview/lib/jquery.cookie.js +92 -0
  278. data/apps/core/components/public/js/jquery/plugins/treeview/lib/jquery.js +3534 -0
  279. data/apps/core/components/public/js/jquery/plugins/treeview/todo +8 -0
  280. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/LICENSE +0 -0
  281. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/README +0 -0
  282. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/jquery.timepickr.css +34 -0
  283. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/jquery.timepickr.js +1413 -0
  284. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/jquery.timepickr.min.js +10 -0
  285. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/222222_256x240_icons_icons.png +0 -0
  286. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/2e83ff_256x240_icons_icons.png +0 -0
  287. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/454545_256x240_icons_icons.png +0 -0
  288. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/888888_256x240_icons_icons.png +0 -0
  289. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/aaaaaa_40x100_textures_01_flat_0.png +0 -0
  290. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/cccccc_40x100_textures_03_highlight_soft_75.png +0 -0
  291. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/cd0a0a_256x240_icons_icons.png +0 -0
  292. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/dadada_40x100_textures_02_glass_75.png +0 -0
  293. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/e6e6e6_40x100_textures_02_glass_75.png +0 -0
  294. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/fbf9ee_40x100_textures_02_glass_55.png +0 -0
  295. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/fef1ec_40x100_textures_05_inset_soft_95.png +0 -0
  296. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/ffffff_40x100_textures_02_glass_65.png +0 -0
  297. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/ffffff_40x100_textures_02_glass_75.png +0 -0
  298. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.accordion.css +9 -0
  299. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.all.css +4 -0
  300. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.allplugins.css +7 -0
  301. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.core.css +37 -0
  302. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.datepicker.css +60 -0
  303. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.dialog.css +13 -0
  304. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.progressbar.css +4 -0
  305. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.resizable.css +13 -0
  306. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.slider.css +13 -0
  307. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.tabs.css +9 -0
  308. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.theme.css +238 -0
  309. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.timepickr.css +44 -0
  310. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/ui.timepickr.js +2307 -0
  311. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/ui.timepickr.min.js +10 -0
  312. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/body-bg.png +0 -0
  313. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/btn-hover.png +0 -0
  314. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/btn.png +0 -0
  315. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/buttons.psd +0 -0
  316. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/index.html +326 -0
  317. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.anchorHandler.js +44 -0
  318. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.strings.js +290 -0
  319. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.ui.all.js +518 -0
  320. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.utils.js +255 -0
  321. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.utils.ui.min.js +26 -0
  322. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo-ff.png +0 -0
  323. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo-ie.png +0 -0
  324. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo.png +0 -0
  325. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo.psd +0 -0
  326. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/package.png +0 -0
  327. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/reset.css +48 -0
  328. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/script_code.png +0 -0
  329. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/styles.css +308 -0
  330. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/themeroller_ready_black_200px.gif +0 -0
  331. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/weather_sun.png +0 -0
  332. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/css/ui.dropslide.css +26 -0
  333. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/css/ui.timepickr.css +18 -0
  334. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/ui.dropslide.js +132 -0
  335. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/ui.timepickr.js +217 -0
  336. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/data/testrunner.js +1 -0
  337. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/index.html +34 -0
  338. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/otherlibs/jquery/1.2.1/jquery.js +11 -0
  339. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/otherlibs/jquery/1.2.3/jquery.js +11 -0
  340. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/qunit/testrunner.js +780 -0
  341. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/qunit/testsuite.css +120 -0
  342. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/styles.css +201 -0
  343. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/test.js +41 -0
  344. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/unit/ui.timepickr.js +154 -0
  345. data/apps/core/components/public/js/list.js +234 -0
  346. data/apps/core/components/public/js/spider.js +484 -0
  347. data/apps/core/components/public/widgets/search_table.js +10 -0
  348. data/apps/core/components/public/widgets/table.js +9 -0
  349. data/apps/core/components/widgets/admin/admin.rb +75 -0
  350. data/apps/core/components/widgets/admin/admin.shtml +16 -0
  351. data/apps/core/components/widgets/confirm/confirm.rb +37 -0
  352. data/apps/core/components/widgets/confirm/confirm.shtml +9 -0
  353. data/apps/core/components/widgets/crud/crud.rb +119 -0
  354. data/apps/core/components/widgets/crud/crud.shtml +59 -0
  355. data/apps/core/components/widgets/crud/form_table/form_table.rb +13 -0
  356. data/apps/core/components/widgets/crud/form_table/form_table.shtml +3 -0
  357. data/apps/core/components/widgets/list/list.rb +294 -0
  358. data/apps/core/components/widgets/list/list.shtml +38 -0
  359. data/apps/core/components/widgets/list/plugins/exportable/exportable_list.rb +19 -0
  360. data/apps/core/components/widgets/list/plugins/exportable/exportable_list.shtml +5 -0
  361. data/apps/core/components/widgets/menu/menu.rb +20 -0
  362. data/apps/core/components/widgets/menu/menu.shtml +13 -0
  363. data/apps/core/components/widgets/search_table/search_table.rb +22 -0
  364. data/apps/core/components/widgets/search_table/search_table.shtml +11 -0
  365. data/apps/core/components/widgets/switcher/switcher.rb +68 -0
  366. data/apps/core/components/widgets/switcher/switcher.shtml +17 -0
  367. data/apps/core/components/widgets/table/table.rb +153 -0
  368. data/apps/core/components/widgets/table/table.shtml +41 -0
  369. data/apps/core/components/widgets/tabs/tabs.rb +38 -0
  370. data/apps/core/components/widgets/tabs/tabs.shtml +2 -0
  371. data/apps/core/forms/_init.rb +22 -0
  372. data/apps/core/forms/po/it/spider_forms.po +36 -0
  373. data/apps/core/forms/po/spider_forms.pot +37 -0
  374. data/apps/core/forms/public/date_time.js +23 -0
  375. data/apps/core/forms/public/form.css +81 -0
  376. data/apps/core/forms/public/form.js +19 -0
  377. data/apps/core/forms/public/input.js +30 -0
  378. data/apps/core/forms/public/search_select.js +123 -0
  379. data/apps/core/forms/public/select.js +11 -0
  380. data/apps/core/forms/tags/element_label.erb +1 -0
  381. data/apps/core/forms/tags/element_row.erb +4 -0
  382. data/apps/core/forms/tags/row.erb +4 -0
  383. data/apps/core/forms/widgets/form/form.rb +430 -0
  384. data/apps/core/forms/widgets/form/form.shtml +47 -0
  385. data/apps/core/forms/widgets/inputs/checkbox/checkbox.rb +13 -0
  386. data/apps/core/forms/widgets/inputs/checkbox/checkbox.shtml +3 -0
  387. data/apps/core/forms/widgets/inputs/date_time/date_time.rb +48 -0
  388. data/apps/core/forms/widgets/inputs/date_time/date_time.shtml +4 -0
  389. data/apps/core/forms/widgets/inputs/hidden/hidden.rb +8 -0
  390. data/apps/core/forms/widgets/inputs/hidden/hidden.shtml +3 -0
  391. data/apps/core/forms/widgets/inputs/input/input.rb +105 -0
  392. data/apps/core/forms/widgets/inputs/input/input.shtml +3 -0
  393. data/apps/core/forms/widgets/inputs/input/readonly.shtml +6 -0
  394. data/apps/core/forms/widgets/inputs/password/password.rb +24 -0
  395. data/apps/core/forms/widgets/inputs/password/password.shtml +5 -0
  396. data/apps/core/forms/widgets/inputs/search_select/search_select.rb +168 -0
  397. data/apps/core/forms/widgets/inputs/search_select/search_select.shtml +42 -0
  398. data/apps/core/forms/widgets/inputs/select/select.rb +126 -0
  399. data/apps/core/forms/widgets/inputs/select/select.shtml +8 -0
  400. data/apps/core/forms/widgets/inputs/subform/subform.rb +10 -0
  401. data/apps/core/forms/widgets/inputs/subform/subform.shtml +5 -0
  402. data/apps/core/forms/widgets/inputs/text/text.rb +9 -0
  403. data/apps/core/forms/widgets/inputs/text/text.shtml +3 -0
  404. data/apps/core/forms/widgets/inputs/text_area/text_area.rb +10 -0
  405. data/apps/core/forms/widgets/inputs/text_area/text_area.shtml +1 -0
  406. data/apps/drb_server/_init.rb +8 -0
  407. data/apps/drb_server/lib/model_server.rb +41 -0
  408. data/apps/drb_server/script/start_server.rb +19 -0
  409. data/apps/hippo/_init.rb +10 -0
  410. data/apps/hippo/models/mixins/hippo_struct.rb +210 -0
  411. data/apps/hippo/models/security_group.rb +21 -0
  412. data/apps/hippo/models/security_user.rb +29 -0
  413. data/apps/messenger/_init.rb +24 -0
  414. data/apps/messenger/config/options.rb +15 -0
  415. data/apps/messenger/config/worker.rb +3 -0
  416. data/apps/messenger/controllers/messenger_controller.rb +80 -0
  417. data/apps/messenger/controllers/mixins/messenger_controller_mixin.rb +54 -0
  418. data/apps/messenger/lib/backends/email/smtp.rb +0 -0
  419. data/apps/messenger/messenger.rb +94 -0
  420. data/apps/messenger/models/email.rb +22 -0
  421. data/apps/messenger/models/message.rb +44 -0
  422. data/apps/messenger/po/it/spider_messenger.po +77 -0
  423. data/apps/messenger/po/spider_messenger.pot +77 -0
  424. data/apps/messenger/views/index.shtml +13 -0
  425. data/apps/messenger/views/list.shtml +5 -0
  426. data/apps/messenger/views/messenger.layout.shtml +4 -0
  427. data/apps/messenger/views/queue.shtml +8 -0
  428. data/apps/messenger/views/tags/sent_messages.shtml +1 -0
  429. data/apps/soap/_init.rb +16 -0
  430. data/apps/soap/controllers/soap_controller.rb +334 -0
  431. data/apps/soap/doc/examples/example.rb +28 -0
  432. data/apps/soap/lib/soap.rb +217 -0
  433. data/apps/sso/_init.rb +16 -0
  434. data/apps/sso/config/options.rb +13 -0
  435. data/apps/sso/controllers/mixins/saml2_mixin.rb +149 -0
  436. data/apps/sso/lib/saml2/backend.rb +16 -0
  437. data/apps/sso/lib/saml2/lasso_backend.rb +88 -0
  438. data/apps/sso/lib/saml2.rb +112 -0
  439. data/apps/sso/views/saml2_post.shtml +19 -0
  440. data/apps/webdav/_init.rb +15 -0
  441. data/apps/webdav/controllers/webdav_controller.rb +862 -0
  442. data/apps/webdav/lib/locking.rb +193 -0
  443. data/apps/webdav/lib/vfs/abstract.rb +78 -0
  444. data/apps/webdav/lib/vfs/local.rb +126 -0
  445. data/apps/webdav/lib/vfs/mapped.rb +235 -0
  446. data/apps/webdav/lib/vfs/properties.rb +41 -0
  447. data/apps/worker/_init.rb +13 -0
  448. data/apps/worker/cmd.rb +65 -0
  449. data/apps/worker/config/options.rb +9 -0
  450. data/apps/worker/lib/runner.rb +43 -0
  451. data/apps/worker/lib/task.rb +9 -0
  452. data/apps/worker/models/job.rb +20 -0
  453. data/apps/worker/worker.rb +168 -0
  454. data/bin/spider +9 -0
  455. data/blueprints/app/_init.rb +10 -0
  456. data/blueprints/app/controllers/__APP___controller.rb +14 -0
  457. data/blueprints/app/views/__APP__.layout.shtml +8 -0
  458. data/blueprints/app/views/index.shtml +3 -0
  459. data/blueprints/install/config/config.yml +14 -0
  460. data/blueprints/install/init.rb +3 -0
  461. data/data/locale/it/LC_MESSAGES/spider.mo +0 -0
  462. data/data/locale/it/LC_MESSAGES/spider_auth.mo +0 -0
  463. data/data/locale/it/LC_MESSAGES/spider_components.mo +0 -0
  464. data/data/locale/it/LC_MESSAGES/spider_forms.mo +0 -0
  465. data/data/locale/it/LC_MESSAGES/spider_messenger.mo +0 -0
  466. data/lib/spiderfw/app.rb +186 -0
  467. data/lib/spiderfw/autoload.rb +12 -0
  468. data/lib/spiderfw/cache/template_cache.rb +136 -0
  469. data/lib/spiderfw/cmd/cmd.rb +72 -0
  470. data/lib/spiderfw/cmd/commands/cert.rb +427 -0
  471. data/lib/spiderfw/cmd/commands/console.rb +27 -0
  472. data/lib/spiderfw/cmd/commands/init.rb +52 -0
  473. data/lib/spiderfw/cmd/commands/model.rb +131 -0
  474. data/lib/spiderfw/cmd/commands/setup.rb +54 -0
  475. data/lib/spiderfw/cmd/commands/test.rb +61 -0
  476. data/lib/spiderfw/cmd/commands/webserver.rb +93 -0
  477. data/lib/spiderfw/config/configurable.rb +38 -0
  478. data/lib/spiderfw/config/configuration.rb +281 -0
  479. data/lib/spiderfw/config/options/spider.rb +122 -0
  480. data/lib/spiderfw/controller/app_controller.rb +14 -0
  481. data/lib/spiderfw/controller/controller.rb +321 -0
  482. data/lib/spiderfw/controller/controller_exceptions.rb +27 -0
  483. data/lib/spiderfw/controller/controller_io.rb +26 -0
  484. data/lib/spiderfw/controller/controller_mixin.rb +12 -0
  485. data/lib/spiderfw/controller/cookie.rb +20 -0
  486. data/lib/spiderfw/controller/cookies.rb +17 -0
  487. data/lib/spiderfw/controller/dispatcher.rb +269 -0
  488. data/lib/spiderfw/controller/first_responder.rb +59 -0
  489. data/lib/spiderfw/controller/formats/html.rb +90 -0
  490. data/lib/spiderfw/controller/helpers/widget_helper.rb +73 -0
  491. data/lib/spiderfw/controller/home_controller.rb +26 -0
  492. data/lib/spiderfw/controller/http_controller.rb +112 -0
  493. data/lib/spiderfw/controller/mixins/http_mixin.rb +228 -0
  494. data/lib/spiderfw/controller/mixins/static_content.rb +90 -0
  495. data/lib/spiderfw/controller/mixins/visual.rb +489 -0
  496. data/lib/spiderfw/controller/page_controller.rb +39 -0
  497. data/lib/spiderfw/controller/request.rb +48 -0
  498. data/lib/spiderfw/controller/response.rb +50 -0
  499. data/lib/spiderfw/controller/router.rb +9 -0
  500. data/lib/spiderfw/controller/scene.rb +27 -0
  501. data/lib/spiderfw/controller/session/file_session.rb +83 -0
  502. data/lib/spiderfw/controller/session/flash_hash.rb +56 -0
  503. data/lib/spiderfw/controller/session/memory_session.rb +62 -0
  504. data/lib/spiderfw/controller/session/transient_hash.rb +18 -0
  505. data/lib/spiderfw/controller/session.rb +106 -0
  506. data/lib/spiderfw/controller/spider_controller.rb +20 -0
  507. data/lib/spiderfw/create.rb +64 -0
  508. data/lib/spiderfw/env.rb +17 -0
  509. data/lib/spiderfw/exceptions.rb +2 -0
  510. data/lib/spiderfw/home.rb +26 -0
  511. data/lib/spiderfw/http/adapters/cgi.rb +62 -0
  512. data/lib/spiderfw/http/adapters/cgi_io.rb +27 -0
  513. data/lib/spiderfw/http/adapters/fcgi.rb +62 -0
  514. data/lib/spiderfw/http/adapters/mongrel.rb +207 -0
  515. data/lib/spiderfw/http/adapters/rack.rb +152 -0
  516. data/lib/spiderfw/http/adapters/thin.rb +38 -0
  517. data/lib/spiderfw/http/adapters/webrick.rb +176 -0
  518. data/lib/spiderfw/http/http.rb +297 -0
  519. data/lib/spiderfw/http/server.rb +40 -0
  520. data/lib/spiderfw/i18n/cldr.rb +114 -0
  521. data/lib/spiderfw/i18n/gettext.rb +8 -0
  522. data/lib/spiderfw/i18n/i18n.rb +120 -0
  523. data/lib/spiderfw/i18n/provider.rb +12 -0
  524. data/lib/spiderfw/i18n/rails.rb +89 -0
  525. data/lib/spiderfw/i18n/shtml_parser.rb +41 -0
  526. data/lib/spiderfw/model/active_record.rb +335 -0
  527. data/lib/spiderfw/model/base_model.rb +2068 -0
  528. data/lib/spiderfw/model/condition.rb +416 -0
  529. data/lib/spiderfw/model/data_type.rb +75 -0
  530. data/lib/spiderfw/model/datatypes/binary.rb +10 -0
  531. data/lib/spiderfw/model/datatypes/bool.rb +10 -0
  532. data/lib/spiderfw/model/datatypes/decimal.rb +22 -0
  533. data/lib/spiderfw/model/datatypes/email.rb +13 -0
  534. data/lib/spiderfw/model/datatypes/password.rb +63 -0
  535. data/lib/spiderfw/model/datatypes/serialized_object.rb +32 -0
  536. data/lib/spiderfw/model/datatypes/text.rb +10 -0
  537. data/lib/spiderfw/model/datatypes/uuid.rb +29 -0
  538. data/lib/spiderfw/model/datatypes.rb +19 -0
  539. data/lib/spiderfw/model/element.rb +250 -0
  540. data/lib/spiderfw/model/extended_models/managed.rb +43 -0
  541. data/lib/spiderfw/model/identity_mapper.rb +89 -0
  542. data/lib/spiderfw/model/inline_model.rb +37 -0
  543. data/lib/spiderfw/model/mappers/db_mapper.rb +1126 -0
  544. data/lib/spiderfw/model/mappers/hash_mapper.rb +114 -0
  545. data/lib/spiderfw/model/mappers/mapper.rb +926 -0
  546. data/lib/spiderfw/model/mappers/mappers.rb +7 -0
  547. data/lib/spiderfw/model/mappers/proxy_mapper.rb +25 -0
  548. data/lib/spiderfw/model/mappers/vfs/flat_file.rb +31 -0
  549. data/lib/spiderfw/model/mixins/converted.rb +110 -0
  550. data/lib/spiderfw/model/mixins/list.rb +135 -0
  551. data/lib/spiderfw/model/mixins/mixins.rb +7 -0
  552. data/lib/spiderfw/model/mixins/state_machine.rb +81 -0
  553. data/lib/spiderfw/model/mixins/synchronized.rb +88 -0
  554. data/lib/spiderfw/model/mixins/tree.rb +296 -0
  555. data/lib/spiderfw/model/mixins/versioned.rb +147 -0
  556. data/lib/spiderfw/model/model.rb +226 -0
  557. data/lib/spiderfw/model/model_hash.rb +50 -0
  558. data/lib/spiderfw/model/proxy_model.rb +37 -0
  559. data/lib/spiderfw/model/query.rb +147 -0
  560. data/lib/spiderfw/model/query_funcs.rb +99 -0
  561. data/lib/spiderfw/model/query_set.rb +700 -0
  562. data/lib/spiderfw/model/request.rb +80 -0
  563. data/lib/spiderfw/model/storage/base_storage.rb +110 -0
  564. data/lib/spiderfw/model/storage/db/adapters/mssql.rb +129 -0
  565. data/lib/spiderfw/model/storage/db/adapters/mysql.rb +436 -0
  566. data/lib/spiderfw/model/storage/db/adapters/oci8.rb +533 -0
  567. data/lib/spiderfw/model/storage/db/adapters/sqlite.rb +163 -0
  568. data/lib/spiderfw/model/storage/db/connectors/odbc.rb +213 -0
  569. data/lib/spiderfw/model/storage/db/db.rb +13 -0
  570. data/lib/spiderfw/model/storage/db/db_connection_pool.rb +126 -0
  571. data/lib/spiderfw/model/storage/db/db_connector.rb +9 -0
  572. data/lib/spiderfw/model/storage/db/db_schema.rb +233 -0
  573. data/lib/spiderfw/model/storage/db/db_storage.rb +872 -0
  574. data/lib/spiderfw/model/storage/db/dialects/no_total_rows.rb +18 -0
  575. data/lib/spiderfw/model/storage/db/reflector.rb +36 -0
  576. data/lib/spiderfw/model/storage/null_storage.rb +18 -0
  577. data/lib/spiderfw/model/storage/schema.rb +19 -0
  578. data/lib/spiderfw/model/storage.rb +72 -0
  579. data/lib/spiderfw/model/sync.rb +94 -0
  580. data/lib/spiderfw/model/type.rb +13 -0
  581. data/lib/spiderfw/model/unit_of_work.rb +75 -0
  582. data/lib/spiderfw/requires.rb +21 -0
  583. data/lib/spiderfw/resource.rb +18 -0
  584. data/lib/spiderfw/setup/setup_task.rb +44 -0
  585. data/lib/spiderfw/tag/tag.rb +28 -0
  586. data/lib/spiderfw/templates/blocks/attr_if.rb +32 -0
  587. data/lib/spiderfw/templates/blocks/comment.rb +38 -0
  588. data/lib/spiderfw/templates/blocks/debugger.rb +16 -0
  589. data/lib/spiderfw/templates/blocks/each.rb +51 -0
  590. data/lib/spiderfw/templates/blocks/html.rb +70 -0
  591. data/lib/spiderfw/templates/blocks/if.rb +35 -0
  592. data/lib/spiderfw/templates/blocks/pass.rb +16 -0
  593. data/lib/spiderfw/templates/blocks/render.rb +23 -0
  594. data/lib/spiderfw/templates/blocks/run.rb +30 -0
  595. data/lib/spiderfw/templates/blocks/tag.rb +21 -0
  596. data/lib/spiderfw/templates/blocks/tag_if.rb +29 -0
  597. data/lib/spiderfw/templates/blocks/text.rb +43 -0
  598. data/lib/spiderfw/templates/blocks/widget.rb +58 -0
  599. data/lib/spiderfw/templates/blocks/yield.rb +18 -0
  600. data/lib/spiderfw/templates/layout.rb +44 -0
  601. data/lib/spiderfw/templates/resources/less.rb +14 -0
  602. data/lib/spiderfw/templates/template.rb +625 -0
  603. data/lib/spiderfw/templates/template_blocks.rb +185 -0
  604. data/lib/spiderfw/utils/annotations.rb +201 -0
  605. data/lib/spiderfw/utils/fork.rb +75 -0
  606. data/lib/spiderfw/utils/hash_comparison.rb +8 -0
  607. data/lib/spiderfw/utils/inflector.rb +42 -0
  608. data/lib/spiderfw/utils/logger.rb +92 -0
  609. data/lib/spiderfw/utils/monkey/class.rb +59 -0
  610. data/lib/spiderfw/utils/monkey/date_time.rb +34 -0
  611. data/lib/spiderfw/utils/monkey/debugger.rb +25 -0
  612. data/lib/spiderfw/utils/monkey/exception.rb +23 -0
  613. data/lib/spiderfw/utils/monkey/kernel.rb +12 -0
  614. data/lib/spiderfw/utils/monkey/module.rb +12 -0
  615. data/lib/spiderfw/utils/monkey/symbol.rb +7 -0
  616. data/lib/spiderfw/utils/monkey/time.rb +17 -0
  617. data/lib/spiderfw/utils/multi_level_hash.rb +33 -0
  618. data/lib/spiderfw/utils/periodic_runner.rb +50 -0
  619. data/lib/spiderfw/utils/rails.rb +78 -0
  620. data/lib/spiderfw/utils/rails_app.rb +53 -0
  621. data/lib/spiderfw/utils/sanitizer.rb +178 -0
  622. data/lib/spiderfw/utils/setup_task.rb +35 -0
  623. data/lib/spiderfw/utils/shared_store/file_shared_store.rb +73 -0
  624. data/lib/spiderfw/utils/shared_store/memory_shared_store.rb +46 -0
  625. data/lib/spiderfw/utils/shared_store.rb +47 -0
  626. data/lib/spiderfw/utils/test_case.rb +24 -0
  627. data/lib/spiderfw/utils/thread_out.rb +24 -0
  628. data/lib/spiderfw/version.rb +3 -0
  629. data/lib/spiderfw/widget/rest_model.rb +20 -0
  630. data/lib/spiderfw/widget/widget.rb +671 -0
  631. data/lib/spiderfw/widget/widget_attributes.rb +54 -0
  632. data/lib/spiderfw/widget/widget_plugin.rb +37 -0
  633. data/lib/spiderfw.rb +509 -0
  634. data/spider.gemspec +43 -0
  635. data/views/errors/404.shtml +6 -0
  636. data/views/errors/error.layout.shtml +70 -0
  637. data/views/errors/error_generic.shtml +6 -0
  638. metadata +800 -0
@@ -0,0 +1,1636 @@
1
+ /*
2
+ * jQuery UI Datepicker 1.7.2
3
+ *
4
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
6
+ * and GPL (GPL-LICENSE.txt) licenses.
7
+ *
8
+ * http://docs.jquery.com/UI/Datepicker
9
+ *
10
+ * Depends:
11
+ * ui.core.js
12
+ */
13
+
14
+ (function($) { // hide the namespace
15
+
16
+ $.extend($.ui, { datepicker: { version: "1.7.2" } });
17
+
18
+ var PROP_NAME = 'datepicker';
19
+
20
+ /* Date picker manager.
21
+ Use the singleton instance of this class, $.datepicker, to interact with the date picker.
22
+ Settings for (groups of) date pickers are maintained in an instance object,
23
+ allowing multiple different settings on the same page. */
24
+
25
+ function Datepicker() {
26
+ this.debug = false; // Change this to true to start debugging
27
+ this._curInst = null; // The current instance in use
28
+ this._keyEvent = false; // If the last event was a key event
29
+ this._disabledInputs = []; // List of date picker inputs that have been disabled
30
+ this._datepickerShowing = false; // True if the popup picker is showing , false if not
31
+ this._inDialog = false; // True if showing within a "dialog", false if not
32
+ this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division
33
+ this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class
34
+ this._appendClass = 'ui-datepicker-append'; // The name of the append marker class
35
+ this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class
36
+ this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class
37
+ this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class
38
+ this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class
39
+ this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class
40
+ this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class
41
+ this.regional = []; // Available regional settings, indexed by language code
42
+ this.regional[''] = { // Default regional settings
43
+ closeText: 'Done', // Display text for close link
44
+ prevText: 'Prev', // Display text for previous month link
45
+ nextText: 'Next', // Display text for next month link
46
+ currentText: 'Today', // Display text for current month link
47
+ monthNames: ['January','February','March','April','May','June',
48
+ 'July','August','September','October','November','December'], // Names of months for drop-down and formatting
49
+ monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting
50
+ dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting
51
+ dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
52
+ dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
53
+ dateFormat: 'mm/dd/yy', // See format options on parseDate
54
+ firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
55
+ isRTL: false // True if right-to-left language, false if left-to-right
56
+ };
57
+ this._defaults = { // Global defaults for all the date picker instances
58
+ showOn: 'focus', // 'focus' for popup on focus,
59
+ // 'button' for trigger button, or 'both' for either
60
+ showAnim: 'show', // Name of jQuery animation for popup
61
+ showOptions: {}, // Options for enhanced animations
62
+ defaultDate: null, // Used when field is blank: actual date,
63
+ // +/-number for offset from today, null for today
64
+ appendText: '', // Display text following the input box, e.g. showing the format
65
+ buttonText: '...', // Text for trigger button
66
+ buttonImage: '', // URL for trigger button image
67
+ buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
68
+ hideIfNoPrevNext: false, // True to hide next/previous month links
69
+ // if not applicable, false to just disable them
70
+ navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
71
+ gotoCurrent: false, // True if today link goes back to current selection instead
72
+ changeMonth: false, // True if month can be selected directly, false if only prev/next
73
+ changeYear: false, // True if year can be selected directly, false if only prev/next
74
+ showMonthAfterYear: false, // True if the year select precedes month, false for month then year
75
+ yearRange: '-10:+10', // Range of years to display in drop-down,
76
+ // either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)
77
+ showOtherMonths: false, // True to show dates in other months, false to leave blank
78
+ calculateWeek: this.iso8601Week, // How to calculate the week of the year,
79
+ // takes a Date and returns the number of the week for it
80
+ shortYearCutoff: '+10', // Short year values < this are in the current century,
81
+ // > this are in the previous century,
82
+ // string value starting with '+' for current year + value
83
+ minDate: null, // The earliest selectable date, or null for no limit
84
+ maxDate: null, // The latest selectable date, or null for no limit
85
+ duration: 'normal', // Duration of display/closure
86
+ beforeShowDay: null, // Function that takes a date and returns an array with
87
+ // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
88
+ // [2] = cell title (optional), e.g. $.datepicker.noWeekends
89
+ beforeShow: null, // Function that takes an input field and
90
+ // returns a set of custom settings for the date picker
91
+ onSelect: null, // Define a callback function when a date is selected
92
+ onChangeMonthYear: null, // Define a callback function when the month or year is changed
93
+ onClose: null, // Define a callback function when the datepicker is closed
94
+ numberOfMonths: 1, // Number of months to show at a time
95
+ showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
96
+ stepMonths: 1, // Number of months to step back/forward
97
+ stepBigMonths: 12, // Number of months to step back/forward for the big links
98
+ altField: '', // Selector for an alternate field to store selected dates into
99
+ altFormat: '', // The date format to use for the alternate field
100
+ constrainInput: true, // The input is constrained by the current date format
101
+ showButtonPanel: false // True to show button panel, false to not show it
102
+ };
103
+ $.extend(this._defaults, this.regional['']);
104
+ this.dpDiv = $('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>');
105
+ }
106
+
107
+ $.extend(Datepicker.prototype, {
108
+ /* Class name added to elements to indicate already configured with a date picker. */
109
+ markerClassName: 'hasDatepicker',
110
+
111
+ /* Debug logging (if enabled). */
112
+ log: function () {
113
+ if (this.debug)
114
+ console.log.apply('', arguments);
115
+ },
116
+
117
+ /* Override the default settings for all instances of the date picker.
118
+ @param settings object - the new settings to use as defaults (anonymous object)
119
+ @return the manager object */
120
+ setDefaults: function(settings) {
121
+ extendRemove(this._defaults, settings || {});
122
+ return this;
123
+ },
124
+
125
+ /* Attach the date picker to a jQuery selection.
126
+ @param target element - the target input field or division or span
127
+ @param settings object - the new settings to use for this date picker instance (anonymous) */
128
+ _attachDatepicker: function(target, settings) {
129
+ // check for settings on the control itself - in namespace 'date:'
130
+ var inlineSettings = null;
131
+ for (var attrName in this._defaults) {
132
+ var attrValue = target.getAttribute('date:' + attrName);
133
+ if (attrValue) {
134
+ inlineSettings = inlineSettings || {};
135
+ try {
136
+ inlineSettings[attrName] = eval(attrValue);
137
+ } catch (err) {
138
+ inlineSettings[attrName] = attrValue;
139
+ }
140
+ }
141
+ }
142
+ var nodeName = target.nodeName.toLowerCase();
143
+ var inline = (nodeName == 'div' || nodeName == 'span');
144
+ if (!target.id)
145
+ target.id = 'dp' + (++this.uuid);
146
+ var inst = this._newInst($(target), inline);
147
+ inst.settings = $.extend({}, settings || {}, inlineSettings || {});
148
+ if (nodeName == 'input') {
149
+ this._connectDatepicker(target, inst);
150
+ } else if (inline) {
151
+ this._inlineDatepicker(target, inst);
152
+ }
153
+ },
154
+
155
+ /* Create a new instance object. */
156
+ _newInst: function(target, inline) {
157
+ var id = target[0].id.replace(/([:\[\]\.])/g, '\\\\$1'); // escape jQuery meta chars
158
+ return {id: id, input: target, // associated target
159
+ selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
160
+ drawMonth: 0, drawYear: 0, // month being drawn
161
+ inline: inline, // is datepicker inline or not
162
+ dpDiv: (!inline ? this.dpDiv : // presentation div
163
+ $('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))};
164
+ },
165
+
166
+ /* Attach the date picker to an input field. */
167
+ _connectDatepicker: function(target, inst) {
168
+ var input = $(target);
169
+ inst.append = $([]);
170
+ inst.trigger = $([]);
171
+ if (input.hasClass(this.markerClassName))
172
+ return;
173
+ var appendText = this._get(inst, 'appendText');
174
+ var isRTL = this._get(inst, 'isRTL');
175
+ if (appendText) {
176
+ inst.append = $('<span class="' + this._appendClass + '">' + appendText + '</span>');
177
+ input[isRTL ? 'before' : 'after'](inst.append);
178
+ }
179
+ var showOn = this._get(inst, 'showOn');
180
+ if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field
181
+ input.focus(this._showDatepicker);
182
+ if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked
183
+ var buttonText = this._get(inst, 'buttonText');
184
+ var buttonImage = this._get(inst, 'buttonImage');
185
+ inst.trigger = $(this._get(inst, 'buttonImageOnly') ?
186
+ $('<img/>').addClass(this._triggerClass).
187
+ attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
188
+ $('<button type="button"></button>').addClass(this._triggerClass).
189
+ html(buttonImage == '' ? buttonText : $('<img/>').attr(
190
+ { src:buttonImage, alt:buttonText, title:buttonText })));
191
+ input[isRTL ? 'before' : 'after'](inst.trigger);
192
+ inst.trigger.click(function() {
193
+ if ($.datepicker._datepickerShowing && $.datepicker._lastInput == target)
194
+ $.datepicker._hideDatepicker();
195
+ else
196
+ $.datepicker._showDatepicker(target);
197
+ return false;
198
+ });
199
+ }
200
+ input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).
201
+ bind("setData.datepicker", function(event, key, value) {
202
+ inst.settings[key] = value;
203
+ }).bind("getData.datepicker", function(event, key) {
204
+ return this._get(inst, key);
205
+ });
206
+ $.data(target, PROP_NAME, inst);
207
+ },
208
+
209
+ /* Attach an inline date picker to a div. */
210
+ _inlineDatepicker: function(target, inst) {
211
+ var divSpan = $(target);
212
+ if (divSpan.hasClass(this.markerClassName))
213
+ return;
214
+ divSpan.addClass(this.markerClassName).append(inst.dpDiv).
215
+ bind("setData.datepicker", function(event, key, value){
216
+ inst.settings[key] = value;
217
+ }).bind("getData.datepicker", function(event, key){
218
+ return this._get(inst, key);
219
+ });
220
+ $.data(target, PROP_NAME, inst);
221
+ this._setDate(inst, this._getDefaultDate(inst));
222
+ this._updateDatepicker(inst);
223
+ this._updateAlternate(inst);
224
+ },
225
+
226
+ /* Pop-up the date picker in a "dialog" box.
227
+ @param input element - ignored
228
+ @param dateText string - the initial date to display (in the current format)
229
+ @param onSelect function - the function(dateText) to call when a date is selected
230
+ @param settings object - update the dialog date picker instance's settings (anonymous object)
231
+ @param pos int[2] - coordinates for the dialog's position within the screen or
232
+ event - with x/y coordinates or
233
+ leave empty for default (screen centre)
234
+ @return the manager object */
235
+ _dialogDatepicker: function(input, dateText, onSelect, settings, pos) {
236
+ var inst = this._dialogInst; // internal instance
237
+ if (!inst) {
238
+ var id = 'dp' + (++this.uuid);
239
+ this._dialogInput = $('<input type="text" id="' + id +
240
+ '" size="1" style="position: absolute; top: -100px;"/>');
241
+ this._dialogInput.keydown(this._doKeyDown);
242
+ $('body').append(this._dialogInput);
243
+ inst = this._dialogInst = this._newInst(this._dialogInput, false);
244
+ inst.settings = {};
245
+ $.data(this._dialogInput[0], PROP_NAME, inst);
246
+ }
247
+ extendRemove(inst.settings, settings || {});
248
+ this._dialogInput.val(dateText);
249
+
250
+ this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
251
+ if (!this._pos) {
252
+ var browserWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
253
+ var browserHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
254
+ var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
255
+ var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
256
+ this._pos = // should use actual width/height below
257
+ [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
258
+ }
259
+
260
+ // move input on screen for focus, but hidden behind dialog
261
+ this._dialogInput.css('left', this._pos[0] + 'px').css('top', this._pos[1] + 'px');
262
+ inst.settings.onSelect = onSelect;
263
+ this._inDialog = true;
264
+ this.dpDiv.addClass(this._dialogClass);
265
+ this._showDatepicker(this._dialogInput[0]);
266
+ if ($.blockUI)
267
+ $.blockUI(this.dpDiv);
268
+ $.data(this._dialogInput[0], PROP_NAME, inst);
269
+ return this;
270
+ },
271
+
272
+ /* Detach a datepicker from its control.
273
+ @param target element - the target input field or division or span */
274
+ _destroyDatepicker: function(target) {
275
+ var $target = $(target);
276
+ var inst = $.data(target, PROP_NAME);
277
+ if (!$target.hasClass(this.markerClassName)) {
278
+ return;
279
+ }
280
+ var nodeName = target.nodeName.toLowerCase();
281
+ $.removeData(target, PROP_NAME);
282
+ if (nodeName == 'input') {
283
+ inst.append.remove();
284
+ inst.trigger.remove();
285
+ $target.removeClass(this.markerClassName).
286
+ unbind('focus', this._showDatepicker).
287
+ unbind('keydown', this._doKeyDown).
288
+ unbind('keypress', this._doKeyPress);
289
+ } else if (nodeName == 'div' || nodeName == 'span')
290
+ $target.removeClass(this.markerClassName).empty();
291
+ },
292
+
293
+ /* Enable the date picker to a jQuery selection.
294
+ @param target element - the target input field or division or span */
295
+ _enableDatepicker: function(target) {
296
+ var $target = $(target);
297
+ var inst = $.data(target, PROP_NAME);
298
+ if (!$target.hasClass(this.markerClassName)) {
299
+ return;
300
+ }
301
+ var nodeName = target.nodeName.toLowerCase();
302
+ if (nodeName == 'input') {
303
+ target.disabled = false;
304
+ inst.trigger.filter('button').
305
+ each(function() { this.disabled = false; }).end().
306
+ filter('img').css({opacity: '1.0', cursor: ''});
307
+ }
308
+ else if (nodeName == 'div' || nodeName == 'span') {
309
+ var inline = $target.children('.' + this._inlineClass);
310
+ inline.children().removeClass('ui-state-disabled');
311
+ }
312
+ this._disabledInputs = $.map(this._disabledInputs,
313
+ function(value) { return (value == target ? null : value); }); // delete entry
314
+ },
315
+
316
+ /* Disable the date picker to a jQuery selection.
317
+ @param target element - the target input field or division or span */
318
+ _disableDatepicker: function(target) {
319
+ var $target = $(target);
320
+ var inst = $.data(target, PROP_NAME);
321
+ if (!$target.hasClass(this.markerClassName)) {
322
+ return;
323
+ }
324
+ var nodeName = target.nodeName.toLowerCase();
325
+ if (nodeName == 'input') {
326
+ target.disabled = true;
327
+ inst.trigger.filter('button').
328
+ each(function() { this.disabled = true; }).end().
329
+ filter('img').css({opacity: '0.5', cursor: 'default'});
330
+ }
331
+ else if (nodeName == 'div' || nodeName == 'span') {
332
+ var inline = $target.children('.' + this._inlineClass);
333
+ inline.children().addClass('ui-state-disabled');
334
+ }
335
+ this._disabledInputs = $.map(this._disabledInputs,
336
+ function(value) { return (value == target ? null : value); }); // delete entry
337
+ this._disabledInputs[this._disabledInputs.length] = target;
338
+ },
339
+
340
+ /* Is the first field in a jQuery collection disabled as a datepicker?
341
+ @param target element - the target input field or division or span
342
+ @return boolean - true if disabled, false if enabled */
343
+ _isDisabledDatepicker: function(target) {
344
+ if (!target) {
345
+ return false;
346
+ }
347
+ for (var i = 0; i < this._disabledInputs.length; i++) {
348
+ if (this._disabledInputs[i] == target)
349
+ return true;
350
+ }
351
+ return false;
352
+ },
353
+
354
+ /* Retrieve the instance data for the target control.
355
+ @param target element - the target input field or division or span
356
+ @return object - the associated instance data
357
+ @throws error if a jQuery problem getting data */
358
+ _getInst: function(target) {
359
+ try {
360
+ return $.data(target, PROP_NAME);
361
+ }
362
+ catch (err) {
363
+ throw 'Missing instance data for this datepicker';
364
+ }
365
+ },
366
+
367
+ /* Update or retrieve the settings for a date picker attached to an input field or division.
368
+ @param target element - the target input field or division or span
369
+ @param name object - the new settings to update or
370
+ string - the name of the setting to change or retrieve,
371
+ when retrieving also 'all' for all instance settings or
372
+ 'defaults' for all global defaults
373
+ @param value any - the new value for the setting
374
+ (omit if above is an object or to retrieve a value) */
375
+ _optionDatepicker: function(target, name, value) {
376
+ var inst = this._getInst(target);
377
+ if (arguments.length == 2 && typeof name == 'string') {
378
+ return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) :
379
+ (inst ? (name == 'all' ? $.extend({}, inst.settings) :
380
+ this._get(inst, name)) : null));
381
+ }
382
+ var settings = name || {};
383
+ if (typeof name == 'string') {
384
+ settings = {};
385
+ settings[name] = value;
386
+ }
387
+ if (inst) {
388
+ if (this._curInst == inst) {
389
+ this._hideDatepicker(null);
390
+ }
391
+ var date = this._getDateDatepicker(target);
392
+ extendRemove(inst.settings, settings);
393
+ this._setDateDatepicker(target, date);
394
+ this._updateDatepicker(inst);
395
+ }
396
+ },
397
+
398
+ // change method deprecated
399
+ _changeDatepicker: function(target, name, value) {
400
+ this._optionDatepicker(target, name, value);
401
+ },
402
+
403
+ /* Redraw the date picker attached to an input field or division.
404
+ @param target element - the target input field or division or span */
405
+ _refreshDatepicker: function(target) {
406
+ var inst = this._getInst(target);
407
+ if (inst) {
408
+ this._updateDatepicker(inst);
409
+ }
410
+ },
411
+
412
+ /* Set the dates for a jQuery selection.
413
+ @param target element - the target input field or division or span
414
+ @param date Date - the new date
415
+ @param endDate Date - the new end date for a range (optional) */
416
+ _setDateDatepicker: function(target, date, endDate) {
417
+ var inst = this._getInst(target);
418
+ if (inst) {
419
+ this._setDate(inst, date, endDate);
420
+ this._updateDatepicker(inst);
421
+ this._updateAlternate(inst);
422
+ }
423
+ },
424
+
425
+ /* Get the date(s) for the first entry in a jQuery selection.
426
+ @param target element - the target input field or division or span
427
+ @return Date - the current date or
428
+ Date[2] - the current dates for a range */
429
+ _getDateDatepicker: function(target) {
430
+ var inst = this._getInst(target);
431
+ if (inst && !inst.inline)
432
+ this._setDateFromField(inst);
433
+ return (inst ? this._getDate(inst) : null);
434
+ },
435
+
436
+ /* Handle keystrokes. */
437
+ _doKeyDown: function(event) {
438
+ var inst = $.datepicker._getInst(event.target);
439
+ var handled = true;
440
+ var isRTL = inst.dpDiv.is('.ui-datepicker-rtl');
441
+ inst._keyEvent = true;
442
+ if ($.datepicker._datepickerShowing)
443
+ switch (event.keyCode) {
444
+ case 9: $.datepicker._hideDatepicker(null, '');
445
+ break; // hide on tab out
446
+ case 13: var sel = $('td.' + $.datepicker._dayOverClass +
447
+ ', td.' + $.datepicker._currentClass, inst.dpDiv);
448
+ if (sel[0])
449
+ $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
450
+ else
451
+ $.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration'));
452
+ return false; // don't submit the form
453
+ break; // select the value on enter
454
+ case 27: $.datepicker._hideDatepicker(null, $.datepicker._get(inst, 'duration'));
455
+ break; // hide on escape
456
+ case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
457
+ -$.datepicker._get(inst, 'stepBigMonths') :
458
+ -$.datepicker._get(inst, 'stepMonths')), 'M');
459
+ break; // previous month/year on page up/+ ctrl
460
+ case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
461
+ +$.datepicker._get(inst, 'stepBigMonths') :
462
+ +$.datepicker._get(inst, 'stepMonths')), 'M');
463
+ break; // next month/year on page down/+ ctrl
464
+ case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target);
465
+ handled = event.ctrlKey || event.metaKey;
466
+ break; // clear on ctrl or command +end
467
+ case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target);
468
+ handled = event.ctrlKey || event.metaKey;
469
+ break; // current on ctrl or command +home
470
+ case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D');
471
+ handled = event.ctrlKey || event.metaKey;
472
+ // -1 day on ctrl or command +left
473
+ if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
474
+ -$.datepicker._get(inst, 'stepBigMonths') :
475
+ -$.datepicker._get(inst, 'stepMonths')), 'M');
476
+ // next month/year on alt +left on Mac
477
+ break;
478
+ case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D');
479
+ handled = event.ctrlKey || event.metaKey;
480
+ break; // -1 week on ctrl or command +up
481
+ case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D');
482
+ handled = event.ctrlKey || event.metaKey;
483
+ // +1 day on ctrl or command +right
484
+ if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
485
+ +$.datepicker._get(inst, 'stepBigMonths') :
486
+ +$.datepicker._get(inst, 'stepMonths')), 'M');
487
+ // next month/year on alt +right
488
+ break;
489
+ case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D');
490
+ handled = event.ctrlKey || event.metaKey;
491
+ break; // +1 week on ctrl or command +down
492
+ default: handled = false;
493
+ }
494
+ else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home
495
+ $.datepicker._showDatepicker(this);
496
+ else {
497
+ handled = false;
498
+ }
499
+ if (handled) {
500
+ event.preventDefault();
501
+ event.stopPropagation();
502
+ }
503
+ },
504
+
505
+ /* Filter entered characters - based on date format. */
506
+ _doKeyPress: function(event) {
507
+ var inst = $.datepicker._getInst(event.target);
508
+ if ($.datepicker._get(inst, 'constrainInput')) {
509
+ var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat'));
510
+ var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode);
511
+ return event.ctrlKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);
512
+ }
513
+ },
514
+
515
+ /* Pop-up the date picker for a given input field.
516
+ @param input element - the input field attached to the date picker or
517
+ event - if triggered by focus */
518
+ _showDatepicker: function(input) {
519
+ input = input.target || input;
520
+ if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
521
+ input = $('input', input.parentNode)[0];
522
+ if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
523
+ return;
524
+ var inst = $.datepicker._getInst(input);
525
+ var beforeShow = $.datepicker._get(inst, 'beforeShow');
526
+ extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]) : {}));
527
+ $.datepicker._hideDatepicker(null, '');
528
+ $.datepicker._lastInput = input;
529
+ $.datepicker._setDateFromField(inst);
530
+ if ($.datepicker._inDialog) // hide cursor
531
+ input.value = '';
532
+ if (!$.datepicker._pos) { // position below input
533
+ $.datepicker._pos = $.datepicker._findPos(input);
534
+ $.datepicker._pos[1] += input.offsetHeight; // add the height
535
+ }
536
+ var isFixed = false;
537
+ $(input).parents().each(function() {
538
+ isFixed |= $(this).css('position') == 'fixed';
539
+ return !isFixed;
540
+ });
541
+ if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled
542
+ $.datepicker._pos[0] -= document.documentElement.scrollLeft;
543
+ $.datepicker._pos[1] -= document.documentElement.scrollTop;
544
+ }
545
+ var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
546
+ $.datepicker._pos = null;
547
+ inst.rangeStart = null;
548
+ // determine sizing offscreen
549
+ inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'});
550
+ $.datepicker._updateDatepicker(inst);
551
+ // fix width for dynamic number of date pickers
552
+ // and adjust position before showing
553
+ offset = $.datepicker._checkOffset(inst, offset, isFixed);
554
+ inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
555
+ 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',
556
+ left: offset.left + 'px', top: offset.top + 'px'});
557
+ if (!inst.inline) {
558
+ var showAnim = $.datepicker._get(inst, 'showAnim') || 'show';
559
+ var duration = $.datepicker._get(inst, 'duration');
560
+ var postProcess = function() {
561
+ $.datepicker._datepickerShowing = true;
562
+ if ($.browser.msie && parseInt($.browser.version,10) < 7) // fix IE < 7 select problems
563
+ $('iframe.ui-datepicker-cover').css({width: inst.dpDiv.width() + 4,
564
+ height: inst.dpDiv.height() + 4});
565
+ };
566
+ if ($.effects && $.effects[showAnim])
567
+ inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
568
+ else
569
+ inst.dpDiv[showAnim](duration, postProcess);
570
+ if (duration == '')
571
+ postProcess();
572
+ if (inst.input[0].type != 'hidden')
573
+ inst.input[0].focus();
574
+ $.datepicker._curInst = inst;
575
+ }
576
+ },
577
+
578
+ /* Generate the date picker content. */
579
+ _updateDatepicker: function(inst) {
580
+ var dims = {width: inst.dpDiv.width() + 4,
581
+ height: inst.dpDiv.height() + 4};
582
+ var self = this;
583
+ inst.dpDiv.empty().append(this._generateHTML(inst))
584
+ .find('iframe.ui-datepicker-cover').
585
+ css({width: dims.width, height: dims.height})
586
+ .end()
587
+ .find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a')
588
+ .bind('mouseout', function(){
589
+ $(this).removeClass('ui-state-hover');
590
+ if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover');
591
+ if(this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover');
592
+ })
593
+ .bind('mouseover', function(){
594
+ if (!self._isDisabledDatepicker( inst.inline ? inst.dpDiv.parent()[0] : inst.input[0])) {
595
+ $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');
596
+ $(this).addClass('ui-state-hover');
597
+ if(this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover');
598
+ if(this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover');
599
+ }
600
+ })
601
+ .end()
602
+ .find('.' + this._dayOverClass + ' a')
603
+ .trigger('mouseover')
604
+ .end();
605
+ var numMonths = this._getNumberOfMonths(inst);
606
+ var cols = numMonths[1];
607
+ var width = 17;
608
+ if (cols > 1) {
609
+ inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em');
610
+ } else {
611
+ inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');
612
+ }
613
+ inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +
614
+ 'Class']('ui-datepicker-multi');
615
+ inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
616
+ 'Class']('ui-datepicker-rtl');
617
+ if (inst.input && inst.input[0].type != 'hidden' && inst == $.datepicker._curInst)
618
+ $(inst.input[0]).focus();
619
+ },
620
+
621
+ /* Check positioning to remain on screen. */
622
+ _checkOffset: function(inst, offset, isFixed) {
623
+ var dpWidth = inst.dpDiv.outerWidth();
624
+ var dpHeight = inst.dpDiv.outerHeight();
625
+ var inputWidth = inst.input ? inst.input.outerWidth() : 0;
626
+ var inputHeight = inst.input ? inst.input.outerHeight() : 0;
627
+ var viewWidth = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) + $(document).scrollLeft();
628
+ var viewHeight = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) + $(document).scrollTop();
629
+
630
+ offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0);
631
+ offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;
632
+ offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
633
+
634
+ // now check if datepicker is showing outside window viewport - move to a better place if so.
635
+ offset.left -= (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math.abs(offset.left + dpWidth - viewWidth) : 0;
636
+ offset.top -= (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? Math.abs(offset.top + dpHeight + inputHeight*2 - viewHeight) : 0;
637
+
638
+ return offset;
639
+ },
640
+
641
+ /* Find an object's position on the screen. */
642
+ _findPos: function(obj) {
643
+ while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) {
644
+ obj = obj.nextSibling;
645
+ }
646
+ var position = $(obj).offset();
647
+ return [position.left, position.top];
648
+ },
649
+
650
+ /* Hide the date picker from view.
651
+ @param input element - the input field attached to the date picker
652
+ @param duration string - the duration over which to close the date picker */
653
+ _hideDatepicker: function(input, duration) {
654
+ var inst = this._curInst;
655
+ if (!inst || (input && inst != $.data(input, PROP_NAME)))
656
+ return;
657
+ if (inst.stayOpen)
658
+ this._selectDate('#' + inst.id, this._formatDate(inst,
659
+ inst.currentDay, inst.currentMonth, inst.currentYear));
660
+ inst.stayOpen = false;
661
+ if (this._datepickerShowing) {
662
+ duration = (duration != null ? duration : this._get(inst, 'duration'));
663
+ var showAnim = this._get(inst, 'showAnim');
664
+ var postProcess = function() {
665
+ $.datepicker._tidyDialog(inst);
666
+ };
667
+ if (duration != '' && $.effects && $.effects[showAnim])
668
+ inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'),
669
+ duration, postProcess);
670
+ else
671
+ inst.dpDiv[(duration == '' ? 'hide' : (showAnim == 'slideDown' ? 'slideUp' :
672
+ (showAnim == 'fadeIn' ? 'fadeOut' : 'hide')))](duration, postProcess);
673
+ if (duration == '')
674
+ this._tidyDialog(inst);
675
+ var onClose = this._get(inst, 'onClose');
676
+ if (onClose)
677
+ onClose.apply((inst.input ? inst.input[0] : null),
678
+ [(inst.input ? inst.input.val() : ''), inst]); // trigger custom callback
679
+ this._datepickerShowing = false;
680
+ this._lastInput = null;
681
+ if (this._inDialog) {
682
+ this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });
683
+ if ($.blockUI) {
684
+ $.unblockUI();
685
+ $('body').append(this.dpDiv);
686
+ }
687
+ }
688
+ this._inDialog = false;
689
+ }
690
+ this._curInst = null;
691
+ },
692
+
693
+ /* Tidy up after a dialog display. */
694
+ _tidyDialog: function(inst) {
695
+ inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar');
696
+ },
697
+
698
+ /* Close date picker if clicked elsewhere. */
699
+ _checkExternalClick: function(event) {
700
+ if (!$.datepicker._curInst)
701
+ return;
702
+ var $target = $(event.target);
703
+ if (($target.parents('#' + $.datepicker._mainDivId).length == 0) &&
704
+ !$target.hasClass($.datepicker.markerClassName) &&
705
+ !$target.hasClass($.datepicker._triggerClass) &&
706
+ $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI))
707
+ $.datepicker._hideDatepicker(null, '');
708
+ },
709
+
710
+ /* Adjust one of the date sub-fields. */
711
+ _adjustDate: function(id, offset, period) {
712
+ var target = $(id);
713
+ var inst = this._getInst(target[0]);
714
+ if (this._isDisabledDatepicker(target[0])) {
715
+ return;
716
+ }
717
+ this._adjustInstDate(inst, offset +
718
+ (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning
719
+ period);
720
+ this._updateDatepicker(inst);
721
+ },
722
+
723
+ /* Action for current link. */
724
+ _gotoToday: function(id) {
725
+ var target = $(id);
726
+ var inst = this._getInst(target[0]);
727
+ if (this._get(inst, 'gotoCurrent') && inst.currentDay) {
728
+ inst.selectedDay = inst.currentDay;
729
+ inst.drawMonth = inst.selectedMonth = inst.currentMonth;
730
+ inst.drawYear = inst.selectedYear = inst.currentYear;
731
+ }
732
+ else {
733
+ var date = new Date();
734
+ inst.selectedDay = date.getDate();
735
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
736
+ inst.drawYear = inst.selectedYear = date.getFullYear();
737
+ }
738
+ this._notifyChange(inst);
739
+ this._adjustDate(target);
740
+ },
741
+
742
+ /* Action for selecting a new month/year. */
743
+ _selectMonthYear: function(id, select, period) {
744
+ var target = $(id);
745
+ var inst = this._getInst(target[0]);
746
+ inst._selectingMonthYear = false;
747
+ inst['selected' + (period == 'M' ? 'Month' : 'Year')] =
748
+ inst['draw' + (period == 'M' ? 'Month' : 'Year')] =
749
+ parseInt(select.options[select.selectedIndex].value,10);
750
+ this._notifyChange(inst);
751
+ this._adjustDate(target);
752
+ },
753
+
754
+ /* Restore input focus after not changing month/year. */
755
+ _clickMonthYear: function(id) {
756
+ var target = $(id);
757
+ var inst = this._getInst(target[0]);
758
+ if (inst.input && inst._selectingMonthYear && !$.browser.msie)
759
+ inst.input[0].focus();
760
+ inst._selectingMonthYear = !inst._selectingMonthYear;
761
+ },
762
+
763
+ /* Action for selecting a day. */
764
+ _selectDay: function(id, month, year, td) {
765
+ var target = $(id);
766
+ if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
767
+ return;
768
+ }
769
+ var inst = this._getInst(target[0]);
770
+ inst.selectedDay = inst.currentDay = $('a', td).html();
771
+ inst.selectedMonth = inst.currentMonth = month;
772
+ inst.selectedYear = inst.currentYear = year;
773
+ if (inst.stayOpen) {
774
+ inst.endDay = inst.endMonth = inst.endYear = null;
775
+ }
776
+ this._selectDate(id, this._formatDate(inst,
777
+ inst.currentDay, inst.currentMonth, inst.currentYear));
778
+ if (inst.stayOpen) {
779
+ inst.rangeStart = this._daylightSavingAdjust(
780
+ new Date(inst.currentYear, inst.currentMonth, inst.currentDay));
781
+ this._updateDatepicker(inst);
782
+ }
783
+ },
784
+
785
+ /* Erase the input field and hide the date picker. */
786
+ _clearDate: function(id) {
787
+ var target = $(id);
788
+ var inst = this._getInst(target[0]);
789
+ inst.stayOpen = false;
790
+ inst.endDay = inst.endMonth = inst.endYear = inst.rangeStart = null;
791
+ this._selectDate(target, '');
792
+ },
793
+
794
+ /* Update the input field with the selected date. */
795
+ _selectDate: function(id, dateStr) {
796
+ var target = $(id);
797
+ var inst = this._getInst(target[0]);
798
+ dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
799
+ if (inst.input)
800
+ inst.input.val(dateStr);
801
+ this._updateAlternate(inst);
802
+ var onSelect = this._get(inst, 'onSelect');
803
+ if (onSelect)
804
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback
805
+ else if (inst.input)
806
+ inst.input.trigger('change'); // fire the change event
807
+ if (inst.inline)
808
+ this._updateDatepicker(inst);
809
+ else if (!inst.stayOpen) {
810
+ this._hideDatepicker(null, this._get(inst, 'duration'));
811
+ this._lastInput = inst.input[0];
812
+ if (typeof(inst.input[0]) != 'object')
813
+ inst.input[0].focus(); // restore focus
814
+ this._lastInput = null;
815
+ }
816
+ },
817
+
818
+ /* Update any alternate field to synchronise with the main field. */
819
+ _updateAlternate: function(inst) {
820
+ var altField = this._get(inst, 'altField');
821
+ if (altField) { // update alternate field too
822
+ var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat');
823
+ var date = this._getDate(inst);
824
+ dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
825
+ $(altField).each(function() { $(this).val(dateStr); });
826
+ }
827
+ },
828
+
829
+ /* Set as beforeShowDay function to prevent selection of weekends.
830
+ @param date Date - the date to customise
831
+ @return [boolean, string] - is this date selectable?, what is its CSS class? */
832
+ noWeekends: function(date) {
833
+ var day = date.getDay();
834
+ return [(day > 0 && day < 6), ''];
835
+ },
836
+
837
+ /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
838
+ @param date Date - the date to get the week for
839
+ @return number - the number of the week within the year that contains this date */
840
+ iso8601Week: function(date) {
841
+ var checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate());
842
+ var firstMon = new Date(checkDate.getFullYear(), 1 - 1, 4); // First week always contains 4 Jan
843
+ var firstDay = firstMon.getDay() || 7; // Day of week: Mon = 1, ..., Sun = 7
844
+ firstMon.setDate(firstMon.getDate() + 1 - firstDay); // Preceding Monday
845
+ if (firstDay < 4 && checkDate < firstMon) { // Adjust first three days in year if necessary
846
+ checkDate.setDate(checkDate.getDate() - 3); // Generate for previous year
847
+ return $.datepicker.iso8601Week(checkDate);
848
+ } else if (checkDate > new Date(checkDate.getFullYear(), 12 - 1, 28)) { // Check last three days in year
849
+ firstDay = new Date(checkDate.getFullYear() + 1, 1 - 1, 4).getDay() || 7;
850
+ if (firstDay > 4 && (checkDate.getDay() || 7) < firstDay - 3) { // Adjust if necessary
851
+ return 1;
852
+ }
853
+ }
854
+ return Math.floor(((checkDate - firstMon) / 86400000) / 7) + 1; // Weeks to given date
855
+ },
856
+
857
+ /* Parse a string value into a date object.
858
+ See formatDate below for the possible formats.
859
+
860
+ @param format string - the expected format of the date
861
+ @param value string - the date in the above format
862
+ @param settings Object - attributes include:
863
+ shortYearCutoff number - the cutoff year for determining the century (optional)
864
+ dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
865
+ dayNames string[7] - names of the days from Sunday (optional)
866
+ monthNamesShort string[12] - abbreviated names of the months (optional)
867
+ monthNames string[12] - names of the months (optional)
868
+ @return Date - the extracted date value or null if value is blank */
869
+ parseDate: function (format, value, settings) {
870
+ if (format == null || value == null)
871
+ throw 'Invalid arguments';
872
+ value = (typeof value == 'object' ? value.toString() : value + '');
873
+ if (value == '')
874
+ return null;
875
+ var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;
876
+ var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
877
+ var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
878
+ var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
879
+ var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
880
+ var year = -1;
881
+ var month = -1;
882
+ var day = -1;
883
+ var doy = -1;
884
+ var literal = false;
885
+ // Check whether a format character is doubled
886
+ var lookAhead = function(match) {
887
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
888
+ if (matches)
889
+ iFormat++;
890
+ return matches;
891
+ };
892
+ // Extract a number from the string value
893
+ var getNumber = function(match) {
894
+ lookAhead(match);
895
+ var origSize = (match == '@' ? 14 : (match == 'y' ? 4 : (match == 'o' ? 3 : 2)));
896
+ var size = origSize;
897
+ var num = 0;
898
+ while (size > 0 && iValue < value.length &&
899
+ value.charAt(iValue) >= '0' && value.charAt(iValue) <= '9') {
900
+ num = num * 10 + parseInt(value.charAt(iValue++),10);
901
+ size--;
902
+ }
903
+ if (size == origSize)
904
+ throw 'Missing number at position ' + iValue;
905
+ return num;
906
+ };
907
+ // Extract a name from the string value and convert to an index
908
+ var getName = function(match, shortNames, longNames) {
909
+ var names = (lookAhead(match) ? longNames : shortNames);
910
+ var size = 0;
911
+ for (var j = 0; j < names.length; j++)
912
+ size = Math.max(size, names[j].length);
913
+ var name = '';
914
+ var iInit = iValue;
915
+ while (size > 0 && iValue < value.length) {
916
+ name += value.charAt(iValue++);
917
+ for (var i = 0; i < names.length; i++)
918
+ if (name == names[i])
919
+ return i + 1;
920
+ size--;
921
+ }
922
+ throw 'Unknown name at position ' + iInit;
923
+ };
924
+ // Confirm that a literal character matches the string value
925
+ var checkLiteral = function() {
926
+ if (value.charAt(iValue) != format.charAt(iFormat))
927
+ throw 'Unexpected literal at position ' + iValue;
928
+ iValue++;
929
+ };
930
+ var iValue = 0;
931
+ for (var iFormat = 0; iFormat < format.length; iFormat++) {
932
+ if (literal)
933
+ if (format.charAt(iFormat) == "'" && !lookAhead("'"))
934
+ literal = false;
935
+ else
936
+ checkLiteral();
937
+ else
938
+ switch (format.charAt(iFormat)) {
939
+ case 'd':
940
+ day = getNumber('d');
941
+ break;
942
+ case 'D':
943
+ getName('D', dayNamesShort, dayNames);
944
+ break;
945
+ case 'o':
946
+ doy = getNumber('o');
947
+ break;
948
+ case 'm':
949
+ month = getNumber('m');
950
+ break;
951
+ case 'M':
952
+ month = getName('M', monthNamesShort, monthNames);
953
+ break;
954
+ case 'y':
955
+ year = getNumber('y');
956
+ break;
957
+ case '@':
958
+ var date = new Date(getNumber('@'));
959
+ year = date.getFullYear();
960
+ month = date.getMonth() + 1;
961
+ day = date.getDate();
962
+ break;
963
+ case "'":
964
+ if (lookAhead("'"))
965
+ checkLiteral();
966
+ else
967
+ literal = true;
968
+ break;
969
+ default:
970
+ checkLiteral();
971
+ }
972
+ }
973
+ if (year == -1)
974
+ year = new Date().getFullYear();
975
+ else if (year < 100)
976
+ year += new Date().getFullYear() - new Date().getFullYear() % 100 +
977
+ (year <= shortYearCutoff ? 0 : -100);
978
+ if (doy > -1) {
979
+ month = 1;
980
+ day = doy;
981
+ do {
982
+ var dim = this._getDaysInMonth(year, month - 1);
983
+ if (day <= dim)
984
+ break;
985
+ month++;
986
+ day -= dim;
987
+ } while (true);
988
+ }
989
+ var date = this._daylightSavingAdjust(new Date(year, month - 1, day));
990
+ if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day)
991
+ throw 'Invalid date'; // E.g. 31/02/*
992
+ return date;
993
+ },
994
+
995
+ /* Standard date formats. */
996
+ ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601)
997
+ COOKIE: 'D, dd M yy',
998
+ ISO_8601: 'yy-mm-dd',
999
+ RFC_822: 'D, d M y',
1000
+ RFC_850: 'DD, dd-M-y',
1001
+ RFC_1036: 'D, d M y',
1002
+ RFC_1123: 'D, d M yy',
1003
+ RFC_2822: 'D, d M yy',
1004
+ RSS: 'D, d M y', // RFC 822
1005
+ TIMESTAMP: '@',
1006
+ W3C: 'yy-mm-dd', // ISO 8601
1007
+
1008
+ /* Format a date object into a string value.
1009
+ The format can be combinations of the following:
1010
+ d - day of month (no leading zero)
1011
+ dd - day of month (two digit)
1012
+ o - day of year (no leading zeros)
1013
+ oo - day of year (three digit)
1014
+ D - day name short
1015
+ DD - day name long
1016
+ m - month of year (no leading zero)
1017
+ mm - month of year (two digit)
1018
+ M - month name short
1019
+ MM - month name long
1020
+ y - year (two digit)
1021
+ yy - year (four digit)
1022
+ @ - Unix timestamp (ms since 01/01/1970)
1023
+ '...' - literal text
1024
+ '' - single quote
1025
+
1026
+ @param format string - the desired format of the date
1027
+ @param date Date - the date value to format
1028
+ @param settings Object - attributes include:
1029
+ dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
1030
+ dayNames string[7] - names of the days from Sunday (optional)
1031
+ monthNamesShort string[12] - abbreviated names of the months (optional)
1032
+ monthNames string[12] - names of the months (optional)
1033
+ @return string - the date in the above format */
1034
+ formatDate: function (format, date, settings) {
1035
+ if (!date)
1036
+ return '';
1037
+ var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
1038
+ var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
1039
+ var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
1040
+ var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
1041
+ // Check whether a format character is doubled
1042
+ var lookAhead = function(match) {
1043
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
1044
+ if (matches)
1045
+ iFormat++;
1046
+ return matches;
1047
+ };
1048
+ // Format a number, with leading zero if necessary
1049
+ var formatNumber = function(match, value, len) {
1050
+ var num = '' + value;
1051
+ if (lookAhead(match))
1052
+ while (num.length < len)
1053
+ num = '0' + num;
1054
+ return num;
1055
+ };
1056
+ // Format a name, short or long as requested
1057
+ var formatName = function(match, value, shortNames, longNames) {
1058
+ return (lookAhead(match) ? longNames[value] : shortNames[value]);
1059
+ };
1060
+ var output = '';
1061
+ var literal = false;
1062
+ if (date)
1063
+ for (var iFormat = 0; iFormat < format.length; iFormat++) {
1064
+ if (literal)
1065
+ if (format.charAt(iFormat) == "'" && !lookAhead("'"))
1066
+ literal = false;
1067
+ else
1068
+ output += format.charAt(iFormat);
1069
+ else
1070
+ switch (format.charAt(iFormat)) {
1071
+ case 'd':
1072
+ output += formatNumber('d', date.getDate(), 2);
1073
+ break;
1074
+ case 'D':
1075
+ output += formatName('D', date.getDay(), dayNamesShort, dayNames);
1076
+ break;
1077
+ case 'o':
1078
+ var doy = date.getDate();
1079
+ for (var m = date.getMonth() - 1; m >= 0; m--)
1080
+ doy += this._getDaysInMonth(date.getFullYear(), m);
1081
+ output += formatNumber('o', doy, 3);
1082
+ break;
1083
+ case 'm':
1084
+ output += formatNumber('m', date.getMonth() + 1, 2);
1085
+ break;
1086
+ case 'M':
1087
+ output += formatName('M', date.getMonth(), monthNamesShort, monthNames);
1088
+ break;
1089
+ case 'y':
1090
+ output += (lookAhead('y') ? date.getFullYear() :
1091
+ (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);
1092
+ break;
1093
+ case '@':
1094
+ output += date.getTime();
1095
+ break;
1096
+ case "'":
1097
+ if (lookAhead("'"))
1098
+ output += "'";
1099
+ else
1100
+ literal = true;
1101
+ break;
1102
+ default:
1103
+ output += format.charAt(iFormat);
1104
+ }
1105
+ }
1106
+ return output;
1107
+ },
1108
+
1109
+ /* Extract all possible characters from the date format. */
1110
+ _possibleChars: function (format) {
1111
+ var chars = '';
1112
+ var literal = false;
1113
+ for (var iFormat = 0; iFormat < format.length; iFormat++)
1114
+ if (literal)
1115
+ if (format.charAt(iFormat) == "'" && !lookAhead("'"))
1116
+ literal = false;
1117
+ else
1118
+ chars += format.charAt(iFormat);
1119
+ else
1120
+ switch (format.charAt(iFormat)) {
1121
+ case 'd': case 'm': case 'y': case '@':
1122
+ chars += '0123456789';
1123
+ break;
1124
+ case 'D': case 'M':
1125
+ return null; // Accept anything
1126
+ case "'":
1127
+ if (lookAhead("'"))
1128
+ chars += "'";
1129
+ else
1130
+ literal = true;
1131
+ break;
1132
+ default:
1133
+ chars += format.charAt(iFormat);
1134
+ }
1135
+ return chars;
1136
+ },
1137
+
1138
+ /* Get a setting value, defaulting if necessary. */
1139
+ _get: function(inst, name) {
1140
+ return inst.settings[name] !== undefined ?
1141
+ inst.settings[name] : this._defaults[name];
1142
+ },
1143
+
1144
+ /* Parse existing date and initialise date picker. */
1145
+ _setDateFromField: function(inst) {
1146
+ var dateFormat = this._get(inst, 'dateFormat');
1147
+ var dates = inst.input ? inst.input.val() : null;
1148
+ inst.endDay = inst.endMonth = inst.endYear = null;
1149
+ var date = defaultDate = this._getDefaultDate(inst);
1150
+ var settings = this._getFormatConfig(inst);
1151
+ try {
1152
+ date = this.parseDate(dateFormat, dates, settings) || defaultDate;
1153
+ } catch (event) {
1154
+ this.log(event);
1155
+ date = defaultDate;
1156
+ }
1157
+ inst.selectedDay = date.getDate();
1158
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
1159
+ inst.drawYear = inst.selectedYear = date.getFullYear();
1160
+ inst.currentDay = (dates ? date.getDate() : 0);
1161
+ inst.currentMonth = (dates ? date.getMonth() : 0);
1162
+ inst.currentYear = (dates ? date.getFullYear() : 0);
1163
+ this._adjustInstDate(inst);
1164
+ },
1165
+
1166
+ /* Retrieve the default date shown on opening. */
1167
+ _getDefaultDate: function(inst) {
1168
+ var date = this._determineDate(this._get(inst, 'defaultDate'), new Date());
1169
+ var minDate = this._getMinMaxDate(inst, 'min', true);
1170
+ var maxDate = this._getMinMaxDate(inst, 'max');
1171
+ date = (minDate && date < minDate ? minDate : date);
1172
+ date = (maxDate && date > maxDate ? maxDate : date);
1173
+ return date;
1174
+ },
1175
+
1176
+ /* A date may be specified as an exact value or a relative one. */
1177
+ _determineDate: function(date, defaultDate) {
1178
+ var offsetNumeric = function(offset) {
1179
+ var date = new Date();
1180
+ date.setDate(date.getDate() + offset);
1181
+ return date;
1182
+ };
1183
+ var offsetString = function(offset, getDaysInMonth) {
1184
+ var date = new Date();
1185
+ var year = date.getFullYear();
1186
+ var month = date.getMonth();
1187
+ var day = date.getDate();
1188
+ var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;
1189
+ var matches = pattern.exec(offset);
1190
+ while (matches) {
1191
+ switch (matches[2] || 'd') {
1192
+ case 'd' : case 'D' :
1193
+ day += parseInt(matches[1],10); break;
1194
+ case 'w' : case 'W' :
1195
+ day += parseInt(matches[1],10) * 7; break;
1196
+ case 'm' : case 'M' :
1197
+ month += parseInt(matches[1],10);
1198
+ day = Math.min(day, getDaysInMonth(year, month));
1199
+ break;
1200
+ case 'y': case 'Y' :
1201
+ year += parseInt(matches[1],10);
1202
+ day = Math.min(day, getDaysInMonth(year, month));
1203
+ break;
1204
+ }
1205
+ matches = pattern.exec(offset);
1206
+ }
1207
+ return new Date(year, month, day);
1208
+ };
1209
+ date = (date == null ? defaultDate :
1210
+ (typeof date == 'string' ? offsetString(date, this._getDaysInMonth) :
1211
+ (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date)));
1212
+ date = (date && date.toString() == 'Invalid Date' ? defaultDate : date);
1213
+ if (date) {
1214
+ date.setHours(0);
1215
+ date.setMinutes(0);
1216
+ date.setSeconds(0);
1217
+ date.setMilliseconds(0);
1218
+ }
1219
+ return this._daylightSavingAdjust(date);
1220
+ },
1221
+
1222
+ /* Handle switch to/from daylight saving.
1223
+ Hours may be non-zero on daylight saving cut-over:
1224
+ > 12 when midnight changeover, but then cannot generate
1225
+ midnight datetime, so jump to 1AM, otherwise reset.
1226
+ @param date (Date) the date to check
1227
+ @return (Date) the corrected date */
1228
+ _daylightSavingAdjust: function(date) {
1229
+ if (!date) return null;
1230
+ date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
1231
+ return date;
1232
+ },
1233
+
1234
+ /* Set the date(s) directly. */
1235
+ _setDate: function(inst, date, endDate) {
1236
+ var clear = !(date);
1237
+ var origMonth = inst.selectedMonth;
1238
+ var origYear = inst.selectedYear;
1239
+ date = this._determineDate(date, new Date());
1240
+ inst.selectedDay = inst.currentDay = date.getDate();
1241
+ inst.drawMonth = inst.selectedMonth = inst.currentMonth = date.getMonth();
1242
+ inst.drawYear = inst.selectedYear = inst.currentYear = date.getFullYear();
1243
+ if (origMonth != inst.selectedMonth || origYear != inst.selectedYear)
1244
+ this._notifyChange(inst);
1245
+ this._adjustInstDate(inst);
1246
+ if (inst.input) {
1247
+ inst.input.val(clear ? '' : this._formatDate(inst));
1248
+ }
1249
+ },
1250
+
1251
+ /* Retrieve the date(s) directly. */
1252
+ _getDate: function(inst) {
1253
+ var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null :
1254
+ this._daylightSavingAdjust(new Date(
1255
+ inst.currentYear, inst.currentMonth, inst.currentDay)));
1256
+ return startDate;
1257
+ },
1258
+
1259
+ /* Generate the HTML for the current state of the date picker. */
1260
+ _generateHTML: function(inst) {
1261
+ var today = new Date();
1262
+ today = this._daylightSavingAdjust(
1263
+ new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time
1264
+ var isRTL = this._get(inst, 'isRTL');
1265
+ var showButtonPanel = this._get(inst, 'showButtonPanel');
1266
+ var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext');
1267
+ var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat');
1268
+ var numMonths = this._getNumberOfMonths(inst);
1269
+ var showCurrentAtPos = this._get(inst, 'showCurrentAtPos');
1270
+ var stepMonths = this._get(inst, 'stepMonths');
1271
+ var stepBigMonths = this._get(inst, 'stepBigMonths');
1272
+ var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
1273
+ var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
1274
+ new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
1275
+ var minDate = this._getMinMaxDate(inst, 'min', true);
1276
+ var maxDate = this._getMinMaxDate(inst, 'max');
1277
+ var drawMonth = inst.drawMonth - showCurrentAtPos;
1278
+ var drawYear = inst.drawYear;
1279
+ if (drawMonth < 0) {
1280
+ drawMonth += 12;
1281
+ drawYear--;
1282
+ }
1283
+ if (maxDate) {
1284
+ var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
1285
+ maxDate.getMonth() - numMonths[1] + 1, maxDate.getDate()));
1286
+ maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
1287
+ while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
1288
+ drawMonth--;
1289
+ if (drawMonth < 0) {
1290
+ drawMonth = 11;
1291
+ drawYear--;
1292
+ }
1293
+ }
1294
+ }
1295
+ inst.drawMonth = drawMonth;
1296
+ inst.drawYear = drawYear;
1297
+ var prevText = this._get(inst, 'prevText');
1298
+ prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
1299
+ this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
1300
+ this._getFormatConfig(inst)));
1301
+ var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
1302
+ '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' +
1303
+ ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' :
1304
+ (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+ prevText +'"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>'));
1305
+ var nextText = this._get(inst, 'nextText');
1306
+ nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
1307
+ this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
1308
+ this._getFormatConfig(inst)));
1309
+ var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
1310
+ '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' +
1311
+ ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' :
1312
+ (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+ nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>'));
1313
+ var currentText = this._get(inst, 'currentText');
1314
+ var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today);
1315
+ currentText = (!navigationAsDateFormat ? currentText :
1316
+ this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
1317
+ var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">' + this._get(inst, 'closeText') + '</button>' : '');
1318
+ var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') +
1319
+ (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#' + inst.id + '\');"' +
1320
+ '>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : '';
1321
+ var firstDay = parseInt(this._get(inst, 'firstDay'),10);
1322
+ firstDay = (isNaN(firstDay) ? 0 : firstDay);
1323
+ var dayNames = this._get(inst, 'dayNames');
1324
+ var dayNamesShort = this._get(inst, 'dayNamesShort');
1325
+ var dayNamesMin = this._get(inst, 'dayNamesMin');
1326
+ var monthNames = this._get(inst, 'monthNames');
1327
+ var monthNamesShort = this._get(inst, 'monthNamesShort');
1328
+ var beforeShowDay = this._get(inst, 'beforeShowDay');
1329
+ var showOtherMonths = this._get(inst, 'showOtherMonths');
1330
+ var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week;
1331
+ var endDate = inst.endDay ? this._daylightSavingAdjust(
1332
+ new Date(inst.endYear, inst.endMonth, inst.endDay)) : currentDate;
1333
+ var defaultDate = this._getDefaultDate(inst);
1334
+ var html = '';
1335
+ for (var row = 0; row < numMonths[0]; row++) {
1336
+ var group = '';
1337
+ for (var col = 0; col < numMonths[1]; col++) {
1338
+ var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
1339
+ var cornerClass = ' ui-corner-all';
1340
+ var calender = '';
1341
+ if (isMultiMonth) {
1342
+ calender += '<div class="ui-datepicker-group ui-datepicker-group-';
1343
+ switch (col) {
1344
+ case 0: calender += 'first'; cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break;
1345
+ case numMonths[1]-1: calender += 'last'; cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break;
1346
+ default: calender += 'middle'; cornerClass = ''; break;
1347
+ }
1348
+ calender += '">';
1349
+ }
1350
+ calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' +
1351
+ (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') +
1352
+ (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') +
1353
+ this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
1354
+ selectedDate, row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
1355
+ '</div><table class="ui-datepicker-calendar"><thead>' +
1356
+ '<tr>';
1357
+ var thead = '';
1358
+ for (var dow = 0; dow < 7; dow++) { // days of the week
1359
+ var day = (dow + firstDay) % 7;
1360
+ thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' +
1361
+ '<span title="' + dayNames[day] + '">' + dayNamesMin[day] + '</span></th>';
1362
+ }
1363
+ calender += thead + '</tr></thead><tbody>';
1364
+ var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
1365
+ if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth)
1366
+ inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
1367
+ var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
1368
+ var numRows = (isMultiMonth ? 6 : Math.ceil((leadDays + daysInMonth) / 7)); // calculate the number of rows to generate
1369
+ var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
1370
+ for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
1371
+ calender += '<tr>';
1372
+ var tbody = '';
1373
+ for (var dow = 0; dow < 7; dow++) { // create date picker days
1374
+ var daySettings = (beforeShowDay ?
1375
+ beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']);
1376
+ var otherMonth = (printDate.getMonth() != drawMonth);
1377
+ var unselectable = otherMonth || !daySettings[0] ||
1378
+ (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
1379
+ tbody += '<td class="' +
1380
+ ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends
1381
+ (otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months
1382
+ ((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || // user pressed key
1383
+ (defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ?
1384
+ // or defaultDate is current printedDate and defaultDate is selectedDate
1385
+ ' ' + this._dayOverClass : '') + // highlight selected day
1386
+ (unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') + // highlight unselectable days
1387
+ (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates
1388
+ (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range
1389
+ ' ' + this._currentClass : '') + // highlight selected day
1390
+ (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
1391
+ ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
1392
+ (unselectable ? '' : ' onclick="DP_jQuery.datepicker._selectDay(\'#' +
1393
+ inst.id + '\',' + drawMonth + ',' + drawYear + ', this);return false;"') + '>' + // actions
1394
+ (otherMonth ? (showOtherMonths ? printDate.getDate() : '&#xa0;') : // display for other months
1395
+ (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' +
1396
+ (printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') +
1397
+ (printDate.getTime() >= currentDate.getTime() && printDate.getTime() <= endDate.getTime() ? // in current range
1398
+ ' ui-state-active' : '') + // highlight selected day
1399
+ '" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display for this month
1400
+ printDate.setDate(printDate.getDate() + 1);
1401
+ printDate = this._daylightSavingAdjust(printDate);
1402
+ }
1403
+ calender += tbody + '</tr>';
1404
+ }
1405
+ drawMonth++;
1406
+ if (drawMonth > 11) {
1407
+ drawMonth = 0;
1408
+ drawYear++;
1409
+ }
1410
+ calender += '</tbody></table>' + (isMultiMonth ? '</div>' +
1411
+ ((numMonths[0] > 0 && col == numMonths[1]-1) ? '<div class="ui-datepicker-row-break"></div>' : '') : '');
1412
+ group += calender;
1413
+ }
1414
+ html += group;
1415
+ }
1416
+ html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ?
1417
+ '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : '');
1418
+ inst._keyEvent = false;
1419
+ return html;
1420
+ },
1421
+
1422
+ /* Generate the month and year header. */
1423
+ _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
1424
+ selectedDate, secondary, monthNames, monthNamesShort) {
1425
+ minDate = (inst.rangeStart && minDate && selectedDate < minDate ? selectedDate : minDate);
1426
+ var changeMonth = this._get(inst, 'changeMonth');
1427
+ var changeYear = this._get(inst, 'changeYear');
1428
+ var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');
1429
+ var html = '<div class="ui-datepicker-title">';
1430
+ var monthHtml = '';
1431
+ // month selection
1432
+ if (secondary || !changeMonth)
1433
+ monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span> ';
1434
+ else {
1435
+ var inMinYear = (minDate && minDate.getFullYear() == drawYear);
1436
+ var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
1437
+ monthHtml += '<select class="ui-datepicker-month" ' +
1438
+ 'onchange="DP_jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' +
1439
+ 'onclick="DP_jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
1440
+ '>';
1441
+ for (var month = 0; month < 12; month++) {
1442
+ if ((!inMinYear || month >= minDate.getMonth()) &&
1443
+ (!inMaxYear || month <= maxDate.getMonth()))
1444
+ monthHtml += '<option value="' + month + '"' +
1445
+ (month == drawMonth ? ' selected="selected"' : '') +
1446
+ '>' + monthNamesShort[month] + '</option>';
1447
+ }
1448
+ monthHtml += '</select>';
1449
+ }
1450
+ if (!showMonthAfterYear)
1451
+ html += monthHtml + ((secondary || changeMonth || changeYear) && (!(changeMonth && changeYear)) ? '&#xa0;' : '');
1452
+ // year selection
1453
+ if (secondary || !changeYear)
1454
+ html += '<span class="ui-datepicker-year">' + drawYear + '</span>';
1455
+ else {
1456
+ // determine range of years to display
1457
+ var years = this._get(inst, 'yearRange').split(':');
1458
+ var year = 0;
1459
+ var endYear = 0;
1460
+ if (years.length != 2) {
1461
+ year = drawYear - 10;
1462
+ endYear = drawYear + 10;
1463
+ } else if (years[0].charAt(0) == '+' || years[0].charAt(0) == '-') {
1464
+ year = drawYear + parseInt(years[0], 10);
1465
+ endYear = drawYear + parseInt(years[1], 10);
1466
+ } else {
1467
+ year = parseInt(years[0], 10);
1468
+ endYear = parseInt(years[1], 10);
1469
+ }
1470
+ year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
1471
+ endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
1472
+ html += '<select class="ui-datepicker-year" ' +
1473
+ 'onchange="DP_jQuery.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' +
1474
+ 'onclick="DP_jQuery.datepicker._clickMonthYear(\'#' + inst.id + '\');"' +
1475
+ '>';
1476
+ for (; year <= endYear; year++) {
1477
+ html += '<option value="' + year + '"' +
1478
+ (year == drawYear ? ' selected="selected"' : '') +
1479
+ '>' + year + '</option>';
1480
+ }
1481
+ html += '</select>';
1482
+ }
1483
+ if (showMonthAfterYear)
1484
+ html += (secondary || changeMonth || changeYear ? '&#xa0;' : '') + monthHtml;
1485
+ html += '</div>'; // Close datepicker_header
1486
+ return html;
1487
+ },
1488
+
1489
+ /* Adjust one of the date sub-fields. */
1490
+ _adjustInstDate: function(inst, offset, period) {
1491
+ var year = inst.drawYear + (period == 'Y' ? offset : 0);
1492
+ var month = inst.drawMonth + (period == 'M' ? offset : 0);
1493
+ var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) +
1494
+ (period == 'D' ? offset : 0);
1495
+ var date = this._daylightSavingAdjust(new Date(year, month, day));
1496
+ // ensure it is within the bounds set
1497
+ var minDate = this._getMinMaxDate(inst, 'min', true);
1498
+ var maxDate = this._getMinMaxDate(inst, 'max');
1499
+ date = (minDate && date < minDate ? minDate : date);
1500
+ date = (maxDate && date > maxDate ? maxDate : date);
1501
+ inst.selectedDay = date.getDate();
1502
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
1503
+ inst.drawYear = inst.selectedYear = date.getFullYear();
1504
+ if (period == 'M' || period == 'Y')
1505
+ this._notifyChange(inst);
1506
+ },
1507
+
1508
+ /* Notify change of month/year. */
1509
+ _notifyChange: function(inst) {
1510
+ var onChange = this._get(inst, 'onChangeMonthYear');
1511
+ if (onChange)
1512
+ onChange.apply((inst.input ? inst.input[0] : null),
1513
+ [inst.selectedYear, inst.selectedMonth + 1, inst]);
1514
+ },
1515
+
1516
+ /* Determine the number of months to show. */
1517
+ _getNumberOfMonths: function(inst) {
1518
+ var numMonths = this._get(inst, 'numberOfMonths');
1519
+ return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));
1520
+ },
1521
+
1522
+ /* Determine the current maximum date - ensure no time components are set - may be overridden for a range. */
1523
+ _getMinMaxDate: function(inst, minMax, checkRange) {
1524
+ var date = this._determineDate(this._get(inst, minMax + 'Date'), null);
1525
+ return (!checkRange || !inst.rangeStart ? date :
1526
+ (!date || inst.rangeStart > date ? inst.rangeStart : date));
1527
+ },
1528
+
1529
+ /* Find the number of days in a given month. */
1530
+ _getDaysInMonth: function(year, month) {
1531
+ return 32 - new Date(year, month, 32).getDate();
1532
+ },
1533
+
1534
+ /* Find the day of the week of the first of a month. */
1535
+ _getFirstDayOfMonth: function(year, month) {
1536
+ return new Date(year, month, 1).getDay();
1537
+ },
1538
+
1539
+ /* Determines if we should allow a "next/prev" month display change. */
1540
+ _canAdjustMonth: function(inst, offset, curYear, curMonth) {
1541
+ var numMonths = this._getNumberOfMonths(inst);
1542
+ var date = this._daylightSavingAdjust(new Date(
1543
+ curYear, curMonth + (offset < 0 ? offset : numMonths[1]), 1));
1544
+ if (offset < 0)
1545
+ date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
1546
+ return this._isInRange(inst, date);
1547
+ },
1548
+
1549
+ /* Is the given date in the accepted range? */
1550
+ _isInRange: function(inst, date) {
1551
+ // during range selection, use minimum of selected date and range start
1552
+ var newMinDate = (!inst.rangeStart ? null : this._daylightSavingAdjust(
1553
+ new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay)));
1554
+ newMinDate = (newMinDate && inst.rangeStart < newMinDate ? inst.rangeStart : newMinDate);
1555
+ var minDate = newMinDate || this._getMinMaxDate(inst, 'min');
1556
+ var maxDate = this._getMinMaxDate(inst, 'max');
1557
+ return ((!minDate || date >= minDate) && (!maxDate || date <= maxDate));
1558
+ },
1559
+
1560
+ /* Provide the configuration settings for formatting/parsing. */
1561
+ _getFormatConfig: function(inst) {
1562
+ var shortYearCutoff = this._get(inst, 'shortYearCutoff');
1563
+ shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
1564
+ new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
1565
+ return {shortYearCutoff: shortYearCutoff,
1566
+ dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'),
1567
+ monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')};
1568
+ },
1569
+
1570
+ /* Format the given date for display. */
1571
+ _formatDate: function(inst, day, month, year) {
1572
+ if (!day) {
1573
+ inst.currentDay = inst.selectedDay;
1574
+ inst.currentMonth = inst.selectedMonth;
1575
+ inst.currentYear = inst.selectedYear;
1576
+ }
1577
+ var date = (day ? (typeof day == 'object' ? day :
1578
+ this._daylightSavingAdjust(new Date(year, month, day))) :
1579
+ this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
1580
+ return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst));
1581
+ }
1582
+ });
1583
+
1584
+ /* jQuery extend now ignores nulls! */
1585
+ function extendRemove(target, props) {
1586
+ $.extend(target, props);
1587
+ for (var name in props)
1588
+ if (props[name] == null || props[name] == undefined)
1589
+ target[name] = props[name];
1590
+ return target;
1591
+ };
1592
+
1593
+ /* Determine whether an object is an array. */
1594
+ function isArray(a) {
1595
+ return (a && (($.browser.safari && typeof a == 'object' && a.length) ||
1596
+ (a.constructor && a.constructor.toString().match(/\Array\(\)/))));
1597
+ };
1598
+
1599
+ /* Invoke the datepicker functionality.
1600
+ @param options string - a command, optionally followed by additional parameters or
1601
+ Object - settings for attaching new datepicker functionality
1602
+ @return jQuery object */
1603
+ $.fn.datepicker = function(options){
1604
+
1605
+ /* Initialise the date picker. */
1606
+ if (!$.datepicker.initialized) {
1607
+ $(document).mousedown($.datepicker._checkExternalClick).
1608
+ find('body').append($.datepicker.dpDiv);
1609
+ $.datepicker.initialized = true;
1610
+ }
1611
+
1612
+ var otherArgs = Array.prototype.slice.call(arguments, 1);
1613
+ if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate'))
1614
+ return $.datepicker['_' + options + 'Datepicker'].
1615
+ apply($.datepicker, [this[0]].concat(otherArgs));
1616
+ if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string')
1617
+ return $.datepicker['_' + options + 'Datepicker'].
1618
+ apply($.datepicker, [this[0]].concat(otherArgs));
1619
+ return this.each(function() {
1620
+ typeof options == 'string' ?
1621
+ $.datepicker['_' + options + 'Datepicker'].
1622
+ apply($.datepicker, [this].concat(otherArgs)) :
1623
+ $.datepicker._attachDatepicker(this, options);
1624
+ });
1625
+ };
1626
+
1627
+ $.datepicker = new Datepicker(); // singleton instance
1628
+ $.datepicker.initialized = false;
1629
+ $.datepicker.uuid = new Date().getTime();
1630
+ $.datepicker.version = "1.7.2";
1631
+
1632
+ // Workaround for #4055
1633
+ // Add another global to avoid noConflict issues with inline event handlers
1634
+ window.DP_jQuery = $;
1635
+
1636
+ })(jQuery);