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,20 @@
1
+ <html>
2
+ <head>
3
+ <link rel="stylesheet" type="text/css" href="../../../funcunit/qunit/qunit.css" />
4
+ <title>QUnit Test</title>
5
+ <script type='text/javascript'>
6
+ steal = {ignoreControllers: true}
7
+ </script>
8
+ <script type='text/javascript' src='../../../steal/steal.js?funcunit/synthetic/drag/test/qunit'></script>
9
+ </head>
10
+ <body>
11
+
12
+ <h1 id="qunit-header">drag Test Suite</h1>
13
+ <h2 id="qunit-banner"></h2>
14
+ <div id="qunit-testrunner-toolbar"></div>
15
+ <h2 id="qunit-userAgent"></h2>
16
+ <div id="test-content"></div>
17
+ <ol id="qunit-tests"></ol>
18
+ <div id="qunit-test-area"></div>
19
+ </body>
20
+ </html>
@@ -0,0 +1,195 @@
1
+ module("funcunit/synthetic/drag");
2
+
3
+
4
+ test("dragging off the page", function(){
5
+ var drags = ( {}),
6
+ drops = ({});
7
+
8
+
9
+
10
+ var div = $("<div>"+
11
+ "<div id='drag'></div>"+
12
+ "<div id='drop'></div>"+
13
+ "</div>");
14
+
15
+ div.appendTo($("#qunit-test-area"));
16
+ var basicCss = {
17
+ width: "20px",
18
+ height: "20px",
19
+ border: "solid 1px black"
20
+ }
21
+ $("#drag").css(basicCss).css({top: "300px", left: "0px", backgroundColor: "green", zIndex: 99})
22
+ $("#drop").css(basicCss).css({top: "300px", marginTop: "1000px", left: "30px", backgroundColor: "yellow"});
23
+
24
+
25
+ $('#drag')
26
+ .live("draginit", function(){})
27
+
28
+ $('#drop')
29
+ .live("dropinit", function(){ })
30
+ .live("dropover", function(){
31
+ drops.dropover = true;
32
+ })
33
+
34
+ stop();
35
+
36
+ Syn.drag( {to: "#drop", duration: 700}, $("#drag")[0], function(){
37
+ ok(drops.dropover,"dropover fired correctly")
38
+ $("#qunit-test-area").innerHTML = "";
39
+ start();
40
+ })
41
+ })
42
+
43
+ test("move", function(){
44
+
45
+ var drags = {}, drops ={};
46
+ var div = $("<div id='wrap'>"+
47
+ "<div id='left'></div>"+
48
+ "<div id='right'></div>"+
49
+ "</div>");
50
+
51
+ div.appendTo($("#qunit-test-area"));
52
+ var basicCss = {
53
+ width: "90px",
54
+ height: "100px",
55
+ position: "absolute",
56
+ border: "solid 1px black"
57
+ }
58
+ $('#wrap').css({position: "absolute",top: "0px",left: "0px", width: "200px", height: "100px",backgroundColor: "yellow"})
59
+ $("#left").css(basicCss).css({top: "0px", left: "10px", backgroundColor: "green"})
60
+ $("#right").css(basicCss).css({top: "0px", left: "100px", backgroundColor: "blue"})
61
+
62
+ var clientX=-1,
63
+ clientY=-1,
64
+ els = [$('#wrap')[0], $('#left')[0], $('#right')[0], $('#wrap')[0] ],
65
+ targets = [];
66
+
67
+ var move = function(ev){
68
+ if(ev.clientX < clientX){
69
+ ok(false, "mouse isn't moving right")
70
+ }
71
+ clientX = ev.clientX;
72
+ if(ev.clientY < clientY){
73
+ ok(false, "mouse isn't moving right")
74
+ }
75
+ clientY = ev.clientY;
76
+ if(!targets.length || targets[targets.length - 1] !== ev.target){
77
+ targets.push(ev.target)
78
+ }
79
+ }
80
+ $(document.documentElement).bind('mousemove',move )
81
+
82
+ stop();
83
+ Syn.move({
84
+ from : {clientX: 2, clientY: 50},
85
+ to : {clientX: 199, clientY: 50},
86
+ duration: 1000
87
+ }, "wrap", function(){
88
+
89
+ equals(clientX, 199)
90
+ equals(clientY, 50)
91
+ $(document.documentElement).unbind('mousemove',move )
92
+ for(var i=0; i < els.length;i++){
93
+ ok(els[i] == targets[i], "target is right")
94
+ }
95
+
96
+ $("#qunit-test-area").html("")
97
+ start();
98
+ })
99
+
100
+ })
101
+
102
+ test("dragging an element with duration", function(){
103
+ var drags = ( {}),
104
+ drops = ({});
105
+
106
+
107
+
108
+ var div = $("<div>"+
109
+ "<div id='drag'></div>"+
110
+ "<div id='midpoint'></div>"+
111
+ "<div id='drop'></div>"+
112
+ "</div>");
113
+
114
+ div.appendTo($("#qunit-test-area"));
115
+ var basicCss = {
116
+ width: "20px",
117
+ height: "20px",
118
+ border: "solid 1px black",
119
+ position: "absolute"
120
+ }
121
+ $("#drag").css(basicCss).css({top: "300px", left: "0px", backgroundColor: "green", zIndex: 99})
122
+ $("#midpoint").css(basicCss).css({top: "300px", left: "30px", backgroundColor: "blue"})
123
+ $("#drop").css(basicCss).css({top: "330px", left: "30px", backgroundColor: "yellow"});
124
+
125
+
126
+ $('#drag')
127
+ .live("dragdown", function(){
128
+ drags.dragdown = true;
129
+ })
130
+ .live("draginit", function(){
131
+ drags.draginit = true;
132
+ })
133
+ .live("dragmove", function(){
134
+ drags.dragmove = true;
135
+ })
136
+ .live("dragend", function(){
137
+ drags.dragend = true;
138
+ })
139
+ .live("dragover", function(){
140
+ drags.dragover = true;
141
+ })
142
+ .live("dragout", function(){
143
+ drags.dragout = true;
144
+ });
145
+
146
+ $('#drop')
147
+ .live("dropinit", function(){
148
+ drops.dropinit = true;
149
+ })
150
+ .live("dropover", function(){
151
+ drops.dropover = true;
152
+ })
153
+ .live("dropout", function(){
154
+ drops.dropout = true;
155
+ })
156
+ .live("dropmove", function(){
157
+ drops.dropmove = true;
158
+ })
159
+ .live("dropon", function(){
160
+ drops.dropon = true;
161
+ })
162
+ .live("dropend", function(){
163
+ drops.dropend = true;
164
+ })
165
+
166
+
167
+
168
+ stop();
169
+
170
+ Syn.drag( {to: "#midpoint", duration: 700}, $("#drag")[0], function(){
171
+
172
+ ok(drags.draginit, "draginit fired correctly")
173
+ ok(drags.dragmove, "dragmove fired correctly")
174
+ ok(!drags.dragover,"dragover not fired yet")
175
+
176
+ ok(!drops.dropover,"dropover fired correctly")
177
+ ok(!drops.dropon, "dropon not fired yet")
178
+ ok(drops.dropend, "dropend fired");
179
+
180
+ Syn.drag( {to: "#drop", duration: 700}, $("#drag")[0], function(){
181
+ ok(drops.dropinit, "dropinit fired correctly")
182
+ ok(drops.dropover, "dropover fired correctly")
183
+ ok(drops.dropmove, "dropmove fired correctly")
184
+ ok(drops.dropon, "dropon fired correctly")
185
+
186
+ Syn.drag( {to: "#midpoint", duration: 700}, $("#drag")[0], function(){
187
+ ok(drags.dragout, "dragout fired correctly")
188
+ ok(drops.dropout, "dropout fired correctly")
189
+ $("#qunit-test-area").innerHTML = "";
190
+ start();
191
+ })
192
+
193
+ });
194
+ })
195
+ })
@@ -0,0 +1,7 @@
1
+ steal
2
+ .plugins("funcunit/qunit",
3
+ "funcunit/synthetic",
4
+ "funcunit/synthetic/drag"
5
+ )
6
+ .plugins("jquery", "jquery/event/drag", "jquery/event/drop")
7
+ .then("drag_test")
@@ -0,0 +1,832 @@
1
+ steal.then(function(){
2
+
3
+ var h = Syn.helpers,
4
+ S = Syn,
5
+
6
+ // gets the selection of an input or textarea
7
+ getSelection = function(el){
8
+ // use selectionStart if we can
9
+ if (el.selectionStart !== undefined) {
10
+ // this is for opera, so we don't have to focus to type how we think we would
11
+ if(document.activeElement
12
+ && document.activeElement != el
13
+ && el.selectionStart == el.selectionEnd
14
+ && el.selectionStart == 0){
15
+ return {start: el.value.length, end: el.value.length};
16
+ }
17
+ return {start: el.selectionStart, end: el.selectionEnd}
18
+ }else{
19
+ //check if we aren't focused
20
+ //if(document.activeElement && document.activeElement != el){
21
+
22
+
23
+ //}
24
+ try {
25
+ //try 2 different methods that work differently (IE breaks depending on type)
26
+ if (el.nodeName.toLowerCase() == 'input') {
27
+ var real = h.getWindow(el).document.selection.createRange(), r = el.createTextRange();
28
+ r.setEndPoint("EndToStart", real);
29
+
30
+ var start = r.text.length
31
+ return {
32
+ start: start,
33
+ end: start + real.text.length
34
+ }
35
+ }
36
+ else {
37
+ var real = h.getWindow(el).document.selection.createRange(), r = real.duplicate(), r2 = real.duplicate(), r3 = real.duplicate();
38
+ r2.collapse();
39
+ r3.collapse(false);
40
+ r2.moveStart('character', -1)
41
+ r3.moveStart('character', -1)
42
+ //select all of our element
43
+ r.moveToElementText(el)
44
+ //now move our endpoint to the end of our real range
45
+ r.setEndPoint('EndToEnd', real);
46
+ var start = r.text.length - real.text.length, end = r.text.length;
47
+ if (start != 0 && r2.text == "") {
48
+ start += 2;
49
+ }
50
+ if (end != 0 && r3.text == "") {
51
+ end += 2;
52
+ }
53
+ //if we aren't at the start, but previous is empty, we are at start of newline
54
+ return {
55
+ start: start,
56
+ end: end
57
+ }
58
+ }
59
+ }catch(e){
60
+ return {start: el.value.length, end: el.value.length};
61
+ }
62
+ }
63
+ },
64
+ // gets all focusable elements
65
+ getFocusable = function(el){
66
+ var document = h.getWindow(el).document,
67
+ res = [];
68
+
69
+ var els = document.getElementsByTagName('*'),
70
+ len = els.length;
71
+
72
+ for(var i=0; i< len; i++){
73
+ Syn.isFocusable(els[i]) && els[i] != document.documentElement && res.push(els[i])
74
+ }
75
+ return res;
76
+
77
+
78
+ };
79
+
80
+ /**
81
+ * @add Syn static
82
+ */
83
+ h.extend(Syn,{
84
+ /**
85
+ * @attribute
86
+ * A list of the keys and their keycodes codes you can type.
87
+ * You can add type keys with
88
+ * @codestart
89
+ * Syn('key','delete','title');
90
+ *
91
+ * //or
92
+ *
93
+ * Syn('type','One Two Three[left][left][delete]','title')
94
+ * @codeend
95
+ *
96
+ * The following are a list of keys you can type:
97
+ * @codestart text
98
+ * \b - backspace
99
+ * \t - tab
100
+ * \r - enter
101
+ * ' ' - space
102
+ * a-Z 0-9 - normal characters
103
+ * /!@#$*,.? - All other typeable characters
104
+ * page-up - scrolls up
105
+ * page-down - scrolls down
106
+ * end - scrolls to bottom
107
+ * home - scrolls to top
108
+ * insert - changes how keys are entered
109
+ * delete - deletes the next character
110
+ * left - moves cursor left
111
+ * right - moves cursor right
112
+ * up - moves the cursor up
113
+ * down - moves the cursor down
114
+ * f1-12 - function buttons
115
+ * shift, ctrl, alt - special keys
116
+ * pause-break - the pause button
117
+ * scroll-lock - locks scrolling
118
+ * caps - makes caps
119
+ * escape - escape button
120
+ * num-lock - allows numbers on keypad
121
+ * print - screen capture
122
+ * @codeend
123
+ */
124
+ keycodes: {
125
+ //backspace
126
+ '\b':'8',
127
+
128
+ //tab
129
+ '\t':'9',
130
+
131
+ //enter
132
+ '\r':'13',
133
+
134
+ //special
135
+ 'shift':'16','ctrl':'17','alt':'18',
136
+
137
+ //weird
138
+ 'pause-break':'19',
139
+ 'caps':'20',
140
+ 'escape':'27',
141
+ 'num-lock':'144',
142
+ 'scroll-lock':'145',
143
+ 'print' : '44',
144
+
145
+ //navigation
146
+ 'page-up':'33','page-down':'34','end':'35','home':'36',
147
+ 'left':'37','up':'38','right':'39','down':'40','insert':'45','delete':'46',
148
+
149
+ //normal characters
150
+ ' ':'32',
151
+ '0':'48','1':'49','2':'50','3':'51','4':'52','5':'53','6':'54','7':'55','8':'56','9':'57',
152
+ 'a':'65','b':'66','c':'67','d':'68','e':'69','f':'70','g':'71','h':'72','i':'73','j':'74','k':'75','l':'76','m':'77',
153
+ 'n':'78','o':'79','p':'80','q':'81','r':'82','s':'83','t':'84','u':'85','v':'86','w':'87','x':'88','y':'89','z':'90',
154
+ //normal-characters, numpad
155
+ 'num0':'96','num1':'97','num2':'98','num3':'99','num4':'100','num5':'101','num6':'102','num7':'103','num8':'104','num9':'105',
156
+ '*':'106','+':'107','-':'109','.':'110',
157
+ //normal-characters, others
158
+ '/':'111',
159
+ ';':'186',
160
+ '=':'187',
161
+ ',':'188',
162
+ '-':'189',
163
+ '.':'190',
164
+ '/':'191',
165
+ '`':'192',
166
+ '[':'219',
167
+ '\\':'220',
168
+ ']':'221',
169
+ "'":'222',
170
+
171
+ //ignore these, you shouldn't use them
172
+ 'left window key':'91','right window key':'92','select key':'93',
173
+
174
+
175
+ 'f1':'112','f2':'113','f3':'114','f4':'115','f5':'116','f6':'117',
176
+ 'f7':'118','f8':'119','f9':'120','f10':'121','f11':'122','f12':'123'
177
+ },
178
+
179
+ // what we can type in
180
+ typeable : /input|textarea/i,
181
+
182
+ // selects text on an element
183
+ selectText: function( el, start, end ) {
184
+ if(el.setSelectionRange){
185
+ if(!end){
186
+ el.focus();
187
+ el.setSelectionRange(start, start);
188
+ } else {
189
+ el.selectionStart = start;
190
+ el.selectionEnd = end;
191
+ }
192
+ }else if (el.createTextRange) {
193
+ //el.focus();
194
+ var r = el.createTextRange();
195
+ r.moveStart('character', start);
196
+ end = end || start;
197
+ r.moveEnd('character', end - el.value.length);
198
+
199
+ r.select();
200
+ }
201
+ },
202
+ getText: function( el ) {
203
+ //first check if the el has anything selected ..
204
+ if(Syn.typeable.test(el.nodeName)){
205
+ var sel = getSelection(el);
206
+ return el.value.substring(sel.start, sel.end)
207
+ }
208
+ //otherwise get from page
209
+ var win = Syn.helpers.getWindow(el);
210
+ if (win.getSelection) {
211
+ return win.getSelection().toString();
212
+ }
213
+ else if (win.document.getSelection) {
214
+ return win.document.getSelection().toString()
215
+ }
216
+ else {
217
+ return win.document.selection.createRange().text;
218
+ }
219
+ },
220
+ getSelection : getSelection
221
+ });
222
+
223
+ h.extend(Syn.key,{
224
+ // retrieves a description of what events for this character should look like
225
+ data: function( key ) {
226
+ //check if it is described directly
227
+ if(S.key.browser[key]){
228
+ return S.key.browser[key];
229
+ }
230
+ for(var kind in S.key.kinds){
231
+ if(h.inArray(key, S.key.kinds[kind] ) > -1){
232
+ return S.key.browser[kind]
233
+ }
234
+ }
235
+ return S.key.browser.character
236
+ },
237
+
238
+ //returns the special key if special
239
+ isSpecial: function( keyCode ) {
240
+ var specials = S.key.kinds.special;
241
+ for(var i=0; i < specials.length; i++){
242
+ if(Syn.keycodes[ specials[i] ] == keyCode){
243
+ return specials[i];
244
+ }
245
+ }
246
+ },
247
+ /**
248
+ * @hide
249
+ * gets the options for a key and event type ...
250
+ * @param {Object} key
251
+ * @param {Object} event
252
+ */
253
+ options: function( key, event ) {
254
+ var keyData = Syn.key.data(key);
255
+
256
+ if(!keyData[event]){
257
+ //we shouldn't be creating this event
258
+ return null;
259
+ }
260
+
261
+ var charCode = keyData[event][0],
262
+ keyCode = keyData[event][1],
263
+ result = {};
264
+
265
+ if(keyCode == 'key'){
266
+ result.keyCode = Syn.keycodes[key]
267
+ } else if (keyCode == 'char'){
268
+ result.keyCode = key.charCodeAt(0)
269
+ }else{
270
+ result.keyCode = keyCode;
271
+ }
272
+
273
+ if(charCode == 'char'){
274
+ result.charCode = key.charCodeAt(0)
275
+ }else if(charCode !== null){
276
+ result.charCode = charCode;
277
+ }
278
+
279
+
280
+ return result
281
+ },
282
+ //types of event keys
283
+ kinds : {
284
+ special : ["shift",'ctrl','alt','caps'],
285
+ specialChars : ["\b"],
286
+ navigation: ["page-up",'page-down','end','home','left','up','right','down','insert','delete'],
287
+ 'function' : ['f1','f2','f3','f4','f5','f6','f7','f8','f9','f10','f11','f12']
288
+ },
289
+ //returns the default function
290
+ getDefault: function( key ) {
291
+ //check if it is described directly
292
+ if(Syn.key.defaults[key]){
293
+ return Syn.key.defaults[key];
294
+ }
295
+ for(var kind in Syn.key.kinds){
296
+ if(h.inArray(key, Syn.key.kinds[kind])> -1 && Syn.key.defaults[kind] ){
297
+ return Syn.key.defaults[kind];
298
+ }
299
+ }
300
+ return Syn.key.defaults.character
301
+ },
302
+ // default behavior when typing
303
+ defaults : {
304
+ 'character' : function( options, scope, key, force, sel ) {
305
+ if(/num\d+/.test(key)){
306
+ key = key.match(/\d+/)[0]
307
+ }
308
+
309
+ if(force || (!S.support.keyCharacters && Syn.typeable.test(this.nodeName))){
310
+ var current = this.value,
311
+ before = current.substr(0,sel.start),
312
+ after = current.substr(sel.end),
313
+ character = key;
314
+
315
+ this.value = before+character+after;
316
+ //handle IE inserting \r\n
317
+ var charLength = character == "\n" && S.support.textareaCarriage ? 2 : character.length;
318
+ Syn.selectText(this, before.length + charLength)
319
+ }
320
+ },
321
+ 'c' : function( options, scope, key, force, sel ) {
322
+ if(Syn.key.ctrlKey){
323
+ Syn.key.clipboard = Syn.getText(this)
324
+ }else{
325
+ Syn.key.defaults.character.apply(this, arguments);
326
+ }
327
+ },
328
+ 'v' : function( options, scope, key, force, sel ) {
329
+ if(Syn.key.ctrlKey){
330
+ Syn.key.defaults.character.call(this, options,scope, Syn.key.clipboard, true,sel);
331
+ }else{
332
+ Syn.key.defaults.character.apply(this, arguments);
333
+ }
334
+ },
335
+ 'a' : function( options, scope, key, force, sel ) {
336
+ if(Syn.key.ctrlKey){
337
+ Syn.selectText(this, 0, this.value.length)
338
+ }else{
339
+ Syn.key.defaults.character.apply(this, arguments);
340
+ }
341
+ },
342
+ 'home' : function() {
343
+ Syn.onParents(this, function(el){
344
+ if(el.scrollHeight != el.clientHeight){
345
+ el.scrollTop = 0;
346
+ return false;
347
+ }
348
+ })
349
+ },
350
+ 'end' : function() {
351
+ Syn.onParents(this, function(el){
352
+ if(el.scrollHeight != el.clientHeight){
353
+ el.scrollTop = el.scrollHeight;
354
+ return false;
355
+ }
356
+ })
357
+ },
358
+ 'page-down' : function() {
359
+ //find the first parent we can scroll
360
+ Syn.onParents(this, function(el){
361
+ if(el.scrollHeight != el.clientHeight){
362
+ var ch = el.clientHeight
363
+ el.scrollTop += ch;
364
+ return false;
365
+ }
366
+ })
367
+ },
368
+ 'page-up' : function() {
369
+ Syn.onParents(this, function(el){
370
+ if(el.scrollHeight != el.clientHeight){
371
+ var ch = el.clientHeight
372
+ el.scrollTop -= ch;
373
+ return false;
374
+ }
375
+ })
376
+ },
377
+ '\b' : function( options, scope, key, force, sel ) {
378
+ //this assumes we are deleting from the end
379
+ if(!S.support.backspaceWorks && Syn.typeable.test(this.nodeName)){
380
+ var current = this.value,
381
+ before = current.substr(0,sel.start),
382
+ after = current.substr(sel.end);
383
+
384
+ if(sel.start == sel.end && sel.start > 0){
385
+ //remove a character
386
+ this.value = before.substring(0, before.length - 1)+after
387
+ Syn.selectText(this, sel.start-1)
388
+ }else{
389
+ this.value = before+after;
390
+ Syn.selectText(this, sel.start)
391
+ }
392
+
393
+ //set back the selection
394
+ }
395
+ },
396
+ 'delete' : function( options, scope, key, force, sel ) {
397
+ if(!S.support.backspaceWorks && Syn.typeable.test(this.nodeName)){
398
+ var current = this.value,
399
+ before = current.substr(0,sel.start),
400
+ after = current.substr(sel.end);
401
+ if(sel.start == sel.end && sel.start <= this.value.length - 1){
402
+ this.value = before+after.substring(1)
403
+ }else{
404
+ this.value = before+after;
405
+
406
+ }
407
+ Syn.selectText(this, sel.start)
408
+ }
409
+ },
410
+ '\r' : function( options, scope, key, force, sel ) {
411
+
412
+ var nodeName = this.nodeName.toLowerCase()
413
+ // submit a form
414
+ if(!S.support.keypressSubmits && nodeName == 'input'){
415
+ var form = Syn.closest(this, "form");
416
+ if(form){
417
+ Syn.trigger("submit", {}, form);
418
+ }
419
+
420
+ }
421
+ //newline in textarea
422
+ if(!S.support.keyCharacters && nodeName == 'textarea'){
423
+ Syn.key.defaults.character.call(this, options, scope, "\n", undefined, sel)
424
+ }
425
+ // 'click' hyperlinks
426
+ if(!S.support.keypressOnAnchorClicks && nodeName == 'a'){
427
+ Syn.trigger("click", {}, this);
428
+ }
429
+ },
430
+ //
431
+ // Gets all focusable elements. If the element (this)
432
+ // doesn't have a tabindex, finds the next element after.
433
+ // If the element (this) has a tabindex finds the element
434
+ // with the next higher tabindex OR the element with the same
435
+ // tabindex after it in the document.
436
+ // @return the next element
437
+ //
438
+ '\t' : function( options, scope ) {
439
+ // focusable elements
440
+ var focusEls = getFocusable(this),
441
+ // the current element's tabindex
442
+ tabIndex = Syn.tabIndex(this),
443
+ // will be set to our guess for the next element
444
+ current = null,
445
+ // the next index we care about
446
+ currentIndex = 1000000000,
447
+ // set to true once we found 'this' element
448
+ found = false,
449
+ i = 0,
450
+ el,
451
+ //the tabindex of the tabable element we are looking at
452
+ elIndex,
453
+ firstNotIndexed,
454
+ prev;
455
+ orders = [];
456
+ for(; i< focusEls.length; i++){
457
+ orders.push([focusEls[i], i]);
458
+ }
459
+ var sort = function(order1, order2){
460
+ var el1 = order1[0],
461
+ el2 = order2[0],
462
+ tab1 = Syn.tabIndex(el1) || 0,
463
+ tab2 = Syn.tabIndex(el2) || 0;
464
+ if(tab1 == tab2){
465
+ return order1[1] - order2[1]
466
+ }else{
467
+ if(tab1 == 0){
468
+ return 1;
469
+ }else if(tab2 == 0){
470
+ return -1;
471
+ }else{
472
+ return tab1-tab2;
473
+ }
474
+ }
475
+ }
476
+ orders.sort(sort);
477
+ //now find current
478
+ for(i=0; i< orders.length; i++){
479
+ el = orders[i][0];
480
+ if(this== el ){
481
+ if(!Syn.key.shiftKey){
482
+ current = orders[i+1][0];
483
+ if(!current){
484
+ current = orders[0][0]
485
+ }
486
+ }else{
487
+ current = orders[i-1][0];
488
+ if(!current){
489
+ current = orders[focusEls.length-1][0]
490
+ }
491
+ }
492
+
493
+ }
494
+ }
495
+
496
+ //restart if we didn't find anything
497
+ if(!current){
498
+ current = firstNotIndexed;
499
+ }
500
+ current && current.focus();
501
+ return current;
502
+ },
503
+ 'left' : function( options, scope, key, force, sel ) {
504
+ if( Syn.typeable.test(this.nodeName) ){
505
+ if(Syn.key.shiftKey){
506
+ Syn.selectText(this, sel.start == 0 ? 0 : sel.start - 1, sel.end)
507
+ }else{
508
+ Syn.selectText(this, sel.start == 0 ? 0 : sel.start - 1)
509
+ }
510
+ }
511
+ },
512
+ 'right' : function( options, scope, key, force, sel ) {
513
+ if( Syn.typeable.test(this.nodeName) ){
514
+ if(Syn.key.shiftKey){
515
+ Syn.selectText(this, sel.start, sel.end+1 > this.value.length ? this.value.length : sel.end+1)
516
+ }else{
517
+ Syn.selectText(this, sel.end+1 > this.value.length ? this.value.length : sel.end+1)
518
+ }
519
+ }
520
+ },
521
+ 'up' : function() {
522
+ if(/select/i.test(this.nodeName)){
523
+
524
+ this.selectedIndex = this.selectedIndex ? this.selectedIndex-1 : 0;
525
+ //set this to change on blur?
526
+ }
527
+ },
528
+ 'down' : function() {
529
+ if(/select/i.test(this.nodeName)){
530
+ Syn.changeOnBlur(this, "selectedIndex", this.selectedIndex)
531
+ this.selectedIndex = this.selectedIndex+1;
532
+ //set this to change on blur?
533
+ }
534
+ },
535
+ 'shift' : function() {
536
+ return null;
537
+ }
538
+ }
539
+ });
540
+
541
+
542
+ h.extend(Syn.create,{
543
+ keydown : {
544
+ setup: function( type, options, element ) {
545
+ if(h.inArray(options,Syn.key.kinds.special ) != -1){
546
+ Syn.key[options+"Key"] = element;
547
+ }
548
+ }
549
+ },
550
+ keyup : {
551
+ setup: function( type, options, element ) {
552
+ if(h.inArray(options,Syn.key.kinds.special )!= -1){
553
+ Syn.key[options+"Key"] = null;
554
+ }
555
+ }
556
+ },
557
+ key : {
558
+ // return the options for a key event
559
+ options: function( type, options, element ) {
560
+ //check if options is character or has character
561
+ options = typeof options != "object" ? {character : options} : options;
562
+
563
+ //don't change the orignial
564
+ options = h.extend({}, options)
565
+ if(options.character){
566
+ h.extend(options, S.key.options(options.character, type));
567
+ delete options.character;
568
+ }
569
+
570
+ options = h.extend({
571
+ ctrlKey: !!Syn.key.ctrlKey,
572
+ altKey: !!Syn.key.altKey,
573
+ shiftKey: !!Syn.key.shiftKey,
574
+ metaKey: !!Syn.key.metaKey
575
+ }, options)
576
+
577
+ return options;
578
+ },
579
+ // creates a key event
580
+ event : document.createEvent ?
581
+ function(type, options, element){ //Everyone Else
582
+ var event;
583
+
584
+ try {
585
+
586
+ event = element.ownerDocument.createEvent("KeyEvents");
587
+ event.initKeyEvent(type, true, true, window,
588
+ options.ctrlKey, options.altKey, options.shiftKey, options.metaKey,
589
+ options.keyCode, options.charCode );
590
+ } catch(e) {
591
+ event = h.createBasicStandardEvent(type,options)
592
+ }
593
+ event.synthetic = true;
594
+ return event;
595
+
596
+ } :
597
+ function(type, options, element){
598
+ var event = h.createEventObject.apply(this,arguments);
599
+ h.extend(event, options)
600
+
601
+ return event;
602
+ }
603
+ }
604
+ });
605
+
606
+ var convert = {
607
+ "enter" : "\r",
608
+ "backspace" : "\b",
609
+ "tab" : "\t",
610
+ "space" : " "
611
+ }
612
+
613
+ /**
614
+ * @add Syn prototype
615
+ */
616
+ h.extend(Syn.init.prototype,
617
+ {
618
+ /**
619
+ * @function key
620
+ * Types a single key. The key should be
621
+ * a string that matches a
622
+ * [Syn.static.keycodes].
623
+ *
624
+ * The following sends a carridge return
625
+ * to the 'name' element.
626
+ * @codestart
627
+ * Syn.key('\r','name')
628
+ * @codeend
629
+ * For each character, a keydown, keypress, and keyup is triggered if
630
+ * appropriate.
631
+ * @param {String} options
632
+ * @param {HTMLElement} [element]
633
+ * @param {Function} [callback]
634
+ * @return {HTMLElement} the element currently focused.
635
+ */
636
+ _key: function( options, element, callback ) {
637
+ //first check if it is a special up
638
+ if(/-up$/.test(options)
639
+ && h.inArray(options.replace("-up",""),Syn.key.kinds.special )!= -1){
640
+ Syn.trigger('keyup',options.replace("-up",""), element )
641
+ callback(true, element);
642
+ return;
643
+ }
644
+
645
+
646
+ var caret = Syn.typeable.test(element.nodeName) && getSelection(element),
647
+ key = convert[options] || options,
648
+ // should we run default events
649
+ runDefaults = Syn.trigger('keydown',key, element ),
650
+
651
+ // a function that gets the default behavior for a key
652
+ getDefault = Syn.key.getDefault,
653
+
654
+ // how this browser handles preventing default events
655
+ prevent = Syn.key.browser.prevent,
656
+
657
+ // the result of the default event
658
+ defaultResult,
659
+
660
+ // options for keypress
661
+ keypressOptions = Syn.key.options(key, 'keypress')
662
+
663
+
664
+ if(runDefaults){
665
+ //if the browser doesn't create keypresses for this key, run default
666
+ if(!keypressOptions){
667
+ defaultResult = getDefault(key).call(element, keypressOptions, h.getWindow(element), key, undefined, caret)
668
+ }else{
669
+ //do keypress
670
+ runDefaults = Syn.trigger('keypress',keypressOptions, element )
671
+ if(runDefaults){
672
+ defaultResult = getDefault(key).call(element, keypressOptions, h.getWindow(element), key, undefined, caret)
673
+ }
674
+ }
675
+ }else{
676
+ //canceled ... possibly don't run keypress
677
+ if(keypressOptions && h.inArray('keypress',prevent.keydown) == -1 ){
678
+ Syn.trigger('keypress',keypressOptions, element )
679
+ }
680
+ }
681
+ if(defaultResult && defaultResult.nodeName){
682
+ element = defaultResult
683
+ }
684
+
685
+ if(defaultResult !== null){
686
+ setTimeout(function(){
687
+ Syn.trigger('keyup',Syn.key.options(key, 'keyup'), element )
688
+ callback(runDefaults, element)
689
+ },1)
690
+ }else{
691
+ callback(runDefaults, element)
692
+ }
693
+
694
+
695
+ //do mouseup
696
+
697
+ return element;
698
+ // is there a keypress? .. if not , run default
699
+ // yes -> did we prevent it?, if not run ...
700
+
701
+ },
702
+ /**
703
+ * @function type
704
+ * Types sequence of [Syn.prototype.key key actions]. Each
705
+ * character is typed, one at a type.
706
+ * Multi-character keys like 'left' should be
707
+ * enclosed in square brackents.
708
+ *
709
+ * The following types 'JavaScript MVC' then deletes the space.
710
+ * @codestart
711
+ * Syn.type('JavaScript MVC[left][left][left]\b','name')
712
+ * @codeend
713
+ *
714
+ * Type is able to handle (and move with) tabs (\t).
715
+ * The following simulates tabing and entering values in a form and
716
+ * eventually submitting the form.
717
+ * @codestart
718
+ * Syn.type("Justin\tMeyer\t27\tjustinbmeyer@gmail.com\r")
719
+ * @codeend
720
+ * @param {String} options the text to type
721
+ * @param {HTMLElement} [element] an element or an id of an element
722
+ * @param {Function} [callback] a function to callback
723
+ */
724
+ _type: function( options, element, callback ) {
725
+ //break it up into parts ...
726
+ //go through each type and run
727
+ var parts = options.match(/(\[[^\]]+\])|([^\[])/g),
728
+ self = this,
729
+ runNextPart = function(runDefaults, el){
730
+ var part = parts.shift();
731
+ if(!part){
732
+ callback(runDefaults, el);
733
+ return;
734
+ }
735
+ el = el || element;
736
+ if(part.length > 1){
737
+ part = part.substr(1,part.length - 2)
738
+ }
739
+ self._key(part, el, runNextPart)
740
+ }
741
+
742
+ runNextPart();
743
+
744
+ }
745
+ });
746
+
747
+
748
+ //do support code
749
+ (function(){
750
+ if(!document.body){
751
+ setTimeout(arguments.callee,1)
752
+ return;
753
+ }
754
+
755
+ var div = document.createElement("div"),
756
+ checkbox,
757
+ submit,
758
+ form,
759
+ input,
760
+ submitted = false,
761
+ anchor,
762
+ textarea;
763
+
764
+ div.innerHTML = "<form id='outer'>"+
765
+ "<input name='checkbox' type='checkbox'/>"+
766
+ "<input name='radio' type='radio' />"+
767
+ "<input type='submit' name='submitter'/>"+
768
+ "<input type='input' name='inputter'/>"+
769
+ "<input name='one'>"+
770
+ "<input name='two'/>"+
771
+ "<a href='#abc'></a>"+
772
+ "<textarea>1\n2</textarea>"
773
+ "</form>";
774
+
775
+ document.documentElement.appendChild(div);
776
+ form = div.firstChild;
777
+ checkbox = form.childNodes[0];
778
+ submit = form.childNodes[2];
779
+ anchor = form.getElementsByTagName("a")[0];
780
+ textarea = form.getElementsByTagName("textarea")[0]
781
+ form.onsubmit = function(ev){
782
+ if (ev.preventDefault)
783
+ ev.preventDefault();
784
+ S.support.keypressSubmits = true;
785
+ ev.returnValue = false;
786
+ return false;
787
+ }
788
+ Syn.trigger("keypress", "\r", form.childNodes[3]);
789
+
790
+
791
+ Syn.trigger("keypress", "a", form.childNodes[3]);
792
+ S.support.keyCharacters = form.childNodes[3].value == "a";
793
+
794
+
795
+ form.childNodes[3].value = "a"
796
+ Syn.trigger("keypress", "\b", form.childNodes[3]);
797
+ S.support.backspaceWorks = form.childNodes[3].value == "";
798
+
799
+
800
+
801
+ form.childNodes[3].onchange = function(){
802
+ S.support.focusChanges = true;
803
+ }
804
+ form.childNodes[3].focus();
805
+ Syn.trigger("keypress", "a", form.childNodes[3]);
806
+ form.childNodes[5].focus();
807
+
808
+ //test keypress \r on anchor submits
809
+ S.bind(anchor,"click",function(ev){
810
+ if (ev.preventDefault)
811
+ ev.preventDefault();
812
+ S.support.keypressOnAnchorClicks = true;
813
+ ev.returnValue = false;
814
+ return false;
815
+ })
816
+ Syn.trigger("keypress", "\r", anchor);
817
+
818
+ S.support.textareaCarriage = textarea.value.length == 4
819
+ document.documentElement.removeChild(div);
820
+
821
+ S.support.ready = true;
822
+ })();
823
+
824
+
825
+
826
+
827
+ })
828
+
829
+
830
+
831
+
832
+