sproutcore 0.9.23 → 1.0.1003

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1668) hide show
  1. data/Buildfile +125 -0
  2. data/History.txt +5 -569
  3. data/README.txt +99 -64
  4. data/Rakefile +236 -6
  5. data/Todo.txt +1 -0
  6. data/VERSION.yml +5 -0
  7. data/bin/sc-build +9 -210
  8. data/bin/sc-build-number +13 -0
  9. data/bin/sc-docs +14 -0
  10. data/bin/sc-gen +9 -23
  11. data/bin/sc-init +9 -34
  12. data/bin/sc-manifest +13 -0
  13. data/bin/sc-server +9 -82
  14. data/bin/sproutcore +10 -24
  15. data/buildtasks/build.rake +82 -0
  16. data/buildtasks/entry.rake +62 -0
  17. data/buildtasks/manifest.rake +565 -0
  18. data/buildtasks/render.rake +21 -0
  19. data/buildtasks/target.rake +61 -0
  20. data/design/Technical Notes.graffle/QuickLook/Preview.pdf +0 -0
  21. data/design/Technical Notes.graffle/QuickLook/Thumbnail.tiff +0 -0
  22. data/design/Technical Notes.graffle/data.plist +5534 -0
  23. data/design/Technical Notes.graffle/image8.png +0 -0
  24. data/doc_templates/jsdoc/publish.js +170 -0
  25. data/doc_templates/jsdoc/static/default.css +162 -0
  26. data/{jsdoc/templates/sproutcore → doc_templates/jsdoc}/static/header.html +0 -0
  27. data/doc_templates/jsdoc/static/index.html +19 -0
  28. data/doc_templates/sproutcore/publish.js +345 -0
  29. data/doc_templates/sproutcore/static/default.css +258 -0
  30. data/doc_templates/sproutcore/static/header.html +2 -0
  31. data/doc_templates/sproutcore/static/index.html +19 -0
  32. data/frameworks/sproutcore/Buildfile +88 -0
  33. data/frameworks/sproutcore/HISTORY +10 -10
  34. data/frameworks/sproutcore/README +8 -1
  35. data/frameworks/sproutcore/apps/docs/core.js +27 -0
  36. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/QuickLook/Preview.pdf +0 -0
  37. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/QuickLook/Thumbnail.tiff +0 -0
  38. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/data.plist +14378 -0
  39. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image10.png +0 -0
  40. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image11.png +0 -0
  41. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image13.png +0 -0
  42. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image14.png +0 -0
  43. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image8.png +0 -0
  44. data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image9.tiff +0 -0
  45. data/frameworks/sproutcore/apps/docs/english.lproj/loading.rhtml +9 -0
  46. data/frameworks/sproutcore/apps/docs/english.lproj/main_page.js +22 -0
  47. data/frameworks/sproutcore/apps/docs/english.lproj/strings.js +15 -0
  48. data/frameworks/sproutcore/apps/docs/main.js +30 -0
  49. data/frameworks/sproutcore/apps/tests/controllers/detail.js +25 -0
  50. data/frameworks/sproutcore/apps/tests/controllers/source.js +29 -0
  51. data/frameworks/sproutcore/apps/tests/controllers/target.js +26 -0
  52. data/frameworks/sproutcore/apps/tests/controllers/targets.js +86 -0
  53. data/frameworks/sproutcore/apps/tests/controllers/tests.js +33 -0
  54. data/frameworks/sproutcore/apps/tests/core.js +133 -0
  55. data/frameworks/sproutcore/apps/tests/english.lproj/loading.rhtml +9 -0
  56. data/frameworks/sproutcore/apps/tests/english.lproj/main_page.css +39 -0
  57. data/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +232 -0
  58. data/frameworks/sproutcore/apps/tests/english.lproj/strings.js +26 -0
  59. data/frameworks/sproutcore/apps/tests/main.js +28 -0
  60. data/frameworks/sproutcore/apps/tests/states/no_targets.js +26 -0
  61. data/frameworks/sproutcore/apps/tests/states/ready.js +56 -0
  62. data/frameworks/sproutcore/apps/tests/states/ready_detail.js +41 -0
  63. data/frameworks/sproutcore/apps/tests/states/ready_empty.js +48 -0
  64. data/frameworks/sproutcore/apps/tests/states/ready_list.js +41 -0
  65. data/frameworks/sproutcore/apps/tests/states/ready_loading.js +44 -0
  66. data/frameworks/sproutcore/apps/tests/states/ready_no_tests.js +31 -0
  67. data/frameworks/sproutcore/apps/tests/states/start.js +39 -0
  68. data/frameworks/sproutcore/apps/tests/tests/controllers/detail.js +15 -0
  69. data/frameworks/sproutcore/apps/tests/tests/controllers/source.js +15 -0
  70. data/frameworks/sproutcore/apps/tests/tests/controllers/target.js +15 -0
  71. data/frameworks/sproutcore/apps/tests/tests/controllers/targets.js +15 -0
  72. data/frameworks/sproutcore/apps/tests/tests/controllers/tests.js +15 -0
  73. data/frameworks/sproutcore/apps/tests/tests/models/target.js +15 -0
  74. data/frameworks/sproutcore/apps/tests/tests/models/test.js +15 -0
  75. data/frameworks/sproutcore/apps/tests/tests/views/offset_checkbox.js +15 -0
  76. data/frameworks/sproutcore/apps/tests/views/offset_checkbox.js +26 -0
  77. data/frameworks/sproutcore/apps/welcome/controllers/targets.js +49 -0
  78. data/frameworks/sproutcore/apps/welcome/core.js +30 -0
  79. data/frameworks/sproutcore/apps/welcome/english.lproj/loading.rhtml +10 -0
  80. data/frameworks/sproutcore/apps/welcome/english.lproj/main_page.css +7 -0
  81. data/frameworks/sproutcore/apps/welcome/english.lproj/main_page.js +77 -0
  82. data/frameworks/sproutcore/apps/welcome/english.lproj/strings.js +15 -0
  83. data/frameworks/sproutcore/apps/welcome/main.js +19 -0
  84. data/frameworks/sproutcore/apps/welcome/tests/controllers/targets.js +15 -0
  85. data/frameworks/sproutcore/design/CollectionView State Charts.graffle +4848 -0
  86. data/frameworks/sproutcore/design/Design Charts.graffle +18232 -0
  87. data/frameworks/sproutcore/design/Record State Table.numbers +0 -0
  88. data/frameworks/sproutcore/design/SproutCore Datastore Design.graffle/QuickLook/Preview.pdf +0 -0
  89. data/frameworks/sproutcore/design/SproutCore Datastore Design.graffle/QuickLook/Thumbnail.tiff +0 -0
  90. data/frameworks/sproutcore/design/SproutCore Datastore Design.graffle/data.plist +19588 -0
  91. data/frameworks/sproutcore/design/SproutCore Datastore Design.graffle/image8.png +0 -0
  92. data/frameworks/sproutcore/design/SproutCore Design Template.graffle/QuickLook/Preview.pdf +0 -0
  93. data/frameworks/sproutcore/design/SproutCore Design Template.graffle/QuickLook/Thumbnail.tiff +0 -0
  94. data/frameworks/sproutcore/design/SproutCore Design Template.graffle/data.plist +1452 -0
  95. data/frameworks/sproutcore/design/SproutCore Design Template.graffle/image8.png +0 -0
  96. data/frameworks/sproutcore/design/TestRunner Design.graffle/QuickLook/Preview.pdf +0 -0
  97. data/frameworks/sproutcore/design/TestRunner Design.graffle/QuickLook/Thumbnail.tiff +0 -0
  98. data/frameworks/sproutcore/design/TestRunner Design.graffle/data.plist +24187 -0
  99. data/frameworks/sproutcore/design/TestRunner Design.graffle/image10.png +0 -0
  100. data/frameworks/sproutcore/design/TestRunner Design.graffle/image11.png +0 -0
  101. data/frameworks/sproutcore/design/TestRunner Design.graffle/image13.png +0 -0
  102. data/frameworks/sproutcore/design/TestRunner Design.graffle/image15.png +0 -0
  103. data/frameworks/sproutcore/design/TestRunner Design.graffle/image16.png +0 -0
  104. data/frameworks/sproutcore/design/TestRunner Design.graffle/image17.png +0 -0
  105. data/frameworks/sproutcore/design/TestRunner Design.graffle/image18.png +0 -0
  106. data/frameworks/sproutcore/design/TestRunner Design.graffle/image19.png +0 -0
  107. data/frameworks/sproutcore/design/TestRunner Design.graffle/image22.tiff +0 -0
  108. data/frameworks/sproutcore/design/TestRunner Design.graffle/image23.png +0 -0
  109. data/frameworks/sproutcore/design/TestRunner Design.graffle/image24.png +0 -0
  110. data/frameworks/sproutcore/design/TestRunner Design.graffle/image25.png +0 -0
  111. data/frameworks/sproutcore/design/TestRunner Design.graffle/image30.png +0 -0
  112. data/frameworks/sproutcore/design/TestRunner Design.graffle/image31.png +0 -0
  113. data/frameworks/sproutcore/design/TestRunner Design.graffle/image8.png +0 -0
  114. data/frameworks/sproutcore/design/TestRunner Design.graffle/image9.png +0 -0
  115. data/frameworks/sproutcore/frameworks/core_tools/core.js +20 -0
  116. data/frameworks/sproutcore/frameworks/core_tools/data_source.js +99 -0
  117. data/frameworks/sproutcore/frameworks/core_tools/english.lproj/strings.js +15 -0
  118. data/frameworks/sproutcore/frameworks/core_tools/fixtures/target.js +87 -0
  119. data/frameworks/sproutcore/frameworks/core_tools/fixtures/test.js +44 -0
  120. data/frameworks/sproutcore/frameworks/core_tools/models/target.js +108 -0
  121. data/frameworks/sproutcore/frameworks/core_tools/models/test.js +48 -0
  122. data/frameworks/sproutcore/frameworks/datastore/core.js +8 -0
  123. data/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +180 -0
  124. data/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +340 -0
  125. data/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +393 -0
  126. data/frameworks/sproutcore/frameworks/datastore/debug/json.js +71 -0
  127. data/frameworks/sproutcore/frameworks/datastore/debug/standard_setup.js +96 -0
  128. data/frameworks/sproutcore/frameworks/datastore/fixtures/author_fixtures.js +2503 -0
  129. data/frameworks/sproutcore/frameworks/datastore/fixtures/sample.js +17 -0
  130. data/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +100 -0
  131. data/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +152 -0
  132. data/frameworks/sproutcore/frameworks/datastore/models/record.js +898 -0
  133. data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +462 -0
  134. data/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +158 -0
  135. data/frameworks/sproutcore/frameworks/datastore/system/many_array.js +411 -0
  136. data/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +499 -0
  137. data/frameworks/sproutcore/frameworks/datastore/system/query.js +1488 -0
  138. data/frameworks/sproutcore/frameworks/datastore/system/record_array.js +568 -0
  139. data/frameworks/sproutcore/frameworks/datastore/system/store.js +2407 -0
  140. data/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +117 -0
  141. data/frameworks/sproutcore/frameworks/datastore/tests/integration/contact_model.js +131 -0
  142. data/frameworks/sproutcore/frameworks/datastore/tests/integration/cyclical_relationship.js +119 -0
  143. data/frameworks/sproutcore/frameworks/datastore/tests/integration/mail_model.js +91 -0
  144. data/frameworks/sproutcore/frameworks/datastore/tests/integration/test_runner_model.js +56 -0
  145. data/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +384 -0
  146. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +55 -0
  147. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/destroy.js +81 -0
  148. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +245 -0
  149. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/readAttribute.js +53 -0
  150. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/refresh.js +48 -0
  151. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/storeDidChangeProperties.js +169 -0
  152. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/unknownProperty.js +51 -0
  153. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +97 -0
  154. data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +178 -0
  155. data/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +216 -0
  156. data/frameworks/sproutcore/frameworks/datastore/tests/system/many_array/core_methods.js +204 -0
  157. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +149 -0
  158. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js +171 -0
  159. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +154 -0
  160. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/dataHashDidChange.js +113 -0
  161. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/discardChanges.js +99 -0
  162. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readDataHash.js +180 -0
  163. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readEditableDataHash.js +126 -0
  164. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/removeDataHash.js +163 -0
  165. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +166 -0
  166. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +219 -0
  167. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/compare.js +131 -0
  168. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/contains.js +131 -0
  169. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/containsRecordTypes.js +81 -0
  170. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/copy.js +30 -0
  171. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation.js +185 -0
  172. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation_of_records.js +92 -0
  173. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/expandedRecordTypes.js +64 -0
  174. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/parse.js +202 -0
  175. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/queryWithScope.js +57 -0
  176. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/record_type_is.js +43 -0
  177. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_comparisons.js +66 -0
  178. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_query_extensions.js +67 -0
  179. data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +177 -0
  180. data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +134 -0
  181. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js +54 -0
  182. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitChangesFromNestedStore.js +133 -0
  183. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +211 -0
  184. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +136 -0
  185. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/createRecord.js +72 -0
  186. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataHashDidChange.js +78 -0
  187. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +254 -0
  188. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +106 -0
  189. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/find.js +530 -0
  190. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/init.js +21 -0
  191. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushChanges.js +61 -0
  192. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readDataHash.js +74 -0
  193. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readEditableDataHash.js +74 -0
  194. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/recordDidChange.js +73 -0
  195. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/removeDataHash.js +144 -0
  196. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/retrieveRecord.js +184 -0
  197. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/writeDataHash.js +125 -0
  198. data/frameworks/sproutcore/frameworks/datejs/core.js +865 -0
  199. data/frameworks/sproutcore/frameworks/datejs/english.lproj/en-US.js +186 -0
  200. data/frameworks/sproutcore/frameworks/datejs/extras.js +332 -0
  201. data/frameworks/sproutcore/frameworks/datejs/license.js +25 -0
  202. data/frameworks/sproutcore/frameworks/datejs/parser.js +1116 -0
  203. data/frameworks/sproutcore/frameworks/datejs/spanish.lproj/es-CO.js +186 -0
  204. data/frameworks/sproutcore/frameworks/datejs/sugarpak.js +475 -0
  205. data/frameworks/sproutcore/frameworks/datejs/time.js +269 -0
  206. data/frameworks/sproutcore/frameworks/datejs/validators/datejs.js +34 -0
  207. data/frameworks/sproutcore/frameworks/debug/core.js +99 -0
  208. data/frameworks/sproutcore/frameworks/designer/coders/design.js +29 -0
  209. data/frameworks/sproutcore/frameworks/designer/coders/localization.js +27 -0
  210. data/frameworks/sproutcore/frameworks/designer/coders/object.js +347 -0
  211. data/frameworks/sproutcore/frameworks/designer/controllers/page_design.js +102 -0
  212. data/frameworks/sproutcore/frameworks/designer/css/css_rule.js +22 -0
  213. data/frameworks/sproutcore/frameworks/designer/css/css_style.js +29 -0
  214. data/frameworks/sproutcore/frameworks/designer/css/css_style_sheet.js +201 -0
  215. data/frameworks/sproutcore/frameworks/designer/ext/page.js +86 -0
  216. data/frameworks/sproutcore/frameworks/designer/ext/view.js +38 -0
  217. data/frameworks/sproutcore/frameworks/designer/views/controls/button.js +17 -0
  218. data/frameworks/sproutcore/frameworks/designer/views/designer.js +569 -0
  219. data/frameworks/sproutcore/frameworks/designer/views/label.js +16 -0
  220. data/frameworks/sproutcore/frameworks/designer/views/mixins/button.js +11 -0
  221. data/frameworks/sproutcore/frameworks/designer/views/tab.js +16 -0
  222. data/frameworks/sproutcore/frameworks/desktop/core.js +6 -0
  223. data/frameworks/sproutcore/frameworks/desktop/debug/drag.js +41 -0
  224. data/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +56 -0
  225. data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/a_sample_image.jpg +0 -0
  226. data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/apple-logo1.jpeg +0 -0
  227. data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/iframe.html +23 -0
  228. data/frameworks/sproutcore/frameworks/desktop/english.lproj/disclosure.css +78 -0
  229. data/frameworks/sproutcore/frameworks/desktop/english.lproj/drag.css +6 -0
  230. data/frameworks/sproutcore/frameworks/desktop/english.lproj/icons.css +943 -0
  231. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_222222.png +0 -0
  232. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_454545.png +0 -0
  233. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_888888.png +0 -0
  234. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_ffffff.png +0 -0
  235. data/frameworks/sproutcore/{english.lproj/images/shared-icons.png → frameworks/desktop/english.lproj/images/icons/shared.png} +0 -0
  236. data/{clients/sc_test_runner → frameworks/sproutcore/frameworks/desktop}/english.lproj/images/indicator.gif +0 -0
  237. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/panels/sprite-x.png +0 -0
  238. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/panels/sprite-y.png +0 -0
  239. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sc-theme-sprite.png +0 -0
  240. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/standard_fade/000000.png +0 -0
  241. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/standard_fade/ffffff.png +0 -0
  242. data/frameworks/sproutcore/{english.lproj → frameworks/desktop/english.lproj}/images/sticky-note.png +0 -0
  243. data/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +209 -0
  244. data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +113 -0
  245. data/frameworks/sproutcore/frameworks/desktop/english.lproj/modal.css +5 -0
  246. data/frameworks/sproutcore/frameworks/desktop/english.lproj/panel.css +95 -0
  247. data/frameworks/sproutcore/frameworks/desktop/english.lproj/picker.css +39 -0
  248. data/frameworks/sproutcore/frameworks/desktop/english.lproj/progress.css +31 -0
  249. data/frameworks/sproutcore/frameworks/desktop/english.lproj/radio.css +10 -0
  250. data/frameworks/sproutcore/frameworks/desktop/english.lproj/scroller.css +26 -0
  251. data/frameworks/sproutcore/frameworks/desktop/english.lproj/segmented.css +141 -0
  252. data/frameworks/sproutcore/frameworks/desktop/english.lproj/separator.css +19 -0
  253. data/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +62 -0
  254. data/frameworks/sproutcore/frameworks/desktop/english.lproj/split.css +70 -0
  255. data/frameworks/sproutcore/frameworks/desktop/english.lproj/split_divider.css +9 -0
  256. data/frameworks/sproutcore/frameworks/desktop/english.lproj/strings.js +14 -0
  257. data/frameworks/sproutcore/frameworks/desktop/english.lproj/tab.css +12 -0
  258. data/frameworks/sproutcore/frameworks/desktop/english.lproj/toolbar.css +6 -0
  259. data/frameworks/sproutcore/frameworks/desktop/mixins/border.js +53 -0
  260. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +22 -0
  261. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +61 -0
  262. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +292 -0
  263. data/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +247 -0
  264. data/frameworks/sproutcore/frameworks/desktop/panes/alert.js +408 -0
  265. data/frameworks/sproutcore/frameworks/desktop/panes/drop_down.js +665 -0
  266. data/frameworks/sproutcore/frameworks/desktop/panes/menu.js +680 -0
  267. data/frameworks/sproutcore/frameworks/desktop/panes/modal.js +68 -0
  268. data/frameworks/sproutcore/frameworks/desktop/panes/palette.js +63 -0
  269. data/frameworks/sproutcore/frameworks/desktop/panes/panel.js +184 -0
  270. data/frameworks/sproutcore/frameworks/desktop/panes/picker.js +403 -0
  271. data/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +46 -0
  272. data/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +39 -0
  273. data/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +81 -0
  274. data/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +175 -0
  275. data/frameworks/sproutcore/frameworks/desktop/protocols/responder.js +290 -0
  276. data/frameworks/sproutcore/frameworks/desktop/system/drag.js +869 -0
  277. data/frameworks/sproutcore/frameworks/desktop/system/key_bindings.js +40 -0
  278. data/frameworks/sproutcore/frameworks/desktop/system/root_responder.js +647 -0
  279. data/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +187 -0
  280. data/frameworks/sproutcore/frameworks/desktop/tests/datetime_recordattribute.js +73 -0
  281. data/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js +43 -0
  282. data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/methods.js +10 -0
  283. data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +152 -0
  284. data/frameworks/sproutcore/frameworks/desktop/tests/panes/dropDown/methods.js +161 -0
  285. data/frameworks/sproutcore/frameworks/desktop/tests/panes/dropDown/ui.js +199 -0
  286. data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +55 -0
  287. data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +59 -0
  288. data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/methods.js +10 -0
  289. data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/ui.js +35 -0
  290. data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +10 -0
  291. data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +40 -0
  292. data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +10 -0
  293. data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +84 -0
  294. data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/methods.js +10 -0
  295. data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +38 -0
  296. data/frameworks/sproutcore/frameworks/desktop/tests/views/button/methods.js +45 -0
  297. data/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +163 -0
  298. data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +144 -0
  299. data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/ui.js +99 -0
  300. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/content.js +249 -0
  301. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deleteSelection.js +82 -0
  302. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deselect.js +199 -0
  303. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/displayProperties.js +31 -0
  304. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +288 -0
  305. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/layerIdFor.js +65 -0
  306. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/length.js +88 -0
  307. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +174 -0
  308. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/nowShowing.js +121 -0
  309. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/reload.js +177 -0
  310. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/select.js +240 -0
  311. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectNextItem.js +191 -0
  312. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectPreviousItem.js +197 -0
  313. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selection.js +141 -0
  314. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/ui_diagram.js +182 -0
  315. data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/methods.js +10 -0
  316. data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +64 -0
  317. data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/methods.js +10 -0
  318. data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/ui.js +10 -0
  319. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/render.js +92 -0
  320. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowDelegate.js +183 -0
  321. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +133 -0
  322. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowOffsetForContentIndex.js +131 -0
  323. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +56 -0
  324. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +167 -0
  325. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +127 -0
  326. data/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +284 -0
  327. data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/methods.js +10 -0
  328. data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/ui.js +44 -0
  329. data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/methods.js +128 -0
  330. data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +240 -0
  331. data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/methods.js +113 -0
  332. data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/ui.js +200 -0
  333. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +142 -0
  334. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +169 -0
  335. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/methods.js +72 -0
  336. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/ui.js +71 -0
  337. data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +95 -0
  338. data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +222 -0
  339. data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +132 -0
  340. data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +110 -0
  341. data/frameworks/sproutcore/frameworks/desktop/tests/views/separator.js +37 -0
  342. data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/methods.js +10 -0
  343. data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/ui.js +10 -0
  344. data/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js +60 -0
  345. data/frameworks/sproutcore/frameworks/desktop/tests/views/split/ui.js +52 -0
  346. data/frameworks/sproutcore/frameworks/desktop/tests/views/stacked/ui_comments.js +231 -0
  347. data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +54 -0
  348. data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +88 -0
  349. data/frameworks/sproutcore/frameworks/desktop/tests/views/web/methods.js +10 -0
  350. data/frameworks/sproutcore/frameworks/desktop/tests/views/web/ui.js +110 -0
  351. data/frameworks/sproutcore/frameworks/desktop/views/button.js +375 -0
  352. data/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +126 -0
  353. data/frameworks/sproutcore/frameworks/desktop/views/collection.js +2775 -0
  354. data/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +60 -0
  355. data/frameworks/sproutcore/frameworks/desktop/views/form.js +594 -0
  356. data/frameworks/sproutcore/frameworks/desktop/views/grid.js +201 -0
  357. data/frameworks/sproutcore/frameworks/desktop/views/list.js +549 -0
  358. data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +657 -0
  359. data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +608 -0
  360. data/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +20 -0
  361. data/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +68 -0
  362. data/frameworks/sproutcore/frameworks/desktop/views/progress.js +233 -0
  363. data/frameworks/sproutcore/frameworks/desktop/views/radio.js +357 -0
  364. data/frameworks/sproutcore/frameworks/desktop/views/scene.js +204 -0
  365. data/frameworks/sproutcore/frameworks/desktop/views/scroll.js +689 -0
  366. data/frameworks/sproutcore/frameworks/desktop/views/scroller.js +227 -0
  367. data/frameworks/sproutcore/frameworks/desktop/views/segmented.js +587 -0
  368. data/frameworks/sproutcore/frameworks/desktop/views/select_field.js +311 -0
  369. data/frameworks/sproutcore/frameworks/desktop/views/separator.js +37 -0
  370. data/frameworks/sproutcore/frameworks/desktop/views/slider.js +261 -0
  371. data/frameworks/sproutcore/frameworks/desktop/views/source_list.js +47 -0
  372. data/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +169 -0
  373. data/frameworks/sproutcore/frameworks/desktop/views/split.js +684 -0
  374. data/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +55 -0
  375. data/frameworks/sproutcore/frameworks/desktop/views/stacked.js +101 -0
  376. data/frameworks/sproutcore/frameworks/desktop/views/tab.js +191 -0
  377. data/frameworks/sproutcore/frameworks/desktop/views/thumb.js +49 -0
  378. data/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +49 -0
  379. data/frameworks/sproutcore/frameworks/desktop/views/web.js +87 -0
  380. data/frameworks/sproutcore/frameworks/foundation/TESTING +46 -0
  381. data/frameworks/sproutcore/frameworks/foundation/controllers/array.js +504 -0
  382. data/frameworks/sproutcore/frameworks/foundation/controllers/controller.js +44 -0
  383. data/frameworks/sproutcore/frameworks/foundation/controllers/object.js +322 -0
  384. data/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +105 -0
  385. data/frameworks/sproutcore/frameworks/foundation/core.js +144 -0
  386. data/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +194 -0
  387. data/frameworks/sproutcore/{english.lproj → frameworks/foundation/english.lproj}/blank.gif +0 -0
  388. data/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +81 -0
  389. data/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +33 -0
  390. data/frameworks/sproutcore/frameworks/foundation/english.lproj/core.css +438 -0
  391. data/frameworks/sproutcore/frameworks/foundation/english.lproj/debug/control-test-pane.css +9 -0
  392. data/frameworks/sproutcore/{english.lproj → frameworks/foundation/english.lproj}/images/sproutcore-logo.png +0 -0
  393. data/{clients/sc_test_runner/english.lproj/controls.css → frameworks/sproutcore/frameworks/foundation/english.lproj/inline_editor.css} +0 -0
  394. data/frameworks/sproutcore/frameworks/foundation/english.lproj/label.css +31 -0
  395. data/frameworks/sproutcore/frameworks/foundation/english.lproj/static_layout.css +5 -0
  396. data/frameworks/sproutcore/frameworks/foundation/english.lproj/strings.js +15 -0
  397. data/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +133 -0
  398. data/frameworks/sproutcore/frameworks/foundation/english.lproj/view.css +51 -0
  399. data/frameworks/sproutcore/frameworks/foundation/ext/object.js +83 -0
  400. data/frameworks/sproutcore/frameworks/foundation/ext/run_loop.js +161 -0
  401. data/frameworks/sproutcore/frameworks/foundation/fixtures/file_exists.json +1 -0
  402. data/frameworks/sproutcore/frameworks/foundation/license.js +19 -0
  403. data/frameworks/sproutcore/frameworks/foundation/mixins/button.js +355 -0
  404. data/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +179 -0
  405. data/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +91 -0
  406. data/frameworks/sproutcore/frameworks/foundation/mixins/control.js +386 -0
  407. data/frameworks/sproutcore/frameworks/foundation/mixins/editable.js +150 -0
  408. data/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +491 -0
  409. data/frameworks/sproutcore/frameworks/foundation/mixins/selection_support.js +233 -0
  410. data/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +148 -0
  411. data/frameworks/sproutcore/frameworks/foundation/mixins/string.js +334 -0
  412. data/frameworks/sproutcore/frameworks/foundation/mixins/tree_item_content.js +160 -0
  413. data/frameworks/sproutcore/frameworks/foundation/mixins/validatable.js +189 -0
  414. data/frameworks/sproutcore/frameworks/foundation/panes/main.js +51 -0
  415. data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +661 -0
  416. data/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +887 -0
  417. data/frameworks/sproutcore/frameworks/foundation/protocols/inline_editor_delegate.js +84 -0
  418. data/frameworks/sproutcore/frameworks/foundation/system/application.js +36 -0
  419. data/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +502 -0
  420. data/frameworks/sproutcore/frameworks/foundation/system/browser.js +64 -0
  421. data/frameworks/sproutcore/frameworks/foundation/system/builder.js +210 -0
  422. data/frameworks/sproutcore/frameworks/foundation/system/bundle.js +267 -0
  423. data/frameworks/sproutcore/frameworks/foundation/system/core_query.js +2028 -0
  424. data/frameworks/sproutcore/frameworks/foundation/system/cursor.js +129 -0
  425. data/frameworks/sproutcore/frameworks/foundation/system/datetime.js +915 -0
  426. data/frameworks/sproutcore/frameworks/foundation/system/event.js +849 -0
  427. data/frameworks/sproutcore/frameworks/foundation/system/image_cache.js +432 -0
  428. data/frameworks/sproutcore/frameworks/foundation/system/json.js +440 -0
  429. data/frameworks/sproutcore/frameworks/foundation/system/locale.js +288 -0
  430. data/frameworks/sproutcore/frameworks/foundation/system/page.js +106 -0
  431. data/frameworks/sproutcore/frameworks/foundation/system/ready.js +195 -0
  432. data/frameworks/sproutcore/frameworks/foundation/system/render_context.js +905 -0
  433. data/frameworks/sproutcore/frameworks/foundation/system/request.js +386 -0
  434. data/frameworks/sproutcore/frameworks/foundation/system/responder.js +120 -0
  435. data/frameworks/sproutcore/frameworks/foundation/system/responder_context.js +243 -0
  436. data/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +391 -0
  437. data/frameworks/sproutcore/frameworks/foundation/system/routes.js +525 -0
  438. data/frameworks/sproutcore/frameworks/foundation/system/text_selection.js +103 -0
  439. data/frameworks/sproutcore/frameworks/foundation/system/time.js +478 -0
  440. data/frameworks/sproutcore/frameworks/foundation/system/timer.js +549 -0
  441. data/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +233 -0
  442. data/frameworks/sproutcore/frameworks/foundation/system/utils.js +482 -0
  443. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/array_case.js +182 -0
  444. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/enum_case.js +193 -0
  445. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/null_case.js +64 -0
  446. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/single_case.js +136 -0
  447. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/empty_case.js +82 -0
  448. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/multiple_case.js +111 -0
  449. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_case.js +193 -0
  450. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_enumerable_case.js +179 -0
  451. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/outline_case.js +108 -0
  452. data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/methods.js +10 -0
  453. data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/ui.js +113 -0
  454. data/frameworks/sproutcore/frameworks/foundation/tests/integration/creating_views.js +113 -0
  455. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/content.js +195 -0
  456. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/displayProperties.js +89 -0
  457. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/keyEquivalents.js +56 -0
  458. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/content.js +168 -0
  459. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/displayProperties.js +89 -0
  460. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +128 -0
  461. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js +17 -0
  462. data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/flat_case.js +325 -0
  463. data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/group_case.js +718 -0
  464. data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/outline_case.js +484 -0
  465. data/frameworks/sproutcore/frameworks/foundation/tests/system/builder.js +42 -0
  466. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_core.js +1323 -0
  467. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_dimensions.js +387 -0
  468. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_selector.js +405 -0
  469. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/setClass.js +49 -0
  470. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/within.js +66 -0
  471. data/frameworks/sproutcore/frameworks/foundation/tests/system/datetime.js +252 -0
  472. data/frameworks/sproutcore/frameworks/foundation/tests/system/json.js +14 -0
  473. data/frameworks/sproutcore/frameworks/foundation/tests/system/locale.js +128 -0
  474. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/begin.js +47 -0
  475. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/element.js +44 -0
  476. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/end.js +119 -0
  477. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/get.js +51 -0
  478. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_attr.js +50 -0
  479. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_basic.js +28 -0
  480. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_className.js +179 -0
  481. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_style.js +100 -0
  482. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/init.js +55 -0
  483. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/join.js +28 -0
  484. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/push_text.js +74 -0
  485. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/tag.js +45 -0
  486. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/update.js +205 -0
  487. data/frameworks/sproutcore/frameworks/foundation/tests/system/request.js +127 -0
  488. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeKeyPane.js +124 -0
  489. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeMainPane.js +68 -0
  490. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/root_responder.js +101 -0
  491. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/targetForAction.js +238 -0
  492. data/frameworks/sproutcore/frameworks/foundation/tests/system/routes.js +33 -0
  493. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/invalidate.js +38 -0
  494. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/invokeLater.js +201 -0
  495. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/isPaused.js +71 -0
  496. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/performAction.js +67 -0
  497. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/schedule.js +170 -0
  498. data/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js +24 -0
  499. data/frameworks/sproutcore/frameworks/foundation/tests/system/utils/normalizeURL.js +18 -0
  500. data/frameworks/sproutcore/frameworks/foundation/tests/system/utils/range.js +62 -0
  501. data/frameworks/sproutcore/frameworks/foundation/tests/validators/credit_card.js +35 -0
  502. data/frameworks/sproutcore/frameworks/foundation/tests/validators/date.js +23 -0
  503. data/frameworks/sproutcore/frameworks/foundation/tests/validators/number.js +47 -0
  504. data/frameworks/sproutcore/frameworks/foundation/tests/validators/password.js +13 -0
  505. data/frameworks/sproutcore/frameworks/foundation/tests/validators/validator.js +20 -0
  506. data/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +10 -0
  507. data/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +83 -0
  508. data/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +52 -0
  509. data/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +148 -0
  510. data/frameworks/sproutcore/frameworks/foundation/tests/views/main_pane.js +31 -0
  511. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/append_remove.js +113 -0
  512. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/firstResponder.js +148 -0
  513. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/keyPane.js +133 -0
  514. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/sendEvent.js +165 -0
  515. data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +76 -0
  516. data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +446 -0
  517. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/clippingFrame.js +133 -0
  518. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/convertFrames.js +246 -0
  519. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createChildViews.js +122 -0
  520. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createLayer.js +97 -0
  521. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/destroyLayer.js +85 -0
  522. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/findLayerInParentLayer.js +52 -0
  523. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/init.js +50 -0
  524. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/insertBefore.js +200 -0
  525. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/isVisible.js +51 -0
  526. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/isVisibleInWindow.js +116 -0
  527. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layer.js +150 -0
  528. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutChildViews.js +162 -0
  529. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutDidChange.js +127 -0
  530. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutStyle.js +328 -0
  531. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/parentViewDidChange.js +67 -0
  532. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/prepareContext.js +166 -0
  533. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/removeChild.js +189 -0
  534. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/render.js +83 -0
  535. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/replaceChild.js +29 -0
  536. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayer.js +146 -0
  537. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayerLocation.js +194 -0
  538. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/viewDidResize.js +223 -0
  539. data/frameworks/sproutcore/frameworks/foundation/validators/credit_card.js +125 -0
  540. data/frameworks/sproutcore/frameworks/foundation/validators/date.js +52 -0
  541. data/frameworks/sproutcore/frameworks/foundation/validators/email.js +45 -0
  542. data/frameworks/sproutcore/frameworks/foundation/validators/not_empty.js +33 -0
  543. data/frameworks/sproutcore/frameworks/foundation/validators/number.js +82 -0
  544. data/frameworks/sproutcore/frameworks/foundation/validators/password.js +86 -0
  545. data/frameworks/sproutcore/frameworks/foundation/validators/validator.js +314 -0
  546. data/frameworks/sproutcore/frameworks/foundation/views/container.js +136 -0
  547. data/frameworks/sproutcore/frameworks/foundation/views/field.js +347 -0
  548. data/frameworks/sproutcore/frameworks/foundation/views/image.js +178 -0
  549. data/frameworks/sproutcore/frameworks/foundation/views/label.js +285 -0
  550. data/frameworks/sproutcore/frameworks/foundation/views/text_field.js +662 -0
  551. data/frameworks/sproutcore/frameworks/foundation/views/view.js +2521 -0
  552. data/frameworks/sproutcore/frameworks/mini/license.js +28 -0
  553. data/frameworks/sproutcore/frameworks/mobile/english.lproj/core.css +12 -0
  554. data/frameworks/sproutcore/frameworks/mobile/lib/index.rhtml +126 -0
  555. data/frameworks/sproutcore/frameworks/mobile/system/root_responder.js +109 -0
  556. data/frameworks/sproutcore/frameworks/mobile/tests/views/button/ui.js +9 -0
  557. data/frameworks/sproutcore/frameworks/mobile/views/button.js +190 -0
  558. data/frameworks/sproutcore/frameworks/runtime/README +12 -0
  559. data/frameworks/sproutcore/frameworks/runtime/core.js +950 -0
  560. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +238 -0
  561. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/indexOf.js +33 -0
  562. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/insertAt.js +121 -0
  563. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js +34 -0
  564. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/popObject.js +50 -0
  565. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/pushObject.js +46 -0
  566. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/rangeObserver.js +371 -0
  567. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeAt.js +100 -0
  568. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js +49 -0
  569. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/replace.js +94 -0
  570. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/shiftObject.js +50 -0
  571. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/unshiftObject.js +47 -0
  572. data/frameworks/sproutcore/frameworks/runtime/license.js +28 -0
  573. data/frameworks/sproutcore/frameworks/runtime/mixins/array.js +613 -0
  574. data/frameworks/sproutcore/frameworks/runtime/mixins/comparable.js +45 -0
  575. data/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +64 -0
  576. data/frameworks/sproutcore/frameworks/runtime/mixins/delegate_support.js +110 -0
  577. data/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +1238 -0
  578. data/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +110 -0
  579. data/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +1315 -0
  580. data/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +141 -0
  581. data/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +173 -0
  582. data/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +172 -0
  583. data/frameworks/sproutcore/frameworks/runtime/protocols/observable_protocol.js +40 -0
  584. data/frameworks/sproutcore/frameworks/runtime/protocols/sparse_array_delegate.js +131 -0
  585. data/frameworks/sproutcore/frameworks/runtime/system/binding.js +943 -0
  586. data/frameworks/sproutcore/frameworks/runtime/system/enumerator.js +106 -0
  587. data/frameworks/sproutcore/frameworks/runtime/system/error.js +157 -0
  588. data/frameworks/sproutcore/frameworks/runtime/system/index_set.js +1193 -0
  589. data/frameworks/sproutcore/frameworks/runtime/system/object.js +834 -0
  590. data/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +271 -0
  591. data/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +245 -0
  592. data/frameworks/sproutcore/frameworks/runtime/system/selection_set.js +669 -0
  593. data/frameworks/sproutcore/frameworks/runtime/system/set.js +425 -0
  594. data/frameworks/sproutcore/frameworks/runtime/system/sparse_array.js +379 -0
  595. data/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js +56 -0
  596. data/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js +23 -0
  597. data/frameworks/sproutcore/frameworks/runtime/tests/core/clone.js +84 -0
  598. data/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js +44 -0
  599. data/frameworks/sproutcore/frameworks/runtime/tests/core/console.js +16 -0
  600. data/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +147 -0
  601. data/frameworks/sproutcore/frameworks/runtime/tests/core/inspect.js +27 -0
  602. data/frameworks/sproutcore/frameworks/runtime/tests/core/isArray.js +25 -0
  603. data/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +38 -0
  604. data/frameworks/sproutcore/frameworks/runtime/tests/core/keys.js +20 -0
  605. data/frameworks/sproutcore/frameworks/runtime/tests/core/makeArray.js +30 -0
  606. data/frameworks/sproutcore/frameworks/runtime/tests/core/objectForPropertyPath.js +19 -0
  607. data/frameworks/sproutcore/frameworks/runtime/tests/core/tupleForPropertyPath.js +37 -0
  608. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +57 -0
  609. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/comparable.js +44 -0
  610. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable.js +611 -0
  611. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +587 -0
  612. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +132 -0
  613. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +79 -0
  614. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +80 -0
  615. data/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue/isObservingSuspended.js +55 -0
  616. data/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +265 -0
  617. data/frameworks/sproutcore/frameworks/runtime/tests/system/error.js +52 -0
  618. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +195 -0
  619. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/addEach.js +49 -0
  620. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/clone.js +43 -0
  621. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/contains.js +74 -0
  622. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js +42 -0
  623. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js +38 -0
  624. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexBefore.js +38 -0
  625. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/intersects.js +74 -0
  626. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/max.js +40 -0
  627. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js +40 -0
  628. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/rangeStartForIndex.js +36 -0
  629. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/remove.js +189 -0
  630. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/removeEach.js +49 -0
  631. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/without.js +89 -0
  632. data/frameworks/sproutcore/frameworks/runtime/tests/system/object/base.js +148 -0
  633. data/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +339 -0
  634. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/create.js +59 -0
  635. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/destroy.js +75 -0
  636. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/objectPropertyDidChange.js +117 -0
  637. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/rangeDidChange.js +110 -0
  638. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/update.js +65 -0
  639. data/frameworks/sproutcore/frameworks/runtime/tests/system/run_loop.js +120 -0
  640. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/add.js +92 -0
  641. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/copy.js +17 -0
  642. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/indexSetForSource.js +85 -0
  643. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/isEqual.js +60 -0
  644. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/remove.js +87 -0
  645. data/frameworks/sproutcore/frameworks/runtime/tests/system/set.js +292 -0
  646. data/frameworks/sproutcore/frameworks/runtime/tests/system/sparse_array.js +175 -0
  647. data/frameworks/sproutcore/frameworks/testing/core.js +196 -0
  648. data/frameworks/sproutcore/frameworks/testing/english.lproj/additions.css +8 -0
  649. data/frameworks/sproutcore/frameworks/testing/english.lproj/runner.css +128 -0
  650. data/frameworks/sproutcore/frameworks/testing/english.lproj/testsuite.css +131 -0
  651. data/frameworks/sproutcore/frameworks/testing/extras.js +17 -0
  652. data/frameworks/sproutcore/frameworks/testing/jquery.js +3559 -0
  653. data/frameworks/sproutcore/frameworks/testing/qunit.js +827 -0
  654. data/frameworks/sproutcore/frameworks/testing/system/dump.js +205 -0
  655. data/frameworks/sproutcore/frameworks/testing/system/equiv.js +201 -0
  656. data/frameworks/sproutcore/frameworks/testing/system/plan.js +695 -0
  657. data/frameworks/sproutcore/frameworks/testing/system/runner.js +209 -0
  658. data/frameworks/sproutcore/frameworks/testing/system/suite.js +228 -0
  659. data/frameworks/sproutcore/frameworks/testing/utils.js +62 -0
  660. data/frameworks/sproutcore/lib/index.rhtml +81 -33
  661. data/frameworks/sproutcore/license.js +28 -28
  662. data/frameworks/sproutcore/themes/empty_theme/tests/mini_icons.rhtml +69 -0
  663. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/button.css +41 -0
  664. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/core.css +8 -0
  665. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/backButton.png +0 -0
  666. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/blueButton.png +0 -0
  667. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/cancel.png +0 -0
  668. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/grayButton.png +0 -0
  669. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/leftButton.png +0 -0
  670. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listArrow.png +0 -0
  671. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listArrowSel.png +0 -0
  672. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listGroup.png +0 -0
  673. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/loading.gif +0 -0
  674. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/pinstripes.png +0 -0
  675. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/rightButton.png +0 -0
  676. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/selection.png +0 -0
  677. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/thumb.png +0 -0
  678. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toggle.png +0 -0
  679. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toggleOn.png +0 -0
  680. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toolButton.png +0 -0
  681. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toolbar.png +0 -0
  682. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/whiteButton.png +0 -0
  683. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/strings.js +15 -0
  684. data/frameworks/sproutcore/themes/standard_theme/Source/Panel.drawit/Data +0 -0
  685. data/frameworks/sproutcore/themes/standard_theme/Source/Panel.drawit/QuickLook/Preview.jpg +0 -0
  686. data/frameworks/sproutcore/themes/standard_theme/Source/Panel.drawit/QuickLook/Thumbnail.jpg +0 -0
  687. data/frameworks/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/Data +0 -0
  688. data/frameworks/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/QuickLook/Preview.jpg +0 -0
  689. data/frameworks/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/QuickLook/Thumbnail.jpg +0 -0
  690. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/10.png +0 -0
  691. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/100.png +0 -0
  692. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/102.png +0 -0
  693. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/110.png +0 -0
  694. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/120.png +0 -0
  695. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/127.png +0 -0
  696. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/18.png +0 -0
  697. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/19.png +0 -0
  698. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/2.png +0 -0
  699. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/24.png +0 -0
  700. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/26.png +0 -0
  701. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/27.png +0 -0
  702. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/28.png +0 -0
  703. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/29.png +0 -0
  704. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/30.png +0 -0
  705. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/31.png +0 -0
  706. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/33.png +0 -0
  707. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/37.png +0 -0
  708. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/41.png +0 -0
  709. data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/99.png +0 -0
  710. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/10.png +0 -0
  711. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/100.png +0 -0
  712. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/102.png +0 -0
  713. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/110.png +0 -0
  714. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/120.png +0 -0
  715. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/127.png +0 -0
  716. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/18.png +0 -0
  717. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/19.png +0 -0
  718. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/2.png +0 -0
  719. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/24.png +0 -0
  720. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/26.png +0 -0
  721. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/27.png +0 -0
  722. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/28.png +0 -0
  723. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/29.png +0 -0
  724. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/30.png +0 -0
  725. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/31.png +0 -0
  726. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/33.png +0 -0
  727. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/37.png +0 -0
  728. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/41.png +0 -0
  729. data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/99.png +0 -0
  730. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/10.png +0 -0
  731. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/100.png +0 -0
  732. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/102.png +0 -0
  733. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/110.png +0 -0
  734. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/120.png +0 -0
  735. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/127.png +0 -0
  736. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/18.png +0 -0
  737. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/19.png +0 -0
  738. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/2.png +0 -0
  739. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/24.png +0 -0
  740. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/26.png +0 -0
  741. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/27.png +0 -0
  742. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/28.png +0 -0
  743. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/29.png +0 -0
  744. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/30.png +0 -0
  745. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/31.png +0 -0
  746. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/33.png +0 -0
  747. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/37.png +0 -0
  748. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/41.png +0 -0
  749. data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/99.png +0 -0
  750. data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/10.png +0 -0
  751. data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/18.png +0 -0
  752. data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/19.png +0 -0
  753. data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/2.png +0 -0
  754. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/Data +0 -0
  755. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/QuickLook/Preview.jpg +0 -0
  756. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/QuickLook/Thumbnail.jpg +0 -0
  757. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/Data +0 -0
  758. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/QuickLook/Preview.jpg +0 -0
  759. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/QuickLook/Thumbnail.jpg +0 -0
  760. data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x-2.psd +0 -0
  761. data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x.psd +0 -0
  762. data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-sprite.psd +0 -0
  763. data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-ysprite.psd +0 -0
  764. data/frameworks/sproutcore/themes/standard_theme/Source/shared-icons.psd +0 -0
  765. data/frameworks/sproutcore/themes/standard_theme/Source/sproutcore-logo.psd +0 -0
  766. data/frameworks/sproutcore/themes/standard_theme/Source/sticky-note.psd +0 -0
  767. data/frameworks/sproutcore/themes/standard_theme/english.lproj/button.css +327 -0
  768. data/frameworks/sproutcore/themes/standard_theme/english.lproj/checkbox.css +93 -0
  769. data/frameworks/sproutcore/themes/standard_theme/english.lproj/collection.css +126 -0
  770. data/frameworks/sproutcore/themes/standard_theme/english.lproj/core.css +76 -0
  771. data/frameworks/sproutcore/themes/standard_theme/english.lproj/disclosure.css +57 -0
  772. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-repeat-x.png +0 -0
  773. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-sprite.png +0 -0
  774. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/images/sc-theme-ysprite.png +0 -0
  775. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-toolbar-view.png +0 -0
  776. data/frameworks/sproutcore/themes/standard_theme/english.lproj/label.css +11 -0
  777. data/frameworks/sproutcore/themes/standard_theme/english.lproj/list_item.css +30 -0
  778. data/frameworks/sproutcore/themes/standard_theme/english.lproj/menu_item_view.css +3 -0
  779. data/frameworks/sproutcore/themes/standard_theme/english.lproj/pane.css +8 -0
  780. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/background-fat.jpg +0 -0
  781. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/background-thin.jpg +0 -0
  782. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/bottom-edge.png +0 -0
  783. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/bottom-left-corner.png +0 -0
  784. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/bottom-right-corner.png +0 -0
  785. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/left-edge.png +0 -0
  786. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/overlay.png +0 -0
  787. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/right-edge.png +0 -0
  788. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/top-edge.png +0 -0
  789. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/top-left-corner.png +0 -0
  790. data/frameworks/sproutcore/{english.lproj → themes/standard_theme/english.lproj}/panels/top-right-corner.png +0 -0
  791. data/frameworks/sproutcore/themes/standard_theme/english.lproj/progress.css +26 -0
  792. data/frameworks/sproutcore/themes/standard_theme/english.lproj/radio.css +149 -0
  793. data/frameworks/sproutcore/themes/standard_theme/english.lproj/segmented.css +279 -0
  794. data/frameworks/sproutcore/themes/standard_theme/english.lproj/slider.css +94 -0
  795. data/frameworks/sproutcore/themes/standard_theme/english.lproj/split_view.css +27 -0
  796. data/frameworks/sproutcore/themes/standard_theme/english.lproj/tab.css +19 -0
  797. data/frameworks/sproutcore/themes/standard_theme/english.lproj/text_field.css +20 -0
  798. data/frameworks/sproutcore/themes/standard_theme/english.lproj/toolbar.css +7 -0
  799. data/gen/Buildfile +16 -0
  800. data/gen/app/Buildfile +36 -0
  801. data/gen/app/README +1 -0
  802. data/gen/app/USAGE +13 -0
  803. data/gen/app/templates/apps/@target_name@/core.js +27 -0
  804. data/gen/app/templates/apps/@target_name@/main.js +30 -0
  805. data/gen/app/templates/apps/@target_name@/resources/loading.rhtml +9 -0
  806. data/gen/app/templates/apps/@target_name@/resources/main_page.js +24 -0
  807. data/gen/controller/Buildfile +18 -0
  808. data/gen/controller/README +1 -0
  809. data/gen/controller/USAGE +13 -0
  810. data/gen/controller/templates/controllers/@filename@.js +18 -0
  811. data/gen/controller/templates/tests/controllers/@filename@.js +15 -0
  812. data/gen/design/Buildfile +23 -0
  813. data/gen/design/README +1 -0
  814. data/gen/design/USAGE +10 -0
  815. data/gen/design/templates/resources/@filename@.js +16 -0
  816. data/gen/framework/Buildfile +36 -0
  817. data/gen/framework/README +1 -0
  818. data/gen/framework/USAGE +13 -0
  819. data/gen/framework/templates/frameworks/@target_name@/core.js +21 -0
  820. data/gen/framework/templates/frameworks/@target_name@/english.lproj/strings.js +15 -0
  821. data/gen/language/Buildfile +26 -0
  822. data/gen/language/README +1 -0
  823. data/gen/language/USAGE +13 -0
  824. data/gen/language/templates/@filename@/strings.js +14 -0
  825. data/gen/model/Buildfile +16 -0
  826. data/gen/model/README +1 -0
  827. data/gen/model/USAGE +15 -0
  828. data/gen/model/templates/fixtures/@filename@.js +35 -0
  829. data/gen/model/templates/models/@filename@.js +19 -0
  830. data/gen/model/templates/tests/models/@filename@.js +15 -0
  831. data/gen/page/Buildfile +36 -0
  832. data/gen/page/README +1 -0
  833. data/gen/page/USAGE +15 -0
  834. data/gen/page/templates/pages/@target_name@/Buildfile +16 -0
  835. data/gen/page/templates/pages/@target_name@/core.js +22 -0
  836. data/gen/page/templates/pages/@target_name@/en.lproj/strings.js +14 -0
  837. data/gen/page/templates/pages/@target_name@/resources/body.css +1 -0
  838. data/gen/page/templates/pages/@target_name@/resources/body.rhtml +7 -0
  839. data/gen/project/Buildfile +45 -0
  840. data/gen/project/INIT +3 -0
  841. data/gen/project/README +1 -0
  842. data/gen/project/USAGE +2 -0
  843. data/gen/project/templates/@filename@/Buildfile +7 -0
  844. data/gen/project/templates/@filename@/README +7 -0
  845. data/gen/test/Buildfile +25 -0
  846. data/gen/test/README +1 -0
  847. data/gen/test/USAGE +12 -0
  848. data/gen/test/templates/tests/@filename@.js +15 -0
  849. data/gen/theme/Buildfile +36 -0
  850. data/gen/theme/README +1 -0
  851. data/gen/theme/USAGE +13 -0
  852. data/gen/theme/templates/themes/@target_name@/resources/theme_styles.css +11 -0
  853. data/gen/view/Buildfile +18 -0
  854. data/gen/view/README +1 -0
  855. data/gen/view/USAGE +13 -0
  856. data/gen/view/templates/tests/views/@filename@.js +15 -0
  857. data/gen/view/templates/views/@filename@.js +18 -0
  858. data/lib/sproutcore/builders/base.rb +91 -0
  859. data/lib/sproutcore/builders/bundle.rb +63 -0
  860. data/lib/sproutcore/builders/combine.rb +37 -0
  861. data/lib/sproutcore/builders/html.rb +205 -0
  862. data/lib/sproutcore/builders/javascript.rb +62 -0
  863. data/lib/sproutcore/builders/minify.rb +133 -0
  864. data/lib/sproutcore/builders/sass.rb +55 -0
  865. data/lib/sproutcore/builders/strings.rb +44 -0
  866. data/lib/sproutcore/builders/stylesheet.rb +40 -0
  867. data/lib/sproutcore/builders/test.rb +59 -0
  868. data/lib/sproutcore/builders/test_index.rb +26 -0
  869. data/lib/sproutcore/buildfile/build_task.rb +33 -0
  870. data/lib/sproutcore/buildfile/buildfile_dsl.rb +162 -0
  871. data/lib/sproutcore/buildfile/cloneable.rb +34 -0
  872. data/lib/sproutcore/buildfile/early_time.rb +30 -0
  873. data/lib/sproutcore/buildfile/invocation_chain.rb +64 -0
  874. data/lib/sproutcore/buildfile/namespace.rb +33 -0
  875. data/lib/sproutcore/buildfile/string_ext.rb +198 -0
  876. data/lib/sproutcore/buildfile/task.rb +304 -0
  877. data/lib/sproutcore/buildfile/task_arguments.rb +86 -0
  878. data/lib/sproutcore/buildfile/task_manager.rb +193 -0
  879. data/lib/sproutcore/buildfile.rb +484 -0
  880. data/lib/sproutcore/deprecated/view_helper.rb +662 -0
  881. data/lib/sproutcore/helpers/capture_helper.rb +9 -1
  882. data/lib/sproutcore/helpers/cssmin.rb +202 -0
  883. data/lib/sproutcore/helpers/dom_id_helper.rb +8 -1
  884. data/lib/sproutcore/helpers/entry_sorter.rb +139 -0
  885. data/lib/sproutcore/helpers/packed_optimizer.rb +102 -0
  886. data/lib/sproutcore/helpers/static_helper.rb +223 -41
  887. data/lib/sproutcore/helpers/tag_helper.rb +73 -1
  888. data/lib/sproutcore/helpers/text_helper.rb +24 -57
  889. data/lib/sproutcore/models/generator.rb +493 -0
  890. data/lib/sproutcore/models/hash_struct.rb +109 -0
  891. data/lib/sproutcore/models/manifest.rb +376 -0
  892. data/lib/sproutcore/models/manifest_entry.rb +252 -0
  893. data/lib/sproutcore/models/project.rb +267 -0
  894. data/lib/sproutcore/models/target.rb +664 -0
  895. data/lib/sproutcore/rack/builder.rb +331 -0
  896. data/lib/sproutcore/rack/dev.rb +51 -0
  897. data/lib/sproutcore/rack/docs.rb +24 -0
  898. data/lib/sproutcore/rack/filesystem.rb +265 -0
  899. data/lib/sproutcore/rack/proxy.rb +100 -0
  900. data/lib/sproutcore/rack/service.rb +155 -0
  901. data/lib/sproutcore/rack/test_runner.rb +24 -0
  902. data/lib/sproutcore/render_engines/erubis.rb +55 -0
  903. data/lib/sproutcore/render_engines/haml.rb +39 -0
  904. data/lib/sproutcore/tools/build.rb +80 -0
  905. data/lib/sproutcore/tools/build_number.rb +23 -0
  906. data/lib/sproutcore/tools/docs.rb +53 -0
  907. data/lib/sproutcore/tools/gen.rb +99 -0
  908. data/lib/sproutcore/tools/init.rb +40 -0
  909. data/lib/sproutcore/tools/manifest.rb +85 -0
  910. data/lib/sproutcore/tools/server.rb +48 -0
  911. data/lib/sproutcore/tools.rb +341 -0
  912. data/lib/sproutcore.rb +141 -18
  913. data/lib/thor/CHANGELOG.rdoc +52 -0
  914. data/lib/thor/LICENSE +20 -0
  915. data/lib/thor/README.markdown +76 -0
  916. data/lib/thor/Rakefile +6 -0
  917. data/lib/thor/Thorfile +45 -0
  918. data/lib/thor/bin/rake2thor +83 -0
  919. data/lib/thor/bin/thor +7 -0
  920. data/lib/thor/lib/thor/error.rb +3 -0
  921. data/lib/thor/lib/thor/options.rb +267 -0
  922. data/lib/thor/lib/thor/ordered_hash.rb +64 -0
  923. data/lib/thor/lib/thor/runner.rb +305 -0
  924. data/lib/thor/lib/thor/task.rb +83 -0
  925. data/lib/thor/lib/thor/task_hash.rb +22 -0
  926. data/lib/thor/lib/thor/tasks/package.rb +18 -0
  927. data/lib/thor/lib/thor/tasks.rb +77 -0
  928. data/lib/thor/lib/thor/util.rb +75 -0
  929. data/lib/thor/lib/thor.rb +170 -0
  930. data/lib/thor/script/destroy +14 -0
  931. data/lib/thor/script/generate +14 -0
  932. data/lib/thor/spec/fixtures/task.thor +10 -0
  933. data/lib/thor/spec/options_spec.rb +271 -0
  934. data/lib/thor/spec/ordered_hash_spec.rb +84 -0
  935. data/lib/thor/spec/spec.opts +1 -0
  936. data/lib/thor/spec/spec_helper.rb +30 -0
  937. data/lib/thor/spec/task_spec.rb +11 -0
  938. data/lib/thor/spec/tasks_spec.rb +28 -0
  939. data/lib/thor/spec/thor_runner_spec.rb +194 -0
  940. data/lib/thor/spec/thor_spec.rb +206 -0
  941. data/lib/thor/spec/util_spec.rb +99 -0
  942. data/lib/thor/task.thor +15 -0
  943. data/lib/thor/thor.gemspec +29 -0
  944. data/spec/buildtasks/build/copy_spec.rb +60 -0
  945. data/spec/buildtasks/build/spec_helper.rb +36 -0
  946. data/spec/buildtasks/manifest/catalog_spec.rb +48 -0
  947. data/spec/buildtasks/manifest/hide_buildfiles_spec.rb +126 -0
  948. data/spec/buildtasks/manifest/localize_spec.rb +97 -0
  949. data/spec/buildtasks/manifest/prepare_build_tasks/bundle_spec.rb +254 -0
  950. data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +246 -0
  951. data/spec/buildtasks/manifest/prepare_build_tasks/css_spec.rb +87 -0
  952. data/spec/buildtasks/manifest/prepare_build_tasks/html_spec.rb +175 -0
  953. data/spec/buildtasks/manifest/prepare_build_tasks/javascript_spec.rb +65 -0
  954. data/spec/buildtasks/manifest/prepare_build_tasks/minify_spec.rb +70 -0
  955. data/spec/buildtasks/manifest/prepare_build_tasks/packed_spec.rb +152 -0
  956. data/spec/buildtasks/manifest/prepare_build_tasks/sass_spec.rb +98 -0
  957. data/spec/buildtasks/manifest/prepare_build_tasks/strings_spec.rb +64 -0
  958. data/spec/buildtasks/manifest/prepare_build_tasks/tests_spec.rb +163 -0
  959. data/spec/buildtasks/manifest/prepare_spec.rb +43 -0
  960. data/spec/buildtasks/manifest/spec_helper.rb +35 -0
  961. data/spec/buildtasks/target_spec.rb +270 -0
  962. data/spec/fixtures/builder_tests/Buildfile +20 -0
  963. data/spec/fixtures/builder_tests/apps/bundle_test/bundle.js +1 -0
  964. data/spec/fixtures/builder_tests/apps/combine_test/a.js +1 -0
  965. data/spec/fixtures/builder_tests/apps/combine_test/b.js +1 -0
  966. data/spec/fixtures/builder_tests/apps/combine_test/c.js +1 -0
  967. data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/a.css +1 -0
  968. data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/b.css +1 -0
  969. data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/c.css +1 -0
  970. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/bar1_sample.rhtml +2 -0
  971. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/erb_sample.html.erb +1 -0
  972. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/icons/image.png +0 -0
  973. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/image.jpg +0 -0
  974. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/rhtml_sample.rhtml +1 -0
  975. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/strings.js +4 -0
  976. data/spec/fixtures/builder_tests/apps/html_test/english.lproj/style.css +0 -0
  977. data/spec/fixtures/builder_tests/apps/html_test/french.lproj/french-icons/fr.png +0 -0
  978. data/spec/fixtures/builder_tests/apps/html_test/french.lproj/strings.js +4 -0
  979. data/spec/fixtures/builder_tests/apps/html_test/lib/layout_template.rhtml +1 -0
  980. data/spec/fixtures/builder_tests/apps/html_test/scripts.js +0 -0
  981. data/spec/fixtures/builder_tests/apps/javascript_test/sc_static.js +15 -0
  982. data/spec/fixtures/builder_tests/apps/javascript_test/sc_super.js +4 -0
  983. data/spec/fixtures/builder_tests/apps/javascript_test/strings.js +7 -0
  984. data/spec/fixtures/builder_tests/apps/sass_test/sample.sass +3 -0
  985. data/spec/fixtures/builder_tests/apps/strings_test/lproj/strings.js +8 -0
  986. data/spec/fixtures/builder_tests/apps/stylesheet_test/build_directives.css +9 -0
  987. data/spec/fixtures/builder_tests/apps/stylesheet_test/sc_static.css +12 -0
  988. data/spec/fixtures/builder_tests/apps/test_test/lib/alt_layout.rhtml +1 -0
  989. data/spec/fixtures/builder_tests/apps/test_test/lib/test_layout.rhtml +3 -0
  990. data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test.js +1 -0
  991. data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test2.js +1 -0
  992. data/spec/fixtures/builder_tests/apps/test_test/tests/rhtml_test.rhtml +4 -0
  993. data/spec/fixtures/builder_tests/frameworks/debug/core.js +0 -0
  994. data/spec/fixtures/builder_tests/frameworks/debug/english.lproj/dummy.css +0 -0
  995. data/spec/fixtures/builder_tests/frameworks/dynamic_req_target_1/dynamic_req_js_1.js +0 -0
  996. data/spec/fixtures/builder_tests/frameworks/dynamic_req_target_1/english.lproj/dynamic_req_style_1.css +0 -0
  997. data/spec/fixtures/builder_tests/frameworks/qunit/core.js +0 -0
  998. data/spec/fixtures/builder_tests/frameworks/qunit/english.lproj/dummy.css +0 -0
  999. data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/req_style_1.css +0 -0
  1000. data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/strings.js +4 -0
  1001. data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/test.rhtml +1 -0
  1002. data/spec/fixtures/builder_tests/frameworks/req_target_1/req_js_1.js +0 -0
  1003. data/spec/fixtures/builder_tests/frameworks/req_target_2/english.lproj/req_style_2.css +0 -0
  1004. data/spec/fixtures/builder_tests/frameworks/req_target_2/english.lproj/test.rhtml +1 -0
  1005. data/spec/fixtures/builder_tests/frameworks/req_target_2/javascript.js +1 -0
  1006. data/spec/fixtures/builder_tests/frameworks/req_target_2/lib/alt_layout.rhtml +0 -0
  1007. data/spec/fixtures/builder_tests/frameworks/req_target_2/req_js_2.js +0 -0
  1008. data/spec/fixtures/builder_tests/themes/sample_theme/Buildfile +1 -0
  1009. data/spec/fixtures/buildfiles/basic/Buildfile +16 -0
  1010. data/spec/fixtures/buildfiles/basic/task_module.rake +6 -0
  1011. data/spec/fixtures/buildfiles/installed/Buildfile +7 -0
  1012. data/spec/fixtures/buildfiles/installed/Buildfile2 +5 -0
  1013. data/spec/fixtures/buildfiles/project_test/Buildfile +4 -0
  1014. data/spec/fixtures/buildfiles/project_test/not_project/Buildfile +2 -0
  1015. data/spec/fixtures/buildfiles/project_test/not_project/child/PLACEHOLDER +0 -0
  1016. data/spec/fixtures/entry_for_project/Buildfile +1 -0
  1017. data/spec/fixtures/entry_for_project/apps/test_app/entry.txt +0 -0
  1018. data/spec/fixtures/entry_for_project/apps/test_app/frameworks/nested/PLACEHOLDER +0 -0
  1019. data/spec/fixtures/entry_for_project/frameworks/shared/PLACEHOLDER +0 -0
  1020. data/spec/fixtures/find_targets/custom/Buildfile +8 -0
  1021. data/spec/fixtures/find_targets/custom/bars/bar1/bars/bar1/PLACEHOLDER +0 -0
  1022. data/spec/fixtures/find_targets/custom/bars/bar1/bars/bar2/PLACEHOLDER +0 -0
  1023. data/spec/fixtures/find_targets/custom/bars/bar1/foos/foo1/PLACEHOLDER +0 -0
  1024. data/spec/fixtures/find_targets/custom/bars/bar1/foos/foo2/PLACEHOLDER +0 -0
  1025. data/spec/fixtures/find_targets/custom/foos/custom_foos/Buildfile +5 -0
  1026. data/spec/fixtures/find_targets/custom/foos/custom_foos/custom_foodir/foo1/PLACEHOLDER +0 -0
  1027. data/spec/fixtures/find_targets/custom/foos/custom_foos/custom_foodir/foo2/PLACEHOLDER +0 -0
  1028. data/spec/fixtures/find_targets/custom/foos/custom_foos/foos/not_foo1/PLACEHOLDER +0 -0
  1029. data/spec/fixtures/find_targets/custom/foos/foo1/bars/bar1/PLACEHOLDER +0 -0
  1030. data/spec/fixtures/find_targets/custom/foos/foo1/bars/bar2/PLACEHOLDER +0 -0
  1031. data/spec/fixtures/find_targets/nested/Buildfile +8 -0
  1032. data/spec/fixtures/find_targets/nested/apps/app1/Buildfile +1 -0
  1033. data/spec/fixtures/find_targets/nested/apps/app1/apps/nested_app/PLACEHOLDER +0 -0
  1034. data/spec/fixtures/find_targets/standard/Apps/app1/frameworks/framework1/PLACEHOLDER +0 -0
  1035. data/spec/fixtures/find_targets/standard/Apps/app1/frameworks/framework2/PLACEHOLDER +0 -0
  1036. data/spec/fixtures/find_targets/standard/clients/client1/PLACEHOLDER +0 -0
  1037. data/spec/fixtures/find_targets/standard/frameworks/framework1/frameworks/framework1/PLACEHOLDER +0 -0
  1038. data/spec/fixtures/find_targets/standard/frameworks/framework2/PLACEHOLDER +0 -0
  1039. data/spec/fixtures/find_targets/standard/themes/theme1/PLACEHOLDER +0 -0
  1040. data/spec/fixtures/find_targets/standard/themes/theme2/PLACEHOLDER +0 -0
  1041. data/spec/fixtures/languages/apps/caps_long_names/English.lproj/PLACEHOLDER +0 -0
  1042. data/spec/fixtures/languages/apps/caps_long_names/FreNCH.lproj/PLACEHOLDER +0 -0
  1043. data/spec/fixtures/languages/apps/caps_long_names/UnknOWN.lproj/PLACEHOLDER +0 -0
  1044. data/spec/fixtures/languages/apps/long_names/english.lproj/PLACEHOLDER +0 -0
  1045. data/spec/fixtures/languages/apps/long_names/french.lproj/PLACEHOLDER +0 -0
  1046. data/spec/fixtures/languages/apps/long_names/german.lproj/PLACEHOLDER +0 -0
  1047. data/spec/fixtures/languages/apps/long_names/italian.lproj/PLACEHOLDER +0 -0
  1048. data/spec/fixtures/languages/apps/long_names/japanese.lproj/PLACEHOLDER +0 -0
  1049. data/spec/fixtures/languages/apps/long_names/spanish.lproj/PLACEHOLDER +0 -0
  1050. data/spec/fixtures/languages/apps/long_names/unknown.lproj/PLACEHOLDER +0 -0
  1051. data/spec/fixtures/languages/apps/no_names/PLACEHOLDER +0 -0
  1052. data/spec/fixtures/languages/apps/short_names/de.lproj/PLACEHOLDER +0 -0
  1053. data/spec/fixtures/languages/apps/short_names/en-CA.lproj/PLACEHOLDER +0 -0
  1054. data/spec/fixtures/languages/apps/short_names/en-GB.lproj/PLACEHOLDER +0 -0
  1055. data/spec/fixtures/languages/apps/short_names/en-US.lproj/PLACEHOLDER +0 -0
  1056. data/spec/fixtures/languages/apps/short_names/en.lproj/PLACEHOLDER +0 -0
  1057. data/spec/fixtures/languages/apps/short_names/es.lproj/PLACEHOLDER +0 -0
  1058. data/spec/fixtures/languages/apps/short_names/foo.lproj/PLACEHOLDER +0 -0
  1059. data/spec/fixtures/languages/apps/short_names/fr.lproj/PLACEHOLDER +0 -0
  1060. data/spec/fixtures/languages/apps/short_names/it.lproj/PLACEHOLDER +0 -0
  1061. data/spec/fixtures/languages/apps/short_names/ja.lproj/PLACEHOLDER +0 -0
  1062. data/spec/fixtures/ordered_entries/apps/no_requires/1.js +1 -0
  1063. data/spec/fixtures/ordered_entries/apps/no_requires/B.js +1 -0
  1064. data/spec/fixtures/ordered_entries/apps/no_requires/a/a.js +1 -0
  1065. data/spec/fixtures/ordered_entries/apps/no_requires/a/b.js +1 -0
  1066. data/spec/fixtures/ordered_entries/apps/no_requires/a.js +1 -0
  1067. data/spec/fixtures/ordered_entries/apps/no_requires/b/a.js +1 -0
  1068. data/spec/fixtures/ordered_entries/apps/no_requires/c.js +1 -0
  1069. data/spec/fixtures/ordered_entries/apps/no_requires/core.js +1 -0
  1070. data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/B.css +0 -0
  1071. data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a/a.css +0 -0
  1072. data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a/b.css +0 -0
  1073. data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a.css +0 -0
  1074. data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/b/a.css +0 -0
  1075. data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/c.css +0 -0
  1076. data/spec/fixtures/ordered_entries/apps/no_requires/lproj/strings.js +1 -0
  1077. data/spec/fixtures/ordered_entries/apps/no_requires/utils.js +1 -0
  1078. data/spec/fixtures/ordered_entries/apps/with_requires/a.js +2 -0
  1079. data/spec/fixtures/ordered_entries/apps/with_requires/b.js +3 -0
  1080. data/spec/fixtures/ordered_entries/apps/with_requires/c.js +2 -0
  1081. data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/a.css +2 -0
  1082. data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/b.css +2 -0
  1083. data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/c.css +2 -0
  1084. data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/d.js +1 -0
  1085. data/spec/fixtures/real_world/Buildfile +12 -0
  1086. data/spec/fixtures/real_world/apps/account/README +1 -0
  1087. data/spec/fixtures/real_world/apps/calendar/README +1 -0
  1088. data/spec/fixtures/real_world/apps/contacts/README_BEFORE_EDITING +1 -0
  1089. data/spec/fixtures/real_world/apps/files/README +1 -0
  1090. data/spec/fixtures/real_world/apps/mail/README +1 -0
  1091. data/spec/fixtures/real_world/apps/mobile_photos/README +1 -0
  1092. data/spec/fixtures/real_world/apps/photos/README +1 -0
  1093. data/spec/fixtures/real_world/apps/uploader/README +1 -0
  1094. data/spec/fixtures/real_world/frameworks/core_files/PLACEHOLDER +0 -0
  1095. data/spec/fixtures/real_world/frameworks/core_photos/PLACEHOLDER +0 -0
  1096. data/spec/fixtures/real_world/frameworks/shared/PLACEHOLDER +0 -0
  1097. data/spec/fixtures/real_world/frameworks/sproutcore/Buildfile +26 -0
  1098. data/spec/fixtures/real_world/frameworks/sproutcore/README +1 -0
  1099. data/spec/fixtures/real_world/frameworks/sproutcore/apps/docs/PLACEHOLDER +0 -0
  1100. data/spec/fixtures/real_world/frameworks/sproutcore/apps/test_runner/PLACEHOLDER +0 -0
  1101. data/spec/fixtures/real_world/frameworks/sproutcore/core.js +0 -0
  1102. data/spec/fixtures/real_world/frameworks/sproutcore/debug/debug-resource.html +0 -0
  1103. data/spec/fixtures/real_world/frameworks/sproutcore/debug/sample_debug.js +0 -0
  1104. data/spec/fixtures/real_world/frameworks/sproutcore/demo2.js +0 -0
  1105. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/debug/sample_debug-loc.js +0 -0
  1106. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.css +4 -0
  1107. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.html +1 -0
  1108. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo2.sass +0 -0
  1109. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.haml +0 -0
  1110. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.html.erb +1 -0
  1111. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.rhtml +0 -0
  1112. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/fixtures/sample_fixtures-loc.js +0 -0
  1113. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/has_require.css +4 -0
  1114. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_require.css +1 -0
  1115. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_sc_resource.rhtml +1 -0
  1116. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/protocols/sample-loc.js +0 -0
  1117. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.css +6 -0
  1118. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.rhtml +3 -0
  1119. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/strings.js +1 -0
  1120. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/tests/sample-loc.js +0 -0
  1121. data/spec/fixtures/real_world/frameworks/sproutcore/fixtures/sample-json-fixture.json +1 -0
  1122. data/spec/fixtures/real_world/frameworks/sproutcore/fixtures/sample_fixtures.js +0 -0
  1123. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/application/PLACEHOLDER +0 -0
  1124. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/costello/core.js +0 -0
  1125. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/data_store/PLACEHOLDER +0 -0
  1126. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/debug/PLACEHOLDER +0 -0
  1127. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/desktop/PLACEHOLDER +0 -0
  1128. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/empty_theme/PLACEHOLDER +0 -0
  1129. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/foundation/PLACEHOLDER +0 -0
  1130. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/mobile/PLACEHOLDER +0 -0
  1131. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/qunit/PLACEHOLDER +0 -0
  1132. data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/uploader/PLACEHOLDER +0 -0
  1133. data/spec/fixtures/real_world/frameworks/sproutcore/french.lproj/french-resource.js +0 -0
  1134. data/spec/fixtures/real_world/frameworks/sproutcore/french.lproj/strings.js +1 -0
  1135. data/spec/fixtures/real_world/frameworks/sproutcore/german.lproj/german-resource.js +0 -0
  1136. data/spec/fixtures/real_world/frameworks/sproutcore/german.lproj/strings.js +0 -0
  1137. data/spec/fixtures/real_world/frameworks/sproutcore/has_require.js +4 -0
  1138. data/spec/fixtures/real_world/frameworks/sproutcore/lib/index.html +1 -0
  1139. data/spec/fixtures/real_world/frameworks/sproutcore/no_require.js +1 -0
  1140. data/spec/fixtures/real_world/frameworks/sproutcore/protocols/sample.js +0 -0
  1141. data/spec/fixtures/real_world/frameworks/sproutcore/resources/boo.png +0 -0
  1142. data/spec/fixtures/real_world/frameworks/sproutcore/sc_resource.js +6 -0
  1143. data/spec/fixtures/real_world/frameworks/sproutcore/tests/nested/sample1.js +0 -0
  1144. data/spec/fixtures/real_world/frameworks/sproutcore/tests/nested/sample2.js +0 -0
  1145. data/spec/fixtures/real_world/frameworks/sproutcore/tests/sample.js +0 -0
  1146. data/spec/fixtures/real_world/frameworks/sproutcore/tests/sample.rhtml +1 -0
  1147. data/spec/fixtures/real_world/frameworks/sproutcore/themes/standard_theme/README +0 -0
  1148. data/spec/fixtures/real_world/frameworks/sproutcore/views/view.js +1 -0
  1149. data/spec/fixtures/real_world/generators/sample_custom/Buildfile +0 -0
  1150. data/spec/fixtures/recursive_project/Buildfile +8 -0
  1151. data/spec/fixtures/recursive_project/frameworks/sproutcore/frameworks/costello/PLACEHOLDER +0 -0
  1152. data/spec/lib/builders/bundle_spec.rb +294 -0
  1153. data/spec/lib/builders/combine_spec.rb +67 -0
  1154. data/spec/lib/builders/html_spec.rb +579 -0
  1155. data/spec/lib/builders/javascript_spec.rb +81 -0
  1156. data/spec/lib/builders/sass_spec.rb +43 -0
  1157. data/spec/lib/builders/spec_helper.rb +30 -0
  1158. data/spec/lib/builders/strings_spec.rb +52 -0
  1159. data/spec/lib/builders/stylesheet_spec.rb +63 -0
  1160. data/spec/lib/builders/test_index_spec.rb +44 -0
  1161. data/spec/lib/builders/test_spec.rb +136 -0
  1162. data/spec/lib/buildfile/config_for_spec.rb +81 -0
  1163. data/spec/lib/buildfile/define_spec.rb +59 -0
  1164. data/spec/lib/buildfile/dup_spec.rb +65 -0
  1165. data/spec/lib/buildfile/invoke_spec.rb +130 -0
  1166. data/spec/lib/buildfile/load_spec.rb +49 -0
  1167. data/spec/lib/buildfile/task/dup_spec.rb +55 -0
  1168. data/spec/lib/buildfile/task_defined_spec.rb +17 -0
  1169. data/spec/lib/buildfile_commands/build_task_spec.rb +19 -0
  1170. data/spec/lib/buildfile_commands/config_spec.rb +97 -0
  1171. data/spec/lib/buildfile_commands/import_spec.rb +17 -0
  1172. data/spec/lib/buildfile_commands/namespace_spec.rb +18 -0
  1173. data/spec/lib/buildfile_commands/proxies_spec.rb +38 -0
  1174. data/spec/lib/buildfile_commands/replace_task_spec.rb +29 -0
  1175. data/spec/lib/buildfile_commands/task_spec.rb +36 -0
  1176. data/spec/lib/helpers/packing_optimizer/optimize_spec.rb +26 -0
  1177. data/spec/lib/models/hash_struct/deep_clone_spec.rb +27 -0
  1178. data/spec/lib/models/hash_struct/has_options_spec.rb +32 -0
  1179. data/spec/lib/models/hash_struct/hash_spec.rb +64 -0
  1180. data/spec/lib/models/hash_struct/merge_spec.rb +26 -0
  1181. data/spec/lib/models/hash_struct/method_missing.rb +41 -0
  1182. data/spec/lib/models/manifest/add_entry_spec.rb +36 -0
  1183. data/spec/lib/models/manifest/add_transform_spec.rb +91 -0
  1184. data/spec/lib/models/manifest/build_spec.rb +78 -0
  1185. data/spec/lib/models/manifest/entry_for_spec.rb +94 -0
  1186. data/spec/lib/models/manifest/find_entry.rb +97 -0
  1187. data/spec/lib/models/manifest/prepare_spec.rb +62 -0
  1188. data/spec/lib/models/manifest_entry/cacheable_url_spec.rb +31 -0
  1189. data/spec/lib/models/manifest_entry/prepare_spec.rb +54 -0
  1190. data/spec/lib/models/project/add_target_spec.rb +44 -0
  1191. data/spec/lib/models/project/buildfile_spec.rb +35 -0
  1192. data/spec/lib/models/project/find_targets_for_spec.rb +78 -0
  1193. data/spec/lib/models/project/load_nearest_project_spec.rb +23 -0
  1194. data/spec/lib/models/project/target_for_spec.rb +33 -0
  1195. data/spec/lib/models/project/targets_spec.rb +62 -0
  1196. data/spec/lib/models/target/compute_build_number_spec.rb +125 -0
  1197. data/spec/lib/models/target/config_spec.rb +30 -0
  1198. data/spec/lib/models/target/expand_required_targets_spec.rb +48 -0
  1199. data/spec/lib/models/target/installed_languages_spec.rb +47 -0
  1200. data/spec/lib/models/target/lproj_for_spec.rb +38 -0
  1201. data/spec/lib/models/target/manifest_for_spec.rb +42 -0
  1202. data/spec/lib/models/target/parent_target_spec.rb +21 -0
  1203. data/spec/lib/models/target/prepare_spec.rb +53 -0
  1204. data/spec/lib/models/target/required_targets_spec.rb +119 -0
  1205. data/spec/lib/models/target/target_for_spec.rb +56 -0
  1206. data/spec/lib/tools/build_number_spec.rb +28 -0
  1207. data/spec/lib/tools/gen_spec.rb +207 -0
  1208. data/spec/lib/tools/tools_spec.rb +78 -0
  1209. data/spec/spec.opts +3 -0
  1210. data/spec/spec_helper.rb +137 -6
  1211. data/sproutcore-abbot.gemspec +1582 -0
  1212. data/vendor/github_gem_lint.rb +22 -0
  1213. data/{jsdoc → vendor/jsdoc}/README.txt +0 -0
  1214. data/vendor/jsdoc/app/frame/Chain.js +102 -0
  1215. data/vendor/jsdoc/app/frame/Dumper.js +144 -0
  1216. data/vendor/jsdoc/app/frame/Hash.js +47 -0
  1217. data/vendor/jsdoc/app/frame/Link.js +142 -0
  1218. data/vendor/jsdoc/app/frame/Namespace.js +10 -0
  1219. data/vendor/jsdoc/app/frame/Opt.js +134 -0
  1220. data/vendor/jsdoc/app/frame/Reflection.js +26 -0
  1221. data/vendor/jsdoc/app/frame/String.js +93 -0
  1222. data/vendor/jsdoc/app/frame/Testrun.js +129 -0
  1223. data/vendor/jsdoc/app/frame.js +33 -0
  1224. data/vendor/jsdoc/app/handlers/FOODOC.js +26 -0
  1225. data/{jsdoc → vendor/jsdoc}/app/handlers/XMLDOC/DomReader.js +0 -0
  1226. data/{jsdoc → vendor/jsdoc}/app/handlers/XMLDOC/XMLDoc.js +0 -0
  1227. data/{jsdoc → vendor/jsdoc}/app/handlers/XMLDOC/XMLParse.js +0 -0
  1228. data/vendor/jsdoc/app/handlers/XMLDOC.js +26 -0
  1229. data/vendor/jsdoc/app/lib/JSDOC/DocComment.js +200 -0
  1230. data/vendor/jsdoc/app/lib/JSDOC/DocTag.js +294 -0
  1231. data/vendor/jsdoc/app/lib/JSDOC/JsDoc.js +162 -0
  1232. data/vendor/jsdoc/app/lib/JSDOC/JsPlate.js +100 -0
  1233. data/vendor/jsdoc/app/lib/JSDOC/Lang.js +144 -0
  1234. data/vendor/jsdoc/app/lib/JSDOC/Parser.js +109 -0
  1235. data/vendor/jsdoc/app/lib/JSDOC/PluginManager.js +33 -0
  1236. data/vendor/jsdoc/app/lib/JSDOC/Symbol.js +681 -0
  1237. data/vendor/jsdoc/app/lib/JSDOC/SymbolSet.js +226 -0
  1238. data/vendor/jsdoc/app/lib/JSDOC/TextStream.js +41 -0
  1239. data/vendor/jsdoc/app/lib/JSDOC/Token.js +18 -0
  1240. data/vendor/jsdoc/app/lib/JSDOC/TokenReader.js +332 -0
  1241. data/vendor/jsdoc/app/lib/JSDOC/TokenStream.js +133 -0
  1242. data/vendor/jsdoc/app/lib/JSDOC/Util.js +32 -0
  1243. data/vendor/jsdoc/app/lib/JSDOC/Walker.js +453 -0
  1244. data/vendor/jsdoc/app/lib/JSDOC.js +98 -0
  1245. data/vendor/jsdoc/app/main.js +74 -0
  1246. data/vendor/jsdoc/app/plugins/commentSrcJson.js +19 -0
  1247. data/vendor/jsdoc/app/plugins/frameworkPrototype.js +16 -0
  1248. data/vendor/jsdoc/app/plugins/functionCall.js +10 -0
  1249. data/vendor/jsdoc/app/plugins/publishSrcHilite.js +62 -0
  1250. data/{jsdoc → vendor/jsdoc}/app/plugins/sproutcoreTags.js +0 -0
  1251. data/vendor/jsdoc/app/plugins/symbolLink.js +9 -0
  1252. data/vendor/jsdoc/app/plugins/tagParamConfig.js +31 -0
  1253. data/vendor/jsdoc/app/plugins/tagSynonyms.js +43 -0
  1254. data/vendor/jsdoc/app/run.js +346 -0
  1255. data/vendor/jsdoc/app/t/TestDoc.js +144 -0
  1256. data/{jsdoc → vendor/jsdoc/app}/t/runner.js +0 -0
  1257. data/{jsdoc → vendor/jsdoc/app}/test/addon.js +0 -0
  1258. data/{jsdoc → vendor/jsdoc/app}/test/anon_inner.js +0 -0
  1259. data/vendor/jsdoc/app/test/augments.js +31 -0
  1260. data/vendor/jsdoc/app/test/augments2.js +26 -0
  1261. data/vendor/jsdoc/app/test/borrows.js +41 -0
  1262. data/vendor/jsdoc/app/test/borrows2.js +23 -0
  1263. data/{jsdoc → vendor/jsdoc/app}/test/config.js +0 -0
  1264. data/vendor/jsdoc/app/test/constructs.js +18 -0
  1265. data/{jsdoc → vendor/jsdoc/app}/test/encoding.js +0 -0
  1266. data/{jsdoc → vendor/jsdoc/app}/test/encoding_other.js +0 -0
  1267. data/vendor/jsdoc/app/test/functions_anon.js +39 -0
  1268. data/vendor/jsdoc/app/test/functions_nested.js +33 -0
  1269. data/vendor/jsdoc/app/test/global.js +13 -0
  1270. data/vendor/jsdoc/app/test/globals.js +25 -0
  1271. data/vendor/jsdoc/app/test/ignore.js +10 -0
  1272. data/{jsdoc → vendor/jsdoc/app}/test/inner.js +0 -0
  1273. data/vendor/jsdoc/app/test/jsdoc_test.js +477 -0
  1274. data/vendor/jsdoc/app/test/lend.js +33 -0
  1275. data/vendor/jsdoc/app/test/memberof.js +20 -0
  1276. data/vendor/jsdoc/app/test/memberof_constructor.js +15 -0
  1277. data/vendor/jsdoc/app/test/name.js +19 -0
  1278. data/vendor/jsdoc/app/test/namespace_nested.js +23 -0
  1279. data/{jsdoc → vendor/jsdoc/app}/test/nocode.js +0 -0
  1280. data/vendor/jsdoc/app/test/oblit_anon.js +20 -0
  1281. data/vendor/jsdoc/app/test/overview.js +20 -0
  1282. data/vendor/jsdoc/app/test/param_inline.js +37 -0
  1283. data/{jsdoc → vendor/jsdoc/app}/test/params_optional.js +0 -0
  1284. data/vendor/jsdoc/app/test/prototype.js +17 -0
  1285. data/{jsdoc → vendor/jsdoc/app}/test/prototype_nested.js +0 -0
  1286. data/vendor/jsdoc/app/test/prototype_oblit.js +13 -0
  1287. data/vendor/jsdoc/app/test/prototype_oblit_constructor.js +24 -0
  1288. data/vendor/jsdoc/app/test/public.js +10 -0
  1289. data/{jsdoc → vendor/jsdoc/app}/test/shared.js +0 -0
  1290. data/{jsdoc → vendor/jsdoc/app}/test/shared2.js +0 -0
  1291. data/vendor/jsdoc/app/test/shortcuts.js +22 -0
  1292. data/vendor/jsdoc/app/test/static_this.js +13 -0
  1293. data/vendor/jsdoc/app/test/synonyms.js +23 -0
  1294. data/{jsdoc → vendor/jsdoc/app}/test/tosource.js +0 -0
  1295. data/vendor/jsdoc/app/test/variable_redefine.js +14 -0
  1296. data/vendor/jsdoc/app/test.js +304 -0
  1297. data/{jsdoc → vendor/jsdoc}/changes.txt +0 -0
  1298. data/{jsdoc → vendor/jsdoc}/conf/sample.conf +0 -0
  1299. data/{jsdoc → vendor/jsdoc}/java/build.xml +0 -0
  1300. data/{jsdoc → vendor/jsdoc}/java/build_1.4.xml +0 -0
  1301. data/{jsdoc → vendor/jsdoc}/java/classes/js.jar +0 -0
  1302. data/{jsdoc → vendor/jsdoc}/java/src/JsDebugRun.java +0 -0
  1303. data/{jsdoc → vendor/jsdoc}/java/src/JsRun.java +0 -0
  1304. data/{jsdoc → vendor/jsdoc}/jsdebug.jar +0 -0
  1305. data/{jsdoc → vendor/jsdoc}/jsrun.jar +0 -0
  1306. data/{jsdoc → vendor/jsdoc}/t/TestDoc.js +0 -0
  1307. data/vendor/jsdoc/t/runner.js +13 -0
  1308. data/vendor/jsdoc/test/addon.js +24 -0
  1309. data/vendor/jsdoc/test/anon_inner.js +14 -0
  1310. data/{jsdoc → vendor/jsdoc}/test/augments.js +0 -0
  1311. data/{jsdoc → vendor/jsdoc}/test/augments2.js +0 -0
  1312. data/{jsdoc → vendor/jsdoc}/test/borrows.js +0 -0
  1313. data/{jsdoc → vendor/jsdoc}/test/borrows2.js +0 -0
  1314. data/vendor/jsdoc/test/config.js +22 -0
  1315. data/{jsdoc → vendor/jsdoc}/test/constructs.js +0 -0
  1316. data/vendor/jsdoc/test/encoding.js +10 -0
  1317. data/vendor/jsdoc/test/encoding_other.js +12 -0
  1318. data/{jsdoc → vendor/jsdoc}/test/functions_anon.js +0 -0
  1319. data/{jsdoc → vendor/jsdoc}/test/functions_nested.js +0 -0
  1320. data/{jsdoc → vendor/jsdoc}/test/global.js +0 -0
  1321. data/{jsdoc → vendor/jsdoc}/test/globals.js +0 -0
  1322. data/{jsdoc → vendor/jsdoc}/test/ignore.js +0 -0
  1323. data/vendor/jsdoc/test/inner.js +16 -0
  1324. data/{jsdoc → vendor/jsdoc}/test/jsdoc_test.js +0 -0
  1325. data/{jsdoc → vendor/jsdoc}/test/lend.js +0 -0
  1326. data/{jsdoc → vendor/jsdoc}/test/memberof.js +0 -0
  1327. data/{jsdoc → vendor/jsdoc}/test/memberof_constructor.js +0 -0
  1328. data/{jsdoc → vendor/jsdoc}/test/name.js +0 -0
  1329. data/{jsdoc → vendor/jsdoc}/test/namespace_nested.js +0 -0
  1330. data/vendor/jsdoc/test/nocode.js +13 -0
  1331. data/{jsdoc → vendor/jsdoc}/test/oblit_anon.js +0 -0
  1332. data/{jsdoc → vendor/jsdoc}/test/overview.js +0 -0
  1333. data/{jsdoc → vendor/jsdoc}/test/param_inline.js +0 -0
  1334. data/vendor/jsdoc/test/params_optional.js +8 -0
  1335. data/{jsdoc → vendor/jsdoc}/test/prototype.js +0 -0
  1336. data/vendor/jsdoc/test/prototype_nested.js +9 -0
  1337. data/{jsdoc → vendor/jsdoc}/test/prototype_oblit.js +0 -0
  1338. data/{jsdoc → vendor/jsdoc}/test/prototype_oblit_constructor.js +0 -0
  1339. data/{jsdoc → vendor/jsdoc}/test/public.js +0 -0
  1340. data/vendor/jsdoc/test/shared.js +42 -0
  1341. data/vendor/jsdoc/test/shared2.js +2 -0
  1342. data/{jsdoc → vendor/jsdoc}/test/shortcuts.js +0 -0
  1343. data/{jsdoc → vendor/jsdoc}/test/static_this.js +0 -0
  1344. data/{jsdoc → vendor/jsdoc}/test/synonyms.js +0 -0
  1345. data/vendor/jsdoc/test/tosource.js +23 -0
  1346. data/{jsdoc → vendor/jsdoc}/test/variable_redefine.js +0 -0
  1347. data/{jsdoc → vendor/jsdoc}/test.js +0 -0
  1348. data/{yui_compressor → vendor/yui-compressor}/yuicompressor-2.4.2.jar +0 -0
  1349. metadata +1537 -431
  1350. data/License.txt +0 -20
  1351. data/Manifest.txt +0 -415
  1352. data/app_generators/sproutcore/USAGE +0 -4
  1353. data/app_generators/sproutcore/sproutcore_generator.rb +0 -68
  1354. data/app_generators/sproutcore/templates/README +0 -80
  1355. data/app_generators/sproutcore/templates/sc-config +0 -93
  1356. data/bin/sc-ide +0 -278
  1357. data/bin/sc-install +0 -101
  1358. data/bin/sc-remove +0 -99
  1359. data/bin/sc-update +0 -99
  1360. data/clients/sc_docs/HISTORY +0 -3
  1361. data/clients/sc_docs/README +0 -6
  1362. data/clients/sc_docs/controllers/docs.js +0 -150
  1363. data/clients/sc_docs/core.js +0 -19
  1364. data/clients/sc_docs/english.lproj/body.css +0 -112
  1365. data/clients/sc_docs/english.lproj/body.rhtml +0 -58
  1366. data/clients/sc_docs/english.lproj/no_docs.rhtml +0 -8
  1367. data/clients/sc_docs/english.lproj/strings.js +0 -14
  1368. data/clients/sc_docs/english.lproj/tabs.rhtml +0 -16
  1369. data/clients/sc_docs/fixtures/doc.js +0 -11
  1370. data/clients/sc_docs/main.js +0 -26
  1371. data/clients/sc_docs/models/doc.js +0 -15
  1372. data/clients/sc_docs/tests/controllers/docs.rhtml +0 -20
  1373. data/clients/sc_docs/tests/models/doc.rhtml +0 -20
  1374. data/clients/sc_docs/tests/views/doc_frame.rhtml +0 -20
  1375. data/clients/sc_docs/tests/views/doc_label_view.rhtml +0 -20
  1376. data/clients/sc_docs/views/doc_frame.js +0 -33
  1377. data/clients/sc_docs/views/doc_label.js +0 -20
  1378. data/clients/sc_test_runner/HISTORY +0 -3
  1379. data/clients/sc_test_runner/README +0 -4
  1380. data/clients/sc_test_runner/controllers/runner.js +0 -203
  1381. data/clients/sc_test_runner/core.js +0 -19
  1382. data/clients/sc_test_runner/english.lproj/body.css +0 -91
  1383. data/clients/sc_test_runner/english.lproj/body.rhtml +0 -76
  1384. data/clients/sc_test_runner/english.lproj/icons/small/next.png +0 -0
  1385. data/clients/sc_test_runner/english.lproj/icons/small/reset.png +0 -0
  1386. data/clients/sc_test_runner/english.lproj/images/gradients.png +0 -0
  1387. data/clients/sc_test_runner/english.lproj/images/toolbar.png +0 -0
  1388. data/clients/sc_test_runner/english.lproj/no_tests.rhtml +0 -5
  1389. data/clients/sc_test_runner/english.lproj/strings.js +0 -14
  1390. data/clients/sc_test_runner/fixtures/test.js +0 -12
  1391. data/clients/sc_test_runner/main.js +0 -21
  1392. data/clients/sc_test_runner/models/test.js +0 -27
  1393. data/clients/sc_test_runner/views/runner_frame.js +0 -74
  1394. data/clients/sc_test_runner/views/test_label.js +0 -20
  1395. data/config/hoe.rb +0 -72
  1396. data/config/requirements.rb +0 -17
  1397. data/frameworks/prototype/HISTORY +0 -3
  1398. data/frameworks/prototype/README +0 -2
  1399. data/frameworks/prototype/prototype.js +0 -4223
  1400. data/frameworks/sproutcore/controllers/array.js +0 -409
  1401. data/frameworks/sproutcore/controllers/collection.js +0 -203
  1402. data/frameworks/sproutcore/controllers/controller.js +0 -323
  1403. data/frameworks/sproutcore/controllers/object.js +0 -401
  1404. data/frameworks/sproutcore/core.js +0 -636
  1405. data/frameworks/sproutcore/debug/trace.js +0 -81
  1406. data/frameworks/sproutcore/debug/unittest.js +0 -626
  1407. data/frameworks/sproutcore/drag/drag.js +0 -788
  1408. data/frameworks/sproutcore/drag/drag_data_source.js +0 -40
  1409. data/frameworks/sproutcore/drag/drag_source.js +0 -75
  1410. data/frameworks/sproutcore/drag/drop_target.js +0 -160
  1411. data/frameworks/sproutcore/english.lproj/buttons.css +0 -694
  1412. data/frameworks/sproutcore/english.lproj/core.css +0 -145
  1413. data/frameworks/sproutcore/english.lproj/detect-browser +0 -44
  1414. data/frameworks/sproutcore/english.lproj/icons.css +0 -227
  1415. data/frameworks/sproutcore/english.lproj/images/indicator.gif +0 -0
  1416. data/frameworks/sproutcore/english.lproj/images/sc-theme-sprite.png +0 -0
  1417. data/frameworks/sproutcore/english.lproj/menu.css +0 -122
  1418. data/frameworks/sproutcore/english.lproj/panes.css +0 -136
  1419. data/frameworks/sproutcore/english.lproj/picker.css +0 -22
  1420. data/frameworks/sproutcore/english.lproj/splitview.css +0 -83
  1421. data/frameworks/sproutcore/english.lproj/strings.js +0 -20
  1422. data/frameworks/sproutcore/english.lproj/tab.css +0 -23
  1423. data/frameworks/sproutcore/english.lproj/tests.css +0 -67
  1424. data/frameworks/sproutcore/english.lproj/theme.css +0 -502
  1425. data/frameworks/sproutcore/foundation/animator.js +0 -679
  1426. data/frameworks/sproutcore/foundation/application.js +0 -228
  1427. data/frameworks/sproutcore/foundation/benchmark.js +0 -244
  1428. data/frameworks/sproutcore/foundation/binding.js +0 -385
  1429. data/frameworks/sproutcore/foundation/date.js +0 -357
  1430. data/frameworks/sproutcore/foundation/enumerator.js +0 -105
  1431. data/frameworks/sproutcore/foundation/error.js +0 -84
  1432. data/frameworks/sproutcore/foundation/input_manager.js +0 -165
  1433. data/frameworks/sproutcore/foundation/json.js +0 -296
  1434. data/frameworks/sproutcore/foundation/mock.js +0 -42
  1435. data/frameworks/sproutcore/foundation/node_descriptor.js +0 -71
  1436. data/frameworks/sproutcore/foundation/object.js +0 -875
  1437. data/frameworks/sproutcore/foundation/page.js +0 -67
  1438. data/frameworks/sproutcore/foundation/path_module.js +0 -431
  1439. data/frameworks/sproutcore/foundation/responder.js +0 -313
  1440. data/frameworks/sproutcore/foundation/routes.js +0 -375
  1441. data/frameworks/sproutcore/foundation/run_loop.js +0 -322
  1442. data/frameworks/sproutcore/foundation/set.js +0 -222
  1443. data/frameworks/sproutcore/foundation/string.js +0 -319
  1444. data/frameworks/sproutcore/foundation/timer.js +0 -405
  1445. data/frameworks/sproutcore/foundation/undo_manager.js +0 -186
  1446. data/frameworks/sproutcore/foundation/utils.js +0 -320
  1447. data/frameworks/sproutcore/globals/panels.js +0 -182
  1448. data/frameworks/sproutcore/globals/popups.js +0 -61
  1449. data/frameworks/sproutcore/globals/window.js +0 -498
  1450. data/frameworks/sproutcore/lib/button_views.rb +0 -330
  1451. data/frameworks/sproutcore/lib/collection_view.rb +0 -83
  1452. data/frameworks/sproutcore/lib/core_views.rb +0 -326
  1453. data/frameworks/sproutcore/lib/form_views.rb +0 -253
  1454. data/frameworks/sproutcore/lib/menu_views.rb +0 -93
  1455. data/frameworks/sproutcore/mixins/array.js +0 -265
  1456. data/frameworks/sproutcore/mixins/collection_view_delegate.js +0 -201
  1457. data/frameworks/sproutcore/mixins/control.js +0 -265
  1458. data/frameworks/sproutcore/mixins/delegate_support.js +0 -66
  1459. data/frameworks/sproutcore/mixins/editable.js +0 -144
  1460. data/frameworks/sproutcore/mixins/enumerable.js +0 -1002
  1461. data/frameworks/sproutcore/mixins/inline_editor_delegate.js +0 -82
  1462. data/frameworks/sproutcore/mixins/observable.js +0 -1060
  1463. data/frameworks/sproutcore/mixins/scrollable.js +0 -246
  1464. data/frameworks/sproutcore/mixins/selection_support.js +0 -160
  1465. data/frameworks/sproutcore/mixins/validatable.js +0 -152
  1466. data/frameworks/sproutcore/models/collection.js +0 -421
  1467. data/frameworks/sproutcore/models/record.js +0 -811
  1468. data/frameworks/sproutcore/models/store.js +0 -352
  1469. data/frameworks/sproutcore/panes/dialog.js +0 -16
  1470. data/frameworks/sproutcore/panes/manager.js +0 -164
  1471. data/frameworks/sproutcore/panes/menu.js +0 -45
  1472. data/frameworks/sproutcore/panes/overlay.js +0 -235
  1473. data/frameworks/sproutcore/panes/pane.js +0 -117
  1474. data/frameworks/sproutcore/panes/panel.js +0 -19
  1475. data/frameworks/sproutcore/panes/picker.js +0 -46
  1476. data/frameworks/sproutcore/server/rails_server.js +0 -79
  1477. data/frameworks/sproutcore/server/rest_server.js +0 -177
  1478. data/frameworks/sproutcore/server/server.js +0 -629
  1479. data/frameworks/sproutcore/tests/controllers/array.rhtml +0 -126
  1480. data/frameworks/sproutcore/tests/controllers/controller.rhtml +0 -273
  1481. data/frameworks/sproutcore/tests/controllers/object.rhtml +0 -353
  1482. data/frameworks/sproutcore/tests/core/guidFor.rhtml +0 -114
  1483. data/frameworks/sproutcore/tests/foundation/application.rhtml +0 -125
  1484. data/frameworks/sproutcore/tests/foundation/array.rhtml +0 -220
  1485. data/frameworks/sproutcore/tests/foundation/object.rhtml +0 -69
  1486. data/frameworks/sproutcore/tests/foundation/set.rhtml +0 -254
  1487. data/frameworks/sproutcore/tests/foundation/timer/invalidate.rhtml +0 -33
  1488. data/frameworks/sproutcore/tests/foundation/timer/invokeLater.rhtml +0 -145
  1489. data/frameworks/sproutcore/tests/foundation/timer/isPaused.rhtml +0 -70
  1490. data/frameworks/sproutcore/tests/foundation/timer/schedule.rhtml +0 -145
  1491. data/frameworks/sproutcore/tests/globals/window.rhtml +0 -45
  1492. data/frameworks/sproutcore/tests/mixins/enumerable.rhtml +0 -421
  1493. data/frameworks/sproutcore/tests/mixins/observable.rhtml +0 -127
  1494. data/frameworks/sproutcore/tests/models/collection.rhtml +0 -160
  1495. data/frameworks/sproutcore/tests/models/model.rhtml +0 -373
  1496. data/frameworks/sproutcore/tests/panes/pane.rhtml +0 -88
  1497. data/frameworks/sproutcore/tests/views/checkbox.rhtml +0 -21
  1498. data/frameworks/sproutcore/tests/views/collection/base.rhtml +0 -211
  1499. data/frameworks/sproutcore/tests/views/collection/incremental_rendering.rhtml +0 -260
  1500. data/frameworks/sproutcore/tests/views/collection/source_list_rendering.rhtml +0 -232
  1501. data/frameworks/sproutcore/tests/views/image_cell.rhtml +0 -19
  1502. data/frameworks/sproutcore/tests/views/label_item.rhtml +0 -19
  1503. data/frameworks/sproutcore/tests/views/list.rhtml +0 -20
  1504. data/frameworks/sproutcore/tests/views/list_item.rhtml +0 -20
  1505. data/frameworks/sproutcore/tests/views/popup_button.rhtml +0 -116
  1506. data/frameworks/sproutcore/tests/views/slider.rhtml +0 -20
  1507. data/frameworks/sproutcore/tests/views/text_cell.rhtml +0 -19
  1508. data/frameworks/sproutcore/tests/views/text_field.rhtml +0 -37
  1509. data/frameworks/sproutcore/tests/views/view/clippingFrame.rhtml +0 -401
  1510. data/frameworks/sproutcore/tests/views/view/frame.rhtml +0 -357
  1511. data/frameworks/sproutcore/tests/views/view/innerFrame.rhtml +0 -366
  1512. data/frameworks/sproutcore/tests/views/view/isVisibleInWindow.rhtml +0 -148
  1513. data/frameworks/sproutcore/tests/views/view/scrollFrame.rhtml +0 -467
  1514. data/frameworks/sproutcore/validators/credit_card.js +0 -112
  1515. data/frameworks/sproutcore/validators/date.js +0 -50
  1516. data/frameworks/sproutcore/validators/email.js +0 -47
  1517. data/frameworks/sproutcore/validators/not_empty.js +0 -34
  1518. data/frameworks/sproutcore/validators/number.js +0 -69
  1519. data/frameworks/sproutcore/validators/password.js +0 -89
  1520. data/frameworks/sproutcore/validators/validator.js +0 -314
  1521. data/frameworks/sproutcore/views/button/button.js +0 -478
  1522. data/frameworks/sproutcore/views/button/checkbox.js +0 -29
  1523. data/frameworks/sproutcore/views/button/disclosure.js +0 -42
  1524. data/frameworks/sproutcore/views/button/radio.js +0 -29
  1525. data/frameworks/sproutcore/views/collection/collection.js +0 -2764
  1526. data/frameworks/sproutcore/views/collection/grid.js +0 -251
  1527. data/frameworks/sproutcore/views/collection/image_cell.js +0 -125
  1528. data/frameworks/sproutcore/views/collection/list.js +0 -162
  1529. data/frameworks/sproutcore/views/collection/source_list.js +0 -458
  1530. data/frameworks/sproutcore/views/collection/table.js +0 -118
  1531. data/frameworks/sproutcore/views/container.js +0 -67
  1532. data/frameworks/sproutcore/views/error_explanation.js +0 -58
  1533. data/frameworks/sproutcore/views/field/checkbox_field.js +0 -40
  1534. data/frameworks/sproutcore/views/field/field.js +0 -218
  1535. data/frameworks/sproutcore/views/field/radio_field.js +0 -122
  1536. data/frameworks/sproutcore/views/field/select_field.js +0 -307
  1537. data/frameworks/sproutcore/views/field/text_field.js +0 -251
  1538. data/frameworks/sproutcore/views/field/textarea_field.js +0 -32
  1539. data/frameworks/sproutcore/views/filter_button.js +0 -29
  1540. data/frameworks/sproutcore/views/form.js +0 -597
  1541. data/frameworks/sproutcore/views/image.js +0 -255
  1542. data/frameworks/sproutcore/views/inline_text_field.js +0 -427
  1543. data/frameworks/sproutcore/views/label.js +0 -243
  1544. data/frameworks/sproutcore/views/list_item.js +0 -516
  1545. data/frameworks/sproutcore/views/menu_item.js +0 -97
  1546. data/frameworks/sproutcore/views/pagination.js +0 -62
  1547. data/frameworks/sproutcore/views/popup_button.js +0 -90
  1548. data/frameworks/sproutcore/views/popup_menu.js +0 -139
  1549. data/frameworks/sproutcore/views/progress.js +0 -125
  1550. data/frameworks/sproutcore/views/radio_group.js +0 -48
  1551. data/frameworks/sproutcore/views/scroll.js +0 -74
  1552. data/frameworks/sproutcore/views/segmented.js +0 -105
  1553. data/frameworks/sproutcore/views/slider.js +0 -134
  1554. data/frameworks/sproutcore/views/source_list_group.js +0 -130
  1555. data/frameworks/sproutcore/views/spinner.js +0 -11
  1556. data/frameworks/sproutcore/views/split.js +0 -312
  1557. data/frameworks/sproutcore/views/split_divider.js +0 -112
  1558. data/frameworks/sproutcore/views/tab.js +0 -128
  1559. data/frameworks/sproutcore/views/toolbar.js +0 -29
  1560. data/frameworks/sproutcore/views/view.js +0 -2301
  1561. data/jsdoc/app/frame/Chain.js +0 -102
  1562. data/jsdoc/app/frame/Dumper.js +0 -144
  1563. data/jsdoc/app/frame/Hash.js +0 -47
  1564. data/jsdoc/app/frame/Link.js +0 -142
  1565. data/jsdoc/app/frame/Namespace.js +0 -10
  1566. data/jsdoc/app/frame/Opt.js +0 -134
  1567. data/jsdoc/app/frame/Reflection.js +0 -26
  1568. data/jsdoc/app/frame/String.js +0 -93
  1569. data/jsdoc/app/frame/Testrun.js +0 -129
  1570. data/jsdoc/app/frame.js +0 -33
  1571. data/jsdoc/app/handlers/FOODOC.js +0 -26
  1572. data/jsdoc/app/handlers/XMLDOC.js +0 -26
  1573. data/jsdoc/app/lib/JSDOC/DocComment.js +0 -200
  1574. data/jsdoc/app/lib/JSDOC/DocTag.js +0 -294
  1575. data/jsdoc/app/lib/JSDOC/JsDoc.js +0 -180
  1576. data/jsdoc/app/lib/JSDOC/JsPlate.js +0 -100
  1577. data/jsdoc/app/lib/JSDOC/Lang.js +0 -144
  1578. data/jsdoc/app/lib/JSDOC/Parser.js +0 -109
  1579. data/jsdoc/app/lib/JSDOC/PluginManager.js +0 -33
  1580. data/jsdoc/app/lib/JSDOC/Symbol.js +0 -600
  1581. data/jsdoc/app/lib/JSDOC/SymbolSet.js +0 -220
  1582. data/jsdoc/app/lib/JSDOC/TextStream.js +0 -41
  1583. data/jsdoc/app/lib/JSDOC/Token.js +0 -18
  1584. data/jsdoc/app/lib/JSDOC/TokenReader.js +0 -323
  1585. data/jsdoc/app/lib/JSDOC/TokenStream.js +0 -133
  1586. data/jsdoc/app/lib/JSDOC/Util.js +0 -32
  1587. data/jsdoc/app/lib/JSDOC/Walker.js +0 -416
  1588. data/jsdoc/app/lib/JSDOC.js +0 -97
  1589. data/jsdoc/app/main.js +0 -74
  1590. data/jsdoc/app/plugins/commentSrcJson.js +0 -19
  1591. data/jsdoc/app/plugins/frameworkPrototype.js +0 -16
  1592. data/jsdoc/app/plugins/functionCall.js +0 -10
  1593. data/jsdoc/app/plugins/publishSrcHilite.js +0 -62
  1594. data/jsdoc/app/plugins/symbolLink.js +0 -9
  1595. data/jsdoc/app/plugins/tagParamConfig.js +0 -31
  1596. data/jsdoc/app/plugins/tagSynonyms.js +0 -43
  1597. data/jsdoc/app/run.js +0 -346
  1598. data/jsdoc/templates/sproutcore/allclasses.tmpl +0 -17
  1599. data/jsdoc/templates/sproutcore/allfiles.tmpl +0 -56
  1600. data/jsdoc/templates/sproutcore/class.tmpl +0 -423
  1601. data/jsdoc/templates/sproutcore/index.tmpl +0 -55
  1602. data/jsdoc/templates/sproutcore/publish.js +0 -333
  1603. data/jsdoc/templates/sproutcore/static/default.css +0 -191
  1604. data/jsdoc/templates/sproutcore/static/index.html +0 -19
  1605. data/jsdoc/templates/sproutcore/symbol.tmpl +0 -35
  1606. data/lib/sproutcore/build_tools/html_builder.rb +0 -163
  1607. data/lib/sproutcore/build_tools/resource_builder.rb +0 -256
  1608. data/lib/sproutcore/build_tools/test_template.rhtml +0 -12
  1609. data/lib/sproutcore/build_tools.rb +0 -44
  1610. data/lib/sproutcore/bundle.rb +0 -802
  1611. data/lib/sproutcore/bundle_installer.rb +0 -270
  1612. data/lib/sproutcore/bundle_manifest.rb +0 -574
  1613. data/lib/sproutcore/cssmin.rb +0 -195
  1614. data/lib/sproutcore/generator_helper.rb +0 -185
  1615. data/lib/sproutcore/helpers.rb +0 -3
  1616. data/lib/sproutcore/jsdoc.rb +0 -45
  1617. data/lib/sproutcore/jsmin.rb +0 -247
  1618. data/lib/sproutcore/library.rb +0 -479
  1619. data/lib/sproutcore/merb/bundle_controller.rb +0 -297
  1620. data/lib/sproutcore/merb/router.rb +0 -50
  1621. data/lib/sproutcore/merb.rb +0 -22
  1622. data/lib/sproutcore/renderers/erubis.rb +0 -43
  1623. data/lib/sproutcore/renderers/haml.rb +0 -28
  1624. data/lib/sproutcore/renderers/sass.rb +0 -42
  1625. data/lib/sproutcore/version.rb +0 -9
  1626. data/lib/sproutcore/view_helpers.rb +0 -656
  1627. data/sc-config +0 -16
  1628. data/sc_generators/client/README +0 -3
  1629. data/sc_generators/client/USAGE +0 -11
  1630. data/sc_generators/client/client_generator.rb +0 -45
  1631. data/sc_generators/client/templates/core.js +0 -16
  1632. data/sc_generators/client/templates/english.lproj/body.css +0 -147
  1633. data/sc_generators/client/templates/english.lproj/body.rhtml +0 -18
  1634. data/sc_generators/client/templates/english.lproj/strings.js +0 -13
  1635. data/sc_generators/client/templates/main.js +0 -35
  1636. data/sc_generators/controller/USAGE +0 -15
  1637. data/sc_generators/controller/controller_generator.rb +0 -51
  1638. data/sc_generators/controller/templates/controller.js +0 -21
  1639. data/sc_generators/controller/templates/test.rhtml +0 -22
  1640. data/sc_generators/framework/README +0 -6
  1641. data/sc_generators/framework/USAGE +0 -11
  1642. data/sc_generators/framework/framework_generator.rb +0 -53
  1643. data/sc_generators/framework/templates/core.js +0 -20
  1644. data/sc_generators/framework/templates/english.lproj/strings.js +0 -13
  1645. data/sc_generators/language/USAGE +0 -13
  1646. data/sc_generators/language/language_generator.rb +0 -47
  1647. data/sc_generators/language/templates/strings.js +0 -13
  1648. data/sc_generators/model/USAGE +0 -23
  1649. data/sc_generators/model/model_generator.rb +0 -55
  1650. data/sc_generators/model/templates/fixture.js +0 -43
  1651. data/sc_generators/model/templates/model.js +0 -20
  1652. data/sc_generators/model/templates/test.rhtml +0 -21
  1653. data/sc_generators/test/USAGE +0 -15
  1654. data/sc_generators/test/templates/test.rhtml +0 -21
  1655. data/sc_generators/test/test_generator.rb +0 -47
  1656. data/sc_generators/view/USAGE +0 -15
  1657. data/sc_generators/view/templates/test.rhtml +0 -21
  1658. data/sc_generators/view/templates/view.js +0 -20
  1659. data/sc_generators/view/view_generator.rb +0 -51
  1660. data/script/destroy +0 -14
  1661. data/script/generate +0 -14
  1662. data/script/txt2html +0 -74
  1663. data/setup.rb +0 -1585
  1664. data/spec/sproutcore_spec.rb +0 -11
  1665. data/tasks/deployment.rake +0 -47
  1666. data/tasks/environment.rake +0 -7
  1667. data/tasks/rspec.rake +0 -21
  1668. data/tasks/website.rake +0 -17
