Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes to sample app: upgrading components, Gruntfile, paths for Requi…

…re.js + r.js config etc.
  • Loading branch information...
commit a0f6c5f1ada4339ce55c3b2d5fad258d3e65d1d5 1 parent 532a5ab
Addy Osmani authored
Showing with 25,974 additions and 88 deletions.
  1. +80 −81 cli/samples/todos_spine_requirejs/Gruntfile.js
  2. 0  cli/samples/todos_spine_requirejs/{ → app}/favicon.ico
  3. 0  cli/samples/todos_spine_requirejs/{ → app}/img/.gitignore
  4. 0  cli/samples/todos_spine_requirejs/{ → app}/img/destroy.png
  5. 0  cli/samples/todos_spine_requirejs/{ → app}/img/nyan.gif
  6. +2 −2 cli/samples/todos_spine_requirejs/{ → app}/index.html
  7. +46 −0 cli/samples/todos_spine_requirejs/app/scripts/Task.js
  8. +87 −0 cli/samples/todos_spine_requirejs/app/scripts/TaskApp.js
  9. +70 −0 cli/samples/todos_spine_requirejs/app/scripts/Tasks.js
  10. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/coffee/Task.coffee
  11. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/coffee/TaskApp.coffee
  12. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/coffee/Tasks.coffee
  13. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/coffee/spineModule.js
  14. +8 −0 cli/samples/todos_spine_requirejs/app/scripts/components/jquery/component.json
  15. +9,301 −0 cli/samples/todos_spine_requirejs/app/scripts/components/jquery/jquery.js
  16. +2 −0  cli/samples/todos_spine_requirejs/app/scripts/components/spine/.gitignore
  17. +18 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/Cakefile
  18. +20 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/LICENSE
  19. +11 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/README.md
  20. +21 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/component.json
  21. +1 −0  cli/samples/todos_spine_requirejs/app/scripts/components/spine/index.js
  22. +318 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/ajax.js
  23. +74 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/list.js
  24. +30 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/local.js
  25. +158 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/manager.js
  26. +255 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/relation.js
  27. +220 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/route.js
  28. +913 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/spine.js
  29. +16 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/package.json
  30. +208 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/src/ajax.coffee
  31. +43 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/src/list.coffee
  32. +16 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/src/local.coffee
  33. +83 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/src/manager.coffee
  34. +144 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/src/relation.coffee
  35. +149 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/src/route.coffee
  36. +535 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/src/spine.coffee
  37. +21 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/ajax.html
  38. +28 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/index.html
  39. +20 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/lib/MIT.LICENSE
  40. +166 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/lib/jasmine.css
  41. +188 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/lib/jasmine.html.js
  42. +2,421 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/lib/jasmine.js
  43. +9,046 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/lib/jquery.js
  44. +21 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/manager.html
  45. +22 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/route.html
  46. +197 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/specs/ajax.js
  47. +71 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/specs/class.js
  48. +93 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/specs/controller.js
  49. +94 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/specs/events.js
  50. +79 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/specs/manager.js
  51. +472 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/specs/model.js
  52. +30 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/specs/model.local.js
  53. +67 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/specs/model.relation.js
  54. +102 −0 cli/samples/todos_spine_requirejs/app/scripts/components/spine/test/specs/route.js
  55. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/hm.js
  56. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/hm/fun.hm
  57. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/hm/nyan.hm
  58. +7 −5 cli/samples/todos_spine_requirejs/{js → app/scripts}/main.js
  59. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/plugins.js
  60. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/.jshintrc
  61. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/README.md
  62. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/bootstrap/bootstrap-alert.js
  63. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/bootstrap/bootstrap-button.js
  64. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/bootstrap/bootstrap-carousel.js
  65. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/bootstrap/bootstrap-collapse.js
  66. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/bootstrap/bootstrap-dropdown.js
  67. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/bootstrap/bootstrap-modal.js
  68. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/bootstrap/bootstrap-popover.js
  69. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/bootstrap/bootstrap-scrollspy.js
  70. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/bootstrap/bootstrap-tab.js
  71. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/bootstrap/bootstrap-tooltip.js
  72. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/bootstrap/bootstrap-transition.js
  73. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/bootstrap/bootstrap-typeahead.js
  74. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/cs.js
  75. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/jquery.tmpl.js
  76. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/json2.js
  77. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/modernizr-2.5.3.min.js
  78. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/require.js
  79. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/AUTHORS
  80. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/ChangeLog.txt
  81. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/License.txt
  82. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/README.markdown
  83. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/ReadMe
  84. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/demo.html
  85. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ReadMe
  86. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/af_list
  87. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/af_rules
  88. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ca_list
  89. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ca_rules
  90. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/cs_list
  91. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/cs_rules
  92. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/cy_list
  93. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/cy_rules
  94. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/da_extra
  95. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/da_list
  96. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/da_rules
  97. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/de_list
  98. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/de_rules
  99. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/dict_log
  100. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/dict_phonemes
  101. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/el_list
  102. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/el_rules
  103. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/en_list
  104. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/en_rules
  105. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/eo_list
  106. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/eo_rules
  107. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/es_list
  108. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/es_rules
  109. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/fi_list
  110. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/fi_rules
  111. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/fr_list
  112. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/fr_rules
  113. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/grc_list
  114. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/grc_rules
  115. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/hbs_list
  116. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/hbs_rules
  117. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/hi_list
  118. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/hi_rules
  119. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/hu_list
  120. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/hu_rules
  121. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/hy_list
  122. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/hy_rules
  123. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/id_list
  124. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/id_rules
  125. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/is_list
  126. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/is_rules
  127. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/it_list
  128. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/it_listx
  129. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/it_rules
  130. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/jbo_list
  131. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/jbo_rules
  132. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ka_list
  133. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ka_rules
  134. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/kn_list
  135. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/kn_rules
  136. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ku_list
  137. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ku_rules
  138. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/la_list
  139. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/la_rules
  140. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/lv_list
  141. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/lv_rules
  142. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/mk_list
  143. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/mk_rules
  144. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ml_list
  145. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ml_rules
  146. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/nci_list
  147. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/nci_rules
  148. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/nl_list
  149. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/nl_rules
  150. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/no_list
  151. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/no_rules
  152. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/pap_list
  153. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/pap_rules
  154. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/pl_list
  155. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/pl_rules
  156. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/pt_list
  157. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/pt_rules
  158. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ro_list
  159. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ro_rules
  160. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ru_list
  161. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ru_rules
  162. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/sk_list
  163. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/sk_rules
  164. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/sq_list
  165. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/sq_rules
  166. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/sv_list
  167. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/sv_rules
  168. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/sw_list
  169. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/sw_rules
  170. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ta_list
  171. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/ta_rules
  172. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/tr_list
  173. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/tr_rules
  174. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/vi_list
  175. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/vi_rules
  176. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/zh_list
  177. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/zh_rules
  178. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/dictsource/zhy_rules
  179. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/af_dict
  180. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/ca_dict
  181. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/config
  182. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/cs_dict
  183. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/cy_dict
  184. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/da_dict
  185. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/de_dict
  186. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/el_dict
  187. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/en_dict
  188. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/eo_dict
  189. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/es_dict
  190. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/fi_dict
  191. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/fr_dict
  192. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/grc_dict
  193. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/hbs_dict
  194. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/hi_dict
  195. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/hu_dict
  196. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/hy_dict
  197. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/id_dict
  198. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/intonations
  199. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/is_dict
  200. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/it_dict
  201. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/jbo_dict
  202. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/ka_dict
  203. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/kn_dict
  204. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/ku_dict
  205. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/la_dict
  206. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/lv_dict
  207. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/af1_phtrans
  208. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/ca1_phtrans
  209. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/cr1_phtrans
  210. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/cs_phtrans
  211. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/de2_phtrans
  212. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/de4_phtrans
  213. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/de6_phtrans
  214. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/en1_phtrans
  215. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/es_phtrans
  216. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/fr1_phtrans
  217. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/gr2_phtrans
  218. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/grc-de6_phtrans
  219. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/hu1_phtrans
  220. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/ic1_phtrans
  221. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/id1_phtrans
  222. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/in1_phtrans
  223. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/it3_phtrans
  224. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/la1_phtrans
  225. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/nl_phtrans
  226. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/pl1_phtrans
  227. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/pt1_phtrans
  228. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/pt_phtrans
  229. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/ptbr4_phtrans
  230. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/ptbr_phtrans
  231. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/ro1_phtrans
  232. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/sv2_phtrans
  233. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/sv_phtrans
  234. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/tr1_phtrans
  235. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/us3_phtrans
  236. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mbrola_ph/us_phtrans
  237. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/mk_dict
  238. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/ml_dict
  239. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/nci_dict
  240. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/nl_dict
  241. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/no_dict
  242. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/pap_dict
  243. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/phondata
  244. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/phonindex
  245. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/phontab
  246. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/pl_dict
  247. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/pt_dict
  248. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/ro_dict
  249. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/ru_dict
  250. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/sk_dict
  251. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/sq_dict
  252. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/sv_dict
  253. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/sw_dict
  254. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/ta_dict
  255. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/tr_dict
  256. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/vi_dict
  257. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/croak
  258. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/f1
  259. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/f2
  260. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/f3
  261. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/f4
  262. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/f5
  263. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/klatt
  264. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/klatt2
  265. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/klatt3
  266. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/m1
  267. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/m2
  268. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/m3
  269. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/m4
  270. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/m5
  271. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/m6
  272. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/m7
  273. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/whisper
  274. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/!v/whisperf
  275. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/af
  276. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/bs
  277. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/ca
  278. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/cs
  279. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/cy
  280. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/da
  281. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/de
  282. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/default
  283. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/el
  284. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/en/en
  285. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/en/en-n
  286. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/en/en-rp
  287. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/en/en-sc
  288. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/en/en-us
  289. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/en/en-wi
  290. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/en/en-wm
  291. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/eo
  292. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/es
  293. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/es-la
  294. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/fi
  295. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/fr
  296. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/fr-be
  297. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/hi
  298. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/hr
  299. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/hu
  300. 0  cli/samples/todos_spine_requirejs/{js → app/scripts}/vendor/speak/espeak-data/voices/hy
