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,3534 @@
1
+ (function(){
2
+ /*
3
+ * jQuery 1.2.7pre - New Wave Javascript
4
+ *
5
+ * Copyright (c) 2008 John Resig (jquery.com)
6
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
7
+ * and GPL (GPL-LICENSE.txt) licenses.
8
+ *
9
+ * $Date: 2008-07-23 19:00:32 +0200 (Mi, 23 Jul 2008) $
10
+ * $Rev: 5793 $
11
+ */
12
+
13
+ // Map over jQuery in case of overwrite
14
+ var _jQuery = window.jQuery,
15
+ // Map over the $ in case of overwrite
16
+ _$ = window.$;
17
+
18
+ var jQuery = window.jQuery = window.$ = function( selector, context ) {
19
+ // The jQuery object is actually just the init constructor 'enhanced'
20
+ return new jQuery.fn.init( selector, context );
21
+ };
22
+
23
+ // A simple way to check for HTML strings or ID strings
24
+ // (both of which we optimize for)
25
+ var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
26
+
27
+ // Is it a simple selector
28
+ isSimple = /^.[^:#\[\.]*$/,
29
+
30
+ // Will speed up references to undefined, and allows munging its name.
31
+ undefined;
32
+
33
+ jQuery.fn = jQuery.prototype = {
34
+ init: function( selector, context ) {
35
+ // Make sure that a selection was provided
36
+ selector = selector || document;
37
+
38
+ // Handle $(DOMElement)
39
+ if ( selector.nodeType ) {
40
+ this[0] = selector;
41
+ this.length = 1;
42
+ return this;
43
+ }
44
+ // Handle HTML strings
45
+ if ( typeof selector == "string" ) {
46
+ // Are we dealing with HTML string or an ID?
47
+ var match = quickExpr.exec( selector );
48
+
49
+ // Verify a match, and that no context was specified for #id
50
+ if ( match && (match[1] || !context) ) {
51
+
52
+ // HANDLE: $(html) -> $(array)
53
+ if ( match[1] )
54
+ selector = jQuery.clean( [ match[1] ], context );
55
+
56
+ // HANDLE: $("#id")
57
+ else {
58
+ var elem = document.getElementById( match[3] );
59
+
60
+ // Make sure an element was located
61
+ if ( elem ){
62
+ // Handle the case where IE and Opera return items
63
+ // by name instead of ID
64
+ if ( elem.id != match[3] )
65
+ return jQuery().find( selector );
66
+
67
+ // Otherwise, we inject the element directly into the jQuery object
68
+ return jQuery( elem );
69
+ }
70
+ selector = [];
71
+ }
72
+
73
+ // HANDLE: $(expr, [context])
74
+ // (which is just equivalent to: $(content).find(expr)
75
+ } else
76
+ return jQuery( context ).find( selector );
77
+
78
+ // HANDLE: $(function)
79
+ // Shortcut for document ready
80
+ } else if ( jQuery.isFunction( selector ) )
81
+ return jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector );
82
+
83
+ return this.setArray(jQuery.makeArray(selector));
84
+ },
85
+
86
+ // The current version of jQuery being used
87
+ jquery: "1.2.7pre",
88
+
89
+ // The number of elements contained in the matched element set
90
+ size: function() {
91
+ return this.length;
92
+ },
93
+
94
+ // The number of elements contained in the matched element set
95
+ length: 0,
96
+
97
+ // Get the Nth element in the matched element set OR
98
+ // Get the whole matched element set as a clean array
99
+ get: function( num ) {
100
+ return num == undefined ?
101
+
102
+ // Return a 'clean' array
103
+ jQuery.makeArray( this ) :
104
+
105
+ // Return just the object
106
+ this[ num ];
107
+ },
108
+
109
+ // Take an array of elements and push it onto the stack
110
+ // (returning the new matched element set)
111
+ pushStack: function( elems ) {
112
+ // Build a new jQuery matched element set
113
+ var ret = jQuery( elems );
114
+
115
+ // Add the old object onto the stack (as a reference)
116
+ ret.prevObject = this;
117
+
118
+ // Return the newly-formed element set
119
+ return ret;
120
+ },
121
+
122
+ // Force the current matched set of elements to become
123
+ // the specified array of elements (destroying the stack in the process)
124
+ // You should use pushStack() in order to do this, but maintain the stack
125
+ setArray: function( elems ) {
126
+ // Resetting the length to 0, then using the native Array push
127
+ // is a super-fast way to populate an object with array-like properties
128
+ this.length = 0;
129
+ Array.prototype.push.apply( this, elems );
130
+
131
+ return this;
132
+ },
133
+
134
+ // Execute a callback for every element in the matched set.
135
+ // (You can seed the arguments with an array of args, but this is
136
+ // only used internally.)
137
+ each: function( callback, args ) {
138
+ return jQuery.each( this, callback, args );
139
+ },
140
+
141
+ // Determine the position of an element within
142
+ // the matched set of elements
143
+ index: function( elem ) {
144
+ var ret = -1;
145
+
146
+ // Locate the position of the desired element
147
+ return jQuery.inArray(
148
+ // If it receives a jQuery object, the first element is used
149
+ elem && elem.jquery ? elem[0] : elem
150
+ , this );
151
+ },
152
+
153
+ attr: function( name, value, type ) {
154
+ var options = name;
155
+
156
+ // Look for the case where we're accessing a style value
157
+ if ( name.constructor == String )
158
+ if ( value === undefined )
159
+ return this[0] && jQuery[ type || "attr" ]( this[0], name );
160
+
161
+ else {
162
+ options = {};
163
+ options[ name ] = value;
164
+ }
165
+
166
+ // Check to see if we're setting style values
167
+ return this.each(function(i){
168
+ // Set all the styles
169
+ for ( name in options )
170
+ jQuery.attr(
171
+ type ?
172
+ this.style :
173
+ this,
174
+ name, jQuery.prop( this, options[ name ], type, i, name )
175
+ );
176
+ });
177
+ },
178
+
179
+ css: function( key, value ) {
180
+ // ignore negative width and height values
181
+ if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
182
+ value = undefined;
183
+ return this.attr( key, value, "curCSS" );
184
+ },
185
+
186
+ text: function( text ) {
187
+ if ( typeof text != "object" && text != null )
188
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
189
+
190
+ var ret = "";
191
+
192
+ jQuery.each( text || this, function(){
193
+ jQuery.each( this.childNodes, function(){
194
+ if ( this.nodeType != 8 )
195
+ ret += this.nodeType != 1 ?
196
+ this.nodeValue :
197
+ jQuery.fn.text( [ this ] );
198
+ });
199
+ });
200
+
201
+ return ret;
202
+ },
203
+
204
+ wrapAll: function( html ) {
205
+ if ( this[0] )
206
+ // The elements to wrap the target around
207
+ jQuery( html, this[0].ownerDocument )
208
+ .clone()
209
+ .insertBefore( this[0] )
210
+ .map(function(){
211
+ var elem = this;
212
+
213
+ while ( elem.firstChild )
214
+ elem = elem.firstChild;
215
+
216
+ return elem;
217
+ })
218
+ .append(this);
219
+
220
+ return this;
221
+ },
222
+
223
+ wrapInner: function( html ) {
224
+ return this.each(function(){
225
+ jQuery( this ).contents().wrapAll( html );
226
+ });
227
+ },
228
+
229
+ wrap: function( html ) {
230
+ return this.each(function(){
231
+ jQuery( this ).wrapAll( html );
232
+ });
233
+ },
234
+
235
+ append: function() {
236
+ return this.domManip(arguments, true, false, function(elem){
237
+ if (this.nodeType == 1)
238
+ this.appendChild( elem );
239
+ });
240
+ },
241
+
242
+ prepend: function() {
243
+ return this.domManip(arguments, true, true, function(elem){
244
+ if (this.nodeType == 1)
245
+ this.insertBefore( elem, this.firstChild );
246
+ });
247
+ },
248
+
249
+ before: function() {
250
+ return this.domManip(arguments, false, false, function(elem){
251
+ this.parentNode.insertBefore( elem, this );
252
+ });
253
+ },
254
+
255
+ after: function() {
256
+ return this.domManip(arguments, false, true, function(elem){
257
+ this.parentNode.insertBefore( elem, this.nextSibling );
258
+ });
259
+ },
260
+
261
+ end: function() {
262
+ return this.prevObject || jQuery( [] );
263
+ },
264
+
265
+ find: function( selector ) {
266
+ var elems = jQuery.map(this, function(elem){
267
+ return jQuery.find( selector, elem );
268
+ });
269
+
270
+ return this.pushStack( /[^+>] [^+>]/.test( selector ) ?
271
+ jQuery.unique( elems ) :
272
+ elems );
273
+ },
274
+
275
+ clone: function( events ) {
276
+ // Do the clone
277
+ var ret = this.map(function(){
278
+ if ( jQuery.browser.msie && !jQuery.isXMLDoc(this) ) {
279
+ // IE copies events bound via attachEvent when
280
+ // using cloneNode. Calling detachEvent on the
281
+ // clone will also remove the events from the orignal
282
+ // In order to get around this, we use innerHTML.
283
+ // Unfortunately, this means some modifications to
284
+ // attributes in IE that are actually only stored
285
+ // as properties will not be copied (such as the
286
+ // the name attribute on an input).
287
+ var clone = this.cloneNode(true),
288
+ container = document.createElement("div");
289
+ container.appendChild(clone);
290
+ return jQuery.clean([container.innerHTML])[0];
291
+ } else
292
+ return this.cloneNode(true);
293
+ });
294
+
295
+ // Need to set the expando to null on the cloned set if it exists
296
+ // removeData doesn't work here, IE removes it from the original as well
297
+ // this is primarily for IE but the data expando shouldn't be copied over in any browser
298
+ var clone = ret.find("*").andSelf().each(function(){
299
+ if ( this[ expando ] != undefined )
300
+ this[ expando ] = null;
301
+ });
302
+
303
+ // Copy the events from the original to the clone
304
+ if ( events === true )
305
+ this.find("*").andSelf().each(function(i){
306
+ if (this.nodeType == 3)
307
+ return;
308
+ var events = jQuery.data( this, "events" );
309
+
310
+ for ( var type in events )
311
+ for ( var handler in events[ type ] )
312
+ jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data );
313
+ });
314
+
315
+ // Return the cloned set
316
+ return ret;
317
+ },
318
+
319
+ filter: function( selector ) {
320
+ return this.pushStack(
321
+ jQuery.isFunction( selector ) &&
322
+ jQuery.grep(this, function(elem, i){
323
+ return selector.call( elem, i );
324
+ }) ||
325
+
326
+ jQuery.multiFilter( selector, this ) );
327
+ },
328
+
329
+ not: function( selector ) {
330
+ if ( selector.constructor == String )
331
+ // test special case where just one selector is passed in
332
+ if ( isSimple.test( selector ) )
333
+ return this.pushStack( jQuery.multiFilter( selector, this, true ) );
334
+ else
335
+ selector = jQuery.multiFilter( selector, this );
336
+
337
+ var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
338
+ return this.filter(function() {
339
+ return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
340
+ });
341
+ },
342
+
343
+ add: function( selector ) {
344
+ return this.pushStack( jQuery.unique( jQuery.merge(
345
+ this.get(),
346
+ typeof selector == 'string' ?
347
+ jQuery( selector ) :
348
+ jQuery.makeArray( selector )
349
+ )));
350
+ },
351
+
352
+ is: function( selector ) {
353
+ return !!selector && jQuery.multiFilter( selector, this ).length > 0;
354
+ },
355
+
356
+ hasClass: function( selector ) {
357
+ return this.is( "." + selector );
358
+ },
359
+
360
+ val: function( value ) {
361
+ if ( value == undefined ) {
362
+
363
+ if ( this.length ) {
364
+ var elem = this[0];
365
+
366
+ if( jQuery.nodeName( elem, 'option' ) )
367
+ return (elem.attributes.value || {}).specified ? elem.value : elem.text;
368
+
369
+ // We need to handle select boxes special
370
+ if ( jQuery.nodeName( elem, "select" ) ) {
371
+ var index = elem.selectedIndex,
372
+ values = [],
373
+ options = elem.options,
374
+ one = elem.type == "select-one";
375
+
376
+ // Nothing was selected
377
+ if ( index < 0 )
378
+ return null;
379
+
380
+ // Loop through all the selected options
381
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
382
+ var option = options[ i ];
383
+
384
+ if ( option.selected ) {
385
+ // Get the specifc value for the option
386
+ value = jQuery(option).val();
387
+
388
+ // We don't need an array for one selects
389
+ if ( one )
390
+ return value;
391
+
392
+ // Multi-Selects return an array
393
+ values.push( value );
394
+ }
395
+ }
396
+
397
+ return values;
398
+
399
+ // Everything else, we just grab the value
400
+ } else
401
+ return (this[0].value || "").replace(/\r/g, "");
402
+
403
+ }
404
+
405
+ return undefined;
406
+ }
407
+
408
+ if( value.constructor == Number )
409
+ value += '';
410
+
411
+ return this.each(function(){
412
+ if ( this.nodeType != 1 )
413
+ return;
414
+
415
+ if ( value.constructor == Array && /radio|checkbox/.test( this.type ) )
416
+ this.checked = (jQuery.inArray(this.value, value) >= 0 ||
417
+ jQuery.inArray(this.name, value) >= 0);
418
+
419
+ else if ( jQuery.nodeName( this, "select" ) ) {
420
+ var values = jQuery.makeArray(value);
421
+
422
+ jQuery( "option", this ).each(function(){
423
+ this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
424
+ jQuery.inArray( this.text, values ) >= 0);
425
+ });
426
+
427
+ if ( !values.length )
428
+ this.selectedIndex = -1;
429
+
430
+ } else
431
+ this.value = value;
432
+ });
433
+ },
434
+
435
+ html: function( value ) {
436
+ return value == undefined ?
437
+ (this[0] ?
438
+ this[0].innerHTML :
439
+ null) :
440
+ this.empty().append( value );
441
+ },
442
+
443
+ replaceWith: function( value ) {
444
+ return this.after( value ).remove();
445
+ },
446
+
447
+ eq: function( i ) {
448
+ return this.slice( i, +i + 1 );
449
+ },
450
+
451
+ slice: function() {
452
+ return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
453
+ },
454
+
455
+ map: function( callback ) {
456
+ return this.pushStack( jQuery.map(this, function(elem, i){
457
+ return callback.call( elem, i, elem );
458
+ }));
459
+ },
460
+
461
+ andSelf: function() {
462
+ return this.add( this.prevObject );
463
+ },
464
+
465
+ data: function( key, value ){
466
+ var parts = key.split(".");
467
+ parts[1] = parts[1] ? "." + parts[1] : "";
468
+
469
+ if ( value === undefined ) {
470
+ var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
471
+
472
+ if ( data === undefined && this.length )
473
+ data = jQuery.data( this[0], key );
474
+
475
+ return data === undefined && parts[1] ?
476
+ this.data( parts[0] ) :
477
+ data;
478
+ } else
479
+ return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
480
+ jQuery.data( this, key, value );
481
+ });
482
+ },
483
+
484
+ removeData: function( key ){
485
+ return this.each(function(){
486
+ jQuery.removeData( this, key );
487
+ });
488
+ },
489
+
490
+ domManip: function( args, table, reverse, callback ) {
491
+ var clone = this.length > 1, elems;
492
+
493
+ return this.each(function(){
494
+ if ( !elems ) {
495
+ elems = jQuery.clean( args, this.ownerDocument );
496
+
497
+ if ( reverse )
498
+ elems.reverse();
499
+ }
500
+
501
+ var obj = this;
502
+
503
+ if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) )
504
+ obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") );
505
+
506
+ var scripts = jQuery( [] );
507
+
508
+ jQuery.each(elems, function(){
509
+ var elem = clone ?
510
+ jQuery( this ).clone( true )[0] :
511
+ this;
512
+
513
+ // execute all scripts after the elements have been injected
514
+ if ( jQuery.nodeName( elem, "script" ) )
515
+ scripts = scripts.add( elem );
516
+ else {
517
+ // Remove any inner scripts for later evaluation
518
+ if ( elem.nodeType == 1 )
519
+ scripts = scripts.add( jQuery( "script", elem ).remove() );
520
+
521
+ // Inject the elements into the document
522
+ callback.call( obj, elem );
523
+ }
524
+ });
525
+
526
+ scripts.each( evalScript );
527
+ });
528
+ }
529
+ };
530
+
531
+ // Give the init function the jQuery prototype for later instantiation
532
+ jQuery.fn.init.prototype = jQuery.fn;
533
+
534
+ function evalScript( i, elem ) {
535
+ if ( elem.src )
536
+ jQuery.ajax({
537
+ url: elem.src,
538
+ async: false,
539
+ dataType: "script"
540
+ });
541
+
542
+ else
543
+ jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
544
+
545
+ if ( elem.parentNode )
546
+ elem.parentNode.removeChild( elem );
547
+ }
548
+
549
+ function now(){
550
+ return +new Date;
551
+ }
552
+
553
+ jQuery.extend = jQuery.fn.extend = function() {
554
+ // copy reference to target object
555
+ var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
556
+
557
+ // Handle a deep copy situation
558
+ if ( target.constructor == Boolean ) {
559
+ deep = target;
560
+ target = arguments[1] || {};
561
+ // skip the boolean and the target
562
+ i = 2;
563
+ }
564
+
565
+ // Handle case when target is a string or something (possible in deep copy)
566
+ if ( typeof target != "object" && typeof target != "function" )
567
+ target = {};
568
+
569
+ // extend jQuery itself if only one argument is passed
570
+ if ( length == i ) {
571
+ target = this;
572
+ --i;
573
+ }
574
+
575
+ for ( ; i < length; i++ )
576
+ // Only deal with non-null/undefined values
577
+ if ( (options = arguments[ i ]) != null )
578
+ // Extend the base object
579
+ for ( var name in options ) {
580
+ var src = target[ name ], copy = options[ name ];
581
+
582
+ // Prevent never-ending loop
583
+ if ( target === copy )
584
+ continue;
585
+
586
+ // Recurse if we're merging object values
587
+ if ( deep && copy && typeof copy == "object" && !copy.nodeType )
588
+ target[ name ] = jQuery.extend( deep,
589
+ // Never move original objects, clone them
590
+ src || ( copy.length != null ? [ ] : { } )
591
+ , copy );
592
+
593
+ // Don't bring in undefined values
594
+ else if ( copy !== undefined )
595
+ target[ name ] = copy;
596
+
597
+ }
598
+
599
+ // Return the modified object
600
+ return target;
601
+ };
602
+
603
+ var expando = "jQuery" + now(), uuid = 0, windowData = {},
604
+ // exclude the following css properties to add px
605
+ exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
606
+ // cache defaultView
607
+ defaultView = document.defaultView || {};
608
+
609
+ jQuery.extend({
610
+ noConflict: function( deep ) {
611
+ window.$ = _$;
612
+
613
+ if ( deep )
614
+ window.jQuery = _jQuery;
615
+
616
+ return jQuery;
617
+ },
618
+
619
+ // See test/unit/core.js for details concerning this function.
620
+ // Since 1.3 DOM methods and function like alert
621
+ // aren't supported. They return false on IE (#2968).
622
+ isFunction: function( fn ) {
623
+ return fn instanceof Function;
624
+ },
625
+
626
+ // check if an element is in a (or is an) XML document
627
+ isXMLDoc: function( elem ) {
628
+ return elem.documentElement && !elem.body ||
629
+ elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
630
+ },
631
+
632
+ // Evalulates a script in a global context
633
+ globalEval: function( data ) {
634
+ data = jQuery.trim( data );
635
+
636
+ if ( data ) {
637
+ // Inspired by code by Andrea Giammarchi
638
+ // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
639
+ var head = document.getElementsByTagName("head")[0] || document.documentElement,
640
+ script = document.createElement("script");
641
+
642
+ script.type = "text/javascript";
643
+ if ( jQuery.browser.msie )
644
+ script.text = data;
645
+ else
646
+ script.appendChild( document.createTextNode( data ) );
647
+
648
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
649
+ // This arises when a base node is used (#2709).
650
+ head.insertBefore( script, head.firstChild );
651
+ head.removeChild( script );
652
+ }
653
+ },
654
+
655
+ nodeName: function( elem, name ) {
656
+ return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
657
+ },
658
+
659
+ cache: {},
660
+
661
+ data: function( elem, name, data ) {
662
+ elem = elem == window ?
663
+ windowData :
664
+ elem;
665
+
666
+ var id = elem[ expando ];
667
+
668
+ // Compute a unique ID for the element
669
+ if ( !id )
670
+ id = elem[ expando ] = ++uuid;
671
+
672
+ // Only generate the data cache if we're
673
+ // trying to access or manipulate it
674
+ if ( name && !jQuery.cache[ id ] )
675
+ jQuery.cache[ id ] = {};
676
+
677
+ // Prevent overriding the named cache with undefined values
678
+ if ( data !== undefined )
679
+ jQuery.cache[ id ][ name ] = data;
680
+
681
+ // Return the named cache data, or the ID for the element
682
+ return name ?
683
+ jQuery.cache[ id ][ name ] :
684
+ id;
685
+ },
686
+
687
+ removeData: function( elem, name ) {
688
+ elem = elem == window ?
689
+ windowData :
690
+ elem;
691
+
692
+ var id = elem[ expando ];
693
+
694
+ // If we want to remove a specific section of the element's data
695
+ if ( name ) {
696
+ if ( jQuery.cache[ id ] ) {
697
+ // Remove the section of cache data
698
+ delete jQuery.cache[ id ][ name ];
699
+
700
+ // If we've removed all the data, remove the element's cache
701
+ name = "";
702
+
703
+ for ( name in jQuery.cache[ id ] )
704
+ break;
705
+
706
+ if ( !name )
707
+ jQuery.removeData( elem );
708
+ }
709
+
710
+ // Otherwise, we want to remove all of the element's data
711
+ } else {
712
+ // Clean up the element expando
713
+ try {
714
+ delete elem[ expando ];
715
+ } catch(e){
716
+ // IE has trouble directly removing the expando
717
+ // but it's ok with using removeAttribute
718
+ if ( elem.removeAttribute )
719
+ elem.removeAttribute( expando );
720
+ }
721
+
722
+ // Completely remove the data cache
723
+ delete jQuery.cache[ id ];
724
+ }
725
+ },
726
+
727
+ // args is for internal usage only
728
+ each: function( object, callback, args ) {
729
+ var name, i = 0, length = object.length;
730
+
731
+ if ( args ) {
732
+ if ( length == undefined ) {
733
+ for ( name in object )
734
+ if ( callback.apply( object[ name ], args ) === false )
735
+ break;
736
+ } else
737
+ for ( ; i < length; )
738
+ if ( callback.apply( object[ i++ ], args ) === false )
739
+ break;
740
+
741
+ // A special, fast, case for the most common use of each
742
+ } else {
743
+ if ( length == undefined ) {
744
+ for ( name in object )
745
+ if ( callback.call( object[ name ], name, object[ name ] ) === false )
746
+ break;
747
+ } else
748
+ for ( var value = object[0];
749
+ i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
750
+ }
751
+
752
+ return object;
753
+ },
754
+
755
+ prop: function( elem, value, type, i, name ) {
756
+ // Handle executable functions
757
+ if ( jQuery.isFunction( value ) )
758
+ value = value.call( elem, i );
759
+
760
+ // Handle passing in a number to a CSS property
761
+ return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ?
762
+ value + "px" :
763
+ value;
764
+ },
765
+
766
+ className: {
767
+ // internal only, use addClass("class")
768
+ add: function( elem, classNames ) {
769
+ jQuery.each((classNames || "").split(/\s+/), function(i, className){
770
+ if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
771
+ elem.className += (elem.className ? " " : "") + className;
772
+ });
773
+ },
774
+
775
+ // internal only, use removeClass("class")
776
+ remove: function( elem, classNames ) {
777
+ if (elem.nodeType == 1)
778
+ elem.className = classNames != undefined ?
779
+ jQuery.grep(elem.className.split(/\s+/), function(className){
780
+ return !jQuery.className.has( classNames, className );
781
+ }).join(" ") :
782
+ "";
783
+ },
784
+
785
+ // internal only, use hasClass("class")
786
+ has: function( elem, className ) {
787
+ return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
788
+ }
789
+ },
790
+
791
+ // A method for quickly swapping in/out CSS properties to get correct calculations
792
+ swap: function( elem, options, callback ) {
793
+ var old = {};
794
+ // Remember the old values, and insert the new ones
795
+ for ( var name in options ) {
796
+ old[ name ] = elem.style[ name ];
797
+ elem.style[ name ] = options[ name ];
798
+ }
799
+
800
+ callback.call( elem );
801
+
802
+ // Revert the old values
803
+ for ( var name in options )
804
+ elem.style[ name ] = old[ name ];
805
+ },
806
+
807
+ css: function( elem, name, force ) {
808
+ if ( name == "width" || name == "height" ) {
809
+ var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
810
+
811
+ function getWH() {
812
+ val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
813
+ var padding = 0, border = 0;
814
+ jQuery.each( which, function() {
815
+ padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
816
+ border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
817
+ });
818
+ val -= Math.round(padding + border);
819
+ }
820
+
821
+ if ( jQuery(elem).is(":visible") )
822
+ getWH();
823
+ else
824
+ jQuery.swap( elem, props, getWH );
825
+
826
+ return Math.max(0, val);
827
+ }
828
+
829
+ return jQuery.curCSS( elem, name, force );
830
+ },
831
+
832
+ curCSS: function( elem, name, force ) {
833
+ var ret, style = elem.style;
834
+
835
+ // A helper method for determining if an element's values are broken
836
+ function color( elem ) {
837
+ if ( !jQuery.browser.safari )
838
+ return false;
839
+
840
+ // defaultView is cached
841
+ var ret = defaultView.getComputedStyle( elem, null );
842
+ return !ret || ret.getPropertyValue("color") == "";
843
+ }
844
+
845
+ // We need to handle opacity special in IE
846
+ if ( name == "opacity" && jQuery.browser.msie ) {
847
+ ret = jQuery.attr( style, "opacity" );
848
+
849
+ return ret == "" ?
850
+ "1" :
851
+ ret;
852
+ }
853
+ // Opera sometimes will give the wrong display answer, this fixes it, see #2037
854
+ if ( jQuery.browser.opera && name == "display" ) {
855
+ var save = style.outline;
856
+ style.outline = "0 solid black";
857
+ style.outline = save;
858
+ }
859
+
860
+ // Make sure we're using the right name for getting the float value
861
+ if ( name.match( /float/i ) )
862
+ name = styleFloat;
863
+
864
+ if ( !force && style && style[ name ] )
865
+ ret = style[ name ];
866
+
867
+ else if ( defaultView.getComputedStyle ) {
868
+
869
+ // Only "float" is needed here
870
+ if ( name.match( /float/i ) )
871
+ name = "float";
872
+
873
+ name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
874
+
875
+ var computedStyle = defaultView.getComputedStyle( elem, null );
876
+
877
+ if ( computedStyle && !color( elem ) )
878
+ ret = computedStyle.getPropertyValue( name );
879
+
880
+ // If the element isn't reporting its values properly in Safari
881
+ // then some display: none elements are involved
882
+ else {
883
+ var swap = [], stack = [], a = elem, i = 0;
884
+
885
+ // Locate all of the parent display: none elements
886
+ for ( ; a && color(a); a = a.parentNode )
887
+ stack.unshift(a);
888
+
889
+ // Go through and make them visible, but in reverse
890
+ // (It would be better if we knew the exact display type that they had)
891
+ for ( ; i < stack.length; i++ )
892
+ if ( color( stack[ i ] ) ) {
893
+ swap[ i ] = stack[ i ].style.display;
894
+ stack[ i ].style.display = "block";
895
+ }
896
+
897
+ // Since we flip the display style, we have to handle that
898
+ // one special, otherwise get the value
899
+ ret = name == "display" && swap[ stack.length - 1 ] != null ?
900
+ "none" :
901
+ ( computedStyle && computedStyle.getPropertyValue( name ) ) || "";
902
+
903
+ // Finally, revert the display styles back
904
+ for ( i = 0; i < swap.length; i++ )
905
+ if ( swap[ i ] != null )
906
+ stack[ i ].style.display = swap[ i ];
907
+ }
908
+
909
+ // We should always get a number back from opacity
910
+ if ( name == "opacity" && ret == "" )
911
+ ret = "1";
912
+
913
+ } else if ( elem.currentStyle ) {
914
+ var camelCase = name.replace(/\-(\w)/g, function(all, letter){
915
+ return letter.toUpperCase();
916
+ });
917
+
918
+ ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
919
+
920
+ // From the awesome hack by Dean Edwards
921
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
922
+
923
+ // If we're not dealing with a regular pixel number
924
+ // but a number that has a weird ending, we need to convert it to pixels
925
+ if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
926
+ // Remember the original values
927
+ var left = style.left, rsLeft = elem.runtimeStyle.left;
928
+
929
+ // Put in the new values to get a computed value out
930
+ elem.runtimeStyle.left = elem.currentStyle.left;
931
+ style.left = ret || 0;
932
+ ret = style.pixelLeft + "px";
933
+
934
+ // Revert the changed values
935
+ style.left = left;
936
+ elem.runtimeStyle.left = rsLeft;
937
+ }
938
+ }
939
+
940
+ return ret;
941
+ },
942
+
943
+ clean: function( elems, context ) {
944
+ var ret = [];
945
+ context = context || document;
946
+ // !context.createElement fails in IE with an error but returns typeof 'object'
947
+ if (typeof context.createElement == 'undefined')
948
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
949
+
950
+ jQuery.each(elems, function(i, elem){
951
+ if ( typeof elem == 'number' )
952
+ elem += '';
953
+
954
+ if ( !elem )
955
+ return;
956
+
957
+ // Convert html string into DOM nodes
958
+ if ( typeof elem == "string" ) {
959
+ // Fix "XHTML"-style tags in all browsers
960
+ elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
961
+ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
962
+ all :
963
+ front + "></" + tag + ">";
964
+ });
965
+
966
+ // Trim whitespace, otherwise indexOf won't work as expected
967
+ var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div");
968
+
969
+ var wrap =
970
+ // option or optgroup
971
+ !tags.indexOf("<opt") &&
972
+ [ 1, "<select multiple='multiple'>", "</select>" ] ||
973
+
974
+ !tags.indexOf("<leg") &&
975
+ [ 1, "<fieldset>", "</fieldset>" ] ||
976
+
977
+ tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
978
+ [ 1, "<table>", "</table>" ] ||
979
+
980
+ !tags.indexOf("<tr") &&
981
+ [ 2, "<table><tbody>", "</tbody></table>" ] ||
982
+
983
+ // <thead> matched above
984
+ (!tags.indexOf("<td") || !tags.indexOf("<th")) &&
985
+ [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||
986
+
987
+ !tags.indexOf("<col") &&
988
+ [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
989
+
990
+ // IE can't serialize <link> and <script> tags normally
991
+ jQuery.browser.msie &&
992
+ [ 1, "div<div>", "</div>" ] ||
993
+
994
+ [ 0, "", "" ];
995
+
996
+ // Go to html and back, then peel off extra wrappers
997
+ div.innerHTML = wrap[1] + elem + wrap[2];
998
+
999
+ // Move to the right depth
1000
+ while ( wrap[0]-- )
1001
+ div = div.lastChild;
1002
+
1003
+ // Remove IE's autoinserted <tbody> from table fragments
1004
+ if ( jQuery.browser.msie ) {
1005
+
1006
+ // String was a <table>, *may* have spurious <tbody>
1007
+ var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?
1008
+ div.firstChild && div.firstChild.childNodes :
1009
+
1010
+ // String was a bare <thead> or <tfoot>
1011
+ wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ?
1012
+ div.childNodes :
1013
+ [];
1014
+
1015
+ for ( var j = tbody.length - 1; j >= 0 ; --j )
1016
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
1017
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
1018
+
1019
+ // IE completely kills leading whitespace when innerHTML is used
1020
+ if ( /^\s/.test( elem ) )
1021
+ div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
1022
+
1023
+ }
1024
+
1025
+ elem = jQuery.makeArray( div.childNodes );
1026
+ }
1027
+
1028
+ if ( elem.length === 0 && (!jQuery.nodeName( elem, "form" ) && !jQuery.nodeName( elem, "select" )) )
1029
+ return;
1030
+
1031
+ if ( elem[0] == undefined || jQuery.nodeName( elem, "form" ) || elem.options )
1032
+ ret.push( elem );
1033
+
1034
+ else
1035
+ ret = jQuery.merge( ret, elem );
1036
+
1037
+ });
1038
+
1039
+ return ret;
1040
+ },
1041
+
1042
+ attr: function( elem, name, value ) {
1043
+ // don't set attributes on text and comment nodes
1044
+ if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
1045
+ return undefined;
1046
+
1047
+ var notxml = !jQuery.isXMLDoc( elem ),
1048
+ // Whether we are setting (or getting)
1049
+ set = value !== undefined,
1050
+ msie = jQuery.browser.msie;
1051
+
1052
+ // Try to normalize/fix the name
1053
+ name = notxml && jQuery.props[ name ] || name;
1054
+
1055
+ // Only do all the following if this is a node (faster for style)
1056
+ // IE elem.getAttribute passes even for style
1057
+ if ( elem.tagName ) {
1058
+
1059
+ // These attributes require special treatment
1060
+ var special = /href|src|style/.test( name );
1061
+
1062
+ // Safari mis-reports the default selected property of a hidden option
1063
+ // Accessing the parent's selectedIndex property fixes it
1064
+ if ( name == "selected" && jQuery.browser.safari )
1065
+ elem.parentNode.selectedIndex;
1066
+
1067
+ // If applicable, access the attribute via the DOM 0 way
1068
+ if ( name in elem && notxml && !special ) {
1069
+ if ( set ){
1070
+ // We can't allow the type property to be changed (since it causes problems in IE)
1071
+ if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
1072
+ throw "type property can't be changed";
1073
+
1074
+ elem[ name ] = value;
1075
+ }
1076
+
1077
+ // browsers index elements by id/name on forms, give priority to attributes.
1078
+ if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
1079
+ return elem.getAttributeNode( name ).nodeValue;
1080
+
1081
+ return elem[ name ];
1082
+ }
1083
+
1084
+ if ( msie && notxml && name == "style" )
1085
+ return jQuery.attr( elem.style, "cssText", value );
1086
+
1087
+ if ( set )
1088
+ // convert the value to a string (all browsers do this but IE) see #1070
1089
+ elem.setAttribute( name, "" + value );
1090
+
1091
+ var attr = msie && notxml && special
1092
+ // Some attributes require a special call on IE
1093
+ ? elem.getAttribute( name, 2 )
1094
+ : elem.getAttribute( name );
1095
+
1096
+ // Non-existent attributes return null, we normalize to undefined
1097
+ return attr === null ? undefined : attr;
1098
+ }
1099
+
1100
+ // elem is actually elem.style ... set the style
1101
+
1102
+ // IE uses filters for opacity
1103
+ if ( msie && name == "opacity" ) {
1104
+ if ( set ) {
1105
+ // IE has trouble with opacity if it does not have layout
1106
+ // Force it by setting the zoom level
1107
+ elem.zoom = 1;
1108
+
1109
+ // Set the alpha filter to set the opacity
1110
+ elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
1111
+ (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
1112
+ }
1113
+
1114
+ return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
1115
+ (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
1116
+ "";
1117
+ }
1118
+
1119
+ name = name.replace(/-([a-z])/ig, function(all, letter){
1120
+ return letter.toUpperCase();
1121
+ });
1122
+
1123
+ if ( set )
1124
+ elem[ name ] = value;
1125
+
1126
+ return elem[ name ];
1127
+ },
1128
+
1129
+ trim: function( text ) {
1130
+ return (text || "").replace( /^\s+|\s+$/g, "" );
1131
+ },
1132
+
1133
+ makeArray: function( array ) {
1134
+ var ret = [];
1135
+
1136
+ if( array != null ){
1137
+ var i = array.length;
1138
+ //the window, strings and functions also have 'length'
1139
+ if( i == null || array.split || array.setInterval || array.call )
1140
+ ret[0] = array;
1141
+ else
1142
+ while( i )
1143
+ ret[--i] = array[i];
1144
+ }
1145
+
1146
+ return ret;
1147
+ },
1148
+
1149
+ inArray: function( elem, array ) {
1150
+ for ( var i = 0, length = array.length; i < length; i++ )
1151
+ // Use === because on IE, window == document
1152
+ if ( array[ i ] === elem )
1153
+ return i;
1154
+
1155
+ return -1;
1156
+ },
1157
+
1158
+ merge: function( first, second ) {
1159
+ // We have to loop this way because IE & Opera overwrite the length
1160
+ // expando of getElementsByTagName
1161
+ var i = 0, elem, pos = first.length;
1162
+ // Also, we need to make sure that the correct elements are being returned
1163
+ // (IE returns comment nodes in a '*' query)
1164
+ if ( jQuery.browser.msie ) {
1165
+ while ( elem = second[ i++ ] )
1166
+ if ( elem.nodeType != 8 )
1167
+ first[ pos++ ] = elem;
1168
+
1169
+ } else
1170
+ while ( elem = second[ i++ ] )
1171
+ first[ pos++ ] = elem;
1172
+
1173
+ return first;
1174
+ },
1175
+
1176
+ unique: function( array ) {
1177
+ var ret = [], done = {};
1178
+
1179
+ try {
1180
+
1181
+ for ( var i = 0, length = array.length; i < length; i++ ) {
1182
+ var id = jQuery.data( array[ i ] );
1183
+
1184
+ if ( !done[ id ] ) {
1185
+ done[ id ] = true;
1186
+ ret.push( array[ i ] );
1187
+ }
1188
+ }
1189
+
1190
+ } catch( e ) {
1191
+ ret = array;
1192
+ }
1193
+
1194
+ return ret;
1195
+ },
1196
+
1197
+ grep: function( elems, callback, inv ) {
1198
+ var ret = [];
1199
+
1200
+ // Go through the array, only saving the items
1201
+ // that pass the validator function
1202
+ for ( var i = 0, length = elems.length; i < length; i++ )
1203
+ if ( !inv != !callback( elems[ i ], i ) )
1204
+ ret.push( elems[ i ] );
1205
+
1206
+ return ret;
1207
+ },
1208
+
1209
+ map: function( elems, callback ) {
1210
+ var ret = [];
1211
+
1212
+ // Go through the array, translating each of the items to their
1213
+ // new value (or values).
1214
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
1215
+ var value = callback( elems[ i ], i );
1216
+
1217
+ if ( value != null )
1218
+ ret[ ret.length ] = value;
1219
+ }
1220
+
1221
+ return ret.concat.apply( [], ret );
1222
+ }
1223
+ });
1224
+
1225
+ var userAgent = navigator.userAgent.toLowerCase();
1226
+
1227
+ // Figure out what browser is being used
1228
+ jQuery.browser = {
1229
+ version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
1230
+ safari: /webkit/.test( userAgent ),
1231
+ opera: /opera/.test( userAgent ),
1232
+ msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
1233
+ mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
1234
+ };
1235
+
1236
+ var styleFloat = jQuery.browser.msie ?
1237
+ "styleFloat" :
1238
+ "cssFloat";
1239
+
1240
+ jQuery.extend({
1241
+ // Check to see if the W3C box model is being used
1242
+ boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",
1243
+
1244
+ props: {
1245
+ "for": "htmlFor",
1246
+ "class": "className",
1247
+ "float": styleFloat,
1248
+ cssFloat: styleFloat,
1249
+ styleFloat: styleFloat,
1250
+ readonly: "readOnly",
1251
+ maxlength: "maxLength",
1252
+ cellspacing: "cellSpacing",
1253
+ rowspan: "rowSpan"
1254
+ }
1255
+ });
1256
+
1257
+ jQuery.each({
1258
+ parent: function(elem){return elem.parentNode;},
1259
+ parents: function(elem){return jQuery.dir(elem,"parentNode");},
1260
+ next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
1261
+ prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
1262
+ nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
1263
+ prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
1264
+ siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
1265
+ children: function(elem){return jQuery.sibling(elem.firstChild);},
1266
+ contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
1267
+ }, function(name, fn){
1268
+ jQuery.fn[ name ] = function( selector ) {
1269
+ var ret = jQuery.map( this, fn );
1270
+
1271
+ if ( selector && typeof selector == "string" )
1272
+ ret = jQuery.multiFilter( selector, ret );
1273
+
1274
+ return this.pushStack( jQuery.unique( ret ) );
1275
+ };
1276
+ });
1277
+
1278
+ jQuery.each({
1279
+ appendTo: "append",
1280
+ prependTo: "prepend",
1281
+ insertBefore: "before",
1282
+ insertAfter: "after",
1283
+ replaceAll: "replaceWith"
1284
+ }, function(name, original){
1285
+ jQuery.fn[ name ] = function() {
1286
+ var args = arguments;
1287
+
1288
+ return this.each(function(){
1289
+ for ( var i = 0, length = args.length; i < length; i++ )
1290
+ jQuery( args[ i ] )[ original ]( this );
1291
+ });
1292
+ };
1293
+ });
1294
+
1295
+ jQuery.each({
1296
+ removeAttr: function( name ) {
1297
+ jQuery.attr( this, name, "" );
1298
+ if (this.nodeType == 1)
1299
+ this.removeAttribute( name );
1300
+ },
1301
+
1302
+ addClass: function( classNames ) {
1303
+ jQuery.className.add( this, classNames );
1304
+ },
1305
+
1306
+ removeClass: function( classNames ) {
1307
+ jQuery.className.remove( this, classNames );
1308
+ },
1309
+
1310
+ toggleClass: function( classNames ) {
1311
+ jQuery.className[ jQuery.className.has( this, classNames ) ? "remove" : "add" ]( this, classNames );
1312
+ },
1313
+
1314
+ remove: function( selector ) {
1315
+ if ( !selector || jQuery.filter( selector, [ this ] ).r.length ) {
1316
+ // Prevent memory leaks
1317
+ jQuery( "*", this ).add([this]).each(function(){
1318
+ jQuery.event.remove(this);
1319
+ jQuery.removeData(this);
1320
+ });
1321
+ if (this.parentNode)
1322
+ this.parentNode.removeChild( this );
1323
+ }
1324
+ },
1325
+
1326
+ empty: function() {
1327
+ // Remove element nodes and prevent memory leaks
1328
+ jQuery( ">*", this ).remove();
1329
+
1330
+ // Remove any remaining nodes
1331
+ while ( this.firstChild )
1332
+ this.removeChild( this.firstChild );
1333
+ }
1334
+ }, function(name, fn){
1335
+ jQuery.fn[ name ] = function(){
1336
+ return this.each( fn, arguments );
1337
+ };
1338
+ });
1339
+
1340
+ jQuery.each([ "Height", "Width" ], function(i, name){
1341
+ var type = name.toLowerCase();
1342
+
1343
+ jQuery.fn[ type ] = function( size ) {
1344
+ // Get window width or height
1345
+ return this[0] == window ?
1346
+ // Opera reports document.body.client[Width/Height] properly in both quirks and standards
1347
+ jQuery.browser.opera && document.body[ "client" + name ] ||
1348
+
1349
+ // Safari reports inner[Width/Height] just fine (Mozilla and Opera include scroll bar widths)
1350
+ jQuery.browser.safari && window[ "inner" + name ] ||
1351
+
1352
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
1353
+ document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ] :
1354
+
1355
+ // Get document width or height
1356
+ this[0] == document ?
1357
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
1358
+ Math.max(
1359
+ Math.max(document.body["scroll" + name], document.documentElement["scroll" + name]),
1360
+ Math.max(document.body["offset" + name], document.documentElement["offset" + name])
1361
+ ) :
1362
+
1363
+ // Get or set width or height on the element
1364
+ size == undefined ?
1365
+ // Get width or height on the element
1366
+ (this.length ? jQuery.css( this[0], type ) : null) :
1367
+
1368
+ // Set the width or height on the element (default to pixels if value is unitless)
1369
+ this.css( type, size.constructor == String ? size : size + "px" );
1370
+ };
1371
+ });
1372
+
1373
+ // Helper function used by the dimensions and offset modules
1374
+ function num(elem, prop) {
1375
+ return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
1376
+ }
1377
+ var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
1378
+ "(?:[\\w*_-]|\\\\.)" :
1379
+ "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
1380
+ quickChild = new RegExp("^>\\s*(" + chars + "+)"),
1381
+ quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
1382
+ quickClass = new RegExp("^([#.]?)(" + chars + "*)");
1383
+
1384
+ jQuery.extend({
1385
+ expr: {
1386
+ "": function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},
1387
+ "#": function(a,i,m){return a.getAttribute("id")==m[2];},
1388
+ ":": {
1389
+ // Position Checks
1390
+ lt: function(a,i,m){return i<m[3]-0;},
1391
+ gt: function(a,i,m){return i>m[3]-0;},
1392
+ nth: function(a,i,m){return m[3]-0==i;},
1393
+ eq: function(a,i,m){return m[3]-0==i;},
1394
+ first: function(a,i){return i==0;},
1395
+ last: function(a,i,m,r){return i==r.length-1;},
1396
+ even: function(a,i){return i%2==0;},
1397
+ odd: function(a,i){return i%2;},
1398
+
1399
+ // Child Checks
1400
+ "first-child": function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},
1401
+ "last-child": function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},
1402
+ "only-child": function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},
1403
+
1404
+ // Parent Checks
1405
+ parent: function(a){return a.firstChild;},
1406
+ empty: function(a){return !a.firstChild;},
1407
+
1408
+ // Text Check
1409
+ contains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},
1410
+
1411
+ // Visibility
1412
+ visible: function(a){return "hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},
1413
+ hidden: function(a){return "hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},
1414
+
1415
+ // Form attributes
1416
+ enabled: function(a){return !a.disabled;},
1417
+ disabled: function(a){return a.disabled;},
1418
+ checked: function(a){return a.checked;},
1419
+ selected: function(a){return a.selected||jQuery.attr(a,"selected");},
1420
+
1421
+ // Form elements
1422
+ text: function(a){return "text"==a.type;},
1423
+ radio: function(a){return "radio"==a.type;},
1424
+ checkbox: function(a){return "checkbox"==a.type;},
1425
+ file: function(a){return "file"==a.type;},
1426
+ password: function(a){return "password"==a.type;},
1427
+ submit: function(a){return "submit"==a.type;},
1428
+ image: function(a){return "image"==a.type;},
1429
+ reset: function(a){return "reset"==a.type;},
1430
+ button: function(a){return "button"==a.type||jQuery.nodeName(a,"button");},
1431
+ input: function(a){return /input|select|textarea|button/i.test(a.nodeName);},
1432
+
1433
+ // :has()
1434
+ has: function(a,i,m){return jQuery.find(m[3],a).length;},
1435
+
1436
+ // :header
1437
+ header: function(a){return /h\d/i.test(a.nodeName);},
1438
+
1439
+ // :animated
1440
+ animated: function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}
1441
+ }
1442
+ },
1443
+
1444
+ // The regular expressions that power the parsing engine
1445
+ parse: [
1446
+ // Match: [@value='test'], [@foo]
1447
+ /^(\[) *@?([\w:-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
1448
+
1449
+ // Match: :contains('foo')
1450
+ /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
1451
+
1452
+ // Match: :even, :last-child, #id, .class
1453
+ new RegExp("^([:.#]*)(" + chars + "+)")
1454
+ ],
1455
+
1456
+ multiFilter: function( expr, elems, not ) {
1457
+ var old, cur = [];
1458
+
1459
+ while ( expr && expr != old ) {
1460
+ old = expr;
1461
+ var f = jQuery.filter( expr, elems, not );
1462
+ expr = f.t.replace(/^\s*,\s*/, "" );
1463
+ cur = not ? elems = f.r : jQuery.merge( cur, f.r );
1464
+ }
1465
+
1466
+ return cur;
1467
+ },
1468
+
1469
+ find: function( t, context ) {
1470
+ // Quickly handle non-string expressions
1471
+ if ( typeof t != "string" )
1472
+ return [ t ];
1473
+
1474
+ // check to make sure context is a DOM element or a document
1475
+ if ( context && context.nodeType != 1 && context.nodeType != 9)
1476
+ return [ ];
1477
+
1478
+ // Set the correct context (if none is provided)
1479
+ context = context || document;
1480
+
1481
+ // Initialize the search
1482
+ var ret = [context], done = [], last, nodeName;
1483
+
1484
+ // Continue while a selector expression exists, and while
1485
+ // we're no longer looping upon ourselves
1486
+ while ( t && last != t ) {
1487
+ var r = [];
1488
+ last = t;
1489
+
1490
+ t = jQuery.trim(t);
1491
+
1492
+ var foundToken = false,
1493
+
1494
+ // An attempt at speeding up child selectors that
1495
+ // point to a specific element tag
1496
+ re = quickChild,
1497
+
1498
+ m = re.exec(t);
1499
+
1500
+ if ( m ) {
1501
+ nodeName = m[1].toUpperCase();
1502
+
1503
+ // Perform our own iteration and filter
1504
+ for ( var i = 0; ret[i]; i++ )
1505
+ for ( var c = ret[i].firstChild; c; c = c.nextSibling )
1506
+ if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName) )
1507
+ r.push( c );
1508
+
1509
+ ret = r;
1510
+ t = t.replace( re, "" );
1511
+ if ( t.indexOf(" ") == 0 ) continue;
1512
+ foundToken = true;
1513
+ } else {
1514
+ re = /^([>+~])\s*(\w*)/i;
1515
+
1516
+ if ( (m = re.exec(t)) != null ) {
1517
+ r = [];
1518
+
1519
+ var merge = {};
1520
+ nodeName = m[2].toUpperCase();
1521
+ m = m[1];
1522
+
1523
+ for ( var j = 0, rl = ret.length; j < rl; j++ ) {
1524
+ var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
1525
+ for ( ; n; n = n.nextSibling )
1526
+ if ( n.nodeType == 1 ) {
1527
+ var id = jQuery.data(n);
1528
+
1529
+ if ( m == "~" && merge[id] ) break;
1530
+
1531
+ if (!nodeName || n.nodeName.toUpperCase() == nodeName ) {
1532
+ if ( m == "~" ) merge[id] = true;
1533
+ r.push( n );
1534
+ }
1535
+
1536
+ if ( m == "+" ) break;
1537
+ }
1538
+ }
1539
+
1540
+ ret = r;
1541
+
1542
+ // And remove the token
1543
+ t = jQuery.trim( t.replace( re, "" ) );
1544
+ foundToken = true;
1545
+ }
1546
+ }
1547
+
1548
+ // See if there's still an expression, and that we haven't already
1549
+ // matched a token
1550
+ if ( t && !foundToken ) {
1551
+ // Handle multiple expressions
1552
+ if ( !t.indexOf(",") ) {
1553
+ // Clean the result set
1554
+ if ( context == ret[0] ) ret.shift();
1555
+
1556
+ // Merge the result sets
1557
+ done = jQuery.merge( done, ret );
1558
+
1559
+ // Reset the context
1560
+ r = ret = [context];
1561
+
1562
+ // Touch up the selector string
1563
+ t = " " + t.substr(1,t.length);
1564
+
1565
+ } else {
1566
+ // Optimize for the case nodeName#idName
1567
+ var re2 = quickID;
1568
+ var m = re2.exec(t);
1569
+
1570
+ // Re-organize the results, so that they're consistent
1571
+ if ( m ) {
1572
+ m = [ 0, m[2], m[3], m[1] ];
1573
+
1574
+ } else {
1575
+ // Otherwise, do a traditional filter check for
1576
+ // ID, class, and element selectors
1577
+ re2 = quickClass;
1578
+ m = re2.exec(t);
1579
+ }
1580
+
1581
+ m[2] = m[2].replace(/\\/g, "");
1582
+
1583
+ var elem = ret[ret.length-1];
1584
+
1585
+ // Try to do a global search by ID, where we can
1586
+ if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
1587
+ // Optimization for HTML document case
1588
+ var oid = elem.getElementById(m[2]);
1589
+
1590
+ // Do a quick check for the existence of the actual ID attribute
1591
+ // to avoid selecting by the name attribute in IE
1592
+ // also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
1593
+ if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
1594
+ oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
1595
+
1596
+ // Do a quick check for node name (where applicable) so
1597
+ // that div#foo searches will be really fast
1598
+ ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
1599
+ } else {
1600
+ // We need to find all descendant elements
1601
+ for ( var i = 0; ret[i]; i++ ) {
1602
+ // Grab the tag name being searched for
1603
+ var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
1604
+
1605
+ // Handle IE7 being really dumb about <object>s
1606
+ if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
1607
+ tag = "param";
1608
+
1609
+ r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
1610
+ }
1611
+
1612
+ // It's faster to filter by class and be done with it
1613
+ if ( m[1] == "." )
1614
+ r = jQuery.classFilter( r, m[2] );
1615
+
1616
+ // Same with ID filtering
1617
+ if ( m[1] == "#" ) {
1618
+ var tmp = [];
1619
+
1620
+ // Try to find the element with the ID
1621
+ for ( var i = 0; r[i]; i++ )
1622
+ if ( r[i].getAttribute("id") == m[2] ) {
1623
+ tmp = [ r[i] ];
1624
+ break;
1625
+ }
1626
+
1627
+ r = tmp;
1628
+ }
1629
+
1630
+ ret = r;
1631
+ }
1632
+
1633
+ t = t.replace( re2, "" );
1634
+ }
1635
+
1636
+ }
1637
+
1638
+ // If a selector string still exists
1639
+ if ( t ) {
1640
+ // Attempt to filter it
1641
+ var val = jQuery.filter(t,r);
1642
+ ret = r = val.r;
1643
+ t = jQuery.trim(val.t);
1644
+ }
1645
+ }
1646
+
1647
+ // An error occurred with the selector;
1648
+ // just return an empty set instead
1649
+ if ( t )
1650
+ ret = [];
1651
+
1652
+ // Remove the root context
1653
+ if ( ret && context == ret[0] )
1654
+ ret.shift();
1655
+
1656
+ // And combine the results
1657
+ done = jQuery.merge( done, ret );
1658
+
1659
+ return done;
1660
+ },
1661
+
1662
+ classFilter: function(r,m,not){
1663
+ m = " " + m + " ";
1664
+ var tmp = [];
1665
+ for ( var i = 0; r[i]; i++ ) {
1666
+ var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
1667
+ if ( !not && pass || not && !pass )
1668
+ tmp.push( r[i] );
1669
+ }
1670
+ return tmp;
1671
+ },
1672
+
1673
+ filter: function(t,r,not) {
1674
+ var last;
1675
+
1676
+ // Look for common filter expressions
1677
+ while ( t && t != last ) {
1678
+ last = t;
1679
+
1680
+ var p = jQuery.parse, m;
1681
+
1682
+ for ( var i = 0; p[i]; i++ ) {
1683
+ m = p[i].exec( t );
1684
+
1685
+ if ( m ) {
1686
+ // Remove what we just matched
1687
+ t = t.substring( m[0].length );
1688
+
1689
+ m[2] = m[2].replace(/\\/g, "");
1690
+ break;
1691
+ }
1692
+ }
1693
+
1694
+ if ( !m )
1695
+ break;
1696
+
1697
+ // :not() is a special case that can be optimized by
1698
+ // keeping it out of the expression list
1699
+ if ( m[1] == ":" && m[2] == "not" )
1700
+ // optimize if only one selector found (most common case)
1701
+ r = isSimple.test( m[3] ) ?
1702
+ jQuery.filter(m[3], r, true).r :
1703
+ jQuery( r ).not( m[3] );
1704
+
1705
+ // We can get a big speed boost by filtering by class here
1706
+ else if ( m[1] == "." )
1707
+ r = jQuery.classFilter(r, m[2], not);
1708
+
1709
+ else if ( m[1] == "[" ) {
1710
+ var tmp = [], type = m[3];
1711
+
1712
+ for ( var i = 0, rl = r.length; i < rl; i++ ) {
1713
+ var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
1714
+
1715
+ if ( z == null || /style|href|src|selected/.test(m[2]) )
1716
+ z = jQuery.attr(a,m[2]) || '';
1717
+
1718
+ if ( (type == "" && !!z ||
1719
+ type == "=" && z == m[5] ||
1720
+ type == "!=" && z != m[5] ||
1721
+ type == "^=" && z && !z.indexOf(m[5]) ||
1722
+ type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
1723
+ (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
1724
+ tmp.push( a );
1725
+ }
1726
+
1727
+ r = tmp;
1728
+
1729
+ // We can get a speed boost by handling nth-child here
1730
+ } else if ( m[1] == ":" && m[2] == "nth-child" ) {
1731
+ var merge = {}, tmp = [],
1732
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
1733
+ test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
1734
+ m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
1735
+ !/\D/.test(m[3]) && "0n+" + m[3] || m[3]),
1736
+ // calculate the numbers (first)n+(last) including if they are negative
1737
+ first = (test[1] + (test[2] || 1)) - 0, last = test[3] - 0;
1738
+
1739
+ // loop through all the elements left in the jQuery object
1740
+ for ( var i = 0, rl = r.length; i < rl; i++ ) {
1741
+ var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
1742
+
1743
+ if ( !merge[id] ) {
1744
+ var c = 1;
1745
+
1746
+ for ( var n = parentNode.firstChild; n; n = n.nextSibling )
1747
+ if ( n.nodeType == 1 )
1748
+ n.nodeIndex = c++;
1749
+
1750
+ merge[id] = true;
1751
+ }
1752
+
1753
+ var add = false;
1754
+
1755
+ if ( first == 0 ) {
1756
+ if ( node.nodeIndex == last )
1757
+ add = true;
1758
+ } else if ( (node.nodeIndex - last) % first == 0 && (node.nodeIndex - last) / first >= 0 )
1759
+ add = true;
1760
+
1761
+ if ( add ^ not )
1762
+ tmp.push( node );
1763
+ }
1764
+
1765
+ r = tmp;
1766
+
1767
+ // Otherwise, find the expression to execute
1768
+ } else {
1769
+ var fn = jQuery.expr[ m[1] ];
1770
+ if ( typeof fn == "object" )
1771
+ fn = fn[ m[2] ];
1772
+
1773
+ if ( typeof fn == "string" )
1774
+ fn = eval("false||function(a,i){return " + fn + ";}");
1775
+
1776
+ // Execute it against the current filter
1777
+ r = jQuery.grep( r, function(elem, i){
1778
+ return fn(elem, i, m, r);
1779
+ }, not );
1780
+ }
1781
+ }
1782
+
1783
+ // Return an array of filtered elements (r)
1784
+ // and the modified expression string (t)
1785
+ return { r: r, t: t };
1786
+ },
1787
+
1788
+ dir: function( elem, dir ){
1789
+ var matched = [],
1790
+ cur = elem[dir];
1791
+ while ( cur && cur != document ) {
1792
+ if ( cur.nodeType == 1 )
1793
+ matched.push( cur );
1794
+ cur = cur[dir];
1795
+ }
1796
+ return matched;
1797
+ },
1798
+
1799
+ nth: function(cur,result,dir,elem){
1800
+ result = result || 1;
1801
+ var num = 0;
1802
+
1803
+ for ( ; cur; cur = cur[dir] )
1804
+ if ( cur.nodeType == 1 && ++num == result )
1805
+ break;
1806
+
1807
+ return cur;
1808
+ },
1809
+
1810
+ sibling: function( n, elem ) {
1811
+ var r = [];
1812
+
1813
+ for ( ; n; n = n.nextSibling ) {
1814
+ if ( n.nodeType == 1 && n != elem )
1815
+ r.push( n );
1816
+ }
1817
+
1818
+ return r;
1819
+ }
1820
+ });
1821
+ /*
1822
+ * A number of helper functions used for managing events.
1823
+ * Many of the ideas behind this code originated from
1824
+ * Dean Edwards' addEvent library.
1825
+ */
1826
+ jQuery.event = {
1827
+
1828
+ // Bind an event to an element
1829
+ // Original by Dean Edwards
1830
+ add: function(elem, types, handler, data) {
1831
+ if ( elem.nodeType == 3 || elem.nodeType == 8 )
1832
+ return;
1833
+
1834
+ // For whatever reason, IE has trouble passing the window object
1835
+ // around, causing it to be cloned in the process
1836
+ if ( jQuery.browser.msie && elem.setInterval )
1837
+ elem = window;
1838
+
1839
+ // Make sure that the function being executed has a unique ID
1840
+ if ( !handler.guid )
1841
+ handler.guid = this.guid++;
1842
+
1843
+ // if data is passed, bind to handler
1844
+ if( data != undefined ) {
1845
+ // Create temporary function pointer to original handler
1846
+ var fn = handler;
1847
+
1848
+ // Create unique handler function, wrapped around original handler
1849
+ handler = this.proxy( fn, function() {
1850
+ // Pass arguments and context to original handler
1851
+ return fn.apply(this, arguments);
1852
+ });
1853
+
1854
+ // Store data in unique handler
1855
+ handler.data = data;
1856
+ }
1857
+
1858
+ // Init the element's event structure
1859
+ var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
1860
+ handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){
1861
+ // Handle the second event of a trigger and when
1862
+ // an event is called after a page has unloaded
1863
+ if ( typeof jQuery != "undefined" && !jQuery.event.triggered )
1864
+ return jQuery.event.handle.apply(arguments.callee.elem, arguments);
1865
+ });
1866
+ // Add elem as a property of the handle function
1867
+ // This is to prevent a memory leak with non-native
1868
+ // event in IE.
1869
+ handle.elem = elem;
1870
+
1871
+ // Handle multiple events separated by a space
1872
+ // jQuery(...).bind("mouseover mouseout", fn);
1873
+ jQuery.each(types.split(/\s+/), function(index, type) {
1874
+ // Namespaced event handlers
1875
+ var parts = type.split(".");
1876
+ type = parts[0];
1877
+ handler.type = parts[1];
1878
+
1879
+ // Get the current list of functions bound to this event
1880
+ var handlers = events[type];
1881
+
1882
+ // Init the event handler queue
1883
+ if (!handlers) {
1884
+ handlers = events[type] = {};
1885
+
1886
+ // Check for a special event handler
1887
+ // Only use addEventListener/attachEvent if the special
1888
+ // events handler returns false
1889
+ if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem,data) === false ) {
1890
+ // Bind the global event handler to the element
1891
+ if (elem.addEventListener)
1892
+ elem.addEventListener(type, handle, false);
1893
+ else if (elem.attachEvent)
1894
+ elem.attachEvent("on" + type, handle);
1895
+ }
1896
+ }
1897
+
1898
+ // Add the function to the element's handler list
1899
+ handlers[handler.guid] = handler;
1900
+
1901
+ // Keep track of which events have been used, for global triggering
1902
+ jQuery.event.global[type] = true;
1903
+ });
1904
+
1905
+ // Nullify elem to prevent memory leaks in IE
1906
+ elem = null;
1907
+ },
1908
+
1909
+ guid: 1,
1910
+ global: {},
1911
+
1912
+ // Detach an event or set of events from an element
1913
+ remove: function(elem, types, handler) {
1914
+ // don't do events on text and comment nodes
1915
+ if ( elem.nodeType == 3 || elem.nodeType == 8 )
1916
+ return;
1917
+
1918
+ var events = jQuery.data(elem, "events"), ret, index;
1919
+
1920
+ if ( events ) {
1921
+ // Unbind all events for the element
1922
+ if ( types == undefined || (typeof types == "string" && types.charAt(0) == ".") )
1923
+ for ( var type in events )
1924
+ this.remove( elem, type + (types || "") );
1925
+ else {
1926
+ // types is actually an event object here
1927
+ if ( types.type ) {
1928
+ handler = types.handler;
1929
+ types = types.type;
1930
+ }
1931
+
1932
+ // Handle multiple events seperated by a space
1933
+ // jQuery(...).unbind("mouseover mouseout", fn);
1934
+ jQuery.each(types.split(/\s+/), function(index, type){
1935
+ // Namespaced event handlers
1936
+ var parts = type.split(".");
1937
+ type = parts[0];
1938
+
1939
+ if ( events[type] ) {
1940
+ // remove the given handler for the given type
1941
+ if ( handler )
1942
+ delete events[type][handler.guid];
1943
+
1944
+ // remove all handlers for the given type
1945
+ else
1946
+ for ( handler in events[type] )
1947
+ // Handle the removal of namespaced events
1948
+ if ( !parts[1] || events[type][handler].type == parts[1] )
1949
+ delete events[type][handler];
1950
+
1951
+ // remove generic event handler if no more handlers exist
1952
+ for ( ret in events[type] ) break;
1953
+ if ( !ret ) {
1954
+ if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem) === false ) {
1955
+ if (elem.removeEventListener)
1956
+ elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
1957
+ else if (elem.detachEvent)
1958
+ elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
1959
+ }
1960
+ ret = null;
1961
+ delete events[type];
1962
+ }
1963
+ }
1964
+ });
1965
+ }
1966
+
1967
+ // Remove the expando if it's no longer used
1968
+ for ( ret in events ) break;
1969
+ if ( !ret ) {
1970
+ var handle = jQuery.data( elem, "handle" );
1971
+ if ( handle ) handle.elem = null;
1972
+ jQuery.removeData( elem, "events" );
1973
+ jQuery.removeData( elem, "handle" );
1974
+ }
1975
+ }
1976
+ },
1977
+
1978
+ trigger: function(type, data, elem, donative, extra) {
1979
+ // Clone the incoming data, if any
1980
+ data = jQuery.makeArray(data);
1981
+
1982
+ if ( type.indexOf("!") >= 0 ) {
1983
+ type = type.slice(0, -1);
1984
+ var exclusive = true;
1985
+ }
1986
+
1987
+ // Handle a global trigger
1988
+ if ( !elem ) {
1989
+ // Only trigger if we've ever bound an event for it
1990
+ if ( this.global[type] )
1991
+ jQuery.each( jQuery.cache, function(){
1992
+ if ( this.events && this.events[type] )
1993
+ jQuery.event.trigger( type, data, this.handle.elem );
1994
+ });
1995
+
1996
+ // Handle triggering a single element
1997
+ } else {
1998
+ // don't do events on text and comment nodes
1999
+ if ( elem.nodeType == 3 || elem.nodeType == 8 )
2000
+ return undefined;
2001
+
2002
+ var val, ret, fn = jQuery.isFunction( elem[ type ] || null ),
2003
+ // Check to see if we need to provide a fake event, or not
2004
+ event = !data[0] || !data[0].preventDefault;
2005
+
2006
+ // Pass along a fake event
2007
+ if ( event ) {
2008
+ data.unshift({
2009
+ type: type,
2010
+ target: elem,
2011
+ preventDefault: function(){},
2012
+ stopPropagation: function(){},
2013
+ timeStamp: now()
2014
+ });
2015
+ data[0][expando] = true; // no need to fix fake event
2016
+ }
2017
+
2018
+ // Enforce the right trigger type
2019
+ data[0].type = type;
2020
+ if ( exclusive )
2021
+ data[0].exclusive = true;
2022
+
2023
+ // Trigger the event, it is assumed that "handle" is a function
2024
+ var handle = jQuery.data(elem, "handle");
2025
+ if ( handle )
2026
+ val = handle.apply( elem, data );
2027
+
2028
+ // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
2029
+ if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
2030
+ val = false;
2031
+
2032
+ // Extra functions don't get the custom event object
2033
+ if ( event )
2034
+ data.shift();
2035
+
2036
+ // Handle triggering of extra function
2037
+ if ( extra && jQuery.isFunction( extra ) ) {
2038
+ // call the extra function and tack the current return value on the end for possible inspection
2039
+ ret = extra.apply( elem, val == null ? data : data.concat( val ) );
2040
+ // if anything is returned, give it precedence and have it overwrite the previous value
2041
+ if (ret !== undefined)
2042
+ val = ret;
2043
+ }
2044
+
2045
+ // Trigger the native events (except for clicks on links)
2046
+ if ( fn && donative !== false && val !== false && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
2047
+ this.triggered = true;
2048
+ try {
2049
+ elem[ type ]();
2050
+ // prevent IE from throwing an error for some hidden elements
2051
+ } catch (e) {}
2052
+ }
2053
+
2054
+ this.triggered = false;
2055
+ }
2056
+
2057
+ return val;
2058
+ },
2059
+
2060
+ handle: function(event) {
2061
+ // returned undefined or false
2062
+ var val, ret, namespace, all, handlers;
2063
+
2064
+ event = arguments[0] = jQuery.event.fix( event || window.event );
2065
+
2066
+ // Namespaced event handlers
2067
+ namespace = event.type.split(".");
2068
+ event.type = namespace[0];
2069
+ namespace = namespace[1];
2070
+ // Cache this now, all = true means, any handler
2071
+ all = !namespace && !event.exclusive;
2072
+
2073
+ handlers = ( jQuery.data(this, "events") || {} )[event.type];
2074
+
2075
+ for ( var j in handlers ) {
2076
+ var handler = handlers[j];
2077
+
2078
+ // Filter the functions by class
2079
+ if ( all || handler.type == namespace ) {
2080
+ // Pass in a reference to the handler function itself
2081
+ // So that we can later remove it
2082
+ event.handler = handler;
2083
+ event.data = handler.data;
2084
+
2085
+ ret = handler.apply( this, arguments );
2086
+
2087
+ if ( val !== false )
2088
+ val = ret;
2089
+
2090
+ if ( ret === false ) {
2091
+ event.preventDefault();
2092
+ event.stopPropagation();
2093
+ }
2094
+ }
2095
+ }
2096
+
2097
+ return val;
2098
+ },
2099
+
2100
+ props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" "),
2101
+
2102
+ fix: function(event) {
2103
+ if ( event[expando] == true )
2104
+ return event;
2105
+
2106
+ // store a copy of the original event object
2107
+ // and "clone" to set read-only properties
2108
+ var originalEvent = event;
2109
+ event = { originalEvent: originalEvent };
2110
+
2111
+ for ( var i = this.props.length, prop; i; ){
2112
+ prop = this.props[ --i ];
2113
+ event[ prop ] = originalEvent[ prop ];
2114
+ }
2115
+
2116
+ // Mark it as fixed
2117
+ event[expando] = true;
2118
+
2119
+ // add preventDefault and stopPropagation since
2120
+ // they will not work on the clone
2121
+ event.preventDefault = function() {
2122
+ // if preventDefault exists run it on the original event
2123
+ if (originalEvent.preventDefault)
2124
+ originalEvent.preventDefault();
2125
+ // otherwise set the returnValue property of the original event to false (IE)
2126
+ originalEvent.returnValue = false;
2127
+ };
2128
+ event.stopPropagation = function() {
2129
+ // if stopPropagation exists run it on the original event
2130
+ if (originalEvent.stopPropagation)
2131
+ originalEvent.stopPropagation();
2132
+ // otherwise set the cancelBubble property of the original event to true (IE)
2133
+ originalEvent.cancelBubble = true;
2134
+ };
2135
+
2136
+ // Fix timeStamp
2137
+ event.timeStamp = event.timeStamp || now();
2138
+
2139
+ // Fix target property, if necessary
2140
+ if ( !event.target )
2141
+ event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
2142
+
2143
+ // check if target is a textnode (safari)
2144
+ if ( event.target.nodeType == 3 )
2145
+ event.target = event.target.parentNode;
2146
+
2147
+ // Add relatedTarget, if necessary
2148
+ if ( !event.relatedTarget && event.fromElement )
2149
+ event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
2150
+
2151
+ // Calculate pageX/Y if missing and clientX/Y available
2152
+ if ( event.pageX == null && event.clientX != null ) {
2153
+ var doc = document.documentElement, body = document.body;
2154
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
2155
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
2156
+ }
2157
+
2158
+ // Add which for key events
2159
+ if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
2160
+ event.which = event.charCode || event.keyCode;
2161
+
2162
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
2163
+ if ( !event.metaKey && event.ctrlKey )
2164
+ event.metaKey = event.ctrlKey;
2165
+
2166
+ // Add which for click: 1 == left; 2 == middle; 3 == right
2167
+ // Note: button is not normalized, so don't use it
2168
+ if ( !event.which && event.button )
2169
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
2170
+
2171
+ return event;
2172
+ },
2173
+
2174
+ proxy: function( fn, proxy ){
2175
+ // Set the guid of unique handler to the same of original handler, so it can be removed
2176
+ proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
2177
+ // So proxy can be declared as an argument
2178
+ return proxy;
2179
+ },
2180
+
2181
+ special: {
2182
+ ready: {
2183
+ // Make sure the ready event is setup
2184
+ setup: bindReady,
2185
+ teardown: function() {}
2186
+ }
2187
+ }
2188
+ };
2189
+
2190
+ if ( !jQuery.browser.msie ){
2191
+ // Checks if an event happened on an element within another element
2192
+ // Used in jQuery.event.special.mouseenter and mouseleave handlers
2193
+ var withinElement = function(event) {
2194
+ // Check if mouse(over|out) are still within the same parent element
2195
+ var parent = event.relatedTarget;
2196
+ // Traverse up the tree
2197
+ while ( parent && parent != this )
2198
+ try { parent = parent.parentNode; }
2199
+ catch(e) { parent = this; }
2200
+
2201
+ if( parent != this ){
2202
+ // set the correct event type
2203
+ event.type = event.data;
2204
+ // handle event if we actually just moused on to a non sub-element
2205
+ jQuery.event.handle.apply( this, arguments );
2206
+ }
2207
+ };
2208
+
2209
+ jQuery.each({
2210
+ mouseover: 'mouseenter',
2211
+ mouseout: 'mouseleave'
2212
+ }, function( orig, fix ){
2213
+ jQuery.event.special[ fix ] = {
2214
+ setup: function(){
2215
+ jQuery.event.add( this, orig, withinElement, fix );
2216
+ },
2217
+ teardown: function(){
2218
+ jQuery.event.remove( this, orig, withinElement );
2219
+ }
2220
+ };
2221
+ });
2222
+ }
2223
+
2224
+ jQuery.fn.extend({
2225
+ bind: function( type, data, fn ) {
2226
+ return type == "unload" ? this.one(type, data, fn) : this.each(function(){
2227
+ jQuery.event.add( this, type, fn || data, fn && data );
2228
+ });
2229
+ },
2230
+
2231
+ one: function( type, data, fn ) {
2232
+ var one = jQuery.event.proxy( fn || data, function(event) {
2233
+ jQuery(this).unbind(event, one);
2234
+ return (fn || data).apply( this, arguments );
2235
+ });
2236
+ return this.each(function(){
2237
+ jQuery.event.add( this, type, one, fn && data);
2238
+ });
2239
+ },
2240
+
2241
+ unbind: function( type, fn ) {
2242
+ return this.each(function(){
2243
+ jQuery.event.remove( this, type, fn );
2244
+ });
2245
+ },
2246
+
2247
+ trigger: function( type, data, fn ) {
2248
+ return this.each(function(){
2249
+ jQuery.event.trigger( type, data, this, true, fn );
2250
+ });
2251
+ },
2252
+
2253
+ triggerHandler: function( type, data, fn ) {
2254
+ return this[0] && jQuery.event.trigger( type, data, this[0], false, fn );
2255
+ },
2256
+
2257
+ toggle: function( fn ) {
2258
+ // Save reference to arguments for access in closure
2259
+ var args = arguments, i = 1;
2260
+
2261
+ // link all the functions, so any of them can unbind this click handler
2262
+ while( i < args.length )
2263
+ jQuery.event.proxy( fn, args[i++] );
2264
+
2265
+ return this.click( jQuery.event.proxy( fn, function(event) {
2266
+ // Figure out which function to execute
2267
+ this.lastToggle = ( this.lastToggle || 0 ) % i;
2268
+
2269
+ // Make sure that clicks stop
2270
+ event.preventDefault();
2271
+
2272
+ // and execute the function
2273
+ return args[ this.lastToggle++ ].apply( this, arguments ) || false;
2274
+ }));
2275
+ },
2276
+
2277
+ hover: function(fnOver, fnOut) {
2278
+ return this.bind('mouseenter', fnOver).bind('mouseleave', fnOut);
2279
+ },
2280
+
2281
+ ready: function(fn) {
2282
+ // Attach the listeners
2283
+ bindReady();
2284
+
2285
+ // If the DOM is already ready
2286
+ if ( jQuery.isReady )
2287
+ // Execute the function immediately
2288
+ fn.call( document, jQuery );
2289
+
2290
+ // Otherwise, remember the function for later
2291
+ else
2292
+ // Add the function to the wait list
2293
+ jQuery.readyList.push( function() { return fn.call(this, jQuery); } );
2294
+
2295
+ return this;
2296
+ }
2297
+ });
2298
+
2299
+ jQuery.extend({
2300
+ isReady: false,
2301
+ readyList: [],
2302
+ // Handle when the DOM is ready
2303
+ ready: function() {
2304
+ // Make sure that the DOM is not already loaded
2305
+ if ( !jQuery.isReady ) {
2306
+ // Remember that the DOM is ready
2307
+ jQuery.isReady = true;
2308
+
2309
+ // If there are functions bound, to execute
2310
+ if ( jQuery.readyList ) {
2311
+ // Execute all of them
2312
+ jQuery.each( jQuery.readyList, function(){
2313
+ this.call( document );
2314
+ });
2315
+
2316
+ // Reset the list of functions
2317
+ jQuery.readyList = null;
2318
+ }
2319
+
2320
+ // Trigger any bound ready events
2321
+ jQuery(document).triggerHandler("ready");
2322
+ }
2323
+ }
2324
+ });
2325
+
2326
+ var readyBound = false;
2327
+
2328
+ function bindReady(){
2329
+ if ( readyBound ) return;
2330
+ readyBound = true;
2331
+
2332
+ // Mozilla, Opera (see further below for it) and webkit nightlies currently support this event
2333
+ if ( document.addEventListener && !jQuery.browser.opera)
2334
+ // Use the handy event callback
2335
+ document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
2336
+
2337
+ // If IE is used and is not in a frame
2338
+ // Continually check to see if the document is ready
2339
+ if ( jQuery.browser.msie && window == top ) (function(){
2340
+ if (jQuery.isReady) return;
2341
+ try {
2342
+ // If IE is used, use the trick by Diego Perini
2343
+ // http://javascript.nwbox.com/IEContentLoaded/
2344
+ document.documentElement.doScroll("left");
2345
+ } catch( error ) {
2346
+ setTimeout( arguments.callee, 0 );
2347
+ return;
2348
+ }
2349
+ // and execute any waiting functions
2350
+ jQuery.ready();
2351
+ })();
2352
+
2353
+ if ( jQuery.browser.opera )
2354
+ document.addEventListener( "DOMContentLoaded", function () {
2355
+ if (jQuery.isReady) return;
2356
+ for (var i = 0; i < document.styleSheets.length; i++)
2357
+ if (document.styleSheets[i].disabled) {
2358
+ setTimeout( arguments.callee, 0 );
2359
+ return;
2360
+ }
2361
+ // and execute any waiting functions
2362
+ jQuery.ready();
2363
+ }, false);
2364
+
2365
+ if ( jQuery.browser.safari ) {
2366
+ var numStyles;
2367
+ (function(){
2368
+ if (jQuery.isReady) return;
2369
+ if ( document.readyState != "loaded" && document.readyState != "complete" ) {
2370
+ setTimeout( arguments.callee, 0 );
2371
+ return;
2372
+ }
2373
+ if ( numStyles === undefined )
2374
+ numStyles = jQuery("style, link[rel=stylesheet]").length;
2375
+ if ( document.styleSheets.length != numStyles ) {
2376
+ setTimeout( arguments.callee, 0 );
2377
+ return;
2378
+ }
2379
+ // and execute any waiting functions
2380
+ jQuery.ready();
2381
+ })();
2382
+ }
2383
+
2384
+ // A fallback to window.onload, that will always work
2385
+ jQuery.event.add( window, "load", jQuery.ready );
2386
+ }
2387
+
2388
+ jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
2389
+ "mousedown,mouseup,mousemove,mouseover,mouseout,change,select," +
2390
+ "submit,keydown,keypress,keyup,error").split(","), function(i, name){
2391
+
2392
+ // Handle event binding
2393
+ jQuery.fn[name] = function(fn){
2394
+ return fn ? this.bind(name, fn) : this.trigger(name);
2395
+ };
2396
+ });
2397
+
2398
+ // Prevent memory leaks in IE
2399
+ // And prevent errors on refresh with events like mouseover in other browsers
2400
+ // Window isn't included so as not to unbind existing unload events
2401
+ jQuery( window ).bind( 'unload', function(){
2402
+ for ( var id in jQuery.cache )
2403
+ // Skip the window
2404
+ if ( id != 1 && jQuery.cache[ id ].handle )
2405
+ jQuery.event.remove( jQuery.cache[ id ].handle.elem );
2406
+ });
2407
+ jQuery.fn.extend({
2408
+ // Keep a copy of the old load
2409
+ _load: jQuery.fn.load,
2410
+
2411
+ load: function( url, params, callback ) {
2412
+ if ( typeof url != 'string' )
2413
+ return this._load( url );
2414
+
2415
+ var off = url.indexOf(" ");
2416
+ if ( off >= 0 ) {
2417
+ var selector = url.slice(off, url.length);
2418
+ url = url.slice(0, off);
2419
+ }
2420
+
2421
+ callback = callback || function(){};
2422
+
2423
+ // Default to a GET request
2424
+ var type = "GET";
2425
+
2426
+ // If the second parameter was provided
2427
+ if ( params )
2428
+ // If it's a function
2429
+ if ( jQuery.isFunction( params ) ) {
2430
+ // We assume that it's the callback
2431
+ callback = params;
2432
+ params = null;
2433
+
2434
+ // Otherwise, build a param string
2435
+ } else if( typeof params == 'object' ) {
2436
+ params = jQuery.param( params );
2437
+ type = "POST";
2438
+ }
2439
+
2440
+ var self = this;
2441
+
2442
+ // Request the remote document
2443
+ jQuery.ajax({
2444
+ url: url,
2445
+ type: type,
2446
+ dataType: "html",
2447
+ data: params,
2448
+ complete: function(res, status){
2449
+ // If successful, inject the HTML into all the matched elements
2450
+ if ( status == "success" || status == "notmodified" )
2451
+ // See if a selector was specified
2452
+ self.html( selector ?
2453
+ // Create a dummy div to hold the results
2454
+ jQuery("<div/>")
2455
+ // inject the contents of the document in, removing the scripts
2456
+ // to avoid any 'Permission Denied' errors in IE
2457
+ .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
2458
+
2459
+ // Locate the specified elements
2460
+ .find(selector) :
2461
+
2462
+ // If not, just inject the full result
2463
+ res.responseText );
2464
+
2465
+ self.each( callback, [res.responseText, status, res] );
2466
+ }
2467
+ });
2468
+ return this;
2469
+ },
2470
+
2471
+ serialize: function() {
2472
+ return jQuery.param(this.serializeArray());
2473
+ },
2474
+ serializeArray: function() {
2475
+ return this.map(function(){
2476
+ return jQuery.nodeName(this, "form") ?
2477
+ jQuery.makeArray(this.elements) : this;
2478
+ })
2479
+ .filter(function(){
2480
+ return this.name && !this.disabled &&
2481
+ (this.checked || /select|textarea/i.test(this.nodeName) ||
2482
+ /text|hidden|password/i.test(this.type));
2483
+ })
2484
+ .map(function(i, elem){
2485
+ var val = jQuery(this).val();
2486
+ return val == null ? null :
2487
+ val.constructor == Array ?
2488
+ jQuery.map( val, function(val, i){
2489
+ return {name: elem.name, value: val};
2490
+ }) :
2491
+ {name: elem.name, value: val};
2492
+ }).get();
2493
+ }
2494
+ });
2495
+
2496
+ // Attach a bunch of functions for handling common AJAX events
2497
+ jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
2498
+ jQuery.fn[o] = function(f){
2499
+ return this.bind(o, f);
2500
+ };
2501
+ });
2502
+
2503
+ var jsc = now();
2504
+
2505
+ jQuery.extend({
2506
+ get: function( url, data, callback, type ) {
2507
+ // shift arguments if data argument was ommited
2508
+ if ( jQuery.isFunction( data ) ) {
2509
+ callback = data;
2510
+ data = null;
2511
+ }
2512
+
2513
+ return jQuery.ajax({
2514
+ type: "GET",
2515
+ url: url,
2516
+ data: data,
2517
+ success: callback,
2518
+ dataType: type
2519
+ });
2520
+ },
2521
+
2522
+ getScript: function( url, callback ) {
2523
+ return jQuery.get(url, null, callback, "script");
2524
+ },
2525
+
2526
+ getJSON: function( url, data, callback ) {
2527
+ return jQuery.get(url, data, callback, "json");
2528
+ },
2529
+
2530
+ post: function( url, data, callback, type ) {
2531
+ if ( jQuery.isFunction( data ) ) {
2532
+ callback = data;
2533
+ data = {};
2534
+ }
2535
+
2536
+ return jQuery.ajax({
2537
+ type: "POST",
2538
+ url: url,
2539
+ data: data,
2540
+ success: callback,
2541
+ dataType: type
2542
+ });
2543
+ },
2544
+
2545
+ ajaxSetup: function( settings ) {
2546
+ jQuery.extend( jQuery.ajaxSettings, settings );
2547
+ },
2548
+
2549
+ ajaxSettings: {
2550
+ url: location.href,
2551
+ global: true,
2552
+ type: "GET",
2553
+ timeout: 0,
2554
+ contentType: "application/x-www-form-urlencoded",
2555
+ processData: true,
2556
+ async: true,
2557
+ data: null,
2558
+ username: null,
2559
+ password: null,
2560
+ accepts: {
2561
+ xml: "application/xml, text/xml",
2562
+ html: "text/html",
2563
+ script: "text/javascript, application/javascript",
2564
+ json: "application/json, text/javascript",
2565
+ text: "text/plain",
2566
+ _default: "*/*"
2567
+ }
2568
+ },
2569
+
2570
+ // Last-Modified header cache for next request
2571
+ lastModified: {},
2572
+
2573
+ ajax: function( s ) {
2574
+ // Extend the settings, but re-extend 's' so that it can be
2575
+ // checked again later (in the test suite, specifically)
2576
+ s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
2577
+
2578
+ var jsonp, jsre = /=\?(&|$)/g, status, data,
2579
+ type = s.type.toUpperCase();
2580
+
2581
+ // convert data if not already a string
2582
+ if ( s.data && s.processData && typeof s.data != "string" )
2583
+ s.data = jQuery.param(s.data);
2584
+
2585
+ // Handle JSONP Parameter Callbacks
2586
+ if ( s.dataType == "jsonp" ) {
2587
+ if ( type == "GET" ) {
2588
+ if ( !s.url.match(jsre) )
2589
+ s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
2590
+ } else if ( !s.data || !s.data.match(jsre) )
2591
+ s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
2592
+ s.dataType = "json";
2593
+ }
2594
+
2595
+ // Build temporary JSONP function
2596
+ if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
2597
+ jsonp = "jsonp" + jsc++;
2598
+
2599
+ // Replace the =? sequence both in the query string and the data
2600
+ if ( s.data )
2601
+ s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
2602
+ s.url = s.url.replace(jsre, "=" + jsonp + "$1");
2603
+
2604
+ // We need to make sure
2605
+ // that a JSONP style response is executed properly
2606
+ s.dataType = "script";
2607
+
2608
+ // Handle JSONP-style loading
2609
+ window[ jsonp ] = function(tmp){
2610
+ data = tmp;
2611
+ success();
2612
+ complete();
2613
+ // Garbage collect
2614
+ window[ jsonp ] = undefined;
2615
+ try{ delete window[ jsonp ]; } catch(e){}
2616
+ if ( head )
2617
+ head.removeChild( script );
2618
+ };
2619
+ }
2620
+
2621
+ if ( s.dataType == "script" && s.cache == null )
2622
+ s.cache = false;
2623
+
2624
+ if ( s.cache === false && type == "GET" ) {
2625
+ var ts = now();
2626
+ // try replacing _= if it is there
2627
+ var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
2628
+ // if nothing was replaced, add timestamp to the end
2629
+ s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
2630
+ }
2631
+
2632
+ // If data is available, append data to url for get requests
2633
+ if ( s.data && type == "GET" ) {
2634
+ s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
2635
+
2636
+ // IE likes to send both get and post data, prevent this
2637
+ s.data = null;
2638
+ }
2639
+
2640
+ // Watch for a new set of requests
2641
+ if ( s.global && ! jQuery.active++ )
2642
+ jQuery.event.trigger( "ajaxStart" );
2643
+
2644
+ // Matches an absolute URL, and saves the domain
2645
+ var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url );
2646
+
2647
+ // If we're requesting a remote document
2648
+ // and trying to load JSON or Script with a GET
2649
+ if ( s.dataType == "script" && type == "GET" && parts
2650
+ && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){
2651
+
2652
+ var head = document.getElementsByTagName("head")[0];
2653
+ var script = document.createElement("script");
2654
+ script.src = s.url;
2655
+ if (s.scriptCharset)
2656
+ script.charset = s.scriptCharset;
2657
+
2658
+ // Handle Script loading
2659
+ if ( !jsonp ) {
2660
+ var done = false;
2661
+
2662
+ // Attach handlers for all browsers
2663
+ script.onload = script.onreadystatechange = function(){
2664
+ if ( !done && (!this.readyState ||
2665
+ this.readyState == "loaded" || this.readyState == "complete") ) {
2666
+ done = true;
2667
+ success();
2668
+ complete();
2669
+ head.removeChild( script );
2670
+ }
2671
+ };
2672
+ }
2673
+
2674
+ head.appendChild(script);
2675
+
2676
+ // We handle everything using the script element injection
2677
+ return undefined;
2678
+ }
2679
+
2680
+ var requestDone = false;
2681
+
2682
+ // Create the request object; Microsoft failed to properly
2683
+ // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
2684
+ var xhr = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
2685
+
2686
+ // Open the socket
2687
+ // Passing null username, generates a login popup on Opera (#2865)
2688
+ if( s.username )
2689
+ xhr.open(type, s.url, s.async, s.username, s.password);
2690
+ else
2691
+ xhr.open(type, s.url, s.async);
2692
+
2693
+ // Need an extra try/catch for cross domain requests in Firefox 3
2694
+ try {
2695
+ // Set the correct header, if data is being sent
2696
+ if ( s.data )
2697
+ xhr.setRequestHeader("Content-Type", s.contentType);
2698
+
2699
+ // Set the If-Modified-Since header, if ifModified mode.
2700
+ if ( s.ifModified )
2701
+ xhr.setRequestHeader("If-Modified-Since",
2702
+ jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
2703
+
2704
+ // Set header so the called script knows that it's an XMLHttpRequest
2705
+ xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
2706
+
2707
+ // Set the Accepts header for the server, depending on the dataType
2708
+ xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
2709
+ s.accepts[ s.dataType ] + ", */*" :
2710
+ s.accepts._default );
2711
+ } catch(e){}
2712
+
2713
+ // Allow custom headers/mimetypes
2714
+ if ( s.beforeSend && s.beforeSend(xhr, s) === false ) {
2715
+ // cleanup active request counter
2716
+ s.global && jQuery.active--;
2717
+ // close opended socket
2718
+ xhr.abort();
2719
+ return false;
2720
+ }
2721
+
2722
+ if ( s.global )
2723
+ jQuery.event.trigger("ajaxSend", [xhr, s]);
2724
+
2725
+ // Wait for a response to come back
2726
+ var onreadystatechange = function(isTimeout){
2727
+ // The transfer is complete and the data is available, or the request timed out
2728
+ if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) {
2729
+ requestDone = true;
2730
+
2731
+ // clear poll interval
2732
+ if (ival) {
2733
+ clearInterval(ival);
2734
+ ival = null;
2735
+ }
2736
+
2737
+ status = isTimeout == "timeout" ? "timeout" :
2738
+ !jQuery.httpSuccess( xhr ) ? "error" :
2739
+ s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" :
2740
+ "success";
2741
+
2742
+ if ( status == "success" ) {
2743
+ // Watch for, and catch, XML document parse errors
2744
+ try {
2745
+ // process the data (runs the xml through httpData regardless of callback)
2746
+ data = jQuery.httpData( xhr, s.dataType, s );
2747
+ } catch(e) {
2748
+ status = "parsererror";
2749
+ }
2750
+ }
2751
+
2752
+ // Make sure that the request was successful or notmodified
2753
+ if ( status == "success" ) {
2754
+ // Cache Last-Modified header, if ifModified mode.
2755
+ var modRes;
2756
+ try {
2757
+ modRes = xhr.getResponseHeader("Last-Modified");
2758
+ } catch(e) {} // swallow exception thrown by FF if header is not available
2759
+
2760
+ if ( s.ifModified && modRes )
2761
+ jQuery.lastModified[s.url] = modRes;
2762
+
2763
+ // JSONP handles its own success callback
2764
+ if ( !jsonp )
2765
+ success();
2766
+ } else
2767
+ jQuery.handleError(s, xhr, status);
2768
+
2769
+ // Fire the complete handlers
2770
+ complete();
2771
+
2772
+ // Stop memory leaks
2773
+ if ( s.async )
2774
+ xhr = null;
2775
+ }
2776
+ };
2777
+
2778
+ if ( s.async ) {
2779
+ // don't attach the handler to the request, just poll it instead
2780
+ var ival = setInterval(onreadystatechange, 13);
2781
+
2782
+ // Timeout checker
2783
+ if ( s.timeout > 0 )
2784
+ setTimeout(function(){
2785
+ // Check to see if the request is still happening
2786
+ if ( xhr ) {
2787
+ // Cancel the request
2788
+ xhr.abort();
2789
+
2790
+ if( !requestDone )
2791
+ onreadystatechange( "timeout" );
2792
+ }
2793
+ }, s.timeout);
2794
+ }
2795
+
2796
+ // Send the data
2797
+ try {
2798
+ xhr.send(s.data);
2799
+ } catch(e) {
2800
+ jQuery.handleError(s, xhr, null, e);
2801
+ }
2802
+
2803
+ // firefox 1.5 doesn't fire statechange for sync requests
2804
+ if ( !s.async )
2805
+ onreadystatechange();
2806
+
2807
+ function success(){
2808
+ // If a local callback was specified, fire it and pass it the data
2809
+ if ( s.success )
2810
+ s.success( data, status );
2811
+
2812
+ // Fire the global callback
2813
+ if ( s.global )
2814
+ jQuery.event.trigger( "ajaxSuccess", [xhr, s] );
2815
+ }
2816
+
2817
+ function complete(){
2818
+ // Process result
2819
+ if ( s.complete )
2820
+ s.complete(xhr, status);
2821
+
2822
+ // The request was completed
2823
+ if ( s.global )
2824
+ jQuery.event.trigger( "ajaxComplete", [xhr, s] );
2825
+
2826
+ // Handle the global AJAX counter
2827
+ if ( s.global && ! --jQuery.active )
2828
+ jQuery.event.trigger( "ajaxStop" );
2829
+ }
2830
+
2831
+ // return XMLHttpRequest to allow aborting the request etc.
2832
+ return xhr;
2833
+ },
2834
+
2835
+ handleError: function( s, xhr, status, e ) {
2836
+ // If a local callback was specified, fire it
2837
+ if ( s.error ) s.error( xhr, status, e );
2838
+
2839
+ // Fire the global callback
2840
+ if ( s.global )
2841
+ jQuery.event.trigger( "ajaxError", [xhr, s, e] );
2842
+ },
2843
+
2844
+ // Counter for holding the number of active queries
2845
+ active: 0,
2846
+
2847
+ // Determines if an XMLHttpRequest was successful or not
2848
+ httpSuccess: function( xhr ) {
2849
+ try {
2850
+ // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
2851
+ return !xhr.status && location.protocol == "file:" ||
2852
+ ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223 ||
2853
+ jQuery.browser.safari && xhr.status == undefined;
2854
+ } catch(e){}
2855
+ return false;
2856
+ },
2857
+
2858
+ // Determines if an XMLHttpRequest returns NotModified
2859
+ httpNotModified: function( xhr, url ) {
2860
+ try {
2861
+ var xhrRes = xhr.getResponseHeader("Last-Modified");
2862
+
2863
+ // Firefox always returns 200. check Last-Modified date
2864
+ return xhr.status == 304 || xhrRes == jQuery.lastModified[url] ||
2865
+ jQuery.browser.safari && xhr.status == undefined;
2866
+ } catch(e){}
2867
+ return false;
2868
+ },
2869
+
2870
+ httpData: function( xhr, type, s ) {
2871
+ var ct = xhr.getResponseHeader("content-type"),
2872
+ xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
2873
+ data = xml ? xhr.responseXML : xhr.responseText;
2874
+
2875
+ if ( xml && data.documentElement.tagName == "parsererror" )
2876
+ throw "parsererror";
2877
+
2878
+ // Allow a pre-filtering function to sanitize the response
2879
+ // s != null is checked to keep backwards compatibility
2880
+ if( s && s.dataFilter )
2881
+ data = s.dataFilter( data, type );
2882
+
2883
+ // If the type is "script", eval it in global context
2884
+ if ( type == "script" )
2885
+ jQuery.globalEval( data );
2886
+
2887
+ // Get the JavaScript object, if JSON is used.
2888
+ if ( type == "json" )
2889
+ data = eval("(" + data + ")");
2890
+
2891
+ return data;
2892
+ },
2893
+
2894
+ // Serialize an array of form elements or a set of
2895
+ // key/values into a query string
2896
+ param: function( a ) {
2897
+ var s = [ ];
2898
+
2899
+ function add( key, value ){
2900
+ s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value);
2901
+ };
2902
+
2903
+ // If an array was passed in, assume that it is an array
2904
+ // of form elements
2905
+ if ( a.constructor == Array || a.jquery )
2906
+ // Serialize the form elements
2907
+ jQuery.each( a, function(){
2908
+ add( this.name, this.value );
2909
+ });
2910
+
2911
+ // Otherwise, assume that it's an object of key/value pairs
2912
+ else
2913
+ // Serialize the key/values
2914
+ for ( var j in a )
2915
+ // If the value is an array then the key names need to be repeated
2916
+ if ( a[j] && a[j].constructor == Array )
2917
+ jQuery.each( a[j], function(){
2918
+ add( j, this );
2919
+ });
2920
+ else
2921
+ add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] );
2922
+
2923
+ // Return the resulting serialization
2924
+ return s.join("&").replace(/%20/g, "+");
2925
+ }
2926
+
2927
+ });
2928
+ jQuery.fn.extend({
2929
+ show: function(speed,callback){
2930
+ return speed ?
2931
+ this.animate({
2932
+ height: "show", width: "show", opacity: "show"
2933
+ }, speed, callback) :
2934
+
2935
+ this.filter(":hidden").each(function(){
2936
+ this.style.display = this.oldblock || "";
2937
+ if ( jQuery.css(this,"display") == "none" ) {
2938
+ var elem = jQuery("<" + this.tagName + " />").appendTo("body");
2939
+ this.style.display = elem.css("display");
2940
+ // handle an edge condition where css is - div { display:none; } or similar
2941
+ if (this.style.display == "none")
2942
+ this.style.display = "block";
2943
+ elem.remove();
2944
+ }
2945
+ }).end();
2946
+ },
2947
+
2948
+ hide: function(speed,callback){
2949
+ return speed ?
2950
+ this.animate({
2951
+ height: "hide", width: "hide", opacity: "hide"
2952
+ }, speed, callback) :
2953
+
2954
+ this.filter(":visible").each(function(){
2955
+ this.oldblock = this.oldblock || jQuery.css(this,"display");
2956
+ this.style.display = "none";
2957
+ }).end();
2958
+ },
2959
+
2960
+ // Save the old toggle function
2961
+ _toggle: jQuery.fn.toggle,
2962
+
2963
+ toggle: function( fn, fn2 ){
2964
+ return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
2965
+ this._toggle.apply( this, arguments ) :
2966
+ fn ?
2967
+ this.animate({
2968
+ height: "toggle", width: "toggle", opacity: "toggle"
2969
+ }, fn, fn2) :
2970
+ this.each(function(){
2971
+ jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
2972
+ });
2973
+ },
2974
+
2975
+ fadeTo: function(speed,to,callback){
2976
+ return this.animate({opacity: to}, speed, callback);
2977
+ },
2978
+
2979
+ animate: function( prop, speed, easing, callback ) {
2980
+ var optall = jQuery.speed(speed, easing, callback);
2981
+
2982
+ return this[ optall.queue === false ? "each" : "queue" ](function(){
2983
+
2984
+ var opt = jQuery.extend({}, optall), p,
2985
+ hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),
2986
+ self = this;
2987
+
2988
+ for ( p in prop ) {
2989
+ if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
2990
+ return opt.complete.call(this);
2991
+
2992
+ if ( ( p == "height" || p == "width" ) && this.style ) {
2993
+ // Store display property
2994
+ opt.display = jQuery.css(this, "display");
2995
+
2996
+ // Make sure that nothing sneaks out
2997
+ opt.overflow = this.style.overflow;
2998
+ }
2999
+ }
3000
+
3001
+ if ( opt.overflow != null )
3002
+ this.style.overflow = "hidden";
3003
+
3004
+ opt.curAnim = jQuery.extend({}, prop);
3005
+
3006
+ jQuery.each( prop, function(name, val){
3007
+ var e = new jQuery.fx( self, opt, name );
3008
+
3009
+ if ( /toggle|show|hide/.test(val) )
3010
+ e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
3011
+ else {
3012
+ var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
3013
+ start = e.cur(true) || 0;
3014
+
3015
+ if ( parts ) {
3016
+ var end = parseFloat(parts[2]),
3017
+ unit = parts[3] || "px";
3018
+
3019
+ // We need to compute starting value
3020
+ if ( unit != "px" ) {
3021
+ self.style[ name ] = (end || 1) + unit;
3022
+ start = ((end || 1) / e.cur(true)) * start;
3023
+ self.style[ name ] = start + unit;
3024
+ }
3025
+
3026
+ // If a +=/-= token was provided, we're doing a relative animation
3027
+ if ( parts[1] )
3028
+ end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
3029
+
3030
+ e.custom( start, end, unit );
3031
+ } else
3032
+ e.custom( start, val, "" );
3033
+ }
3034
+ });
3035
+
3036
+ // For JS strict compliance
3037
+ return true;
3038
+ });
3039
+ },
3040
+
3041
+ queue: function(type, fn){
3042
+ if ( jQuery.isFunction(type) || ( type && type.constructor == Array )) {
3043
+ fn = type;
3044
+ type = "fx";
3045
+ }
3046
+
3047
+ if ( !type || (typeof type == "string" && !fn) )
3048
+ return queue( this[0], type );
3049
+
3050
+ return this.each(function(){
3051
+ if ( fn.constructor == Array )
3052
+ queue(this, type, fn);
3053
+ else {
3054
+ queue(this, type).push( fn );
3055
+
3056
+ if ( queue(this, type).length == 1 )
3057
+ fn.call(this);
3058
+ }
3059
+ });
3060
+ },
3061
+
3062
+ stop: function(clearQueue, gotoEnd){
3063
+ var timers = jQuery.timers;
3064
+
3065
+ if (clearQueue)
3066
+ this.queue([]);
3067
+
3068
+ this.each(function(){
3069
+ // go in reverse order so anything added to the queue during the loop is ignored
3070
+ for ( var i = timers.length - 1; i >= 0; i-- )
3071
+ if ( timers[i].elem == this ) {
3072
+ if (gotoEnd)
3073
+ // force the next step to be the last
3074
+ timers[i](true);
3075
+ timers.splice(i, 1);
3076
+ }
3077
+ });
3078
+
3079
+ // start the next in the queue if the last step wasn't forced
3080
+ if (!gotoEnd)
3081
+ this.dequeue();
3082
+
3083
+ return this;
3084
+ }
3085
+
3086
+ });
3087
+
3088
+ // Generate shortcuts for custom animations
3089
+ jQuery.each({
3090
+ slideDown: { height:"show" },
3091
+ slideUp: { height: "hide" },
3092
+ slideToggle: { height: "toggle" },
3093
+ fadeIn: { opacity: "show" },
3094
+ fadeOut: { opacity: "hide" }
3095
+ }, function( name, props ){
3096
+ jQuery.fn[ name ] = function( speed, callback ){
3097
+ return this.animate( props, speed, callback );
3098
+ };
3099
+ });
3100
+
3101
+ var queue = function( elem, type, array ) {
3102
+ if ( elem ){
3103
+
3104
+ type = type || "fx";
3105
+
3106
+ var q = jQuery.data( elem, type + "queue" );
3107
+
3108
+ if ( !q || array )
3109
+ q = jQuery.data( elem, type + "queue", jQuery.makeArray(array) );
3110
+
3111
+ }
3112
+ return q;
3113
+ };
3114
+
3115
+ jQuery.fn.dequeue = function(type){
3116
+ type = type || "fx";
3117
+
3118
+ return this.each(function(){
3119
+ var q = queue(this, type);
3120
+
3121
+ q.shift();
3122
+
3123
+ if ( q.length )
3124
+ q[0].call( this );
3125
+ });
3126
+ };
3127
+
3128
+ jQuery.extend({
3129
+
3130
+ speed: function(speed, easing, fn) {
3131
+ var opt = speed && speed.constructor == Object ? speed : {
3132
+ complete: fn || !fn && easing ||
3133
+ jQuery.isFunction( speed ) && speed,
3134
+ duration: speed,
3135
+ easing: fn && easing || easing && easing.constructor != Function && easing
3136
+ };
3137
+
3138
+ opt.duration = (opt.duration && opt.duration.constructor == Number ?
3139
+ opt.duration :
3140
+ jQuery.fx.speeds[opt.duration]) || jQuery.fx.speeds._default;
3141
+
3142
+ // Queueing
3143
+ opt.old = opt.complete;
3144
+ opt.complete = function(){
3145
+ if ( opt.queue !== false )
3146
+ jQuery(this).dequeue();
3147
+ if ( jQuery.isFunction( opt.old ) )
3148
+ opt.old.call( this );
3149
+ };
3150
+
3151
+ return opt;
3152
+ },
3153
+
3154
+ easing: {
3155
+ linear: function( p, n, firstNum, diff ) {
3156
+ return firstNum + diff * p;
3157
+ },
3158
+ swing: function( p, n, firstNum, diff ) {
3159
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
3160
+ }
3161
+ },
3162
+
3163
+ timers: [],
3164
+ timerId: null,
3165
+
3166
+ fx: function( elem, options, prop ){
3167
+ this.options = options;
3168
+ this.elem = elem;
3169
+ this.prop = prop;
3170
+
3171
+ if ( !options.orig )
3172
+ options.orig = {};
3173
+ }
3174
+
3175
+ });
3176
+
3177
+ jQuery.fx.prototype = {
3178
+
3179
+ // Simple function for setting a style value
3180
+ update: function(){
3181
+ if ( this.options.step )
3182
+ this.options.step.call( this.elem, this.now, this );
3183
+
3184
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
3185
+
3186
+ // Set display property to block for height/width animations
3187
+ if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style )
3188
+ this.elem.style.display = "block";
3189
+ },
3190
+
3191
+ // Get the current size
3192
+ cur: function(force){
3193
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) )
3194
+ return this.elem[ this.prop ];
3195
+
3196
+ var r = parseFloat(jQuery.css(this.elem, this.prop, force));
3197
+ return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
3198
+ },
3199
+
3200
+ // Start an animation from one number to another
3201
+ custom: function(from, to, unit){
3202
+ this.startTime = now();
3203
+ this.start = from;
3204
+ this.end = to;
3205
+ this.unit = unit || this.unit || "px";
3206
+ this.now = this.start;
3207
+ this.pos = this.state = 0;
3208
+ this.update();
3209
+
3210
+ var self = this;
3211
+ function t(gotoEnd){
3212
+ return self.step(gotoEnd);
3213
+ }
3214
+
3215
+ t.elem = this.elem;
3216
+
3217
+ jQuery.timers.push(t);
3218
+
3219
+ if ( jQuery.timerId == null ) {
3220
+ jQuery.timerId = setInterval(function(){
3221
+ var timers = jQuery.timers;
3222
+
3223
+ for ( var i = 0; i < timers.length; i++ )
3224
+ if ( !timers[i]() )
3225
+ timers.splice(i--, 1);
3226
+
3227
+ if ( !timers.length ) {
3228
+ clearInterval( jQuery.timerId );
3229
+ jQuery.timerId = null;
3230
+ }
3231
+ }, 13);
3232
+ }
3233
+ },
3234
+
3235
+ // Simple 'show' function
3236
+ show: function(){
3237
+ // Remember where we started, so that we can go back to it later
3238
+ this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
3239
+ this.options.show = true;
3240
+
3241
+ // Begin the animation
3242
+ this.custom(0, this.cur());
3243
+
3244
+ // Make sure that we start at a small width/height to avoid any
3245
+ // flash of content
3246
+ if ( this.prop == "width" || this.prop == "height" )
3247
+ this.elem.style[this.prop] = "1px";
3248
+
3249
+ // Start by showing the element
3250
+ jQuery(this.elem).show();
3251
+ },
3252
+
3253
+ // Simple 'hide' function
3254
+ hide: function(){
3255
+ // Remember where we started, so that we can go back to it later
3256
+ this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
3257
+ this.options.hide = true;
3258
+
3259
+ // Begin the animation
3260
+ this.custom(this.cur(), 0);
3261
+ },
3262
+
3263
+ // Each step of an animation
3264
+ step: function(gotoEnd){
3265
+ var t = now();
3266
+
3267
+ if ( gotoEnd || t > this.options.duration + this.startTime ) {
3268
+ this.now = this.end;
3269
+ this.pos = this.state = 1;
3270
+ this.update();
3271
+
3272
+ this.options.curAnim[ this.prop ] = true;
3273
+
3274
+ var done = true;
3275
+ for ( var i in this.options.curAnim )
3276
+ if ( this.options.curAnim[i] !== true )
3277
+ done = false;
3278
+
3279
+ if ( done ) {
3280
+ if ( this.options.display != null ) {
3281
+ // Reset the overflow
3282
+ this.elem.style.overflow = this.options.overflow;
3283
+
3284
+ // Reset the display
3285
+ this.elem.style.display = this.options.display;
3286
+ if ( jQuery.css(this.elem, "display") == "none" )
3287
+ this.elem.style.display = "block";
3288
+ }
3289
+
3290
+ // Hide the element if the "hide" operation was done
3291
+ if ( this.options.hide )
3292
+ this.elem.style.display = "none";
3293
+
3294
+ // Reset the properties, if the item has been hidden or shown
3295
+ if ( this.options.hide || this.options.show )
3296
+ for ( var p in this.options.curAnim )
3297
+ jQuery.attr(this.elem.style, p, this.options.orig[p]);
3298
+ }
3299
+
3300
+ if ( done )
3301
+ // Execute the complete function
3302
+ this.options.complete.call( this.elem );
3303
+
3304
+ return false;
3305
+ } else {
3306
+ var n = t - this.startTime;
3307
+ this.state = n / this.options.duration;
3308
+
3309
+ // Perform the easing function, defaults to swing
3310
+ this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
3311
+ this.now = this.start + ((this.end - this.start) * this.pos);
3312
+
3313
+ // Perform the next step of the animation
3314
+ this.update();
3315
+ }
3316
+
3317
+ return true;
3318
+ }
3319
+
3320
+ };
3321
+
3322
+ jQuery.extend( jQuery.fx, {
3323
+ speeds:{
3324
+ slow: 600,
3325
+ fast: 200,
3326
+ // Default speed
3327
+ _default: 400
3328
+ },
3329
+ step: {
3330
+
3331
+ opacity: function(fx){
3332
+ jQuery.attr(fx.elem.style, "opacity", fx.now);
3333
+ },
3334
+
3335
+ _default: function(fx){
3336
+ if( fx.prop in fx.elem )
3337
+ fx.elem[ fx.prop ] = fx.now;
3338
+ else if( fx.elem.style )
3339
+ fx.elem.style[ fx.prop ] = fx.now + fx.unit;
3340
+ }
3341
+ }
3342
+ });
3343
+ // The Offset Method
3344
+ // Originally By Brandon Aaron, part of the Dimension Plugin
3345
+ // http://jquery.com/plugins/project/dimensions
3346
+ jQuery.fn.offset = function() {
3347
+ var left = 0, top = 0, elem = this[0], results;
3348
+
3349
+ if ( elem ) with ( jQuery.browser ) {
3350
+ var parent = elem.parentNode,
3351
+ offsetChild = elem,
3352
+ offsetParent = elem.offsetParent,
3353
+ doc = elem.ownerDocument,
3354
+ safari2 = safari && parseInt(version) < 522 && !/adobeair/i.test(userAgent),
3355
+ css = jQuery.curCSS,
3356
+ fixed = css(elem, "position") == "fixed";
3357
+
3358
+ // Use getBoundingClientRect if available
3359
+ if ( !(mozilla && elem == document.body) && elem.getBoundingClientRect ) {
3360
+ var box = elem.getBoundingClientRect();
3361
+
3362
+ // Add the document scroll offsets
3363
+ add(box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
3364
+ box.top + Math.max(doc.documentElement.scrollTop, doc.body.scrollTop));
3365
+
3366
+ // IE adds the HTML element's border, by default it is medium which is 2px
3367
+ // IE 6 and 7 quirks mode the border width is overwritable by the following css html { border: 0; }
3368
+ // IE 7 standards mode, the border is always 2px
3369
+ // This border/offset is typically represented by the clientLeft and clientTop properties
3370
+ // However, in IE6 and 7 quirks mode the clientLeft and clientTop properties are not updated when overwriting it via CSS
3371
+ // Therefore this method will be off by 2px in IE while in quirksmode
3372
+ add( -doc.documentElement.clientLeft, -doc.documentElement.clientTop );
3373
+
3374
+ // Otherwise loop through the offsetParents and parentNodes
3375
+ } else {
3376
+
3377
+ // Initial element offsets
3378
+ add( elem.offsetLeft, elem.offsetTop );
3379
+
3380
+ // Get parent offsets
3381
+ while ( offsetParent ) {
3382
+ // Add offsetParent offsets
3383
+ add( offsetParent.offsetLeft, offsetParent.offsetTop );
3384
+
3385
+ // Mozilla and Safari > 2 does not include the border on offset parents
3386
+ // However Mozilla adds the border for table or table cells
3387
+ if ( mozilla && !/^t(able|d|h)$/i.test(offsetParent.tagName) || safari && !safari2 )
3388
+ border( offsetParent );
3389
+
3390
+ // Add the document scroll offsets if position is fixed on any offsetParent
3391
+ if ( !fixed && css(offsetParent, "position") == "fixed" )
3392
+ fixed = true;
3393
+
3394
+ // Set offsetChild to previous offsetParent unless it is the body element
3395
+ offsetChild = /^body$/i.test(offsetParent.tagName) ? offsetChild : offsetParent;
3396
+ // Get next offsetParent
3397
+ offsetParent = offsetParent.offsetParent;
3398
+ }
3399
+
3400
+ // Get parent scroll offsets
3401
+ while ( parent && parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
3402
+ // Remove parent scroll UNLESS that parent is inline or a table to work around Opera inline/table scrollLeft/Top bug
3403
+ if ( !/^inline|table.*$/i.test(css(parent, "display")) )
3404
+ // Subtract parent scroll offsets
3405
+ add( -parent.scrollLeft, -parent.scrollTop );
3406
+
3407
+ // Mozilla does not add the border for a parent that has overflow != visible
3408
+ if ( mozilla && css(parent, "overflow") != "visible" )
3409
+ border( parent );
3410
+
3411
+ // Get next parent
3412
+ parent = parent.parentNode;
3413
+ }
3414
+
3415
+ // Safari <= 2 doubles body offsets with a fixed position element/offsetParent or absolutely positioned offsetChild
3416
+ // Mozilla doubles body offsets with a non-absolutely positioned offsetChild
3417
+ if ( (safari2 && (fixed || css(offsetChild, "position") == "absolute")) ||
3418
+ (mozilla && css(offsetChild, "position") != "absolute") )
3419
+ add( -doc.body.offsetLeft, -doc.body.offsetTop );
3420
+
3421
+ // Add the document scroll offsets if position is fixed
3422
+ if ( fixed )
3423
+ add(Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
3424
+ Math.max(doc.documentElement.scrollTop, doc.body.scrollTop));
3425
+ }
3426
+
3427
+ // Return an object with top and left properties
3428
+ results = { top: top, left: left };
3429
+ }
3430
+
3431
+ function border(elem) {
3432
+ add( jQuery.curCSS(elem, "borderLeftWidth", true), jQuery.curCSS(elem, "borderTopWidth", true) );
3433
+ }
3434
+
3435
+ function add(l, t) {
3436
+ left += parseInt(l, 10) || 0;
3437
+ top += parseInt(t, 10) || 0;
3438
+ }
3439
+
3440
+ return results;
3441
+ };
3442
+
3443
+
3444
+ jQuery.fn.extend({
3445
+ position: function() {
3446
+ var left = 0, top = 0, results;
3447
+
3448
+ if ( this[0] ) {
3449
+ // Get *real* offsetParent
3450
+ var offsetParent = this.offsetParent(),
3451
+
3452
+ // Get correct offsets
3453
+ offset = this.offset(),
3454
+ parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
3455
+
3456
+ // Subtract element margins
3457
+ // note: when an element has margin: auto the offsetLeft and marginLeft
3458
+ // are the same in Safari causing offset.left to incorrectly be 0
3459
+ offset.top -= num( this, 'marginTop' );
3460
+ offset.left -= num( this, 'marginLeft' );
3461
+
3462
+ // Add offsetParent borders
3463
+ parentOffset.top += num( offsetParent, 'borderTopWidth' );
3464
+ parentOffset.left += num( offsetParent, 'borderLeftWidth' );
3465
+
3466
+ // Subtract the two offsets
3467
+ results = {
3468
+ top: offset.top - parentOffset.top,
3469
+ left: offset.left - parentOffset.left
3470
+ };
3471
+ }
3472
+
3473
+ return results;
3474
+ },
3475
+
3476
+ offsetParent: function() {
3477
+ var offsetParent = this[0].offsetParent || document.body;
3478
+ while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
3479
+ offsetParent = offsetParent.offsetParent;
3480
+ return jQuery(offsetParent);
3481
+ }
3482
+ });
3483
+
3484
+
3485
+ // Create scrollLeft and scrollTop methods
3486
+ jQuery.each( ['Left', 'Top'], function(i, name) {
3487
+ var method = 'scroll' + name;
3488
+
3489
+ jQuery.fn[ method ] = function(val) {
3490
+ if (!this[0]) return;
3491
+
3492
+ return val != undefined ?
3493
+
3494
+ // Set the scroll offset
3495
+ this.each(function() {
3496
+ this == window || this == document ?
3497
+ window.scrollTo(
3498
+ !i ? val : jQuery(window).scrollLeft(),
3499
+ i ? val : jQuery(window).scrollTop()
3500
+ ) :
3501
+ this[ method ] = val;
3502
+ }) :
3503
+
3504
+ // Return the scroll offset
3505
+ this[0] == window || this[0] == document ?
3506
+ self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
3507
+ jQuery.boxModel && document.documentElement[ method ] ||
3508
+ document.body[ method ] :
3509
+ this[0][ method ];
3510
+ };
3511
+ });
3512
+ // Create innerHeight, innerWidth, outerHeight and outerWidth methods
3513
+ jQuery.each([ "Height", "Width" ], function(i, name){
3514
+
3515
+ var tl = i ? "Left" : "Top", // top or left
3516
+ br = i ? "Right" : "Bottom"; // bottom or right
3517
+
3518
+ // innerHeight and innerWidth
3519
+ jQuery.fn["inner" + name] = function(){
3520
+ return this[ name.toLowerCase() ]() +
3521
+ num(this, "padding" + tl) +
3522
+ num(this, "padding" + br);
3523
+ };
3524
+
3525
+ // outerHeight and outerWidth
3526
+ jQuery.fn["outer" + name] = function(margin) {
3527
+ return this["inner" + name]() +
3528
+ num(this, "border" + tl + "Width") +
3529
+ num(this, "border" + br + "Width") +
3530
+ (margin ?
3531
+ num(this, "margin" + tl) + num(this, "margin" + br) : 0);
3532
+ };
3533
+
3534
+ });})();