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,68 @@
1
+ // script.aculo.us scriptaculous.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
2
+
3
+ // Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
4
+ //
5
+ // Permission is hereby granted, free of charge, to any person obtaining
6
+ // a copy of this software and associated documentation files (the
7
+ // "Software"), to deal in the Software without restriction, including
8
+ // without limitation the rights to use, copy, modify, merge, publish,
9
+ // distribute, sublicense, and/or sell copies of the Software, and to
10
+ // permit persons to whom the Software is furnished to do so, subject to
11
+ // the following conditions:
12
+ //
13
+ // The above copyright notice and this permission notice shall be
14
+ // included in all copies or substantial portions of the Software.
15
+ //
16
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+ //
24
+ // For details, see the script.aculo.us web site: http://script.aculo.us/
25
+
26
+ var Scriptaculous = {
27
+ Version: '1.8.3',
28
+ require: function(libraryName) {
29
+ try{
30
+ // inserting via DOM fails in Safari 2.0, so brute force approach
31
+ document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
32
+ } catch(e) {
33
+ // for xhtml+xml served content, fall back to DOM methods
34
+ var script = document.createElement('script');
35
+ script.type = 'text/javascript';
36
+ script.src = libraryName;
37
+ document.getElementsByTagName('head')[0].appendChild(script);
38
+ }
39
+ },
40
+ REQUIRED_PROTOTYPE: '1.6.0.3',
41
+ load: function() {
42
+ function convertVersionString(versionString) {
43
+ var v = versionString.replace(/_.*|\./g, '');
44
+ v = parseInt(v + '0'.times(4-v.length));
45
+ return versionString.indexOf('_') > -1 ? v-1 : v;
46
+ }
47
+
48
+ if((typeof Prototype=='undefined') ||
49
+ (typeof Element == 'undefined') ||
50
+ (typeof Element.Methods=='undefined') ||
51
+ (convertVersionString(Prototype.Version) <
52
+ convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
53
+ throw("script.aculo.us requires the Prototype JavaScript framework >= " +
54
+ Scriptaculous.REQUIRED_PROTOTYPE);
55
+
56
+ var js = /scriptaculous\.js(\?.*)?$/;
57
+ $$('head script[src]').findAll(function(s) {
58
+ return s.src.match(js);
59
+ }).each(function(s) {
60
+ var path = s.src.replace(js, ''),
61
+ includes = s.src.match(/\?.*load=([a-z,]*)/);
62
+ (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider,sound').split(',').each(
63
+ function(include) { Scriptaculous.require(path+include+'.js') });
64
+ });
65
+ }
66
+ };
67
+
68
+ Scriptaculous.load();
@@ -0,0 +1,5 @@
1
+ load('steal/rhino/steal.js')
2
+
3
+ steal('//steal/get/get', function(s){
4
+ s.get("http://github.com/jupiterjs/funcunit/","funcunit");
5
+ })
@@ -0,0 +1,24 @@
1
+ TOC:
2
+ A. How to get (and contribute) to JMVC
3
+
4
+
5
+ A. How to get (and contribute) JMVC
6
+
7
+ 1. Start a new project in git.
8
+
9
+ 2. Fork ....
10
+ http://github.com/jupiterjs/steal and
11
+ http://github.com/jupiterjs/javascriptmvc
12
+
13
+ 3. Add steal and javascriptmvc as submodules of your project...
14
+ git submodule add git@github.com:_YOU_/steal.git steal
15
+ git submodule add git@github.com:_YOU_/javascriptmvc.git jquery
16
+
17
+ * Notice javascriptmvc is under the jquery folder
18
+
19
+ 4. Learn a little more about submodules ...
20
+ http://johnleach.co.uk/words/archives/2008/10/12/323/git-submodules-in-n-easy-steps
21
+
22
+ 5. Make changes in steal or jmvc, and push them back to your fork.
23
+
24
+ 6. Make a pull request to your fork.
@@ -0,0 +1,73 @@
1
+ load('steal/file/file.js')
2
+
3
+ var i, fileName, cmd,
4
+ plugins = [
5
+ "class",
6
+ "controller",
7
+ {
8
+ plugin: "controller/subscribe",
9
+ exclude: ["jquery/controller/controller.js",
10
+ "jquery/class/class.js",
11
+ "jquery/lang/lang.js",
12
+ "jquery/event/destroyed/destroyed.js",
13
+ "jquery/controller/controller.js"]},
14
+ "event/default",
15
+ "event/destroyed",
16
+ "event/drag",
17
+ {
18
+ plugin: "event/drag/limit",
19
+ exclude: ["jquery/lang/vector/vector.js", "jquery/event/livehack/livehack.js", "jquery/event/drag/drag.js"]},
20
+ {
21
+ plugin: "event/drag/scroll",
22
+ exclude: ["jquery/dom/within/within.js", "jquery/dom/compare/compare.js", "jquery/event/drop/drop.js","jquery/lang/vector/vector.js", "jquery/event/livehack/livehack.js", "jquery/event/drag/drag.js"]},
23
+ {
24
+ plugin: "event/drop",
25
+ exclude: ["jquery/lang/vector/vector.js", "jquery/event/livehack/livehack.js", "jquery/event/drag/drag.js"]},
26
+ "event/hover",
27
+ {
28
+ plugin: "model",
29
+ exclude: ["jquery/class/class.js",
30
+ "jquery/lang/lang.js",
31
+ "jquery/event/destroyed/destroyed.js",
32
+ "jquery/lang/openajax/openajax.js"]},
33
+ "view/ejs",
34
+ "dom/closest",
35
+ "dom/compare",
36
+ {
37
+ plugin: "dom/dimensions",
38
+ fileName: "jquery.dimensions.etc.js"
39
+ },
40
+ "dom/fixture",
41
+ "dom/form_params",
42
+ "dom/within",
43
+ "dom/cur_styles"
44
+ ]
45
+
46
+
47
+ var plugin, exclude, fileDest, fileName;
48
+ for(i=0; i<plugins.length; i++){
49
+ plugin = plugins[i];
50
+ exclude = [];
51
+ fileName = null;
52
+ if (typeof plugin != "string") {
53
+ fileName = plugin.fileName;
54
+ exclude = plugin.exclude || [];
55
+ plugin = plugin.plugin;
56
+ }
57
+ fileName = fileName || "jquery."+plugin.replace(/\//g, ".").replace(/dom\./, "").replace(/\_/, "")+".js";
58
+ fileDest = "jquery/dist/"+fileName
59
+ cmd = "js steal/scripts/pluginify.js jquery/"+plugin+" -destination "+fileDest;
60
+ if(exclude.length)
61
+ cmd += " -exclude "+exclude;
62
+ runCommand( "cmd", "/C", cmd)
63
+
64
+ // compress
65
+ var outBaos = new java.io.ByteArrayOutputStream();
66
+ var output = new java.io.PrintStream(outBaos);
67
+ runCommand("java", "-jar", "steal/rhino/compiler.jar", "--compilation_level",
68
+ "SIMPLE_OPTIMIZATIONS", "--warning_level","QUIET", "--js", fileDest, {output: output});
69
+
70
+ var minFileDest = fileDest.replace(".js", ".min.js")
71
+ new steal.File(minFileDest).save(outBaos.toString());
72
+ print("***"+fileName+" pluginified and compressed")
73
+ }
@@ -0,0 +1,109 @@
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>jQuery.Class Demo</title>
6
+ <style type='text/css'>
7
+ body {font-family: verdana}
8
+ .tabs, .history_tabs {
9
+
10
+ padding: 0px; margin: 20px 0 0 0;
11
+ }
12
+ li {
13
+ float: left;
14
+ padding: 10px;
15
+ background-color: #F6F6F6;
16
+ list-style: none;
17
+ margin-left: 10px;
18
+ }
19
+ li a {
20
+ color: #1C94C4;
21
+ font-weight: bold;
22
+ text-decoration: none;
23
+ }
24
+ li.active a {
25
+ color: #F6A828;
26
+ cursor: default;
27
+ }
28
+ .tab {
29
+ border: solid 1px #F6A828;
30
+ }
31
+ /* clearfix from jQueryUI */
32
+ .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
33
+ .ui-helper-clearfix { display: inline-block; }
34
+ /* required comment for clearfix to work in Opera \*/
35
+ * html .ui-helper-clearfix { height:1%; }
36
+ .ui-helper-clearfix { display:block; }
37
+ /* end clearfix */
38
+ </style>
39
+ </head>
40
+ <body>
41
+ <p>jQuery.Class Demo shows a tabs controller extended to work with history.</p>
42
+ <div id="demo-html">
43
+ <h2>Basic Tabs</h2>
44
+ <ul id='tabs1' class='ui-helper-clearfix''>
45
+ <li><a href='#tab1'>Tab 1</a></li>
46
+ <li><a href='#tab2'>Tab 2</a></li>
47
+ <li><a href='#tab3'>Tab 3</a></li>
48
+ </ul>
49
+ <div id='tab1' class='tab'>Tab 1 Content</div>
50
+ <div id='tab2' class='tab'>Tab 2 Content</div>
51
+ <div id='tab3' class='tab'>Tab 3 Content</div>
52
+ <h2>History Tabs</h2>
53
+ <ul id='tabs2' class='ui-helper-clearfix''>
54
+ <li><a href='#tab4'>Tab 4</a></li>
55
+ <li><a href='#tab5'>Tab 5</a></li>
56
+ <li><a href='#tab6'>Tab 6</a></li>
57
+ </ul>
58
+ <div id='tab4' class='tab'>Tab 4 Content</div>
59
+ <div id='tab5' class='tab'>Tab 5 Content</div>
60
+ <div id='tab6' class='tab'>Tab 6 Content</div>
61
+ </div>
62
+ <script type='text/javascript'>DEMO_HTML = document.getElementById('demo-html').innerHTML</script>
63
+ <script type='text/javascript' src='../../steal/steal.js'></script>
64
+ <script type='text/javascript'>
65
+ steal.plugins('jquery/controller/history').start();
66
+ </script>
67
+ <script type='text/javascript' id="demo-source">
68
+ $.Controller.extend("Tabs",{
69
+ init : function(){
70
+ this.element.children("li:first").addClass('active')
71
+ var tab = this.tab;
72
+ this.element.children("li:gt(0)").each(function(){
73
+ tab($(this)).hide()
74
+ })
75
+ },
76
+ tab : function(li){
77
+ return $(li.find("a").attr("href"))
78
+ },
79
+ "li click" : function(el, ev){
80
+ ev.preventDefault();
81
+ this.activate(el)
82
+ },
83
+ activate : function(el){
84
+ this.tab(this.find('.active').removeClass('active')).hide()
85
+ this.tab(el.addClass('active')).show();
86
+ }
87
+ })
88
+
89
+ //inherit from tabs
90
+ Tabs.extend("HistoryTabs",{
91
+ // ignore clicks
92
+ "li click" : function(){},
93
+
94
+ // listen for history changes
95
+ "history.** subscribe" : function(called){
96
+ var hash = window.location.hash;
97
+ this.activate(hash === '' || hash === '#' ?
98
+ this.element.find("li:first") :
99
+ this.element.find("a[href="+hash+"]").parent()
100
+ )
101
+ }
102
+ })
103
+
104
+ //adds the controller to the element
105
+ $("#tabs1").tabs();
106
+ $("#tabs2").history_tabs();
107
+ </script>
108
+ </body>
109
+ </html>
@@ -0,0 +1,627 @@
1
+ //jQuery.Class
2
+ // This is a modified version of John Resig's class
3
+ // http://ejohn.org/blog/simple-javascript-inheritance/
4
+ // It provides class level inheritance and callbacks.
5
+ steal.plugin("jquery").then(function( $ ) {
6
+
7
+ // if we are initializing a new class
8
+ var initializing = false,
9
+
10
+ // tests if we can get super in .toString()
11
+ fnTest = /xyz/.test(function() {
12
+ xyz;
13
+ }) ? /\b_super\b/ : /.*/,
14
+
15
+ // overwrites an object with methods, sets up _super
16
+ inheritProps = function( newProps, oldProps, addTo ) {
17
+ addTo = addTo || newProps
18
+ for ( var name in newProps ) {
19
+ // Check if we're overwriting an existing function
20
+ addTo[name] = typeof newProps[name] == "function" && typeof oldProps[name] == "function" && fnTest.test(newProps[name]) ? (function( name, fn ) {
21
+ return function() {
22
+ var tmp = this._super,
23
+ ret;
24
+
25
+ // Add a new ._super() method that is the same method
26
+ // but on the super-class
27
+ this._super = oldProps[name];
28
+
29
+ // The method only need to be bound temporarily, so we
30
+ // remove it when we're done executing
31
+ ret = fn.apply(this, arguments);
32
+ this._super = tmp;
33
+ return ret;
34
+ };
35
+ })(name, newProps[name]) : newProps[name];
36
+ }
37
+ };
38
+
39
+
40
+ /**
41
+ * @constructor jQuery.Class
42
+ * @plugin jquery/class
43
+ * @tag core
44
+ * @download dist/jquery/jquery.class.js
45
+ * @test jquery/class/qunit.html
46
+ * Class provides simulated inheritance in JavaScript. Use $.Class to bridge the gap between
47
+ * jQuery's functional programming style and Object Oriented Programming.
48
+ * It is based off John Resig's [http://ejohn.org/blog/simple-javascript-inheritance/|Simple Class]
49
+ * Inheritance library. Besides prototypal inheritance, it includes a few important features:
50
+ * <ul>
51
+ * <li>Static inheritance</li>
52
+ * <li>Introspection</li>
53
+ * <li>Namespaces</li>
54
+ * <li>Setup and initialization methods</li>
55
+ * <li>Easy callback function creation</li>
56
+ * </ul>
57
+ * <h2>Static v. Prototype</h2>
58
+ * <p>Before learning about Class, it's important to
59
+ * understand the difference between
60
+ * a class's <b>static</b> and <b>prototype</b> properties.
61
+ * </p>
62
+ * @codestart
63
+ * //STATIC
64
+ * MyClass.staticProperty //shared property
65
+ *
66
+ * //PROTOTYPE
67
+ * myclass = new MyClass()
68
+ * myclass.prototypeMethod() //instance method
69
+ * @codeend
70
+ * <p>A static (or class) property is on the Class constructor
71
+ * function itself
72
+ * and can be thought of being shared by all instances of the Class.
73
+ * Prototype propertes are available only on instances of the Class.
74
+ * </p>
75
+ * <h2>A Basic Class</h2>
76
+ * <p>The following creates a Monster class with a
77
+ * name (for introspection), static, and prototype members.
78
+ * Every time a monster instance is created, the static
79
+ * count is incremented.
80
+ *
81
+ * </p>
82
+ * @codestart
83
+ * $.Class.extend('Monster',
84
+ * /* @static *|
85
+ * {
86
+ * count: 0
87
+ * },
88
+ * /* @prototype *|
89
+ * {
90
+ * init: function( name ) {
91
+ *
92
+ * // saves name on the monster instance
93
+ * this.name = name;
94
+ *
95
+ * // sets the health
96
+ * this.health = 10;
97
+ *
98
+ * // increments count
99
+ * this.Class.count++;
100
+ * },
101
+ * eat: function( smallChildren ){
102
+ * this.health += smallChildren;
103
+ * },
104
+ * fight: function() {
105
+ * this.health -= 2;
106
+ * }
107
+ * });
108
+ *
109
+ * hydra = new Monster('hydra');
110
+ *
111
+ * dragon = new Monster('dragon');
112
+ *
113
+ * hydra.name // -> hydra
114
+ * Monster.count // -> 2
115
+ * Monster.shortName // -> 'Monster'
116
+ *
117
+ * hydra.eat(2); // health = 12
118
+ *
119
+ * dragon.fight(); // health = 8
120
+ *
121
+ * @codeend
122
+ *
123
+ * <p>
124
+ * Notice that the prototype <b>init</b> function is called when a new instance of Monster is created.
125
+ * </p>
126
+ * <h2>Inheritance</h2>
127
+ * <p>When a class is extended, all static and prototype properties are available on the new class.
128
+ * If you overwrite a function, you can call the base class's function by calling
129
+ * <code>this._super</code>. Lets create a SeaMonster class. SeaMonsters are less
130
+ * efficient at eating small children, but more powerful fighters.
131
+ * </p>
132
+ * @codestart
133
+ * Monster.extend("SeaMonster",{
134
+ * eat: function( smallChildren ) {
135
+ * this._super(smallChildren / 2);
136
+ * },
137
+ * fight: function() {
138
+ * this.health -= 1;
139
+ * }
140
+ * });
141
+ *
142
+ * lockNess = new SeaMonster('Lock Ness');
143
+ * lockNess.eat(4); //health = 12
144
+ * lockNess.fight(); //health = 11
145
+ * @codeend
146
+ * <h3>Static property inheritance</h3>
147
+ * You can also inherit static properties in the same way:
148
+ * @codestart
149
+ * $.Class.extend("First",
150
+ * {
151
+ * staticMethod: function() { return 1;}
152
+ * },{})
153
+ *
154
+ * First.extend("Second",{
155
+ * staticMethod: function() { return this._super()+1;}
156
+ * },{})
157
+ *
158
+ * Second.staticMethod() // -> 2
159
+ * @codeend
160
+ * <h2>Namespaces</h2>
161
+ * <p>Namespaces are a good idea! We encourage you to namespace all of your code.
162
+ * It makes it possible to drop your code into another app without problems.
163
+ * Making a namespaced class is easy:
164
+ * </p>
165
+ * @codestart
166
+ * $.Class.extend("MyNamespace.MyClass",{},{});
167
+ *
168
+ * new MyNamespace.MyClass()
169
+ * @codeend
170
+ * <h2 id='introspection'>Introspection</h2>
171
+ * Often, it's nice to create classes whose name helps determine functionality. Ruby on
172
+ * Rails's [http://api.rubyonrails.org/classes/ActiveRecord/Base.html|ActiveRecord] ORM class
173
+ * is a great example of this. Unfortunately, JavaScript doesn't have a way of determining
174
+ * an object's name, so the developer must provide a name. Class fixes this by taking a String name for the class.
175
+ * @codestart
176
+ * $.Class.extend("MyOrg.MyClass",{},{})
177
+ * MyOrg.MyClass.shortName //-> 'MyClass'
178
+ * MyOrg.MyClass.fullName //-> 'MyOrg.MyClass'
179
+ * @codeend
180
+ * The fullName (with namespaces) and the shortName (without namespaces) are added to the Class's
181
+ * static properties.
182
+ *
183
+ *
184
+ * <h2>Setup and initialization methods</h2>
185
+ * <p>
186
+ * Class provides static and prototype initialization functions.
187
+ * These come in two flavors - setup and init.
188
+ * Setup is called before init and
189
+ * can be used to 'normalize' init's arguments.
190
+ * </p>
191
+ * <div class='whisper'>PRO TIP: Typically, you don't need setup methods in your classes. Use Init instead.
192
+ * Reserve setup methods for when you need to do complex pre-processing of your class before init is called.
193
+ *
194
+ * </div>
195
+ * @codestart
196
+ * $.Class.extend("MyClass",
197
+ * {
198
+ * setup: function() {} //static setup
199
+ * init: function() {} //static constructor
200
+ * },
201
+ * {
202
+ * setup: function() {} //prototype setup
203
+ * init: function() {} //prototype constructor
204
+ * })
205
+ * @codeend
206
+ *
207
+ * <h3>Setup</h3>
208
+ * <p>Setup functions are called before init functions. Static setup functions are passed
209
+ * the base class followed by arguments passed to the extend function.
210
+ * Prototype static functions are passed the Class constructor function arguments.</p>
211
+ * <p>If a setup function returns an array, that array will be used as the arguments
212
+ * for the following init method. This provides setup functions the ability to normalize
213
+ * arguments passed to the init constructors. They are also excellent places
214
+ * to put setup code you want to almost always run.</p>
215
+ * <p>
216
+ * The following is similar to how [jQuery.Controller.prototype.setup]
217
+ * makes sure init is always called with a jQuery element and merged options
218
+ * even if it is passed a raw
219
+ * HTMLElement and no second parameter.
220
+ * </p>
221
+ * @codestart
222
+ * $.Class.extend("jQuery.Controller",{
223
+ * ...
224
+ * },{
225
+ * setup: function( el, options ) {
226
+ * ...
227
+ * return [$(el),
228
+ * $.extend(true,
229
+ * this.Class.defaults,
230
+ * options || {} ) ]
231
+ * }
232
+ * })
233
+ * @codeend
234
+ * Typically, you won't need to make or overwrite setup functions.
235
+ * <h3>Init</h3>
236
+ *
237
+ * <p>Init functions are called after setup functions.
238
+ * Typically, they receive the same arguments
239
+ * as their preceding setup function. The Foo class's <code>init</code> method
240
+ * gets called in the following example:
241
+ * </p>
242
+ * @codestart
243
+ * $.Class.Extend("Foo", {
244
+ * init: function( arg1, arg2, arg3 ) {
245
+ * this.sum = arg1+arg2+arg3;
246
+ * }
247
+ * })
248
+ * var foo = new Foo(1,2,3);
249
+ * foo.sum //-> 6
250
+ * @codeend
251
+ * <h2>Callbacks</h2>
252
+ * <p>Similar to jQuery's proxy method, Class provides a
253
+ * [jQuery.Class.static.callback callback]
254
+ * function that returns a callback to a method that will always
255
+ * have
256
+ * <code>this</code> set to the class or instance of the class.
257
+ * </p>
258
+ * The following example uses this.callback to make sure
259
+ * <code>this.name</code> is available in <code>show</code>.
260
+ * @codestart
261
+ * $.Class.extend("Todo",{
262
+ * init: function( name ) { this.name = name }
263
+ * get: function() {
264
+ * $.get("/stuff",this.callback('show'))
265
+ * },
266
+ * show: function( txt ) {
267
+ * alert(this.name+txt)
268
+ * }
269
+ * })
270
+ * new Todo("Trash").get()
271
+ * @codeend
272
+ * <p>Callback is available as a static and prototype method.</p>
273
+ * <h2>Demo</h2>
274
+ * @demo jquery/class/class.html
275
+ *
276
+ * @init Creating a new instance of an object that has extended jQuery.Class
277
+ * calls the init prototype function and returns a new instance of the class.
278
+ *
279
+ */
280
+
281
+ jQuery.Class = function() {
282
+ if ( arguments.length ) this.extend.apply(this, arguments)
283
+ };
284
+
285
+ /* @Static*/
286
+ $.extend($.Class, {
287
+ /**
288
+ * @function callback
289
+ * Returns a callback function for a function on this Class.
290
+ * The callback function ensures that 'this' is set appropriately.
291
+ * @codestart
292
+ * $.Class.extend("MyClass",{
293
+ * getData: function() {
294
+ * this.showing = null;
295
+ * $.get("data.json",this.callback('gotData'),'json')
296
+ * },
297
+ * gotData: function( data ) {
298
+ * this.showing = data;
299
+ * }
300
+ * },{});
301
+ * MyClass.showData();
302
+ * @codeend
303
+ * <h2>Currying Arguments</h2>
304
+ * Additional arguments to callback will fill in arguments on the returning function.
305
+ * @codestart
306
+ * $.Class.extend("MyClass",{
307
+ * getData: function( <b>callback</b> ) {
308
+ * $.get("data.json",this.callback('process',<b>callback</b>),'json');
309
+ * },
310
+ * process: function( <b>callback</b>, jsonData ) { //callback is added as first argument
311
+ * jsonData.processed = true;
312
+ * callback(jsonData);
313
+ * }
314
+ * },{});
315
+ * MyClass.getData(showDataFunc)
316
+ * @codeend
317
+ * <h2>Nesting Functions</h2>
318
+ * Callback can take an array of functions to call as the first argument. When the returned callback function
319
+ * is called each function in the array is passed the return value of the prior function. This is often used
320
+ * to eliminate currying initial arguments.
321
+ * @codestart
322
+ * $.Class.extend("MyClass",{
323
+ * getData: function( callback ) {
324
+ * //calls process, then callback with value from process
325
+ * $.get("data.json",this.callback(['process2',callback]),'json')
326
+ * },
327
+ * process2: function( type,jsonData ) {
328
+ * jsonData.processed = true;
329
+ * return [jsonData];
330
+ * }
331
+ * },{});
332
+ * MyClass.getData(showDataFunc);
333
+ * @codeend
334
+ * @param {String|Array} fname If a string, it represents the function to be called.
335
+ * If it is an array, it will call each function in order and pass the return value of the prior function to the
336
+ * next function.
337
+ * @return {Function} the callback function.
338
+ */
339
+ callback: function( funcs ) {
340
+
341
+ //args that should be curried
342
+ var args = jQuery.makeArray(arguments),
343
+ self;
344
+
345
+ funcs = args.shift();
346
+
347
+ if (!jQuery.isArray(funcs) ) {
348
+ funcs = [funcs];
349
+ }
350
+
351
+ self = this;
352
+
353
+ return function class_cb() {
354
+ var cur = args.concat(jQuery.makeArray(arguments)),
355
+ isString, length = funcs.length,
356
+ f = 0,
357
+ func;
358
+
359
+ for (; f < length; f++ ) {
360
+ func = funcs[f];
361
+ if (!func ) {
362
+ continue;
363
+ }
364
+
365
+ isString = typeof func == "string";
366
+ if ( isString && self._set_called ) {
367
+ self.called = func;
368
+ }
369
+ cur = (isString ? self[func] : func).apply(self, cur || []);
370
+ if ( f < length - 1 ) {
371
+ cur = !jQuery.isArray(cur) || cur._use_call ? [cur] : cur
372
+ }
373
+ }
374
+ return cur;
375
+ }
376
+ },
377
+ /**
378
+ * @function getObject
379
+ * Gets an object from a String.
380
+ * If the object or namespaces the string represent do not
381
+ * exist it will create them.
382
+ * @codestart
383
+ * Foo = {Bar: {Zar: {"Ted"}}}
384
+ * $.Class.getobject("Foo.Bar.Zar") //-> "Ted"
385
+ * @codeend
386
+ * @param {String} objectName the object you want to get
387
+ * @param {Object} [current=window] the object you want to look in.
388
+ * @return {Object} the object you are looking for.
389
+ */
390
+ getObject: function( objectName, current ) {
391
+ var current = current || window,
392
+ parts = objectName ? objectName.split(/\./) : [],
393
+ i = 0;
394
+ for (; i < parts.length; i++ ) {
395
+ current = current[parts[i]] || (current[parts[i]] = {})
396
+ }
397
+ return current;
398
+ },
399
+ /**
400
+ * @function newInstance
401
+ * Creates a new instance of the class. This method is useful for creating new instances
402
+ * with arbitrary parameters.
403
+ * <h3>Example</h3>
404
+ * @codestart
405
+ * $.Class.extend("MyClass",{},{})
406
+ * var mc = MyClass.newInstance.apply(null, new Array(parseInt(Math.random()*10,10))
407
+ * @codeend
408
+ * @return {class} instance of the class
409
+ */
410
+ newInstance: function() {
411
+ var inst = this.rawInstance(),
412
+ args;
413
+ if ( inst.setup ) {
414
+ args = inst.setup.apply(inst, arguments);
415
+ }
416
+ if ( inst.init ) {
417
+ inst.init.apply(inst, $.isArray(args) ? args : arguments);
418
+ }
419
+ return inst;
420
+ },
421
+ /**
422
+ * Copy and overwrite options from old class
423
+ * @param {Object} oldClass
424
+ * @param {String} fullName
425
+ * @param {Object} staticProps
426
+ * @param {Object} protoProps
427
+ */
428
+ setup: function( oldClass, fullName ) {
429
+ this.defaults = $.extend(true, {}, oldClass.defaults, this.defaults);
430
+ return arguments;
431
+ },
432
+ rawInstance: function() {
433
+ initializing = true;
434
+ var inst = new this();
435
+ initializing = false;
436
+ return inst;
437
+ },
438
+ /**
439
+ * Extends a class with new static and prototype functions. There are a variety of ways
440
+ * to use extend:
441
+ * @codestart
442
+ * //with className, static and prototype functions
443
+ * $.Class.extend('Task',{ STATIC },{ PROTOTYPE })
444
+ * //with just classname and prototype functions
445
+ * $.Class.extend('Task',{ PROTOTYPE })
446
+ * //With just a className
447
+ * $.Class.extend('Task')
448
+ * @codeend
449
+ * @param {String} [fullName] the classes name (used for classes w/ introspection)
450
+ * @param {Object} [klass] the new classes static/class functions
451
+ * @param {Object} [proto] the new classes prototype functions
452
+ * @return {jQuery.Class} returns the new class
453
+ */
454
+ extend: function( fullName, klass, proto ) {
455
+ // figure out what was passed
456
+ if ( typeof fullName != 'string' ) {
457
+ proto = klass;
458
+ klass = fullName;
459
+ fullName = null;
460
+ }
461
+ if (!proto ) {
462
+ proto = klass;
463
+ klass = null;
464
+ }
465
+
466
+ proto = proto || {};
467
+ var _super_class = this,
468
+ _super = this.prototype,
469
+ name, shortName, namespace, prototype;
470
+
471
+ // Instantiate a base class (but only create the instance,
472
+ // don't run the init constructor)
473
+ initializing = true;
474
+ prototype = new this();
475
+ initializing = false;
476
+ // Copy the properties over onto the new prototype
477
+ inheritProps(proto, _super, prototype);
478
+
479
+ // The dummy class constructor
480
+
481
+ function Class() {
482
+ // All construction is actually done in the init method
483
+ if ( initializing ) return;
484
+
485
+ if ( this.constructor !== Class && arguments.length ) { //we are being called w/o new
486
+ return this.extend.apply(this, arguments)
487
+ } else { //we are being called w/ new
488
+ return this.Class.newInstance.apply(this.Class, arguments)
489
+ }
490
+ }
491
+ // Copy old stuff onto class
492
+ for ( name in this ) {
493
+ if ( this.hasOwnProperty(name) && $.inArray(name, ['prototype', 'defaults', 'getObject']) == -1 ) {
494
+ Class[name] = this[name];
495
+ }
496
+ }
497
+
498
+ // do static inheritance
499
+ inheritProps(klass, this, Class);
500
+
501
+ // do namespace stuff
502
+ if ( fullName ) {
503
+
504
+ var parts = fullName.split(/\./),
505
+ shortName = parts.pop(),
506
+ current = $.Class.getObject(parts.join('.')),
507
+ namespace = current;
508
+
509
+ //@steal-remove-start
510
+ steal.dev.isHappyName(fullName)
511
+ //@steal-remove-end
512
+ current[shortName] = Class;
513
+ }
514
+
515
+ // set things that can't be overwritten
516
+ $.extend(Class, {
517
+ prototype: prototype,
518
+ namespace: namespace,
519
+ shortName: shortName,
520
+ constructor: Class,
521
+ fullName: fullName
522
+ });
523
+
524
+ //make sure our prototype looks nice
525
+ Class.prototype.Class = Class.prototype.constructor = Class;
526
+
527
+
528
+ /**
529
+ * @attribute fullName
530
+ * The full name of the class, including namespace, provided for introspection purposes.
531
+ * @codestart
532
+ * $.Class.extend("MyOrg.MyClass",{},{})
533
+ * MyOrg.MyClass.shortName //-> 'MyClass'
534
+ * MyOrg.MyClass.fullName //-> 'MyOrg.MyClass'
535
+ * @codeend
536
+ */
537
+
538
+ var args = Class.setup.apply(Class, [_super_class].concat($.makeArray(arguments)));
539
+
540
+ if ( Class.init ) {
541
+ Class.init.apply(Class, args || []);
542
+ }
543
+
544
+ /* @Prototype*/
545
+ return Class;
546
+ /**
547
+ * @function setup
548
+ * Called with the same arguments as new Class(arguments ...) when a new instance is created.
549
+ * @codestart
550
+ * $.Class.extend("MyClass",
551
+ * {
552
+ * setup: function( val ) {
553
+ * this.val = val;
554
+ * }
555
+ * })
556
+ * var mc = new MyClass("Check Check")
557
+ * mc.val //-> 'Check Check'
558
+ * @codeend
559
+ *
560
+ * <div class='whisper'>PRO TIP:
561
+ * Setup functions are used to normalize constructor arguments and provide a place for
562
+ * setup code that extending classes don't have to remember to call _super to
563
+ * run.
564
+ * </div>
565
+ *
566
+ * @return {Array|undefined} If an array is return, [jQuery.Class.prototype.init] is
567
+ * called with those arguments; otherwise, the original arguments are used.
568
+ */
569
+ //break up
570
+ /**
571
+ * @function init
572
+ * Called with the same arguments as new Class(arguments ...) when a new instance is created.
573
+ * @codestart
574
+ * $.Class.extend("MyClass",
575
+ * {
576
+ * init: function( val ) {
577
+ * this.val = val;
578
+ * }
579
+ * })
580
+ * var mc = new MyClass("Check Check")
581
+ * mc.val //-> 'Check Check'
582
+ * @codeend
583
+ */
584
+ //Breaks up code
585
+ /**
586
+ * @attribute Class
587
+ * References the static properties of the instance's class.
588
+ * <h3>Quick Example</h3>
589
+ * @codestart
590
+ * // a class with a static classProperty property
591
+ * $.Class.extend("MyClass", {classProperty : true}, {});
592
+ *
593
+ * // a new instance of myClass
594
+ * var mc1 = new MyClass();
595
+ *
596
+ * //
597
+ * mc1.Class.classProperty = false;
598
+ *
599
+ * // creates a new MyClass
600
+ * var mc2 = new mc.Class();
601
+ * @codeend
602
+ * Getting static properties via the Class property, such as it's
603
+ * [jQuery.Class.static.fullName fullName] is very common.
604
+ */
605
+ }
606
+
607
+ })
608
+
609
+
610
+
611
+
612
+
613
+ jQuery.Class.prototype.
614
+ /**
615
+ * @function callback
616
+ * Returns a callback function. This does the same thing as and is described better in [jQuery.Class.static.callback].
617
+ * The only difference is this callback works
618
+ * on a instance instead of a class.
619
+ * @param {String|Array} fname If a string, it represents the function to be called.
620
+ * If it is an array, it will call each function in order and pass the return value of the prior function to the
621
+ * next function.
622
+ * @return {Function} the callback function
623
+ */
624
+ callback = jQuery.Class.callback;
625
+
626
+
627
+ })();