spiderfw 0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (638) hide show
  1. data/README +4 -0
  2. data/Rakefile +74 -0
  3. data/apps/cas_server/_init.rb +23 -0
  4. data/apps/cas_server/config/options.rb +9 -0
  5. data/apps/cas_server/controllers/mixins/cas_login_mixin.rb +353 -0
  6. data/apps/cas_server/lib/cas.rb +329 -0
  7. data/apps/cas_server/lib/utils.rb +30 -0
  8. data/apps/cas_server/models/login_ticket.rb +11 -0
  9. data/apps/cas_server/models/mixins/consumable.rb +10 -0
  10. data/apps/cas_server/models/proxy_granting_ticket.rb +12 -0
  11. data/apps/cas_server/models/proxy_ticket.rb +12 -0
  12. data/apps/cas_server/models/service_ticket.rb +22 -0
  13. data/apps/cas_server/models/ticket.rb +20 -0
  14. data/apps/cas_server/models/ticket_granting_ticket.rb +15 -0
  15. data/apps/cas_server/views/logout.shtml +3 -0
  16. data/apps/core/admin/_init.rb +23 -0
  17. data/apps/core/admin/admin.rb +17 -0
  18. data/apps/core/admin/controllers/admin_controller.rb +15 -0
  19. data/apps/core/admin/views/index.shtml +1 -0
  20. data/apps/core/admin/views/spider_admin.layout.shtml +23 -0
  21. data/apps/core/admin/widgets/admin_menu/admin_menu.rb +17 -0
  22. data/apps/core/auth/_init.rb +42 -0
  23. data/apps/core/auth/controllers/login_controller.rb +94 -0
  24. data/apps/core/auth/controllers/mixins/auth_helper.rb +114 -0
  25. data/apps/core/auth/controllers/mixins/http_basic_auth.rb +24 -0
  26. data/apps/core/auth/controllers/mixins/http_digest_auth.rb +26 -0
  27. data/apps/core/auth/lib/authenticable.rb +86 -0
  28. data/apps/core/auth/lib/authenticator.rb +11 -0
  29. data/apps/core/auth/lib/digest_authenticator.rb +44 -0
  30. data/apps/core/auth/lib/login_authenticator.rb +27 -0
  31. data/apps/core/auth/models/digest_user.rb +34 -0
  32. data/apps/core/auth/models/group.rb +22 -0
  33. data/apps/core/auth/models/login_user.rb +15 -0
  34. data/apps/core/auth/models/mixins/access_control.rb +71 -0
  35. data/apps/core/auth/models/mixins/authentication_tracking.rb +19 -0
  36. data/apps/core/auth/models/super_user.rb +8 -0
  37. data/apps/core/auth/models/user.rb +15 -0
  38. data/apps/core/auth/po/it/spider_auth.po +33 -0
  39. data/apps/core/auth/po/spider_auth.pot +31 -0
  40. data/apps/core/auth/views/login.shtml +25 -0
  41. data/apps/core/components/_init.rb +21 -0
  42. data/apps/core/components/po/it/spider_components.po +52 -0
  43. data/apps/core/components/po/spider_components.pot +53 -0
  44. data/apps/core/components/public/css/admin.css +73 -0
  45. data/apps/core/components/public/css/crud.css +58 -0
  46. data/apps/core/components/public/css/img/add.gif +0 -0
  47. data/apps/core/components/public/css/img/ajax-loader.gif +0 -0
  48. data/apps/core/components/public/css/img/back.gif +0 -0
  49. data/apps/core/components/public/css/img/bg_header.png +0 -0
  50. data/apps/core/components/public/css/img/body_bg.jpg +0 -0
  51. data/apps/core/components/public/css/img/gray_gradient.gif +0 -0
  52. data/apps/core/components/public/css/img/li_bg.png +0 -0
  53. data/apps/core/components/public/css/img/li_bg_active.png +0 -0
  54. data/apps/core/components/public/css/img/li_bg_hover.png +0 -0
  55. data/apps/core/components/public/css/img/logo.png +0 -0
  56. data/apps/core/components/public/css/img/menu_bg.png +0 -0
  57. data/apps/core/components/public/css/img/menu_bottom.png +0 -0
  58. data/apps/core/components/public/css/img/menu_top.png +0 -0
  59. data/apps/core/components/public/css/img/section-bottom.jpg +0 -0
  60. data/apps/core/components/public/css/list.css +7 -0
  61. data/apps/core/components/public/css/menu.css +47 -0
  62. data/apps/core/components/public/css/spider.css +9 -0
  63. data/apps/core/components/public/css/switcher.css +13 -0
  64. data/apps/core/components/public/css/table.css +99 -0
  65. data/apps/core/components/public/js/inheritance.js +71 -0
  66. data/apps/core/components/public/js/jquery/jquery-1.3.2.js +4376 -0
  67. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  68. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  69. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  70. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  71. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  72. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  73. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  74. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  75. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
  76. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  77. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
  78. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
  79. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  80. data/apps/core/components/public/js/jquery/jquery-ui/css/smoothness/jquery-ui-1.7.2.custom.css +406 -0
  81. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  82. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  83. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  84. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  85. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  86. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  87. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  88. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  89. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  90. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  91. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  92. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  93. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  94. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  95. data/apps/core/components/public/js/jquery/jquery-ui/css/ui-lightness/jquery-ui-1.7.2.custom.css +406 -0
  96. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/AUTHORS.txt +30 -0
  97. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/GPL-LICENSE.txt +278 -0
  98. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/MIT-LICENSE.txt +25 -0
  99. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/ChangeLog.txt +20 -0
  100. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/META.json +32 -0
  101. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.js +100 -0
  102. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.min.js +10 -0
  103. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/jquery.bgiframe.pack.js +10 -0
  104. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/bgiframe/test/index.html +197 -0
  105. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.js +97 -0
  106. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.min.js +10 -0
  107. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.pack.js +10 -0
  108. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/cookie/jquery.cookie.zip +0 -0
  109. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/jsdiff/jsdiff.js +159 -0
  110. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/qunit/testrunner.js +780 -0
  111. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/qunit/testsuite.css +120 -0
  112. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/external/simulate/jquery.simulate.js +152 -0
  113. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/jquery-1.3.2.js +4376 -0
  114. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  115. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  116. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  117. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  118. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  119. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  120. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  121. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  122. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_222222_256x240.png +0 -0
  123. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
  124. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_454545_256x240.png +0 -0
  125. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_888888_256x240.png +0 -0
  126. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
  127. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.accordion.css +9 -0
  128. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.all.css +2 -0
  129. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.base.css +8 -0
  130. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.core.css +37 -0
  131. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.datepicker.css +62 -0
  132. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.dialog.css +13 -0
  133. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.progressbar.css +4 -0
  134. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.resizable.css +13 -0
  135. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.slider.css +17 -0
  136. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.tabs.css +11 -0
  137. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/base/ui.theme.css +245 -0
  138. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  139. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  140. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  141. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  142. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  143. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  144. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  145. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  146. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  147. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  148. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  149. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  150. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  151. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  152. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/jquery-ui-1.7.2.custom.css +406 -0
  153. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.accordion.css +9 -0
  154. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.all.css +2 -0
  155. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.base.css +8 -0
  156. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.core.css +37 -0
  157. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.datepicker.css +62 -0
  158. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.dialog.css +13 -0
  159. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.progressbar.css +4 -0
  160. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.resizable.css +13 -0
  161. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.slider.css +17 -0
  162. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.tabs.css +11 -0
  163. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/themes/ui-lightness/ui.theme.css +247 -0
  164. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.blind.js +49 -0
  165. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.bounce.js +78 -0
  166. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.clip.js +54 -0
  167. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.core.js +545 -0
  168. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.drop.js +50 -0
  169. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.explode.js +79 -0
  170. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.fold.js +56 -0
  171. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.highlight.js +48 -0
  172. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.pulsate.js +56 -0
  173. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.scale.js +180 -0
  174. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.shake.js +57 -0
  175. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.slide.js +50 -0
  176. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/effects.transfer.js +45 -0
  177. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/jquery-ui-i18n.js +771 -0
  178. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ar.js +20 -0
  179. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-bg.js +20 -0
  180. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ca.js +19 -0
  181. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-cs.js +19 -0
  182. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-da.js +19 -0
  183. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-de.js +19 -0
  184. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-el.js +19 -0
  185. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-eo.js +19 -0
  186. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-es.js +19 -0
  187. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-fa.js +19 -0
  188. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-fi.js +19 -0
  189. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-fr.js +19 -0
  190. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-he.js +19 -0
  191. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-hr.js +19 -0
  192. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-hu.js +19 -0
  193. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-hy.js +19 -0
  194. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-id.js +19 -0
  195. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-is.js +19 -0
  196. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-it.js +19 -0
  197. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ja.js +20 -0
  198. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ko.js +19 -0
  199. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-lt.js +19 -0
  200. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-lv.js +19 -0
  201. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ms.js +19 -0
  202. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-nl.js +19 -0
  203. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-no.js +19 -0
  204. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-pl.js +19 -0
  205. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-pt-BR.js +19 -0
  206. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ro.js +22 -0
  207. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-ru.js +19 -0
  208. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sk.js +19 -0
  209. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sl.js +20 -0
  210. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sq.js +19 -0
  211. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sr-SR.js +19 -0
  212. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sr.js +19 -0
  213. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-sv.js +19 -0
  214. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-th.js +19 -0
  215. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-tr.js +19 -0
  216. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-uk.js +25 -0
  217. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-zh-CN.js +19 -0
  218. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/i18n/ui.datepicker-zh-TW.js +19 -0
  219. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/jquery-ui-1.7.2.custom.js +9133 -0
  220. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.accordion.js +477 -0
  221. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.core.js +519 -0
  222. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.datepicker.js +1636 -0
  223. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.dialog.js +671 -0
  224. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.draggable.js +766 -0
  225. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.droppable.js +282 -0
  226. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.progressbar.js +116 -0
  227. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.resizable.js +800 -0
  228. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.selectable.js +257 -0
  229. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.slider.js +558 -0
  230. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.sortable.js +1019 -0
  231. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/ui/ui.tabs.js +685 -0
  232. data/apps/core/components/public/js/jquery/jquery-ui/development-bundle/version.txt +1 -0
  233. data/apps/core/components/public/js/jquery/jquery-ui/index.html +367 -0
  234. data/apps/core/components/public/js/jquery/jquery-ui/js/jquery-1.3.2.min.js +19 -0
  235. data/apps/core/components/public/js/jquery/jquery-ui/js/jquery-ui-1.7.2.custom.min.js +298 -0
  236. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/changelog.txt +27 -0
  237. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.css +48 -0
  238. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.js +808 -0
  239. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.min.js +13 -0
  240. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/jquery.autocomplete.pack.js +12 -0
  241. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.ajaxQueue.js +116 -0
  242. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.bgiframe.min.js +10 -0
  243. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/jquery.js +3558 -0
  244. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/thickbox-compressed.js +10 -0
  245. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/lib/thickbox.css +163 -0
  246. data/apps/core/components/public/js/jquery/plugins/jquery-autocomplete/todo +166 -0
  247. data/apps/core/components/public/js/jquery/plugins/jquery.form.js +653 -0
  248. data/apps/core/components/public/js/jquery/plugins/jquery.query-2.1.6.js +224 -0
  249. data/apps/core/components/public/js/jquery/plugins/jquery.url.js +214 -0
  250. data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.js +187 -0
  251. data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.1.0.min.js +1 -0
  252. data/apps/core/components/public/js/jquery/plugins/jtree/jquery.jtree.spider.1.0.js +193 -0
  253. data/apps/core/components/public/js/jquery/plugins/treeview/changelog.txt +35 -0
  254. data/apps/core/components/public/js/jquery/plugins/treeview/images/ajax-loader.gif +0 -0
  255. data/apps/core/components/public/js/jquery/plugins/treeview/images/file.gif +0 -0
  256. data/apps/core/components/public/js/jquery/plugins/treeview/images/folder-closed.gif +0 -0
  257. data/apps/core/components/public/js/jquery/plugins/treeview/images/folder.gif +0 -0
  258. data/apps/core/components/public/js/jquery/plugins/treeview/images/minus.gif +0 -0
  259. data/apps/core/components/public/js/jquery/plugins/treeview/images/plus.gif +0 -0
  260. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-black-line.gif +0 -0
  261. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-black.gif +0 -0
  262. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-default-line.gif +0 -0
  263. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-default.gif +0 -0
  264. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-famfamfam-line.gif +0 -0
  265. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-famfamfam.gif +0 -0
  266. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-gray-line.gif +0 -0
  267. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-gray.gif +0 -0
  268. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-red-line.gif +0 -0
  269. data/apps/core/components/public/js/jquery/plugins/treeview/images/treeview-red.gif +0 -0
  270. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.async.js +110 -0
  271. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.css +74 -0
  272. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.edit.js +37 -0
  273. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.js +256 -0
  274. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.min.js +15 -0
  275. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.pack.js +16 -0
  276. data/apps/core/components/public/js/jquery/plugins/treeview/jquery.treeview.sortable.js +386 -0
  277. data/apps/core/components/public/js/jquery/plugins/treeview/lib/jquery.cookie.js +92 -0
  278. data/apps/core/components/public/js/jquery/plugins/treeview/lib/jquery.js +3534 -0
  279. data/apps/core/components/public/js/jquery/plugins/treeview/todo +8 -0
  280. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/LICENSE +0 -0
  281. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/README +0 -0
  282. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/jquery.timepickr.css +34 -0
  283. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/jquery.timepickr.js +1413 -0
  284. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/jquery.timepickr.min.js +10 -0
  285. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/222222_256x240_icons_icons.png +0 -0
  286. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/2e83ff_256x240_icons_icons.png +0 -0
  287. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/454545_256x240_icons_icons.png +0 -0
  288. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/888888_256x240_icons_icons.png +0 -0
  289. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/aaaaaa_40x100_textures_01_flat_0.png +0 -0
  290. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/cccccc_40x100_textures_03_highlight_soft_75.png +0 -0
  291. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/cd0a0a_256x240_icons_icons.png +0 -0
  292. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/dadada_40x100_textures_02_glass_75.png +0 -0
  293. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/e6e6e6_40x100_textures_02_glass_75.png +0 -0
  294. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/fbf9ee_40x100_textures_02_glass_55.png +0 -0
  295. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/fef1ec_40x100_textures_05_inset_soft_95.png +0 -0
  296. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/ffffff_40x100_textures_02_glass_65.png +0 -0
  297. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/images/ffffff_40x100_textures_02_glass_75.png +0 -0
  298. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.accordion.css +9 -0
  299. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.all.css +4 -0
  300. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.allplugins.css +7 -0
  301. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.core.css +37 -0
  302. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.datepicker.css +60 -0
  303. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.dialog.css +13 -0
  304. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.progressbar.css +4 -0
  305. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.resizable.css +13 -0
  306. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.slider.css +13 -0
  307. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.tabs.css +9 -0
  308. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.theme.css +238 -0
  309. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/themes/default/ui.timepickr.css +44 -0
  310. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/ui.timepickr.js +2307 -0
  311. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/dist/ui.timepickr.min.js +10 -0
  312. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/body-bg.png +0 -0
  313. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/btn-hover.png +0 -0
  314. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/btn.png +0 -0
  315. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/buttons.psd +0 -0
  316. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/index.html +326 -0
  317. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.anchorHandler.js +44 -0
  318. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.strings.js +290 -0
  319. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.ui.all.js +518 -0
  320. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.utils.js +255 -0
  321. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/jquery.utils.ui.min.js +26 -0
  322. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo-ff.png +0 -0
  323. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo-ie.png +0 -0
  324. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo.png +0 -0
  325. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/logo.psd +0 -0
  326. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/package.png +0 -0
  327. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/reset.css +48 -0
  328. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/script_code.png +0 -0
  329. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/styles.css +308 -0
  330. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/themeroller_ready_black_200px.gif +0 -0
  331. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/page/weather_sun.png +0 -0
  332. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/css/ui.dropslide.css +26 -0
  333. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/css/ui.timepickr.css +18 -0
  334. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/ui.dropslide.js +132 -0
  335. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/src/ui.timepickr.js +217 -0
  336. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/data/testrunner.js +1 -0
  337. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/index.html +34 -0
  338. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/otherlibs/jquery/1.2.1/jquery.js +11 -0
  339. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/otherlibs/jquery/1.2.3/jquery.js +11 -0
  340. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/qunit/testrunner.js +780 -0
  341. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/qunit/testsuite.css +120 -0
  342. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/styles.css +201 -0
  343. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/test.js +41 -0
  344. data/apps/core/components/public/js/jquery/plugins/ui-timepickr/test/unit/ui.timepickr.js +154 -0
  345. data/apps/core/components/public/js/list.js +234 -0
  346. data/apps/core/components/public/js/spider.js +484 -0
  347. data/apps/core/components/public/widgets/search_table.js +10 -0
  348. data/apps/core/components/public/widgets/table.js +9 -0
  349. data/apps/core/components/widgets/admin/admin.rb +75 -0
  350. data/apps/core/components/widgets/admin/admin.shtml +16 -0
  351. data/apps/core/components/widgets/confirm/confirm.rb +37 -0
  352. data/apps/core/components/widgets/confirm/confirm.shtml +9 -0
  353. data/apps/core/components/widgets/crud/crud.rb +119 -0
  354. data/apps/core/components/widgets/crud/crud.shtml +59 -0
  355. data/apps/core/components/widgets/crud/form_table/form_table.rb +13 -0
  356. data/apps/core/components/widgets/crud/form_table/form_table.shtml +3 -0
  357. data/apps/core/components/widgets/list/list.rb +294 -0
  358. data/apps/core/components/widgets/list/list.shtml +38 -0
  359. data/apps/core/components/widgets/list/plugins/exportable/exportable_list.rb +19 -0
  360. data/apps/core/components/widgets/list/plugins/exportable/exportable_list.shtml +5 -0
  361. data/apps/core/components/widgets/menu/menu.rb +20 -0
  362. data/apps/core/components/widgets/menu/menu.shtml +13 -0
  363. data/apps/core/components/widgets/search_table/search_table.rb +22 -0
  364. data/apps/core/components/widgets/search_table/search_table.shtml +11 -0
  365. data/apps/core/components/widgets/switcher/switcher.rb +68 -0
  366. data/apps/core/components/widgets/switcher/switcher.shtml +17 -0
  367. data/apps/core/components/widgets/table/table.rb +153 -0
  368. data/apps/core/components/widgets/table/table.shtml +41 -0
  369. data/apps/core/components/widgets/tabs/tabs.rb +38 -0
  370. data/apps/core/components/widgets/tabs/tabs.shtml +2 -0
  371. data/apps/core/forms/_init.rb +22 -0
  372. data/apps/core/forms/po/it/spider_forms.po +36 -0
  373. data/apps/core/forms/po/spider_forms.pot +37 -0
  374. data/apps/core/forms/public/date_time.js +23 -0
  375. data/apps/core/forms/public/form.css +81 -0
  376. data/apps/core/forms/public/form.js +19 -0
  377. data/apps/core/forms/public/input.js +30 -0
  378. data/apps/core/forms/public/search_select.js +123 -0
  379. data/apps/core/forms/public/select.js +11 -0
  380. data/apps/core/forms/tags/element_label.erb +1 -0
  381. data/apps/core/forms/tags/element_row.erb +4 -0
  382. data/apps/core/forms/tags/row.erb +4 -0
  383. data/apps/core/forms/widgets/form/form.rb +430 -0
  384. data/apps/core/forms/widgets/form/form.shtml +47 -0
  385. data/apps/core/forms/widgets/inputs/checkbox/checkbox.rb +13 -0
  386. data/apps/core/forms/widgets/inputs/checkbox/checkbox.shtml +3 -0
  387. data/apps/core/forms/widgets/inputs/date_time/date_time.rb +48 -0
  388. data/apps/core/forms/widgets/inputs/date_time/date_time.shtml +4 -0
  389. data/apps/core/forms/widgets/inputs/hidden/hidden.rb +8 -0
  390. data/apps/core/forms/widgets/inputs/hidden/hidden.shtml +3 -0
  391. data/apps/core/forms/widgets/inputs/input/input.rb +105 -0
  392. data/apps/core/forms/widgets/inputs/input/input.shtml +3 -0
  393. data/apps/core/forms/widgets/inputs/input/readonly.shtml +6 -0
  394. data/apps/core/forms/widgets/inputs/password/password.rb +24 -0
  395. data/apps/core/forms/widgets/inputs/password/password.shtml +5 -0
  396. data/apps/core/forms/widgets/inputs/search_select/search_select.rb +168 -0
  397. data/apps/core/forms/widgets/inputs/search_select/search_select.shtml +42 -0
  398. data/apps/core/forms/widgets/inputs/select/select.rb +126 -0
  399. data/apps/core/forms/widgets/inputs/select/select.shtml +8 -0
  400. data/apps/core/forms/widgets/inputs/subform/subform.rb +10 -0
  401. data/apps/core/forms/widgets/inputs/subform/subform.shtml +5 -0
  402. data/apps/core/forms/widgets/inputs/text/text.rb +9 -0
  403. data/apps/core/forms/widgets/inputs/text/text.shtml +3 -0
  404. data/apps/core/forms/widgets/inputs/text_area/text_area.rb +10 -0
  405. data/apps/core/forms/widgets/inputs/text_area/text_area.shtml +1 -0
  406. data/apps/drb_server/_init.rb +8 -0
  407. data/apps/drb_server/lib/model_server.rb +41 -0
  408. data/apps/drb_server/script/start_server.rb +19 -0
  409. data/apps/hippo/_init.rb +10 -0
  410. data/apps/hippo/models/mixins/hippo_struct.rb +210 -0
  411. data/apps/hippo/models/security_group.rb +21 -0
  412. data/apps/hippo/models/security_user.rb +29 -0
  413. data/apps/messenger/_init.rb +24 -0
  414. data/apps/messenger/config/options.rb +15 -0
  415. data/apps/messenger/config/worker.rb +3 -0
  416. data/apps/messenger/controllers/messenger_controller.rb +80 -0
  417. data/apps/messenger/controllers/mixins/messenger_controller_mixin.rb +54 -0
  418. data/apps/messenger/lib/backends/email/smtp.rb +0 -0
  419. data/apps/messenger/messenger.rb +94 -0
  420. data/apps/messenger/models/email.rb +22 -0
  421. data/apps/messenger/models/message.rb +44 -0
  422. data/apps/messenger/po/it/spider_messenger.po +77 -0
  423. data/apps/messenger/po/spider_messenger.pot +77 -0
  424. data/apps/messenger/views/index.shtml +13 -0
  425. data/apps/messenger/views/list.shtml +5 -0
  426. data/apps/messenger/views/messenger.layout.shtml +4 -0
  427. data/apps/messenger/views/queue.shtml +8 -0
  428. data/apps/messenger/views/tags/sent_messages.shtml +1 -0
  429. data/apps/soap/_init.rb +16 -0
  430. data/apps/soap/controllers/soap_controller.rb +334 -0
  431. data/apps/soap/doc/examples/example.rb +28 -0
  432. data/apps/soap/lib/soap.rb +217 -0
  433. data/apps/sso/_init.rb +16 -0
  434. data/apps/sso/config/options.rb +13 -0
  435. data/apps/sso/controllers/mixins/saml2_mixin.rb +149 -0
  436. data/apps/sso/lib/saml2/backend.rb +16 -0
  437. data/apps/sso/lib/saml2/lasso_backend.rb +88 -0
  438. data/apps/sso/lib/saml2.rb +112 -0
  439. data/apps/sso/views/saml2_post.shtml +19 -0
  440. data/apps/webdav/_init.rb +15 -0
  441. data/apps/webdav/controllers/webdav_controller.rb +862 -0
  442. data/apps/webdav/lib/locking.rb +193 -0
  443. data/apps/webdav/lib/vfs/abstract.rb +78 -0
  444. data/apps/webdav/lib/vfs/local.rb +126 -0
  445. data/apps/webdav/lib/vfs/mapped.rb +235 -0
  446. data/apps/webdav/lib/vfs/properties.rb +41 -0
  447. data/apps/worker/_init.rb +13 -0
  448. data/apps/worker/cmd.rb +65 -0
  449. data/apps/worker/config/options.rb +9 -0
  450. data/apps/worker/lib/runner.rb +43 -0
  451. data/apps/worker/lib/task.rb +9 -0
  452. data/apps/worker/models/job.rb +20 -0
  453. data/apps/worker/worker.rb +168 -0
  454. data/bin/spider +9 -0
  455. data/blueprints/app/_init.rb +10 -0
  456. data/blueprints/app/controllers/__APP___controller.rb +14 -0
  457. data/blueprints/app/views/__APP__.layout.shtml +8 -0
  458. data/blueprints/app/views/index.shtml +3 -0
  459. data/blueprints/install/config/config.yml +14 -0
  460. data/blueprints/install/init.rb +3 -0
  461. data/data/locale/it/LC_MESSAGES/spider.mo +0 -0
  462. data/data/locale/it/LC_MESSAGES/spider_auth.mo +0 -0
  463. data/data/locale/it/LC_MESSAGES/spider_components.mo +0 -0
  464. data/data/locale/it/LC_MESSAGES/spider_forms.mo +0 -0
  465. data/data/locale/it/LC_MESSAGES/spider_messenger.mo +0 -0
  466. data/lib/spiderfw/app.rb +186 -0
  467. data/lib/spiderfw/autoload.rb +12 -0
  468. data/lib/spiderfw/cache/template_cache.rb +136 -0
  469. data/lib/spiderfw/cmd/cmd.rb +72 -0
  470. data/lib/spiderfw/cmd/commands/cert.rb +427 -0
  471. data/lib/spiderfw/cmd/commands/console.rb +27 -0
  472. data/lib/spiderfw/cmd/commands/init.rb +52 -0
  473. data/lib/spiderfw/cmd/commands/model.rb +131 -0
  474. data/lib/spiderfw/cmd/commands/setup.rb +54 -0
  475. data/lib/spiderfw/cmd/commands/test.rb +61 -0
  476. data/lib/spiderfw/cmd/commands/webserver.rb +93 -0
  477. data/lib/spiderfw/config/configurable.rb +38 -0
  478. data/lib/spiderfw/config/configuration.rb +281 -0
  479. data/lib/spiderfw/config/options/spider.rb +122 -0
  480. data/lib/spiderfw/controller/app_controller.rb +14 -0
  481. data/lib/spiderfw/controller/controller.rb +321 -0
  482. data/lib/spiderfw/controller/controller_exceptions.rb +27 -0
  483. data/lib/spiderfw/controller/controller_io.rb +26 -0
  484. data/lib/spiderfw/controller/controller_mixin.rb +12 -0
  485. data/lib/spiderfw/controller/cookie.rb +20 -0
  486. data/lib/spiderfw/controller/cookies.rb +17 -0
  487. data/lib/spiderfw/controller/dispatcher.rb +269 -0
  488. data/lib/spiderfw/controller/first_responder.rb +59 -0
  489. data/lib/spiderfw/controller/formats/html.rb +90 -0
  490. data/lib/spiderfw/controller/helpers/widget_helper.rb +73 -0
  491. data/lib/spiderfw/controller/home_controller.rb +26 -0
  492. data/lib/spiderfw/controller/http_controller.rb +112 -0
  493. data/lib/spiderfw/controller/mixins/http_mixin.rb +228 -0
  494. data/lib/spiderfw/controller/mixins/static_content.rb +90 -0
  495. data/lib/spiderfw/controller/mixins/visual.rb +489 -0
  496. data/lib/spiderfw/controller/page_controller.rb +39 -0
  497. data/lib/spiderfw/controller/request.rb +48 -0
  498. data/lib/spiderfw/controller/response.rb +50 -0
  499. data/lib/spiderfw/controller/router.rb +9 -0
  500. data/lib/spiderfw/controller/scene.rb +27 -0
  501. data/lib/spiderfw/controller/session/file_session.rb +83 -0
  502. data/lib/spiderfw/controller/session/flash_hash.rb +56 -0
  503. data/lib/spiderfw/controller/session/memory_session.rb +62 -0
  504. data/lib/spiderfw/controller/session/transient_hash.rb +18 -0
  505. data/lib/spiderfw/controller/session.rb +106 -0
  506. data/lib/spiderfw/controller/spider_controller.rb +20 -0
  507. data/lib/spiderfw/create.rb +64 -0
  508. data/lib/spiderfw/env.rb +17 -0
  509. data/lib/spiderfw/exceptions.rb +2 -0
  510. data/lib/spiderfw/home.rb +26 -0
  511. data/lib/spiderfw/http/adapters/cgi.rb +62 -0
  512. data/lib/spiderfw/http/adapters/cgi_io.rb +27 -0
  513. data/lib/spiderfw/http/adapters/fcgi.rb +62 -0
  514. data/lib/spiderfw/http/adapters/mongrel.rb +207 -0
  515. data/lib/spiderfw/http/adapters/rack.rb +152 -0
  516. data/lib/spiderfw/http/adapters/thin.rb +38 -0
  517. data/lib/spiderfw/http/adapters/webrick.rb +176 -0
  518. data/lib/spiderfw/http/http.rb +297 -0
  519. data/lib/spiderfw/http/server.rb +40 -0
  520. data/lib/spiderfw/i18n/cldr.rb +114 -0
  521. data/lib/spiderfw/i18n/gettext.rb +8 -0
  522. data/lib/spiderfw/i18n/i18n.rb +120 -0
  523. data/lib/spiderfw/i18n/provider.rb +12 -0
  524. data/lib/spiderfw/i18n/rails.rb +89 -0
  525. data/lib/spiderfw/i18n/shtml_parser.rb +41 -0
  526. data/lib/spiderfw/model/active_record.rb +335 -0
  527. data/lib/spiderfw/model/base_model.rb +2068 -0
  528. data/lib/spiderfw/model/condition.rb +416 -0
  529. data/lib/spiderfw/model/data_type.rb +75 -0
  530. data/lib/spiderfw/model/datatypes/binary.rb +10 -0
  531. data/lib/spiderfw/model/datatypes/bool.rb +10 -0
  532. data/lib/spiderfw/model/datatypes/decimal.rb +22 -0
  533. data/lib/spiderfw/model/datatypes/email.rb +13 -0
  534. data/lib/spiderfw/model/datatypes/password.rb +63 -0
  535. data/lib/spiderfw/model/datatypes/serialized_object.rb +32 -0
  536. data/lib/spiderfw/model/datatypes/text.rb +10 -0
  537. data/lib/spiderfw/model/datatypes/uuid.rb +29 -0
  538. data/lib/spiderfw/model/datatypes.rb +19 -0
  539. data/lib/spiderfw/model/element.rb +250 -0
  540. data/lib/spiderfw/model/extended_models/managed.rb +43 -0
  541. data/lib/spiderfw/model/identity_mapper.rb +89 -0
  542. data/lib/spiderfw/model/inline_model.rb +37 -0
  543. data/lib/spiderfw/model/mappers/db_mapper.rb +1126 -0
  544. data/lib/spiderfw/model/mappers/hash_mapper.rb +114 -0
  545. data/lib/spiderfw/model/mappers/mapper.rb +926 -0
  546. data/lib/spiderfw/model/mappers/mappers.rb +7 -0
  547. data/lib/spiderfw/model/mappers/proxy_mapper.rb +25 -0
  548. data/lib/spiderfw/model/mappers/vfs/flat_file.rb +31 -0
  549. data/lib/spiderfw/model/mixins/converted.rb +110 -0
  550. data/lib/spiderfw/model/mixins/list.rb +135 -0
  551. data/lib/spiderfw/model/mixins/mixins.rb +7 -0
  552. data/lib/spiderfw/model/mixins/state_machine.rb +81 -0
  553. data/lib/spiderfw/model/mixins/synchronized.rb +88 -0
  554. data/lib/spiderfw/model/mixins/tree.rb +296 -0
  555. data/lib/spiderfw/model/mixins/versioned.rb +147 -0
  556. data/lib/spiderfw/model/model.rb +226 -0
  557. data/lib/spiderfw/model/model_hash.rb +50 -0
  558. data/lib/spiderfw/model/proxy_model.rb +37 -0
  559. data/lib/spiderfw/model/query.rb +147 -0
  560. data/lib/spiderfw/model/query_funcs.rb +99 -0
  561. data/lib/spiderfw/model/query_set.rb +700 -0
  562. data/lib/spiderfw/model/request.rb +80 -0
  563. data/lib/spiderfw/model/storage/base_storage.rb +110 -0
  564. data/lib/spiderfw/model/storage/db/adapters/mssql.rb +129 -0
  565. data/lib/spiderfw/model/storage/db/adapters/mysql.rb +436 -0
  566. data/lib/spiderfw/model/storage/db/adapters/oci8.rb +533 -0
  567. data/lib/spiderfw/model/storage/db/adapters/sqlite.rb +163 -0
  568. data/lib/spiderfw/model/storage/db/connectors/odbc.rb +213 -0
  569. data/lib/spiderfw/model/storage/db/db.rb +13 -0
  570. data/lib/spiderfw/model/storage/db/db_connection_pool.rb +126 -0
  571. data/lib/spiderfw/model/storage/db/db_connector.rb +9 -0
  572. data/lib/spiderfw/model/storage/db/db_schema.rb +233 -0
  573. data/lib/spiderfw/model/storage/db/db_storage.rb +872 -0
  574. data/lib/spiderfw/model/storage/db/dialects/no_total_rows.rb +18 -0
  575. data/lib/spiderfw/model/storage/db/reflector.rb +36 -0
  576. data/lib/spiderfw/model/storage/null_storage.rb +18 -0
  577. data/lib/spiderfw/model/storage/schema.rb +19 -0
  578. data/lib/spiderfw/model/storage.rb +72 -0
  579. data/lib/spiderfw/model/sync.rb +94 -0
  580. data/lib/spiderfw/model/type.rb +13 -0
  581. data/lib/spiderfw/model/unit_of_work.rb +75 -0
  582. data/lib/spiderfw/requires.rb +21 -0
  583. data/lib/spiderfw/resource.rb +18 -0
  584. data/lib/spiderfw/setup/setup_task.rb +44 -0
  585. data/lib/spiderfw/tag/tag.rb +28 -0
  586. data/lib/spiderfw/templates/blocks/attr_if.rb +32 -0
  587. data/lib/spiderfw/templates/blocks/comment.rb +38 -0
  588. data/lib/spiderfw/templates/blocks/debugger.rb +16 -0
  589. data/lib/spiderfw/templates/blocks/each.rb +51 -0
  590. data/lib/spiderfw/templates/blocks/html.rb +70 -0
  591. data/lib/spiderfw/templates/blocks/if.rb +35 -0
  592. data/lib/spiderfw/templates/blocks/pass.rb +16 -0
  593. data/lib/spiderfw/templates/blocks/render.rb +23 -0
  594. data/lib/spiderfw/templates/blocks/run.rb +30 -0
  595. data/lib/spiderfw/templates/blocks/tag.rb +21 -0
  596. data/lib/spiderfw/templates/blocks/tag_if.rb +29 -0
  597. data/lib/spiderfw/templates/blocks/text.rb +43 -0
  598. data/lib/spiderfw/templates/blocks/widget.rb +58 -0
  599. data/lib/spiderfw/templates/blocks/yield.rb +18 -0
  600. data/lib/spiderfw/templates/layout.rb +44 -0
  601. data/lib/spiderfw/templates/resources/less.rb +14 -0
  602. data/lib/spiderfw/templates/template.rb +625 -0
  603. data/lib/spiderfw/templates/template_blocks.rb +185 -0
  604. data/lib/spiderfw/utils/annotations.rb +201 -0
  605. data/lib/spiderfw/utils/fork.rb +75 -0
  606. data/lib/spiderfw/utils/hash_comparison.rb +8 -0
  607. data/lib/spiderfw/utils/inflector.rb +42 -0
  608. data/lib/spiderfw/utils/logger.rb +92 -0
  609. data/lib/spiderfw/utils/monkey/class.rb +59 -0
  610. data/lib/spiderfw/utils/monkey/date_time.rb +34 -0
  611. data/lib/spiderfw/utils/monkey/debugger.rb +25 -0
  612. data/lib/spiderfw/utils/monkey/exception.rb +23 -0
  613. data/lib/spiderfw/utils/monkey/kernel.rb +12 -0
  614. data/lib/spiderfw/utils/monkey/module.rb +12 -0
  615. data/lib/spiderfw/utils/monkey/symbol.rb +7 -0
  616. data/lib/spiderfw/utils/monkey/time.rb +17 -0
  617. data/lib/spiderfw/utils/multi_level_hash.rb +33 -0
  618. data/lib/spiderfw/utils/periodic_runner.rb +50 -0
  619. data/lib/spiderfw/utils/rails.rb +78 -0
  620. data/lib/spiderfw/utils/rails_app.rb +53 -0
  621. data/lib/spiderfw/utils/sanitizer.rb +178 -0
  622. data/lib/spiderfw/utils/setup_task.rb +35 -0
  623. data/lib/spiderfw/utils/shared_store/file_shared_store.rb +73 -0
  624. data/lib/spiderfw/utils/shared_store/memory_shared_store.rb +46 -0
  625. data/lib/spiderfw/utils/shared_store.rb +47 -0
  626. data/lib/spiderfw/utils/test_case.rb +24 -0
  627. data/lib/spiderfw/utils/thread_out.rb +24 -0
  628. data/lib/spiderfw/version.rb +3 -0
  629. data/lib/spiderfw/widget/rest_model.rb +20 -0
  630. data/lib/spiderfw/widget/widget.rb +671 -0
  631. data/lib/spiderfw/widget/widget_attributes.rb +54 -0
  632. data/lib/spiderfw/widget/widget_plugin.rb +37 -0
  633. data/lib/spiderfw.rb +509 -0
  634. data/spider.gemspec +43 -0
  635. data/views/errors/404.shtml +6 -0
  636. data/views/errors/error.layout.shtml +70 -0
  637. data/views/errors/error_generic.shtml +6 -0
  638. metadata +800 -0
