bloggit 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. data/History +4 -0
  2. data/Manifest +422 -0
  3. data/Rakefile +64 -0
  4. data/ReadMe +69 -0
  5. data/Todo +26 -0
  6. data/bin/bloggit +5 -0
  7. data/docs/index.html +57 -0
  8. data/docs/specifications.html +100 -0
  9. data/docs/src/_layout.rhtml +53 -0
  10. data/docs/src/index.markdown +5 -0
  11. data/docs/src/specifications.markdown +48 -0
  12. data/lib/bloggit.rb +28 -0
  13. data/lib/bloggit/boilerplate/Rakefile +2 -0
  14. data/lib/bloggit/boilerplate/pages/about.page +5 -0
  15. data/lib/bloggit/boilerplate/plugins/haloscan/init.rb +5 -0
  16. data/lib/bloggit/boilerplate/settings.yml +28 -0
  17. data/lib/bloggit/boilerplate/themes/default/styles/main.css +145 -0
  18. data/lib/bloggit/boilerplate/themes/default/templates/archive.rhtml +20 -0
  19. data/lib/bloggit/boilerplate/themes/default/templates/home.rhtml +6 -0
  20. data/lib/bloggit/boilerplate/themes/default/templates/layouts/main.rhtml +15 -0
  21. data/lib/bloggit/boilerplate/themes/default/templates/layouts/two-columns.rhtml +21 -0
  22. data/lib/bloggit/boilerplate/themes/default/templates/page.rhtml +8 -0
  23. data/lib/bloggit/boilerplate/themes/default/templates/post.rhtml +3 -0
  24. data/lib/bloggit/boilerplate/themes/default/templates/snippets/blog_entry.rhtml +16 -0
  25. data/lib/bloggit/boilerplate/themes/default/templates/snippets/navigation.rhtml +12 -0
  26. data/lib/bloggit/boilerplate/themes/default/templates/snippets/tag_list.rhtml +9 -0
  27. data/lib/bloggit/boilerplate/themes/default/templates/tag_archive.rhtml +38 -0
  28. data/lib/bloggit/checksum.rb +39 -0
  29. data/lib/bloggit/client/index.html +2 -0
  30. data/lib/bloggit/client/scripts/adapter/jquery/ext-jquery-adapter.js +12 -0
  31. data/lib/bloggit/client/scripts/adapter/jquery/jquery-plugins.js +965 -0
  32. data/lib/bloggit/client/scripts/adapter/jquery/jquery.js +2201 -0
  33. data/lib/bloggit/client/scripts/adapter/prototype/effects.js +1098 -0
  34. data/lib/bloggit/client/scripts/adapter/prototype/ext-prototype-adapter.js +12 -0
  35. data/lib/bloggit/client/scripts/adapter/prototype/prototype.js +2523 -0
  36. data/lib/bloggit/client/scripts/adapter/prototype/scriptaculous.js +59 -0
  37. data/lib/bloggit/client/scripts/adapter/yui/ext-yui-adapter.js +12 -0
  38. data/lib/bloggit/client/scripts/adapter/yui/yui-utilities.js +18 -0
  39. data/lib/bloggit/client/scripts/app.js +121 -0
  40. data/lib/bloggit/client/scripts/ext-all.js +256 -0
  41. data/lib/bloggit/client/scripts/resources/css/README.txt +3 -0
  42. data/lib/bloggit/client/scripts/resources/css/basic-dialog.css +286 -0
  43. data/lib/bloggit/client/scripts/resources/css/box.css +111 -0
  44. data/lib/bloggit/client/scripts/resources/css/button.css +148 -0
  45. data/lib/bloggit/client/scripts/resources/css/combo.css +46 -0
  46. data/lib/bloggit/client/scripts/resources/css/core.css +290 -0
  47. data/lib/bloggit/client/scripts/resources/css/date-picker.css +155 -0
  48. data/lib/bloggit/client/scripts/resources/css/dd.css +61 -0
  49. data/lib/bloggit/client/scripts/resources/css/debug.css +55 -0
  50. data/lib/bloggit/client/scripts/resources/css/ext-all.css +3167 -0
  51. data/lib/bloggit/client/scripts/resources/css/form.css +359 -0
  52. data/lib/bloggit/client/scripts/resources/css/grid.css +295 -0
  53. data/lib/bloggit/client/scripts/resources/css/layout.css +252 -0
  54. data/lib/bloggit/client/scripts/resources/css/menu.css +116 -0
  55. data/lib/bloggit/client/scripts/resources/css/panel.css +258 -0
  56. data/lib/bloggit/client/scripts/resources/css/qtips.css +119 -0
  57. data/lib/bloggit/client/scripts/resources/css/reset-min.css +9 -0
  58. data/lib/bloggit/client/scripts/resources/css/resizable.css +143 -0
  59. data/lib/bloggit/client/scripts/resources/css/tabs.css +134 -0
  60. data/lib/bloggit/client/scripts/resources/css/toolbar.css +160 -0
  61. data/lib/bloggit/client/scripts/resources/css/tree.css +179 -0
  62. data/lib/bloggit/client/scripts/resources/css/window.css +155 -0
  63. data/lib/bloggit/client/scripts/resources/css/ytheme-aero.css +581 -0
  64. data/lib/bloggit/client/scripts/resources/css/ytheme-gray.css +438 -0
  65. data/lib/bloggit/client/scripts/resources/css/ytheme-vista.css +511 -0
  66. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/aero-close-over.gif +0 -0
  67. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/aero-close.gif +0 -0
  68. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/bg-center.gif +0 -0
  69. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/bg-left.gif +0 -0
  70. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/bg-right.gif +0 -0
  71. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/close.gif +0 -0
  72. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/collapse-over.gif +0 -0
  73. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/collapse.gif +0 -0
  74. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/e-handle.gif +0 -0
  75. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/expand-over.gif +0 -0
  76. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/expand.gif +0 -0
  77. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/hd-sprite.gif +0 -0
  78. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/s-handle.gif +0 -0
  79. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/se-handle.gif +0 -0
  80. data/lib/bloggit/client/scripts/resources/images/aero/basic-dialog/w-handle.gif +0 -0
  81. data/lib/bloggit/client/scripts/resources/images/aero/gradient-bg.gif +0 -0
  82. data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-blue-split.gif +0 -0
  83. data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-hrow.gif +0 -0
  84. data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-split.gif +0 -0
  85. data/lib/bloggit/client/scripts/resources/images/aero/grid/grid-vista-hd.gif +0 -0
  86. data/lib/bloggit/client/scripts/resources/images/aero/grid/pspbrwse.jbf +0 -0
  87. data/lib/bloggit/client/scripts/resources/images/aero/grid/sort-col-bg.gif +0 -0
  88. data/lib/bloggit/client/scripts/resources/images/aero/grid/sort_asc.gif +0 -0
  89. data/lib/bloggit/client/scripts/resources/images/aero/grid/sort_desc.gif +0 -0
  90. data/lib/bloggit/client/scripts/resources/images/aero/layout/collapse.gif +0 -0
  91. data/lib/bloggit/client/scripts/resources/images/aero/layout/expand.gif +0 -0
  92. data/lib/bloggit/client/scripts/resources/images/aero/layout/gradient-bg.gif +0 -0
  93. data/lib/bloggit/client/scripts/resources/images/aero/layout/ns-collapse.gif +0 -0
  94. data/lib/bloggit/client/scripts/resources/images/aero/layout/ns-expand.gif +0 -0
  95. data/lib/bloggit/client/scripts/resources/images/aero/layout/panel-close.gif +0 -0
  96. data/lib/bloggit/client/scripts/resources/images/aero/layout/panel-title-bg.gif +0 -0
  97. data/lib/bloggit/client/scripts/resources/images/aero/layout/panel-title-light-bg.gif +0 -0
  98. data/lib/bloggit/client/scripts/resources/images/aero/layout/tab-close-on.gif +0 -0
  99. data/lib/bloggit/client/scripts/resources/images/aero/layout/tab-close.gif +0 -0
  100. data/lib/bloggit/client/scripts/resources/images/aero/qtip/bg.gif +0 -0
  101. data/lib/bloggit/client/scripts/resources/images/aero/s.gif +0 -0
  102. data/lib/bloggit/client/scripts/resources/images/aero/sizer/e-handle-dark.gif +0 -0
  103. data/lib/bloggit/client/scripts/resources/images/aero/sizer/e-handle.gif +0 -0
  104. data/lib/bloggit/client/scripts/resources/images/aero/sizer/ne-handle-dark.gif +0 -0
  105. data/lib/bloggit/client/scripts/resources/images/aero/sizer/ne-handle.gif +0 -0
  106. data/lib/bloggit/client/scripts/resources/images/aero/sizer/nw-handle-dark.gif +0 -0
  107. data/lib/bloggit/client/scripts/resources/images/aero/sizer/nw-handle.gif +0 -0
  108. data/lib/bloggit/client/scripts/resources/images/aero/sizer/s-handle-dark.gif +0 -0
  109. data/lib/bloggit/client/scripts/resources/images/aero/sizer/s-handle.gif +0 -0
  110. data/lib/bloggit/client/scripts/resources/images/aero/sizer/se-handle-dark.gif +0 -0
  111. data/lib/bloggit/client/scripts/resources/images/aero/sizer/se-handle.gif +0 -0
  112. data/lib/bloggit/client/scripts/resources/images/aero/sizer/sw-handle-dark.gif +0 -0
  113. data/lib/bloggit/client/scripts/resources/images/aero/sizer/sw-handle.gif +0 -0
  114. data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-inactive-left-bg.gif +0 -0
  115. data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-inactive-right-bg.gif +0 -0
  116. data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-left-bg.gif +0 -0
  117. data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-btm-right-bg.gif +0 -0
  118. data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-sprite.gif +0 -0
  119. data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-strip-bg.gif +0 -0
  120. data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-strip-bg.png +0 -0
  121. data/lib/bloggit/client/scripts/resources/images/aero/tabs/tab-strip-btm-bg.gif +0 -0
  122. data/lib/bloggit/client/scripts/resources/images/aero/toolbar/bg.gif +0 -0
  123. data/lib/bloggit/client/scripts/resources/images/aero/toolbar/tb-btn-sprite.gif +0 -0
  124. data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/btn-arrow.gif +0 -0
  125. data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/btn-sprite.gif +0 -0
  126. data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/close.gif +0 -0
  127. data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/collapse.gif +0 -0
  128. data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/e-handle.gif +0 -0
  129. data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/expand.gif +0 -0
  130. data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/hd-sprite.gif +0 -0
  131. data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/progress.gif +0 -0
  132. data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/progress2.gif +0 -0
  133. data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/s-handle.gif +0 -0
  134. data/lib/bloggit/client/scripts/resources/images/default/basic-dialog/se-handle.gif +0 -0
  135. data/lib/bloggit/client/scripts/resources/images/default/box/corners-blue.gif +0 -0
  136. data/lib/bloggit/client/scripts/resources/images/default/box/corners.gif +0 -0
  137. data/lib/bloggit/client/scripts/resources/images/default/box/l-blue.gif +0 -0
  138. data/lib/bloggit/client/scripts/resources/images/default/box/l.gif +0 -0
  139. data/lib/bloggit/client/scripts/resources/images/default/box/r-blue.gif +0 -0
  140. data/lib/bloggit/client/scripts/resources/images/default/box/r.gif +0 -0
  141. data/lib/bloggit/client/scripts/resources/images/default/box/tb-blue.gif +0 -0
  142. data/lib/bloggit/client/scripts/resources/images/default/box/tb.gif +0 -0
  143. data/lib/bloggit/client/scripts/resources/images/default/dd/drop-add.gif +0 -0
  144. data/lib/bloggit/client/scripts/resources/images/default/dd/drop-no.gif +0 -0
  145. data/lib/bloggit/client/scripts/resources/images/default/dd/drop-yes.gif +0 -0
  146. data/lib/bloggit/client/scripts/resources/images/default/form/date-trigger.gif +0 -0
  147. data/lib/bloggit/client/scripts/resources/images/default/form/error-tip-corners.gif +0 -0
  148. data/lib/bloggit/client/scripts/resources/images/default/form/exclamation.gif +0 -0
  149. data/lib/bloggit/client/scripts/resources/images/default/form/text-bg.gif +0 -0
  150. data/lib/bloggit/client/scripts/resources/images/default/form/trigger.gif +0 -0
  151. data/lib/bloggit/client/scripts/resources/images/default/gradient-bg.gif +0 -0
  152. data/lib/bloggit/client/scripts/resources/images/default/grid/Thumbs.db +0 -0
  153. data/lib/bloggit/client/scripts/resources/images/default/grid/arrow-left-white.gif +0 -0
  154. data/lib/bloggit/client/scripts/resources/images/default/grid/arrow-right-white.gif +0 -0
  155. data/lib/bloggit/client/scripts/resources/images/default/grid/col-move-bottom.gif +0 -0
  156. data/lib/bloggit/client/scripts/resources/images/default/grid/col-move-top.gif +0 -0
  157. data/lib/bloggit/client/scripts/resources/images/default/grid/dirty.gif +0 -0
  158. data/lib/bloggit/client/scripts/resources/images/default/grid/done.gif +0 -0
  159. data/lib/bloggit/client/scripts/resources/images/default/grid/drop-no.gif +0 -0
  160. data/lib/bloggit/client/scripts/resources/images/default/grid/drop-yes.gif +0 -0
  161. data/lib/bloggit/client/scripts/resources/images/default/grid/footer-bg.gif +0 -0
  162. data/lib/bloggit/client/scripts/resources/images/default/grid/grid-blue-hd.gif +0 -0
  163. data/lib/bloggit/client/scripts/resources/images/default/grid/grid-blue-split.gif +0 -0
  164. data/lib/bloggit/client/scripts/resources/images/default/grid/grid-hrow.gif +0 -0
  165. data/lib/bloggit/client/scripts/resources/images/default/grid/grid-loading.gif +0 -0
  166. data/lib/bloggit/client/scripts/resources/images/default/grid/grid-split.gif +0 -0
  167. data/lib/bloggit/client/scripts/resources/images/default/grid/grid-vista-hd.gif +0 -0
  168. data/lib/bloggit/client/scripts/resources/images/default/grid/hd-pop.gif +0 -0
  169. data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-asc.gif +0 -0
  170. data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-desc.gif +0 -0
  171. data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-lock.gif +0 -0
  172. data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-lock.png +0 -0
  173. data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-unlock.gif +0 -0
  174. data/lib/bloggit/client/scripts/resources/images/default/grid/hmenu-unlock.png +0 -0
  175. data/lib/bloggit/client/scripts/resources/images/default/grid/invalid_line.gif +0 -0
  176. data/lib/bloggit/client/scripts/resources/images/default/grid/loading.gif +0 -0
  177. data/lib/bloggit/client/scripts/resources/images/default/grid/mso-hd.gif +0 -0
  178. data/lib/bloggit/client/scripts/resources/images/default/grid/nowait.gif +0 -0
  179. data/lib/bloggit/client/scripts/resources/images/default/grid/page-first-disabled.gif +0 -0
  180. data/lib/bloggit/client/scripts/resources/images/default/grid/page-first.gif +0 -0
  181. data/lib/bloggit/client/scripts/resources/images/default/grid/page-last-disabled.gif +0 -0
  182. data/lib/bloggit/client/scripts/resources/images/default/grid/page-last.gif +0 -0
  183. data/lib/bloggit/client/scripts/resources/images/default/grid/page-next-disabled.gif +0 -0
  184. data/lib/bloggit/client/scripts/resources/images/default/grid/page-next.gif +0 -0
  185. data/lib/bloggit/client/scripts/resources/images/default/grid/page-prev-disabled.gif +0 -0
  186. data/lib/bloggit/client/scripts/resources/images/default/grid/page-prev.gif +0 -0
  187. data/lib/bloggit/client/scripts/resources/images/default/grid/pick-button.gif +0 -0
  188. data/lib/bloggit/client/scripts/resources/images/default/grid/refresh.gif +0 -0
  189. data/lib/bloggit/client/scripts/resources/images/default/grid/sort_asc.gif +0 -0
  190. data/lib/bloggit/client/scripts/resources/images/default/grid/sort_desc.gif +0 -0
  191. data/lib/bloggit/client/scripts/resources/images/default/grid/wait.gif +0 -0
  192. data/lib/bloggit/client/scripts/resources/images/default/layout/collapse.gif +0 -0
  193. data/lib/bloggit/client/scripts/resources/images/default/layout/expand.gif +0 -0
  194. data/lib/bloggit/client/scripts/resources/images/default/layout/gradient-bg.gif +0 -0
  195. data/lib/bloggit/client/scripts/resources/images/default/layout/ns-collapse.gif +0 -0
  196. data/lib/bloggit/client/scripts/resources/images/default/layout/ns-expand.gif +0 -0
  197. data/lib/bloggit/client/scripts/resources/images/default/layout/panel-close.gif +0 -0
  198. data/lib/bloggit/client/scripts/resources/images/default/layout/panel-title-bg.gif +0 -0
  199. data/lib/bloggit/client/scripts/resources/images/default/layout/panel-title-light-bg.gif +0 -0
  200. data/lib/bloggit/client/scripts/resources/images/default/layout/stick.gif +0 -0
  201. data/lib/bloggit/client/scripts/resources/images/default/layout/stuck.gif +0 -0
  202. data/lib/bloggit/client/scripts/resources/images/default/layout/tab-close-on.gif +0 -0
  203. data/lib/bloggit/client/scripts/resources/images/default/layout/tab-close.gif +0 -0
  204. data/lib/bloggit/client/scripts/resources/images/default/menu/checked.gif +0 -0
  205. data/lib/bloggit/client/scripts/resources/images/default/menu/group-checked.gif +0 -0
  206. data/lib/bloggit/client/scripts/resources/images/default/menu/menu-parent.gif +0 -0
  207. data/lib/bloggit/client/scripts/resources/images/default/menu/menu.gif +0 -0
  208. data/lib/bloggit/client/scripts/resources/images/default/menu/unchecked.gif +0 -0
  209. data/lib/bloggit/client/scripts/resources/images/default/qtip/bg.gif +0 -0
  210. data/lib/bloggit/client/scripts/resources/images/default/qtip/close.gif +0 -0
  211. data/lib/bloggit/client/scripts/resources/images/default/qtip/tip-sprite.gif +0 -0
  212. data/lib/bloggit/client/scripts/resources/images/default/s.gif +0 -0
  213. data/lib/bloggit/client/scripts/resources/images/default/shadow-c.png +0 -0
  214. data/lib/bloggit/client/scripts/resources/images/default/shadow-lr.png +0 -0
  215. data/lib/bloggit/client/scripts/resources/images/default/shadow.png +0 -0
  216. data/lib/bloggit/client/scripts/resources/images/default/shared/calendar.gif +0 -0
  217. data/lib/bloggit/client/scripts/resources/images/default/shared/left-btn.gif +0 -0
  218. data/lib/bloggit/client/scripts/resources/images/default/shared/right-btn.gif +0 -0
  219. data/lib/bloggit/client/scripts/resources/images/default/shared/warning.gif +0 -0
  220. data/lib/bloggit/client/scripts/resources/images/default/sizer/e-handle-dark.gif +0 -0
  221. data/lib/bloggit/client/scripts/resources/images/default/sizer/e-handle.gif +0 -0
  222. data/lib/bloggit/client/scripts/resources/images/default/sizer/ne-handle-dark.gif +0 -0
  223. data/lib/bloggit/client/scripts/resources/images/default/sizer/ne-handle.gif +0 -0
  224. data/lib/bloggit/client/scripts/resources/images/default/sizer/nw-handle-dark.gif +0 -0
  225. data/lib/bloggit/client/scripts/resources/images/default/sizer/nw-handle.gif +0 -0
  226. data/lib/bloggit/client/scripts/resources/images/default/sizer/s-handle-dark.gif +0 -0
  227. data/lib/bloggit/client/scripts/resources/images/default/sizer/s-handle.gif +0 -0
  228. data/lib/bloggit/client/scripts/resources/images/default/sizer/se-handle-dark.gif +0 -0
  229. data/lib/bloggit/client/scripts/resources/images/default/sizer/se-handle.gif +0 -0
  230. data/lib/bloggit/client/scripts/resources/images/default/sizer/square.gif +0 -0
  231. data/lib/bloggit/client/scripts/resources/images/default/sizer/sw-handle-dark.gif +0 -0
  232. data/lib/bloggit/client/scripts/resources/images/default/sizer/sw-handle.gif +0 -0
  233. data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-inactive-left-bg.gif +0 -0
  234. data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-inactive-right-bg.gif +0 -0
  235. data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-left-bg.gif +0 -0
  236. data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-btm-right-bg.gif +0 -0
  237. data/lib/bloggit/client/scripts/resources/images/default/tabs/tab-sprite.gif +0 -0
  238. data/lib/bloggit/client/scripts/resources/images/default/toolbar/btn-arrow-light.gif +0 -0
  239. data/lib/bloggit/client/scripts/resources/images/default/toolbar/btn-arrow.gif +0 -0
  240. data/lib/bloggit/client/scripts/resources/images/default/toolbar/btn-over-bg.gif +0 -0
  241. data/lib/bloggit/client/scripts/resources/images/default/toolbar/gray-bg.gif +0 -0
  242. data/lib/bloggit/client/scripts/resources/images/default/toolbar/tb-bg.gif +0 -0
  243. data/lib/bloggit/client/scripts/resources/images/default/toolbar/tb-btn-sprite.gif +0 -0
  244. data/lib/bloggit/client/scripts/resources/images/default/tree/drop-add.gif +0 -0
  245. data/lib/bloggit/client/scripts/resources/images/default/tree/drop-between.gif +0 -0
  246. data/lib/bloggit/client/scripts/resources/images/default/tree/drop-no.gif +0 -0
  247. data/lib/bloggit/client/scripts/resources/images/default/tree/drop-over.gif +0 -0
  248. data/lib/bloggit/client/scripts/resources/images/default/tree/drop-under.gif +0 -0
  249. data/lib/bloggit/client/scripts/resources/images/default/tree/drop-yes.gif +0 -0
  250. data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-minus-nl.gif +0 -0
  251. data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-minus.gif +0 -0
  252. data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-plus-nl.gif +0 -0
  253. data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end-plus.gif +0 -0
  254. data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-end.gif +0 -0
  255. data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-line.gif +0 -0
  256. data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-minus-nl.gif +0 -0
  257. data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-minus.gif +0 -0
  258. data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-plus-nl.gif +0 -0
  259. data/lib/bloggit/client/scripts/resources/images/default/tree/elbow-plus.gif +0 -0
  260. data/lib/bloggit/client/scripts/resources/images/default/tree/elbow.gif +0 -0
  261. data/lib/bloggit/client/scripts/resources/images/default/tree/folder-open.gif +0 -0
  262. data/lib/bloggit/client/scripts/resources/images/default/tree/folder.gif +0 -0
  263. data/lib/bloggit/client/scripts/resources/images/default/tree/leaf.gif +0 -0
  264. data/lib/bloggit/client/scripts/resources/images/default/tree/loading.gif +0 -0
  265. data/lib/bloggit/client/scripts/resources/images/default/tree/s.gif +0 -0
  266. data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/close.gif +0 -0
  267. data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/collapse.gif +0 -0
  268. data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/dlg-bg.gif +0 -0
  269. data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/e-handle.gif +0 -0
  270. data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/expand.gif +0 -0
  271. data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/hd-sprite.gif +0 -0
  272. data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/s-handle.gif +0 -0
  273. data/lib/bloggit/client/scripts/resources/images/gray/basic-dialog/se-handle.gif +0 -0
  274. data/lib/bloggit/client/scripts/resources/images/gray/gradient-bg.gif +0 -0
  275. data/lib/bloggit/client/scripts/resources/images/gray/grid/grid-hrow.gif +0 -0
  276. data/lib/bloggit/client/scripts/resources/images/gray/layout/collapse.gif +0 -0
  277. data/lib/bloggit/client/scripts/resources/images/gray/layout/expand.gif +0 -0
  278. data/lib/bloggit/client/scripts/resources/images/gray/layout/gradient-bg.gif +0 -0
  279. data/lib/bloggit/client/scripts/resources/images/gray/layout/ns-collapse.gif +0 -0
  280. data/lib/bloggit/client/scripts/resources/images/gray/layout/ns-expand.gif +0 -0
  281. data/lib/bloggit/client/scripts/resources/images/gray/layout/panel-close.gif +0 -0
  282. data/lib/bloggit/client/scripts/resources/images/gray/layout/panel-title-bg.gif +0 -0
  283. data/lib/bloggit/client/scripts/resources/images/gray/layout/panel-title-light-bg.gif +0 -0
  284. data/lib/bloggit/client/scripts/resources/images/gray/layout/stick.gif +0 -0
  285. data/lib/bloggit/client/scripts/resources/images/gray/layout/tab-close-on.gif +0 -0
  286. data/lib/bloggit/client/scripts/resources/images/gray/layout/tab-close.gif +0 -0
  287. data/lib/bloggit/client/scripts/resources/images/gray/menu/checked.gif +0 -0
  288. data/lib/bloggit/client/scripts/resources/images/gray/menu/group-checked.gif +0 -0
  289. data/lib/bloggit/client/scripts/resources/images/gray/menu/menu-parent.gif +0 -0
  290. data/lib/bloggit/client/scripts/resources/images/gray/menu/menu.gif +0 -0
  291. data/lib/bloggit/client/scripts/resources/images/gray/menu/unchecked.gif +0 -0
  292. data/lib/bloggit/client/scripts/resources/images/gray/qtip/bg.gif +0 -0
  293. data/lib/bloggit/client/scripts/resources/images/gray/qtip/tip-sprite.gif +0 -0
  294. data/lib/bloggit/client/scripts/resources/images/gray/s.gif +0 -0
  295. data/lib/bloggit/client/scripts/resources/images/gray/sizer/e-handle-dark.gif +0 -0
  296. data/lib/bloggit/client/scripts/resources/images/gray/sizer/e-handle.gif +0 -0
  297. data/lib/bloggit/client/scripts/resources/images/gray/sizer/ne-handle-dark.gif +0 -0
  298. data/lib/bloggit/client/scripts/resources/images/gray/sizer/ne-handle.gif +0 -0
  299. data/lib/bloggit/client/scripts/resources/images/gray/sizer/nw-handle-dark.gif +0 -0
  300. data/lib/bloggit/client/scripts/resources/images/gray/sizer/nw-handle.gif +0 -0
  301. data/lib/bloggit/client/scripts/resources/images/gray/sizer/s-handle-dark.gif +0 -0
  302. data/lib/bloggit/client/scripts/resources/images/gray/sizer/s-handle.gif +0 -0
  303. data/lib/bloggit/client/scripts/resources/images/gray/sizer/se-handle-dark.gif +0 -0
  304. data/lib/bloggit/client/scripts/resources/images/gray/sizer/se-handle.gif +0 -0
  305. data/lib/bloggit/client/scripts/resources/images/gray/sizer/sw-handle-dark.gif +0 -0
  306. data/lib/bloggit/client/scripts/resources/images/gray/sizer/sw-handle.gif +0 -0
  307. data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-inactive-left-bg.gif +0 -0
  308. data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-inactive-right-bg.gif +0 -0
  309. data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-left-bg.gif +0 -0
  310. data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-btm-right-bg.gif +0 -0
  311. data/lib/bloggit/client/scripts/resources/images/gray/tabs/tab-sprite.gif +0 -0
  312. data/lib/bloggit/client/scripts/resources/images/gray/toolbar/gray-bg.gif +0 -0
  313. data/lib/bloggit/client/scripts/resources/images/gray/toolbar/tb-btn-sprite.gif +0 -0
  314. data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/bg-center.gif +0 -0
  315. data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/bg-left.gif +0 -0
  316. data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/bg-right.gif +0 -0
  317. data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/close.gif +0 -0
  318. data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/collapse.gif +0 -0
  319. data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/dlg-bg.gif +0 -0
  320. data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/e-handle.gif +0 -0
  321. data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/expand.gif +0 -0
  322. data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/hd-sprite.gif +0 -0
  323. data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/s-handle.gif +0 -0
  324. data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/se-handle.gif +0 -0
  325. data/lib/bloggit/client/scripts/resources/images/vista/basic-dialog/w-handle.gif +0 -0
  326. data/lib/bloggit/client/scripts/resources/images/vista/gradient-bg.gif +0 -0
  327. data/lib/bloggit/client/scripts/resources/images/vista/grid/grid-split.gif +0 -0
  328. data/lib/bloggit/client/scripts/resources/images/vista/grid/grid-vista-hd.gif +0 -0
  329. data/lib/bloggit/client/scripts/resources/images/vista/layout/collapse.gif +0 -0
  330. data/lib/bloggit/client/scripts/resources/images/vista/layout/expand.gif +0 -0
  331. data/lib/bloggit/client/scripts/resources/images/vista/layout/gradient-bg.gif +0 -0
  332. data/lib/bloggit/client/scripts/resources/images/vista/layout/ns-collapse.gif +0 -0
  333. data/lib/bloggit/client/scripts/resources/images/vista/layout/ns-expand.gif +0 -0
  334. data/lib/bloggit/client/scripts/resources/images/vista/layout/panel-close.gif +0 -0
  335. data/lib/bloggit/client/scripts/resources/images/vista/layout/panel-title-bg.gif +0 -0
  336. data/lib/bloggit/client/scripts/resources/images/vista/layout/panel-title-light-bg.gif +0 -0
  337. data/lib/bloggit/client/scripts/resources/images/vista/layout/stick.gif +0 -0
  338. data/lib/bloggit/client/scripts/resources/images/vista/layout/tab-close-on.gif +0 -0
  339. data/lib/bloggit/client/scripts/resources/images/vista/layout/tab-close.gif +0 -0
  340. data/lib/bloggit/client/scripts/resources/images/vista/qtip/bg.gif +0 -0
  341. data/lib/bloggit/client/scripts/resources/images/vista/qtip/tip-sprite.gif +0 -0
  342. data/lib/bloggit/client/scripts/resources/images/vista/s.gif +0 -0
  343. data/lib/bloggit/client/scripts/resources/images/vista/sizer/e-handle-dark.gif +0 -0
  344. data/lib/bloggit/client/scripts/resources/images/vista/sizer/e-handle.gif +0 -0
  345. data/lib/bloggit/client/scripts/resources/images/vista/sizer/ne-handle-dark.gif +0 -0
  346. data/lib/bloggit/client/scripts/resources/images/vista/sizer/ne-handle.gif +0 -0
  347. data/lib/bloggit/client/scripts/resources/images/vista/sizer/nw-handle-dark.gif +0 -0
  348. data/lib/bloggit/client/scripts/resources/images/vista/sizer/nw-handle.gif +0 -0
  349. data/lib/bloggit/client/scripts/resources/images/vista/sizer/s-handle-dark.gif +0 -0
  350. data/lib/bloggit/client/scripts/resources/images/vista/sizer/s-handle.gif +0 -0
  351. data/lib/bloggit/client/scripts/resources/images/vista/sizer/se-handle-dark.gif +0 -0
  352. data/lib/bloggit/client/scripts/resources/images/vista/sizer/se-handle.gif +0 -0
  353. data/lib/bloggit/client/scripts/resources/images/vista/sizer/sw-handle-dark.gif +0 -0
  354. data/lib/bloggit/client/scripts/resources/images/vista/sizer/sw-handle.gif +0 -0
  355. data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-inactive-left-bg.gif +0 -0
  356. data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-inactive-right-bg.gif +0 -0
  357. data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-left-bg.gif +0 -0
  358. data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-btm-right-bg.gif +0 -0
  359. data/lib/bloggit/client/scripts/resources/images/vista/tabs/tab-sprite.gif +0 -0
  360. data/lib/bloggit/client/scripts/resources/images/vista/toolbar/gray-bg.gif +0 -0
  361. data/lib/bloggit/client/scripts/resources/images/vista/toolbar/tb-btn-sprite.gif +0 -0
  362. data/lib/bloggit/client/scripts/resources/license.txt +25 -0
  363. data/lib/bloggit/client/scripts/resources/raw-images/shadow.psd +0 -0
  364. data/lib/bloggit/client/scripts/resources/resources.jsb +522 -0
  365. data/lib/bloggit/client/templates/json.rhtml +5 -0
  366. data/lib/bloggit/client/templates/main.rhtml +109 -0
  367. data/lib/bloggit/commandline.rb +52 -0
  368. data/lib/bloggit/commands/page_cmd.rb +17 -0
  369. data/lib/bloggit/commands/plugin_cmd.rb +89 -0
  370. data/lib/bloggit/commands/post_cmd.rb +17 -0
  371. data/lib/bloggit/commands/site_cmd.rb +82 -0
  372. data/lib/bloggit/commands/theme_cmd.rb +16 -0
  373. data/lib/bloggit/etc/hash.rb +24 -0
  374. data/lib/bloggit/etc/string.rb +5 -0
  375. data/lib/bloggit/generator.rb +331 -0
  376. data/lib/bloggit/hooks.rb +21 -0
  377. data/lib/bloggit/media.rb +40 -0
  378. data/lib/bloggit/page.rb +98 -0
  379. data/lib/bloggit/plugin.rb +52 -0
  380. data/lib/bloggit/post.rb +169 -0
  381. data/lib/bloggit/publisher.rb +115 -0
  382. data/lib/bloggit/server.rb +102 -0
  383. data/lib/bloggit/site.rb +183 -0
  384. data/lib/bloggit/tag.rb +61 -0
  385. data/lib/bloggit/tasks/client.rb +9 -0
  386. data/lib/bloggit/tasks/publishing.rb +36 -0
  387. data/lib/bloggit/tasks/scm.rb +78 -0
  388. data/lib/bloggit/tasks/specs.rb +128 -0
  389. data/lib/bloggit/template.rb +334 -0
  390. data/lib/bloggit/text_formatter.rb +50 -0
  391. data/lib/util/fixed_hoe.rb +553 -0
  392. data/test/fixtures/test.blog/Rakefile +7 -0
  393. data/test/fixtures/test.blog/pages/about.page +7 -0
  394. data/test/fixtures/test.blog/pages/coming-soon.page +3 -0
  395. data/test/fixtures/test.blog/pages/todo.page +23 -0
  396. data/test/fixtures/test.blog/plugins/example/init.rb +69 -0
  397. data/test/fixtures/test.blog/plugins/haloscan/init.rb +25 -0
  398. data/test/fixtures/test.blog/plugins/js_search/init.rb +51 -0
  399. data/test/fixtures/test.blog/plugins/rdoc_formatter/init.rb +14 -0
  400. data/test/fixtures/test.blog/posts/2004.03.07_to-boldly-go.post +11 -0
  401. data/test/fixtures/test.blog/posts/2007.03.25_sure-whatever.post +10 -0
  402. data/test/fixtures/test.blog/posts/2007.03.27_rdoc-anyone.post +13 -0
  403. data/test/fixtures/test.blog/posts/2010.12.07_35-already.post +5 -0
  404. data/test/fixtures/test.blog/settings.yml +34 -0
  405. data/test/fixtures/test.blog/themes/default/styles/main.css +145 -0
  406. data/test/fixtures/test.blog/themes/default/templates/archive.rhtml +22 -0
  407. data/test/fixtures/test.blog/themes/default/templates/home.rhtml +9 -0
  408. data/test/fixtures/test.blog/themes/default/templates/layouts/main.rhtml +17 -0
  409. data/test/fixtures/test.blog/themes/default/templates/layouts/two-columns.rhtml +21 -0
  410. data/test/fixtures/test.blog/themes/default/templates/page.rhtml +8 -0
  411. data/test/fixtures/test.blog/themes/default/templates/post.rhtml +15 -0
  412. data/test/fixtures/test.blog/themes/default/templates/snippets/blog_entry.rhtml +10 -0
  413. data/test/fixtures/test.blog/themes/default/templates/snippets/navigation.rhtml +12 -0
  414. data/test/fixtures/test.blog/themes/default/templates/snippets/tag_list.rhtml +9 -0
  415. data/test/fixtures/test.blog/themes/default/templates/tag_archive.rhtml +41 -0
  416. data/test/helpers.rb +25 -0
  417. data/test/unit/bloggit_test.rb +9 -0
  418. data/test/unit/page_test.rb +28 -0
  419. data/test/unit/post_test.rb +36 -0
  420. data/test/unit/site_test.rb +27 -0
  421. data/test/unit/template_test.rb +21 -0
  422. data/test/unit/text_formatter_test.rb +43 -0
  423. metadata +520 -0
