sproutcore 1.6.0.beta.3-java → 1.6.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (633) hide show
  1. data/CHANGELOG +70 -0
  2. data/{History.txt → History.rdoc} +0 -0
  3. data/{README.txt → README.rdoc} +3 -2
  4. data/Rakefile +213 -10
  5. data/{Todo.txt → Todo.rdoc} +0 -0
  6. data/VERSION.yml +1 -1
  7. data/bin/sc-docs +6 -1
  8. data/lib/Buildfile +5 -1
  9. data/lib/buildtasks/manifest.rake +14 -1
  10. data/lib/buildtasks/target.rake +20 -23
  11. data/lib/frameworks/sproutcore/Buildfile +8 -3
  12. data/lib/frameworks/sproutcore/CHANGELOG.md +364 -1
  13. data/lib/frameworks/sproutcore/README.md +1 -1
  14. data/lib/frameworks/sproutcore/apps/test_controls/controllers/select.js +12 -0
  15. data/lib/frameworks/sproutcore/apps/test_controls/resources/select_page.js +19 -5
  16. data/lib/frameworks/sproutcore/apps/welcome/english.lproj/main_page.css +9 -0
  17. data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +243 -199
  18. data/lib/frameworks/sproutcore/frameworks/ajax/system/response.js +250 -172
  19. data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/request.js +29 -0
  20. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +5 -0
  21. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/controller.js +21 -1
  22. data/lib/frameworks/sproutcore/frameworks/core_foundation/controls/button.js +6 -2
  23. data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +2 -42
  24. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/bind.js +38 -15
  25. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/collection.js +6 -4
  26. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/responder_context.js +1 -1
  27. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/checkbox_support.js +11 -6
  28. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +55 -20
  29. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/keyboard.js +2 -0
  30. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +26 -20
  31. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/template.js +37 -21
  32. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/application.js +2 -7
  33. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +7 -7
  34. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +157 -5
  35. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +2 -2
  36. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +7 -6
  37. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/responder.js +1 -1
  38. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +29 -15
  39. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +8 -8
  40. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/string.js +162 -1
  41. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/theme.js +3 -56
  42. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +24 -8
  43. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +42 -0
  44. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/content_destroyed.js +59 -0
  45. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controls/button.js +39 -57
  46. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/string.js +41 -1
  47. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/template_helpers/text_field_support.js +19 -2
  48. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/panes/template.js +16 -1
  49. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_style.js +5 -3
  50. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +32 -0
  51. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/collection.js +135 -0
  52. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +29 -18
  53. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +11 -0
  54. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/didAppendToDocument.js +18 -2
  55. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/insertBefore.js +10 -6
  56. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js +414 -1
  57. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +1 -1
  58. data/lib/frameworks/sproutcore/frameworks/core_foundation/{system → views}/bindable_span.js +2 -1
  59. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +112 -40
  60. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +13 -7
  61. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +2 -1
  62. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/keyboard.js +245 -67
  63. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +17 -9
  64. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +8 -18
  65. data/lib/frameworks/sproutcore/frameworks/core_tools/core.js +8 -2
  66. data/lib/frameworks/sproutcore/frameworks/core_tools/data_source.js +1 -1
  67. data/lib/frameworks/sproutcore/frameworks/core_tools/models/target.js +1 -1
  68. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +15 -8
  69. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +12 -2
  70. data/lib/frameworks/sproutcore/frameworks/datastore/mixins/relationship_support.js +296 -0
  71. data/lib/frameworks/sproutcore/frameworks/datastore/models/child_record.js +3 -3
  72. data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +330 -326
  73. data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +23 -1
  74. data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +26 -5
  75. data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +1 -1
  76. data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +69 -58
  77. data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +614 -614
  78. data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/data_source.js +203 -0
  79. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js +3 -1
  80. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +44 -0
  81. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array_complex.js +2 -0
  82. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_complex.js +2 -0
  83. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +20 -13
  84. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +76 -47
  85. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +30 -30
  86. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +74 -53
  87. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +0 -1
  88. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitChangesFromNestedStore.js +24 -24
  89. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/connectDataSource.js +31 -0
  90. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushRelationships.js +1177 -0
  91. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +212 -182
  92. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +6 -67
  93. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +1 -1
  94. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +1 -1
  95. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +1 -1
  96. data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +13 -15
  97. data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +41 -12
  98. data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +9 -0
  99. data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +6 -3
  100. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +3 -3
  101. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +3 -3
  102. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/button.js +1 -1
  103. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/checkbox.js +1 -1
  104. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/collection.js +1 -1
  105. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/disclosure.js +1 -1
  106. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/image_button.js +1 -1
  107. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/master_detail.js +3 -2
  108. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/menu.js +12 -2
  109. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/panel.js +1 -1
  110. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/picker.js +1 -1
  111. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/progress.js +1 -1
  112. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio.js +1 -1
  113. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio_group.js +2 -2
  114. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segment.js +1 -1
  115. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segmented.js +1 -1
  116. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/slider.js +1 -1
  117. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/toolbar.js +1 -1
  118. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/well.js +1 -1
  119. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/workspace.js +1 -1
  120. data/lib/frameworks/sproutcore/frameworks/desktop/resources/alert.css +49 -0
  121. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/debug/a_sample_image.jpg +0 -0
  122. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/debug/apple-logo1.jpeg +0 -0
  123. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/debug/iframe.html +0 -0
  124. data/lib/frameworks/sproutcore/frameworks/desktop/resources/disclosure.css +20 -0
  125. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/drag.css +1 -1
  126. data/lib/frameworks/sproutcore/frameworks/desktop/resources/icons.css +214 -0
  127. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/cap.png +0 -0
  128. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/downbutton.png +0 -0
  129. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-alert-16.png +0 -0
  130. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-alert-24.png +0 -0
  131. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-alert-48.png +0 -0
  132. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-bookmark-16.png +0 -0
  133. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-bookmark-24.png +0 -0
  134. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-cancel-24.png +0 -0
  135. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-document-16.png +0 -0
  136. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-document-24.png +0 -0
  137. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-down-24.png +0 -0
  138. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-error-48.png +0 -0
  139. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-favorite-16.png +0 -0
  140. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-favorite-24.png +0 -0
  141. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-folder-16.png +0 -0
  142. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-folder-24.png +0 -0
  143. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-group-16.png +0 -0
  144. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-group-24.png +0 -0
  145. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-help-16.png +0 -0
  146. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-help-24.png +0 -0
  147. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-info-16.png +0 -0
  148. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-info-24.png +0 -0
  149. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-info-48.png +0 -0
  150. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-left-24.png +0 -0
  151. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-options-16.png +0 -0
  152. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-options-24.png +0 -0
  153. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-redo-24.png +0 -0
  154. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-right-24.png +0 -0
  155. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-tools-24.png +0 -0
  156. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-trash-16.png +0 -0
  157. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-trash-24.png +0 -0
  158. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-undo-24.png +0 -0
  159. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-up-24.png +0 -0
  160. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-user-16.png +0 -0
  161. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-user-24.png +0 -0
  162. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/thumb-bottom.png +0 -0
  163. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/thumb-center.png +0 -0
  164. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/thumb-top.png +0 -0
  165. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/track.png +0 -0
  166. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/upbutton.png +0 -0
  167. data/lib/frameworks/sproutcore/frameworks/desktop/resources/list_item.css +145 -0
  168. data/lib/frameworks/sproutcore/frameworks/desktop/resources/menu.css +10 -0
  169. data/lib/frameworks/sproutcore/frameworks/desktop/resources/menu_item_view.css +88 -0
  170. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/modal.css +3 -4
  171. data/lib/frameworks/sproutcore/frameworks/desktop/resources/panel.css +91 -0
  172. data/lib/frameworks/sproutcore/frameworks/desktop/resources/picker.css +37 -0
  173. data/lib/frameworks/sproutcore/frameworks/desktop/resources/progress.css +29 -0
  174. data/lib/frameworks/sproutcore/frameworks/desktop/resources/radio.css +11 -0
  175. data/lib/frameworks/sproutcore/frameworks/desktop/resources/segmented.css +122 -0
  176. data/lib/frameworks/sproutcore/frameworks/desktop/resources/separator.css +20 -0
  177. data/lib/frameworks/sproutcore/frameworks/desktop/resources/slider.css +34 -0
  178. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/split.css +0 -0
  179. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/split_divider.css +0 -0
  180. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/tab.css +0 -0
  181. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/toolbar.css +0 -0
  182. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/touch-scroller.css +13 -13
  183. data/lib/frameworks/sproutcore/frameworks/desktop/resources/well.css +65 -0
  184. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +58 -23
  185. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +20 -1
  186. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +121 -103
  187. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +34 -7
  188. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/static_content.js +3 -2
  189. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +1 -3
  190. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +20 -1
  191. data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +14 -15
  192. data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +43 -16
  193. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +717 -700
  194. data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +2 -2
  195. data/lib/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +11 -1
  196. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +16 -6
  197. data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +4 -7
  198. data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +0 -1
  199. data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +49 -7
  200. data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +9 -2
  201. data/lib/frameworks/sproutcore/frameworks/desktop/{panes → views}/select_button.js +52 -0
  202. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +7 -3
  203. data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +4 -26
  204. data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +46 -49
  205. data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +20 -19
  206. data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +2 -0
  207. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/designer/designers/view_designer.js +249 -249
  208. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/mixins/edit_mode.js +13 -5
  209. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/mixins/emptiness.js +53 -37
  210. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/render_delegates/form.js +2 -1
  211. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/render_delegates/form_row.js +3 -11
  212. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/mixins/edit_mode.js +53 -0
  213. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/mixins/emptiness.js +114 -0
  214. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form.js +174 -6
  215. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_row.js +86 -6
  216. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form.js +98 -126
  217. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form_row.js +96 -97
  218. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/README.md +2 -1
  219. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +20 -36
  220. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/ext/menu.js +121 -0
  221. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/ext/menu_item.js +90 -0
  222. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/mixins/select_view_menu.js +139 -0
  223. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/render_delegates/select_button.js +14 -0
  224. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/ext/menu_resizing.js +25 -0
  225. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/mixins/select_view_menu/bindings.js +43 -0
  226. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/mixins/select_view_menu/check_selected.js +32 -0
  227. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/popup_button/menu_setup.js +40 -0
  228. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/popup_button/show_menu.js +45 -0
  229. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/select/menu_width.js +49 -0
  230. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/select/selected_item.js +191 -0
  231. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/views/popup_button.js +264 -0
  232. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/views/select.js +450 -0
  233. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/mixins/split_child.js +14 -6
  234. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/mixins/split_thumb.js +1 -1
  235. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/render_delegates/split.js +1 -1
  236. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/render_delegates/split_divider.js +1 -1
  237. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/split.js +9 -0
  238. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/thumb.js +3 -2
  239. data/lib/frameworks/sproutcore/frameworks/foundation/core.js +2 -2
  240. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +16 -19
  241. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/button.js +4 -7
  242. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_value_support.js +1 -1
  243. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +85 -16
  244. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editable.js +1 -1
  245. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editor.js +1 -1
  246. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editor_delegate.js +1 -1
  247. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inner_frame.js +1 -1
  248. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +4 -2
  249. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/helpers/sizing.js +2 -0
  250. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/image.js +1 -1
  251. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/label.js +1 -1
  252. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/render_delegate.js +13 -13
  253. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/benchmark.css +0 -0
  254. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/blank.gif +0 -0
  255. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/bootstrap.rhtml +0 -0
  256. data/lib/frameworks/sproutcore/frameworks/foundation/resources/button_view.css +36 -0
  257. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/checkbox_view.css +0 -0
  258. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/debug/control-test-pane.css +0 -0
  259. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/favicon.ico +0 -0
  260. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-logo.png +0 -0
  261. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup-landscape.jpg +0 -0
  262. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup-landscape.png +0 -0
  263. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup-portrait.jpg +0 -0
  264. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup-portrait.png +0 -0
  265. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup.png +0 -0
  266. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore.png +0 -0
  267. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/inline_editor.css +0 -0
  268. data/lib/frameworks/sproutcore/frameworks/foundation/resources/label.css +47 -0
  269. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/radio_view.css +0 -0
  270. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/static_layout.css +1 -1
  271. data/lib/frameworks/sproutcore/frameworks/foundation/resources/text_field.css +125 -0
  272. data/lib/frameworks/sproutcore/frameworks/foundation/system/chance.js +5 -1
  273. data/lib/frameworks/sproutcore/frameworks/foundation/system/exception_handler.js +4 -2
  274. data/lib/frameworks/sproutcore/frameworks/foundation/system/math.js +2 -1
  275. data/lib/frameworks/sproutcore/frameworks/foundation/system/module.js +13 -0
  276. data/lib/frameworks/sproutcore/frameworks/foundation/system/string.js +0 -43
  277. data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/string_measurement.js +11 -11
  278. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/flowed_layout/tests.js +912 -0
  279. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +23 -0
  280. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +36 -7
  281. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +58 -4
  282. data/lib/frameworks/sproutcore/frameworks/foundation/validators/date.js +4 -4
  283. data/lib/frameworks/sproutcore/frameworks/foundation/validators/validator.js +1 -3
  284. data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +17 -6
  285. data/lib/frameworks/sproutcore/frameworks/foundation/views/field.js +0 -15
  286. data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +3 -3
  287. data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +30 -19
  288. data/lib/frameworks/sproutcore/frameworks/handlebars/handlebars.js +1 -1
  289. data/lib/frameworks/sproutcore/frameworks/jquery/jquery-buffered.js +2 -76
  290. data/lib/frameworks/sproutcore/frameworks/jquery/jquery.js +3348 -1591
  291. data/lib/frameworks/sproutcore/frameworks/routing/system/routes.js +6 -3
  292. data/lib/frameworks/sproutcore/frameworks/routing/tests/system/routes.js +11 -0
  293. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +38 -12
  294. data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/flatten.js +24 -0
  295. data/lib/frameworks/sproutcore/frameworks/runtime/ext/array.js +2 -1
  296. data/lib/frameworks/sproutcore/frameworks/runtime/ext/function.js +5 -5
  297. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +21 -2
  298. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +3 -2
  299. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +1 -1
  300. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +1 -1
  301. data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +2 -2
  302. data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +14 -14
  303. data/lib/frameworks/sproutcore/frameworks/runtime/system/error.js +4 -1
  304. data/lib/frameworks/sproutcore/frameworks/runtime/system/index_set.js +0 -3
  305. data/lib/frameworks/sproutcore/frameworks/runtime/system/logger.js +4 -4
  306. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +4 -4
  307. data/lib/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +1 -1
  308. data/lib/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +3 -3
  309. data/lib/frameworks/sproutcore/frameworks/runtime/system/set.js +15 -16
  310. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +6 -2
  311. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/objectForPropertyPath.js +10 -5
  312. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/requiredObjectForPropertyPath.js +29 -0
  313. data/lib/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue.js +98 -0
  314. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/enhance.js +30 -0
  315. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/create.js +17 -0
  316. data/lib/frameworks/sproutcore/frameworks/statechart/debug/monitor.js +4 -73
  317. data/lib/frameworks/sproutcore/frameworks/statechart/debug/sequence_matcher.js +189 -0
  318. data/lib/frameworks/sproutcore/frameworks/statechart/ext/function.js +122 -0
  319. data/lib/frameworks/sproutcore/frameworks/statechart/system/async.js +88 -0
  320. data/lib/frameworks/sproutcore/frameworks/statechart/system/empty_state.js +34 -0
  321. data/lib/frameworks/sproutcore/frameworks/statechart/system/history_state.js +97 -0
  322. data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +16 -191
  323. data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +17 -79
  324. data/lib/frameworks/sproutcore/frameworks/statechart/tests/debug/sequence_matcher.js +464 -0
  325. data/lib/frameworks/sproutcore/frameworks/statechart/tests/event_handling/basic/with_concurrent_states.js +31 -11
  326. data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/async/with_concurrent_states.js +6 -4
  327. data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/with_concurrent_states/advanced.js +40 -6
  328. data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/with_concurrent_states/basic.js +22 -2
  329. data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/with_concurrent_states/intermediate.js +44 -3
  330. data/lib/frameworks/sproutcore/frameworks/testing/core.js +61 -9
  331. data/lib/frameworks/sproutcore/frameworks/testing/{english.lproj → resources}/additions.css +0 -0
  332. data/lib/frameworks/sproutcore/frameworks/testing/{english.lproj → resources}/runner.css +10 -2
  333. data/lib/frameworks/sproutcore/frameworks/testing/{english.lproj → resources}/testsuite.css +0 -0
  334. data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +66 -27
  335. data/lib/frameworks/sproutcore/frameworks/testing/tests/spy_on.js +41 -0
  336. data/lib/frameworks/sproutcore/frameworks/testing/tests/stub_method.js +9 -0
  337. data/lib/frameworks/sproutcore/frameworks/yuireset/resources/base.css +80 -0
  338. data/lib/frameworks/sproutcore/frameworks/yuireset/resources/core.css +20 -0
  339. data/lib/frameworks/sproutcore/frameworks/yuireset/resources/fonts.css +39 -0
  340. data/lib/frameworks/sproutcore/frameworks/yuireset/resources/reset.css +126 -0
  341. data/lib/frameworks/sproutcore/frameworks/yuireset/resources/view.css +57 -0
  342. data/lib/frameworks/sproutcore/lib/index.rhtml +8 -4
  343. data/lib/frameworks/sproutcore/themes/ace/designs/psds/checkbox/ace/14px/checkbox_checked.psd +0 -0
  344. data/lib/frameworks/sproutcore/themes/ace/designs/psds/checkbox/ace/14px/checkbox_checked_active.psd +0 -0
  345. data/lib/frameworks/sproutcore/themes/ace/designs/psds/checkbox/ace/14px/checkbox_mixed.psd +0 -0
  346. data/lib/frameworks/sproutcore/themes/ace/designs/psds/checkbox/ace/14px/checkbox_mixed_active.psd +0 -0
  347. data/lib/frameworks/sproutcore/themes/ace/designs/psds/checkbox/ace/14px/checkbox_unchecked.psd +0 -0
  348. data/lib/frameworks/sproutcore/themes/ace/designs/psds/checkbox/ace/14px/checkbox_unchecked_active.psd +0 -0
  349. data/lib/frameworks/sproutcore/themes/ace/designs/psds/checkbox/ace/16px/checkbox_checked.psd +0 -0
  350. data/lib/frameworks/sproutcore/themes/ace/designs/psds/checkbox/ace/16px/checkbox_checked_active.psd +0 -0
  351. data/lib/frameworks/sproutcore/themes/ace/designs/psds/checkbox/ace/16px/checkbox_mixed.psd +0 -0
  352. data/lib/frameworks/sproutcore/themes/ace/designs/psds/checkbox/ace/16px/checkbox_mixed_active.psd +0 -0
  353. data/lib/frameworks/sproutcore/themes/ace/designs/psds/checkbox/ace/16px/checkbox_unchecked.psd +0 -0
  354. data/lib/frameworks/sproutcore/themes/ace/designs/psds/checkbox/ace/16px/checkbox_unchecked_active.psd +0 -0
  355. data/lib/frameworks/sproutcore/themes/ace/designs/psds/menu/menu_item.psd +0 -0
  356. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_checked.png +0 -0
  357. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_checked_active.png +0 -0
  358. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_mixed.png +0 -0
  359. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_mixed_active.png +0 -0
  360. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_unchecked.png +0 -0
  361. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_unchecked_active.png +0 -0
  362. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_checked.png +0 -0
  363. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_checked_active.png +0 -0
  364. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_mixed.png +0 -0
  365. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_mixed_active.png +0 -0
  366. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_unchecked.png +0 -0
  367. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_unchecked_active.png +0 -0
  368. data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list.css +13 -4
  369. data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list_item.css +16 -14
  370. data/lib/frameworks/sproutcore/themes/ace/resources/form/form.css +9 -0
  371. data/lib/frameworks/sproutcore/themes/ace/resources/menu/menu.css +3 -1
  372. data/lib/frameworks/sproutcore/themes/ace/resources/menu/menu_item.png +0 -0
  373. data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/picker.js +1 -1
  374. data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/workspace.js +1 -1
  375. data/lib/frameworks/sproutcore/themes/ace/resources/split/split.css +1 -1
  376. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/button.js +1 -1
  377. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/panel.js +1 -1
  378. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/progress.js +2 -0
  379. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/slider.js +1 -1
  380. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/well.js +1 -1
  381. data/lib/gen/app/templates/apps/@target_name@/Buildfile +1 -4
  382. data/lib/gen/app/templates/apps/@target_name@/core.js +1 -4
  383. data/lib/gen/app/templates/apps/@target_name@/main.js +1 -4
  384. data/lib/gen/app/templates/apps/@target_name@/resources/main_page.js +1 -4
  385. data/lib/gen/app/templates/apps/@target_name@/theme.js +1 -4
  386. data/lib/gen/controller/templates/controllers/{@filename@.js → @filename@_controller.js} +1 -4
  387. data/lib/gen/controller/templates/tests/controllers/{@filename@.js → @filename@_test.js} +1 -4
  388. data/lib/gen/data-source/templates/data_sources/{@filename@.js → @filename@_data_source.js} +1 -4
  389. data/lib/gen/design/templates/resources/@filename@.js +1 -4
  390. data/lib/gen/framework/templates/frameworks/@target_name@/core.js +1 -4
  391. data/lib/gen/framework/templates/frameworks/@target_name@/english.lproj/strings.js +1 -4
  392. data/lib/gen/html_app/templates/apps/@target_name@/@target_name@.js +1 -4
  393. data/lib/gen/html_app/templates/apps/@target_name@/resources/stylesheets/@target_name@.css +2 -0
  394. data/lib/gen/html_project/templates/@filename@/Buildfile +1 -4
  395. data/lib/gen/html_project/templates/@filename@/README +1 -4
  396. data/lib/gen/language/Buildfile +1 -1
  397. data/lib/gen/language/templates/@filename@/strings.js +1 -4
  398. data/lib/gen/model/templates/fixtures/{@filename@.js → @filename@_fixtures.js} +2 -5
  399. data/lib/gen/model/templates/models/{@filename@.js → @filename@_model.js} +1 -4
  400. data/lib/gen/model/templates/tests/models/{@filename@.js → @filename@_test.js} +1 -4
  401. data/lib/gen/page/templates/pages/@target_name@/Buildfile +1 -4
  402. data/lib/gen/page/templates/pages/@target_name@/core.js +1 -4
  403. data/lib/gen/page/templates/pages/@target_name@/en.lproj/strings.js +1 -4
  404. data/lib/gen/page/templates/pages/@target_name@/resources/body.css +3 -1
  405. data/lib/gen/project/templates/@filename@/Buildfile +1 -4
  406. data/lib/gen/project/templates/@filename@/README +1 -5
  407. data/lib/gen/responder/templates/states/{@filename@.js → @filename@_state.js} +1 -4
  408. data/lib/gen/test/templates/tests/{@filename@.js → @filename@_test.js} +1 -4
  409. data/lib/gen/theme/templates/themes/@target_name@/resources/theme_styles.css +1 -5
  410. data/lib/gen/theme/templates/themes/@target_name@/theme.js +1 -4
  411. data/lib/gen/view/templates/tests/views/{@filename@.js → @filename@_test.js} +1 -4
  412. data/lib/gen/view/templates/views/{@filename@.js → @filename@_view.js} +1 -4
  413. data/lib/sproutcore.rb +5 -15
  414. data/lib/sproutcore/builders/base.rb +5 -1
  415. data/lib/sproutcore/builders/handlebars.rb +12 -1
  416. data/lib/sproutcore/builders/module.rb +2 -2
  417. data/lib/sproutcore/buildfile/string_ext.rb +0 -4
  418. data/lib/sproutcore/helpers/cssmin.rb +44 -59
  419. data/lib/sproutcore/helpers/static_helper.rb +4 -2
  420. data/lib/sproutcore/helpers/text_helper.rb +11 -13
  421. data/lib/sproutcore/models/generator.rb +22 -0
  422. data/lib/sproutcore/models/manifest.rb +4 -4
  423. data/lib/sproutcore/models/manifest_entry.rb +1 -0
  424. data/lib/sproutcore/models/target.rb +3 -107
  425. data/lib/sproutcore/rack.rb +0 -1
  426. data/lib/sproutcore/rack/builder.rb +3 -0
  427. data/lib/sproutcore/rack/dev.rb +0 -1
  428. data/lib/sproutcore/rack/proxy.rb +240 -93
  429. data/lib/sproutcore/rack/service.rb +1 -1
  430. data/lib/sproutcore/render_engines/haml.rb +2 -5
  431. data/lib/sproutcore/tools.rb +11 -11
  432. data/lib/sproutcore/tools/build.rb +2 -0
  433. data/lib/sproutcore/tools/docs.rb +2 -37
  434. data/lib/sproutcore/tools/init.rb +10 -22
  435. data/lib/sproutcore/tools/manifest.rb +21 -22
  436. data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +21 -1
  437. data/spec/buildtasks/target_spec.rb +9 -0
  438. data/spec/fixtures/builder_tests/apps/handlebars_test/Buildfile +1 -0
  439. data/spec/fixtures/builder_tests/apps/handlebars_test/{template.handlebars → templates/template.handlebars} +2 -0
  440. data/{lib/doc_templates/sproutcore/allclasses.tmpl → spec/fixtures/ordered_entries/apps/template_style/a.js} +0 -0
  441. data/spec/fixtures/{real_world/frameworks/sproutcore/apps/docs/PLACEHOLDER → ordered_entries/apps/template_style/template_style.js} +0 -0
  442. data/spec/fixtures/real_world/frameworks/sproutcore/Buildfile +1 -1
  443. data/spec/lib/builders/handlebars_spec.rb +10 -4
  444. data/spec/lib/buildfile_commands/build_task_spec.rb +1 -1
  445. data/spec/lib/tools/manifest_spec.rb +11 -0
  446. data/sproutcore.gemspec +8 -7
  447. data/vendor/chance/lib/chance/instance.rb +8 -9
  448. metadata +167 -266
  449. data/lib/doc_templates/jsdoc/allclasses.tmpl +0 -17
  450. data/lib/doc_templates/jsdoc/allfiles.tmpl +0 -56
  451. data/lib/doc_templates/jsdoc/class.tmpl +0 -487
  452. data/lib/doc_templates/jsdoc/index.tmpl +0 -38
  453. data/lib/doc_templates/jsdoc/publish.js +0 -170
  454. data/lib/doc_templates/jsdoc/static/default.css +0 -162
  455. data/lib/doc_templates/jsdoc/static/header.html +0 -2
  456. data/lib/doc_templates/jsdoc/static/index.html +0 -19
  457. data/lib/doc_templates/jsdoc/symbol.tmpl +0 -35
  458. data/lib/doc_templates/sproutcore/allfiles.tmpl +0 -56
  459. data/lib/doc_templates/sproutcore/class.tmpl +0 -674
  460. data/lib/doc_templates/sproutcore/classes-json.tmpl +0 -55
  461. data/lib/doc_templates/sproutcore/index.tmpl +0 -62
  462. data/lib/doc_templates/sproutcore/publish.js +0 -346
  463. data/lib/doc_templates/sproutcore/static/default.css +0 -258
  464. data/lib/doc_templates/sproutcore/static/header.html +0 -2
  465. data/lib/doc_templates/sproutcore/static/index.html +0 -19
  466. data/lib/doc_templates/sproutcore/symbol.tmpl +0 -35
  467. data/lib/frameworks/sproutcore/frameworks/core_foundation/resources/core.css +0 -378
  468. data/lib/frameworks/sproutcore/frameworks/core_foundation/resources/view.css +0 -57
  469. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +0 -56
  470. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/disclosure.css +0 -73
  471. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/icons.css +0 -916
  472. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/shared.png +0 -0
  473. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +0 -185
  474. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/menu.css +0 -12
  475. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +0 -101
  476. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/panel.css +0 -91
  477. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/picker.css +0 -35
  478. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/progress.css +0 -33
  479. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/radio.css +0 -10
  480. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/segmented.css +0 -132
  481. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/separator.css +0 -19
  482. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +0 -69
  483. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/strings.js +0 -14
  484. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/well.css +0 -71
  485. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/english.lproj/default_styles.css +0 -5
  486. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/english.lproj/strings.js +0 -15
  487. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_checkbox_field.js +0 -17
  488. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_field.js +0 -17
  489. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_label.js +0 -17
  490. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_radio_field.js +0 -17
  491. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/tests/views/form_text_field.js +0 -17
  492. data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +0 -40
  493. data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/images/favicon.ico +0 -0
  494. data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/label.css +0 -47
  495. data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +0 -146
  496. data/lib/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue/isObservingSuspended.js +0 -55
  497. data/lib/frameworks/sproutcore/themes/empty_theme/tests/mini_icons.rhtml +0 -69
  498. data/lib/sproutcore/rack/docs.rb +0 -24
  499. data/vendor/jsdoc/README.txt +0 -151
  500. data/vendor/jsdoc/app/frame.js +0 -33
  501. data/vendor/jsdoc/app/frame/Chain.js +0 -102
  502. data/vendor/jsdoc/app/frame/Dumper.js +0 -144
  503. data/vendor/jsdoc/app/frame/Hash.js +0 -47
  504. data/vendor/jsdoc/app/frame/Link.js +0 -142
  505. data/vendor/jsdoc/app/frame/Namespace.js +0 -10
  506. data/vendor/jsdoc/app/frame/Opt.js +0 -134
  507. data/vendor/jsdoc/app/frame/Reflection.js +0 -26
  508. data/vendor/jsdoc/app/frame/String.js +0 -93
  509. data/vendor/jsdoc/app/frame/Testrun.js +0 -129
  510. data/vendor/jsdoc/app/handlers/FOODOC.js +0 -26
  511. data/vendor/jsdoc/app/handlers/XMLDOC.js +0 -26
  512. data/vendor/jsdoc/app/handlers/XMLDOC/DomReader.js +0 -159
  513. data/vendor/jsdoc/app/handlers/XMLDOC/XMLDoc.js +0 -16
  514. data/vendor/jsdoc/app/handlers/XMLDOC/XMLParse.js +0 -292
  515. data/vendor/jsdoc/app/lib/JSDOC.js +0 -98
  516. data/vendor/jsdoc/app/lib/JSDOC/DocComment.js +0 -200
  517. data/vendor/jsdoc/app/lib/JSDOC/DocTag.js +0 -294
  518. data/vendor/jsdoc/app/lib/JSDOC/JsDoc.js +0 -162
  519. data/vendor/jsdoc/app/lib/JSDOC/JsPlate.js +0 -100
  520. data/vendor/jsdoc/app/lib/JSDOC/Lang.js +0 -144
  521. data/vendor/jsdoc/app/lib/JSDOC/Parser.js +0 -109
  522. data/vendor/jsdoc/app/lib/JSDOC/PluginManager.js +0 -33
  523. data/vendor/jsdoc/app/lib/JSDOC/Symbol.js +0 -681
  524. data/vendor/jsdoc/app/lib/JSDOC/SymbolSet.js +0 -226
  525. data/vendor/jsdoc/app/lib/JSDOC/TextStream.js +0 -41
  526. data/vendor/jsdoc/app/lib/JSDOC/Token.js +0 -18
  527. data/vendor/jsdoc/app/lib/JSDOC/TokenReader.js +0 -332
  528. data/vendor/jsdoc/app/lib/JSDOC/TokenStream.js +0 -133
  529. data/vendor/jsdoc/app/lib/JSDOC/Util.js +0 -32
  530. data/vendor/jsdoc/app/lib/JSDOC/Walker.js +0 -453
  531. data/vendor/jsdoc/app/main.js +0 -74
  532. data/vendor/jsdoc/app/plugins/commentSrcJson.js +0 -19
  533. data/vendor/jsdoc/app/plugins/frameworkPrototype.js +0 -16
  534. data/vendor/jsdoc/app/plugins/functionCall.js +0 -10
  535. data/vendor/jsdoc/app/plugins/publishSrcHilite.js +0 -62
  536. data/vendor/jsdoc/app/plugins/sproutcoreTags.js +0 -26
  537. data/vendor/jsdoc/app/plugins/symbolLink.js +0 -9
  538. data/vendor/jsdoc/app/plugins/tagParamConfig.js +0 -31
  539. data/vendor/jsdoc/app/plugins/tagSynonyms.js +0 -43
  540. data/vendor/jsdoc/app/run.js +0 -346
  541. data/vendor/jsdoc/app/t/TestDoc.js +0 -144
  542. data/vendor/jsdoc/app/t/runner.js +0 -13
  543. data/vendor/jsdoc/app/test.js +0 -304
  544. data/vendor/jsdoc/app/test/addon.js +0 -24
  545. data/vendor/jsdoc/app/test/anon_inner.js +0 -14
  546. data/vendor/jsdoc/app/test/augments.js +0 -31
  547. data/vendor/jsdoc/app/test/augments2.js +0 -26
  548. data/vendor/jsdoc/app/test/borrows.js +0 -41
  549. data/vendor/jsdoc/app/test/borrows2.js +0 -23
  550. data/vendor/jsdoc/app/test/config.js +0 -22
  551. data/vendor/jsdoc/app/test/constructs.js +0 -18
  552. data/vendor/jsdoc/app/test/encoding.js +0 -10
  553. data/vendor/jsdoc/app/test/encoding_other.js +0 -12
  554. data/vendor/jsdoc/app/test/functions_anon.js +0 -39
  555. data/vendor/jsdoc/app/test/functions_nested.js +0 -33
  556. data/vendor/jsdoc/app/test/global.js +0 -13
  557. data/vendor/jsdoc/app/test/globals.js +0 -25
  558. data/vendor/jsdoc/app/test/ignore.js +0 -10
  559. data/vendor/jsdoc/app/test/inner.js +0 -16
  560. data/vendor/jsdoc/app/test/jsdoc_test.js +0 -477
  561. data/vendor/jsdoc/app/test/lend.js +0 -33
  562. data/vendor/jsdoc/app/test/memberof.js +0 -20
  563. data/vendor/jsdoc/app/test/memberof_constructor.js +0 -15
  564. data/vendor/jsdoc/app/test/name.js +0 -19
  565. data/vendor/jsdoc/app/test/namespace_nested.js +0 -23
  566. data/vendor/jsdoc/app/test/nocode.js +0 -13
  567. data/vendor/jsdoc/app/test/oblit_anon.js +0 -20
  568. data/vendor/jsdoc/app/test/overview.js +0 -20
  569. data/vendor/jsdoc/app/test/param_inline.js +0 -37
  570. data/vendor/jsdoc/app/test/params_optional.js +0 -8
  571. data/vendor/jsdoc/app/test/prototype.js +0 -17
  572. data/vendor/jsdoc/app/test/prototype_nested.js +0 -9
  573. data/vendor/jsdoc/app/test/prototype_oblit.js +0 -13
  574. data/vendor/jsdoc/app/test/prototype_oblit_constructor.js +0 -24
  575. data/vendor/jsdoc/app/test/public.js +0 -10
  576. data/vendor/jsdoc/app/test/shared.js +0 -42
  577. data/vendor/jsdoc/app/test/shared2.js +0 -2
  578. data/vendor/jsdoc/app/test/shortcuts.js +0 -22
  579. data/vendor/jsdoc/app/test/static_this.js +0 -13
  580. data/vendor/jsdoc/app/test/synonyms.js +0 -23
  581. data/vendor/jsdoc/app/test/tosource.js +0 -23
  582. data/vendor/jsdoc/app/test/variable_redefine.js +0 -14
  583. data/vendor/jsdoc/changes.txt +0 -47
  584. data/vendor/jsdoc/conf/sample.conf +0 -31
  585. data/vendor/jsdoc/java/build.xml +0 -36
  586. data/vendor/jsdoc/java/build_1.4.xml +0 -36
  587. data/vendor/jsdoc/java/classes/js.jar +0 -0
  588. data/vendor/jsdoc/java/src/JsDebugRun.java +0 -21
  589. data/vendor/jsdoc/java/src/JsRun.java +0 -21
  590. data/vendor/jsdoc/jsdebug.jar +0 -0
  591. data/vendor/jsdoc/jsrun.jar +0 -0
  592. data/vendor/jsdoc/t/TestDoc.js +0 -144
  593. data/vendor/jsdoc/t/runner.js +0 -13
  594. data/vendor/jsdoc/test.js +0 -304
  595. data/vendor/jsdoc/test/addon.js +0 -24
  596. data/vendor/jsdoc/test/anon_inner.js +0 -14
  597. data/vendor/jsdoc/test/augments.js +0 -31
  598. data/vendor/jsdoc/test/augments2.js +0 -26
  599. data/vendor/jsdoc/test/borrows.js +0 -41
  600. data/vendor/jsdoc/test/borrows2.js +0 -23
  601. data/vendor/jsdoc/test/config.js +0 -22
  602. data/vendor/jsdoc/test/constructs.js +0 -18
  603. data/vendor/jsdoc/test/encoding.js +0 -10
  604. data/vendor/jsdoc/test/encoding_other.js +0 -12
  605. data/vendor/jsdoc/test/functions_anon.js +0 -39
  606. data/vendor/jsdoc/test/functions_nested.js +0 -33
  607. data/vendor/jsdoc/test/global.js +0 -13
  608. data/vendor/jsdoc/test/globals.js +0 -25
  609. data/vendor/jsdoc/test/ignore.js +0 -10
  610. data/vendor/jsdoc/test/inner.js +0 -16
  611. data/vendor/jsdoc/test/jsdoc_test.js +0 -477
  612. data/vendor/jsdoc/test/lend.js +0 -33
  613. data/vendor/jsdoc/test/memberof.js +0 -20
  614. data/vendor/jsdoc/test/memberof_constructor.js +0 -15
  615. data/vendor/jsdoc/test/name.js +0 -19
  616. data/vendor/jsdoc/test/namespace_nested.js +0 -23
  617. data/vendor/jsdoc/test/nocode.js +0 -13
  618. data/vendor/jsdoc/test/oblit_anon.js +0 -20
  619. data/vendor/jsdoc/test/overview.js +0 -20
  620. data/vendor/jsdoc/test/param_inline.js +0 -37
  621. data/vendor/jsdoc/test/params_optional.js +0 -8
  622. data/vendor/jsdoc/test/prototype.js +0 -17
  623. data/vendor/jsdoc/test/prototype_nested.js +0 -9
  624. data/vendor/jsdoc/test/prototype_oblit.js +0 -13
  625. data/vendor/jsdoc/test/prototype_oblit_constructor.js +0 -24
  626. data/vendor/jsdoc/test/public.js +0 -10
  627. data/vendor/jsdoc/test/shared.js +0 -42
  628. data/vendor/jsdoc/test/shared2.js +0 -2
  629. data/vendor/jsdoc/test/shortcuts.js +0 -22
  630. data/vendor/jsdoc/test/static_this.js +0 -13
  631. data/vendor/jsdoc/test/synonyms.js +0 -23
  632. data/vendor/jsdoc/test/tosource.js +0 -23
  633. data/vendor/jsdoc/test/variable_redefine.js +0 -14