Sorry, we could not display the entire diff because too many files (558) changed.
View
161 cli/samples/todos_spine_requirejs/Gruntfile.js
@@ -1,5 +1,5 @@
-module.exports = function(grunt) {
-
+module.exports = function( grunt ) {
+ 'use strict';
//
// Grunt configuration:
//
@@ -10,33 +10,30 @@ module.exports = function(grunt) {
// Project configuration
// ---------------------
- // pull in package.json data
- pkg: '<json:package.json>',
- // and build banner from these information
- meta: {
- banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
- '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
- '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
- '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
- ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
+ // specify an alternate install location for Bower
+ bower: {
+ dir: 'app/scripts/vendor'
},
- // Dev utilities and configuration
- // -------------------------------
-
- // coffee to js compilation
+ // Coffee to JS compilation
coffee: {
dist: {
- src: 'js/**/*.coffee',
- dest: 'js'
+ src: 'app/scripts/**/*.coffee',
+ dest: 'app/scripts'
}
},
- // compass compile
- // https://github.com/sindresorhus/grunt-shell#grunt-shell
- shell: {
- compass: {
- command: 'compass compile'
+ // compile .scss/.sass to .css using Compass
+ compass: {
+ dist: {
+ // http://compass-style.org/help/tutorials/configuration-reference/#configuration-properties
+ options: {
+ css_dir: 'temp/styles',
+ sass_dir: 'app/styles',
+ images_dir: 'app/images',
+ javascripts_dir: 'temp/scripts',
+ force: true
+ }
}
},
@@ -45,9 +42,8 @@ module.exports = function(grunt) {
dest: ''
},
- // Jasmine headless test through PhantomJS
- // > https://github.com/creynders/grunt-jasmine-task
- jasmine: {
+ // headless testing through PhantomJS
+ mocha: {
all: ['test/**/*.html']
},
@@ -55,24 +51,33 @@ module.exports = function(grunt) {
watch: {
coffee: {
files: '<config:coffee.dist.src>',
- tasks: 'coffee'
+ tasks: 'coffee reload'
},
compass: {
- files: ['css/**/*.sass', 'css/**/*.scss'],
- tasks: 'shell:compass'
+ files: [
+ 'app/styles/**/*.{scss,sass}'
+ ],
+ tasks: 'compass reload'
},
- // only used with `yeoman server`
reload: {
- files: ['css/**/*.css', 'js/**/*.js', 'img/**/*'],
+ files: [
+ 'app/*.html',
+ 'app/styles/**/*.css',
+ 'app/scripts/**/*.js',
+ 'app/images/**/*'
+ ],
tasks: 'reload'
}
},
-
// default lint configuration, change this to match your setup:
// https://github.com/cowboy/grunt/blob/master/docs/task_lint.md#lint-built-in-task
lint: {
- files: ['grunt.js', 'js/**/*.js', 'test/**/*.js']
+ files: [
+ 'Gruntfile.js',
+ 'app/scripts/**/*.js',
+ 'spec/**/*.js'
+ ]
},
// specifying JSHint options and globals
@@ -99,38 +104,46 @@ module.exports = function(grunt) {
// Build configuration
// -------------------
- // the staging directory used during the process
- staging: 'intermediate',
+ // the staging directory used during the process
+ staging: 'temp',
// final build output
- output: 'publish',
+ output: 'dist',
- // filter any files matching one of the below pattern during mkdirs task
- // the pattern in the .gitignore file should work too.
- exclude: '.git* build/** node_modules/** grunt.js package.json *.md css/sass/'.split(' '),
mkdirs: {
- staging: '<config:exclude>'
+ staging: 'app/'
},
+ // Below, all paths are relative to the staging directory, which is a copy
+ // of the app/ directory. Any .gitignore, .ignore and .buildignore file
+ // that might appear in the app/ tree are used to ignore these values
+ // during the copy process.
+
// concat css/**/*.css files, inline @import, output a single minified css
css: {
- 'css/style.css': ['css/**/*.css']
+ 'styles/main.css': ['styles/**/*.css']
},
- // Renames JS/CSS to prepend a hash of their contents for easier
+ // renames JS/CSS to prepend a hash of their contents for easier
// versioning
rev: {
- js: 'js/**/*.js',
- css: 'css/**/*.css',
- img: 'img/**'
+ js: 'scripts/**/*.js',
+ css: 'styles/**/*.css',
+ img: 'images/**'
},
- // update references in html to revved files
+ // usemin handler should point to the file containing
+ // the usemin blocks to be parsed
+ 'usemin-handler': {
+ html: 'index.html'
+ },
+
+ // update references in HTML/CSS to revved files
usemin: {
html: ['**/*.html'],
css: ['**/*.css']
},
- // html minification
+ // HTML minification
html: {
files: ['**/*.html']
},
@@ -140,47 +153,33 @@ module.exports = function(grunt) {
dist: '<config:rev.img>'
},
- // default concat configuration, change this to match your setup:
- // https://github.com/cowboy/grunt/blob/master/docs/task_concat.md
- concat: {
- dist: {
- src: ['js/plugins.js', 'js/vendor/bootstrap-*.js', 'js/main.js'],
- dest: 'js/<%= pkg.name %>-<%= pkg.version %>.js'
- }
- },
-
- // default min configuration, change this to match your setup:
- // https://github.com/cowboy/grunt/blob/master/docs/task_min.md
- min: {
- dist: {
- src: 'js/<%= pkg.name %>-<%= pkg.version %>.js',
- dest: 'js/main.js'
- }
+ // rjs configuration. You don't necessarily need to specify the typical
+ // `path` configuration, the rjs task will parse these values from your
+ // main module, using http://requirejs.org/docs/optimization.html#mainConfigFile
+ //
+ // name / out / mainConfig file should be used. You can let it blank if
+ // you're using usemin-handler to parse rjs config from markup (default
+ // setup)
+ rjs: {
+ // no minification, is done by the min task
+ optimize: 'none',
+ baseUrl: './scripts',
+ dir: './scripts',
+ wrap: true
},
- rjs: {
- modules: [{
- name: 'main',
- }],
- dir: 'js',
- appDir: 'js',
- baseUrl: './',
- pragmas: {
- doExclude: true
- },
- skipModuleInsertion: false,
- optimizeAllPluginResources: true,
- findNestedDependencies: true
+ // While Yeoman handles concat/min when using
+ // usemin blocks, you can still use them manually
+ concat: {
+ dist: ''
},
- // specifying UglifyJS options:
- // https://github.com/cowboy/grunt/blob/master/docs/task_min.md#specifying-uglifyjs-options
- uglify: {}
+ min: {
+ dist: ''
+ }
});
-
-
- // Alias the `test` task to run the `jasmine` task instead
+ // Alias the `test` task to run the `mocha` task instead
grunt.registerTask('test', 'jasmine');
};
View
0  cli/samples/todos_spine_requirejs/favicon.ico → cli/samples/todos_spine_requirejs/app/favicon.ico
File renamed without changes
View
0  cli/samples/todos_spine_requirejs/img/.gitignore → cli/samples/todos_spine_requirejs/app/img/.gitignore
File renamed without changes
View
0  cli/samples/todos_spine_requirejs/img/destroy.png → ...samples/todos_spine_requirejs/app/img/destroy.png
File renamed without changes
View
0  cli/samples/todos_spine_requirejs/img/nyan.gif → cli/samples/todos_spine_requirejs/app/img/nyan.gif
File renamed without changes
View
4 cli/samples/todos_spine_requirejs/index.html → cli/samples/todos_spine_requirejs/app/index.html
@@ -3,9 +3,9 @@
<head>
<title>Todos</title>
- <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8">
+ <link rel="stylesheet" href="styles/style.css" type="text/css" charset="utf-8">
- <script src="js/vendor/require.js" type="text/javascript" data-main="js/main" ></script>
+ <script src="scripts/vendor/require.js" type="text/javascript" data-main="scripts/main" ></script>
<!-- switch to underscore templating, handlebars or something else soon -->
<script type="text/x-jquery-tmpl" id="taskTemplate">
View
46 cli/samples/todos_spine_requirejs/app/scripts/Task.js
@@ -0,0 +1,46 @@
+var __hasProp = {}.hasOwnProperty,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+define(function(require, exports, module) {
+ var Spine, Task;
+ module.exports = Task;
+ Spine = require("coffee/spineModule");
+ return Task = (function(_super) {
+
+ __extends(Task, _super);
+
+ function Task() {
+ return Task.__super__.constructor.apply(this, arguments);
+ }
+
+ Task.configure("Task", "name", "done");
+
+ Task.extend(Spine.Model.Local);
+
+ Task.active = function() {
+ return this.select(function(item) {
+ return !item.done;
+ });
+ };
+
+ Task.done = function() {
+ return this.select(function(item) {
+ return !!item.done;
+ });
+ };
+
+ Task.destroyDone = function() {
+ var rec, _i, _len, _ref, _results;
+ _ref = this.done();
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ rec = _ref[_i];
+ _results.push(rec.destroy());
+ }
+ return _results;
+ };
+
+ return Task;
+
+ })(Spine.Model);
+});
View
87 cli/samples/todos_spine_requirejs/app/scripts/TaskApp.js
@@ -0,0 +1,87 @@
+var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ __hasProp = {}.hasOwnProperty,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+define(function(require, exports, module) {
+ var Fun, MyManager, MyStack, Spine, Task, TaskApp, Tasks, jQuery;
+ module.exports = TaskApp;
+ Spine = require("coffee/spineModule");
+ Task = require("cs!coffee/Task");
+ Tasks = require("cs!coffee/Tasks");
+ Fun = require("hm!hm/fun");
+ jQuery = require("jquery");
+ MyManager = new Spine.Manager();
+ try {
+ MyStack = new Spine.Stack();
+ } catch (error) {
+ console.log(error);
+ }
+ return TaskApp = (function(_super) {
+
+ __extends(TaskApp, _super);
+
+ TaskApp.prototype.events = {
+ "submit form": "create",
+ "click .clear": "clear"
+ };
+
+ TaskApp.prototype.elements = {
+ ".items": "items",
+ ".countVal": "count",
+ ".clear": "cleared",
+ "form input": "input"
+ };
+
+ function TaskApp() {
+ this.renderCount = __bind(this.renderCount, this);
+
+ this.addAll = __bind(this.addAll, this);
+
+ this.addOne = __bind(this.addOne, this);
+ TaskApp.__super__.constructor.apply(this, arguments);
+ Task.bind("create", this.addOne);
+ Task.bind("refresh", this.addAll);
+ Task.bind("refresh change", this.renderCount);
+ Task.fetch();
+ }
+
+ TaskApp.prototype.addOne = function(task) {
+ var view;
+ view = new Tasks({
+ item: task
+ });
+ return this.items.append(view.render().el);
+ };
+
+ TaskApp.prototype.addAll = function() {
+ return Task.each(this.addOne);
+ };
+
+ TaskApp.prototype.clear = function() {
+ return Task.destroyDone();
+ };
+
+ TaskApp.prototype.create = function(e) {
+ e.preventDefault();
+ Task.create({
+ name: this.input.val()
+ });
+ return this.input.val("");
+ };
+
+ TaskApp.prototype.renderCount = function() {
+ var active, inactive;
+ active = Task.active().length;
+ this.count.text(active);
+ inactive = Task.done().length;
+ if (inactive) {
+ return this.cleared.show();
+ } else {
+ return this.cleared.hide();
+ }
+ };
+
+ return TaskApp;
+
+ })(Spine.Controller);
+});
View
70 cli/samples/todos_spine_requirejs/app/scripts/Tasks.js
@@ -0,0 +1,70 @@
+var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ __hasProp = {}.hasOwnProperty,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+define(function(require, exports, module) {
+ var Spine, Task, Tasks, jQuery, tmpl;
+ module.exports = Tasks;
+ Spine = require("coffee/spineModule");
+ Task = require("cs!coffee/Task");
+ jQuery = require("jquery");
+ tmpl = require("tmpl");
+ return Tasks = (function(_super) {
+
+ __extends(Tasks, _super);
+
+ Tasks.prototype.events = {
+ "change input[type=checkbox]": "toggle",
+ "click .destroy": "remove",
+ "dblclick .view": "edit",
+ "keypress input[type=text]": "blurOnEnter",
+ "blur input[type=text]": "close"
+ };
+
+ Tasks.prototype.elements = {
+ "input[type=text]": "input"
+ };
+
+ function Tasks() {
+ this.render = __bind(this.render, this);
+ Tasks.__super__.constructor.apply(this, arguments);
+ this.item.bind("update", this.render);
+ this.item.bind("destroy", this.release);
+ }
+
+ Tasks.prototype.render = function() {
+ this.replace(jQuery("#taskTemplate").tmpl(this.item));
+ return this;
+ };
+
+ Tasks.prototype.toggle = function() {
+ this.item.done = !this.item.done;
+ return this.item.save();
+ };
+
+ Tasks.prototype.remove = function() {
+ return this.item.destroy();
+ };
+
+ Tasks.prototype.edit = function() {
+ this.el.addClass("editing");
+ return this.input.focus();
+ };
+
+ Tasks.prototype.blurOnEnter = function(e) {
+ if (e.keyCode === 13) {
+ return e.target.blur();
+ }
+ };
+
+ Tasks.prototype.close = function() {
+ this.el.removeClass("editing");
+ return this.item.updateAttributes({
+ name: this.input.val()
+ });
+ };
+
+ return Tasks;
+
+ })(Spine.Controller);
+});
View
0  ...mples/todos_spine_requirejs/js/coffee/Task.coffee → ...os_spine_requirejs/app/scripts/coffee/Task.coffee
File renamed without changes
View
0  ...es/todos_spine_requirejs/js/coffee/TaskApp.coffee → ...spine_requirejs/app/scripts/coffee/TaskApp.coffee
File renamed without changes
View
0  ...ples/todos_spine_requirejs/js/coffee/Tasks.coffee → ...s_spine_requirejs/app/scripts/coffee/Tasks.coffee
File renamed without changes
View
0  ...es/todos_spine_requirejs/js/coffee/spineModule.js → ...spine_requirejs/app/scripts/coffee/spineModule.js
File renamed without changes
View
8 cli/samples/todos_spine_requirejs/app/scripts/components/jquery/component.json
@@ -0,0 +1,8 @@
+{
+ "name" : "jquery",
+ "version" : "1.8.1",
+ "main" : "./jquery.js",
+ "dependencies": {
+ }
+}
+
View
9,301 cli/samples/todos_spine_requirejs/app/scripts/components/jquery/jquery.js
9,301 additions, 0 deletions not shown
View
2  cli/samples/todos_spine_requirejs/app/scripts/components/spine/.gitignore
@@ -0,0 +1,2 @@
+.DS_Store
+node_modules
View
18 cli/samples/todos_spine_requirejs/app/scripts/components/spine/Cakefile
@@ -0,0 +1,18 @@
+{print} = require 'util'
+{spawn} = require 'child_process'
+
+task 'build', 'Build lib/ from src/', ->
+ coffee = spawn 'coffee', ['-c', '-o', 'lib', 'src']
+ coffee.stderr.on 'data', (data) ->
+ process.stderr.write data.toString()
+ coffee.stdout.on 'data', (data) ->
+ print data.toString()
+ coffee.on 'exit', (code) ->
+ callback?() if code is 0
+
+task 'watch', 'Watch src/ for changes', ->
+ coffee = spawn 'coffee', ['-w', '-c', '-o', 'lib', 'src']
+ coffee.stderr.on 'data', (data) ->
+ process.stderr.write data.toString()
+ coffee.stdout.on 'data', (data) ->
+ print data.toString()
View
20 cli/samples/todos_spine_requirejs/app/scripts/components/spine/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2011 Alex MacCaw (info@eribium.org)
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
11 cli/samples/todos_spine_requirejs/app/scripts/components/spine/README.md
@@ -0,0 +1,11 @@
+# Spine
+
+Spine is a lightweight framework for building JavaScript web applications. Spine gives you an MVC structure and then gets out of your way, allowing you to concentrate on the fun stuff, building awesome web applications.
+
+Spine is opinionated in its approach to web application architecture and design. Spine's architecture complements patterns such as de-coupled components and CommonJS modules, markedly helping with code quality and maintainability.
+
+The library is written in [CoffeeScript](http://jashkenas.github.com/coffee-script), but doesn't necessarily require CoffeeScript to develop applications - you can use whichever language you're most familiar with.
+
+Spine is tiny, the library comes in at around 500 lines of CoffeeScript. Being lightweight and simple is fundamental to Spine.
+
+For documentation, usage, and examples, see: [spinejs.com](http://spinejs.com)
View
21 cli/samples/todos_spine_requirejs/app/scripts/components/spine/component.json
@@ -0,0 +1,21 @@
+{
+ "name": "spine",
+ "description": "MVC Framework.",
+ "version": "1.0.8",
+ "author": {
+ "name": "maccman"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://github.com/maccman/spine/blob/master/LICENSE"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/maccman/spine.git"
+ },
+ "main": "./index.js",
+ "readme": "# Spine\n\nSpine is a lightweight framework for building JavaScript web applications. Spine gives you an MVC structure and then gets out of your way, allowing you to concentrate on the fun stuff, building awesome web applications.\n\nSpine is opinionated in its approach to web application architecture and design. Spine's architecture complements patterns such as de-coupled components and CommonJS modules, markedly helping with code quality and maintainability.\n\nThe library is written in [CoffeeScript](http://jashkenas.github.com/coffee-script), but doesn't necessarily require CoffeeScript to develop applications - you can use whichever language you're most familiar with.\n\nSpine is tiny, the library comes in at around 500 lines of CoffeeScript. Being lightweight and simple is fundamental to Spine.\n\nFor documentation, usage, and examples, see: [spinejs.com](http://spinejs.com)",
+ "_id": "spine@1.0.8"
+}
View
1  cli/samples/todos_spine_requirejs/app/scripts/components/spine/index.js
@@ -0,0 +1 @@
+module.exports = require('./lib/spine');
View
318 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/ajax.js
@@ -0,0 +1,318 @@
+// Generated by CoffeeScript 1.3.3
+(function() {
+ var $, Ajax, Base, Collection, Extend, Include, Model, Singleton, Spine,
+ __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ __hasProp = {}.hasOwnProperty,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ __slice = [].slice;
+
+ Spine = this.Spine || require('spine');
+
+ $ = Spine.$;
+
+ Model = Spine.Model;
+
+ Ajax = {
+ getURL: function(object) {
+ return object && (typeof object.url === "function" ? object.url() : void 0) || object.url;
+ },
+ enabled: true,
+ pending: false,
+ requests: [],
+ disable: function(callback) {
+ if (this.enabled) {
+ this.enabled = false;
+ try {
+ return callback();
+ } catch (e) {
+ throw e;
+ } finally {
+ this.enabled = true;
+ }
+ } else {
+ return callback();
+ }
+ },
+ requestNext: function() {
+ var next;
+ next = this.requests.shift();
+ if (next) {
+ return this.request(next);
+ } else {
+ return this.pending = false;
+ }
+ },
+ request: function(callback) {
+ var _this = this;
+ return (callback()).complete(function() {
+ return _this.requestNext();
+ });
+ },
+ queue: function(callback) {
+ if (!this.enabled) {
+ return;
+ }
+ if (this.pending) {
+ this.requests.push(callback);
+ } else {
+ this.pending = true;
+ this.request(callback);
+ }
+ return callback;
+ }
+ };
+
+ Base = (function() {
+
+ function Base() {}
+
+ Base.prototype.defaults = {
+ contentType: 'application/json',
+ dataType: 'json',
+ processData: false,
+ headers: {
+ 'X-Requested-With': 'XMLHttpRequest'
+ }
+ };
+
+ Base.prototype.ajax = function(params, defaults) {
+ return $.ajax($.extend({}, this.defaults, defaults, params));
+ };
+
+ Base.prototype.queue = function(callback) {
+ return Ajax.queue(callback);
+ };
+
+ return Base;
+
+ })();
+
+ Collection = (function(_super) {
+
+ __extends(Collection, _super);
+
+ function Collection(model) {
+ this.model = model;
+ this.errorResponse = __bind(this.errorResponse, this);
+
+ this.recordsResponse = __bind(this.recordsResponse, this);
+
+ }
+
+ Collection.prototype.find = function(id, params) {
+ var record;
+ record = new this.model({
+ id: id
+ });
+ return this.ajax(params, {
+ type: 'GET',
+ url: Ajax.getURL(record)
+ }).success(this.recordsResponse).error(this.errorResponse);
+ };
+
+ Collection.prototype.all = function(params) {
+ return this.ajax(params, {
+ type: 'GET',
+ url: Ajax.getURL(this.model)
+ }).success(this.recordsResponse).error(this.errorResponse);
+ };
+
+ Collection.prototype.fetch = function(params, options) {
+ var id,
+ _this = this;
+ if (params == null) {
+ params = {};
+ }
+ if (options == null) {
+ options = {};
+ }
+ if (id = params.id) {
+ delete params.id;
+ return this.find(id, params).success(function(record) {
+ return _this.model.refresh(record, options);
+ });
+ } else {
+ return this.all(params).success(function(records) {
+ return _this.model.refresh(records, options);
+ });
+ }
+ };
+
+ Collection.prototype.recordsResponse = function(data, status, xhr) {
+ return this.model.trigger('ajaxSuccess', null, status, xhr);
+ };
+
+ Collection.prototype.errorResponse = function(xhr, statusText, error) {
+ return this.model.trigger('ajaxError', null, xhr, statusText, error);
+ };
+
+ return Collection;
+
+ })(Base);
+
+ Singleton = (function(_super) {
+
+ __extends(Singleton, _super);
+
+ function Singleton(record) {
+ this.record = record;
+ this.errorResponse = __bind(this.errorResponse, this);
+
+ this.recordResponse = __bind(this.recordResponse, this);
+
+ this.model = this.record.constructor;
+ }
+
+ Singleton.prototype.reload = function(params, options) {
+ var _this = this;
+ return this.queue(function() {
+ return _this.ajax(params, {
+ type: 'GET',
+ url: Ajax.getURL(_this.record)
+ }).success(_this.recordResponse(options)).error(_this.errorResponse(options));
+ });
+ };
+
+ Singleton.prototype.create = function(params, options) {
+ var _this = this;
+ return this.queue(function() {
+ return _this.ajax(params, {
+ type: 'POST',
+ data: JSON.stringify(_this.record),
+ url: Ajax.getURL(_this.model)
+ }).success(_this.recordResponse(options)).error(_this.errorResponse(options));
+ });
+ };
+
+ Singleton.prototype.update = function(params, options) {
+ var _this = this;
+ return this.queue(function() {
+ return _this.ajax(params, {
+ type: 'PUT',
+ data: JSON.stringify(_this.record),
+ url: Ajax.getURL(_this.record)
+ }).success(_this.recordResponse(options)).error(_this.errorResponse(options));
+ });
+ };
+
+ Singleton.prototype.destroy = function(params, options) {
+ var _this = this;
+ return this.queue(function() {
+ return _this.ajax(params, {
+ type: 'DELETE',
+ url: Ajax.getURL(_this.record)
+ }).success(_this.recordResponse(options)).error(_this.errorResponse(options));
+ });
+ };
+
+ Singleton.prototype.recordResponse = function(options) {
+ var _this = this;
+ if (options == null) {
+ options = {};
+ }
+ return function(data, status, xhr) {
+ var _ref;
+ if (Spine.isBlank(data)) {
+ data = false;
+ } else {
+ data = _this.model.fromJSON(data);
+ }
+ Ajax.disable(function() {
+ if (data) {
+ if (data.id && _this.record.id !== data.id) {
+ _this.record.changeID(data.id);
+ }
+ return _this.record.updateAttributes(data.attributes());
+ }
+ });
+ _this.record.trigger('ajaxSuccess', data, status, xhr);
+ return (_ref = options.success) != null ? _ref.apply(_this.record) : void 0;
+ };
+ };
+
+ Singleton.prototype.errorResponse = function(options) {
+ var _this = this;
+ if (options == null) {
+ options = {};
+ }
+ return function(xhr, statusText, error) {
+ var _ref;
+ _this.record.trigger('ajaxError', xhr, statusText, error);
+ return (_ref = options.error) != null ? _ref.apply(_this.record) : void 0;
+ };
+ };
+
+ return Singleton;
+
+ })(Base);
+
+ Model.host = '';
+
+ Include = {
+ ajax: function() {
+ return new Singleton(this);
+ },
+ url: function() {
+ var args, url;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ url = Ajax.getURL(this.constructor);
+ if (url.charAt(url.length - 1) !== '/') {
+ url += '/';
+ }
+ url += encodeURIComponent(this.id);
+ args.unshift(url);
+ return args.join('/');
+ }
+ };
+
+ Extend = {
+ ajax: function() {
+ return new Collection(this);
+ },
+ url: function() {
+ var args;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ args.unshift(this.className.toLowerCase() + 's');
+ args.unshift(Model.host);
+ return args.join('/');
+ }
+ };
+
+ Model.Ajax = {
+ extended: function() {
+ this.fetch(this.ajaxFetch);
+ this.change(this.ajaxChange);
+ this.extend(Extend);
+ return this.include(Include);
+ },
+ ajaxFetch: function() {
+ var _ref;
+ return (_ref = this.ajax()).fetch.apply(_ref, arguments);
+ },
+ ajaxChange: function(record, type, options) {
+ if (options == null) {
+ options = {};
+ }
+ if (options.ajax === false) {
+ return;
+ }
+ return record.ajax()[type](options.ajax, options);
+ }
+ };
+
+ Model.Ajax.Methods = {
+ extended: function() {
+ this.extend(Extend);
+ return this.include(Include);
+ }
+ };
+
+ Ajax.defaults = Base.prototype.defaults;
+
+ Spine.Ajax = Ajax;
+
+ if (typeof module !== "undefined" && module !== null) {
+ module.exports = Ajax;
+ }
+
+}).call(this);
View
74 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/list.js
@@ -0,0 +1,74 @@
+// Generated by CoffeeScript 1.3.3
+(function() {
+ var $, Spine,
+ __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+ __hasProp = {}.hasOwnProperty,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+ Spine = this.Spine || require('spine');
+
+ $ = Spine.$;
+
+ Spine.List = (function(_super) {
+
+ __extends(List, _super);
+
+ List.prototype.events = {
+ 'click .item': 'click'
+ };
+
+ List.prototype.selectFirst = false;
+
+ function List() {
+ this.change = __bind(this.change, this);
+ List.__super__.constructor.apply(this, arguments);
+ this.bind('change', this.change);
+ }
+
+ List.prototype.template = function() {
+ throw 'Override template';
+ };
+
+ List.prototype.change = function(item) {
+ this.current = item;
+ if (!this.current) {
+ this.children().removeClass('active');
+ return;
+ }
+ this.children().removeClass('active');
+ return $(this.children().get(this.items.indexOf(this.current))).addClass('active');
+ };
+
+ List.prototype.render = function(items) {
+ if (items) {
+ this.items = items;
+ }
+ this.html(this.template(this.items));
+ this.change(this.current);
+ if (this.selectFirst) {
+ if (!this.children('.active').length) {
+ return this.children(':first').click();
+ }
+ }
+ };
+
+ List.prototype.children = function(sel) {
+ return this.el.children(sel);
+ };
+
+ List.prototype.click = function(e) {
+ var item;
+ item = this.items[$(e.currentTarget).index()];
+ this.trigger('change', item);
+ return true;
+ };
+
+ return List;
+
+ })(Spine.Controller);
+
+ if (typeof module !== "undefined" && module !== null) {
+ module.exports = Spine.List;
+ }
+
+}).call(this);
View
30 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/local.js
@@ -0,0 +1,30 @@
+// Generated by CoffeeScript 1.3.3
+(function() {
+ var Spine;
+
+ Spine = this.Spine || require('spine');
+
+ Spine.Model.Local = {
+ extended: function() {
+ this.change(this.saveLocal);
+ return this.fetch(this.loadLocal);
+ },
+ saveLocal: function() {
+ var result;
+ result = JSON.stringify(this);
+ return localStorage[this.className] = result;
+ },
+ loadLocal: function() {
+ var result;
+ result = localStorage[this.className];
+ return this.refresh(result || [], {
+ clear: true
+ });
+ }
+ };
+
+ if (typeof module !== "undefined" && module !== null) {
+ module.exports = Spine.Model.Local;
+ }
+
+}).call(this);
View
158 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/manager.js
@@ -0,0 +1,158 @@
+// Generated by CoffeeScript 1.3.3
+(function() {
+ var $, Spine,
+ __hasProp = {}.hasOwnProperty,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ __slice = [].slice;
+
+ Spine = this.Spine || require('spine');
+
+ $ = Spine.$;
+
+ Spine.Manager = (function(_super) {
+
+ __extends(Manager, _super);
+
+ Manager.include(Spine.Events);
+
+ function Manager() {
+ this.controllers = [];
+ this.bind('change', this.change);
+ this.add.apply(this, arguments);
+ }
+
+ Manager.prototype.add = function() {
+ var cont, controllers, _i, _len, _results;
+ controllers = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ _results = [];
+ for (_i = 0, _len = controllers.length; _i < _len; _i++) {
+ cont = controllers[_i];
+ _results.push(this.addOne(cont));
+ }
+ return _results;
+ };
+
+ Manager.prototype.addOne = function(controller) {
+ var _this = this;
+ controller.bind('active', function() {
+ var args;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ return _this.trigger.apply(_this, ['change', controller].concat(__slice.call(args)));
+ });
+ controller.bind('release', function() {
+ return _this.controllers.splice(_this.controllers.indexOf(controller), 1);
+ });
+ return this.controllers.push(controller);
+ };
+
+ Manager.prototype.deactivate = function() {
+ return this.trigger.apply(this, ['change', false].concat(__slice.call(arguments)));
+ };
+
+ Manager.prototype.change = function() {
+ var args, cont, current, _i, _len, _ref, _results;
+ current = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ _ref = this.controllers;
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ cont = _ref[_i];
+ if (cont === current) {
+ _results.push(cont.activate.apply(cont, args));
+ } else {
+ _results.push(cont.deactivate.apply(cont, args));
+ }
+ }
+ return _results;
+ };
+
+ return Manager;
+
+ })(Spine.Module);
+
+ Spine.Controller.include({
+ active: function() {
+ var args;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ if (typeof args[0] === 'function') {
+ this.bind('active', args[0]);
+ } else {
+ args.unshift('active');
+ this.trigger.apply(this, args);
+ }
+ return this;
+ },
+ isActive: function() {
+ return this.el.hasClass('active');
+ },
+ activate: function() {
+ this.el.addClass('active');
+ return this;
+ },
+ deactivate: function() {
+ this.el.removeClass('active');
+ return this;
+ }
+ });
+
+ Spine.Stack = (function(_super) {
+
+ __extends(Stack, _super);
+
+ Stack.prototype.controllers = {};
+
+ Stack.prototype.routes = {};
+
+ Stack.prototype.className = 'spine stack';
+
+ function Stack() {
+ var key, value, _fn, _ref, _ref1,
+ _this = this;
+ Stack.__super__.constructor.apply(this, arguments);
+ this.manager = new Spine.Manager;
+ _ref = this.controllers;
+ for (key in _ref) {
+ value = _ref[key];
+ this[key] = new value({
+ stack: this
+ });
+ this.add(this[key]);
+ }
+ _ref1 = this.routes;
+ _fn = function(key, value) {
+ var callback;
+ if (typeof value === 'function') {
+ callback = value;
+ }
+ callback || (callback = function() {
+ var _ref2;
+ return (_ref2 = _this[value]).active.apply(_ref2, arguments);
+ });
+ return _this.route(key, callback);
+ };
+ for (key in _ref1) {
+ value = _ref1[key];
+ _fn(key, value);
+ }
+ if (this["default"]) {
+ this[this["default"]].active();
+ }
+ }
+
+ Stack.prototype.add = function(controller) {
+ this.manager.add(controller);
+ return this.append(controller);
+ };
+
+ return Stack;
+
+ })(Spine.Controller);
+
+ if (typeof module !== "undefined" && module !== null) {
+ module.exports = Spine.Manager;
+ }
+
+ if (typeof module !== "undefined" && module !== null) {
+ module.exports.Stack = Spine.Stack;
+ }
+
+}).call(this);
View
255 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/relation.js
@@ -0,0 +1,255 @@
+// Generated by CoffeeScript 1.3.3
+(function() {
+ var Collection, Instance, Singleton, Spine, isArray, require, singularize, underscore,
+ __hasProp = {}.hasOwnProperty,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+ Spine = this.Spine || require('spine');
+
+ isArray = Spine.isArray;
+
+ require = this.require || (function(value) {
+ return eval(value);
+ });
+
+ Collection = (function(_super) {
+
+ __extends(Collection, _super);
+
+ function Collection(options) {
+ var key, value;
+ if (options == null) {
+ options = {};
+ }
+ for (key in options) {
+ value = options[key];
+ this[key] = value;
+ }
+ }
+
+ Collection.prototype.all = function() {
+ var _this = this;
+ return this.model.select(function(rec) {
+ return _this.associated(rec);
+ });
+ };
+
+ Collection.prototype.first = function() {
+ return this.all()[0];
+ };
+
+ Collection.prototype.last = function() {
+ var values;
+ values = this.all();
+ return values[values.length - 1];
+ };
+
+ Collection.prototype.find = function(id) {
+ var records,
+ _this = this;
+ records = this.select(function(rec) {
+ return rec.id + '' === id + '';
+ });
+ if (!records[0]) {
+ throw 'Unknown record';
+ }
+ return records[0];
+ };
+
+ Collection.prototype.findAllByAttribute = function(name, value) {
+ var _this = this;
+ return this.model.select(function(rec) {
+ return _this.associated(rec) && rec[name] === value;
+ });
+ };
+
+ Collection.prototype.findByAttribute = function(name, value) {
+ return this.findAllByAttribute(name, value)[0];
+ };
+
+ Collection.prototype.select = function(cb) {
+ var _this = this;
+ return this.model.select(function(rec) {
+ return _this.associated(rec) && cb(rec);
+ });
+ };
+
+ Collection.prototype.refresh = function(values) {
+ var record, records, _i, _j, _len, _len1, _ref;
+ _ref = this.all();
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ record = _ref[_i];
+ delete this.model.records[record.id];
+ }
+ records = this.model.fromJSON(values);
+ if (!isArray(records)) {
+ records = [records];
+ }
+ for (_j = 0, _len1 = records.length; _j < _len1; _j++) {
+ record = records[_j];
+ record.newRecord = false;
+ record[this.fkey] = this.record.id;
+ this.model.records[record.id] = record;
+ }
+ return this.model.trigger('refresh', this.model.cloneArray(records));
+ };
+
+ Collection.prototype.create = function(record) {
+ record[this.fkey] = this.record.id;
+ return this.model.create(record);
+ };
+
+ Collection.prototype.associated = function(record) {
+ return record[this.fkey] === this.record.id;
+ };
+
+ return Collection;
+
+ })(Spine.Module);
+
+ Instance = (function(_super) {
+
+ __extends(Instance, _super);
+
+ function Instance(options) {
+ var key, value;
+ if (options == null) {
+ options = {};
+ }
+ for (key in options) {
+ value = options[key];
+ this[key] = value;
+ }
+ }
+
+ Instance.prototype.exists = function() {
+ return this.record[this.fkey] && this.model.exists(this.record[this.fkey]);
+ };
+
+ Instance.prototype.update = function(value) {
+ if (!(value instanceof this.model)) {
+ value = new this.model(value);
+ }
+ if (value.isNew()) {
+ value.save();
+ }
+ return this.record[this.fkey] = value && value.id;
+ };
+
+ return Instance;
+
+ })(Spine.Module);
+
+ Singleton = (function(_super) {
+
+ __extends(Singleton, _super);
+
+ function Singleton(options) {
+ var key, value;
+ if (options == null) {
+ options = {};
+ }
+ for (key in options) {
+ value = options[key];
+ this[key] = value;
+ }
+ }
+
+ Singleton.prototype.find = function() {
+ return this.record.id && this.model.findByAttribute(this.fkey, this.record.id);
+ };
+
+ Singleton.prototype.update = function(value) {
+ if (!(value instanceof this.model)) {
+ value = this.model.fromJSON(value);
+ }
+ value[this.fkey] = this.record.id;
+ return value.save();
+ };
+
+ return Singleton;
+
+ })(Spine.Module);
+
+ singularize = function(str) {
+ return str.replace(/s$/, '');
+ };
+
+ underscore = function(str) {
+ return str.replace(/::/g, '/').replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2').replace(/([a-z\d])([A-Z])/g, '$1_$2').replace(/-/g, '_').toLowerCase();
+ };
+
+ Spine.Model.extend({
+ hasMany: function(name, model, fkey) {
+ var association;
+ if (fkey == null) {
+ fkey = "" + (underscore(this.className)) + "_id";
+ }
+ association = function(record) {
+ if (typeof model === 'string') {
+ model = require(model);
+ }
+ return new Collection({
+ name: name,
+ model: model,
+ record: record,
+ fkey: fkey
+ });
+ };
+ return this.prototype[name] = function(value) {
+ if (value != null) {
+ association(this).refresh(value);
+ }
+ return association(this);
+ };
+ },
+ belongsTo: function(name, model, fkey) {
+ var association;
+ if (fkey == null) {
+ fkey = "" + (singularize(name)) + "_id";
+ }
+ association = function(record) {
+ if (typeof model === 'string') {
+ model = require(model);
+ }
+ return new Instance({
+ name: name,
+ model: model,
+ record: record,
+ fkey: fkey
+ });
+ };
+ this.prototype[name] = function(value) {
+ if (value != null) {
+ association(this).update(value);
+ }
+ return association(this).exists();
+ };
+ return this.attributes.push(fkey);
+ },
+ hasOne: function(name, model, fkey) {
+ var association;
+ if (fkey == null) {
+ fkey = "" + (underscore(this.className)) + "_id";
+ }
+ association = function(record) {
+ if (typeof model === 'string') {
+ model = require(model);
+ }
+ return new Singleton({
+ name: name,
+ model: model,
+ record: record,
+ fkey: fkey
+ });
+ };
+ return this.prototype[name] = function(value) {
+ if (value != null) {
+ association(this).update(value);
+ }
+ return association(this).find();
+ };
+ }
+ });
+
+}).call(this);
View
220 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/route.js
@@ -0,0 +1,220 @@
+// Generated by CoffeeScript 1.3.3
+(function() {
+ var $, Spine, escapeRegExp, hashStrip, namedParam, splatParam,
+ __hasProp = {}.hasOwnProperty,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ __slice = [].slice;
+
+ Spine = this.Spine || require('spine');
+
+ $ = Spine.$;
+
+ hashStrip = /^#*/;
+
+ namedParam = /:([\w\d]+)/g;
+
+ splatParam = /\*([\w\d]+)/g;
+
+ escapeRegExp = /[-[\]{}()+?.,\\^$|#\s]/g;
+
+ Spine.Route = (function(_super) {
+ var _ref;
+
+ __extends(Route, _super);
+
+ Route.extend(Spine.Events);
+
+ Route.historySupport = ((_ref = window.history) != null ? _ref.pushState : void 0) != null;
+
+ Route.routes = [];
+
+ Route.options = {
+ trigger: true,
+ history: false,
+ shim: false
+ };
+
+ Route.add = function(path, callback) {
+ var key, value, _results;
+ if (typeof path === 'object' && !(path instanceof RegExp)) {
+ _results = [];
+ for (key in path) {
+ value = path[key];
+ _results.push(this.add(key, value));
+ }
+ return _results;
+ } else {
+ return this.routes.push(new this(path, callback));
+ }
+ };
+
+ Route.setup = function(options) {
+ if (options == null) {
+ options = {};
+ }
+ this.options = $.extend({}, this.options, options);
+ if (this.options.history) {
+ this.history = this.historySupport && this.options.history;
+ }
+ if (this.options.shim) {
+ return;
+ }
+ if (this.history) {
+ $(window).bind('popstate', this.change);
+ } else {
+ $(window).bind('hashchange', this.change);
+ }
+ return this.change();
+ };
+
+ Route.unbind = function() {
+ if (this.history) {
+ return $(window).unbind('popstate', this.change);
+ } else {
+ return $(window).unbind('hashchange', this.change);
+ }
+ };
+
+ Route.navigate = function() {
+ var args, lastArg, options, path;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ options = {};
+ lastArg = args[args.length - 1];
+ if (typeof lastArg === 'object') {
+ options = args.pop();
+ } else if (typeof lastArg === 'boolean') {
+ options.trigger = args.pop();
+ }
+ options = $.extend({}, this.options, options);
+ path = args.join('/');
+ if (this.path === path) {
+ return;
+ }
+ this.path = path;
+ this.trigger('navigate', this.path);
+ if (options.trigger) {
+ this.matchRoute(this.path, options);
+ }
+ if (options.shim) {
+ return;
+ }
+ if (this.history) {
+ return history.pushState({}, document.title, this.path);
+ } else {
+ return window.location.hash = this.path;
+ }
+ };
+
+ Route.getPath = function() {
+ var path;
+ path = window.location.pathname;
+ if (path.substr(0, 1) !== '/') {
+ path = '/' + path;
+ }
+ return path;
+ };
+
+ Route.getHash = function() {
+ return window.location.hash;
+ };
+
+ Route.getFragment = function() {
+ return this.getHash().replace(hashStrip, '');
+ };
+
+ Route.getHost = function() {
+ return (document.location + '').replace(this.getPath() + this.getHash(), '');
+ };
+
+ Route.change = function() {
+ var path;
+ path = this.getFragment() !== '' ? this.getFragment() : this.getPath();
+ if (path === this.path) {
+ return;
+ }
+ this.path = path;
+ return this.matchRoute(this.path);
+ };
+
+ Route.matchRoute = function(path, options) {
+ var route, _i, _len, _ref1;
+ _ref1 = this.routes;
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+ route = _ref1[_i];
+ if (route.match(path, options)) {
+ this.trigger('change', route, path);
+ return route;
+ }
+ }
+ };
+
+ function Route(path, callback) {
+ var match;
+ this.path = path;
+ this.callback = callback;
+ this.names = [];
+ if (typeof path === 'string') {
+ namedParam.lastIndex = 0;
+ while ((match = namedParam.exec(path)) !== null) {
+ this.names.push(match[1]);
+ }
+ splatParam.lastIndex = 0;
+ while ((match = splatParam.exec(path)) !== null) {
+ this.names.push(match[1]);
+ }
+ path = path.replace(escapeRegExp, '\\$&').replace(namedParam, '([^\/]*)').replace(splatParam, '(.*?)');
+ this.route = new RegExp('^' + path + '$');
+ } else {
+ this.route = path;
+ }
+ }
+
+ Route.prototype.match = function(path, options) {
+ var i, match, param, params, _i, _len;
+ if (options == null) {
+ options = {};
+ }
+ match = this.route.exec(path);
+ if (!match) {
+ return false;
+ }
+ options.match = match;
+ params = match.slice(1);
+ if (this.names.length) {
+ for (i = _i = 0, _len = params.length; _i < _len; i = ++_i) {
+ param = params[i];
+ options[this.names[i]] = param;
+ }
+ }
+ return this.callback.call(null, options) !== false;
+ };
+
+ return Route;
+
+ })(Spine.Module);
+
+ Spine.Route.change = Spine.Route.proxy(Spine.Route.change);
+
+ Spine.Controller.include({
+ route: function(path, callback) {
+ return Spine.Route.add(path, this.proxy(callback));
+ },
+ routes: function(routes) {
+ var key, value, _results;
+ _results = [];
+ for (key in routes) {
+ value = routes[key];
+ _results.push(this.route(key, value));
+ }
+ return _results;
+ },
+ navigate: function() {
+ return Spine.Route.navigate.apply(Spine.Route, arguments);
+ }
+ });
+
+ if (typeof module !== "undefined" && module !== null) {
+ module.exports = Spine.Route;
+ }
+
+}).call(this);
View
913 cli/samples/todos_spine_requirejs/app/scripts/components/spine/lib/spine.js
@@ -0,0 +1,913 @@
+// Generated by CoffeeScript 1.3.3
+(function() {
+ var $, Controller, Events, Log, Model, Module, Spine, createObject, isArray, isBlank, makeArray, moduleKeywords,
+ __slice = [].slice,
+ __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ __hasProp = {}.hasOwnProperty,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+
+ Events = {
+ bind: function(ev, callback) {
+ var calls, evs, name, _i, _len;
+ evs = ev.split(' ');
+ calls = this.hasOwnProperty('_callbacks') && this._callbacks || (this._callbacks = {});
+ for (_i = 0, _len = evs.length; _i < _len; _i++) {
+ name = evs[_i];
+ calls[name] || (calls[name] = []);
+ calls[name].push(callback);
+ }
+ return this;
+ },
+ one: function(ev, callback) {
+ return this.bind(ev, function() {
+ this.unbind(ev, arguments.callee);
+ return callback.apply(this, arguments);
+ });
+ },
+ trigger: function() {
+ var args, callback, ev, list, _i, _len, _ref;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ ev = args.shift();
+ list = this.hasOwnProperty('_callbacks') && ((_ref = this._callbacks) != null ? _ref[ev] : void 0);
+ if (!list) {
+ return;
+ }
+ for (_i = 0, _len = list.length; _i < _len; _i++) {
+ callback = list[_i];
+ if (callback.apply(this, args) === false) {
+ break;
+ }
+ }
+ return true;
+ },
+ unbind: function(ev, callback) {
+ var cb, i, list, _i, _len, _ref;
+ if (!ev) {
+ this._callbacks = {};
+ return this;
+ }
+ list = (_ref = this._callbacks) != null ? _ref[ev] : void 0;
+ if (!list) {
+ return this;
+ }
+ if (!callback) {
+ delete this._callbacks[ev];
+ return this;
+ }
+ for (i = _i = 0, _len = list.length; _i < _len; i = ++_i) {
+ cb = list[i];
+ if (!(cb === callback)) {
+ continue;
+ }
+ list = list.slice();
+ list.splice(i, 1);
+ this._callbacks[ev] = list;
+ break;
+ }
+ return this;
+ }
+ };
+
+ Log = {
+ trace: true,
+ logPrefix: '(App)',
+ log: function() {
+ var args;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ if (!this.trace) {
+ return;
+ }
+ if (this.logPrefix) {
+ args.unshift(this.logPrefix);
+ }
+ if (typeof console !== "undefined" && console !== null) {
+ if (typeof console.log === "function") {
+ console.log.apply(console, args);
+ }
+ }
+ return this;
+ }
+ };
+
+ moduleKeywords = ['included', 'extended'];
+
+ Module = (function() {
+
+ Module.include = function(obj) {
+ var key, value, _ref;
+ if (!obj) {
+ throw new Error('include(obj) requires obj');
+ }
+ for (key in obj) {
+ value = obj[key];
+ if (__indexOf.call(moduleKeywords, key) < 0) {
+ this.prototype[key] = value;
+ }
+ }
+ if ((_ref = obj.included) != null) {
+ _ref.apply(this);
+ }
+ return this;
+ };
+
+ Module.extend = function(obj) {
+ var key, value, _ref;
+ if (!obj) {
+ throw new Error('extend(obj) requires obj');
+ }
+ for (key in obj) {
+ value = obj[key];
+ if (__indexOf.call(moduleKeywords, key) < 0) {
+ this[key] = value;
+ }
+ }
+ if ((_ref = obj.extended) != null) {
+ _ref.apply(this);
+ }
+ return this;
+ };
+
+ Module.proxy = function(func) {
+ var _this = this;
+ return function() {
+ return func.apply(_this, arguments);
+ };
+ };
+
+ Module.prototype.proxy = function(func) {
+ var _this = this;
+ return function() {
+ return func.apply(_this, arguments);
+ };
+ };
+
+ function Module() {
+ if (typeof this.init === "function") {
+ this.init.apply(this, arguments);
+ }
+ }
+
+ return Module;
+
+ })();
+
+ Model = (function(_super) {
+
+ __extends(Model, _super);
+
+ Model.extend(Events);
+
+ Model.records = {};
+
+ Model.crecords = {};
+
+ Model.attributes = [];
+
+ Model.configure = function() {
+ var attributes, name;
+ name = arguments[0], attributes = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ this.className = name;
+ this.records = {};
+ this.crecords = {};
+ if (attributes.length) {
+ this.attributes = attributes;
+ }
+ this.attributes && (this.attributes = makeArray(this.attributes));
+ this.attributes || (this.attributes = []);
+ this.unbind();
+ return this;
+ };
+
+ Model.toString = function() {
+ return "" + this.className + "(" + (this.attributes.join(", ")) + ")";
+ };
+
+ Model.find = function(id) {
+ var record;
+ record = this.records[id];
+ if (!record && ("" + id).match(/c-\d+/)) {
+ return this.findCID(id);
+ }
+ if (!record) {
+ throw new Error('Unknown record');
+ }
+ return record.clone();
+ };
+
+ Model.findCID = function(cid) {
+ var record;
+ record = this.crecords[cid];
+ if (!record) {
+ throw new Error('Unknown record');
+ }
+ return record.clone();
+ };
+
+ Model.exists = function(id) {
+ try {
+ return this.find(id);
+ } catch (e) {
+ return false;
+ }
+ };
+
+ Model.refresh = function(values, options) {
+ var record, records, _i, _len;
+ if (options == null) {
+ options = {};
+ }
+ if (options.clear) {
+ this.records = {};
+ this.crecords = {};
+ }
+ records = this.fromJSON(values);
+ if (!isArray(records)) {
+ records = [records];
+ }
+ for (_i = 0, _len = records.length; _i < _len; _i++) {
+ record = records[_i];
+ record.id || (record.id = record.cid);
+ this.records[record.id] = record;
+ this.crecords[record.cid] = record;
+ }
+ this.trigger('refresh', this.cloneArray(records));
+ return this;
+ };
+
+ Model.select = function(callback) {
+ var id, record, result;
+ result = (function() {
+ var _ref, _results;
+ _ref = this.records;
+ _results = [];
+ for (id in _ref) {
+ record = _ref[id];
+ if (callback(record)) {
+ _results.push(record);
+ }
+ }
+ return _results;
+ }).call(this);
+ return this.cloneArray(result);
+ };
+
+ Model.findByAttribute = function(name, value) {
+ var id, record, _ref;
+ _ref = this.records;
+ for (id in _ref) {
+ record = _ref[id];
+ if (record[name] === value) {
+ return record.clone();
+ }
+ }
+ return null;
+ };
+
+ Model.findAllByAttribute = function(name, value) {
+ return this.select(function(item) {
+ return item[name] === value;
+ });
+ };
+
+ Model.each = function(callback) {
+ var key, value, _ref, _results;
+ _ref = this.records;
+ _results = [];