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,15 @@
1
+ <html>
2
+ <head>
3
+ <link rel="stylesheet" type="text/css" href="../../funcunit/qunit/qunit.css" />
4
+ </head>
5
+ <body>
6
+
7
+ <h1 id="qunit-header">Class Test Suite</h1>
8
+ <h2 id="qunit-banner"></h2>
9
+ <div id="qunit-testrunner-toolbar"></div>
10
+ <h2 id="qunit-userAgent"></h2>
11
+ <ol id="qunit-tests"></ol>
12
+ <div id="qunit-test-area"></div>
13
+ <script type='text/javascript' src='../../steal/steal.js?steal[app]=jquery/class/test/qunit'></script>
14
+ </body>
15
+ </html>
@@ -0,0 +1,146 @@
1
+ module("jquery/class");
2
+
3
+ test("Creating", function(){
4
+
5
+ jQuery.Class.extend("Animal",
6
+ {
7
+ count: 0,
8
+ test: function() {
9
+ return this.match ? true : false
10
+ }
11
+ },
12
+ {
13
+ init: function() {
14
+ this.Class.count++;
15
+ this.eyes = false;
16
+ }
17
+ }
18
+ );
19
+ Animal.extend("Dog",
20
+ {
21
+ match : /abc/
22
+ },
23
+ {
24
+ init: function() {
25
+ this._super();
26
+ },
27
+ talk: function() {
28
+ return "Woof";
29
+ }
30
+ });
31
+ Dog.extend("Ajax",
32
+ {
33
+ count : 0
34
+ },
35
+ {
36
+ init: function( hairs ) {
37
+ this._super();
38
+ this.hairs = hairs;
39
+ this.setEyes();
40
+
41
+ },
42
+ setEyes: function() {
43
+ this.eyes = true;
44
+ }
45
+ });
46
+ new Dog();
47
+ new Animal();
48
+ new Animal();
49
+ ajax = new Ajax(1000);
50
+
51
+ equals(2, Animal.count, "right number of animals");
52
+ equals(1, Dog.count, "right number of animals")
53
+ ok(Dog.match, "right number of animals")
54
+ ok(!Animal.match, "right number of animals")
55
+ ok(Dog.test(), "right number of animals")
56
+ ok(!Animal.test(), "right number of animals")
57
+ equals(1, Ajax.count, "right number of animals")
58
+ equals(2, Animal.count, "right number of animals");
59
+ equals(true, ajax.eyes, "right number of animals");
60
+ equals(1000, ajax.hairs, "right number of animals");
61
+ })
62
+
63
+
64
+ test("new instance",function(){
65
+ var d = Ajax.newInstance(6);
66
+ equals(6, d.hairs);
67
+ })
68
+
69
+
70
+ test("namespaces",function(){
71
+ var fb = $.Class.extend("Foo.Bar")
72
+ ok(Foo.Bar === fb, "returns class")
73
+ equals(fb.shortName, "Bar", "short name is right");
74
+ equals(fb.fullName, "Foo.Bar","fullName is right")
75
+
76
+ })
77
+
78
+ test("setups", function(){
79
+ var order = 0,
80
+ staticSetup,
81
+ staticSetupArgs,
82
+ staticInit,
83
+ staticInitArgs,
84
+ protoSetup,
85
+ protoInitArgs,
86
+ protoInit,
87
+ staticProps = {
88
+ setup: function() {
89
+ staticSetup = ++order;
90
+ staticSetupArgs = arguments;
91
+ return ["something"]
92
+ },
93
+ init: function() {
94
+ staticInit = ++order;
95
+ staticInitArgs = arguments;
96
+ }
97
+ },
98
+ protoProps = {
99
+ setup: function( name ) {
100
+ protoSetup = ++order;
101
+ return ["Ford: "+name];
102
+ },
103
+ init: function() {
104
+ protoInit = ++order;
105
+ protoInitArgs = arguments;
106
+ }
107
+ }
108
+ $.Class.extend("Car",staticProps,protoProps);
109
+
110
+ var geo = new Car("geo");
111
+ equals(staticSetup, 1);
112
+ equals(staticInit, 2);
113
+ equals(protoSetup, 3);
114
+ equals(protoInit, 4);
115
+
116
+ same($.makeArray(staticInitArgs), ["something"] )
117
+ same($.makeArray(protoInitArgs),["Ford: geo"] )
118
+
119
+ same($.makeArray(staticSetupArgs),[$.Class, "Car",staticProps, protoProps] ,"static construct");
120
+
121
+
122
+ //now see if staticSetup gets called again ...
123
+ Car.extend("Truck");
124
+ equals(staticSetup, 5, "Static setup is called if overwriting");
125
+
126
+ });
127
+
128
+ test("callback", function(){
129
+ var curVal = 0;
130
+ $.Class.extend("Car",{
131
+ show: function( value ) {
132
+ equals(curVal, value)
133
+ }
134
+ },{
135
+ show: function( value ) {
136
+
137
+ }
138
+ })
139
+ var cb = Car.callback('show');
140
+ curVal = 1;
141
+ cb(1)
142
+
143
+ curVal = 2;
144
+ var cb2 = Car.callback('show',2)
145
+ cb2();
146
+ })
@@ -0,0 +1,5 @@
1
+ //we probably have to have this only describing where the tests are
2
+ steal
3
+ .plugins("jquery/class") //load your app
4
+ .plugins('funcunit/qunit') //load qunit
5
+ .then("class_test")
@@ -0,0 +1,20 @@
1
+ <html>
2
+ <head>
3
+ <link rel="stylesheet" type="text/css" href="../../../../funcunit/qunit/qunit.css" />
4
+ <style>
5
+ body {
6
+ margin: 0px; padding: 0px;
7
+ }
8
+ </style>
9
+ </head>
10
+ <body>
11
+
12
+ <h1 id="qunit-header">jQuery Dom Compare Test Suite</h1>
13
+ <h2 id="qunit-banner"></h2>
14
+ <div id="qunit-testrunner-toolbar"></div>
15
+ <h2 id="qunit-userAgent"></h2>
16
+ <ol id="qunit-tests"></ol>
17
+
18
+ <script type='text/javascript' src='../../../../steal/steal.js?steal[app]=jquery/class/test/qunit'></script>
19
+ </body>
20
+ </html>
@@ -0,0 +1,89 @@
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>Controller Example</title>
6
+ <style type='text/css'>
7
+ body {font-family: verdana}
8
+ .tabs {
9
+
10
+ padding: 0px; margin: 0px;
11
+ }
12
+ .tabs li {
13
+ float: left;
14
+ padding: 10px;
15
+ background-color: #F6F6F6;
16
+ list-style: none;
17
+ margin-left: 10px;
18
+ }
19
+ .tabs li a {
20
+ color: #1C94C4;
21
+ font-weight: bold;
22
+ text-decoration: none;
23
+ }
24
+ .tabs 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
+ <div id="demo-html">
42
+ <ul id='tabs' class='ui-helper-clearfix''>
43
+ <li><a href='#tab1'>Tab 1</a></li>
44
+ <li><a href='#tab2'>Tab 2</a></li>
45
+ <li><a href='#tab3'>Tab 3</a></li>
46
+ </ul>
47
+ <div id='tab1' class='tab'>Tab 1 Content</div>
48
+ <div id='tab2' class='tab'>Tab 2 Content</div>
49
+ <div id='tab3' class='tab'>Tab 3 Content</div>
50
+ </div>
51
+ <script type='text/javascript' src='../../steal/steal.js'></script>
52
+ <script type='text/javascript'>
53
+ steal.plugins("jquery/controller").start();
54
+ </script>
55
+ <script type='text/javascript' id="demo-source">
56
+ // create a new Tabs class
57
+ $.Controller.extend("Tabs",{
58
+
59
+ // initialize widget
60
+ init : function(el){
61
+
62
+ // activate the first tab
63
+ $(el).children("li:first").addClass('active')
64
+
65
+ // hide the other tabs
66
+ var tab = this.tab;
67
+ this.element.children("li:gt(0)").each(function(){
68
+ tab($(this)).hide()
69
+ })
70
+ },
71
+
72
+ // helper function finds the tab for a given li
73
+ tab : function(li){
74
+ return $(li.find("a").attr("href"))
75
+ },
76
+
77
+ // hides old active tab, shows new one
78
+ "li click" : function(el, ev){
79
+ ev.preventDefault();
80
+ this.tab(this.find('.active').removeClass('active')).hide()
81
+ this.tab(el.addClass('active')).show();
82
+ }
83
+ })
84
+
85
+ // adds the controller to the element
86
+ $("#tabs").tabs();
87
+ </script>
88
+ </body>
89
+ </html>
@@ -0,0 +1,735 @@
1
+ steal.plugins('jquery/class', 'jquery/lang', 'jquery/event/destroyed').then(function( $ ) {
2
+
3
+ // ------- helpers ------
4
+ // Binds an element, returns a function that unbinds
5
+ var bind = function( el, ev, callback ) {
6
+ var wrappedCallback;
7
+ //this is for events like >click.
8
+ if ( ev.indexOf(">") == 0 ) {
9
+ ev = ev.substr(1);
10
+ wrappedCallback = function( event ) {
11
+ event.target === el ? callback.apply(this, arguments) : event.handled = null;
12
+ }
13
+ }
14
+ $(el).bind(ev, wrappedCallback || callback);
15
+ // if ev name has >, change the name and bind
16
+ // in the wrapped callback, check that the element matches the actual element
17
+ return function() {
18
+ $(el).unbind(ev, wrappedCallback || callback);
19
+ el = ev = callback = wrappedCallback = null;
20
+ }
21
+ },
22
+ // Binds an element, returns a function that unbinds
23
+ delegate = function( el, selector, ev, callback ) {
24
+ $(el).delegate(selector, ev, callback);
25
+ return function() {
26
+ $(el).undelegate(selector, ev, callback);
27
+ el = ev = callback = selector = null;
28
+ }
29
+ },
30
+ binder = function( el, ev, callback, selector ) {
31
+ return selector ? delegate(el, selector, ev, callback) : bind(el, ev, callback)
32
+ },
33
+ /**
34
+ * moves 'this' to the first argument
35
+ */
36
+ shifter = function shifter(cb) {
37
+ return function() {
38
+ return cb.apply(null, [$(this)].concat(Array.prototype.slice.call(arguments, 0)));
39
+ }
40
+ },
41
+ // matches dots
42
+ dotsReg = /\./g,
43
+ // matches controller
44
+ controllersReg = /_?controllers?/ig,
45
+ //used to remove the controller from the name
46
+ underscoreAndRemoveController = function( className ) {
47
+ return $.String.underscore(className.replace(dotsReg, '_').replace(controllersReg, ""));
48
+ },
49
+ // checks if it looks like an action
50
+ actionMatcher = /[^\w]/,
51
+ // gets jus the event
52
+ eventCleaner = /^(>?default\.)|(>)/,
53
+ // handles parameterized action names
54
+ parameterReplacer = /\{([^\}]+)\}/g,
55
+ breaker = /^(?:(.*?)\s)?([\w\.\:>]+)$/;
56
+ /**
57
+ * @tag core
58
+ * @plugin jquery/controller
59
+ * @download jquery/dist/jquery.controller.js
60
+ *
61
+ * <p>Controllers organize event handlers using event delegation.
62
+ * If something happens in your application (a user click or a [jQuery.Model|Model] instance being updated),
63
+ * a controller should respond to it. </p>
64
+ *
65
+ * <h2 class='spaced'>Benefits</h2>
66
+ * <ul>
67
+ * <li><p><i>Know your code.</i></p>
68
+ * Group events and label your html in repeatable ways so it's easy to find your code.</li>
69
+ * <li><p><i>Controllers are inheritable.</i></p>
70
+ * Package, inherit, and reuse your widgets.</li>
71
+ * <li><p><i>Write less.</i></p>
72
+ * Controllers take care of setup / teardown auto-magically.</li>
73
+ * </ul>
74
+ * <h2>Basic Example</h2>
75
+ * Controllers organize jQuery code into resuable, inheritable, and extendable widgets. So instead of
76
+ * @codestart
77
+ * $(function(){
78
+ * $('#tabs').click(someCallbackFunction1)
79
+ * $('#tabs .tab').click(someCallbackFunction2)
80
+ * $('#tabs .delete click').click(someCallbackFunction3)
81
+ * });
82
+ * @codeend
83
+ * do this
84
+ * @codestart
85
+ * $.Controller.extend('Tabs',{
86
+ * click: function() {...},
87
+ * '.tab click' : function() {...},
88
+ * '.delete click' : function() {...}
89
+ * })
90
+ * $('#tabs').tabs();
91
+ * @codeend
92
+ * <h2>Tabs Example</h2>
93
+ * @demo jquery/controller/controller.html
94
+ *
95
+ * <h2>Using Controllers</h2>
96
+ * <p>A Controller is mostly a list of functions that get called back when specific events happen.
97
+ * A function's name provides a description of when the function should be called.
98
+ * By naming your functions like "<b>selector</b> <b>event</b>",
99
+ * Controller recognizes them as an <b>Action</b> and binds them appropriately.
100
+ * </p>
101
+ *
102
+ * <p>The event binding happens when you create a [jQuery.Controller.prototype.setup|new controller instance].
103
+ * </p>
104
+ *
105
+ * <p>Lets look at a very basic example -
106
+ * a list of todos and a button you want to click to create a new todo.
107
+ * Your HTML might look like:</p>
108
+ * @codestart html
109
+ * &lt;div id='todos'>
110
+ * &lt;ol>
111
+ * &lt;li class="todo">Laundry&lt;/li>
112
+ * &lt;li class="todo">Dishes&lt;/li>
113
+ * &lt;li class="todo">Walk Dog&lt;/li>
114
+ * &lt;/ol>
115
+ * &lt;a class="create">Create&lt;/a>
116
+ * &lt;/div>
117
+ * @codeend
118
+ * To add a mousover effect and create todos, your controller might look like:
119
+ * @codestart
120
+ * $.Controller.extend('Todos',{
121
+ * ".todo mouseover" : function( el, ev ) {
122
+ * el.css("backgroundColor","red")
123
+ * },
124
+ * ".todo mouseout" : function( el, ev ) {
125
+ * el.css("backgroundColor","")
126
+ * },
127
+ * ".create click" : function() {
128
+ * this.find("ol").append("&lt;li class='todo'>New Todo&lt;/li>");
129
+ * }
130
+ * })
131
+ * @codeend
132
+ * Now that you've created the controller class, you've must attach the event handlers on the '#todos' div by
133
+ * creating [jQuery.Controller.prototype.init|a new controller instance]. There are 2 ways of doing this.
134
+ * @codestart
135
+ * //1. Create a new controller directly:
136
+ * new Todos($('#todos'));
137
+ * //2. Use jQuery function
138
+ * $('#todos').todos();
139
+ * @codeend
140
+ *
141
+ * As you've likely noticed, when the [jQuery.Controller.static.init|controller class is created], it creates helper
142
+ * functions on [jQuery.fn]. The "#todos" element is known as the <b>controller</b> element.
143
+ *
144
+ * <h3>Event Handler Matching</h3>
145
+ * With the exception of subscribe actions, controller uses jQuery.fn.bind or jQuery.fn.delegate to
146
+ * attach event handlers. Controller uses the following rules to determine if a function name is
147
+ * an event handler:
148
+ *
149
+ * <ul>
150
+ * <li>Does the function name contain a selector? Ex: <code>"a.foo click"</code></li>
151
+ * <li>Does the function name match an event in jQuery.event.special? Ex: <code>"mouseenter"</code></li>
152
+ * <li>Does the function name match a standard event name? Ex: <code>"click"</code></li>
153
+ * <li>Does the function name match a value in the controller's static listensTo array? Ex: <code>"activate"</code></li>
154
+ * </ul>
155
+ * In general, Controller will know automatically when to bind event handler functions except for one case
156
+ * - event names without selectors that are not in $.event.special. But to correct for this, you
157
+ * just need to add the function to the listensTo property. Here's how:
158
+ * @codestart
159
+ * $.Controller.extend("MyShow",{
160
+ * listensTo: ["show"]
161
+ * },{
162
+ * show: function( el, ev ) {
163
+ * el.show();
164
+ * }
165
+ * })
166
+ * $('.show').my_show().trigger("show");
167
+ * @codeend
168
+ *
169
+ *
170
+ * <h3>Callback Parameters</h3>
171
+ * For most actions, the first two parameters are always:
172
+ * <ul>
173
+ * <li>el - the jQuery wrapped element.</li>
174
+ * <li>ev - the jQuery wrapped DOM event.</li>
175
+ * </ul>
176
+ * @codestart
177
+ * ".something click" : function( el, ev ) {
178
+ * el.slideUp()
179
+ * ev.stopDelegation(); //stops this event from delegating to any other
180
+ * // delegated events for this delegated element.
181
+ * ev.preventDefault(); //prevents the default action from happening.
182
+ * ev.stopPropagation(); //stops the event from going to other elements.
183
+ * }
184
+ * @codeend
185
+ *
186
+ * If the action provides different parameters, they are in each action's documentation.
187
+ *
188
+ *
189
+ * <h2>Document Controllers</h2>
190
+ * <p>
191
+ * Document Controllers delegate on the documentElement. You don't have to attach an instance as this will be done
192
+ * for you when the controller class is created. Document Controllers, with the exception of MainControllers,
193
+ * add an implicit '#CONTROLLERNAME' before every selector.
194
+ * </p>
195
+ * <p>To create a document controller, you just have to set the controller's [jQuery.Controller.static.onDocument static onDocument]
196
+ * property to true.</p>
197
+ * @codestart
198
+ * $.Controller.extend('TodosController',
199
+ * {onDocument: true},
200
+ * {
201
+ * ".todo mouseover" : function( el, ev ) { //matches #todos .todo
202
+ * el.css("backgroundColor","red")
203
+ * },
204
+ * ".todo mouseout" : function( el, ev ) { //matches #todos .todo
205
+ * el.css("backgroundColor","")
206
+ * },
207
+ * ".create click" : function() { //matches #todos .create
208
+ * this.find("ol").append("&lt;li class='todo'>New Todo&lt;/li>");
209
+ * }
210
+ * })
211
+ * @codeend
212
+ * <p>DocumentControllers are typically used for page layout and functionality that is
213
+ * extremely unlikely to be repeated such as a SidebarController.
214
+ * Often, a Document Controller's <b>"ready"</b> event will be used to create
215
+ * necessary Element Controllers.</p>
216
+ * @codestart
217
+ * $.Controller.extend('SidebarController',
218
+ * {onDocument: true},
219
+ * {
220
+ * <b>ready</b> : function() {
221
+ * $(".slider").slider_controller()
222
+ * },
223
+ * "a.tag click" : function() {..}
224
+ * })
225
+ * @codeend
226
+ * <h3>MainControllers</h3>
227
+ * <p>MainControllers are documentControllers that do not add '#CONTROLLERNAME' before every selector. This controller
228
+ * should only be used for page wide functionality and setup.</p>
229
+ * @codestart
230
+ * $.Controller.extend("MainController",{
231
+ * hasActiveElement : document.activeElement || false
232
+ * },{
233
+ * focus : funtion(el){
234
+ * if(!this.Class.hasActiveElement)
235
+ * document.activeElement = el[0] //tracks active element
236
+ * }
237
+ * })
238
+ * @codeend
239
+ * <h2>Controller Initialization</h2>
240
+ * <p>It can be extremely useful to overwrite [jQuery.Controller.prototype.init Controller.prototype.init] with
241
+ * setup functionality for your widget. </p>
242
+ * <p>In the following example, I create a controller that when created, will put a message as the content of the element:</p>
243
+ * @codestart
244
+ * $.Controller.extend("SpecialController",
245
+ * {
246
+ * init: function( el, message ) {
247
+ * this.element.html(message)
248
+ * }
249
+ * })
250
+ * $(".special").special("Hello World")
251
+ * @codeend
252
+ * <h2>Removing Controllers</h2>
253
+ * Controller removal is built into jQuery. So to remove a controller, you just have to remove its element:
254
+ * @codestart
255
+ * $(".special_controller").remove()
256
+ * $("#containsControllers").html("")
257
+ * @codeend
258
+ * <p>It's important to note that if you use raw DOM methods (<code>innerHTML, removeChild</code>), the controllers won't be destroyed.</p>
259
+ * <p>If you just want to remove controller functionality, call destroy on the controller instance:</p>
260
+ * @codestart
261
+ * $(".special_controller").controller().destroy()
262
+ * @codeend
263
+ * <h2>Accessing Controllers</h2>
264
+ * <p>Often you need to get a reference to a controller, there are a few ways of doing that. For the
265
+ * following example, we assume there are 2 elements with <code>className="special"</code>.</p>
266
+ * @codestart
267
+ * //creates 2 foo controllers
268
+ * $(".special").foo()
269
+ *
270
+ * //creates 2 bar controllers
271
+ * $(".special").bar()
272
+ *
273
+ * //gets all controllers on all elements:
274
+ * $(".special").controllers() //-> [foo, bar, foo, bar]
275
+ *
276
+ * //gets only foo controllers
277
+ * $(".special").controllers(FooController) //-> [foo, foo]
278
+ *
279
+ * //gets all bar controllers
280
+ * $(".special").controllers(BarController) //-> [bar, bar]
281
+ *
282
+ * //gets first controller
283
+ * $(".special").controller() //-> foo
284
+ *
285
+ * //gets foo controller via data
286
+ * $(".special").data("controllers")["FooController"] //-> foo
287
+ * @codeend
288
+ *
289
+ * <h2>Calling methods on Controllers</h2>
290
+ * Once you have a reference to an element, you can call methods on it. However, Controller has
291
+ * a few shortcuts:
292
+ * @codestart
293
+ * //creates foo controller
294
+ * $(".special").foo({name: "value"})
295
+ *
296
+ * //calls FooController.prototype.update
297
+ * $(".special").foo({name: "value2"})
298
+ *
299
+ * //calls FooController.prototype.bar
300
+ * $(".special").foo("bar","something I want to pass")
301
+ * @codeend
302
+ */
303
+ $.Class.extend("jQuery.Controller",
304
+ /**
305
+ * @Static
306
+ */
307
+ {
308
+ /**
309
+ * Does 3 things:
310
+ * <ol>
311
+ * <li>Creates a jQuery helper for this controller.</li>
312
+ * <li>Calculates and caches which functions listen for events.</li>
313
+ * <li> and attaches this element to the documentElement if onDocument is true.</li>
314
+ * </ol>
315
+ * <h3>jQuery Helper Naming Examples</h3>
316
+ * @codestart
317
+ * "TaskController" -> $().task_controller()
318
+ * "Controllers.Task" -> $().controllers_task()
319
+ * @codeend
320
+ */
321
+ init: function() {
322
+ // if you didn't provide a name, or are controller, don't do anything
323
+ if (!this.shortName || this.fullName == "jQuery.Controller" ) {
324
+ return;
325
+ }
326
+ // cache the underscored names
327
+ this._fullName = underscoreAndRemoveController(this.fullName);
328
+ this._shortName = underscoreAndRemoveController(this.shortName);
329
+
330
+ var val, processor, controller = this,
331
+ pluginname = this._fullName,
332
+ funcName;
333
+
334
+ // create jQuery plugin
335
+ if (!$.fn[pluginname] ) {
336
+ $.fn[pluginname] = function( options ) {
337
+
338
+ var args = $.makeArray(arguments),
339
+ //if the arg is a method on this controller
340
+ isMethod = typeof options == "string" && $.isFunction(controller.prototype[options]),
341
+ meth = args[0];
342
+ this.each(function() {
343
+ //check if created
344
+ var controllers = $.data(this, "controllers"),
345
+ //plugin is actually the controller instance
346
+ plugin = controllers && controllers[pluginname];
347
+
348
+ if ( plugin ) {
349
+ isMethod ?
350
+ // call a method on the controller with the remaining args
351
+ plugin[meth].apply(plugin, args.slice(1)) :
352
+ // call the plugin's update method
353
+ plugin.update.apply(plugin, args)
354
+ } else {
355
+ //create a new controller instance
356
+ controller.newInstance.apply(controller, [this].concat(args))
357
+ }
358
+ })
359
+ //always return the element
360
+ return this;
361
+ }
362
+ }
363
+
364
+ // make sure listensTo is an array
365
+ //@steal-remove-start
366
+ if (!$.isArray(this.listensTo) ) {
367
+ throw "listensTo is not an array in " + this.fullName;
368
+ }
369
+ //@steal-remove-end
370
+ // calculate and cache actions
371
+ this.actions = {};
372
+
373
+ for ( funcName in this.prototype ) {
374
+ if (!$.isFunction(this.prototype[funcName]) ) {
375
+ continue;
376
+ }
377
+ this._isAction(funcName) && (this.actions[funcName] = this._getAction(funcName));
378
+ }
379
+
380
+ /**
381
+ * @attribute onDocument
382
+ * Set to true if you want to automatically attach this element to the documentElement.
383
+ */
384
+ if ( this.onDocument ) new this(document.documentElement);
385
+ },
386
+ hookup: function( el ) {
387
+ return new this(el);
388
+ },
389
+
390
+ /**
391
+ * @hide
392
+ * @param {String} methodName a prototype function
393
+ * @return {Boolean} truthy if an action or not
394
+ */
395
+ _isAction: function( methodName ) {
396
+ if ( actionMatcher.test(methodName) ) {
397
+ return true;
398
+ } else {
399
+ var cleanedEvent = methodName.replace(eventCleaner, "");
400
+ return $.inArray(cleanedEvent, this.listensTo) > -1 || $.event.special[cleanedEvent] || $.Controller.processors[cleanedEvent]
401
+ }
402
+
403
+ },
404
+ /**
405
+ * @hide
406
+ * @param {Object} methodName the method that will be bound
407
+ * @param {Object} [options] first param merged with class default options
408
+ * @return {Object} null or the processor and pre-split parts.
409
+ * The processor is what does the binding/subscribing.
410
+ */
411
+ _getAction: function( methodName, options ) {
412
+ //if we don't have a controller instance, we'll break this guy up later
413
+ parameterReplacer.lastIndex = 0;
414
+ if (!options && parameterReplacer.test(methodName) ) {
415
+ return null;
416
+ }
417
+ var convertedName = options ? methodName.replace(parameterReplacer, function( whole, inside ) {
418
+ //convert inside to type
419
+ return $.Class.getObject(inside, options).toString(); //gets the value in options
420
+ }) : methodName,
421
+ parts = convertedName.match(breaker),
422
+ event = parts[2],
423
+ processor = this.processors[event] || basicProcessor;
424
+ return {
425
+ processor: processor,
426
+ parts: parts
427
+ };
428
+ },
429
+ /**
430
+ * @attribute processors
431
+ * A has of eventName: function pairs that Controller uses to hook
432
+ */
433
+ processors: {},
434
+ /**
435
+ * @attribute listensTo
436
+ * A list of special events this controller listens too. You only need to add event names that
437
+ * are whole words (ie have no special characters).
438
+ */
439
+ listensTo: []
440
+ },
441
+ /**
442
+ * @Prototype
443
+ */
444
+ {
445
+ /**
446
+ * Does three things:
447
+ * <ol>
448
+ * <li>Matches and creates actions.</li>
449
+ * <li>Set the controller's element.</li>
450
+ * <li>Saves a reference to this controller in the element's data.</li>
451
+ * </ol>
452
+ * @param {HTMLElement} element the element this instance operates on.
453
+ */
454
+ setup: function( element, options ) {
455
+ var funcName, cb, ready, cls = this.Class;
456
+
457
+ //want the raw element here
458
+ element = element.jquery ? element[0] : element;
459
+
460
+ //set element and className on element
461
+ this.element = $(element).addClass(cls._fullName);
462
+
463
+ //set in data
464
+ ($.data(element, "controllers") || $.data(element, "controllers", {}))[cls._fullName] = this;
465
+
466
+ //adds bindings
467
+ this._bindings = [];
468
+ /**
469
+ * @attribute options
470
+ * Options is automatically merged from this.Class.OPTIONS and the 2nd argument
471
+ * passed to a controller.
472
+ */
473
+ this.options = $.extend($.extend(true, {}, cls.defaults), options);
474
+
475
+ //go through the cached list of actions and use the processor to bind
476
+ for ( funcName in cls.actions ) {
477
+ ready = cls.actions[funcName] || cls._getAction(funcName, this.options);
478
+
479
+ this._bindings.push(
480
+ ready.processor(element, ready.parts[2], ready.parts[1], this.callback(funcName), this));
481
+ }
482
+
483
+
484
+ /**
485
+ * @attribute called
486
+ * String name of current function being called on controller instance. This is
487
+ * used for picking the right view in render.
488
+ * @hide
489
+ */
490
+ this.called = "init";
491
+
492
+ //setup to be destroyed ... don't bind b/c we don't want to remove it
493
+ //this.element.bind('destroyed', this.callback('destroy'))
494
+ var destroyCB = shifter(this.callback("destroy"))
495
+ this.element.bind("destroyed", destroyCB);
496
+ this._bindings.push(function( el ) {
497
+ destroyCB.removed = true;
498
+ $(element).unbind("destroyed", destroyCB);
499
+ })
500
+
501
+ /**
502
+ * @attribute element
503
+ * The controller instance's delegated element. This is set by [jQuery.Controller.prototype.init init].
504
+ * It is a jQuery wrapped element.
505
+ * @codestart
506
+ * ".something click" : function() {
507
+ * this.element.css("color","red")
508
+ * }
509
+ * @codeend
510
+ */
511
+ return this.element;
512
+ },
513
+ /**
514
+ * Bind attaches event handlers that will be removed when the controller is removed.
515
+ * This is a good way to attach to an element not in the controller's element.
516
+ * <br/>
517
+ * <h3>Examples:</h3>
518
+ * @codestart
519
+ * init: function() {
520
+ * // calls somethingClicked(el,ev)
521
+ * this.bind('click','somethingClicked')
522
+ *
523
+ * // calls function when the window is clicked
524
+ * this.bind(window, 'click', function(ev){
525
+ * //do something
526
+ * })
527
+ * },
528
+ * somethingClicked: function( el, ev ) {
529
+ *
530
+ * }
531
+ * @codeend
532
+ * @param {HTMLElement|jQuery.fn} [element=this.element] element the element to be bound
533
+ * @param {String} eventName The event to listen for.
534
+ * @param {Function|String} func A callback function or the String name of a controller function. If a controller
535
+ * function name is given, the controller function is called back with the bound element and event as the first
536
+ * and second parameter. Otherwise the function is called back like a normal bind.
537
+ * @return {Integer} The id of the binding in this._bindings
538
+ */
539
+ bind: function( el, eventName, func ) {
540
+ if ( typeof el == 'string' ) {
541
+ func = eventName;
542
+ eventName = el;
543
+ el = this.element
544
+ }
545
+ return this._binder(el, eventName, func)
546
+ },
547
+ _binder: function( el, eventName, func, selector ) {
548
+ if ( typeof func == 'string' ) {
549
+ func = shifter(this.callback(func))
550
+ }
551
+ this._bindings.push(binder(el, eventName, func, selector))
552
+ return this._bindings.length;
553
+ },
554
+ /**
555
+ * Delegate will delegate on an elememt and will be undelegated when the controller is removed.
556
+ * This is a good way to delegate on elements not in a controller's element.<br/>
557
+ * <h3>Example:</h3>
558
+ * @codestart
559
+ * // calls function when the any 'a.foo' is clicked.
560
+ * this.delegate(document.documentElement,'a.foo', 'click', function(ev){
561
+ * //do something
562
+ * })
563
+ * @codeend
564
+ * @param {HTMLElement|jQuery.fn} [element=this.element] element
565
+ * @param {String} selector the css selector
566
+ * @param {String} eventName
567
+ * @param {Function|String} func A callback function or the String name of a controller function. If a controller
568
+ * function name is given, the controller function is called back with the bound element and event as the first
569
+ * and second parameter. Otherwise the function is called back like a normal bind.
570
+ * @return {Integer} The id of the binding in this._bindings
571
+ */
572
+ delegate: function( element, selector, eventName, func ) {
573
+ if ( typeof element == 'string' ) {
574
+ func = eventName;
575
+ eventName = selector;
576
+ selector = element
577
+ element = this.element
578
+ }
579
+ return this._binder(element, eventName, func, selector)
580
+ },
581
+ /**
582
+ * Called if an controller's jQuery helper is called on an element that already has a controller instance
583
+ * of the same type. Extends this.options with the options passed in. If you overwrite this, you might want to call
584
+ * this._super.
585
+ * <h3>Examples</h3>
586
+ * @codestart
587
+ * $.Controller.extend("Thing",{
588
+ * init: function( el, options ) {
589
+ * alert('init')
590
+ * },
591
+ * update: function( options ) {
592
+ * this._super(options);
593
+ * alert('update')
594
+ * }
595
+ * });
596
+ * $('#myel').thing(); // alerts init
597
+ * $('#myel').thing(); // alerts update
598
+ * @codeend
599
+ * @param {Object} options
600
+ */
601
+ update: function( options ) {
602
+ $.extend(this.options, options)
603
+ },
604
+ /**
605
+ * Destroy unbinds and undelegates all actions on this controller, and prevents any memory leaks. This is called automatically
606
+ * if the element is removed.
607
+ *
608
+ */
609
+ destroy: function( ev ) {
610
+ if ( this._destroyed ) {
611
+ throw this.Class.shortName + " controller instance has been deleted";
612
+ }
613
+ var self = this,
614
+ fname = this.Class._fullName;
615
+ this._destroyed = true;
616
+ this.element.removeClass(fname);
617
+
618
+ $.each(this._bindings, function( key, value ) {
619
+ if ( $.isFunction(value) ) value(self.element[0]);
620
+ });
621
+
622
+ delete this._actions;
623
+
624
+
625
+ var controllers = this.element.data("controllers");
626
+ if ( controllers && controllers[fname] ) delete controllers[fname];
627
+
628
+ this.element = null;
629
+ },
630
+ /**
631
+ * Queries from the controller's element.
632
+ * @codestart
633
+ * ".destroy_all click" : function() {
634
+ * this.find(".todos").remove();
635
+ * }
636
+ * @codeend
637
+ * @param {String} selector selection string
638
+ * @return {jQuery.fn} returns the matched elements
639
+ */
640
+ find: function( selector ) {
641
+ return this.element.find(selector);
642
+ },
643
+ //tells callback to set called on this. I hate this.
644
+ _set_called: true
645
+ });
646
+
647
+
648
+ //------------- PROCESSSORS -----------------------------
649
+ //processors do the binding. They return a function that
650
+ //unbinds when called.
651
+ //the basic processor that binds events
652
+ var basicProcessor = function( el, event, selector, cb, controller ) {
653
+ var c = controller.Class;
654
+
655
+ // document controllers use their name as an ID prefix.
656
+ if ( c.onDocument && !/^Main(Controller)?$/.test(c.shortName) ) { //prepend underscore name if necessary
657
+ selector = selector ? "#" + c._shortName + " " + selector : "#" + c._shortName
658
+ }
659
+ return binder(el, event, shifter(cb), selector);
660
+ },
661
+ processors = $.Controller.processors,
662
+
663
+ //a window event only happens on the window
664
+ windowEvent = function( el, event, selector, cb ) {
665
+ return binder(window, event.replace(/window/, ""), shifter(cb))
666
+ }
667
+
668
+ //set commong events to be processed as a basicProcessor
669
+ $.each("change click contextmenu dblclick keydown keyup keypress mousedown mousemove mouseout mouseover mouseup reset windowresize resize windowscroll scroll select submit dblclick focusin focusout load unload ready hashchange mouseenter mouseleave".split(" "), function( i, v ) {
670
+ processors[v] = basicProcessor;
671
+ })
672
+ $.each(["windowresize", "windowscroll", "load", "ready", "unload", "hashchange"], function( i, v ) {
673
+ processors[v] = windowEvent;
674
+ })
675
+ //the ready processor happens on the document
676
+ processors.ready = function( el, event, selector, cb ) {
677
+ $(shifter(cb)); //cant really unbind
678
+ }
679
+ /**
680
+ * @add jQuery.fn
681
+ */
682
+
683
+ $.fn.mixin = function() {
684
+ //create a bunch of controllers
685
+ var controllers = $.makeArray(arguments);
686
+ return this.each(function() {
687
+ for ( var i = 0; i < controllers.length; i++ ) {
688
+ new controllers[i](this)
689
+ }
690
+
691
+ })
692
+ }
693
+ //used to determine if a controller instance is one of controllers
694
+ //controllers can be strings or classes
695
+ var isAControllerOf = function( instance, controllers ) {
696
+ for ( var i = 0; i < controllers.length; i++ ) {
697
+ if ( typeof controllers[i] == 'string' ? instance.Class._shortName == controllers[i] : instance instanceof controllers[i] ) {
698
+ return true;
699
+ }
700
+ }
701
+ return false;
702
+ }
703
+ $.fn.
704
+ /**
705
+ * @function controllers
706
+ * Gets all controllers in the jQuery element.
707
+ * @return {Array} an array of controller instances.
708
+ */
709
+ controllers = function() {
710
+ var controllerNames = $.makeArray(arguments),
711
+ instances = [],
712
+ controllers, cname;
713
+ //check if arguments
714
+ this.each(function() {
715
+ controllers = $.data(this, "controllers")
716
+ if (!controllers ) return;
717
+ for ( var cname in controllers ) {
718
+ var c = controllers[cname];
719
+ if (!controllerNames.length || isAControllerOf(c, controllerNames) ) instances.push(c);
720
+ }
721
+ })
722
+ return instances;
723
+ };
724
+ $.fn.
725
+ /**
726
+ * @function controller
727
+ * Gets a controller in the jQuery element. With no arguments, returns the first one found.
728
+ * @param {Object} controller (optional) if exists, the first controller instance with this class type will be returned.
729
+ * @return {jQuery.Controller} the first controller.
730
+ */
731
+ controller = function( controller ) {
732
+ return this.controllers.apply(this, arguments)[0];
733
+ };
734
+
735
+ })