sproutit-sproutcore 1.0.0.20090407205609 → 1.0.0.20090408130025

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 (574) hide show
  1. data/frameworks/sproutcore/Buildfile +63 -0
  2. data/frameworks/sproutcore/HISTORY +682 -0
  3. data/frameworks/sproutcore/README +22 -0
  4. data/frameworks/sproutcore/apps/sc_jsdoc/controllers/docs.js +149 -0
  5. data/frameworks/sproutcore/apps/sc_jsdoc/core.js +16 -0
  6. data/frameworks/sproutcore/apps/sc_jsdoc/english.lproj/body.css +17 -0
  7. data/frameworks/sproutcore/apps/sc_jsdoc/english.lproj/body.js +99 -0
  8. data/frameworks/sproutcore/apps/sc_jsdoc/english.lproj/images/sproutcore-logo.png +0 -0
  9. data/frameworks/sproutcore/apps/sc_jsdoc/english.lproj/strings.js +15 -0
  10. data/frameworks/sproutcore/apps/sc_jsdoc/main.js +27 -0
  11. data/frameworks/sproutcore/apps/sc_jsdoc/models/doc.js +21 -0
  12. data/frameworks/sproutcore/apps/sc_qunit/controllers/runner.js +209 -0
  13. data/frameworks/sproutcore/apps/sc_qunit/core.js +16 -0
  14. data/frameworks/sproutcore/apps/sc_qunit/english.lproj/body.css +17 -0
  15. data/frameworks/sproutcore/apps/sc_qunit/english.lproj/body.js +107 -0
  16. data/frameworks/sproutcore/apps/sc_qunit/english.lproj/images/sproutcore-logo.png +0 -0
  17. data/frameworks/sproutcore/apps/sc_qunit/english.lproj/strings.js +15 -0
  18. data/frameworks/sproutcore/apps/sc_qunit/main.js +18 -0
  19. data/frameworks/sproutcore/apps/sc_qunit/models/test.js +24 -0
  20. data/frameworks/sproutcore/apps/sc_qunit/views/test_iframe.js +52 -0
  21. data/frameworks/sproutcore/apps/tests/controllers/targets.js +47 -0
  22. data/frameworks/sproutcore/apps/tests/controllers/test.js +20 -0
  23. data/frameworks/sproutcore/apps/tests/controllers/tests.js +38 -0
  24. data/frameworks/sproutcore/apps/tests/core.js +35 -0
  25. data/frameworks/sproutcore/apps/tests/english.lproj/loading.rhtml +9 -0
  26. data/frameworks/sproutcore/apps/tests/english.lproj/main_page.css +19 -0
  27. data/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +86 -0
  28. data/frameworks/sproutcore/apps/tests/english.lproj/strings.js +17 -0
  29. data/frameworks/sproutcore/apps/tests/fixtures/target.js +43 -0
  30. data/frameworks/sproutcore/apps/tests/fixtures/test.js +43 -0
  31. data/frameworks/sproutcore/apps/tests/main.js +39 -0
  32. data/frameworks/sproutcore/apps/tests/models/target.js +49 -0
  33. data/frameworks/sproutcore/apps/tests/models/test.js +20 -0
  34. data/frameworks/sproutcore/apps/tests/tests/controllers/targets.js +15 -0
  35. data/frameworks/sproutcore/apps/tests/tests/controllers/test.js +15 -0
  36. data/frameworks/sproutcore/apps/tests/tests/controllers/tests.js +15 -0
  37. data/frameworks/sproutcore/apps/tests/tests/models/target.js +15 -0
  38. data/frameworks/sproutcore/apps/tests/tests/models/test.js +15 -0
  39. data/frameworks/sproutcore/apps/welcome/core.js +23 -0
  40. data/frameworks/sproutcore/apps/welcome/english.lproj/loading.rhtml +8 -0
  41. data/frameworks/sproutcore/apps/welcome/english.lproj/main_page.js +43 -0
  42. data/frameworks/sproutcore/apps/welcome/english.lproj/strings.js +15 -0
  43. data/frameworks/sproutcore/apps/welcome/main.js +36 -0
  44. data/frameworks/sproutcore/design/Design Charts.graffle +15819 -0
  45. data/frameworks/sproutcore/design/Record State Table.numbers +0 -0
  46. data/frameworks/sproutcore/frameworks/datastore/core.js +14 -0
  47. data/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +113 -0
  48. data/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +256 -0
  49. data/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +196 -0
  50. data/frameworks/sproutcore/frameworks/datastore/debug/json.js +71 -0
  51. data/frameworks/sproutcore/frameworks/datastore/debug/standard_setup.js +96 -0
  52. data/frameworks/sproutcore/frameworks/datastore/fixtures/author_fixtures.js +2503 -0
  53. data/frameworks/sproutcore/frameworks/datastore/fixtures/sample.js +17 -0
  54. data/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +92 -0
  55. data/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +38 -0
  56. data/frameworks/sproutcore/frameworks/datastore/models/record.js +430 -0
  57. data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +361 -0
  58. data/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +305 -0
  59. data/frameworks/sproutcore/frameworks/datastore/system/query.js +128 -0
  60. data/frameworks/sproutcore/frameworks/datastore/system/record_array.js +149 -0
  61. data/frameworks/sproutcore/frameworks/datastore/system/store.js +1689 -0
  62. data/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +86 -0
  63. data/frameworks/sproutcore/frameworks/datastore/tests/integration/contact_model.js +114 -0
  64. data/frameworks/sproutcore/frameworks/datastore/tests/integration/mail_model.js +91 -0
  65. data/frameworks/sproutcore/frameworks/datastore/tests/integration/test_runner_model.js +56 -0
  66. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/destroy.js +73 -0
  67. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/readAttribute.js +48 -0
  68. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/refresh.js +42 -0
  69. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/storeDidChangeProperties.js +138 -0
  70. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/unknownProperty.js +46 -0
  71. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +71 -0
  72. data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +115 -0
  73. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +40 -0
  74. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js +116 -0
  75. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +135 -0
  76. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/dataHashDidChange.js +110 -0
  77. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/discardChanges.js +99 -0
  78. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readDataHash.js +180 -0
  79. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readEditableDataHash.js +126 -0
  80. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/removeDataHash.js +163 -0
  81. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +166 -0
  82. data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +175 -0
  83. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js +54 -0
  84. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitChangesFromNestedStore.js +126 -0
  85. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +127 -0
  86. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/createRecord.js +57 -0
  87. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataHashDidChange.js +78 -0
  88. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +247 -0
  89. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +106 -0
  90. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/init.js +21 -0
  91. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushChanges.js +61 -0
  92. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readDataHash.js +74 -0
  93. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readEditableDataHash.js +74 -0
  94. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/recordDidChange.js +74 -0
  95. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/removeDataHash.js +144 -0
  96. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/retrieveRecord.js +137 -0
  97. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/writeDataHash.js +130 -0
  98. data/frameworks/sproutcore/frameworks/debug/core.js +1 -0
  99. data/frameworks/sproutcore/frameworks/deprecated/core.js +61 -0
  100. data/frameworks/sproutcore/frameworks/deprecated/lib/button_views.rb +330 -0
  101. data/frameworks/sproutcore/frameworks/deprecated/lib/collection_view.rb +83 -0
  102. data/frameworks/sproutcore/frameworks/deprecated/lib/core_views.rb +326 -0
  103. data/frameworks/sproutcore/frameworks/deprecated/lib/form_views.rb +253 -0
  104. data/frameworks/sproutcore/frameworks/deprecated/lib/index.rhtml +75 -0
  105. data/frameworks/sproutcore/frameworks/deprecated/lib/menu_views.rb +93 -0
  106. data/frameworks/sproutcore/frameworks/deprecated/server/rails_server.js +80 -0
  107. data/frameworks/sproutcore/frameworks/deprecated/server/rest_server.js +178 -0
  108. data/frameworks/sproutcore/frameworks/deprecated/server/server.js +674 -0
  109. data/frameworks/sproutcore/frameworks/deprecated/system/animator.js +679 -0
  110. data/frameworks/sproutcore/frameworks/deprecated/system/binding.js +36 -0
  111. data/frameworks/sproutcore/frameworks/deprecated/system/browser.js +77 -0
  112. data/frameworks/sproutcore/frameworks/deprecated/system/classic_responder.js +314 -0
  113. data/frameworks/sproutcore/frameworks/deprecated/system/event.js +60 -0
  114. data/frameworks/sproutcore/frameworks/deprecated/system/globals.js +20 -0
  115. data/frameworks/sproutcore/frameworks/deprecated/system/misc.js +60 -0
  116. data/frameworks/sproutcore/frameworks/deprecated/system/node_descriptor.js +72 -0
  117. data/frameworks/sproutcore/frameworks/deprecated/system/object.js +124 -0
  118. data/frameworks/sproutcore/frameworks/deprecated/system/path_module.js +433 -0
  119. data/frameworks/sproutcore/frameworks/deprecated/system/string.js +109 -0
  120. data/frameworks/sproutcore/frameworks/deprecated/tests/application/application.rhtml +125 -0
  121. data/frameworks/sproutcore/frameworks/deprecated/tests/views/classic_view/clippingFrame.rhtml +401 -0
  122. data/frameworks/sproutcore/frameworks/deprecated/tests/views/classic_view/frame.rhtml +357 -0
  123. data/frameworks/sproutcore/frameworks/deprecated/tests/views/classic_view/isVisibleInWindow.rhtml +147 -0
  124. data/frameworks/sproutcore/frameworks/deprecated/tests/views/collection/base.rhtml +298 -0
  125. data/frameworks/sproutcore/frameworks/deprecated/tests/views/collection/incremental_rendering.rhtml +260 -0
  126. data/frameworks/sproutcore/frameworks/deprecated/tests/views/collection/source_list_rendering.rhtml +143 -0
  127. data/frameworks/sproutcore/frameworks/deprecated/tests/views/popup_button.rhtml +128 -0
  128. data/frameworks/sproutcore/frameworks/deprecated/tests/views/text_field.rhtml +37 -0
  129. data/frameworks/sproutcore/frameworks/deprecated/views/collection.js +24 -0
  130. data/frameworks/sproutcore/frameworks/designer/coders/design.js +30 -0
  131. data/frameworks/sproutcore/frameworks/designer/coders/localization.js +28 -0
  132. data/frameworks/sproutcore/frameworks/designer/coders/object.js +347 -0
  133. data/frameworks/sproutcore/frameworks/designer/controllers/page_design.js +102 -0
  134. data/frameworks/sproutcore/frameworks/designer/css/css_rule.js +22 -0
  135. data/frameworks/sproutcore/frameworks/designer/css/css_style.js +29 -0
  136. data/frameworks/sproutcore/frameworks/designer/css/css_style_sheet.js +201 -0
  137. data/frameworks/sproutcore/frameworks/designer/ext/page.js +88 -0
  138. data/frameworks/sproutcore/frameworks/designer/ext/view.js +40 -0
  139. data/frameworks/sproutcore/frameworks/designer/views/controls/button.js +18 -0
  140. data/frameworks/sproutcore/frameworks/designer/views/designer.js +553 -0
  141. data/frameworks/sproutcore/frameworks/designer/views/label.js +17 -0
  142. data/frameworks/sproutcore/frameworks/designer/views/mixins/button.js +13 -0
  143. data/frameworks/sproutcore/frameworks/designer/views/tab.js +17 -0
  144. data/frameworks/sproutcore/frameworks/desktop/core.js +6 -0
  145. data/frameworks/sproutcore/frameworks/desktop/debug/drag.js +41 -0
  146. data/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +56 -0
  147. data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/a_sample_image.jpg +0 -0
  148. data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/apple-logo1.jpeg +0 -0
  149. data/frameworks/sproutcore/frameworks/desktop/english.lproj/debug/iframe.html +23 -0
  150. data/frameworks/sproutcore/frameworks/desktop/english.lproj/disclosure.css +71 -0
  151. data/frameworks/sproutcore/frameworks/desktop/english.lproj/icons.css +943 -0
  152. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/blank.gif +0 -0
  153. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_222222.png +0 -0
  154. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_454545.png +0 -0
  155. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_888888.png +0 -0
  156. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/mini_ffffff.png +0 -0
  157. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/shared.png +0 -0
  158. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/indicator.gif +0 -0
  159. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/panels/sprite-x.png +0 -0
  160. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/panels/sprite-y.png +0 -0
  161. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sc-theme-sprite.png +0 -0
  162. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/standard_fade/000000.png +0 -0
  163. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/standard_fade/ffffff.png +0 -0
  164. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sticky-note.png +0 -0
  165. data/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +156 -0
  166. data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu.css +83 -0
  167. data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +99 -0
  168. data/frameworks/sproutcore/frameworks/desktop/english.lproj/palette.css +3 -0
  169. data/frameworks/sproutcore/frameworks/desktop/english.lproj/panel.css +94 -0
  170. data/frameworks/sproutcore/frameworks/desktop/english.lproj/picker.css +39 -0
  171. data/frameworks/sproutcore/frameworks/desktop/english.lproj/progress.css +31 -0
  172. data/frameworks/sproutcore/frameworks/desktop/english.lproj/radio.css +10 -0
  173. data/frameworks/sproutcore/frameworks/desktop/english.lproj/scroller.css +26 -0
  174. data/frameworks/sproutcore/frameworks/desktop/english.lproj/segmented.css +141 -0
  175. data/frameworks/sproutcore/frameworks/desktop/english.lproj/separator.css +19 -0
  176. data/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +57 -0
  177. data/frameworks/sproutcore/frameworks/desktop/english.lproj/split.css +70 -0
  178. data/frameworks/sproutcore/frameworks/desktop/english.lproj/split_divider.css +8 -0
  179. data/frameworks/sproutcore/frameworks/desktop/english.lproj/strings.js +14 -0
  180. data/frameworks/sproutcore/frameworks/desktop/english.lproj/tab.css +12 -0
  181. data/frameworks/sproutcore/frameworks/desktop/english.lproj/text_field.css +29 -0
  182. data/frameworks/sproutcore/frameworks/desktop/english.lproj/toolbar.css +6 -0
  183. data/frameworks/sproutcore/frameworks/desktop/mixins/border.js +53 -0
  184. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +22 -0
  185. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_item.js +22 -0
  186. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +226 -0
  187. data/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +247 -0
  188. data/frameworks/sproutcore/frameworks/desktop/panes/alert.js +377 -0
  189. data/frameworks/sproutcore/frameworks/desktop/panes/menu.js +504 -0
  190. data/frameworks/sproutcore/frameworks/desktop/panes/modal.js +68 -0
  191. data/frameworks/sproutcore/frameworks/desktop/panes/palette.js +63 -0
  192. data/frameworks/sproutcore/frameworks/desktop/panes/panel.js +184 -0
  193. data/frameworks/sproutcore/frameworks/desktop/panes/picker.js +402 -0
  194. data/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +46 -0
  195. data/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +39 -0
  196. data/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +81 -0
  197. data/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +175 -0
  198. data/frameworks/sproutcore/frameworks/desktop/protocols/responder.js +280 -0
  199. data/frameworks/sproutcore/frameworks/desktop/system/drag.js +721 -0
  200. data/frameworks/sproutcore/frameworks/desktop/system/key_bindings.js +40 -0
  201. data/frameworks/sproutcore/frameworks/desktop/system/root_responder.js +641 -0
  202. data/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +187 -0
  203. data/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js +43 -0
  204. data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/methods.js +10 -0
  205. data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +152 -0
  206. data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +10 -0
  207. data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +57 -0
  208. data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/methods.js +10 -0
  209. data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/ui.js +36 -0
  210. data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +10 -0
  211. data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +40 -0
  212. data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +10 -0
  213. data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +80 -0
  214. data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/methods.js +10 -0
  215. data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +38 -0
  216. data/frameworks/sproutcore/frameworks/desktop/tests/views/button/methods.js +45 -0
  217. data/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +140 -0
  218. data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +145 -0
  219. data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/ui.js +99 -0
  220. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/methods.js +10 -0
  221. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectPreviousItem.js +39 -0
  222. data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/methods.js +10 -0
  223. data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +64 -0
  224. data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/methods.js +10 -0
  225. data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/ui.js +10 -0
  226. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/methods.js +10 -0
  227. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui.js +110 -0
  228. data/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +255 -0
  229. data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/methods.js +10 -0
  230. data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/ui.js +44 -0
  231. data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/methods.js +128 -0
  232. data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +240 -0
  233. data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/methods.js +113 -0
  234. data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/ui.js +202 -0
  235. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +139 -0
  236. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +111 -0
  237. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/methods.js +63 -0
  238. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/ui.js +70 -0
  239. data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +94 -0
  240. data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +206 -0
  241. data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +81 -0
  242. data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +85 -0
  243. data/frameworks/sproutcore/frameworks/desktop/tests/views/separator.js +37 -0
  244. data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/methods.js +10 -0
  245. data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/ui.js +10 -0
  246. data/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js +50 -0
  247. data/frameworks/sproutcore/frameworks/desktop/tests/views/split/ui.js +52 -0
  248. data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +54 -0
  249. data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +88 -0
  250. data/frameworks/sproutcore/frameworks/desktop/tests/views/text_field/methods.js +76 -0
  251. data/frameworks/sproutcore/frameworks/desktop/tests/views/text_field/ui.js +198 -0
  252. data/frameworks/sproutcore/frameworks/desktop/tests/views/web/methods.js +10 -0
  253. data/frameworks/sproutcore/frameworks/desktop/tests/views/web/ui.js +110 -0
  254. data/frameworks/sproutcore/frameworks/desktop/views/button.js +320 -0
  255. data/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +98 -0
  256. data/frameworks/sproutcore/frameworks/desktop/views/collection.js +2141 -0
  257. data/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +44 -0
  258. data/frameworks/sproutcore/frameworks/desktop/views/form.js +595 -0
  259. data/frameworks/sproutcore/frameworks/desktop/views/grid.js +199 -0
  260. data/frameworks/sproutcore/frameworks/desktop/views/list.js +706 -0
  261. data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +523 -0
  262. data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +437 -0
  263. data/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +62 -0
  264. data/frameworks/sproutcore/frameworks/desktop/views/progress.js +207 -0
  265. data/frameworks/sproutcore/frameworks/desktop/views/radio.js +332 -0
  266. data/frameworks/sproutcore/frameworks/desktop/views/scene.js +56 -0
  267. data/frameworks/sproutcore/frameworks/desktop/views/scroll.js +648 -0
  268. data/frameworks/sproutcore/frameworks/desktop/views/scroller.js +203 -0
  269. data/frameworks/sproutcore/frameworks/desktop/views/segmented.js +509 -0
  270. data/frameworks/sproutcore/frameworks/desktop/views/select_field.js +292 -0
  271. data/frameworks/sproutcore/frameworks/desktop/views/separator.js +37 -0
  272. data/frameworks/sproutcore/frameworks/desktop/views/slider.js +178 -0
  273. data/frameworks/sproutcore/frameworks/desktop/views/source_list.js +1117 -0
  274. data/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +169 -0
  275. data/frameworks/sproutcore/frameworks/desktop/views/split.js +651 -0
  276. data/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +55 -0
  277. data/frameworks/sproutcore/frameworks/desktop/views/tab.js +190 -0
  278. data/frameworks/sproutcore/frameworks/desktop/views/text_field.js +233 -0
  279. data/frameworks/sproutcore/frameworks/desktop/views/thumb.js +49 -0
  280. data/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +49 -0
  281. data/frameworks/sproutcore/frameworks/desktop/views/web.js +86 -0
  282. data/frameworks/sproutcore/frameworks/foundation/TESTING +46 -0
  283. data/frameworks/sproutcore/frameworks/foundation/controllers/array.js +490 -0
  284. data/frameworks/sproutcore/frameworks/foundation/controllers/controller.js +317 -0
  285. data/frameworks/sproutcore/frameworks/foundation/controllers/object.js +421 -0
  286. data/frameworks/sproutcore/frameworks/foundation/core.js +111 -0
  287. data/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +172 -0
  288. data/frameworks/sproutcore/frameworks/foundation/english.lproj/blank.gif +0 -0
  289. data/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +53 -0
  290. data/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +55 -0
  291. data/frameworks/sproutcore/frameworks/foundation/english.lproj/core.css +5 -0
  292. data/frameworks/sproutcore/frameworks/foundation/english.lproj/debug/control-test-pane.css +8 -0
  293. data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-logo.png +0 -0
  294. data/frameworks/sproutcore/frameworks/foundation/english.lproj/static_layout.css +5 -0
  295. data/frameworks/sproutcore/frameworks/foundation/english.lproj/view.css +40 -0
  296. data/frameworks/sproutcore/frameworks/foundation/ext/object.js +81 -0
  297. data/frameworks/sproutcore/frameworks/foundation/ext/run_loop.js +158 -0
  298. data/frameworks/sproutcore/frameworks/foundation/fixtures/file_exists.json +1 -0
  299. data/frameworks/sproutcore/frameworks/foundation/mixins/button.js +291 -0
  300. data/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +88 -0
  301. data/frameworks/sproutcore/frameworks/foundation/mixins/control.js +352 -0
  302. data/frameworks/sproutcore/frameworks/foundation/mixins/editable.js +146 -0
  303. data/frameworks/sproutcore/frameworks/foundation/mixins/responder.js +156 -0
  304. data/frameworks/sproutcore/frameworks/foundation/mixins/selection_support.js +154 -0
  305. data/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +101 -0
  306. data/frameworks/sproutcore/frameworks/foundation/mixins/string.js +237 -0
  307. data/frameworks/sproutcore/frameworks/foundation/mixins/validatable.js +176 -0
  308. data/frameworks/sproutcore/frameworks/foundation/panes/main.js +47 -0
  309. data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +555 -0
  310. data/frameworks/sproutcore/frameworks/foundation/protocols/inline_editor_delegate.js +84 -0
  311. data/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +244 -0
  312. data/frameworks/sproutcore/frameworks/foundation/system/browser.js +64 -0
  313. data/frameworks/sproutcore/frameworks/foundation/system/builder.js +210 -0
  314. data/frameworks/sproutcore/frameworks/foundation/system/core_query.js +2015 -0
  315. data/frameworks/sproutcore/frameworks/foundation/system/cursor.js +129 -0
  316. data/frameworks/sproutcore/frameworks/foundation/system/error.js +93 -0
  317. data/frameworks/sproutcore/frameworks/foundation/system/event.js +817 -0
  318. data/frameworks/sproutcore/frameworks/foundation/system/image_cache.js +433 -0
  319. data/frameworks/sproutcore/frameworks/foundation/system/json.js +440 -0
  320. data/frameworks/sproutcore/frameworks/foundation/system/locale.js +288 -0
  321. data/frameworks/sproutcore/frameworks/foundation/system/page.js +106 -0
  322. data/frameworks/sproutcore/frameworks/foundation/system/ready.js +189 -0
  323. data/frameworks/sproutcore/frameworks/foundation/system/render_context.js +865 -0
  324. data/frameworks/sproutcore/frameworks/foundation/system/request.js +255 -0
  325. data/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +368 -0
  326. data/frameworks/sproutcore/frameworks/foundation/system/routes.js +446 -0
  327. data/frameworks/sproutcore/frameworks/foundation/system/time.js +478 -0
  328. data/frameworks/sproutcore/frameworks/foundation/system/timer.js +549 -0
  329. data/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +158 -0
  330. data/frameworks/sproutcore/frameworks/foundation/system/utils.js +330 -0
  331. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array.js +118 -0
  332. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/controller.js +268 -0
  333. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object.js +433 -0
  334. data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/methods.js +10 -0
  335. data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/ui.js +113 -0
  336. data/frameworks/sproutcore/frameworks/foundation/tests/integration/creating_views.js +113 -0
  337. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/content.js +195 -0
  338. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/displayProperties.js +89 -0
  339. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/content.js +168 -0
  340. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/displayProperties.js +89 -0
  341. data/frameworks/sproutcore/frameworks/foundation/tests/system/builder.js +42 -0
  342. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_core.js +1323 -0
  343. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_dimensions.js +387 -0
  344. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_selector.js +405 -0
  345. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/setClass.js +49 -0
  346. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/within.js +66 -0
  347. data/frameworks/sproutcore/frameworks/foundation/tests/system/error.js +41 -0
  348. data/frameworks/sproutcore/frameworks/foundation/tests/system/json.js +14 -0
  349. data/frameworks/sproutcore/frameworks/foundation/tests/system/locale.js +128 -0
  350. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/begin.js +47 -0
  351. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/element.js +44 -0
  352. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/end.js +119 -0
  353. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/get.js +51 -0
  354. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_attr.js +50 -0
  355. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_basic.js +28 -0
  356. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_className.js +179 -0
  357. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_style.js +100 -0
  358. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/init.js +55 -0
  359. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/join.js +28 -0
  360. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/push_text.js +74 -0
  361. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/tag.js +45 -0
  362. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/update.js +205 -0
  363. data/frameworks/sproutcore/frameworks/foundation/tests/system/request.js +89 -0
  364. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeKeyPane.js +124 -0
  365. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeMainPane.js +68 -0
  366. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/root_responder.js +97 -0
  367. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/targetForAction.js +238 -0
  368. data/frameworks/sproutcore/frameworks/foundation/tests/system/routes.js +33 -0
  369. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/invalidate.js +38 -0
  370. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/invokeLater.js +201 -0
  371. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/isPaused.js +71 -0
  372. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/performAction.js +67 -0
  373. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/schedule.js +170 -0
  374. data/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js +27 -0
  375. data/frameworks/sproutcore/frameworks/foundation/tests/system/utils/normalizeURL.js +18 -0
  376. data/frameworks/sproutcore/frameworks/foundation/tests/system/utils/range.js +62 -0
  377. data/frameworks/sproutcore/frameworks/foundation/tests/validators/credit_card.js +35 -0
  378. data/frameworks/sproutcore/frameworks/foundation/tests/validators/date.js +21 -0
  379. data/frameworks/sproutcore/frameworks/foundation/tests/validators/number.js +47 -0
  380. data/frameworks/sproutcore/frameworks/foundation/tests/validators/password.js +13 -0
  381. data/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +10 -0
  382. data/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +83 -0
  383. data/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +39 -0
  384. data/frameworks/sproutcore/frameworks/foundation/tests/views/main_pane.js +31 -0
  385. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/append_remove.js +89 -0
  386. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/firstResponder.js +148 -0
  387. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/keyPane.js +133 -0
  388. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/sendEvent.js +165 -0
  389. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/clippingFrame.js +132 -0
  390. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/convertFrames.js +246 -0
  391. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createChildViews.js +87 -0
  392. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createLayer.js +97 -0
  393. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/destroyLayer.js +85 -0
  394. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/findLayerInParentLayer.js +52 -0
  395. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/init.js +50 -0
  396. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/insertBefore.js +200 -0
  397. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/isVisibleInWindow.js +102 -0
  398. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layer.js +150 -0
  399. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutChildViews.js +162 -0
  400. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutDidChange.js +127 -0
  401. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutStyle.js +248 -0
  402. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/parentViewDidChange.js +67 -0
  403. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/prepareContext.js +166 -0
  404. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/removeChild.js +189 -0
  405. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/render.js +83 -0
  406. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/replaceChild.js +29 -0
  407. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayer.js +142 -0
  408. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayerLocation.js +194 -0
  409. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/viewDidResize.js +185 -0
  410. data/frameworks/sproutcore/frameworks/foundation/validators/credit_card.js +125 -0
  411. data/frameworks/sproutcore/frameworks/foundation/validators/date.js +52 -0
  412. data/frameworks/sproutcore/frameworks/foundation/validators/email.js +45 -0
  413. data/frameworks/sproutcore/frameworks/foundation/validators/not_empty.js +33 -0
  414. data/frameworks/sproutcore/frameworks/foundation/validators/number.js +82 -0
  415. data/frameworks/sproutcore/frameworks/foundation/validators/password.js +86 -0
  416. data/frameworks/sproutcore/frameworks/foundation/validators/validator.js +311 -0
  417. data/frameworks/sproutcore/frameworks/foundation/views/container.js +136 -0
  418. data/frameworks/sproutcore/frameworks/foundation/views/field.js +276 -0
  419. data/frameworks/sproutcore/frameworks/foundation/views/image.js +158 -0
  420. data/frameworks/sproutcore/frameworks/foundation/views/label.js +261 -0
  421. data/frameworks/sproutcore/frameworks/foundation/views/view.js +2160 -0
  422. data/frameworks/sproutcore/frameworks/mobile/english.lproj/core.css +12 -0
  423. data/frameworks/sproutcore/frameworks/mobile/lib/index.rhtml +126 -0
  424. data/frameworks/sproutcore/frameworks/mobile/system/root_responder.js +109 -0
  425. data/frameworks/sproutcore/frameworks/mobile/tests/views/button/ui.js +9 -0
  426. data/frameworks/sproutcore/frameworks/mobile/views/button.js +190 -0
  427. data/frameworks/sproutcore/frameworks/runtime/README +11 -0
  428. data/frameworks/sproutcore/frameworks/runtime/core.js +777 -0
  429. data/frameworks/sproutcore/frameworks/runtime/license.js +28 -0
  430. data/frameworks/sproutcore/frameworks/runtime/mixins/array.js +403 -0
  431. data/frameworks/sproutcore/frameworks/runtime/mixins/delegate_support.js +70 -0
  432. data/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +1193 -0
  433. data/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +1149 -0
  434. data/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +135 -0
  435. data/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +108 -0
  436. data/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +128 -0
  437. data/frameworks/sproutcore/frameworks/runtime/protocols/sparse_array_delegate.js +131 -0
  438. data/frameworks/sproutcore/frameworks/runtime/system/binding.js +891 -0
  439. data/frameworks/sproutcore/frameworks/runtime/system/enumerator.js +107 -0
  440. data/frameworks/sproutcore/frameworks/runtime/system/object.js +783 -0
  441. data/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +99 -0
  442. data/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +214 -0
  443. data/frameworks/sproutcore/frameworks/runtime/system/set.js +246 -0
  444. data/frameworks/sproutcore/frameworks/runtime/system/sparse_array.js +286 -0
  445. data/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js +56 -0
  446. data/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js +23 -0
  447. data/frameworks/sproutcore/frameworks/runtime/tests/core/clone.js +66 -0
  448. data/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +147 -0
  449. data/frameworks/sproutcore/frameworks/runtime/tests/core/inspect.js +27 -0
  450. data/frameworks/sproutcore/frameworks/runtime/tests/core/isArray.js +25 -0
  451. data/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +38 -0
  452. data/frameworks/sproutcore/frameworks/runtime/tests/core/keys.js +20 -0
  453. data/frameworks/sproutcore/frameworks/runtime/tests/core/makeArray.js +30 -0
  454. data/frameworks/sproutcore/frameworks/runtime/tests/core/objectForPropertyPath.js +19 -0
  455. data/frameworks/sproutcore/frameworks/runtime/tests/core/tupleForPropertyPath.js +37 -0
  456. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable.js +592 -0
  457. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +467 -0
  458. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +123 -0
  459. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +79 -0
  460. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +80 -0
  461. data/frameworks/sproutcore/frameworks/runtime/tests/system/array.js +263 -0
  462. data/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +190 -0
  463. data/frameworks/sproutcore/frameworks/runtime/tests/system/object/base.js +135 -0
  464. data/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +339 -0
  465. data/frameworks/sproutcore/frameworks/runtime/tests/system/run_loop.js +120 -0
  466. data/frameworks/sproutcore/frameworks/runtime/tests/system/set.js +313 -0
  467. data/frameworks/sproutcore/frameworks/runtime/tests/system/sparse_array.js +84 -0
  468. data/frameworks/sproutcore/frameworks/testing/core.js +13 -0
  469. data/frameworks/sproutcore/frameworks/testing/english.lproj/additions.css +8 -0
  470. data/frameworks/sproutcore/frameworks/testing/english.lproj/testsuite.css +131 -0
  471. data/frameworks/sproutcore/frameworks/testing/extras.js +43 -0
  472. data/frameworks/sproutcore/frameworks/testing/jquery.js +3559 -0
  473. data/frameworks/sproutcore/frameworks/testing/qunit.js +819 -0
  474. data/frameworks/sproutcore/frameworks/testing/tests/debug/qunit.js +25 -0
  475. data/frameworks/sproutcore/frameworks/testing/utils.js +55 -0
  476. data/frameworks/sproutcore/lib/index.rhtml +118 -0
  477. data/frameworks/sproutcore/license.js +28 -0
  478. data/frameworks/sproutcore/themes/empty_theme/tests/mini_icons.rhtml +69 -0
  479. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/button.css +41 -0
  480. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/core.css +8 -0
  481. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/backButton.png +0 -0
  482. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/blueButton.png +0 -0
  483. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/cancel.png +0 -0
  484. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/grayButton.png +0 -0
  485. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/leftButton.png +0 -0
  486. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listArrow.png +0 -0
  487. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listArrowSel.png +0 -0
  488. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/listGroup.png +0 -0
  489. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/loading.gif +0 -0
  490. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/pinstripes.png +0 -0
  491. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/rightButton.png +0 -0
  492. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/selection.png +0 -0
  493. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/thumb.png +0 -0
  494. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toggle.png +0 -0
  495. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toggleOn.png +0 -0
  496. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toolButton.png +0 -0
  497. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/toolbar.png +0 -0
  498. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/images/whiteButton.png +0 -0
  499. data/frameworks/sproutcore/themes/iphone_theme/english.lproj/strings.js +15 -0
  500. data/frameworks/sproutcore/themes/standard_theme/Source/Panel.drawit/Data +0 -0
  501. data/frameworks/sproutcore/themes/standard_theme/Source/Panel.drawit/QuickLook/Preview.jpg +0 -0
  502. data/frameworks/sproutcore/themes/standard_theme/Source/Panel.drawit/QuickLook/Thumbnail.jpg +0 -0
  503. data/frameworks/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/Data +0 -0
  504. data/frameworks/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/QuickLook/Preview.jpg +0 -0
  505. data/frameworks/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/QuickLook/Thumbnail.jpg +0 -0
  506. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/Data +0 -0
  507. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/QuickLook/Preview.jpg +0 -0
  508. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/QuickLook/Thumbnail.jpg +0 -0
  509. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/Data +0 -0
  510. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/QuickLook/Preview.jpg +0 -0
  511. data/frameworks/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/QuickLook/Thumbnail.jpg +0 -0
  512. data/frameworks/sproutcore/themes/standard_theme/english.lproj/button.css +333 -0
  513. data/frameworks/sproutcore/themes/standard_theme/english.lproj/checkbox.css +90 -0
  514. data/frameworks/sproutcore/themes/standard_theme/english.lproj/collection.css +53 -0
  515. data/frameworks/sproutcore/themes/standard_theme/english.lproj/core.css +47 -0
  516. data/frameworks/sproutcore/themes/standard_theme/english.lproj/disclosure.css +55 -0
  517. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-sprite.png +0 -0
  518. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-ysprite.png +0 -0
  519. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-toolbar-view.png +0 -0
  520. data/frameworks/sproutcore/themes/standard_theme/english.lproj/label.css +37 -0
  521. data/frameworks/sproutcore/themes/standard_theme/english.lproj/pane.css +8 -0
  522. data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/background-fat.jpg +0 -0
  523. data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/background-thin.jpg +0 -0
  524. data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/bottom-edge.png +0 -0
  525. data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/bottom-left-corner.png +0 -0
  526. data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/bottom-right-corner.png +0 -0
  527. data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/left-edge.png +0 -0
  528. data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/overlay.png +0 -0
  529. data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/right-edge.png +0 -0
  530. data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/top-edge.png +0 -0
  531. data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/top-left-corner.png +0 -0
  532. data/frameworks/sproutcore/themes/standard_theme/english.lproj/panels/top-right-corner.png +0 -0
  533. data/frameworks/sproutcore/themes/standard_theme/english.lproj/progress.css +23 -0
  534. data/frameworks/sproutcore/themes/standard_theme/english.lproj/radio.css +113 -0
  535. data/frameworks/sproutcore/themes/standard_theme/english.lproj/segmented.css +141 -0
  536. data/frameworks/sproutcore/themes/standard_theme/english.lproj/slider.css +62 -0
  537. data/frameworks/sproutcore/themes/standard_theme/english.lproj/split_view.css +27 -0
  538. data/frameworks/sproutcore/themes/standard_theme/english.lproj/tab.css +12 -0
  539. data/frameworks/sproutcore/themes/standard_theme/english.lproj/text_field.css +13 -0
  540. data/frameworks/sproutcore/themes/standard_theme/english.lproj/toolbar.css +4 -0
  541. data/lib/thor/.autotest +7 -0
  542. data/lib/thor/CHANGELOG.rdoc +52 -0
  543. data/lib/thor/LICENSE +20 -0
  544. data/lib/thor/README.markdown +76 -0
  545. data/lib/thor/Rakefile +6 -0
  546. data/lib/thor/Thorfile +45 -0
  547. data/lib/thor/bin/rake2thor +83 -0
  548. data/lib/thor/bin/thor +7 -0
  549. data/lib/thor/lib/thor/error.rb +3 -0
  550. data/lib/thor/lib/thor/options.rb +267 -0
  551. data/lib/thor/lib/thor/ordered_hash.rb +64 -0
  552. data/lib/thor/lib/thor/runner.rb +305 -0
  553. data/lib/thor/lib/thor/task.rb +83 -0
  554. data/lib/thor/lib/thor/task_hash.rb +22 -0
  555. data/lib/thor/lib/thor/tasks/package.rb +18 -0
  556. data/lib/thor/lib/thor/tasks.rb +77 -0
  557. data/lib/thor/lib/thor/util.rb +75 -0
  558. data/lib/thor/lib/thor.rb +170 -0
  559. data/lib/thor/script/destroy +14 -0
  560. data/lib/thor/script/generate +14 -0
  561. data/lib/thor/spec/fixtures/task.thor +10 -0
  562. data/lib/thor/spec/options_spec.rb +271 -0
  563. data/lib/thor/spec/ordered_hash_spec.rb +84 -0
  564. data/lib/thor/spec/spec.opts +1 -0
  565. data/lib/thor/spec/spec_helper.rb +30 -0
  566. data/lib/thor/spec/task_spec.rb +11 -0
  567. data/lib/thor/spec/tasks_spec.rb +28 -0
  568. data/lib/thor/spec/thor_runner_spec.rb +194 -0
  569. data/lib/thor/spec/thor_spec.rb +206 -0
  570. data/lib/thor/spec/util_spec.rb +99 -0
  571. data/lib/thor/task.thor +15 -0
  572. data/lib/thor/thor.gemspec +29 -0
  573. metadata +3 -4
  574. data/sproutcore.gemspec +0 -47