@@ -9,13 +9,13 @@ sc_require('models/record');
9
9
 
10
10
  /**
11
11
  @class
12
- @deprecated
12
+ @deprecated SC.ChildRecord is deprecated. Please extend SC.Record instead.
13
13
  */
14
14
  SC.ChildRecord = SC.Record.extend({});
15
15
 
16
16
  SC.ChildRecord.extend = function() {
17
- //@ if (debug)
17
+ // @if (debug)
18
18
  console.log("SC.ChildRecord is deprecated. Please extend SC.Record instead.");
19
- //@ endif
19
+ // @endif
20
20
  return SC.Record.extend.apply(this, arguments);
21
21
  };
@@ -10,27 +10,27 @@ sc_require('system/query');
10
10
  /**
11
11
  @class
12
12
 
13
- A Record is the core model class in SproutCore. It is analogous to
13
+ A Record is the core model class in SproutCore. It is analogous to
14
14
  NSManagedObject in Core Data and EOEnterpriseObject in the Enterprise
15
15
  Objects Framework (aka WebObjects), or ActiveRecord::Base in Rails.
16
-
16
+
17
17
  To create a new model class, in your SproutCore workspace, do:
18
-
18
+
19
19
  $ sc-gen model MyApp.MyModel
20
-
20
+
21
21
  This will create MyApp.MyModel in clients/my_app/models/my_model.js.
22
-
23
- The core attributes hash is used to store the values of a record in a
24
- format that can be easily passed to/from the server. The values should
25
- generally be stored in their raw string form. References to external
22
+
23
+ The core attributes hash is used to store the values of a record in a
24
+ format that can be easily passed to/from the server. The values should
25
+ generally be stored in their raw string form. References to external
26
26
  records should be stored as primary keys.
27
-
28
- Normally you do not need to work with the attributes hash directly.
29
- Instead you should use get/set on normal record properties. If the
30
- property is not defined on the object, then the record will check the
27
+
28
+ Normally you do not need to work with the attributes hash directly.
29
+ Instead you should use get/set on normal record properties. If the
30
+ property is not defined on the object, then the record will check the
31
31
  attributes hash instead.
32
-
33
- You can bulk update attributes from the server using the
32
+
33
+ You can bulk update attributes from the server using the
34
34
  `updateAttributes()` method.
35
35
 
36
36
  @extends SC.Object
@@ -39,42 +39,42 @@ sc_require('system/query');
39
39
  */
