webroar 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (402) hide show
  1. data/CHANGELOG +7 -0
  2. data/README +1 -1
  3. data/doc/user-guide.html +125 -85
  4. data/doc/user-guide.txt +2 -2
  5. data/lib/constant.rb +23 -16
  6. data/lib/db_connect.rb +2 -3
  7. data/lib/installer.rb +17 -10
  8. data/lib/user_interaction.rb +21 -10
  9. data/lib/webroar_command.rb +21 -23
  10. data/src/admin_panel/Gemfile +8 -0
  11. data/src/admin_panel/Rakefile +2 -5
  12. data/src/admin_panel/app/controllers/application_controller.rb +1 -1
  13. data/src/admin_panel/app/controllers/exceptions_controller.rb +25 -26
  14. data/src/admin_panel/app/controllers/graph_controller.rb +2 -1
  15. data/src/admin_panel/app/helpers/admin_helper.rb +1 -1
  16. data/src/admin_panel/app/{models → mailers}/mailer.rb +5 -8
  17. data/src/admin_panel/app/models/app.rb +1 -1
  18. data/src/admin_panel/app/models/app_exception.rb +15 -11
  19. data/src/admin_panel/app/models/app_time_sample.rb +40 -10
  20. data/src/admin_panel/app/models/application_specification.rb +71 -41
  21. data/src/admin_panel/app/models/resource_usage.rb +76 -55
  22. data/src/admin_panel/app/models/url_breakup_time_sample.rb +6 -11
  23. data/src/admin_panel/app/models/url_time_sample.rb +57 -13
  24. data/src/admin_panel/app/views/admin/_application_table.html.erb +5 -5
  25. data/src/admin_panel/app/views/admin/_feedback_partial.html.erb +4 -4
  26. data/src/admin_panel/app/views/admin/_report_bug_partial.html.erb +5 -5
  27. data/src/admin_panel/app/views/admin/change_password_form.html.erb +3 -3
  28. data/src/admin_panel/app/views/admin/configuration.html.erb +6 -6
  29. data/src/admin_panel/app/views/admin/home.html.erb +4 -4
  30. data/src/admin_panel/app/views/admin/index.html.erb +5 -5
  31. data/src/admin_panel/app/views/application_specification/_application_specification_form.html.erb +15 -6
  32. data/src/admin_panel/app/views/exceptions/_add_and_list_exception_classes.html.erb +7 -6
  33. data/src/admin_panel/app/views/exceptions/_exception_backtrace_partial.html.erb +1 -1
  34. data/src/admin_panel/app/views/exceptions/_exception_environment_partial.html.erb +30 -30
  35. data/src/admin_panel/app/views/exceptions/_exception_list_partial.html.erb +11 -11
  36. data/src/admin_panel/app/views/exceptions/_show.html.erb +8 -8
  37. data/src/admin_panel/app/views/exceptions/index.html.erb +0 -1
  38. data/src/admin_panel/app/views/graph/_get_database_data.html.erb +1 -1
  39. data/src/admin_panel/app/views/graph/_get_resource_usage_data_app.html.erb +2 -2
  40. data/src/admin_panel/app/views/graph/_get_resource_usage_data_server.html.erb +2 -2
  41. data/src/admin_panel/app/views/graph/_get_throughput_data.html.erb +2 -2
  42. data/src/admin_panel/app/views/graph/_get_url_data.html.erb +4 -4
  43. data/src/admin_panel/app/views/graph/_pie.html.erb +2 -2
  44. data/src/admin_panel/app/views/graph/_query_date.html.erb +1 -1
  45. data/src/admin_panel/app/views/graph/_query_period.html.erb +1 -1
  46. data/src/admin_panel/app/views/graph/_slider_partial.html.erb +5 -4
  47. data/src/admin_panel/app/views/graph/index.html.erb +0 -1
  48. data/src/admin_panel/app/views/headers/_add_expires_text_box.html.erb +5 -5
  49. data/src/admin_panel/app/views/headers/_expires_by_type_form.html.erb +1 -1
  50. data/src/admin_panel/app/views/headers/_headers_table.html.erb +12 -12
  51. data/src/admin_panel/app/views/layouts/application.html.erb +71 -51
  52. data/src/admin_panel/app/views/mail_specification/_current_spec.html.erb +4 -4
  53. data/src/admin_panel/app/views/mail_specification/_sendmail_form.html.erb +3 -3
  54. data/src/admin_panel/app/views/mail_specification/_smtp_form.html.erb +3 -3
  55. data/src/admin_panel/app/views/server_specification/_add_div.html.erb +4 -4
  56. data/src/admin_panel/app/views/server_specification/_ssl_support_form.html.erb +3 -2
  57. data/src/admin_panel/config.ru +4 -0
  58. data/src/admin_panel/config/application.rb +46 -0
  59. data/src/admin_panel/config/boot.rb +4 -112
  60. data/src/admin_panel/config/environment.rb +4 -85
  61. data/src/admin_panel/config/environments/development.rb +20 -13
  62. data/src/admin_panel/config/environments/production.rb +44 -17
  63. data/src/admin_panel/config/environments/test.rb +31 -18
  64. data/src/admin_panel/config/initializers/application_constants.rb +13 -11
  65. data/src/admin_panel/config/initializers/secret_token.rb +7 -0
  66. data/src/admin_panel/config/initializers/session_store.rb +8 -0
  67. data/src/admin_panel/config/initializers/ssl.rb +6 -2
  68. data/src/admin_panel/config/routes.rb +15 -57
  69. data/src/admin_panel/doc/README_FOR_APP +1 -1
  70. data/src/admin_panel/doc/app/ActionView.html +229 -0
  71. data/src/admin_panel/doc/app/ActionView/Helpers.html +229 -0
  72. data/src/admin_panel/doc/app/ActionView/Helpers/AssetTagHelper.html +277 -0
  73. data/src/admin_panel/doc/app/AdminController.html +814 -0
  74. data/src/admin_panel/doc/app/AdminHelper.html +495 -0
  75. data/src/admin_panel/doc/app/Analytics.html +272 -0
  76. data/src/admin_panel/doc/app/Analytics/Database.html +401 -0
  77. data/src/admin_panel/doc/app/Analytics/ResourceUsage.html +683 -0
  78. data/src/admin_panel/doc/app/Analytics/Throughput.html +488 -0
  79. data/src/admin_panel/doc/app/Analytics/Url.html +484 -0
  80. data/src/admin_panel/doc/app/Analytics/UrlBreakup.html +537 -0
  81. data/src/admin_panel/doc/app/App.html +489 -0
  82. data/src/admin_panel/doc/app/AppException.html +710 -0
  83. data/src/admin_panel/doc/app/AppTimeSample.html +620 -0
  84. data/src/admin_panel/doc/app/ApplicationController.html +239 -0
  85. data/src/admin_panel/doc/app/ApplicationHelper.html +296 -0
  86. data/src/admin_panel/doc/app/ApplicationSpecification.html +876 -0
  87. data/src/admin_panel/doc/app/ApplicationSpecificationController.html +552 -0
  88. data/src/admin_panel/doc/app/ApplicationSpecificationHelper.html +219 -0
  89. data/src/admin_panel/doc/app/Control.html +431 -0
  90. data/src/admin_panel/doc/app/ExceptionDetail.html +227 -0
  91. data/src/admin_panel/doc/app/ExceptionsController.html +754 -0
  92. data/src/admin_panel/doc/app/ExceptionsHelper.html +219 -0
  93. data/src/admin_panel/doc/app/GraphController.html +1101 -0
  94. data/src/admin_panel/doc/app/GraphHelper.html +285 -0
  95. data/src/admin_panel/doc/app/Headers.html +549 -0
  96. data/src/admin_panel/doc/app/HeadersController.html +507 -0
  97. data/src/admin_panel/doc/app/HeadersHelper.html +219 -0
  98. data/src/admin_panel/doc/app/MailSpecification.html +685 -0
  99. data/src/admin_panel/doc/app/MailSpecificationController.html +541 -0
  100. data/src/admin_panel/doc/app/MailSpecificationHelper.html +219 -0
  101. data/src/admin_panel/doc/app/Mailer.html +589 -0
  102. data/src/admin_panel/doc/app/Object.html +240 -0
  103. data/src/admin_panel/doc/app/PseudoModel.html +354 -0
  104. data/src/admin_panel/doc/app/ResourceUsage.html +656 -0
  105. data/src/admin_panel/doc/app/SCGI.html +674 -0
  106. data/src/admin_panel/doc/app/ServerSpecification.html +479 -0
  107. data/src/admin_panel/doc/app/ServerSpecificationController.html +500 -0
  108. data/src/admin_panel/doc/app/ServerSpecificationHelper.html +219 -0
  109. data/src/admin_panel/doc/app/SignalHelper.html +287 -0
  110. data/src/admin_panel/doc/app/UrlBreakupTimeSample.html +287 -0
  111. data/src/admin_panel/doc/app/UrlTimeSample.html +986 -0
  112. data/src/admin_panel/doc/app/User.html +290 -0
  113. data/src/admin_panel/doc/app/YAMLConfig.html +247 -0
  114. data/src/admin_panel/doc/app/YAMLWriter.html +284 -0
  115. data/src/admin_panel/doc/app/app/controllers/admin_controller_rb.html +52 -0
  116. data/src/admin_panel/doc/app/app/controllers/application_controller_rb.html +54 -0
  117. data/src/admin_panel/doc/app/app/controllers/application_specification_controller_rb.html +52 -0
  118. data/src/admin_panel/doc/app/app/controllers/exceptions_controller_rb.html +52 -0
  119. data/src/admin_panel/doc/app/app/controllers/graph_controller_rb.html +52 -0
  120. data/src/admin_panel/doc/app/app/controllers/headers_controller_rb.html +52 -0
  121. data/src/admin_panel/doc/app/app/controllers/mail_specification_controller_rb.html +52 -0
  122. data/src/admin_panel/doc/app/app/controllers/server_specification_controller_rb.html +52 -0
  123. data/src/admin_panel/doc/app/app/helpers/admin_helper_rb.html +52 -0
  124. data/src/admin_panel/doc/app/app/helpers/application_helper_rb.html +52 -0
  125. data/src/admin_panel/doc/app/app/helpers/application_specification_helper_rb.html +52 -0
  126. data/src/admin_panel/doc/app/app/helpers/exceptions_helper_rb.html +52 -0
  127. data/src/admin_panel/doc/app/app/helpers/graph_helper_rb.html +52 -0
  128. data/src/admin_panel/doc/app/app/helpers/headers_helper_rb.html +52 -0
  129. data/src/admin_panel/doc/app/app/helpers/mail_specification_helper_rb.html +52 -0
  130. data/src/admin_panel/doc/app/app/helpers/server_specification_helper_rb.html +52 -0
  131. data/src/admin_panel/doc/app/app/mailers/mailer_rb.html +56 -0
  132. data/src/admin_panel/doc/app/app/models/app_exception_rb.html +52 -0
  133. data/src/admin_panel/doc/app/app/models/app_rb.html +54 -0
  134. data/src/admin_panel/doc/app/app/models/app_time_sample_rb.html +52 -0
  135. data/src/admin_panel/doc/app/app/models/application_specification_rb.html +52 -0
  136. data/src/admin_panel/doc/app/app/models/exception_detail_rb.html +52 -0
  137. data/src/admin_panel/doc/app/app/models/headers_rb.html +52 -0
  138. data/src/admin_panel/doc/app/app/models/mail_specification_rb.html +52 -0
  139. data/src/admin_panel/doc/app/app/models/pseudo_model_rb.html +52 -0
  140. data/src/admin_panel/doc/app/app/models/resource_usage_rb.html +52 -0
  141. data/src/admin_panel/doc/app/app/models/server_specification_rb.html +52 -0
  142. data/src/admin_panel/doc/app/app/models/url_breakup_time_sample_rb.html +52 -0
  143. data/src/admin_panel/doc/app/app/models/url_time_sample_rb.html +52 -0
  144. data/src/admin_panel/doc/app/app/models/user_rb.html +52 -0
  145. data/src/admin_panel/doc/app/created.rid +42 -1
  146. data/src/admin_panel/doc/app/doc/README_FOR_APP.html +172 -0
  147. data/src/admin_panel/doc/app/images/brick.png +0 -0
  148. data/src/admin_panel/doc/app/images/brick_link.png +0 -0
  149. data/src/admin_panel/doc/app/images/bug.png +0 -0
  150. data/src/admin_panel/doc/app/images/bullet_black.png +0 -0
  151. data/src/admin_panel/doc/app/images/bullet_toggle_minus.png +0 -0
  152. data/src/admin_panel/doc/app/images/bullet_toggle_plus.png +0 -0
  153. data/src/admin_panel/doc/app/images/date.png +0 -0
  154. data/src/admin_panel/doc/app/images/find.png +0 -0
  155. data/src/admin_panel/doc/app/images/loadingAnimation.gif +0 -0
  156. data/src/admin_panel/doc/app/images/macFFBgHack.png +0 -0
  157. data/src/admin_panel/doc/app/images/package.png +0 -0
  158. data/src/admin_panel/doc/app/images/page_green.png +0 -0
  159. data/src/admin_panel/doc/app/images/page_white_text.png +0 -0
  160. data/src/admin_panel/doc/app/images/page_white_width.png +0 -0
  161. data/src/admin_panel/doc/app/images/plugin.png +0 -0
  162. data/src/admin_panel/doc/app/images/ruby.png +0 -0
  163. data/src/admin_panel/doc/app/images/tag_green.png +0 -0
  164. data/src/admin_panel/doc/app/images/wrench.png +0 -0
  165. data/src/admin_panel/doc/app/images/wrench_orange.png +0 -0
  166. data/src/admin_panel/doc/app/images/zoom.png +0 -0
  167. data/src/admin_panel/doc/app/index.html +564 -20
  168. data/src/admin_panel/doc/app/js/darkfish.js +116 -0
  169. data/src/admin_panel/doc/app/js/jquery.js +32 -0
  170. data/src/admin_panel/doc/app/js/quicksearch.js +114 -0
  171. data/src/admin_panel/doc/app/js/thickbox-compressed.js +10 -0
  172. data/src/admin_panel/doc/app/lib/asset_tag_helper_ext_rb.html +52 -0
  173. data/src/admin_panel/doc/app/lib/control_rb.html +58 -0
  174. data/src/admin_panel/doc/app/lib/graph_controller_extensions/database_analytics_rb.html +52 -0
  175. data/src/admin_panel/doc/app/lib/graph_controller_extensions/resource_usage_analytics_rb.html +52 -0
  176. data/src/admin_panel/doc/app/lib/graph_controller_extensions/throughput_analytics_rb.html +52 -0
  177. data/src/admin_panel/doc/app/lib/graph_controller_extensions/url_analytics_rb.html +52 -0
  178. data/src/admin_panel/doc/app/lib/graph_controller_extensions/url_breakup_analytics_rb.html +52 -0
  179. data/src/admin_panel/doc/app/lib/helper_rb.html +52 -0
  180. data/src/admin_panel/doc/app/lib/scgi_rb.html +54 -0
  181. data/src/admin_panel/doc/app/lib/yaml_writer_rb.html +52 -0
  182. data/src/admin_panel/doc/app/rdoc.css +763 -0
  183. data/src/admin_panel/lib/helper.rb +6 -2
  184. data/src/admin_panel/public/stylesheets/other/login.css +8 -4
  185. data/src/admin_panel/public/stylesheets/other/style.css +21 -17
  186. data/src/admin_panel/script/rails +6 -0
  187. data/src/admin_panel/test/test_helper.rb +2 -2
  188. data/src/admin_panel/vendor/plugins/calendar_date_select/History.txt +281 -0
  189. data/src/admin_panel/vendor/plugins/calendar_date_select/MIT-LICENSE +20 -0
  190. data/src/admin_panel/vendor/plugins/calendar_date_select/Manifest.txt +42 -0
  191. data/src/admin_panel/vendor/plugins/calendar_date_select/README.txt +17 -0
  192. data/src/admin_panel/vendor/plugins/calendar_date_select/Rakefile +37 -0
  193. data/src/admin_panel/vendor/plugins/calendar_date_select/VERSION +1 -0
  194. data/src/admin_panel/vendor/plugins/calendar_date_select/calendar_date_select.gemspec +95 -0
  195. data/src/admin_panel/vendor/plugins/calendar_date_select/init.rb +1 -0
  196. data/src/admin_panel/vendor/plugins/calendar_date_select/js_test/functional/cds_test.html +376 -0
  197. data/src/admin_panel/vendor/plugins/calendar_date_select/js_test/functional/format_iso_date_test.html +52 -0
  198. data/src/admin_panel/vendor/plugins/calendar_date_select/js_test/prototype.js +4184 -0
  199. data/src/admin_panel/vendor/plugins/calendar_date_select/js_test/test.css +40 -0
  200. data/src/admin_panel/vendor/plugins/calendar_date_select/js_test/unit/cds_helper_methods.html +46 -0
  201. data/src/admin_panel/vendor/plugins/calendar_date_select/js_test/unittest.js +564 -0
  202. data/src/admin_panel/vendor/plugins/calendar_date_select/lib/calendar_date_select.rb +33 -0
  203. data/src/admin_panel/vendor/plugins/calendar_date_select/lib/calendar_date_select/calendar_date_select.rb +122 -0
  204. data/src/admin_panel/vendor/plugins/calendar_date_select/lib/calendar_date_select/form_helpers.rb +237 -0
  205. data/src/admin_panel/vendor/plugins/calendar_date_select/lib/calendar_date_select/includes_helper.rb +29 -0
  206. data/src/admin_panel/vendor/plugins/calendar_date_select/public/blank_iframe.html +2 -0
  207. data/src/admin_panel/vendor/plugins/calendar_date_select/public/images/calendar_date_select/calendar.gif +0 -0
  208. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/calendar_date_select.js +459 -0
  209. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_american.js +35 -0
  210. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_danish.js +31 -0
  211. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_db.js +27 -0
  212. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_euro_24hr.js +7 -0
  213. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_euro_24hr_ymd.js +7 -0
  214. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_finnish.js +32 -0
  215. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_hyphen_ampm.js +37 -0
  216. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_iso_date.js +29 -0
  217. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_italian.js +24 -0
  218. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/ar.js +10 -0
  219. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/cs.js +11 -0
  220. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/da.js +11 -0
  221. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/de.js +11 -0
  222. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/es.js +11 -0
  223. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/fi.js +10 -0
  224. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/fr.js +11 -0
  225. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/hu.js +11 -0
  226. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/it.js +9 -0
  227. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/ja.js +11 -0
  228. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/nl.js +11 -0
  229. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/pl.js +11 -0
  230. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/pt.js +11 -0
  231. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/ru.js +10 -0
  232. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/sl.js +11 -0
  233. data/src/admin_panel/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/sv.js +9 -0
  234. data/src/admin_panel/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/blue.css +130 -0
  235. data/src/admin_panel/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/default.css +135 -0
  236. data/src/admin_panel/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/green.css +142 -0
  237. data/src/admin_panel/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/plain.css +128 -0
  238. data/src/admin_panel/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/red.css +135 -0
  239. data/src/admin_panel/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/silver.css +133 -0
  240. data/src/admin_panel/vendor/plugins/calendar_date_select/spec/calendar_date_select/calendar_date_select_spec.rb +14 -0
  241. data/src/admin_panel/vendor/plugins/calendar_date_select/spec/calendar_date_select/form_helpers_spec.rb +189 -0
  242. data/src/admin_panel/vendor/plugins/calendar_date_select/spec/calendar_date_select/includes_helper_spec.rb +46 -0
  243. data/src/admin_panel/vendor/plugins/calendar_date_select/spec/spec_helper.rb +26 -0
  244. data/src/admin_panel/vendor/plugins/open_flash_chart_2_plugin/install.rb +2 -2
  245. data/src/admin_panel/vendor/plugins/open_flash_chart_2_plugin/uninstall.rb +2 -2
  246. data/src/admin_panel/vendor/plugins/prototype_legacy_helper/README.markdown +13 -0
  247. data/src/admin_panel/vendor/plugins/prototype_legacy_helper/init.rb +1 -0
  248. data/src/admin_panel/vendor/plugins/prototype_legacy_helper/lib/prototype_legacy_helper.rb +432 -0
  249. data/src/admin_panel/vendor/plugins/prototype_legacy_helper/test/test_prototype_helper.rb +297 -0
  250. data/src/helper/wr_config.c +1 -1
  251. data/src/ruby_lib/analyzer/message_analyzer.rb +1 -0
  252. data/src/ruby_lib/analyzer/webroar_analyzer.rb +2 -2
  253. data/src/ruby_lib/profiler/message_dispatcher.rb +1 -1
  254. data/src/ruby_lib/ruby_interface/version.rb +2 -2
  255. data/src/ruby_lib/webroar_app_loader.rb +1 -1
  256. data/tasks/gem.rake +5 -7
  257. data/tasks/test.rake +1 -0
  258. data/test/spec/analytics_spec.rb +25 -24
  259. data/test/spec/test_app/README +142 -129
  260. data/test/spec/test_app/Rakefile +2 -5
  261. data/test/spec/test_app/app/controllers/application_controller.rb +3 -8
  262. data/test/spec/test_app/app/controllers/test_controller.rb +3 -3
  263. data/test/spec/test_app/app/controllers/users_controller.rb +8 -8
  264. data/test/spec/test_app/app/helpers/application_helper.rb +2 -1
  265. data/test/spec/test_app/app/helpers/test_helper.rb +2 -0
  266. data/test/spec/test_app/app/helpers/users_helper.rb +2 -0
  267. data/test/spec/test_app/app/models/user.rb +2 -0
  268. data/test/spec/test_app/app/views/layouts/{users.html.erb → application.html.erb} +6 -9
  269. data/test/spec/test_app/app/views/test/post_data.html.erb +2 -2
  270. data/test/spec/test_app/app/views/test/upload_file.html.erb +1 -1
  271. data/test/spec/test_app/{db/migrate/20090602102438_create_users.rb → app/views/users/_form.html.erb} +22 -11
  272. data/test/spec/test_app/app/views/users/edit.html.erb +19 -28
  273. data/test/spec/test_app/app/views/users/index.html.erb +23 -19
  274. data/test/spec/test_app/app/views/users/new.html.erb +19 -28
  275. data/test/spec/test_app/app/views/users/show.html.erb +21 -18
  276. data/test/spec/test_app/config/application.rb +45 -0
  277. data/test/spec/test_app/config/boot.rb +4 -112
  278. data/test/spec/test_app/config/database.yml +1 -1
  279. data/test/spec/test_app/config/environment.rb +4 -41
  280. data/test/spec/test_app/config/environments/development.rb +22 -13
  281. data/test/spec/test_app/config/environments/production.rb +41 -20
  282. data/test/spec/test_app/config/environments/test.rb +35 -28
  283. data/test/spec/test_app/config/initializers/backtrace_silencers.rb +2 -2
  284. data/test/spec/test_app/config/initializers/inflections.rb +1 -1
  285. data/test/spec/test_app/config/initializers/secret_token.rb +7 -0
  286. data/test/spec/test_app/config/initializers/session_store.rb +3 -10
  287. data/test/spec/test_app/config/locales/en.yml +5 -0
  288. data/test/spec/test_app/config/routes.rb +37 -22
  289. data/test/spec/test_app/db/migrate/20110906113329_create_users.rb +13 -0
  290. data/test/spec/test_app/db/seeds.rb +7 -0
  291. data/test/spec/test_app/public/404.html +15 -19
  292. data/test/spec/test_app/public/422.html +15 -19
  293. data/test/spec/test_app/public/500.html +14 -18
  294. data/test/spec/test_app/public/index.html +41 -77
  295. data/test/spec/test_app/public/javascripts/controls.js +5 -3
  296. data/test/spec/test_app/public/javascripts/dragdrop.js +7 -6
  297. data/test/spec/test_app/public/javascripts/effects.js +8 -13
  298. data/test/spec/test_app/public/javascripts/prototype.js +3381 -1700
  299. data/test/spec/test_app/public/javascripts/rails.js +191 -0
  300. data/test/spec/test_app/public/stylesheets/scaffold.css +15 -13
  301. data/test/spec/test_app/script/rails +6 -0
  302. metadata +340 -163
  303. data/src/admin_panel/Gemfile.lock +0 -79
  304. data/src/admin_panel/doc/app/classes/ActionView.html +0 -111
  305. data/src/admin_panel/doc/app/classes/ActionView/Helpers.html +0 -111
  306. data/src/admin_panel/doc/app/classes/ActionView/Helpers/AssetTagHelper.html +0 -149
  307. data/src/admin_panel/doc/app/classes/AdminController.html +0 -628
  308. data/src/admin_panel/doc/app/classes/AdminHelper.html +0 -482
  309. data/src/admin_panel/doc/app/classes/Analytics.html +0 -138
  310. data/src/admin_panel/doc/app/classes/Analytics/Database.html +0 -245
  311. data/src/admin_panel/doc/app/classes/Analytics/ResourceUsage.html +0 -478
  312. data/src/admin_panel/doc/app/classes/Analytics/Throughput.html +0 -316
  313. data/src/admin_panel/doc/app/classes/Analytics/Url.html +0 -314
  314. data/src/admin_panel/doc/app/classes/Analytics/UrlBreakup.html +0 -372
  315. data/src/admin_panel/doc/app/classes/App.html +0 -298
  316. data/src/admin_panel/doc/app/classes/AppException.html +0 -330
  317. data/src/admin_panel/doc/app/classes/AppTimeSample.html +0 -427
  318. data/src/admin_panel/doc/app/classes/ApplicationController.html +0 -118
  319. data/src/admin_panel/doc/app/classes/ApplicationHelper.html +0 -172
  320. data/src/admin_panel/doc/app/classes/ApplicationSpecification.html +0 -641
  321. data/src/admin_panel/doc/app/classes/ApplicationSpecificationController.html +0 -354
  322. data/src/admin_panel/doc/app/classes/Control.html +0 -273
  323. data/src/admin_panel/doc/app/classes/ExceptionsController.html +0 -612
  324. data/src/admin_panel/doc/app/classes/ExceptionsHelper.html +0 -105
  325. data/src/admin_panel/doc/app/classes/GraphController.html +0 -804
  326. data/src/admin_panel/doc/app/classes/GraphHelper.html +0 -164
  327. data/src/admin_panel/doc/app/classes/MailSpecification.html +0 -357
  328. data/src/admin_panel/doc/app/classes/MailSpecificationController.html +0 -304
  329. data/src/admin_panel/doc/app/classes/PseudoModel.html +0 -206
  330. data/src/admin_panel/doc/app/classes/ResourceUsage.html +0 -425
  331. data/src/admin_panel/doc/app/classes/SCGI.html +0 -406
  332. data/src/admin_panel/doc/app/classes/ServerSpecification.html +0 -325
  333. data/src/admin_panel/doc/app/classes/ServerSpecificationController.html +0 -273
  334. data/src/admin_panel/doc/app/classes/UrlBreakupTimeSample.html +0 -169
  335. data/src/admin_panel/doc/app/classes/UrlTimeSample.html +0 -708
  336. data/src/admin_panel/doc/app/classes/User.html +0 -165
  337. data/src/admin_panel/doc/app/classes/YAMLWriter.html +0 -159
  338. data/src/admin_panel/doc/app/files/app/controllers/admin_controller_rb.html +0 -101
  339. data/src/admin_panel/doc/app/files/app/controllers/application_controller_rb.html +0 -108
  340. data/src/admin_panel/doc/app/files/app/controllers/application_specification_controller_rb.html +0 -101
  341. data/src/admin_panel/doc/app/files/app/controllers/exceptions_controller_rb.html +0 -101
  342. data/src/admin_panel/doc/app/files/app/controllers/graph_controller_rb.html +0 -101
  343. data/src/admin_panel/doc/app/files/app/controllers/mail_specification_controller_rb.html +0 -101
  344. data/src/admin_panel/doc/app/files/app/controllers/server_specification_controller_rb.html +0 -101
  345. data/src/admin_panel/doc/app/files/app/helpers/admin_helper_rb.html +0 -101
  346. data/src/admin_panel/doc/app/files/app/helpers/application_helper_rb.html +0 -101
  347. data/src/admin_panel/doc/app/files/app/helpers/exceptions_helper_rb.html +0 -101
  348. data/src/admin_panel/doc/app/files/app/helpers/graph_helper_rb.html +0 -101
  349. data/src/admin_panel/doc/app/files/app/models/app_exception_rb.html +0 -101
  350. data/src/admin_panel/doc/app/files/app/models/app_rb.html +0 -108
  351. data/src/admin_panel/doc/app/files/app/models/app_time_sample_rb.html +0 -101
  352. data/src/admin_panel/doc/app/files/app/models/application_specification_rb.html +0 -101
  353. data/src/admin_panel/doc/app/files/app/models/mail_specification_rb.html +0 -101
  354. data/src/admin_panel/doc/app/files/app/models/pseudo_model_rb.html +0 -101
  355. data/src/admin_panel/doc/app/files/app/models/resource_usage_rb.html +0 -101
  356. data/src/admin_panel/doc/app/files/app/models/server_specification_rb.html +0 -101
  357. data/src/admin_panel/doc/app/files/app/models/url_breakup_time_sample_rb.html +0 -101
  358. data/src/admin_panel/doc/app/files/app/models/url_time_sample_rb.html +0 -101
  359. data/src/admin_panel/doc/app/files/app/models/user_rb.html +0 -101
  360. data/src/admin_panel/doc/app/files/doc/README_FOR_APP.html +0 -109
  361. data/src/admin_panel/doc/app/files/lib/asset_tag_helper_ext_rb.html +0 -101
  362. data/src/admin_panel/doc/app/files/lib/control_rb.html +0 -110
  363. data/src/admin_panel/doc/app/files/lib/graph_controller_extensions/database_analytics_rb.html +0 -101
  364. data/src/admin_panel/doc/app/files/lib/graph_controller_extensions/resource_usage_analytics_rb.html +0 -101
  365. data/src/admin_panel/doc/app/files/lib/graph_controller_extensions/throughput_analytics_rb.html +0 -101
  366. data/src/admin_panel/doc/app/files/lib/graph_controller_extensions/url_analytics_rb.html +0 -101
  367. data/src/admin_panel/doc/app/files/lib/graph_controller_extensions/url_breakup_analytics_rb.html +0 -101
  368. data/src/admin_panel/doc/app/files/lib/scgi_rb.html +0 -101
  369. data/src/admin_panel/doc/app/files/lib/yaml_writer_rb.html +0 -101
  370. data/src/admin_panel/doc/app/fr_class_index.html +0 -60
  371. data/src/admin_panel/doc/app/fr_file_index.html +0 -58
  372. data/src/admin_panel/doc/app/fr_method_index.html +0 -206
  373. data/src/admin_panel/doc/app/rdoc-style.css +0 -208
  374. data/src/admin_panel/public/dispatch.cgi +0 -10
  375. data/src/admin_panel/public/dispatch.fcgi +0 -24
  376. data/src/admin_panel/public/dispatch.rb +0 -10
  377. data/src/admin_panel/script/about +0 -4
  378. data/src/admin_panel/script/console +0 -3
  379. data/src/admin_panel/script/dbconsole +0 -3
  380. data/src/admin_panel/script/destroy +0 -3
  381. data/src/admin_panel/script/generate +0 -3
  382. data/src/admin_panel/script/performance/benchmarker +0 -3
  383. data/src/admin_panel/script/performance/profiler +0 -3
  384. data/src/admin_panel/script/performance/request +0 -3
  385. data/src/admin_panel/script/plugin +0 -3
  386. data/src/admin_panel/script/process/inspector +0 -3
  387. data/src/admin_panel/script/process/reaper +0 -3
  388. data/src/admin_panel/script/process/spawner +0 -3
  389. data/src/admin_panel/script/runner +0 -3
  390. data/src/admin_panel/script/server +0 -3
  391. data/test/spec/test_app/config/initializers/new_rails_defaults.rb +0 -19
  392. data/test/spec/test_app/script/about +0 -4
  393. data/test/spec/test_app/script/console +0 -3
  394. data/test/spec/test_app/script/dbconsole +0 -3
  395. data/test/spec/test_app/script/destroy +0 -3
  396. data/test/spec/test_app/script/generate +0 -3
  397. data/test/spec/test_app/script/performance/benchmarker +0 -3
  398. data/test/spec/test_app/script/performance/profiler +0 -3
  399. data/test/spec/test_app/script/plugin +0 -3
  400. data/test/spec/test_app/script/runner +0 -3
  401. data/test/spec/test_app/script/server +0 -3
  402. data/test/spec/test_app/vendor/.placeholder +0 -0