@@ -0,0 +1,2307 @@
1
+ /*
2
+ * jQuery UI 0.6.6
3
+ *
4
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
6
+ * and GPL (GPL-LICENSE.txt) licenses.
7
+ *
8
+ * http://docs.jquery.com/UI
9
+ */
10
+ ;jQuery.ui || (function($) {
11
+
12
+ var _remove = $.fn.remove,
13
+ isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
14
+
15
+ //Helper functions and ui object
16
+ $.ui = {
17
+ version: "0.6.6",
18
+
19
+ // $.ui.plugin is deprecated. Use the proxy pattern instead.
20
+ plugin: {
21
+ add: function(module, option, set) {
22
+ var proto = $.ui[module].prototype;
23
+ for(var i in set) {
24
+ proto.plugins[i] = proto.plugins[i] || [];
25
+ proto.plugins[i].push([option, set[i]]);
26
+ }
27
+ },
28
+ call: function(instance, name, args) {
29
+ var set = instance.plugins[name];
30
+ if(!set || !instance.element[0].parentNode) { return; }
31
+
32
+ for (var i = 0; i < set.length; i++) {
33
+ if (instance.options[set[i][0]]) {
34
+ set[i][1].apply(instance.element, args);
35
+ }
36
+ }
37
+ }
38
+ },
39
+
40
+ contains: function(a, b) {
41
+ return document.compareDocumentPosition
42
+ ? a.compareDocumentPosition(b) & 16
43
+ : a !== b && a.contains(b);
44
+ },
45
+
46
+ hasScroll: function(el, a) {
47
+
48
+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
49
+ if ($(el).css('overflow') == 'hidden') { return false; }
50
+
51
+ var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
52
+ has = false;
53
+
54
+ if (el[scroll] > 0) { return true; }
55
+
56
+ // TODO: determine which cases actually cause this to happen
57
+ // if the element doesn't have the scroll set, see if it's possible to
58
+ // set the scroll
59
+ el[scroll] = 1;
60
+ has = (el[scroll] > 0);
61
+ el[scroll] = 0;
62
+ return has;
63
+ },
64
+
65
+ isOverAxis: function(x, reference, size) {
66
+ //Determines when x coordinate is over "b" element axis
67
+ return (x > reference) && (x < (reference + size));
68
+ },
69
+
70
+ isOver: function(y, x, top, left, height, width) {
71
+ //Determines when x, y coordinates is over "b" element
72
+ return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
73
+ },
74
+
75
+ keyCode: {
76
+ BACKSPACE: 8,
77
+ CAPS_LOCK: 20,
78
+ COMMA: 188,
79
+ CONTROL: 17,
80
+ DELETE: 46,
81
+ DOWN: 40,
82
+ END: 35,
83
+ ENTER: 13,
84
+ ESCAPE: 27,
85
+ HOME: 36,
86
+ INSERT: 45,
87
+ LEFT: 37,
88
+ NUMPAD_ADD: 107,
89
+ NUMPAD_DECIMAL: 110,
90
+ NUMPAD_DIVIDE: 111,
91
+ NUMPAD_ENTER: 108,
92
+ NUMPAD_MULTIPLY: 106,
93
+ NUMPAD_SUBTRACT: 109,
94
+ PAGE_DOWN: 34,
95
+ PAGE_UP: 33,
96
+ PERIOD: 190,
97
+ RIGHT: 39,
98
+ SHIFT: 16,
99
+ SPACE: 32,
100
+ TAB: 9,
101
+ UP: 38
102
+ }
103
+ };
104
+
105
+ // WAI-ARIA normalization
106
+ if (isFF2) {
107
+ var attr = $.attr,
108
+ removeAttr = $.fn.removeAttr,
109
+ ariaNS = "http://www.w3.org/2005/07/aaa",
110
+ ariaState = /^aria-/,
111
+ ariaRole = /^wairole:/;
112
+
113
+ $.attr = function(elem, name, value) {
114
+ var set = value !== undefined;
115
+
116
+ return (name == 'role'
117
+ ? (set
118
+ ? attr.call(this, elem, name, "wairole:" + value)
119
+ : (attr.apply(this, arguments) || "").replace(ariaRole, ""))
120
+ : (ariaState.test(name)
121
+ ? (set
122
+ ? elem.setAttributeNS(ariaNS,
123
+ name.replace(ariaState, "aaa:"), value)
124
+ : attr.call(this, elem, name.replace(ariaState, "aaa:")))
125
+ : attr.apply(this, arguments)));
126
+ };
127
+
128
+ $.fn.removeAttr = function(name) {
129
+ return (ariaState.test(name)
130
+ ? this.each(function() {
131
+ this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
132
+ }) : removeAttr.call(this, name));
133
+ };
134
+ }
135
+
136
+ //jQuery plugins
137
+ $.fn.extend({
138
+ remove: function() {
139
+ // Safari has a native remove event which actually removes DOM elements,
140
+ // so we have to use triggerHandler instead of trigger (#3037).
141
+ $("*", this).add(this).each(function() {
142
+ $(this).triggerHandler("remove");
143
+ });
144
+ return _remove.apply(this, arguments );
145
+ },
146
+
147
+ enableSelection: function() {
148
+ return this
149
+ .attr('unselectable', 'off')
150
+ .css('MozUserSelect', '')
151
+ .unbind('selectstart.ui');
152
+ },
153
+
154
+ disableSelection: function() {
155
+ return this
156
+ .attr('unselectable', 'on')
157
+ .css('MozUserSelect', 'none')
158
+ .bind('selectstart.ui', function() { return false; });
159
+ },
160
+
161
+ scrollParent: function() {
162
+ var scrollParent;
163
+ if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
164
+ scrollParent = this.parents().filter(function() {
165
+ return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
166
+ }).eq(0);
167
+ } else {
168
+ scrollParent = this.parents().filter(function() {
169
+ return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
170
+ }).eq(0);
171
+ }
172
+
173
+ return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
174
+ }
175
+ });
176
+
177
+
178
+ //Additional selectors
179
+ $.extend($.expr[':'], {
180
+ data: function(elem, i, match) {
181
+ return !!$.data(elem, match[3]);
182
+ },
183
+
184
+ focusable: function(element) {
185
+ var nodeName = element.nodeName.toLowerCase(),
186
+ tabIndex = $.attr(element, 'tabindex');
187
+ return (/input|select|textarea|button|object/.test(nodeName)
188
+ ? !element.disabled
189
+ : 'a' == nodeName || 'area' == nodeName
190
+ ? element.href || !isNaN(tabIndex)
191
+ : !isNaN(tabIndex))
192
+ // the element and all of its ancestors must be visible
193
+ // the browser may report that the area is hidden
194
+ && !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
195
+ },
196
+
197
+ tabbable: function(element) {
198
+ var tabIndex = $.attr(element, 'tabindex');
199
+ return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
200
+ }
201
+ });
202
+
203
+
204
+ // $.widget is a factory to create jQuery plugins
205
+ // taking some boilerplate code out of the plugin code
206
+ function getter(namespace, plugin, method, args) {
207
+ function getMethods(type) {
208
+ var methods = $[namespace][plugin][type] || [];
209
+ return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
210
+ }
211
+
212
+ var methods = getMethods('getter');
213
+ if (args.length == 1 && typeof args[0] == 'string') {
214
+ methods = methods.concat(getMethods('getterSetter'));
215
+ }
216
+ return ($.inArray(method, methods) != -1);
217
+ }
218
+
219
+ $.widget = function(name, prototype) {
220
+ var namespace = name.split(".")[0];
221
+ name = name.split(".")[1];
222
+
223
+ // create plugin method
224
+ $.fn[name] = function(options) {
225
+ var isMethodCall = (typeof options == 'string'),
226
+ args = Array.prototype.slice.call(arguments, 1);
227
+
228
+ // prevent calls to internal methods
229
+ if (isMethodCall && options.substring(0, 1) == '_') {
230
+ return this;
231
+ }
232
+
233
+ // handle getter methods
234
+ if (isMethodCall && getter(namespace, name, options, args)) {
235
+ var instance = $.data(this[0], name);
236
+ return (instance ? instance[options].apply(instance, args)
237
+ : undefined);
238
+ }
239
+
240
+ // handle initialization and non-getter methods
241
+ return this.each(function() {
242
+ var instance = $.data(this, name);
243
+
244
+ // constructor
245
+ (!instance && !isMethodCall &&
246
+ $.data(this, name, new $[namespace][name](this, options))._init());
247
+
248
+ // method call
249
+ (instance && isMethodCall && $.isFunction(instance[options]) &&
250
+ instance[options].apply(instance, args));
251
+ });
252
+ };
253
+
254
+ // create widget constructor
255
+ $[namespace] = $[namespace] || {};
256
+ $[namespace][name] = function(element, options) {
257
+ var self = this;
258
+
259
+ this.namespace = namespace;
260
+ this.widgetName = name;
261
+ this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
262
+ this.widgetBaseClass = namespace + '-' + name;
263
+
264
+ this.options = $.extend({},
265
+ $.widget.defaults,
266
+ $[namespace][name].defaults,
267
+ $.metadata && $.metadata.get(element)[name],
268
+ options);
269
+
270
+ this.element = $(element)
271
+ .bind('setData.' + name, function(event, key, value) {
272
+ if (event.target == element) {
273
+ return self._setData(key, value);
274
+ }
275
+ })
276
+ .bind('getData.' + name, function(event, key) {
277
+ if (event.target == element) {
278
+ return self._getData(key);
279
+ }
280
+ })
281
+ .bind('remove', function() {
282
+ return self.destroy();
283
+ });
284
+ };
285
+
286
+ // add widget prototype
287
+ $[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
288
+
289
+ // TODO: merge getter and getterSetter properties from widget prototype
290
+ // and plugin prototype
291
+ $[namespace][name].getterSetter = 'option';
292
+ };
293
+
294
+ $.widget.prototype = {
295
+ _init: function() {},
296
+ destroy: function() {
297
+ this.element.removeData(this.widgetName)
298
+ .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
299
+ .removeAttr('aria-disabled');
300
+ },
301
+
302
+ option: function(key, value) {
303
+ var options = key,
304
+ self = this;
305
+
306
+ if (typeof key == "string") {
307
+ if (value === undefined) {
308
+ return this._getData(key);
309
+ }
310
+ options = {};
311
+ options[key] = value;
312
+ }
313
+
314
+ $.each(options, function(key, value) {
315
+ self._setData(key, value);
316
+ });
317
+ },
318
+ _getData: function(key) {
319
+ return this.options[key];
320
+ },
321
+ _setData: function(key, value) {
322
+ this.options[key] = value;
323
+
324
+ if (key == 'disabled') {
325
+ this.element
326
+ [value ? 'addClass' : 'removeClass'](
327
+ this.widgetBaseClass + '-disabled' + ' ' +
328
+ this.namespace + '-state-disabled')
329
+ .attr("aria-disabled", value);
330
+ }
331
+ },
332
+
333
+ enable: function() {
334
+ this._setData('disabled', false);
335
+ },
336
+ disable: function() {
337
+ this._setData('disabled', true);
338
+ },
339
+
340
+ _trigger: function(type, event, data) {
341
+ var callback = this.options[type],
342
+ eventName = (type == this.widgetEventPrefix
343
+ ? type : this.widgetEventPrefix + type);
344
+
345
+ event = $.Event(event);
346
+ event.type = eventName;
347
+
348
+ // copy original event properties over to the new event
349
+ // this would happen if we could call $.event.fix instead of $.Event
350
+ // but we don't have a way to force an event to be fixed multiple times
351
+ if (event.originalEvent) {
352
+ for (var i = $.event.props.length, prop; i;) {
353
+ prop = $.event.props[--i];
354
+ event[prop] = event.originalEvent[prop];
355
+ }
356
+ }
357
+
358
+ this.element.trigger(event, data);
359
+
360
+ return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
361
+ || event.isDefaultPrevented());
362
+ }
363
+ };
364
+
365
+ $.widget.defaults = {
366
+ disabled: false
367
+ };
368
+
369
+
370
+ /** Mouse Interaction Plugin **/
371
+
372
+ $.ui.mouse = {
373
+ _mouseInit: function() {
374
+ var self = this;
375
+
376
+ this.element
377
+ .bind('mousedown.'+this.widgetName, function(event) {
378
+ return self._mouseDown(event);
379
+ })
380
+ .bind('click.'+this.widgetName, function(event) {
381
+ if(self._preventClickEvent) {
382
+ self._preventClickEvent = false;
383
+ event.stopImmediatePropagation();
384
+ return false;
385
+ }
386
+ });
387
+
388
+ // Prevent text selection in IE
389
+ if ($.browser.msie) {
390
+ this._mouseUnselectable = this.element.attr('unselectable');
391
+ this.element.attr('unselectable', 'on');
392
+ }
393
+
394
+ this.started = false;
395
+ },
396
+
397
+ // TODO: make sure destroying one instance of mouse doesn't mess with
398
+ // other instances of mouse
399
+ _mouseDestroy: function() {
400
+ this.element.unbind('.'+this.widgetName);
401
+
402
+ // Restore text selection in IE
403
+ ($.browser.msie
404
+ && this.element.attr('unselectable', this._mouseUnselectable));
405
+ },
406
+
407
+ _mouseDown: function(event) {
408
+ // don't let more than one widget handle mouseStart
409
+ // TODO: figure out why we have to use originalEvent
410
+ event.originalEvent = event.originalEvent || {};
411
+ if (event.originalEvent.mouseHandled) { return; }
412
+
413
+ // we may have missed mouseup (out of window)
414
+ (this._mouseStarted && this._mouseUp(event));
415
+
416
+ this._mouseDownEvent = event;
417
+
418
+ var self = this,
419
+ btnIsLeft = (event.which == 1),
420
+ elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
421
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
422
+ return true;
423
+ }
424
+
425
+ this.mouseDelayMet = !this.options.delay;
426
+ if (!this.mouseDelayMet) {
427
+ this._mouseDelayTimer = setTimeout(function() {
428
+ self.mouseDelayMet = true;
429
+ }, this.options.delay);
430
+ }
431
+
432
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
433
+ this._mouseStarted = (this._mouseStart(event) !== false);
434
+ if (!this._mouseStarted) {
435
+ event.preventDefault();
436
+ return true;
437
+ }
438
+ }
439
+
440
+ // these delegates are required to keep context
441
+ this._mouseMoveDelegate = function(event) {
442
+ return self._mouseMove(event);
443
+ };
444
+ this._mouseUpDelegate = function(event) {
445
+ return self._mouseUp(event);
446
+ };
447
+ $(document)
448
+ .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
449
+ .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
450
+
451
+ // preventDefault() is used to prevent the selection of text here -
452
+ // however, in Safari, this causes select boxes not to be selectable
453
+ // anymore, so this fix is needed
454
+ ($.browser.safari || event.preventDefault());
455
+
456
+ event.originalEvent.mouseHandled = true;
457
+ return true;
458
+ },
459
+
460
+ _mouseMove: function(event) {
461
+ // IE mouseup check - mouseup happened when mouse was out of window
462
+ if ($.browser.msie && !event.button) {
463
+ return this._mouseUp(event);
464
+ }
465
+
466
+ if (this._mouseStarted) {
467
+ this._mouseDrag(event);
468
+ return event.preventDefault();
469
+ }
470
+
471
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
472
+ this._mouseStarted =
473
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
474
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
475
+ }
476
+
477
+ return !this._mouseStarted;
478
+ },
479
+
480
+ _mouseUp: function(event) {
481
+ $(document)
482
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
483
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
484
+
485
+ if (this._mouseStarted) {
486
+ this._mouseStarted = false;
487
+ this._preventClickEvent = (event.target == this._mouseDownEvent.target);
488
+ this._mouseStop(event);
489
+ }
490
+
491
+ return false;
492
+ },
493
+
494
+ _mouseDistanceMet: function(event) {
495
+ return (Math.max(
496
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
497
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
498
+ ) >= this.options.distance
499
+ );
500
+ },
501
+
502
+ _mouseDelayMet: function(event) {
503
+ return this.mouseDelayMet;
504
+ },
505
+
506
+ // These are placeholder methods, to be overriden by extending plugin
507
+ _mouseStart: function(event) {},
508
+ _mouseDrag: function(event) {},
509
+ _mouseStop: function(event) {},
510
+ _mouseCapture: function(event) { return true; }
511
+ };
512
+
513
+ $.ui.mouse.defaults = {
514
+ cancel: null,
515
+ distance: 1,
516
+ delay: 0
517
+ };
518
+
519
+ })(jQuery);
520
+ /*
521
+ jQuery utils - 0.6.6
522
+ http://code.google.com/p/jquery-utils/
523
+
524
+ (c) Maxime Haineault <haineault@gmail.com>
525
+ http://haineault.com
526
+
527
+ MIT License (http://www.opensource.org/licenses/mit-license.php
528
+
529
+ */
530
+
531
+ (function($){
532
+ $.extend($.expr[':'], {
533
+ // case insensitive version of :contains
534
+ icontains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||"").toLowerCase().indexOf(m[3].toLowerCase())>=0;}
535
+ });
536
+
537
+ $.iterators = {
538
+ getText: function() { return $(this).text(); },
539
+ parseInt: function(v){ return parseInt(v, 10); }
540
+ };
541
+
542
+ $.extend({
543
+
544
+ // Returns a range object
545
+ // Author: Matthias Miller
546
+ // Site: http://blog.outofhanwell.com/2006/03/29/javascript-range-function/
547
+ range: function() {
548
+ if (!arguments.length) { return []; }
549
+ var min, max, step;
550
+ if (arguments.length == 1) {
551
+ min = 0;
552
+ max = arguments[0]-1;
553
+ step = 1;
554
+ }
555
+ else {
556
+ // default step to 1 if it's zero or undefined
557
+ min = arguments[0];
558
+ max = arguments[1]-1;
559
+ step = arguments[2] || 1;
560
+ }
561
+ // convert negative steps to positive and reverse min/max
562
+ if (step < 0 && min >= max) {
563
+ step *= -1;
564
+ var tmp = min;
565
+ min = max;
566
+ max = tmp;
567
+ min += ((max-min) % step);
568
+ }
569
+ var a = [];
570
+ for (var i = min; i <= max; i += step) { a.push(i); }
571
+ return a;
572
+ },
573
+
574
+ // Taken from ui.core.js.
575
+ // Why are you keeping this gem for yourself guys ? :|
576
+ keyCode: {
577
+ BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, CONTROL: 17, DELETE: 46, DOWN: 40,
578
+ END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37,
579
+ NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108,
580
+ NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33,
581
+ PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38
582
+ },
583
+
584
+ keyIs: function(k, e) {
585
+ return parseInt($.keyCode[k.toUpperCase()], 10) == parseInt((typeof(e) == 'number' )? e: e.keyCode, 10);
586
+ },
587
+
588
+ // Redirect to a specified url
589
+ redirect: function(url) {
590
+ window.location.href = url;
591
+ return url;
592
+ },
593
+
594
+ // Stop event shorthand
595
+ stop: function(e, preventDefault, stopPropagation) {
596
+ if (preventDefault) { e.preventDefault(); }
597
+ if (stopPropagation) { e.stopPropagation(); }
598
+ return preventDefault && false || true;
599
+ },
600
+
601
+ // Returns the basename of a path
602
+ basename: function(path) {
603
+ var t = path.split('/');
604
+ return t[t.length] === '' && s || t.slice(0, t.length).join('/');
605
+ },
606
+
607
+ // Returns the filename of a path
608
+ filename: function(path) {
609
+ return path.split('/').pop();
610
+ },
611
+
612
+ // Returns a formated file size
613
+ filesizeformat: function(bytes, suffixes){
614
+ var b = parseInt(bytes, 10);
615
+ var s = suffixes || ['byte', 'bytes', 'KB', 'MB', 'GB'];
616
+ if (isNaN(b) || b === 0) { return '0 ' + s[0]; }
617
+ if (b == 1) { return '1 ' + s[0]; }
618
+ if (b < 1024) { return b.toFixed(2) + ' ' + s[1]; }
619
+ if (b < 1048576) { return (b / 1024).toFixed(2) + ' ' + s[2]; }
620
+ if (b < 1073741824) { return (b / 1048576).toFixed(2) + ' '+ s[3]; }
621
+ else { return (b / 1073741824).toFixed(2) + ' '+ s[4]; }
622
+ },
623
+
624
+ fileExtension: function(s) {
625
+ var tokens = s.split('.');
626
+ return tokens[tokens.length-1] || false;
627
+ },
628
+
629
+ // Returns true if an object is a String
630
+ isString: function(o) {
631
+ return typeof(o) == 'string' && true || false;
632
+ },
633
+
634
+ // Returns true if an object is a RegExp
635
+ isRegExp: function(o) {
636
+ return o && o.constructor.toString().indexOf('RegExp()') != -1 || false;
637
+ },
638
+
639
+ // Returns true if an object is an array
640
+ // Mark Miller - http://blog.360.yahoo.com/blog-TBPekxc1dLNy5DOloPfzVvFIVOWMB0li?p=916
641
+ isArray: function(o) {
642
+ if (!o) { return false; }
643
+ return o.constructor && Object.prototype.toString.apply(o.constructor.prototype) === '[object Array]';
644
+ },
645
+
646
+ isObject: function(o) {
647
+ return (typeof(o) == 'object');
648
+ },
649
+
650
+ // Convert input to currency (two decimal fixed number)
651
+ toCurrency: function(i) {
652
+ i = parseFloat(i, 10).toFixed(2);
653
+ return (i=='NaN') ? '0.00' : i;
654
+ },
655
+
656
+ /*--------------------------------------------------------------------
657
+ * javascript method: "pxToEm"
658
+ * by:
659
+ Scott Jehl (scott@filamentgroup.com)
660
+ Maggie Wachs (maggie@filamentgroup.com)
661
+ http://www.filamentgroup.com
662
+ *
663
+ * Copyright (c) 2008 Filament Group
664
+ * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
665
+ *
666
+ * Description: pxToEm converts a pixel value to ems depending on inherited font size.
667
+ * Article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/
668
+ * Demo: http://www.filamentgroup.com/examples/pxToEm/
669
+ *
670
+ * Options:
671
+ scope: string or jQuery selector for font-size scoping
672
+ reverse: Boolean, true reverses the conversion to em-px
673
+ * Dependencies: jQuery library
674
+ * Usage Example: myPixelValue.pxToEm(); or myPixelValue.pxToEm({'scope':'#navigation', reverse: true});
675
+ *
676
+ * Version: 2.1, 18.12.2008
677
+ * Changelog:
678
+ * 08.02.2007 initial Version 1.0
679
+ * 08.01.2008 - fixed font-size calculation for IE
680
+ * 18.12.2008 - removed native object prototyping to stay in jQuery's spirit, jsLinted (Maxime Haineault <haineault@gmail.com>)
681
+ --------------------------------------------------------------------*/
682
+
683
+ pxToEm: function(i, settings){
684
+ //set defaults
685
+ settings = jQuery.extend({
686
+ scope: 'body',
687
+ reverse: false
688
+ }, settings);
689
+
690
+ var pxVal = (i === '') ? 0 : parseFloat(i);
691
+ var scopeVal;
692
+ var getWindowWidth = function(){
693
+ var de = document.documentElement;
694
+ return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
695
+ };
696
+
697
+ /* When a percentage-based font-size is set on the body, IE returns that percent of the window width as the font-size.
698
+ For example, if the body font-size is 62.5% and the window width is 1000px, IE will return 625px as the font-size.
699
+ When this happens, we calculate the correct body font-size (%) and multiply it by 16 (the standard browser font size)
700
+ to get an accurate em value. */
701
+
702
+ if (settings.scope == 'body' && $.browser.msie && (parseFloat($('body').css('font-size')) / getWindowWidth()).toFixed(1) > 0.0) {
703
+ var calcFontSize = function(){
704
+ return (parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(3) * 16;
705
+ };
706
+ scopeVal = calcFontSize();
707
+ }
708
+ else { scopeVal = parseFloat(jQuery(settings.scope).css("font-size")); }
709
+
710
+ var result = (settings.reverse === true) ? (pxVal * scopeVal).toFixed(2) + 'px' : (pxVal / scopeVal).toFixed(2) + 'em';
711
+ return result;
712
+ }
713
+ });
714
+
715
+ $.extend($.fn, {
716
+ // Select a text range in a textarea
717
+ selectRange: function(start, end){
718
+ // use only the first one since only one input can be focused
719
+ if ($(this).get(0).createTextRange) {
720
+ var range = $(this).get(0).createTextRange();
721
+ range.collapse(true);
722
+ range.moveEnd('character', end);
723
+ range.moveStart('character', start);
724
+ range.select();
725
+ }
726
+ else if ($(this).get(0).setSelectionRange) {
727
+ $(this).bind('focus', function(e){
728
+ e.preventDefault();
729
+ }).get(0).setSelectionRange(start, end);
730
+ }
731
+ return $(this);
732
+ },
733
+
734
+ /*--------------------------------------------------------------------
735
+ * JQuery Plugin: "EqualHeights"
736
+ * by: Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com)
737
+ *
738
+ * Copyright (c) 2008 Filament Group
739
+ * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
740
+ *
741
+ * Description: Compares the heights or widths of the top-level children of a provided element
742
+ and sets their min-height to the tallest height (or width to widest width). Sets in em units
743
+ by default if pxToEm() method is available.
744
+ * Dependencies: jQuery library, pxToEm method (article:
745
+ http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/)
746
+ * Usage Example: $(element).equalHeights();
747
+ Optional: to set min-height in px, pass a true argument: $(element).equalHeights(true);
748
+ * Version: 2.1, 18.12.2008
749
+ *
750
+ * Note: Changed pxToEm call to call $.pxToEm instead, jsLinted (Maxime Haineault <haineault@gmail.com>)
751
+ --------------------------------------------------------------------*/
752
+
753
+ equalHeights: function(px){
754
+ $(this).each(function(){
755
+ var currentTallest = 0;
756
+ $(this).children().each(function(i){
757
+ if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
758
+ });
759
+ if (!px || !$.pxToEm) { currentTallest = $.pxToEm(currentTallest); } //use ems unless px is specified
760
+ // for ie6, set height since min-height isn't supported
761
+ if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': currentTallest}); }
762
+ $(this).children().css({'min-height': currentTallest});
763
+ });
764
+ return this;
765
+ },
766
+
767
+ // Copyright (c) 2009 James Padolsey
768
+ // http://james.padolsey.com/javascript/jquery-delay-plugin/
769
+ delay: function(time, callback){
770
+ jQuery.fx.step.delay = function(){};
771
+ return this.animate({delay:1}, time, callback);
772
+ }
773
+ });
774
+ })(jQuery);
775
+ /*
776
+ jQuery strings - 0.3
777
+ http://code.google.com/p/jquery-utils/
778
+
779
+ (c) Maxime Haineault <haineault@gmail.com>
780
+ http://haineault.com
781
+
782
+ MIT License (http://www.opensource.org/licenses/mit-license.php)
783
+
784
+ Implementation of Python3K advanced string formatting
785
+ http://www.python.org/dev/peps/pep-3101/
786
+
787
+ Documentation: http://code.google.com/p/jquery-utils/wiki/StringFormat
788
+
789
+ */
790
+ (function($){
791
+ var strings = {
792
+ strConversion: {
793
+ // tries to translate any objects type into string gracefully
794
+ __repr: function(i){
795
+ switch(this.__getType(i)) {
796
+ case 'array':case 'date':case 'number':
797
+ return i.toString();
798
+ case 'object':
799
+ var o = [];
800
+ for (x=0; x<i.length; i++) { o.push(i+': '+ this.__repr(i[x])); }
801
+ return o.join(', ');
802
+ case 'string':
803
+ return i;
804
+ default:
805
+ return i;
806
+ }
807
+ },
808
+ // like typeof but less vague
809
+ __getType: function(i) {
810
+ if (!i || !i.constructor) { return typeof(i); }
811
+ var match = i.constructor.toString().match(/Array|Number|String|Object|Date/);
812
+ return match && match[0].toLowerCase() || typeof(i);
813
+ },
814
+ //+ Jonas Raoni Soares Silva
815
+ //@ http://jsfromhell.com/string/pad [v1.0]
816
+ __pad: function(str, l, s, t){
817
+ var p = s || ' ';
818
+ var o = str;
819
+ if (l - str.length > 0) {
820
+ o = new Array(Math.ceil(l / p.length)).join(p).substr(0, t = !t ? l : t == 1 ? 0 : Math.ceil(l / 2)) + str + p.substr(0, l - t);
821
+ }
822
+ return o;
823
+ },
824
+ __getInput: function(arg, args) {
825
+ var key = arg.getKey();
826
+ switch(this.__getType(args)){
827
+ case 'object': // Thanks to Jonathan Works for the patch
828
+ var keys = key.split('.');
829
+ var obj = args;
830
+ for(var subkey = 0; subkey < keys.length; subkey++){
831
+ obj = obj[keys[subkey]];
832
+ }
833
+ if (typeof(obj) != 'undefined') {
834
+ if (strings.strConversion.__getType(obj) == 'array') {
835
+ return arg.getFormat().match(/\.\*/) && obj[1] || obj;
836
+ }
837
+ return obj;
838
+ }
839
+ else {
840
+ // TODO: try by numerical index
841
+ }
842
+ break;
843
+ case 'array':
844
+ key = parseInt(key, 10);
845
+ if (arg.getFormat().match(/\.\*/) && typeof args[key+1] != 'undefined') { return args[key+1]; }
846
+ else if (typeof args[key] != 'undefined') { return args[key]; }
847
+ else { return key; }
848
+ break;
849
+ }
850
+ return '{'+key+'}';
851
+ },
852
+ __formatToken: function(token, args) {
853
+ var arg = new Argument(token, args);
854
+ return strings.strConversion[arg.getFormat().slice(-1)](this.__getInput(arg, args), arg);
855
+ },
856
+
857
+ // Signed integer decimal.
858
+ d: function(input, arg){
859
+ var o = parseInt(input, 10); // enforce base 10
860
+ var p = arg.getPaddingLength();
861
+ if (p) { return this.__pad(o.toString(), p, arg.getPaddingString(), 0); }
862
+ else { return o; }
863
+ },
864
+ // Signed integer decimal.
865
+ i: function(input, args){
866
+ return this.d(input, args);
867
+ },
868
+ // Unsigned octal
869
+ o: function(input, arg){
870
+ var o = input.toString(8);
871
+ if (arg.isAlternate()) { o = this.__pad(o, o.length+1, '0', 0); }
872
+ return this.__pad(o, arg.getPaddingLength(), arg.getPaddingString(), 0);
873
+ },
874
+ // Unsigned decimal
875
+ u: function(input, args) {
876
+ return Math.abs(this.d(input, args));
877
+ },
878
+ // Unsigned hexadecimal (lowercase)
879
+ x: function(input, arg){
880
+ var o = parseInt(input, 10).toString(16);
881
+ o = this.__pad(o, arg.getPaddingLength(), arg.getPaddingString(),0);
882
+ return arg.isAlternate() ? '0x'+o : o;
883
+ },
884
+ // Unsigned hexadecimal (uppercase)
885
+ X: function(input, arg){
886
+ return this.x(input, arg).toUpperCase();
887
+ },
888
+ // Floating point exponential format (lowercase)
889
+ e: function(input, arg){
890
+ return parseFloat(input, 10).toExponential(arg.getPrecision());
891
+ },
892
+ // Floating point exponential format (uppercase)
893
+ E: function(input, arg){
894
+ return this.e(input, arg).toUpperCase();
895
+ },
896
+ // Floating point decimal format
897
+ f: function(input, arg){
898
+ return this.__pad(parseFloat(input, 10).toFixed(arg.getPrecision()), arg.getPaddingLength(), arg.getPaddingString(),0);
899
+ },
900
+ // Floating point decimal format (alias)
901
+ F: function(input, args){
902
+ return this.f(input, args);
903
+ },
904
+ // Floating point format. Uses exponential format if exponent is greater than -4 or less than precision, decimal format otherwise
905
+ g: function(input, arg){
906
+ var o = parseFloat(input, 10);
907
+ return (o.toString().length > 6) ? Math.round(o.toExponential(arg.getPrecision())): o;
908
+ },
909
+ // Floating point format. Uses exponential format if exponent is greater than -4 or less than precision, decimal format otherwise
910
+ G: function(input, args){
911
+ return this.g(input, args);
912
+ },
913
+ // Single character (accepts integer or single character string).
914
+ c: function(input, args) {
915
+ var match = input.match(/\w|\d/);
916
+ return match && match[0] || '';
917
+ },
918
+ // String (converts any JavaScript object to anotated format)
919
+ r: function(input, args) {
920
+ return this.__repr(input);
921
+ },
922
+ // String (converts any JavaScript object using object.toString())
923
+ s: function(input, args) {
924
+ return input.toString && input.toString() || ''+input;
925
+ }
926
+ },
927
+
928
+ format: function(str, args) {
929
+ var end = 0;
930
+ var start = 0;
931
+ var match = false;
932
+ var buffer = [];
933
+ var token = '';
934
+ var tmp = (str||'').split('');
935
+ for(start=0; start < tmp.length; start++) {
936
+ if (tmp[start] == '{' && tmp[start+1] !='{') {
937
+ end = str.indexOf('}', start);
938
+ token = tmp.slice(start+1, end).join('');
939
+ if (tmp[start-1] != '{' && tmp[end+1] != '}') {
940
+ var tokenArgs = (typeof arguments[1] != 'object')? arguments2Array(arguments, 2): args || [];
941
+ buffer.push(strings.strConversion.__formatToken(token, tokenArgs));
942
+ }
943
+ else {
944
+ buffer.push(token);
945
+ }
946
+ }
947
+ else if (start > end || buffer.length < 1) { buffer.push(tmp[start]); }
948
+ }
949
+ return (buffer.length > 1)? buffer.join(''): buffer[0];
950
+ },
951
+
952
+ calc: function(str, args) {
953
+ return eval(format(str, args));
954
+ },
955
+
956
+ repeat: function(s, n) {
957
+ return new Array(n+1).join(s);
958
+ },
959
+
960
+ UTF8encode: function(s) {
961
+ return unescape(encodeURIComponent(s));
962
+ },
963
+
964
+ UTF8decode: function(s) {
965
+ return decodeURIComponent(escape(s));
966
+ },
967
+
968
+ tpl: function() {
969
+ var out = '', render = true;
970
+ // Set
971
+ // $.tpl('ui.test', ['<span>', helloWorld ,'</span>']);
972
+ if (arguments.length == 2 && $.isArray(arguments[1])) {
973
+ this[arguments[0]] = arguments[1].join('');
974
+ return jQuery;
975
+ }
976
+ // $.tpl('ui.test', '<span>hello world</span>');
977
+ if (arguments.length == 2 && $.isString(arguments[1])) {
978
+ this[arguments[0]] = arguments[1];
979
+ return jQuery;
980
+ }
981
+ // Call
982
+ // $.tpl('ui.test');
983
+ if (arguments.length == 1) {
984
+ return $(this[arguments[0]]);
985
+ }
986
+ // $.tpl('ui.test', false);
987
+ if (arguments.length == 2 && arguments[1] == false) {
988
+ return this[arguments[0]];
989
+ }
990
+ // $.tpl('ui.test', {value:blah});
991
+ if (arguments.length == 2 && $.isObject(arguments[1])) {
992
+ return $($.format(this[arguments[0]], arguments[1]));
993
+ }
994
+ // $.tpl('ui.test', {value:blah}, false);
995
+ if (arguments.length == 3 && $.isObject(arguments[1])) {
996
+ return (arguments[2] == true)
997
+ ? $.format(this[arguments[0]], arguments[1])
998
+ : $($.format(this[arguments[0]], arguments[1]));
999
+ }
1000
+ }
1001
+ };
1002
+
1003
+ var Argument = function(arg, args) {
1004
+ this.__arg = arg;
1005
+ this.__args = args;
1006
+ this.__max_precision = parseFloat('1.'+ (new Array(32)).join('1'), 10).toString().length-3;
1007
+ this.__def_precision = 6;
1008
+ this.getString = function(){
1009
+ return this.__arg;
1010
+ };
1011
+ this.getKey = function(){
1012
+ return this.__arg.split(':')[0];
1013
+ };
1014
+ this.getFormat = function(){
1015
+ var match = this.getString().split(':');
1016
+ return (match && match[1])? match[1]: 's';
1017
+ };
1018
+ this.getPrecision = function(){
1019
+ var match = this.getFormat().match(/\.(\d+|\*)/g);
1020
+ if (!match) { return this.__def_precision; }
1021
+ else {
1022
+ match = match[0].slice(1);
1023
+ if (match != '*') { return parseInt(match, 10); }
1024
+ else if(strings.strConversion.__getType(this.__args) == 'array') {
1025
+ return this.__args[1] && this.__args[0] || this.__def_precision;
1026
+ }
1027
+ else if(strings.strConversion.__getType(this.__args) == 'object') {
1028
+ return this.__args[this.getKey()] && this.__args[this.getKey()][0] || this.__def_precision;
1029
+ }
1030
+ else { return this.__def_precision; }
1031
+ }
1032
+ };
1033
+ this.getPaddingLength = function(){
1034
+ var match = false;
1035
+ if (this.isAlternate()) {
1036
+ match = this.getString().match(/0?#0?(\d+)/);
1037
+ if (match && match[1]) { return parseInt(match[1], 10); }
1038
+ }
1039
+ match = this.getString().match(/(0|\.)(\d+|\*)/g);
1040
+ return match && parseInt(match[0].slice(1), 10) || 0;
1041
+ };
1042
+ this.getPaddingString = function(){
1043
+ var o = '';
1044
+ if (this.isAlternate()) { o = ' '; }
1045
+ // 0 take precedence on alternate format
1046
+ if (this.getFormat().match(/#0|0#|^0|\.\d+/)) { o = '0'; }
1047
+ return o;
1048
+ };
1049
+ this.getFlags = function(){
1050
+ var match = this.getString().matc(/^(0|\#|\-|\+|\s)+/);
1051
+ return match && match[0].split('') || [];
1052
+ };
1053
+ this.isAlternate = function() {
1054
+ return !!this.getFormat().match(/^0?#/);
1055
+ };
1056
+ };
1057
+
1058
+ var arguments2Array = function(args, shift) {
1059
+ var o = [];
1060
+ for (l=args.length, x=(shift || 0)-1; x<l;x++) { o.push(args[x]); }
1061
+ return o;
1062
+ };
1063
+ $.extend(strings);
1064
+ })(jQuery);
1065
+ /*
1066
+ jQuery ui.dropslide - 0.4
1067
+ http://code.google.com/p/jquery-utils/
1068
+
1069
+ (c) Maxime Haineault <haineault@gmail.com>
1070
+ http://haineault.com
1071
+
1072
+ MIT License (http://www.opensource.org/licenses/mit-license.php
1073
+
1074
+ */
1075
+
1076
+ (function($) {
1077
+ $.widget('ui.dropslide', $.extend({}, $.ui.mouse, {
1078
+ getter: 'showLevel showNextLevel getSelection',
1079
+ _init: function() {
1080
+ var widget = this;
1081
+ this.wrapper = this.element.next();
1082
+
1083
+ this.element.bind(this.options.trigger +'.dropslide', function(){
1084
+ widget.show();
1085
+ });
1086
+ this.wrapper
1087
+ .data('dropslide', this)
1088
+ .css({width:this.options.width})
1089
+ .find('li, li ol li')
1090
+ .bind('mouseover.dropslide', function(e){
1091
+ $(this).siblings().removeClass('hover')
1092
+ .find('ol').hide().end()
1093
+ .find('span').removeClass('ui-state-hover').end();
1094
+ $(this).find('ol').show().end().addClass('hover').children(0).addClass('ui-state-hover');
1095
+ widget.showNextLevel();
1096
+ })
1097
+ .bind('click.dropslide', function(e){
1098
+ $(widget.element).triggerHandler('dropslideclick', [e, widget], widget.options.click);
1099
+ $(widget.element).triggerHandler('select', [e, widget], widget.options.select);
1100
+ }).end()
1101
+ .find('ol')
1102
+ .bind('mousemove.dropslide', function(e){
1103
+ return widget._redraw();
1104
+ })
1105
+ .addClass('ui-widget ui-helper-clearfix ui-helper-reset')
1106
+ .hide().end()
1107
+ .find('span').addClass('ui-state-default ui-corner-all');
1108
+
1109
+ this._redraw();
1110
+ },
1111
+
1112
+ // show specified level, id is the DOM position
1113
+ showLevel: function(id) {
1114
+ var ols = this.wrapper.find('ol');
1115
+ var ds = this;
1116
+ if (id == 0) {
1117
+ ols.eq(0).css('left', this.element.position().left);
1118
+ this.wrapper.css('top', ds.element.position().top + ds.element.height() + ds.options.top);
1119
+ this.wrapper.css('z-index', 1000);
1120
+ }
1121
+ setTimeout(function() {
1122
+ ols.removeClass('active').eq(id).addClass('active').show(ds.options.animSpeed);
1123
+ }, ds.options.showDelay);
1124
+ },
1125
+
1126
+ // guess what it does
1127
+ showNextLevel: function() {
1128
+ this.wrapper.find('ol.active')
1129
+ .removeClass('active')
1130
+ .next('ol').addClass('active').show(this.options.animSpeed);
1131
+ },
1132
+
1133
+ getSelection: function(level) {
1134
+ return level
1135
+ && this.wrapper.find('ol').eq(level).find('li span.ui-state-hover')
1136
+ || $.makeArray(this.wrapper.find('span.ui-state-hover').map($.iterators.getText));
1137
+ },
1138
+
1139
+ // essentially reposition each ol
1140
+ _redraw: function() {
1141
+ var prevLI ,prevOL, nextOL, pos = false;
1142
+ var offset = this.element.position().left + this.options.left;
1143
+ var ols = $(this.wrapper).find('ol');
1144
+
1145
+ $(this.wrapper).css({
1146
+ top: this.element.position().top + this.element.height() + this.options.top,
1147
+ left: this.element.position().left
1148
+ });
1149
+
1150
+ // reposition each ol
1151
+ ols.each(function(i) {
1152
+ prevOL = $(this).prevAll('ol:visible:first');
1153
+ if (prevOL.get(0)) {
1154
+ prevLI = prevOL.find('li.hover').get(0) && prevOL.find('li.hover') || prevOL.find('li:first');
1155
+ $(this).css('margin-left', prevLI.position().left);
1156
+ }
1157
+ });
1158
+ },
1159
+
1160
+ // show level 0 (shortcut)
1161
+ show: function(e) {
1162
+ this.showLevel(0);
1163
+ },
1164
+
1165
+ // hide all levels
1166
+ hide: function() {
1167
+ var widget = this;
1168
+ setTimeout(function() {
1169
+ widget.wrapper.find('ol').hide();
1170
+ }, widget.options.hideDelay);
1171
+ },
1172
+
1173
+ activate: function(e) {
1174
+ this.element.focus();
1175
+ this.show(this.options.animSpeed);
1176
+ },
1177
+
1178
+ destroy: function(e) {
1179
+ this.wrapper.remove();
1180
+ }
1181
+ }));
1182
+
1183
+ $.ui.dropslide.defaults = {
1184
+ // options
1185
+ tree: false,
1186
+ trigger: 'mouseover',
1187
+ top: 6,
1188
+ left: 0,
1189
+ showDelay: 0,
1190
+ hideDelay: 0,
1191
+ animSpeed: 0,
1192
+ // events
1193
+ select: function() {},
1194
+ click: function(e, ui) { ui.hide(); }
1195
+ };
1196
+ })(jQuery);
1197
+ /*
1198
+ jQuery ui.timepickr - 0.6.6
1199
+ http://code.google.com/p/jquery-utils/
1200
+
1201
+ (c) Maxime Haineault <haineault@gmail.com>
1202
+ http://haineault.com
1203
+
1204
+ MIT License (http://www.opensource.org/licenses/mit-license.php
1205
+
1206
+ Note: if you want the original experimental plugin checkout the rev 224
1207
+
1208
+ Dependencies
1209
+ ------------
1210
+ - jquery.utils.js
1211
+ - jquery.strings.js
1212
+ - jquery.ui.js
1213
+ - ui.dropslide.js
1214
+
1215
+ */
1216
+
1217
+ (function($) {
1218
+ $.tpl('timepickr.menu', '<span class="ui-helper-reset ui-dropslide ui-timepickr ui-widget" />');
1219
+ $.tpl('timepickr.row', '<ol class="ui-timepickr" />');
1220
+ $.tpl('timepickr.button', '<li class="{className:s}"><span>{label:s}</span></li>');
1221
+
1222
+ $.widget('ui.timepickr', {
1223
+ _init: function() {
1224
+ var ui = this;
1225
+ var menu = ui._buildMenu();
1226
+ var element = ui.element;
1227
+ element.data('timepickr.initialValue', element.val());
1228
+ menu.insertAfter(ui.element);
1229
+ element
1230
+ .addClass('ui-timepickr')
1231
+ .dropslide(ui.options.dropslide)
1232
+ .bind('select', ui.select);
1233
+
1234
+ element.blur(function(e) {
1235
+ $(this).dropslide('hide');
1236
+ if (ui.options.resetOnBlur) {
1237
+ $(this).val($(this).data('timepickr.initialValue'));
1238
+ }
1239
+ });
1240
+
1241
+ if (ui.options.val) {
1242
+ element.val(this.options.val);
1243
+ }
1244
+
1245
+ if (ui.options.handle) {
1246
+ $(this.options.handle).click(function() {
1247
+ $(element).dropslide('show');
1248
+ });
1249
+ }
1250
+
1251
+ if (ui.options.resetOnBlur) {
1252
+ menu.find('li > span').bind('mousedown.timepickr', function(){
1253
+ $(element).data('timepickr.initialValue', $(element).val());
1254
+ });
1255
+ }
1256
+ if (ui.options.updateLive) {
1257
+ menu.find('li').bind('mouseover.timepickr', function() {
1258
+ $(element).timepickr('update');
1259
+ });
1260
+ }
1261
+ var hrs = menu.find('ol:eq(1)').find('li:first').addClass('hover').find('span').addClass('ui-state-hover').end().end();
1262
+ var min = menu.find('ol:eq(2)').find('li:first').addClass('hover').find('span').addClass('ui-state-hover').end().end();
1263
+ var sec = menu.find('ol:eq(3)').find('li:first').addClass('hover').find('span').addClass('ui-state-hover').end().end();
1264
+
1265
+ if (this.options.convention === 24) {
1266
+ var day = menu.find('ol:eq(0) li:eq(0)');
1267
+ var night = menu.find('ol:eq(0) li:eq(1)');
1268
+ var dayHours = hrs.find('li').slice(0, 12);
1269
+ var nightHours = hrs.find('li').slice(12, 24);
1270
+ var index = 0;
1271
+ var selectHr = function(id) {
1272
+ hrs.find('li').removeClass('hover');
1273
+ hrs.find('span').removeClass('ui-state-hover');
1274
+ hrs.find('li').eq(id).addClass('hover').find('span').addClass('ui-state-hover')
1275
+ };
1276
+
1277
+ day.mouseover(function() {
1278
+ nightHours.hide();
1279
+ dayHours.show(0);
1280
+ index = hrs.find('li.hover').data('id') || hrs.find('li:first').data('id');
1281
+ selectHr(index > 11 && index - 12 || index);
1282
+ element.dropslide('redraw');
1283
+ });
1284
+
1285
+ night.mouseover(function() {
1286
+ dayHours.hide();
1287
+ nightHours.show(0);
1288
+ index = hrs.find('li.hover').data('id') || hrs.find('li:first').data('id');
1289
+ selectHr(index < 12 && index + 12 || index);
1290
+ element.dropslide('redraw');
1291
+ });
1292
+ }
1293
+ element.dropslide('redraw');
1294
+ element.data('timepickr', this);
1295
+ },
1296
+
1297
+ update: function() {
1298
+ var frmt = this.options.convention === 24 && 'format24' || 'format12';
1299
+ var val = {
1300
+ h: this.getValue('hour'),
1301
+ m: this.getValue('minute'),
1302
+ s: this.getValue('second'),
1303
+ prefix: this.getValue('prefix'),
1304
+ suffix: this.getValue('suffix')
1305
+ };
1306
+ var o = $.format(this.options[frmt], val);
1307
+
1308
+ $(this.element).val(o);
1309
+ },
1310
+
1311
+ select: function(e) {
1312
+ var dropslide = $(this).data('dropslide');
1313
+ $(dropslide.element).timepickr('update');
1314
+ e.stopPropagation();
1315
+ },
1316
+
1317
+ getHour: function() {
1318
+ return this.getValue('hour');
1319
+ },
1320
+
1321
+ getMinute: function() {
1322
+ return this.getValue('minute');
1323
+ },
1324
+
1325
+ getSecond: function() {
1326
+ return this.getValue('second');
1327
+ },
1328
+
1329
+ getValue: function(type) {
1330
+ return $('.ui-timepickr.'+ type +'.hover', this.element.next()).text();
1331
+ },
1332
+
1333
+ activate: function() {
1334
+ this.element.dropslide('activate');
1335
+ },
1336
+
1337
+ destroy: function() {
1338
+ this.element.dropslide('destroy');
1339
+ },
1340
+
1341
+ /* UI private methods */
1342
+
1343
+ _createButton: function(i, format, className) {
1344
+ var o = format && $.format(format, i) || i;
1345
+ var cn = className && 'ui-timepickr '+ className || 'ui-timepickr';
1346
+ return $.tpl('timepickr.button', {className: cn, label: o}).data('id', i);
1347
+ },
1348
+
1349
+ _createRow: function(range, format, className) {
1350
+ var row = $.tpl('timepickr.row');
1351
+ var button = this._createButton;
1352
+ // Thanks to Christoph Müller-Spengler for the bug report
1353
+ $.each(range, function(idx, val){
1354
+ row.append(button(val, format || false, className || false));
1355
+ });
1356
+ return row;
1357
+ },
1358
+
1359
+ _getRanges12: function() {
1360
+ var o = [], opt = this.options;
1361
+ if (opt.hours) { o.push(this._createRow($.range(1, 13), '{0:0.2d}', 'hour')); }
1362
+ if (opt.minutes) { o.push(this._createRow(opt.rangeMin, '{0:0.2d}', 'minute')); }
1363
+ if (opt.seconds) { o.push(this._createRow(opt.rangeSec, '{0:0.2d}', 'second')); }
1364
+ if (opt.suffix) { o.push(this._createRow(opt.suffix, false, 'suffix')); }
1365
+ return o;
1366
+ },
1367
+
1368
+ _getRanges24: function() {
1369
+ var o = [], opt = this.options;
1370
+ o.push(this._createRow(opt.prefix, false, 'prefix')); // prefix is required in 24h mode
1371
+ if (opt.hours) { o.push(this._createRow($.range(0, 24), '{0:0.2d}', 'hour')); }
1372
+ if (opt.minutes) { o.push(this._createRow(opt.rangeMin, '{0:0.2d}', 'minute')); }
1373
+ if (opt.seconds) { o.push(this._createRow(opt.rangeSec, '{0:0.2d}', 'second')); }
1374
+ return o;
1375
+ },
1376
+
1377
+ _buildMenu: function() {
1378
+ var menu = $.tpl('timepickr.menu');
1379
+ var ranges = this.options.convention === 24
1380
+ && this._getRanges24() || this._getRanges12();
1381
+
1382
+ $.each(ranges, function(idx, val){
1383
+ menu.append(val);
1384
+ });
1385
+ return menu;
1386
+ }
1387
+ });
1388
+
1389
+ // These properties are shared accross every instances of timepickr
1390
+ $.extend($.ui.timepickr, {
1391
+ version: '0.6.6',
1392
+ eventPrefix: '',
1393
+ getter: '',
1394
+ defaults: {
1395
+ convention: 24, // 24, 12
1396
+ dropslide: { trigger: 'focus' },
1397
+ format12: '{h:02.d}:{m:02.d} {suffix:s}',
1398
+ format24: '{h:02.d}:{m:02.d}',
1399
+ handle: false,
1400
+ hours: true,
1401
+ minutes: true,
1402
+ seconds: false,
1403
+ prefix: ['am', 'pm'],
1404
+ suffix: ['am', 'pm'],
1405
+ rangeMin: $.range(0, 60, 15),
1406
+ rangeSec: $.range(0, 60, 15),
1407
+ updateLive: true,
1408
+ resetOnBlur: true,
1409
+ val: false
1410
+ }
1411
+ });
1412
+
1413
+ })(jQuery);
1414
+ /*
1415
+ jQuery utils - 0.6.6
1416
+ http://code.google.com/p/jquery-utils/
1417
+
1418
+ (c) Maxime Haineault <haineault@gmail.com>
1419
+ http://haineault.com
1420
+
1421
+ MIT License (http://www.opensource.org/licenses/mit-license.php
1422
+
1423
+ */
1424
+
1425
+ (function($){
1426
+ $.extend($.expr[':'], {
1427
+ // case insensitive version of :contains
1428
+ icontains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||"").toLowerCase().indexOf(m[3].toLowerCase())>=0;}
1429
+ });
1430
+
1431
+ $.iterators = {
1432
+ getText: function() { return $(this).text(); },
1433
+ parseInt: function(v){ return parseInt(v, 10); }
1434
+ };
1435
+
1436
+ $.extend({
1437
+
1438
+ // Returns a range object
1439
+ // Author: Matthias Miller
1440
+ // Site: http://blog.outofhanwell.com/2006/03/29/javascript-range-function/
1441
+ range: function() {
1442
+ if (!arguments.length) { return []; }
1443
+ var min, max, step;
1444
+ if (arguments.length == 1) {
1445
+ min = 0;
1446
+ max = arguments[0]-1;
1447
+ step = 1;
1448
+ }
1449
+ else {
1450
+ // default step to 1 if it's zero or undefined
1451
+ min = arguments[0];
1452
+ max = arguments[1]-1;
1453
+ step = arguments[2] || 1;
1454
+ }
1455
+ // convert negative steps to positive and reverse min/max
1456
+ if (step < 0 && min >= max) {
1457
+ step *= -1;
1458
+ var tmp = min;
1459
+ min = max;
1460
+ max = tmp;
1461
+ min += ((max-min) % step);
1462
+ }
1463
+ var a = [];
1464
+ for (var i = min; i <= max; i += step) { a.push(i); }
1465
+ return a;
1466
+ },
1467
+
1468
+ // Taken from ui.core.js.
1469
+ // Why are you keeping this gem for yourself guys ? :|
1470
+ keyCode: {
1471
+ BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, CONTROL: 17, DELETE: 46, DOWN: 40,
1472
+ END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37,
1473
+ NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108,
1474
+ NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33,
1475
+ PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38
1476
+ },
1477
+
1478
+ keyIs: function(k, e) {
1479
+ return parseInt($.keyCode[k.toUpperCase()], 10) == parseInt((typeof(e) == 'number' )? e: e.keyCode, 10);
1480
+ },
1481
+
1482
+ // Redirect to a specified url
1483
+ redirect: function(url) {
1484
+ window.location.href = url;
1485
+ return url;
1486
+ },
1487
+
1488
+ // Stop event shorthand
1489
+ stop: function(e, preventDefault, stopPropagation) {
1490
+ if (preventDefault) { e.preventDefault(); }
1491
+ if (stopPropagation) { e.stopPropagation(); }
1492
+ return preventDefault && false || true;
1493
+ },
1494
+
1495
+ // Returns the basename of a path
1496
+ basename: function(path) {
1497
+ var t = path.split('/');
1498
+ return t[t.length] === '' && s || t.slice(0, t.length).join('/');
1499
+ },
1500
+
1501
+ // Returns the filename of a path
1502
+ filename: function(path) {
1503
+ return path.split('/').pop();
1504
+ },
1505
+
1506
+ // Returns a formated file size
1507
+ filesizeformat: function(bytes, suffixes){
1508
+ var b = parseInt(bytes, 10);
1509
+ var s = suffixes || ['byte', 'bytes', 'KB', 'MB', 'GB'];
1510
+ if (isNaN(b) || b === 0) { return '0 ' + s[0]; }
1511
+ if (b == 1) { return '1 ' + s[0]; }
1512
+ if (b < 1024) { return b.toFixed(2) + ' ' + s[1]; }
1513
+ if (b < 1048576) { return (b / 1024).toFixed(2) + ' ' + s[2]; }
1514
+ if (b < 1073741824) { return (b / 1048576).toFixed(2) + ' '+ s[3]; }
1515
+ else { return (b / 1073741824).toFixed(2) + ' '+ s[4]; }
1516
+ },
1517
+
1518
+ fileExtension: function(s) {
1519
+ var tokens = s.split('.');
1520
+ return tokens[tokens.length-1] || false;
1521
+ },
1522
+
1523
+ // Returns true if an object is a String
1524
+ isString: function(o) {
1525
+ return typeof(o) == 'string' && true || false;
1526
+ },
1527
+
1528
+ // Returns true if an object is a RegExp
1529
+ isRegExp: function(o) {
1530
+ return o && o.constructor.toString().indexOf('RegExp()') != -1 || false;
1531
+ },
1532
+
1533
+ // Returns true if an object is an array
1534
+ // Mark Miller - http://blog.360.yahoo.com/blog-TBPekxc1dLNy5DOloPfzVvFIVOWMB0li?p=916
1535
+ isArray: function(o) {
1536
+ if (!o) { return false; }
1537
+ return o.constructor && Object.prototype.toString.apply(o.constructor.prototype) === '[object Array]';
1538
+ },
1539
+
1540
+ isObject: function(o) {
1541
+ return (typeof(o) == 'object');
1542
+ },
1543
+
1544
+ // Convert input to currency (two decimal fixed number)
1545
+ toCurrency: function(i) {
1546
+ i = parseFloat(i, 10).toFixed(2);
1547
+ return (i=='NaN') ? '0.00' : i;
1548
+ },
1549
+
1550
+ /*--------------------------------------------------------------------
1551
+ * javascript method: "pxToEm"
1552
+ * by:
1553
+ Scott Jehl (scott@filamentgroup.com)
1554
+ Maggie Wachs (maggie@filamentgroup.com)
1555
+ http://www.filamentgroup.com
1556
+ *
1557
+ * Copyright (c) 2008 Filament Group
1558
+ * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
1559
+ *
1560
+ * Description: pxToEm converts a pixel value to ems depending on inherited font size.
1561
+ * Article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/
1562
+ * Demo: http://www.filamentgroup.com/examples/pxToEm/
1563
+ *
1564
+ * Options:
1565
+ scope: string or jQuery selector for font-size scoping
1566
+ reverse: Boolean, true reverses the conversion to em-px
1567
+ * Dependencies: jQuery library
1568
+ * Usage Example: myPixelValue.pxToEm(); or myPixelValue.pxToEm({'scope':'#navigation', reverse: true});
1569
+ *
1570
+ * Version: 2.1, 18.12.2008
1571
+ * Changelog:
1572
+ * 08.02.2007 initial Version 1.0
1573
+ * 08.01.2008 - fixed font-size calculation for IE
1574
+ * 18.12.2008 - removed native object prototyping to stay in jQuery's spirit, jsLinted (Maxime Haineault <haineault@gmail.com>)
1575
+ --------------------------------------------------------------------*/
1576
+
1577
+ pxToEm: function(i, settings){
1578
+ //set defaults
1579
+ settings = jQuery.extend({
1580
+ scope: 'body',
1581
+ reverse: false
1582
+ }, settings);
1583
+
1584
+ var pxVal = (i === '') ? 0 : parseFloat(i);
1585
+ var scopeVal;
1586
+ var getWindowWidth = function(){
1587
+ var de = document.documentElement;
1588
+ return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
1589
+ };
1590
+
1591
+ /* When a percentage-based font-size is set on the body, IE returns that percent of the window width as the font-size.
1592
+ For example, if the body font-size is 62.5% and the window width is 1000px, IE will return 625px as the font-size.
1593
+ When this happens, we calculate the correct body font-size (%) and multiply it by 16 (the standard browser font size)
1594
+ to get an accurate em value. */
1595
+
1596
+ if (settings.scope == 'body' && $.browser.msie && (parseFloat($('body').css('font-size')) / getWindowWidth()).toFixed(1) > 0.0) {
1597
+ var calcFontSize = function(){
1598
+ return (parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(3) * 16;
1599
+ };
1600
+ scopeVal = calcFontSize();
1601
+ }
1602
+ else { scopeVal = parseFloat(jQuery(settings.scope).css("font-size")); }
1603
+
1604
+ var result = (settings.reverse === true) ? (pxVal * scopeVal).toFixed(2) + 'px' : (pxVal / scopeVal).toFixed(2) + 'em';
1605
+ return result;
1606
+ }
1607
+ });
1608
+
1609
+ $.extend($.fn, {
1610
+ // Select a text range in a textarea
1611
+ selectRange: function(start, end){
1612
+ // use only the first one since only one input can be focused
1613
+ if ($(this).get(0).createTextRange) {
1614
+ var range = $(this).get(0).createTextRange();
1615
+ range.collapse(true);
1616
+ range.moveEnd('character', end);
1617
+ range.moveStart('character', start);
1618
+ range.select();
1619
+ }
1620
+ else if ($(this).get(0).setSelectionRange) {
1621
+ $(this).bind('focus', function(e){
1622
+ e.preventDefault();
1623
+ }).get(0).setSelectionRange(start, end);
1624
+ }
1625
+ return $(this);
1626
+ },
1627
+
1628
+ /*--------------------------------------------------------------------
1629
+ * JQuery Plugin: "EqualHeights"
1630
+ * by: Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com)
1631
+ *
1632
+ * Copyright (c) 2008 Filament Group
1633
+ * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
1634
+ *
1635
+ * Description: Compares the heights or widths of the top-level children of a provided element
1636
+ and sets their min-height to the tallest height (or width to widest width). Sets in em units
1637
+ by default if pxToEm() method is available.
1638
+ * Dependencies: jQuery library, pxToEm method (article:
1639
+ http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/)
1640
+ * Usage Example: $(element).equalHeights();
1641
+ Optional: to set min-height in px, pass a true argument: $(element).equalHeights(true);
1642
+ * Version: 2.1, 18.12.2008
1643
+ *
1644
+ * Note: Changed pxToEm call to call $.pxToEm instead, jsLinted (Maxime Haineault <haineault@gmail.com>)
1645
+ --------------------------------------------------------------------*/
1646
+
1647
+ equalHeights: function(px){
1648
+ $(this).each(function(){
1649
+ var currentTallest = 0;
1650
+ $(this).children().each(function(i){
1651
+ if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
1652
+ });
1653
+ if (!px || !$.pxToEm) { currentTallest = $.pxToEm(currentTallest); } //use ems unless px is specified
1654
+ // for ie6, set height since min-height isn't supported
1655
+ if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': currentTallest}); }
1656
+ $(this).children().css({'min-height': currentTallest});
1657
+ });
1658
+ return this;
1659
+ },
1660
+
1661
+ // Copyright (c) 2009 James Padolsey
1662
+ // http://james.padolsey.com/javascript/jquery-delay-plugin/
1663
+ delay: function(time, callback){
1664
+ jQuery.fx.step.delay = function(){};
1665
+ return this.animate({delay:1}, time, callback);
1666
+ }
1667
+ });
1668
+ })(jQuery);
1669
+ /*
1670
+ jQuery strings - 0.3
1671
+ http://code.google.com/p/jquery-utils/
1672
+
1673
+ (c) Maxime Haineault <haineault@gmail.com>
1674
+ http://haineault.com
1675
+
1676
+ MIT License (http://www.opensource.org/licenses/mit-license.php)
1677
+
1678
+ Implementation of Python3K advanced string formatting
1679
+ http://www.python.org/dev/peps/pep-3101/
1680
+
1681
+ Documentation: http://code.google.com/p/jquery-utils/wiki/StringFormat
1682
+
1683
+ */
1684
+ (function($){
1685
+ var strings = {
1686
+ strConversion: {
1687
+ // tries to translate any objects type into string gracefully
1688
+ __repr: function(i){
1689
+ switch(this.__getType(i)) {
1690
+ case 'array':case 'date':case 'number':
1691
+ return i.toString();
1692
+ case 'object':
1693
+ var o = [];
1694
+ for (x=0; x<i.length; i++) { o.push(i+': '+ this.__repr(i[x])); }
1695
+ return o.join(', ');
1696
+ case 'string':
1697
+ return i;
1698
+ default:
1699
+ return i;
1700
+ }
1701
+ },
1702
+ // like typeof but less vague
1703
+ __getType: function(i) {
1704
+ if (!i || !i.constructor) { return typeof(i); }
1705
+ var match = i.constructor.toString().match(/Array|Number|String|Object|Date/);
1706
+ return match && match[0].toLowerCase() || typeof(i);
1707
+ },
1708
+ //+ Jonas Raoni Soares Silva
1709
+ //@ http://jsfromhell.com/string/pad [v1.0]
1710
+ __pad: function(str, l, s, t){
1711
+ var p = s || ' ';
1712
+ var o = str;
1713
+ if (l - str.length > 0) {
1714
+ o = new Array(Math.ceil(l / p.length)).join(p).substr(0, t = !t ? l : t == 1 ? 0 : Math.ceil(l / 2)) + str + p.substr(0, l - t);
1715
+ }
1716
+ return o;
1717
+ },
1718
+ __getInput: function(arg, args) {
1719
+ var key = arg.getKey();
1720
+ switch(this.__getType(args)){
1721
+ case 'object': // Thanks to Jonathan Works for the patch
1722
+ var keys = key.split('.');
1723
+ var obj = args;
1724
+ for(var subkey = 0; subkey < keys.length; subkey++){
1725
+ obj = obj[keys[subkey]];
1726
+ }
1727
+ if (typeof(obj) != 'undefined') {
1728
+ if (strings.strConversion.__getType(obj) == 'array') {
1729
+ return arg.getFormat().match(/\.\*/) && obj[1] || obj;
1730
+ }
1731
+ return obj;
1732
+ }
1733
+ else {
1734
+ // TODO: try by numerical index
1735
+ }
1736
+ break;
1737
+ case 'array':
1738
+ key = parseInt(key, 10);
1739
+ if (arg.getFormat().match(/\.\*/) && typeof args[key+1] != 'undefined') { return args[key+1]; }
1740
+ else if (typeof args[key] != 'undefined') { return args[key]; }
1741
+ else { return key; }
1742
+ break;
1743
+ }
1744
+ return '{'+key+'}';
1745
+ },
1746
+ __formatToken: function(token, args) {
1747
+ var arg = new Argument(token, args);
1748
+ return strings.strConversion[arg.getFormat().slice(-1)](this.__getInput(arg, args), arg);
1749
+ },
1750
+
1751
+ // Signed integer decimal.
1752
+ d: function(input, arg){
1753
+ var o = parseInt(input, 10); // enforce base 10
1754
+ var p = arg.getPaddingLength();
1755
+ if (p) { return this.__pad(o.toString(), p, arg.getPaddingString(), 0); }
1756
+ else { return o; }
1757
+ },
1758
+ // Signed integer decimal.
1759
+ i: function(input, args){
1760
+ return this.d(input, args);
1761
+ },
1762
+ // Unsigned octal
1763
+ o: function(input, arg){
1764
+ var o = input.toString(8);
1765
+ if (arg.isAlternate()) { o = this.__pad(o, o.length+1, '0', 0); }
1766
+ return this.__pad(o, arg.getPaddingLength(), arg.getPaddingString(), 0);
1767
+ },
1768
+ // Unsigned decimal
1769
+ u: function(input, args) {
1770
+ return Math.abs(this.d(input, args));
1771
+ },
1772
+ // Unsigned hexadecimal (lowercase)
1773
+ x: function(input, arg){
1774
+ var o = parseInt(input, 10).toString(16);
1775
+ o = this.__pad(o, arg.getPaddingLength(), arg.getPaddingString(),0);
1776
+ return arg.isAlternate() ? '0x'+o : o;
1777
+ },
1778
+ // Unsigned hexadecimal (uppercase)
1779
+ X: function(input, arg){
1780
+ return this.x(input, arg).toUpperCase();
1781
+ },
1782
+ // Floating point exponential format (lowercase)
1783
+ e: function(input, arg){
1784
+ return parseFloat(input, 10).toExponential(arg.getPrecision());
1785
+ },
1786
+ // Floating point exponential format (uppercase)
1787
+ E: function(input, arg){
1788
+ return this.e(input, arg).toUpperCase();
1789
+ },
1790
+ // Floating point decimal format
1791
+ f: function(input, arg){
1792
+ return this.__pad(parseFloat(input, 10).toFixed(arg.getPrecision()), arg.getPaddingLength(), arg.getPaddingString(),0);
1793
+ },
1794
+ // Floating point decimal format (alias)
1795
+ F: function(input, args){
1796
+ return this.f(input, args);
1797
+ },
1798
+ // Floating point format. Uses exponential format if exponent is greater than -4 or less than precision, decimal format otherwise
1799
+ g: function(input, arg){
1800
+ var o = parseFloat(input, 10);
1801
+ return (o.toString().length > 6) ? Math.round(o.toExponential(arg.getPrecision())): o;
1802
+ },
1803
+ // Floating point format. Uses exponential format if exponent is greater than -4 or less than precision, decimal format otherwise
1804
+ G: function(input, args){
1805
+ return this.g(input, args);
1806
+ },
1807
+ // Single character (accepts integer or single character string).
1808
+ c: function(input, args) {
1809
+ var match = input.match(/\w|\d/);
1810
+ return match && match[0] || '';
1811
+ },
1812
+ // String (converts any JavaScript object to anotated format)
1813
+ r: function(input, args) {
1814
+ return this.__repr(input);
1815
+ },
1816
+ // String (converts any JavaScript object using object.toString())
1817
+ s: function(input, args) {
1818
+ return input.toString && input.toString() || ''+input;
1819
+ }
1820
+ },
1821
+
1822
+ format: function(str, args) {
1823
+ var end = 0;
1824
+ var start = 0;
1825
+ var match = false;
1826
+ var buffer = [];
1827
+ var token = '';
1828
+ var tmp = (str||'').split('');
1829
+ for(start=0; start < tmp.length; start++) {
1830
+ if (tmp[start] == '{' && tmp[start+1] !='{') {
1831
+ end = str.indexOf('}', start);
1832
+ token = tmp.slice(start+1, end).join('');
1833
+ if (tmp[start-1] != '{' && tmp[end+1] != '}') {
1834
+ var tokenArgs = (typeof arguments[1] != 'object')? arguments2Array(arguments, 2): args || [];
1835
+ buffer.push(strings.strConversion.__formatToken(token, tokenArgs));
1836
+ }
1837
+ else {
1838
+ buffer.push(token);
1839
+ }
1840
+ }
1841
+ else if (start > end || buffer.length < 1) { buffer.push(tmp[start]); }
1842
+ }
1843
+ return (buffer.length > 1)? buffer.join(''): buffer[0];
1844
+ },
1845
+
1846
+ calc: function(str, args) {
1847
+ return eval(format(str, args));
1848
+ },
1849
+
1850
+ repeat: function(s, n) {
1851
+ return new Array(n+1).join(s);
1852
+ },
1853
+
1854
+ UTF8encode: function(s) {
1855
+ return unescape(encodeURIComponent(s));
1856
+ },
1857
+
1858
+ UTF8decode: function(s) {
1859
+ return decodeURIComponent(escape(s));
1860
+ },
1861
+
1862
+ tpl: function() {
1863
+ var out = '', render = true;
1864
+ // Set
1865
+ // $.tpl('ui.test', ['<span>', helloWorld ,'</span>']);
1866
+ if (arguments.length == 2 && $.isArray(arguments[1])) {
1867
+ this[arguments[0]] = arguments[1].join('');
1868
+ return jQuery;
1869
+ }
1870
+ // $.tpl('ui.test', '<span>hello world</span>');
1871
+ if (arguments.length == 2 && $.isString(arguments[1])) {
1872
+ this[arguments[0]] = arguments[1];
1873
+ return jQuery;
1874
+ }
1875
+ // Call
1876
+ // $.tpl('ui.test');
1877
+ if (arguments.length == 1) {
1878
+ return $(this[arguments[0]]);
1879
+ }
1880
+ // $.tpl('ui.test', false);
1881
+ if (arguments.length == 2 && arguments[1] == false) {
1882
+ return this[arguments[0]];
1883
+ }
1884
+ // $.tpl('ui.test', {value:blah});
1885
+ if (arguments.length == 2 && $.isObject(arguments[1])) {
1886
+ return $($.format(this[arguments[0]], arguments[1]));
1887
+ }
1888
+ // $.tpl('ui.test', {value:blah}, false);
1889
+ if (arguments.length == 3 && $.isObject(arguments[1])) {
1890
+ return (arguments[2] == true)
1891
+ ? $.format(this[arguments[0]], arguments[1])
1892
+ : $($.format(this[arguments[0]], arguments[1]));
1893
+ }
1894
+ }
1895
+ };
1896
+
1897
+ var Argument = function(arg, args) {
1898
+ this.__arg = arg;
1899
+ this.__args = args;
1900
+ this.__max_precision = parseFloat('1.'+ (new Array(32)).join('1'), 10).toString().length-3;
1901
+ this.__def_precision = 6;
1902
+ this.getString = function(){
1903
+ return this.__arg;
1904
+ };
1905
+ this.getKey = function(){
1906
+ return this.__arg.split(':')[0];
1907
+ };
1908
+ this.getFormat = function(){
1909
+ var match = this.getString().split(':');
1910
+ return (match && match[1])? match[1]: 's';
1911
+ };
1912
+ this.getPrecision = function(){
1913
+ var match = this.getFormat().match(/\.(\d+|\*)/g);
1914
+ if (!match) { return this.__def_precision; }
1915
+ else {
1916
+ match = match[0].slice(1);
1917
+ if (match != '*') { return parseInt(match, 10); }
1918
+ else if(strings.strConversion.__getType(this.__args) == 'array') {
1919
+ return this.__args[1] && this.__args[0] || this.__def_precision;
1920
+ }
1921
+ else if(strings.strConversion.__getType(this.__args) == 'object') {
1922
+ return this.__args[this.getKey()] && this.__args[this.getKey()][0] || this.__def_precision;
1923
+ }
1924
+ else { return this.__def_precision; }
1925
+ }
1926
+ };
1927
+ this.getPaddingLength = function(){
1928
+ var match = false;
1929
+ if (this.isAlternate()) {
1930
+ match = this.getString().match(/0?#0?(\d+)/);
1931
+ if (match && match[1]) { return parseInt(match[1], 10); }
1932
+ }
1933
+ match = this.getString().match(/(0|\.)(\d+|\*)/g);
1934
+ return match && parseInt(match[0].slice(1), 10) || 0;
1935
+ };
1936
+ this.getPaddingString = function(){
1937
+ var o = '';
1938
+ if (this.isAlternate()) { o = ' '; }
1939
+ // 0 take precedence on alternate format
1940
+ if (this.getFormat().match(/#0|0#|^0|\.\d+/)) { o = '0'; }
1941
+ return o;
1942
+ };
1943
+ this.getFlags = function(){
1944
+ var match = this.getString().matc(/^(0|\#|\-|\+|\s)+/);
1945
+ return match && match[0].split('') || [];
1946
+ };
1947
+ this.isAlternate = function() {
1948
+ return !!this.getFormat().match(/^0?#/);
1949
+ };
1950
+ };
1951
+
1952
+ var arguments2Array = function(args, shift) {
1953
+ var o = [];
1954
+ for (l=args.length, x=(shift || 0)-1; x<l;x++) { o.push(args[x]); }
1955
+ return o;
1956
+ };
1957
+ $.extend(strings);
1958
+ })(jQuery);
1959
+ /*
1960
+ jQuery ui.dropslide - 0.4
1961
+ http://code.google.com/p/jquery-utils/
1962
+
1963
+ (c) Maxime Haineault <haineault@gmail.com>
1964
+ http://haineault.com
1965
+
1966
+ MIT License (http://www.opensource.org/licenses/mit-license.php
1967
+
1968
+ */
1969
+
1970
+ (function($) {
1971
+ $.widget('ui.dropslide', $.extend({}, $.ui.mouse, {
1972
+ getter: 'showLevel showNextLevel getSelection',
1973
+ _init: function() {
1974
+ var widget = this;
1975
+ this.wrapper = this.element.next();
1976
+
1977
+ this.element.bind(this.options.trigger +'.dropslide', function(){
1978
+ widget.show();
1979
+ });
1980
+ this.wrapper
1981
+ .data('dropslide', this)
1982
+ .css({width:this.options.width})
1983
+ .find('li, li ol li')
1984
+ .bind('mouseover.dropslide', function(e){
1985
+ $(this).siblings().removeClass('hover')
1986
+ .find('ol').hide().end()
1987
+ .find('span').removeClass('ui-state-hover').end();
1988
+ $(this).find('ol').show().end().addClass('hover').children(0).addClass('ui-state-hover');
1989
+ widget.showNextLevel();
1990
+ })
1991
+ .bind('click.dropslide', function(e){
1992
+ $(widget.element).triggerHandler('dropslideclick', [e, widget], widget.options.click);
1993
+ $(widget.element).triggerHandler('select', [e, widget], widget.options.select);
1994
+ }).end()
1995
+ .find('ol')
1996
+ .bind('mousemove.dropslide', function(e){
1997
+ return widget._redraw();
1998
+ })
1999
+ .addClass('ui-widget ui-helper-clearfix ui-helper-reset')
2000
+ .hide().end()
2001
+ .find('span').addClass('ui-state-default ui-corner-all');
2002
+
2003
+ this._redraw();
2004
+ },
2005
+
2006
+ // show specified level, id is the DOM position
2007
+ showLevel: function(id) {
2008
+ var ols = this.wrapper.find('ol');
2009
+ var ds = this;
2010
+ if (id == 0) {
2011
+ ols.eq(0).css('left', this.element.position().left);
2012
+ this.wrapper.css('top', ds.element.position().top + ds.element.height() + ds.options.top);
2013
+ this.wrapper.css('z-index', 1000);
2014
+ }
2015
+ setTimeout(function() {
2016
+ ols.removeClass('active').eq(id).addClass('active').show(ds.options.animSpeed);
2017
+ }, ds.options.showDelay);
2018
+ },
2019
+
2020
+ // guess what it does
2021
+ showNextLevel: function() {
2022
+ this.wrapper.find('ol.active')
2023
+ .removeClass('active')
2024
+ .next('ol').addClass('active').show(this.options.animSpeed);
2025
+ },
2026
+
2027
+ getSelection: function(level) {
2028
+ return level
2029
+ && this.wrapper.find('ol').eq(level).find('li span.ui-state-hover')
2030
+ || $.makeArray(this.wrapper.find('span.ui-state-hover').map($.iterators.getText));
2031
+ },
2032
+
2033
+ // essentially reposition each ol
2034
+ _redraw: function() {
2035
+ var prevLI ,prevOL, nextOL, pos = false;
2036
+ var offset = this.element.position().left + this.options.left;
2037
+ var ols = $(this.wrapper).find('ol');
2038
+
2039
+ $(this.wrapper).css({
2040
+ top: this.element.position().top + this.element.height() + this.options.top,
2041
+ left: this.element.position().left
2042
+ });
2043
+
2044
+ // reposition each ol
2045
+ ols.each(function(i) {
2046
+ prevOL = $(this).prevAll('ol:visible:first');
2047
+ if (prevOL.get(0)) {
2048
+ prevLI = prevOL.find('li.hover').get(0) && prevOL.find('li.hover') || prevOL.find('li:first');
2049
+ $(this).css('margin-left', prevLI.position().left);
2050
+ }
2051
+ });
2052
+ },
2053
+
2054
+ // show level 0 (shortcut)
2055
+ show: function(e) {
2056
+ this.showLevel(0);
2057
+ },
2058
+
2059
+ // hide all levels
2060
+ hide: function() {
2061
+ var widget = this;
2062
+ setTimeout(function() {
2063
+ widget.wrapper.find('ol').hide();
2064
+ }, widget.options.hideDelay);
2065
+ },
2066
+
2067
+ activate: function(e) {
2068
+ this.element.focus();
2069
+ this.show(this.options.animSpeed);
2070
+ },
2071
+
2072
+ destroy: function(e) {
2073
+ this.wrapper.remove();
2074
+ }
2075
+ }));
2076
+
2077
+ $.ui.dropslide.defaults = {
2078
+ // options
2079
+ tree: false,
2080
+ trigger: 'mouseover',
2081
+ top: 6,
2082
+ left: 0,
2083
+ showDelay: 0,
2084
+ hideDelay: 0,
2085
+ animSpeed: 0,
2086
+ // events
2087
+ select: function() {},
2088
+ click: function(e, ui) { ui.hide(); }
2089
+ };
2090
+ })(jQuery);
2091
+ /*
2092
+ jQuery ui.timepickr - 0.6.6
2093
+ http://code.google.com/p/jquery-utils/
2094
+
2095
+ (c) Maxime Haineault <haineault@gmail.com>
2096
+ http://haineault.com
2097
+
2098
+ MIT License (http://www.opensource.org/licenses/mit-license.php
2099
+
2100
+ Note: if you want the original experimental plugin checkout the rev 224
2101
+
2102
+ Dependencies
2103
+ ------------
2104
+ - jquery.utils.js
2105
+ - jquery.strings.js
2106
+ - jquery.ui.js
2107
+ - ui.dropslide.js
2108
+
2109
+ */
2110
+
2111
+ (function($) {
2112
+ $.tpl('timepickr.menu', '<span class="ui-helper-reset ui-dropslide ui-timepickr ui-widget" />');
2113
+ $.tpl('timepickr.row', '<ol class="ui-timepickr" />');
2114
+ $.tpl('timepickr.button', '<li class="{className:s}"><span>{label:s}</span></li>');
2115
+
2116
+ $.widget('ui.timepickr', {
2117
+ _init: function() {
2118
+ var ui = this;
2119
+ var menu = ui._buildMenu();
2120
+ var element = ui.element;
2121
+ element.data('timepickr.initialValue', element.val());
2122
+ menu.insertAfter(ui.element);
2123
+ element
2124
+ .addClass('ui-timepickr')
2125
+ .dropslide(ui.options.dropslide)
2126
+ .bind('select', ui.select);
2127
+
2128
+ element.blur(function(e) {
2129
+ $(this).dropslide('hide');
2130
+ if (ui.options.resetOnBlur) {
2131
+ $(this).val($(this).data('timepickr.initialValue'));
2132
+ }
2133
+ });
2134
+
2135
+ if (ui.options.val) {
2136
+ element.val(this.options.val);
2137
+ }
2138
+
2139
+ if (ui.options.handle) {
2140
+ $(this.options.handle).click(function() {
2141
+ $(element).dropslide('show');
2142
+ });
2143
+ }
2144
+
2145
+ if (ui.options.resetOnBlur) {
2146
+ menu.find('li > span').bind('mousedown.timepickr', function(){
2147
+ $(element).data('timepickr.initialValue', $(element).val());
2148
+ });
2149
+ }
2150
+ if (ui.options.updateLive) {
2151
+ menu.find('li').bind('mouseover.timepickr', function() {
2152
+ $(element).timepickr('update');
2153
+ });
2154
+ }
2155
+ var hrs = menu.find('ol:eq(1)').find('li:first').addClass('hover').find('span').addClass('ui-state-hover').end().end();
2156
+ var min = menu.find('ol:eq(2)').find('li:first').addClass('hover').find('span').addClass('ui-state-hover').end().end();
2157
+ var sec = menu.find('ol:eq(3)').find('li:first').addClass('hover').find('span').addClass('ui-state-hover').end().end();
2158
+
2159
+ if (this.options.convention === 24) {
2160
+ var day = menu.find('ol:eq(0) li:eq(0)');
2161
+ var night = menu.find('ol:eq(0) li:eq(1)');
2162
+ var dayHours = hrs.find('li').slice(0, 12);
2163
+ var nightHours = hrs.find('li').slice(12, 24);
2164
+ var index = 0;
2165
+ var selectHr = function(id) {
2166
+ hrs.find('li').removeClass('hover');
2167
+ hrs.find('span').removeClass('ui-state-hover');
2168
+ hrs.find('li').eq(id).addClass('hover').find('span').addClass('ui-state-hover')
2169
+ };
2170
+
2171
+ day.mouseover(function() {
2172
+ nightHours.hide();
2173
+ dayHours.show(0);
2174
+ index = hrs.find('li.hover').data('id') || hrs.find('li:first').data('id');
2175
+ selectHr(index > 11 && index - 12 || index);
2176
+ element.dropslide('redraw');
2177
+ });
2178
+
2179
+ night.mouseover(function() {
2180
+ dayHours.hide();
2181
+ nightHours.show(0);
2182
+ index = hrs.find('li.hover').data('id') || hrs.find('li:first').data('id');
2183
+ selectHr(index < 12 && index + 12 || index);
2184
+ element.dropslide('redraw');
2185
+ });
2186
+ }
2187
+ element.dropslide('redraw');
2188
+ element.data('timepickr', this);
2189
+ },
2190
+
2191
+ update: function() {
2192
+ var frmt = this.options.convention === 24 && 'format24' || 'format12';
2193
+ var val = {
2194
+ h: this.getValue('hour'),
2195
+ m: this.getValue('minute'),
2196
+ s: this.getValue('second'),
2197
+ prefix: this.getValue('prefix'),
2198
+ suffix: this.getValue('suffix')
2199
+ };
2200
+ var o = $.format(this.options[frmt], val);
2201
+
2202
+ $(this.element).val(o);
2203
+ },
2204
+
2205
+ select: function(e) {
2206
+ var dropslide = $(this).data('dropslide');
2207
+ $(dropslide.element).timepickr('update');
2208
+ e.stopPropagation();
2209
+ },
2210
+
2211
+ getHour: function() {
2212
+ return this.getValue('hour');
2213
+ },
2214
+
2215
+ getMinute: function() {
2216
+ return this.getValue('minute');
2217
+ },
2218
+
2219
+ getSecond: function() {
2220
+ return this.getValue('second');
2221
+ },
2222
+
2223
+ getValue: function(type) {
2224
+ return $('.ui-timepickr.'+ type +'.hover', this.element.next()).text();
2225
+ },
2226
+
2227
+ activate: function() {
2228
+ this.element.dropslide('activate');
2229
+ },
2230
+
2231
+ destroy: function() {
2232
+ this.element.dropslide('destroy');
2233
+ },
2234
+
2235
+ /* UI private methods */
2236
+
2237
+ _createButton: function(i, format, className) {
2238
+ var o = format && $.format(format, i) || i;
2239
+ var cn = className && 'ui-timepickr '+ className || 'ui-timepickr';
2240
+ return $.tpl('timepickr.button', {className: cn, label: o}).data('id', i);
2241
+ },
2242
+
2243
+ _createRow: function(range, format, className) {
2244
+ var row = $.tpl('timepickr.row');
2245
+ var button = this._createButton;
2246
+ // Thanks to Christoph Müller-Spengler for the bug report
2247
+ $.each(range, function(idx, val){
2248
+ row.append(button(val, format || false, className || false));
2249
+ });
2250
+ return row;
2251
+ },
2252
+
2253
+ _getRanges12: function() {
2254
+ var o = [], opt = this.options;
2255
+ if (opt.hours) { o.push(this._createRow($.range(1, 13), '{0:0.2d}', 'hour')); }
2256
+ if (opt.minutes) { o.push(this._createRow(opt.rangeMin, '{0:0.2d}', 'minute')); }
2257
+ if (opt.seconds) { o.push(this._createRow(opt.rangeSec, '{0:0.2d}', 'second')); }
2258
+ if (opt.suffix) { o.push(this._createRow(opt.suffix, false, 'suffix')); }
2259
+ return o;
2260
+ },
2261
+
2262
+ _getRanges24: function() {
2263
+ var o = [], opt = this.options;
2264
+ o.push(this._createRow(opt.prefix, false, 'prefix')); // prefix is required in 24h mode
2265
+ if (opt.hours) { o.push(this._createRow($.range(0, 24), '{0:0.2d}', 'hour')); }
2266
+ if (opt.minutes) { o.push(this._createRow(opt.rangeMin, '{0:0.2d}', 'minute')); }
2267
+ if (opt.seconds) { o.push(this._createRow(opt.rangeSec, '{0:0.2d}', 'second')); }
2268
+ return o;
2269
+ },
2270
+
2271
+ _buildMenu: function() {
2272
+ var menu = $.tpl('timepickr.menu');
2273
+ var ranges = this.options.convention === 24
2274
+ && this._getRanges24() || this._getRanges12();
2275
+
2276
+ $.each(ranges, function(idx, val){
2277
+ menu.append(val);
2278
+ });
2279
+ return menu;
2280
+ }
2281
+ });
2282
+
2283
+ // These properties are shared accross every instances of timepickr
2284
+ $.extend($.ui.timepickr, {
2285
+ version: '0.6.6',
2286
+ eventPrefix: '',
2287
+ getter: '',
2288
+ defaults: {
2289
+ convention: 24, // 24, 12
2290
+ dropslide: { trigger: 'focus' },
2291
+ format12: '{h:02.d}:{m:02.d} {suffix:s}',
2292
+ format24: '{h:02.d}:{m:02.d}',
2293
+ handle: false,
2294
+ hours: true,
2295
+ minutes: true,
2296
+ seconds: false,
2297
+ prefix: ['am', 'pm'],
2298
+ suffix: ['am', 'pm'],
2299
+ rangeMin: $.range(0, 60, 15),
2300
+ rangeSec: $.range(0, 60, 15),
2301
+ updateLive: true,
2302
+ resetOnBlur: true,
2303
+ val: false
2304
+ }
2305
+ });
2306
+
2307
+ })(jQuery);