40
40
  SC.Record = SC.Object.extend(
41
41
  /** @scope SC.Record.prototype */ {
42
-
43
- /**
42
+
43
+ /**
44
44
  Walk like a duck
45
-
45
+
46
46
  @type Boolean
47
47
  @default YES
48
48
  */
49
49
  isRecord: YES,
50
-
50
+
51
51
  /**
52
52
  If you have nested records
53
-
53
+
54
54
  @type Boolean
55
55
  @default NO
56
56
  */
57
57
  isParentRecord: NO,
58
-
58
+
59
59
  // ...............................
60
60
  // PROPERTIES
61
61
  //
62
-
62
+
63
63
  /**
64
64
  This is the primary key used to distinguish records. If the keys
65
65
  match, the records are assumed to be identical.
66
-
66
+
67
67
  @type String
68
68
  @default 'guid'
69
69
  */
70
70
  primaryKey: 'guid',
71
-
71
+
72
72
  /**
73
- Returns the id for the record instance. The id is used to uniquely
74
- identify this record instance from all others of the same type. If you
73
+ Returns the id for the record instance. The id is used to uniquely
74
+ identify this record instance from all others of the same type. If you
75
75
  have a `primaryKey set on this class, then the id will be the value of the
76
76
  `primaryKey` property on the underlying JSON hash.
77
-
77
+
78
78
  @type String
79
79
  @property
80
80
  @dependsOn storeKey
@@ -87,21 +87,21 @@ SC.Record = SC.Object.extend(
87
87
  return SC.Store.idFor(this.storeKey);
88
88
  }
89
89
  }.property('storeKey').cacheable(),
90
-
90
+
91
91
  /**
92
- All records generally have a life cycle as they are created or loaded into
93
- memory, modified, committed and finally destroyed. This life cycle is
94
- managed by the status property on your record.
92
+ All records generally have a life cycle as they are created or loaded into
93
+ memory, modified, committed and finally destroyed. This life cycle is
94
+ managed by the status property on your record.
95
95
 
96
- The status of a record is modelled as a finite state machine. Based on the
97
- current state of the record, you can determine which operations are
96
+ The status of a record is modelled as a finite state machine. Based on the
97
+ current state of the record, you can determine which operations are
98
98
  currently allowed on the record and which are not.
99
-
99
+
100
100
  In general, a record can be in one of five primary states:
101
101
  `SC.Record.EMPTY`, `SC.Record.BUSY`, `SC.Record.READY`,
102
102
  `SC.Record.DESTROYED`, `SC.Record.ERROR`. These are all described in
103
103
  more detail in the class mixin (below) where they are defined.
104
-
104
+
105
105
  @type Number
106
106
  @property
107
107
  @dependsOn storeKey
@@ -113,47 +113,47 @@ SC.Record = SC.Object.extend(
113
113
  /**
114
114
  The store that owns this record. All changes will be buffered into this
115
115
  store and committed to the rest of the store chain through here.
116
-
116
+
117
117
  This property is set when the record instance is created and should not be
118
118
  changed or else it will break the record behavior.
119
-
119
+
120
120
  @type SC.Store
121
121
  @default null
122
122
  */
123
123
  store: null,
124
124
 
125
125
  /**
126
- This is the store key for the record, it is used to link it back to the
126
+ This is the store key for the record, it is used to link it back to the
127
127
  dataHash. If a record is reused, this value will be replaced.
128
-
128
+
129
129
  You should not edit this store key but you may sometimes need to refer to
130
130
  this store key when implementing a Server object.
131
-
131
+
132
132
  @type Number
133
133
  @default null
134
134
  */
135
135
  storeKey: null,
136
136
 
137
- /**
137
+ /**
138
138
  YES when the record has been destroyed
139
-
139
+
140
140
  @type Boolean
141
141
  @property
142
142
  @dependsOn status
143
143
  */
144
144
  isDestroyed: function() {
145
- return !!(this.get('status') & SC.Record.DESTROYED);
145
+ return !!(this.get('status') & SC.Record.DESTROYED);
146
146
  }.property('status').cacheable(),
147
-
147
+
148
148
  /**
149
149
  `YES` when the record is in an editable state. You can use this property to
150
- quickly determine whether attempting to modify the record would raise an
150
+ quickly determine whether attempting to modify the record would raise an
151
151
  exception or not.
152
-
153
- This property is both readable and writable. Note however that if you
152
+
153
+ This property is both readable and writable. Note however that if you
154
154
  set this property to `YES` but the status of the record is anything but
155
155
  `SC.Record.READY`, the return value of this property may remain `NO`.
156
-
156
+
157
157
  @type Boolean
158
158
  @property
159
159
  @dependsOn status
@@ -166,49 +166,49 @@ SC.Record = SC.Object.extend(
166
166
 
167
167
  /**
168
168
  @private
169
-
169
+
170
170
  Backing value for isEditable
171
171
  */
172
172
  _screc_isEditable: YES, // default
173
173
 
174
174
  /**
175
- `YES` when the record's contents have been loaded for the first time. You
175
+ `YES` when the record's contents have been loaded for the first time. You
176
176
  can use this to quickly determine if the record is ready to display.
177
-
177
+
178
178
  @type Boolean
179
179
  @property
180
180
  @dependsOn status
181
181
  */
182
182
  isLoaded: function() {
183
- var K = SC.Record,
183
+ var K = SC.Record,
184
184
  status = this.get('status');
185
185
  return !((status===K.EMPTY) || (status===K.BUSY_LOADING) || (status===K.ERROR));
186
186
  }.property('status').cacheable(),
187
-
187
+
188
188
  /**
189
189
  If set, this should be an array of active relationship objects that need
190
- to be notified whenever the underlying record properties change.
191
- Currently this is only used by toMany relationships, but you could
192
- possibly patch into this yourself also if you are building your own
190
+ to be notified whenever the underlying record properties change.
191
+ Currently this is only used by toMany relationships, but you could
192
+ possibly patch into this yourself also if you are building your own
193
193
  relationships.
194
-
194
+
195
195
  Note this must be a regular Array - NOT any object implementing SC.Array.
196
-
196
+
197
197
  @type Array
198
198
  @default null
199
199
  */
200
200
  relationships: null,
201
201
 
202
202
  /**
203
- This will return the raw attributes that you can edit directly. If you
203
+ This will return the raw attributes that you can edit directly. If you
204
204
  make changes to this hash, be sure to call `beginEditing()` before you get
205
205
  the attributes and `endEditing()` afterwards.
206
-
206
+
207
207
  @type Hash
208
208
  @property
209
209
  **/
210
210
  attributes: function() {
211
- var store = this.get('store'),
211
+ var store = this.get('store'),
212
212
  storeKey = this.storeKey;
213
213
  return store.readEditableDataHash(storeKey);
214
214
  }.property(),
@@ -218,31 +218,31 @@ SC.Record = SC.Object.extend(
218
218
  useful if you want to efficiently look at multiple attributes in bulk. If
219
219
  you would like to edit the attributes, see the `attributes` property
220
220
  instead.
221
-
221
+
222
222
  @type Hash
223
223
  @property
224
224
  **/
225
225
  readOnlyAttributes: function() {
226
- var store = this.get('store'),
226
+ var store = this.get('store'),
227
227
  storeKey = this.storeKey,
228
228
  ret = store.readDataHash(storeKey);
229
-
229
+
230
230
  if (ret) ret = SC.clone(ret, YES);
231
231
 
232
232
  return ret;
233
233
  }.property(),
234
-
234
+
235
235
  /**
236
236
  The namespace which to retrieve the childRecord Types from
237
-
237
+
238
238
  @type String
239
239
  @default null
240
240
  */
241
241
  nestedRecordNamespace: null,
242
-
242
+
243
243
  /**
244
244
  Whether or not this is a nested Record.
245
-
245
+
246
246
  @type Boolean
247
247
  @property
248
248
  */
@@ -250,14 +250,14 @@ SC.Record = SC.Object.extend(
250
250
  var store = this.get('store'), ret,
251
251
  sk = this.get('storeKey'),
252
252
  prKey = store.parentStoreKeyExists(sk);
253
-
253
+
254
254
  ret = prKey ? YES : NO;
255
255
  return ret;
256
256
  }.property().cacheable(),
257
-
257
+
258
258
  /**
259
259
  The parent record if this is a nested record.
260
-
260
+
261
261
  @type Boolean
262
262
  @property
263
263
  */
@@ -265,24 +265,24 @@ SC.Record = SC.Object.extend(
265
265
  var sk = this.storeKey, store = this.get('store');
266
266
  return store.materializeParentRecord(sk);
267
267
  }.property(),
268
-
268
+
269
269
  // ...............................
270
270
  // CRUD OPERATIONS
271
271
  //
272
272
 
273
273
  /**
274
- Refresh the record from the persistent store. If the record was loaded
275
- from a persistent store, then the store will be asked to reload the
276
- record data from the server. If the record is new and exists only in
274
+ Refresh the record from the persistent store. If the record was loaded
275
+ from a persistent store, then the store will be asked to reload the
276
+ record data from the server. If the record is new and exists only in
277
277
  memory then this call will have no effect.
278
-
278
+
279
279
  @param {boolean} recordOnly optional param if you want to only THIS record
280
280
  even if it is a child record.
281
281
  @param {Function} callback optional callback that will fire when request finishes
282
-
282
+
283
283
  @returns {SC.Record} receiver
284
284
  */
285
- refresh: function(recordOnly, callback) {
285
+ refresh: function(recordOnly, callback) {
286
286
  var store = this.get('store'), rec, ro,
287
287
  sk = this.get('storeKey'),
288
288
  prKey = store.parentStoreKeyExists();
@@ -299,19 +299,19 @@ SC.Record = SC.Object.extend(
299
299
 
300
300
  return this ;
301
301
  },
302
-
302
+
303
303
  /**
304
- Deletes the record along with any dependent records. This will mark the
305
- records destroyed in the store as well as changing the isDestroyed
306
- property on the record to YES. If this is a new record, this will avoid
304
+ Deletes the record along with any dependent records. This will mark the
305
+ records destroyed in the store as well as changing the isDestroyed
306
+ property on the record to YES. If this is a new record, this will avoid
307
307
  creating the record in the first place.
308
308
 
309
309
  @param {boolean} recordOnly optional param if you want to only THIS record
310
- even if it is a child record.
311
-
310
+ even if it is a child record.
311
+
312
312
  @returns {SC.Record} receiver
313
313
  */
314
- destroy: function(recordOnly) {
314
+ destroy: function(recordOnly) {
315
315
  var store = this.get('store'), rec, ro,
316
316
  sk = this.get('storeKey'),
317
317
  prKey = store.parentStoreKeyExists();
@@ -325,12 +325,12 @@ SC.Record = SC.Object.extend(
325
325
  // If there are any aggregate records, we might need to propagate our new
326
326
  // status to them.
327
327
  this.propagateToAggregates();
328
-
328
+
329
329
  } else if (prKey){
330
330
  rec = store.materializeRecord(prKey);
331
331
  rec.destroy(recordOnly);
332
332
  }
333
-
333
+
334
334
  return this ;
335
335
  },
336
336
 
@@ -338,22 +338,22 @@ SC.Record = SC.Object.extend(
338
338
  You can invoke this method anytime you need to make the record as dirty.
339
339
  This will cause the record to be commited when you `commitChanges()`
340
340
  on the underlying store.
341
-
342
- If you use the `writeAttribute()` primitive, this method will be called
341
+
342
+ If you use the `writeAttribute()` primitive, this method will be called
343
343
  for you.
344
-
344
+
345
345
  If you pass the key that changed it will ensure that observers are fired
346
346
  only once for the changed property instead of `allPropertiesDidChange()`
347
-
347
+
348
348
  @param {String} key key that changed (optional)
349
349
  @returns {SC.Record} receiver
350
350
  */
351
351
  recordDidChange: function(key) {
352
-
352
+
353
353
  // If we have a parent, they changed too!
354
354
  var p = this.get('parentRecord');
355
355
  if (p) p.recordDidChange();
356
-
356
+
357
357
  this.get('store').recordDidChange(null, null, this.get('storeKey'), key);
358
358
  this.notifyPropertyChange('status');
359
359
 
@@ -363,23 +363,27 @@ SC.Record = SC.Object.extend(
363
363
 
364
364
  return this ;
365
365
  },
366
-
366
+
367
+ toJSON: function(){
368
+ return this.get('attributes');
369
+ },
370
+
367
371
  // ...............................
368
372
  // ATTRIBUTES
369
373
  //
370
374
 
371
375
  /** @private
372
- Current edit level. Used to defer editing changes.
376
+ Current edit level. Used to defer editing changes.
373
377
  */
374
378
  _editLevel: 0 ,
375
-
379
+
376
380
  /**
377
- Defers notification of record changes until you call a matching
381
+ Defers notification of record changes until you call a matching
378
382
  `endEditing()` method. This method is called automatically whenever you
379
383
  set an attribute, but you can call it yourself to group multiple changes.
380
-
384
+
381
385
  Calls to `beginEditing()` and `endEditing()` can be nested.
382
-
386
+
383
387
  @returns {SC.Record} receiver
384
388
  */
385
389
  beginEditing: function() {
@@ -391,50 +395,50 @@ SC.Record = SC.Object.extend(
391
395
  Notifies the store of record changes if this matches a top level call to
392
396
  `beginEditing()`. This method is called automatically whenever you set an
393
397
  attribute, but you can call it yourself to group multiple changes.
394
-
398
+
395
399
  Calls to `beginEditing()` and `endEditing()` can be nested.
396
-
400
+
397
401
  @param {String} key key that changed (optional)
398
402
  @returns {SC.Record} receiver
399
403
  */
400
404
  endEditing: function(key) {
401
405
  if(--this._editLevel <= 0) {
402
- this._editLevel = 0;
406
+ this._editLevel = 0;
403
407
  this.recordDidChange(key);
404
408
  }
405
409
  return this ;
406
410
  },
407
-
411
+
408
412
  /**
409
413
  Reads the raw attribute from the underlying data hash. This method does
410
414
  not transform the underlying attribute at all.
411
-
415
+
412
416
  @param {String} key the attribute you want to read
413
417
  @returns {Object} the value of the key, or undefined if it doesn't exist
414
418
  */
415
419
  readAttribute: function(key) {
416
420
  var store = this.get('store'), storeKey = this.storeKey;
417
421
  var attrs = store.readDataHash(storeKey);
418
- return attrs ? attrs[key] : undefined ;
422
+ return attrs ? attrs[key] : undefined ;
419
423
  },
420
424
 
421
425
  /**
422
- Updates the passed attribute with the new value. This method does not
423
- transform the value at all. If instead you want to modify an array or
424
- hash already defined on the underlying json, you should instead get
426
+ Updates the passed attribute with the new value. This method does not
427
+ transform the value at all. If instead you want to modify an array or
428
+ hash already defined on the underlying json, you should instead get
425
429
  an editable version of the attribute using `editableAttribute()`.
426
-
430
+
427
431
  @param {String} key the attribute you want to read
428
432
  @param {Object} value the value you want to write
429
- @param {Boolean} ignoreDidChange only set if you do NOT want to flag
433
+ @param {Boolean} ignoreDidChange only set if you do NOT want to flag
430
434
  record as dirty
431
435
  @returns {SC.Record} receiver
432
436
  */
433
437
  writeAttribute: function(key, value, ignoreDidChange) {
434
- var store = this.get('store'),
438
+ var store = this.get('store'),
435
439
  storeKey = this.storeKey,
436
440
  attrs;
437
-
441
+
438
442
  attrs = store.readEditableDataHash(storeKey);
439
443
  if (!attrs) throw SC.Record.BAD_STATE_ERROR;
440
444
 
@@ -442,33 +446,33 @@ SC.Record = SC.Object.extend(
442
446
  if (value !== attrs[key]) {
443
447
  if(!ignoreDidChange) this.beginEditing();
444
448
  attrs[key] = value;
445
-
449
+
446
450
  // If the key is the primaryKey of the record, we need to tell the store
447
451
  // about the change.
448
452
  if (key===this.get('primaryKey')) {
449
453
  SC.Store.replaceIdFor(storeKey, value) ;
450
454
  this.propertyDidChange('id'); // Reset computed value
451
455
  }
452
-
456
+
453
457
  if(!ignoreDidChange) this.endEditing(key);
454
458
  }
455
459
  return this ;
456
460
  },
457
-
461
+
458
462
  /**
459
463
  This will also ensure that any aggregate records are also marked dirty
460
464
  if this record changes.
461
-
465
+
462
466
  Should not have to be called manually.
463
467
  */
464
468
  propagateToAggregates: function() {
465
469
  var storeKey = this.get('storeKey'),
466
- recordType = SC.Store.recordTypeFor(storeKey),
470
+ recordType = SC.Store.recordTypeFor(storeKey),
467
471
  idx, len, key, val, recs;
468
-
472
+
469
473
  var aggregates = recordType.aggregates;
470
-
471
- // if recordType aggregates are not set up yet, make sure to
474
+
475
+ // if recordType aggregates are not set up yet, make sure to
472
476
  // create the cache first
473
477
  if (!aggregates) {
474
478
  var dataHash = this.get('store').readDataHash(storeKey);
@@ -480,7 +484,7 @@ SC.Record = SC.Object.extend(
480
484
  }
481
485
  recordType.aggregates = aggregates;
482
486
  }
483
-
487
+
484
488
  // now loop through all aggregate properties and mark their related
485
489
  // record objects as dirty
486
490
  var K = SC.Record,
@@ -489,23 +493,23 @@ SC.Record = SC.Object.extend(
489
493
  destroyed = K.DESTROYED,
490
494
  readyClean = K.READY_CLEAN,
491
495
  iter;
492
-
496
+
493
497
  /**
494
498
  @private
495
-
499
+
496
500
  If the child is dirty, then make sure the parent gets a dirty
497
501
  status. (If the child is created or destroyed, there's no need,
498
502
  because the parent will dirty itself when it modifies that
499
503
  relationship.)
500
-
504
+
501
505
  @param {SC.Record} record to propagate to
502
506
  */
503
507
  iter = function(rec) {
504
508
  var childStatus, parentStatus;
505
-
506
- if (rec) {
509
+
510
+ if (rec) {
507
511
  childStatus = this.get('status');
508
- if ((childStatus & dirty) ||
512
+ if ((childStatus & dirty) ||
509
513
  (childStatus & readyNew) || (childStatus & destroyed)) {
510
514
  parentStatus = rec.get('status');
511
515
  if (parentStatus === readyClean) {
@@ -516,7 +520,7 @@ SC.Record = SC.Object.extend(
516
520
  }
517
521
  }
518
522
  };
519
-
523
+
520
524
  for(idx=0,len=aggregates.length;idx<len;++idx) {
521
525
  key = aggregates[idx];
522
526
  val = this.get(key);
@@ -524,12 +528,12 @@ SC.Record = SC.Object.extend(
524
528
  recs.forEach(iter, this);
525
529
  }
526
530
  },
527
-
531
+
528
532
  /**
529
533
  Called by the store whenever the underlying data hash has changed. This
530
534
  will notify any observers interested in data hash properties that they
531
535
  have changed.
532
-
536
+
533
537
  @param {Boolean} statusOnly changed
534
538
  @param {String} key that changed (optional)
535
539
  @returns {SC.Record} receiver
@@ -538,54 +542,54 @@ SC.Record = SC.Object.extend(
538
542
  // TODO: Should this function call propagateToAggregates() at the
539
543
  // appropriate times?
540
544
  if (statusOnly) this.notifyPropertyChange('status');
541
- else {
545
+ else {
542
546
  if (keys) {
543
547
  this.beginPropertyChanges();
544
548
  keys.forEach(function(k) { this.notifyPropertyChange(k); }, this);
545
- this.notifyPropertyChange('status');
549
+ this.notifyPropertyChange('status');
546
550
  this.endPropertyChanges();
547
551
 
548
- } else this.allPropertiesDidChange();
549
-
552
+ } else this.allPropertiesDidChange();
553
+
550
554
  // also notify manyArrays
551
555
  var manyArrays = this.relationships,
552
556
  loc = manyArrays ? manyArrays.length : 0 ;
553
- while(--loc>=0) manyArrays[loc].recordPropertyDidChange(keys);
557
+ while(--loc>=0) manyArrays[loc].recordPropertyDidChange(keys);
554
558
  }
555
559
  },
556
-
560
+
557
561
  /**
558
562
  Normalizing a record will ensure that the underlying hash conforms
559
- to the record attributes such as their types (transforms) and default
560
- values.
561
-
563
+ to the record attributes such as their types (transforms) and default
564
+ values.
565
+
562
566
  This method will write the conforming hash to the store and return
563
567
  the materialized record.
564
-
568
+
565
569
  By normalizing the record, you can use `.attributes()` and be
566
570
  assured that it will conform to the defined model. For example, this
567
571
  can be useful in the case where you need to send a JSON representation
568
572
  to some server after you have used `.createRecord()`, since this method
569
573
  will enforce the 'rules' in the model such as their types and default
570
- values. You can also include null values in the hash with the
574
+ values. You can also include null values in the hash with the
571
575
  includeNull argument.
572
-
576
+
573
577
  @param {Boolean} includeNull will write empty (null) attributes
574
578
  @returns {SC.Record} the normalized record
575
579
  */
576
-
577
- normalize: function(includeNull) {
578
- var primaryKey = this.primaryKey,
579
- recordId = this.get('id'),
580
- store = this.get('store'),
581
- storeKey = this.get('storeKey'),
580
+
581
+ normalize: function(includeNull) {
582
+ var primaryKey = this.primaryKey,
583
+ recordId = this.get('id'),
584
+ store = this.get('store'),
585
+ storeKey = this.get('storeKey'),
582
586
  key, valueForKey, typeClass, recHash, attrValue, normChild, isRecord,
583
587
  isChild, defaultVal, keyForDataHash, attr;
584
-
588
+
585
589
  var dataHash = store.readEditableDataHash(storeKey) || {};
586
590
  dataHash[primaryKey] = recordId;
587
591
  recHash = store.readDataHash(storeKey);
588
-
592
+
589
593
  for (key in this) {
590
594
  // make sure property is a record attribute.
591
595
  valueForKey = this[key];
@@ -605,7 +609,7 @@ SC.Record = SC.Object.extend(
605
609
  }
606
610
  dataHash[keyForDataHash] = attrValue;
607
611
  }
608
-
612
+
609
613
  } else if (isChild) {
610
614
  attrValue = this.get(key);
611
615
 
@@ -627,7 +631,7 @@ SC.Record = SC.Object.extend(
627
631
  if (SC.typeOf(defaultVal)===SC.T_FUNCTION) {
628
632
  dataHash[keyForDataHash] = defaultVal(this, key, defaultVal);
629
633
  } else {
630
- // plain value
634
+ // plain value
631
635
  dataHash[keyForDataHash] = defaultVal;
632
636
  }
633
637
  }
@@ -639,37 +643,37 @@ SC.Record = SC.Object.extend(
639
643
  return this;
640
644
  },
641
645
 
642
-
643
-
646
+
647
+
644
648
  /**
645
- If you try to get/set a property not defined by the record, then this
646
- method will be called. It will try to get the value from the set of
649
+ If you try to get/set a property not defined by the record, then this
650
+ method will be called. It will try to get the value from the set of
647
651
  attributes.
648
-
652
+
649
653
  This will also check is `ignoreUnknownProperties` is set on the recordType
650
654
  so that they will not be written to `dataHash` unless explicitly defined
651
655
  in the model schema.
652
-
656
+
653
657
  @param {String} key the attribute being get/set
654
658
  @param {Object} value the value to set the key to, if present
655
659
  @returns {Object} the value
656
660
  */
657
661
  unknownProperty: function(key, value) {
658
-
662
+
659
663
  if (value !== undefined) {
660
-
661
- // first check if we should ignore unknown properties for this
664
+
665
+ // first check if we should ignore unknown properties for this
662
666
  // recordType
663
667
  var storeKey = this.get('storeKey'),
664
668
  recordType = SC.Store.recordTypeFor(storeKey);
665
-
669
+
666
670
  if(recordType.ignoreUnknownProperties===YES) {
667
671
  this[key] = value;
668
672
  return value;
669
673
  }
670
-
671
- // if we're modifying the PKEY, then `SC.Store` needs to relocate where
672
- // this record is cached. store the old key, update the value, then let
674
+
675
+ // if we're modifying the PKEY, then `SC.Store` needs to relocate where
676
+ // this record is cached. store the old key, update the value, then let
673
677
  // the store do the housekeeping...
674
678
  var primaryKey = this.get('primaryKey');
675
679
  this.writeAttribute(key,value);
@@ -678,28 +682,28 @@ SC.Record = SC.Object.extend(
678
682
  if (key === primaryKey) {
679
683
  SC.Store.replaceIdFor(storeKey, value);
680
684
  }
681
-
685
+
682
686
  }
683
687
  return this.readAttribute(key);
684
688
  },
685
-
689
+
686
690
  /**
687
691
  Lets you commit this specific record to the store which will trigger
688
692
  the appropriate methods in the data source for you.
689
-
693
+
690
694
  @param {Hash} params optional additonal params that will passed down
691
695
  to the data source
692
696
  @param {boolean} recordOnly optional param if you want to only commit a single
693
697
  record if it has a parent.
694
- @param {Function} callback optional callback that the store will fire once the
698
+ @param {Function} callback optional callback that the store will fire once the
695
699
  datasource finished committing
696
700
  @returns {SC.Record} receiver
697
701
  */
698
- commitRecord: function(params, recordOnly, callback) {
702
+ commitRecord: function(params, recordOnly, callback) {
699
703
  var store = this.get('store'), rec, ro,
700
704
  sk = this.get('storeKey'),
701
705
  prKey = store.parentStoreKeyExists();
702
-
706
+
703
707
  // If we only want to commit this record or it doesn't have a parent record
704
708
  // we will commit this record
705
709
  ro = recordOnly || (SC.none(recordOnly) && SC.none(prKey));
@@ -711,15 +715,15 @@ SC.Record = SC.Object.extend(
711
715
  }
712
716
  return this ;
713
717
  },
714
-
718
+
715
719
  // ..........................................................
716
720
  // EMULATE SC.ERROR API
717
- //
718
-
721
+ //
722
+
719
723
  /**
720
724
  Returns `YES` whenever the status is SC.Record.ERROR. This will allow you
721
725
  to put the UI into an error state.
722
-
726
+
723
727
  @type Boolean
724
728
  @property
725
729
  @dependsOn status
@@ -731,7 +735,7 @@ SC.Record = SC.Object.extend(
731
735
  /**
732
736
  Returns the receiver if the record is in an error state. Returns null
733
737
  otherwise.
734
-
738
+
735
739
  @type SC.Record
736
740
  @property
737
741
  @dependsOn isError
@@ -739,11 +743,11 @@ SC.Record = SC.Object.extend(
739
743
  errorValue: function() {
740
744
  return this.get('isError') ? SC.val(this.get('errorObject')) : null ;
741
745
  }.property('isError').cacheable(),
742
-
746
+
743
747
  /**
744
748
  Returns the current error object only if the record is in an error state.
745
749
  If no explicit error object has been set, returns SC.Record.GENERIC_ERROR.
746
-
750
+
747
751
  @type SC.Error
748
752
  @property
749
753
  @dependsOn isError
@@ -754,11 +758,11 @@ SC.Record = SC.Object.extend(
754
758
  return store.readError(this.get('storeKey')) || SC.Record.GENERIC_ERROR;
755
759
  } else return null ;
756
760
  }.property('isError').cacheable(),
757
-
761
+
758
762
  // ...............................
759
763
  // PRIVATE
760
764
  //
761
-
765
+
762
766
  /** @private
763
767
  Sets the key equal to value.
764
768
 
@@ -781,35 +785,35 @@ SC.Record = SC.Object.extend(
781
785
 
782
786
  /** @private
783
787
  Creates string representation of record, with status.
784
-
788
+
785
789
  @returns {String}
786
790
  */
787
-
791
+
788
792
  toString: function() {
789
793
  // We won't use 'readOnlyAttributes' here because accessing them directly
790
794
  // avoids a SC.clone() -- we'll be careful not to edit anything.
791
795
  var attrs = this.get('store').readDataHash(this.get('storeKey'));
792
796
  return "%@(%@) %@".fmt(this.constructor.toString(), SC.inspect(attrs), this.statusString());
793
797
  },
794
-
798
+
795
799
  /** @private
796
800
  Creates string representation of record, with status.
797
-
801
+
798
802
  @returns {String}
799
803
  */
800
-
804
+
801
805
  statusString: function() {
802
806
  var ret = [], status = this.get('status');
803
-
807
+
804
808
  for(var prop in SC.Record) {
805
809
  if(prop.match(/[A-Z_]$/) && SC.Record[prop]===status) {
806
810
  ret.push(prop);
807
811
  }
808
812
  }
809
-
813
+
810
814
  return ret.join(" ");
811
815
  },
812
-
816
+
813
817
  /**
814
818
  Registers a child record with this parent record.
815
819
 
@@ -824,15 +828,15 @@ SC.Record = SC.Object.extend(
824
828
  */
825
829
  registerNestedRecord: function(value, key, path) {
826
830
  var store, psk, csk, childRecord, recordType;
827
-
831
+
828
832
  // if no path is entered it must be the key
829
833
  if (SC.none(path)) path = key;
830
- // if a record instance is passed, simply use the storeKey. This allows
834
+ // if a record instance is passed, simply use the storeKey. This allows
831
835
  // you to pass a record from a chained store to get the same record in the
832
836
  // current store.
833
837
  if (value && value.get && value.get('isRecord')) {
834
838
  childRecord = value;
835
- }
839
+ }
836
840
  else {
837
841
  recordType = this._materializeNestedRecordType(value, key);
838
842
  childRecord = this.createNestedRecord(recordType, value);
@@ -844,19 +848,19 @@ SC.Record = SC.Object.extend(
844
848
  csk = childRecord.get('storeKey');
845
849
  store.registerChildToParent(psk, csk, path);
846
850
  }
847
-
851
+
848
852
  return childRecord;
849
853
  },
850
-
854
+
851
855
  /**
852
856
  @private
853
-
857
+
854
858
  private method that retrieves the `recordType` from the hash that is
855
859
  provided.
856
860
 
857
861
  Important for use in polymorphism but you must have the following items
858
862
  in the parent record:
859
-
863
+
860
864
  `nestedRecordNamespace` <= this is the object that has the `SC.Records`
861
865
  defined
862
866
 
@@ -888,7 +892,7 @@ SC.Record = SC.Object.extend(
888
892
 
889
893
  return recordType;
890
894
  },
891
-
895
+
892
896
  /**
893
897
  Creates a new nested record instance.
894
898
 
@@ -901,12 +905,12 @@ SC.Record = SC.Object.extend(
901
905
  var store, id, sk, pk, cr = null, existingId = null;
902
906
  SC.run(function() {
903
907
  hash = hash || {}; // init if needed
904
-
908
+
905
909
  existingId = hash[recordType.prototype.primaryKey];
906
-
910
+
907
911
  store = this.get('store');
908
912
  if (SC.none(store)) throw 'Error: during the creation of a child record: NO STORE ON PARENT!';
909
-
913
+
910
914
  if (!id && (pk = recordType.prototype.primaryKey)) {
911
915
  id = hash[pk];
912
916
  // In case there isnt a primary key supplied then we create on
@@ -925,9 +929,9 @@ SC.Record = SC.Object.extend(
925
929
  hash[pk] = id;
926
930
  }
927
931
  }
928
-
932
+
929
933
  }
930
-
934
+
931
935
  // ID processing if necessary
932
936
  if (SC.none(existingId) && this.generateIdForChild) this.generateIdForChild(cr);
933
937
 
@@ -935,28 +939,28 @@ SC.Record = SC.Object.extend(
935
939
 
936
940
  return cr;
937
941
  },
938
-
942
+
939
943
  _nestedRecordKey: 0,
940
-
944
+
941
945
  /**
942
- Override this function if you want to have a special way of creating
946
+ Override this function if you want to have a special way of creating
943
947
  ids for your child records
944
-
948
+
945
949
  @param {SC.Record} childRecord
946
950
  @returns {String} the id generated
947
951
  */
948
952
  generateIdForChild: function(childRecord){}
949
-
953
+
950
954
  }) ;
951
955
 
952
956
  // Class Methods
953
- SC.Record.mixin( /** @scope SC.Record.prototype */ {
957
+ SC.Record.mixin( /** @scope SC.Record */ {
954
958
 
955
959
  /**
956
960
  Whether to ignore unknown properties when they are being set on the record
957
961
  object. This is useful if you want to strictly enforce the model schema
958
962
  and not allow dynamically expanding it by setting new unknown properties
959
-
963
+
960
964
  @static
961
965
  @type Boolean
962
966
  @default NO
@@ -965,13 +969,13 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
965
969
 
966
970
  // ..........................................................
967
971
  // CONSTANTS
968
- //
972
+ //
969
973
 
970
- /**
974
+ /**
971
975
  Generic state for records with no local changes.
972
-
976
+
973
977
  Use a logical AND (single `&`) to test record status
974
-
978
+
975
979
  @static
976
980
  @constant
977
981
  @type Number
@@ -979,25 +983,25 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
979
983
  */
980
984
  CLEAN: 0x0001, // 1
981
985
 
982
- /**
986
+ /**
983
987
  Generic state for records with local changes.
984
-
988
+
985
989
  Use a logical AND (single `&`) to test record status
986
-
990
+
987
991
  @static
988
992
  @constant
989
993
  @type Number
990
994
  @default 0x0002
991
995
  */
992
996
  DIRTY: 0x0002, // 2
993
-
994
- /**
995
- State for records that are still loaded.
996
-
997
- A record instance should never be in this state. You will only run into
998
- it when working with the low-level data hash API on `SC.Store`. Use a
997
+
998
+ /**
999
+ State for records that are still loaded.
1000
+
1001
+ A record instance should never be in this state. You will only run into
1002
+ it when working with the low-level data hash API on `SC.Store`. Use a
999
1003
  logical AND (single `&`) to test record status
1000
-
1004
+
1001
1005
  @static
1002
1006
  @constant
1003
1007
  @type Number
@@ -1005,23 +1009,23 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1005
1009
  */
1006
1010
  EMPTY: 0x0100, // 256
1007
1011
 
1008
- /**
1012
+ /**
1009
1013
  State for records in an error state.
1010
-
1014
+
1011
1015
  Use a logical AND (single `&`) to test record status
1012
-
1016
+
1013
1017
  @static
1014
1018
  @constant
1015
1019
  @type Number
1016
1020
  @default 0x1000
1017
1021
  */
1018
1022
  ERROR: 0x1000, // 4096
1019
-
1020
- /**
1023
+
1024
+ /**
1021
1025
  Generic state for records that are loaded and ready for use
1022
-
1026
+
1023
1027
  Use a logical AND (single `&`) to test record status
1024
-
1028
+
1025
1029
  @static
1026
1030
  @constant
1027
1031
  @type Number
@@ -1029,11 +1033,11 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1029
1033
  */
1030
1034
  READY: 0x0200, // 512
1031
1035
 
1032
- /**
1036
+ /**
1033
1037
  State for records that are loaded and ready for use with no local changes
1034
-
1038
+
1035
1039
  Use a logical AND (single `&`) to test record status
1036
-
1040
+
1037
1041
  @static
1038
1042
  @constant
1039
1043
  @type Number
@@ -1042,11 +1046,11 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1042
1046
  READY_CLEAN: 0x0201, // 513
1043
1047
 
1044
1048
 
1045
- /**
1049
+ /**
1046
1050
  State for records that are loaded and ready for use with local changes
1047
-
1051
+
1048
1052
  Use a logical AND (single `&`) to test record status
1049
-
1053
+
1050
1054
  @static
1051
1055
  @constant
1052
1056
  @type Number
@@ -1055,24 +1059,24 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1055
1059
  READY_DIRTY: 0x0202, // 514
1056
1060
 
1057
1061
 
1058
- /**
1062
+ /**
1059
1063
  State for records that are new - not yet committed to server
1060
-
1064
+
1061
1065
  Use a logical AND (single `&`) to test record status
1062
-
1066
+
1063
1067
  @static
1064
1068
  @constant
1065
1069
  @type Number
1066
1070
  @default 0x0203
1067
1071
  */
1068
1072
  READY_NEW: 0x0203, // 515
1069
-
1070
1073
 
1071
- /**
1074
+
1075
+ /**
1072
1076
  Generic state for records that have been destroyed
1073
-
1077
+
1074
1078
  Use a logical AND (single `&`) to test record status
1075
-
1079
+
1076
1080
  @static
1077
1081
  @constant
1078
1082
  @type Number
@@ -1081,11 +1085,11 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1081
1085
  DESTROYED: 0x0400, // 1024
1082
1086
 
1083
1087
 
1084
- /**
1088
+ /**
1085
1089
  State for records that have been destroyed and committed to server
1086
-
1090
+
1087
1091
  Use a logical AND (single `&`) to test record status
1088
-
1092
+
1089
1093
  @static
1090
1094
  @constant
1091
1095
  @type Number
@@ -1094,24 +1098,24 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1094
1098
  DESTROYED_CLEAN: 0x0401, // 1025
1095
1099
 
1096
1100
 
1097
- /**
1101
+ /**
1098
1102
  State for records that have been destroyed but not yet committed to server
1099
-
1103
+
1100
1104
  Use a logical AND (single `&`) to test record status
1101
-
1105
+
1102
1106
  @static
1103
1107
  @constant
1104
1108
  @type Number
1105
1109
  @default 0x0402
1106
1110
  */
1107
1111
  DESTROYED_DIRTY: 0x0402, // 1026
1108
-
1109
1112
 
1110
- /**
1113
+
1114
+ /**
1111
1115
  Generic state for records that have been submitted to data source
1112
-
1116
+
1113
1117
  Use a logical AND (single `&`) to test record status
1114
-
1118
+
1115
1119
  @static
1116
1120
  @constant
1117
1121
  @type Number
@@ -1120,11 +1124,11 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1120
1124
  BUSY: 0x0800, // 2048
1121
1125
 
1122
1126
 
1123
- /**
1127
+ /**
1124
1128
  State for records that are still loading data from the server
1125
-
1129
+
1126
1130
  Use a logical AND (single `&`) to test record status
1127
-
1131
+
1128
1132
  @static
1129
1133
  @constant
1130
1134
  @type Number
@@ -1133,12 +1137,12 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1133
1137
  BUSY_LOADING: 0x0804, // 2052
1134
1138
 
1135
1139
 
1136
- /**
1137
- State for new records that were created and submitted to the server;
1140
+ /**
1141
+ State for new records that were created and submitted to the server;
1138
1142
  waiting on response from server
1139
-
1143
+
1140
1144
  Use a logical AND (single `&`) to test record status
1141
-
1145
+
1142
1146
  @static
1143
1147
  @constant
1144
1148
  @type Number
@@ -1147,11 +1151,11 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1147
1151
  BUSY_CREATING: 0x0808, // 2056
1148
1152
 
1149
1153
 
1150
- /**
1154
+ /**
1151
1155
  State for records that have been modified and submitted to server
1152
-
1156
+
1153
1157
  Use a logical AND (single `&`) to test record status
1154
-
1158
+
1155
1159
  @static
1156
1160
  @constant
1157
1161
  @type Number
@@ -1160,11 +1164,11 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1160
1164
  BUSY_COMMITTING: 0x0810, // 2064
1161
1165
 
1162
1166
 
1163
- /**
1167
+ /**
1164
1168
  State for records that have requested a refresh from the server.
1165
-
1169
+
1166
1170
  Use a logical AND (single `&`) to test record status.
1167
-
1171
+
1168
1172
  @static
1169
1173
  @constant
1170
1174
  @type Number
@@ -1173,11 +1177,11 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1173
1177
  BUSY_REFRESH: 0x0820, // 2080
1174
1178
 
1175
1179
 
1176
- /**
1180
+ /**
1177
1181
  State for records that have requested a refresh from the server.
1178
-
1182
+
1179
1183
  Use a logical AND (single `&`) to test record status
1180
-
1184
+
1181
1185
  @static
1182
1186
  @constant
1183
1187
  @type Number
@@ -1185,11 +1189,11 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1185
1189
  */
1186
1190
  BUSY_REFRESH_CLEAN: 0x0821, // 2081
1187
1191
 
1188
- /**
1192
+ /**
1189
1193
  State for records that have requested a refresh from the server.
1190
-
1194
+
1191
1195
  Use a logical AND (single `&`) to test record status
1192
-
1196
+
1193
1197
  @static
1194
1198
  @constant
1195
1199
  @type Number
@@ -1197,11 +1201,11 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1197
1201
  */
1198
1202
  BUSY_REFRESH_DIRTY: 0x0822, // 2082
1199
1203
 
1200
- /**
1204
+ /**
1201
1205
  State for records that have been destroyed and submitted to server
1202
-
1206
+
1203
1207
  Use a logical AND (single `&`) to test record status
1204
-
1208
+
1205
1209
  @static
1206
1210
  @constant
1207
1211
  @type Number
@@ -1212,12 +1216,12 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1212
1216
 
1213
1217
  // ..........................................................
1214
1218
  // ERRORS
1215
- //
1216
-
1219
+ //
1220
+
1217
1221
  /**
1218
- Error for when you try to modify a record while it is in a bad
1222
+ Error for when you try to modify a record while it is in a bad
1219
1223
  state.
1220
-
1224
+
1221
1225
  @static
1222
1226
  @constant
1223
1227
  @type SC.Error
@@ -1226,7 +1230,7 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1226
1230
 
1227
1231
  /**
1228
1232
  Error for when you try to create a new record that already exists.
1229
-
1233
+
1230
1234
  @static
1231
1235
  @constant
1232
1236
  @type SC.Error
@@ -1235,7 +1239,7 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1235
1239
 
1236
1240
  /**
1237
1241
  Error for when you attempt to locate a record that is not found
1238
-
1242
+
1239
1243
  @static
1240
1244
  @constant
1241
1245
  @type SC.Error
@@ -1244,7 +1248,7 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1244
1248
 
1245
1249
  /**
1246
1250
  Error for when you try to modify a record that is currently busy
1247
-
1251
+
1248
1252
  @static
1249
1253
  @constant
1250
1254
  @type SC.Error
@@ -1253,54 +1257,54 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1253
1257
 
1254
1258
  /**
1255
1259
  Generic unknown record error
1256
-
1260
+
1257
1261
  @static
1258
1262
  @constant
1259
1263
  @type SC.Error
1260
1264
  */
1261
1265
  GENERIC_ERROR: SC.$error("Generic Error"),
1262
-
1266
+
1263
1267
  /**
1264
1268
  @private
1265
1269
  The next child key to allocate. A nextChildKey must always be greater than 0.
1266
1270
  */
1267
1271
  _nextChildKey: 0,
1268
-
1272
+
1269
1273
  // ..........................................................
1270
1274
  // CLASS METHODS
1271
- //
1272
-
1275
+ //
1276
+
1273
1277
  /**
1274
1278
  Helper method returns a new `SC.RecordAttribute` instance to map a simple
1275
- value or to-one relationship. At the very least, you should pass the
1279
+ value or to-one relationship. At the very least, you should pass the
1276
1280
  type class you expect the attribute to have. You may pass any additional
1277
1281
  options as well.
1278
-
1279
- Use this helper when you define SC.Record subclasses.
1280
-
1282
+
1283
+ Use this helper when you define SC.Record subclasses.
1284
+
1281
1285
  MyApp.Contact = SC.Record.extend({
1282
1286
  firstName: SC.Record.attr(String, { isRequired: YES })
1283
1287
  });
1284
-
1288
+
1285
1289
  @param {Class} type the attribute type
1286
1290
  @param {Hash} opts the options for the attribute
1287
1291
  @returns {SC.RecordAttribute} created instance
1288
1292
  */
1289
- attr: function(type, opts) {
1290
- return SC.RecordAttribute.attr(type, opts);
1293
+ attr: function(type, opts) {
1294
+ return SC.RecordAttribute.attr(type, opts);
1291
1295
  },
1292
-
1296
+
1293
1297
  /**
1294
- Returns an `SC.RecordAttribute` that describes a fetched attribute. When
1298
+ Returns an `SC.RecordAttribute` that describes a fetched attribute. When
1295
1299
  you reference this attribute, it will return an `SC.RecordArray` that uses
1296
1300
  the type as the fetch key and passes the attribute value as a param.
1297
-
1298
- Use this helper when you define SC.Record subclasses.
1299
-
1301
+
1302
+ Use this helper when you define SC.Record subclasses.
1303
+
1300
1304
  MyApp.Group = SC.Record.extend({
1301
1305
  contacts: SC.Record.fetch('MyApp.Contact')
1302
1306
  });
1303
-
1307
+
1304
1308
  @param {SC.Record|String} recordType The type of records to load
1305
1309
  @param {Hash} opts the options for the attribute
1306
1310
  @returns {SC.RecordAttribute} created instance
@@ -1308,22 +1312,22 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1308
1312
  fetch: function(recordType, opts) {
1309
1313
  return SC.FetchedAttribute.attr(recordType, opts) ;
1310
1314
  },
1311
-
1315
+
1312
1316
  /**
1313
1317
  Will return one of the following:
1314
-
1315
- 1. `SC.ManyAttribute` that describes a record array backed by an
1316
- array of guids stored in the underlying JSON.
1318
+
1319
+ 1. `SC.ManyAttribute` that describes a record array backed by an
1320
+ array of guids stored in the underlying JSON.
1317
1321
  2. `SC.ChildrenAttribute` that describes a record array backed by a
1318
1322
  array of hashes.
1319
-
1323
+
1320
1324
  You can edit the contents of this relationship.
1321
-
1322
- For `SC.ManyAttribute`, If you set the inverse and `isMaster: NO` key,
1323
- then editing this array will modify the underlying data, but the
1324
- inverse key on the matching record will also be edited and that
1325
+
1326
+ For `SC.ManyAttribute`, If you set the inverse and `isMaster: NO` key,
1327
+ then editing this array will modify the underlying data, but the
1328
+ inverse key on the matching record will also be edited and that
1325
1329
  record will be marked as needing a change.
1326
-
1330
+
1327
1331
  @param {SC.Record|String} recordType The type of record to create
1328
1332
  @param {Hash} opts the options for the attribute
1329
1333
  @returns {SC.ManyAttribute|SC.ChildrenAttribute} created instance
@@ -1340,16 +1344,16 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1340
1344
  }
1341
1345
  return attr;
1342
1346
  },
1343
-
1347
+
1344
1348
  /**
1345
1349
  Will return one of the following:
1346
-
1350
+
1347
1351
  1. `SC.SingleAttribute` that converts the underlying ID to a single
1348
1352
  record. If you modify this property, it will rewrite the underyling
1349
1353
  ID. It will also modify the inverse of the relationship, if you set it.
1350
1354
  2. `SC.ChildAttribute` that you can edit the contents
1351
1355
  of this relationship.
1352
-
1356
+
1353
1357
  @param {SC.Record|String} recordType the type of the record to create
1354
1358
  @param {Hash} opts additional options
1355
1359
  @returns {SC.SingleAttribute|SC.ChildAttribute} created instance
@@ -1366,12 +1370,12 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1366
1370
  }
1367
1371
  return attr;
1368
1372
  },
1369
-
1373
+
1370
1374
  /**
1371
1375
  Returns all storeKeys mapped by Id for this record type. This method is
1372
1376
  used mostly by the `SC.Store` and the Record to coordinate. You will rarely
1373
1377
  need to call this method yourself.
1374
-
1378
+
1375
1379
  @returns {Hash}
1376
1380
  */
1377
1381
  storeKeysById: function() {
@@ -1380,50 +1384,50 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1380
1384
  if (!ret) ret = this[key] = {};
1381
1385
  return ret;
1382
1386
  },
1383
-
1387
+
1384
1388
  /**
1385
1389
  Given a primaryKey value for the record, returns the associated
1386
- storeKey. If the primaryKey has not been assigned a storeKey yet, it
1390
+ storeKey. If the primaryKey has not been assigned a storeKey yet, it
1387
1391
  will be added.
1388
-
1389
- For the inverse of this method see `SC.Store.idFor()` and
1392
+
1393
+ For the inverse of this method see `SC.Store.idFor()` and
1390
1394
  `SC.Store.recordTypeFor()`.
1391
-
1395
+
1392
1396
  @param {String} id a record id
1393
1397
  @returns {Number} a storeKey.
1394
1398
  */
1395
1399
  storeKeyFor: function(id) {
1396
1400
  var storeKeys = this.storeKeysById(),
1397
1401
  ret = storeKeys[id];
1398
-
1402
+
1399
1403
  if (!ret) {
1400
1404
  ret = SC.Store.generateStoreKey();
1401
1405
  SC.Store.idsByStoreKey[ret] = id ;
1402
1406
  SC.Store.recordTypesByStoreKey[ret] = this ;
1403
1407
  storeKeys[id] = ret ;
1404
1408
  }
1405
-
1409
+
1406
1410
  return ret ;
1407
1411
  },
1408
-
1412
+
1409
1413
  /**
1410
1414
  Given a primaryKey value for the record, returns the associated
1411
1415
  storeKey. As opposed to `storeKeyFor()` however, this method
1412
1416
  will NOT generate a new storeKey but returned undefined.
1413
-
1417
+
1414
1418
  @param {String} id a record id
1415
1419
  @returns {Number} a storeKey.
1416
1420
  */
1417
1421
  storeKeyExists: function(id) {
1418
1422
  var storeKeys = this.storeKeysById(),
1419
1423
  ret = storeKeys[id];
1420
-
1424
+
1421
1425
  return ret ;
1422
1426
  },
1423
1427
 
1424
- /**
1428
+ /**
1425
1429
  Returns a record with the named ID in store.
1426
-
1430
+
1427
1431
  @param {SC.Store} store the store
1428
1432
  @param {String} id the record id or a query
1429
1433
  @returns {SC.Record} record instance
@@ -1431,7 +1435,7 @@ SC.Record.mixin( /** @scope SC.Record.prototype */ {
1431
1435
  find: function(store, id) {
1432
1436
  return store.find(this, id);
1433
1437
  },
1434
-
1438
+
1435
1439
  /** @private - enhance extend to notify SC.Query as well. */
1436
1440
  extend: function() {
1437
1441
  var ret = SC.Object.extend.apply(this, arguments);