ramaze 2009.03 → 2009.04

Sign up to get free protection for your applications and to get access to all the features.
Files changed (545) hide show
  1. data/.mailmap +25 -0
  2. data/CHANGELOG +16750 -0
  3. data/MANIFEST +485 -0
  4. data/{README.md → README.markdown} +0 -5
  5. data/Rakefile +79 -242
  6. data/bin/ramaze +275 -52
  7. data/doc/AUTHORS +36 -28
  8. data/doc/FAQ +1 -1
  9. data/doc/tutorial/todolist.html +1415 -742
  10. data/doc/tutorial/todolist.txt +939 -0
  11. data/examples/app/auth/layout/auth.xhtml +25 -0
  12. data/examples/app/auth/start.rb +23 -0
  13. data/examples/app/auth/view/index.xhtml +4 -0
  14. data/examples/app/auth/view/login.xhtml +20 -0
  15. data/examples/app/auth/view/secret.xhtml +1 -0
  16. data/examples/app/blog/app.rb +69 -0
  17. data/{lib/proto/start.ru → examples/app/blog/config.ru} +8 -7
  18. data/examples/app/blog/controller/comment.rb +45 -0
  19. data/examples/app/blog/controller/entry.rb +85 -0
  20. data/examples/app/blog/controller/init.rb +86 -0
  21. data/examples/app/blog/controller/main.rb +16 -25
  22. data/examples/app/blog/controller/tag.rb +9 -0
  23. data/examples/app/blog/layout/default.nag +31 -0
  24. data/examples/app/blog/model/comment.rb +58 -0
  25. data/examples/app/blog/model/entry.rb +81 -22
  26. data/examples/app/blog/model/init.rb +15 -0
  27. data/examples/app/blog/model/tag.rb +36 -0
  28. data/examples/app/blog/public/css/screen.css +273 -0
  29. data/examples/app/blog/start.rb +3 -5
  30. data/examples/app/blog/view/comment/form.nag +10 -0
  31. data/examples/app/blog/view/comment/show.nag +16 -0
  32. data/examples/app/blog/view/entry/edit.nag +14 -0
  33. data/examples/app/blog/view/entry/feed.atom.nag +8 -0
  34. data/examples/app/blog/view/entry/feed.rss.nag +7 -0
  35. data/examples/app/blog/view/entry/index.nag +7 -0
  36. data/examples/app/blog/view/entry/new.nag +13 -0
  37. data/examples/app/blog/view/entry/show.nag +36 -0
  38. data/examples/app/blog/view/feed.atom.nag +18 -0
  39. data/examples/app/blog/view/feed.rss.nag +25 -0
  40. data/examples/app/blog/view/index.nag +6 -0
  41. data/examples/app/blog/view/tag/index.nag +5 -0
  42. data/examples/app/chat/{view/layout.xhtml → layout/default.nag} +1 -1
  43. data/examples/app/chat/model/history.rb +13 -11
  44. data/examples/app/chat/public/css/chat.css +9 -13
  45. data/examples/app/chat/public/js/chat.js +6 -0
  46. data/examples/app/chat/start.rb +16 -17
  47. data/examples/app/chat/view/{chat.xhtml → chat.nag} +0 -0
  48. data/examples/app/chat/view/{index.xhtml → index.nag} +0 -0
  49. data/examples/app/sourceview/{sourceview.rb → start.rb} +36 -34
  50. data/examples/app/sourceview/{template → view}/index.haml +0 -0
  51. data/examples/app/todolist/controller/init.rb +10 -0
  52. data/examples/app/todolist/controller/task.rb +39 -0
  53. data/examples/app/todolist/layout/default.xhtml +14 -0
  54. data/examples/app/todolist/model/init.rb +14 -0
  55. data/examples/app/todolist/model/task.rb +39 -0
  56. data/examples/app/todolist/public/css/screen.css +63 -0
  57. data/examples/app/todolist/start.rb +6 -6
  58. data/examples/app/todolist/view/index.xhtml +29 -0
  59. data/examples/app/wikore/spec/wikore.rb +4 -6
  60. data/examples/app/wikore/src/controller.rb +9 -11
  61. data/examples/app/wikore/src/model.rb +7 -10
  62. data/examples/app/wikore/start.rb +1 -1
  63. data/examples/app/wikore/{template → view}/index.xhtml +0 -0
  64. data/examples/basic/element.rb +5 -3
  65. data/examples/basic/gestalt.rb +1 -2
  66. data/examples/basic/hello.rb +3 -4
  67. data/examples/basic/layout.rb +2 -2
  68. data/examples/basic/linking.rb +7 -7
  69. data/examples/basic/partial.rb +3 -5
  70. data/examples/basic/simple.rb +1 -5
  71. data/examples/helpers/cache.rb +5 -5
  72. data/examples/helpers/httpdigest.rb +31 -32
  73. data/examples/misc/memleak_detector.rb +17 -12
  74. data/examples/misc/rapp.rb +28 -17
  75. data/examples/misc/serve_directory.rb +6 -0
  76. data/examples/templates/template_erubis.rb +9 -10
  77. data/examples/templates/template_ezamar.rb +8 -7
  78. data/examples/templates/template_haml.rb +6 -7
  79. data/examples/templates/template_liquid.rb +20 -19
  80. data/examples/templates/template_markaby.rb +2 -3
  81. data/examples/templates/template_nagoro.rb +6 -7
  82. data/examples/templates/template_redcloth.rb +8 -9
  83. data/examples/templates/template_remarkably.rb +7 -8
  84. data/examples/templates/template_tenjin.rb +6 -7
  85. data/examples/templates/{template → view}/external.haml +4 -4
  86. data/examples/templates/{template → view}/external.liquid +0 -0
  87. data/examples/templates/{template → view}/external.mab +0 -0
  88. data/examples/templates/{template → view}/external.nag +4 -4
  89. data/examples/templates/{template → view}/external.redcloth +4 -4
  90. data/examples/templates/{template → view}/external.rem +4 -4
  91. data/examples/templates/{template → view}/external.rhtml +6 -6
  92. data/examples/templates/{template → view}/external.tenjin +4 -4
  93. data/examples/templates/{template → view}/external.zmr +6 -6
  94. data/lib/proto/app.rb +15 -0
  95. data/lib/proto/config.ru +16 -0
  96. data/lib/proto/controller/init.rb +2 -2
  97. data/lib/proto/{view/page.xhtml → layout/default.xhtml} +1 -4
  98. data/lib/proto/public/.htaccess +24 -0
  99. data/lib/proto/public/css/screen.css +30 -0
  100. data/lib/proto/public/js/jquery.js +2121 -1294
  101. data/lib/proto/spec/main.rb +11 -15
  102. data/lib/proto/start.rb +6 -10
  103. data/lib/proto/view/index.xhtml +34 -27
  104. data/lib/ramaze.rb +78 -129
  105. data/lib/ramaze/app.rb +124 -0
  106. data/lib/ramaze/cache.rb +9 -104
  107. data/lib/ramaze/cache/localmemcache.rb +56 -0
  108. data/lib/ramaze/cache/memcache.rb +99 -0
  109. data/lib/ramaze/cache/sequel.rb +67 -0
  110. data/lib/ramaze/contrib/app_graph.rb +64 -0
  111. data/lib/ramaze/contrib/email.rb +2 -0
  112. data/lib/ramaze/contrib/gettext/po.rb +23 -23
  113. data/lib/ramaze/contrib/gzip_filter.rb +1 -69
  114. data/lib/ramaze/contrib/rest.rb +20 -15
  115. data/lib/ramaze/contrib/sequel/create_join.rb +1 -0
  116. data/lib/ramaze/contrib/sequel/form_field.rb +4 -4
  117. data/lib/ramaze/contrib/sequel/image.rb +9 -11
  118. data/lib/ramaze/contrib/sequel/relation.rb +21 -5
  119. data/lib/ramaze/controller.rb +63 -257
  120. data/lib/ramaze/controller/default.rb +12 -0
  121. data/lib/ramaze/current.rb +3 -47
  122. data/lib/ramaze/files.rb +24 -0
  123. data/lib/ramaze/gestalt.rb +6 -1
  124. data/lib/ramaze/helper.rb +6 -81
  125. data/lib/ramaze/helper/auth.rb +68 -104
  126. data/lib/ramaze/helper/bench.rb +0 -2
  127. data/lib/ramaze/helper/cache.rb +71 -120
  128. data/lib/ramaze/helper/disqus.rb +26 -0
  129. data/lib/ramaze/helper/flash.rb +32 -44
  130. data/lib/ramaze/helper/form.rb +83 -252
  131. data/lib/ramaze/helper/formatting.rb +32 -5
  132. data/lib/ramaze/helper/gestalt.rb +1 -1
  133. data/lib/ramaze/helper/gravatar.rb +66 -19
  134. data/lib/ramaze/helper/httpdigest.rb +66 -62
  135. data/lib/ramaze/helper/link.rb +62 -109
  136. data/lib/ramaze/helper/localize.rb +138 -0
  137. data/lib/ramaze/helper/markaby.rb +1 -1
  138. data/lib/ramaze/helper/maruku.rb +10 -3
  139. data/lib/ramaze/helper/pager.rb +2 -1
  140. data/lib/ramaze/helper/paginate.rb +17 -9
  141. data/lib/ramaze/helper/partial.rb +86 -91
  142. data/lib/ramaze/helper/remarkably.rb +14 -0
  143. data/lib/ramaze/helper/request_accessor.rb +16 -0
  144. data/lib/ramaze/helper/sequel_form.rb +284 -0
  145. data/lib/ramaze/helper/simple_captcha.rb +46 -16
  146. data/lib/ramaze/helper/stack.rb +64 -66
  147. data/lib/ramaze/helper/user.rb +141 -22
  148. data/lib/ramaze/helper/xhtml.rb +27 -16
  149. data/lib/ramaze/log.rb +19 -7
  150. data/lib/ramaze/log/analogger.rb +1 -2
  151. data/lib/ramaze/log/informer.rb +1 -0
  152. data/lib/ramaze/log/logging.rb +2 -8
  153. data/lib/ramaze/log/syslog.rb +36 -36
  154. data/lib/ramaze/middleware_compiler.rb +13 -0
  155. data/lib/ramaze/plugin.rb +69 -0
  156. data/lib/ramaze/reloader.rb +8 -6
  157. data/lib/ramaze/request.rb +118 -0
  158. data/lib/ramaze/{current/response.rb → response.rb} +9 -10
  159. data/lib/ramaze/setup.rb +93 -33
  160. data/lib/ramaze/snippets/ramaze/deprecated.rb +3 -1
  161. data/lib/ramaze/snippets/{dictionary.rb → ramaze/dictionary.rb} +0 -104
  162. data/lib/ramaze/snippets/ramaze/fiber.rb +5 -5
  163. data/lib/ramaze/spec.rb +34 -1
  164. data/lib/ramaze/spec/helper/bacon.rb +4 -3
  165. data/lib/ramaze/spec/helper/snippets.rb +3 -1
  166. data/lib/ramaze/spec/helper/template_examples.rb +29 -0
  167. data/lib/ramaze/tool/create.rb +1 -1
  168. data/lib/ramaze/version.rb +1 -4
  169. data/lib/ramaze/view.rb +48 -0
  170. data/lib/ramaze/view/erubis.rb +23 -0
  171. data/lib/ramaze/view/ezamar.rb +23 -0
  172. data/lib/ramaze/view/haml.rb +16 -0
  173. data/lib/ramaze/view/liquid.rb +100 -0
  174. data/lib/ramaze/view/maruku.rb +14 -0
  175. data/lib/ramaze/view/nagoro.rb +44 -0
  176. data/lib/ramaze/view/nagoro/render_partial.rb +32 -0
  177. data/lib/ramaze/view/redcloth.rb +21 -0
  178. data/lib/ramaze/view/remarkably.rb +21 -0
  179. data/lib/ramaze/view/sass.rb +21 -0
  180. data/lib/ramaze/view/tagz.rb +63 -0
  181. data/lib/ramaze/view/tenjin.rb +29 -0
  182. data/lib/vendor/etag.rb +20 -0
  183. data/lib/vendor/route_exceptions.rb +48 -0
  184. data/ramaze.gemspec +44 -0
  185. data/spec/contrib/rest.rb +28 -0
  186. data/spec/examples/caching.rb +1 -2
  187. data/spec/examples/css.rb +1 -2
  188. data/spec/examples/element.rb +1 -2
  189. data/spec/examples/hello.rb +2 -3
  190. data/spec/examples/helpers/httpdigest.rb +64 -0
  191. data/spec/examples/linking.rb +1 -2
  192. data/spec/examples/simple.rb +1 -6
  193. data/spec/examples/templates/template_erubis.rb +3 -17
  194. data/spec/examples/templates/template_ezamar.rb +3 -18
  195. data/spec/examples/templates/template_haml.rb +3 -17
  196. data/spec/examples/templates/template_liquid.rb +3 -23
  197. data/spec/examples/templates/template_markaby.rb +6 -19
  198. data/spec/examples/templates/template_nagoro.rb +9 -0
  199. data/spec/examples/templates/template_redcloth.rb +3 -22
  200. data/spec/examples/templates/template_remarkably.rb +3 -17
  201. data/spec/examples/templates/template_tenjin.rb +3 -22
  202. data/spec/helper.rb +10 -3
  203. data/spec/ramaze/action/render.rb +5 -15
  204. data/spec/ramaze/action/view/other_wrapper.erb +1 -0
  205. data/spec/ramaze/action/view/sub/sub_wrapper.erb +1 -0
  206. data/spec/ramaze/app.rb +47 -0
  207. data/spec/ramaze/cache/localmemcache.rb +49 -0
  208. data/spec/ramaze/cache/memcache.rb +54 -0
  209. data/spec/ramaze/cache/sequel.rb +51 -0
  210. data/spec/ramaze/controller/actionless_templates.rb +14 -10
  211. data/spec/ramaze/controller/mapping.rb +57 -0
  212. data/spec/ramaze/controller/provide_inheritance.rb +47 -0
  213. data/spec/ramaze/controller/resolve.rb +7 -9
  214. data/spec/ramaze/controller/subclass.rb +13 -13
  215. data/spec/ramaze/controller/template_resolving.rb +21 -57
  216. data/spec/ramaze/dispatcher/directory.rb +38 -24
  217. data/spec/ramaze/dispatcher/file.rb +55 -44
  218. data/spec/ramaze/error.rb +56 -62
  219. data/spec/ramaze/files.rb +29 -0
  220. data/spec/ramaze/files/public_1/plain.txt +1 -0
  221. data/spec/ramaze/files/public_2/rich.txt +1 -0
  222. data/spec/ramaze/gestalt.rb +2 -4
  223. data/spec/ramaze/helper/auth.rb +41 -24
  224. data/spec/ramaze/helper/bench.rb +17 -0
  225. data/spec/ramaze/helper/cache.rb +65 -101
  226. data/spec/ramaze/helper/flash.rb +20 -112
  227. data/spec/ramaze/helper/form.rb +336 -98
  228. data/spec/ramaze/helper/formatting.rb +66 -9
  229. data/spec/ramaze/helper/gestalt.rb +15 -0
  230. data/spec/ramaze/helper/gravatar.rb +40 -0
  231. data/spec/ramaze/helper/httpdigest.rb +144 -0
  232. data/spec/ramaze/helper/link.rb +25 -100
  233. data/spec/ramaze/helper/localize.rb +60 -0
  234. data/spec/ramaze/helper/maruku.rb +19 -0
  235. data/spec/ramaze/helper/pager.rb +13 -16
  236. data/spec/ramaze/helper/paginate.rb +68 -0
  237. data/spec/ramaze/helper/request_accessor.rb +19 -0
  238. data/spec/ramaze/helper/sequel_form.rb +89 -0
  239. data/spec/ramaze/helper/simple_captcha.rb +35 -12
  240. data/spec/ramaze/helper/stack.rb +52 -39
  241. data/spec/ramaze/helper/user.rb +39 -10
  242. data/spec/ramaze/helper/xhtml.rb +32 -0
  243. data/spec/ramaze/log/informer.rb +20 -19
  244. data/spec/ramaze/log/logging.rb +63 -0
  245. data/spec/ramaze/log/syslog.rb +59 -62
  246. data/spec/ramaze/params.rb +8 -11
  247. data/spec/ramaze/request.rb +57 -181
  248. data/spec/ramaze/view.rb +36 -0
  249. data/spec/ramaze/view/erubis.rb +73 -0
  250. data/spec/ramaze/view/erubis/external.rhtml +8 -0
  251. data/spec/ramaze/view/erubis/sum.rhtml +1 -0
  252. data/spec/ramaze/view/ezamar.rb +73 -0
  253. data/spec/ramaze/view/ezamar/external.zmr +8 -0
  254. data/spec/ramaze/view/ezamar/sum.zmr +1 -0
  255. data/spec/ramaze/view/haml.rb +86 -0
  256. data/spec/ramaze/view/haml/external.haml +5 -0
  257. data/spec/ramaze/view/haml/sum.haml +2 -0
  258. data/spec/ramaze/view/liquid.rb +73 -0
  259. data/spec/ramaze/view/liquid/external.liquid +8 -0
  260. data/spec/ramaze/view/liquid/sum.liquid +1 -0
  261. data/spec/ramaze/view/nagoro.rb +73 -0
  262. data/spec/ramaze/view/nagoro/external.nag +8 -0
  263. data/spec/ramaze/view/nagoro/sum.nag +1 -0
  264. data/spec/ramaze/view/redcloth.rb +66 -0
  265. data/spec/ramaze/view/redcloth/external.redcloth +8 -0
  266. data/spec/ramaze/view/remarkably.rb +49 -0
  267. data/spec/ramaze/{template → view}/remarkably/external.rem +0 -0
  268. data/spec/ramaze/{template → view}/remarkably/sum.rem +0 -0
  269. data/spec/ramaze/view/sass.rb +73 -0
  270. data/spec/ramaze/{template → view}/sass/file.css.sass +0 -0
  271. data/spec/ramaze/{template → view}/tagz.rb +18 -29
  272. data/spec/ramaze/{template → view}/tagz/external.tagz +0 -0
  273. data/spec/ramaze/{template → view}/tagz/sum.tagz +0 -0
  274. data/spec/ramaze/view/tenjin.rb +57 -0
  275. data/spec/ramaze/view/tenjin/external.rbhtml +8 -0
  276. data/spec/ramaze/view/tenjin/sum.rbhtml +1 -0
  277. data/spec/snippets/ramaze/dictionary.rb +110 -0
  278. data/spec/snippets/ramaze/struct.rb +12 -0
  279. data/spec/snippets/thread/into.rb +3 -14
  280. data/tasks/authors.rake +30 -0
  281. data/tasks/bacon.rake +66 -0
  282. data/tasks/changelog.rake +18 -0
  283. data/tasks/copyright.rake +21 -0
  284. data/tasks/gem.rake +22 -0
  285. data/tasks/gem_installer.rake +76 -0
  286. data/{rake_tasks → tasks}/git.rake +10 -5
  287. data/tasks/grancher.rake +12 -0
  288. data/tasks/install_dependencies.rake +6 -0
  289. data/tasks/jquery.rake +15 -0
  290. data/tasks/manifest.rake +4 -0
  291. data/{rake_tasks/metric.rake → tasks/metric_changes.rake} +7 -7
  292. data/tasks/rcov.rake +23 -0
  293. data/tasks/release.rake +51 -0
  294. data/tasks/reversion.rake +8 -0
  295. data/tasks/setup.rake +24 -0
  296. data/tasks/todo.rake +29 -0
  297. data/tasks/traits.rake +21 -0
  298. data/tasks/yard.rake +4 -0
  299. metadata +191 -452
  300. data/benchmark/suite/template_amrita2.rb +0 -17
  301. data/doc/readme_chunks/appendix.txt +0 -10
  302. data/doc/readme_chunks/examples.txt +0 -38
  303. data/doc/readme_chunks/features.txt +0 -148
  304. data/doc/readme_chunks/getting_help.txt +0 -5
  305. data/doc/readme_chunks/getting_started.txt +0 -18
  306. data/doc/readme_chunks/installing.txt +0 -92
  307. data/doc/readme_chunks/introduction.txt +0 -18
  308. data/doc/readme_chunks/principles.txt +0 -56
  309. data/doc/readme_chunks/thanks.txt +0 -59
  310. data/examples/app/auth/auth.rb +0 -54
  311. data/examples/app/auth/template/layout.haml +0 -20
  312. data/examples/app/auth/template/login.haml +0 -16
  313. data/examples/app/blog/public/styles/blog.css +0 -132
  314. data/examples/app/blog/view/edit.xhtml +0 -17
  315. data/examples/app/blog/view/index.xhtml +0 -17
  316. data/examples/app/blog/view/layout.xhtml +0 -11
  317. data/examples/app/blog/view/new.xhtml +0 -16
  318. data/examples/app/rapaste/Rakefile +0 -34
  319. data/examples/app/rapaste/controller/paste.rb +0 -101
  320. data/examples/app/rapaste/model/paste.rb +0 -58
  321. data/examples/app/rapaste/public/css/active4d.css +0 -114
  322. data/examples/app/rapaste/public/css/all_hallows_eve.css +0 -72
  323. data/examples/app/rapaste/public/css/amy.css +0 -147
  324. data/examples/app/rapaste/public/css/blackboard.css +0 -88
  325. data/examples/app/rapaste/public/css/brilliance_black.css +0 -605
  326. data/examples/app/rapaste/public/css/brilliance_dull.css +0 -599
  327. data/examples/app/rapaste/public/css/cobalt.css +0 -149
  328. data/examples/app/rapaste/public/css/dawn.css +0 -121
  329. data/examples/app/rapaste/public/css/display.css +0 -197
  330. data/examples/app/rapaste/public/css/eiffel.css +0 -121
  331. data/examples/app/rapaste/public/css/espresso_libre.css +0 -109
  332. data/examples/app/rapaste/public/css/idle.css +0 -62
  333. data/examples/app/rapaste/public/css/iplastic.css +0 -80
  334. data/examples/app/rapaste/public/css/lazy.css +0 -73
  335. data/examples/app/rapaste/public/css/mac_classic.css +0 -123
  336. data/examples/app/rapaste/public/css/magicwb_amiga.css +0 -104
  337. data/examples/app/rapaste/public/css/pastels_on_dark.css +0 -188
  338. data/examples/app/rapaste/public/css/slush_poppies.css +0 -85
  339. data/examples/app/rapaste/public/css/spacecadet.css +0 -51
  340. data/examples/app/rapaste/public/css/sunburst.css +0 -180
  341. data/examples/app/rapaste/public/css/twilight.css +0 -137
  342. data/examples/app/rapaste/public/css/zenburnesque.css +0 -91
  343. data/examples/app/rapaste/public/js/jquery.js +0 -11
  344. data/examples/app/rapaste/spec/rapaste.rb +0 -51
  345. data/examples/app/rapaste/start.rb +0 -25
  346. data/examples/app/rapaste/view/copy.xhtml +0 -10
  347. data/examples/app/rapaste/view/index.xhtml +0 -9
  348. data/examples/app/rapaste/view/layout.xhtml +0 -25
  349. data/examples/app/rapaste/view/list.xhtml +0 -29
  350. data/examples/app/rapaste/view/search.xhtml +0 -41
  351. data/examples/app/rapaste/view/view.xhtml +0 -40
  352. data/examples/app/todolist/README +0 -1
  353. data/examples/app/todolist/public/js/jquery.js +0 -1923
  354. data/examples/app/todolist/public/ramaze.png +0 -0
  355. data/examples/app/todolist/spec/todolist.rb +0 -132
  356. data/examples/app/todolist/src/controller/main.rb +0 -70
  357. data/examples/app/todolist/src/element/page.rb +0 -31
  358. data/examples/app/todolist/src/model.rb +0 -14
  359. data/examples/app/todolist/template/index.xhtml +0 -17
  360. data/examples/app/todolist/template/new.xhtml +0 -7
  361. data/examples/helpers/provide.rb +0 -23
  362. data/examples/misc/simple_auth.rb +0 -35
  363. data/examples/templates/template/external.amrita +0 -19
  364. data/examples/templates/template/external.xsl +0 -57
  365. data/examples/templates/template_amrita2.rb +0 -74
  366. data/examples/templates/template_xslt.rb +0 -49
  367. data/lib/proto/public/css/ramaze_error.css +0 -90
  368. data/lib/proto/view/error.xhtml +0 -64
  369. data/lib/ramaze/action.rb +0 -159
  370. data/lib/ramaze/action/render.rb +0 -192
  371. data/lib/ramaze/adapter.rb +0 -97
  372. data/lib/ramaze/adapter/base.rb +0 -128
  373. data/lib/ramaze/adapter/cgi.rb +0 -20
  374. data/lib/ramaze/adapter/ebb.rb +0 -18
  375. data/lib/ramaze/adapter/evented_mongrel.rb +0 -7
  376. data/lib/ramaze/adapter/fake.rb +0 -12
  377. data/lib/ramaze/adapter/fcgi.rb +0 -18
  378. data/lib/ramaze/adapter/lsws.rb +0 -19
  379. data/lib/ramaze/adapter/mongrel.rb +0 -21
  380. data/lib/ramaze/adapter/scgi.rb +0 -18
  381. data/lib/ramaze/adapter/swiftiplied_mongrel.rb +0 -7
  382. data/lib/ramaze/adapter/thin.rb +0 -17
  383. data/lib/ramaze/adapter/webrick.rb +0 -43
  384. data/lib/ramaze/cache/file.rb +0 -71
  385. data/lib/ramaze/cache/memcached.rb +0 -69
  386. data/lib/ramaze/cache/memory.rb +0 -6
  387. data/lib/ramaze/cache/yaml_store.rb +0 -68
  388. data/lib/ramaze/contrib.rb +0 -82
  389. data/lib/ramaze/contrib/file_cache.rb +0 -3
  390. data/lib/ramaze/contrib/gems.rb +0 -82
  391. data/lib/ramaze/contrib/sequel/fill.rb +0 -12
  392. data/lib/ramaze/contrib/sequel_cache.rb +0 -92
  393. data/lib/ramaze/controller/error.rb +0 -46
  394. data/lib/ramaze/controller/main.rb +0 -2
  395. data/lib/ramaze/controller/resolve.rb +0 -278
  396. data/lib/ramaze/current/request.rb +0 -231
  397. data/lib/ramaze/current/session.rb +0 -179
  398. data/lib/ramaze/current/session/flash.rb +0 -88
  399. data/lib/ramaze/current/session/hash.rb +0 -62
  400. data/lib/ramaze/dispatcher.rb +0 -145
  401. data/lib/ramaze/dispatcher/action.rb +0 -50
  402. data/lib/ramaze/dispatcher/directory.rb +0 -119
  403. data/lib/ramaze/dispatcher/error.rb +0 -108
  404. data/lib/ramaze/dispatcher/file.rb +0 -100
  405. data/lib/ramaze/error.rb +0 -24
  406. data/lib/ramaze/helper/aspect.rb +0 -106
  407. data/lib/ramaze/helper/cgi.rb +0 -39
  408. data/lib/ramaze/helper/redirect.rb +0 -100
  409. data/lib/ramaze/helper/rest.rb +0 -43
  410. data/lib/ramaze/helper/sendfile.rb +0 -16
  411. data/lib/ramaze/option.rb +0 -156
  412. data/lib/ramaze/option/dsl.rb +0 -45
  413. data/lib/ramaze/option/holder.rb +0 -131
  414. data/lib/ramaze/option/merger.rb +0 -108
  415. data/lib/ramaze/route.rb +0 -97
  416. data/lib/ramaze/snippets/object/traits.rb +0 -76
  417. data/lib/ramaze/snippets/ramaze/caller_info.rb +0 -30
  418. data/lib/ramaze/snippets/ramaze/caller_lines.rb +0 -51
  419. data/lib/ramaze/snippets/ramaze/state.rb +0 -86
  420. data/lib/ramaze/snippets/string/each.rb +0 -19
  421. data/lib/ramaze/spec/helper.rb +0 -135
  422. data/lib/ramaze/spec/helper/browser.rb +0 -88
  423. data/lib/ramaze/spec/helper/mock_http.rb +0 -64
  424. data/lib/ramaze/spec/helper/requester.rb +0 -63
  425. data/lib/ramaze/spec/helper/simple_http.rb +0 -434
  426. data/lib/ramaze/store/default.rb +0 -109
  427. data/lib/ramaze/template.rb +0 -87
  428. data/lib/ramaze/template/amrita2.rb +0 -49
  429. data/lib/ramaze/template/builder.rb +0 -28
  430. data/lib/ramaze/template/erubis.rb +0 -41
  431. data/lib/ramaze/template/ezamar.rb +0 -42
  432. data/lib/ramaze/template/ezamar/element.rb +0 -169
  433. data/lib/ramaze/template/ezamar/engine.rb +0 -76
  434. data/lib/ramaze/template/ezamar/morpher.rb +0 -135
  435. data/lib/ramaze/template/ezamar/render_partial.rb +0 -39
  436. data/lib/ramaze/template/ezamar/textpow.syntax +0 -34
  437. data/lib/ramaze/template/haml.rb +0 -37
  438. data/lib/ramaze/template/liquid.rb +0 -36
  439. data/lib/ramaze/template/markaby.rb +0 -52
  440. data/lib/ramaze/template/maruku.rb +0 -34
  441. data/lib/ramaze/template/nagoro.rb +0 -52
  442. data/lib/ramaze/template/none.rb +0 -14
  443. data/lib/ramaze/template/redcloth.rb +0 -25
  444. data/lib/ramaze/template/remarkably.rb +0 -38
  445. data/lib/ramaze/template/sass.rb +0 -38
  446. data/lib/ramaze/template/tagz.rb +0 -79
  447. data/lib/ramaze/template/tenjin.rb +0 -74
  448. data/lib/ramaze/template/xslt.rb +0 -100
  449. data/lib/ramaze/tool.rb +0 -9
  450. data/lib/ramaze/tool/daemonize.rb +0 -37
  451. data/lib/ramaze/tool/localize.rb +0 -202
  452. data/lib/ramaze/tool/mime.rb +0 -35
  453. data/lib/ramaze/tool/mime_types.yaml +0 -615
  454. data/lib/ramaze/tool/record.rb +0 -6
  455. data/lib/ramaze/trinity.rb +0 -16
  456. data/lib/vendor/bacon.rb +0 -323
  457. data/rake_tasks/conf.rake +0 -71
  458. data/rake_tasks/coverage.rake +0 -45
  459. data/rake_tasks/gem.rake +0 -74
  460. data/rake_tasks/maintenance.rake +0 -386
  461. data/rake_tasks/release.rake +0 -76
  462. data/rake_tasks/spec.rake +0 -61
  463. data/spec/contrib/profiling.rb +0 -29
  464. data/spec/contrib/sequel/fill.rb +0 -47
  465. data/spec/examples/simple_auth.rb +0 -32
  466. data/spec/examples/templates/template_amrita2.rb +0 -16
  467. data/spec/ramaze/action/basics.rb +0 -36
  468. data/spec/ramaze/action/cache.rb +0 -87
  469. data/spec/ramaze/action/file_cache.rb +0 -70
  470. data/spec/ramaze/action/layout.rb +0 -190
  471. data/spec/ramaze/adapter.rb +0 -49
  472. data/spec/ramaze/adapter/ebb.rb +0 -12
  473. data/spec/ramaze/adapter/mongrel.rb +0 -12
  474. data/spec/ramaze/adapter/record.rb +0 -31
  475. data/spec/ramaze/adapter/webrick.rb +0 -12
  476. data/spec/ramaze/cache.rb +0 -140
  477. data/spec/ramaze/controller.rb +0 -180
  478. data/spec/ramaze/current/request.rb +0 -30
  479. data/spec/ramaze/current/session.rb +0 -97
  480. data/spec/ramaze/dispatcher.rb +0 -31
  481. data/spec/ramaze/element.rb +0 -107
  482. data/spec/ramaze/helper/aspect.rb +0 -101
  483. data/spec/ramaze/helper/cgi.rb +0 -43
  484. data/spec/ramaze/helper/file.rb +0 -18
  485. data/spec/ramaze/helper/partial.rb +0 -88
  486. data/spec/ramaze/helper/redirect.rb +0 -112
  487. data/spec/ramaze/localize.rb +0 -89
  488. data/spec/ramaze/morpher.rb +0 -111
  489. data/spec/ramaze/public/error404.xhtml +0 -1
  490. data/spec/ramaze/request/ebb.rb +0 -9
  491. data/spec/ramaze/request/mongrel.rb +0 -9
  492. data/spec/ramaze/request/thin.rb +0 -9
  493. data/spec/ramaze/request/webrick.rb +0 -5
  494. data/spec/ramaze/rewrite.rb +0 -36
  495. data/spec/ramaze/route.rb +0 -131
  496. data/spec/ramaze/session.rb +0 -94
  497. data/spec/ramaze/store/default.rb +0 -71
  498. data/spec/ramaze/template.rb +0 -128
  499. data/spec/ramaze/template/amrita2.rb +0 -50
  500. data/spec/ramaze/template/amrita2/external.amrita +0 -6
  501. data/spec/ramaze/template/amrita2/sum.amrita +0 -1
  502. data/spec/ramaze/template/builder.rb +0 -51
  503. data/spec/ramaze/template/builder/external.rxml +0 -3
  504. data/spec/ramaze/template/erubis.rb +0 -41
  505. data/spec/ramaze/template/erubis/sum.rhtml +0 -1
  506. data/spec/ramaze/template/ezamar.rb +0 -63
  507. data/spec/ramaze/template/ezamar/another/long/action.zmr +0 -1
  508. data/spec/ramaze/template/ezamar/combined.zmr +0 -1
  509. data/spec/ramaze/template/ezamar/file_only.zmr +0 -1
  510. data/spec/ramaze/template/ezamar/index.zmr +0 -1
  511. data/spec/ramaze/template/ezamar/nested.zmr +0 -1
  512. data/spec/ramaze/template/ezamar/other__index.xhtml +0 -1
  513. data/spec/ramaze/template/ezamar/some__long__action.zmr +0 -1
  514. data/spec/ramaze/template/ezamar/sum.zmr +0 -1
  515. data/spec/ramaze/template/haml.rb +0 -66
  516. data/spec/ramaze/template/haml/index.haml +0 -5
  517. data/spec/ramaze/template/haml/locals.haml +0 -2
  518. data/spec/ramaze/template/haml/with_vars.haml +0 -4
  519. data/spec/ramaze/template/liquid.rb +0 -99
  520. data/spec/ramaze/template/liquid/index.liquid +0 -1
  521. data/spec/ramaze/template/liquid/products.liquid +0 -45
  522. data/spec/ramaze/template/markaby.rb +0 -61
  523. data/spec/ramaze/template/markaby/external.mab +0 -8
  524. data/spec/ramaze/template/markaby/sum.mab +0 -1
  525. data/spec/ramaze/template/nagoro.rb +0 -64
  526. data/spec/ramaze/template/nagoro/another/long/action.nag +0 -1
  527. data/spec/ramaze/template/nagoro/combined.nag +0 -1
  528. data/spec/ramaze/template/nagoro/file_only.nag +0 -1
  529. data/spec/ramaze/template/nagoro/index.nag +0 -1
  530. data/spec/ramaze/template/nagoro/nested.nag +0 -1
  531. data/spec/ramaze/template/nagoro/some__long__action.nag +0 -1
  532. data/spec/ramaze/template/nagoro/sum.nag +0 -1
  533. data/spec/ramaze/template/redcloth.rb +0 -38
  534. data/spec/ramaze/template/redcloth/external.redcloth +0 -1
  535. data/spec/ramaze/template/remarkably.rb +0 -58
  536. data/spec/ramaze/template/sass.rb +0 -70
  537. data/spec/ramaze/template/tenjin.rb +0 -47
  538. data/spec/ramaze/template/tenjin/external.tenjin +0 -1
  539. data/spec/ramaze/template/xslt.rb +0 -90
  540. data/spec/ramaze/template/xslt/concat_words.xsl +0 -16
  541. data/spec/ramaze/template/xslt/index.xsl +0 -14
  542. data/spec/ramaze/template/xslt/products.xsl +0 -32
  543. data/spec/ramaze/template/xslt/ruby_version.xsl +0 -14
  544. data/spec/snippets/ramaze/caller_info.rb +0 -39
  545. data/spec/snippets/ramaze/caller_lines.rb +0 -30