@@ -0,0 +1,1689 @@
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
+ dataSource: null,
45
+
46
+ /**
47
+ This type of store is not nested.
48
+ */
49
+ isNested: NO,
50
+
51
+ // ..........................................................
52
+ // DATA SOURCE SUPPORT
53
+ //
54
+
55
+ /**
56
+ Convenience method. Sets the current data source to the passed property.
57
+ This will also set the store property on the dataSource to the receiver.
58
+
59
+ @returns {SC.Store} receiver
60
+ */
61
+ from: function(dataSource) {
62
+ this.set('dataSource', dataSource);
63
+ return this ;
64
+ },
65
+
66
+ /**
67
+ Convenience method. Creates a CascadeDataSource with the passed
68
+ data source arguments and sets the CascadeDataSource as the data source
69
+ for the receiver.
70
+
71
+ @param {SC.DataSource...} dataSource one or more data source arguments
72
+ @returns {SC.Store} reciever
73
+ */
74
+ cascade: function(dataSource) {
75
+ var dataSources = SC.A(arguments) ;
76
+ dataSource = SC.CascadeDataSource.create({
77
+ dataSources: dataSources
78
+ });
79
+ return this.from(dataSource);
80
+ },
81
+
82
+ // ..........................................................
83
+ // STORE CHAINING
84
+ //
85
+
86
+ /**
87
+ Returns a new nested store instance that can be used to buffer changes
88
+ until you are ready to commit them. When you are ready to commit your
89
+ changes, call commitChanges() or destroyChanges() and then destroy() when
90
+ you are finished with the chained store altogether.
91
+
92
+ {{{
93
+ store = MyApp.store.chain();
94
+ .. edit edit edit
95
+ store.commitChanges().destroy();
96
+ }}}
97
+
98
+ @returns {SC.NestedStore} new nested store chained to receiver
99
+ */
100
+ chain: function() {
101
+ var ret = SC.NestedStore.create({ parentStore: this }) ;
102
+ var nested = this.nestedStores;
103
+ if (!nested) nested =this.nestedStores = [];
104
+ nested.push(ret);
105
+ return ret ;
106
+ },
107
+
108
+ /** @private
109
+
110
+ Called by a nested store just before it is destroyed so that the parent
111
+ can remove the store from its list of nested stores.
112
+
113
+ @returns {SC.Store} receiver
114
+ */
115
+ willDestroyNestedStore: function(nestedStore) {
116
+ if (this.nestedStores) {
117
+ this.nestedStores.removeObject(nestedStore);
118
+ }
119
+ return this ;
120
+ },
121
+
122
+ // ..........................................................
123
+ // SHARED DATA STRUCTURES
124
+ //
125
+
126
+ /** @private
127
+ JSON data hashes indexed by store key.
128
+
129
+ *IMPORTANT: Property is not observable*
130
+
131
+ Shared by a store and its child stores until you make edits to it.
132
+
133
+ @property {Hash}
134
+ */
135
+ dataHashes: null,
136
+
137
+ /** @private
138
+ The current status of a data hash indexed by store key.
139
+
140
+ *IMPORTANT: Property is not observable*
141
+
142
+ Shared by a store and its child stores until you make edits to it.
143
+
144
+ @property {Hash}
145
+ */
146
+ statuses: null,
147
+
148
+ /** @private
149
+ This array contains the revisions for the attributes indexed by the
150
+ storeKey.
151
+
152
+ *IMPORTANT: Property is not observable*
153
+
154
+ Revisions are used to keep track of when an attribute hash has been
155
+ changed. A store shares the revisions data with its parent until it
156
+ starts to make changes to it.
157
+
158
+ @property {Hash}
159
+ */
160
+ revisions: null,
161
+
162
+ /**
163
+ Array indicates whether a data hash is possibly in use by an external
164
+ record for editing. If a data hash is editable then it may be modified
165
+ at any time and therefore chained stores may need to clone the
166
+ attributes before keeping a copy of them.
167
+
168
+ Note that this is kept as an array because it will be stored as a dense
169
+ array on some browsers, making it faster.
170
+
171
+ @property {Array}
172
+ */
173
+ editables: null,
174
+
175
+ /**
176
+ A set of storeKeys that need to be committed back to the data source. If
177
+ you call commitRecords() without passing any other parameters, the keys
178
+ in this set will be committed instead.
179
+
180
+ @property {Hash}
181
+ */
182
+ changelog: null,
183
+
184
+ // ..........................................................
185
+ // CORE ATTRIBUTE API
186
+ //
187
+ // The methods in this layer work on data hashes in the store. They do not
188
+ // perform any changes that can impact records. Usually you will not need
189
+ // to use these methods.
190
+
191
+ /**
192
+ Returns the current edit status of a storekey. May be one of EDITABLE or
193
+ LOCKED. Used mostly for unit testing.
194
+
195
+ @param {Number} storeKey the store key
196
+ @returns {Number} edit status
197
+ */
198
+ storeKeyEditState: function(storeKey) {
199
+ var editables = this.editables, locks = this.locks;
200
+ return (editables && editables[storeKey]) ? SC.Store.EDITABLE : SC.Store.LOCKED ;
201
+ },
202
+
203
+ /**
204
+ Returns the data hash for the given storeKey. This will also 'lock'
205
+ the hash so that further edits to the parent store will no
206
+ longer be reflected in this store until you reset.
207
+
208
+ @param {Number} storeKey key to retrieve
209
+ @returns {Hash} data hash or null
210
+ */
211
+ readDataHash: function(storeKey) {
212
+ return this.dataHashes[storeKey];
213
+ },
214
+
215
+ /**
216
+ Returns the data hash for the storeKey, cloned so that you can edit
217
+ the contents of the attributes if you like. This will do the extra work
218
+ to make sure that you only clone the attributes one time.
219
+
220
+ If you use this method to modify data hash, be sure to call
221
+ dataHashDidChange() when you make edits to record the change.
222
+
223
+ @param {Number} storeKey the store key to retrieve
224
+ @returns {Hash} the attributes hash
225
+ */
226
+ readEditableDataHash: function(storeKey) {
227
+ // read the value - if there is no hash just return; nothing to do
228
+ var ret = this.dataHashes[storeKey];
229
+ if (!ret) return ret ; // nothing to do.
230
+
231
+ // clone data hash if not editable
232
+ var editables = this.editables;
233
+ if (!editables) editables = this.editables = [];
234
+ if (!editables[storeKey]) {
235
+ editables[storeKey] = 1 ; // use number to store as dense array
236
+ ret = this.dataHashes[storeKey] = SC.clone(ret);
237
+ }
238
+ return ret;
239
+ },
240
+
241
+ /**
242
+ Replaces the data hash for the storeKey. This will lock the data hash and
243
+ mark them as cloned. This will also call dataHashDidChange() for you.
244
+
245
+ Note that the hash you set here must be a different object from the
246
+ original data hash. Once you make a change here, you must also call
247
+ dataHashDidChange() to register the changes.
248
+
249
+ If the data hash does not yet exist in the store, this method will add it.
250
+ Pass the optional status to edit the status as well.
251
+
252
+ @param {Number} storeKey the store key to write
253
+ @param {Hash} hash the new hash
254
+ @param {String} status the new hash status
255
+ @returns {SC.Store} receiver
256
+ */
257
+ writeDataHash: function(storeKey, hash, status) {
258
+
259
+ // update dataHashes and optionally status.
260
+ if (hash) this.dataHashes[storeKey] = hash;
261
+ if (status) this.statuses[storeKey] = status ;
262
+
263
+ // also note that this hash is now editable
264
+ var editables = this.editables;
265
+ if (!editables) editables = this.editables = [];
266
+ editables[storeKey] = 1 ; // use number for dense array support
267
+
268
+ return this ;
269
+ },
270
+
271
+ /**
272
+ Removes the data hash from the store. This does not imply a deletion of
273
+ the record. You could be simply unloading the record. Eitherway,
274
+ removing the dataHash will be synced back to the parent store but not to
275
+ the server.
276
+
277
+ Note that you can optionally pass a new status to go along with this. If
278
+ you do not pass a status, it will change the status to SC.RECORD_EMPTY
279
+ (assuming you just unloaded the record). If you are deleting the record
280
+ you may set it to SC.Record.DESTROYED_CLEAN.
281
+
282
+ Be sure to also call dataHashDidChange() to register this change.
283
+
284
+ @param {Number} storeKey
285
+ @param {String} status optional new status
286
+ @returns {SC.Store} reciever
287
+ */
288
+ removeDataHash: function(storeKey, status) {
289
+ var rev ;
290
+
291
+ // don't use delete -- that will allow parent dataHash to come through
292
+ this.dataHashes[storeKey] = null;
293
+ this.statuses[storeKey] = status || SC.Record.EMPTY;
294
+ rev = this.revisions[storeKey] = this.revisions[storeKey]; // copy ref
295
+
296
+ // hash is gone and therefore no longer editable
297
+ var editables = this.editables;
298
+ if (editables) editables[storeKey] = 0 ;
299
+
300
+ return this ;
301
+ },
302
+
303
+ /**
304
+ Reads the current status for a storeKey. This will also lock the data
305
+ hash. If no status is found, returns SC.RECORD_EMPTY.
306
+
307
+ @param {Number} storeKey the store key
308
+ @returns {String} status
309
+ */
310
+ readStatus: function(storeKey) {
311
+ // use readDataHash to handle optimistic locking. this could be inlined
312
+ // but for now this minimized copy-and-paste code.
313
+ this.readDataHash(storeKey);
314
+ return this.statuses[storeKey] || SC.Record.EMPTY;
315
+ },
316
+
317
+ /**
318
+ Writes the current status for a storeKey.
319
+ */
320
+ writeStatus: function(storeKey, newStatus) {
321
+ // use writeDataHash for now to handle optimistic lock. maximize code
322
+ // reuse.
323
+ return this.writeDataHash(storeKey, null, newStatus);
324
+ },
325
+
326
+ /**
327
+ Call this method whenever you modify some editable data hash to register
328
+ with the Store that the attribute values have actually changed. This will
329
+ do the book-keeping necessary to track the change across stores including
330
+ managing locks.
331
+
332
+ @param {Number|Array} storeKeys one or more store keys that changed
333
+ @param {Number} rev optional new revision number. normally leave null
334
+ @param {Boolean} statusOnly (optional) YES if only status changed
335
+ @returns {SC.Store} receiver
336
+ */
337
+ dataHashDidChange: function(storeKeys, rev, statusOnly) {
338
+
339
+ // update the revision for storeKey. Use generateStoreKey() because that
340
+ // gaurantees a universally (to this store hierarchy anyway) unique
341
+ // key value.
342
+ if (!rev) rev = SC.Store.generateStoreKey();
343
+ var isArray, len, idx, storeKey;
344
+
345
+ isArray = SC.typeOf(storeKeys) === SC.T_ARRAY;
346
+ if (isArray) {
347
+ len = storeKeys.length;
348
+ } else {
349
+ len = 1;
350
+ storeKey = storeKeys;
351
+ }
352
+
353
+ for(idx=0;idx<len;idx++) {
354
+ if (isArray) storeKey = storeKeys[idx];
355
+ this.revisions[storeKey] = rev;
356
+ this._notifyRecordPropertyChange(storeKey, statusOnly);
357
+ }
358
+
359
+ return this ;
360
+ },
361
+
362
+ /**
363
+ Will notify any record instances of the property change at the end of
364
+ the run loop. Also notifies any inherited record instances as well.
365
+ */
366
+ _notifyRecordPropertyChange: function(storeKey, statusOnly) {
367
+
368
+ var records = this.records, rec ;
369
+
370
+ // schedule
371
+ if (records && (rec=records[storeKey])) {
372
+ rec.storeDidChangeProperties(statusOnly);
373
+ }
374
+
375
+ // pass along to nested stores
376
+ var nestedStores = this.get('nestedStores'), len, idx, store;
377
+ var K = SC.Store;
378
+ len = nestedStores ? nestedStores.length : 0 ;
379
+ for(idx=0;idx<len;idx++) {
380
+ store = nestedStores[idx];
381
+ if (store.storeKeyEditState(storeKey) === K.INHERITED) {
382
+ store._notifyRecordPropertyChange(storeKey, statusOnly);
383
+ }
384
+ }
385
+ return this;
386
+ },
387
+
388
+ /**
389
+ Resets the store content. This will clear all internal data for all
390
+ records, resetting them to an EMPTY state. You generally do not want
391
+ to call this method yourself, though you may override it.
392
+
393
+ @returns {SC.Store} receiver
394
+ */
395
+ reset: function() {
396
+
397
+ // create a new empty data store
398
+ this.dataHashes = {} ;
399
+ this.revisions = {} ;
400
+ this.statuses = {} ;
401
+
402
+ // also reset temporary objects
403
+ this.chainedChanges = this.locks = this.editables = null;
404
+ this.changelog = null ;
405
+
406
+ var records = this.records, storeKey;
407
+ if (records) {
408
+ for(storeKey in records) {
409
+ if (!records.hasOwnProperty(storeKey)) continue ;
410
+ this._notifyRecordPropertyChange(storeKey, NO);
411
+ }
412
+ }
413
+
414
+ this.set('hasChanges', NO);
415
+ },
416
+
417
+ /** @private
418
+ Called by a nested store on a parent store to commit any changes from the
419
+ store. This will copy any changed dataHashes as well as any persistant
420
+ change logs.
421
+
422
+ If the parentStore detects a conflict with the optimistic locking, it will
423
+ raise an exception before it makes any changes. If you pass the
424
+ force flag then this detection phase will be skipped and the changes will
425
+ be applied even if another resource has modified the store in the mean
426
+ time.
427
+
428
+ @param {SC.Store} nestedStore the child store
429
+ @param {Array} changes the array of changed store keys
430
+ @param {Boolean} force
431
+ @returns {SC.Store} receiver
432
+ */
433
+ commitChangesFromNestedStore: function(nestedStore, changes, force)
434
+ {
435
+ // first, check for optimistic locking problems
436
+ if (!force) this._verifyLockRevisions(changes, nestedStore.locks);
437
+
438
+ // OK, no locking issues. So let's just copy them changes.
439
+ // get local reference to values.
440
+ var len = changes.length, i, storeKey ;
441
+ var my_dataHashes, my_statuses, my_editables, my_revisions;
442
+ var ch_dataHashes, ch_statuses, ch_revisions;
443
+
444
+ my_revisions = this.revisions ;
445
+ my_dataHashes = this.dataHashes;
446
+ my_statuses = this.statuses;
447
+ my_editables = this.editables ;
448
+
449
+ // setup some arrays if needed
450
+ if (!my_editables) my_editables = this.editables = [] ;
451
+
452
+ ch_dataHashes = nestedStore.dataHashes;
453
+ ch_revisions = nestedStore.revisions ;
454
+ ch_statuses = nestedStore.statuses;
455
+
456
+ for(i=0;i<len;i++) {
457
+ storeKey = changes[i];
458
+
459
+ // now copy changes
460
+ my_dataHashes[storeKey] = ch_dataHashes[storeKey];
461
+ my_statuses[storeKey] = ch_statuses[storeKey];
462
+ my_revisions[storeKey] = ch_revisions[storeKey];
463
+
464
+ my_editables[storeKey] = 0 ; // always make dataHash no longer editable
465
+
466
+ this._notifyRecordPropertyChange(storeKey, NO);
467
+ }
468
+
469
+ // add any records to the changelog for commit handling
470
+ var my_changelog = this.changelog, ch_changelog = nestedStore.changelog;
471
+ if (ch_changelog) {
472
+ if (!my_changelog) my_changelog = this.changelog = SC.Set.create();
473
+ my_changelog.addEach(ch_changelog);
474
+ }
475
+ this.changelog=my_changelog;
476
+
477
+ return this ;
478
+ },
479
+
480
+ /** @private
481
+ Verifies that the passed lock revisions match the current revisions
482
+ in the receiver store. If the lock revisions do not match, then the
483
+ store is in a conflict and an exception will be raised.
484
+
485
+ @param {Array} changes set of changes we are trying to apply
486
+ @param {SC.Set} locks the locks to verify
487
+ @returns {SC.Store} receiver
488
+ */
489
+ _verifyLockRevisions: function(changes, locks) {
490
+ var len = changes.length, revs = this.revisions, i, storeKey, lock, rev ;
491
+ if (locks && revs) {
492
+ for(i=0;i<len;i++) {
493
+ storeKey = changes[i];
494
+ lock = locks[storeKey] || 1;
495
+ rev = revs[storeKey] || 1;
496
+
497
+ // if the save revision for the item does not match the current rev
498
+ // the someone has changed the data hash in this store and we have
499
+ // a conflict.
500
+ if (lock < rev) throw SC.Store.CHAIN_CONFLICT_ERROR;
501
+ }
502
+ }
503
+ return this ;
504
+ },
505
+
506
+ // ..........................................................
507
+ // HIGH-LEVEL RECORD API
508
+ //
509
+
510
+
511
+ /**
512
+ Finds a record instance with the specified recordType and id, returning
513
+ the record instance. If no matching record could be found, asks the
514
+ data source to retrieve the record. If the data source cannot retrieve
515
+ the record, returns null.
516
+
517
+ Note that if you try to find a record id that does not exist in memory,
518
+ a dataSource may load it from ths server. In this case, this method will
519
+ return a record instance with a status of SC.Record.BUSY_LOADING to indicate
520
+ that it is still fetching the data from the server.
521
+
522
+ @param {SC.Record} recordType the expected record type
523
+ @param {String} id the id to load
524
+ @returns {SC.Record} record instance or null
525
+ */
526
+ find: function(recordType, id) {
527
+ // first attempt to find the record in the local store
528
+ var storeKey = recordType.storeKeyFor(id);
529
+ if (this.readStatus(storeKey) === SC.Record.EMPTY) {
530
+ storeKey = this.retrieveRecord(recordType, id);
531
+ }
532
+
533
+ // now we have the storeKey, materialize the record and return it.
534
+ return storeKey ? this.materializeRecord(storeKey) : null ;
535
+ },
536
+
537
+ /**
538
+ Retrieves records from the persistent store. You should pass in a named
539
+ query that will be understood by one of the persistent stores you have
540
+ configured along with any optional parameters needed by the search.
541
+
542
+ The return value is an SC.RecordArray that may be populated dynamically
543
+ by the server as data becomes available. You can treat this object just
544
+ like any other object that implements SC.Array.
545
+
546
+ h2. Query Keys
547
+
548
+ The kind of query key you pass is generally determined by the type of
549
+ persistent stores you hook up for your application. Most stores, however,
550
+ will accept an SC.Record subclass as the query key. This will return
551
+ a RecordArray matching all instances of that class as is relevant to your
552
+ application.
553
+
554
+ Once you retrieve a RecordArray, you can filter the results even further
555
+ by using the filter() method, which may issue even more specific requests.
556
+
557
+ @param {Object} queryKey key describing the type of records to fetch
558
+ @param {Hash} params optional additional parameters to pass along
559
+ @param {SC.Store} _store this is a private param. Do not pass
560
+ @returns {SC.RecordArray} matching set or null if no server handled it
561
+ */
562
+ findAll: function(queryKey, params, _store) {
563
+ if (!_store) _store = this;
564
+
565
+ var source = this.get('dataSource'), ret, storeKeys, cacheKey ;
566
+ if (source) {
567
+
568
+ // ask the dataSource to provide a storeKey array
569
+ storeKeys = source.fetchRecords.call(source, this, queryKey, params);
570
+ if (storeKeys) {
571
+
572
+ // if an array was provided, see if a wrapper already exists for
573
+ // this store. Otherwise create it
574
+ cacheKey = SC.keyFor('__records__', SC.guidFor(storeKeys));
575
+ ret = this[cacheKey];
576
+ if (!ret) {
577
+ ret = SC.RecordArray.create({store: _store, storeKeys: storeKeys});
578
+ this[cacheKey] = ret ; // save for future reuse.
579
+ }
580
+ }
581
+ }
582
+ return ret ;
583
+ },
584
+
585
+ /**
586
+ Array of all records currently in the store with the specified
587
+ type. This method only reflects the actual records loaded into memory and
588
+ therefore is not usually needed at runtime. However you will often use
589
+ this method for testing.
590
+
591
+ @param {SC.Record} recordType the record type
592
+ @returns {SC.Array} array instance - usually SC.RecordArray
593
+ */
594
+ recordsFor: function(recordType) {
595
+ var storeKeys = [], storeKeysById = recordType.prototype.storeKeysById;
596
+ var id, storeKey, ret;
597
+
598
+ // collect all non-empty store keys
599
+ if (storeKeysById) {
600
+ for(id in storeKeysById) {
601
+ storeKey = storeKeysById[id]; // get the storeKey
602
+ if (this.readStatus(storeKey) !== SC.RECORD_EMPTY) {
603
+ storeKeys.push(storeKey);
604
+ }
605
+ }
606
+ }
607
+
608
+ if (storeKeys.length>0) {
609
+ ret = SC.RecordArray.create({ store: this, storeKeys: storeKeys });
610
+ } else ret = storeKeys; // empty array
611
+ return ret ;
612
+ },
613
+
614
+ _TMP_REC_ATTRS: {},
615
+
616
+ /**
617
+ Given a storeKey, return a materialized record. You will not usually
618
+ call this method yourself. Instead it will used by other methods when
619
+ you find records by id or perform other searches.
620
+
621
+ If a recordType has been mapped to the storeKey, then a record instance
622
+ will be returned even if the data hash has not been requested yet.
623
+
624
+ Each Store instance returns unique record instances for each storeKey.
625
+
626
+ @param {Integer} storeKey The storeKey for the dataHash.
627
+ @returns {SC.Record} Returns a record instance.
628
+ */
629
+ materializeRecord: function(storeKey) {
630
+ var records = this.records, ret, recordType, attrs;
631
+
632
+ // look up in cached records
633
+ if (!records) records = this.records = {}; // load cached records
634
+ ret = records[storeKey];
635
+ if (ret) return ret;
636
+
637
+ // not found -- OK, create one then.
638
+ recordType = SC.Store.recordTypeFor(storeKey);
639
+ if (!recordType) return null; // not recordType registered, nothing to do
640
+
641
+ attrs = this._TMP_REC_ATTRS ;
642
+ attrs.storeKey = storeKey ;
643
+ attrs.store = this ;
644
+ ret = records[storeKey] = recordType.create(attrs);
645
+
646
+ return ret ;
647
+ },
648
+
649
+ // ..........................................................
650
+ // CORE RECORDS API
651
+ //
652
+ // The methods in this section can be used to manipulate records without
653
+ // actually creating record instances.
654
+
655
+ /**
656
+ Creates a new record instance with the passed recordType and dataHash.
657
+ You can also optionally specify an id or else it will be pulled from the
658
+ data hash.
659
+
660
+ Note that the record will not yet be saved back to the server. To save
661
+ a record to the server, call commitChanges() on the store.
662
+
663
+ @param {SC.Record} recordType the record class to use on creation
664
+ @param {Hash} dataHash the JSON attributes to assign to the hash.
665
+ @param {String} id (optional) id to assign to record
666
+
667
+ @returns {SC.Record} Returns the created record
668
+ */
669
+ createRecord: function(recordType, dataHash, id) {
670
+
671
+ var primaryKey, storeKey, status, K = SC.Record, changelog;
672
+
673
+ // First, try to get an id. If no id is passed, look it up in the
674
+ // dataHash.
675
+ if (!id && (primaryKey = recordType.prototype.primaryKey)) {
676
+ id = dataHash[primaryKey];
677
+ }
678
+
679
+ // Next get the storeKey - base on id if available
680
+ storeKey = id ? recordType.storeKeyFor(id) : SC.Store.generateStoreKey();
681
+
682
+ // now, check the state and do the right thing.
683
+ status = this.readStatus(storeKey);
684
+
685
+ // check state
686
+ // any busy or ready state or destroyed dirty state is not allowed
687
+ if ((status & K.BUSY) ||
688
+ (status & K.READY) ||
689
+ (status == K.DESTROYED_DIRTY)) {
690
+ throw id ? K.RECORD_EXISTS_ERROR : K.BAD_STATE_ERROR;
691
+
692
+ // allow error or destroyed state only with id
693
+ } else if (!id && (status==SC.DESTROYED_CLEAN || status==SC.ERROR)) {
694
+ throw K.BAD_STATE_ERROR;
695
+ }
696
+
697
+ // add dataHash and setup initial status -- also save recordType
698
+ this.writeDataHash(storeKey, dataHash, K.READY_NEW);
699
+ SC.Store.replaceRecordTypeFor(storeKey, recordType);
700
+ this.dataHashDidChange(storeKey);
701
+
702
+ // Record is now in a committable state -- add storeKey to changelog
703
+ changelog = this.changelog;
704
+ if (!changelog) changelog = SC.Set.create();
705
+ changelog.add(storeKey);
706
+ this.changelog=changelog;
707
+
708
+ // finally return materialized record
709
+ return this.materializeRecord(storeKey) ;
710
+ },
711
+
712
+ /**
713
+ Creates an array of new records. You must pass an array of dataHashes
714
+ plus a recordType and, optionally, an array of ids. This will create an
715
+ array of record instances with the same record type.
716
+
717
+ If you need to instead create a bunch of records with different data types
718
+ you can instead pass an array of recordTypes, one for each data hash.
719
+
720
+ @param {SC.Record|Array} recordTypes class or array of classes
721
+ @param {Array} dataHashes array of data hashes
722
+ @param {Array} ids (optional) ids to assign to records
723
+ @returns {Array} array of materialized record instances.
724
+ */
725
+ createRecords: function(recordTypes, dataHashes, ids) {
726
+ var ret = [], recordType, id, isArray, len = dataHashes.length, idx ;
727
+ isArray = SC.typeOf(recordTypes) === SC.T_ARRAY;
728
+ if (!isArray) recordType = recordTypes;
729
+ for(idx=0;idx<len;idx++) {
730
+ if (isArray) recordType = recordTypes[idx] || SC.Record;
731
+ id = ids ? ids[idx] : undefined ;
732
+ ret.push(this.createRecord(recordType, dataHashes[idx], id));
733
+ }
734
+ return ret ;
735
+ },
736
+
737
+ /**
738
+ Destroys a record, removing the data hash from the store and adding the
739
+ record to the destroyed changelog. If you try to destroy a record that is
740
+ already destroyed then this method will have no effect. If you destroy a
741
+ record that does not exist or an error then an exception will be raised.
742
+
743
+ @param {SC.Record} recordType the recordType
744
+ @param {String} id the record id
745
+ @param {Number} storeKey (optional) if passed, ignores recordType and id
746
+ @returns {SC.Store} receiver
747
+ */
748
+ destroyRecord: function(recordType, id, storeKey) {
749
+ if (storeKey === undefined) storeKey = recordType.storeKeyFor(id);
750
+ var status = this.readStatus(storeKey), changelog, K = SC.Record;
751
+
752
+ // handle status - ignore if destroying or destroyed
753
+ if ((status === K.BUSY_DESTROYING) || (status & K.DESTROYED)) {
754
+ return this; // nothing to do
755
+
756
+ // error out if empty
757
+ } else if (status == K.EMPTY) {
758
+ throw K.NOT_FOUND_ERROR ;
759
+
760
+ // error out if busy
761
+ } else if (status & K.BUSY) {
762
+ throw K.BUSY_ERROR ;
763
+
764
+ // if new status, destroy but leave in clean state
765
+ } else if (status == K.READY_NEW) {
766
+ status = K.DESTROYED_CLEAN ;
767
+
768
+ // otherwise, destroy in dirty state
769
+ } else status = K.DESTROYED_DIRTY ;
770
+
771
+ // remove the data hash, set new status
772
+ this.removeDataHash(storeKey, status);
773
+ this.dataHashDidChange(storeKey);
774
+
775
+ // add/remove change log
776
+ changelog = this.changelog;
777
+ if (!changelog) changelog = this.changelog = SC.Set.create();
778
+ ((status & K.DIRTY) ? changelog.add(storeKey) : changelog.remove(storeKey));
779
+ this.changelog=changelog;
780
+
781
+ return this ;
782
+ },
783
+
784
+ /**
785
+ Destroys a group of records. If you have a set of record ids, destroying
786
+ them this way can be faster than retrieving each record and destroying
787
+ it individually.
788
+
789
+ You can pass either a single recordType or an array of recordTypes. If
790
+ you pass a single recordType, then the record type will be used for each
791
+ record. If you pass an array, then each id must have a matching record
792
+ type in the array.
793
+
794
+ You can optionally pass an array of storeKeys instead of the recordType
795
+ and ids. In this case the first two parameters will be ignored. This
796
+ is usually only used by low-level internal methods. You will not usually
797
+ destroy records this way.
798
+
799
+ @param {SC.Record|Array} recordTypes class or array of classes
800
+ @param {Array} ids ids to destroy
801
+ @param {Array} storeKeys (optional) store keys to destroy
802
+ @returns {SC.Store} receiver
803
+ */
804
+ destroyRecords: function(recordTypes, ids, storeKeys) {
805
+ var len, isArray, idx, id, recordType, storeKey;
806
+ if(storeKeys===undefined){
807
+ len = ids.length;
808
+ isArray = SC.typeOf(recordTypes) === SC.T_ARRAY;
809
+ if (!isArray) recordType = recordTypes;
810
+ for(idx=0;idx<len;idx++) {
811
+ if (isArray) recordType = recordTypes[idx] || SC.Record;
812
+ id = ids ? ids[idx] : undefined ;
813
+ this.destroyRecord(recordType, id, undefined);
814
+ }
815
+ }else{
816
+ len = storeKeys.length;
817
+ for(idx=0;idx<len;idx++) {
818
+ storeKey = storeKeys ? storeKeys[idx] : undefined ;
819
+ this.destroyRecord(undefined, undefined, storeKey);
820
+ }
821
+ }
822
+ return this ;
823
+ },
824
+
825
+ /**
826
+ Notes that the data for the given record id has changed. The record will
827
+ be committed to the server the next time you commit the root store. Only
828
+ call this method on a record in a READY state of some type.
829
+
830
+ @param {SC.Record} recordType the recordType
831
+ @param {String} id the record id
832
+ @param {Number} storeKey (optional) if passed, ignores recordType and id
833
+ @returns {SC.Store} receiver
834
+ */
835
+ recordDidChange: function(recordType, id, storeKey) {
836
+ if (storeKey === undefined) storeKey = recordType.storeKeyFor(id);
837
+ var status = this.readStatus(storeKey), changelog, K = SC.Record;
838
+
839
+ // BUSY_LOADING, BUSY_CREATING, BUSY_COMMITTING, BUSY_REFRESH_CLEAN
840
+ // BUSY_REFRESH_DIRTY, BUSY_DESTROYING
841
+ if (status & K.BUSY) {
842
+ throw K.BUSY_ERROR ;
843
+
844
+ // if record is not in ready state, then it is not found.
845
+ // ERROR, EMPTY, DESTROYED_CLEAN, DESTROYED_DIRTY
846
+ } else if (!(status & K.READY)) {
847
+ throw K.NOT_FOUND_ERROR ;
848
+
849
+ // otherwise, make new status READY_DIRTY unless new.
850
+ // K.READY_CLEAN, K.READY_DIRTY, ignore K.READY_NEW
851
+ } else {
852
+ if (status != K.READY_NEW) this.writeStatus(storeKey, K.READY_DIRTY);
853
+ }
854
+
855
+ // record data hash change
856
+ this.dataHashDidChange(storeKey, null);
857
+
858
+ // record in changelog
859
+ changelog = this.changelog ;
860
+ if (!changelog) changelog = this.changelog = SC.Set.create() ;
861
+ changelog.add(storeKey);
862
+ this.changelog=changelog;
863
+
864
+ return this ;
865
+ },
866
+
867
+ /**
868
+ Mark a group of records as dirty. The records will be committed to the
869
+ server the next time you commit changes on the root store. If you have a
870
+ set of record ids, marking them dirty this way can be faster than
871
+ retrieving each record and destroying it individually.
872
+
873
+ You can pass either a single recordType or an array of recordTypes. If
874
+ you pass a single recordType, then the record type will be used for each
875
+ record. If you pass an array, then each id must have a matching record
876
+ type in the array.
877
+
878
+ You can optionally pass an array of storeKeys instead of the recordType
879
+ and ids. In this case the first two parameters will be ignored. This
880
+ is usually only used by low-level internal methods.
881
+
882
+ @param {SC.Record|Array} recordTypes class or array of classes
883
+ @param {Array} ids ids to destroy
884
+ @param {Array} storeKeys (optional) store keys to destroy
885
+ @returns {SC.Store} receiver
886
+ */
887
+ recordsDidChange: function(recordTypes, ids, storeKeys) {
888
+ var len, isArray, idx, id, recordType, storeKey;
889
+ if(storeKeys===undefined){
890
+ len = ids.length;
891
+ isArray = SC.typeOf(recordTypes) === SC.T_ARRAY;
892
+ if (!isArray) recordType = recordTypes;
893
+ for(idx=0;idx<len;idx++) {
894
+ if (isArray) recordType = recordTypes[idx] || SC.Record;
895
+ id = ids ? ids[idx] : undefined ;
896
+ storeKey = storeKeys ? storeKeys[idx] : undefined ;
897
+ this.recordDidChange(recordType, id, storeKey);
898
+ }
899
+ }else{
900
+ len = storeKeys.length;
901
+ for(idx=0;idx<len;idx++) {
902
+ storeKey = storeKeys ? storeKeys[idx] : undefined ;
903
+ this.recordDidChange(undefined, undefined, storeKey);
904
+ }
905
+ }
906
+ return this ;
907
+ },
908
+
909
+ /**
910
+ Retrieves a set of records from the server. If the records has
911
+ already been loaded in the store, then this method will simply return.
912
+ Otherwise if your store has a dataSource, this will call the
913
+ dataSource to retrieve the record. Generally you will not need to
914
+ call this method yourself. Instead you can just use find().
915
+
916
+ This will not actually create a record instance but it will initiate a
917
+ load of the record from the server. You can subsequently get a record
918
+ instance itself using materializeRecord()
919
+
920
+ @param {SC.Record|Array} recordTypes class or array of classes
921
+ @param {Array} ids ids to destroy
922
+ @param {Array} storeKeys (optional) store keys to destroy
923
+ @returns {Array} storeKeys to be retrieved
924
+ */
925
+ retrieveRecords: function(recordTypes, ids, storeKeys, _isRefresh) {
926
+
927
+ var source = this.get('dataSource'),
928
+ isArray = SC.typeOf(recordTypes) === SC.T_ARRAY,
929
+ len = (storeKeys === undefined) ? ids.length : storeKeys.length,
930
+ ret = [],
931
+ rev = SC.Store.generateStoreKey(),
932
+ K = SC.Record,
933
+ recordType, idx, storeKey, status;
934
+
935
+ if (!isArray) recordType = recordTypes;
936
+
937
+ // if no storeKeys were passed, map recordTypes + ids
938
+ for(idx=0;idx<len;idx++) {
939
+
940
+ // collect store key
941
+ if (storeKeys) {
942
+ storeKey = storeKeys[idx];
943
+ } else {
944
+ if (isArray) recordType = recordTypes[idx];
945
+ storeKey = recordType.storeKeyFor(ids[idx]);
946
+ }
947
+
948
+ // collect status and process
949
+ status = this.readStatus(storeKey);
950
+
951
+ // K.EMPTY, K.ERROR, K.DESTROYED_CLEAN - initial retrieval
952
+ if ((status == K.EMPTY) || (status == K.ERROR) || (status == K.DESTROYED_CLEAN)) {
953
+
954
+ this.writeStatus(storeKey, K.BUSY_LOADING);
955
+ this.dataHashDidChange(storeKey, rev, YES);
956
+ ret.push(storeKey);
957
+
958
+ // otherwise, ignore record unless isRefresh is YES.
959
+ } else if (_isRefresh) {
960
+
961
+ // K.READY_CLEAN, K.READY_DIRTY, ignore K.READY_NEW
962
+ if (status & K.READY) {
963
+ this.writeStatus(storeKey, K.BUSY_REFRESH | (status & 0x03)) ;
964
+ this.dataHashDidChange(storeKey, rev, YES);
965
+ ret.push(storeKey);
966
+
967
+ // K.BUSY_DESTROYING, K.BUSY_COMMITTING, K.BUSY_CREATING
968
+ } else if ((status == K.BUSY_DESTROYING) || (status == K.BUSY_CREATING) || (status == K.BUSY_COMMITTING)) {
969
+ throw K.BUSY_ERROR ;
970
+
971
+ // K.DESTROY_DIRTY, bad state...
972
+ } else if (status == K.DESTROYED_DIRTY) {
973
+ throw K.BAD_STATE_ERROR ;
974
+
975
+ // ignore K.BUSY_LOADING, K.BUSY_REFRESH_CLEAN, K.BUSY_REFRESH_DIRTY
976
+ }
977
+ }
978
+ }
979
+
980
+ // now commit storekeys to dataSource
981
+ if (source) {
982
+ var ok = source.retrieveRecords.call(source, this, ret);
983
+ if (ok === NO) ret.length = 0; // could not find.
984
+ }
985
+ return ret ;
986
+ },
987
+
988
+ _TMP_RETRIEVE_ARRAY: [],
989
+
990
+ /**
991
+ Retrieves a record from the server. If the record has already been loaded
992
+ in the store, then this method will simply return. Otherwise if your
993
+ store has a dataSource, this will call the dataSource to retrieve the
994
+ record. Generally you will not need to call this method yourself.
995
+ Instead you can just use find().
996
+
997
+ This will not actually create a record instance but it will initiate a
998
+ load of the record from the server. You can subsequently get a record
999
+ instance itself using materializeRecord()
1000
+
1001
+ @param {SC.Record} recordType class
1002
+ @param {String} id id to retrieve
1003
+ @param {Number} storeKey (optional) store key
1004
+ @returns {Number} storeKey that was retrieved
1005
+ */
1006
+ retrieveRecord: function(recordType, id, storeKey, _isRefresh) {
1007
+ var array = this._TMP_RETRIEVE_ARRAY,
1008
+ ret;
1009
+
1010
+ if (storeKey !== undefined) {
1011
+ array[0] = storeKey;
1012
+ storeKey = array;
1013
+ id = null ;
1014
+ } else {
1015
+ array[0] = id;
1016
+ id = array;
1017
+ }
1018
+
1019
+ ret = this.retrieveRecords(recordType, id, storeKey, _isRefresh);
1020
+ array.length = 0 ;
1021
+ return ret[0];
1022
+ },
1023
+
1024
+ /**
1025
+ Refreshes a record from the server. If the record has already been loaded
1026
+ in the store, then this method will request a refresh from the dataSource.
1027
+ Otherwise it will attempt to retrieve the record.
1028
+
1029
+ @param {String} id to id of the record to load
1030
+ @param {SC.Record} recordType the expected record type
1031
+ @param {Number} storeKey (optional) optional store key
1032
+ @returns {Boolean} YES if the retrieval was a success.
1033
+ */
1034
+ refreshRecord: function(recordType, id, storeKey) {
1035
+ return this.retrieveRecord(recordType, id, storeKey, YES);
1036
+ },
1037
+
1038
+ /**
1039
+ Refreshes a set of records from the server. If the records has already been loaded
1040
+ in the store, then this method will request a refresh from the dataSource.
1041
+ Otherwise it will attempt to retrieve them.
1042
+
1043
+ @param {SC.Record|Array} recordTypes class or array of classes
1044
+ @param {Array} ids ids to destroy
1045
+ @param {Array} storeKeys (optional) store keys to destroy
1046
+ @returns {Boolean} YES if the retrieval was a success.
1047
+ */
1048
+ refreshRecords: function(recordTypes, ids, storeKeys) {
1049
+ return this.retrieveRecords(recordTypes, ids, storeKeys, YES);
1050
+ },
1051
+
1052
+ /**
1053
+ Commits the passed store keys. Based on the current state of the
1054
+ record, this will ask the data source to perform the appropriate actions
1055
+ on the store keys.
1056
+
1057
+ @param {String} id to id of the record to load
1058
+ @param {SC.Record} recordType the expected record type
1059
+
1060
+ @returns {SC.Bool} if the action was succesful.
1061
+ */
1062
+ commitRecords: function(recordTypes, ids, storeKeys) {
1063
+ var source = this.get('dataSource'),
1064
+ isArray = SC.typeOf(recordTypes) === SC.T_ARRAY,
1065
+ retCreate= [], retUpdate= [], retDestroy = [],
1066
+ rev = SC.Store.generateStoreKey(),
1067
+ K = SC.Record,
1068
+ recordType, idx, storeKey, status, key, ret, len ;
1069
+
1070
+ // If no params are passed, look up storeKeys in the changelog property.
1071
+ // Remove any committed records from changelog property.
1072
+
1073
+ if(recordTypes===undefined && ids===undefined && storeKeys===undefined){
1074
+ storeKeys=this.changelog;
1075
+ }
1076
+ len = (storeKeys === undefined) ? ids.length : storeKeys.length;
1077
+
1078
+ for(idx=0;idx<len;idx++) {
1079
+
1080
+ // collect store key
1081
+ if (storeKeys) {
1082
+ storeKey = storeKeys[idx];
1083
+ } else {
1084
+ if (isArray) recordType = recordTypes[idx] || SC.Record;
1085
+ else recordType = recordTypes;
1086
+ storeKey = recordType.storeKeyFor(ids[idx]);
1087
+ }
1088
+
1089
+ // collect status and process
1090
+ status = this.readStatus(storeKey);
1091
+
1092
+ if ((status == K.EMPTY) || (status == K.ERROR) || (status == K.DESTROYED_CLEAN)) {
1093
+ throw K.NOT_FOUND_ERROR ;
1094
+ }else{
1095
+ if(status==K.READY_NEW){
1096
+ this.writeStatus(storeKey, K.BUSY_CREATING);
1097
+ this.dataHashDidChange(storeKey, rev, YES);
1098
+ retCreate.push(storeKey);
1099
+ } else if (status==K.READY_DIRTY) {
1100
+ this.writeStatus(storeKey, K.BUSY_COMMITTING);
1101
+ this.dataHashDidChange(storeKey, rev, YES);
1102
+ retUpdate.push(storeKey);
1103
+ } else if (status==K.DESTROYED_DIRTY) {
1104
+ this.writeStatus(storeKey, K.BUSY_DESTROYING);
1105
+ this.dataHashDidChange(storeKey, rev, YES);
1106
+ retDestroy.push(storeKey);
1107
+ }
1108
+ // ignore K.READY_CLEAN, K.BUSY_LOADING, K.BUSY_CREATING, K.BUSY_COMMITTING,
1109
+ // K.BUSY_REFRESH_CLEAN, K_BUSY_REFRESH_DIRTY, KBUSY_DESTROYING
1110
+ }
1111
+ }
1112
+
1113
+ // now commit storekeys to dataSource
1114
+ if (source) ret=source.commitRecords.call(source, this, retCreate, retUpdate, retDestroy);
1115
+ //remove all commited changes from changelog
1116
+ if (ret && recordTypes===undefined && ids===undefined && storeKeys===this.changelog){
1117
+ this.changelog=null;
1118
+ }
1119
+ return ret ;
1120
+ },
1121
+
1122
+ /**
1123
+ Commits the passed store key. Based on the current state of the
1124
+ record, this will ask the data source to perform the appropriate action
1125
+ on the store key.
1126
+
1127
+ You have to pass either the id or the storeKey otherwise it will return NO.
1128
+
1129
+ @param {String} id to id of the record to load
1130
+ @param {SC.Record} recordType the expected record type
1131
+
1132
+ @returns {SC.Bool} if the action was succesful.
1133
+ */
1134
+ commitRecord: function(recordType, id, storeKey) {
1135
+ var array = this._TMP_RETRIEVE_ARRAY,
1136
+ ret ;
1137
+ if (id === undefined && storeKey === undefined ) return NO;
1138
+ if (storeKey !== undefined) {
1139
+ array[0] = storeKey;
1140
+ storeKey = array;
1141
+ id = null ;
1142
+ } else {
1143
+ array[0] = id;
1144
+ id = array;
1145
+ }
1146
+
1147
+ ret = this.commitRecords(recordType, id, storeKey);
1148
+ array.length = 0 ;
1149
+ return ret;
1150
+ },
1151
+
1152
+ /**
1153
+ Cancels an inflight request for the passed records. Depending on the
1154
+ server implementation, this could cancel an entire request, causing
1155
+ other records to also transition their current state.
1156
+
1157
+ @param {SC.Record|Array} recordTypes class or array of classes
1158
+ @param {Array} ids ids to destroy
1159
+ @param {Array} storeKeys (optional) store keys to destroy
1160
+ @returns {SC.Store} the store.
1161
+ */
1162
+ cancelRecords: function(recordTypes, ids, storeKeys) {
1163
+ var source = this.get('dataSource'),
1164
+ isArray = SC.typeOf(recordTypes) === SC.T_ARRAY,
1165
+ K = SC.Record,
1166
+ ret = [],
1167
+ status, len, idx, id, recordType, storeKey;
1168
+
1169
+ len = (storeKeys === undefined) ? ids.length : storeKeys.length;
1170
+ for(idx=0;idx<len;idx++) {
1171
+ if (isArray) recordType = recordTypes[idx] || SC.Record;
1172
+ else recordType = recordTypes || SC.Record;
1173
+
1174
+ id = ids ? ids[idx] : undefined ;
1175
+
1176
+ if(storeKeys===undefined){
1177
+ storeKey = recordType.storeKeyFor(id);
1178
+ }else{
1179
+ storeKey = storeKeys ? storeKeys[idx] : undefined ;
1180
+ }
1181
+ if(storeKey) {
1182
+ status = this.readStatus(storeKey);
1183
+
1184
+ if ((status == K.EMPTY) || (status == K.ERROR)) {
1185
+ throw K.NOT_FOUND_ERROR ;
1186
+ }
1187
+ ret.push(storeKey);
1188
+ }
1189
+ }
1190
+
1191
+ if (source) source.cancel.call(source, this, ret);
1192
+
1193
+ return this ;
1194
+ },
1195
+
1196
+ /**
1197
+ Cancels an inflight request for the passed record. Depending on the
1198
+ server implementation, this could cancel an entire request, causing
1199
+ other records to also transition their current state.
1200
+
1201
+ @param {SC.Record|Array} recordTypes class or array of classes
1202
+ @param {Array} ids ids to destroy
1203
+ @param {Array} storeKeys (optional) store keys to destroy
1204
+ @returns {SC.Store} the store.
1205
+ */
1206
+ cancelRecord: function(recordType, id, storeKey) {
1207
+ var array = this._TMP_RETRIEVE_ARRAY,
1208
+ ret ;
1209
+
1210
+ if (storeKey !== undefined) {
1211
+ array[0] = storeKey;
1212
+ storeKey = array;
1213
+ id = null ;
1214
+ } else {
1215
+ array[0] = id;
1216
+ id = array;
1217
+ }
1218
+
1219
+ ret = this.cancelRecords(recordType, id, storeKey);
1220
+ array.length = 0 ;
1221
+ return this;
1222
+ },
1223
+
1224
+ /**
1225
+ Convenience method can be called by the store or other parts of your
1226
+ application to load records into the store. This method will take a
1227
+ recordType and an array of data hashes and either add or update the
1228
+ record in the store.
1229
+
1230
+ The loaded records will be in an SC.Record.READY_CLEAN state, indicating
1231
+ they were loaded from the data source and do not need to be committed
1232
+ back before changing.
1233
+
1234
+ This method is implemented by calling pushRetrieve(). The standard
1235
+ state constraints for that method apply here.
1236
+
1237
+ If you are upgrading from a pre SproutCore 1.0 application, this method
1238
+ is the closest to the old updateRecords().
1239
+
1240
+ @param {SC.Record} recordTypes the record type or array of record types
1241
+ @param {Array} dataHashes array of data hashes to update
1242
+ @param {Array} ids optional array of ids. if not passed lookup on hashes
1243
+ @returns {Array} store keys assigned to these ids
1244
+ */
1245
+ loadRecords: function(recordTypes, dataHashes, ids) {
1246
+ var isArray = SC.typeOf(recordTypes) === SC.T_ARRAY,
1247
+ len = dataHashes.get('length'),
1248
+ ret = [],
1249
+ recordType, id, primaryKey, idx, dataHash, storeKey;
1250
+
1251
+ // save lookup info
1252
+ if (!isArray) {
1253
+ recordType = recordTypes || SC.Record;
1254
+ primaryKey = recordType.prototype.primaryKey ;
1255
+ }
1256
+
1257
+ // push each record
1258
+ for(idx=0;idx<len;idx++) {
1259
+ dataHash = dataHashes.objectAt(idx);
1260
+ if (isArray) {
1261
+ recordType = recordTypes.objectAt(idx) || SC.Record;
1262
+ primaryKey = recordType.prototype.primaryKey ;
1263
+ }
1264
+ id = (ids) ? ids.objectAt(idx) : dataHash[primaryKey];
1265
+ ret[idx] = storeKey = recordType.storeKeyFor(id); // needed to cache
1266
+ this.pushRetrieve(recordType, id, dataHash, storeKey);
1267
+ }
1268
+
1269
+ // return storeKeys
1270
+ return ret ;
1271
+ },
1272
+
1273
+ // ..........................................................
1274
+ // DATA SOURCE CALLBACKS
1275
+ //
1276
+ // Mathods called by the data source on the store
1277
+
1278
+ /**
1279
+ Called by a dataSource when it cancels an inflight operation on a
1280
+ record. This will transition the record back to it non-inflight state.
1281
+
1282
+ @param {Number} storeKey record store key to cancel
1283
+ @returns {SC.Store} reciever
1284
+ */
1285
+ dataSourceDidCancel: function(storeKey) {
1286
+ var status = this.readStatus(storeKey),
1287
+ K = SC.Record;
1288
+
1289
+ // EMPTY, ERROR, READY_CLEAN, READY_NEW, READY_DIRTY, DESTROYED_CLEAN,
1290
+ // DESTROYED_DIRTY
1291
+ if (!(status & K.BUSY)) {
1292
+ throw K.BAD_STATE_ERROR; // should never be called in this state
1293
+
1294
+ }
1295
+
1296
+ // otherwise, determine proper state transition
1297
+ switch(status) {
1298
+ case K.BUSY_LOADING:
1299
+ status = K.EMPTY;
1300
+ break ;
1301
+
1302
+ case K.BUSY_CREATING:
1303
+ status = K.READY_NEW;
1304
+ break;
1305
+
1306
+ case K.BUSY_COMMITTING:
1307
+ status = K.READY_DIRTY ;
1308
+ break;
1309
+
1310
+ case K.BUSY_REFRESH_CLEAN:
1311
+ status = K.READY_CLEAN;
1312
+ break;
1313
+
1314
+ case K.BUSY_REFRESH_DIRTY:
1315
+ status = K.READY_DIRTY ;
1316
+ break ;
1317
+
1318
+ case K.BUSY_DESTROYING:
1319
+ status = K.DESTROYED_DIRTY ;
1320
+ break;
1321
+
1322
+ default:
1323
+ throw K.BAD_STATE_ERROR ;
1324
+ }
1325
+ this.writeStatus(storeKey, status) ;
1326
+ this.dataHashDidChange(storeKey, null, YES);
1327
+
1328
+ return this ;
1329
+ },
1330
+
1331
+ /**
1332
+ Called by a data source when it creates or commits a record. Passing an
1333
+ optional id will remap the storeKey to the new record id. This is
1334
+ required when you commit a record that does not have an id yet.
1335
+
1336
+ @param {Number} storeKey record store key to change to READY_CLEAN state
1337
+ @returns {SC.Store} reciever
1338
+ */
1339
+ dataSourceDidComplete: function(storeKey, dataHash, newId) {
1340
+ var status = this.readStatus(storeKey), K = SC.Record;
1341
+
1342
+ // EMPTY, ERROR, READY_CLEAN, READY_NEW, READY_DIRTY, DESTROYED_CLEAN,
1343
+ // DESTROYED_DIRTY
1344
+ if (!(status & K.BUSY)) {
1345
+ throw K.BAD_STATE_ERROR; // should never be called in this state
1346
+
1347
+ }
1348
+
1349
+ // otherwise, determine proper state transition
1350
+ if(status==K.BUSY_DESTROYING) {
1351
+ throw K.BAD_STATE_ERROR ;
1352
+ } else status = K.READY_CLEAN ;
1353
+
1354
+ this.writeStatus(storeKey, status) ;
1355
+ if (dataHash) this.writeDataHash(storeKey, dataHash, status) ;
1356
+ if (newId) SC.Store.replaceIdFor(storeKey, newId);
1357
+ this.dataHashDidChange(storeKey);
1358
+
1359
+ return this ;
1360
+ },
1361
+
1362
+ /**
1363
+ Called by a data source when it has destroyed a record. This will
1364
+ transition the record to the proper state.
1365
+
1366
+ @param {Number} storeKey record store key to cancel
1367
+ @returns {SC.Store} reciever
1368
+ */
1369
+ dataSourceDidDestroy: function(storeKey) {
1370
+ var status = this.readStatus(storeKey), K = SC.Record;
1371
+
1372
+ // EMPTY, ERROR, READY_CLEAN, READY_NEW, READY_DIRTY, DESTROYED_CLEAN,
1373
+ // DESTROYED_DIRTY
1374
+ if (!(status & K.BUSY)) {
1375
+ throw K.BAD_STATE_ERROR; // should never be called in this state
1376
+ }
1377
+ // otherwise, determine proper state transition
1378
+ else{
1379
+ status = K.DESTROYED_CLEAN ;
1380
+ }
1381
+ this.removeDataHash(storeKey, status) ;
1382
+ this.dataHashDidChange(storeKey);
1383
+
1384
+ return this ;
1385
+ },
1386
+
1387
+ /**
1388
+ Converts the passed record into an error object.
1389
+
1390
+ @param {Number} storeKey record store key to cancel
1391
+ @returns {SC.Store} reciever
1392
+ */
1393
+ dataSourceDidError: function(storeKey, error) {
1394
+ var status = this.readStatus(storeKey), K = SC.Record;
1395
+
1396
+ // EMPTY, ERROR, READY_CLEAN, READY_NEW, READY_DIRTY, DESTROYED_CLEAN,
1397
+ // DESTROYED_DIRTY
1398
+ if (!(status & K.BUSY)) {
1399
+ throw K.BAD_STATE_ERROR; // should never be called in this state
1400
+ }
1401
+ // otherwise, determine proper state transition
1402
+ else{
1403
+ status = error ;
1404
+ }
1405
+ this.writeStatus(storeKey, status) ;
1406
+ this.dataHashDidChange(storeKey, null, YES);
1407
+
1408
+ return this ;
1409
+ },
1410
+
1411
+ // ..........................................................
1412
+ // PUSH CHANGES FROM DATA SOURCE
1413
+ //
1414
+
1415
+ pushRetrieve: function(recordType, id, dataHash, storeKey) {
1416
+ var K = SC.Record, status;
1417
+
1418
+ if(storeKey===undefined){
1419
+ storeKey = recordType.storeKeyFor(id);
1420
+ }
1421
+ status = this.readStatus(storeKey);
1422
+ if(status==K.EMPTY || status==K.ERROR || status==K.READY_CLEAN || status==K.DESTROY_CLEAN){
1423
+ status = K.READY_CLEAN;
1424
+ if(dataHash===undefined) this.writeStatus(storeKey, status) ;
1425
+ else this.writeDataHash(storeKey, dataHash, status) ;
1426
+ this.dataHashDidChange(storeKey);
1427
+
1428
+ return YES;
1429
+ }
1430
+ //conflicted (ready)
1431
+ return NO;
1432
+ },
1433
+
1434
+ pushDestroy: function(recordType, id, storeKey) {
1435
+ var K = SC.Record;
1436
+
1437
+ if(storeKey===undefined){
1438
+ storeKey = recordType.storeKeyFor(id);
1439
+ }
1440
+ status = this.readStatus(storeKey);
1441
+ if(status==K.EMPTY || status==K.ERROR || status==K.READY_CLEAN || status==K.DESTROY_CLEAN){
1442
+ status = K.DESTROY_CLEAN;
1443
+ this.removeDataHash(storeKey, status) ;
1444
+ this.dataHashDidChange(storeKey);
1445
+ return YES;
1446
+ }
1447
+ //conflicted (destroy)
1448
+ return NO;
1449
+ },
1450
+
1451
+ pushError: function(recordType, id, error, storeKey) {
1452
+ var K = SC.Record;
1453
+
1454
+ if(storeKey===undefined){
1455
+ storeKey = recordType.storeKeyFor(id);
1456
+ }
1457
+ status = this.readStatus(storeKey);
1458
+ if(status==K.EMPTY || status==K.ERROR || status==K.READY_CLEAN || status==K.DESTROY_CLEAN){
1459
+ status = error;
1460
+ this.writeStatus(storeKey, status) ;
1461
+ this.dataHashDidChange(storeKey, null, YES);
1462
+ return YES;
1463
+ }
1464
+ //conflicted (error)
1465
+ return NO;
1466
+ },
1467
+
1468
+ // ..........................................................
1469
+ // INTERNAL SUPPORT
1470
+ //
1471
+
1472
+ init: function() {
1473
+ sc_super();
1474
+ this.reset();
1475
+ },
1476
+
1477
+
1478
+ // ..........................................................
1479
+ // PRIMARY KEY CONVENIENCE METHODS
1480
+ //
1481
+
1482
+ /**
1483
+ Given a storeKey, return the primaryKey.
1484
+
1485
+ @param {Number} storeKey the store key
1486
+ @returns {String} primaryKey value
1487
+ */
1488
+ idFor: function(storeKey) {
1489
+ return SC.Store.idFor(storeKey);
1490
+ },
1491
+
1492
+ /**
1493
+ Given a storeKey, return the recordType.
1494
+
1495
+ @param {Number} storeKey the store key
1496
+ @returns {SC.Record} record instance
1497
+ */
1498
+ recordTypeFor: function(storeKey) {
1499
+ return SC.Store.recordTypeFor(storeKey) ;
1500
+ },
1501
+
1502
+ /**
1503
+ Given a recordType and primaryKey, find the storeKey.
1504
+
1505
+ @param {SC.Record} recordType the record type
1506
+ @param {String} primaryKey the primary key
1507
+ @returns {Number} storeKey
1508
+ */
1509
+ storeKeyFor: function(recordType, primaryKey) {
1510
+ return recordType.storeKeyFor(primaryKey);
1511
+ }
1512
+
1513
+ }) ;
1514
+
1515
+ SC.Store.mixin({
1516
+
1517
+ CHAIN_CONFLICT_ERROR: new Error("Nested Store Conflict"),
1518
+ NO_PARENT_STORE_ERROR: new Error("Parent Store Required"),
1519
+ NESTED_STORE_UNSUPPORTED_ERROR: new Error("Unsupported In Nested Store"),
1520
+
1521
+ EDITABLE: 'editable',
1522
+ LOCKED: 'locked',
1523
+ INHERITED: 'inherited',
1524
+
1525
+ /** @private
1526
+ This array maps all storeKeys to primary keys. You will not normally
1527
+ access this method directly. Instead use the idFor() and
1528
+ storeKeyFor() methods on SC.Record.
1529
+ */
1530
+ idsByStoreKey: [],
1531
+
1532
+ /** @private
1533
+ Maps all storeKeys to a recordType. Once a storeKey is associated with
1534
+ a primaryKey and recordType that remains constant throughout the lifetime
1535
+ of the application.
1536
+ */
1537
+ recordTypesByStoreKey: [],
1538
+
1539
+ /** @private
1540
+ The next store key to allocate. A storeKey must always be greater than 0
1541
+ */
1542
+ nextStoreKey: 1,
1543
+
1544
+ generateStoreKey: function() { return this.nextStoreKey++; },
1545
+
1546
+ /**
1547
+ Given a storeKey returns the primaryKey associated with the key.
1548
+ If not primaryKey is associated with the storeKey, returns null.
1549
+
1550
+ @param {Number} storeKey the store key
1551
+ @returns {String} the primary key or null
1552
+ */
1553
+ idFor: function(storeKey) {
1554
+ return this.idsByStoreKey[storeKey] ;
1555
+ },
1556
+
1557
+ /**
1558
+ Given a storeKey returns the SC.Record class associated with the key.
1559
+ If no record type is associated with the store key, returns null.
1560
+
1561
+ @param {Number} storeKey the store key
1562
+ @returns {String} the primary key or null
1563
+ */
1564
+ recordTypeFor: function(storeKey) {
1565
+ return this.recordTypesByStoreKey[storeKey];
1566
+ },
1567
+
1568
+ /**
1569
+ Swaps the primaryKey mapped to the given storeKey with the new
1570
+ primaryKey. If the storeKey is not currently associated with a record
1571
+ this will raise an exception.
1572
+
1573
+ @param {Number} storeKey the existing store key
1574
+ @param {String} newPrimaryKey the new primary key
1575
+ @returns {SC.Store} receiver
1576
+ */
1577
+ replaceIdFor: function(storeKey, primaryKey) {
1578
+ var recordType = this.recordTypeFor(storeKey);
1579
+ if (!recordType) {
1580
+ throw "replaceIdFor: storeKey %@ does not exist".fmt(storeKey);
1581
+ }
1582
+
1583
+ // map one direction...
1584
+ var oldPrimaryKey = this.idsByStoreKey[storeKey];
1585
+ this.idsByStoreKey[storeKey] = primaryKey ;
1586
+
1587
+ // then the other...
1588
+ var storeKeys = recordType.storeKeysById ;
1589
+ if (!storeKeys) storeKeys = recordType.storeKeysById = {};
1590
+ delete storeKeys[oldPrimaryKey];
1591
+ storeKeys[primaryKey] = storeKey;
1592
+
1593
+ return this ;
1594
+ },
1595
+
1596
+ /**
1597
+ Swaps the recordType recorded for a given storeKey. Normally you should
1598
+ not call this method directly as it can damage the store behavior. This
1599
+ method is used by other store methods to set the recordType for a
1600
+ storeKey.
1601
+
1602
+ @param {Integer} storeKey the store key
1603
+ @param {SC.Record} recordType a record class
1604
+ @returns {SC.Store} reciever
1605
+ */
1606
+ replaceRecordTypeFor: function(storeKey, recordType) {
1607
+ this.recordTypesByStoreKey[storeKey] = recordType;
1608
+ return this ;
1609
+ }
1610
+
1611
+ });
1612
+
1613
+
1614
+ SC.Store.prototype.nextStoreIndex = 1;
1615
+
1616
+ // ..........................................................
1617
+ // COMPATIBILITY
1618
+ //
1619
+
1620
+ /** @private
1621
+ global store is used only for deprecated compatibility methods. Don't use
1622
+ this in real code.
1623
+ */
1624
+ SC.Store._getDefaultStore = function() {
1625
+ var store = this._store;
1626
+ if(!store) this._store = store = SC.Store.create();
1627
+ return store;
1628
+ };
1629
+
1630
+ /** @deprecated
1631
+ Included for compatibility, loads data hashes with the named recordType.
1632
+ If no recordType is passed, expects to find a recordType property in the
1633
+ data hashes. dataSource and isLoaded params are ignored.
1634
+
1635
+ Calls SC.Store#loadRecords() on the default store. Do not use this method in
1636
+ new code.
1637
+
1638
+ @param {Array} dataHashes data hashes to import
1639
+ @param {Object} dataSource ignored
1640
+ @param {SC.Record} recordType default record type
1641
+ @param {Boolean} isLoaded ignored
1642
+ @returns {Array} SC.Record instances for loaded data hashes
1643
+ */
1644
+ SC.Store.updateRecords = function(dataHashes, dataSource, recordType, isLoaded) {
1645
+ var store = this._getDefaultStore(),
1646
+ len = dataHashes.length,
1647
+ idx, ret;
1648
+
1649
+ // if no recordType was passed, build an array of recordTypes from hashes
1650
+ if (!recordType) {
1651
+ recordType = [];
1652
+ for(idx=0;idx<len;idx++) recordType[idx] = dataHashes[idx].recordType;
1653
+ }
1654
+
1655
+ // call new API. Returns storeKeys
1656
+ ret = store.loadRecords(recordType, dataHashes);
1657
+
1658
+ // map to SC.Record instances
1659
+ len = ret.length;
1660
+ for(idx=0;idx<len;idx++) ret[idx] = store.materializeRecord(ret[idx]);
1661
+
1662
+ return ret ;
1663
+ };
1664
+
1665
+ /** @deprecated
1666
+ Finds a record with the passed guid on the default store. This is included
1667
+ only for compatibility. You should use the newer find() method defined on
1668
+ SC.Store instead.
1669
+
1670
+ @param {String} guid the guid
1671
+ @param {SC.Record} recordType expected record type
1672
+ @returns {SC.Record} found record
1673
+ */
1674
+ SC.Store.find = function(guid, recordType) {
1675
+ return this._getDefaultStore().find(recordType, guid);
1676
+ };
1677
+
1678
+ /** @deprecated
1679
+ Passes through to findAll on default store. This is included only for
1680
+ compatibility. You should use the newer findAll() defined on SC.Store
1681
+ instead.
1682
+
1683
+ @param {Hash} filter search parameters
1684
+ @param {SC.Record} recordType type of record to find
1685
+ @returns {SC.RecordArray} result set
1686
+ */
1687
+ SC.Store.findAll = function(filter, recordType) {
1688
+ return this._getDefaultStore().findAll(filter, recordType);
1689
+ };