upstream-rails_admin 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (556) hide show
  1. data/Gemfile +74 -0
  2. data/LICENSE.md +20 -0
  3. data/README.md +162 -0
  4. data/Rakefile +19 -0
  5. data/app/assets/images/rails_admin/aristo/images/bg_fallback.png +0 -0
  6. data/app/assets/images/rails_admin/aristo/images/icon_sprite.png +0 -0
  7. data/app/assets/images/rails_admin/aristo/images/progress_bar.gif +0 -0
  8. data/app/assets/images/rails_admin/aristo/images/slider_handles.png +0 -0
  9. data/app/assets/images/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
  10. data/app/assets/images/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
  11. data/app/assets/images/rails_admin/bullet_black.png +0 -0
  12. data/app/assets/images/rails_admin/bullet_white.png +0 -0
  13. data/app/assets/images/rails_admin/calendar.png +0 -0
  14. data/app/assets/images/rails_admin/clock.png +0 -0
  15. data/app/assets/images/rails_admin/colorpicker/colorpicker_background.png +0 -0
  16. data/app/assets/images/rails_admin/colorpicker/colorpicker_hex.png +0 -0
  17. data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_b.png +0 -0
  18. data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_h.png +0 -0
  19. data/app/assets/images/rails_admin/colorpicker/colorpicker_hsb_s.png +0 -0
  20. data/app/assets/images/rails_admin/colorpicker/colorpicker_indic.gif +0 -0
  21. data/app/assets/images/rails_admin/colorpicker/colorpicker_overlay.png +0 -0
  22. data/app/assets/images/rails_admin/colorpicker/colorpicker_rgb_b.png +0 -0
  23. data/app/assets/images/rails_admin/colorpicker/colorpicker_rgb_g.png +0 -0
  24. data/app/assets/images/rails_admin/colorpicker/colorpicker_rgb_r.png +0 -0
  25. data/app/assets/images/rails_admin/colorpicker/colorpicker_select.gif +0 -0
  26. data/app/assets/images/rails_admin/colorpicker/colorpicker_submit.png +0 -0
  27. data/app/assets/images/rails_admin/colorpicker/custom_background.png +0 -0
  28. data/app/assets/images/rails_admin/colorpicker/custom_hex.png +0 -0
  29. data/app/assets/images/rails_admin/colorpicker/custom_hsb_b.png +0 -0
  30. data/app/assets/images/rails_admin/colorpicker/custom_hsb_h.png +0 -0
  31. data/app/assets/images/rails_admin/colorpicker/custom_hsb_s.png +0 -0
  32. data/app/assets/images/rails_admin/colorpicker/custom_indic.gif +0 -0
  33. data/app/assets/images/rails_admin/colorpicker/custom_rgb_b.png +0 -0
  34. data/app/assets/images/rails_admin/colorpicker/custom_rgb_g.png +0 -0
  35. data/app/assets/images/rails_admin/colorpicker/custom_rgb_r.png +0 -0
  36. data/app/assets/images/rails_admin/colorpicker/custom_submit.png +0 -0
  37. data/app/assets/images/rails_admin/colorpicker/select.png +0 -0
  38. data/app/assets/images/rails_admin/colorpicker/select2.png +0 -0
  39. data/app/assets/images/rails_admin/colorpicker/slider.png +0 -0
  40. data/app/assets/images/rails_admin/logo.png +0 -0
  41. data/app/assets/images/rails_admin/magnifier.png +0 -0
  42. data/app/assets/images/rails_admin/multiselect/icon_sprite.png +0 -0
  43. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-dark.png +0 -0
  44. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-n-light.png +0 -0
  45. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-dark.png +0 -0
  46. data/app/assets/images/rails_admin/multiselect/ui-icon-circle-triangle-s-light.png +0 -0
  47. data/app/assets/javascripts/rails_admin/custom/ui.js +12 -0
  48. data/app/assets/javascripts/rails_admin/jquery.colorpicker.js +484 -0
  49. data/app/assets/javascripts/rails_admin/jquery.pjax.js +543 -0
  50. data/app/assets/javascripts/rails_admin/jquery.ui.timepicker.js +1371 -0
  51. data/app/assets/javascripts/rails_admin/ra.datetimepicker.js +67 -0
  52. data/app/assets/javascripts/rails_admin/ra.filter-box.js +129 -0
  53. data/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js +280 -0
  54. data/app/assets/javascripts/rails_admin/ra.filtering-select.js +181 -0
  55. data/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee +41 -0
  56. data/app/assets/javascripts/rails_admin/ra.remote-form.js +152 -0
  57. data/app/assets/javascripts/rails_admin/ra.widgets.coffee +135 -0
  58. data/app/assets/javascripts/rails_admin/rails_admin.js.erb +27 -0
  59. data/app/assets/javascripts/rails_admin/themes/cerulean/ui.js +0 -0
  60. data/app/assets/javascripts/rails_admin/themes/default/ui.js +12 -0
  61. data/app/assets/javascripts/rails_admin/ui.js.coffee +65 -0
  62. data/app/assets/stylesheets/rails_admin/aristo/images/bg_fallback.png +0 -0
  63. data/app/assets/stylesheets/rails_admin/aristo/images/icon_sprite.png +0 -0
  64. data/app/assets/stylesheets/rails_admin/aristo/images/progress_bar.gif +0 -0
  65. data/app/assets/stylesheets/rails_admin/aristo/images/slider_handles.png +0 -0
  66. data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_222222_256x240.png +0 -0
  67. data/app/assets/stylesheets/rails_admin/aristo/images/ui-icons_454545_256x240.png +0 -0
  68. data/app/assets/stylesheets/rails_admin/aristo/jquery-ui-1.8.7.custom.css.scss +733 -0
  69. data/app/assets/stylesheets/rails_admin/base/README +2 -0
  70. data/app/assets/stylesheets/rails_admin/base/mixins.css.scss +1 -0
  71. data/app/assets/stylesheets/rails_admin/base/theming.css.scss +270 -0
  72. data/app/assets/stylesheets/rails_admin/base/variables.css.scss +1 -0
  73. data/app/assets/stylesheets/rails_admin/custom/mixins.css.scss +12 -0
  74. data/app/assets/stylesheets/rails_admin/custom/theming.css.scss +13 -0
  75. data/app/assets/stylesheets/rails_admin/custom/variables.css.scss +15 -0
  76. data/app/assets/stylesheets/rails_admin/imports.css.scss.erb +78 -0
  77. data/app/assets/stylesheets/rails_admin/jquery.colorpicker.css.scss +180 -0
  78. data/app/assets/stylesheets/rails_admin/jquery.ui.timepicker.css.scss +69 -0
  79. data/app/assets/stylesheets/rails_admin/ra.calendar-additions.css.scss +25 -0
  80. data/app/assets/stylesheets/rails_admin/ra.filtering-multiselect.css.scss +85 -0
  81. data/app/assets/stylesheets/rails_admin/rails_admin.css +4 -0
  82. data/app/assets/stylesheets/rails_admin/themes/cerulean/mixins.css.scss +0 -0
  83. data/app/assets/stylesheets/rails_admin/themes/cerulean/theming.css.scss +97 -0
  84. data/app/assets/stylesheets/rails_admin/themes/cerulean/variables.css.scss +168 -0
  85. data/app/assets/stylesheets/rails_admin/themes/default/mixins.css.scss +8 -0
  86. data/app/assets/stylesheets/rails_admin/themes/default/theming.css.scss +11 -0
  87. data/app/assets/stylesheets/rails_admin/themes/default/variables.css.scss +12 -0
  88. data/app/controllers/rails_admin/application_controller.rb +82 -0
  89. data/app/controllers/rails_admin/main_controller.rb +155 -0
  90. data/app/helpers/rails_admin/application_helper.rb +125 -0
  91. data/app/helpers/rails_admin/form_builder.rb +113 -0
  92. data/app/helpers/rails_admin/main_helper.rb +36 -0
  93. data/app/views/kaminari/twitter-bootstrap/_gap.html.haml +2 -0
  94. data/app/views/kaminari/twitter-bootstrap/_next_page.html.haml +4 -0
  95. data/app/views/kaminari/twitter-bootstrap/_page.html.haml +4 -0
  96. data/app/views/kaminari/twitter-bootstrap/_paginator.html.haml +10 -0
  97. data/app/views/kaminari/twitter-bootstrap/_prev_page.html.haml +4 -0
  98. data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +12 -0
  99. data/app/views/layouts/rails_admin/application.html.haml +26 -0
  100. data/app/views/layouts/rails_admin/pjax.html.haml +20 -0
  101. data/app/views/rails_admin/main/_dashboard_history.html.haml +10 -0
  102. data/app/views/rails_admin/main/_delete_notice.html.haml +18 -0
  103. data/app/views/rails_admin/main/_form_colorpicker.html.haml +1 -0
  104. data/app/views/rails_admin/main/_form_datetime.html.haml +1 -0
  105. data/app/views/rails_admin/main/_form_enumeration.html.haml +1 -0
  106. data/app/views/rails_admin/main/_form_field.html.haml +1 -0
  107. data/app/views/rails_admin/main/_form_file_upload.html.haml +13 -0
  108. data/app/views/rails_admin/main/_form_filtering_multiselect.html.haml +47 -0
  109. data/app/views/rails_admin/main/_form_filtering_select.html.haml +37 -0
  110. data/app/views/rails_admin/main/_form_nested_many.html.haml +14 -0
  111. data/app/views/rails_admin/main/_form_nested_one.html.haml +10 -0
  112. data/app/views/rails_admin/main/_form_polymorphic_association.html.haml +10 -0
  113. data/app/views/rails_admin/main/_form_text.html.haml +15 -0
  114. data/app/views/rails_admin/main/_submit_buttons.html.haml +15 -0
  115. data/app/views/rails_admin/main/bulk_delete.html.haml +11 -0
  116. data/app/views/rails_admin/main/dashboard.html.haml +31 -0
  117. data/app/views/rails_admin/main/delete.html.haml +18 -0
  118. data/app/views/rails_admin/main/edit.html.haml +2 -0
  119. data/app/views/rails_admin/main/export.html.haml +75 -0
  120. data/app/views/rails_admin/main/history.html.haml +42 -0
  121. data/app/views/rails_admin/main/index.html.haml +140 -0
  122. data/app/views/rails_admin/main/new.html.haml +2 -0
  123. data/app/views/rails_admin/main/show.html.haml +14 -0
  124. data/config/initializers/active_record_extensions.rb +19 -0
  125. data/config/initializers/devise_patch.rb +9 -0
  126. data/config/initializers/haml.rb +2 -0
  127. data/config/initializers/mongoid_extensions.rb +5 -0
  128. data/config/locales/fr.yml +24 -0
  129. data/config/locales/rails_admin.en.yml +130 -0
  130. data/config/routes.rb +12 -0
  131. data/lib/generators/rails_admin/install_generator.rb +84 -0
  132. data/lib/generators/rails_admin/templates/drop.rb +18 -0
  133. data/lib/generators/rails_admin/templates/initializer.erb +101 -0
  134. data/lib/generators/rails_admin/templates/migration.rb +18 -0
  135. data/lib/generators/rails_admin/uninstall_generator.rb +22 -0
  136. data/lib/generators/rails_admin/utils.rb +30 -0
  137. data/lib/rails_admin.rb +34 -0
  138. data/lib/rails_admin/abstract_model.rb +108 -0
  139. data/lib/rails_admin/adapters/active_record.rb +255 -0
  140. data/lib/rails_admin/adapters/active_record/abstract_object.rb +32 -0
  141. data/lib/rails_admin/adapters/mongoid.rb +390 -0
  142. data/lib/rails_admin/adapters/mongoid/abstract_object.rb +48 -0
  143. data/lib/rails_admin/adapters/mongoid/extension.rb +48 -0
  144. data/lib/rails_admin/config.rb +323 -0
  145. data/lib/rails_admin/config/actions.rb +121 -0
  146. data/lib/rails_admin/config/actions/base.rb +117 -0
  147. data/lib/rails_admin/config/actions/bulk_delete.rb +55 -0
  148. data/lib/rails_admin/config/actions/dashboard.rb +46 -0
  149. data/lib/rails_admin/config/actions/delete.rb +53 -0
  150. data/lib/rails_admin/config/actions/edit.rb +60 -0
  151. data/lib/rails_admin/config/actions/export.rb +40 -0
  152. data/lib/rails_admin/config/actions/history_index.rb +38 -0
  153. data/lib/rails_admin/config/actions/history_show.rb +38 -0
  154. data/lib/rails_admin/config/actions/index.rb +85 -0
  155. data/lib/rails_admin/config/actions/new.rb +64 -0
  156. data/lib/rails_admin/config/actions/show.rb +32 -0
  157. data/lib/rails_admin/config/actions/show_in_app.rb +28 -0
  158. data/lib/rails_admin/config/configurable.rb +92 -0
  159. data/lib/rails_admin/config/fields.rb +88 -0
  160. data/lib/rails_admin/config/fields/association.rb +108 -0
  161. data/lib/rails_admin/config/fields/base.rb +298 -0
  162. data/lib/rails_admin/config/fields/factories/association.rb +32 -0
  163. data/lib/rails_admin/config/fields/factories/carrierwave.rb +31 -0
  164. data/lib/rails_admin/config/fields/factories/devise.rb +27 -0
  165. data/lib/rails_admin/config/fields/factories/dragonfly.rb +27 -0
  166. data/lib/rails_admin/config/fields/factories/enum.rb +11 -0
  167. data/lib/rails_admin/config/fields/factories/paperclip.rb +26 -0
  168. data/lib/rails_admin/config/fields/factories/password.rb +17 -0
  169. data/lib/rails_admin/config/fields/factories/serialized.rb +17 -0
  170. data/lib/rails_admin/config/fields/group.rb +78 -0
  171. data/lib/rails_admin/config/fields/types.rb +27 -0
  172. data/lib/rails_admin/config/fields/types/all.rb +25 -0
  173. data/lib/rails_admin/config/fields/types/belongs_to_association.rb +41 -0
  174. data/lib/rails_admin/config/fields/types/boolean.rb +31 -0
  175. data/lib/rails_admin/config/fields/types/bson_object_id.rb +42 -0
  176. data/lib/rails_admin/config/fields/types/carrierwave.rb +31 -0
  177. data/lib/rails_admin/config/fields/types/color.rb +37 -0
  178. data/lib/rails_admin/config/fields/types/date.rb +24 -0
  179. data/lib/rails_admin/config/fields/types/datetime.rb +163 -0
  180. data/lib/rails_admin/config/fields/types/decimal.rb +14 -0
  181. data/lib/rails_admin/config/fields/types/dragonfly.rb +41 -0
  182. data/lib/rails_admin/config/fields/types/enum.rb +35 -0
  183. data/lib/rails_admin/config/fields/types/file_upload.rb +61 -0
  184. data/lib/rails_admin/config/fields/types/float.rb +14 -0
  185. data/lib/rails_admin/config/fields/types/has_and_belongs_to_many_association.rb +14 -0
  186. data/lib/rails_admin/config/fields/types/has_many_association.rb +32 -0
  187. data/lib/rails_admin/config/fields/types/has_one_association.rb +39 -0
  188. data/lib/rails_admin/config/fields/types/hidden.rb +21 -0
  189. data/lib/rails_admin/config/fields/types/integer.rb +22 -0
  190. data/lib/rails_admin/config/fields/types/paperclip.rb +28 -0
  191. data/lib/rails_admin/config/fields/types/password.rb +39 -0
  192. data/lib/rails_admin/config/fields/types/polymorphic_association.rb +76 -0
  193. data/lib/rails_admin/config/fields/types/serialized.rb +22 -0
  194. data/lib/rails_admin/config/fields/types/string.rb +41 -0
  195. data/lib/rails_admin/config/fields/types/text.rb +36 -0
  196. data/lib/rails_admin/config/fields/types/time.rb +36 -0
  197. data/lib/rails_admin/config/fields/types/timestamp.rb +18 -0
  198. data/lib/rails_admin/config/groupable.rb +18 -0
  199. data/lib/rails_admin/config/has_fields.rb +135 -0
  200. data/lib/rails_admin/config/has_groups.rb +23 -0
  201. data/lib/rails_admin/config/hideable.rb +28 -0
  202. data/lib/rails_admin/config/model.rb +88 -0
  203. data/lib/rails_admin/config/proxyable.rb +12 -0
  204. data/lib/rails_admin/config/proxyable/proxy.rb +43 -0
  205. data/lib/rails_admin/config/sections.rb +39 -0
  206. data/lib/rails_admin/config/sections/base.rb +29 -0
  207. data/lib/rails_admin/config/sections/create.rb +11 -0
  208. data/lib/rails_admin/config/sections/edit.rb +11 -0
  209. data/lib/rails_admin/config/sections/export.rb +11 -0
  210. data/lib/rails_admin/config/sections/list.rb +27 -0
  211. data/lib/rails_admin/config/sections/modal.rb +10 -0
  212. data/lib/rails_admin/config/sections/nested.rb +10 -0
  213. data/lib/rails_admin/config/sections/show.rb +10 -0
  214. data/lib/rails_admin/config/sections/update.rb +10 -0
  215. data/lib/rails_admin/engine.rb +22 -0
  216. data/lib/rails_admin/extension.rb +29 -0
  217. data/lib/rails_admin/extensions/cancan.rb +5 -0
  218. data/lib/rails_admin/extensions/cancan/authorization_adapter.rb +59 -0
  219. data/lib/rails_admin/extensions/history.rb +5 -0
  220. data/lib/rails_admin/extensions/history/auditing_adapter.rb +37 -0
  221. data/lib/rails_admin/extensions/history/history.rb +70 -0
  222. data/lib/rails_admin/extensions/paper_trail.rb +5 -0
  223. data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +92 -0
  224. data/lib/rails_admin/i18n_support.rb +43 -0
  225. data/lib/rails_admin/support/core_extensions.rb +44 -0
  226. data/lib/rails_admin/support/csv_converter.rb +109 -0
  227. data/lib/rails_admin/version.rb +3 -0
  228. data/lib/tasks/prepare_ci_env.rake +27 -0
  229. data/lib/tasks/rails_admin.rake +18 -0
  230. data/spec/ci.sh +2 -0
  231. data/spec/controllers/application_controller_spec.rb +30 -0
  232. data/spec/controllers/main_controller_spec.rb +179 -0
  233. data/spec/dummy_app/Gemfile +71 -0
  234. data/spec/dummy_app/Gemfile.lock +205 -0
  235. data/spec/dummy_app/Rakefile +7 -0
  236. data/spec/dummy_app/app/active_record/abstract.rb +5 -0
  237. data/spec/dummy_app/app/active_record/ball.rb +9 -0
  238. data/spec/dummy_app/app/active_record/carrierwave_uploader.rb +53 -0
  239. data/spec/dummy_app/app/active_record/category.rb +5 -0
  240. data/spec/dummy_app/app/active_record/cms.rb +5 -0
  241. data/spec/dummy_app/app/active_record/cms/basic_page.rb +9 -0
  242. data/spec/dummy_app/app/active_record/cms/unscoped_page.rb +3 -0
  243. data/spec/dummy_app/app/active_record/comment.rb +5 -0
  244. data/spec/dummy_app/app/active_record/division.rb +15 -0
  245. data/spec/dummy_app/app/active_record/draft.rb +13 -0
  246. data/spec/dummy_app/app/active_record/fan.rb +7 -0
  247. data/spec/dummy_app/app/active_record/field_test.rb +20 -0
  248. data/spec/dummy_app/app/active_record/hardball.rb +2 -0
  249. data/spec/dummy_app/app/active_record/league.rb +12 -0
  250. data/spec/dummy_app/app/active_record/nested_field_test.rb +7 -0
  251. data/spec/dummy_app/app/active_record/player.rb +23 -0
  252. data/spec/dummy_app/app/active_record/team.rb +27 -0
  253. data/spec/dummy_app/app/active_record/user.rb +21 -0
  254. data/spec/dummy_app/app/assets/images/rails.png +0 -0
  255. data/spec/dummy_app/app/assets/javascripts/application.js +15 -0
  256. data/spec/dummy_app/app/assets/stylesheets/application.css +13 -0
  257. data/spec/dummy_app/app/controllers/application_controller.rb +3 -0
  258. data/spec/dummy_app/app/controllers/players_controller.rb +5 -0
  259. data/spec/dummy_app/app/locales/models.en.yml +20 -0
  260. data/spec/dummy_app/app/mongoid/ball.rb +14 -0
  261. data/spec/dummy_app/app/mongoid/carrierwave_uploader.rb +53 -0
  262. data/spec/dummy_app/app/mongoid/category.rb +7 -0
  263. data/spec/dummy_app/app/mongoid/cms.rb +5 -0
  264. data/spec/dummy_app/app/mongoid/cms/basic_page.rb +12 -0
  265. data/spec/dummy_app/app/mongoid/cms/unscoped_page.rb +5 -0
  266. data/spec/dummy_app/app/mongoid/comment.rb +9 -0
  267. data/spec/dummy_app/app/mongoid/division.rb +14 -0
  268. data/spec/dummy_app/app/mongoid/draft.rb +22 -0
  269. data/spec/dummy_app/app/mongoid/embed.rb +6 -0
  270. data/spec/dummy_app/app/mongoid/fan.rb +12 -0
  271. data/spec/dummy_app/app/mongoid/field_test.rb +56 -0
  272. data/spec/dummy_app/app/mongoid/hardball.rb +2 -0
  273. data/spec/dummy_app/app/mongoid/league.rb +16 -0
  274. data/spec/dummy_app/app/mongoid/nested_field_test.rb +12 -0
  275. data/spec/dummy_app/app/mongoid/player.rb +37 -0
  276. data/spec/dummy_app/app/mongoid/team.rb +47 -0
  277. data/spec/dummy_app/app/mongoid/user.rb +61 -0
  278. data/spec/dummy_app/app/views/layouts/application.html.erb +14 -0
  279. data/spec/dummy_app/app/views/players/show.html.haml +1 -0
  280. data/spec/dummy_app/config.ru +4 -0
  281. data/spec/dummy_app/config/application.rb +69 -0
  282. data/spec/dummy_app/config/boot.rb +9 -0
  283. data/spec/dummy_app/config/database.yml +25 -0
  284. data/spec/dummy_app/config/environment.rb +5 -0
  285. data/spec/dummy_app/config/environments/development.rb +37 -0
  286. data/spec/dummy_app/config/environments/production.rb +67 -0
  287. data/spec/dummy_app/config/environments/test.rb +37 -0
  288. data/spec/dummy_app/config/initializers/backtrace_silencers.rb +7 -0
  289. data/spec/dummy_app/config/initializers/devise.rb +223 -0
  290. data/spec/dummy_app/config/initializers/dragonfly.rb +14 -0
  291. data/spec/dummy_app/config/initializers/inflections.rb +15 -0
  292. data/spec/dummy_app/config/initializers/mime_types.rb +5 -0
  293. data/spec/dummy_app/config/initializers/rails_admin.rb +8 -0
  294. data/spec/dummy_app/config/initializers/secret_token.rb +7 -0
  295. data/spec/dummy_app/config/initializers/session_patch.rb +16 -0
  296. data/spec/dummy_app/config/initializers/session_store.rb +8 -0
  297. data/spec/dummy_app/config/initializers/wrap_parameters.rb +14 -0
  298. data/spec/dummy_app/config/mongoid.yml +11 -0
  299. data/spec/dummy_app/config/routes.rb +10 -0
  300. data/spec/dummy_app/db/development.sqlite3 +0 -0
  301. data/spec/dummy_app/db/migrate/00000000000001_create_divisions_migration.rb +13 -0
  302. data/spec/dummy_app/db/migrate/00000000000002_create_drafts_migration.rb +19 -0
  303. data/spec/dummy_app/db/migrate/00000000000003_create_leagues_migration.rb +12 -0
  304. data/spec/dummy_app/db/migrate/00000000000004_create_players_migration.rb +20 -0
  305. data/spec/dummy_app/db/migrate/00000000000005_create_teams_migration.rb +22 -0
  306. data/spec/dummy_app/db/migrate/00000000000006_devise_create_users.rb +49 -0
  307. data/spec/dummy_app/db/migrate/00000000000007_create_histories_table.rb +16 -0
  308. data/spec/dummy_app/db/migrate/00000000000008_create_fans_migration.rb +12 -0
  309. data/spec/dummy_app/db/migrate/00000000000009_create_fans_teams_migration.rb +11 -0
  310. data/spec/dummy_app/db/migrate/00000000000010_add_revenue_to_team_migration.rb +9 -0
  311. data/spec/dummy_app/db/migrate/00000000000011_add_suspended_to_player_migration.rb +9 -0
  312. data/spec/dummy_app/db/migrate/00000000000012_add_avatar_columns_to_user.rb +16 -0
  313. data/spec/dummy_app/db/migrate/00000000000013_add_roles_to_user.rb +9 -0
  314. data/spec/dummy_app/db/migrate/00000000000014_add_color_to_team_migration.rb +9 -0
  315. data/spec/dummy_app/db/migrate/20101223222233_create_rel_tests.rb +15 -0
  316. data/spec/dummy_app/db/migrate/20110103205808_create_comments.rb +15 -0
  317. data/spec/dummy_app/db/migrate/20110123042530_rename_histories_to_rails_admin_histories.rb +9 -0
  318. data/spec/dummy_app/db/migrate/20110224184303_create_field_tests.rb +22 -0
  319. data/spec/dummy_app/db/migrate/20110328193014_create_cms_basic_pages.rb +14 -0
  320. data/spec/dummy_app/db/migrate/20110329183136_remove_league_id_from_teams.rb +9 -0
  321. data/spec/dummy_app/db/migrate/20110607152842_add_format_to_field_test.rb +9 -0
  322. data/spec/dummy_app/db/migrate/20110714095433_create_balls.rb +12 -0
  323. data/spec/dummy_app/db/migrate/20110831090841_add_protected_field_and_restricted_field_to_field_tests.rb +6 -0
  324. data/spec/dummy_app/db/migrate/20110901131551_change_division_primary_key.rb +19 -0
  325. data/spec/dummy_app/db/migrate/20110901142530_rename_league_id_foreign_key_on_divisions.rb +5 -0
  326. data/spec/dummy_app/db/migrate/20110901150912_set_primary_key_not_null_for_divisions.rb +21 -0
  327. data/spec/dummy_app/db/migrate/20110901154834_change_length_for_rails_admin_histories.rb +9 -0
  328. data/spec/dummy_app/db/migrate/20111103174459_create_unscoped_pages.rb +9 -0
  329. data/spec/dummy_app/db/migrate/20111108143642_add_dragonfly_and_carrierwave_to_field_tests.rb +7 -0
  330. data/spec/dummy_app/db/migrate/20111115041025_add_type_to_balls.rb +5 -0
  331. data/spec/dummy_app/db/migrate/20111123092549_create_nested_field_tests.rb +10 -0
  332. data/spec/dummy_app/db/migrate/20111130075338_add_dragonfly_asset_name_to_field_tests.rb +5 -0
  333. data/spec/dummy_app/db/migrate/20111215083258_create_foo_bars.rb +8 -0
  334. data/spec/dummy_app/db/migrate/20120117151733_add_custom_field_to_teams.rb +5 -0
  335. data/spec/dummy_app/db/migrate/20120118122004_add_categories.rb +7 -0
  336. data/spec/dummy_app/db/migrate/20120319041705_drop_rel_tests.rb +15 -0
  337. data/spec/dummy_app/db/schema.rb +188 -0
  338. data/spec/dummy_app/db/seeds.rb +29 -0
  339. data/spec/dummy_app/db/test.sqlite3 +0 -0
  340. data/spec/dummy_app/doc/README_FOR_APP +2 -0
  341. data/spec/dummy_app/log/development.log +865 -0
  342. data/spec/dummy_app/log/test.log +36651 -0
  343. data/spec/dummy_app/public/404.html +26 -0
  344. data/spec/dummy_app/public/422.html +26 -0
  345. data/spec/dummy_app/public/500.html +25 -0
  346. data/spec/dummy_app/public/favicon.ico +0 -0
  347. data/spec/dummy_app/public/robots.txt +5 -0
  348. data/spec/dummy_app/public/system/dragonfly/development/2011/11/24/10_36_27_888_Pensive_Parakeet.jpg +0 -0
  349. data/spec/dummy_app/public/system/dragonfly/development/2011/11/24/10_36_27_888_Pensive_Parakeet.jpg.meta +1 -0
  350. data/spec/dummy_app/public/system/dragonfly/development/2011/11/30/08_54_39_906_Costa_Rican_Frog.jpg +0 -0
  351. data/spec/dummy_app/public/system/dragonfly/development/2011/11/30/08_54_39_906_Costa_Rican_Frog.jpg.meta +1 -0
  352. data/spec/dummy_app/public/system/paperclip_assets/1/original/Boston City Flow.jpg +0 -0
  353. data/spec/dummy_app/public/system/paperclip_assets/1/thumb/Boston City Flow.jpg +0 -0
  354. data/spec/dummy_app/public/system/paperclip_assets/3/original/Costa Rican Frog.jpg +0 -0
  355. data/spec/dummy_app/public/system/paperclip_assets/3/thumb/Costa Rican Frog.jpg +0 -0
  356. data/spec/dummy_app/public/system/paperclip_assets/6/original/liste-electorale.pdf +0 -0
  357. data/spec/dummy_app/public/system/paperclip_assets/6/thumb/liste-electorale.pdf +148 -0
  358. data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/3/Boston_City_Flow.jpg +0 -0
  359. data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/3/thumb_Boston_City_Flow.jpg +0 -0
  360. data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/4/Costa_Rican_Frog.jpg +0 -0
  361. data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/4/thumb_Costa_Rican_Frog.jpg +0 -0
  362. data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/6/Pensive_Parakeet.jpg +0 -0
  363. data/spec/dummy_app/public/uploads/field_test/carrierwave_asset/6/thumb_Pensive_Parakeet.jpg +0 -0
  364. data/spec/dummy_app/script/rails +6 -0
  365. data/spec/dummy_app/tmp/cache/assets/BE5/B00/sprockets%2F47892969925432da563a88e366309859 +1833 -0
  366. data/spec/dummy_app/tmp/cache/assets/C1C/C90/sprockets%2F4c1f0504074864b8b21792c77391e206 +0 -0
  367. data/spec/dummy_app/tmp/cache/assets/C29/F50/sprockets%2F6d087f33314fd5091b1270969287268b +0 -0
  368. data/spec/dummy_app/tmp/cache/assets/C2C/130/sprockets%2F2d09a75917207f5a55929639226b4b48 +26 -0
  369. data/spec/dummy_app/tmp/cache/assets/C49/FD0/sprockets%2F07901b5391110eea9648d5c25d481327 +0 -0
  370. data/spec/dummy_app/tmp/cache/assets/C63/BF0/sprockets%2F600472e1a4718315162a7cb0f285a02b +547 -0
  371. data/spec/dummy_app/tmp/cache/assets/C66/0B0/sprockets%2F2560ef2871b489690ff209e164d86665 +635 -0
  372. data/spec/dummy_app/tmp/cache/assets/C68/560/sprockets%2F5996692771c33962a9a2c72790ddd754 +0 -0
  373. data/spec/dummy_app/tmp/cache/assets/C83/F90/sprockets%2Fa580b424c36c26dd59f660078d541755 +0 -0
  374. data/spec/dummy_app/tmp/cache/assets/C86/C30/sprockets%2F23ca33803f8248991f3fa8d2104e9961 +0 -0
  375. data/spec/dummy_app/tmp/cache/assets/C88/790/sprockets%2F538d9562b05167d03d26b0e5e9f78830 +5 -0
  376. data/spec/dummy_app/tmp/cache/assets/C89/3B0/sprockets%2F503f729e1bc985e17b730122c7176f97 +0 -0
  377. data/spec/dummy_app/tmp/cache/assets/C95/A00/sprockets%2F458c72992a558902c05a9d6d99339af2 +4 -0
  378. data/spec/dummy_app/tmp/cache/assets/C97/4C0/sprockets%2F97a81a953151b41a100165fb83dfa023 +133 -0
  379. data/spec/dummy_app/tmp/cache/assets/C9A/C90/sprockets%2F400271d29a3bb9124a286ba761c3f254 +0 -0
  380. data/spec/dummy_app/tmp/cache/assets/C9D/BA0/sprockets%2F1bfd091b2034980851caa077c0892c40 +490 -0
  381. data/spec/dummy_app/tmp/cache/assets/CA2/FA0/sprockets%2F0c3f1c8708606aa0440c866138d1e9a2 +0 -0
  382. data/spec/dummy_app/tmp/cache/assets/CA7/480/sprockets%2F23a375f496616605e4144a21fb4dc83a +4 -0
  383. data/spec/dummy_app/tmp/cache/assets/CB1/8A0/sprockets%2F25c2eb1d72087ed5e863f217109b6069 +0 -0
  384. data/spec/dummy_app/tmp/cache/assets/CB3/B50/sprockets%2F03a7c1f7144eb79946ceb8e151772127 +0 -0
  385. data/spec/dummy_app/tmp/cache/assets/CC4/220/sprockets%2F8d947b008798f16134b7d576fa456ce4 +285 -0
  386. data/spec/dummy_app/tmp/cache/assets/CC7/F70/sprockets%2F1a1af5b2c6473f104b2f0b252a729338 +0 -0
  387. data/spec/dummy_app/tmp/cache/assets/CD1/C70/sprockets%2F75b65e7751a3f030d43c1cf6827cc100 +133 -0
  388. data/spec/dummy_app/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  389. data/spec/dummy_app/tmp/cache/assets/CD8/430/sprockets%2Fc89f860631079a34d3c0d662aac0d256 +635 -0
  390. data/spec/dummy_app/tmp/cache/assets/CD8/AF0/sprockets%2Ffa2b25b3f4c05f51086482175c970ca7 +0 -0
  391. data/spec/dummy_app/tmp/cache/assets/CD9/590/sprockets%2F6882cdc2e05726d5172e2b9b334ec007 +0 -0
  392. data/spec/dummy_app/tmp/cache/assets/CD9/E00/sprockets%2F233f366461a5722d7dfb7a0ecd064087 +0 -0
  393. data/spec/dummy_app/tmp/cache/assets/CDA/880/sprockets%2Fa1e3e4ae81b451c8b4b798061148a358 +275 -0
  394. data/spec/dummy_app/tmp/cache/assets/CE2/490/sprockets%2Fab26cd4524240da60a93659780f9ae78 +0 -0
  395. data/spec/dummy_app/tmp/cache/assets/CEC/270/sprockets%2Fb531a7fa499c7953ab753fa911a61799 +328 -0
  396. data/spec/dummy_app/tmp/cache/assets/CFD/D70/sprockets%2F79acf34495d5196bd47278685b4ee68b +237 -0
  397. data/spec/dummy_app/tmp/cache/assets/CFE/060/sprockets%2Fd97e1e070419bcfe35c7000d1a70427b +303 -0
  398. data/spec/dummy_app/tmp/cache/assets/D02/8B0/sprockets%2F0c493e35ea651c55155b2a383bf2d34d +0 -0
  399. data/spec/dummy_app/tmp/cache/assets/D04/A20/sprockets%2Fa264585296de2351212f1063ebcccd9b +1092 -0
  400. data/spec/dummy_app/tmp/cache/assets/D0F/EA0/sprockets%2F4a754f04f5d1c8995a01927bbd074fa4 +0 -0
  401. data/spec/dummy_app/tmp/cache/assets/D11/470/sprockets%2F67d64aa5490686515e07cdb8ae05b4c6 +9 -0
  402. data/spec/dummy_app/tmp/cache/assets/D12/F60/sprockets%2F6ac89a4a48bf0e3bb6364925661da565 +0 -0
  403. data/spec/dummy_app/tmp/cache/assets/D15/3D0/sprockets%2F7ef98ea43116410c4c50ffff444428c8 +1376 -0
  404. data/spec/dummy_app/tmp/cache/assets/D17/9B0/sprockets%2F3154059ed98209719dc1a7c493cb0fff +381 -0
  405. data/spec/dummy_app/tmp/cache/assets/D20/9E0/sprockets%2F9e5560466ce41eac747392c97eef4c51 +0 -0
  406. data/spec/dummy_app/tmp/cache/assets/D24/B30/sprockets%2F69d62273002dffc74f5368f55dfb97f3 +0 -0
  407. data/spec/dummy_app/tmp/cache/assets/D2D/840/sprockets%2F6f3b681ef8ba260acc705e3b262425a0 +0 -0
  408. data/spec/dummy_app/tmp/cache/assets/D2F/7C0/sprockets%2F99f6619fe89012fb9908a47ebb9b92a8 +7 -0
  409. data/spec/dummy_app/tmp/cache/assets/D2F/D60/sprockets%2Fa0cb0b3d7d775c4707c42a58fb0d2615 +9409 -0
  410. data/spec/dummy_app/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  411. data/spec/dummy_app/tmp/cache/assets/D3A/260/sprockets%2F35a5b51d1927651a39e3edca8c483dd1 +0 -0
  412. data/spec/dummy_app/tmp/cache/assets/D3B/F80/sprockets%2F304efb1d2d219915606f3fd96b3bf5c2 +9409 -0
  413. data/spec/dummy_app/tmp/cache/assets/D3C/7C0/sprockets%2F6a50cb4a5d265838f510fc8e6178bae1 +0 -0
  414. data/spec/dummy_app/tmp/cache/assets/D3D/0A0/sprockets%2Fa92066280edcd6b188dc38e35361dd3b +0 -0
  415. data/spec/dummy_app/tmp/cache/assets/D40/9B0/sprockets%2F704cfd791b468a6fba4fb820ec128941 +237 -0
  416. data/spec/dummy_app/tmp/cache/assets/D40/E10/sprockets%2F97d56619e64ca8c9c514a3aa2a4b339c +0 -0
  417. data/spec/dummy_app/tmp/cache/assets/D42/1F0/sprockets%2Fcaf59e1c6d22bae908a06e476b752791 +0 -0
  418. data/spec/dummy_app/tmp/cache/assets/D43/E30/sprockets%2Fece324b9d4dc935a92333fd0149bf773 +0 -0
  419. data/spec/dummy_app/tmp/cache/assets/D47/520/sprockets%2Ff142cf9478904f9e3ebb31ecc8c50913 +0 -0
  420. data/spec/dummy_app/tmp/cache/assets/D4B/390/sprockets%2Feb90dbdd2a6275f48086881f7b74ee32 +0 -0
  421. data/spec/dummy_app/tmp/cache/assets/D4B/6D0/sprockets%2F760ec9c344d334cfe919a55cf7f6a165 +0 -0
  422. data/spec/dummy_app/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  423. data/spec/dummy_app/tmp/cache/assets/D53/5C0/sprockets%2Fa93098db097c86d1e33dc86dece09991 +1092 -0
  424. data/spec/dummy_app/tmp/cache/assets/D56/F00/sprockets%2F48f6039e6745b557cbe83957abc8df2d +303 -0
  425. data/spec/dummy_app/tmp/cache/assets/D58/940/sprockets%2F0c3d05522ea3be49ba23372222fdcde7 +328 -0
  426. data/spec/dummy_app/tmp/cache/assets/D58/950/sprockets%2F6ade11e1b9d3ac4736b05aaf039c0804 +0 -0
  427. data/spec/dummy_app/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  428. data/spec/dummy_app/tmp/cache/assets/D5C/D10/sprockets%2F3fddf4c16115fad562082a5d4f1bd520 +0 -0
  429. data/spec/dummy_app/tmp/cache/assets/D5D/950/sprockets%2F9ed4c3b788618998fefb569a0a58da80 +0 -0
  430. data/spec/dummy_app/tmp/cache/assets/D5F/F30/sprockets%2Fc93672decbf5fb650336d1a67001fba0 +547 -0
  431. data/spec/dummy_app/tmp/cache/assets/D62/4A0/sprockets%2F47b7cb361e1f2e2ce081ea52fe32f640 +0 -0
  432. data/spec/dummy_app/tmp/cache/assets/D65/140/sprockets%2F5cc4a9317d68e31bb0c5b8d3f517a0e4 +0 -0
  433. data/spec/dummy_app/tmp/cache/assets/D6C/170/sprockets%2Fdc1a668e0c34eb1206fc67cf526249cf +0 -0
  434. data/spec/dummy_app/tmp/cache/assets/D71/9B0/sprockets%2Fc98bb1ca9b745d615b0f2f0d963c44d8 +5 -0
  435. data/spec/dummy_app/tmp/cache/assets/D74/020/sprockets%2Fd99999af4693dfa5998fdaf5b68276e6 +0 -0
  436. data/spec/dummy_app/tmp/cache/assets/D74/050/sprockets%2Fab9217b6ce5c3c8969791adc819b2a2b +0 -0
  437. data/spec/dummy_app/tmp/cache/assets/D7A/410/sprockets%2Fd1decdae4824f395df114687f262e78a +381 -0
  438. data/spec/dummy_app/tmp/cache/assets/D7C/630/sprockets%2Fff49f6b45a167453dabfa743e588dd16 +0 -0
  439. data/spec/dummy_app/tmp/cache/assets/D85/CC0/sprockets%2F09f7b34bbc050700a3bcbf6c6c5c1b45 +0 -0
  440. data/spec/dummy_app/tmp/cache/assets/D8F/DD0/sprockets%2F7bd51d74d575ec0bfad624acc81a6040 +0 -0
  441. data/spec/dummy_app/tmp/cache/assets/D93/C20/sprockets%2F2f48ab1ea8216fd918beb173c2a4f04d +0 -0
  442. data/spec/dummy_app/tmp/cache/assets/D9B/920/sprockets%2F4a02c68d7d2e9a072b8cdd5f715ab7c4 +26 -0
  443. data/spec/dummy_app/tmp/cache/assets/D9D/720/sprockets%2Fc7c311fcebe12a3cf86631a4a47f849f +490 -0
  444. data/spec/dummy_app/tmp/cache/assets/D9F/F20/sprockets%2F32f6c0bcea62f9ab09385db3217ee7e8 +0 -0
  445. data/spec/dummy_app/tmp/cache/assets/DA0/8A0/sprockets%2F9aff0ec8777da07337a51280eacd3f4e +768 -0
  446. data/spec/dummy_app/tmp/cache/assets/DA2/DB0/sprockets%2Fa6cfbef08a491ac3397e006bed885b38 +275 -0
  447. data/spec/dummy_app/tmp/cache/assets/DA4/010/sprockets%2F9663c5eebc07fdb49dd221cf84804c6b +0 -0
  448. data/spec/dummy_app/tmp/cache/assets/DA5/FE0/sprockets%2Fc5d487522471a6ab39cac1bf8e7e9b9b +0 -0
  449. data/spec/dummy_app/tmp/cache/assets/DA6/0A0/sprockets%2Fae11a6ff426fe2d094a5cde67159f94d +0 -0
  450. data/spec/dummy_app/tmp/cache/assets/DA9/170/sprockets%2F88a844719bb0fc081d9cfafc0e76ca96 +0 -0
  451. data/spec/dummy_app/tmp/cache/assets/DC2/720/sprockets%2F6a32e6f352ddd183d19dcac10cfc456b +0 -0
  452. data/spec/dummy_app/tmp/cache/assets/DCA/070/sprockets%2F8ec1ae13cf7ba342507cbb8f877a6dd1 +768 -0
  453. data/spec/dummy_app/tmp/cache/assets/DCB/120/sprockets%2Fc29be206ce74d90a4ad1f9a3d9d20f7d +0 -0
  454. data/spec/dummy_app/tmp/cache/assets/DD6/9B0/sprockets%2Fb92fb5cec0493bfdbe8248cd5673f71b +0 -0
  455. data/spec/dummy_app/tmp/cache/assets/DD7/5C0/sprockets%2Fe0912ed75a6ed23afdf293deed66871c +1376 -0
  456. data/spec/dummy_app/tmp/cache/assets/DD8/110/sprockets%2F8dfc7ac2667a017ee469f4cd443cfa8c +0 -0
  457. data/spec/dummy_app/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +21 -0
  458. data/spec/dummy_app/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +21 -0
  459. data/spec/dummy_app/tmp/cache/assets/E05/140/sprockets%2F41bf6f07f45b76cd2eef60ed2ffbb908 +0 -0
  460. data/spec/dummy_app/tmp/cache/assets/E09/FE0/sprockets%2Fc5df928b0e066c9e19ee3f2be8f6dbd0 +0 -0
  461. data/spec/dummy_app/tmp/cache/assets/E30/BF0/sprockets%2Fd35aca629e1763dd5a9deeb6caa78b6c +285 -0
  462. data/spec/dummy_app/tmp/cache/assets/E42/8C0/sprockets%2Faff1c93e2a43b887cbdebf8f9df9087b +0 -0
  463. data/spec/dummy_app/tmp/cache/assets/E61/F10/sprockets%2Fe616dbbacda8602fc9c589aefaf4c34f +1833 -0
  464. data/spec/dummy_app/tmp/cache/assets/E87/8F0/sprockets%2Ff90a7f08fcd06d0faf133fed3edbfa6a +0 -0
  465. data/spec/dummy_app/tmp/cache/sass/0591c977016a0bb372763f6f1cfb8002d44de3b2/mixins.css.scssc +0 -0
  466. data/spec/dummy_app/tmp/cache/sass/0591c977016a0bb372763f6f1cfb8002d44de3b2/theming.css.scssc +0 -0
  467. data/spec/dummy_app/tmp/cache/sass/0591c977016a0bb372763f6f1cfb8002d44de3b2/variables.css.scssc +0 -0
  468. data/spec/dummy_app/tmp/cache/sass/10238403c134661921596d094764445b02e815fe/mixins.css.scssc +0 -0
  469. data/spec/dummy_app/tmp/cache/sass/10238403c134661921596d094764445b02e815fe/theming.css.scssc +0 -0
  470. data/spec/dummy_app/tmp/cache/sass/10238403c134661921596d094764445b02e815fe/variables.css.scssc +0 -0
  471. data/spec/dummy_app/tmp/cache/sass/59e0a00e930df996e5ae01d3215f486bd084d24f/imports.css.scss.erbc +0 -0
  472. data/spec/dummy_app/tmp/cache/sass/59e0a00e930df996e5ae01d3215f486bd084d24f/jquery.colorpicker.css.scssc +0 -0
  473. data/spec/dummy_app/tmp/cache/sass/59e0a00e930df996e5ae01d3215f486bd084d24f/jquery.ui.timepicker.css.scssc +0 -0
  474. data/spec/dummy_app/tmp/cache/sass/59e0a00e930df996e5ae01d3215f486bd084d24f/ra.calendar-additions.css.scssc +0 -0
  475. data/spec/dummy_app/tmp/cache/sass/59e0a00e930df996e5ae01d3215f486bd084d24f/ra.filtering-multiselect.css.scssc +0 -0
  476. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_accordion.scssc +0 -0
  477. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_alerts.scssc +0 -0
  478. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_breadcrumbs.scssc +0 -0
  479. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_button-groups.scssc +0 -0
  480. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_buttons.scssc +0 -0
  481. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_carousel.scssc +0 -0
  482. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_close.scssc +0 -0
  483. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_code.scssc +0 -0
  484. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_component-animations.scssc +0 -0
  485. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_dropdowns.scssc +0 -0
  486. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_forms.scssc +0 -0
  487. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_grid.scssc +0 -0
  488. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_hero-unit.scssc +0 -0
  489. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_labels.scssc +0 -0
  490. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_layouts.scssc +0 -0
  491. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_mixins.scssc +0 -0
  492. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_modals.scssc +0 -0
  493. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_navbar.scssc +0 -0
  494. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_navs.scssc +0 -0
  495. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_pager.scssc +0 -0
  496. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_pagination.scssc +0 -0
  497. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_popovers.scssc +0 -0
  498. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_progress-bars.scssc +0 -0
  499. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_reset.scssc +0 -0
  500. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_scaffolding.scssc +0 -0
  501. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_sprites.scssc +0 -0
  502. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_tables.scssc +0 -0
  503. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_thumbnails.scssc +0 -0
  504. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_tooltip.scssc +0 -0
  505. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_type.scssc +0 -0
  506. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_utilities.scssc +0 -0
  507. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_variables.scssc +0 -0
  508. data/spec/dummy_app/tmp/cache/sass/e49dad041ec24255ebe09b15ccd7ea91f1ab56bd/_wells.scssc +0 -0
  509. data/spec/dummy_app/tmp/cache/sass/ea17b334a44bfc0f3681b2e3e4202c941da9ee82/jquery-ui-1.8.7.custom.css.scssc +0 -0
  510. data/spec/dummy_app/tmp/cache/sass/fb68f840f6ad0344d3dcaecafd4b6ac4e35ca8fe/mixins.css.scssc +0 -0
  511. data/spec/dummy_app/tmp/cache/sass/fb68f840f6ad0344d3dcaecafd4b6ac4e35ca8fe/theming.css.scssc +0 -0
  512. data/spec/dummy_app/tmp/cache/sass/fb68f840f6ad0344d3dcaecafd4b6ac4e35ca8fe/variables.css.scssc +0 -0
  513. data/spec/dummy_app/tmp/dragonfly/cache/body/67/c49ea211b51fee9c0ccde26af73f27446aa071 +1 -0
  514. data/spec/dummy_app/tmp/dragonfly/cache/body/da/39a3ee5e6b4b0d3255bfef95601890afd80709 +0 -0
  515. data/spec/dummy_app/tmp/dragonfly/cache/body/e7/536a0250f5395f318c24bee30dbbb0a2a28714 +24 -0
  516. data/spec/dummy_app/tmp/dragonfly/cache/body/f0/76846cb5891d588ad63ea7f6451e26b4f48c3d +19 -0
  517. data/spec/dummy_app/tmp/dragonfly/cache/meta/26/1464d915347774c08b1ddf6d305783e3acfadb +0 -0
  518. data/spec/dummy_app/tmp/dragonfly/cache/meta/7f/29e62b90d2b255e74d7e1a8ee8ed509c3f0406 +0 -0
  519. data/spec/dummy_app/tmp/dragonfly/cache/meta/c1/0f5c4fe64b3d3cffe2793ad7a8e51aeb4f3eec +0 -0
  520. data/spec/dummy_app/tmp/dragonfly/cache/meta/fe/97fd48b64023fee9cc7d8a12f0f1e9097058da +0 -0
  521. data/spec/factories.rb +71 -0
  522. data/spec/helpers/application_helper_spec.rb +277 -0
  523. data/spec/integration/authorization/cancan_spec.rb +358 -0
  524. data/spec/integration/basic/bulk_action/rails_admin_basic_bulk_action_spec.rb +25 -0
  525. data/spec/integration/basic/bulk_destroy/rails_admin_basic_bulk_destroy_spec.rb +42 -0
  526. data/spec/integration/basic/create/rails_admin_basic_create_spec.rb +141 -0
  527. data/spec/integration/basic/create/rails_admin_namespaced_model_create_spec.rb +23 -0
  528. data/spec/integration/basic/delete/rails_admin_basic_delete_spec.rb +27 -0
  529. data/spec/integration/basic/destroy/rails_admin_basic_destroy_spec.rb +56 -0
  530. data/spec/integration/basic/edit/rails_admin_basic_edit_spec.rb +109 -0
  531. data/spec/integration/basic/export/rails_admin_basic_export_spec.rb +106 -0
  532. data/spec/integration/basic/list/rails_admin_basic_list_spec.rb +400 -0
  533. data/spec/integration/basic/new/rails_admin_basic_new_spec.rb +74 -0
  534. data/spec/integration/basic/new/rails_admin_namespaced_model_new_spec.rb +31 -0
  535. data/spec/integration/basic/show/rails_admin_basic_show_spec.rb +91 -0
  536. data/spec/integration/basic/update/rails_admin_basic_update_spec.rb +223 -0
  537. data/spec/integration/config/edit/rails_admin_config_edit_spec.rb +1043 -0
  538. data/spec/integration/config/list/rails_admin_config_list_spec.rb +521 -0
  539. data/spec/integration/config/show/rails_admin_config_show_spec.rb +312 -0
  540. data/spec/integration/history/rails_admin_history_spec.rb +65 -0
  541. data/spec/integration/rails_admin_spec.rb +113 -0
  542. data/spec/integration/relation_spec.rb +35 -0
  543. data/spec/orm/active_record.rb +42 -0
  544. data/spec/orm/mongoid.rb +19 -0
  545. data/spec/spec_helper.rb +79 -0
  546. data/spec/unit/abstract_model_spec.rb +45 -0
  547. data/spec/unit/adapters/active_record/abstract_object_spec.rb +132 -0
  548. data/spec/unit/adapters/active_record_spec.rb +373 -0
  549. data/spec/unit/adapters/mongoid/abstract_object_spec.rb +31 -0
  550. data/spec/unit/adapters/mongoid_spec.rb +686 -0
  551. data/spec/unit/config/actions_spec.rb +181 -0
  552. data/spec/unit/config/fields/base_spec.rb +339 -0
  553. data/spec/unit/config/model_spec.rb +75 -0
  554. data/spec/unit/config/sections_spec.rb +123 -0
  555. data/spec/unit/config_spec.rb +278 -0
  556. metadata +1317 -0
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1 @@
1
+ {: nameI"Pensive Parakeet.jpg:ET:model_classI"FieldTest;F:model_attachment:dragonfly_asset
@@ -0,0 +1 @@
1
+ {: nameI"Costa Rican Frog.jpg:ET:model_classI"FieldTest;F:model_attachment:dragonfly_asset
@@ -0,0 +1,148 @@
1
+ %PDF-1.4
2
+ 1 0 obj
3
+ <<
4
+ /Pages 2 0 R
5
+ /Type /Catalog
6
+ >>
7
+ endobj
8
+ 2 0 obj
9
+ <<
10
+ /Type /Pages
11
+ /Kids [ 3 0 R ]
12
+ /Count 1
13
+ >>
14
+ endobj
15
+ 3 0 obj
16
+ <<
17
+ /Type /Page
18
+ /Parent 2 0 R
19
+ /Resources <<
20
+ /XObject << /Im0 8 0 R >>
21
+ /ProcSet 6 0 R >>
22
+ /MediaBox [0 0 71 100]
23
+ /CropBox [0 0 71 100]
24
+ /Contents 4 0 R
25
+ /Thumb 11 0 R
26
+ >>
27
+ endobj
28
+ 4 0 obj
29
+ <<
30
+ /Length 5 0 R
31
+ >>
32
+ stream
33
+ q
34
+ 71 0 0 100 0 0 cm
35
+ /Im0 Do
36
+ Q
37
+ endstream
38
+ endobj
39
+ 5 0 obj
40
+ 30
41
+ endobj
42
+ 6 0 obj
43
+ [ /PDF /Text /ImageC ]
44
+ endobj
45
+ 7 0 obj
46
+ <<
47
+ >>
48
+ endobj
49
+ 8 0 obj
50
+ <<
51
+ /Type /XObject
52
+ /Subtype /Image
53
+ /Name /Im0
54
+ /Filter [ /RunLengthDecode ]
55
+ /Width 71
56
+ /Height 100
57
+ /ColorSpace 10 0 R
58
+ /BitsPerComponent 8
59
+ /SMask 15 0 R
60
+ /Length 9 0 R
61
+ >>
62
+ stream
63
+ ~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~������������������������������������������������������������������������������������������������������������������������������~������������������������������������������������������������������������������������������������������������������������������~�������������������}��j�舞���������������������������������������������������������������������������������������������������~������������������������������������������������������������������������������������������������������v��Cm�Qw�\��_������������~�������������������������������������������������������������������������������������������������������������������������������~����������������������������������������������������������������p��_��i�驵����������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~���������������������������䱻��������䳼�������䳽嶿�������������������������䵾岼屻����������������������嶿�~����������������������������������������������������������������������������������������������������������Rv�Sw�v��r��`��j��o�~�Os�?f�?f�?g�>f�>f�?g�?g�?g�?f�?g�?g�?f�?g�?g�?f�>f�=e�?f�?g�?g�=e�?g�?g�=f�>f�?g�?g�?g�?g�?g�>f�?f�>f�>f�?f�>f�>f�=e�?f�>f�?g�~>f�>f�>f�>f�>f�>f�>f�>f�>f�>f�>f�>f�>f�>f�>f�?g������������������u��y�ኝ㋞��䊟莢�{��j��i��i��i��i��i��i��i��i��i��i��i��i~��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�~�i��h��������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~������������������������������������������������������������������������������������������������������������������������������� �����������������������������������W������������������������������������������������������������������������������������������$���������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������������������� ��������������]������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������l����������������������������������������������������������������������������������������������������������������������������������۰�~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������+���������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������=�������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~���������������������������������������������������������������������������������������������������������������������������㴽�~Kq�El�c��c��f��e��j��Sw�^��Pu�[}�p��l��h��m��g��f��?h�-Y�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.~Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�0\�����������������⏠���ߚ�������ᘧ���ᔤ���������ࢯ᢯៭~ᡮ៭ᛪᇚ��ހ�����ހ���ހ����~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~~��~��~��~��~��~��~��~��}������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~��������������������������������������������������������������������������������������������������׶�ڻ�ٷ���������������������P�����������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�پ�پ�ٰ�ڳ����������������ض�ڽ����پ����������������������������������������������������������������������������������������~���������������������������������������������ؿ����ظ�ڹ����������ٺ�ڲ����ٻ�ٻ�������پ�������ټ�������������������ط����ؼ��~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�����ز�ڳ����پ�������������ط�ڹ�ں����������������٬������������������������������������������������������������������������~�������������������������������������������������������������׻�ٷ�ڵ�ڼ�پ����������������ٶ�������پ�������ؿ�������ؾ�������~������������׾�������ٮ��������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������"��������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~������������������������������׽����ٽ�ٲ�ڼ�������������ؿ�ٿ����ؾ�������ٷ�������������ؽ����ؽ�������ع�ڹ�ڶ�������ؼ�پ��~�����������س�ڲ�ں�������������������ػ����ؽ�������ٹ�������ؽ�ٸ�ڱ�ڽ������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~������������������������������������������������������������������������������������������������������������������������������~����������������������������������������������������������������������������������������������������������������~���������������������������㪶�9d�0\�Ms�Vz�^��[~�Z}�c��n��\�Ip�X|�^��[~�]�e��]��Gn�X|�Jp�Sx�Em�_��d��\�`��_��W{�Ot�Rw�~Ho�Kq�Kr�Uy�Rw�W{�Jq�[~�Pu�Y}�X|�Ip�_��_��b��Pu�J�G�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�I箹��������������������~�������������������������������������������������������������������������������������������������������������������������������~������������������������������������������������������������ݿ�����������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������9�������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������,�����������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~����������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�����������������������������������������������������������������������������������������������������������������������������������������������������������������
64
+ endstream
65
+ endobj
66
+ 9 0 obj
67
+ 20775
68
+ endobj
69
+ 10 0 obj
70
+ /DeviceRGB
71
+ endobj
72
+ 11 0 obj
73
+ <<
74
+ /Filter [ /RunLengthDecode ]
75
+ /Width 71
76
+ /Height 100
77
+ /ColorSpace 10 0 R
78
+ /BitsPerComponent 8
79
+ /Length 12 0 R
80
+ >>
81
+ stream
82
+ ~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~������������������������������������������������������������������������������������������������������������������������������~������������������������������������������������������������������������������������������������������������������������������~�������������������}��j�舞���������������������������������������������������������������������������������������������������~������������������������������������������������������������������������������������������������������v��Cm�Qw�\��_������������~�������������������������������������������������������������������������������������������������������������������������������~����������������������������������������������������������������p��_��i�驵����������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~���������������������������䱻��������䳼�������䳽嶿�������������������������䵾岼屻����������������������嶿�~����������������������������������������������������������������������������������������������������������Rv�Sw�v��r��`��j��o�~�Os�?f�?f�?g�>f�>f�?g�?g�?g�?f�?g�?g�?f�?g�?g�?f�>f�=e�?f�?g�?g�=e�?g�?g�=f�>f�?g�?g�?g�?g�?g�>f�?f�>f�>f�?f�>f�>f�=e�?f�>f�?g�~>f�>f�>f�>f�>f�>f�>f�>f�>f�>f�>f�>f�>f�>f�>f�?g������������������u��y�ኝ㋞��䊟莢�{��j��i��i��i��i��i��i��i��i��i��i��i��i~��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�~�i��h��������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~������������������������������������������������������������������������������������������������������������������������������� �����������������������������������W������������������������������������������������������������������������������������������$���������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������������������� ��������������]������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������l����������������������������������������������������������������������������������������������������������������������������������۰�~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������+���������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������=�������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~���������������������������������������������������������������������������������������������������������������������������㴽�~Kq�El�c��c��f��e��j��Sw�^��Pu�[}�p��l��h��m��g��f��?h�-Y�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.~Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�.Z�0\�����������������⏠���ߚ�������ᘧ���ᔤ���������ࢯ᢯៭~ᡮ៭ᛪᇚ��ހ�����ހ���ހ����~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~��~~��~��~��~��~��~��~��~��}������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~��������������������������������������������������������������������������������������������������׶�ڻ�ٷ���������������������P�����������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�پ�پ�ٰ�ڳ����������������ض�ڽ����پ����������������������������������������������������������������������������������������~���������������������������������������������ؿ����ظ�ڹ����������ٺ�ڲ����ٻ�ٻ�������پ�������ټ�������������������ط����ؼ��~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�����ز�ڳ����پ�������������ط�ڹ�ں����������������٬������������������������������������������������������������������������~�������������������������������������������������������������׻�ٷ�ڵ�ڼ�پ����������������ٶ�������پ�������ؿ�������ؾ�������~������������׾�������ٮ��������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������"��������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~������������������������������׽����ٽ�ٲ�ڼ�������������ؿ�ٿ����ؾ�������ٷ�������������ؽ����ؽ�������ع�ڹ�ڶ�������ؼ�پ��~�����������س�ڲ�ں�������������������ػ����ؽ�������ٹ�������ؽ�ٸ�ڱ�ڽ������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~������������������������������������������������������������������������������������������������������������������������������~����������������������������������������������������������������������������������������������������������������~���������������������������㪶�9d�0\�Ms�Vz�^��[~�Z}�c��n��\�Ip�X|�^��[~�]�e��]��Gn�X|�Jp�Sx�Em�_��d��\�`��_��W{�Ot�Rw�~Ho�Kq�Kr�Uy�Rw�W{�Jq�[~�Pu�Y}�X|�Ip�_��_��b��Pu�J�G�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�I箹��������������������~�������������������������������������������������������������������������������������������������������������������������������~������������������������������������������������������������ݿ�����������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������9�������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������,�����������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~����������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�������������������������������������������������������������������������������������������������������������������������������~�����������������������������������������������������������������������������������������������������������������������������������������������������������������
83
+ endstream
84
+ endobj
85
+ 12 0 obj
86
+ 20775
87
+ endobj
88
+ 13 0 obj
89
+ endobj
90
+ 14 0 obj
91
+ 20775
92
+ endobj
93
+ 15 0 obj
94
+ <<
95
+ /Type /XObject
96
+ /Subtype /Image
97
+ /Name /Ma0
98
+ /Filter [ /RunLengthDecode ]
99
+ /Width 71
100
+ /Height 100
101
+ /ColorSpace /DeviceGray
102
+ /BitsPerComponent 8
103
+ /Length 16 0 R
104
+ >>
105
+ stream
106
+ �����������������������������������������������������������������������������������������������������������������
107
+ endstream
108
+ endobj
109
+ 16 0 obj
110
+ 113
111
+ endobj
112
+ 17 0 obj
113
+ <<
114
+ /Title (stream20111125-77314-rem7u820111125-77314-vynn24)
115
+ /CreationDate (D:20111125111100)
116
+ /ModDate (D:20111125111100)
117
+ /Producer (ImageMagick 6.7.1-1 2011-07-29 Q16 http://www.imagemagick.org)
118
+ >>
119
+ endobj
120
+ xref
121
+ 0 18
122
+ 0000000000 65535 f
123
+ 0000000010 00000 n
124
+ 0000000059 00000 n
125
+ 0000000118 00000 n
126
+ 0000000298 00000 n
127
+ 0000000380 00000 n
128
+ 0000000398 00000 n
129
+ 0000000436 00000 n
130
+ 0000000457 00000 n
131
+ 0000021431 00000 n
132
+ 0000021452 00000 n
133
+ 0000021479 00000 n
134
+ 0000042399 00000 n
135
+ 0000042421 00000 n
136
+ 0000042437 00000 n
137
+ 0000042459 00000 n
138
+ 0000042764 00000 n
139
+ 0000042784 00000 n
140
+ trailer
141
+ <<
142
+ /Size 18
143
+ /Info 17 0 R
144
+ /Root 1 0 R
145
+ >>
146
+ startxref
147
+ 42999
148
+ %%EOF
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,1833 @@
1
+ o: ActiveSupport::Cache::Entry :@expires_in0:@compressedF: @value"�/{"content_type"application/javascript"
2
+ class"ProcessedAsset"dependency_digest"%48c43e670200428629269c31ae439fd0"
3
+ mtime"2012-04-20T18:49:51-05:00"
4
+ mtime"2012-04-20T18:49:51-05:00" digest"%dea6588c6972886e1519b74b14ee79b5" path"h/Library/Ruby/Gems/1.8/gems/jquery-ui-rails-0.2.2/vendor/assets/javascripts/jquery.ui.datepicker.js{@"2012-04-28T19:31:29-05:00@"%33830d8b45ce2f9b31ccd9bdf5f3fc6e@"W/Library/Ruby/Gems/1.8/gems/jquery-rails-2.0.2/vendor/assets/javascripts/jquery.js{@"2012-04-20T18:49:51-05:00@"%7672653a2f5e4eab1758536a65296684@"b/Library/Ruby/Gems/1.8/gems/jquery-ui-rails-0.2.2/vendor/assets/javascripts/jquery.ui.core.js" digest"%2b326ac7516d93124e8fbb37d4041545"required_paths["W/Library/Ruby/Gems/1.8/gems/jquery-rails-2.0.2/vendor/assets/javascripts/jquery.js"b/Library/Ruby/Gems/1.8/gems/jquery-ui-rails-0.2.2/vendor/assets/javascripts/jquery.ui.core.js"h/Library/Ruby/Gems/1.8/gems/jquery-ui-rails-0.2.2/vendor/assets/javascripts/jquery.ui.datepicker.js"
5
+
6
+ /*!
7
+ * jQuery UI Datepicker 1.8.18
8
+ *
9
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
10
+ * Dual licensed under the MIT or GPL Version 2 licenses.
11
+ * http://jquery.org/license
12
+ *
13
+ * http://docs.jquery.com/UI/Datepicker
14
+ *
15
+ * Depends:
16
+ * jquery.ui.core.js
17
+ */
18
+
19
+ (function( $, undefined ) {
20
+
21
+ $.extend($.ui, { datepicker: { version: "1.8.18" } });
22
+
23
+ var PROP_NAME = 'datepicker';
24
+ var dpuuid = new Date().getTime();
25
+ var instActive;
26
+
27
+ /* Date picker manager.
28
+ Use the singleton instance of this class, $.datepicker, to interact with the date picker.
29
+ Settings for (groups of) date pickers are maintained in an instance object,
30
+ allowing multiple different settings on the same page. */
31
+
32
+ function Datepicker() {
33
+ this.debug = false; // Change this to true to start debugging
34
+ this._curInst = null; // The current instance in use
35
+ this._keyEvent = false; // If the last event was a key event
36
+ this._disabledInputs = []; // List of date picker inputs that have been disabled
37
+ this._datepickerShowing = false; // True if the popup picker is showing , false if not
38
+ this._inDialog = false; // True if showing within a "dialog", false if not
39
+ this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division
40
+ this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class
41
+ this._appendClass = 'ui-datepicker-append'; // The name of the append marker class
42
+ this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class
43
+ this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class
44
+ this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class
45
+ this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class
46
+ this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class
47
+ this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class
48
+ this.regional = []; // Available regional settings, indexed by language code
49
+ this.regional[''] = { // Default regional settings
50
+ closeText: 'Done', // Display text for close link
51
+ prevText: 'Prev', // Display text for previous month link
52
+ nextText: 'Next', // Display text for next month link
53
+ currentText: 'Today', // Display text for current month link
54
+ monthNames: ['January','February','March','April','May','June',
55
+ 'July','August','September','October','November','December'], // Names of months for drop-down and formatting
56
+ monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting
57
+ dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting
58
+ dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
59
+ dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
60
+ weekHeader: 'Wk', // Column header for week of the year
61
+ dateFormat: 'mm/dd/yy', // See format options on parseDate
62
+ firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
63
+ isRTL: false, // True if right-to-left language, false if left-to-right
64
+ showMonthAfterYear: false, // True if the year select precedes month, false for month then year
65
+ yearSuffix: '' // Additional text to append to the year in the month headers
66
+ };
67
+ this._defaults = { // Global defaults for all the date picker instances
68
+ showOn: 'focus', // 'focus' for popup on focus,
69
+ // 'button' for trigger button, or 'both' for either
70
+ showAnim: 'fadeIn', // Name of jQuery animation for popup
71
+ showOptions: {}, // Options for enhanced animations
72
+ defaultDate: null, // Used when field is blank: actual date,
73
+ // +/-number for offset from today, null for today
74
+ appendText: '', // Display text following the input box, e.g. showing the format
75
+ buttonText: '...', // Text for trigger button
76
+ buttonImage: '', // URL for trigger button image
77
+ buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
78
+ hideIfNoPrevNext: false, // True to hide next/previous month links
79
+ // if not applicable, false to just disable them
80
+ navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
81
+ gotoCurrent: false, // True if today link goes back to current selection instead
82
+ changeMonth: false, // True if month can be selected directly, false if only prev/next
83
+ changeYear: false, // True if year can be selected directly, false if only prev/next
84
+ yearRange: 'c-10:c+10', // Range of years to display in drop-down,
85
+ // either relative to today's year (-nn:+nn), relative to currently displayed year
86
+ // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
87
+ showOtherMonths: false, // True to show dates in other months, false to leave blank
88
+ selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
89
+ showWeek: false, // True to show week of the year, false to not show it
90
+ calculateWeek: this.iso8601Week, // How to calculate the week of the year,
91
+ // takes a Date and returns the number of the week for it
92
+ shortYearCutoff: '+10', // Short year values < this are in the current century,
93
+ // > this are in the previous century,
94
+ // string value starting with '+' for current year + value
95
+ minDate: null, // The earliest selectable date, or null for no limit
96
+ maxDate: null, // The latest selectable date, or null for no limit
97
+ duration: 'fast', // Duration of display/closure
98
+ beforeShowDay: null, // Function that takes a date and returns an array with
99
+ // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
100
+ // [2] = cell title (optional), e.g. $.datepicker.noWeekends
101
+ beforeShow: null, // Function that takes an input field and
102
+ // returns a set of custom settings for the date picker
103
+ onSelect: null, // Define a callback function when a date is selected
104
+ onChangeMonthYear: null, // Define a callback function when the month or year is changed
105
+ onClose: null, // Define a callback function when the datepicker is closed
106
+ numberOfMonths: 1, // Number of months to show at a time
107
+ showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
108
+ stepMonths: 1, // Number of months to step back/forward
109
+ stepBigMonths: 12, // Number of months to step back/forward for the big links
110
+ altField: '', // Selector for an alternate field to store selected dates into
111
+ altFormat: '', // The date format to use for the alternate field
112
+ constrainInput: true, // The input is constrained by the current date format
113
+ showButtonPanel: false, // True to show button panel, false to not show it
114
+ autoSize: false, // True to size the input for the date format, false to leave as is
115
+ disabled: false // The initial disabled state
116
+ };
117
+ $.extend(this._defaults, this.regional['']);
118
+ this.dpDiv = bindHover($('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'));
119
+ }
120
+
121
+ $.extend(Datepicker.prototype, {
122
+ /* Class name added to elements to indicate already configured with a date picker. */
123
+ markerClassName: 'hasDatepicker',
124
+
125
+ //Keep track of the maximum number of rows displayed (see #7043)
126
+ maxRows: 4,
127
+
128
+ /* Debug logging (if enabled). */
129
+ log: function () {
130
+ if (this.debug)
131
+ console.log.apply('', arguments);
132
+ },
133
+
134
+ // TODO rename to "widget" when switching to widget factory
135
+ _widgetDatepicker: function() {
136
+ return this.dpDiv;
137
+ },
138
+
139
+ /* Override the default settings for all instances of the date picker.
140
+ @param settings object - the new settings to use as defaults (anonymous object)
141
+ @return the manager object */
142
+ setDefaults: function(settings) {
143
+ extendRemove(this._defaults, settings || {});
144
+ return this;
145
+ },
146
+
147
+ /* Attach the date picker to a jQuery selection.
148
+ @param target element - the target input field or division or span
149
+ @param settings object - the new settings to use for this date picker instance (anonymous) */
150
+ _attachDatepicker: function(target, settings) {
151
+ // check for settings on the control itself - in namespace 'date:'
152
+ var inlineSettings = null;
153
+ for (var attrName in this._defaults) {
154
+ var attrValue = target.getAttribute('date:' + attrName);
155
+ if (attrValue) {
156
+ inlineSettings = inlineSettings || {};
157
+ try {
158
+ inlineSettings[attrName] = eval(attrValue);
159
+ } catch (err) {
160
+ inlineSettings[attrName] = attrValue;
161
+ }
162
+ }
163
+ }
164
+ var nodeName = target.nodeName.toLowerCase();
165
+ var inline = (nodeName == 'div' || nodeName == 'span');
166
+ if (!target.id) {
167
+ this.uuid += 1;
168
+ target.id = 'dp' + this.uuid;
169
+ }
170
+ var inst = this._newInst($(target), inline);
171
+ inst.settings = $.extend({}, settings || {}, inlineSettings || {});
172
+ if (nodeName == 'input') {
173
+ this._connectDatepicker(target, inst);
174
+ } else if (inline) {
175
+ this._inlineDatepicker(target, inst);
176
+ }
177
+ },
178
+
179
+ /* Create a new instance object. */
180
+ _newInst: function(target, inline) {
181
+ var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1'); // escape jQuery meta chars
182
+ return {id: id, input: target, // associated target
183
+ selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
184
+ drawMonth: 0, drawYear: 0, // month being drawn
185
+ inline: inline, // is datepicker inline or not
186
+ dpDiv: (!inline ? this.dpDiv : // presentation div
187
+ bindHover($('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')))};
188
+ },
189
+
190
+ /* Attach the date picker to an input field. */
191
+ _connectDatepicker: function(target, inst) {
192
+ var input = $(target);
193
+ inst.append = $([]);
194
+ inst.trigger = $([]);
195
+ if (input.hasClass(this.markerClassName))
196
+ return;
197
+ this._attachments(input, inst);
198
+ input.addClass(this.markerClassName).keydown(this._doKeyDown).
199
+ keypress(this._doKeyPress).keyup(this._doKeyUp).
200
+ bind("setData.datepicker", function(event, key, value) {
201
+ inst.settings[key] = value;
202
+ }).bind("getData.datepicker", function(event, key) {
203
+ return this._get(inst, key);
204
+ });
205
+ this._autoSize(inst);
206
+ $.data(target, PROP_NAME, inst);
207
+ //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
208
+ if( inst.settings.disabled ) {
209
+ this._disableDatepicker( target );
210
+ }
211
+ },
212
+
213
+ /* Make attachments based on settings. */
214
+ _attachments: function(input, inst) {
215
+ var appendText = this._get(inst, 'appendText');
216
+ var isRTL = this._get(inst, 'isRTL');
217
+ if (inst.append)
218
+ inst.append.remove();
219
+ if (appendText) {
220
+ inst.append = $('<span class="' + this._appendClass + '">' + appendText + '</span>');
221
+ input[isRTL ? 'before' : 'after'](inst.append);
222
+ }
223
+ input.unbind('focus', this._showDatepicker);
224
+ if (inst.trigger)
225
+ inst.trigger.remove();
226
+ var showOn = this._get(inst, 'showOn');
227
+ if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field
228
+ input.focus(this._showDatepicker);
229
+ if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked
230
+ var buttonText = this._get(inst, 'buttonText');
231
+ var buttonImage = this._get(inst, 'buttonImage');
232
+ inst.trigger = $(this._get(inst, 'buttonImageOnly') ?
233
+ $('<img/>').addClass(this._triggerClass).
234
+ attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
235
+ $('<button type="button"></button>').addClass(this._triggerClass).
236
+ html(buttonImage == '' ? buttonText : $('<img/>').attr(
237
+ { src:buttonImage, alt:buttonText, title:buttonText })));
238
+ input[isRTL ? 'before' : 'after'](inst.trigger);
239
+ inst.trigger.click(function() {
240
+ if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0])
241
+ $.datepicker._hideDatepicker();
242
+ else if ($.datepicker._datepickerShowing && $.datepicker._lastInput != input[0]) {
243
+ $.datepicker._hideDatepicker();
244
+ $.datepicker._showDatepicker(input[0]);
245
+ } else
246
+ $.datepicker._showDatepicker(input[0]);
247
+ return false;
248
+ });
249
+ }
250
+ },
251
+
252
+ /* Apply the maximum length for the date format. */
253
+ _autoSize: function(inst) {
254
+ if (this._get(inst, 'autoSize') && !inst.inline) {
255
+ var date = new Date(2009, 12 - 1, 20); // Ensure double digits
256
+ var dateFormat = this._get(inst, 'dateFormat');
257
+ if (dateFormat.match(/[DM]/)) {
258
+ var findMax = function(names) {
259
+ var max = 0;
260
+ var maxI = 0;
261
+ for (var i = 0; i < names.length; i++) {
262
+ if (names[i].length > max) {
263
+ max = names[i].length;
264
+ maxI = i;
265
+ }
266
+ }
267
+ return maxI;
268
+ };
269
+ date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
270
+ 'monthNames' : 'monthNamesShort'))));
271
+ date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
272
+ 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay());
273
+ }
274
+ inst.input.attr('size', this._formatDate(inst, date).length);
275
+ }
276
+ },
277
+
278
+ /* Attach an inline date picker to a div. */
279
+ _inlineDatepicker: function(target, inst) {
280
+ var divSpan = $(target);
281
+ if (divSpan.hasClass(this.markerClassName))
282
+ return;
283
+ divSpan.addClass(this.markerClassName).append(inst.dpDiv).
284
+ bind("setData.datepicker", function(event, key, value){
285
+ inst.settings[key] = value;
286
+ }).bind("getData.datepicker", function(event, key){
287
+ return this._get(inst, key);
288
+ });
289
+ $.data(target, PROP_NAME, inst);
290
+ this._setDate(inst, this._getDefaultDate(inst), true);
291
+ this._updateDatepicker(inst);
292
+ this._updateAlternate(inst);
293
+ //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
294
+ if( inst.settings.disabled ) {
295
+ this._disableDatepicker( target );
296
+ }
297
+ // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
298
+ // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
299
+ inst.dpDiv.css( "display", "block" );
300
+ },
301
+
302
+ /* Pop-up the date picker in a "dialog" box.
303
+ @param input element - ignored
304
+ @param date string or Date - the initial date to display
305
+ @param onSelect function - the function to call when a date is selected
306
+ @param settings object - update the dialog date picker instance's settings (anonymous object)
307
+ @param pos int[2] - coordinates for the dialog's position within the screen or
308
+ event - with x/y coordinates or
309
+ leave empty for default (screen centre)
310
+ @return the manager object */
311
+ _dialogDatepicker: function(input, date, onSelect, settings, pos) {
312
+ var inst = this._dialogInst; // internal instance
313
+ if (!inst) {
314
+ this.uuid += 1;
315
+ var id = 'dp' + this.uuid;
316
+ this._dialogInput = $('<input type="text" id="' + id +
317
+ '" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');
318
+ this._dialogInput.keydown(this._doKeyDown);
319
+ $('body').append(this._dialogInput);
320
+ inst = this._dialogInst = this._newInst(this._dialogInput, false);
321
+ inst.settings = {};
322
+ $.data(this._dialogInput[0], PROP_NAME, inst);
323
+ }
324
+ extendRemove(inst.settings, settings || {});
325
+ date = (date && date.constructor == Date ? this._formatDate(inst, date) : date);
326
+ this._dialogInput.val(date);
327
+
328
+ this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
329
+ if (!this._pos) {
330
+ var browserWidth = document.documentElement.clientWidth;
331
+ var browserHeight = document.documentElement.clientHeight;
332
+ var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
333
+ var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
334
+ this._pos = // should use actual width/height below
335
+ [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
336
+ }
337
+
338
+ // move input on screen for focus, but hidden behind dialog
339
+ this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px');
340
+ inst.settings.onSelect = onSelect;
341
+ this._inDialog = true;
342
+ this.dpDiv.addClass(this._dialogClass);
343
+ this._showDatepicker(this._dialogInput[0]);
344
+ if ($.blockUI)
345
+ $.blockUI(this.dpDiv);
346
+ $.data(this._dialogInput[0], PROP_NAME, inst);
347
+ return this;
348
+ },
349
+
350
+ /* Detach a datepicker from its control.
351
+ @param target element - the target input field or division or span */
352
+ _destroyDatepicker: function(target) {
353
+ var $target = $(target);
354
+ var inst = $.data(target, PROP_NAME);
355
+ if (!$target.hasClass(this.markerClassName)) {
356
+ return;
357
+ }
358
+ var nodeName = target.nodeName.toLowerCase();
359
+ $.removeData(target, PROP_NAME);
360
+ if (nodeName == 'input') {
361
+ inst.append.remove();
362
+ inst.trigger.remove();
363
+ $target.removeClass(this.markerClassName).
364
+ unbind('focus', this._showDatepicker).
365
+ unbind('keydown', this._doKeyDown).
366
+ unbind('keypress', this._doKeyPress).
367
+ unbind('keyup', this._doKeyUp);
368
+ } else if (nodeName == 'div' || nodeName == 'span')
369
+ $target.removeClass(this.markerClassName).empty();
370
+ },
371
+
372
+ /* Enable the date picker to a jQuery selection.
373
+ @param target element - the target input field or division or span */
374
+ _enableDatepicker: function(target) {
375
+ var $target = $(target);
376
+ var inst = $.data(target, PROP_NAME);
377
+ if (!$target.hasClass(this.markerClassName)) {
378
+ return;
379
+ }
380
+ var nodeName = target.nodeName.toLowerCase();
381
+ if (nodeName == 'input') {
382
+ target.disabled = false;
383
+ inst.trigger.filter('button').
384
+ each(function() { this.disabled = false; }).end().
385
+ filter('img').css({opacity: '1.0', cursor: ''});
386
+ }
387
+ else if (nodeName == 'div' || nodeName == 'span') {
388
+ var inline = $target.children('.' + this._inlineClass);
389
+ inline.children().removeClass('ui-state-disabled');
390
+ inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
391
+ removeAttr("disabled");
392
+ }
393
+ this._disabledInputs = $.map(this._disabledInputs,
394
+ function(value) { return (value == target ? null : value); }); // delete entry
395
+ },
396
+
397
+ /* Disable the date picker to a jQuery selection.
398
+ @param target element - the target input field or division or span */
399
+ _disableDatepicker: function(target) {
400
+ var $target = $(target);
401
+ var inst = $.data(target, PROP_NAME);
402
+ if (!$target.hasClass(this.markerClassName)) {
403
+ return;
404
+ }
405
+ var nodeName = target.nodeName.toLowerCase();
406
+ if (nodeName == 'input') {
407
+ target.disabled = true;
408
+ inst.trigger.filter('button').
409
+ each(function() { this.disabled = true; }).end().
410
+ filter('img').css({opacity: '0.5', cursor: 'default'});
411
+ }
412
+ else if (nodeName == 'div' || nodeName == 'span') {
413
+ var inline = $target.children('.' + this._inlineClass);
414
+ inline.children().addClass('ui-state-disabled');
415
+ inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
416
+ attr("disabled", "disabled");
417
+ }
418
+ this._disabledInputs = $.map(this._disabledInputs,
419
+ function(value) { return (value == target ? null : value); }); // delete entry
420
+ this._disabledInputs[this._disabledInputs.length] = target;
421
+ },
422
+
423
+ /* Is the first field in a jQuery collection disabled as a datepicker?
424
+ @param target element - the target input field or division or span
425
+ @return boolean - true if disabled, false if enabled */
426
+ _isDisabledDatepicker: function(target) {
427
+ if (!target) {
428
+ return false;
429
+ }
430
+ for (var i = 0; i < this._disabledInputs.length; i++) {
431
+ if (this._disabledInputs[i] == target)
432
+ return true;
433
+ }
434
+ return false;
435
+ },
436
+
437
+ /* Retrieve the instance data for the target control.
438
+ @param target element - the target input field or division or span
439
+ @return object - the associated instance data
440
+ @throws error if a jQuery problem getting data */
441
+ _getInst: function(target) {
442
+ try {
443
+ return $.data(target, PROP_NAME);
444
+ }
445
+ catch (err) {
446
+ throw 'Missing instance data for this datepicker';
447
+ }
448
+ },
449
+
450
+ /* Update or retrieve the settings for a date picker attached to an input field or division.
451
+ @param target element - the target input field or division or span
452
+ @param name object - the new settings to update or
453
+ string - the name of the setting to change or retrieve,
454
+ when retrieving also 'all' for all instance settings or
455
+ 'defaults' for all global defaults
456
+ @param value any - the new value for the setting
457
+ (omit if above is an object or to retrieve a value) */
458
+ _optionDatepicker: function(target, name, value) {
459
+ var inst = this._getInst(target);
460
+ if (arguments.length == 2 && typeof name == 'string') {
461
+ return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) :
462
+ (inst ? (name == 'all' ? $.extend({}, inst.settings) :
463
+ this._get(inst, name)) : null));
464
+ }
465
+ var settings = name || {};
466
+ if (typeof name == 'string') {
467
+ settings = {};
468
+ settings[name] = value;
469
+ }
470
+ if (inst) {
471
+ if (this._curInst == inst) {
472
+ this._hideDatepicker();
473
+ }
474
+ var date = this._getDateDatepicker(target, true);
475
+ var minDate = this._getMinMaxDate(inst, 'min');
476
+ var maxDate = this._getMinMaxDate(inst, 'max');
477
+ extendRemove(inst.settings, settings);
478
+ // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
479
+ if (minDate !== null && settings['dateFormat'] !== undefined && settings['minDate'] === undefined)
480
+ inst.settings.minDate = this._formatDate(inst, minDate);
481
+ if (maxDate !== null && settings['dateFormat'] !== undefined && settings['maxDate'] === undefined)
482
+ inst.settings.maxDate = this._formatDate(inst, maxDate);
483
+ this._attachments($(target), inst);
484
+ this._autoSize(inst);
485
+ this._setDate(inst, date);
486
+ this._updateAlternate(inst);
487
+ this._updateDatepicker(inst);
488
+ }
489
+ },
490
+
491
+ // change method deprecated
492
+ _changeDatepicker: function(target, name, value) {
493
+ this._optionDatepicker(target, name, value);
494
+ },
495
+
496
+ /* Redraw the date picker attached to an input field or division.
497
+ @param target element - the target input field or division or span */
498
+ _refreshDatepicker: function(target) {
499
+ var inst = this._getInst(target);
500
+ if (inst) {
501
+ this._updateDatepicker(inst);
502
+ }
503
+ },
504
+
505
+ /* Set the dates for a jQuery selection.
506
+ @param target element - the target input field or division or span
507
+ @param date Date - the new date */
508
+ _setDateDatepicker: function(target, date) {
509
+ var inst = this._getInst(target);
510
+ if (inst) {
511
+ this._setDate(inst, date);
512
+ this._updateDatepicker(inst);
513
+ this._updateAlternate(inst);
514
+ }
515
+ },
516
+
517
+ /* Get the date(s) for the first entry in a jQuery selection.
518
+ @param target element - the target input field or division or span
519
+ @param noDefault boolean - true if no default date is to be used
520
+ @return Date - the current date */
521
+ _getDateDatepicker: function(target, noDefault) {
522
+ var inst = this._getInst(target);
523
+ if (inst && !inst.inline)
524
+ this._setDateFromField(inst, noDefault);
525
+ return (inst ? this._getDate(inst) : null);
526
+ },
527
+
528
+ /* Handle keystrokes. */
529
+ _doKeyDown: function(event) {
530
+ var inst = $.datepicker._getInst(event.target);
531
+ var handled = true;
532
+ var isRTL = inst.dpDiv.is('.ui-datepicker-rtl');
533
+ inst._keyEvent = true;
534
+ if ($.datepicker._datepickerShowing)
535
+ switch (event.keyCode) {
536
+ case 9: $.datepicker._hideDatepicker();
537
+ handled = false;
538
+ break; // hide on tab out
539
+ case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' +
540
+ $.datepicker._currentClass + ')', inst.dpDiv);
541
+ if (sel[0])
542
+ $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
543
+ var onSelect = $.datepicker._get(inst, 'onSelect');
544
+ if (onSelect) {
545
+ var dateStr = $.datepicker._formatDate(inst);
546
+
547
+ // trigger custom callback
548
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
549
+ }
550
+ else
551
+ $.datepicker._hideDatepicker();
552
+ return false; // don't submit the form
553
+ break; // select the value on enter
554
+ case 27: $.datepicker._hideDatepicker();
555
+ break; // hide on escape
556
+ case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
557
+ -$.datepicker._get(inst, 'stepBigMonths') :
558
+ -$.datepicker._get(inst, 'stepMonths')), 'M');
559
+ break; // previous month/year on page up/+ ctrl
560
+ case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
561
+ +$.datepicker._get(inst, 'stepBigMonths') :
562
+ +$.datepicker._get(inst, 'stepMonths')), 'M');
563
+ break; // next month/year on page down/+ ctrl
564
+ case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target);
565
+ handled = event.ctrlKey || event.metaKey;
566
+ break; // clear on ctrl or command +end
567
+ case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target);
568
+ handled = event.ctrlKey || event.metaKey;
569
+ break; // current on ctrl or command +home
570
+ case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D');
571
+ handled = event.ctrlKey || event.metaKey;
572
+ // -1 day on ctrl or command +left
573
+ if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
574
+ -$.datepicker._get(inst, 'stepBigMonths') :
575
+ -$.datepicker._get(inst, 'stepMonths')), 'M');
576
+ // next month/year on alt +left on Mac
577
+ break;
578
+ case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D');
579
+ handled = event.ctrlKey || event.metaKey;
580
+ break; // -1 week on ctrl or command +up
581
+ case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D');
582
+ handled = event.ctrlKey || event.metaKey;
583
+ // +1 day on ctrl or command +right
584
+ if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
585
+ +$.datepicker._get(inst, 'stepBigMonths') :
586
+ +$.datepicker._get(inst, 'stepMonths')), 'M');
587
+ // next month/year on alt +right
588
+ break;
589
+ case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D');
590
+ handled = event.ctrlKey || event.metaKey;
591
+ break; // +1 week on ctrl or command +down
592
+ default: handled = false;
593
+ }
594
+ else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home
595
+ $.datepicker._showDatepicker(this);
596
+ else {
597
+ handled = false;
598
+ }
599
+ if (handled) {
600
+ event.preventDefault();
601
+ event.stopPropagation();
602
+ }
603
+ },
604
+
605
+ /* Filter entered characters - based on date format. */
606
+ _doKeyPress: function(event) {
607
+ var inst = $.datepicker._getInst(event.target);
608
+ if ($.datepicker._get(inst, 'constrainInput')) {
609
+ var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat'));
610
+ var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode);
611
+ return event.ctrlKey || event.metaKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);
612
+ }
613
+ },
614
+
615
+ /* Synchronise manual entry and field/alternate field. */
616
+ _doKeyUp: function(event) {
617
+ var inst = $.datepicker._getInst(event.target);
618
+ if (inst.input.val() != inst.lastVal) {
619
+ try {
620
+ var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
621
+ (inst.input ? inst.input.val() : null),
622
+ $.datepicker._getFormatConfig(inst));
623
+ if (date) { // only if valid
624
+ $.datepicker._setDateFromField(inst);
625
+ $.datepicker._updateAlternate(inst);
626
+ $.datepicker._updateDatepicker(inst);
627
+ }
628
+ }
629
+ catch (event) {
630
+ $.datepicker.log(event);
631
+ }
632
+ }
633
+ return true;
634
+ },
635
+
636
+ /* Pop-up the date picker for a given input field.
637
+ If false returned from beforeShow event handler do not show.
638
+ @param input element - the input field attached to the date picker or
639
+ event - if triggered by focus */
640
+ _showDatepicker: function(input) {
641
+ input = input.target || input;
642
+ if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
643
+ input = $('input', input.parentNode)[0];
644
+ if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
645
+ return;
646
+ var inst = $.datepicker._getInst(input);
647
+ if ($.datepicker._curInst && $.datepicker._curInst != inst) {
648
+ $.datepicker._curInst.dpDiv.stop(true, true);
649
+ if ( inst && $.datepicker._datepickerShowing ) {
650
+ $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
651
+ }
652
+ }
653
+ var beforeShow = $.datepicker._get(inst, 'beforeShow');
654
+ var beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
655
+ if(beforeShowSettings === false){
656
+ //false
657
+ return;
658
+ }
659
+ extendRemove(inst.settings, beforeShowSettings);
660
+ inst.lastVal = null;
661
+ $.datepicker._lastInput = input;
662
+ $.datepicker._setDateFromField(inst);
663
+ if ($.datepicker._inDialog) // hide cursor
664
+ input.value = '';
665
+ if (!$.datepicker._pos) { // position below input
666
+ $.datepicker._pos = $.datepicker._findPos(input);
667
+ $.datepicker._pos[1] += input.offsetHeight; // add the height
668
+ }
669
+ var isFixed = false;
670
+ $(input).parents().each(function() {
671
+ isFixed |= $(this).css('position') == 'fixed';
672
+ return !isFixed;
673
+ });
674
+ if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled
675
+ $.datepicker._pos[0] -= document.documentElement.scrollLeft;
676
+ $.datepicker._pos[1] -= document.documentElement.scrollTop;
677
+ }
678
+ var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
679
+ $.datepicker._pos = null;
680
+ //to avoid flashes on Firefox
681
+ inst.dpDiv.empty();
682
+ // determine sizing offscreen
683
+ inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'});
684
+ $.datepicker._updateDatepicker(inst);
685
+ // fix width for dynamic number of date pickers
686
+ // and adjust position before showing
687
+ offset = $.datepicker._checkOffset(inst, offset, isFixed);
688
+ inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
689
+ 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',
690
+ left: offset.left + 'px', top: offset.top + 'px'});
691
+ if (!inst.inline) {
692
+ var showAnim = $.datepicker._get(inst, 'showAnim');
693
+ var duration = $.datepicker._get(inst, 'duration');
694
+ var postProcess = function() {
695
+ var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only
696
+ if( !! cover.length ){
697
+ var borders = $.datepicker._getBorders(inst.dpDiv);
698
+ cover.css({left: -borders[0], top: -borders[1],
699
+ width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()});
700
+ }
701
+ };
702
+ inst.dpDiv.zIndex($(input).zIndex()+1);
703
+ $.datepicker._datepickerShowing = true;
704
+ if ($.effects && $.effects[showAnim])
705
+ inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
706
+ else
707
+ inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess);
708
+ if (!showAnim || !duration)
709
+ postProcess();
710
+ if (inst.input.is(':visible') && !inst.input.is(':disabled'))
711
+ inst.input.focus();
712
+ $.datepicker._curInst = inst;
713
+ }
714
+ },
715
+
716
+ /* Generate the date picker content. */
717
+ _updateDatepicker: function(inst) {
718
+ var self = this;
719
+ self.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
720
+ var borders = $.datepicker._getBorders(inst.dpDiv);
721
+ instActive = inst; // for delegate hover events
722
+ inst.dpDiv.empty().append(this._generateHTML(inst));
723
+ var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only
724
+ if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6
725
+ cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()})
726
+ }
727
+ inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover();
728
+ var numMonths = this._getNumberOfMonths(inst);
729
+ var cols = numMonths[1];
730
+ var width = 17;
731
+ inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');
732
+ if (cols > 1)
733
+ inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em');
734
+ inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +
735
+ 'Class']('ui-datepicker-multi');
736
+ inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
737
+ 'Class']('ui-datepicker-rtl');
738
+ if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&
739
+ // #6694 - don't focus the input if it's already focused
740
+ // this breaks the change event in IE
741
+ inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement)
742
+ inst.input.focus();
743
+ // deffered render of the years select (to avoid flashes on Firefox)
744
+ if( inst.yearshtml ){
745
+ var origyearshtml = inst.yearshtml;
746
+ setTimeout(function(){
747
+ //assure that inst.yearshtml didn't change.
748
+ if( origyearshtml === inst.yearshtml && inst.yearshtml ){
749
+ inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml);
750
+ }
751
+ origyearshtml = inst.yearshtml = null;
752
+ }, 0);
753
+ }
754
+ },
755
+
756
+ /* Retrieve the size of left and top borders for an element.
757
+ @param elem (jQuery object) the element of interest
758
+ @return (number[2]) the left and top borders */
759
+ _getBorders: function(elem) {
760
+ var convert = function(value) {
761
+ return {thin: 1, medium: 2, thick: 3}[value] || value;
762
+ };
763
+ return [parseFloat(convert(elem.css('border-left-width'))),
764
+ parseFloat(convert(elem.css('border-top-width')))];
765
+ },
766
+
767
+ /* Check positioning to remain on screen. */
768
+ _checkOffset: function(inst, offset, isFixed) {
769
+ var dpWidth = inst.dpDiv.outerWidth();
770
+ var dpHeight = inst.dpDiv.outerHeight();
771
+ var inputWidth = inst.input ? inst.input.outerWidth() : 0;
772
+ var inputHeight = inst.input ? inst.input.outerHeight() : 0;
773
+ var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft();
774
+ var viewHeight = document.documentElement.clientHeight + $(document).scrollTop();
775
+
776
+ offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0);
777
+ offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;
778
+ offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
779
+
780
+ // now check if datepicker is showing outside window viewport - move to a better place if so.
781
+ offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
782
+ Math.abs(offset.left + dpWidth - viewWidth) : 0);
783
+ offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
784
+ Math.abs(dpHeight + inputHeight) : 0);
785
+
786
+ return offset;
787
+ },
788
+
789
+ /* Find an object's position on the screen. */
790
+ _findPos: function(obj) {
791
+ var inst = this._getInst(obj);
792
+ var isRTL = this._get(inst, 'isRTL');
793
+ while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) {
794
+ obj = obj[isRTL ? 'previousSibling' : 'nextSibling'];
795
+ }
796
+ var position = $(obj).offset();
797
+ return [position.left, position.top];
798
+ },
799
+
800
+ /* Hide the date picker from view.
801
+ @param input element - the input field attached to the date picker */
802
+ _hideDatepicker: function(input) {
803
+ var inst = this._curInst;
804
+ if (!inst || (input && inst != $.data(input, PROP_NAME)))
805
+ return;
806
+ if (this._datepickerShowing) {
807
+ var showAnim = this._get(inst, 'showAnim');
808
+ var duration = this._get(inst, 'duration');
809
+ var self = this;
810
+ var postProcess = function() {
811
+ $.datepicker._tidyDialog(inst);
812
+ self._curInst = null;
813
+ };
814
+ if ($.effects && $.effects[showAnim])
815
+ inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
816
+ else
817
+ inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' :
818
+ (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess);
819
+ if (!showAnim)
820
+ postProcess();
821
+ this._datepickerShowing = false;
822
+ var onClose = this._get(inst, 'onClose');
823
+ if (onClose)
824
+ onClose.apply((inst.input ? inst.input[0] : null),
825
+ [(inst.input ? inst.input.val() : ''), inst]);
826
+ this._lastInput = null;
827
+ if (this._inDialog) {
828
+ this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });
829
+ if ($.blockUI) {
830
+ $.unblockUI();
831
+ $('body').append(this.dpDiv);
832
+ }
833
+ }
834
+ this._inDialog = false;
835
+ }
836
+ },
837
+
838
+ /* Tidy up after a dialog display. */
839
+ _tidyDialog: function(inst) {
840
+ inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar');
841
+ },
842
+
843
+ /* Close date picker if clicked elsewhere. */
844
+ _checkExternalClick: function(event) {
845
+ if (!$.datepicker._curInst)
846
+ return;
847
+
848
+ var $target = $(event.target),
849
+ inst = $.datepicker._getInst($target[0]);
850
+
851
+ if ( ( ( $target[0].id != $.datepicker._mainDivId &&
852
+ $target.parents('#' + $.datepicker._mainDivId).length == 0 &&
853
+ !$target.hasClass($.datepicker.markerClassName) &&
854
+ !$target.closest("." + $.datepicker._triggerClass).length &&
855
+ $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
856
+ ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != inst ) )
857
+ $.datepicker._hideDatepicker();
858
+ },
859
+
860
+ /* Adjust one of the date sub-fields. */
861
+ _adjustDate: function(id, offset, period) {
862
+ var target = $(id);
863
+ var inst = this._getInst(target[0]);
864
+ if (this._isDisabledDatepicker(target[0])) {
865
+ return;
866
+ }
867
+ this._adjustInstDate(inst, offset +
868
+ (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning
869
+ period);
870
+ this._updateDatepicker(inst);
871
+ },
872
+
873
+ /* Action for current link. */
874
+ _gotoToday: function(id) {
875
+ var target = $(id);
876
+ var inst = this._getInst(target[0]);
877
+ if (this._get(inst, 'gotoCurrent') && inst.currentDay) {
878
+ inst.selectedDay = inst.currentDay;
879
+ inst.drawMonth = inst.selectedMonth = inst.currentMonth;
880
+ inst.drawYear = inst.selectedYear = inst.currentYear;
881
+ }
882
+ else {
883
+ var date = new Date();
884
+ inst.selectedDay = date.getDate();
885
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
886
+ inst.drawYear = inst.selectedYear = date.getFullYear();
887
+ }
888
+ this._notifyChange(inst);
889
+ this._adjustDate(target);
890
+ },
891
+
892
+ /* Action for selecting a new month/year. */
893
+ _selectMonthYear: function(id, select, period) {
894
+ var target = $(id);
895
+ var inst = this._getInst(target[0]);
896
+ inst['selected' + (period == 'M' ? 'Month' : 'Year')] =
897
+ inst['draw' + (period == 'M' ? 'Month' : 'Year')] =
898
+ parseInt(select.options[select.selectedIndex].value,10);
899
+ this._notifyChange(inst);
900
+ this._adjustDate(target);
901
+ },
902
+
903
+ /* Action for selecting a day. */
904
+ _selectDay: function(id, month, year, td) {
905
+ var target = $(id);
906
+ if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
907
+ return;
908
+ }
909
+ var inst = this._getInst(target[0]);
910
+ inst.selectedDay = inst.currentDay = $('a', td).html();
911
+ inst.selectedMonth = inst.currentMonth = month;
912
+ inst.selectedYear = inst.currentYear = year;
913
+ this._selectDate(id, this._formatDate(inst,
914
+ inst.currentDay, inst.currentMonth, inst.currentYear));
915
+ },
916
+
917
+ /* Erase the input field and hide the date picker. */
918
+ _clearDate: function(id) {
919
+ var target = $(id);
920
+ var inst = this._getInst(target[0]);
921
+ this._selectDate(target, '');
922
+ },
923
+
924
+ /* Update the input field with the selected date. */
925
+ _selectDate: function(id, dateStr) {
926
+ var target = $(id);
927
+ var inst = this._getInst(target[0]);
928
+ dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
929
+ if (inst.input)
930
+ inst.input.val(dateStr);
931
+ this._updateAlternate(inst);
932
+ var onSelect = this._get(inst, 'onSelect');
933
+ if (onSelect)
934
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback
935
+ else if (inst.input)
936
+ inst.input.trigger('change'); // fire the change event
937
+ if (inst.inline)
938
+ this._updateDatepicker(inst);
939
+ else {
940
+ this._hideDatepicker();
941
+ this._lastInput = inst.input[0];
942
+ if (typeof(inst.input[0]) != 'object')
943
+ inst.input.focus(); // restore focus
944
+ this._lastInput = null;
945
+ }
946
+ },
947
+
948
+ /* Update any alternate field to synchronise with the main field. */
949
+ _updateAlternate: function(inst) {
950
+ var altField = this._get(inst, 'altField');
951
+ if (altField) { // update alternate field too
952
+ var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat');
953
+ var date = this._getDate(inst);
954
+ var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
955
+ $(altField).each(function() { $(this).val(dateStr); });
956
+ }
957
+ },
958
+
959
+ /* Set as beforeShowDay function to prevent selection of weekends.
960
+ @param date Date - the date to customise
961
+ @return [boolean, string] - is this date selectable?, what is its CSS class? */
962
+ noWeekends: function(date) {
963
+ var day = date.getDay();
964
+ return [(day > 0 && day < 6), ''];
965
+ },
966
+
967
+ /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
968
+ @param date Date - the date to get the week for
969
+ @return number - the number of the week within the year that contains this date */
970
+ iso8601Week: function(date) {
971
+ var checkDate = new Date(date.getTime());
972
+ // Find Thursday of this week starting on Monday
973
+ checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
974
+ var time = checkDate.getTime();
975
+ checkDate.setMonth(0); // Compare with Jan 1
976
+ checkDate.setDate(1);
977
+ return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
978
+ },
979
+
980
+ /* Parse a string value into a date object.
981
+ See formatDate below for the possible formats.
982
+
983
+ @param format string - the expected format of the date
984
+ @param value string - the date in the above format
985
+ @param settings Object - attributes include:
986
+ shortYearCutoff number - the cutoff year for determining the century (optional)
987
+ dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
988
+ dayNames string[7] - names of the days from Sunday (optional)
989
+ monthNamesShort string[12] - abbreviated names of the months (optional)
990
+ monthNames string[12] - names of the months (optional)
991
+ @return Date - the extracted date value or null if value is blank */
992
+ parseDate: function (format, value, settings) {
993
+ if (format == null || value == null)
994
+ throw 'Invalid arguments';
995
+ value = (typeof value == 'object' ? value.toString() : value + '');
996
+ if (value == '')
997
+ return null;
998
+ var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;
999
+ shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
1000
+ new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
1001
+ var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
1002
+ var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
1003
+ var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
1004
+ var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
1005
+ var year = -1;
1006
+ var month = -1;
1007
+ var day = -1;
1008
+ var doy = -1;
1009
+ var literal = false;
1010
+ // Check whether a format character is doubled
1011
+ var lookAhead = function(match) {
1012
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
1013
+ if (matches)
1014
+ iFormat++;
1015
+ return matches;
1016
+ };
1017
+ // Extract a number from the string value
1018
+ var getNumber = function(match) {
1019
+ var isDoubled = lookAhead(match);
1020
+ var size = (match == '@' ? 14 : (match == '!' ? 20 :
1021
+ (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2))));
1022
+ var digits = new RegExp('^\\d{1,' + size + '}');
1023
+ var num = value.substring(iValue).match(digits);
1024
+ if (!num)
1025
+ throw 'Missing number at position ' + iValue;
1026
+ iValue += num[0].length;
1027
+ return parseInt(num[0], 10);
1028
+ };
1029
+ // Extract a name from the string value and convert to an index
1030
+ var getName = function(match, shortNames, longNames) {
1031
+ var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
1032
+ return [ [k, v] ];
1033
+ }).sort(function (a, b) {
1034
+ return -(a[1].length - b[1].length);
1035
+ });
1036
+ var index = -1;
1037
+ $.each(names, function (i, pair) {
1038
+ var name = pair[1];
1039
+ if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) {
1040
+ index = pair[0];
1041
+ iValue += name.length;
1042
+ return false;
1043
+ }
1044
+ });
1045
+ if (index != -1)
1046
+ return index + 1;
1047
+ else
1048
+ throw 'Unknown name at position ' + iValue;
1049
+ };
1050
+ // Confirm that a literal character matches the string value
1051
+ var checkLiteral = function() {
1052
+ if (value.charAt(iValue) != format.charAt(iFormat))
1053
+ throw 'Unexpected literal at position ' + iValue;
1054
+ iValue++;
1055
+ };
1056
+ var iValue = 0;
1057
+ for (var iFormat = 0; iFormat < format.length; iFormat++) {
1058
+ if (literal)
1059
+ if (format.charAt(iFormat) == "'" && !lookAhead("'"))
1060
+ literal = false;
1061
+ else
1062
+ checkLiteral();
1063
+ else
1064
+ switch (format.charAt(iFormat)) {
1065
+ case 'd':
1066
+ day = getNumber('d');
1067
+ break;
1068
+ case 'D':
1069
+ getName('D', dayNamesShort, dayNames);
1070
+ break;
1071
+ case 'o':
1072
+ doy = getNumber('o');
1073
+ break;
1074
+ case 'm':
1075
+ month = getNumber('m');
1076
+ break;
1077
+ case 'M':
1078
+ month = getName('M', monthNamesShort, monthNames);
1079
+ break;
1080
+ case 'y':
1081
+ year = getNumber('y');
1082
+ break;
1083
+ case '@':
1084
+ var date = new Date(getNumber('@'));
1085
+ year = date.getFullYear();
1086
+ month = date.getMonth() + 1;
1087
+ day = date.getDate();
1088
+ break;
1089
+ case '!':
1090
+ var date = new Date((getNumber('!') - this._ticksTo1970) / 10000);
1091
+ year = date.getFullYear();
1092
+ month = date.getMonth() + 1;
1093
+ day = date.getDate();
1094
+ break;
1095
+ case "'":
1096
+ if (lookAhead("'"))
1097
+ checkLiteral();
1098
+ else
1099
+ literal = true;
1100
+ break;
1101
+ default:
1102
+ checkLiteral();
1103
+ }
1104
+ }
1105
+ if (iValue < value.length){
1106
+ throw "Extra/unparsed characters found in date: " + value.substring(iValue);
1107
+ }
1108
+ if (year == -1)
1109
+ year = new Date().getFullYear();
1110
+ else if (year < 100)
1111
+ year += new Date().getFullYear() - new Date().getFullYear() % 100 +
1112
+ (year <= shortYearCutoff ? 0 : -100);
1113
+ if (doy > -1) {
1114
+ month = 1;
1115
+ day = doy;
1116
+ do {
1117
+ var dim = this._getDaysInMonth(year, month - 1);
1118
+ if (day <= dim)
1119
+ break;
1120
+ month++;
1121
+ day -= dim;
1122
+ } while (true);
1123
+ }
1124
+ var date = this._daylightSavingAdjust(new Date(year, month - 1, day));
1125
+ if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day)
1126
+ throw 'Invalid date'; // E.g. 31/02/00
1127
+ return date;
1128
+ },
1129
+
1130
+ /* Standard date formats. */
1131
+ ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601)
1132
+ COOKIE: 'D, dd M yy',
1133
+ ISO_8601: 'yy-mm-dd',
1134
+ RFC_822: 'D, d M y',
1135
+ RFC_850: 'DD, dd-M-y',
1136
+ RFC_1036: 'D, d M y',
1137
+ RFC_1123: 'D, d M yy',
1138
+ RFC_2822: 'D, d M yy',
1139
+ RSS: 'D, d M y', // RFC 822
1140
+ TICKS: '!',
1141
+ TIMESTAMP: '@',
1142
+ W3C: 'yy-mm-dd', // ISO 8601
1143
+
1144
+ _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
1145
+ Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
1146
+
1147
+ /* Format a date object into a string value.
1148
+ The format can be combinations of the following:
1149
+ d - day of month (no leading zero)
1150
+ dd - day of month (two digit)
1151
+ o - day of year (no leading zeros)
1152
+ oo - day of year (three digit)
1153
+ D - day name short
1154
+ DD - day name long
1155
+ m - month of year (no leading zero)
1156
+ mm - month of year (two digit)
1157
+ M - month name short
1158
+ MM - month name long
1159
+ y - year (two digit)
1160
+ yy - year (four digit)
1161
+ @ - Unix timestamp (ms since 01/01/1970)
1162
+ ! - Windows ticks (100ns since 01/01/0001)
1163
+ '...' - literal text
1164
+ '' - single quote
1165
+
1166
+ @param format string - the desired format of the date
1167
+ @param date Date - the date value to format
1168
+ @param settings Object - attributes include:
1169
+ dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
1170
+ dayNames string[7] - names of the days from Sunday (optional)
1171
+ monthNamesShort string[12] - abbreviated names of the months (optional)
1172
+ monthNames string[12] - names of the months (optional)
1173
+ @return string - the date in the above format */
1174
+ formatDate: function (format, date, settings) {
1175
+ if (!date)
1176
+ return '';
1177
+ var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
1178
+ var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
1179
+ var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
1180
+ var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
1181
+ // Check whether a format character is doubled
1182
+ var lookAhead = function(match) {
1183
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
1184
+ if (matches)
1185
+ iFormat++;
1186
+ return matches;
1187
+ };
1188
+ // Format a number, with leading zero if necessary
1189
+ var formatNumber = function(match, value, len) {
1190
+ var num = '' + value;
1191
+ if (lookAhead(match))
1192
+ while (num.length < len)
1193
+ num = '0' + num;
1194
+ return num;
1195
+ };
1196
+ // Format a name, short or long as requested
1197
+ var formatName = function(match, value, shortNames, longNames) {
1198
+ return (lookAhead(match) ? longNames[value] : shortNames[value]);
1199
+ };
1200
+ var output = '';
1201
+ var literal = false;
1202
+ if (date)
1203
+ for (var iFormat = 0; iFormat < format.length; iFormat++) {
1204
+ if (literal)
1205
+ if (format.charAt(iFormat) == "'" && !lookAhead("'"))
1206
+ literal = false;
1207
+ else
1208
+ output += format.charAt(iFormat);
1209
+ else
1210
+ switch (format.charAt(iFormat)) {
1211
+ case 'd':
1212
+ output += formatNumber('d', date.getDate(), 2);
1213
+ break;
1214
+ case 'D':
1215
+ output += formatName('D', date.getDay(), dayNamesShort, dayNames);
1216
+ break;
1217
+ case 'o':
1218
+ output += formatNumber('o',
1219
+ Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
1220
+ break;
1221
+ case 'm':
1222
+ output += formatNumber('m', date.getMonth() + 1, 2);
1223
+ break;
1224
+ case 'M':
1225
+ output += formatName('M', date.getMonth(), monthNamesShort, monthNames);
1226
+ break;
1227
+ case 'y':
1228
+ output += (lookAhead('y') ? date.getFullYear() :
1229
+ (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);
1230
+ break;
1231
+ case '@':
1232
+ output += date.getTime();
1233
+ break;
1234
+ case '!':
1235
+ output += date.getTime() * 10000 + this._ticksTo1970;
1236
+ break;
1237
+ case "'":
1238
+ if (lookAhead("'"))
1239
+ output += "'";
1240
+ else
1241
+ literal = true;
1242
+ break;
1243
+ default:
1244
+ output += format.charAt(iFormat);
1245
+ }
1246
+ }
1247
+ return output;
1248
+ },
1249
+
1250
+ /* Extract all possible characters from the date format. */
1251
+ _possibleChars: function (format) {
1252
+ var chars = '';
1253
+ var literal = false;
1254
+ // Check whether a format character is doubled
1255
+ var lookAhead = function(match) {
1256
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
1257
+ if (matches)
1258
+ iFormat++;
1259
+ return matches;
1260
+ };
1261
+ for (var iFormat = 0; iFormat < format.length; iFormat++)
1262
+ if (literal)
1263
+ if (format.charAt(iFormat) == "'" && !lookAhead("'"))
1264
+ literal = false;
1265
+ else
1266
+ chars += format.charAt(iFormat);
1267
+ else
1268
+ switch (format.charAt(iFormat)) {
1269
+ case 'd': case 'm': case 'y': case '@':
1270
+ chars += '0123456789';
1271
+ break;
1272
+ case 'D': case 'M':
1273
+ return null; // Accept anything
1274
+ case "'":
1275
+ if (lookAhead("'"))
1276
+ chars += "'";
1277
+ else
1278
+ literal = true;
1279
+ break;
1280
+ default:
1281
+ chars += format.charAt(iFormat);
1282
+ }
1283
+ return chars;
1284
+ },
1285
+
1286
+ /* Get a setting value, defaulting if necessary. */
1287
+ _get: function(inst, name) {
1288
+ return inst.settings[name] !== undefined ?
1289
+ inst.settings[name] : this._defaults[name];
1290
+ },
1291
+
1292
+ /* Parse existing date and initialise date picker. */
1293
+ _setDateFromField: function(inst, noDefault) {
1294
+ if (inst.input.val() == inst.lastVal) {
1295
+ return;
1296
+ }
1297
+ var dateFormat = this._get(inst, 'dateFormat');
1298
+ var dates = inst.lastVal = inst.input ? inst.input.val() : null;
1299
+ var date, defaultDate;
1300
+ date = defaultDate = this._getDefaultDate(inst);
1301
+ var settings = this._getFormatConfig(inst);
1302
+ try {
1303
+ date = this.parseDate(dateFormat, dates, settings) || defaultDate;
1304
+ } catch (event) {
1305
+ this.log(event);
1306
+ dates = (noDefault ? '' : dates);
1307
+ }
1308
+ inst.selectedDay = date.getDate();
1309
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
1310
+ inst.drawYear = inst.selectedYear = date.getFullYear();
1311
+ inst.currentDay = (dates ? date.getDate() : 0);
1312
+ inst.currentMonth = (dates ? date.getMonth() : 0);
1313
+ inst.currentYear = (dates ? date.getFullYear() : 0);
1314
+ this._adjustInstDate(inst);
1315
+ },
1316
+
1317
+ /* Retrieve the default date shown on opening. */
1318
+ _getDefaultDate: function(inst) {
1319
+ return this._restrictMinMax(inst,
1320
+ this._determineDate(inst, this._get(inst, 'defaultDate'), new Date()));
1321
+ },
1322
+
1323
+ /* A date may be specified as an exact value or a relative one. */
1324
+ _determineDate: function(inst, date, defaultDate) {
1325
+ var offsetNumeric = function(offset) {
1326
+ var date = new Date();
1327
+ date.setDate(date.getDate() + offset);
1328
+ return date;
1329
+ };
1330
+ var offsetString = function(offset) {
1331
+ try {
1332
+ return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
1333
+ offset, $.datepicker._getFormatConfig(inst));
1334
+ }
1335
+ catch (e) {
1336
+ // Ignore
1337
+ }
1338
+ var date = (offset.toLowerCase().match(/^c/) ?
1339
+ $.datepicker._getDate(inst) : null) || new Date();
1340
+ var year = date.getFullYear();
1341
+ var month = date.getMonth();
1342
+ var day = date.getDate();
1343
+ var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;
1344
+ var matches = pattern.exec(offset);
1345
+ while (matches) {
1346
+ switch (matches[2] || 'd') {
1347
+ case 'd' : case 'D' :
1348
+ day += parseInt(matches[1],10); break;
1349
+ case 'w' : case 'W' :
1350
+ day += parseInt(matches[1],10) * 7; break;
1351
+ case 'm' : case 'M' :
1352
+ month += parseInt(matches[1],10);
1353
+ day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
1354
+ break;
1355
+ case 'y': case 'Y' :
1356
+ year += parseInt(matches[1],10);
1357
+ day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
1358
+ break;
1359
+ }
1360
+ matches = pattern.exec(offset);
1361
+ }
1362
+ return new Date(year, month, day);
1363
+ };
1364
+ var newDate = (date == null || date === '' ? defaultDate : (typeof date == 'string' ? offsetString(date) :
1365
+ (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
1366
+ newDate = (newDate && newDate.toString() == 'Invalid Date' ? defaultDate : newDate);
1367
+ if (newDate) {
1368
+ newDate.setHours(0);
1369
+ newDate.setMinutes(0);
1370
+ newDate.setSeconds(0);
1371
+ newDate.setMilliseconds(0);
1372
+ }
1373
+ return this._daylightSavingAdjust(newDate);
1374
+ },
1375
+
1376
+ /* Handle switch to/from daylight saving.
1377
+ Hours may be non-zero on daylight saving cut-over:
1378
+ > 12 when midnight changeover, but then cannot generate
1379
+ midnight datetime, so jump to 1AM, otherwise reset.
1380
+ @param date (Date) the date to check
1381
+ @return (Date) the corrected date */
1382
+ _daylightSavingAdjust: function(date) {
1383
+ if (!date) return null;
1384
+ date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
1385
+ return date;
1386
+ },
1387
+
1388
+ /* Set the date(s) directly. */
1389
+ _setDate: function(inst, date, noChange) {
1390
+ var clear = !date;
1391
+ var origMonth = inst.selectedMonth;
1392
+ var origYear = inst.selectedYear;
1393
+ var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
1394
+ inst.selectedDay = inst.currentDay = newDate.getDate();
1395
+ inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
1396
+ inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
1397
+ if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange)
1398
+ this._notifyChange(inst);
1399
+ this._adjustInstDate(inst);
1400
+ if (inst.input) {
1401
+ inst.input.val(clear ? '' : this._formatDate(inst));
1402
+ }
1403
+ },
1404
+
1405
+ /* Retrieve the date(s) directly. */
1406
+ _getDate: function(inst) {
1407
+ var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null :
1408
+ this._daylightSavingAdjust(new Date(
1409
+ inst.currentYear, inst.currentMonth, inst.currentDay)));
1410
+ return startDate;
1411
+ },
1412
+
1413
+ /* Generate the HTML for the current state of the date picker. */
1414
+ _generateHTML: function(inst) {
1415
+ var today = new Date();
1416
+ today = this._daylightSavingAdjust(
1417
+ new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time
1418
+ var isRTL = this._get(inst, 'isRTL');
1419
+ var showButtonPanel = this._get(inst, 'showButtonPanel');
1420
+ var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext');
1421
+ var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat');
1422
+ var numMonths = this._getNumberOfMonths(inst);
1423
+ var showCurrentAtPos = this._get(inst, 'showCurrentAtPos');
1424
+ var stepMonths = this._get(inst, 'stepMonths');
1425
+ var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
1426
+ var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
1427
+ new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
1428
+ var minDate = this._getMinMaxDate(inst, 'min');
1429
+ var maxDate = this._getMinMaxDate(inst, 'max');
1430
+ var drawMonth = inst.drawMonth - showCurrentAtPos;
1431
+ var drawYear = inst.drawYear;
1432
+ if (drawMonth < 0) {
1433
+ drawMonth += 12;
1434
+ drawYear--;
1435
+ }
1436
+ if (maxDate) {
1437
+ var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
1438
+ maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
1439
+ maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
1440
+ while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
1441
+ drawMonth--;
1442
+ if (drawMonth < 0) {
1443
+ drawMonth = 11;
1444
+ drawYear--;
1445
+ }
1446
+ }
1447
+ }
1448
+ inst.drawMonth = drawMonth;
1449
+ inst.drawYear = drawYear;
1450
+ var prevText = this._get(inst, 'prevText');
1451
+ prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
1452
+ this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
1453
+ this._getFormatConfig(inst)));
1454
+ var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
1455
+ '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_' + dpuuid +
1456
+ '.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' +
1457
+ ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' :
1458
+ (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>'));
1459
+ var nextText = this._get(inst, 'nextText');
1460
+ nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
1461
+ this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
1462
+ this._getFormatConfig(inst)));
1463
+ var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
1464
+ '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_' + dpuuid +
1465
+ '.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' +
1466
+ ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' :
1467
+ (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>'));
1468
+ var currentText = this._get(inst, 'currentText');
1469
+ var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today);
1470
+ currentText = (!navigationAsDateFormat ? currentText :
1471
+ this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
1472
+ var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_' + dpuuid +
1473
+ '.datepicker._hideDatepicker();">' + this._get(inst, 'closeText') + '</button>' : '');
1474
+ var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') +
1475
+ (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_' + dpuuid +
1476
+ '.datepicker._gotoToday(\'#' + inst.id + '\');"' +
1477
+ '>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : '';
1478
+ var firstDay = parseInt(this._get(inst, 'firstDay'),10);
1479
+ firstDay = (isNaN(firstDay) ? 0 : firstDay);
1480
+ var showWeek = this._get(inst, 'showWeek');
1481
+ var dayNames = this._get(inst, 'dayNames');
1482
+ var dayNamesShort = this._get(inst, 'dayNamesShort');
1483
+ var dayNamesMin = this._get(inst, 'dayNamesMin');
1484
+ var monthNames = this._get(inst, 'monthNames');
1485
+ var monthNamesShort = this._get(inst, 'monthNamesShort');
1486
+ var beforeShowDay = this._get(inst, 'beforeShowDay');
1487
+ var showOtherMonths = this._get(inst, 'showOtherMonths');
1488
+ var selectOtherMonths = this._get(inst, 'selectOtherMonths');
1489
+ var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week;
1490
+ var defaultDate = this._getDefaultDate(inst);
1491
+ var html = '';
1492
+ for (var row = 0; row < numMonths[0]; row++) {
1493
+ var group = '';
1494
+ this.maxRows = 4;
1495
+ for (var col = 0; col < numMonths[1]; col++) {
1496
+ var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
1497
+ var cornerClass = ' ui-corner-all';
1498
+ var calender = '';
1499
+ if (isMultiMonth) {
1500
+ calender += '<div class="ui-datepicker-group';
1501
+ if (numMonths[1] > 1)
1502
+ switch (col) {
1503
+ case 0: calender += ' ui-datepicker-group-first';
1504
+ cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break;
1505
+ case numMonths[1]-1: calender += ' ui-datepicker-group-last';
1506
+ cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break;
1507
+ default: calender += ' ui-datepicker-group-middle'; cornerClass = ''; break;
1508
+ }
1509
+ calender += '">';
1510
+ }
1511
+ calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' +
1512
+ (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') +
1513
+ (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') +
1514
+ this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
1515
+ row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
1516
+ '</div><table class="ui-datepicker-calendar"><thead>' +
1517
+ '<tr>';
1518
+ var thead = (showWeek ? '<th class="ui-datepicker-week-col">' + this._get(inst, 'weekHeader') + '</th>' : '');
1519
+ for (var dow = 0; dow < 7; dow++) { // days of the week
1520
+ var day = (dow + firstDay) % 7;
1521
+ thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' +
1522
+ '<span title="' + dayNames[day] + '">' + dayNamesMin[day] + '</span></th>';
1523
+ }
1524
+ calender += thead + '</tr></thead><tbody>';
1525
+ var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
1526
+ if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth)
1527
+ inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
1528
+ var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
1529
+ var curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
1530
+ var numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
1531
+ this.maxRows = numRows;
1532
+ var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
1533
+ for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
1534
+ calender += '<tr>';
1535
+ var tbody = (!showWeek ? '' : '<td class="ui-datepicker-week-col">' +
1536
+ this._get(inst, 'calculateWeek')(printDate) + '</td>');
1537
+ for (var dow = 0; dow < 7; dow++) { // create date picker days
1538
+ var daySettings = (beforeShowDay ?
1539
+ beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']);
1540
+ var otherMonth = (printDate.getMonth() != drawMonth);
1541
+ var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
1542
+ (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
1543
+ tbody += '<td class="' +
1544
+ ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends
1545
+ (otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months
1546
+ ((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || // user pressed key
1547
+ (defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ?
1548
+ // or defaultDate is current printedDate and defaultDate is selectedDate
1549
+ ' ' + this._dayOverClass : '') + // highlight selected day
1550
+ (unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') + // highlight unselectable days
1551
+ (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates
1552
+ (printDate.getTime() == currentDate.getTime() ? ' ' + this._currentClass : '') + // highlight selected day
1553
+ (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
1554
+ ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
1555
+ (unselectable ? '' : ' onclick="DP_jQuery_' + dpuuid + '.datepicker._selectDay(\'#' +
1556
+ inst.id + '\',' + printDate.getMonth() + ',' + printDate.getFullYear() + ', this);return false;"') + '>' + // actions
1557
+ (otherMonth && !showOtherMonths ? '&#xa0;' : // display for other months
1558
+ (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' +
1559
+ (printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') +
1560
+ (printDate.getTime() == currentDate.getTime() ? ' ui-state-active' : '') + // highlight selected day
1561
+ (otherMonth ? ' ui-priority-secondary' : '') + // distinguish dates from other months
1562
+ '" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date
1563
+ printDate.setDate(printDate.getDate() + 1);
1564
+ printDate = this._daylightSavingAdjust(printDate);
1565
+ }
1566
+ calender += tbody + '</tr>';
1567
+ }
1568
+ drawMonth++;
1569
+ if (drawMonth > 11) {
1570
+ drawMonth = 0;
1571
+ drawYear++;
1572
+ }
1573
+ calender += '</tbody></table>' + (isMultiMonth ? '</div>' +
1574
+ ((numMonths[0] > 0 && col == numMonths[1]-1) ? '<div class="ui-datepicker-row-break"></div>' : '') : '');
1575
+ group += calender;
1576
+ }
1577
+ html += group;
1578
+ }
1579
+ html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ?
1580
+ '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : '');
1581
+ inst._keyEvent = false;
1582
+ return html;
1583
+ },
1584
+
1585
+ /* Generate the month and year header. */
1586
+ _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
1587
+ secondary, monthNames, monthNamesShort) {
1588
+ var changeMonth = this._get(inst, 'changeMonth');
1589
+ var changeYear = this._get(inst, 'changeYear');
1590
+ var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');
1591
+ var html = '<div class="ui-datepicker-title">';
1592
+ var monthHtml = '';
1593
+ // month selection
1594
+ if (secondary || !changeMonth)
1595
+ monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span>';
1596
+ else {
1597
+ var inMinYear = (minDate && minDate.getFullYear() == drawYear);
1598
+ var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
1599
+ monthHtml += '<select class="ui-datepicker-month" ' +
1600
+ 'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' +
1601
+ '>';
1602
+ for (var month = 0; month < 12; month++) {
1603
+ if ((!inMinYear || month >= minDate.getMonth()) &&
1604
+ (!inMaxYear || month <= maxDate.getMonth()))
1605
+ monthHtml += '<option value="' + month + '"' +
1606
+ (month == drawMonth ? ' selected="selected"' : '') +
1607
+ '>' + monthNamesShort[month] + '</option>';
1608
+ }
1609
+ monthHtml += '</select>';
1610
+ }
1611
+ if (!showMonthAfterYear)
1612
+ html += monthHtml + (secondary || !(changeMonth && changeYear) ? '&#xa0;' : '');
1613
+ // year selection
1614
+ if ( !inst.yearshtml ) {
1615
+ inst.yearshtml = '';
1616
+ if (secondary || !changeYear)
1617
+ html += '<span class="ui-datepicker-year">' + drawYear + '</span>';
1618
+ else {
1619
+ // determine range of years to display
1620
+ var years = this._get(inst, 'yearRange').split(':');
1621
+ var thisYear = new Date().getFullYear();
1622
+ var determineYear = function(value) {
1623
+ var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) :
1624
+ (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) :
1625
+ parseInt(value, 10)));
1626
+ return (isNaN(year) ? thisYear : year);
1627
+ };
1628
+ var year = determineYear(years[0]);
1629
+ var endYear = Math.max(year, determineYear(years[1] || ''));
1630
+ year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
1631
+ endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
1632
+ inst.yearshtml += '<select class="ui-datepicker-year" ' +
1633
+ 'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' +
1634
+ '>';
1635
+ for (; year <= endYear; year++) {
1636
+ inst.yearshtml += '<option value="' + year + '"' +
1637
+ (year == drawYear ? ' selected="selected"' : '') +
1638
+ '>' + year + '</option>';
1639
+ }
1640
+ inst.yearshtml += '</select>';
1641
+
1642
+ html += inst.yearshtml;
1643
+ inst.yearshtml = null;
1644
+ }
1645
+ }
1646
+ html += this._get(inst, 'yearSuffix');
1647
+ if (showMonthAfterYear)
1648
+ html += (secondary || !(changeMonth && changeYear) ? '&#xa0;' : '') + monthHtml;
1649
+ html += '</div>'; // Close datepicker_header
1650
+ return html;
1651
+ },
1652
+
1653
+ /* Adjust one of the date sub-fields. */
1654
+ _adjustInstDate: function(inst, offset, period) {
1655
+ var year = inst.drawYear + (period == 'Y' ? offset : 0);
1656
+ var month = inst.drawMonth + (period == 'M' ? offset : 0);
1657
+ var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) +
1658
+ (period == 'D' ? offset : 0);
1659
+ var date = this._restrictMinMax(inst,
1660
+ this._daylightSavingAdjust(new Date(year, month, day)));
1661
+ inst.selectedDay = date.getDate();
1662
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
1663
+ inst.drawYear = inst.selectedYear = date.getFullYear();
1664
+ if (period == 'M' || period == 'Y')
1665
+ this._notifyChange(inst);
1666
+ },
1667
+
1668
+ /* Ensure a date is within any min/max bounds. */
1669
+ _restrictMinMax: function(inst, date) {
1670
+ var minDate = this._getMinMaxDate(inst, 'min');
1671
+ var maxDate = this._getMinMaxDate(inst, 'max');
1672
+ var newDate = (minDate && date < minDate ? minDate : date);
1673
+ newDate = (maxDate && newDate > maxDate ? maxDate : newDate);
1674
+ return newDate;
1675
+ },
1676
+
1677
+ /* Notify change of month/year. */
1678
+ _notifyChange: function(inst) {
1679
+ var onChange = this._get(inst, 'onChangeMonthYear');
1680
+ if (onChange)
1681
+ onChange.apply((inst.input ? inst.input[0] : null),
1682
+ [inst.selectedYear, inst.selectedMonth + 1, inst]);
1683
+ },
1684
+
1685
+ /* Determine the number of months to show. */
1686
+ _getNumberOfMonths: function(inst) {
1687
+ var numMonths = this._get(inst, 'numberOfMonths');
1688
+ return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));
1689
+ },
1690
+
1691
+ /* Determine the current maximum date - ensure no time components are set. */
1692
+ _getMinMaxDate: function(inst, minMax) {
1693
+ return this._determineDate(inst, this._get(inst, minMax + 'Date'), null);
1694
+ },
1695
+
1696
+ /* Find the number of days in a given month. */
1697
+ _getDaysInMonth: function(year, month) {
1698
+ return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
1699
+ },
1700
+
1701
+ /* Find the day of the week of the first of a month. */
1702
+ _getFirstDayOfMonth: function(year, month) {
1703
+ return new Date(year, month, 1).getDay();
1704
+ },
1705
+
1706
+ /* Determines if we should allow a "next/prev" month display change. */
1707
+ _canAdjustMonth: function(inst, offset, curYear, curMonth) {
1708
+ var numMonths = this._getNumberOfMonths(inst);
1709
+ var date = this._daylightSavingAdjust(new Date(curYear,
1710
+ curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
1711
+ if (offset < 0)
1712
+ date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
1713
+ return this._isInRange(inst, date);
1714
+ },
1715
+
1716
+ /* Is the given date in the accepted range? */
1717
+ _isInRange: function(inst, date) {
1718
+ var minDate = this._getMinMaxDate(inst, 'min');
1719
+ var maxDate = this._getMinMaxDate(inst, 'max');
1720
+ return ((!minDate || date.getTime() >= minDate.getTime()) &&
1721
+ (!maxDate || date.getTime() <= maxDate.getTime()));
1722
+ },
1723
+
1724
+ /* Provide the configuration settings for formatting/parsing. */
1725
+ _getFormatConfig: function(inst) {
1726
+ var shortYearCutoff = this._get(inst, 'shortYearCutoff');
1727
+ shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
1728
+ new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
1729
+ return {shortYearCutoff: shortYearCutoff,
1730
+ dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'),
1731
+ monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')};
1732
+ },
1733
+
1734
+ /* Format the given date for display. */
1735
+ _formatDate: function(inst, day, month, year) {
1736
+ if (!day) {
1737
+ inst.currentDay = inst.selectedDay;
1738
+ inst.currentMonth = inst.selectedMonth;
1739
+ inst.currentYear = inst.selectedYear;
1740
+ }
1741
+ var date = (day ? (typeof day == 'object' ? day :
1742
+ this._daylightSavingAdjust(new Date(year, month, day))) :
1743
+ this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
1744
+ return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst));
1745
+ }
1746
+ });
1747
+
1748
+ /*
1749
+ * Bind hover events for datepicker elements.
1750
+ * Done via delegate so the binding only occurs once in the lifetime of the parent div.
1751
+ * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
1752
+ */
1753
+ function bindHover(dpDiv) {
1754
+ var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a';
1755
+ return dpDiv.bind('mouseout', function(event) {
1756
+ var elem = $( event.target ).closest( selector );
1757
+ if ( !elem.length ) {
1758
+ return;
1759
+ }
1760
+ elem.removeClass( "ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover" );
1761
+ })
1762
+ .bind('mouseover', function(event) {
1763
+ var elem = $( event.target ).closest( selector );
1764
+ if ($.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0]) ||
1765
+ !elem.length ) {
1766
+ return;
1767
+ }
1768
+ elem.parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');
1769
+ elem.addClass('ui-state-hover');
1770
+ if (elem.hasClass('ui-datepicker-prev')) elem.addClass('ui-datepicker-prev-hover');
1771
+ if (elem.hasClass('ui-datepicker-next')) elem.addClass('ui-datepicker-next-hover');
1772
+ });
1773
+ }
1774
+
1775
+ /* jQuery extend now ignores nulls! */
1776
+ function extendRemove(target, props) {
1777
+ $.extend(target, props);
1778
+ for (var name in props)
1779
+ if (props[name] == null || props[name] == undefined)
1780
+ target[name] = props[name];
1781
+ return target;
1782
+ };
1783
+
1784
+ /* Determine whether an object is an array. */
1785
+ function isArray(a) {
1786
+ return (a && (($.browser.safari && typeof a == 'object' && a.length) ||
1787
+ (a.constructor && a.constructor.toString().match(/\Array\(\)/))));
1788
+ };
1789
+
1790
+ /* Invoke the datepicker functionality.
1791
+ @param options string - a command, optionally followed by additional parameters or
1792
+ Object - settings for attaching new datepicker functionality
1793
+ @return jQuery object */
1794
+ $.fn.datepicker = function(options){
1795
+
1796
+ /* Verify an empty collection wasn't passed - Fixes #6976 */
1797
+ if ( !this.length ) {
1798
+ return this;
1799
+ }
1800
+
1801
+ /* Initialise the date picker. */
1802
+ if (!$.datepicker.initialized) {
1803
+ $(document).mousedown($.datepicker._checkExternalClick).
1804
+ find('body').append($.datepicker.dpDiv);
1805
+ $.datepicker.initialized = true;
1806
+ }
1807
+
1808
+ var otherArgs = Array.prototype.slice.call(arguments, 1);
1809
+ if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget'))
1810
+ return $.datepicker['_' + options + 'Datepicker'].
1811
+ apply($.datepicker, [this[0]].concat(otherArgs));
1812
+ if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string')
1813
+ return $.datepicker['_' + options + 'Datepicker'].
1814
+ apply($.datepicker, [this[0]].concat(otherArgs));
1815
+ return this.each(function() {
1816
+ typeof options == 'string' ?
1817
+ $.datepicker['_' + options + 'Datepicker'].
1818
+ apply($.datepicker, [this].concat(otherArgs)) :
1819
+ $.datepicker._attachDatepicker(this, options);
1820
+ });
1821
+ };
1822
+
1823
+ $.datepicker = new Datepicker(); // singleton instance
1824
+ $.datepicker.initialized = false;
1825
+ $.datepicker.uuid = new Date().getTime();
1826
+ $.datepicker.version = "1.8.18";
1827
+
1828
+ // Workaround for #4055
1829
+ // Add another global to avoid noConflict issues with inline event handlers
1830
+ window['DP_jQuery_' + dpuuid] = $;
1831
+
1832
+ })(jQuery);
1833
+ :@created_atf1335716315.6687551��