@@ -0,0 +1,2201 @@
1
+ /* prevent execution of jQuery if included more than once */
2
+ if(typeof window.jQuery == "undefined") {
3
+ /*
4
+ * jQuery 1.1.1 - New Wave Javascript
5
+ *
6
+ * Copyright (c) 2007 John Resig (jquery.com)
7
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
8
+ * and GPL (GPL-LICENSE.txt) licenses.
9
+ *
10
+ * $Date: 2007-01-22 00:27:54 -0500 (Mon, 22 Jan 2007) $
11
+ * $Rev: 1153 $
12
+ */
13
+
14
+ // Global undefined variable
15
+ window.undefined = window.undefined;
16
+ var jQuery = function(a,c) {
17
+ // If the context is global, return a new object
18
+ if ( window == this )
19
+ return new jQuery(a,c);
20
+
21
+ // Make sure that a selection was provided
22
+ a = a || document;
23
+
24
+ // HANDLE: $(function)
25
+ // Shortcut for document ready
26
+ if ( jQuery.isFunction(a) )
27
+ return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( a );
28
+
29
+ // Handle HTML strings
30
+ if ( typeof a == "string" ) {
31
+ // HANDLE: $(html) -> $(array)
32
+ var m = /^[^<]*(<(.|\n)+>)[^>]*$/.exec(a);
33
+ if ( m )
34
+ a = jQuery.clean( [ m[1] ] );
35
+
36
+ // HANDLE: $(expr)
37
+ else
38
+ return new jQuery( c ).find( a );
39
+ }
40
+
41
+ return this.setArray(
42
+ // HANDLE: $(array)
43
+ a.constructor == Array && a ||
44
+
45
+ // HANDLE: $(arraylike)
46
+ // Watch for when an array-like object is passed as the selector
47
+ (a.jquery || a.length && a != window && !a.nodeType && a[0] != undefined && a[0].nodeType) && jQuery.makeArray( a ) ||
48
+
49
+ // HANDLE: $(*)
50
+ [ a ] );
51
+ };
52
+
53
+ // Map over the $ in case of overwrite
54
+ if ( typeof $ != "undefined" )
55
+ jQuery._$ = $;
56
+
57
+ // Map the jQuery namespace to the '$' one
58
+ var $ = jQuery;
59
+
60
+ jQuery.fn = jQuery.prototype = {
61
+ jquery: "1.1.1",
62
+
63
+ size: function() {
64
+ return this.length;
65
+ },
66
+
67
+ length: 0,
68
+
69
+ get: function( num ) {
70
+ return num == undefined ?
71
+
72
+ // Return a 'clean' array
73
+ jQuery.makeArray( this ) :
74
+
75
+ // Return just the object
76
+ this[num];
77
+ },
78
+ pushStack: function( a ) {
79
+ var ret = jQuery(this);
80
+ ret.prevObject = this;
81
+ return ret.setArray( a );
82
+ },
83
+ setArray: function( a ) {
84
+ this.length = 0;
85
+ [].push.apply( this, a );
86
+ return this;
87
+ },
88
+ each: function( fn, args ) {
89
+ return jQuery.each( this, fn, args );
90
+ },
91
+ index: function( obj ) {
92
+ var pos = -1;
93
+ this.each(function(i){
94
+ if ( this == obj ) pos = i;
95
+ });
96
+ return pos;
97
+ },
98
+
99
+ attr: function( key, value, type ) {
100
+ var obj = key;
101
+
102
+ // Look for the case where we're accessing a style value
103
+ if ( key.constructor == String )
104
+ if ( value == undefined )
105
+ return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
106
+ else {
107
+ obj = {};
108
+ obj[ key ] = value;
109
+ }
110
+
111
+ // Check to see if we're setting style values
112
+ return this.each(function(index){
113
+ // Set all the styles
114
+ for ( var prop in obj )
115
+ jQuery.attr(
116
+ type ? this.style : this,
117
+ prop, jQuery.prop(this, obj[prop], type, index, prop)
118
+ );
119
+ });
120
+ },
121
+
122
+ css: function( key, value ) {
123
+ return this.attr( key, value, "curCSS" );
124
+ },
125
+
126
+ text: function(e) {
127
+ if ( typeof e == "string" )
128
+ return this.empty().append( document.createTextNode( e ) );
129
+
130
+ var t = "";
131
+ jQuery.each( e || this, function(){
132
+ jQuery.each( this.childNodes, function(){
133
+ if ( this.nodeType != 8 )
134
+ t += this.nodeType != 1 ?
135
+ this.nodeValue : jQuery.fn.text([ this ]);
136
+ });
137
+ });
138
+ return t;
139
+ },
140
+
141
+ wrap: function() {
142
+ // The elements to wrap the target around
143
+ var a = jQuery.clean(arguments);
144
+
145
+ // Wrap each of the matched elements individually
146
+ return this.each(function(){
147
+ // Clone the structure that we're using to wrap
148
+ var b = a[0].cloneNode(true);
149
+
150
+ // Insert it before the element to be wrapped
151
+ this.parentNode.insertBefore( b, this );
152
+
153
+ // Find the deepest point in the wrap structure
154
+ while ( b.firstChild )
155
+ b = b.firstChild;
156
+
157
+ // Move the matched element to within the wrap structure
158
+ b.appendChild( this );
159
+ });
160
+ },
161
+ append: function() {
162
+ return this.domManip(arguments, true, 1, function(a){
163
+ this.appendChild( a );
164
+ });
165
+ },
166
+ prepend: function() {
167
+ return this.domManip(arguments, true, -1, function(a){
168
+ this.insertBefore( a, this.firstChild );
169
+ });
170
+ },
171
+ before: function() {
172
+ return this.domManip(arguments, false, 1, function(a){
173
+ this.parentNode.insertBefore( a, this );
174
+ });
175
+ },
176
+ after: function() {
177
+ return this.domManip(arguments, false, -1, function(a){
178
+ this.parentNode.insertBefore( a, this.nextSibling );
179
+ });
180
+ },
181
+ end: function() {
182
+ return this.prevObject || jQuery([]);
183
+ },
184
+ find: function(t) {
185
+ return this.pushStack( jQuery.map( this, function(a){
186
+ return jQuery.find(t,a);
187
+ }) );
188
+ },
189
+ clone: function(deep) {
190
+ return this.pushStack( jQuery.map( this, function(a){
191
+ return a.cloneNode( deep != undefined ? deep : true );
192
+ }) );
193
+ },
194
+
195
+ filter: function(t) {
196
+ return this.pushStack(
197
+ jQuery.isFunction( t ) &&
198
+ jQuery.grep(this, function(el, index){
199
+ return t.apply(el, [index])
200
+ }) ||
201
+
202
+ jQuery.multiFilter(t,this) );
203
+ },
204
+
205
+ not: function(t) {
206
+ return this.pushStack(
207
+ t.constructor == String &&
208
+ jQuery.multiFilter(t,this,true) ||
209
+
210
+ jQuery.grep(this,function(a){
211
+ if ( t.constructor == Array || t.jquery )
212
+ return jQuery.inArray( t, a ) < 0;
213
+ else
214
+ return a != t;
215
+ }) );
216
+ },
217
+
218
+ add: function(t) {
219
+ return this.pushStack( jQuery.merge(
220
+ this.get(),
221
+ t.constructor == String ?
222
+ jQuery(t).get() :
223
+ t.length != undefined && !t.nodeName ?
224
+ t : [t] )
225
+ );
226
+ },
227
+ is: function(expr) {
228
+ return expr ? jQuery.filter(expr,this).r.length > 0 : false;
229
+ },
230
+
231
+ val: function( val ) {
232
+ return val == undefined ?
233
+ ( this.length ? this[0].value : null ) :
234
+ this.attr( "value", val );
235
+ },
236
+
237
+ html: function( val ) {
238
+ return val == undefined ?
239
+ ( this.length ? this[0].innerHTML : null ) :
240
+ this.empty().append( val );
241
+ },
242
+ domManip: function(args, table, dir, fn){
243
+ var clone = this.length > 1;
244
+ var a = jQuery.clean(args);
245
+ if ( dir < 0 )
246
+ a.reverse();
247
+
248
+ return this.each(function(){
249
+ var obj = this;
250
+
251
+ if ( table && jQuery.nodeName(this, "table") && jQuery.nodeName(a[0], "tr") )
252
+ obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody"));
253
+
254
+ jQuery.each( a, function(){
255
+ fn.apply( obj, [ clone ? this.cloneNode(true) : this ] );
256
+ });
257
+
258
+ });
259
+ }
260
+ };
261
+
262
+ jQuery.extend = jQuery.fn.extend = function() {
263
+ // copy reference to target object
264
+ var target = arguments[0],
265
+ a = 1;
266
+
267
+ // extend jQuery itself if only one argument is passed
268
+ if ( arguments.length == 1 ) {
269
+ target = this;
270
+ a = 0;
271
+ }
272
+ var prop;
273
+ while (prop = arguments[a++])
274
+ // Extend the base object
275
+ for ( var i in prop ) target[i] = prop[i];
276
+
277
+ // Return the modified object
278
+ return target;
279
+ };
280
+
281
+ jQuery.extend({
282
+ noConflict: function() {
283
+ if ( jQuery._$ )
284
+ $ = jQuery._$;
285
+ return jQuery;
286
+ },
287
+
288
+ // This may seem like some crazy code, but trust me when I say that this
289
+ // is the only cross-browser way to do this. --John
290
+ isFunction: function( fn ) {
291
+ return !!fn && typeof fn != "string" &&
292
+ typeof fn[0] == "undefined" && /function/i.test( fn + "" );
293
+ },
294
+
295
+ nodeName: function( elem, name ) {
296
+ return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
297
+ },
298
+ // args is for internal usage only
299
+ each: function( obj, fn, args ) {
300
+ if ( obj.length == undefined )
301
+ for ( var i in obj )
302
+ fn.apply( obj[i], args || [i, obj[i]] );
303
+ else
304
+ for ( var i = 0, ol = obj.length; i < ol; i++ )
305
+ if ( fn.apply( obj[i], args || [i, obj[i]] ) === false ) break;
306
+ return obj;
307
+ },
308
+
309
+ prop: function(elem, value, type, index, prop){
310
+ // Handle executable functions
311
+ if ( jQuery.isFunction( value ) )
312
+ return value.call( elem, [index] );
313
+
314
+ // exclude the following css properties to add px
315
+ var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
316
+
317
+ // Handle passing in a number to a CSS property
318
+ if ( value.constructor == Number && type == "curCSS" && !exclude.test(prop) )
319
+ return value + "px";
320
+
321
+ return value;
322
+ },
323
+
324
+ className: {
325
+ // internal only, use addClass("class")
326
+ add: function( elem, c ){
327
+ jQuery.each( c.split(/\s+/), function(i, cur){
328
+ if ( !jQuery.className.has( elem.className, cur ) )
329
+ elem.className += ( elem.className ? " " : "" ) + cur;
330
+ });
331
+ },
332
+
333
+ // internal only, use removeClass("class")
334
+ remove: function( elem, c ){
335
+ elem.className = c ?
336
+ jQuery.grep( elem.className.split(/\s+/), function(cur){
337
+ return !jQuery.className.has( c, cur );
338
+ }).join(" ") : "";
339
+ },
340
+
341
+ // internal only, use is(".class")
342
+ has: function( t, c ) {
343
+ t = t.className || t;
344
+ return t && new RegExp("(^|\\s)" + c + "(\\s|$)").test( t );
345
+ }
346
+ },
347
+ swap: function(e,o,f) {
348
+ for ( var i in o ) {
349
+ e.style["old"+i] = e.style[i];
350
+ e.style[i] = o[i];
351
+ }
352
+ f.apply( e, [] );
353
+ for ( var i in o )
354
+ e.style[i] = e.style["old"+i];
355
+ },
356
+
357
+ css: function(e,p) {
358
+ if ( p == "height" || p == "width" ) {
359
+ var old = {}, oHeight, oWidth, d = ["Top","Bottom","Right","Left"];
360
+
361
+ jQuery.each( d, function(){
362
+ old["padding" + this] = 0;
363
+ old["border" + this + "Width"] = 0;
364
+ });
365
+
366
+ jQuery.swap( e, old, function() {
367
+ if (jQuery.css(e,"display") != "none") {
368
+ oHeight = e.offsetHeight;
369
+ oWidth = e.offsetWidth;
370
+ } else {
371
+ e = jQuery(e.cloneNode(true))
372
+ .find(":radio").removeAttr("checked").end()
373
+ .css({
374
+ visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
375
+ }).appendTo(e.parentNode)[0];
376
+
377
+ var parPos = jQuery.css(e.parentNode,"position");
378
+ if ( parPos == "" || parPos == "static" )
379
+ e.parentNode.style.position = "relative";
380
+
381
+ oHeight = e.clientHeight;
382
+ oWidth = e.clientWidth;
383
+
384
+ if ( parPos == "" || parPos == "static" )
385
+ e.parentNode.style.position = "static";
386
+
387
+ e.parentNode.removeChild(e);
388
+ }
389
+ });
390
+
391
+ return p == "height" ? oHeight : oWidth;
392
+ }
393
+
394
+ return jQuery.curCSS( e, p );
395
+ },
396
+
397
+ curCSS: function(elem, prop, force) {
398
+ var ret;
399
+
400
+ if (prop == "opacity" && jQuery.browser.msie)
401
+ return jQuery.attr(elem.style, "opacity");
402
+
403
+ if (prop == "float" || prop == "cssFloat")
404
+ prop = jQuery.browser.msie ? "styleFloat" : "cssFloat";
405
+
406
+ if (!force && elem.style[prop])
407
+ ret = elem.style[prop];
408
+
409
+ else if (document.defaultView && document.defaultView.getComputedStyle) {
410
+
411
+ if (prop == "cssFloat" || prop == "styleFloat")
412
+ prop = "float";
413
+
414
+ prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase();
415
+ var cur = document.defaultView.getComputedStyle(elem, null);
416
+
417
+ if ( cur )
418
+ ret = cur.getPropertyValue(prop);
419
+ else if ( prop == "display" )
420
+ ret = "none";
421
+ else
422
+ jQuery.swap(elem, { display: "block" }, function() {
423
+ var c = document.defaultView.getComputedStyle(this, "");
424
+ ret = c && c.getPropertyValue(prop) || "";
425
+ });
426
+
427
+ } else if (elem.currentStyle) {
428
+
429
+ var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});
430
+ ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
431
+
432
+ }
433
+
434
+ return ret;
435
+ },
436
+
437
+ clean: function(a) {
438
+ var r = [];
439
+
440
+ jQuery.each( a, function(i,arg){
441
+ if ( !arg ) return;
442
+
443
+ if ( arg.constructor == Number )
444
+ arg = arg.toString();
445
+
446
+ // Convert html string into DOM nodes
447
+ if ( typeof arg == "string" ) {
448
+ // Trim whitespace, otherwise indexOf won't work as expected
449
+ var s = jQuery.trim(arg), div = document.createElement("div"), tb = [];
450
+
451
+ var wrap =
452
+ // option or optgroup
453
+ !s.indexOf("<opt") &&
454
+ [1, "<select>", "</select>"] ||
455
+
456
+ (!s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot")) &&
457
+ [1, "<table>", "</table>"] ||
458
+
459
+ !s.indexOf("<tr") &&
460
+ [2, "<table><tbody>", "</tbody></table>"] ||
461
+
462
+ // <thead> matched above
463
+ (!s.indexOf("<td") || !s.indexOf("<th")) &&
464
+ [3, "<table><tbody><tr>", "</tr></tbody></table>"] ||
465
+
466
+ [0,"",""];
467
+
468
+ // Go to html and back, then peel off extra wrappers
469
+ div.innerHTML = wrap[1] + s + wrap[2];
470
+
471
+ // Move to the right depth
472
+ while ( wrap[0]-- )
473
+ div = div.firstChild;
474
+
475
+ // Remove IE's autoinserted <tbody> from table fragments
476
+ if ( jQuery.browser.msie ) {
477
+
478
+ // String was a <table>, *may* have spurious <tbody>
479
+ if ( !s.indexOf("<table") && s.indexOf("<tbody") < 0 )
480
+ tb = div.firstChild && div.firstChild.childNodes;
481
+
482
+ // String was a bare <thead> or <tfoot>
483
+ else if ( wrap[1] == "<table>" && s.indexOf("<tbody") < 0 )
484
+ tb = div.childNodes;
485
+
486
+ for ( var n = tb.length-1; n >= 0 ; --n )
487
+ if ( jQuery.nodeName(tb[n], "tbody") && !tb[n].childNodes.length )
488
+ tb[n].parentNode.removeChild(tb[n]);
489
+
490
+ }
491
+
492
+ arg = div.childNodes;
493
+ }
494
+
495
+ if ( arg.length === 0 )
496
+ return;
497
+
498
+ if ( arg[0] == undefined )
499
+ r.push( arg );
500
+ else
501
+ r = jQuery.merge( r, arg );
502
+
503
+ });
504
+
505
+ return r;
506
+ },
507
+
508
+ attr: function(elem, name, value){
509
+ var fix = {
510
+ "for": "htmlFor",
511
+ "class": "className",
512
+ "float": jQuery.browser.msie ? "styleFloat" : "cssFloat",
513
+ cssFloat: jQuery.browser.msie ? "styleFloat" : "cssFloat",
514
+ innerHTML: "innerHTML",
515
+ className: "className",
516
+ value: "value",
517
+ disabled: "disabled",
518
+ checked: "checked",
519
+ readonly: "readOnly",
520
+ selected: "selected"
521
+ };
522
+
523
+ // IE actually uses filters for opacity ... elem is actually elem.style
524
+ if ( name == "opacity" && jQuery.browser.msie && value != undefined ) {
525
+ // IE has trouble with opacity if it does not have layout
526
+ // Force it by setting the zoom level
527
+ elem.zoom = 1;
528
+
529
+ // Set the alpha filter to set the opacity
530
+ return elem.filter = elem.filter.replace(/alpha\([^\)]*\)/gi,"") +
531
+ ( value == 1 ? "" : "alpha(opacity=" + value * 100 + ")" );
532
+
533
+ } else if ( name == "opacity" && jQuery.browser.msie )
534
+ return elem.filter ?
535
+ parseFloat( elem.filter.match(/alpha\(opacity=(.*)\)/)[1] ) / 100 : 1;
536
+
537
+ // Mozilla doesn't play well with opacity 1
538
+ if ( name == "opacity" && jQuery.browser.mozilla && value == 1 )
539
+ value = 0.9999;
540
+
541
+ // Certain attributes only work when accessed via the old DOM 0 way
542
+ if ( fix[name] ) {
543
+ if ( value != undefined ) elem[fix[name]] = value;
544
+ return elem[fix[name]];
545
+
546
+ } else if ( value == undefined && jQuery.browser.msie && jQuery.nodeName(elem, "form") && (name == "action" || name == "method") )
547
+ return elem.getAttributeNode(name).nodeValue;
548
+
549
+ // IE elem.getAttribute passes even for style
550
+ else if ( elem.tagName ) {
551
+ if ( value != undefined ) elem.setAttribute( name, value );
552
+ return elem.getAttribute( name );
553
+
554
+ } else {
555
+ name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();});
556
+ if ( value != undefined ) elem[name] = value;
557
+ return elem[name];
558
+ }
559
+ },
560
+ trim: function(t){
561
+ return t.replace(/^\s+|\s+$/g, "");
562
+ },
563
+
564
+ makeArray: function( a ) {
565
+ var r = [];
566
+
567
+ if ( a.constructor != Array )
568
+ for ( var i = 0, al = a.length; i < al; i++ )
569
+ r.push( a[i] );
570
+ else
571
+ r = a.slice( 0 );
572
+
573
+ return r;
574
+ },
575
+
576
+ inArray: function( b, a ) {
577
+ for ( var i = 0, al = a.length; i < al; i++ )
578
+ if ( a[i] == b )
579
+ return i;
580
+ return -1;
581
+ },
582
+ merge: function(first, second) {
583
+ var r = [].slice.call( first, 0 );
584
+
585
+ // Now check for duplicates between the two arrays
586
+ // and only add the unique items
587
+ for ( var i = 0, sl = second.length; i < sl; i++ )
588
+ // Check for duplicates
589
+ if ( jQuery.inArray( second[i], r ) == -1 )
590
+ // The item is unique, add it
591
+ first.push( second[i] );
592
+
593
+ return first;
594
+ },
595
+ grep: function(elems, fn, inv) {
596
+ // If a string is passed in for the function, make a function
597
+ // for it (a handy shortcut)
598
+ if ( typeof fn == "string" )
599
+ fn = new Function("a","i","return " + fn);
600
+
601
+ var result = [];
602
+
603
+ // Go through the array, only saving the items
604
+ // that pass the validator function
605
+ for ( var i = 0, el = elems.length; i < el; i++ )
606
+ if ( !inv && fn(elems[i],i) || inv && !fn(elems[i],i) )
607
+ result.push( elems[i] );
608
+
609
+ return result;
610
+ },
611
+ map: function(elems, fn) {
612
+ // If a string is passed in for the function, make a function
613
+ // for it (a handy shortcut)
614
+ if ( typeof fn == "string" )
615
+ fn = new Function("a","return " + fn);
616
+
617
+ var result = [], r = [];
618
+
619
+ // Go through the array, translating each of the items to their
620
+ // new value (or values).
621
+ for ( var i = 0, el = elems.length; i < el; i++ ) {
622
+ var val = fn(elems[i],i);
623
+
624
+ if ( val !== null && val != undefined ) {
625
+ if ( val.constructor != Array ) val = [val];
626
+ result = result.concat( val );
627
+ }
628
+ }
629
+
630
+ var r = result.length ? [ result[0] ] : [];
631
+
632
+ check: for ( var i = 1, rl = result.length; i < rl; i++ ) {
633
+ for ( var j = 0; j < i; j++ )
634
+ if ( result[i] == r[j] )
635
+ continue check;
636
+
637
+ r.push( result[i] );
638
+ }
639
+
640
+ return r;
641
+ }
642
+ });
643
+
644
+ /*
645
+ * Whether the W3C compliant box model is being used.
646
+ *
647
+ * @property
648
+ * @name $.boxModel
649
+ * @type Boolean
650
+ * @cat JavaScript
651
+ */
652
+ new function() {
653
+ var b = navigator.userAgent.toLowerCase();
654
+
655
+ // Figure out what browser is being used
656
+ jQuery.browser = {
657
+ safari: /webkit/.test(b),
658
+ opera: /opera/.test(b),
659
+ msie: /msie/.test(b) && !/opera/.test(b),
660
+ mozilla: /mozilla/.test(b) && !/(compatible|webkit)/.test(b)
661
+ };
662
+
663
+ // Check to see if the W3C box model is being used
664
+ jQuery.boxModel = !jQuery.browser.msie || document.compatMode == "CSS1Compat";
665
+ };
666
+
667
+ jQuery.each({
668
+ parent: "a.parentNode",
669
+ parents: "jQuery.parents(a)",
670
+ next: "jQuery.nth(a,2,'nextSibling')",
671
+ prev: "jQuery.nth(a,2,'previousSibling')",
672
+ siblings: "jQuery.sibling(a.parentNode.firstChild,a)",
673
+ children: "jQuery.sibling(a.firstChild)"
674
+ }, function(i,n){
675
+ jQuery.fn[ i ] = function(a) {
676
+ var ret = jQuery.map(this,n);
677
+ if ( a && typeof a == "string" )
678
+ ret = jQuery.multiFilter(a,ret);
679
+ return this.pushStack( ret );
680
+ };
681
+ });
682
+
683
+ jQuery.each({
684
+ appendTo: "append",
685
+ prependTo: "prepend",
686
+ insertBefore: "before",
687
+ insertAfter: "after"
688
+ }, function(i,n){
689
+ jQuery.fn[ i ] = function(){
690
+ var a = arguments;
691
+ return this.each(function(){
692
+ for ( var j = 0, al = a.length; j < al; j++ )
693
+ jQuery(a[j])[n]( this );
694
+ });
695
+ };
696
+ });
697
+
698
+ jQuery.each( {
699
+ removeAttr: function( key ) {
700
+ jQuery.attr( this, key, "" );
701
+ this.removeAttribute( key );
702
+ },
703
+ addClass: function(c){
704
+ jQuery.className.add(this,c);
705
+ },
706
+ removeClass: function(c){
707
+ jQuery.className.remove(this,c);
708
+ },
709
+ toggleClass: function( c ){
710
+ jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this, c);
711
+ },
712
+ remove: function(a){
713
+ if ( !a || jQuery.filter( a, [this] ).r.length )
714
+ this.parentNode.removeChild( this );
715
+ },
716
+ empty: function() {
717
+ while ( this.firstChild )
718
+ this.removeChild( this.firstChild );
719
+ }
720
+ }, function(i,n){
721
+ jQuery.fn[ i ] = function() {
722
+ return this.each( n, arguments );
723
+ };
724
+ });
725
+
726
+ jQuery.each( [ "eq", "lt", "gt", "contains" ], function(i,n){
727
+ jQuery.fn[ n ] = function(num,fn) {
728
+ return this.filter( ":" + n + "(" + num + ")", fn );
729
+ };
730
+ });
731
+
732
+ jQuery.each( [ "height", "width" ], function(i,n){
733
+ jQuery.fn[ n ] = function(h) {
734
+ return h == undefined ?
735
+ ( this.length ? jQuery.css( this[0], n ) : null ) :
736
+ this.css( n, h.constructor == String ? h : h + "px" );
737
+ };
738
+ });
739
+ jQuery.extend({
740
+ expr: {
741
+ "": "m[2]=='*'||jQuery.nodeName(a,m[2])",
742
+ "#": "a.getAttribute('id')==m[2]",
743
+ ":": {
744
+ // Position Checks
745
+ lt: "i<m[3]-0",
746
+ gt: "i>m[3]-0",
747
+ nth: "m[3]-0==i",
748
+ eq: "m[3]-0==i",
749
+ first: "i==0",
750
+ last: "i==r.length-1",
751
+ even: "i%2==0",
752
+ odd: "i%2",
753
+
754
+ // Child Checks
755
+ "nth-child": "jQuery.nth(a.parentNode.firstChild,m[3],'nextSibling',a)==a",
756
+ "first-child": "jQuery.nth(a.parentNode.firstChild,1,'nextSibling')==a",
757
+ "last-child": "jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a",
758
+ "only-child": "jQuery.sibling(a.parentNode.firstChild).length==1",
759
+
760
+ // Parent Checks
761
+ parent: "a.firstChild",
762
+ empty: "!a.firstChild",
763
+
764
+ // Text Check
765
+ contains: "jQuery.fn.text.apply([a]).indexOf(m[3])>=0",
766
+
767
+ // Visibility
768
+ visible: 'a.type!="hidden"&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',
769
+ hidden: 'a.type=="hidden"||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',
770
+
771
+ // Form attributes
772
+ enabled: "!a.disabled",
773
+ disabled: "a.disabled",
774
+ checked: "a.checked",
775
+ selected: "a.selected||jQuery.attr(a,'selected')",
776
+
777
+ // Form elements
778
+ text: "a.type=='text'",
779
+ radio: "a.type=='radio'",
780
+ checkbox: "a.type=='checkbox'",
781
+ file: "a.type=='file'",
782
+ password: "a.type=='password'",
783
+ submit: "a.type=='submit'",
784
+ image: "a.type=='image'",
785
+ reset: "a.type=='reset'",
786
+ button: 'a.type=="button"||jQuery.nodeName(a,"button")',
787
+ input: "/input|select|textarea|button/i.test(a.nodeName)"
788
+ },
789
+ ".": "jQuery.className.has(a,m[2])",
790
+ "@": {
791
+ "=": "z==m[4]",
792
+ "!=": "z!=m[4]",
793
+ "^=": "z&&!z.indexOf(m[4])",
794
+ "$=": "z&&z.substr(z.length - m[4].length,m[4].length)==m[4]",
795
+ "*=": "z&&z.indexOf(m[4])>=0",
796
+ "": "z",
797
+ _resort: function(m){
798
+ return ["", m[1], m[3], m[2], m[5]];
799
+ },
800
+ _prefix: "z=a[m[3]]||jQuery.attr(a,m[3]);"
801
+ },
802
+ "[": "jQuery.find(m[2],a).length"
803
+ },
804
+
805
+ // The regular expressions that power the parsing engine
806
+ parse: [
807
+ // Match: [@value='test'], [@foo]
808
+ /^\[ *(@)([a-z0-9_-]*) *([!*$^=]*) *('?"?)(.*?)\4 *\]/i,
809
+
810
+ // Match: [div], [div p]
811
+ /^(\[)\s*(.*?(\[.*?\])?[^[]*?)\s*\]/,
812
+
813
+ // Match: :contains('foo')
814
+ /^(:)([a-z0-9_-]*)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/i,
815
+
816
+ // Match: :even, :last-chlid
817
+ /^([:.#]*)([a-z0-9_*-]*)/i
818
+ ],
819
+
820
+ token: [
821
+ /^(\/?\.\.)/, "a.parentNode",
822
+ /^(>|\/)/, "jQuery.sibling(a.firstChild)",
823
+ /^(\+)/, "jQuery.nth(a,2,'nextSibling')",
824
+ /^(~)/, function(a){
825
+ var s = jQuery.sibling(a.parentNode.firstChild);
826
+ return s.slice(0, jQuery.inArray(a,s));
827
+ }
828
+ ],
829
+
830
+ multiFilter: function( expr, elems, not ) {
831
+ var old, cur = [];
832
+
833
+ while ( expr && expr != old ) {
834
+ old = expr;
835
+ var f = jQuery.filter( expr, elems, not );
836
+ expr = f.t.replace(/^\s*,\s*/, "" );
837
+ cur = not ? elems = f.r : jQuery.merge( cur, f.r );
838
+ }
839
+
840
+ return cur;
841
+ },
842
+ find: function( t, context ) {
843
+ // Quickly handle non-string expressions
844
+ if ( typeof t != "string" )
845
+ return [ t ];
846
+
847
+ // Make sure that the context is a DOM Element
848
+ if ( context && !context.nodeType )
849
+ context = null;
850
+
851
+ // Set the correct context (if none is provided)
852
+ context = context || document;
853
+
854
+ // Handle the common XPath // expression
855
+ if ( !t.indexOf("//") ) {
856
+ context = context.documentElement;
857
+ t = t.substr(2,t.length);
858
+
859
+ // And the / root expression
860
+ } else if ( !t.indexOf("/") ) {
861
+ context = context.documentElement;
862
+ t = t.substr(1,t.length);
863
+ if ( t.indexOf("/") >= 1 )
864
+ t = t.substr(t.indexOf("/"),t.length);
865
+ }
866
+
867
+ // Initialize the search
868
+ var ret = [context], done = [], last = null;
869
+
870
+ // Continue while a selector expression exists, and while
871
+ // we're no longer looping upon ourselves
872
+ while ( t && last != t ) {
873
+ var r = [];
874
+ last = t;
875
+
876
+ t = jQuery.trim(t).replace( /^\/\//i, "" );
877
+
878
+ var foundToken = false;
879
+
880
+ // An attempt at speeding up child selectors that
881
+ // point to a specific element tag
882
+ var re = /^[\/>]\s*([a-z0-9*-]+)/i;
883
+ var m = re.exec(t);
884
+
885
+ if ( m ) {
886
+ // Perform our own iteration and filter
887
+ jQuery.each( ret, function(){
888
+ for ( var c = this.firstChild; c; c = c.nextSibling )
889
+ if ( c.nodeType == 1 && ( jQuery.nodeName(c, m[1]) || m[1] == "*" ) )
890
+ r.push( c );
891
+ });
892
+
893
+ ret = r;
894
+ t = t.replace( re, "" );
895
+ if ( t.indexOf(" ") == 0 ) continue;
896
+ foundToken = true;
897
+ } else {
898
+ // Look for pre-defined expression tokens
899
+ for ( var i = 0; i < jQuery.token.length; i += 2 ) {
900
+ // Attempt to match each, individual, token in
901
+ // the specified order
902
+ var re = jQuery.token[i];
903
+ var m = re.exec(t);
904
+
905
+ // If the token match was found
906
+ if ( m ) {
907
+ // Map it against the token's handler
908
+ r = ret = jQuery.map( ret, jQuery.isFunction( jQuery.token[i+1] ) ?
909
+ jQuery.token[i+1] :
910
+ function(a){ return eval(jQuery.token[i+1]); });
911
+
912
+ // And remove the token
913
+ t = jQuery.trim( t.replace( re, "" ) );
914
+ foundToken = true;
915
+ break;
916
+ }
917
+ }
918
+ }
919
+
920
+ // See if there's still an expression, and that we haven't already
921
+ // matched a token
922
+ if ( t && !foundToken ) {
923
+ // Handle multiple expressions
924
+ if ( !t.indexOf(",") ) {
925
+ // Clean the result set
926
+ if ( ret[0] == context ) ret.shift();
927
+
928
+ // Merge the result sets
929
+ jQuery.merge( done, ret );
930
+
931
+ // Reset the context
932
+ r = ret = [context];
933
+
934
+ // Touch up the selector string
935
+ t = " " + t.substr(1,t.length);
936
+
937
+ } else {
938
+ // Optomize for the case nodeName#idName
939
+ var re2 = /^([a-z0-9_-]+)(#)([a-z0-9\\*_-]*)/i;
940
+ var m = re2.exec(t);
941
+
942
+ // Re-organize the results, so that they're consistent
943
+ if ( m ) {
944
+ m = [ 0, m[2], m[3], m[1] ];
945
+
946
+ } else {
947
+ // Otherwise, do a traditional filter check for
948
+ // ID, class, and element selectors
949
+ re2 = /^([#.]?)([a-z0-9\\*_-]*)/i;
950
+ m = re2.exec(t);
951
+ }
952
+
953
+ // Try to do a global search by ID, where we can
954
+ if ( m[1] == "#" && ret[ret.length-1].getElementById ) {
955
+ // Optimization for HTML document case
956
+ var oid = ret[ret.length-1].getElementById(m[2]);
957
+
958
+ // Do a quick check for node name (where applicable) so
959
+ // that div#foo searches will be really fast
960
+ ret = r = oid &&
961
+ (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
962
+
963
+ } else {
964
+ // Pre-compile a regular expression to handle class searches
965
+ if ( m[1] == "." )
966
+ var rec = new RegExp("(^|\\s)" + m[2] + "(\\s|$)");
967
+
968
+ // We need to find all descendant elements, it is more
969
+ // efficient to use getAll() when we are already further down
970
+ // the tree - we try to recognize that here
971
+ jQuery.each( ret, function(){
972
+ // Grab the tag name being searched for
973
+ var tag = m[1] != "" || m[0] == "" ? "*" : m[2];
974
+
975
+ // Handle IE7 being really dumb about <object>s
976
+ if ( jQuery.nodeName(this, "object") && tag == "*" )
977
+ tag = "param";
978
+
979
+ jQuery.merge( r,
980
+ m[1] != "" && ret.length != 1 ?
981
+ jQuery.getAll( this, [], m[1], m[2], rec ) :
982
+ this.getElementsByTagName( tag )
983
+ );
984
+ });
985
+
986
+ // It's faster to filter by class and be done with it
987
+ if ( m[1] == "." && ret.length == 1 )
988
+ r = jQuery.grep( r, function(e) {
989
+ return rec.test(e.className);
990
+ });
991
+
992
+ // Same with ID filtering
993
+ if ( m[1] == "#" && ret.length == 1 ) {
994
+ // Remember, then wipe out, the result set
995
+ var tmp = r;
996
+ r = [];
997
+
998
+ // Then try to find the element with the ID
999
+ jQuery.each( tmp, function(){
1000
+ if ( this.getAttribute("id") == m[2] ) {
1001
+ r = [ this ];
1002
+ return false;
1003
+ }
1004
+ });
1005
+ }
1006
+
1007
+ ret = r;
1008
+ }
1009
+
1010
+ t = t.replace( re2, "" );
1011
+ }
1012
+
1013
+ }
1014
+
1015
+ // If a selector string still exists
1016
+ if ( t ) {
1017
+ // Attempt to filter it
1018
+ var val = jQuery.filter(t,r);
1019
+ ret = r = val.r;
1020
+ t = jQuery.trim(val.t);
1021
+ }
1022
+ }
1023
+
1024
+ // Remove the root context
1025
+ if ( ret && ret[0] == context ) ret.shift();
1026
+
1027
+ // And combine the results
1028
+ jQuery.merge( done, ret );
1029
+
1030
+ return done;
1031
+ },
1032
+
1033
+ filter: function(t,r,not) {
1034
+ // Look for common filter expressions
1035
+ while ( t && /^[a-z[({<*:.#]/i.test(t) ) {
1036
+
1037
+ var p = jQuery.parse, m;
1038
+
1039
+ jQuery.each( p, function(i,re){
1040
+
1041
+ // Look for, and replace, string-like sequences
1042
+ // and finally build a regexp out of it
1043
+ m = re.exec( t );
1044
+
1045
+ if ( m ) {
1046
+ // Remove what we just matched
1047
+ t = t.substring( m[0].length );
1048
+
1049
+ // Re-organize the first match
1050
+ if ( jQuery.expr[ m[1] ]._resort )
1051
+ m = jQuery.expr[ m[1] ]._resort( m );
1052
+
1053
+ return false;
1054
+ }
1055
+ });
1056
+
1057
+ // :not() is a special case that can be optimized by
1058
+ // keeping it out of the expression list
1059
+ if ( m[1] == ":" && m[2] == "not" )
1060
+ r = jQuery.filter(m[3], r, true).r;
1061
+
1062
+ // Handle classes as a special case (this will help to
1063
+ // improve the speed, as the regexp will only be compiled once)
1064
+ else if ( m[1] == "." ) {
1065
+
1066
+ var re = new RegExp("(^|\\s)" + m[2] + "(\\s|$)");
1067
+ r = jQuery.grep( r, function(e){
1068
+ return re.test(e.className || "");
1069
+ }, not);
1070
+
1071
+ // Otherwise, find the expression to execute
1072
+ } else {
1073
+ var f = jQuery.expr[m[1]];
1074
+ if ( typeof f != "string" )
1075
+ f = jQuery.expr[m[1]][m[2]];
1076
+
1077
+ // Build a custom macro to enclose it
1078
+ eval("f = function(a,i){" +
1079
+ ( jQuery.expr[ m[1] ]._prefix || "" ) +
1080
+ "return " + f + "}");
1081
+
1082
+ // Execute it against the current filter
1083
+ r = jQuery.grep( r, f, not );
1084
+ }
1085
+ }
1086
+
1087
+ // Return an array of filtered elements (r)
1088
+ // and the modified expression string (t)
1089
+ return { r: r, t: t };
1090
+ },
1091
+
1092
+ getAll: function( o, r, token, name, re ) {
1093
+ for ( var s = o.firstChild; s; s = s.nextSibling )
1094
+ if ( s.nodeType == 1 ) {
1095
+ var add = true;
1096
+
1097
+ if ( token == "." )
1098
+ add = s.className && re.test(s.className);
1099
+ else if ( token == "#" )
1100
+ add = s.getAttribute("id") == name;
1101
+
1102
+ if ( add )
1103
+ r.push( s );
1104
+
1105
+ if ( token == "#" && r.length ) break;
1106
+
1107
+ if ( s.firstChild )
1108
+ jQuery.getAll( s, r, token, name, re );
1109
+ }
1110
+
1111
+ return r;
1112
+ },
1113
+ parents: function( elem ){
1114
+ var matched = [];
1115
+ var cur = elem.parentNode;
1116
+ while ( cur && cur != document ) {
1117
+ matched.push( cur );
1118
+ cur = cur.parentNode;
1119
+ }
1120
+ return matched;
1121
+ },
1122
+ nth: function(cur,result,dir,elem){
1123
+ result = result || 1;
1124
+ var num = 0;
1125
+ for ( ; cur; cur = cur[dir] ) {
1126
+ if ( cur.nodeType == 1 ) num++;
1127
+ if ( num == result || result == "even" && num % 2 == 0 && num > 1 && cur == elem ||
1128
+ result == "odd" && num % 2 == 1 && cur == elem ) return cur;
1129
+ }
1130
+ },
1131
+ sibling: function( n, elem ) {
1132
+ var r = [];
1133
+
1134
+ for ( ; n; n = n.nextSibling ) {
1135
+ if ( n.nodeType == 1 && (!elem || n != elem) )
1136
+ r.push( n );
1137
+ }
1138
+
1139
+ return r;
1140
+ }
1141
+ });
1142
+ /*
1143
+ * A number of helper functions used for managing events.
1144
+ * Many of the ideas behind this code orignated from
1145
+ * Dean Edwards' addEvent library.
1146
+ */
1147
+ jQuery.event = {
1148
+
1149
+ // Bind an event to an element
1150
+ // Original by Dean Edwards
1151
+ add: function(element, type, handler, data) {
1152
+ // For whatever reason, IE has trouble passing the window object
1153
+ // around, causing it to be cloned in the process
1154
+ if ( jQuery.browser.msie && element.setInterval != undefined )
1155
+ element = window;
1156
+
1157
+ // if data is passed, bind to handler
1158
+ if( data )
1159
+ handler.data = data;
1160
+
1161
+ // Make sure that the function being executed has a unique ID
1162
+ if ( !handler.guid )
1163
+ handler.guid = this.guid++;
1164
+
1165
+ // Init the element's event structure
1166
+ if (!element.events)
1167
+ element.events = {};
1168
+
1169
+ // Get the current list of functions bound to this event
1170
+ var handlers = element.events[type];
1171
+
1172
+ // If it hasn't been initialized yet
1173
+ if (!handlers) {
1174
+ // Init the event handler queue
1175
+ handlers = element.events[type] = {};
1176
+
1177
+ // Remember an existing handler, if it's already there
1178
+ if (element["on" + type])
1179
+ handlers[0] = element["on" + type];
1180
+ }
1181
+
1182
+ // Add the function to the element's handler list
1183
+ handlers[handler.guid] = handler;
1184
+
1185
+ // And bind the global event handler to the element
1186
+ element["on" + type] = this.handle;
1187
+
1188
+ // Remember the function in a global list (for triggering)
1189
+ if (!this.global[type])
1190
+ this.global[type] = [];
1191
+ this.global[type].push( element );
1192
+ },
1193
+
1194
+ guid: 1,
1195
+ global: {},
1196
+
1197
+ // Detach an event or set of events from an element
1198
+ remove: function(element, type, handler) {
1199
+ if (element.events)
1200
+ if ( type && type.type )
1201
+ delete element.events[ type.type ][ type.handler.guid ];
1202
+ else if (type && element.events[type])
1203
+ if ( handler )
1204
+ delete element.events[type][handler.guid];
1205
+ else
1206
+ for ( var i in element.events[type] )
1207
+ delete element.events[type][i];
1208
+ else
1209
+ for ( var j in element.events )
1210
+ this.remove( element, j );
1211
+ },
1212
+
1213
+ trigger: function(type,data,element) {
1214
+ // Clone the incoming data, if any
1215
+ data = jQuery.makeArray(data || []);
1216
+
1217
+ // Handle a global trigger
1218
+ if ( !element )
1219
+ jQuery.each( this.global[type] || [], function(){
1220
+ jQuery.event.trigger( type, data, this );
1221
+ });
1222
+
1223
+ // Handle triggering a single element
1224
+ else {
1225
+ var handler = element["on" + type ], val,
1226
+ fn = jQuery.isFunction( element[ type ] );
1227
+
1228
+ if ( handler ) {
1229
+ // Pass along a fake event
1230
+ data.unshift( this.fix({ type: type, target: element }) );
1231
+
1232
+ // Trigger the event
1233
+ if ( (val = handler.apply( element, data )) !== false )
1234
+ this.triggered = true;
1235
+ }
1236
+
1237
+ if ( fn && val !== false )
1238
+ element[ type ]();
1239
+
1240
+ this.triggered = false;
1241
+ }
1242
+ },
1243
+
1244
+ handle: function(event) {
1245
+ // Handle the second event of a trigger and when
1246
+ // an event is called after a page has unloaded
1247
+ if ( typeof jQuery == "undefined" || jQuery.event.triggered ) return;
1248
+
1249
+ // Empty object is for triggered events with no data
1250
+ event = jQuery.event.fix( event || window.event || {} );
1251
+
1252
+ // returned undefined or false
1253
+ var returnValue;
1254
+
1255
+ var c = this.events[event.type];
1256
+
1257
+ var args = [].slice.call( arguments, 1 );
1258
+ args.unshift( event );
1259
+
1260
+ for ( var j in c ) {
1261
+ // Pass in a reference to the handler function itself
1262
+ // So that we can later remove it
1263
+ args[0].handler = c[j];
1264
+ args[0].data = c[j].data;
1265
+
1266
+ if ( c[j].apply( this, args ) === false ) {
1267
+ event.preventDefault();
1268
+ event.stopPropagation();
1269
+ returnValue = false;
1270
+ }
1271
+ }
1272
+
1273
+ // Clean up added properties in IE to prevent memory leak
1274
+ if (jQuery.browser.msie) event.target = event.preventDefault = event.stopPropagation = event.handler = event.data = null;
1275
+
1276
+ return returnValue;
1277
+ },
1278
+
1279
+ fix: function(event) {
1280
+ // Fix target property, if necessary
1281
+ if ( !event.target && event.srcElement )
1282
+ event.target = event.srcElement;
1283
+
1284
+ // Calculate pageX/Y if missing and clientX/Y available
1285
+ if ( event.pageX == undefined && event.clientX != undefined ) {
1286
+ var e = document.documentElement, b = document.body;
1287
+ event.pageX = event.clientX + (e.scrollLeft || b.scrollLeft);
1288
+ event.pageY = event.clientY + (e.scrollTop || b.scrollTop);
1289
+ }
1290
+
1291
+ // check if target is a textnode (safari)
1292
+ if (jQuery.browser.safari && event.target.nodeType == 3) {
1293
+ // store a copy of the original event object
1294
+ // and clone because target is read only
1295
+ var originalEvent = event;
1296
+ event = jQuery.extend({}, originalEvent);
1297
+
1298
+ // get parentnode from textnode
1299
+ event.target = originalEvent.target.parentNode;
1300
+
1301
+ // add preventDefault and stopPropagation since
1302
+ // they will not work on the clone
1303
+ event.preventDefault = function() {
1304
+ return originalEvent.preventDefault();
1305
+ };
1306
+ event.stopPropagation = function() {
1307
+ return originalEvent.stopPropagation();
1308
+ };
1309
+ }
1310
+
1311
+ // fix preventDefault and stopPropagation
1312
+ if (!event.preventDefault)
1313
+ event.preventDefault = function() {
1314
+ this.returnValue = false;
1315
+ };
1316
+
1317
+ if (!event.stopPropagation)
1318
+ event.stopPropagation = function() {
1319
+ this.cancelBubble = true;
1320
+ };
1321
+
1322
+ return event;
1323
+ }
1324
+ };
1325
+
1326
+ jQuery.fn.extend({
1327
+ bind: function( type, data, fn ) {
1328
+ return this.each(function(){
1329
+ jQuery.event.add( this, type, fn || data, data );
1330
+ });
1331
+ },
1332
+ one: function( type, data, fn ) {
1333
+ return this.each(function(){
1334
+ jQuery.event.add( this, type, function(event) {
1335
+ jQuery(this).unbind(event);
1336
+ return (fn || data).apply( this, arguments);
1337
+ }, data);
1338
+ });
1339
+ },
1340
+ unbind: function( type, fn ) {
1341
+ return this.each(function(){
1342
+ jQuery.event.remove( this, type, fn );
1343
+ });
1344
+ },
1345
+ trigger: function( type, data ) {
1346
+ return this.each(function(){
1347
+ jQuery.event.trigger( type, data, this );
1348
+ });
1349
+ },
1350
+ toggle: function() {
1351
+ // Save reference to arguments for access in closure
1352
+ var a = arguments;
1353
+
1354
+ return this.click(function(e) {
1355
+ // Figure out which function to execute
1356
+ this.lastToggle = this.lastToggle == 0 ? 1 : 0;
1357
+
1358
+ // Make sure that clicks stop
1359
+ e.preventDefault();
1360
+
1361
+ // and execute the function
1362
+ return a[this.lastToggle].apply( this, [e] ) || false;
1363
+ });
1364
+ },
1365
+ hover: function(f,g) {
1366
+
1367
+ // A private function for handling mouse 'hovering'
1368
+ function handleHover(e) {
1369
+ // Check if mouse(over|out) are still within the same parent element
1370
+ var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
1371
+
1372
+ // Traverse up the tree
1373
+ while ( p && p != this ) try { p = p.parentNode } catch(e) { p = this; };
1374
+
1375
+ // If we actually just moused on to a sub-element, ignore it
1376
+ if ( p == this ) return false;
1377
+
1378
+ // Execute the right function
1379
+ return (e.type == "mouseover" ? f : g).apply(this, [e]);
1380
+ }
1381
+
1382
+ // Bind the function to the two event listeners
1383
+ return this.mouseover(handleHover).mouseout(handleHover);
1384
+ },
1385
+ ready: function(f) {
1386
+ // If the DOM is already ready
1387
+ if ( jQuery.isReady )
1388
+ // Execute the function immediately
1389
+ f.apply( document, [jQuery] );
1390
+
1391
+ // Otherwise, remember the function for later
1392
+ else {
1393
+ // Add the function to the wait list
1394
+ jQuery.readyList.push( function() { return f.apply(this, [jQuery]) } );
1395
+ }
1396
+
1397
+ return this;
1398
+ }
1399
+ });
1400
+
1401
+ jQuery.extend({
1402
+ /*
1403
+ * All the code that makes DOM Ready work nicely.
1404
+ */
1405
+ isReady: false,
1406
+ readyList: [],
1407
+
1408
+ // Handle when the DOM is ready
1409
+ ready: function() {
1410
+ // Make sure that the DOM is not already loaded
1411
+ if ( !jQuery.isReady ) {
1412
+ // Remember that the DOM is ready
1413
+ jQuery.isReady = true;
1414
+
1415
+ // If there are functions bound, to execute
1416
+ if ( jQuery.readyList ) {
1417
+ // Execute all of them
1418
+ jQuery.each( jQuery.readyList, function(){
1419
+ this.apply( document );
1420
+ });
1421
+
1422
+ // Reset the list of functions
1423
+ jQuery.readyList = null;
1424
+ }
1425
+ // Remove event lisenter to avoid memory leak
1426
+ if ( jQuery.browser.mozilla || jQuery.browser.opera )
1427
+ document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
1428
+ }
1429
+ }
1430
+ });
1431
+
1432
+ new function(){
1433
+
1434
+ jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
1435
+ "mousedown,mouseup,mousemove,mouseover,mouseout,change,select," +
1436
+ "submit,keydown,keypress,keyup,error").split(","), function(i,o){
1437
+
1438
+ // Handle event binding
1439
+ jQuery.fn[o] = function(f){
1440
+ return f ? this.bind(o, f) : this.trigger(o);
1441
+ };
1442
+
1443
+ });
1444
+
1445
+ // If Mozilla is used
1446
+ if ( jQuery.browser.mozilla || jQuery.browser.opera )
1447
+ // Use the handy event callback
1448
+ document.addEventListener( "DOMContentLoaded", jQuery.ready, false );
1449
+
1450
+ // If IE is used, use the excellent hack by Matthias Miller
1451
+ // http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited
1452
+ else if ( jQuery.browser.msie ) {
1453
+
1454
+ // Only works if you document.write() it
1455
+ document.write("<scr" + "ipt id=__ie_init defer=true " +
1456
+ "src=//:><\/script>");
1457
+
1458
+ // Use the defer script hack
1459
+ var script = document.getElementById("__ie_init");
1460
+
1461
+ // script does not exist if jQuery is loaded dynamically
1462
+ if ( script )
1463
+ script.onreadystatechange = function() {
1464
+ if ( this.readyState != "complete" ) return;
1465
+ this.parentNode.removeChild( this );
1466
+ jQuery.ready();
1467
+ };
1468
+
1469
+ // Clear from memory
1470
+ script = null;
1471
+
1472
+ // If Safari is used
1473
+ } else if ( jQuery.browser.safari )
1474
+ // Continually check to see if the document.readyState is valid
1475
+ jQuery.safariTimer = setInterval(function(){
1476
+ // loaded and complete are both valid states
1477
+ if ( document.readyState == "loaded" ||
1478
+ document.readyState == "complete" ) {
1479
+
1480
+ // If either one are found, remove the timer
1481
+ clearInterval( jQuery.safariTimer );
1482
+ jQuery.safariTimer = null;
1483
+
1484
+ // and execute any waiting functions
1485
+ jQuery.ready();
1486
+ }
1487
+ }, 10);
1488
+
1489
+ // A fallback to window.onload, that will always work
1490
+ jQuery.event.add( window, "load", jQuery.ready );
1491
+
1492
+ };
1493
+
1494
+ // Clean up after IE to avoid memory leaks
1495
+ if (jQuery.browser.msie)
1496
+ jQuery(window).one("unload", function() {
1497
+ var global = jQuery.event.global;
1498
+ for ( var type in global ) {
1499
+ var els = global[type], i = els.length;
1500
+ if ( i && type != 'unload' )
1501
+ do
1502
+ jQuery.event.remove(els[i-1], type);
1503
+ while (--i);
1504
+ }
1505
+ });
1506
+ jQuery.fn.extend({
1507
+
1508
+ show: function(speed,callback){
1509
+ var hidden = this.filter(":hidden");
1510
+ speed ?
1511
+ hidden.animate({
1512
+ height: "show", width: "show", opacity: "show"
1513
+ }, speed, callback) :
1514
+
1515
+ hidden.each(function(){
1516
+ this.style.display = this.oldblock ? this.oldblock : "";
1517
+ if ( jQuery.css(this,"display") == "none" )
1518
+ this.style.display = "block";
1519
+ });
1520
+ return this;
1521
+ },
1522
+
1523
+ hide: function(speed,callback){
1524
+ var visible = this.filter(":visible");
1525
+ speed ?
1526
+ visible.animate({
1527
+ height: "hide", width: "hide", opacity: "hide"
1528
+ }, speed, callback) :
1529
+
1530
+ visible.each(function(){
1531
+ this.oldblock = this.oldblock || jQuery.css(this,"display");
1532
+ if ( this.oldblock == "none" )
1533
+ this.oldblock = "block";
1534
+ this.style.display = "none";
1535
+ });
1536
+ return this;
1537
+ },
1538
+
1539
+ // Save the old toggle function
1540
+ _toggle: jQuery.fn.toggle,
1541
+ toggle: function( fn, fn2 ){
1542
+ var args = arguments;
1543
+ return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
1544
+ this._toggle( fn, fn2 ) :
1545
+ this.each(function(){
1546
+ jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]
1547
+ .apply( jQuery(this), args );
1548
+ });
1549
+ },
1550
+ slideDown: function(speed,callback){
1551
+ return this.animate({height: "show"}, speed, callback);
1552
+ },
1553
+ slideUp: function(speed,callback){
1554
+ return this.animate({height: "hide"}, speed, callback);
1555
+ },
1556
+ slideToggle: function(speed, callback){
1557
+ return this.each(function(){
1558
+ var state = jQuery(this).is(":hidden") ? "show" : "hide";
1559
+ jQuery(this).animate({height: state}, speed, callback);
1560
+ });
1561
+ },
1562
+ fadeIn: function(speed, callback){
1563
+ return this.animate({opacity: "show"}, speed, callback);
1564
+ },
1565
+ fadeOut: function(speed, callback){
1566
+ return this.animate({opacity: "hide"}, speed, callback);
1567
+ },
1568
+ fadeTo: function(speed,to,callback){
1569
+ return this.animate({opacity: to}, speed, callback);
1570
+ },
1571
+ animate: function( prop, speed, easing, callback ) {
1572
+ return this.queue(function(){
1573
+
1574
+ this.curAnim = jQuery.extend({}, prop);
1575
+ var opt = jQuery.speed(speed, easing, callback);
1576
+
1577
+ for ( var p in prop ) {
1578
+ var e = new jQuery.fx( this, opt, p );
1579
+ if ( prop[p].constructor == Number )
1580
+ e.custom( e.cur(), prop[p] );
1581
+ else
1582
+ e[ prop[p] ]( prop );
1583
+ }
1584
+
1585
+ });
1586
+ },
1587
+ queue: function(type,fn){
1588
+ if ( !fn ) {
1589
+ fn = type;
1590
+ type = "fx";
1591
+ }
1592
+
1593
+ return this.each(function(){
1594
+ if ( !this.queue )
1595
+ this.queue = {};
1596
+
1597
+ if ( !this.queue[type] )
1598
+ this.queue[type] = [];
1599
+
1600
+ this.queue[type].push( fn );
1601
+
1602
+ if ( this.queue[type].length == 1 )
1603
+ fn.apply(this);
1604
+ });
1605
+ }
1606
+
1607
+ });
1608
+
1609
+ jQuery.extend({
1610
+
1611
+ speed: function(speed, easing, fn) {
1612
+ var opt = speed && speed.constructor == Object ? speed : {
1613
+ complete: fn || !fn && easing ||
1614
+ jQuery.isFunction( speed ) && speed,
1615
+ duration: speed,
1616
+ easing: fn && easing || easing && easing.constructor != Function && easing
1617
+ };
1618
+
1619
+ opt.duration = (opt.duration && opt.duration.constructor == Number ?
1620
+ opt.duration :
1621
+ { slow: 600, fast: 200 }[opt.duration]) || 400;
1622
+
1623
+ // Queueing
1624
+ opt.old = opt.complete;
1625
+ opt.complete = function(){
1626
+ jQuery.dequeue(this, "fx");
1627
+ if ( jQuery.isFunction( opt.old ) )
1628
+ opt.old.apply( this );
1629
+ };
1630
+
1631
+ return opt;
1632
+ },
1633
+
1634
+ easing: {},
1635
+
1636
+ queue: {},
1637
+
1638
+ dequeue: function(elem,type){
1639
+ type = type || "fx";
1640
+
1641
+ if ( elem.queue && elem.queue[type] ) {
1642
+ // Remove self
1643
+ elem.queue[type].shift();
1644
+
1645
+ // Get next function
1646
+ var f = elem.queue[type][0];
1647
+
1648
+ if ( f ) f.apply( elem );
1649
+ }
1650
+ },
1651
+
1652
+ /*
1653
+ * I originally wrote fx() as a clone of moo.fx and in the process
1654
+ * of making it small in size the code became illegible to sane
1655
+ * people. You've been warned.
1656
+ */
1657
+
1658
+ fx: function( elem, options, prop ){
1659
+
1660
+ var z = this;
1661
+
1662
+ // The styles
1663
+ var y = elem.style;
1664
+
1665
+ // Store display property
1666
+ var oldDisplay = jQuery.css(elem, "display");
1667
+
1668
+ // Set display property to block for animation
1669
+ y.display = "block";
1670
+
1671
+ // Make sure that nothing sneaks out
1672
+ y.overflow = "hidden";
1673
+
1674
+ // Simple function for setting a style value
1675
+ z.a = function(){
1676
+ if ( options.step )
1677
+ options.step.apply( elem, [ z.now ] );
1678
+
1679
+ if ( prop == "opacity" )
1680
+ jQuery.attr(y, "opacity", z.now); // Let attr handle opacity
1681
+ else if ( parseInt(z.now) ) // My hate for IE will never die
1682
+ y[prop] = parseInt(z.now) + "px";
1683
+ };
1684
+
1685
+ // Figure out the maximum number to run to
1686
+ z.max = function(){
1687
+ return parseFloat( jQuery.css(elem,prop) );
1688
+ };
1689
+
1690
+ // Get the current size
1691
+ z.cur = function(){
1692
+ var r = parseFloat( jQuery.curCSS(elem, prop) );
1693
+ return r && r > -10000 ? r : z.max();
1694
+ };
1695
+
1696
+ // Start an animation from one number to another
1697
+ z.custom = function(from,to){
1698
+ z.startTime = (new Date()).getTime();
1699
+ z.now = from;
1700
+ z.a();
1701
+
1702
+ z.timer = setInterval(function(){
1703
+ z.step(from, to);
1704
+ }, 13);
1705
+ };
1706
+
1707
+ // Simple 'show' function
1708
+ z.show = function(){
1709
+ if ( !elem.orig ) elem.orig = {};
1710
+
1711
+ // Remember where we started, so that we can go back to it later
1712
+ elem.orig[prop] = this.cur();
1713
+
1714
+ options.show = true;
1715
+
1716
+ // Begin the animation
1717
+ z.custom(0, elem.orig[prop]);
1718
+
1719
+ // Stupid IE, look what you made me do
1720
+ if ( prop != "opacity" )
1721
+ y[prop] = "1px";
1722
+ };
1723
+
1724
+ // Simple 'hide' function
1725
+ z.hide = function(){
1726
+ if ( !elem.orig ) elem.orig = {};
1727
+
1728
+ // Remember where we started, so that we can go back to it later
1729
+ elem.orig[prop] = this.cur();
1730
+
1731
+ options.hide = true;
1732
+
1733
+ // Begin the animation
1734
+ z.custom(elem.orig[prop], 0);
1735
+ };
1736
+
1737
+ //Simple 'toggle' function
1738
+ z.toggle = function() {
1739
+ if ( !elem.orig ) elem.orig = {};
1740
+
1741
+ // Remember where we started, so that we can go back to it later
1742
+ elem.orig[prop] = this.cur();
1743
+
1744
+ if(oldDisplay == "none") {
1745
+ options.show = true;
1746
+
1747
+ // Stupid IE, look what you made me do
1748
+ if ( prop != "opacity" )
1749
+ y[prop] = "1px";
1750
+
1751
+ // Begin the animation
1752
+ z.custom(0, elem.orig[prop]);
1753
+ } else {
1754
+ options.hide = true;
1755
+
1756
+ // Begin the animation
1757
+ z.custom(elem.orig[prop], 0);
1758
+ }
1759
+ };
1760
+
1761
+ // Each step of an animation
1762
+ z.step = function(firstNum, lastNum){
1763
+ var t = (new Date()).getTime();
1764
+
1765
+ if (t > options.duration + z.startTime) {
1766
+ // Stop the timer
1767
+ clearInterval(z.timer);
1768
+ z.timer = null;
1769
+
1770
+ z.now = lastNum;
1771
+ z.a();
1772
+
1773
+ if (elem.curAnim) elem.curAnim[ prop ] = true;
1774
+
1775
+ var done = true;
1776
+ for ( var i in elem.curAnim )
1777
+ if ( elem.curAnim[i] !== true )
1778
+ done = false;
1779
+
1780
+ if ( done ) {
1781
+ // Reset the overflow
1782
+ y.overflow = "";
1783
+
1784
+ // Reset the display
1785
+ y.display = oldDisplay;
1786
+ if (jQuery.css(elem, "display") == "none")
1787
+ y.display = "block";
1788
+
1789
+ // Hide the element if the "hide" operation was done
1790
+ if ( options.hide )
1791
+ y.display = "none";
1792
+
1793
+ // Reset the properties, if the item has been hidden or shown
1794
+ if ( options.hide || options.show )
1795
+ for ( var p in elem.curAnim )
1796
+ if (p == "opacity")
1797
+ jQuery.attr(y, p, elem.orig[p]);
1798
+ else
1799
+ y[p] = "";
1800
+ }
1801
+
1802
+ // If a callback was provided, execute it
1803
+ if ( done && jQuery.isFunction( options.complete ) )
1804
+ // Execute the complete function
1805
+ options.complete.apply( elem );
1806
+ } else {
1807
+ var n = t - this.startTime;
1808
+ // Figure out where in the animation we are and set the number
1809
+ var p = n / options.duration;
1810
+
1811
+ // If the easing function exists, then use it
1812
+ z.now = options.easing && jQuery.easing[options.easing] ?
1813
+ jQuery.easing[options.easing](p, n, firstNum, (lastNum-firstNum), options.duration) :
1814
+ // else use default linear easing
1815
+ ((-Math.cos(p*Math.PI)/2) + 0.5) * (lastNum-firstNum) + firstNum;
1816
+
1817
+ // Perform the next step of the animation
1818
+ z.a();
1819
+ }
1820
+ };
1821
+
1822
+ }
1823
+ });
1824
+ jQuery.fn.extend({
1825
+ loadIfModified: function( url, params, callback ) {
1826
+ this.load( url, params, callback, 1 );
1827
+ },
1828
+ load: function( url, params, callback, ifModified ) {
1829
+ if ( jQuery.isFunction( url ) )
1830
+ return this.bind("load", url);
1831
+
1832
+ callback = callback || function(){};
1833
+
1834
+ // Default to a GET request
1835
+ var type = "GET";
1836
+
1837
+ // If the second parameter was provided
1838
+ if ( params )
1839
+ // If it's a function
1840
+ if ( jQuery.isFunction( params ) ) {
1841
+ // We assume that it's the callback
1842
+ callback = params;
1843
+ params = null;
1844
+
1845
+ // Otherwise, build a param string
1846
+ } else {
1847
+ params = jQuery.param( params );
1848
+ type = "POST";
1849
+ }
1850
+
1851
+ var self = this;
1852
+
1853
+ // Request the remote document
1854
+ jQuery.ajax({
1855
+ url: url,
1856
+ type: type,
1857
+ data: params,
1858
+ ifModified: ifModified,
1859
+ complete: function(res, status){
1860
+ if ( status == "success" || !ifModified && status == "notmodified" )
1861
+ // Inject the HTML into all the matched elements
1862
+ self.attr("innerHTML", res.responseText)
1863
+ // Execute all the scripts inside of the newly-injected HTML
1864
+ .evalScripts()
1865
+ // Execute callback
1866
+ .each( callback, [res.responseText, status, res] );
1867
+ else
1868
+ callback.apply( self, [res.responseText, status, res] );
1869
+ }
1870
+ });
1871
+ return this;
1872
+ },
1873
+ serialize: function() {
1874
+ return jQuery.param( this );
1875
+ },
1876
+ evalScripts: function() {
1877
+ return this.find("script").each(function(){
1878
+ if ( this.src )
1879
+ jQuery.getScript( this.src );
1880
+ else
1881
+ jQuery.globalEval( this.text || this.textContent || this.innerHTML || "" );
1882
+ }).end();
1883
+ }
1884
+
1885
+ });
1886
+
1887
+ // If IE is used, create a wrapper for the XMLHttpRequest object
1888
+ if ( !window.XMLHttpRequest )
1889
+ XMLHttpRequest = function(){
1890
+ return new ActiveXObject("Microsoft.XMLHTTP");
1891
+ };
1892
+
1893
+ // Attach a bunch of functions for handling common AJAX events
1894
+
1895
+ jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
1896
+ jQuery.fn[o] = function(f){
1897
+ return this.bind(o, f);
1898
+ };
1899
+ });
1900
+
1901
+ jQuery.extend({
1902
+ get: function( url, data, callback, type, ifModified ) {
1903
+ // shift arguments if data argument was ommited
1904
+ if ( jQuery.isFunction( data ) ) {
1905
+ callback = data;
1906
+ data = null;
1907
+ }
1908
+
1909
+ return jQuery.ajax({
1910
+ url: url,
1911
+ data: data,
1912
+ success: callback,
1913
+ dataType: type,
1914
+ ifModified: ifModified
1915
+ });
1916
+ },
1917
+ getIfModified: function( url, data, callback, type ) {
1918
+ return jQuery.get(url, data, callback, type, 1);
1919
+ },
1920
+ getScript: function( url, callback ) {
1921
+ return jQuery.get(url, null, callback, "script");
1922
+ },
1923
+ getJSON: function( url, data, callback ) {
1924
+ return jQuery.get(url, data, callback, "json");
1925
+ },
1926
+ post: function( url, data, callback, type ) {
1927
+ if ( jQuery.isFunction( data ) ) {
1928
+ callback = data;
1929
+ data = {};
1930
+ }
1931
+
1932
+ return jQuery.ajax({
1933
+ type: "POST",
1934
+ url: url,
1935
+ data: data,
1936
+ success: callback,
1937
+ dataType: type
1938
+ });
1939
+ },
1940
+
1941
+ // timeout (ms)
1942
+ //timeout: 0,
1943
+ ajaxTimeout: function( timeout ) {
1944
+ jQuery.ajaxSettings.timeout = timeout;
1945
+ },
1946
+ ajaxSetup: function( settings ) {
1947
+ jQuery.extend( jQuery.ajaxSettings, settings );
1948
+ },
1949
+
1950
+ ajaxSettings: {
1951
+ global: true,
1952
+ type: "GET",
1953
+ timeout: 0,
1954
+ contentType: "application/x-www-form-urlencoded",
1955
+ processData: true,
1956
+ async: true,
1957
+ data: null
1958
+ },
1959
+
1960
+ // Last-Modified header cache for next request
1961
+ lastModified: {},
1962
+ ajax: function( s ) {
1963
+ // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
1964
+ s = jQuery.extend({}, jQuery.ajaxSettings, s);
1965
+
1966
+ // if data available
1967
+ if ( s.data ) {
1968
+ // convert data if not already a string
1969
+ if (s.processData && typeof s.data != "string")
1970
+ s.data = jQuery.param(s.data);
1971
+ // append data to url for get requests
1972
+ if( s.type.toLowerCase() == "get" )
1973
+ // "?" + data or "&" + data (in case there are already params)
1974
+ s.url += ((s.url.indexOf("?") > -1) ? "&" : "?") + s.data;
1975
+ }
1976
+
1977
+ // Watch for a new set of requests
1978
+ if ( s.global && ! jQuery.active++ )
1979
+ jQuery.event.trigger( "ajaxStart" );
1980
+
1981
+ var requestDone = false;
1982
+
1983
+ // Create the request object
1984
+ var xml = new XMLHttpRequest();
1985
+
1986
+ // Open the socket
1987
+ xml.open(s.type, s.url, s.async);
1988
+
1989
+ // Set the correct header, if data is being sent
1990
+ if ( s.data )
1991
+ xml.setRequestHeader("Content-Type", s.contentType);
1992
+
1993
+ // Set the If-Modified-Since header, if ifModified mode.
1994
+ if ( s.ifModified )
1995
+ xml.setRequestHeader("If-Modified-Since",
1996
+ jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
1997
+
1998
+ // Set header so the called script knows that it's an XMLHttpRequest
1999
+ xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");
2000
+
2001
+ // Make sure the browser sends the right content length
2002
+ if ( xml.overrideMimeType )
2003
+ xml.setRequestHeader("Connection", "close");
2004
+
2005
+ // Allow custom headers/mimetypes
2006
+ if( s.beforeSend )
2007
+ s.beforeSend(xml);
2008
+
2009
+ if ( s.global )
2010
+ jQuery.event.trigger("ajaxSend", [xml, s]);
2011
+
2012
+ // Wait for a response to come back
2013
+ var onreadystatechange = function(isTimeout){
2014
+ // The transfer is complete and the data is available, or the request timed out
2015
+ if ( xml && (xml.readyState == 4 || isTimeout == "timeout") ) {
2016
+ requestDone = true;
2017
+ var status;
2018
+ try {
2019
+ status = jQuery.httpSuccess( xml ) && isTimeout != "timeout" ?
2020
+ s.ifModified && jQuery.httpNotModified( xml, s.url ) ? "notmodified" : "success" : "error";
2021
+ // Make sure that the request was successful or notmodified
2022
+ if ( status != "error" ) {
2023
+ // Cache Last-Modified header, if ifModified mode.
2024
+ var modRes;
2025
+ try {
2026
+ modRes = xml.getResponseHeader("Last-Modified");
2027
+ } catch(e) {} // swallow exception thrown by FF if header is not available
2028
+
2029
+ if ( s.ifModified && modRes )
2030
+ jQuery.lastModified[s.url] = modRes;
2031
+
2032
+ // process the data (runs the xml through httpData regardless of callback)
2033
+ var data = jQuery.httpData( xml, s.dataType );
2034
+
2035
+ // If a local callback was specified, fire it and pass it the data
2036
+ if ( s.success )
2037
+ s.success( data, status );
2038
+
2039
+ // Fire the global callback
2040
+ if( s.global )
2041
+ jQuery.event.trigger( "ajaxSuccess", [xml, s] );
2042
+ } else
2043
+ jQuery.handleError(s, xml, status);
2044
+ } catch(e) {
2045
+ status = "error";
2046
+ jQuery.handleError(s, xml, status, e);
2047
+ }
2048
+
2049
+ // The request was completed
2050
+ if( s.global )
2051
+ jQuery.event.trigger( "ajaxComplete", [xml, s] );
2052
+
2053
+ // Handle the global AJAX counter
2054
+ if ( s.global && ! --jQuery.active )
2055
+ jQuery.event.trigger( "ajaxStop" );
2056
+
2057
+ // Process result
2058
+ if ( s.complete )
2059
+ s.complete(xml, status);
2060
+
2061
+ // Stop memory leaks
2062
+ xml.onreadystatechange = function(){};
2063
+ xml = null;
2064
+ }
2065
+ };
2066
+ xml.onreadystatechange = onreadystatechange;
2067
+
2068
+ // Timeout checker
2069
+ if ( s.timeout > 0 )
2070
+ setTimeout(function(){
2071
+ // Check to see if the request is still happening
2072
+ if ( xml ) {
2073
+ // Cancel the request
2074
+ xml.abort();
2075
+
2076
+ if( !requestDone )
2077
+ onreadystatechange( "timeout" );
2078
+ }
2079
+ }, s.timeout);
2080
+
2081
+ // save non-leaking reference
2082
+ var xml2 = xml;
2083
+
2084
+ // Send the data
2085
+ try {
2086
+ xml2.send(s.data);
2087
+ } catch(e) {
2088
+ jQuery.handleError(s, xml, null, e);
2089
+ }
2090
+
2091
+ // firefox 1.5 doesn't fire statechange for sync requests
2092
+ if ( !s.async )
2093
+ onreadystatechange();
2094
+
2095
+ // return XMLHttpRequest to allow aborting the request etc.
2096
+ return xml2;
2097
+ },
2098
+
2099
+ handleError: function( s, xml, status, e ) {
2100
+ // If a local callback was specified, fire it
2101
+ if ( s.error ) s.error( xml, status, e );
2102
+
2103
+ // Fire the global callback
2104
+ if ( s.global )
2105
+ jQuery.event.trigger( "ajaxError", [xml, s, e] );
2106
+ },
2107
+
2108
+ // Counter for holding the number of active queries
2109
+ active: 0,
2110
+
2111
+ // Determines if an XMLHttpRequest was successful or not
2112
+ httpSuccess: function( r ) {
2113
+ try {
2114
+ return !r.status && location.protocol == "file:" ||
2115
+ ( r.status >= 200 && r.status < 300 ) || r.status == 304 ||
2116
+ jQuery.browser.safari && r.status == undefined;
2117
+ } catch(e){}
2118
+ return false;
2119
+ },
2120
+
2121
+ // Determines if an XMLHttpRequest returns NotModified
2122
+ httpNotModified: function( xml, url ) {
2123
+ try {
2124
+ var xmlRes = xml.getResponseHeader("Last-Modified");
2125
+
2126
+ // Firefox always returns 200. check Last-Modified date
2127
+ return xml.status == 304 || xmlRes == jQuery.lastModified[url] ||
2128
+ jQuery.browser.safari && xml.status == undefined;
2129
+ } catch(e){}
2130
+ return false;
2131
+ },
2132
+
2133
+ /* Get the data out of an XMLHttpRequest.
2134
+ * Return parsed XML if content-type header is "xml" and type is "xml" or omitted,
2135
+ * otherwise return plain text.
2136
+ * (String) data - The type of data that you're expecting back,
2137
+ * (e.g. "xml", "html", "script")
2138
+ */
2139
+ httpData: function( r, type ) {
2140
+ var ct = r.getResponseHeader("content-type");
2141
+ var data = !type && ct && ct.indexOf("xml") >= 0;
2142
+ data = type == "xml" || data ? r.responseXML : r.responseText;
2143
+
2144
+ // If the type is "script", eval it in global context
2145
+ if ( type == "script" )
2146
+ jQuery.globalEval( data );
2147
+
2148
+ // Get the JavaScript object, if JSON is used.
2149
+ if ( type == "json" )
2150
+ eval( "data = " + data );
2151
+
2152
+ // evaluate scripts within html
2153
+ if ( type == "html" )
2154
+ jQuery("<div>").html(data).evalScripts();
2155
+
2156
+ return data;
2157
+ },
2158
+
2159
+ // Serialize an array of form elements or a set of
2160
+ // key/values into a query string
2161
+ param: function( a ) {
2162
+ var s = [];
2163
+
2164
+ // If an array was passed in, assume that it is an array
2165
+ // of form elements
2166
+ if ( a.constructor == Array || a.jquery )
2167
+ // Serialize the form elements
2168
+ jQuery.each( a, function(){
2169
+ s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
2170
+ });
2171
+
2172
+ // Otherwise, assume that it's an object of key/value pairs
2173
+ else
2174
+ // Serialize the key/values
2175
+ for ( var j in a )
2176
+ // If the value is an array then the key names need to be repeated
2177
+ if ( a[j] && a[j].constructor == Array )
2178
+ jQuery.each( a[j], function(){
2179
+ s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
2180
+ });
2181
+ else
2182
+ s.push( encodeURIComponent(j) + "=" + encodeURIComponent( a[j] ) );
2183
+
2184
+ // Return the resulting serialization
2185
+ return s.join("&");
2186
+ },
2187
+
2188
+ // evalulates a script in global context
2189
+ // not reliable for safari
2190
+ globalEval: function( data ) {
2191
+ if ( window.execScript )
2192
+ window.execScript( data );
2193
+ else if ( jQuery.browser.safari )
2194
+ // safari doesn't provide a synchronous global eval
2195
+ window.setTimeout( data, 0 );
2196
+ else
2197
+ eval.call( window, data );
2198
+ }
2199
+
2200
+ });
2201
+ }