javascriptmvc 3.0.0.pre15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (550) hide show
  1. data/.document +5 -0
  2. data/.gitignore +21 -0
  3. data/README.markdown +15 -0
  4. data/Rakefile +17 -0
  5. data/VERSION +1 -0
  6. data/bin/jmvc-build +4 -0
  7. data/bin/jmvc-gen +4 -0
  8. data/bin/jmvc-get +4 -0
  9. data/bin/jmvc-init +4 -0
  10. data/bin/jmvc-update +4 -0
  11. data/lib/javascriptmvc.rb +97 -0
  12. data/lib/javascriptmvc/documentjs/README +0 -0
  13. data/lib/javascriptmvc/documentjs/add.js +76 -0
  14. data/lib/javascriptmvc/documentjs/application.js +285 -0
  15. data/lib/javascriptmvc/documentjs/attribute.js +61 -0
  16. data/lib/javascriptmvc/documentjs/baseclass.js +537 -0
  17. data/lib/javascriptmvc/documentjs/class.js +141 -0
  18. data/lib/javascriptmvc/documentjs/constructor.js +145 -0
  19. data/lib/javascriptmvc/documentjs/directives.js +394 -0
  20. data/lib/javascriptmvc/documentjs/distance.js +49 -0
  21. data/lib/javascriptmvc/documentjs/document +21 -0
  22. data/lib/javascriptmvc/documentjs/documentjs.js +76 -0
  23. data/lib/javascriptmvc/documentjs/file.js +55 -0
  24. data/lib/javascriptmvc/documentjs/function.js +112 -0
  25. data/lib/javascriptmvc/documentjs/jmvcdoc/images/close.png +0 -0
  26. data/lib/javascriptmvc/documentjs/jmvcdoc/images/download.png +0 -0
  27. data/lib/javascriptmvc/documentjs/jmvcdoc/images/fav-off.png +0 -0
  28. data/lib/javascriptmvc/documentjs/jmvcdoc/images/fav-on.png +0 -0
  29. data/lib/javascriptmvc/documentjs/jmvcdoc/images/favicon.ico +0 -0
  30. data/lib/javascriptmvc/documentjs/jmvcdoc/images/logo.png +0 -0
  31. data/lib/javascriptmvc/documentjs/jmvcdoc/images/pre.png +0 -0
  32. data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  33. data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  34. data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  35. data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  36. data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  37. data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  38. data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  39. data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  40. data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-icons_222222_256x240.png +0 -0
  41. data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-icons_2e83ff_256x240.png +0 -0
  42. data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-icons_454545_256x240.png +0 -0
  43. data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-icons_888888_256x240.png +0 -0
  44. data/lib/javascriptmvc/documentjs/jmvcdoc/images/ui-icons_cd0a0a_256x240.png +0 -0
  45. data/lib/javascriptmvc/documentjs/jmvcdoc/images/video.png +0 -0
  46. data/lib/javascriptmvc/documentjs/jmvcdoc/production.js +552 -0
  47. data/lib/javascriptmvc/documentjs/jmvcdoc/style.css +354 -0
  48. data/lib/javascriptmvc/documentjs/jmvcdoc/summary.ejs +134 -0
  49. data/lib/javascriptmvc/documentjs/json.js +172 -0
  50. data/lib/javascriptmvc/documentjs/page.js +107 -0
  51. data/lib/javascriptmvc/documentjs/pair.js +302 -0
  52. data/lib/javascriptmvc/documentjs/prototype.js +13 -0
  53. data/lib/javascriptmvc/documentjs/scripts/build.js +6 -0
  54. data/lib/javascriptmvc/documentjs/static.js +25 -0
  55. data/lib/javascriptmvc/documentjs/test/docs/Something.json +1 -0
  56. data/lib/javascriptmvc/documentjs/test/docs/searchData.json +1 -0
  57. data/lib/javascriptmvc/documentjs/test/something.js +8 -0
  58. data/lib/javascriptmvc/documentjs/test/test.html +6 -0
  59. data/lib/javascriptmvc/documentjs/test_doc.html +1 -0
  60. data/lib/javascriptmvc/documentjs/update +5 -0
  61. data/lib/javascriptmvc/funcunit/README +17 -0
  62. data/lib/javascriptmvc/funcunit/autosuggest/auto_suggest.js +495 -0
  63. data/lib/javascriptmvc/funcunit/autosuggest/autosuggest.css +24 -0
  64. data/lib/javascriptmvc/funcunit/autosuggest/autosuggest.html +26 -0
  65. data/lib/javascriptmvc/funcunit/autosuggest/autosuggest.js +17 -0
  66. data/lib/javascriptmvc/funcunit/autosuggest/autosuggest_test.js +14 -0
  67. data/lib/javascriptmvc/funcunit/autosuggest/funcunit.html +15 -0
  68. data/lib/javascriptmvc/funcunit/build.js +54 -0
  69. data/lib/javascriptmvc/funcunit/drivers/selenium.js +129 -0
  70. data/lib/javascriptmvc/funcunit/drivers/standard.js +169 -0
  71. data/lib/javascriptmvc/funcunit/envjs +13 -0
  72. data/lib/javascriptmvc/funcunit/envjs.bat +28 -0
  73. data/lib/javascriptmvc/funcunit/funcunit.html +20 -0
  74. data/lib/javascriptmvc/funcunit/funcunit.js +1509 -0
  75. data/lib/javascriptmvc/funcunit/java/selenium-java-client-driver.jar +0 -0
  76. data/lib/javascriptmvc/funcunit/java/selenium-server.jar +0 -0
  77. data/lib/javascriptmvc/funcunit/qunit.html +22 -0
  78. data/lib/javascriptmvc/funcunit/qunit/qunit.css +119 -0
  79. data/lib/javascriptmvc/funcunit/qunit/qunit.js +1124 -0
  80. data/lib/javascriptmvc/funcunit/qunit/rhino/rhino.js +24 -0
  81. data/lib/javascriptmvc/funcunit/qunit/test/qunit.html +18 -0
  82. data/lib/javascriptmvc/funcunit/qunit/test/test.js +7 -0
  83. data/lib/javascriptmvc/funcunit/resources/funcunit.js +31 -0
  84. data/lib/javascriptmvc/funcunit/resources/jquery.js +6378 -0
  85. data/lib/javascriptmvc/funcunit/resources/json.js +201 -0
  86. data/lib/javascriptmvc/funcunit/resources/selenium_start.js +43 -0
  87. data/lib/javascriptmvc/funcunit/scripts/run.js +36 -0
  88. data/lib/javascriptmvc/funcunit/scripts/test.js +55 -0
  89. data/lib/javascriptmvc/funcunit/settings.js +10 -0
  90. data/lib/javascriptmvc/funcunit/synthetic/browsers.js +151 -0
  91. data/lib/javascriptmvc/funcunit/synthetic/demo.html +150 -0
  92. data/lib/javascriptmvc/funcunit/synthetic/demo/record.js +254 -0
  93. data/lib/javascriptmvc/funcunit/synthetic/drag/drag.html +41 -0
  94. data/lib/javascriptmvc/funcunit/synthetic/drag/drag.js +268 -0
  95. data/lib/javascriptmvc/funcunit/synthetic/drag/qunit.html +20 -0
  96. data/lib/javascriptmvc/funcunit/synthetic/drag/test/qunit/drag_test.js +195 -0
  97. data/lib/javascriptmvc/funcunit/synthetic/drag/test/qunit/qunit.js +7 -0
  98. data/lib/javascriptmvc/funcunit/synthetic/key.js +832 -0
  99. data/lib/javascriptmvc/funcunit/synthetic/mouse.js +291 -0
  100. data/lib/javascriptmvc/funcunit/synthetic/qunit.html +22 -0
  101. data/lib/javascriptmvc/funcunit/synthetic/recorder.html +303 -0
  102. data/lib/javascriptmvc/funcunit/synthetic/synthetic.html +85 -0
  103. data/lib/javascriptmvc/funcunit/synthetic/synthetic.js +796 -0
  104. data/lib/javascriptmvc/funcunit/synthetic/test/qunit/key_test.js +391 -0
  105. data/lib/javascriptmvc/funcunit/synthetic/test/qunit/mouse_test.js +233 -0
  106. data/lib/javascriptmvc/funcunit/synthetic/test/qunit/qunit.js +6 -0
  107. data/lib/javascriptmvc/funcunit/synthetic/test/qunit/synthetic_test.js +91 -0
  108. data/lib/javascriptmvc/funcunit/synthetic/test/submit.html +29 -0
  109. data/lib/javascriptmvc/funcunit/synthetic/test/submitted.html +3 -0
  110. data/lib/javascriptmvc/funcunit/template.html +18 -0
  111. data/lib/javascriptmvc/funcunit/test/drag.html +63 -0
  112. data/lib/javascriptmvc/funcunit/test/funcunit/funcunit.js +3 -0
  113. data/lib/javascriptmvc/funcunit/test/funcunit/funcunit_test.js +87 -0
  114. data/lib/javascriptmvc/funcunit/test/funcunit/open_test.js +28 -0
  115. data/lib/javascriptmvc/funcunit/test/funcunit/protodrag_test.js +13 -0
  116. data/lib/javascriptmvc/funcunit/test/funcunit/syn_test.js +41 -0
  117. data/lib/javascriptmvc/funcunit/test/jquery.event.drag.js +801 -0
  118. data/lib/javascriptmvc/funcunit/test/jquery.event.drop.js +439 -0
  119. data/lib/javascriptmvc/funcunit/test/jquery.js +6360 -0
  120. data/lib/javascriptmvc/funcunit/test/myapp.html +103 -0
  121. data/lib/javascriptmvc/funcunit/test/myotherapp.html +15 -0
  122. data/lib/javascriptmvc/funcunit/test/protodrag/dragdrop.js +974 -0
  123. data/lib/javascriptmvc/funcunit/test/protodrag/effects.js +1123 -0
  124. data/lib/javascriptmvc/funcunit/test/protodrag/funcunit_test.js +20 -0
  125. data/lib/javascriptmvc/funcunit/test/protodrag/myapp.html +63 -0
  126. data/lib/javascriptmvc/funcunit/test/protodrag/prototype.js +4874 -0
  127. data/lib/javascriptmvc/funcunit/test/protodrag/scriptaculous.js +68 -0
  128. data/lib/javascriptmvc/funcunit/update +5 -0
  129. data/lib/javascriptmvc/jquery/README +24 -0
  130. data/lib/javascriptmvc/jquery/build.js +73 -0
  131. data/lib/javascriptmvc/jquery/class/class.html +109 -0
  132. data/lib/javascriptmvc/jquery/class/class.js +627 -0
  133. data/lib/javascriptmvc/jquery/class/qunit.html +15 -0
  134. data/lib/javascriptmvc/jquery/class/test/qunit/class_test.js +146 -0
  135. data/lib/javascriptmvc/jquery/class/test/qunit/qunit.js +5 -0
  136. data/lib/javascriptmvc/jquery/class/test/qunit/test.html +20 -0
  137. data/lib/javascriptmvc/jquery/controller/controller.html +89 -0
  138. data/lib/javascriptmvc/jquery/controller/controller.js +735 -0
  139. data/lib/javascriptmvc/jquery/controller/history/history.html +44 -0
  140. data/lib/javascriptmvc/jquery/controller/history/history.js +177 -0
  141. data/lib/javascriptmvc/jquery/controller/qunit.html +21 -0
  142. data/lib/javascriptmvc/jquery/controller/subscribe/funcunit.html +21 -0
  143. data/lib/javascriptmvc/jquery/controller/subscribe/scripts/compress.js +6 -0
  144. data/lib/javascriptmvc/jquery/controller/subscribe/scripts/docs.js +6 -0
  145. data/lib/javascriptmvc/jquery/controller/subscribe/subscribe.html +56 -0
  146. data/lib/javascriptmvc/jquery/controller/subscribe/subscribe.js +27 -0
  147. data/lib/javascriptmvc/jquery/controller/subscribe/test/funcunit/funcunit.js +3 -0
  148. data/lib/javascriptmvc/jquery/controller/subscribe/test/funcunit/run.js +10 -0
  149. data/lib/javascriptmvc/jquery/controller/subscribe/test/funcunit/subscribe_test.js +11 -0
  150. data/lib/javascriptmvc/jquery/controller/subscribe/test/qunit/qunit.html +21 -0
  151. data/lib/javascriptmvc/jquery/controller/subscribe/test/qunit/qunit.js +9 -0
  152. data/lib/javascriptmvc/jquery/controller/subscribe/test/qunit/run.js +2 -0
  153. data/lib/javascriptmvc/jquery/controller/subscribe/test/qunit/subscribe_test.js +4 -0
  154. data/lib/javascriptmvc/jquery/controller/test/qunit/controller_test.js +170 -0
  155. data/lib/javascriptmvc/jquery/controller/test/qunit/qunit.js +9 -0
  156. data/lib/javascriptmvc/jquery/controller/view/qunit.html +21 -0
  157. data/lib/javascriptmvc/jquery/controller/view/test/qunit/controller_view_test.js +15 -0
  158. data/lib/javascriptmvc/jquery/controller/view/test/qunit/qunit.js +6 -0
  159. data/lib/javascriptmvc/jquery/controller/view/test/qunit/views/init.micro +1 -0
  160. data/lib/javascriptmvc/jquery/controller/view/view.js +102 -0
  161. data/lib/javascriptmvc/jquery/dom/closest/closest.html +23 -0
  162. data/lib/javascriptmvc/jquery/dom/closest/closest.js +47 -0
  163. data/lib/javascriptmvc/jquery/dom/closest/funcunit.html +20 -0
  164. data/lib/javascriptmvc/jquery/dom/closest/qunit.html +22 -0
  165. data/lib/javascriptmvc/jquery/dom/closest/scripts/compress.js +3 -0
  166. data/lib/javascriptmvc/jquery/dom/closest/scripts/doc.js +4 -0
  167. data/lib/javascriptmvc/jquery/dom/closest/scripts/test.js +55 -0
  168. data/lib/javascriptmvc/jquery/dom/closest/settings.js +40 -0
  169. data/lib/javascriptmvc/jquery/dom/closest/test/funcunit/funcunit.js +3 -0
  170. data/lib/javascriptmvc/jquery/dom/closest/test/funcunit/tests/basic.js +11 -0
  171. data/lib/javascriptmvc/jquery/dom/closest/test/qunit/qunit.js +4 -0
  172. data/lib/javascriptmvc/jquery/dom/closest/test/qunit/tests/basic.js +4 -0
  173. data/lib/javascriptmvc/jquery/dom/compare/compare.html +88 -0
  174. data/lib/javascriptmvc/jquery/dom/compare/compare.js +67 -0
  175. data/lib/javascriptmvc/jquery/dom/compare/qunit.html +20 -0
  176. data/lib/javascriptmvc/jquery/dom/compare/test/qunit/compare_test.js +19 -0
  177. data/lib/javascriptmvc/jquery/dom/compare/test/qunit/qunit.js +5 -0
  178. data/lib/javascriptmvc/jquery/dom/cookie/cookie.html +25 -0
  179. data/lib/javascriptmvc/jquery/dom/cookie/cookie.js +119 -0
  180. data/lib/javascriptmvc/jquery/dom/cookie/scripts/compress.js +6 -0
  181. data/lib/javascriptmvc/jquery/dom/cookie/scripts/doc.js +6 -0
  182. data/lib/javascriptmvc/jquery/dom/cookie/test/funcunit/cookie_test.js +11 -0
  183. data/lib/javascriptmvc/jquery/dom/cookie/test/funcunit/funcunit.html +21 -0
  184. data/lib/javascriptmvc/jquery/dom/cookie/test/funcunit/funcunit.js +3 -0
  185. data/lib/javascriptmvc/jquery/dom/cookie/test/funcunit/run.js +10 -0
  186. data/lib/javascriptmvc/jquery/dom/cookie/test/qunit/cookie_test.js +4 -0
  187. data/lib/javascriptmvc/jquery/dom/cookie/test/qunit/qunit.html +21 -0
  188. data/lib/javascriptmvc/jquery/dom/cookie/test/qunit/qunit.js +9 -0
  189. data/lib/javascriptmvc/jquery/dom/cookie/test/qunit/run.js +2 -0
  190. data/lib/javascriptmvc/jquery/dom/cur_styles/cur_styles.html +71 -0
  191. data/lib/javascriptmvc/jquery/dom/cur_styles/cur_styles.js +120 -0
  192. data/lib/javascriptmvc/jquery/dom/cur_styles/qunit.html +22 -0
  193. data/lib/javascriptmvc/jquery/dom/cur_styles/test/qunit/curStyles.micro +3 -0
  194. data/lib/javascriptmvc/jquery/dom/cur_styles/test/qunit/cur_styles_test.js +22 -0
  195. data/lib/javascriptmvc/jquery/dom/cur_styles/test/qunit/outer.micro +0 -0
  196. data/lib/javascriptmvc/jquery/dom/cur_styles/test/qunit/qunit.js +4 -0
  197. data/lib/javascriptmvc/jquery/dom/dimensions/curstyles.html +22 -0
  198. data/lib/javascriptmvc/jquery/dom/dimensions/dimensions.html +132 -0
  199. data/lib/javascriptmvc/jquery/dom/dimensions/dimensions.js +140 -0
  200. data/lib/javascriptmvc/jquery/dom/dimensions/qunit.html +22 -0
  201. data/lib/javascriptmvc/jquery/dom/dimensions/test/qunit/curStyles.micro +3 -0
  202. data/lib/javascriptmvc/jquery/dom/dimensions/test/qunit/dimensions_test.js +8 -0
  203. data/lib/javascriptmvc/jquery/dom/dimensions/test/qunit/outer.micro +0 -0
  204. data/lib/javascriptmvc/jquery/dom/dimensions/test/qunit/qunit.js +4 -0
  205. data/lib/javascriptmvc/jquery/dom/dom.js +7 -0
  206. data/lib/javascriptmvc/jquery/dom/fixture/fixture.html +143 -0
  207. data/lib/javascriptmvc/jquery/dom/fixture/fixture.js +521 -0
  208. data/lib/javascriptmvc/jquery/dom/fixture/fixtures/messages.html +31 -0
  209. data/lib/javascriptmvc/jquery/dom/fixture/fixtures/test.json +3 -0
  210. data/lib/javascriptmvc/jquery/dom/fixture/qunit.html +22 -0
  211. data/lib/javascriptmvc/jquery/dom/fixture/test/qunit/fixture_test.js +50 -0
  212. data/lib/javascriptmvc/jquery/dom/fixture/test/qunit/qunit.js +4 -0
  213. data/lib/javascriptmvc/jquery/dom/form_params/form_params.html +57 -0
  214. data/lib/javascriptmvc/jquery/dom/form_params/form_params.js +106 -0
  215. data/lib/javascriptmvc/jquery/dom/form_params/qunit.html +22 -0
  216. data/lib/javascriptmvc/jquery/dom/form_params/test/qunit/basics.micro +27 -0
  217. data/lib/javascriptmvc/jquery/dom/form_params/test/qunit/checkbox.micro +20 -0
  218. data/lib/javascriptmvc/jquery/dom/form_params/test/qunit/form_params_test.js +43 -0
  219. data/lib/javascriptmvc/jquery/dom/form_params/test/qunit/qunit.js +4 -0
  220. data/lib/javascriptmvc/jquery/dom/form_params/test/qunit/truthy.micro +8 -0
  221. data/lib/javascriptmvc/jquery/dom/within/within.js +67 -0
  222. data/lib/javascriptmvc/jquery/error/background.png +0 -0
  223. data/lib/javascriptmvc/jquery/error/error.html +31 -0
  224. data/lib/javascriptmvc/jquery/error/error.js +227 -0
  225. data/lib/javascriptmvc/jquery/error/setup.js +4 -0
  226. data/lib/javascriptmvc/jquery/error/test/test.html +23 -0
  227. data/lib/javascriptmvc/jquery/error/test/test.js +4 -0
  228. data/lib/javascriptmvc/jquery/event/default/compress.js +7 -0
  229. data/lib/javascriptmvc/jquery/event/default/default.html +85 -0
  230. data/lib/javascriptmvc/jquery/event/default/default.js +193 -0
  231. data/lib/javascriptmvc/jquery/event/default/defaultjquery.html +117 -0
  232. data/lib/javascriptmvc/jquery/event/default/qunit.html +22 -0
  233. data/lib/javascriptmvc/jquery/event/default/test/qunit/default_test.js +104 -0
  234. data/lib/javascriptmvc/jquery/event/default/test/qunit/html.micro +8 -0
  235. data/lib/javascriptmvc/jquery/event/default/test/qunit/qunit.js +6 -0
  236. data/lib/javascriptmvc/jquery/event/default/test/qunit/run.js +2 -0
  237. data/lib/javascriptmvc/jquery/event/destroyed/destroyed.html +24 -0
  238. data/lib/javascriptmvc/jquery/event/destroyed/destroyed.js +40 -0
  239. data/lib/javascriptmvc/jquery/event/destroyed/destroyed_menu.html +96 -0
  240. data/lib/javascriptmvc/jquery/event/destroyed/qunit.html +21 -0
  241. data/lib/javascriptmvc/jquery/event/destroyed/test/qunit/destroyed_test.js +12 -0
  242. data/lib/javascriptmvc/jquery/event/destroyed/test/qunit/qunit.js +6 -0
  243. data/lib/javascriptmvc/jquery/event/drag/drag.html +105 -0
  244. data/lib/javascriptmvc/jquery/event/drag/drag.js +466 -0
  245. data/lib/javascriptmvc/jquery/event/drag/limit/limit.html +74 -0
  246. data/lib/javascriptmvc/jquery/event/drag/limit/limit.js +56 -0
  247. data/lib/javascriptmvc/jquery/event/drag/limit/scripts/compress.js +6 -0
  248. data/lib/javascriptmvc/jquery/event/drag/limit/scripts/doc.js +6 -0
  249. data/lib/javascriptmvc/jquery/event/drag/limit/test/funcunit/funcunit.html +21 -0
  250. data/lib/javascriptmvc/jquery/event/drag/limit/test/funcunit/funcunit.js +3 -0
  251. data/lib/javascriptmvc/jquery/event/drag/limit/test/funcunit/limit_test.js +11 -0
  252. data/lib/javascriptmvc/jquery/event/drag/limit/test/funcunit/run.js +10 -0
  253. data/lib/javascriptmvc/jquery/event/drag/limit/test/qunit/limit_test.js +4 -0
  254. data/lib/javascriptmvc/jquery/event/drag/limit/test/qunit/qunit.html +21 -0
  255. data/lib/javascriptmvc/jquery/event/drag/limit/test/qunit/qunit.js +9 -0
  256. data/lib/javascriptmvc/jquery/event/drag/limit/test/qunit/run.js +2 -0
  257. data/lib/javascriptmvc/jquery/event/drag/qunit.html +16 -0
  258. data/lib/javascriptmvc/jquery/event/drag/scroll/scroll.js +120 -0
  259. data/lib/javascriptmvc/jquery/event/drag/test/qunit/drag_test.js +130 -0
  260. data/lib/javascriptmvc/jquery/event/drag/test/qunit/qunit.js +4 -0
  261. data/lib/javascriptmvc/jquery/event/drop/drop.html +74 -0
  262. data/lib/javascriptmvc/jquery/event/drop/drop.js +301 -0
  263. data/lib/javascriptmvc/jquery/event/event.js +6 -0
  264. data/lib/javascriptmvc/jquery/event/hashchange/hashchange.js +245 -0
  265. data/lib/javascriptmvc/jquery/event/hover/compress.js +7 -0
  266. data/lib/javascriptmvc/jquery/event/hover/hover.html +56 -0
  267. data/lib/javascriptmvc/jquery/event/hover/hover.js +219 -0
  268. data/lib/javascriptmvc/jquery/event/hover/qunit.html +16 -0
  269. data/lib/javascriptmvc/jquery/event/hover/test/qunit/hover_test.js +55 -0
  270. data/lib/javascriptmvc/jquery/event/hover/test/qunit/qunit.js +4 -0
  271. data/lib/javascriptmvc/jquery/event/livehack/compress.js +7 -0
  272. data/lib/javascriptmvc/jquery/event/livehack/funcunit.html +21 -0
  273. data/lib/javascriptmvc/jquery/event/livehack/livehack.html +25 -0
  274. data/lib/javascriptmvc/jquery/event/livehack/livehack.js +167 -0
  275. data/lib/javascriptmvc/jquery/event/offline/funcunit.html +20 -0
  276. data/lib/javascriptmvc/jquery/event/offline/offline.html +26 -0
  277. data/lib/javascriptmvc/jquery/event/offline/offline.js +36 -0
  278. data/lib/javascriptmvc/jquery/event/offline/qunit.html +22 -0
  279. data/lib/javascriptmvc/jquery/event/offline/scripts/compress.js +3 -0
  280. data/lib/javascriptmvc/jquery/event/offline/scripts/doc.js +4 -0
  281. data/lib/javascriptmvc/jquery/event/offline/settings.js +41 -0
  282. data/lib/javascriptmvc/jquery/event/offline/test/funcunit/funcunit.js +3 -0
  283. data/lib/javascriptmvc/jquery/event/offline/test/funcunit/tests/basic.js +11 -0
  284. data/lib/javascriptmvc/jquery/event/offline/test/qunit/qunit.js +4 -0
  285. data/lib/javascriptmvc/jquery/event/offline/test/qunit/tests/basic.js +4 -0
  286. data/lib/javascriptmvc/jquery/event/resize/funcunit.html +20 -0
  287. data/lib/javascriptmvc/jquery/event/resize/qunit.html +22 -0
  288. data/lib/javascriptmvc/jquery/event/resize/resize.html +23 -0
  289. data/lib/javascriptmvc/jquery/event/resize/resize.js +50 -0
  290. data/lib/javascriptmvc/jquery/event/resize/scripts/compress.js +3 -0
  291. data/lib/javascriptmvc/jquery/event/resize/scripts/doc.js +4 -0
  292. data/lib/javascriptmvc/jquery/event/resize/scripts/test.js +55 -0
  293. data/lib/javascriptmvc/jquery/event/resize/settings.js +40 -0
  294. data/lib/javascriptmvc/jquery/event/resize/test/funcunit/funcunit.js +3 -0
  295. data/lib/javascriptmvc/jquery/event/resize/test/funcunit/tests/basic.js +11 -0
  296. data/lib/javascriptmvc/jquery/event/resize/test/qunit/qunit.js +4 -0
  297. data/lib/javascriptmvc/jquery/event/resize/test/qunit/tests/basic.js +4 -0
  298. data/lib/javascriptmvc/jquery/event/select/scripts/compress.js +6 -0
  299. data/lib/javascriptmvc/jquery/event/select/scripts/doc.js +6 -0
  300. data/lib/javascriptmvc/jquery/event/select/select.html +63 -0
  301. data/lib/javascriptmvc/jquery/event/select/select.js +65 -0
  302. data/lib/javascriptmvc/jquery/event/select/test/funcunit/funcunit.html +21 -0
  303. data/lib/javascriptmvc/jquery/event/select/test/funcunit/funcunit.js +3 -0
  304. data/lib/javascriptmvc/jquery/event/select/test/funcunit/run.js +10 -0
  305. data/lib/javascriptmvc/jquery/event/select/test/funcunit/select_test.js +11 -0
  306. data/lib/javascriptmvc/jquery/event/select/test/qunit/qunit.html +21 -0
  307. data/lib/javascriptmvc/jquery/event/select/test/qunit/qunit.js +5 -0
  308. data/lib/javascriptmvc/jquery/event/select/test/qunit/run.js +2 -0
  309. data/lib/javascriptmvc/jquery/event/select/test/qunit/select_test.js +4 -0
  310. data/lib/javascriptmvc/jquery/generate/app +23 -0
  311. data/lib/javascriptmvc/jquery/generate/controller +21 -0
  312. data/lib/javascriptmvc/jquery/generate/model +26 -0
  313. data/lib/javascriptmvc/jquery/generate/page +20 -0
  314. data/lib/javascriptmvc/jquery/generate/plugin +20 -0
  315. data/lib/javascriptmvc/jquery/generate/scaffold +23 -0
  316. data/lib/javascriptmvc/jquery/generate/templates/app/(application_name).css.ejs +4 -0
  317. data/lib/javascriptmvc/jquery/generate/templates/app/(application_name).html.ejs +23 -0
  318. data/lib/javascriptmvc/jquery/generate/templates/app/(application_name).js.ejs +21 -0
  319. data/lib/javascriptmvc/jquery/generate/templates/app/controllers/.ignore +0 -0
  320. data/lib/javascriptmvc/jquery/generate/templates/app/docs/.ignore +0 -0
  321. data/lib/javascriptmvc/jquery/generate/templates/app/fixtures/.ignore +0 -0
  322. data/lib/javascriptmvc/jquery/generate/templates/app/funcunit.html.ejs +15 -0
  323. data/lib/javascriptmvc/jquery/generate/templates/app/models/.ignore +0 -0
  324. data/lib/javascriptmvc/jquery/generate/templates/app/qunit.html.ejs +20 -0
  325. data/lib/javascriptmvc/jquery/generate/templates/app/resources/.ignore +0 -0
  326. data/lib/javascriptmvc/jquery/generate/templates/app/scripts/build.js.ejs +6 -0
  327. data/lib/javascriptmvc/jquery/generate/templates/app/scripts/clean.js.ejs +6 -0
  328. data/lib/javascriptmvc/jquery/generate/templates/app/scripts/docs.js.ejs +4 -0
  329. data/lib/javascriptmvc/jquery/generate/templates/app/test/funcunit/(application_name)_test.js.ejs +9 -0
  330. data/lib/javascriptmvc/jquery/generate/templates/app/test/funcunit/funcunit.js.ejs +3 -0
  331. data/lib/javascriptmvc/jquery/generate/templates/app/test/qunit/(application_name)_test.js.ejs +5 -0
  332. data/lib/javascriptmvc/jquery/generate/templates/app/test/qunit/qunit.js.ejs +3 -0
  333. data/lib/javascriptmvc/jquery/generate/templates/app/views/.ignore +0 -0
  334. data/lib/javascriptmvc/jquery/generate/templates/controller/controllers/(underscore)_controller.js.ejs +12 -0
  335. data/lib/javascriptmvc/jquery/generate/templates/model/fixtures.link +1 -0
  336. data/lib/javascriptmvc/jquery/generate/templates/model/models.link +1 -0
  337. data/lib/javascriptmvc/jquery/generate/templates/model/test/qunit.link +1 -0
  338. data/lib/javascriptmvc/jquery/generate/templates/page.ejs +23 -0
  339. data/lib/javascriptmvc/jquery/generate/templates/plugin/(application_name).html.ejs +23 -0
  340. data/lib/javascriptmvc/jquery/generate/templates/plugin/(application_name).js.ejs +3 -0
  341. data/lib/javascriptmvc/jquery/generate/templates/plugin/fixtures/.ignore +0 -0
  342. data/lib/javascriptmvc/jquery/generate/templates/plugin/funcunit.html.ejs +15 -0
  343. data/lib/javascriptmvc/jquery/generate/templates/plugin/qunit.html.ejs +20 -0
  344. data/lib/javascriptmvc/jquery/generate/templates/plugin/resources/.ignore +0 -0
  345. data/lib/javascriptmvc/jquery/generate/templates/plugin/scripts.link +1 -0
  346. data/lib/javascriptmvc/jquery/generate/templates/plugin/test.link +1 -0
  347. data/lib/javascriptmvc/jquery/generate/templates/plugin/views/.ignore +0 -0
  348. data/lib/javascriptmvc/jquery/generate/templates/scaffold/controllers/(underscore)_controller.js.ejs +96 -0
  349. data/lib/javascriptmvc/jquery/generate/templates/scaffold/fixtures/(plural).json.get.ejs +3 -0
  350. data/lib/javascriptmvc/jquery/generate/templates/scaffold/models/(underscore).js.ejs +83 -0
  351. data/lib/javascriptmvc/jquery/generate/templates/scaffold/test/funcunit/(underscore)_controller_test.js.ejs +63 -0
  352. data/lib/javascriptmvc/jquery/generate/templates/scaffold/test/qunit/(underscore)_test.js.ejs +45 -0
  353. data/lib/javascriptmvc/jquery/generate/templates/scaffold/views/(underscore)/edit.ejs.ejs +10 -0
  354. data/lib/javascriptmvc/jquery/generate/templates/scaffold/views/(underscore)/init.ejs.ejs +26 -0
  355. data/lib/javascriptmvc/jquery/generate/templates/scaffold/views/(underscore)/list.ejs.ejs +5 -0
  356. data/lib/javascriptmvc/jquery/generate/templates/scaffold/views/(underscore)/show.ejs.ejs +10 -0
  357. data/lib/javascriptmvc/jquery/jquery.js +6360 -0
  358. data/lib/javascriptmvc/jquery/lang/json/json.html +25 -0
  359. data/lib/javascriptmvc/jquery/lang/json/json.js +201 -0
  360. data/lib/javascriptmvc/jquery/lang/json/scripts/compress.js +6 -0
  361. data/lib/javascriptmvc/jquery/lang/json/scripts/doc.js +6 -0
  362. data/lib/javascriptmvc/jquery/lang/json/test/funcunit/funcunit.html +21 -0
  363. data/lib/javascriptmvc/jquery/lang/json/test/funcunit/funcunit.js +3 -0
  364. data/lib/javascriptmvc/jquery/lang/json/test/funcunit/json_test.js +11 -0
  365. data/lib/javascriptmvc/jquery/lang/json/test/funcunit/run.js +10 -0
  366. data/lib/javascriptmvc/jquery/lang/json/test/qunit/json_test.js +4 -0
  367. data/lib/javascriptmvc/jquery/lang/json/test/qunit/qunit.html +21 -0
  368. data/lib/javascriptmvc/jquery/lang/json/test/qunit/qunit.js +9 -0
  369. data/lib/javascriptmvc/jquery/lang/json/test/qunit/run.js +2 -0
  370. data/lib/javascriptmvc/jquery/lang/lang.html +27 -0
  371. data/lib/javascriptmvc/jquery/lang/lang.js +104 -0
  372. data/lib/javascriptmvc/jquery/lang/openajax/openajax.js +202 -0
  373. data/lib/javascriptmvc/jquery/lang/rsplit/rsplit.js +31 -0
  374. data/lib/javascriptmvc/jquery/lang/vector/vector.js +167 -0
  375. data/lib/javascriptmvc/jquery/model/associations/associations.html +25 -0
  376. data/lib/javascriptmvc/jquery/model/associations/associations.js +46 -0
  377. data/lib/javascriptmvc/jquery/model/associations/qunit.html +21 -0
  378. data/lib/javascriptmvc/jquery/model/associations/test/qunit/associations_test.js +51 -0
  379. data/lib/javascriptmvc/jquery/model/associations/test/qunit/qunit.js +9 -0
  380. data/lib/javascriptmvc/jquery/model/associations/test/qunit/run.js +2 -0
  381. data/lib/javascriptmvc/jquery/model/backup/backup.js +82 -0
  382. data/lib/javascriptmvc/jquery/model/json_rest/json_rest.js +91 -0
  383. data/lib/javascriptmvc/jquery/model/list/list.js +148 -0
  384. data/lib/javascriptmvc/jquery/model/list/qunit.html +16 -0
  385. data/lib/javascriptmvc/jquery/model/list/test/qunit/list_test.js +58 -0
  386. data/lib/javascriptmvc/jquery/model/list/test/qunit/qunit.js +6 -0
  387. data/lib/javascriptmvc/jquery/model/list/test/qunit/run.js +0 -0
  388. data/lib/javascriptmvc/jquery/model/model.js +537 -0
  389. data/lib/javascriptmvc/jquery/model/qunit.html +17 -0
  390. data/lib/javascriptmvc/jquery/model/store/store.js +66 -0
  391. data/lib/javascriptmvc/jquery/model/test/qunit/model_test.js +71 -0
  392. data/lib/javascriptmvc/jquery/model/test/qunit/qunit.js +5 -0
  393. data/lib/javascriptmvc/jquery/qunit.html +15 -0
  394. data/lib/javascriptmvc/jquery/test/funcunit/funcunit.html +21 -0
  395. data/lib/javascriptmvc/jquery/test/funcunit/funcunit.js +3 -0
  396. data/lib/javascriptmvc/jquery/test/funcunit/jquerytest_test.js +11 -0
  397. data/lib/javascriptmvc/jquery/test/funcunit/run.js +10 -0
  398. data/lib/javascriptmvc/jquery/test/qunit/qunit.js +22 -0
  399. data/lib/javascriptmvc/jquery/update +5 -0
  400. data/lib/javascriptmvc/jquery/view/compress.js +7 -0
  401. data/lib/javascriptmvc/jquery/view/ejs/ejs.html +25 -0
  402. data/lib/javascriptmvc/jquery/view/ejs/ejs.js +489 -0
  403. data/lib/javascriptmvc/jquery/view/ejs/funcunit.html +21 -0
  404. data/lib/javascriptmvc/jquery/view/ejs/test/funcunit/ejs_test.js +11 -0
  405. data/lib/javascriptmvc/jquery/view/ejs/test/funcunit/funcunit.js +3 -0
  406. data/lib/javascriptmvc/jquery/view/ejs/test/funcunit/run.js +10 -0
  407. data/lib/javascriptmvc/jquery/view/ejs/test/qunit/ejs_test.js +4 -0
  408. data/lib/javascriptmvc/jquery/view/ejs/test/qunit/qunit.html +21 -0
  409. data/lib/javascriptmvc/jquery/view/ejs/test/qunit/qunit.js +9 -0
  410. data/lib/javascriptmvc/jquery/view/ejs/test/qunit/run.js +2 -0
  411. data/lib/javascriptmvc/jquery/view/fulljslint.js +3774 -0
  412. data/lib/javascriptmvc/jquery/view/helpers/helpers.js +338 -0
  413. data/lib/javascriptmvc/jquery/view/jaml/compress.js +7 -0
  414. data/lib/javascriptmvc/jquery/view/jaml/funcunit.html +21 -0
  415. data/lib/javascriptmvc/jquery/view/jaml/jaml.html +25 -0
  416. data/lib/javascriptmvc/jquery/view/jaml/jaml.js +73 -0
  417. data/lib/javascriptmvc/jquery/view/jaml/node.js +149 -0
  418. data/lib/javascriptmvc/jquery/view/jaml/template.js +131 -0
  419. data/lib/javascriptmvc/jquery/view/jaml/test/funcunit/funcunit.js +3 -0
  420. data/lib/javascriptmvc/jquery/view/jaml/test/funcunit/jaml_test.js +11 -0
  421. data/lib/javascriptmvc/jquery/view/jaml/test/funcunit/run.js +10 -0
  422. data/lib/javascriptmvc/jquery/view/jaml/test/qunit/jaml_test.js +4 -0
  423. data/lib/javascriptmvc/jquery/view/jaml/test/qunit/qunit.html +21 -0
  424. data/lib/javascriptmvc/jquery/view/jaml/test/qunit/qunit.js +9 -0
  425. data/lib/javascriptmvc/jquery/view/jaml/test/qunit/run.js +2 -0
  426. data/lib/javascriptmvc/jquery/view/micro/compress.js +7 -0
  427. data/lib/javascriptmvc/jquery/view/micro/funcunit.html +21 -0
  428. data/lib/javascriptmvc/jquery/view/micro/micro.html +25 -0
  429. data/lib/javascriptmvc/jquery/view/micro/micro.js +57 -0
  430. data/lib/javascriptmvc/jquery/view/micro/test/funcunit/funcunit.js +3 -0
  431. data/lib/javascriptmvc/jquery/view/micro/test/funcunit/micro_test.js +11 -0
  432. data/lib/javascriptmvc/jquery/view/micro/test/funcunit/run.js +10 -0
  433. data/lib/javascriptmvc/jquery/view/micro/test/qunit/micro_test.js +4 -0
  434. data/lib/javascriptmvc/jquery/view/micro/test/qunit/qunit.html +21 -0
  435. data/lib/javascriptmvc/jquery/view/micro/test/qunit/qunit.js +9 -0
  436. data/lib/javascriptmvc/jquery/view/micro/test/qunit/run.js +2 -0
  437. data/lib/javascriptmvc/jquery/view/qunit.html +16 -0
  438. data/lib/javascriptmvc/jquery/view/test/compression/compression.html +12 -0
  439. data/lib/javascriptmvc/jquery/view/test/compression/compression.js +11 -0
  440. data/lib/javascriptmvc/jquery/view/test/compression/run.js +36 -0
  441. data/lib/javascriptmvc/jquery/view/test/funcunit/funcunit.js +3 -0
  442. data/lib/javascriptmvc/jquery/view/test/funcunit/run.js +10 -0
  443. data/lib/javascriptmvc/jquery/view/test/funcunit/view_test.js +11 -0
  444. data/lib/javascriptmvc/jquery/view/test/qunit/nested_plugin.ejs +1 -0
  445. data/lib/javascriptmvc/jquery/view/test/qunit/plugin.ejs +1 -0
  446. data/lib/javascriptmvc/jquery/view/test/qunit/qunit.js +9 -0
  447. data/lib/javascriptmvc/jquery/view/test/qunit/template.ejs +1 -0
  448. data/lib/javascriptmvc/jquery/view/test/qunit/template.jaml +3 -0
  449. data/lib/javascriptmvc/jquery/view/test/qunit/template.micro +1 -0
  450. data/lib/javascriptmvc/jquery/view/test/qunit/template.tmpl +1 -0
  451. data/lib/javascriptmvc/jquery/view/test/qunit/view_test.js +24 -0
  452. data/lib/javascriptmvc/jquery/view/tmpl/tmpl.js +150 -0
  453. data/lib/javascriptmvc/jquery/view/view.html +65 -0
  454. data/lib/javascriptmvc/jquery/view/view.js +296 -0
  455. data/lib/javascriptmvc/js +56 -0
  456. data/lib/javascriptmvc/js.bat +57 -0
  457. data/lib/javascriptmvc/steal/README +26 -0
  458. data/lib/javascriptmvc/steal/build/apps/apps.js +208 -0
  459. data/lib/javascriptmvc/steal/build/apps/test.js +4 -0
  460. data/lib/javascriptmvc/steal/build/build.js +281 -0
  461. data/lib/javascriptmvc/steal/build/pluginify.js +73 -0
  462. data/lib/javascriptmvc/steal/build/scripts/compiler.jar +0 -0
  463. data/lib/javascriptmvc/steal/build/scripts/scripts.js +155 -0
  464. data/lib/javascriptmvc/steal/build/styles/cssmin.js +17 -0
  465. data/lib/javascriptmvc/steal/build/styles/styles.js +84 -0
  466. data/lib/javascriptmvc/steal/build/test/basicpage.html +6 -0
  467. data/lib/javascriptmvc/steal/build/test/basicproduction.js +1 -0
  468. data/lib/javascriptmvc/steal/build/test/basicsource.js +6 -0
  469. data/lib/javascriptmvc/steal/build/test/css/css/css1.css +1 -0
  470. data/lib/javascriptmvc/steal/build/test/css/css/justin.png +0 -0
  471. data/lib/javascriptmvc/steal/build/test/css/css2.css +5 -0
  472. data/lib/javascriptmvc/steal/build/test/css/page.html +9 -0
  473. data/lib/javascriptmvc/steal/build/test/css/production.css +1 -0
  474. data/lib/javascriptmvc/steal/build/test/css/test.js +7 -0
  475. data/lib/javascriptmvc/steal/build/test/css/upload.PNG +0 -0
  476. data/lib/javascriptmvc/steal/build/test/foreign.html +6 -0
  477. data/lib/javascriptmvc/steal/build/test/foreign.js +2 -0
  478. data/lib/javascriptmvc/steal/build/test/removecode.js +11 -0
  479. data/lib/javascriptmvc/steal/build/test/run.js +57 -0
  480. data/lib/javascriptmvc/steal/build/test/stealpage.html +10 -0
  481. data/lib/javascriptmvc/steal/build/test/stealprodpage.html +10 -0
  482. data/lib/javascriptmvc/steal/build/test/test.js +3 -0
  483. data/lib/javascriptmvc/steal/buildjs +21 -0
  484. data/lib/javascriptmvc/steal/clean/beautify.js +1108 -0
  485. data/lib/javascriptmvc/steal/clean/clean.js +179 -0
  486. data/lib/javascriptmvc/steal/clean/jslint.js +5662 -0
  487. data/lib/javascriptmvc/steal/clean/test.js +7 -0
  488. data/lib/javascriptmvc/steal/cleanjs +5 -0
  489. data/lib/javascriptmvc/steal/coffee/coffee-script.js +9 -0
  490. data/lib/javascriptmvc/steal/coffee/coffee.js +56 -0
  491. data/lib/javascriptmvc/steal/dev/dev.js +83 -0
  492. data/lib/javascriptmvc/steal/end.js +1 -0
  493. data/lib/javascriptmvc/steal/generate/app +23 -0
  494. data/lib/javascriptmvc/steal/generate/ejs.js +470 -0
  495. data/lib/javascriptmvc/steal/generate/generate.js +211 -0
  496. data/lib/javascriptmvc/steal/generate/inflector.js +117 -0
  497. data/lib/javascriptmvc/steal/generate/system.js +33 -0
  498. data/lib/javascriptmvc/steal/generate/templates/app/(application_name).css.ejs +10 -0
  499. data/lib/javascriptmvc/steal/generate/templates/app/(application_name).html.ejs +18 -0
  500. data/lib/javascriptmvc/steal/generate/templates/app/(application_name).js.ejs +10 -0
  501. data/lib/javascriptmvc/steal/generate/templates/app/docs/.ignore +0 -0
  502. data/lib/javascriptmvc/steal/generate/templates/app/resources/.ignore +0 -0
  503. data/lib/javascriptmvc/steal/generate/templates/app/resources/example.coffee.ejs +5 -0
  504. data/lib/javascriptmvc/steal/generate/templates/app/resources/example.js.ejs +13 -0
  505. data/lib/javascriptmvc/steal/generate/templates/app/resources/example.less.ejs +9 -0
  506. data/lib/javascriptmvc/steal/generate/templates/app/scripts/build.js.ejs +6 -0
  507. data/lib/javascriptmvc/steal/generate/templates/app/scripts/clean.js.ejs +6 -0
  508. data/lib/javascriptmvc/steal/generate/templates/app/test/.ignore +0 -0
  509. data/lib/javascriptmvc/steal/generate/templates/page.ejs +23 -0
  510. data/lib/javascriptmvc/steal/generate/test/test.js +92 -0
  511. data/lib/javascriptmvc/steal/get/get.js +163 -0
  512. data/lib/javascriptmvc/steal/get/gets.json +10 -0
  513. data/lib/javascriptmvc/steal/get/getter.js +115 -0
  514. data/lib/javascriptmvc/steal/get/github.js +134 -0
  515. data/lib/javascriptmvc/steal/get/json.js +172 -0
  516. data/lib/javascriptmvc/steal/getjs +5 -0
  517. data/lib/javascriptmvc/steal/js +56 -0
  518. data/lib/javascriptmvc/steal/js.bat +57 -0
  519. data/lib/javascriptmvc/steal/less/less.js +117 -0
  520. data/lib/javascriptmvc/steal/less/less_engine.js +2529 -0
  521. data/lib/javascriptmvc/steal/rhino/blank.html +6 -0
  522. data/lib/javascriptmvc/steal/rhino/build.js +31 -0
  523. data/lib/javascriptmvc/steal/rhino/docs.js +68 -0
  524. data/lib/javascriptmvc/steal/rhino/empty.html +12 -0
  525. data/lib/javascriptmvc/steal/rhino/env.js +11537 -0
  526. data/lib/javascriptmvc/steal/rhino/file.js +299 -0
  527. data/lib/javascriptmvc/steal/rhino/js.jar +0 -0
  528. data/lib/javascriptmvc/steal/rhino/loader.js +8 -0
  529. data/lib/javascriptmvc/steal/rhino/prompt.js +49 -0
  530. data/lib/javascriptmvc/steal/rhino/steal.js +122 -0
  531. data/lib/javascriptmvc/steal/rhino/test.js +16 -0
  532. data/lib/javascriptmvc/steal/steal.js +1317 -0
  533. data/lib/javascriptmvc/steal/steal.production.js +23 -0
  534. data/lib/javascriptmvc/steal/test/absoluteurl.html +7 -0
  535. data/lib/javascriptmvc/steal/test/absoluteurl/absoluteurl.js +1 -0
  536. data/lib/javascriptmvc/steal/test/absoluteurl/alert.js +1 -0
  537. data/lib/javascriptmvc/steal/test/another/two.js +2 -0
  538. data/lib/javascriptmvc/steal/test/one/four.js +1 -0
  539. data/lib/javascriptmvc/steal/test/one/one.js +6 -0
  540. data/lib/javascriptmvc/steal/test/qunit/qunit.html +22 -0
  541. data/lib/javascriptmvc/steal/test/qunit/qunit.js +3 -0
  542. data/lib/javascriptmvc/steal/test/qunit/steal_test.js +197 -0
  543. data/lib/javascriptmvc/steal/test/run.js +12 -0
  544. data/lib/javascriptmvc/steal/test/steal.html +37 -0
  545. data/lib/javascriptmvc/steal/test/test.js +82 -0
  546. data/lib/javascriptmvc/steal/test/three.js +3 -0
  547. data/lib/javascriptmvc/steal/testing/test.html +20 -0
  548. data/lib/javascriptmvc/steal/testing/testing.js +48 -0
  549. data/lib/javascriptmvc/steal/update +5 -0
  550. metadata +622 -0