@@ -1,11 +0,0 @@
1
- /*
2
- * jQuery 1.2.1 - New Wave Javascript
3
- *
4
- * Copyright (c) 2007 John Resig (jquery.com)
5
- * Dual licensed under the MIT (MIT-LICENSE.txt)
6
- * and GPL (GPL-LICENSE.txt) licenses.
7
- *
8
- * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
9
- * $Rev: 3353 $
10
- */
11
- eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(G(){9(1m E!="W")H w=E;H E=18.15=G(a,b){I 6 7u E?6.5N(a,b):1u E(a,b)};9(1m $!="W")H D=$;18.$=E;H u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;E.1b=E.3A={5N:G(c,a){c=c||U;9(1m c=="1M"){H m=u.2S(c);9(m&&(m[1]||!a)){9(m[1])c=E.4D([m[1]],a);J{H b=U.3S(m[3]);9(b)9(b.22!=m[3])I E().1Y(c);J{6[0]=b;6.K=1;I 6}J c=[]}}J I 1u E(a).1Y(c)}J 9(E.1n(c))I 1u E(U)[E.1b.2d?"2d":"39"](c);I 6.6v(c.1c==1B&&c||(c.4c||c.K&&c!=18&&!c.1y&&c[0]!=W&&c[0].1y)&&E.2h(c)||[c])},4c:"1.2.1",7Y:G(){I 6.K},K:0,21:G(a){I a==W?E.2h(6):6[a]},2o:G(a){H b=E(a);b.4Y=6;I b},6v:G(a){6.K=0;1B.3A.1a.16(6,a);I 6},N:G(a,b){I E.N(6,a,b)},4I:G(a){H b=-1;6.N(G(i){9(6==a)b=i});I b},1x:G(f,d,e){H c=f;9(f.1c==3X)9(d==W)I 6.K&&E[e||"1x"](6[0],f)||W;J{c={};c[f]=d}I 6.N(G(a){L(H b 1i c)E.1x(e?6.R:6,b,E.1e(6,c[b],e,a,b))})},17:G(b,a){I 6.1x(b,a,"3C")},2g:G(e){9(1m e!="5i"&&e!=S)I 6.4n().3g(U.6F(e));H t="";E.N(e||6,G(){E.N(6.3j,G(){9(6.1y!=8)t+=6.1y!=1?6.6x:E.1b.2g([6])})});I t},5m:G(b){9(6[0])E(b,6[0].3H).6u().3d(6[0]).1X(G(){H a=6;1W(a.1w)a=a.1w;I a}).3g(6);I 6},8m:G(a){I 6.N(G(){E(6).6q().5m(a)})},8d:G(a){I 6.N(G(){E(6).5m(a)})},3g:G(){I 6.3z(1q,Q,1,G(a){6.58(a)})},6j:G(){I 6.3z(1q,Q,-1,G(a){6.3d(a,6.1w)})},6g:G(){I 6.3z(1q,P,1,G(a){6.12.3d(a,6)})},50:G(){I 6.3z(1q,P,-1,G(a){6.12.3d(a,6.2q)})},2D:G(){I 6.4Y||E([])},1Y:G(t){H b=E.1X(6,G(a){I E.1Y(t,a)});I 6.2o(/[^+>] [^+>]/.14(t)||t.1g("..")>-1?E.4V(b):b)},6u:G(e){H f=6.1X(G(){I 6.67?E(6.67)[0]:6.4R(Q)});H d=f.1Y("*").4O().N(G(){9(6[F]!=W)6[F]=S});9(e===Q)6.1Y("*").4O().N(G(i){H c=E.M(6,"2P");L(H a 1i c)L(H b 1i c[a])E.1j.1f(d[i],a,c[a][b],c[a][b].M)});I f},1E:G(t){I 6.2o(E.1n(t)&&E.2W(6,G(b,a){I t.16(b,[a])})||E.3m(t,6))},5V:G(t){I 6.2o(t.1c==3X&&E.3m(t,6,Q)||E.2W(6,G(a){I(t.1c==1B||t.4c)?E.2A(a,t)<0:a!=t}))},1f:G(t){I 6.2o(E.1R(6.21(),t.1c==3X?E(t).21():t.K!=W&&(!t.11||E.11(t,"2Y"))?t:[t]))},3t:G(a){I a?E.3m(a,6).K>0:P},7c:G(a){I 6.3t("."+a)},3i:G(b){9(b==W){9(6.K){H c=6[0];9(E.11(c,"24")){H e=c.4Z,a=[],Y=c.Y,2G=c.O=="24-2G";9(e<0)I S;L(H i=2G?e:0,33=2G?e+1:Y.K;i<33;i++){H d=Y[i];9(d.26){H b=E.V.1h&&!d.9V["1Q"].9L?d.2g:d.1Q;9(2G)I b;a.1a(b)}}I a}J I 6[0].1Q.1p(/\\r/g,"")}}J I 6.N(G(){9(b.1c==1B&&/4k|5j/.14(6.O))6.2Q=(E.2A(6.1Q,b)>=0||E.2A(6.2H,b)>=0);J 9(E.11(6,"24")){H a=b.1c==1B?b:[b];E("9h",6).N(G(){6.26=(E.2A(6.1Q,a)>=0||E.2A(6.2g,a)>=0)});9(!a.K)6.4Z=-1}J 6.1Q=b})},4o:G(a){I a==W?(6.K?6[0].3O:S):6.4n().3g(a)},6H:G(a){I 6.50(a).28()},6E:G(i){I 6.2J(i,i+1)},2J:G(){I 6.2o(1B.3A.2J.16(6,1q))},1X:G(b){I 6.2o(E.1X(6,G(a,i){I b.2O(a,i,a)}))},4O:G(){I 6.1f(6.4Y)},3z:G(f,d,g,e){H c=6.K>1,a;I 6.N(G(){9(!a){a=E.4D(f,6.3H);9(g<0)a.8U()}H b=6;9(d&&E.11(6,"1I")&&E.11(a[0],"4m"))b=6.4l("1K")[0]||6.58(U.5B("1K"));E.N(a,G(){H a=c?6.4R(Q):6;9(!5A(0,a))e.2O(b,a)})})}};G 5A(i,b){H a=E.11(b,"1J");9(a){9(b.3k)E.3G({1d:b.3k,3e:P,1V:"1J"});J E.5f(b.2g||b.6s||b.3O||"");9(b.12)b.12.3b(b)}J 9(b.1y==1)E("1J",b).N(5A);I a}E.1k=E.1b.1k=G(){H c=1q[0]||{},a=1,2c=1q.K,5e=P;9(c.1c==8o){5e=c;c=1q[1]||{}}9(2c==1){c=6;a=0}H b;L(;a<2c;a++)9((b=1q[a])!=S)L(H i 1i b){9(c==b[i])6r;9(5e&&1m b[i]==\'5i\'&&c[i])E.1k(c[i],b[i]);J 9(b[i]!=W)c[i]=b[i]}I c};H F="15"+(1u 3D()).3B(),6p=0,5c={};E.1k({8a:G(a){18.$=D;9(a)18.15=w;I E},1n:G(a){I!!a&&1m a!="1M"&&!a.11&&a.1c!=1B&&/G/i.14(a+"")},4a:G(a){I a.2V&&!a.1G||a.37&&a.3H&&!a.3H.1G},5f:G(a){a=E.36(a);9(a){9(18.6l)18.6l(a);J 9(E.V.1N)18.56(a,0);J 3w.2O(18,a)}},11:G(b,a){I b.11&&b.11.27()==a.27()},1L:{},M:G(c,d,b){c=c==18?5c:c;H a=c[F];9(!a)a=c[F]=++6p;9(d&&!E.1L[a])E.1L[a]={};9(b!=W)E.1L[a][d]=b;I d?E.1L[a][d]:a},30:G(c,b){c=c==18?5c:c;H a=c[F];9(b){9(E.1L[a]){2E E.1L[a][b];b="";L(b 1i E.1L[a])1T;9(!b)E.30(c)}}J{2a{2E c[F]}29(e){9(c.53)c.53(F)}2E E.1L[a]}},N:G(a,b,c){9(c){9(a.K==W)L(H i 1i a)b.16(a[i],c);J L(H i=0,48=a.K;i<48;i++)9(b.16(a[i],c)===P)1T}J{9(a.K==W)L(H i 1i a)b.2O(a[i],i,a[i]);J L(H i=0,48=a.K,3i=a[0];i<48&&b.2O(3i,i,3i)!==P;3i=a[++i]){}}I a},1e:G(c,b,d,e,a){9(E.1n(b))b=b.2O(c,[e]);H f=/z-?4I|7T-?7Q|1r|69|7P-?1H/i;I b&&b.1c==4W&&d=="3C"&&!f.14(a)?b+"2T":b},1o:{1f:G(b,c){E.N((c||"").2l(/\\s+/),G(i,a){9(!E.1o.3K(b.1o,a))b.1o+=(b.1o?" ":"")+a})},28:G(b,c){b.1o=c!=W?E.2W(b.1o.2l(/\\s+/),G(a){I!E.1o.3K(c,a)}).66(" "):""},3K:G(t,c){I E.2A(c,(t.1o||t).3s().2l(/\\s+/))>-1}},2k:G(e,o,f){L(H i 1i o){e.R["3r"+i]=e.R[i];e.R[i]=o[i]}f.16(e,[]);L(H i 1i o)e.R[i]=e.R["3r"+i]},17:G(e,p){9(p=="1H"||p=="2N"){H b={},42,41,d=["7J","7I","7G","7F"];E.N(d,G(){b["7C"+6]=0;b["7B"+6+"5Z"]=0});E.2k(e,b,G(){9(E(e).3t(\':3R\')){42=e.7A;41=e.7w}J{e=E(e.4R(Q)).1Y(":4k").5W("2Q").2D().17({4C:"1P",2X:"4F",19:"2Z",7o:"0",1S:"0"}).5R(e.12)[0];H a=E.17(e.12,"2X")||"3V";9(a=="3V")e.12.R.2X="7g";42=e.7e;41=e.7b;9(a=="3V")e.12.R.2X="3V";e.12.3b(e)}});I p=="1H"?42:41}I E.3C(e,p)},3C:G(h,j,i){H g,2w=[],2k=[];G 3n(a){9(!E.V.1N)I P;H b=U.3o.3Z(a,S);I!b||b.4y("3n")==""}9(j=="1r"&&E.V.1h){g=E.1x(h.R,"1r");I g==""?"1":g}9(j.1t(/4u/i))j=y;9(!i&&h.R[j])g=h.R[j];J 9(U.3o&&U.3o.3Z){9(j.1t(/4u/i))j="4u";j=j.1p(/([A-Z])/g,"-$1").2p();H d=U.3o.3Z(h,S);9(d&&!3n(h))g=d.4y(j);J{L(H a=h;a&&3n(a);a=a.12)2w.4w(a);L(a=0;a<2w.K;a++)9(3n(2w[a])){2k[a]=2w[a].R.19;2w[a].R.19="2Z"}g=j=="19"&&2k[2w.K-1]!=S?"2s":U.3o.3Z(h,S).4y(j)||"";L(a=0;a<2k.K;a++)9(2k[a]!=S)2w[a].R.19=2k[a]}9(j=="1r"&&g=="")g="1"}J 9(h.3Q){H f=j.1p(/\\-(\\w)/g,G(m,c){I c.27()});g=h.3Q[j]||h.3Q[f];9(!/^\\d+(2T)?$/i.14(g)&&/^\\d/.14(g)){H k=h.R.1S;H e=h.4v.1S;h.4v.1S=h.3Q.1S;h.R.1S=g||0;g=h.R.71+"2T";h.R.1S=k;h.4v.1S=e}}I g},4D:G(a,e){H r=[];e=e||U;E.N(a,G(i,d){9(!d)I;9(d.1c==4W)d=d.3s();9(1m d=="1M"){d=d.1p(/(<(\\w+)[^>]*?)\\/>/g,G(m,a,b){I b.1t(/^(70|6Z|6Y|9Q|4t|9N|9K|3a|9G|9E)$/i)?m:a+"></"+b+">"});H s=E.36(d).2p(),1s=e.5B("1s"),2x=[];H c=!s.1g("<9y")&&[1,"<24>","</24>"]||!s.1g("<9w")&&[1,"<6T>","</6T>"]||s.1t(/^<(9u|1K|9t|9r|9p)/)&&[1,"<1I>","</1I>"]||!s.1g("<4m")&&[2,"<1I><1K>","</1K></1I>"]||(!s.1g("<9m")||!s.1g("<9k"))&&[3,"<1I><1K><4m>","</4m></1K></1I>"]||!s.1g("<6Y")&&[2,"<1I><1K></1K><6L>","</6L></1I>"]||E.V.1h&&[1,"1s<1s>","</1s>"]||[0,"",""];1s.3O=c[1]+d+c[2];1W(c[0]--)1s=1s.5p;9(E.V.1h){9(!s.1g("<1I")&&s.1g("<1K")<0)2x=1s.1w&&1s.1w.3j;J 9(c[1]=="<1I>"&&s.1g("<1K")<0)2x=1s.3j;L(H n=2x.K-1;n>=0;--n)9(E.11(2x[n],"1K")&&!2x[n].3j.K)2x[n].12.3b(2x[n]);9(/^\\s/.14(d))1s.3d(e.6F(d.1t(/^\\s*/)[0]),1s.1w)}d=E.2h(1s.3j)}9(0===d.K&&(!E.11(d,"2Y")&&!E.11(d,"24")))I;9(d[0]==W||E.11(d,"2Y")||d.Y)r.1a(d);J r=E.1R(r,d)});I r},1x:G(c,d,a){H e=E.4a(c)?{}:E.5o;9(d=="26"&&E.V.1N)c.12.4Z;9(e[d]){9(a!=W)c[e[d]]=a;I c[e[d]]}J 9(E.V.1h&&d=="R")I E.1x(c.R,"9e",a);J 9(a==W&&E.V.1h&&E.11(c,"2Y")&&(d=="9d"||d=="9a"))I c.97(d).6x;J 9(c.37){9(a!=W){9(d=="O"&&E.11(c,"4t")&&c.12)6G"O 94 93\'t 92 91";c.90(d,a)}9(E.V.1h&&/6C|3k/.14(d)&&!E.4a(c))I c.4p(d,2);I c.4p(d)}J{9(d=="1r"&&E.V.1h){9(a!=W){c.69=1;c.1E=(c.1E||"").1p(/6O\\([^)]*\\)/,"")+(3I(a).3s()=="8S"?"":"6O(1r="+a*6A+")")}I c.1E?(3I(c.1E.1t(/1r=([^)]*)/)[1])/6A).3s():""}d=d.1p(/-([a-z])/8Q,G(z,b){I b.27()});9(a!=W)c[d]=a;I c[d]}},36:G(t){I(t||"").1p(/^\\s+|\\s+$/g,"")},2h:G(a){H r=[];9(1m a!="8P")L(H i=0,2c=a.K;i<2c;i++)r.1a(a[i]);J r=a.2J(0);I r},2A:G(b,a){L(H i=0,2c=a.K;i<2c;i++)9(a[i]==b)I i;I-1},1R:G(a,b){9(E.V.1h){L(H i=0;b[i];i++)9(b[i].1y!=8)a.1a(b[i])}J L(H i=0;b[i];i++)a.1a(b[i]);I a},4V:G(b){H r=[],2f={};2a{L(H i=0,6y=b.K;i<6y;i++){H a=E.M(b[i]);9(!2f[a]){2f[a]=Q;r.1a(b[i])}}}29(e){r=b}I r},2W:G(b,a,c){9(1m a=="1M")a=3w("P||G(a,i){I "+a+"}");H d=[];L(H i=0,4g=b.K;i<4g;i++)9(!c&&a(b[i],i)||c&&!a(b[i],i))d.1a(b[i]);I d},1X:G(c,b){9(1m b=="1M")b=3w("P||G(a){I "+b+"}");H d=[];L(H i=0,4g=c.K;i<4g;i++){H a=b(c[i],i);9(a!==S&&a!=W){9(a.1c!=1B)a=[a];d=d.8M(a)}}I d}});H v=8K.8I.2p();E.V={4s:(v.1t(/.+(?:8F|8E|8C|8B)[\\/: ]([\\d.]+)/)||[])[1],1N:/6w/.14(v),34:/34/.14(v),1h:/1h/.14(v)&&!/34/.14(v),35:/35/.14(v)&&!/(8z|6w)/.14(v)};H y=E.V.1h?"4h":"5h";E.1k({5g:!E.V.1h||U.8y=="8x",4h:E.V.1h?"4h":"5h",5o:{"L":"8w","8v":"1o","4u":y,5h:y,4h:y,3O:"3O",1o:"1o",1Q:"1Q",3c:"3c",2Q:"2Q",8u:"8t",26:"26",8s:"8r"}});E.N({1D:"a.12",8q:"15.4e(a,\'12\')",8p:"15.2I(a,2,\'2q\')",8n:"15.2I(a,2,\'4d\')",8l:"15.4e(a,\'2q\')",8k:"15.4e(a,\'4d\')",8j:"15.5d(a.12.1w,a)",8i:"15.5d(a.1w)",6q:"15.11(a,\'8h\')?a.8f||a.8e.U:15.2h(a.3j)"},G(i,n){E.1b[i]=G(a){H b=E.1X(6,n);9(a&&1m a=="1M")b=E.3m(a,b);I 6.2o(E.4V(b))}});E.N({5R:"3g",8c:"6j",3d:"6g",8b:"50",89:"6H"},G(i,n){E.1b[i]=G(){H a=1q;I 6.N(G(){L(H j=0,2c=a.K;j<2c;j++)E(a[j])[n](6)})}});E.N({5W:G(a){E.1x(6,a,"");6.53(a)},88:G(c){E.1o.1f(6,c)},87:G(c){E.1o.28(6,c)},86:G(c){E.1o[E.1o.3K(6,c)?"28":"1f"](6,c)},28:G(a){9(!a||E.1E(a,[6]).r.K){E.30(6);6.12.3b(6)}},4n:G(){E("*",6).N(G(){E.30(6)});1W(6.1w)6.3b(6.1w)}},G(i,n){E.1b[i]=G(){I 6.N(n,1q)}});E.N(["85","5Z"],G(i,a){H n=a.2p();E.1b[n]=G(h){I 6[0]==18?E.V.1N&&3y["84"+a]||E.5g&&38.33(U.2V["5a"+a],U.1G["5a"+a])||U.1G["5a"+a]:6[0]==U?38.33(U.1G["6n"+a],U.1G["6m"+a]):h==W?(6.K?E.17(6[0],n):S):6.17(n,h.1c==3X?h:h+"2T")}});H C=E.V.1N&&3x(E.V.4s)<83?"(?:[\\\\w*57-]|\\\\\\\\.)":"(?:[\\\\w\\82-\\81*57-]|\\\\\\\\.)",6k=1u 47("^>\\\\s*("+C+"+)"),6i=1u 47("^("+C+"+)(#)("+C+"+)"),6h=1u 47("^([#.]?)("+C+"*)");E.1k({55:{"":"m[2]==\'*\'||15.11(a,m[2])","#":"a.4p(\'22\')==m[2]",":":{80:"i<m[3]-0",7Z:"i>m[3]-0",2I:"m[3]-0==i",6E:"m[3]-0==i",3v:"i==0",3u:"i==r.K-1",6f:"i%2==0",6e:"i%2","3v-46":"a.12.4l(\'*\')[0]==a","3u-46":"15.2I(a.12.5p,1,\'4d\')==a","7X-46":"!15.2I(a.12.5p,2,\'4d\')",1D:"a.1w",4n:"!a.1w",7W:"(a.6s||a.7V||15(a).2g()||\'\').1g(m[3])>=0",3R:\'"1P"!=a.O&&15.17(a,"19")!="2s"&&15.17(a,"4C")!="1P"\',1P:\'"1P"==a.O||15.17(a,"19")=="2s"||15.17(a,"4C")=="1P"\',7U:"!a.3c",3c:"a.3c",2Q:"a.2Q",26:"a.26||15.1x(a,\'26\')",2g:"\'2g\'==a.O",4k:"\'4k\'==a.O",5j:"\'5j\'==a.O",54:"\'54\'==a.O",52:"\'52\'==a.O",51:"\'51\'==a.O",6d:"\'6d\'==a.O",6c:"\'6c\'==a.O",2r:\'"2r"==a.O||15.11(a,"2r")\',4t:"/4t|24|6b|2r/i.14(a.11)",3K:"15.1Y(m[3],a).K",7S:"/h\\\\d/i.14(a.11)",7R:"15.2W(15.32,G(1b){I a==1b.T;}).K"}},6a:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1u 47("^([:.#]*)("+C+"+)")],3m:G(a,c,b){H d,2b=[];1W(a&&a!=d){d=a;H f=E.1E(a,c,b);a=f.t.1p(/^\\s*,\\s*/,"");2b=b?c=f.r:E.1R(2b,f.r)}I 2b},1Y:G(t,o){9(1m t!="1M")I[t];9(o&&!o.1y)o=S;o=o||U;H d=[o],2f=[],3u;1W(t&&3u!=t){H r=[];3u=t;t=E.36(t);H l=P;H g=6k;H m=g.2S(t);9(m){H p=m[1].27();L(H i=0;d[i];i++)L(H c=d[i].1w;c;c=c.2q)9(c.1y==1&&(p=="*"||c.11.27()==p.27()))r.1a(c);d=r;t=t.1p(g,"");9(t.1g(" ")==0)6r;l=Q}J{g=/^([>+~])\\s*(\\w*)/i;9((m=g.2S(t))!=S){r=[];H p=m[2],1R={};m=m[1];L(H j=0,31=d.K;j<31;j++){H n=m=="~"||m=="+"?d[j].2q:d[j].1w;L(;n;n=n.2q)9(n.1y==1){H h=E.M(n);9(m=="~"&&1R[h])1T;9(!p||n.11.27()==p.27()){9(m=="~")1R[h]=Q;r.1a(n)}9(m=="+")1T}}d=r;t=E.36(t.1p(g,""));l=Q}}9(t&&!l){9(!t.1g(",")){9(o==d[0])d.44();2f=E.1R(2f,d);r=d=[o];t=" "+t.68(1,t.K)}J{H k=6i;H m=k.2S(t);9(m){m=[0,m[2],m[3],m[1]]}J{k=6h;m=k.2S(t)}m[2]=m[2].1p(/\\\\/g,"");H f=d[d.K-1];9(m[1]=="#"&&f&&f.3S&&!E.4a(f)){H q=f.3S(m[2]);9((E.V.1h||E.V.34)&&q&&1m q.22=="1M"&&q.22!=m[2])q=E(\'[@22="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.11(q,m[3]))?[q]:[]}J{L(H i=0;d[i];i++){H a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];9(a=="*"&&d[i].11.2p()=="5i")a="3a";r=E.1R(r,d[i].4l(a))}9(m[1]==".")r=E.4X(r,m[2]);9(m[1]=="#"){H e=[];L(H i=0;r[i];i++)9(r[i].4p("22")==m[2]){e=[r[i]];1T}r=e}d=r}t=t.1p(k,"")}}9(t){H b=E.1E(t,r);d=r=b.r;t=E.36(b.t)}}9(t)d=[];9(d&&o==d[0])d.44();2f=E.1R(2f,d);I 2f},4X:G(r,m,a){m=" "+m+" ";H c=[];L(H i=0;r[i];i++){H b=(" "+r[i].1o+" ").1g(m)>=0;9(!a&&b||a&&!b)c.1a(r[i])}I c},1E:G(t,r,h){H d;1W(t&&t!=d){d=t;H p=E.6a,m;L(H i=0;p[i];i++){m=p[i].2S(t);9(m){t=t.7O(m[0].K);m[2]=m[2].1p(/\\\\/g,"");1T}}9(!m)1T;9(m[1]==":"&&m[2]=="5V")r=E.1E(m[3],r,Q).r;J 9(m[1]==".")r=E.4X(r,m[2],h);J 9(m[1]=="["){H g=[],O=m[3];L(H i=0,31=r.K;i<31;i++){H a=r[i],z=a[E.5o[m[2]]||m[2]];9(z==S||/6C|3k|26/.14(m[2]))z=E.1x(a,m[2])||\'\';9((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1g(m[5])||O=="$="&&z.68(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1g(m[5])>=0)^h)g.1a(a)}r=g}J 9(m[1]==":"&&m[2]=="2I-46"){H e={},g=[],14=/(\\d*)n\\+?(\\d*)/.2S(m[3]=="6f"&&"2n"||m[3]=="6e"&&"2n+1"||!/\\D/.14(m[3])&&"n+"+m[3]||m[3]),3v=(14[1]||1)-0,d=14[2]-0;L(H i=0,31=r.K;i<31;i++){H j=r[i],12=j.12,22=E.M(12);9(!e[22]){H c=1;L(H n=12.1w;n;n=n.2q)9(n.1y==1)n.4U=c++;e[22]=Q}H b=P;9(3v==1){9(d==0||j.4U==d)b=Q}J 9((j.4U+d)%3v==0)b=Q;9(b^h)g.1a(j)}r=g}J{H f=E.55[m[1]];9(1m f!="1M")f=E.55[m[1]][m[2]];f=3w("P||G(a,i){I "+f+"}");r=E.2W(r,f,h)}}I{r:r,t:t}},4e:G(b,c){H d=[];H a=b[c];1W(a&&a!=U){9(a.1y==1)d.1a(a);a=a[c]}I d},2I:G(a,e,c,b){e=e||1;H d=0;L(;a;a=a[c])9(a.1y==1&&++d==e)1T;I a},5d:G(n,a){H r=[];L(;n;n=n.2q){9(n.1y==1&&(!a||n!=a))r.1a(n)}I r}});E.1j={1f:G(g,e,c,h){9(E.V.1h&&g.4j!=W)g=18;9(!c.2u)c.2u=6.2u++;9(h!=W){H d=c;c=G(){I d.16(6,1q)};c.M=h;c.2u=d.2u}H i=e.2l(".");e=i[0];c.O=i[1];H b=E.M(g,"2P")||E.M(g,"2P",{});H f=E.M(g,"2t",G(){H a;9(1m E=="W"||E.1j.4T)I a;a=E.1j.2t.16(g,1q);I a});H j=b[e];9(!j){j=b[e]={};9(g.4S)g.4S(e,f,P);J g.7N("43"+e,f)}j[c.2u]=c;6.1Z[e]=Q},2u:1,1Z:{},28:G(d,c,b){H e=E.M(d,"2P"),2L,4I;9(1m c=="1M"){H a=c.2l(".");c=a[0]}9(e){9(c&&c.O){b=c.4Q;c=c.O}9(!c){L(c 1i e)6.28(d,c)}J 9(e[c]){9(b)2E e[c][b.2u];J L(b 1i e[c])9(!a[1]||e[c][b].O==a[1])2E e[c][b];L(2L 1i e[c])1T;9(!2L){9(d.4P)d.4P(c,E.M(d,"2t"),P);J d.7M("43"+c,E.M(d,"2t"));2L=S;2E e[c]}}L(2L 1i e)1T;9(!2L){E.30(d,"2P");E.30(d,"2t")}}},1F:G(d,b,e,c,f){b=E.2h(b||[]);9(!e){9(6.1Z[d])E("*").1f([18,U]).1F(d,b)}J{H a,2L,1b=E.1n(e[d]||S),4N=!b[0]||!b[0].2M;9(4N)b.4w(6.4M({O:d,2m:e}));b[0].O=d;9(E.1n(E.M(e,"2t")))a=E.M(e,"2t").16(e,b);9(!1b&&e["43"+d]&&e["43"+d].16(e,b)===P)a=P;9(4N)b.44();9(f&&f.16(e,b)===P)a=P;9(1b&&c!==P&&a!==P&&!(E.11(e,\'a\')&&d=="4L")){6.4T=Q;e[d]()}6.4T=P}I a},2t:G(d){H a;d=E.1j.4M(d||18.1j||{});H b=d.O.2l(".");d.O=b[0];H c=E.M(6,"2P")&&E.M(6,"2P")[d.O],3q=1B.3A.2J.2O(1q,1);3q.4w(d);L(H j 1i c){3q[0].4Q=c[j];3q[0].M=c[j].M;9(!b[1]||c[j].O==b[1]){H e=c[j].16(6,3q);9(a!==P)a=e;9(e===P){d.2M();d.3p()}}}9(E.V.1h)d.2m=d.2M=d.3p=d.4Q=d.M=S;I a},4M:G(c){H a=c;c=E.1k({},a);c.2M=G(){9(a.2M)a.2M();a.7L=P};c.3p=G(){9(a.3p)a.3p();a.7K=Q};9(!c.2m&&c.65)c.2m=c.65;9(E.V.1N&&c.2m.1y==3)c.2m=a.2m.12;9(!c.4K&&c.4J)c.4K=c.4J==c.2m?c.7H:c.4J;9(c.64==S&&c.63!=S){H e=U.2V,b=U.1G;c.64=c.63+(e&&e.2R||b.2R||0);c.7E=c.7D+(e&&e.2B||b.2B||0)}9(!c.3Y&&(c.61||c.60))c.3Y=c.61||c.60;9(!c.5F&&c.5D)c.5F=c.5D;9(!c.3Y&&c.2r)c.3Y=(c.2r&1?1:(c.2r&2?3:(c.2r&4?2:0)));I c}};E.1b.1k({3W:G(c,a,b){I c=="5Y"?6.2G(c,a,b):6.N(G(){E.1j.1f(6,c,b||a,b&&a)})},2G:G(d,b,c){I 6.N(G(){E.1j.1f(6,d,G(a){E(6).5X(a);I(c||b).16(6,1q)},c&&b)})},5X:G(a,b){I 6.N(G(){E.1j.28(6,a,b)})},1F:G(c,a,b){I 6.N(G(){E.1j.1F(c,a,6,Q,b)})},7x:G(c,a,b){9(6[0])I E.1j.1F(c,a,6[0],P,b)},25:G(){H a=1q;I 6.4L(G(e){6.4H=0==6.4H?1:0;e.2M();I a[6.4H].16(6,[e])||P})},7v:G(f,g){G 4G(e){H p=e.4K;1W(p&&p!=6)2a{p=p.12}29(e){p=6};9(p==6)I P;I(e.O=="4x"?f:g).16(6,[e])}I 6.4x(4G).5U(4G)},2d:G(f){5T();9(E.3T)f.16(U,[E]);J E.3l.1a(G(){I f.16(6,[E])});I 6}});E.1k({3T:P,3l:[],2d:G(){9(!E.3T){E.3T=Q;9(E.3l){E.N(E.3l,G(){6.16(U)});E.3l=S}9(E.V.35||E.V.34)U.4P("5S",E.2d,P);9(!18.7t.K)E(18).39(G(){E("#4E").28()})}}});E.N(("7s,7r,39,7q,6n,5Y,4L,7p,"+"7n,7m,7l,4x,5U,7k,24,"+"51,7j,7i,7h,3U").2l(","),G(i,o){E.1b[o]=G(f){I f?6.3W(o,f):6.1F(o)}});H x=P;G 5T(){9(x)I;x=Q;9(E.V.35||E.V.34)U.4S("5S",E.2d,P);J 9(E.V.1h){U.7f("<7d"+"7y 22=4E 7z=Q "+"3k=//:><\\/1J>");H a=U.3S("4E");9(a)a.62=G(){9(6.2C!="1l")I;E.2d()};a=S}J 9(E.V.1N)E.4B=4j(G(){9(U.2C=="5Q"||U.2C=="1l"){4A(E.4B);E.4B=S;E.2d()}},10);E.1j.1f(18,"39",E.2d)}E.1b.1k({39:G(g,d,c){9(E.1n(g))I 6.3W("39",g);H e=g.1g(" ");9(e>=0){H i=g.2J(e,g.K);g=g.2J(0,e)}c=c||G(){};H f="4z";9(d)9(E.1n(d)){c=d;d=S}J{d=E.3a(d);f="5P"}H h=6;E.3G({1d:g,O:f,M:d,1l:G(a,b){9(b=="1C"||b=="5O")h.4o(i?E("<1s/>").3g(a.40.1p(/<1J(.|\\s)*?\\/1J>/g,"")).1Y(i):a.40);56(G(){h.N(c,[a.40,b,a])},13)}});I 6},7a:G(){I E.3a(6.5M())},5M:G(){I 6.1X(G(){I E.11(6,"2Y")?E.2h(6.79):6}).1E(G(){I 6.2H&&!6.3c&&(6.2Q||/24|6b/i.14(6.11)||/2g|1P|52/i.14(6.O))}).1X(G(i,c){H b=E(6).3i();I b==S?S:b.1c==1B?E.1X(b,G(a,i){I{2H:c.2H,1Q:a}}):{2H:c.2H,1Q:b}}).21()}});E.N("5L,5K,6t,5J,5I,5H".2l(","),G(i,o){E.1b[o]=G(f){I 6.3W(o,f)}});H B=(1u 3D).3B();E.1k({21:G(d,b,a,c){9(E.1n(b)){a=b;b=S}I E.3G({O:"4z",1d:d,M:b,1C:a,1V:c})},78:G(b,a){I E.21(b,S,a,"1J")},77:G(c,b,a){I E.21(c,b,a,"45")},76:G(d,b,a,c){9(E.1n(b)){a=b;b={}}I E.3G({O:"5P",1d:d,M:b,1C:a,1V:c})},75:G(a){E.1k(E.59,a)},59:{1Z:Q,O:"4z",2z:0,5G:"74/x-73-2Y-72",6o:Q,3e:Q,M:S},49:{},3G:G(s){H f,2y=/=(\\?|%3F)/g,1v,M;s=E.1k(Q,s,E.1k(Q,{},E.59,s));9(s.M&&s.6o&&1m s.M!="1M")s.M=E.3a(s.M);9(s.1V=="4b"){9(s.O.2p()=="21"){9(!s.1d.1t(2y))s.1d+=(s.1d.1t(/\\?/)?"&":"?")+(s.4b||"5E")+"=?"}J 9(!s.M||!s.M.1t(2y))s.M=(s.M?s.M+"&":"")+(s.4b||"5E")+"=?";s.1V="45"}9(s.1V=="45"&&(s.M&&s.M.1t(2y)||s.1d.1t(2y))){f="4b"+B++;9(s.M)s.M=s.M.1p(2y,"="+f);s.1d=s.1d.1p(2y,"="+f);s.1V="1J";18[f]=G(a){M=a;1C();1l();18[f]=W;2a{2E 18[f]}29(e){}}}9(s.1V=="1J"&&s.1L==S)s.1L=P;9(s.1L===P&&s.O.2p()=="21")s.1d+=(s.1d.1t(/\\?/)?"&":"?")+"57="+(1u 3D()).3B();9(s.M&&s.O.2p()=="21"){s.1d+=(s.1d.1t(/\\?/)?"&":"?")+s.M;s.M=S}9(s.1Z&&!E.5b++)E.1j.1F("5L");9(!s.1d.1g("8g")&&s.1V=="1J"){H h=U.4l("9U")[0];H g=U.5B("1J");g.3k=s.1d;9(!f&&(s.1C||s.1l)){H j=P;g.9R=g.62=G(){9(!j&&(!6.2C||6.2C=="5Q"||6.2C=="1l")){j=Q;1C();1l();h.3b(g)}}}h.58(g);I}H k=P;H i=18.6X?1u 6X("9P.9O"):1u 6W();i.9M(s.O,s.1d,s.3e);9(s.M)i.5C("9J-9I",s.5G);9(s.5y)i.5C("9H-5x-9F",E.49[s.1d]||"9D, 9C 9B 9A 5v:5v:5v 9z");i.5C("X-9x-9v","6W");9(s.6U)s.6U(i);9(s.1Z)E.1j.1F("5H",[i,s]);H c=G(a){9(!k&&i&&(i.2C==4||a=="2z")){k=Q;9(d){4A(d);d=S}1v=a=="2z"&&"2z"||!E.6S(i)&&"3U"||s.5y&&E.6R(i,s.1d)&&"5O"||"1C";9(1v=="1C"){2a{M=E.6Q(i,s.1V)}29(e){1v="5k"}}9(1v=="1C"){H b;2a{b=i.5s("6P-5x")}29(e){}9(s.5y&&b)E.49[s.1d]=b;9(!f)1C()}J E.5r(s,i,1v);1l();9(s.3e)i=S}};9(s.3e){H d=4j(c,13);9(s.2z>0)56(G(){9(i){i.9q();9(!k)c("2z")}},s.2z)}2a{i.9o(s.M)}29(e){E.5r(s,i,S,e)}9(!s.3e)c();I i;G 1C(){9(s.1C)s.1C(M,1v);9(s.1Z)E.1j.1F("5I",[i,s])}G 1l(){9(s.1l)s.1l(i,1v);9(s.1Z)E.1j.1F("6t",[i,s]);9(s.1Z&&!--E.5b)E.1j.1F("5K")}},5r:G(s,a,b,e){9(s.3U)s.3U(a,b,e);9(s.1Z)E.1j.1F("5J",[a,s,e])},5b:0,6S:G(r){2a{I!r.1v&&9n.9l=="54:"||(r.1v>=6N&&r.1v<9j)||r.1v==6M||E.V.1N&&r.1v==W}29(e){}I P},6R:G(a,c){2a{H b=a.5s("6P-5x");I a.1v==6M||b==E.49[c]||E.V.1N&&a.1v==W}29(e){}I P},6Q:G(r,b){H c=r.5s("9i-O");H d=b=="6K"||!b&&c&&c.1g("6K")>=0;H a=d?r.9g:r.40;9(d&&a.2V.37=="5k")6G"5k";9(b=="1J")E.5f(a);9(b=="45")a=3w("("+a+")");I a},3a:G(a){H s=[];9(a.1c==1B||a.4c)E.N(a,G(){s.1a(3f(6.2H)+"="+3f(6.1Q))});J L(H j 1i a)9(a[j]&&a[j].1c==1B)E.N(a[j],G(){s.1a(3f(j)+"="+3f(6))});J s.1a(3f(j)+"="+3f(a[j]));I s.66("&").1p(/%20/g,"+")}});E.1b.1k({1A:G(b,a){I b?6.1U({1H:"1A",2N:"1A",1r:"1A"},b,a):6.1E(":1P").N(G(){6.R.19=6.3h?6.3h:"";9(E.17(6,"19")=="2s")6.R.19="2Z"}).2D()},1z:G(b,a){I b?6.1U({1H:"1z",2N:"1z",1r:"1z"},b,a):6.1E(":3R").N(G(){6.3h=6.3h||E.17(6,"19");9(6.3h=="2s")6.3h="2Z";6.R.19="2s"}).2D()},6J:E.1b.25,25:G(a,b){I E.1n(a)&&E.1n(b)?6.6J(a,b):a?6.1U({1H:"25",2N:"25",1r:"25"},a,b):6.N(G(){E(6)[E(6).3t(":1P")?"1A":"1z"]()})},9c:G(b,a){I 6.1U({1H:"1A"},b,a)},9b:G(b,a){I 6.1U({1H:"1z"},b,a)},99:G(b,a){I 6.1U({1H:"25"},b,a)},98:G(b,a){I 6.1U({1r:"1A"},b,a)},96:G(b,a){I 6.1U({1r:"1z"},b,a)},95:G(c,a,b){I 6.1U({1r:a},c,b)},1U:G(k,i,h,g){H j=E.6D(i,h,g);I 6[j.3L===P?"N":"3L"](G(){j=E.1k({},j);H f=E(6).3t(":1P"),3y=6;L(H p 1i k){9(k[p]=="1z"&&f||k[p]=="1A"&&!f)I E.1n(j.1l)&&j.1l.16(6);9(p=="1H"||p=="2N"){j.19=E.17(6,"19");j.2U=6.R.2U}}9(j.2U!=S)6.R.2U="1P";j.3M=E.1k({},k);E.N(k,G(c,a){H e=1u E.2j(3y,j,c);9(/25|1A|1z/.14(a))e[a=="25"?f?"1A":"1z":a](k);J{H b=a.3s().1t(/^([+-]=)?([\\d+-.]+)(.*)$/),1O=e.2b(Q)||0;9(b){H d=3I(b[2]),2i=b[3]||"2T";9(2i!="2T"){3y.R[c]=(d||1)+2i;1O=((d||1)/e.2b(Q))*1O;3y.R[c]=1O+2i}9(b[1])d=((b[1]=="-="?-1:1)*d)+1O;e.3N(1O,d,2i)}J e.3N(1O,a,"")}});I Q})},3L:G(a,b){9(E.1n(a)){b=a;a="2j"}9(!a||(1m a=="1M"&&!b))I A(6[0],a);I 6.N(G(){9(b.1c==1B)A(6,a,b);J{A(6,a).1a(b);9(A(6,a).K==1)b.16(6)}})},9f:G(){H a=E.32;I 6.N(G(){L(H i=0;i<a.K;i++)9(a[i].T==6)a.6I(i--,1)}).5n()}});H A=G(b,c,a){9(!b)I;H q=E.M(b,c+"3L");9(!q||a)q=E.M(b,c+"3L",a?E.2h(a):[]);I q};E.1b.5n=G(a){a=a||"2j";I 6.N(G(){H q=A(6,a);q.44();9(q.K)q[0].16(6)})};E.1k({6D:G(b,a,c){H d=b&&b.1c==8Z?b:{1l:c||!c&&a||E.1n(b)&&b,2e:b,3J:c&&a||a&&a.1c!=8Y&&a};d.2e=(d.2e&&d.2e.1c==4W?d.2e:{8X:8W,8V:6N}[d.2e])||8T;d.3r=d.1l;d.1l=G(){E(6).5n();9(E.1n(d.3r))d.3r.16(6)};I d},3J:{6B:G(p,n,b,a){I b+a*p},5q:G(p,n,b,a){I((-38.9s(p*38.8R)/2)+0.5)*a+b}},32:[],2j:G(b,c,a){6.Y=c;6.T=b;6.1e=a;9(!c.3P)c.3P={}}});E.2j.3A={4r:G(){9(6.Y.2F)6.Y.2F.16(6.T,[6.2v,6]);(E.2j.2F[6.1e]||E.2j.2F.6z)(6);9(6.1e=="1H"||6.1e=="2N")6.T.R.19="2Z"},2b:G(a){9(6.T[6.1e]!=S&&6.T.R[6.1e]==S)I 6.T[6.1e];H r=3I(E.3C(6.T,6.1e,a));I r&&r>-8O?r:3I(E.17(6.T,6.1e))||0},3N:G(c,b,e){6.5u=(1u 3D()).3B();6.1O=c;6.2D=b;6.2i=e||6.2i||"2T";6.2v=6.1O;6.4q=6.4i=0;6.4r();H f=6;G t(){I f.2F()}t.T=6.T;E.32.1a(t);9(E.32.K==1){H d=4j(G(){H a=E.32;L(H i=0;i<a.K;i++)9(!a[i]())a.6I(i--,1);9(!a.K)4A(d)},13)}},1A:G(){6.Y.3P[6.1e]=E.1x(6.T.R,6.1e);6.Y.1A=Q;6.3N(0,6.2b());9(6.1e=="2N"||6.1e=="1H")6.T.R[6.1e]="8N";E(6.T).1A()},1z:G(){6.Y.3P[6.1e]=E.1x(6.T.R,6.1e);6.Y.1z=Q;6.3N(6.2b(),0)},2F:G(){H t=(1u 3D()).3B();9(t>6.Y.2e+6.5u){6.2v=6.2D;6.4q=6.4i=1;6.4r();6.Y.3M[6.1e]=Q;H a=Q;L(H i 1i 6.Y.3M)9(6.Y.3M[i]!==Q)a=P;9(a){9(6.Y.19!=S){6.T.R.2U=6.Y.2U;6.T.R.19=6.Y.19;9(E.17(6.T,"19")=="2s")6.T.R.19="2Z"}9(6.Y.1z)6.T.R.19="2s";9(6.Y.1z||6.Y.1A)L(H p 1i 6.Y.3M)E.1x(6.T.R,p,6.Y.3P[p])}9(a&&E.1n(6.Y.1l))6.Y.1l.16(6.T);I P}J{H n=t-6.5u;6.4i=n/6.Y.2e;6.4q=E.3J[6.Y.3J||(E.3J.5q?"5q":"6B")](6.4i,n,0,1,6.Y.2e);6.2v=6.1O+((6.2D-6.1O)*6.4q);6.4r()}I Q}};E.2j.2F={2R:G(a){a.T.2R=a.2v},2B:G(a){a.T.2B=a.2v},1r:G(a){E.1x(a.T.R,"1r",a.2v)},6z:G(a){a.T.R[a.1e]=a.2v+a.2i}};E.1b.6m=G(){H c=0,3E=0,T=6[0],5t;9(T)8L(E.V){H b=E.17(T,"2X")=="4F",1D=T.12,23=T.23,2K=T.3H,4f=1N&&3x(4s)<8J;9(T.6V){5w=T.6V();1f(5w.1S+38.33(2K.2V.2R,2K.1G.2R),5w.3E+38.33(2K.2V.2B,2K.1G.2B));9(1h){H d=E("4o").17("8H");d=(d=="8G"||E.5g&&3x(4s)>=7)&&2||d;1f(-d,-d)}}J{1f(T.5l,T.5z);1W(23){1f(23.5l,23.5z);9(35&&/^t[d|h]$/i.14(1D.37)||!4f)d(23);9(4f&&!b&&E.17(23,"2X")=="4F")b=Q;23=23.23}1W(1D.37&&!/^1G|4o$/i.14(1D.37)){9(!/^8D|1I-9S.*$/i.14(E.17(1D,"19")))1f(-1D.2R,-1D.2B);9(35&&E.17(1D,"2U")!="3R")d(1D);1D=1D.12}9(4f&&b)1f(-2K.1G.5l,-2K.1G.5z)}5t={3E:3E,1S:c}}I 5t;G d(a){1f(E.17(a,"9T"),E.17(a,"8A"))}G 1f(l,t){c+=3x(l)||0;3E+=3x(t)||0}}})();',62,616,'||||||this|||if|||||||||||||||||||||||||||||||||function|var|return|else|length|for|data|each|type|false|true|style|null|elem|document|browser|undefined||options|||nodeName|parentNode||test|jQuery|apply|css|window|display|push|fn|constructor|url|prop|add|indexOf|msie|in|event|extend|complete|typeof|isFunction|className|replace|arguments|opacity|div|match|new|status|firstChild|attr|nodeType|hide|show|Array|success|parent|filter|trigger|body|height|table|script|tbody|cache|string|safari|start|hidden|value|merge|left|break|animate|dataType|while|map|find|global||get|id|offsetParent|select|toggle|selected|toUpperCase|remove|catch|try|cur|al|ready|duration|done|text|makeArray|unit|fx|swap|split|target||pushStack|toLowerCase|nextSibling|button|none|handle|guid|now|stack|tb|jsre|timeout|inArray|scrollTop|readyState|end|delete|step|one|name|nth|slice|doc|ret|preventDefault|width|call|events|checked|scrollLeft|exec|px|overflow|documentElement|grep|position|form|block|removeData|rl|timers|max|opera|mozilla|trim|tagName|Math|load|param|removeChild|disabled|insertBefore|async|encodeURIComponent|append|oldblock|val|childNodes|src|readyList|multiFilter|color|defaultView|stopPropagation|args|old|toString|is|last|first|eval|parseInt|self|domManip|prototype|getTime|curCSS|Date|top||ajax|ownerDocument|parseFloat|easing|has|queue|curAnim|custom|innerHTML|orig|currentStyle|visible|getElementById|isReady|error|static|bind|String|which|getComputedStyle|responseText|oWidth|oHeight|on|shift|json|child|RegExp|ol|lastModified|isXMLDoc|jsonp|jquery|previousSibling|dir|safari2|el|styleFloat|state|setInterval|radio|getElementsByTagName|tr|empty|html|getAttribute|pos|update|version|input|float|runtimeStyle|unshift|mouseover|getPropertyValue|GET|clearInterval|safariTimer|visibility|clean|__ie_init|absolute|handleHover|lastToggle|index|fromElement|relatedTarget|click|fix|evt|andSelf|removeEventListener|handler|cloneNode|addEventListener|triggered|nodeIndex|unique|Number|classFilter|prevObject|selectedIndex|after|submit|password|removeAttribute|file|expr|setTimeout|_|appendChild|ajaxSettings|client|active|win|sibling|deep|globalEval|boxModel|cssFloat|object|checkbox|parsererror|offsetLeft|wrapAll|dequeue|props|lastChild|swing|handleError|getResponseHeader|results|startTime|00|box|Modified|ifModified|offsetTop|evalScript|createElement|setRequestHeader|ctrlKey|callback|metaKey|contentType|ajaxSend|ajaxSuccess|ajaxError|ajaxStop|ajaxStart|serializeArray|init|notmodified|POST|loaded|appendTo|DOMContentLoaded|bindReady|mouseout|not|removeAttr|unbind|unload|Width|keyCode|charCode|onreadystatechange|clientX|pageX|srcElement|join|outerHTML|substr|zoom|parse|textarea|reset|image|odd|even|before|quickClass|quickID|prepend|quickChild|execScript|offset|scroll|processData|uuid|contents|continue|textContent|ajaxComplete|clone|setArray|webkit|nodeValue|fl|_default|100|linear|href|speed|eq|createTextNode|throw|replaceWith|splice|_toggle|xml|colgroup|304|200|alpha|Last|httpData|httpNotModified|httpSuccess|fieldset|beforeSend|getBoundingClientRect|XMLHttpRequest|ActiveXObject|col|br|abbr|pixelLeft|urlencoded|www|application|ajaxSetup|post|getJSON|getScript|elements|serialize|clientWidth|hasClass|scr|clientHeight|write|relative|keyup|keypress|keydown|change|mousemove|mouseup|mousedown|right|dblclick|resize|focus|blur|frames|instanceof|hover|offsetWidth|triggerHandler|ipt|defer|offsetHeight|border|padding|clientY|pageY|Left|Right|toElement|Bottom|Top|cancelBubble|returnValue|detachEvent|attachEvent|substring|line|weight|animated|header|font|enabled|innerText|contains|only|size|gt|lt|uFFFF|u0128|417|inner|Height|toggleClass|removeClass|addClass|replaceAll|noConflict|insertAfter|prependTo|wrap|contentWindow|contentDocument|http|iframe|children|siblings|prevAll|nextAll|wrapInner|prev|Boolean|next|parents|maxLength|maxlength|readOnly|readonly|class|htmlFor|CSS1Compat|compatMode|compatible|borderTopWidth|ie|ra|inline|it|rv|medium|borderWidth|userAgent|522|navigator|with|concat|1px|10000|array|ig|PI|NaN|400|reverse|fast|600|slow|Function|Object|setAttribute|changed|be|can|property|fadeTo|fadeOut|getAttributeNode|fadeIn|slideToggle|method|slideUp|slideDown|action|cssText|stop|responseXML|option|content|300|th|protocol|td|location|send|cap|abort|colg|cos|tfoot|thead|With|leg|Requested|opt|GMT|1970|Jan|01|Thu|area|Since|hr|If|Type|Content|meta|specified|open|link|XMLHTTP|Microsoft|img|onload|row|borderLeftWidth|head|attributes'.split('|'),0,{}))
@@ -1,51 +0,0 @@
1
- require 'ramaze'
2
- require 'ramaze/spec/helper'
3
-
4
- spec_require 'hpricot', 'uv', 'sequel'
5
-
6
- $LOAD_PATH.unshift base = __DIR__('..')
7
- require 'start'
8
-
9
- describe 'RaPaste' do
10
- behaves_like 'http'
11
- ramaze :public_root => base/:public,
12
- :view_root => base/:view
13
-
14
- it 'should show an empty list on the list page' do
15
- page = get('/list')
16
- Hpricot(page.body).at('p.list_empty').inner_html.strip.
17
- should == 'No pastes available yet, go on and <a href="/">Add one</a>'
18
- end
19
-
20
- it 'should have a link to the new paste form' do
21
- page = get('/list')
22
- Hpricot(page.body).at('#menu a[@href=/]').inner_text.should == 'New'
23
- end
24
-
25
- it 'should show a new paste form' do
26
- page = get('/')
27
- form = Hpricot(page.body).at('form#new_paste')
28
- form[:action].should == '/save'
29
- form[:method].should == 'POST'
30
- form.at(:textarea)[:name].should == 'text'
31
- form.at('select/option[@value=plain_text]').inner_text.should == 'Plain Text'
32
- end
33
-
34
- it 'should create a new paste' do
35
- page = post('/save', 'syntax' => 'plain_text', 'text' => 'spec paste')
36
- page.status.should == 302
37
- page.original_headers['Location'].should == '/1'
38
- end
39
-
40
- it 'should show the new paste in plain text' do
41
- page = get('/1.txt')
42
- page.body.should == 'spec paste'
43
- end
44
-
45
- it 'should show the new paste in html' do
46
- page = get('/1')
47
- (Hpricot(page.body)/'div#paste_body').inner_text.should =~ /spec paste/
48
- end
49
-
50
- FileUtils.rm_f(DB_FILE)
51
- end
@@ -1,25 +0,0 @@
1
- require 'rubygems'
2
- require 'tmpdir'
3
-
4
- require 'ramaze'
5
- require 'sequel'
6
- require 'uv'
7
-
8
- Ramaze::Log.debug "Initializing UltraViolet..."
9
-
10
- Uv.copy_files "xhtml", __DIR__("public")
11
- Uv.init_syntaxes
12
-
13
- UV_PRIORITY_NAMES = %w[ ruby plain_text html css javascript yaml diff ]
14
-
15
- STYLE = 'iplastic'
16
-
17
- Ramaze::Log.debug "done."
18
-
19
- DB_FILE = __DIR__("rapaste.sqlite") # for specs
20
- DB = Sequel.connect("sqlite://#{DB_FILE}")
21
-
22
- require 'model/paste'
23
- require 'controller/paste'
24
-
25
- Ramaze.start :adapter => :mongrel, :port => 9952
@@ -1,10 +0,0 @@
1
- <form id="new_paste" action="/save" method="POST">
2
- <textarea name="text">#{@paste.text}</textarea>
3
- <select name="syntax">
4
- <?r Paste::SYNTAX_LIST.each do |value, name|
5
- selected = ' selected="selected"' if value == @paste.syntax ?>
6
- <option value="#{value}"#{selected}>#{name || value}</option>
7
- <?r end ?>
8
- </select>
9
- <input type="submit" />
10
- </form>
@@ -1,9 +0,0 @@
1
- <form id="new_paste" action="/save" method="POST">
2
- <textarea name="text"></textarea>
3
- <select name="syntax">
4
- <?r Paste::SYNTAX_LIST.each do |value, name| ?>
5
- <option value="#{value}">#{name || value}</option>
6
- <?r end ?>
7
- </select>
8
- <input type="submit" />
9
- </form>
@@ -1,25 +0,0 @@
1
- <?xml version="1.0" encoding="utf8" ?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
- <html>
5
- <head>
6
- <title>RaPaste </title>
7
- <link href='/css/display.css' rel='stylesheet' type='text/css' />
8
- <link href='/css/#{@style || STYLE}.css' rel='stylesheet' type='text/css' />
9
- </head>
10
- <body>
11
- <div id="logo"><a href="/">RaPaste</a></div>
12
- <div id="menu">
13
- <a href="/">New</a>
14
- <a href="/list">List</a>
15
- <form id="search" action="/search" method="GET">
16
- Search: <input type="text" name="substring"/>
17
- </form>
18
- </div>
19
- #@content
20
- <div id="footer">
21
- <div style="text-decoration:line-through">&copy; #{Date.today.year} by manveru</div>
22
- <a href="http://source.ramaze.net/examples/rapaste">View Source</a>
23
- </div>
24
- </body>
25
- </html>
@@ -1,29 +0,0 @@
1
- #{@pager}
2
- <div id="list_head">
3
- Pastes total: #{Paste.size}
4
- </div>
5
- <div class="list">
6
- <?r @pastes.each do |paste| ?>
7
- <div class="item">
8
- <div class="item_meta">
9
- <a href="/#{paste.id}">
10
- <span class="paste_id">#{paste.id}</span>
11
- <span class="syntax">#{paste.syntax_name}</span>
12
- <span class="created">created #{time_diff(paste.created)} ago</span>
13
- </a>
14
- </div>
15
- <div class="fragment">#{paste.text_fragment(@style)}</div>
16
- <?r if paste.lines[11,1] ?>
17
- <div class="more"><a href="/#{paste.id}">more...</a></div>
18
- <?r else ?>
19
- <div class="more"><a href="/#{paste.id}">show...</a></div>
20
- <?r end ?>
21
- </div>
22
- <?r end ?>
23
- <?r if Paste.empty? ?>
24
- <p class="list_empty">
25
- No pastes available yet, go on and <a href="#{Rs(:/)}">Add one</a>
26
- </p>
27
- <?r end ?>
28
- </table>
29
- #{@pager}
@@ -1,41 +0,0 @@
1
- <?r if @pastes ?>
2
-
3
- <h3>Search Results</h3>
4
-
5
- <?r if @pastes.empty? ?>
6
- <div>
7
- No pastes matched your search criteria.
8
- </div>
9
- <?r if Paste.empty? ?>
10
- <p class="list_empty">
11
- There are no pastes at all yet! Go on and <a href="#{Rs(:/)}">Add one</a>.
12
- </p>
13
- <?r end ?>
14
- <?r else ?>
15
-
16
- <div id="list_head">
17
- Total search results: #{@pastes.size}
18
- <?r if @hit_limit ?>(maximum)<?r end ?>
19
- </div>
20
- <div class="list">
21
- <?r @pastes.each do |paste| ?>
22
- <div class="item">
23
- <div class="item_meta">
24
- <a href="/#{paste.id}">
25
- <span class="syntax">#{paste.syntax_name}</span>
26
- <span class="created">created #{time_diff(paste.created)} ago</span>
27
- </a>
28
- </div>
29
- <div class="fragment">#{paste.text_fragment(@style)}</div>
30
- <?r if paste.lines[11,1] ?>
31
- <div class="more"><a href="/#{paste.id}">more...</a></div>
32
- <?r else ?>
33
- <div class="more"><a href="/#{paste.id}">show...</a></div>
34
- <?r end ?>
35
- </div>
36
- <?r end ?>
37
- </table>
38
-
39
- <?r end ?>
40
-
41
- <?r end ?>
@@ -1,40 +0,0 @@
1
- #{@pager}
2
- <script type="text/javascript" src="/js/jquery.js"></script>
3
- <script type="text/javascript">
4
- $(function() {
5
- $('#paste_body').dblclick(function(){ $('.line-numbers').toggle() });
6
- });
7
- function change_style(name){
8
- $('link')[1].href = '/css/' + name + '.css';
9
- $('pre')[0].className = name;
10
- $.get( '/save_theme/' + name );
11
- }
12
- </script>
13
- <div id="paste">
14
- <div id="paste_head">
15
- <a id="toggle_meta" onclick="javascript:$('#paste_meta').toggle();" href="#">
16
- <span class="toggle_button">-</span>
17
- </a>
18
- <ul id="paste_meta">
19
- <li id="meta_syntax">Syntax: #{@syntax}</li>
20
- <li id="meta_created">Created: #{time_diff(@paste.created)} ago</li>
21
- <li id="meta_toggle_lines"><a onclick="javascript:$('span.line-numbers').toggle();" href="#">Toggle line numbers</a></li>
22
- <li id="meta_change_style">
23
- <form>
24
- Theme:
25
- <select onchange="change_style(this.value);" name="style" id="select_style">
26
- <?r Uv.themes.each do |theme| ?>
27
- <option value="#{theme}"#{theme == @style ? ' selected' : ''}>#{theme.capitalize.tr('_', ' ')}</option>
28
- <?r end ?>
29
- </select>
30
- </form>
31
- </li>
32
- <ul id="meta_menu">
33
- <li><a href="/copy/#{@paste.id}">Copy</a></li>
34
- <li><a href="/#{@paste.id}">HTML</a></li>
35
- <li><a href="/#{@paste.id}.txt">Plain</a></li>
36
- </ul>
37
- </ul>
38
- </div>
39
- <div id="paste_body">#@formatted</div>
40
- </div>
@@ -1 +0,0 @@
1
- A simple ToDo list example that uses Ramaze::Store as the persistence layer.
@@ -1,1923 +0,0 @@
1
- /* prevent execution of jQuery if included more then once */
2
- if(typeof window.jQuery == "undefined") {
3
- /*
4
- * jQuery 1.0.2 - New Wave Javascript
5
- *
6
- * Copyright (c) 2006 John Resig (jquery.com)
7
- * Dual licensed under the MIT (MIT-LICENSE.txt)
8
- * and GPL (GPL-LICENSE.txt) licenses.
9
- *
10
- * $Date: 2006-10-09 20:23:18 -0400 (Mon, 09 Oct 2006) $
11
- * $Rev: 413 $
12
- */
13
-
14
- // Global undefined variable
15
- window.undefined = window.undefined;
16
- jQuery = function(a,c) {
17
-
18
- // Shortcut for document ready (because $(document).each() is silly)
19
- if ( a && typeof a == "function" && jQuery.fn.ready )
20
- return jQuery(document).ready(a);
21
-
22
- // Make sure that a selection was provided
23
- a = a || jQuery.context || document;
24
-
25
- // Watch for when a jQuery object is passed as the selector
26
- if ( a.jquery )
27
- return jQuery( jQuery.merge( a, [] ) );
28
-
29
- // Watch for when a jQuery object is passed at the context
30
- if ( c && c.jquery )
31
- return jQuery( c ).find(a);
32
-
33
- // If the context is global, return a new object
34
- if ( window == this )
35
- return new jQuery(a,c);
36
-
37
- // Handle HTML strings
38
- var m = /^[^<]*(<.+>)[^>]*$/.exec(a);
39
- if ( m ) a = jQuery.clean( [ m[1] ] );
40
-
41
- // Watch for when an array is passed in
42
- this.get( a.constructor == Array || a.length && !a.nodeType && a[0] != undefined && a[0].nodeType ?
43
- // Assume that it is an array of DOM Elements
44
- jQuery.merge( a, [] ) :
45
-
46
- // Find the matching elements and save them for later
47
- jQuery.find( a, c ) );
48
-
49
- // See if an extra function was provided
50
- var fn = arguments[ arguments.length - 1 ];
51
-
52
- // If so, execute it in context
53
- if ( fn && typeof fn == "function" )
54
- this.each(fn);
55
- };
56
-
57
- // Map over the $ in case of overwrite
58
- if ( typeof $ != "undefined" )
59
- jQuery._$ = $;
60
-
61
- // Map the jQuery namespace to the '$' one
62
- var $ = jQuery;
63
-
64
- jQuery.fn = jQuery.prototype = {
65
- jquery: "1.0.2",
66
-
67
- size: function() {
68
- return this.length;
69
- },
70
-
71
- get: function( num ) {
72
- // Watch for when an array (of elements) is passed in
73
- if ( num && num.constructor == Array ) {
74
-
75
- // Use a tricky hack to make the jQuery object
76
- // look and feel like an array
77
- this.length = 0;
78
- [].push.apply( this, num );
79
-
80
- return this;
81
- } else
82
- return num == undefined ?
83
-
84
- // Return a 'clean' array
85
- jQuery.merge( this, [] ) :
86
-
87
- // Return just the object
88
- this[num];
89
- },
90
- each: function( fn, args ) {
91
- return jQuery.each( this, fn, args );
92
- },
93
- index: function( obj ) {
94
- var pos = -1;
95
- this.each(function(i){
96
- if ( this == obj ) pos = i;
97
- });
98
- return pos;
99
- },
100
-
101
- attr: function( key, value, type ) {
102
- // Check to see if we're setting style values
103
- return key.constructor != String || value != undefined ?
104
- this.each(function(){
105
- // See if we're setting a hash of styles
106
- if ( value == undefined )
107
- // Set all the styles
108
- for ( var prop in key )
109
- jQuery.attr(
110
- type ? this.style : this,
111
- prop, key[prop]
112
- );
113
-
114
- // See if we're setting a single key/value style
115
- else
116
- jQuery.attr(
117
- type ? this.style : this,
118
- key, value
119
- );
120
- }) :
121
-
122
- // Look for the case where we're accessing a style value
123
- jQuery[ type || "attr" ]( this[0], key );
124
- },
125
-
126
- css: function( key, value ) {
127
- return this.attr( key, value, "curCSS" );
128
- },
129
- text: function(e) {
130
- e = e || this;
131
- var t = "";
132
- for ( var j = 0; j < e.length; j++ ) {
133
- var r = e[j].childNodes;
134
- for ( var i = 0; i < r.length; i++ )
135
- if ( r[i].nodeType != 8 )
136
- t += r[i].nodeType != 1 ?
137
- r[i].nodeValue : jQuery.fn.text([ r[i] ]);
138
- }
139
- return t;
140
- },
141
-
142
- wrap: function() {
143
- // The elements to wrap the target around
144
- var a = jQuery.clean(arguments);
145
-
146
- // Wrap each of the matched elements individually
147
- return this.each(function(){
148
- // Clone the structure that we're using to wrap
149
- var b = a[0].cloneNode(true);
150
-
151
- // Insert it before the element to be wrapped
152
- this.parentNode.insertBefore( b, this );
153
-
154
- // Find the deepest point in the wrap structure
155
- while ( b.firstChild )
156
- b = b.firstChild;
157
-
158
- // Move the matched element to within the wrap structure
159
- b.appendChild( this );
160
- });
161
- },
162
-
163
- append: function() {
164
- return this.domManip(arguments, true, 1, function(a){
165
- this.appendChild( a );
166
- });
167
- },
168
-
169
- prepend: function() {
170
- return this.domManip(arguments, true, -1, function(a){
171
- this.insertBefore( a, this.firstChild );
172
- });
173
- },
174
-
175
- before: function() {
176
- return this.domManip(arguments, false, 1, function(a){
177
- this.parentNode.insertBefore( a, this );
178
- });
179
- },
180
-
181
- after: function() {
182
- return this.domManip(arguments, false, -1, function(a){
183
- this.parentNode.insertBefore( a, this.nextSibling );
184
- });
185
- },
186
- end: function() {
187
- return this.get( this.stack.pop() );
188
- },
189
- find: function(t) {
190
- return this.pushStack( jQuery.map( this, function(a){
191
- return jQuery.find(t,a);
192
- }), arguments );
193
- },
194
- clone: function(deep) {
195
- return this.pushStack( jQuery.map( this, function(a){
196
- return a.cloneNode( deep != undefined ? deep : true );
197
- }), arguments );
198
- },
199
-
200
- filter: function(t) {
201
- return this.pushStack(
202
- t.constructor == Array &&
203
- jQuery.map(this,function(a){
204
- for ( var i = 0; i < t.length; i++ )
205
- if ( jQuery.filter(t[i],[a]).r.length )
206
- return a;
207
- }) ||
208
-
209
- t.constructor == Boolean &&
210
- ( t ? this.get() : [] ) ||
211
-
212
- typeof t == "function" &&
213
- jQuery.grep( this, t ) ||
214
-
215
- jQuery.filter(t,this).r, arguments );
216
- },
217
-
218
- not: function(t) {
219
- return this.pushStack( t.constructor == String ?
220
- jQuery.filter(t,this,false).r :
221
- jQuery.grep(this,function(a){ return a != t; }), arguments );
222
- },
223
-
224
- add: function(t) {
225
- return this.pushStack( jQuery.merge( this, t.constructor == String ?
226
- jQuery.find(t) : t.constructor == Array ? t : [t] ), arguments );
227
- },
228
- is: function(expr) {
229
- return expr ? jQuery.filter(expr,this).r.length > 0 : false;
230
- },
231
- domManip: function(args, table, dir, fn){
232
- var clone = this.size() > 1;
233
- var a = jQuery.clean(args);
234
-
235
- return this.each(function(){
236
- var obj = this;
237
-
238
- if ( table && this.nodeName.toUpperCase() == "TABLE" && a[0].nodeName.toUpperCase() != "THEAD" ) {
239
- var tbody = this.getElementsByTagName("tbody");
240
-
241
- if ( !tbody.length ) {
242
- obj = document.createElement("tbody");
243
- this.appendChild( obj );
244
- } else
245
- obj = tbody[0];
246
- }
247
-
248
- for ( var i = ( dir < 0 ? a.length - 1 : 0 );
249
- i != ( dir < 0 ? dir : a.length ); i += dir ) {
250
- fn.apply( obj, [ clone ? a[i].cloneNode(true) : a[i] ] );
251
- }
252
- });
253
- },
254
- pushStack: function(a,args) {
255
- var fn = args && args[args.length-1];
256
- var fn2 = args && args[args.length-2];
257
-
258
- if ( fn && fn.constructor != Function ) fn = null;
259
- if ( fn2 && fn2.constructor != Function ) fn2 = null;
260
-
261
- if ( !fn ) {
262
- if ( !this.stack ) this.stack = [];
263
- this.stack.push( this.get() );
264
- this.get( a );
265
- } else {
266
- var old = this.get();
267
- this.get( a );
268
-
269
- if ( fn2 && a.length || !fn2 )
270
- this.each( fn2 || fn ).get( old );
271
- else
272
- this.get( old ).each( fn );
273
- }
274
-
275
- return this;
276
- }
277
- };
278
-
279
- jQuery.extend = jQuery.fn.extend = function(obj,prop) {
280
- if ( !prop ) { prop = obj; obj = this; }
281
- for ( var i in prop ) obj[i] = prop[i];
282
- return obj;
283
- };
284
-
285
- jQuery.extend({
286
- init: function(){
287
- jQuery.initDone = true;
288
-
289
- jQuery.each( jQuery.macros.axis, function(i,n){
290
- jQuery.fn[ i ] = function(a) {
291
- var ret = jQuery.map(this,n);
292
- if ( a && a.constructor == String )
293
- ret = jQuery.filter(a,ret).r;
294
- return this.pushStack( ret, arguments );
295
- };
296
- });
297
-
298
- jQuery.each( jQuery.macros.to, function(i,n){
299
- jQuery.fn[ i ] = function(){
300
- var a = arguments;
301
- return this.each(function(){
302
- for ( var j = 0; j < a.length; j++ )
303
- jQuery(a[j])[n]( this );
304
- });
305
- };
306
- });
307
-
308
- jQuery.each( jQuery.macros.each, function(i,n){
309
- jQuery.fn[ i ] = function() {
310
- return this.each( n, arguments );
311
- };
312
- });
313
-
314
- jQuery.each( jQuery.macros.filter, function(i,n){
315
- jQuery.fn[ n ] = function(num,fn) {
316
- return this.filter( ":" + n + "(" + num + ")", fn );
317
- };
318
- });
319
-
320
- jQuery.each( jQuery.macros.attr, function(i,n){
321
- n = n || i;
322
- jQuery.fn[ i ] = function(h) {
323
- return h == undefined ?
324
- this.length ? this[0][n] : null :
325
- this.attr( n, h );
326
- };
327
- });
328
-
329
- jQuery.each( jQuery.macros.css, function(i,n){
330
- jQuery.fn[ n ] = function(h) {
331
- return h == undefined ?
332
- ( this.length ? jQuery.css( this[0], n ) : null ) :
333
- this.css( n, h );
334
- };
335
- });
336
-
337
- },
338
- each: function( obj, fn, args ) {
339
- if ( obj.length == undefined )
340
- for ( var i in obj )
341
- fn.apply( obj[i], args || [i, obj[i]] );
342
- else
343
- for ( var i = 0; i < obj.length; i++ )
344
- fn.apply( obj[i], args || [i, obj[i]] );
345
- return obj;
346
- },
347
-
348
- className: {
349
- add: function(o,c){
350
- if (jQuery.className.has(o,c)) return;
351
- o.className += ( o.className ? " " : "" ) + c;
352
- },
353
- remove: function(o,c){
354
- if( !c ) {
355
- o.className = "";
356
- } else {
357
- var classes = o.className.split(" ");
358
- for(var i=0; i<classes.length; i++) {
359
- if(classes[i] == c) {
360
- classes.splice(i, 1);
361
- break;
362
- }
363
- }
364
- o.className = classes.join(' ');
365
- }
366
- },
367
- has: function(e,a) {
368
- if ( e.className != undefined )
369
- e = e.className;
370
- return new RegExp("(^|\\s)" + a + "(\\s|$)").test(e);
371
- }
372
- },
373
- swap: function(e,o,f) {
374
- for ( var i in o ) {
375
- e.style["old"+i] = e.style[i];
376
- e.style[i] = o[i];
377
- }
378
- f.apply( e, [] );
379
- for ( var i in o )
380
- e.style[i] = e.style["old"+i];
381
- },
382
-
383
- css: function(e,p) {
384
- if ( p == "height" || p == "width" ) {
385
- var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];
386
-
387
- for ( var i in d ) {
388
- old["padding" + d[i]] = 0;
389
- old["border" + d[i] + "Width"] = 0;
390
- }
391
-
392
- jQuery.swap( e, old, function() {
393
- if (jQuery.css(e,"display") != "none") {
394
- oHeight = e.offsetHeight;
395
- oWidth = e.offsetWidth;
396
- } else {
397
- e = jQuery(e.cloneNode(true)).css({
398
- visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
399
- }).appendTo(e.parentNode)[0];
400
-
401
- var parPos = jQuery.css(e.parentNode,"position");
402
- if ( parPos == "" || parPos == "static" )
403
- e.parentNode.style.position = "relative";
404
-
405
- oHeight = e.clientHeight;
406
- oWidth = e.clientWidth;
407
-
408
- if ( parPos == "" || parPos == "static" )
409
- e.parentNode.style.position = "static";
410
-
411
- e.parentNode.removeChild(e);
412
- }
413
- });
414
-
415
- return p == "height" ? oHeight : oWidth;
416
- }
417
-
418
- return jQuery.curCSS( e, p );
419
- },
420
-
421
- curCSS: function(elem, prop, force) {
422
- var ret;
423
-
424
- if (prop == 'opacity' && jQuery.browser.msie)
425
- return jQuery.attr(elem.style, 'opacity');
426
-
427
- if (!force && elem.style[prop]) {
428
-
429
- ret = elem.style[prop];
430
-
431
- } else if (elem.currentStyle) {
432
-
433
- var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
434
- ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
435
-
436
- } else if (document.defaultView && document.defaultView.getComputedStyle) {
437
-
438
- prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase();
439
- var cur = document.defaultView.getComputedStyle(elem, null);
440
-
441
- if ( cur )
442
- ret = cur.getPropertyValue(prop);
443
- else if ( prop == 'display' )
444
- ret = 'none';
445
- else
446
- jQuery.swap(elem, { display: 'block' }, function() {
447
- ret = document.defaultView.getComputedStyle(this,null).getPropertyValue(prop);
448
- });
449
-
450
- }
451
-
452
- return ret;
453
- },
454
-
455
- clean: function(a) {
456
- var r = [];
457
- for ( var i = 0; i < a.length; i++ ) {
458
- if ( a[i].constructor == String ) {
459
- // trim whitespace, otherwise indexOf won't work as expected
460
- a[i] = jQuery.trim(a[i]);
461
-
462
- var table = "";
463
-
464
- if ( !a[i].indexOf("<thead") || !a[i].indexOf("<tbody") ) {
465
- table = "thead";
466
- a[i] = "<table>" + a[i] + "</table>";
467
- } else if ( !a[i].indexOf("<tr") ) {
468
- table = "tr";
469
- a[i] = "<table>" + a[i] + "</table>";
470
- } else if ( !a[i].indexOf("<td") || !a[i].indexOf("<th") ) {
471
- table = "td";
472
- a[i] = "<table><tbody><tr>" + a[i] + "</tr></tbody></table>";
473
- }
474
-
475
- var div = document.createElement("div");
476
- div.innerHTML = a[i];
477
-
478
- if ( table ) {
479
- div = div.firstChild;
480
- if ( table != "thead" ) div = div.firstChild;
481
- if ( table == "td" ) div = div.firstChild;
482
- }
483
-
484
- for ( var j = 0; j < div.childNodes.length; j++ )
485
- r.push( div.childNodes[j] );
486
- } else if ( a[i].jquery || a[i].length && !a[i].nodeType )
487
- for ( var k = 0; k < a[i].length; k++ )
488
- r.push( a[i][k] );
489
- else if ( a[i] !== null )
490
- r.push( a[i].nodeType ? a[i] : document.createTextNode(a[i].toString()) );
491
- }
492
- return r;
493
- },
494
-
495
- expr: {
496
- "": "m[2]== '*'||a.nodeName.toUpperCase()==m[2].toUpperCase()",
497
- "#": "a.getAttribute('id')&&a.getAttribute('id')==m[2]",
498
- ":": {
499
- // Position Checks
500
- lt: "i<m[3]-0",
501
- gt: "i>m[3]-0",
502
- nth: "m[3]-0==i",
503
- eq: "m[3]-0==i",
504
- first: "i==0",
505
- last: "i==r.length-1",
506
- even: "i%2==0",
507
- odd: "i%2",
508
-
509
- // Child Checks
510
- "nth-child": "jQuery.sibling(a,m[3]).cur",
511
- "first-child": "jQuery.sibling(a,0).cur",
512
- "last-child": "jQuery.sibling(a,0).last",
513
- "only-child": "jQuery.sibling(a).length==1",
514
-
515
- // Parent Checks
516
- parent: "a.childNodes.length",
517
- empty: "!a.childNodes.length",
518
-
519
- // Text Check
520
- contains: "(a.innerText||a.innerHTML).indexOf(m[3])>=0",
521
-
522
- // Visibility
523
- visible: "a.type!='hidden'&&jQuery.css(a,'display')!='none'&&jQuery.css(a,'visibility')!='hidden'",
524
- hidden: "a.type=='hidden'||jQuery.css(a,'display')=='none'||jQuery.css(a,'visibility')=='hidden'",
525
-
526
- // Form attributes
527
- enabled: "!a.disabled",
528
- disabled: "a.disabled",
529
- checked: "a.checked",
530
- selected: "a.selected || jQuery.attr(a, 'selected')",
531
-
532
- // Form elements
533
- text: "a.type=='text'",
534
- radio: "a.type=='radio'",
535
- checkbox: "a.type=='checkbox'",
536
- file: "a.type=='file'",
537
- password: "a.type=='password'",
538
- submit: "a.type=='submit'",
539
- image: "a.type=='image'",
540
- reset: "a.type=='reset'",
541
- button: "a.type=='button'",
542
- input: "a.nodeName.toLowerCase().match(/input|select|textarea|button/)"
543
- },
544
- ".": "jQuery.className.has(a,m[2])",
545
- "@": {
546
- "=": "z==m[4]",
547
- "!=": "z!=m[4]",
548
- "^=": "z && !z.indexOf(m[4])",
549
- "$=": "z && z.substr(z.length - m[4].length,m[4].length)==m[4]",
550
- "*=": "z && z.indexOf(m[4])>=0",
551
- "": "z"
552
- },
553
- "[": "jQuery.find(m[2],a).length"
554
- },
555
-
556
- token: [
557
- "\\.\\.|/\\.\\.", "a.parentNode",
558
- ">|/", "jQuery.sibling(a.firstChild)",
559
- "\\+", "jQuery.sibling(a).next",
560
- "~", function(a){
561
- var r = [];
562
- var s = jQuery.sibling(a);
563
- if ( s.n > 0 )
564
- for ( var i = s.n; i < s.length; i++ )
565
- r.push( s[i] );
566
- return r;
567
- }
568
- ],
569
- find: function( t, context ) {
570
- // Make sure that the context is a DOM Element
571
- if ( context && context.nodeType == undefined )
572
- context = null;
573
-
574
- // Set the correct context (if none is provided)
575
- context = context || jQuery.context || document;
576
-
577
- if ( t.constructor != String ) return [t];
578
-
579
- if ( !t.indexOf("//") ) {
580
- context = context.documentElement;
581
- t = t.substr(2,t.length);
582
- } else if ( !t.indexOf("/") ) {
583
- context = context.documentElement;
584
- t = t.substr(1,t.length);
585
- // FIX Assume the root element is right :(
586
- if ( t.indexOf("/") >= 1 )
587
- t = t.substr(t.indexOf("/"),t.length);
588
- }
589
-
590
- var ret = [context];
591
- var done = [];
592
- var last = null;
593
-
594
- while ( t.length > 0 && last != t ) {
595
- var r = [];
596
- last = t;
597
-
598
- t = jQuery.trim(t).replace( /^\/\//i, "" );
599
-
600
- var foundToken = false;
601
-
602
- for ( var i = 0; i < jQuery.token.length; i += 2 ) {
603
- if ( foundToken ) continue;
604
-
605
- var re = new RegExp("^(" + jQuery.token[i] + ")");
606
- var m = re.exec(t);
607
-
608
- if ( m ) {
609
- r = ret = jQuery.map( ret, jQuery.token[i+1] );
610
- t = jQuery.trim( t.replace( re, "" ) );
611
- foundToken = true;
612
- }
613
- }
614
-
615
- if ( !foundToken ) {
616
- if ( !t.indexOf(",") || !t.indexOf("|") ) {
617
- if ( ret[0] == context ) ret.shift();
618
- done = jQuery.merge( done, ret );
619
- r = ret = [context];
620
- t = " " + t.substr(1,t.length);
621
- } else {
622
- var re2 = /^([#.]?)([a-z0-9\\*_-]*)/i;
623
- var m = re2.exec(t);
624
-
625
- if ( m[1] == "#" ) {
626
- // Ummm, should make this work in all XML docs
627
- var oid = document.getElementById(m[2]);
628
- r = ret = oid ? [oid] : [];
629
- t = t.replace( re2, "" );
630
- } else {
631
- if ( !m[2] || m[1] == "." ) m[2] = "*";
632
-
633
- for ( var i = 0; i < ret.length; i++ )
634
- r = jQuery.merge( r,
635
- m[2] == "*" ?
636
- jQuery.getAll(ret[i]) :
637
- ret[i].getElementsByTagName(m[2])
638
- );
639
- }
640
- }
641
-
642
- }
643
-
644
- if ( t ) {
645
- var val = jQuery.filter(t,r);
646
- ret = r = val.r;
647
- t = jQuery.trim(val.t);
648
- }
649
- }
650
-
651
- if ( ret && ret[0] == context ) ret.shift();
652
- done = jQuery.merge( done, ret );
653
-
654
- return done;
655
- },
656
-
657
- getAll: function(o,r) {
658
- r = r || [];
659
- var s = o.childNodes;
660
- for ( var i = 0; i < s.length; i++ )
661
- if ( s[i].nodeType == 1 ) {
662
- r.push( s[i] );
663
- jQuery.getAll( s[i], r );
664
- }
665
- return r;
666
- },
667
-
668
- attr: function(elem, name, value){
669
- var fix = {
670
- "for": "htmlFor",
671
- "class": "className",
672
- "float": "cssFloat",
673
- innerHTML: "innerHTML",
674
- className: "className",
675
- value: "value",
676
- disabled: "disabled",
677
- checked: "checked"
678
- };
679
-
680
- // IE actually uses filters for opacity ... elem is actually elem.style
681
- if (name == "opacity" && jQuery.browser.msie && value != undefined) {
682
- // IE has trouble with opacity if it does not have layout
683
- // Would prefer to check element.hasLayout first but don't have access to the element here
684
- elem['zoom'] = 1;
685
- if (value == 1) // Remove filter to avoid more IE weirdness
686
- return elem["filter"] = elem["filter"].replace(/alpha\([^\)]*\)/gi,"");
687
- else
688
- return elem["filter"] = elem["filter"].replace(/alpha\([^\)]*\)/gi,"") + "alpha(opacity=" + value * 100 + ")";
689
- } else if (name == "opacity" && jQuery.browser.msie) {
690
- return elem["filter"] ? parseFloat( elem["filter"].match(/alpha\(opacity=(.*)\)/)[1] )/100 : 1;
691
- }
692
-
693
- // Mozilla doesn't play well with opacity 1
694
- if (name == "opacity" && jQuery.browser.mozilla && value == 1) value = 0.9999;
695
-
696
- if ( fix[name] ) {
697
- if ( value != undefined ) elem[fix[name]] = value;
698
- return elem[fix[name]];
699
- } else if( value == undefined && jQuery.browser.msie && elem.nodeName && elem.nodeName.toUpperCase() == 'FORM' && (name == 'action' || name == 'method') ) {
700
- return elem.getAttributeNode(name).nodeValue;
701
- } else if ( elem.getAttribute != undefined ) {
702
- if ( value != undefined ) elem.setAttribute( name, value );
703
- return elem.getAttribute( name, 2 );
704
- } else {
705
- name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});
706
- if ( value != undefined ) elem[name] = value;
707
- return elem[name];
708
- }
709
- },
710
-
711
- // The regular expressions that power the parsing engine
712
- parse: [
713
- // Match: [@value='test'], [@foo]
714
- "\\[ *(@)S *([!*$^=]*) *('?\"?)(.*?)\\4 *\\]",
715
-
716
- // Match: [div], [div p]
717
- "(\\[)\s*(.*?)\s*\\]",
718
-
719
- // Match: :contains('foo')
720
- "(:)S\\(\"?'?([^\\)]*?)\"?'?\\)",
721
-
722
- // Match: :even, :last-chlid
723
- "([:.#]*)S"
724
- ],
725
-
726
- filter: function(t,r,not) {
727
- // Figure out if we're doing regular, or inverse, filtering
728
- var g = not !== false ? jQuery.grep :
729
- function(a,f) {return jQuery.grep(a,f,true);};
730
-
731
- while ( t && /^[a-z[({<*:.#]/i.test(t) ) {
732
-
733
- var p = jQuery.parse;
734
-
735
- for ( var i = 0; i < p.length; i++ ) {
736
-
737
- // Look for, and replace, string-like sequences
738
- // and finally build a regexp out of it
739
- var re = new RegExp(
740
- "^" + p[i].replace("S", "([a-z*_-][a-z0-9_-]*)"), "i" );
741
-
742
- var m = re.exec( t );
743
-
744
- if ( m ) {
745
- // Re-organize the first match
746
- if ( !i )
747
- m = ["",m[1], m[3], m[2], m[5]];
748
-
749
- // Remove what we just matched
750
- t = t.replace( re, "" );
751
-
752
- break;
753
- }
754
- }
755
-
756
- // :not() is a special case that can be optimized by
757
- // keeping it out of the expression list
758
- if ( m[1] == ":" && m[2] == "not" )
759
- r = jQuery.filter(m[3],r,false).r;
760
-
761
- // Otherwise, find the expression to execute
762
- else {
763
- var f = jQuery.expr[m[1]];
764
- if ( f.constructor != String )
765
- f = jQuery.expr[m[1]][m[2]];
766
-
767
- // Build a custom macro to enclose it
768
- eval("f = function(a,i){" +
769
- ( m[1] == "@" ? "z=jQuery.attr(a,m[3]);" : "" ) +
770
- "return " + f + "}");
771
-
772
- // Execute it against the current filter
773
- r = g( r, f );
774
- }
775
- }
776
-
777
- // Return an array of filtered elements (r)
778
- // and the modified expression string (t)
779
- return { r: r, t: t };
780
- },
781
- trim: function(t){
782
- return t.replace(/^\s+|\s+$/g, "");
783
- },
784
- parents: function( elem ){
785
- var matched = [];
786
- var cur = elem.parentNode;
787
- while ( cur && cur != document ) {
788
- matched.push( cur );
789
- cur = cur.parentNode;
790
- }
791
- return matched;
792
- },
793
- sibling: function(elem, pos, not) {
794
- var elems = [];
795
-
796
- if(elem) {
797
- var siblings = elem.parentNode.childNodes;
798
- for ( var i = 0; i < siblings.length; i++ ) {
799
- if ( not === true && siblings[i] == elem ) continue;
800
-
801
- if ( siblings[i].nodeType == 1 )
802
- elems.push( siblings[i] );
803
- if ( siblings[i] == elem )
804
- elems.n = elems.length - 1;
805
- }
806
- }
807
-
808
- return jQuery.extend( elems, {
809
- last: elems.n == elems.length - 1,
810
- cur: pos == "even" && elems.n % 2 == 0 || pos == "odd" && elems.n % 2 || elems[pos] == elem,
811
- prev: elems[elems.n - 1],
812
- next: elems[elems.n + 1]
813
- });
814
- },
815
- merge: function(first, second) {
816
- var result = [];
817
-
818
- // Move b over to the new array (this helps to avoid
819
- // StaticNodeList instances)
820
- for ( var k = 0; k < first.length; k++ )
821
- result[k] = first[k];
822
-
823
- // Now check for duplicates between a and b and only
824
- // add the unique items
825
- for ( var i = 0; i < second.length; i++ ) {
826
- var noCollision = true;
827
-
828
- // The collision-checking process
829
- for ( var j = 0; j < first.length; j++ )
830
- if ( second[i] == first[j] )
831
- noCollision = false;
832
-
833
- // If the item is unique, add it
834
- if ( noCollision )
835
- result.push( second[i] );
836
- }
837
-
838
- return result;
839
- },
840
- grep: function(elems, fn, inv) {
841
- // If a string is passed in for the function, make a function
842
- // for it (a handy shortcut)
843
- if ( fn.constructor == String )
844
- fn = new Function("a","i","return " + fn);
845
-
846
- var result = [];
847
-
848
- // Go through the array, only saving the items
849
- // that pass the validator function
850
- for ( var i = 0; i < elems.length; i++ )
851
- if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
852
- result.push( elems[i] );
853
-
854
- return result;
855
- },
856
- map: function(elems, fn) {
857
- // If a string is passed in for the function, make a function
858
- // for it (a handy shortcut)
859
- if ( fn.constructor == String )
860
- fn = new Function("a","return " + fn);
861
-
862
- var result = [];
863
-
864
- // Go through the array, translating each of the items to their
865
- // new value (or values).
866
- for ( var i = 0; i < elems.length; i++ ) {
867
- var val = fn(elems[i],i);
868
-
869
- if ( val !== null && val != undefined ) {
870
- if ( val.constructor != Array ) val = [val];
871
- result = jQuery.merge( result, val );
872
- }
873
- }
874
-
875
- return result;
876
- },
877
-
878
- /*
879
- * A number of helper functions used for managing events.
880
- * Many of the ideas behind this code orignated from Dean Edwards' addEvent library.
881
- */
882
- event: {
883
-
884
- // Bind an event to an element
885
- // Original by Dean Edwards
886
- add: function(element, type, handler) {
887
- // For whatever reason, IE has trouble passing the window object
888
- // around, causing it to be cloned in the process
889
- if ( jQuery.browser.msie && element.setInterval != undefined )
890
- element = window;
891
-
892
- // Make sure that the function being executed has a unique ID
893
- if ( !handler.guid )
894
- handler.guid = this.guid++;
895
-
896
- // Init the element's event structure
897
- if (!element.events)
898
- element.events = {};
899
-
900
- // Get the current list of functions bound to this event
901
- var handlers = element.events[type];
902
-
903
- // If it hasn't been initialized yet
904
- if (!handlers) {
905
- // Init the event handler queue
906
- handlers = element.events[type] = {};
907
-
908
- // Remember an existing handler, if it's already there
909
- if (element["on" + type])
910
- handlers[0] = element["on" + type];
911
- }
912
-
913
- // Add the function to the element's handler list
914
- handlers[handler.guid] = handler;
915
-
916
- // And bind the global event handler to the element
917
- element["on" + type] = this.handle;
918
-
919
- // Remember the function in a global list (for triggering)
920
- if (!this.global[type])
921
- this.global[type] = [];
922
- this.global[type].push( element );
923
- },
924
-
925
- guid: 1,
926
- global: {},
927
-
928
- // Detach an event or set of events from an element
929
- remove: function(element, type, handler) {
930
- if (element.events)
931
- if (type && element.events[type])
932
- if ( handler )
933
- delete element.events[type][handler.guid];
934
- else
935
- for ( var i in element.events[type] )
936
- delete element.events[type][i];
937
- else
938
- for ( var j in element.events )
939
- this.remove( element, j );
940
- },
941
-
942
- trigger: function(type,data,element) {
943
- // Touch up the incoming data
944
- data = data || [];
945
-
946
- // Handle a global trigger
947
- if ( !element ) {
948
- var g = this.global[type];
949
- if ( g )
950
- for ( var i = 0; i < g.length; i++ )
951
- this.trigger( type, data, g[i] );
952
-
953
- // Handle triggering a single element
954
- } else if ( element["on" + type] ) {
955
- // Pass along a fake event
956
- data.unshift( this.fix({ type: type, target: element }) );
957
-
958
- // Trigger the event
959
- element["on" + type].apply( element, data );
960
- }
961
- },
962
-
963
- handle: function(event) {
964
- if ( typeof jQuery == "undefined" ) return;
965
-
966
- event = event || jQuery.event.fix( window.event );
967
-
968
- // If no correct event was found, fail
969
- if ( !event ) return;
970
-
971
- var returnValue = true;
972
-
973
- var c = this.events[event.type];
974
-
975
- var args = [].slice.call( arguments, 1 );
976
- args.unshift( event );
977
-
978
- for ( var j in c ) {
979
- if ( c[j].apply( this, args ) === false ) {
980
- event.preventDefault();
981
- event.stopPropagation();
982
- returnValue = false;
983
- }
984
- }
985
-
986
- return returnValue;
987
- },
988
-
989
- fix: function(event) {
990
- if ( event ) {
991
- event.preventDefault = function() {
992
- this.returnValue = false;
993
- };
994
-
995
- event.stopPropagation = function() {
996
- this.cancelBubble = true;
997
- };
998
- }
999
-
1000
- return event;
1001
- }
1002
-
1003
- }
1004
- });
1005
- new function() {
1006
- var b = navigator.userAgent.toLowerCase();
1007
-
1008
- // Figure out what browser is being used
1009
- jQuery.browser = {
1010
- safari: /webkit/.test(b),
1011
- opera: /opera/.test(b),
1012
- msie: /msie/.test(b) && !/opera/.test(b),
1013
- mozilla: /mozilla/.test(b) && !/(compatible|webkit)/.test(b)
1014
- };
1015
-
1016
- // Check to see if the W3C box model is being used
1017
- jQuery.boxModel = !jQuery.browser.msie || document.compatMode == "CSS1Compat";
1018
- };
1019
-
1020
- jQuery.macros = {
1021
- to: {
1022
- appendTo: "append",
1023
- prependTo: "prepend",
1024
- insertBefore: "before",
1025
- insertAfter: "after"
1026
- },
1027
-
1028
- css: "width,height,top,left,position,float,overflow,color,background".split(","),
1029
-
1030
- filter: [ "eq", "lt", "gt", "contains" ],
1031
-
1032
- attr: {
1033
-
1034
- val: "value",
1035
-
1036
- html: "innerHTML",
1037
-
1038
- id: null,
1039
-
1040
- title: null,
1041
-
1042
- name: null,
1043
-
1044
- href: null,
1045
-
1046
- src: null,
1047
-
1048
- rel: null
1049
- },
1050
-
1051
- axis: {
1052
-
1053
- parent: "a.parentNode",
1054
-
1055
- ancestors: jQuery.parents,
1056
-
1057
- parents: jQuery.parents,
1058
-
1059
- next: "jQuery.sibling(a).next",
1060
-
1061
- prev: "jQuery.sibling(a).prev",
1062
-
1063
- siblings: "jQuery.sibling(a, null, true)",
1064
-
1065
- children: "jQuery.sibling(a.firstChild)"
1066
- },
1067
-
1068
- each: {
1069
- removeAttr: function( key ) {
1070
- this.removeAttribute( key );
1071
- },
1072
- show: function(){
1073
- this.style.display = this.oldblock ? this.oldblock : "";
1074
- if ( jQuery.css(this,"display") == "none" )
1075
- this.style.display = "block";
1076
- },
1077
- hide: function(){
1078
- this.oldblock = this.oldblock || jQuery.css(this,"display");
1079
- if ( this.oldblock == "none" )
1080
- this.oldblock = "block";
1081
- this.style.display = "none";
1082
- },
1083
- toggle: function(){
1084
- jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ].apply( jQuery(this), arguments );
1085
- },
1086
- addClass: function(c){
1087
- jQuery.className.add(this,c);
1088
- },
1089
- removeClass: function(c){
1090
- jQuery.className.remove(this,c);
1091
- },
1092
- toggleClass: function( c ){
1093
- jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this,c);
1094
- },
1095
-
1096
- remove: function(a){
1097
- if ( !a || jQuery.filter( a, [this] ).r )
1098
- this.parentNode.removeChild( this );
1099
- },
1100
- empty: function(){
1101
- while ( this.firstChild )
1102
- this.removeChild( this.firstChild );
1103
- },
1104
- bind: function( type, fn ) {
1105
- if ( fn.constructor == String )
1106
- fn = new Function("e", ( !fn.indexOf(".") ? "jQuery(this)" : "return " ) + fn);
1107
- jQuery.event.add( this, type, fn );
1108
- },
1109
-
1110
- unbind: function( type, fn ) {
1111
- jQuery.event.remove( this, type, fn );
1112
- },
1113
- trigger: function( type, data ) {
1114
- jQuery.event.trigger( type, data, this );
1115
- }
1116
- }
1117
- };
1118
-
1119
- jQuery.init();
1120
- jQuery.fn.extend({
1121
-
1122
- // We're overriding the old toggle function, so
1123
- // remember it for later
1124
- _toggle: jQuery.fn.toggle,
1125
- toggle: function(a,b) {
1126
- // If two functions are passed in, we're
1127
- // toggling on a click
1128
- return a && b && a.constructor == Function && b.constructor == Function ? this.click(function(e){
1129
- // Figure out which function to execute
1130
- this.last = this.last == a ? b : a;
1131
-
1132
- // Make sure that clicks stop
1133
- e.preventDefault();
1134
-
1135
- // and execute the function
1136
- return this.last.apply( this, [e] ) || false;
1137
- }) :
1138
-
1139
- // Otherwise, execute the old toggle function
1140
- this._toggle.apply( this, arguments );
1141
- },
1142
- hover: function(f,g) {
1143
-
1144
- // A private function for haandling mouse 'hovering'
1145
- function handleHover(e) {
1146
- // Check if mouse(over|out) are still within the same parent element
1147
- var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
1148
-
1149
- // Traverse up the tree
1150
- while ( p && p != this ) try { p = p.parentNode } catch(e) { p = this; };
1151
-
1152
- // If we actually just moused on to a sub-element, ignore it
1153
- if ( p == this ) return false;
1154
-
1155
- // Execute the right function
1156
- return (e.type == "mouseover" ? f : g).apply(this, [e]);
1157
- }
1158
-
1159
- // Bind the function to the two event listeners
1160
- return this.mouseover(handleHover).mouseout(handleHover);
1161
- },
1162
- ready: function(f) {
1163
- // If the DOM is already ready
1164
- if ( jQuery.isReady )
1165
- // Execute the function immediately
1166
- f.apply( document );
1167
-
1168
- // Otherwise, remember the function for later
1169
- else {
1170
- // Add the function to the wait list
1171
- jQuery.readyList.push( f );
1172
- }
1173
-
1174
- return this;
1175
- }
1176
- });
1177
-
1178
- jQuery.extend({
1179
- /*
1180
- * All the code that makes DOM Ready work nicely.
1181
- */
1182
- isReady: false,
1183
- readyList: [],
1184
-
1185
- // Handle when the DOM is ready
1186
- ready: function() {
1187
- // Make sure that the DOM is not already loaded
1188
- if ( !jQuery.isReady ) {
1189
- // Remember that the DOM is ready
1190
- jQuery.isReady = true;
1191
-
1192
- // If there are functions bound, to execute
1193
- if ( jQuery.readyList ) {
1194
- // Execute all of them
1195
- for ( var i = 0; i < jQuery.readyList.length; i++ )
1196
- jQuery.readyList[i].apply( document );
1197
-
1198
- // Reset the list of functions
1199
- jQuery.readyList = null;
1200
- }
1201
- // Remove event lisenter to avoid memory leak
1202
- if ( jQuery.browser.mozilla || jQuery.browser.opera )
1203
- document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
1204
- }
1205
- }
1206
- });
1207
-
1208
- new function(){
1209
-
1210
- var e = ("blur,focus,load,resize,scroll,unload,click,dblclick," +
1211
- "mousedown,mouseup,mousemove,mouseover,mouseout,change,reset,select," +
1212
- "submit,keydown,keypress,keyup,error").split(",");
1213
-
1214
- // Go through all the event names, but make sure that
1215
- // it is enclosed properly
1216
- for ( var i = 0; i < e.length; i++ ) new function(){
1217
-
1218
- var o = e[i];
1219
-
1220
- // Handle event binding
1221
- jQuery.fn[o] = function(f){
1222
- return f ? this.bind(o, f) : this.trigger(o);
1223
- };
1224
-
1225
- // Handle event unbinding
1226
- jQuery.fn["un"+o] = function(f){ return this.unbind(o, f); };
1227
-
1228
- // Finally, handle events that only fire once
1229
- jQuery.fn["one"+o] = function(f){
1230
- // Attach the event listener
1231
- return this.each(function(){
1232
-
1233
- var count = 0;
1234
-
1235
- // Add the event
1236
- jQuery.event.add( this, o, function(e){
1237
- // If this function has already been executed, stop
1238
- if ( count++ ) return;
1239
-
1240
- // And execute the bound function
1241
- return f.apply(this, [e]);
1242
- });
1243
- });
1244
- };
1245
-
1246
- };
1247
-
1248
- // If Mozilla is used
1249
- if ( jQuery.browser.mozilla || jQuery.browser.opera ) {
1250
- // Use the handy event callback
1251
- document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
1252
-
1253
- // If IE is used, use the excellent hack by Matthias Miller
1254
- // http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
1255
- } else if ( jQuery.browser.msie ) {
1256
-
1257
- // Only works if you document.write() it
1258
- document.write("<scr" + "ipt id=__ie_init defer=true " +
1259
- "src=//:><\/script>");
1260
-
1261
- // Use the defer script hack
1262
- var script = document.getElementById("__ie_init");
1263
- script.onreadystatechange = function() {
1264
- if ( this.readyState != "complete" ) return;
1265
- this.parentNode.removeChild( this );
1266
- jQuery.ready();
1267
- };
1268
-
1269
- // Clear from memory
1270
- script = null;
1271
-
1272
- // If Safari is used
1273
- } else if ( jQuery.browser.safari ) {
1274
- // Continually check to see if the document.readyState is valid
1275
- jQuery.safariTimer = setInterval(function(){
1276
- // loaded and complete are both valid states
1277
- if ( document.readyState == "loaded" ||
1278
- document.readyState == "complete" ) {
1279
-
1280
- // If either one are found, remove the timer
1281
- clearInterval( jQuery.safariTimer );
1282
- jQuery.safariTimer = null;
1283
-
1284
- // and execute any waiting functions
1285
- jQuery.ready();
1286
- }
1287
- }, 10);
1288
- }
1289
-
1290
- // A fallback to window.onload, that will always work
1291
- jQuery.event.add( window, "load", jQuery.ready );
1292
-
1293
- };
1294
-
1295
- // Clean up after IE to avoid memory leaks
1296
- if (jQuery.browser.msie) jQuery(window).unload(function() {
1297
- var event = jQuery.event, global = event.global;
1298
- for (var type in global) {
1299
- var els = global[type], i = els.length;
1300
- if (i>0) do if (type != 'unload') event.remove(els[i-1], type); while (--i);
1301
- }
1302
- });
1303
- jQuery.fn.extend({
1304
-
1305
- // overwrite the old show method
1306
- _show: jQuery.fn.show,
1307
-
1308
- show: function(speed,callback){
1309
- return speed ? this.animate({
1310
- height: "show", width: "show", opacity: "show"
1311
- }, speed, callback) : this._show();
1312
- },
1313
-
1314
- // Overwrite the old hide method
1315
- _hide: jQuery.fn.hide,
1316
-
1317
- hide: function(speed,callback){
1318
- return speed ? this.animate({
1319
- height: "hide", width: "hide", opacity: "hide"
1320
- }, speed, callback) : this._hide();
1321
- },
1322
-
1323
- slideDown: function(speed,callback){
1324
- return this.animate({height: "show"}, speed, callback);
1325
- },
1326
-
1327
- slideUp: function(speed,callback){
1328
- return this.animate({height: "hide"}, speed, callback);
1329
- },
1330
-
1331
- slideToggle: function(speed,callback){
1332
- return this.each(function(){
1333
- var state = jQuery(this).is(":hidden") ? "show" : "hide";
1334
- jQuery(this).animate({height: state}, speed, callback);
1335
- });
1336
- },
1337
-
1338
- fadeIn: function(speed,callback){
1339
- return this.animate({opacity: "show"}, speed, callback);
1340
- },
1341
-
1342
- fadeOut: function(speed,callback){
1343
- return this.animate({opacity: "hide"}, speed, callback);
1344
- },
1345
-
1346
- fadeTo: function(speed,to,callback){
1347
- return this.animate({opacity: to}, speed, callback);
1348
- },
1349
- animate: function(prop,speed,callback) {
1350
- return this.queue(function(){
1351
-
1352
- this.curAnim = prop;
1353
-
1354
- for ( var p in prop ) {
1355
- var e = new jQuery.fx( this, jQuery.speed(speed,callback), p );
1356
- if ( prop[p].constructor == Number )
1357
- e.custom( e.cur(), prop[p] );
1358
- else
1359
- e[ prop[p] ]( prop );
1360
- }
1361
-
1362
- });
1363
- },
1364
- queue: function(type,fn){
1365
- if ( !fn ) {
1366
- fn = type;
1367
- type = "fx";
1368
- }
1369
-
1370
- return this.each(function(){
1371
- if ( !this.queue )
1372
- this.queue = {};
1373
-
1374
- if ( !this.queue[type] )
1375
- this.queue[type] = [];
1376
-
1377
- this.queue[type].push( fn );
1378
-
1379
- if ( this.queue[type].length == 1 )
1380
- fn.apply(this);
1381
- });
1382
- }
1383
-
1384
- });
1385
-
1386
- jQuery.extend({
1387
-
1388
- setAuto: function(e,p) {
1389
- if ( e.notAuto ) return;
1390
-
1391
- if ( p == "height" && e.scrollHeight != parseInt(jQuery.curCSS(e,p)) ) return;
1392
- if ( p == "width" && e.scrollWidth != parseInt(jQuery.curCSS(e,p)) ) return;
1393
-
1394
- // Remember the original height
1395
- var a = e.style[p];
1396
-
1397
- // Figure out the size of the height right now
1398
- var o = jQuery.curCSS(e,p,1);
1399
-
1400
- if ( p == "height" && e.scrollHeight != o ||
1401
- p == "width" && e.scrollWidth != o ) return;
1402
-
1403
- // Set the height to auto
1404
- e.style[p] = e.currentStyle ? "" : "auto";
1405
-
1406
- // See what the size of "auto" is
1407
- var n = jQuery.curCSS(e,p,1);
1408
-
1409
- // Revert back to the original size
1410
- if ( o != n && n != "auto" ) {
1411
- e.style[p] = a;
1412
- e.notAuto = true;
1413
- }
1414
- },
1415
-
1416
- speed: function(s,o) {
1417
- o = o || {};
1418
-
1419
- if ( o.constructor == Function )
1420
- o = { complete: o };
1421
-
1422
- var ss = { slow: 600, fast: 200 };
1423
- o.duration = (s && s.constructor == Number ? s : ss[s]) || 400;
1424
-
1425
- // Queueing
1426
- o.oldComplete = o.complete;
1427
- o.complete = function(){
1428
- jQuery.dequeue(this, "fx");
1429
- if ( o.oldComplete && o.oldComplete.constructor == Function )
1430
- o.oldComplete.apply( this );
1431
- };
1432
-
1433
- return o;
1434
- },
1435
-
1436
- queue: {},
1437
-
1438
- dequeue: function(elem,type){
1439
- type = type || "fx";
1440
-
1441
- if ( elem.queue && elem.queue[type] ) {
1442
- // Remove self
1443
- elem.queue[type].shift();
1444
-
1445
- // Get next function
1446
- var f = elem.queue[type][0];
1447
-
1448
- if ( f ) f.apply( elem );
1449
- }
1450
- },
1451
-
1452
- /*
1453
- * I originally wrote fx() as a clone of moo.fx and in the process
1454
- * of making it small in size the code became illegible to sane
1455
- * people. You've been warned.
1456
- */
1457
-
1458
- fx: function( elem, options, prop ){
1459
-
1460
- var z = this;
1461
-
1462
- // The users options
1463
- z.o = {
1464
- duration: options.duration || 400,
1465
- complete: options.complete,
1466
- step: options.step
1467
- };
1468
-
1469
- // The element
1470
- z.el = elem;
1471
-
1472
- // The styles
1473
- var y = z.el.style;
1474
-
1475
- // Simple function for setting a style value
1476
- z.a = function(){
1477
- if ( options.step )
1478
- options.step.apply( elem, [ z.now ] );
1479
-
1480
- if ( prop == "opacity" )
1481
- jQuery.attr(y, "opacity", z.now); // Let attr handle opacity
1482
- else if ( parseInt(z.now) ) // My hate for IE will never die
1483
- y[prop] = parseInt(z.now) + "px";
1484
-
1485
- y.display = "block";
1486
- };
1487
-
1488
- // Figure out the maximum number to run to
1489
- z.max = function(){
1490
- return parseFloat( jQuery.css(z.el,prop) );
1491
- };
1492
-
1493
- // Get the current size
1494
- z.cur = function(){
1495
- var r = parseFloat( jQuery.curCSS(z.el, prop) );
1496
- return r && r > -10000 ? r : z.max();
1497
- };
1498
-
1499
- // Start an animation from one number to another
1500
- z.custom = function(from,to){
1501
- z.startTime = (new Date()).getTime();
1502
- z.now = from;
1503
- z.a();
1504
-
1505
- z.timer = setInterval(function(){
1506
- z.step(from, to);
1507
- }, 13);
1508
- };
1509
-
1510
- // Simple 'show' function
1511
- z.show = function( p ){
1512
- if ( !z.el.orig ) z.el.orig = {};
1513
-
1514
- // Remember where we started, so that we can go back to it later
1515
- z.el.orig[prop] = this.cur();
1516
-
1517
- // Begin the animation
1518
- if (prop == "opacity")
1519
- z.custom(z.el.orig[prop], 1);
1520
- else
1521
- z.custom(0, z.el.orig[prop]);
1522
-
1523
- // Stupid IE, look what you made me do
1524
- if ( prop != "opacity" )
1525
- y[prop] = "1px";
1526
- };
1527
-
1528
- // Simple 'hide' function
1529
- z.hide = function(){
1530
- if ( !z.el.orig ) z.el.orig = {};
1531
-
1532
- // Remember where we started, so that we can go back to it later
1533
- z.el.orig[prop] = this.cur();
1534
-
1535
- z.o.hide = true;
1536
-
1537
- // Begin the animation
1538
- z.custom(z.el.orig[prop], 0);
1539
- };
1540
-
1541
- // Remember the overflow of the element
1542
- if ( !z.el.oldOverlay )
1543
- z.el.oldOverflow = jQuery.css( z.el, "overflow" );
1544
-
1545
- // Make sure that nothing sneaks out
1546
- y.overflow = "hidden";
1547
-
1548
- // Each step of an animation
1549
- z.step = function(firstNum, lastNum){
1550
- var t = (new Date()).getTime();
1551
-
1552
- if (t > z.o.duration + z.startTime) {
1553
- // Stop the timer
1554
- clearInterval(z.timer);
1555
- z.timer = null;
1556
-
1557
- z.now = lastNum;
1558
- z.a();
1559
-
1560
- z.el.curAnim[ prop ] = true;
1561
-
1562
- var done = true;
1563
- for ( var i in z.el.curAnim )
1564
- if ( z.el.curAnim[i] !== true )
1565
- done = false;
1566
-
1567
- if ( done ) {
1568
- // Reset the overflow
1569
- y.overflow = z.el.oldOverflow;
1570
-
1571
- // Hide the element if the "hide" operation was done
1572
- if ( z.o.hide )
1573
- y.display = 'none';
1574
-
1575
- // Reset the property, if the item has been hidden
1576
- if ( z.o.hide ) {
1577
- for ( var p in z.el.curAnim ) {
1578
- if (p == "opacity" && jQuery.browser.msie)
1579
- jQuery.attr(y, p, z.el.orig[p]);
1580
- else
1581
- y[ p ] = z.el.orig[p] + "px";
1582
-
1583
- // set its height and/or width to auto
1584
- if ( p == 'height' || p == 'width' )
1585
- jQuery.setAuto( z.el, p );
1586
- }
1587
- }
1588
- }
1589
-
1590
- // If a callback was provided, execute it
1591
- if( done && z.o.complete && z.o.complete.constructor == Function )
1592
- // Execute the complete function
1593
- z.o.complete.apply( z.el );
1594
- } else {
1595
- // Figure out where in the animation we are and set the number
1596
- var p = (t - this.startTime) / z.o.duration;
1597
- z.now = ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum;
1598
-
1599
- // Perform the next step of the animation
1600
- z.a();
1601
- }
1602
- };
1603
-
1604
- }
1605
-
1606
- });
1607
- jQuery.fn.extend({
1608
- loadIfModified: function( url, params, callback ) {
1609
- this.load( url, params, callback, 1 );
1610
- },
1611
- load: function( url, params, callback, ifModified ) {
1612
- if ( url.constructor == Function )
1613
- return this.bind("load", url);
1614
-
1615
- callback = callback || function(){};
1616
-
1617
- // Default to a GET request
1618
- var type = "GET";
1619
-
1620
- // If the second parameter was provided
1621
- if ( params ) {
1622
- // If it's a function
1623
- if ( params.constructor == Function ) {
1624
- // We assume that it's the callback
1625
- callback = params;
1626
- params = null;
1627
-
1628
- // Otherwise, build a param string
1629
- } else {
1630
- params = jQuery.param( params );
1631
- type = "POST";
1632
- }
1633
- }
1634
-
1635
- var self = this;
1636
-
1637
- // Request the remote document
1638
- jQuery.ajax( type, url, params,function(res, status){
1639
-
1640
- if ( status == "success" || !ifModified && status == "notmodified" ) {
1641
- // Inject the HTML into all the matched elements
1642
- self.html(res.responseText).each( callback, [res.responseText, status] );
1643
-
1644
- // Execute all the scripts inside of the newly-injected HTML
1645
- jQuery("script", self).each(function(){
1646
- if ( this.src )
1647
- jQuery.getScript( this.src );
1648
- else
1649
- eval.call( window, this.text || this.textContent || this.innerHTML || "" );
1650
- });
1651
- } else
1652
- callback.apply( self, [res.responseText, status] );
1653
-
1654
- }, ifModified);
1655
-
1656
- return this;
1657
- },
1658
- serialize: function() {
1659
- return jQuery.param( this );
1660
- }
1661
-
1662
- });
1663
-
1664
- // If IE is used, create a wrapper for the XMLHttpRequest object
1665
- if ( jQuery.browser.msie && typeof XMLHttpRequest == "undefined" )
1666
- XMLHttpRequest = function(){
1667
- return new ActiveXObject(
1668
- navigator.userAgent.indexOf("MSIE 5") >= 0 ?
1669
- "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP"
1670
- );
1671
- };
1672
-
1673
- // Attach a bunch of functions for handling common AJAX events
1674
-
1675
-
1676
-
1677
- new function(){
1678
- var e = "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess".split(",");
1679
-
1680
- for ( var i = 0; i < e.length; i++ ) new function(){
1681
- var o = e[i];
1682
- jQuery.fn[o] = function(f){
1683
- return this.bind(o, f);
1684
- };
1685
- };
1686
- };
1687
-
1688
- jQuery.extend({
1689
- get: function( url, data, callback, type, ifModified ) {
1690
- if ( data.constructor == Function ) {
1691
- type = callback;
1692
- callback = data;
1693
- data = null;
1694
- }
1695
-
1696
- // append ? + data or & + data, in case there are already params
1697
- if ( data ) url += ((url.indexOf("?") > -1) ? "&" : "?") + jQuery.param(data);
1698
-
1699
- // Build and start the HTTP Request
1700
- jQuery.ajax( "GET", url, null, function(r, status) {
1701
- if ( callback ) callback( jQuery.httpData(r,type), status );
1702
- }, ifModified);
1703
- },
1704
- getIfModified: function( url, data, callback, type ) {
1705
- jQuery.get(url, data, callback, type, 1);
1706
- },
1707
- getScript: function( url, callback ) {
1708
- jQuery.get(url, callback, "script");
1709
- },
1710
- getJSON: function( url, data, callback ) {
1711
- if(callback)
1712
- jQuery.get(url, data, callback, "json");
1713
- else {
1714
- jQuery.get(url, data, "json");
1715
- }
1716
- },
1717
- post: function( url, data, callback, type ) {
1718
- // Build and start the HTTP Request
1719
- jQuery.ajax( "POST", url, jQuery.param(data), function(r, status) {
1720
- if ( callback ) callback( jQuery.httpData(r,type), status );
1721
- });
1722
- },
1723
-
1724
- // timeout (ms)
1725
- timeout: 0,
1726
- ajaxTimeout: function(timeout) {
1727
- jQuery.timeout = timeout;
1728
- },
1729
-
1730
- // Last-Modified header cache for next request
1731
- lastModified: {},
1732
- ajax: function( type, url, data, ret, ifModified ) {
1733
- // If only a single argument was passed in,
1734
- // assume that it is a object of key/value pairs
1735
- if ( !url ) {
1736
- ret = type.complete;
1737
- var success = type.success;
1738
- var error = type.error;
1739
- var dataType = type.dataType;
1740
- var global = typeof type.global == "boolean" ? type.global : true;
1741
- var timeout = typeof type.timeout == "number" ? type.timeout : jQuery.timeout;
1742
- var ifModified = type.ifModified || false;
1743
- data = type.data;
1744
- url = type.url;
1745
- type = type.type;
1746
- }
1747
-
1748
- // Watch for a new set of requests
1749
- if ( global && ! jQuery.active++ )
1750
- jQuery.event.trigger( "ajaxStart" );
1751
-
1752
- var requestDone = false;
1753
-
1754
- // Create the request object
1755
- var xml = new XMLHttpRequest();
1756
-
1757
- // Open the socket
1758
- xml.open(type || "GET", url, true);
1759
-
1760
- // Set the correct header, if data is being sent
1761
- if ( data )
1762
- xml.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
1763
-
1764
- // Set the If-Modified-Since header, if ifModified mode.
1765
- if ( ifModified )
1766
- xml.setRequestHeader("If-Modified-Since",
1767
- jQuery.lastModified[url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
1768
-
1769
- // Set header so the called script knows that it's an XMLHttpRequest
1770
- xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
1771
-
1772
- // Make sure the browser sends the right content length
1773
- if ( xml.overrideMimeType )
1774
- xml.setRequestHeader("Connection", "close");
1775
-
1776
- // Wait for a response to come back
1777
- var onreadystatechange = function(istimeout){
1778
- // The transfer is complete and the data is available, or the request timed out
1779
- if ( xml && (xml.readyState == 4 || istimeout == "timeout") ) {
1780
- requestDone = true;
1781
-
1782
- var status = jQuery.httpSuccess( xml ) && istimeout != "timeout" ?
1783
- ifModified && jQuery.httpNotModified( xml, url ) ? "notmodified" : "success" : "error";
1784
-
1785
- // Make sure that the request was successful or notmodified
1786
- if ( status != "error" ) {
1787
- // Cache Last-Modified header, if ifModified mode.
1788
- var modRes;
1789
- try {
1790
- modRes = xml.getResponseHeader("Last-Modified");
1791
- } catch(e) {} // swallow exception thrown by FF if header is not available
1792
-
1793
- if ( ifModified && modRes )
1794
- jQuery.lastModified[url] = modRes;
1795
-
1796
- // If a local callback was specified, fire it
1797
- if ( success )
1798
- success( jQuery.httpData( xml, dataType ), status );
1799
-
1800
- // Fire the global callback
1801
- if( global )
1802
- jQuery.event.trigger( "ajaxSuccess" );
1803
-
1804
- // Otherwise, the request was not successful
1805
- } else {
1806
- // If a local callback was specified, fire it
1807
- if ( error ) error( xml, status );
1808
-
1809
- // Fire the global callback
1810
- if( global )
1811
- jQuery.event.trigger( "ajaxError" );
1812
- }
1813
-
1814
- // The request was completed
1815
- if( global )
1816
- jQuery.event.trigger( "ajaxComplete" );
1817
-
1818
- // Handle the global AJAX counter
1819
- if ( global && ! --jQuery.active )
1820
- jQuery.event.trigger( "ajaxStop" );
1821
-
1822
- // Process result
1823
- if ( ret ) ret(xml, status);
1824
-
1825
- // Stop memory leaks
1826
- xml.onreadystatechange = function(){};
1827
- xml = null;
1828
-
1829
- }
1830
- };
1831
- xml.onreadystatechange = onreadystatechange;
1832
-
1833
- // Timeout checker
1834
- if(timeout > 0)
1835
- setTimeout(function(){
1836
- // Check to see if the request is still happening
1837
- if (xml) {
1838
- // Cancel the request
1839
- xml.abort();
1840
-
1841
- if ( !requestDone ) onreadystatechange( "timeout" );
1842
-
1843
- // Clear from memory
1844
- xml = null;
1845
- }
1846
- }, timeout);
1847
-
1848
- // Send the data
1849
- xml.send(data);
1850
- },
1851
-
1852
- // Counter for holding the number of active queries
1853
- active: 0,
1854
-
1855
- // Determines if an XMLHttpRequest was successful or not
1856
- httpSuccess: function(r) {
1857
- try {
1858
- return !r.status && location.protocol == "file:" ||
1859
- ( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
1860
- jQuery.browser.safari && r.status == undefined;
1861
- } catch(e){}
1862
-
1863
- return false;
1864
- },
1865
-
1866
- // Determines if an XMLHttpRequest returns NotModified
1867
- httpNotModified: function(xml, url) {
1868
- try {
1869
- var xmlRes = xml.getResponseHeader("Last-Modified");
1870
-
1871
- // Firefox always returns 200. check Last-Modified date
1872
- return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
1873
- jQuery.browser.safari && xml.status == undefined;
1874
- } catch(e){}
1875
-
1876
- return false;
1877
- },
1878
-
1879
- /* Get the data out of an XMLHttpRequest.
1880
- * Return parsed XML if content-type header is "xml" and type is "xml" or omitted,
1881
- * otherwise return plain text.
1882
- * (String) data - The type of data that you're expecting back,
1883
- * (e.g. "xml", "html", "script")
1884
- */
1885
- httpData: function(r,type) {
1886
- var ct = r.getResponseHeader("content-type");
1887
- var data = !type && ct && ct.indexOf("xml") >= 0;
1888
- data = type == "xml" || data ? r.responseXML : r.responseText;
1889
-
1890
- // If the type is "script", eval it
1891
- if ( type == "script" ) eval.call( window, data );
1892
-
1893
- // Get the JavaScript object, if JSON is used.
1894
- if ( type == "json" ) eval( "data = " + data );
1895
-
1896
- return data;
1897
- },
1898
-
1899
- // Serialize an array of form elements or a set of
1900
- // key/values into a query string
1901
- param: function(a) {
1902
- var s = [];
1903
-
1904
- // If an array was passed in, assume that it is an array
1905
- // of form elements
1906
- if ( a.constructor == Array || a.jquery ) {
1907
- // Serialize the form elements
1908
- for ( var i = 0; i < a.length; i++ )
1909
- s.push( a[i].name + "=" + encodeURIComponent( a[i].value ) );
1910
-
1911
- // Otherwise, assume that it's an object of key/value pairs
1912
- } else {
1913
- // Serialize the key/values
1914
- for ( var j in a )
1915
- s.push( j + "=" + encodeURIComponent( a[j] ) );
1916
- }
1917
-
1918
- // Return the resulting serialization
1919
- return s.join("&");
1920
- }
1921
-
1922
- });
1923
- } // close: if(typeof window.jQuery == "undefined") {