@@ -0,0 +1,2407 @@
1
+ // ==========================================================================
2
+ // Project: SproutCore - JavaScript Application Framework
3
+ // Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
4
+ // Portions ©2008-2009 Apple Inc. All rights reserved.
5
+ // License: Licened under MIT license (see license.js)
6
+ // ==========================================================================
7
+
8
+ sc_require('models/record');
9
+
10
+ /**
11
+ @class
12
+
13
+
14
+ The Store is where you can find all of your dataHashes. Stores can be
15
+ chained for editing purposes and committed back one chain level at a time
16
+ all the way back to a persistent data source.
17
+
18
+ Every application you create should generally have its own store objects.
19
+ Once you create the store, you will rarely need to work with the store
20
+ directly except to retrieve records and collections.
21
+
22
+ Internally, the store will keep track of changes to your json data hashes
23
+ and manage syncing those changes with your data source. A data source may
24
+ be a server, local storage, or any other persistent code.
25
+
26
+ @extends SC.Object
27
+ @since SproutCore 1.0
28
+ */
29
+ SC.Store = SC.Object.extend( /** @scope SC.Store.prototype */ {
30
+
31
+ /**
32
+ An array of all the chained stores that current rely on the receiver
33
+ store.
34
+
35
+ @property {Array}
36
+ */
37
+ nestedStores: null,
38
+
39
+ /**
40
+ The data source is the persistent storage that will provide data to the
41
+ store and save changes. You normally will set your data source when you
42
+ first create your store in your application.
43
+
44
+ @property {SC.DataSource}
45
+ */
46
+ dataSource: null,
47
+
48
+ /**
49
+ This type of store is not nested.
50
+
51
+ @property {Boolean}
52
+ */
53
+ isNested: NO,
54
+
55
+ /**
56
+ This type of store is not nested.
57
+
58
+ @property {Boolean}
59
+ */
60
+ commitRecordsAutomatically: NO,
61
+
62
+ // ..........................................................
63
+ // DATA SOURCE SUPPORT
64
+ //
65
+
66
+ /**
67
+ Convenience method. Sets the current data source to the passed property.
68
+ This will also set the store property on the dataSource to the receiver.
69
+
70
+ If you are using this from the core.js method of your app, you may need to
71
+ just pass a string naming your data source class. If this is the case,
72
+ then your data source will be instantiated the first time it is requested.
73
+
74
+ @param {SC.DataSource|String} dataSource the data source
75
+ @returns {SC.Store} receiver
76
+ */
77
+ from: function(dataSource) {
78
+ this.set('dataSource', dataSource);
79
+ return this ;
80
+ },
81
+
82
+ // lazily convert data source to real object
83
+ _getDataSource: function() {
84
+ var ret = this.get('dataSource');
85
+ if (typeof ret === SC.T_STRING) {
86
+ ret = SC.objectForPropertyPath(ret);
87
+ if (ret) ret = ret.create();
88
+ if (ret) this.set('dataSource', ret);
89
+ }
90
+ return ret;
91
+ },
92
+
93
+ /**
94
+ Convenience method. Creates a CascadeDataSource with the passed
95
+ data source arguments and sets the CascadeDataSource as the data source
96
+ for the receiver.
97
+
98
+ @param {SC.DataSource...} dataSource one or more data source arguments
99
+ @returns {SC.Store} reciever
100
+ */
101
+ cascade: function(dataSource) {
102
+ var dataSources = SC.A(arguments) ;
103
+ dataSource = SC.CascadeDataSource.create({
104
+ dataSources: dataSources
105
+ });
106
+ return this.from(dataSource);
107
+ },
108
+
109
+ // ..........................................................
110
+ // STORE CHAINING
111
+ //
112
+
113
+ /**
114
+ Returns a new nested store instance that can be used to buffer changes
115
+ until you are ready to commit them. When you are ready to commit your
116
+ changes, call commitChanges() or destroyChanges() and then destroy() when
117
+ you are finished with the chained store altogether.
118
+
119
+ {{{
120
+ store = MyApp.store.chain();
121
+ .. edit edit edit
122
+ store.commitChanges().destroy();
123
+ }}}
124
+
125
+ @param {Hash} attrs optional attributes to set on new store
126
+ @returns {SC.NestedStore} new nested store chained to receiver
127
+ */
128
+ chain: function(attrs) {
129
+ if (!attrs) attrs = {};
130
+ attrs.parentStore = this;
131
+
132
+ var ret = SC.NestedStore.create(attrs),
133
+ nested = this.nestedStores;
134
+
135
+ if (!nested) nested = this.nestedStores = [];
136
+ nested.push(ret);
137
+ return ret ;
138
+ },
139
+
140
+ /** @private
141
+
142
+ Called by a nested store just before it is destroyed so that the parent
143
+ can remove the store from its list of nested stores.
144
+
145
+ @returns {SC.Store} receiver
146
+ */
147
+ willDestroyNestedStore: function(nestedStore) {
148
+ if (this.nestedStores) {
149
+ this.nestedStores.removeObject(nestedStore);
150
+ }
151
+ return this ;
152
+ },
153
+
154
+ /**
155
+ Used to determine if a nested store belongs directly or indirectly to the
156
+ receiver.
157
+
158
+ @param {SC.Store} store store instance
159
+ @returns {Boolean} YES if belongs
160
+ */
161
+ hasNestedStore: function(store) {
162
+ while(store && (store !== this)) store = store.get('parentStore');
163
+ return store === this ;
164
+ },
165
+
166
+ // ..........................................................
167
+ // SHARED DATA STRUCTURES
168
+ //
169
+
170
+ /** @private
171
+ JSON data hashes indexed by store key.
172
+
173
+ *IMPORTANT: Property is not observable*
174
+
175
+ Shared by a store and its child stores until you make edits to it.
176
+
177
+ @property {Hash}
178
+ */
179
+ dataHashes: null,
180
+
181
+ /** @private
182
+ The current status of a data hash indexed by store key.
183
+
184
+ *IMPORTANT: Property is not observable*
185
+
186
+ Shared by a store and its child stores until you make edits to it.
187
+
188
+ @property {Hash}
189
+ */
190
+ statuses: null,
191
+
192
+ /** @private
193
+ This array contains the revisions for the attributes indexed by the
194
+ storeKey.
195
+
196
+ *IMPORTANT: Property is not observable*
197
+
198
+ Revisions are used to keep track of when an attribute hash has been
199
+ changed. A store shares the revisions data with its parent until it
200
+ starts to make changes to it.
201
+
202
+ @property {Hash}
203
+ */
204
+ revisions: null,
205
+
206
+ /**
207
+ Array indicates whether a data hash is possibly in use by an external
208
+ record for editing. If a data hash is editable then it may be modified
209
+ at any time and therefore chained stores may need to clone the
210
+ attributes before keeping a copy of them.
211
+
212
+ Note that this is kept as an array because it will be stored as a dense
213
+ array on some browsers, making it faster.
214
+
215
+ @property {Array}
216
+ */
217
+ editables: null,
218
+
219
+ /**
220
+ A set of storeKeys that need to be committed back to the data source. If
221
+ you call commitRecords() without passing any other parameters, the keys
222
+ in this set will be committed instead.
223
+
224
+ @property {Array}
225
+ */
226
+ changelog: null,
227
+
228
+ /**
229
+ A set of SC.RecordArray that have been returned from findAll with an
230
+ SC.Query. These will all be notified with _notifyRecordArraysWithQuery()
231
+ whenever the store changes.
232
+
233
+ @property {Array}
234
+ */
235
+ recordArraysWithQuery: null,
236
+
237
+ // ..........................................................
238
+ // CORE ATTRIBUTE API
239
+ //
240
+ // The methods in this layer work on data hashes in the store. They do not
241
+ // perform any changes that can impact records. Usually you will not need
242
+ // to use these methods.
243
+
244
+ /**
245
+ Returns the current edit status of a storekey. May be one of EDITABLE or
246
+ LOCKED. Used mostly for unit testing.
247
+
248
+ @param {Number} storeKey the store key
249
+ @returns {Number} edit status
250
+ */
251
+ storeKeyEditState: function(storeKey) {
252
+ var editables = this.editables, locks = this.locks;
253
+ return (editables && editables[storeKey]) ? SC.Store.EDITABLE : SC.Store.LOCKED ;
254
+ },
255
+
256
+ /**
257
+ Returns the data hash for the given storeKey. This will also 'lock'
258
+ the hash so that further edits to the parent store will no
259
+ longer be reflected in this store until you reset.
260
+
261
+ @param {Number} storeKey key to retrieve
262
+ @returns {Hash} data hash or null
263
+ */
264
+ readDataHash: function(storeKey) {
265
+ return this.dataHashes[storeKey];
266
+ },
267
+
268
+ /**
269
+ Returns the data hash for the storeKey, cloned so that you can edit
270
+ the contents of the attributes if you like. This will do the extra work
271
+ to make sure that you only clone the attributes one time.
272
+
273
+ If you use this method to modify data hash, be sure to call
274
+ dataHashDidChange() when you make edits to record the change.
275
+
276
+ @param {Number} storeKey the store key to retrieve
277
+ @returns {Hash} the attributes hash
278
+ */
279
+ readEditableDataHash: function(storeKey) {
280
+ // read the value - if there is no hash just return; nothing to do
281
+ var ret = this.dataHashes[storeKey];
282
+ if (!ret) return ret ; // nothing to do.
283
+
284
+ // clone data hash if not editable
285
+ var editables = this.editables;
286
+ if (!editables) editables = this.editables = [];
287
+ if (!editables[storeKey]) {
288
+ editables[storeKey] = 1 ; // use number to store as dense array
289
+ ret = this.dataHashes[storeKey] = SC.clone(ret);
290
+ }
291
+ return ret;
292
+ },
293
+
294
+ /**
295
+ Reads a property from the hash - cloning it if needed so you can modify
296
+ it independently of any parent store. This method is really only well
297
+ tested for use with toMany relationships. Although it is public you
298
+ generally should not call it directly.
299
+
300
+ @param {Number} storeKey storeKey of data hash
301
+ @param {String} propertyName property to read
302
+ @returns {Object} editable property value
303
+ */
304
+ readEditableProperty: function(storeKey, propertyName) {
305
+ var hash = this.readEditableDataHash(storeKey),
306
+ editables = this.editables[storeKey], // get editable info...
307
+ ret = hash[propertyName];
308
+
309
+ // editables must be made into a hash so that we can keep track of which
310
+ // properties have already been made editable
311
+ if (editables === 1) editables = this.editables[storeKey] = {};
312
+
313
+ // clone if needed
314
+ if (!editables[propertyName]) {
315
+ ret = hash[propertyName];
316
+ if (ret && ret.isCopyable) ret = hash[propertyName] = ret.copy();
317
+ editables[propertyName] = YES ;
318
+ }
319
+
320
+ return ret ;
321
+ },
322
+
323
+ /**
324
+ Replaces the data hash for the storeKey. This will lock the data hash and
325
+ mark them as cloned. This will also call dataHashDidChange() for you.
326
+
327
+ Note that the hash you set here must be a different object from the
328
+ original data hash. Once you make a change here, you must also call
329
+ dataHashDidChange() to register the changes.
330
+
331
+ If the data hash does not yet exist in the store, this method will add it.
332
+ Pass the optional status to edit the status as well.
333
+
334
+ @param {Number} storeKey the store key to write
335
+ @param {Hash} hash the new hash
336
+ @param {String} status the new hash status
337
+ @returns {SC.Store} receiver
338
+ */
339
+ writeDataHash: function(storeKey, hash, status) {
340
+
341
+ // update dataHashes and optionally status.
342
+ if (hash) this.dataHashes[storeKey] = hash;
343
+ if (status) this.statuses[storeKey] = status ;
344
+
345
+ // also note that this hash is now editable
346
+ var editables = this.editables;
347
+ if (!editables) editables = this.editables = [];
348
+ editables[storeKey] = 1 ; // use number for dense array support
349
+
350
+ return this ;
351
+ },
352
+
353
+ /**
354
+ Removes the data hash from the store. This does not imply a deletion of
355
+ the record. You could be simply unloading the record. Eitherway,
356
+ removing the dataHash will be synced back to the parent store but not to
357
+ the server.
358
+
359
+ Note that you can optionally pass a new status to go along with this. If
360
+ you do not pass a status, it will change the status to SC.RECORD_EMPTY
361
+ (assuming you just unloaded the record). If you are deleting the record
362
+ you may set it to SC.Record.DESTROYED_CLEAN.
363
+
364
+ Be sure to also call dataHashDidChange() to register this change.
365
+
366
+ @param {Number} storeKey
367
+ @param {String} status optional new status
368
+ @returns {SC.Store} reciever
369
+ */
370
+ removeDataHash: function(storeKey, status) {
371
+ var rev ;
372
+
373
+ // don't use delete -- that will allow parent dataHash to come through
374
+ this.dataHashes[storeKey] = null;
375
+ this.statuses[storeKey] = status || SC.Record.EMPTY;
376
+ rev = this.revisions[storeKey] = this.revisions[storeKey]; // copy ref
377
+
378
+ // hash is gone and therefore no longer editable
379
+ var editables = this.editables;
380
+ if (editables) editables[storeKey] = 0 ;
381
+
382
+ return this ;
383
+ },
384
+
385
+ /**
386
+ Reads the current status for a storeKey. This will also lock the data
387
+ hash. If no status is found, returns SC.RECORD_EMPTY.
388
+
389
+ @param {Number} storeKey the store key
390
+ @returns {Number} status
391
+ */
392
+ readStatus: function(storeKey) {
393
+ // use readDataHash to handle optimistic locking. this could be inlined
394
+ // but for now this minimized copy-and-paste code.
395
+ this.readDataHash(storeKey);
396
+ return this.statuses[storeKey] || SC.Record.EMPTY;
397
+ },
398
+
399
+ /**
400
+ Reads the current status for the storeKey without actually locking the
401
+ record. Usually you won't need to use this method. It is mostly used
402
+ internally.
403
+
404
+ @param {Number} storeKey the store key
405
+ @returns {Number} status
406
+ */
407
+ peekStatus: function(storeKey) {
408
+ return this.statuses[storeKey] || SC.Record.EMPTY;
409
+ },
410
+
411
+ /**
412
+ Writes the current status for a storeKey. If the new status is
413
+ SC.Record.ERROR, you may also pass an optional error object. Otherwise
414
+ this param is ignored.
415
+
416
+ @param {Number} storeKey the store key
417
+ @param {String} newStatus the new status
418
+ @param {SC.Error} error optional error object
419
+ @returns {SC.Store} receiver
420
+ */
421
+ writeStatus: function(storeKey, newStatus) {
422
+ // use writeDataHash for now to handle optimistic lock. maximize code
423
+ // reuse.
424
+ return this.writeDataHash(storeKey, null, newStatus);
425
+ },
426
+
427
+ /**
428
+ Call this method whenever you modify some editable data hash to register
429
+ with the Store that the attribute values have actually changed. This will
430
+ do the book-keeping necessary to track the change across stores including
431
+ managing locks.
432
+
433
+ @param {Number|Array} storeKeys one or more store keys that changed
434
+ @param {Number} rev optional new revision number. normally leave null
435
+ @param {Boolean} statusOnly (optional) YES if only status changed
436
+ @param {String} key that changed (optional)
437
+ @returns {SC.Store} receiver
438
+ */
439
+ dataHashDidChange: function(storeKeys, rev, statusOnly, key) {
440
+
441
+ // update the revision for storeKey. Use generateStoreKey() because that
442
+ // gaurantees a universally (to this store hierarchy anyway) unique
443
+ // key value.
444
+ if (!rev) rev = SC.Store.generateStoreKey();
445
+ var isArray, len, idx, storeKey;
446
+
447
+ isArray = SC.typeOf(storeKeys) === SC.T_ARRAY;
448
+ if (isArray) {
449
+ len = storeKeys.length;
450
+ } else {
451
+ len = 1;
452
+ storeKey = storeKeys;
453
+ }
454
+
455
+ for(idx=0;idx<len;idx++) {
456
+ if (isArray) storeKey = storeKeys[idx];
457
+ this.revisions[storeKey] = rev;
458
+ this._notifyRecordPropertyChange(storeKey, statusOnly, key);
459
+ }
460
+
461
+ return this ;
462
+ },
463
+
464
+ /** @private
465
+ Will push all changes to a the recordPropertyChanges property
466
+ and execute flush() once at the end of the runloop.
467
+ */
468
+ _notifyRecordPropertyChange: function(storeKey, statusOnly, key) {
469
+
470
+ var records = this.records,
471
+ nestedStores = this.get('nestedStores'),
472
+ K = SC.Store,
473
+ rec, editState, len, idx, store, status, keys;
474
+
475
+ // pass along to nested stores
476
+ len = nestedStores ? nestedStores.length : 0 ;
477
+ for(idx=0;idx<len;idx++) {
478
+ store = nestedStores[idx];
479
+ status = store.peekStatus(storeKey); // important: peek avoids read-lock
480
+ editState = store.storeKeyEditState(storeKey);
481
+
482
+ // when store needs to propagate out changes in the parent store
483
+ // to nested stores
484
+ if (editState === K.INHERITED) {
485
+ store._notifyRecordPropertyChange(storeKey, statusOnly);
486
+
487
+ } else if (status & SC.Record.BUSY) {
488
+ // make sure nested store does not have any changes before resetting
489
+ if(store.get('hasChanges')) throw K.CHAIN_CONFLICT_ERROR;
490
+ store.reset();
491
+ }
492
+ }
493
+
494
+ // store info in changes hash and schedule notification if needed.
495
+ var changes = this.recordPropertyChanges;
496
+ if (!changes) {
497
+ changes = this.recordPropertyChanges =
498
+ { storeKeys: SC.CoreSet.create(),
499
+ records: SC.CoreSet.create(),
500
+ statusOnly: SC.CoreSet.create(),
501
+ propertyForStoreKeys: {} };
502
+ }
503
+
504
+ changes.storeKeys.add(storeKey);
505
+
506
+ if (records && (rec=records[storeKey])) {
507
+ changes.records.push(storeKey);
508
+ if(statusOnly) changes.statusOnly.push(storeKey);
509
+
510
+ // if this is a key specific change, make sure that only those
511
+ // properties/keys are notified
512
+ if (key) {
513
+ if (!(keys = changes.propertyForStoreKeys[storeKey])) {
514
+ keys = changes.propertyForStoreKeys[storeKey] = SC.CoreSet.create();
515
+ }
516
+ keys.add(key);
517
+ }
518
+ }
519
+
520
+ this.invokeOnce(this.flush);
521
+ return this;
522
+ },
523
+
524
+ /**
525
+ Delivers any pending changes to materialized records. Normally this
526
+ happens once, automatically, at the end of the RunLoop. If you have
527
+ updated some records and need to update records immediately, however,
528
+ you may call this manually.
529
+
530
+ @returns {SC.Store} receiver
531
+ */
532
+ flush: function() {
533
+ if (!this.recordPropertyChanges) return this;
534
+
535
+ var changes = this.recordPropertyChanges,
536
+ storeKeys = changes.storeKeys,
537
+ statusOnly = changes.statusOnly,
538
+ records = changes.records,
539
+ propertyForStoreKeys = changes.propertyForStoreKeys,
540
+ recordTypes = SC.CoreSet.create(),
541
+ rec, recordType, status, idx, len, storeKey, keys;
542
+
543
+ storeKeys.forEach(function(storeKey) {
544
+
545
+ if (records.contains(storeKey)) {
546
+ status = statusOnly.contains(storeKey) ? YES: NO;
547
+ rec = this.records[storeKey];
548
+ keys = propertyForStoreKeys ? propertyForStoreKeys[storeKey] : null;
549
+
550
+ // remove it so we don't trigger this twice
551
+ records.remove(storeKey);
552
+
553
+ if (rec) rec.storeDidChangeProperties(status, keys);
554
+ }
555
+
556
+ recordType = SC.Store.recordTypeFor(storeKey);
557
+ recordTypes.add(recordType);
558
+
559
+ }, this);
560
+
561
+ this._notifyRecordArrays(storeKeys, recordTypes);
562
+
563
+ storeKeys.clear();
564
+ statusOnly.clear();
565
+ records.clear();
566
+ propertyForStoreKeys.length = 0; // reset
567
+
568
+ return this;
569
+ },
570
+
571
+ /**
572
+ Resets the store content. This will clear all internal data for all
573
+ records, resetting them to an EMPTY state. You generally do not want
574
+ to call this method yourself, though you may override it.
575
+
576
+ @returns {SC.Store} receiver
577
+ */
578
+ reset: function() {
579
+
580
+ // create a new empty data store
581
+ this.dataHashes = {} ;
582
+ this.revisions = {} ;
583
+ this.statuses = {} ;
584
+
585
+ // also reset temporary objects
586
+ this.chainedChanges = this.locks = this.editables = null;
587
+ this.changelog = null ;
588
+
589
+ var records = this.records, storeKey;
590
+ if (records) {
591
+ for(storeKey in records) {
592
+ if (!records.hasOwnProperty(storeKey)) continue ;
593
+ this._notifyRecordPropertyChange(storeKey, NO);
594
+ }
595
+ }
596
+
597
+ this.set('hasChanges', NO);
598
+ },
599
+
600
+ /** @private
601
+ Called by a nested store on a parent store to commit any changes from the
602
+ store. This will copy any changed dataHashes as well as any persistant
603
+ change logs.
604
+
605
+ If the parentStore detects a conflict with the optimistic locking, it will
606
+ raise an exception before it makes any changes. If you pass the
607
+ force flag then this detection phase will be skipped and the changes will
608
+ be applied even if another resource has modified the store in the mean
609
+ time.
610
+
611
+ @param {SC.Store} nestedStore the child store
612
+ @param {Array} changes the array of changed store keys
613
+ @param {Boolean} force
614
+ @returns {SC.Store} receiver
615
+ */
616
+ commitChangesFromNestedStore: function(nestedStore, changes, force) {
617
+ // first, check for optimistic locking problems
618
+ if (!force) this._verifyLockRevisions(changes, nestedStore.locks);
619
+
620
+ // OK, no locking issues. So let's just copy them changes.
621
+ // get local reference to values.
622
+ var len = changes.length, i, storeKey, myDataHashes, myStatuses,
623
+ myEditables, myRevisions, chDataHashes, chStatuses, chRevisions;
624
+
625
+ myRevisions = this.revisions ;
626
+ myDataHashes = this.dataHashes;
627
+ myStatuses = this.statuses;
628
+ myEditables = this.editables ;
629
+
630
+ // setup some arrays if needed
631
+ if (!myEditables) myEditables = this.editables = [] ;
632
+
633
+ chDataHashes = nestedStore.dataHashes;
634
+ chRevisions = nestedStore.revisions ;
635
+ chStatuses = nestedStore.statuses;
636
+
637
+ for(i=0;i<len;i++) {
638
+ storeKey = changes[i];
639
+
640
+ // now copy changes
641
+ myDataHashes[storeKey] = chDataHashes[storeKey];
642
+ myStatuses[storeKey] = chStatuses[storeKey];
643
+ myRevisions[storeKey] = chRevisions[storeKey];
644
+
645
+ myEditables[storeKey] = 0 ; // always make dataHash no longer editable
646
+
647
+ this._notifyRecordPropertyChange(storeKey, NO);
648
+ }
649
+
650
+ // add any records to the changelog for commit handling
651
+ var myChangelog = this.changelog, chChangelog = nestedStore.changelog;
652
+ if (chChangelog) {
653
+ if (!myChangelog) myChangelog = this.changelog = SC.CoreSet.create();
654
+ myChangelog.addEach(chChangelog);
655
+ }
656
+ this.changelog = myChangelog;
657
+
658
+ // immediately flush changes to notify records - nested stores will flush
659
+ // later on.
660
+ if (!this.get('parentStore')) this.flush();
661
+
662
+ return this ;
663
+ },
664
+
665
+ /** @private
666
+ Verifies that the passed lock revisions match the current revisions
667
+ in the receiver store. If the lock revisions do not match, then the
668
+ store is in a conflict and an exception will be raised.
669
+
670
+ @param {Array} changes set of changes we are trying to apply
671
+ @param {SC.Set} locks the locks to verify
672
+ @returns {SC.Store} receiver
673
+ */
674
+ _verifyLockRevisions: function(changes, locks) {
675
+ var len = changes.length, revs = this.revisions, i, storeKey, lock, rev ;
676
+ if (locks && revs) {
677
+ for(i=0;i<len;i++) {
678
+ storeKey = changes[i];
679
+ lock = locks[storeKey] || 1;
680
+ rev = revs[storeKey] || 1;
681
+
682
+ // if the save revision for the item does not match the current rev
683
+ // the someone has changed the data hash in this store and we have
684
+ // a conflict.
685
+ if (lock < rev) throw SC.Store.CHAIN_CONFLICT_ERROR;
686
+ }
687
+ }
688
+ return this ;
689
+ },
690
+
691
+ // ..........................................................
692
+ // HIGH-LEVEL RECORD API
693
+ //
694
+
695
+ /**
696
+ Finds a single record instance with the specified recordType and id or an
697
+ array of records matching some query conditions.
698
+
699
+ h2. Finding a Single Record
700
+
701
+ If you pass a single recordType and id, this method will return an actual
702
+ record instance. If the record has not been loaded into the store yet,
703
+ this method will ask the data source to retrieve it. If no data source
704
+ indicates that it can retrieve the record, then this method will return
705
+ null.
706
+
707
+ Note that if the record needs to be retrieved from the server, then the
708
+ record instance returned from this method will not have any data yet.
709
+ Instead it will have a status of SC.Record.READY_LOADING. You can monitor
710
+ the status property to be notified when the record data is available for
711
+ you to use it.
712
+
713
+ h2. Find a Collection of Records
714
+
715
+ If you pass only a record type or a query object, you can instead find
716
+ all records matching a specified set of conditions. When you call find()
717
+ in this way, it will create a query if needed and pass it to the data
718
+ source to fetch the results.
719
+
720
+ If this is the first time you have fetched the query, then the store will
721
+ automatically ask the data source to fetch any records related to it as
722
+ well. Otherwise you can refresh the query results at anytime by calling
723
+ refresh() on the returned RecordArray.
724
+
725
+ You can detect whether a RecordArray is fetching from the server by
726
+ checking its status.
727
+
728
+ h2. Examples
729
+
730
+ Finding a single record:
731
+
732
+ {{{
733
+ MyApp.store.find(MyApp.Contact, "23"); // returns MyApp.Contact
734
+ }}}
735
+
736
+ Finding all records of a particular type:
737
+
738
+ {{{
739
+ MyApp.store.find(MyApp.Contact); // returns SC.RecordArray of contacts
740
+ }}}
741
+
742
+ Finding all contacts with first name John:
743
+
744
+ {{{
745
+ var query = SC.Query.local(MyApp.Contact, "firstName = %@", "John");
746
+ MyApp.store.find(query); // returns SC.RecordArray of contacts
747
+ }}}
748
+
749
+ Finding all contacts using a remote query:
750
+
751
+ {{{
752
+ var query = SC.Query.remote(MyApp.Contact);
753
+ MyApp.store.find(query); // returns SC.RecordArray filled by server
754
+ }}}
755
+
756
+ @param {SC.Record|String} recordType the expected record type
757
+ @param {String} id the id to load
758
+ @returns {SC.Record} record instance or null
759
+ */
760
+ find: function(recordType, id) {
761
+ // if recordType is passed as string, find object
762
+ if (SC.typeOf(recordType)===SC.T_STRING) {
763
+ recordType = SC.objectForPropertyPath(recordType);
764
+ }
765
+
766
+ // handle passing a query...
767
+ if ((arguments.length === 1) && !(recordType && recordType.isRecord)) {
768
+ if (!recordType) throw "SC.Store#find() must pass recordType or query";
769
+ if (!recordType.isQuery) {
770
+ recordType = SC.Query.local(recordType);
771
+ }
772
+ return this._findQuery(recordType, YES, YES);
773
+
774
+ // handle finding a single record
775
+ } else {
776
+ return this._findRecord(recordType, id);
777
+ }
778
+ },
779
+
780
+ /** @private
781
+ DEPRECATED used find() instead.
782
+
783
+ This method will accept a record type or query and return a record array
784
+ matching the results. This method was commonly used prior to SproutCore
785
+ 1.0. It has been deprecated in favor of a single find() method instead.
786
+
787
+ For compatibility, this method will continue to work in SproutCore 1.0 but
788
+ it will raise a warning. It will be removed in a future version of
789
+ SproutCore.
790
+ */
791
+ findAll: function(recordType, conditions, params) {
792
+ console.warn("SC.Store#findAll() will be removed in a future version of SproutCore. Use SC.Store#find() instead");
793
+
794
+
795
+ if (!recordType || !recordType.isQuery) {
796
+ recordType = SC.Query.local(recordType, conditions, params);
797
+ }
798
+
799
+ return this._findQuery(recordType, YES, YES);
800
+ },
801
+
802
+
803
+ _findQuery: function(query, createIfNeeded, refreshIfNew) {
804
+
805
+ // lookup the local RecordArray for this query.
806
+ var cache = this._scst_recordArraysByQuery,
807
+ key = SC.guidFor(query),
808
+ ret, ra ;
809
+ if (!cache) cache = this._scst_recordArraysByQuery = {};
810
+ ret = cache[key];
811
+
812
+ // if a RecordArray was not found, then create one and also add it to the
813
+ // list of record arrays to update.
814
+ if (!ret && createIfNeeded) {
815
+ cache[key] = ret = SC.RecordArray.create({ store: this, query: query });
816
+
817
+ ra = this.get('recordArrays');
818
+ if (!ra) this.set('recordArrays', ra = SC.Set.create());
819
+ ra.add(ret);
820
+
821
+ if (refreshIfNew) this.refreshQuery(query);
822
+ }
823
+
824
+ this.flush();
825
+ return ret ;
826
+ },
827
+
828
+ _findRecord: function(recordType, id) {
829
+
830
+ var storeKey ;
831
+
832
+ // if a record instance is passed, simply use the storeKey. This allows
833
+ // you to pass a record from a chained store to get the same record in the
834
+ // current store.
835
+ if (recordType && recordType.get && recordType.get('isRecord')) {
836
+ storeKey = recordType.get('storeKey');
837
+
838
+ // otherwise, lookup the storeKey for the passed id. look in subclasses
839
+ // as well.
840
+ } else storeKey = id ? recordType.storeKeyFor(id) : null;
841
+
842
+ if (storeKey && (this.readStatus(storeKey) === SC.Record.EMPTY)) {
843
+ storeKey = this.retrieveRecord(recordType, id);
844
+ }
845
+
846
+ // now we have the storeKey, materialize the record and return it.
847
+ return storeKey ? this.materializeRecord(storeKey) : null ;
848
+ },
849
+
850
+ // ..........................................................
851
+ // RECORD ARRAY OPERATIONS
852
+ //
853
+
854
+ /**
855
+ Called by the record array just before it is destroyed. This will
856
+ de-register it from receiving future notifications.
857
+
858
+ You should never call this method yourself. Instead call destroy() on the
859
+ RecordArray directly.
860
+
861
+ @param {SC.RecordArray} recordArray the record array
862
+ @returns {SC.Store} receiver
863
+ */
864
+ recordArrayWillDestroy: function(recordArray) {
865
+ var cache = this._scst_recordArraysByQuery,
866
+ set = this.get('recordArrays');
867
+
868
+ if (cache) delete cache[SC.guidFor(recordArray.get('query'))];
869
+ if (set) set.remove(recordArray);
870
+ return this ;
871
+ },
872
+
873
+ /**
874
+ Called by the record array whenever it needs the data source to refresh
875
+ its contents. Nested stores will actually just pass this along to the
876
+ parent store. The parent store will call fetch() on the data source.
877
+
878
+ You should never call this method yourself. Instead call refresh() on the
879
+ RecordArray directly.
880
+
881
+ @param {SC.Query} query the record array query to refresh
882
+ @returns {SC.Store} receiver
883
+ */
884
+ refreshQuery: function(query) {
885
+ if (!query) throw "refreshQuery() requires a query";
886
+
887
+ var cache = this._scst_recordArraysByQuery,
888
+ recArray = cache ? cache[SC.guidFor(query)] : null,
889
+ source = this._getDataSource();
890
+
891
+ if (source && source.fetch) {
892
+ if (recArray) recArray.storeWillFetchQuery(query);
893
+ source.fetch.call(source, this, query);
894
+ }
895
+
896
+ return this ;
897
+ },
898
+
899
+ /** @private
900
+ Will ask all record arrays that have been returned from findAll
901
+ with an SC.Query to check their arrays with the new storeKeys
902
+
903
+ @param {SC.IndexSet} storeKeys set of storeKeys that changed
904
+ @param {SC.Set} recordTypes
905
+ @returns {SC.Store} receiver
906
+ */
907
+ _notifyRecordArrays: function(storeKeys, recordTypes) {
908
+ var recordArrays = this.get('recordArrays');
909
+ if (!recordArrays) return this;
910
+
911
+ recordArrays.forEach(function(recArray) {
912
+ if (recArray) recArray.storeDidChangeStoreKeys(storeKeys, recordTypes);
913
+ }, this);
914
+
915
+ return this ;
916
+ },
917
+
918
+
919
+ // ..........................................................
920
+ // LOW-LEVEL HELPERS
921
+ //
922
+
923
+ /**
924
+ Array of all records currently in the store with the specified
925
+ type. This method only reflects the actual records loaded into memory and
926
+ therefore is not usually needed at runtime. However you will often use
927
+ this method for testing.
928
+
929
+ @param {SC.Record} recordType the record type
930
+ @returns {SC.Array} array instance - usually SC.RecordArray
931
+ */
932
+ recordsFor: function(recordType) {
933
+ var storeKeys = [],
934
+ storeKeysById = recordType.storeKeysById(),
935
+ id, storeKey, ret;
936
+
937
+ // collect all non-empty store keys
938
+ for(id in storeKeysById) {
939
+ storeKey = storeKeysById[id]; // get the storeKey
940
+ if (this.readStatus(storeKey) !== SC.RECORD_EMPTY) {
941
+ storeKeys.push(storeKey);
942
+ }
943
+ }
944
+
945
+ if (storeKeys.length>0) {
946
+ ret = SC.RecordArray.create({ store: this, storeKeys: storeKeys });
947
+ } else ret = storeKeys; // empty array
948
+ return ret ;
949
+ },
950
+
951
+ _TMP_REC_ATTRS: {},
952
+
953
+ /**
954
+ Given a storeKey, return a materialized record. You will not usually
955
+ call this method yourself. Instead it will used by other methods when
956
+ you find records by id or perform other searches.
957
+
958
+ If a recordType has been mapped to the storeKey, then a record instance
959
+ will be returned even if the data hash has not been requested yet.
960
+
961
+ Each Store instance returns unique record instances for each storeKey.
962
+
963
+ @param {Number} storeKey The storeKey for the dataHash.
964
+ @returns {SC.Record} Returns a record instance.
965
+ */
966
+ materializeRecord: function(storeKey) {
967
+ var records = this.records, ret, recordType, attrs;
968
+
969
+ // look up in cached records
970
+ if (!records) records = this.records = {}; // load cached records
971
+ ret = records[storeKey];
972
+ if (ret) return ret;
973
+
974
+ // not found -- OK, create one then.
975
+ recordType = SC.Store.recordTypeFor(storeKey);
976
+ if (!recordType) return null; // not recordType registered, nothing to do
977
+
978
+ attrs = this._TMP_REC_ATTRS ;
979
+ attrs.storeKey = storeKey ;
980
+ attrs.store = this ;
981
+ ret = records[storeKey] = recordType.create(attrs);
982
+
983
+ return ret ;
984
+ },
985
+
986
+ // ..........................................................
987
+ // CORE RECORDS API
988
+ //
989
+ // The methods in this section can be used to manipulate records without
990
+ // actually creating record instances.
991
+
992
+ /**
993
+ Creates a new record instance with the passed recordType and dataHash.
994
+ You can also optionally specify an id or else it will be pulled from the
995
+ data hash.
996
+
997
+ Note that the record will not yet be saved back to the server. To save
998
+ a record to the server, call commitChanges() on the store.
999
+
1000
+ @param {SC.Record} recordType the record class to use on creation
1001
+ @param {Hash} dataHash the JSON attributes to assign to the hash.
1002
+ @param {String} id (optional) id to assign to record
1003
+
1004
+ @returns {SC.Record} Returns the created record
1005
+ */
1006
+ createRecord: function(recordType, dataHash, id) {
1007
+ var primaryKey, storeKey, status, K = SC.Record, changelog, defaultVal;
1008
+
1009
+ // First, try to get an id. If no id is passed, look it up in the
1010
+ // dataHash.
1011
+ if (!id && (primaryKey = recordType.prototype.primaryKey)) {
1012
+ id = dataHash[primaryKey];
1013
+ // if still no id, check if there is a defaultValue function for
1014
+ // the primaryKey attribute and assign that
1015
+ defaultVal = recordType.prototype[primaryKey] ? recordType.prototype[primaryKey].defaultValue : null;
1016
+ if(!id && SC.typeOf(defaultVal)===SC.T_FUNCTION) {
1017
+ id = dataHash[primaryKey] = defaultVal();
1018
+ }
1019
+ }
1020
+
1021
+ // Next get the storeKey - base on id if available
1022
+ storeKey = id ? recordType.storeKeyFor(id) : SC.Store.generateStoreKey();
1023
+
1024
+ // now, check the state and do the right thing.
1025
+ status = this.readStatus(storeKey);
1026
+
1027
+ // check state
1028
+ // any busy or ready state or destroyed dirty state is not allowed
1029
+ if ((status & K.BUSY) ||
1030
+ (status & K.READY) ||
1031
+ (status == K.DESTROYED_DIRTY)) {
1032
+ throw id ? K.RECORD_EXISTS_ERROR : K.BAD_STATE_ERROR;
1033
+
1034
+ // allow error or destroyed state only with id
1035
+ } else if (!id && (status==SC.DESTROYED_CLEAN || status==SC.ERROR)) {
1036
+ throw K.BAD_STATE_ERROR;
1037
+ }
1038
+
1039
+ // add dataHash and setup initial status -- also save recordType
1040
+ this.writeDataHash(storeKey, (dataHash ? dataHash : {}), K.READY_NEW);
1041
+
1042
+ SC.Store.replaceRecordTypeFor(storeKey, recordType);
1043
+ this.dataHashDidChange(storeKey);
1044
+
1045
+ // Record is now in a committable state -- add storeKey to changelog
1046
+ changelog = this.changelog;
1047
+ if (!changelog) changelog = SC.Set.create();
1048
+ changelog.add(storeKey);
1049
+ this.changelog = changelog;
1050
+
1051
+ // if commit records is enabled
1052
+ if(this.get('commitRecordsAutomatically')){
1053
+ this.invokeLast(this.commitRecords);
1054
+ }
1055
+
1056
+ // finally return materialized record
1057
+ return this.materializeRecord(storeKey) ;
1058
+ },
1059
+
1060
+ /**
1061
+ Creates an array of new records. You must pass an array of dataHashes
1062
+ plus a recordType and, optionally, an array of ids. This will create an
1063
+ array of record instances with the same record type.
1064
+
1065
+ If you need to instead create a bunch of records with different data types
1066
+ you can instead pass an array of recordTypes, one for each data hash.
1067
+
1068
+ @param {SC.Record|Array} recordTypes class or array of classes
1069
+ @param {Array} dataHashes array of data hashes
1070
+ @param {Array} ids (optional) ids to assign to records
1071
+ @returns {Array} array of materialized record instances.
1072
+ */
1073
+ createRecords: function(recordTypes, dataHashes, ids) {
1074
+ var ret = [], recordType, id, isArray, len = dataHashes.length, idx ;
1075
+ isArray = SC.typeOf(recordTypes) === SC.T_ARRAY;
1076
+ if (!isArray) recordType = recordTypes;
1077
+ for(idx=0;idx<len;idx++) {
1078
+ if (isArray) recordType = recordTypes[idx] || SC.Record;
1079
+ id = ids ? ids[idx] : undefined ;
1080
+ ret.push(this.createRecord(recordType, dataHashes[idx], id));
1081
+ }
1082
+ return ret ;
1083
+ },
1084
+
1085
+ /**
1086
+ Destroys a record, removing the data hash from the store and adding the
1087
+ record to the destroyed changelog. If you try to destroy a record that is
1088
+ already destroyed then this method will have no effect. If you destroy a
1089
+ record that does not exist or an error then an exception will be raised.
1090
+
1091
+ @param {SC.Record} recordType the recordType
1092
+ @param {String} id the record id
1093
+ @param {Number} storeKey (optional) if passed, ignores recordType and id
1094
+ @returns {SC.Store} receiver
1095
+ */
1096
+ destroyRecord: function(recordType, id, storeKey) {
1097
+ if (storeKey === undefined) storeKey = recordType.storeKeyFor(id);
1098
+ var status = this.readStatus(storeKey), changelog, K = SC.Record;
1099
+
1100
+ // handle status - ignore if destroying or destroyed
1101
+ if ((status === K.BUSY_DESTROYING) || (status & K.DESTROYED)) {
1102
+ return this; // nothing to do
1103
+
1104
+ // error out if empty
1105
+ } else if (status == K.EMPTY) {
1106
+ throw K.NOT_FOUND_ERROR ;
1107
+
1108
+ // error out if busy
1109
+ } else if (status & K.BUSY) {
1110
+ throw K.BUSY_ERROR ;
1111
+
1112
+ // if new status, destroy but leave in clean state
1113
+ } else if (status == K.READY_NEW) {
1114
+ status = K.DESTROYED_CLEAN ;
1115
+
1116
+ // otherwise, destroy in dirty state
1117
+ } else status = K.DESTROYED_DIRTY ;
1118
+
1119
+ // remove the data hash, set new status
1120
+ this.writeStatus(storeKey, status);
1121
+ this.dataHashDidChange(storeKey);
1122
+
1123
+ // add/remove change log
1124
+ changelog = this.changelog;
1125
+ if (!changelog) changelog = this.changelog = SC.Set.create();
1126
+
1127
+ ((status & K.DIRTY) ? changelog.add(storeKey) : changelog.remove(storeKey));
1128
+ this.changelog=changelog;
1129
+
1130
+ // if commit records is enabled
1131
+ if(this.get('commitRecordsAutomatically')){
1132
+ this.invokeLast(this.commitRecords);
1133
+ }
1134
+
1135
+ return this ;
1136
+ },
1137
+
1138
+ /**
1139
+ Destroys a group of records. If you have a set of record ids, destroying
1140
+ them this way can be faster than retrieving each record and destroying
1141
+ it individually.
1142
+
1143
+ You can pass either a single recordType or an array of recordTypes. If
1144
+ you pass a single recordType, then the record type will be used for each
1145
+ record. If you pass an array, then each id must have a matching record
1146
+ type in the array.
1147
+
1148
+ You can optionally pass an array of storeKeys instead of the recordType
1149
+ and ids. In this case the first two parameters will be ignored. This
1150
+ is usually only used by low-level internal methods. You will not usually
1151
+ destroy records this way.
1152
+
1153
+ @param {SC.Record|Array} recordTypes class or array of classes
1154
+ @param {Array} ids ids to destroy
1155
+ @param {Array} storeKeys (optional) store keys to destroy
1156
+ @returns {SC.Store} receiver
1157
+ */
1158
+ destroyRecords: function(recordTypes, ids, storeKeys) {
1159
+ var len, isArray, idx, id, recordType, storeKey;
1160
+ if(storeKeys===undefined){
1161
+ len = ids.length;
1162
+ isArray = SC.typeOf(recordTypes) === SC.T_ARRAY;
1163
+ if (!isArray) recordType = recordTypes;
1164
+ for(idx=0;idx<len;idx++) {
1165
+ if (isArray) recordType = recordTypes[idx] || SC.Record;
1166
+ id = ids ? ids[idx] : undefined ;
1167
+ this.destroyRecord(recordType, id, undefined);
1168
+ }
1169
+ }else{
1170
+ len = storeKeys.length;
1171
+ for(idx=0;idx<len;idx++) {
1172
+ storeKey = storeKeys ? storeKeys[idx] : undefined ;
1173
+ this.destroyRecord(undefined, undefined, storeKey);
1174
+ }
1175
+ }
1176
+ return this ;
1177
+ },
1178
+
1179
+ /**
1180
+ Notes that the data for the given record id has changed. The record will
1181
+ be committed to the server the next time you commit the root store. Only
1182
+ call this method on a record in a READY state of some type.
1183
+
1184
+ @param {SC.Record} recordType the recordType
1185
+ @param {String} id the record id
1186
+ @param {Number} storeKey (optional) if passed, ignores recordType and id
1187
+ @param {String} key that changed (optional)
1188
+ @returns {SC.Store} receiver
1189
+ */
1190
+ recordDidChange: function(recordType, id, storeKey, key) {
1191
+ if (storeKey === undefined) storeKey = recordType.storeKeyFor(id);
1192
+ var status = this.readStatus(storeKey), changelog, K = SC.Record;
1193
+
1194
+ // BUSY_LOADING, BUSY_CREATING, BUSY_COMMITTING, BUSY_REFRESH_CLEAN
1195
+ // BUSY_REFRESH_DIRTY, BUSY_DESTROYING
1196
+ if (status & K.BUSY) {
1197
+ throw K.BUSY_ERROR ;
1198
+
1199
+ // if record is not in ready state, then it is not found.
1200
+ // ERROR, EMPTY, DESTROYED_CLEAN, DESTROYED_DIRTY
1201
+ } else if (!(status & K.READY)) {
1202
+ throw K.NOT_FOUND_ERROR ;
1203
+
1204
+ // otherwise, make new status READY_DIRTY unless new.
1205
+ // K.READY_CLEAN, K.READY_DIRTY, ignore K.READY_NEW
1206
+ } else {
1207
+ if (status != K.READY_NEW) this.writeStatus(storeKey, K.READY_DIRTY);
1208
+ }
1209
+
1210
+ // record data hash change
1211
+ this.dataHashDidChange(storeKey, null, null, key);
1212
+
1213
+ // record in changelog
1214
+ changelog = this.changelog ;
1215
+ if (!changelog) changelog = this.changelog = SC.Set.create() ;
1216
+ changelog.add(storeKey);
1217
+ this.changelog = changelog;
1218
+
1219
+ // if commit records is enabled
1220
+ if(this.get('commitRecordsAutomatically')){
1221
+ this.invokeLast(this.commitRecords);
1222
+ }
1223
+
1224
+ return this ;
1225
+ },
1226
+
1227
+ /**
1228
+ Mark a group of records as dirty. The records will be committed to the
1229
+ server the next time you commit changes on the root store. If you have a
1230
+ set of record ids, marking them dirty this way can be faster than
1231
+ retrieving each record and destroying it individually.
1232
+
1233
+ You can pass either a single recordType or an array of recordTypes. If
1234
+ you pass a single recordType, then the record type will be used for each
1235
+ record. If you pass an array, then each id must have a matching record
1236
+ type in the array.
1237
+
1238
+ You can optionally pass an array of storeKeys instead of the recordType
1239
+ and ids. In this case the first two parameters will be ignored. This
1240
+ is usually only used by low-level internal methods.
1241
+
1242
+ @param {SC.Record|Array} recordTypes class or array of classes
1243
+ @param {Array} ids ids to destroy
1244
+ @param {Array} storeKeys (optional) store keys to destroy
1245
+ @returns {SC.Store} receiver
1246
+ */
1247
+ recordsDidChange: function(recordTypes, ids, storeKeys) {
1248
+ var len, isArray, idx, id, recordType, storeKey;
1249
+ if(storeKeys===undefined){
1250
+ len = ids.length;
1251
+ isArray = SC.typeOf(recordTypes) === SC.T_ARRAY;
1252
+ if (!isArray) recordType = recordTypes;
1253
+ for(idx=0;idx<len;idx++) {
1254
+ if (isArray) recordType = recordTypes[idx] || SC.Record;
1255
+ id = ids ? ids[idx] : undefined ;
1256
+ storeKey = storeKeys ? storeKeys[idx] : undefined ;
1257
+ this.recordDidChange(recordType, id, storeKey);
1258
+ }
1259
+ }else{
1260
+ len = storeKeys.length;
1261
+ for(idx=0;idx<len;idx++) {
1262
+ storeKey = storeKeys ? storeKeys[idx] : undefined ;
1263
+ this.recordDidChange(undefined, undefined, storeKey);
1264
+ }
1265
+ }
1266
+ return this ;
1267
+ },
1268
+
1269
+ /**
1270
+ Retrieves a set of records from the server. If the records has
1271
+ already been loaded in the store, then this method will simply return.
1272
+ Otherwise if your store has a dataSource, this will call the
1273
+ dataSource to retrieve the record. Generally you will not need to
1274
+ call this method yourself. Instead you can just use find().
1275
+
1276
+ This will not actually create a record instance but it will initiate a
1277
+ load of the record from the server. You can subsequently get a record
1278
+ instance itself using materializeRecord()
1279
+
1280
+ @param {SC.Record|Array} recordTypes class or array of classes
1281
+ @param {Array} ids ids to retrieve
1282
+ @param {Array} storeKeys (optional) store keys to retrieve
1283
+ @param {Boolean} isRefresh
1284
+ @returns {Array} storeKeys to be retrieved
1285
+ */
1286
+ retrieveRecords: function(recordTypes, ids, storeKeys, isRefresh) {
1287
+
1288
+ var source = this._getDataSource(),
1289
+ isArray = SC.typeOf(recordTypes) === SC.T_ARRAY,
1290
+ len = (!storeKeys) ? ids.length : storeKeys.length,
1291
+ ret = [],
1292
+ rev = SC.Store.generateStoreKey(),
1293
+ K = SC.Record,
1294
+ recordType, idx, storeKey, status, ok;
1295
+
1296
+ if (!isArray) recordType = recordTypes;
1297
+
1298
+ // if no storeKeys were passed, map recordTypes + ids
1299
+ for(idx=0;idx<len;idx++) {
1300
+
1301
+ // collect store key
1302
+ if (storeKeys) {
1303
+ storeKey = storeKeys[idx];
1304
+ } else {
1305
+ if (isArray) recordType = recordTypes[idx];
1306
+ storeKey = recordType.storeKeyFor(ids[idx]);
1307
+ }
1308
+
1309
+ // collect status and process
1310
+ status = this.readStatus(storeKey);
1311
+
1312
+ // K.EMPTY, K.ERROR, K.DESTROYED_CLEAN - initial retrieval
1313
+ if ((status == K.EMPTY) || (status == K.ERROR) || (status == K.DESTROYED_CLEAN)) {
1314
+ this.writeStatus(storeKey, K.BUSY_LOADING);
1315
+ this.dataHashDidChange(storeKey, rev, YES);
1316
+ ret.push(storeKey);
1317
+
1318
+ // otherwise, ignore record unless isRefresh is YES.
1319
+ } else if (isRefresh) {
1320
+ // K.READY_CLEAN, K.READY_DIRTY, ignore K.READY_NEW
1321
+ if (status & K.READY) {
1322
+ this.writeStatus(storeKey, K.BUSY_REFRESH | (status & 0x03)) ;
1323
+ this.dataHashDidChange(storeKey, rev, YES);
1324
+ ret.push(storeKey);
1325
+
1326
+ // K.BUSY_DESTROYING, K.BUSY_COMMITTING, K.BUSY_CREATING
1327
+ } else if ((status == K.BUSY_DESTROYING) || (status == K.BUSY_CREATING) || (status == K.BUSY_COMMITTING)) {
1328
+ throw K.BUSY_ERROR ;
1329
+
1330
+ // K.DESTROY_DIRTY, bad state...
1331
+ } else if (status == K.DESTROYED_DIRTY) {
1332
+ throw K.BAD_STATE_ERROR ;
1333
+
1334
+ // ignore K.BUSY_LOADING, K.BUSY_REFRESH_CLEAN, K.BUSY_REFRESH_DIRTY
1335
+ }
1336
+ }
1337
+ }
1338
+
1339
+ // now retrieve storekeys from dataSource. if there is no dataSource,
1340
+ // then act as if we couldn't retrieve.
1341
+ ok = NO;
1342
+ if (source) ok = source.retrieveRecords.call(source, this, ret, ids);
1343
+
1344
+ // if the data source could not retrieve or if there is no source, then
1345
+ // simulate the data source calling dataSourceDidError on those we are
1346
+ // loading for the first time or dataSourceDidComplete on refreshes.
1347
+ if (!ok) {
1348
+ len = ret.length;
1349
+ rev = SC.Store.generateStoreKey();
1350
+ for(idx=0;idx<len;idx++) {
1351
+ storeKey = ret[idx];
1352
+ status = this.readStatus(storeKey);
1353
+ if (status === K.BUSY_LOADING) {
1354
+ this.writeStatus(storeKey, K.ERROR);
1355
+ this.dataHashDidChange(storeKey, rev, YES);
1356
+
1357
+ } else if (status & K.BUSY_REFRESH) {
1358
+ this.writeStatus(storeKey, K.READY | (status & 0x03));
1359
+ this.dataHashDidChange(storeKey, rev, YES);
1360
+ }
1361
+ }
1362
+ ret.length = 0 ; // truncate to indicate that none could refresh
1363
+ }
1364
+ return ret ;
1365
+ },
1366
+
1367
+ _TMP_RETRIEVE_ARRAY: [],
1368
+
1369
+ /**
1370
+ Retrieves a record from the server. If the record has already been loaded
1371
+ in the store, then this method will simply return. Otherwise if your
1372
+ store has a dataSource, this will call the dataSource to retrieve the
1373
+ record. Generally you will not need to call this method yourself.
1374
+ Instead you can just use find().
1375
+
1376
+ This will not actually create a record instance but it will initiate a
1377
+ load of the record from the server. You can subsequently get a record
1378
+ instance itself using materializeRecord()
1379
+
1380
+ @param {SC.Record} recordType class
1381
+ @param {String} id id to retrieve
1382
+ @param {Number} storeKey (optional) store key
1383
+ @param {Boolean} isRefresh
1384
+ @returns {Number} storeKey that was retrieved
1385
+ */
1386
+ retrieveRecord: function(recordType, id, storeKey, isRefresh) {
1387
+ var array = this._TMP_RETRIEVE_ARRAY,
1388
+ ret;
1389
+
1390
+ if (storeKey) {
1391
+ array[0] = storeKey;
1392
+ storeKey = array;
1393
+ id = null ;
1394
+ } else {
1395
+ array[0] = id;
1396
+ id = array;
1397
+ }
1398
+
1399
+ ret = this.retrieveRecords(recordType, id, storeKey, isRefresh);
1400
+ array.length = 0 ;
1401
+ return ret[0];
1402
+ },
1403
+
1404
+ /**
1405
+ Refreshes a record from the server. If the record has already been loaded
1406
+ in the store, then this method will request a refresh from the dataSource.
1407
+ Otherwise it will attempt to retrieve the record.
1408
+
1409
+ @param {String} id to id of the record to load
1410
+ @param {SC.Record} recordType the expected record type
1411
+ @param {Number} storeKey (optional) optional store key
1412
+ @returns {Boolean} YES if the retrieval was a success.
1413
+ */
1414
+ refreshRecord: function(recordType, id, storeKey) {
1415
+ return !!this.retrieveRecord(recordType, id, storeKey, YES);
1416
+ },
1417
+
1418
+ /**
1419
+ Refreshes a set of records from the server. If the records has already been loaded
1420
+ in the store, then this method will request a refresh from the dataSource.
1421
+ Otherwise it will attempt to retrieve them.
1422
+
1423
+ @param {SC.Record|Array} recordTypes class or array of classes
1424
+ @param {Array} ids ids to destroy
1425
+ @param {Array} storeKeys (optional) store keys to destroy
1426
+ @returns {Boolean} YES if the retrieval was a success.
1427
+ */
1428
+ refreshRecords: function(recordTypes, ids, storeKeys) {
1429
+ var ret = this.retrieveRecords(recordTypes, ids, storeKeys, YES);
1430
+ return ret && ret.length>0;
1431
+ },
1432
+
1433
+ /**
1434
+ Commits the passed store keys or ids. If no storeKeys are given
1435
+ it will commit any records in the changelog.
1436
+
1437
+ Based on the current state of the record, this will ask the data
1438
+ source to perform the appropriate actions
1439
+ on the store keys.
1440
+
1441
+ @param {Array} recordTypes the expected record types (SC.Record)
1442
+ @param {Array} ids to commit
1443
+ @param {Array} storeKeys to commit
1444
+ @param {Hash} params optional additional parameters to pass along to the
1445
+ data source
1446
+
1447
+ @returns {Boolean} if the action was succesful.
1448
+ */
1449
+ commitRecords: function(recordTypes, ids, storeKeys, params) {
1450
+
1451
+ var source = this._getDataSource(),
1452
+ isArray = SC.typeOf(recordTypes) === SC.T_ARRAY,
1453
+ retCreate= [], retUpdate= [], retDestroy = [],
1454
+ rev = SC.Store.generateStoreKey(),
1455
+ K = SC.Record,
1456
+ recordType, idx, storeKey, status, key, ret, len ;
1457
+
1458
+ // If no params are passed, look up storeKeys in the changelog property.
1459
+ // Remove any committed records from changelog property.
1460
+
1461
+ if(!recordTypes && !ids && !storeKeys){
1462
+ storeKeys = this.changelog;
1463
+ }
1464
+
1465
+ len = storeKeys ? storeKeys.get('length') : (ids ? ids.get('length') : 0);
1466
+
1467
+ for(idx=0;idx<len;idx++) {
1468
+
1469
+ // collect store key
1470
+ if (storeKeys) {
1471
+ storeKey = storeKeys[idx];
1472
+ } else {
1473
+ if (isArray) recordType = recordTypes[idx] || SC.Record;
1474
+ else recordType = recordTypes;
1475
+ storeKey = recordType.storeKeyFor(ids[idx]);
1476
+ }
1477
+
1478
+ // collect status and process
1479
+ status = this.readStatus(storeKey);
1480
+
1481
+ if ((status == K.EMPTY) || (status == K.ERROR)) {
1482
+ throw K.NOT_FOUND_ERROR ;
1483
+ }
1484
+ else {
1485
+ if(status==K.READY_NEW) {
1486
+ this.writeStatus(storeKey, K.BUSY_CREATING);
1487
+ this.dataHashDidChange(storeKey, rev, YES);
1488
+ retCreate.push(storeKey);
1489
+ } else if (status==K.READY_DIRTY) {
1490
+ this.writeStatus(storeKey, K.BUSY_COMMITTING);
1491
+ this.dataHashDidChange(storeKey, rev, YES);
1492
+ retUpdate.push(storeKey);
1493
+ } else if (status==K.DESTROYED_DIRTY) {
1494
+ this.writeStatus(storeKey, K.BUSY_DESTROYING);
1495
+ this.dataHashDidChange(storeKey, rev, YES);
1496
+ retDestroy.push(storeKey);
1497
+ } else if (status==K.DESTROYED_CLEAN) {
1498
+ this.dataHashDidChange(storeKey, rev, YES);
1499
+ retDestroy.push(storeKey);
1500
+ }
1501
+ // ignore K.READY_CLEAN, K.BUSY_LOADING, K.BUSY_CREATING, K.BUSY_COMMITTING,
1502
+ // K.BUSY_REFRESH_CLEAN, K_BUSY_REFRESH_DIRTY, KBUSY_DESTROYING
1503
+ }
1504
+ }
1505
+
1506
+ // now commit storekeys to dataSource
1507
+ if (source && (len>0 || params)) {
1508
+ ret = source.commitRecords.call(source, this, retCreate, retUpdate, retDestroy, params);
1509
+ }
1510
+
1511
+ //remove all commited changes from changelog
1512
+ if (ret && !recordTypes && !ids && storeKeys===this.changelog){
1513
+ this.changelog = null;
1514
+ }
1515
+ return ret ;
1516
+ },
1517
+
1518
+ /**
1519
+ Commits the passed store key or id. Based on the current state of the
1520
+ record, this will ask the data source to perform the appropriate action
1521
+ on the store key.
1522
+
1523
+ You have to pass either the id or the storeKey otherwise it will return
1524
+ NO.
1525
+
1526
+ @param {SC.Record} recordType the expected record type
1527
+ @param {String} id the id of the record to commit
1528
+ @param {Number} storeKey the storeKey of the record to commit
1529
+ @param {Hash} params optional additonal params that will passed down
1530
+ to the data source
1531
+ @returns {Boolean} if the action was successful.
1532
+ */
1533
+ commitRecord: function(recordType, id, storeKey, params) {
1534
+ var array = this._TMP_RETRIEVE_ARRAY,
1535
+ ret ;
1536
+ if (id === undefined && storeKey === undefined ) return NO;
1537
+ if (storeKey !== undefined) {
1538
+ array[0] = storeKey;
1539
+ storeKey = array;
1540
+ id = null ;
1541
+ } else {
1542
+ array[0] = id;
1543
+ id = array;
1544
+ }
1545
+
1546
+ ret = this.commitRecords(recordType, id, storeKey, params);
1547
+ array.length = 0 ;
1548
+ return ret;
1549
+ },
1550
+
1551
+ /**
1552
+ Cancels an inflight request for the passed records. Depending on the
1553
+ server implementation, this could cancel an entire request, causing
1554
+ other records to also transition their current state.
1555
+
1556
+ @param {SC.Record|Array} recordTypes class or array of classes
1557
+ @param {Array} ids ids to destroy
1558
+ @param {Array} storeKeys (optional) store keys to destroy
1559
+ @returns {SC.Store} the store.
1560
+ */
1561
+ cancelRecords: function(recordTypes, ids, storeKeys) {
1562
+ var source = this._getDataSource(),
1563
+ isArray = SC.typeOf(recordTypes) === SC.T_ARRAY,
1564
+ K = SC.Record,
1565
+ ret = [],
1566
+ status, len, idx, id, recordType, storeKey;
1567
+
1568
+ len = (storeKeys === undefined) ? ids.length : storeKeys.length;
1569
+ for(idx=0;idx<len;idx++) {
1570
+ if (isArray) recordType = recordTypes[idx] || SC.Record;
1571
+ else recordType = recordTypes || SC.Record;
1572
+
1573
+ id = ids ? ids[idx] : undefined ;
1574
+
1575
+ if(storeKeys===undefined){
1576
+ storeKey = recordType.storeKeyFor(id);
1577
+ }else{
1578
+ storeKey = storeKeys ? storeKeys[idx] : undefined ;
1579
+ }
1580
+ if(storeKey) {
1581
+ status = this.readStatus(storeKey);
1582
+
1583
+ if ((status == K.EMPTY) || (status == K.ERROR)) {
1584
+ throw K.NOT_FOUND_ERROR ;
1585
+ }
1586
+ ret.push(storeKey);
1587
+ }
1588
+ }
1589
+
1590
+ if (source) source.cancel.call(source, this, ret);
1591
+
1592
+ return this ;
1593
+ },
1594
+
1595
+ /**
1596
+ Cancels an inflight request for the passed record. Depending on the
1597
+ server implementation, this could cancel an entire request, causing
1598
+ other records to also transition their current state.
1599
+
1600
+ @param {SC.Record|Array} recordTypes class or array of classes
1601
+ @param {Array} ids ids to destroy
1602
+ @param {Array} storeKeys (optional) store keys to destroy
1603
+ @returns {SC.Store} the store.
1604
+ */
1605
+ cancelRecord: function(recordType, id, storeKey) {
1606
+ var array = this._TMP_RETRIEVE_ARRAY,
1607
+ ret ;
1608
+
1609
+ if (storeKey !== undefined) {
1610
+ array[0] = storeKey;
1611
+ storeKey = array;
1612
+ id = null ;
1613
+ } else {
1614
+ array[0] = id;
1615
+ id = array;
1616
+ }
1617
+
1618
+ ret = this.cancelRecords(recordType, id, storeKey);
1619
+ array.length = 0 ;
1620
+ return this;
1621
+ },
1622
+
1623
+ /**
1624
+ Convenience method can be called by the store or other parts of your
1625
+ application to load records into the store. This method will take a
1626
+ recordType and an array of data hashes and either add or update the
1627
+ record in the store.
1628
+
1629
+ The loaded records will be in an SC.Record.READY_CLEAN state, indicating
1630
+ they were loaded from the data source and do not need to be committed
1631
+ back before changing.
1632
+
1633
+ This method will check the state of each storeKey and call either
1634
+ pushRetrieve() or dataSourceDidComplete(). The standard state constraints
1635
+ for these methods apply here.
1636
+
1637
+ The return value will be the storeKeys used for each push. This is often
1638
+ convenient to pass into loadQuery(), if you are fetching a remote query.
1639
+
1640
+ If you are upgrading from a pre SproutCore 1.0 application, this method
1641
+ is the closest to the old updateRecords().
1642
+
1643
+ @param {SC.Record} recordTypes the record type or array of record types
1644
+ @param {Array} dataHashes array of data hashes to update
1645
+ @param {Array} ids optional array of ids. if not passed lookup on hashes
1646
+ @returns {Array} store keys assigned to these ids
1647
+ */
1648
+ loadRecords: function(recordTypes, dataHashes, ids) {
1649
+ var isArray = SC.typeOf(recordTypes) === SC.T_ARRAY,
1650
+ len = dataHashes.get('length'),
1651
+ ret = [],
1652
+ K = SC.Record,
1653
+ recordType, id, primaryKey, idx, dataHash, storeKey;
1654
+
1655
+ // save lookup info
1656
+ if (!isArray) {
1657
+ recordType = recordTypes || SC.Record;
1658
+ primaryKey = recordType.prototype.primaryKey ;
1659
+ }
1660
+
1661
+ // push each record
1662
+ for(idx=0;idx<len;idx++) {
1663
+ dataHash = dataHashes.objectAt(idx);
1664
+ if (isArray) {
1665
+ recordType = recordTypes.objectAt(idx) || SC.Record;
1666
+ primaryKey = recordType.prototype.primaryKey ;
1667
+ }
1668
+ id = (ids) ? ids.objectAt(idx) : dataHash[primaryKey];
1669
+ ret[idx] = storeKey = recordType.storeKeyFor(id); // needed to cache
1670
+
1671
+ if (this.readStatus(storeKey) & K.BUSY) {
1672
+ this.dataSourceDidComplete(storeKey, dataHash, id);
1673
+ } else this.pushRetrieve(recordType, id, dataHash, storeKey);
1674
+ }
1675
+
1676
+ // return storeKeys
1677
+ return ret ;
1678
+ },
1679
+
1680
+ // ..........................................................
1681
+ // DATA SOURCE CALLBACKS
1682
+ //
1683
+ // Mathods called by the data source on the store
1684
+
1685
+ /**
1686
+ Called by a dataSource when it cancels an inflight operation on a
1687
+ record. This will transition the record back to it non-inflight state.
1688
+
1689
+ @param {Number} storeKey record store key to cancel
1690
+ @returns {SC.Store} reciever
1691
+ */
1692
+ dataSourceDidCancel: function(storeKey) {
1693
+ var status = this.readStatus(storeKey),
1694
+ K = SC.Record;
1695
+
1696
+ // EMPTY, ERROR, READY_CLEAN, READY_NEW, READY_DIRTY, DESTROYED_CLEAN,
1697
+ // DESTROYED_DIRTY
1698
+ if (!(status & K.BUSY)) {
1699
+ throw K.BAD_STATE_ERROR; // should never be called in this state
1700
+
1701
+ }
1702
+
1703
+ // otherwise, determine proper state transition
1704
+ switch(status) {
1705
+ case K.BUSY_LOADING:
1706
+ status = K.EMPTY;
1707
+ break ;
1708
+
1709
+ case K.BUSY_CREATING:
1710
+ status = K.READY_NEW;
1711
+ break;
1712
+
1713
+ case K.BUSY_COMMITTING:
1714
+ status = K.READY_DIRTY ;
1715
+ break;
1716
+
1717
+ case K.BUSY_REFRESH_CLEAN:
1718
+ status = K.READY_CLEAN;
1719
+ break;
1720
+
1721
+ case K.BUSY_REFRESH_DIRTY:
1722
+ status = K.READY_DIRTY ;
1723
+ break ;
1724
+
1725
+ case K.BUSY_DESTROYING:
1726
+ status = K.DESTROYED_DIRTY ;
1727
+ break;
1728
+
1729
+ default:
1730
+ throw K.BAD_STATE_ERROR ;
1731
+ }
1732
+ this.writeStatus(storeKey, status) ;
1733
+ this.dataHashDidChange(storeKey, null, YES);
1734
+
1735
+ return this ;
1736
+ },
1737
+
1738
+ /**
1739
+ Called by a data source when it creates or commits a record. Passing an
1740
+ optional id will remap the storeKey to the new record id. This is
1741
+ required when you commit a record that does not have an id yet.
1742
+
1743
+ @param {Number} storeKey record store key to change to READY_CLEAN state
1744
+ @param {Hash} dataHash optional data hash to replace current hash
1745
+ @param {Object} newId optional new id to replace the old one
1746
+ @returns {SC.Store} reciever
1747
+ */
1748
+ dataSourceDidComplete: function(storeKey, dataHash, newId) {
1749
+ var status = this.readStatus(storeKey), K = SC.Record, statusOnly;
1750
+
1751
+ // EMPTY, ERROR, READY_CLEAN, READY_NEW, READY_DIRTY, DESTROYED_CLEAN,
1752
+ // DESTROYED_DIRTY
1753
+ if (!(status & K.BUSY)) {
1754
+ throw K.BAD_STATE_ERROR; // should never be called in this state
1755
+ }
1756
+
1757
+ // otherwise, determine proper state transition
1758
+ if(status===K.BUSY_DESTROYING) {
1759
+ throw K.BAD_STATE_ERROR ;
1760
+ } else status = K.READY_CLEAN ;
1761
+
1762
+ this.writeStatus(storeKey, status) ;
1763
+ if (dataHash) this.writeDataHash(storeKey, dataHash, status) ;
1764
+ if (newId) SC.Store.replaceIdFor(storeKey, newId);
1765
+
1766
+ statusOnly = dataHash || newId ? NO : YES;
1767
+ this.dataHashDidChange(storeKey, null, statusOnly);
1768
+
1769
+ return this ;
1770
+ },
1771
+
1772
+ /**
1773
+ Called by a data source when it has destroyed a record. This will
1774
+ transition the record to the proper state.
1775
+
1776
+ @param {Number} storeKey record store key to cancel
1777
+ @returns {SC.Store} reciever
1778
+ */
1779
+ dataSourceDidDestroy: function(storeKey) {
1780
+ var status = this.readStatus(storeKey), K = SC.Record;
1781
+
1782
+ // EMPTY, ERROR, READY_CLEAN, READY_NEW, READY_DIRTY, DESTROYED_CLEAN,
1783
+ // DESTROYED_DIRTY
1784
+ if (!(status & K.BUSY)) {
1785
+ throw K.BAD_STATE_ERROR; // should never be called in this state
1786
+ }
1787
+ // otherwise, determine proper state transition
1788
+ else{
1789
+ status = K.DESTROYED_CLEAN ;
1790
+ }
1791
+ this.removeDataHash(storeKey, status) ;
1792
+ this.dataHashDidChange(storeKey);
1793
+
1794
+ return this ;
1795
+ },
1796
+
1797
+ /**
1798
+ Converts the passed record into an error object.
1799
+
1800
+ @param {Number} storeKey record store key to cancel
1801
+ @returns {SC.Store} reciever
1802
+ */
1803
+ dataSourceDidError: function(storeKey, error) {
1804
+ var status = this.readStatus(storeKey), K = SC.Record;
1805
+
1806
+ // EMPTY, ERROR, READY_CLEAN, READY_NEW, READY_DIRTY, DESTROYED_CLEAN,
1807
+ // DESTROYED_DIRTY
1808
+ if (!(status & K.BUSY)) throw K.BAD_STATE_ERROR;
1809
+
1810
+ // otherwise, determine proper state transition
1811
+ else status = K.ERROR ;
1812
+
1813
+ this.writeStatus(storeKey, status) ;
1814
+ this.dataHashDidChange(storeKey, null, YES);
1815
+
1816
+ return this ;
1817
+ },
1818
+
1819
+ // ..........................................................
1820
+ // PUSH CHANGES FROM DATA SOURCE
1821
+ //
1822
+
1823
+ /**
1824
+ Call by the data source whenever you want to push new data out of band
1825
+ into the store.
1826
+
1827
+ @param {Class} recordType the SC.Record subclass
1828
+ @param {Object} id the record id or null
1829
+ @param {Hash} dataHash data hash to load
1830
+ @param {Number} storeKey optional store key.
1831
+ @returns {Boolean} YES if push was allowed
1832
+ */
1833
+ pushRetrieve: function(recordType, id, dataHash, storeKey) {
1834
+ var K = SC.Record, status;
1835
+
1836
+ if(storeKey===undefined) storeKey = recordType.storeKeyFor(id);
1837
+ status = this.readStatus(storeKey);
1838
+ if(status==K.EMPTY || status==K.ERROR || status==K.READY_CLEAN || status==K.DESTROYED_CLEAN) {
1839
+
1840
+ status = K.READY_CLEAN;
1841
+ if(dataHash===undefined) this.writeStatus(storeKey, status) ;
1842
+ else this.writeDataHash(storeKey, dataHash, status) ;
1843
+
1844
+ this.dataHashDidChange(storeKey);
1845
+
1846
+ return YES;
1847
+ }
1848
+ //conflicted (ready)
1849
+ return NO;
1850
+ },
1851
+
1852
+ /**
1853
+ Call by the data source whenever you want to push a deletion into the
1854
+ store.
1855
+
1856
+ @param {Class} recordType the SC.Record subclass
1857
+ @param {Object} id the record id or null
1858
+ @param {Number} storeKey optional store key.
1859
+ @returns {Boolean} YES if push was allowed
1860
+ */
1861
+ pushDestroy: function(recordType, id, storeKey) {
1862
+ var K = SC.Record, status;
1863
+
1864
+ if(storeKey===undefined){
1865
+ storeKey = recordType.storeKeyFor(id);
1866
+ }
1867
+ status = this.readStatus(storeKey);
1868
+ if(status==K.EMPTY || status==K.ERROR || status==K.READY_CLEAN || status==K.DESTROY_CLEAN){
1869
+ status = K.DESTROY_CLEAN;
1870
+ this.removeDataHash(storeKey, status) ;
1871
+ this.dataHashDidChange(storeKey);
1872
+ return YES;
1873
+ }
1874
+ //conflicted (destroy)
1875
+ return NO;
1876
+ },
1877
+
1878
+ /**
1879
+ Call by the data source whenever you want to push an error into the
1880
+ store.
1881
+
1882
+ @param {Class} recordType the SC.Record subclass
1883
+ @param {Object} id the record id or null
1884
+ @param {Number} storeKey optional store key.
1885
+ @returns {Boolean} YES if push was allowed
1886
+ */
1887
+ pushError: function(recordType, id, error, storeKey) {
1888
+ var K = SC.Record, status;
1889
+
1890
+ if(storeKey===undefined) storeKey = recordType.storeKeyFor(id);
1891
+ status = this.readStatus(storeKey);
1892
+
1893
+ if(status==K.EMPTY || status==K.ERROR || status==K.READY_CLEAN || status==K.DESTROY_CLEAN){
1894
+ status = K.ERROR;
1895
+ this.writeStatus(storeKey, status) ;
1896
+ this.dataHashDidChange(storeKey, null, YES);
1897
+ return YES;
1898
+ }
1899
+ //conflicted (error)
1900
+ return NO;
1901
+ },
1902
+
1903
+ // ..........................................................
1904
+ // FETCH CALLBACKS
1905
+ //
1906
+
1907
+ // NOTE: although these method works on RecordArray instances right now.
1908
+ // They could be optimized to actually share query results between nested
1909
+ // stores. This is why these methods are implemented here instead of
1910
+ // directly on Query or RecordArray objects.
1911
+
1912
+ /**
1913
+ Sets the passed array of storeKeys as the new data for the query. You
1914
+ can call this at any time for a remote query to update its content. If
1915
+ you want to use incremental loading, then pass a SparseArray object.
1916
+
1917
+ If the query you pass is not a REMOTE query, then this method will raise
1918
+ an exception. This will also implicitly transition the query state to
1919
+ SC.Record.READY.
1920
+
1921
+ If you called loadRecords() before to load the actual content, you can
1922
+ call this method with the return value of that method to actually set the
1923
+ storeKeys on the result.
1924
+
1925
+ @param {SC.Query} query the query you are loading. must be remote.
1926
+ @param {SC.Array} storeKeys array of store keys
1927
+ @returns {SC.Store} receiver
1928
+ */
1929
+ loadQueryResults: function(query, storeKeys) {
1930
+ if (query.get('location') === SC.Query.LOCAL) {
1931
+ throw "Cannot load query results for a local query";
1932
+ }
1933
+
1934
+ var recArray = this._findQuery(query, YES, NO);
1935
+ if (recArray) recArray.set('storeKeys', storeKeys);
1936
+ this.dataSourceDidFetchQuery(query);
1937
+
1938
+ return this ;
1939
+ },
1940
+
1941
+ /**
1942
+ Called by your data source whenever you finish fetching the results of a
1943
+ query. This will put the query into a READY state if it was loading.
1944
+
1945
+ Note that if the query is a REMOTE query, then you must separately load
1946
+ the results into the query using loadQuery(). If the query is LOCAL, then
1947
+ the query will update automatically with any new records you added to the
1948
+ store.
1949
+
1950
+ @param {SC.Query} query the query you fetched
1951
+ @returns {SC.Store} receiver
1952
+ */
1953
+ dataSourceDidFetchQuery: function(query) {
1954
+ return this._scstore_dataSourceDidFetchQuery(query, YES);
1955
+ },
1956
+
1957
+ _scstore_dataSourceDidFetchQuery: function(query, createIfNeeded) {
1958
+ var recArray = this._findQuery(query, createIfNeeded, NO),
1959
+ nestedStores = this.get('nestedStores'),
1960
+ loc = nestedStores ? nestedStores.get('length') : 0;
1961
+
1962
+ // fix query if needed
1963
+ if (recArray) recArray.storeDidFetchQuery(query);
1964
+
1965
+ // notify nested stores
1966
+ while(--loc >= 0) {
1967
+ nestedStores[loc]._scstore_dataSourceDidFetchQuery(query, NO);
1968
+ }
1969
+
1970
+ return this ;
1971
+ },
1972
+
1973
+ /**
1974
+ Called by your data source if it cancels fetching the results of a query.
1975
+ This will put any RecordArray's back into its original state (READY or
1976
+ EMPTY).
1977
+
1978
+ @param {SC.Query} query the query you cancelled
1979
+ @returns {SC.Store} receiver
1980
+ */
1981
+ dataSourceDidCancelQuery: function(query) {
1982
+ return this._scstore_dataSourceDidCancelQuery(query, YES);
1983
+ },
1984
+
1985
+ _scstore_dataSourceDidCancelQuery: function(query, createIfNeeded) {
1986
+ var recArray = this._findQuery(query, createIfNeeded, NO),
1987
+ nestedStores = this.get('nestedStores'),
1988
+ loc = nestedStores ? nestedStores.get('length') : 0;
1989
+
1990
+ // fix query if needed
1991
+ if (recArray) recArray.storeDidCancelQuery(query);
1992
+
1993
+ // notify nested stores
1994
+ while(--loc >= 0) {
1995
+ nestedStores[loc]._scstore_dataSourceDidCancelQuery(query, NO);
1996
+ }
1997
+
1998
+ return this ;
1999
+ },
2000
+
2001
+ /**
2002
+ Called by your data source if it encountered an error loading the query.
2003
+ This will put the query into an error state until you try to refresh it
2004
+ again.
2005
+
2006
+ @param {SC.Query} query the query with the error
2007
+ @param {SC.Error} error optional error object to set
2008
+ @returns {SC.Store} receiver
2009
+ */
2010
+ dataSourceDidErrorQuery: function(query, error) {
2011
+ return this._scstore_dataSourceDidErrorQuery(query, YES);
2012
+ },
2013
+
2014
+ _scstore_dataSourceDidErrorQuery: function(query, createIfNeeded) {
2015
+ var recArray = this._findQuery(query, createIfNeeded, NO),
2016
+ nestedStores = this.get('nestedStores'),
2017
+ loc = nestedStores ? nestedStores.get('length') : 0;
2018
+
2019
+ // fix query if needed
2020
+ if (recArray) recArray.storeDidErrorQuery(query);
2021
+
2022
+ // notify nested stores
2023
+ while(--loc >= 0) {
2024
+ nestedStores[loc]._scstore_dataSourceDidErrorQuery(query, NO);
2025
+ }
2026
+
2027
+ return this ;
2028
+ },
2029
+
2030
+ // ..........................................................
2031
+ // INTERNAL SUPPORT
2032
+ //
2033
+
2034
+ /** @private */
2035
+ init: function() {
2036
+ sc_super();
2037
+ this.reset();
2038
+ },
2039
+
2040
+
2041
+ // ..........................................................
2042
+ // PRIMARY KEY CONVENIENCE METHODS
2043
+ //
2044
+
2045
+ /**
2046
+ Given a storeKey, return the primaryKey.
2047
+
2048
+ @param {Number} storeKey the store key
2049
+ @returns {String} primaryKey value
2050
+ */
2051
+ idFor: function(storeKey) {
2052
+ return SC.Store.idFor(storeKey);
2053
+ },
2054
+
2055
+ /**
2056
+ Given a storeKey, return the recordType.
2057
+
2058
+ @param {Number} storeKey the store key
2059
+ @returns {SC.Record} record instance
2060
+ */
2061
+ recordTypeFor: function(storeKey) {
2062
+ return SC.Store.recordTypeFor(storeKey) ;
2063
+ },
2064
+
2065
+ /**
2066
+ Given a recordType and primaryKey, find the storeKey. If the primaryKey
2067
+ has not been assigned a storeKey yet, it will be added.
2068
+
2069
+ @param {SC.Record} recordType the record type
2070
+ @param {String} primaryKey the primary key
2071
+ @returns {Number} storeKey
2072
+ */
2073
+ storeKeyFor: function(recordType, primaryKey) {
2074
+ return recordType.storeKeyFor(primaryKey);
2075
+ },
2076
+
2077
+ /**
2078
+ Given a primaryKey value for the record, returns the associated
2079
+ storeKey. As opposed to storeKeyFor() however, this method
2080
+ will NOT generate a new storeKey but returned undefined.
2081
+
2082
+ @param {String} id a record id
2083
+ @returns {Number} a storeKey.
2084
+ */
2085
+ storeKeyExists: function(recordType, primaryKey) {
2086
+ return recordType.storeKeyExists(primaryKey);
2087
+ },
2088
+
2089
+ /**
2090
+ Finds all storeKeys of a certain record type in this store
2091
+ and returns an array.
2092
+
2093
+ @param {SC.Record} recordType
2094
+ @returns {Array} set of storeKeys
2095
+ */
2096
+ storeKeysFor: function(recordType) {
2097
+ var ret = [],
2098
+ isEnum = recordType && recordType.isEnumerable,
2099
+ recType, storeKey, isMatch ;
2100
+
2101
+ if (!this.statuses) return ret;
2102
+ for(storeKey in SC.Store.recordTypesByStoreKey) {
2103
+ recType = SC.Store.recordTypesByStoreKey[storeKey];
2104
+
2105
+ // if same record type and this store has it
2106
+ if (isEnum) isMatch = recordType.contains(recType);
2107
+ else isMatch = recType === recordType;
2108
+
2109
+ if(isMatch && this.statuses[storeKey]) ret.push(parseInt(storeKey, 0));
2110
+ }
2111
+
2112
+ return ret;
2113
+ },
2114
+
2115
+ /**
2116
+ Finds all storeKeys in this store
2117
+ and returns an array.
2118
+
2119
+ @returns {Array} set of storeKeys
2120
+ */
2121
+ storeKeys: function() {
2122
+ var ret = [], storeKey;
2123
+ if(!this.statuses) return;
2124
+
2125
+ for(storeKey in this.statuses) {
2126
+ // if status is not empty
2127
+ if(this.statuses[storeKey] != SC.Record.EMPTY) {
2128
+ ret.push(parseInt(storeKey,0));
2129
+ }
2130
+ }
2131
+
2132
+ return ret;
2133
+ },
2134
+
2135
+ /**
2136
+ Returns string representation of a storeKey, with status.
2137
+
2138
+ @param {Number} storeKey
2139
+ @returns {String}
2140
+ */
2141
+ statusString: function(storeKey) {
2142
+ var rec = this.materializeRecord(storeKey);
2143
+ return rec.statusString();
2144
+ }
2145
+
2146
+ }) ;
2147
+
2148
+ SC.Store.mixin({
2149
+
2150
+ /**
2151
+ Standard error raised if you try to commit changes from a nested store
2152
+ and there is a conflict.
2153
+
2154
+ @property {Error}
2155
+ */
2156
+ CHAIN_CONFLICT_ERROR: new Error("Nested Store Conflict"),
2157
+
2158
+ /**
2159
+ Standard error if you try to perform an operation on a nested store
2160
+ without a parent.
2161
+
2162
+ @property {Error}
2163
+ */
2164
+ NO_PARENT_STORE_ERROR: new Error("Parent Store Required"),
2165
+
2166
+ /**
2167
+ Standard error if you try to perform an operation on a nested store that
2168
+ is only supported in root stores.
2169
+
2170
+ @property {Error}
2171
+ */
2172
+ NESTED_STORE_UNSUPPORTED_ERROR: new Error("Unsupported In Nested Store"),
2173
+
2174
+ /**
2175
+ Data hash state indicates the data hash is currently editable
2176
+
2177
+ @property {String}
2178
+ */
2179
+ EDITABLE: 'editable',
2180
+
2181
+ /**
2182
+ Data hash state indicates the hash no longer tracks changes from a
2183
+ parent store, but it is not editable.
2184
+
2185
+ @property {String}
2186
+ */
2187
+ LOCKED: 'locked',
2188
+
2189
+ /**
2190
+ Data hash state indicates the hash is tracking changes from the parent
2191
+ store and is not editable.
2192
+
2193
+ @property {String}
2194
+ */
2195
+ INHERITED: 'inherited',
2196
+
2197
+ /** @private
2198
+ This array maps all storeKeys to primary keys. You will not normally
2199
+ access this method directly. Instead use the idFor() and
2200
+ storeKeyFor() methods on SC.Record.
2201
+ */
2202
+ idsByStoreKey: [],
2203
+
2204
+ /** @private
2205
+ Maps all storeKeys to a recordType. Once a storeKey is associated with
2206
+ a primaryKey and recordType that remains constant throughout the lifetime
2207
+ of the application.
2208
+ */
2209
+ recordTypesByStoreKey: {},
2210
+
2211
+ /** @private
2212
+ Maps some storeKeys to query instance. Once a storeKey is associated with
2213
+ a query instance, that remains constant through the lifetime of the
2214
+ application. If a Query is destroyed, it will remove itself from this
2215
+ list.
2216
+
2217
+ Don't access this directly. Use queryFor().
2218
+ */
2219
+ queriesByStoreKey: [],
2220
+
2221
+ /** @private
2222
+ The next store key to allocate. A storeKey must always be greater than 0
2223
+ */
2224
+ nextStoreKey: 1,
2225
+
2226
+ /**
2227
+ Generates a new store key for use.
2228
+
2229
+ @property {Number}
2230
+ */
2231
+ generateStoreKey: function() { return this.nextStoreKey++; },
2232
+
2233
+ /**
2234
+ Given a storeKey returns the primaryKey associated with the key.
2235
+ If not primaryKey is associated with the storeKey, returns null.
2236
+
2237
+ @param {Number} storeKey the store key
2238
+ @returns {String} the primary key or null
2239
+ */
2240
+ idFor: function(storeKey) {
2241
+ return this.idsByStoreKey[storeKey] ;
2242
+ },
2243
+
2244
+ /**
2245
+ Given a storeKey, returns the query object associated with the key. If
2246
+ no query is associated with the storeKey, returns null.
2247
+
2248
+ @param {Number} storeKey the store key
2249
+ @returns {SC.Query} query query object
2250
+ */
2251
+ queryFor: function(storeKey) {
2252
+ return this.queriesByStoreKey[storeKey];
2253
+ },
2254
+
2255
+ /**
2256
+ Given a storeKey returns the SC.Record class associated with the key.
2257
+ If no record type is associated with the store key, returns null.
2258
+
2259
+ The SC.Record class will only be found if you have already called
2260
+ storeKeyFor() on the record.
2261
+
2262
+ @param {Number} storeKey the store key
2263
+ @returns {SC.Record} the record type
2264
+ */
2265
+ recordTypeFor: function(storeKey) {
2266
+ return this.recordTypesByStoreKey[storeKey];
2267
+ },
2268
+
2269
+ /**
2270
+ Swaps the primaryKey mapped to the given storeKey with the new
2271
+ primaryKey. If the storeKey is not currently associated with a record
2272
+ this will raise an exception.
2273
+
2274
+ @param {Number} storeKey the existing store key
2275
+ @param {String} newPrimaryKey the new primary key
2276
+ @returns {SC.Store} receiver
2277
+ */
2278
+ replaceIdFor: function(storeKey, newId) {
2279
+ var oldId = this.idsByStoreKey[storeKey],
2280
+ recordType, storeKeys;
2281
+
2282
+ if (oldId !== newId) { // skip if id isn't changing
2283
+
2284
+ recordType = this.recordTypeFor(storeKey);
2285
+ if (!recordType) {
2286
+ throw "replaceIdFor: storeKey %@ does not exist".fmt(storeKey);
2287
+ }
2288
+
2289
+ // map one direction...
2290
+ this.idsByStoreKey[storeKey] = newId;
2291
+
2292
+ // then the other...
2293
+ storeKeys = recordType.storeKeysById() ;
2294
+ delete storeKeys[oldId];
2295
+ storeKeys[newId] = storeKey;
2296
+ }
2297
+
2298
+ return this ;
2299
+ },
2300
+
2301
+ /**
2302
+ Swaps the recordType recorded for a given storeKey. Normally you should
2303
+ not call this method directly as it can damage the store behavior. This
2304
+ method is used by other store methods to set the recordType for a
2305
+ storeKey.
2306
+
2307
+ @param {Integer} storeKey the store key
2308
+ @param {SC.Record} recordType a record class
2309
+ @returns {SC.Store} reciever
2310
+ */
2311
+ replaceRecordTypeFor: function(storeKey, recordType) {
2312
+ this.recordTypesByStoreKey[storeKey] = recordType;
2313
+ return this ;
2314
+ }
2315
+
2316
+ });
2317
+
2318
+
2319
+ /** @private */
2320
+ SC.Store.prototype.nextStoreIndex = 1;
2321
+
2322
+ // ..........................................................
2323
+ // COMPATIBILITY
2324
+ //
2325
+
2326
+ /** @private
2327
+ global store is used only for deprecated compatibility methods. Don't use
2328
+ this in real code.
2329
+ */
2330
+ SC.Store._getDefaultStore = function() {
2331
+ var store = this._store;
2332
+ if(!store) this._store = store = SC.Store.create();
2333
+ return store;
2334
+ };
2335
+
2336
+ /** @private
2337
+
2338
+ DEPRECATED
2339
+
2340
+ Included for compatibility, loads data hashes with the named recordType.
2341
+ If no recordType is passed, expects to find a recordType property in the
2342
+ data hashes. dataSource and isLoaded params are ignored.
2343
+
2344
+ Calls SC.Store#loadRecords() on the default store. Do not use this method in
2345
+ new code.
2346
+
2347
+ @param {Array} dataHashes data hashes to import
2348
+ @param {Object} dataSource ignored
2349
+ @param {SC.Record} recordType default record type
2350
+ @param {Boolean} isLoaded ignored
2351
+ @returns {Array} SC.Record instances for loaded data hashes
2352
+ */
2353
+ SC.Store.updateRecords = function(dataHashes, dataSource, recordType, isLoaded) {
2354
+
2355
+ console.warn("SC.Store.updateRecords() is deprecated. Use loadRecords() instead");
2356
+
2357
+ var store = this._getDefaultStore(),
2358
+ len = dataHashes.length,
2359
+ idx, ret;
2360
+
2361
+ // if no recordType was passed, build an array of recordTypes from hashes
2362
+ if (!recordType) {
2363
+ recordType = [];
2364
+ for(idx=0;idx<len;idx++) recordType[idx] = dataHashes[idx].recordType;
2365
+ }
2366
+
2367
+ // call new API. Returns storeKeys
2368
+ ret = store.loadRecords(recordType, dataHashes);
2369
+
2370
+ // map to SC.Record instances
2371
+ len = ret.length;
2372
+ for(idx=0;idx<len;idx++) ret[idx] = store.materializeRecord(ret[idx]);
2373
+
2374
+ return ret ;
2375
+ };
2376
+
2377
+ /** @private
2378
+
2379
+ DEPRECATED
2380
+
2381
+ Finds a record with the passed guid on the default store. This is included
2382
+ only for compatibility. You should use the newer find() method defined on
2383
+ SC.Store instead.
2384
+
2385
+ @param {String} guid the guid
2386
+ @param {SC.Record} recordType expected record type
2387
+ @returns {SC.Record} found record
2388
+ */
2389
+ SC.Store.find = function(guid, recordType) {
2390
+ return this._getDefaultStore().find(recordType, guid);
2391
+ };
2392
+
2393
+ /** @private
2394
+
2395
+ DEPRECATED
2396
+
2397
+ Passes through to findAll on default store. This is included only for
2398
+ compatibility. You should use the newer findAll() defined on SC.Store
2399
+ instead.
2400
+
2401
+ @param {Hash} filter search parameters
2402
+ @param {SC.Record} recordType type of record to find
2403
+ @returns {SC.RecordArray} result set
2404
+ */
2405
+ SC.Store.findAll = function(filter, recordType) {
2406
+ return this._getDefaultStore().findAll(filter, recordType);
2407
+ };