@@ -0,0 +1,6 @@
1
+ //we probably have to have this only describing where the tests are
2
+ steal
3
+ .plugins("jquery")
4
+ .plugins("funcunit/synthetic") //load your app
5
+ .plugins('funcunit/qunit') //load qunit
6
+ .then("synthetic_test", "mouse_test", "key_test")
@@ -0,0 +1,91 @@
1
+ module("funcunit/synthetic")
2
+
3
+ st = {
4
+ g: function( id ) {
5
+ return document.getElementById(id)
6
+ },
7
+ log: function( c ) {
8
+ if(st.g("mlog"))
9
+ st.g("mlog").innerHTML = st.g("mlog").innerHTML+c+"<br/>"
10
+ },
11
+ binder: function( id, ev, f ) {
12
+ st.bind(st.g(id), ev, f)
13
+ },
14
+ unbinder: function( id, ev, f ) {
15
+ st.unbind(st.g(id), ev, f)
16
+ },
17
+ bind : window.addEventListener ?
18
+ function(el, ev, f){el.addEventListener(ev, f, false)} :
19
+ function(el, ev, f){ el.attachEvent("on"+ev, f) },
20
+ unbind : window.addEventListener ?
21
+ function(el, ev, f){ el.removeEventListener(ev, f, false)} :
22
+ function(el, ev, f){ el.detachEvent("on"+ev, f) }
23
+ };
24
+
25
+
26
+ (function(){
27
+ for(var name in Syn.support){
28
+ st.log(name+": "+Syn.support[name])
29
+ }
30
+ })();
31
+
32
+ test("Selecting a select element", function(){
33
+ st.g("qunit-test-area").innerHTML =
34
+ "<form id='outer'><select name='select'><option value='1' id='one'>one</option><option value='2' id='two'>two</option></select></form>";
35
+
36
+ var change = 0, changef = function(){
37
+ change++;
38
+ }
39
+
40
+ st.g("outer").select.selectedIndex = 0;
41
+
42
+ st.bind(st.g("outer").select,"change",changef );
43
+
44
+ stop()
45
+ Syn.click( st.g("two"), function(){
46
+ equals(change, 1 , "change called once")
47
+ equals(st.g("outer").select.selectedIndex, 1, "Change Selected Index");
48
+ //st.g("qunit-test-area").innerHTML = ""
49
+ start();
50
+ })
51
+
52
+
53
+
54
+
55
+ })
56
+
57
+ asyncTest("scrollTop triggers scroll events", function(){
58
+ st.g("qunit-test-area").innerHTML = "<div id='scroller' style='height:100px;width: 100px;overflow:auto'>"+
59
+ "<div style='height: 200px; width: 100%'>text"+
60
+ "</div>"+
61
+ "</div>";
62
+
63
+ st.binder("scroller","scroll",function(ev){
64
+ ok(true,"scrolling created just by changing ScrollTop");
65
+ st.g("qunit-test-area").innerHTML ="";
66
+ start();
67
+ } );
68
+ stop();
69
+ setTimeout(function(){
70
+ var sc = st.g("scroller");
71
+ sc && (sc.scrollTop = 10);
72
+
73
+ },13)
74
+
75
+ })
76
+
77
+ test("focus triggers focus events", function(){
78
+ st.g("qunit-test-area").innerHTML = "<input type='text' id='focusme'/>";
79
+
80
+ st.binder("focusme","focus",function(ev){
81
+ ok(true,"focus creates event");
82
+ st.g("qunit-test-area").innerHTML ="";
83
+ start();
84
+ } );
85
+ stop();
86
+ setTimeout(function(){
87
+ st.g("focusme").focus();
88
+
89
+ },10)
90
+
91
+ })
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
+ "http://www.w3.org/TR/html4/strict.dtd">
3
+ <html lang="en">
4
+ <head>
5
+ <title>Synthetic Submit Test</title>
6
+ <style type='text/css'>
7
+
8
+ </style>
9
+ </head>
10
+ <body>
11
+ <form action='submitted.html' method='get'>
12
+ <input type='submit' id='submitter'/>
13
+ <input name='something' value='else'/>
14
+ </form>
15
+ <a href='' id='go'>Go</a>
16
+ <script type='text/javascript' src='../../../steal/steal.js'></script>
17
+ <script type='text/javascript'>
18
+ steal.plugins('funcunit/synthetic','jquery').start();
19
+ </script>
20
+ <script type='text/javascript' id="demo-source">
21
+ $("#go").click(function(ev){
22
+ ev.preventDefault();
23
+ setTimeout(function(){
24
+ Syn.click({},'submitter')
25
+ },100)
26
+ })
27
+ </script>
28
+ </body>
29
+ </html>
@@ -0,0 +1,3 @@
1
+ <html>
2
+ <h1>Sumibtted!</h1>
3
+ </html>
@@ -0,0 +1,18 @@
1
+ <html>
2
+ <head>
3
+ <!-- Change HREF to point to your copy of qunit.css -->
4
+ <link rel="stylesheet" type="text/css" href="http://v3.javascriptmvc.com/funcunit/dist/qunit.css" />
5
+ <!-- Change SRC to point to your copy of funcunit.js -->
6
+ <script type='text/javascript' src='http://v3.javascriptmvc.com/funcunit/dist/funcunit.js'></script>
7
+ <!-- Change SRC to point to your test.js -->
8
+ <script type='text/javascript' src='TEMPLATE_test.js'></script>
9
+ <title>TEMPLATE Test Suite</title>
10
+ </head>
11
+ <body>
12
+ <h1 id="qunit-header">TEMPLATE Test Suite</h1>
13
+ <h2 id="qunit-banner"></h2>
14
+ <div id="qunit-testrunner-toolbar"></div>
15
+ <h2 id="qunit-userAgent"></h2>
16
+ <ol id="qunit-tests"></ol>
17
+ </body>
18
+ </html>
@@ -0,0 +1,63 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
+ "http://www.w3.org/TR/html4/strict.dtd">
3
+ <html lang="en">
4
+ <head>
5
+ <title>Synthetic Typing Test</title>
6
+ <style type='text/css'>
7
+ #key th:nth-child(even) {background: #CCf}
8
+ #who th:nth-child(even) {background: #fCb}
9
+ .hover {background-color: blue}
10
+ #drag, #drop {
11
+ width: 20px;
12
+ height: 20px;
13
+ border:1px solid black;
14
+ }
15
+ #drag {
16
+ top: 0px;
17
+ background-color: green;
18
+ }
19
+ #drop {
20
+ margin-top:10px;
21
+ background-color: blue;
22
+ }
23
+ .clicked {
24
+ border:1px solid red;
25
+ }
26
+ </style>
27
+ </head>
28
+ <body>
29
+ <p id='start'>start</p>
30
+ <div class='over'>Move over me</div>
31
+ <p id='end'>end</p>
32
+ <div>
33
+ <div id='drag'></div>
34
+ <div id='drop'></div>
35
+ </div>
36
+ <div class='status'></div>
37
+ <script type='text/javascript' src='../../steal/steal.js'></script>
38
+ <script type='text/javascript'>
39
+ steal.plugins('jquery', 'jquery/event/drag', 'jquery/event/drop').start();
40
+ </script>
41
+ <script type='text/javascript' id="demo-source">
42
+ var hoveredOnce = false;
43
+ $(".over").bind('mouseover',function(){
44
+ if (!hoveredOnce) {
45
+ $(this).addClass('hover')
46
+ $(document.body).append("<input type='text' id='typer' />")
47
+ hoveredOnce = true;
48
+ }
49
+ })
50
+
51
+ $('#drag')
52
+ .live("draginit", function(){})
53
+
54
+ $('#drop')
55
+ .live("dropover", function(){
56
+ $(document.body).append("<a href='#' id='clicker'>click</a>")
57
+ $("#clicker").click(function(){
58
+ $(".status").html("dragged")
59
+ })
60
+ })
61
+ </script>
62
+ </body>
63
+ </html>
@@ -0,0 +1,3 @@
1
+ steal
2
+ .plugins("funcunit")
3
+ .then("funcunit_test","open_test","syn_test",'protodrag_test')
@@ -0,0 +1,87 @@
1
+ module("funcunit - jQuery API",{
2
+ setup: function() {
3
+ var self = this;
4
+ S.open("test/myapp.html", function(){
5
+ self.pageIsLoaded = true;
6
+ }, 10000)
7
+ }
8
+ })
9
+
10
+
11
+
12
+ test("qUnit module setup works async", function(){
13
+ ok(this.pageIsLoaded, "page is loaded set before")
14
+ })
15
+
16
+ test("Iframe access", function(){
17
+
18
+ equals(S("h2",0).text(), "Goodbye World", "text of iframe")
19
+
20
+ })
21
+
22
+ test("html with function", 1, function(){
23
+ S("#clickToChange").click()
24
+ .html(function(html){
25
+ return html == "changed"
26
+ }, function(){
27
+ equals(S("#clickToChange").html(),"changed","wait actually waits")
28
+ })
29
+
30
+ })
31
+ test("Html with value", 1, function(){
32
+ S("#clickToChange").click()
33
+
34
+ .html("changed", function(){
35
+ equals(S("#clickToChange").html(),"changed","wait actually waits")
36
+ })
37
+
38
+ })
39
+
40
+ test("Wait", function(){
41
+ var before,
42
+ after
43
+ setTimeout(function(){
44
+ before = true;
45
+ },2)
46
+ setTimeout(function(){
47
+ after = true
48
+ },1000)
49
+ S.wait(20,function(){
50
+ ok(before, 'after 2 ms')
51
+ ok(!after, 'before 1000ms')
52
+
53
+ })
54
+ })
55
+
56
+ test("hasClass", function(){
57
+ var fast
58
+
59
+ S("#hasClass").click();
60
+ setTimeout(function(){
61
+ fast = true
62
+ },50)
63
+ S("#hasClass").hasClass("someClass",true, function(){
64
+ ok(fast,"waited until it has a class exists")
65
+ });
66
+ })
67
+
68
+ test("Exists", function(){
69
+ var fast
70
+
71
+ S("#exists").click();
72
+ setTimeout(function(){
73
+ fast = true
74
+ },50)
75
+ S("#exists p").exists(function(){
76
+ ok(fast,"waited until it exists")
77
+ });
78
+
79
+ })
80
+ test("Accessing the window", function(){
81
+ ok(S(S.window).width()> 20, "I can get the window's width")
82
+ })
83
+ test("Accessing the document", function(){
84
+ ok(S(S.window.document).width()> 20, "I can get the document's width")
85
+ })
86
+
87
+
@@ -0,0 +1,28 @@
1
+ module("funcunit-open")
2
+
3
+ test("URL Test", function(){
4
+ var path;
5
+
6
+ path = FuncUnit.getAbsolutePath("http://foo.com")
7
+ equals(path, "http://foo.com", "paths match");
8
+
9
+ FuncUnit.jmvcRoot = "http://localhost/"
10
+ path = FuncUnit.getAbsolutePath("//myapp/mypage.html")
11
+ equals(path, "http://localhost/myapp/mypage.html", "paths match");
12
+
13
+ FuncUnit.jmvcRoot = null
14
+ path = FuncUnit.getAbsolutePath("//myapp/mypage.html")
15
+ equals(path, "../myapp/mypage.html", "paths match");
16
+ })
17
+
18
+
19
+
20
+ test("Back to back opens", function(){
21
+ S.open("test/myotherapp.html", null, 10000);
22
+
23
+ S.open("test/myapp.html", null, 10000);
24
+
25
+ S("#changelink").click(function(){
26
+ equals(S("#changelink").text(), "Changed","href javascript run")
27
+ })
28
+ })
@@ -0,0 +1,13 @@
1
+ module("funcunit-prototype / scriptaculous drag",{
2
+ setup: function() {
3
+ S.open("test/protodrag/myapp.html", null, 10000);
4
+ }
5
+ })
6
+
7
+
8
+ test("Drag", function(){
9
+
10
+ S("#drag").drag("#drop", function(){
11
+ equals(S("#drop").text(), "Drags 1", 'drag worked correctly')
12
+ })
13
+ })
@@ -0,0 +1,41 @@
1
+ module("funcunit-syn integration")
2
+
3
+
4
+ test("Type and slow Click", function(){
5
+ S.open("test/myapp.html", null, 10000);
6
+
7
+ S("#typehere").type("javascriptmvc", function(){
8
+ equals(S("#seewhatyoutyped").text(), "typed javascriptmvc","typing");
9
+ })
10
+
11
+
12
+
13
+ //click is going to run slow, to make sure we don't continue
14
+ //until after it is done.
15
+ S("#copy").click(function(){
16
+ equals(S("#seewhatyoutyped").text(), "copied javascriptmvc","copy");
17
+ });
18
+
19
+
20
+ //S("#typehere").offset(function(offset){
21
+ // ok(offset.top,"has values")
22
+ //})
23
+ })
24
+
25
+ test("Move To", function(){
26
+ S.open("test/drag.html", null, 10000);
27
+ S("#start").move("#end")
28
+ S("#typer").type("javascriptmvc",function(){
29
+ equals(S("#typer").val(), "javascriptmvc","move test worked correctly");
30
+ })
31
+
32
+ })
33
+
34
+ test("Drag To", function(){
35
+ S.open("test/drag.html", null, 10000);
36
+ S("#drag").drag("#drop")
37
+ S("#clicker").click(function(){
38
+ equals(S(".status").text(), "dragged", 'drag worked correctly')
39
+ })
40
+
41
+ })
@@ -0,0 +1,801 @@
1
+ // jquery/lang/vector/vector.js
2
+
3
+ (function($){
4
+
5
+ var getSetZero = function(v){ return v !== undefined ? (this.array[0] = v) : this.array[0] },
6
+ getSetOne = function(v){ return v !== undefined ? (this.array[1] = v) : this.array[1] }
7
+ /**
8
+ * @constructor
9
+ * A vector class
10
+ * @init creates a new vector instance from the arguments. Example:
11
+ * @codestart
12
+ * new jQuery.Vector(1,2)
13
+ * @codeend
14
+ *
15
+ */
16
+ jQuery.Vector = function(){
17
+ this.update( jQuery.makeArray(arguments) );
18
+ };
19
+ jQuery.Vector.prototype =
20
+ /* @Prototype*/
21
+ {
22
+ /**
23
+ * Applys the function to every item in the vector. Returns the new vector.
24
+ * @param {Function} f
25
+ * @return {jQuery.Vector} new vector class.
26
+ */
27
+ app: function(f){
28
+ var newArr = [];
29
+
30
+ for(var i=0; i < this.array.length; i++)
31
+ newArr.push( f( this.array[i] ) );
32
+ var vec = new jQuery.Vector();
33
+ return vec.update(newArr);
34
+ },
35
+ /**
36
+ * Adds two vectors together. Example:
37
+ * @codestart
38
+ * new Vector(1,2).plus(2,3) //-> &lt;3,5>
39
+ * new Vector(3,5).plus(new Vector(4,5)) //-> &lt;7,10>
40
+ * @codeend
41
+ * @return {jQuery.Vector}
42
+ */
43
+ plus: function(){
44
+ var args = arguments[0] instanceof jQuery.Vector ?
45
+ arguments[0].array :
46
+ jQuery.makeArray(arguments),
47
+ arr=this.array.slice(0),
48
+ vec = new jQuery.Vector();
49
+ for(var i=0; i < args.length; i++)
50
+ arr[i] = (arr[i] ? arr[i] : 0) + args[i];
51
+ return vec.update(arr);
52
+ },
53
+ /**
54
+ * Like plus but subtracts 2 vectors
55
+ * @return {jQuery.Vector}
56
+ */
57
+ minus: function(){
58
+ var args = arguments[0] instanceof jQuery.Vector ?
59
+ arguments[0].array :
60
+ jQuery.makeArray(arguments),
61
+ arr=this.array.slice(0), vec = new jQuery.Vector();
62
+ for(var i=0; i < args.length; i++)
63
+ arr[i] = (arr[i] ? arr[i] : 0) - args[i];
64
+ return vec.update(arr);
65
+ },
66
+ /**
67
+ * Returns the current vector if it is equal to the vector passed in.
68
+ * False if otherwise.
69
+ * @return {jQuery.Vector}
70
+ */
71
+ equals : function(){
72
+ var args = arguments[0] instanceof jQuery.Vector ?
73
+ arguments[0].array :
74
+ jQuery.makeArray(arguments),
75
+ arr=this.array.slice(0), vec = new jQuery.Vector();
76
+ for(var i=0; i < args.length; i++)
77
+ if(arr[i] != args[i]) return null;
78
+ return vec.update(arr);
79
+ },
80
+ /*
81
+ * Returns the 2nd value of the vector
82
+ * @return {Number}
83
+ */
84
+ x : getSetZero,
85
+ width : getSetZero,
86
+ /**
87
+ * Returns the first value of the vector
88
+ * @return {Number}
89
+ */
90
+ y : getSetOne,
91
+ height : getSetOne,
92
+ /**
93
+ * Same as x()
94
+ * @return {Number}
95
+ */
96
+ top : getSetOne,
97
+ /**
98
+ * same as y()
99
+ * @return {Number}
100
+ */
101
+ left : getSetZero,
102
+ /**
103
+ * returns (x,y)
104
+ * @return {String}
105
+ */
106
+ toString: function(){
107
+ return "("+this.array[0]+","+this.array[1]+")";
108
+ },
109
+ /**
110
+ * Replaces the vectors contents
111
+ * @param {Object} array
112
+ */
113
+ update: function(array){
114
+ if(this.array){
115
+ for(var i =0; i < this.array.length; i++) delete this.array[i];
116
+ }
117
+ this.array = array;
118
+ for(var i =0; i < array.length; i++) this[i]= this.array[i];
119
+ return this;
120
+ }
121
+ };
122
+
123
+ jQuery.Event.prototype.vector = function(){
124
+ if(this.originalEvent.synthetic){
125
+ var doc = document.documentElement, body = document.body;
126
+ return new jQuery.Vector(this.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0),
127
+ this.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0));
128
+ }else{
129
+ return new jQuery.Vector(this.pageX, this.pageY);
130
+ }
131
+ }
132
+
133
+ jQuery.fn.offsetv = function() {
134
+ if(this[0] == window){
135
+ return new jQuery.Vector(window.pageXOffset ? window.pageXOffset : document.documentElement.scrollLeft,
136
+ window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop)
137
+ }else{
138
+ var offset = this.offset();
139
+ return new jQuery.Vector(offset.left, offset.top);
140
+ }
141
+ };
142
+
143
+ jQuery.fn.dimensionsv = function(){
144
+ if(this[0] == window)
145
+ return new jQuery.Vector(this.width(), this.height());
146
+ else
147
+ return new jQuery.Vector(this.outerWidth(), this.outerHeight());
148
+ }
149
+ jQuery.fn.centerv = function(){
150
+ return this.offsetv().plus( this.dimensionsv().app(function(u){return u /2;}) )
151
+ }
152
+
153
+ jQuery.fn.makePositioned = function() {
154
+ return this.each(function(){
155
+ var that = jQuery(this);
156
+ var pos = that.css('position');
157
+
158
+ if (!pos || pos == 'static') {
159
+ var style = { position: 'relative' };
160
+
161
+ if (window.opera) {
162
+ style.top = '0px';
163
+ style.left = '0px';
164
+ }
165
+ that.css(style);
166
+ }
167
+ });
168
+ };
169
+
170
+
171
+ })(jQuery);
172
+
173
+ // jquery/event/livehack/livehack.js
174
+
175
+ (function($){
176
+
177
+
178
+ var event = jQuery.event,
179
+
180
+ //helper that finds handlers by type and calls back a function, this is basically handle
181
+ findHelper = function(events, types, callback){
182
+ for( var t =0; t< types.length; t++ ) {
183
+ var type = types[t],
184
+ typeHandlers,
185
+ all = type.indexOf(".") < 0,
186
+ namespaces,
187
+ namespace;
188
+ if ( !all ) {
189
+ namespaces = type.split(".");
190
+ type = namespaces.shift();
191
+ namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
192
+ }
193
+ typeHandlers = ( events[type] || [] ).slice(0);
194
+
195
+ for( var h = 0; h <typeHandlers.length; h++ ) {
196
+ var handle = typeHandlers[h];
197
+ if( !handle.selector && (all || namespace.test( handle.namespace )) ){
198
+ callback(type, handle.origHandler || handle.handler);
199
+ }
200
+ }
201
+ }
202
+ }
203
+
204
+ /**
205
+ * Finds event handlers of a given type on an element.
206
+ * @param {HTMLElement} el
207
+ * @param {Array} types an array of event names
208
+ * @param {String} [selector] optional selector
209
+ * @return {Array} an array of event handlers
210
+ */
211
+ event.find = function(el, types, selector){
212
+ var events = $.data(el, "events"),
213
+ handlers = [];
214
+
215
+ if( !events ) {
216
+ return handlers;
217
+ }
218
+
219
+ if( selector ) {
220
+ if (!events.live) {
221
+ return [];
222
+ }
223
+ var live = events.live;
224
+
225
+ for ( var t = 0; t < live.length; t++ ) {
226
+ var liver = live[t];
227
+ if( liver.selector === selector && $.inArray(liver.origType, types ) !== -1 ) {
228
+ handlers.push(liver.origHandler || liver.handler);
229
+ }
230
+ }
231
+ }else{
232
+ // basically re-create handler's logic
233
+ findHelper(events, types, function(type, handler){
234
+ handlers.push(handler);
235
+ })
236
+ }
237
+ return handlers;
238
+ }
239
+ /**
240
+ * Finds
241
+ * @param {HTMLElement} el
242
+ * @param {Array} types
243
+ */
244
+ event.findBySelector = function(el, types){
245
+ var events = $.data(el, "events"),
246
+ selectors = {},
247
+ //adds a handler for a given selector and event
248
+ add = function(selector, event, handler){
249
+ var select = selectors[selector] || (selectors[selector] = {}),
250
+ events = select[event] || (select[event] = []);
251
+ events.push(handler);
252
+ };
253
+
254
+ if ( !events ) {
255
+ return selectors;
256
+ }
257
+ //first check live:
258
+ $.each( events.live||[] , function(i, live) {
259
+ if( $.inArray(live.origType, types ) !== -1 ) {
260
+ add( live.selector, live.origType, live.origHandler || live.handler );
261
+ }
262
+ })
263
+ //then check straight binds
264
+
265
+ findHelper(events, types, function(type, handler){
266
+ add("", type, handler);
267
+ })
268
+
269
+ return selectors;
270
+ }
271
+ $.fn.respondsTo = function(events){
272
+ if(!this.length){
273
+ return false;
274
+ }else{
275
+ //add default ?
276
+ return event.find(this[0], $.isArray(events) ? events : [events]).length > 0;
277
+ }
278
+ }
279
+ $.fn.triggerHandled = function(event, data){
280
+ event = ( typeof event == "string" ? $.Event(event) : event);
281
+ this.trigger(event, data);
282
+ return event.handled;
283
+ }
284
+ /**
285
+ * Only attaches one event handler for all types ...
286
+ * @param {Array} types llist of types that will delegate here
287
+ * @param {Object} startingEvent the first event to start listening to
288
+ * @param {Object} onFirst a function to call
289
+ */
290
+ event.setupHelper = function(types, startingEvent, onFirst){
291
+ if(!onFirst) {
292
+ onFirst = startingEvent;
293
+ startingEvent = null;
294
+ }
295
+ var add = function(handleObj){
296
+
297
+ var selector = handleObj.selector || "";
298
+ if (selector) {
299
+ var bySelector = event.find(this, types, selector);
300
+ if (!bySelector.length) {
301
+ $(this).delegate(selector,startingEvent, onFirst );
302
+ }
303
+ }
304
+ else {
305
+ //var bySelector = event.find(this, types, selector);
306
+ event.add(this, startingEvent, onFirst, {
307
+ selector: selector,
308
+ delegate: this
309
+ });
310
+ }
311
+
312
+ }
313
+ var remove = function(handleObj){
314
+ var selector = handleObj.selector || "";
315
+ if (selector) {
316
+ var bySelector = event.find(this, types, selector);
317
+ if (!bySelector.length) {
318
+ $(this).undelegate(selector,startingEvent, onFirst );
319
+ }
320
+ }
321
+ else {
322
+ event.remove(this, startingEvent, onFirst, {
323
+ selector: selector,
324
+ delegate: this
325
+ });
326
+ }
327
+ }
328
+ $.each(types, function(){
329
+ event.special[this] = {
330
+ add: add,
331
+ remove: remove,
332
+ setup : function(){}
333
+ };
334
+ });
335
+ }
336
+
337
+ })(jQuery);
338
+
339
+ // jquery/event/drag/drag.js
340
+
341
+ (function($){
342
+
343
+ //modify live
344
+ //steal the live handler ....
345
+
346
+
347
+
348
+ var bind = function(object, method){
349
+ var args = Array.prototype.slice.call(arguments, 2);
350
+ return function() {
351
+ var args2 = [this].concat(args, $.makeArray( arguments ));
352
+ return method.apply(object, args2);
353
+ };
354
+ },
355
+ event = $.event, handle = event.handle;
356
+
357
+ /**
358
+ * @constructor jQuery.Drag
359
+ * @parent specialevents
360
+ * @plugin jquery/event/drag
361
+ * @download jquery/dist/jquery.event.drag.js
362
+ * @test jquery/event/drag/qunit.html
363
+ * Provides drag events as a special events to jQuery.
364
+ * A jQuery.Drag instance is created on a drag and passed
365
+ * as a parameter to the drag event callbacks. By calling
366
+ * methods on the drag event, you can alter the drag's
367
+ * behavior.
368
+ * <h2>Drag Events</h2>
369
+ * The drag plugin allows you to listen to the following events:
370
+ * <ul>
371
+ * <li><code>dragdown</code> - the mouse cursor is pressed down</li>
372
+ * <li><code>draginit</code> - the drag motion is started</li>
373
+ * <li><code>dragmove</code> - the drag is moved</li>
374
+ * <li><code>dragend</code> - the drag has ended</li>
375
+ * <li><code>dragover</code> - the drag is over a drop point</li>
376
+ * <li><code>dragout</code> - the drag moved out of a drop point</li>
377
+ * </ul>
378
+ * <p>Just by binding or delegating on one of these events, you make
379
+ * the element dragable. You can change the behavior of the drag
380
+ * by calling methods on the drag object passed to the callback.
381
+ * <h3>Example</h3>
382
+ * Here's a quick example:
383
+ * @codestart
384
+ * //makes the drag vertical
385
+ * $(".drags").live("draginit", function(event, drag){
386
+ * drag.vertical();
387
+ * })
388
+ * //gets the position of the drag and uses that to set the width
389
+ * //of an element
390
+ * $(".resize").live("dragmove",function(event, drag){
391
+ * $(this).width(drag.position.left() - $(this).offset().left )
392
+ * })
393
+ * @codeend
394
+ * <h2>Drag Object</h2>
395
+ * <p>The drag object is passed after the event to drag
396
+ * event callback functions. By calling methods
397
+ * and changing the properties of the drag object,
398
+ * you can alter how the drag behaves.
399
+ * </p>
400
+ * <p>The drag properties and methods:</p>
401
+ * <ul>
402
+ * <li><code>[jQuery.Drag.prototype.cancel cancel]</code> - stops the drag motion from happening</li>
403
+ * <li><code>[jQuery.Drag.prototype.ghost ghost]</code> - copys the draggable and drags the cloned element</li>
404
+ * <li><code>[jQuery.Drag.prototype.horizontal horizontal]</code> - limits the scroll to horizontal movement</li>
405
+ * <li><code>[jQuery.Drag.prototype.location location]</code> - where the drag should be on the screen</li>
406
+ * <li><code>[jQuery.Drag.prototype.mouseElementPosition mouseElementPosition]</code> - where the mouse should be on the drag</li>
407
+ * <li><code>[jQuery.Drag.prototype.only only]</code> - only have drags, no drops</li>
408
+ * <li><code>[jQuery.Drag.prototype.representative representative]</code> - move another element in place of this element</li>
409
+ * <li><code>[jQuery.Drag.prototype.revert revert]</code> - animate the drag back to its position</li>
410
+ * <li><code>[jQuery.Drag.prototype.vertical vertical]</code> - limit the drag to vertical movement</li>
411
+ * <li><code>[jQuery.Drag.prototype.limit limit]</code> - limit the drag within an element (*limit plugin)</li>
412
+ * <li><code>[jQuery.Drag.prototype.scrolls scrolls]</code> - scroll scrollable areas when dragging near their boundries (*scroll plugin)</li>
413
+ * </ul>
414
+ * <h2>Demo</h2>
415
+ * Now lets see some examples:
416
+ * @demo jquery/event/drag/drag.html 1000
417
+ * @init
418
+ * The constructor is never called directly.
419
+ */
420
+ $.Drag = function(){}
421
+
422
+ /**
423
+ * @Static
424
+ */
425
+ $.extend($.Drag,
426
+ {
427
+ lowerName: "drag",
428
+ current : null,
429
+ /**
430
+ * Called when someone mouses down on a draggable object.
431
+ * Gathers all callback functions and creates a new Draggable.
432
+ * @hide
433
+ */
434
+ mousedown : function(ev, element){
435
+ var isLeftButton = ev.button == 0 || ev.button == 1;
436
+ if( !isLeftButton || this.current) return; //only allows 1 drag at a time, but in future could allow more
437
+
438
+ ev.preventDefault();
439
+ //create Drag
440
+ var drag = new $.Drag(),
441
+ delegate = ev.liveFired || element,
442
+ selector = ev.handleObj.selector,
443
+ self = this;
444
+ this.current = drag;
445
+ drag.setup({
446
+ element: element,
447
+ delegate: ev.liveFired || element,
448
+ selector: ev.handleObj.selector,
449
+ moved: false,
450
+ callbacks: {
451
+ dragdown: event.find(delegate, ["dragdown"], selector)[0],
452
+ draginit: event.find(delegate, ["draginit"], selector)[0],
453
+ dragover: event.find(delegate, ["dragover"], selector)[0],
454
+ dragmove: event.find(delegate, ["dragmove"], selector)[0],
455
+ dragout: event.find(delegate, ["dragout"], selector)[0],
456
+ dragend: event.find(delegate, ["dragend"], selector)[0]
457
+ },
458
+ destroyed : function(){
459
+ self.current = null;
460
+ }
461
+ }, ev)
462
+
463
+ }
464
+ })
465
+
466
+
467
+
468
+
469
+
470
+ /**
471
+ * @Prototype
472
+ */
473
+ $.extend($.Drag.prototype , {
474
+ setup : function(options, ev){
475
+ this.noSelection();
476
+ $.extend(this,options);
477
+ this.element = $(this.element);
478
+ this.event = ev;
479
+ this.moved = false;
480
+ this.allowOtherDrags = false;
481
+ var mousemove = bind(this, this.mousemove);
482
+ var mouseup = bind(this, this.mouseup);
483
+ this._mousemove = mousemove;
484
+ this._mouseup = mouseup;
485
+ $(document).bind('mousemove' ,mousemove);
486
+ $(document).bind('mouseup',mouseup);
487
+ this.callDown(this.element, ev)
488
+ },
489
+ /**
490
+ * Unbinds listeners and allows other drags ...
491
+ * @hide
492
+ */
493
+ destroy : function(){
494
+ $(document).unbind('mousemove', this._mousemove);
495
+ $(document).unbind('mouseup', this._mouseup);
496
+ if(!this.moved){
497
+ this.event = this.element = null;
498
+ }
499
+ this.selection();
500
+ this.destroyed();
501
+ },
502
+ mousemove : function(docEl, ev){
503
+ if(!this.moved){
504
+ this.init(this.element, ev)
505
+ this.moved= true;
506
+ }
507
+
508
+ var pointer = ev.vector();
509
+ if (this._start_position && this._start_position.equals(pointer)) {
510
+ return;
511
+ }
512
+ //e.preventDefault();
513
+
514
+ this.draw(pointer, ev);
515
+ },
516
+ mouseup : function(docEl,event){
517
+ //if there is a current, we should call its dragstop
518
+ if(this.moved){
519
+ this.end(event);
520
+ }
521
+ this.destroy();
522
+ },
523
+ noSelection : function(){
524
+ document.documentElement.onselectstart = function() { return false; };
525
+ document.documentElement.unselectable = "on";
526
+ $(document.documentElement).css('-moz-user-select', 'none');
527
+ },
528
+ selection : function(){
529
+ document.documentElement.onselectstart = function() { };
530
+ document.documentElement.unselectable = "off";
531
+ $(document.documentElement).css('-moz-user-select', '');
532
+ },
533
+ init : function( element, event){
534
+ element = $(element);
535
+ var startElement = (this.movingElement = (this.element = $(element))); //the element that has been clicked on
536
+ //if a mousemove has come after the click
537
+ this._cancelled = false; //if the drag has been cancelled
538
+ this.event = event;
539
+ this.mouseStartPosition = event.vector(); //where the mouse is located
540
+ /**
541
+ * @attribute mouseElementPosition
542
+ * The position of start of the cursor on the element
543
+ */
544
+ this.mouseElementPosition = this.mouseStartPosition.minus( this.element.offsetv() ); //where the mouse is on the Element
545
+
546
+ this.callStart(element, event);
547
+
548
+ //Check what they have set and respond accordingly
549
+ // if they canceled
550
+ if(this._cancelled == true) return;
551
+ //if they set something else as the element
552
+
553
+ this.startPosition = startElement != this.movingElement ? this.movingElement.offsetv() : this.currentDelta();
554
+
555
+ this.movingElement.makePositioned();
556
+ this.movingElement.css('zIndex',1000);
557
+ if(!this._only && this.constructor.responder)
558
+ this.constructor.responder.compile(event, this);
559
+ },
560
+ callDown : function(element, event){
561
+ if(this.callbacks[this.constructor.lowerName+"down"])
562
+ this.callbacks[this.constructor.lowerName+"down"].call(element, event, this );
563
+ },
564
+ callStart : function(element, event){
565
+ if(this.callbacks[this.constructor.lowerName+"init"])
566
+ this.callbacks[this.constructor.lowerName+"init"].call(element, event, this );
567
+ },
568
+ /**
569
+ * Returns the position of the movingElement by taking its top and left.
570
+ * @hide
571
+ * @return {Vector}
572
+ */
573
+ currentDelta: function() {
574
+ return new $.Vector( parseInt( this.movingElement.css('left') ) || 0 ,
575
+ parseInt( this.movingElement.css('top') ) || 0 ) ;
576
+ },
577
+ //draws the position of the dragmove object
578
+ draw: function(pointer, event){
579
+ // only drag if we haven't been cancelled;
580
+ if(this._cancelled) return;
581
+ /**
582
+ * @attribute location
583
+ * The location of where the element should be in the page. This
584
+ * takes into account the start position of the cursor on the element.
585
+ */
586
+ this.location = pointer.minus(this.mouseElementPosition); // the offset between the mouse pointer and the representative that the user asked for
587
+ // position = mouse - (dragOffset - dragTopLeft) - mousePosition
588
+ this.move( event );
589
+ if(this._cancelled) return;
590
+ if(!event.isDefaultPrevented())
591
+ this.position(this.location);
592
+
593
+ //fill in
594
+ if(!this._only && this.constructor.responder)
595
+ this.constructor.responder.show(pointer, this, event);
596
+ },
597
+ /**
598
+ * @hide
599
+ * Set the drag to only allow horizontal dragging
600
+ */
601
+ position : function(offsetPositionv){ //should draw it on the page
602
+ var dragged_element_page_offset = this.movingElement.offsetv(); // the drag element's current page location
603
+
604
+ var dragged_element_css_offset = this.currentDelta(); // the drag element's current left + top css attributes
605
+
606
+ var dragged_element_position_vector = // the vector between the movingElement's page and css positions
607
+ dragged_element_page_offset.minus(dragged_element_css_offset); // this can be thought of as the original offset
608
+
609
+ this.required_css_position = offsetPositionv.minus(dragged_element_position_vector)
610
+
611
+
612
+
613
+ var style = this.movingElement[0].style;
614
+ if(!this._cancelled && !this._horizontal) {
615
+ style.top = this.required_css_position.top() + "px"
616
+ }
617
+ if(!this._cancelled && !this._vertical){
618
+ style.left = this.required_css_position.left() + "px"
619
+ }
620
+ },
621
+ move : function(event){
622
+ if(this.callbacks[this.constructor.lowerName+"move"]) this.callbacks[this.constructor.lowerName+"move"].call(this.element, event, this );
623
+ },
624
+ /**
625
+ * Called on drag up
626
+ * @hide
627
+ * @param {Event} event a mouseup event signalling drag/drop has completed
628
+ */
629
+ end : function(event){
630
+ if(this._cancelled) return;
631
+ if(!this._only && this.constructor.responder)
632
+ this.constructor.responder.end(event, this);
633
+
634
+ if(this.callbacks[this.constructor.lowerName+"end"])
635
+ this.callbacks[this.constructor.lowerName+"end"].call(this.element, event, this );
636
+
637
+ if(this._revert){
638
+ var self= this;
639
+ this.movingElement.animate(
640
+ {
641
+ top: this.startPosition.top()+"px",
642
+ left: this.startPosition.left()+"px"},
643
+ function(){
644
+ self.cleanup.apply(self, arguments)
645
+ }
646
+ )
647
+ }
648
+ else
649
+ this.cleanup();
650
+ this.event = null;
651
+ },
652
+ /**
653
+ * Cleans up drag element after drag drop.
654
+ * @hide
655
+ */
656
+ cleanup : function(){
657
+ this.movingElement.css({zIndex: ""})
658
+ if (this.movingElement[0] !== this.element[0])
659
+ this.movingElement.css({ display: 'none' });
660
+ if(this._removeMovingElement)
661
+ this.movingElement.remove();
662
+
663
+ this.movingElement = this.element = this.event = null;
664
+ },
665
+ /**
666
+ * Stops drag drop from running.
667
+ */
668
+ cancel: function() {
669
+ this._cancelled = true;
670
+ //this.end(this.event);
671
+ if(!this._only && this.constructor.responder)
672
+ this.constructor.responder.clear(this.event.vector(), this, this.event);
673
+ this.destroy();
674
+
675
+ },
676
+ /**
677
+ * Clones the element and uses it as the moving element.
678
+ * @return {jQuery.fn} the ghost
679
+ */
680
+ ghost: function(loc) {
681
+ // create a ghost by cloning the source element and attach the clone to the dom after the source element
682
+ var ghost = this.movingElement.clone().css('position','absolute');
683
+ (loc ? $(loc) : this.movingElement ).after(ghost);
684
+ ghost.width(this.movingElement.width())
685
+ .height(this.movingElement.height())
686
+
687
+ // store the original element and make the ghost the dragged element
688
+ this.movingElement = ghost;
689
+ this._removeMovingElement = true;
690
+ return ghost;
691
+ },
692
+ /**
693
+ * Use a representative element, instead of the movingElement.
694
+ * @param {HTMLElement} element the element you want to actually drag
695
+ * @param {Number} offsetX the x position where you want your mouse on the object
696
+ * @param {Number} offsetY the y position where you want your mouse on the object
697
+ */
698
+ representative : function( element, offsetX, offsetY ){
699
+ this._offsetX = offsetX || 0;
700
+ this._offsetY = offsetY || 0;
701
+
702
+ var p = this.mouseStartPosition;
703
+
704
+ this.movingElement = $(element);
705
+ this.movingElement.css({
706
+ top: (p.y() - this._offsetY) + "px",
707
+ left: (p.x() - this._offsetX) + "px",
708
+ display: 'block',
709
+ position: 'absolute'
710
+ }).show();
711
+
712
+ this.mouseElementPosition = new $.Vector(this._offsetX, this._offsetY)
713
+ },
714
+ /**
715
+ * Makes the movingElement go back to its original position after drop.
716
+ * @codestart
717
+ * ".handle dragend" : function(el, ev, drag){
718
+ * drag.revert()
719
+ * }
720
+ * @codeend
721
+ * @param {optional:Boolean} val optional, set to false if you don't want to revert.
722
+ */
723
+ revert : function(val){
724
+ this._revert = val == null ? true : val;
725
+ },
726
+ /**
727
+ * Isolates the drag to vertical movement.
728
+ */
729
+ vertical : function(){
730
+ this._vertical = true;
731
+ },
732
+ /**
733
+ * Isolates the drag to horizontal movement.
734
+ */
735
+ horizontal : function(){
736
+ this._horizontal = true;
737
+ },
738
+
739
+
740
+ /**
741
+ * Respondables will not be alerted to this drag.
742
+ */
743
+ only :function(only){
744
+ return (this._only = (only === undefined ? true : only));
745
+ }
746
+ });
747
+
748
+ /**
749
+ * @add jQuery.event.special static
750
+ */
751
+ event.setupHelper( [
752
+ /**
753
+ * @attribute dragdown
754
+ * Listens for when a drag movement has started on a mousedown.
755
+ * <p>Drag events are covered in more detail in [jQuery.Drag].</p>
756
+ * @codestart
757
+ * $(".handles").live("dragdown", function(ev, drag){})
758
+ * @codeend
759
+ */
760
+ 'dragdown',
761
+ /**
762
+ * @attribute draginit
763
+ * Called when the drag starts.
764
+ * <p>Drag events are covered in more detail in [jQuery.Drag].</p>
765
+ */
766
+ 'draginit',
767
+ /**
768
+ * @attribute dragover
769
+ * Called when the drag is over a drop.
770
+ * <p>Drag events are covered in more detail in [jQuery.Drag].</p>
771
+ */
772
+ 'dragover',
773
+ /**
774
+ * @attribute dragmove
775
+ * Called when the drag is moved.
776
+ * <p>Drag events are covered in more detail in [jQuery.Drag].</p>
777
+ */
778
+ 'dragmove',
779
+ /**
780
+ * @attribute dragout
781
+ * When the drag leaves a drop point.
782
+ * <p>Drag events are covered in more detail in [jQuery.Drag].</p>
783
+ */
784
+ 'dragout',
785
+ /**
786
+ * @attribute dragend
787
+ * Called when the drag is done.
788
+ * <p>Drag events are covered in more detail in [jQuery.Drag].</p>
789
+ */
790
+ 'dragend'
791
+ ], "mousedown", function(e){
792
+ $.Drag.mousedown.call($.Drag, e, this)
793
+
794
+ } )
795
+
796
+
797
+
798
+
799
+
800
+ })(jQuery);
801
+