@@ -0,0 +1,20 @@
1
+ All portions Copyright (c) 2007 Tim Harper
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,42 @@
1
+ History.txt
2
+ init.rb
3
+ js_test/functional/cds_test.html
4
+ js_test/prototype.js
5
+ js_test/test.css
6
+ js_test/unit/cds_helper_methods.html
7
+ js_test/unittest.js
8
+ lib/calendar_date_select/calendar_date_select.rb
9
+ lib/calendar_date_select/includes_helper.rb
10
+ lib/calendar_date_select/form_helpers.rb
11
+ lib/calendar_date_select.rb
12
+ Manifest.txt
13
+ MIT-LICENSE
14
+ public/blank_iframe.html
15
+ public/images/calendar_date_select/calendar.gif
16
+ public/javascripts/calendar_date_select/calendar_date_select.js
17
+ public/javascripts/calendar_date_select/format_american.js
18
+ public/javascripts/calendar_date_select/format_db.js
19
+ public/javascripts/calendar_date_select/format_euro_24hr.js
20
+ public/javascripts/calendar_date_select/format_euro_24hr_ymd.js
21
+ public/javascripts/calendar_date_select/format_finnish.js
22
+ public/javascripts/calendar_date_select/format_hyphen_ampm.js
23
+ public/javascripts/calendar_date_select/format_iso_date.js
24
+ public/javascripts/calendar_date_select/format_italian.js
25
+ public/javascripts/calendar_date_select/locale/de.js
26
+ public/javascripts/calendar_date_select/locale/fi.js
27
+ public/javascripts/calendar_date_select/locale/fr.js
28
+ public/javascripts/calendar_date_select/locale/pl.js
29
+ public/javascripts/calendar_date_select/locale/pt.js
30
+ public/javascripts/calendar_date_select/locale/ru.js
31
+ public/stylesheets/calendar_date_select/blue.css
32
+ public/stylesheets/calendar_date_select/default.css
33
+ public/stylesheets/calendar_date_select/plain.css
34
+ public/stylesheets/calendar_date_select/red.css
35
+ public/stylesheets/calendar_date_select/silver.css
36
+ Rakefile
37
+ README.txt
38
+ spec/
39
+ spec/calendar_date_select
40
+ spec/calendar_date_select/calendar_date_select_spec.rb
41
+ spec/calendar_date_select/form_helpers_spec.rb
42
+ spec/spec_helper.rb
@@ -0,0 +1,17 @@
1
+ = CalendarDateSelect
2
+
3
+ http://code.google.com/p/calendardateselect/
4
+
5
+ * This project is looking for a new maintainer. Please contact me if you have sufficient interest in this project to move it forward.
6
+
7
+ == Examples
8
+
9
+ "See a demo here":http://electronicholas.com/calendar
10
+
11
+ == Submitting patches
12
+
13
+ Please take care to do the following:
14
+
15
+ * Clean up your patch (don't send a patch bomb with a hundred features in one)
16
+ * Write test cases!
17
+ * As a general rule of thumb, think of ways to make things more general purpose than specific.
@@ -0,0 +1,37 @@
1
+ # -*- ruby -*-
2
+
3
+
4
+ begin
5
+ require 'rubygems'
6
+ require 'jeweler'
7
+ Jeweler::Tasks.new do |gemspec|
8
+ gemspec.name = "calendar_date_select"
9
+ gemspec.version = File.read("VERSION").strip
10
+ gemspec.summary = "Calendar date picker for rails"
11
+ gemspec.description = "Calendar date picker for rails"
12
+ gemspec.email = ""
13
+ gemspec.homepage = "http://github.com/timcharper/calendar_date_select"
14
+ gemspec.authors = ["Shih-gian Lee", "Enrique Garcia Cota (kikito)", "Tim Charper", "Lars E. Hoeg"]
15
+ end
16
+ rescue LoadError
17
+ puts "Jeweler not available. Install it with: sudo gem install jeweler"
18
+ end
19
+
20
+ desc "Set the current gem version in the code according to the VERSION file"
21
+ task :set_version do
22
+ VERSION=File.read("VERSION").strip
23
+ ["lib/calendar_date_select/calendar_date_select.rb", "public/javascripts/calendar_date_select/calendar_date_select.js"].each do |file|
24
+ abs_file = File.dirname(__FILE__) + "/" + file
25
+ src = File.read(abs_file)
26
+ src = src.map do |line|
27
+ case line
28
+ when /^ *VERSION/ then " VERSION = '#{VERSION}'\n"
29
+ when /^\/\/ CalendarDateSelect version / then "// CalendarDateSelect version #{VERSION} - a prototype based date picker\n"
30
+ else
31
+ line
32
+ end
33
+ end.join
34
+ File.open(abs_file, "wb") { |f| f << src }
35
+ end
36
+ end
37
+ # vim: syntax=Ruby
@@ -0,0 +1,95 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{calendar_date_select}
8
+ s.version = "1.16.3"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Shih-gian Lee", "Enrique Garcia Cota (kikito)", "Tim Charper", "Lars E. Hoeg"]
12
+ s.date = %q{2010-03-29}
13
+ s.description = %q{Calendar date picker for rails}
14
+ s.email = %q{}
15
+ s.extra_rdoc_files = [
16
+ "README.txt"
17
+ ]
18
+ s.files = [
19
+ ".gitignore",
20
+ "History.txt",
21
+ "MIT-LICENSE",
22
+ "Manifest.txt",
23
+ "README.txt",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "calendar_date_select.gemspec",
27
+ "init.rb",
28
+ "js_test/functional/.tmp_cds_test.html",
29
+ "js_test/functional/cds_test.html",
30
+ "js_test/functional/format_iso_date_test.html",
31
+ "js_test/prototype.js",
32
+ "js_test/test.css",
33
+ "js_test/unit/cds_helper_methods.html",
34
+ "js_test/unittest.js",
35
+ "lib/calendar_date_select.rb",
36
+ "lib/calendar_date_select/calendar_date_select.rb",
37
+ "lib/calendar_date_select/form_helpers.rb",
38
+ "lib/calendar_date_select/includes_helper.rb",
39
+ "public/blank_iframe.html",
40
+ "public/images/calendar_date_select/calendar.gif",
41
+ "public/javascripts/calendar_date_select/calendar_date_select.js",
42
+ "public/javascripts/calendar_date_select/format_american.js",
43
+ "public/javascripts/calendar_date_select/format_danish.js",
44
+ "public/javascripts/calendar_date_select/format_db.js",
45
+ "public/javascripts/calendar_date_select/format_euro_24hr.js",
46
+ "public/javascripts/calendar_date_select/format_euro_24hr_ymd.js",
47
+ "public/javascripts/calendar_date_select/format_finnish.js",
48
+ "public/javascripts/calendar_date_select/format_hyphen_ampm.js",
49
+ "public/javascripts/calendar_date_select/format_iso_date.js",
50
+ "public/javascripts/calendar_date_select/format_italian.js",
51
+ "public/javascripts/calendar_date_select/locale/ar.js",
52
+ "public/javascripts/calendar_date_select/locale/da.js",
53
+ "public/javascripts/calendar_date_select/locale/de.js",
54
+ "public/javascripts/calendar_date_select/locale/es.js",
55
+ "public/javascripts/calendar_date_select/locale/fi.js",
56
+ "public/javascripts/calendar_date_select/locale/fr.js",
57
+ "public/javascripts/calendar_date_select/locale/it.js",
58
+ "public/javascripts/calendar_date_select/locale/nl.js",
59
+ "public/javascripts/calendar_date_select/locale/pl.js",
60
+ "public/javascripts/calendar_date_select/locale/pt.js",
61
+ "public/javascripts/calendar_date_select/locale/ru.js",
62
+ "public/javascripts/calendar_date_select/locale/sl.js",
63
+ "public/stylesheets/calendar_date_select/blue.css",
64
+ "public/stylesheets/calendar_date_select/default.css",
65
+ "public/stylesheets/calendar_date_select/green.css",
66
+ "public/stylesheets/calendar_date_select/plain.css",
67
+ "public/stylesheets/calendar_date_select/red.css",
68
+ "public/stylesheets/calendar_date_select/silver.css",
69
+ "spec/calendar_date_select/calendar_date_select_spec.rb",
70
+ "spec/calendar_date_select/form_helpers_spec.rb",
71
+ "spec/calendar_date_select/includes_helper_spec.rb",
72
+ "spec/spec_helper.rb"
73
+ ]
74
+ s.homepage = %q{http://github.com/timcharper/calendar_date_select}
75
+ s.rdoc_options = ["--charset=UTF-8"]
76
+ s.require_paths = ["lib"]
77
+ s.rubygems_version = %q{1.3.6}
78
+ s.summary = %q{Calendar date picker for rails}
79
+ s.test_files = [
80
+ "spec/calendar_date_select/calendar_date_select_spec.rb",
81
+ "spec/calendar_date_select/form_helpers_spec.rb",
82
+ "spec/calendar_date_select/includes_helper_spec.rb",
83
+ "spec/spec_helper.rb"
84
+ ]
85
+
86
+ if s.respond_to? :specification_version then
87
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
88
+ s.specification_version = 3
89
+
90
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
91
+ else
92
+ end
93
+ else
94
+ end
95
+ end
@@ -0,0 +1 @@
1
+ require File.dirname(__FILE__) + "/lib/calendar_date_select.rb"
@@ -0,0 +1,376 @@
1
+
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <title>Calendar Date Select Test Cases</title>
7
+ <script src="../prototype.js" type="text/javascript"></script>
8
+ <script src="../unittest.js" type="text/javascript"></script>
9
+ <!-- other JavaScript includes -->
10
+ <script src="../../public/javascripts/calendar_date_select/calendar_date_select.js" type="text/javascript"></script>
11
+
12
+ <link rel="stylesheet" href="../../public/stylesheets/calendar_date_select/red.css" type="text/css" />
13
+ <link rel="stylesheet" href="../test.css" type="text/css" />
14
+ </head>
15
+ <body>
16
+
17
+ <!-- Log output -->
18
+ <div id="testlog"> </div>
19
+
20
+ <!-- here go any elements you do the testing on -->
21
+ <div id="cds_test_div">
22
+ <input type="text" id="cds_test" />
23
+ </div>
24
+ <div id="cds_status"></div>
25
+
26
+ <!-- Tests -->
27
+ <script type="text/javascript" language="javascript">
28
+ // <![CDATA[
29
+ new Test.Unit.Runner({
30
+ setup: function() { with(this){
31
+ $("cds_test").value="";
32
+ $("cds_test").disabled = false;
33
+ $("cds_test").readOnly = false;
34
+ }},
35
+ teardown: function() { with(this){
36
+ if (typeof(cds)!="undefined") assert(cds.closed,"all tests should close their calendar control");
37
+ Date.first_day_of_week = 0;
38
+ Date.weekdays = $w("S M T W T F S")
39
+ }},
40
+ testMixedTime_feedDateWithAndWithoutTime_shouldSetAccordingly: function() { with(this) {
41
+ $A(["January 2, 2007 5:00 pm", "January 2, 2007 0:00 pm"]).each(function(d) {
42
+ $("cds_test").value=d;
43
+ cds = new CalendarDateSelect($("cds_test"), {time: "mixed"});
44
+ assertEqual(true, cds.use_time);
45
+ cds.close();
46
+ })
47
+
48
+ $("cds_test").value="January 2, 2007";
49
+ cds = new CalendarDateSelect($("cds_test"), {time: "mixed"});
50
+ assertEqual(false, cds.use_time);
51
+ cds.close();
52
+ }},
53
+ testTodayNowButton_mixedMode_shouldSetUseTimeAccordingly: function() { with(this){
54
+ cds = new CalendarDateSelect($("cds_test"), {time: "mixed"});
55
+ today_now = $$(".cds_buttons a[href=#]");
56
+ today_now[0].onclick();
57
+ assertEqual(false, cds.use_time, "when clicking today link");
58
+
59
+ today_now[1].onclick();
60
+ assertEqual(true, cds.use_time, "should have been true when clicking now link");
61
+ cds.close();
62
+ }},
63
+ test__selectMar_23_2008__shouldSelectCorrectDate: function() { with(this){
64
+ $("cds_test").value = "Mar 1, 2008"
65
+ cds = new CalendarDateSelect($("cds_test"), {time: "true"});
66
+ cds.updateSelectedDate({month: 2 /*+1*/, day: 23, year: 2008})
67
+
68
+ assertEqual("23", $$('td.selected div').first().innerHTML);
69
+ cds.close();
70
+ }},
71
+ test_updateSelectedDate: function() { with(this){
72
+ $("cds_test").value = "January 1, 2007"
73
+ cds = new CalendarDateSelect($("cds_test"), {time: "mixed"});
74
+
75
+ cds.use_time=true;
76
+ cds.updateSelectedDate({hour: ""})
77
+ assertEqual(false, cds.use_time, "when setting hour to ''");
78
+
79
+ cds.use_time=true;
80
+ cds.updateSelectedDate({minute: ""})
81
+ assertEqual(false, cds.use_time, "when setting minute to ''");
82
+
83
+ cds.use_time=false;
84
+ cds.updateSelectedDate({hour: 0})
85
+ assertEqual(true, cds.use_time, "when setting hour to 0");
86
+
87
+ cds.use_time=false;
88
+ cds.updateSelectedDate({minute: 0})
89
+ assertEqual(true, cds.use_time, "when setting minute to 0");
90
+
91
+ cds.close();
92
+ }},
93
+ test_navYear: function() { with(this){
94
+ $("cds_test").value = "January 1, 2007";
95
+ cds = new CalendarDateSelect($("cds_test"), {time: "mixed"});
96
+ cds.navYear(1870);
97
+ assertEqual(2007, cds.selected_date.getFullYear());
98
+ assertEqual(1870, cds.date.getFullYear());
99
+ cds.close();
100
+ }},
101
+ test_navMonth: function() { with(this){
102
+ $("cds_test").value = "January 1, 2007";
103
+ cds = new CalendarDateSelect($("cds_test"), {time: "mixed"});
104
+ cds.navMonth(5);
105
+ assertEqual(0, cds.selected_date.getMonth());
106
+ assertEqual(5, cds.date.getMonth())
107
+ cds.close();
108
+ }},
109
+ test_callBacks: function() { with(this){
110
+ $("cds_test").up().build("div", {id: "global"});
111
+ cds = new CalendarDateSelect($("cds_test"), {time: "mixed",
112
+ before_show: function() { $("global").before_show_called = true},
113
+ after_show: function() { $("global").after_show_called = true},
114
+ before_close: function() { $("global").before_close_called = true},
115
+ after_close: function() { $("global").after_close_called = true},
116
+ after_navigate: function() { $("global").after_navigate_called = true},
117
+ onchange: function() { $("global").onchange_called = true},
118
+ });
119
+ cds.navMonth(1);
120
+ cds.navMonth(10);
121
+ cds.updateSelectedDate({month: 1, day: 3, year: 2007});
122
+ cds.close();
123
+ assert($('global').before_show_called, "before_show wasnt called");
124
+ assert($('global').after_show_called, "after_show wasnt called");
125
+ assert($('global').before_close_called, "before_close wasnt called");
126
+ assert($('global').after_close_called, "after_close wasnt called");
127
+ assert($('global').after_navigate_called, "after_navigate wasnt called");
128
+ assert($('global').onchange_called, "onchange wasnt called");
129
+ $("global").remove();
130
+ }},
131
+ test_onchangeCallbackChangedOnclear: function() { with(this){
132
+ $("cds_test").up().build("div", {id: "global"});
133
+ cds = new CalendarDateSelect($("cds_test"), {time: "mixed",
134
+ onchange: function() { $("global").onchange_called = true},
135
+ });
136
+ $("cds_test").value = "";
137
+ cds.clearDate();
138
+ assert( ! $('global').onchange_called, "onchange was called, when the value wasn't actually changed");
139
+ $("cds_test").value = "boogy";
140
+ cds.clearDate();
141
+ assert( $('global').onchange_called, "onchange wasnt called, but should ahve been");
142
+ cds.close();
143
+ $("global").remove();
144
+ }},
145
+
146
+ test_disabledElement_cantUpdate: function() {with(this){
147
+ $("cds_test").value = "May 10, 2007";
148
+ $("cds_test").disabled = true;
149
+ cds = new CalendarDateSelect($("cds_test"));
150
+
151
+ runTest = function() {
152
+ cds.updateSelectedDate({day: 1, month:0, year: 2007});
153
+ assertEqual(10, cds.selected_date.getDate())
154
+ }
155
+ runTest();
156
+ $("cds_test").disabled = false;
157
+ $("cds_test").readOnly = true;
158
+ runTest();
159
+
160
+ $("cds_test").readOnly = false;
161
+ cds.close();
162
+ }},
163
+ test_readOnlyElement_forcePopup_shouldUpdate: function() {with(this){
164
+ $("cds_test").value = "May 10, 2007";
165
+ $("cds_test").readOnly = true;
166
+ cds = new CalendarDateSelect($("cds_test"), {popup: "force"});
167
+
168
+ cds.updateSelectedDate({day: 1, month:0, year: 2007});
169
+ assertEqual(1, cds.selected_date.getDate())
170
+
171
+ $("cds_test").readOnly = false;
172
+ cds.close();
173
+ }},
174
+ test_timePassed_notUsingTime_shouldIgnore: function() {with(this) {
175
+ $("cds_test").value = "May 10, 2007 5:00 pm";
176
+ cds = new CalendarDateSelect($("cds_test"), {time:false});
177
+ assert(cds.closeOnClick(), "should set close_on_click to true when not using time")
178
+ assertEqual(false, cds.use_time, "When parsing time");
179
+ cds.today();
180
+ assert(cds.closed, "should close when clicking today");
181
+ assert(!cds.use_time, "Should not use time when calling today");
182
+
183
+ cds = new CalendarDateSelect($("cds_test"), {time:false});
184
+ cds.updateSelectedDate({hours: 5, minutes:30}) // this will close the control
185
+ assertEqual(false, cds.use_time, "When setting hour/minute");
186
+ assert(cds.closed);
187
+ }},
188
+ test_setUseTime_true_notUsingTime_shouldIgnore: function() {with(this) {
189
+ $("cds_test").value = "May 10, 2007 5:00 pm";
190
+ cds = new CalendarDateSelect($("cds_test"), {time:false});
191
+ assertEqual(false, cds.use_time, "When parsing time");
192
+ cds.setUseTime(true); // this will close the control
193
+ assert(! cds.use_time, "After calling setUseTime(true)");
194
+ cds.close();
195
+ }},
196
+ test_setMinute_notOnInterval_usesFloor: function() {with(this){
197
+ $("cds_test").value = "May 10, 2007 5:25 pm";
198
+ cds = new CalendarDateSelect($("cds_test"), {time:true});
199
+ cds.updateSelectedDate({hour: 1, minute: 4});
200
+ assertEqual(0, cds.selected_date.getMinutes());
201
+ assertEqual(1, cds.selected_date.getHours());
202
+
203
+ cds.close();
204
+ }},
205
+ // this checks for a safari 2 bug where safari parses "" as a date back in 1969
206
+ test_parseDate_blankInput_interpretsAsNotSelected: function() {with(this){
207
+ $("cds_test").value = " ";
208
+ cds = new CalendarDateSelect($("cds_test"), {time:true});
209
+ assertEqual(new Date().getFullYear(), cds.selected_date.getFullYear());
210
+ assertEqual(new Date().getFullYear(), cds.date.getFullYear());
211
+ assert(! cds.selection_made)
212
+ cds.close();
213
+ }},
214
+ test_parseDate_timeTrue_noTimePassed_useTimeSetToTrueAnyway: function() {with(this){
215
+ $("cds_test").value = "December 1, 2007 ";
216
+ cds = new CalendarDateSelect($("cds_test"), {time:true});
217
+ assert(cds.use_time)
218
+ cds.close();
219
+ }},
220
+ test_parseDate_defaultTime_javaScriptFunctionPassed_shouldReturnDateFromJavaScriptFunction: function() {with(this){
221
+ $("cds_test").value = " ";
222
+ cds = new CalendarDateSelect($("cds_test"), {default_time:function() { return new Date('January 02, 2008 2:00 PM') }});
223
+ assertEqual('2008', cds.selected_date.getFullYear());
224
+ assertEqual('2008', cds.date.getFullYear());
225
+ assert(cds.selection_made)
226
+ cds.close();
227
+ }},
228
+ test_parseDate_defaultTime_javaScriptDatePassed_shouldReturnJavaScriptDate: function() {with(this){
229
+ $("cds_test").value = " ";
230
+ cds = new CalendarDateSelect($("cds_test"), {default_time:new Date('January 02, 2007 05:45 PM') });
231
+ assertEqual('2007', cds.selected_date.getFullYear());
232
+ assertEqual('2007', cds.date.getFullYear());
233
+ assert(cds.selection_made)
234
+ cds.close();
235
+ }},
236
+ test_passDivElement__shouldUseChildInputForTargetElement: function() {with(this){
237
+ cds = new CalendarDateSelect($("cds_test_div"), {time:true});
238
+ assertEqual("INPUT", cds.target_element.nodeName)
239
+ cds.close();
240
+ }},
241
+ test__flexibleYearRange__datePassedWayBackWhen__shouldInitYearSelectAroundDate: function() {with(this){
242
+ $("cds_test").value = "July 4, 1776";
243
+ cds = new CalendarDateSelect($("cds_test_div"), {time:true});
244
+ assert(cds.flexibleYearRange(), " should have had a flexibleYearRange");
245
+ assert(cds.year_select.setValue(1776), "Should have allowed me to select 1776");
246
+ cds.close();
247
+ }},
248
+ test__nonflexibleYearRange__dateRangeAtEnds__shouldntAllowNavigationPassedBoundary: function() {with(this){
249
+ $("cds_test").value = "January 1, 2007";
250
+ cds = new CalendarDateSelect($("cds_test"), {time:true, year_range: [2007, 2007]});
251
+
252
+ assert(! cds.navYear(2006), "should not allow year navigation outside of boundary");
253
+ assert(! cds.navYear(2008), "should not allow year navigation outside of boundary");
254
+ assert(! cds.navMonth(-1), "shouldnt allow me to go beyond boundary");
255
+ assert(! cds.navMonth(13), "shouldnt allow me to go beyond boundary");
256
+ assert(cds.navMonth(1), "should allow me to be in boundary");
257
+ assert(cds.navYear(2007), "should allow me to be in boundary");
258
+ cds.close();
259
+ }},
260
+ test__nonflexibleYearRange__shouldPopulateRange: function() {with(this){
261
+ $("cds_test").value = "January 1, 2007";
262
+ cds = new CalendarDateSelect($("cds_test"), {time:true, year_range: [2007, 2007]});
263
+ assert(cds.year_select.setValue(2007), "should allow me to select 2007");
264
+ cds.close();
265
+ }},
266
+ test__nonflexibleYearRange__initializedWithDateOutsideOfRange__shouldShowNavDateAsClosestToOutsideYear: function() {with(this){
267
+ $("cds_test").value = "January 1, 1900";
268
+ cds = new CalendarDateSelect($("cds_test"), {time:true, year_range: [1997, 2007]});
269
+ assertEqual(1997, cds.date.getFullYear(), "When going lesser than year_range");
270
+ cds.close();
271
+
272
+ $("cds_test").value = "January 1, 2010";
273
+ cds = new CalendarDateSelect($("cds_test"), {time:true, year_range: [1997, 2007]});
274
+ assertEqual(2007, cds.date.getFullYear(), "When going greater than year_range");
275
+
276
+ cds.close();
277
+ }},
278
+ test__nonflexibleYearRange__initializedWithDateInsideOfRange__shouldShowNavDateAsYear: function() {with(this){
279
+ $("cds_test").value = "January 1, 2005";
280
+ cds = new CalendarDateSelect($("cds_test"), {year_range: [1997, 2007]});
281
+ assertEqual(2005, cds.date.getFullYear(), "When going lesser than year_range");
282
+ cds.close();
283
+ }},
284
+ test__flexibleYearRange__goToBoundary__shouldRefreshRange: function() {with(this){
285
+ $("cds_test").value = "January 1, 2007";
286
+ cds = new CalendarDateSelect($("cds_test"), {year_range: 10});
287
+ cds.navYear(1997);
288
+ assert(cds.year_select.setValue(1987), "should have refreshed with 1997 as the center");
289
+ cds.navYear(2017);
290
+ assert(cds.year_select.setValue(2027), "should have refreshed with 2027 as the center");
291
+ cds.close();
292
+ }},
293
+ test__should_show_iframe_only_in_ie: function() {with(this){
294
+ cds = new CalendarDateSelect($("cds_test"));
295
+
296
+ if (navigator.appName=="Microsoft Internet Explorer")
297
+ assertEqual(1, $$('iframe.ie6_blocker').length)
298
+ else
299
+ assertEqual(0, $$('iframe.ie6_blocker').length)
300
+
301
+ cds.close();
302
+ }},
303
+ test__should_populate_minute_box_according_to_minute_interval: function() {with(this){
304
+ cds = new CalendarDateSelect($("cds_test"), {time: true, minute_interval: 10});
305
+ assert(cds.minute_select.setValue(0), "should allow me to select 0 minutes" );
306
+ assert(!cds.minute_select.setValue(5), "should NOT allow me to select 5 minutes");
307
+ assert(cds.minute_select.setValue(10), "should allow me to select 10 minutes" );
308
+ cds.close();
309
+ }},
310
+ test__shouldnt_leak_variables: function() {with (this) {
311
+ var vars = $w("padded2 compare_date str minute hour value e above e_dim e_top e_left matched e_bottom e_height c_pos c_left c_top c_height left_px top_px top_div header_div body_div buttons_div footer_div bottom_div days_tbody row_number cell_index weekday that pre_days use_time m y hover_date x d o")
312
+ vars.each(function(v) {eval(v + " = -100");});
313
+
314
+ cds = new CalendarDateSelect($("cds_test"), {time: true});
315
+ cds.navMonth(1);
316
+ cds.navYear(2);
317
+ cds.dayHover($$('.cds_body td').first());
318
+ cds.updateSelectedDate({day:1, month:1, year:2007});
319
+ cds.close();
320
+
321
+ vars.each(function(v) {
322
+ assert(-100 == eval(v), "Variable " + v + " was leaked");
323
+ });
324
+ }},
325
+ test__valid_date__shouldnt_allow_selection_of_invalid_dates_and_should_apply_css: function() {with (this) {
326
+ $('cds_test').value = "December 11, 2007";
327
+ cds = new CalendarDateSelect($("cds_test"), {valid_date_check: function(date) { return date < new Date("December 13, 2007")}, time: "mixed"});
328
+ assertEqual("December 11, 2007", $F('cds_test'));
329
+ cds.updateSelectedDate({day:13, month:12-1, year:2007});
330
+ assertEqual("December 11, 2007", $F('cds_test'), "Date should not have been allowed to be selected");
331
+ cds.updateSelectedDate({day:10, month:12-1, year:2007});
332
+ assertEqual("December 10, 2007", $F('cds_test'), "Date should not have been allowed to be selected");
333
+
334
+ day_12_element = $$('.calendar_date_select td')[17];
335
+ day_13_element = $$('.calendar_date_select td')[18];
336
+ assertEqual(12, day_12_element.day); // make sure we have th right one
337
+ assertEqual(13, day_13_element.day); // make sure we have th right one
338
+ assert( ! day_12_element.hasClassName("disabled"), "Day 12 shouldnt be disabled");
339
+ assert(day_13_element.hasClassName("disabled"), "Day 13 should be disabled");
340
+
341
+ cds.close();
342
+ }},
343
+ test__valid_date_check_is_nil__should_show_all_cells_as_enabled: function() {with (this) {
344
+ $('cds_test').value = "December 11, 2007";
345
+ cds = new CalendarDateSelect($("cds_test"));
346
+
347
+ $$('.calendar_date_select td').each(function(e){
348
+ assert( ! e.hasClassName("disabled"));
349
+ });
350
+
351
+ cds.close();
352
+ }},
353
+ test__should_pull_up_dec_07_when_first_day_of_week_is_1: function() {with (this) {
354
+ Date.first_day_of_week = 1;
355
+ Date.weekdays = $w("M T W T F S S");
356
+ $('cds_test').value = "December 1, 2007";
357
+ cds = new CalendarDateSelect($("cds_test"));
358
+
359
+ assertEqual(1, $$(".calendar_date_select").length);
360
+ cds.close();
361
+ }},
362
+ test__dynamic_onchange_should_be_fired: function() {with (this) {
363
+ Event.observe($('cds_test'), 'change', function()
364
+ { $('cds_status').innerHTML='calendar input changed';
365
+ });
366
+ cds = new CalendarDateSelect($("cds_test"), {time: "mixed"});
367
+ today_now = $$(".cds_buttons a[href=#]");
368
+ today_now[0].onclick();
369
+ assertMatch('calendar input changed', $('cds_status').innerHTML, "status div should indicate date changed");
370
+ cds.close();
371
+ }}
372
+ });
373
+ // ]]>
374
+ </script>
375
+ </body>
376
+ </html>