sproutcore 1.5.0.pre.3 → 1.5.0.pre.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. data/.rspec +1 -0
  2. data/CHANGELOG +42 -0
  3. data/README.txt +25 -0
  4. data/VERSION.yml +1 -1
  5. data/bin/sc-build +1 -1
  6. data/bin/sc-build-number +1 -1
  7. data/bin/sc-docs +1 -1
  8. data/bin/sc-gen +1 -1
  9. data/bin/sc-init +1 -1
  10. data/bin/sc-manifest +1 -1
  11. data/bin/sc-server +1 -1
  12. data/bin/sproutcore +1 -1
  13. data/lib/buildtasks/build.rake +5 -0
  14. data/lib/buildtasks/manifest.rake +20 -1
  15. data/lib/frameworks/sproutcore/Buildfile +12 -9
  16. data/lib/frameworks/sproutcore/CHANGELOG.md +48 -0
  17. data/lib/frameworks/sproutcore/apps/greenhouse/README +2 -9
  18. data/lib/frameworks/sproutcore/apps/greenhouse/TODO +11 -27
  19. data/lib/frameworks/sproutcore/apps/greenhouse/controllers/library.js +3 -10
  20. data/lib/frameworks/sproutcore/apps/greenhouse/english.lproj/css/main-page.css +4 -31
  21. data/lib/frameworks/sproutcore/apps/greenhouse/english.lproj/dialogs.js +5 -4
  22. data/lib/frameworks/sproutcore/apps/greenhouse/models/dir.js +3 -3
  23. data/lib/frameworks/sproutcore/apps/greenhouse/models/file.js +2 -2
  24. data/lib/frameworks/sproutcore/apps/greenhouse/states/main.js +31 -14
  25. data/lib/frameworks/sproutcore/apps/greenhouse/states/modals.js +2 -1
  26. data/lib/frameworks/sproutcore/apps/greenhouse/states/ready.js +27 -1
  27. data/lib/frameworks/sproutcore/apps/greenhouse/tests/views/list_item.js +1 -0
  28. data/lib/frameworks/sproutcore/apps/greenhouse/tests/views/plist_item.js +20 -0
  29. data/lib/frameworks/sproutcore/apps/greenhouse/theme.js +25 -0
  30. data/lib/frameworks/sproutcore/apps/greenhouse/views/plist_item.js +161 -24
  31. data/lib/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js +1 -1
  32. data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +37 -25
  33. data/lib/frameworks/sproutcore/frameworks/bootstrap/tests/system/browser.js +135 -26
  34. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/controllers/array.js +0 -0
  35. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/controllers/controller.js +0 -0
  36. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/controllers/object.js +1 -1
  37. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/core.js +0 -0
  38. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/ext/object.js +0 -0
  39. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/ext/run_loop.js +1 -0
  40. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/mixins/delegate_support.js +0 -0
  41. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/mixins/responder_context.js +0 -0
  42. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/mixins/selection_support.js +0 -0
  43. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/mixins/string.js +0 -0
  44. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/keyboard.js +68 -0
  45. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/layout.js +108 -0
  46. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/panes/main.js +2 -2
  47. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/manipulation.js +27 -0
  48. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/panes/pane.js +215 -505
  49. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/template.js +24 -0
  50. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/visibility.js +11 -0
  51. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/protocols/observable_protocol.js +0 -0
  52. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/protocols/sparse_array_delegate.js +0 -0
  53. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/resources/core.css +0 -0
  54. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/resources/view.css +0 -0
  55. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/application.js +0 -0
  56. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/browser.js +1 -0
  57. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/builder.js +0 -0
  58. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/core_query.js +1 -1
  59. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/cursor.js +0 -0
  60. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/device.js +210 -0
  61. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/event.js +5 -5
  62. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/json.js +0 -0
  63. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/locale.js +0 -0
  64. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/page.js +0 -0
  65. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/platform.js +31 -5
  66. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/ready.js +1 -1
  67. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/render_context.js +0 -0
  68. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/responder.js +0 -0
  69. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/root_responder.js +83 -110
  70. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/selection_set.js +7 -4
  71. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/sparse_array.js +0 -0
  72. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/theme.js +0 -0
  73. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/timer.js +0 -0
  74. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/system/utils/rect.js +0 -0
  75. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +151 -0
  76. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/array/array_case.js +0 -0
  77. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/array/enum_case.js +0 -0
  78. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/array/null_case.js +0 -0
  79. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/array/selection_support.js +26 -0
  80. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/array/single_case.js +0 -0
  81. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/object/empty_case.js +0 -0
  82. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/object/multiple_case.js +0 -0
  83. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/object/single_case.js +0 -0
  84. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/controllers/object/single_enumerable_case.js +0 -0
  85. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/mixins/responder_context.js +0 -0
  86. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/mixins/string.js +0 -0
  87. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/panes/template.js +14 -0
  88. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/builder.js +0 -0
  89. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/core_query/within.js +0 -0
  90. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/json.js +0 -0
  91. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/locale.js +0 -0
  92. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/begin.js +0 -0
  93. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/element.js +0 -0
  94. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/end.js +0 -0
  95. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/get.js +0 -0
  96. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/helpers_attr.js +0 -0
  97. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/helpers_basic.js +0 -0
  98. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/helpers_className.js +0 -0
  99. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/helpers_style.js +0 -0
  100. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/init.js +0 -0
  101. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/join.js +0 -0
  102. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/push_text.js +0 -0
  103. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/tag.js +0 -0
  104. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/render_context/update.js +0 -0
  105. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/root_responder/makeKeyPane.js +0 -0
  106. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/root_responder/makeMainPane.js +0 -0
  107. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/root_responder/makeMenuPane.js +0 -0
  108. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/root_responder/root_responder.js +0 -0
  109. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/root_responder/targetForAction.js +0 -0
  110. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/selection_set/add.js +0 -0
  111. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/selection_set/copy.js +0 -0
  112. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/selection_set/indexSetForSource.js +0 -0
  113. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/selection_set/isEqual.js +0 -0
  114. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/selection_set/remove.js +0 -0
  115. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/sparse_array.js +0 -0
  116. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/theme.js +0 -0
  117. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/timer/invalidate.js +0 -0
  118. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/timer/invokeLater.js +0 -0
  119. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/timer/isPaused.js +0 -0
  120. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/timer/performAction.js +0 -0
  121. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/timer/schedule.js +0 -0
  122. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/utils/normalizeURL.js +0 -0
  123. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/utils/offset.js +268 -0
  124. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/system/utils/rect.js +0 -0
  125. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/main_pane.js +43 -0
  126. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/pane/append_remove.js +107 -18
  127. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/child_view.js +20 -0
  128. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/pane/firstResponder.js +0 -0
  129. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/pane/keyPane.js +0 -0
  130. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/pane/layout.js +0 -0
  131. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/pane/sendEvent.js +0 -0
  132. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/checkbox_support.js +32 -0
  133. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/text_field_support.js +73 -0
  134. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template_view/collection.js +65 -0
  135. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template_view/core.js +67 -0
  136. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template_view/handlebars.js +295 -0
  137. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/animation.js +19 -18
  138. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/build.js +0 -0
  139. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/build_children.js +0 -0
  140. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/clippingFrame.js +0 -0
  141. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/convertFrames.js +0 -0
  142. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/convertLayouts.js +0 -0
  143. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/createChildViews.js +18 -15
  144. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/createLayer.js +0 -0
  145. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/destroyLayer.js +0 -0
  146. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/didAppendToDocument.js +11 -8
  147. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/findLayerInParentLayer.js +0 -0
  148. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/init.js +0 -0
  149. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/insertBefore.js +0 -0
  150. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/isVisible.js +28 -0
  151. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/isVisibleInWindow.js +0 -0
  152. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js +22 -0
  153. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/layer.js +0 -0
  154. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/layoutChildViews.js +0 -0
  155. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js +180 -0
  156. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +640 -0
  157. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/parentViewDidChange.js +0 -0
  158. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/prepareContext.js +0 -0
  159. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/removeChild.js +0 -0
  160. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/render.js +125 -0
  161. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/render_delegate_support.js +0 -0
  162. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/replaceChild.js +0 -0
  163. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/static_layout.js +21 -0
  164. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/theme.js +0 -0
  165. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/updateLayer.js +0 -0
  166. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/updateLayerLocation.js +0 -0
  167. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/view.js +0 -0
  168. data/lib/frameworks/sproutcore/frameworks/{amber → core_foundation}/tests/views/view/viewDidResize.js +0 -0
  169. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template/checkbox_support.js +20 -0
  170. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template/collection.js +99 -0
  171. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template/text_field_support.js +35 -0
  172. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template.js +77 -0
  173. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +187 -0
  174. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/base.js +1 -0
  175. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/cursor.js +41 -0
  176. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +57 -0
  177. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/keyboard.js +223 -0
  178. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +1150 -0
  179. data/lib/frameworks/sproutcore/frameworks/{amber/views → core_foundation/views/view}/layout_style.js +93 -1
  180. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +489 -0
  181. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +362 -0
  182. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/touch.js +67 -0
  183. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/visibility.js +113 -0
  184. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +1280 -0
  185. data/lib/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +27 -53
  186. data/lib/frameworks/sproutcore/frameworks/datastore/models/children_attribute.js +13 -19
  187. data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +1 -0
  188. data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +183 -71
  189. data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +1 -2
  190. data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +26 -46
  191. data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +25 -4
  192. data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +139 -21
  193. data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +6 -1
  194. data/lib/frameworks/sproutcore/frameworks/datastore/tests/integration/cyclical_relationship.js +1 -1
  195. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/{parentless.js → data_store.js} +62 -16
  196. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js +51 -17
  197. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +36 -10
  198. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array_complex.js +11 -11
  199. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_complex.js +8 -8
  200. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +2 -2
  201. data/lib/frameworks/sproutcore/frameworks/{foundation/english.lproj → datetime/resources}/strings.js +1 -0
  202. data/lib/frameworks/sproutcore/frameworks/{foundation → datetime}/system/datetime.js +5 -37
  203. data/lib/frameworks/sproutcore/frameworks/{foundation → datetime}/tests/system/datetime.js +1 -0
  204. data/lib/frameworks/sproutcore/frameworks/debug/core.js +1 -1
  205. data/lib/frameworks/sproutcore/frameworks/designer/controllers/designs.js +1 -2
  206. data/lib/frameworks/sproutcore/frameworks/designer/designers/object_designer.js +3 -3
  207. data/lib/frameworks/sproutcore/frameworks/designer/designers/view_designer.js +3 -3
  208. data/lib/frameworks/sproutcore/frameworks/designer/views/designer_drop_target.js +9 -3
  209. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/segmented.css +71 -70
  210. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +10 -2
  211. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segment.js +4 -19
  212. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segmented.js +33 -14
  213. data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +25 -0
  214. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/ui.js +1 -1
  215. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +25 -103
  216. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +102 -92
  217. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +22 -25
  218. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +38 -25
  219. data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +1 -1
  220. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +1 -1
  221. data/lib/frameworks/sproutcore/frameworks/desktop/views/segment.js +42 -22
  222. data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +513 -230
  223. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +0 -2
  224. data/lib/frameworks/sproutcore/frameworks/experimental/README.md +23 -0
  225. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/README.md +11 -0
  226. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/device.js +215 -0
  227. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js +67 -0
  228. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/README.md +34 -0
  229. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/polymorphic_single_attribute.js +183 -0
  230. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +23 -0
  231. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/tests/models/polymorphic/single.js +124 -0
  232. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +0 -2
  233. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inner_frame.js +151 -0
  234. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +27 -17
  235. data/lib/frameworks/sproutcore/frameworks/foundation/system/image_queue.js +6 -3
  236. data/lib/frameworks/sproutcore/frameworks/foundation/system/logger.js +163 -0
  237. data/lib/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +6 -3
  238. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +1 -0
  239. data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/logger.js +44 -0
  240. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +200 -167
  241. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +1 -1
  242. data/lib/frameworks/sproutcore/frameworks/foundation/views/image.js +52 -137
  243. data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +7 -11
  244. data/lib/frameworks/sproutcore/frameworks/handlebars/extensions.js +138 -0
  245. data/lib/frameworks/sproutcore/frameworks/handlebars/handlebars.js +1338 -0
  246. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +32 -26
  247. data/lib/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +162 -3
  248. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +10 -5
  249. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +123 -3
  250. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +12 -5
  251. data/lib/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +50 -13
  252. data/lib/frameworks/sproutcore/frameworks/runtime/system/logger.js +163 -333
  253. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +58 -8
  254. data/lib/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +2 -0
  255. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +9 -6
  256. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/makeArray.js +15 -1
  257. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +2 -0
  258. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/chained.js +31 -0
  259. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +18 -0
  260. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/logger.js +31 -143
  261. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/concatenated_properties.js +71 -0
  262. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/enhance.js +177 -0
  263. data/lib/frameworks/sproutcore/frameworks/table/views/table.js +5 -4
  264. data/lib/frameworks/sproutcore/frameworks/table/views/table_header.js +5 -3
  265. data/lib/frameworks/sproutcore/themes/ace/resources/button/button.js +8 -2
  266. data/lib/frameworks/sproutcore/themes/ace/resources/menu/menu.css +2 -3
  267. data/lib/frameworks/sproutcore/themes/ace/resources/segmented/18px/segmented.css +1 -1
  268. data/lib/frameworks/sproutcore/themes/ace/resources/segmented/24px/segmented.css +1 -1
  269. data/lib/frameworks/sproutcore/themes/ace/resources/segmented/30px/segmented.css +1 -1
  270. data/lib/frameworks/sproutcore/themes/ace/resources/segmented/44px/segmented.css +1 -1
  271. data/lib/frameworks/sproutcore/themes/ace/resources/segmented/segmented.css +2 -2
  272. data/lib/frameworks/sproutcore/themes/standard_theme/english.lproj/segmented.css +62 -62
  273. data/lib/gen/html_app/Buildfile +36 -0
  274. data/lib/gen/html_app/README +1 -0
  275. data/lib/gen/html_app/USAGE +15 -0
  276. data/lib/gen/html_app/templates/apps/@target_name@/@target_name@.js +14 -0
  277. data/lib/gen/html_app/templates/apps/@target_name@/resources/images/.gitkeep +0 -0
  278. data/lib/gen/html_app/templates/apps/@target_name@/resources/stylesheets/@target_name@.css +0 -0
  279. data/lib/gen/html_app/templates/apps/@target_name@/resources/templates/@target_name@.handlebars +1 -0
  280. data/lib/gen/html_project/Buildfile +45 -0
  281. data/lib/gen/html_project/INIT +3 -0
  282. data/lib/gen/html_project/README +1 -0
  283. data/lib/gen/html_project/USAGE +2 -0
  284. data/lib/gen/html_project/templates/@filename@/Buildfile +8 -0
  285. data/lib/gen/html_project/templates/@filename@/README +7 -0
  286. data/lib/sproutcore/builders/handlebars.rb +30 -0
  287. data/lib/sproutcore/builders.rb +1 -1
  288. data/lib/sproutcore/helpers/static_helper.rb +3 -3
  289. data/lib/sproutcore/tools/init.rb +25 -9
  290. data/spec/buildtasks/manifest/prepare_build_tasks/handlebars_spec.rb +39 -0
  291. data/spec/fixtures/builder_tests/apps/handlebars_test/template.handlebars +5 -0
  292. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/templates/demo.handlebars +4 -0
  293. data/spec/lib/builders/handlebars_spec.rb +29 -0
  294. data/vendor/chance/lib/chance/imagers/data_url.rb +20 -7
  295. data/vendor/chance/lib/chance/instance.rb +4 -1
  296. data/vendor/chance/lib/chance/parser.rb +31 -31
  297. data/vendor/chance/lib/chance/slicing.rb +38 -8
  298. metadata +195 -225
  299. data/lib/frameworks/sproutcore/frameworks/amber/system/device.js +0 -143
  300. data/lib/frameworks/sproutcore/frameworks/amber/system/utils.js +0 -174
  301. data/lib/frameworks/sproutcore/frameworks/amber/tests/views/main_pane.js +0 -31
  302. data/lib/frameworks/sproutcore/frameworks/amber/tests/views/pane/sendTouchEvent.js +0 -267
  303. data/lib/frameworks/sproutcore/frameworks/amber/tests/views/view/layoutDidChange.js +0 -149
  304. data/lib/frameworks/sproutcore/frameworks/amber/tests/views/view/layoutStyle.js +0 -602
  305. data/lib/frameworks/sproutcore/frameworks/amber/tests/views/view/render.js +0 -115
  306. data/lib/frameworks/sproutcore/frameworks/amber/views/base.js +0 -1
  307. data/lib/frameworks/sproutcore/frameworks/amber/views/view.js +0 -4003
  308. data/lib/frameworks/sproutcore/frameworks/datastore/models/child_record.js +0 -105
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Nested Records (SC.ChildRecord) Unit Test
2
+ * Nested Records (SC.Record) Unit Test
3
3
  *
4
4
  * @author Evin Grano
5
5
  */
@@ -12,13 +12,13 @@ var NestedRecord, store, testParent, testParent2, childData1;
12
12
  var initModels = function(){
13
13
  NestedRecord.ParentRecordTest = SC.Record.extend({
14
14
  /** Child Record Namespace */
15
- childRecordNamespace: NestedRecord,
15
+ nestedRecordNamespace: NestedRecord,
16
16
 
17
17
  name: SC.Record.attr(String),
18
18
  info: SC.Record.toOne('NestedRecord.ChildRecordTest', { nested: true })
19
19
  });
20
20
 
21
- NestedRecord.ChildRecordTest = SC.ChildRecord.extend({
21
+ NestedRecord.ChildRecordTest = SC.Record.extend({
22
22
  id: SC.Record.attr(String),
23
23
  name: SC.Record.attr(String),
24
24
  value: SC.Record.attr(String)
@@ -44,7 +44,7 @@ module("Basic SC.Record Functions w/ Parent > Child", {
44
44
  type: 'ChildRecordTest',
45
45
  name: 'Child Name',
46
46
  value: 'Blue Goo',
47
- id: '5001'
47
+ guid: '5001'
48
48
  }
49
49
  });
50
50
  // Test parent 2
@@ -54,7 +54,7 @@ module("Basic SC.Record Functions w/ Parent > Child", {
54
54
  type: 'ChildRecordTest',
55
55
  name: 'Child Name 2',
56
56
  value: 'Purple Goo',
57
- id: '5002'
57
+ guid: '5002'
58
58
  }
59
59
  });
60
60
  SC.RunLoop.end();
@@ -67,7 +67,7 @@ module("Basic SC.Record Functions w/ Parent > Child", {
67
67
  type: 'ChildRecordTest',
68
68
  name: 'Child Name',
69
69
  value: 'Green Goo',
70
- id: '5002'
70
+ guid: '5002'
71
71
  };
72
72
  },
73
73
 
@@ -92,7 +92,7 @@ test("Function: readAttribute()", function() {
92
92
  type: 'ChildRecordTest',
93
93
  name: 'Child Name',
94
94
  value: 'Blue Goo',
95
- id: '5001'
95
+ guid: '5001'
96
96
  },
97
97
  "readAttribute should be correct for info child attribute");
98
98
 
@@ -105,7 +105,7 @@ test("Support Multiple Parent Records With Different Child Records", function()
105
105
  type: 'ChildRecordTest',
106
106
  name: 'Child Name 2',
107
107
  value: 'Purple Goo',
108
- id: '5002'
108
+ guid: '5002'
109
109
  },
110
110
  "readAttribute should be correct for info child attribute on new record");
111
111
  equals(testParent2.get('info').get('value'), 'Purple Goo', "get should retrieve the proper value on new record");
@@ -115,7 +115,7 @@ test("Support Multiple Parent Records With Different Child Records", function()
115
115
  type: 'ChildRecordTest',
116
116
  name: 'Child Name',
117
117
  value: 'Blue Goo',
118
- id: '5001'
118
+ guid: '5001'
119
119
  },
120
120
  "readAttribute should be correct for info child attribute on first record");
121
121
  equals(testParent.get('info').get('value'), 'Blue Goo', "get should retrieve the proper value on first record");
@@ -152,7 +152,7 @@ test("Basic Read", function() {
152
152
  // Test Child Record creation
153
153
  var cr = testParent.get('info');
154
154
  // Check Model Class information
155
- ok(SC.kindOf(cr, SC.ChildRecord), "get() creates an actual instance that is a kind of a SC.ChildRecord Object");
155
+ ok(SC.kindOf(cr, SC.Record), "get() creates an actual instance that is a kind of a SC.Record Object");
156
156
  ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest), "get() creates an actual instance of a ChildRecordTest Object");
157
157
 
158
158
  // Check reference information
@@ -171,13 +171,9 @@ test("Basic Read", function() {
171
171
  var oldKey = cr.get(pm), newKey = sameCR.get(pm);
172
172
  equals(oldKey, newKey, "check to see if the Primary Key are the same");
173
173
  same(sameCR, cr, "check to see that it is the same child record as before");
174
-
175
- // ID check
176
- id = sameCR.get('id');
177
- ok((id !== oldKey), "if there is an id param, it should be different from the Primary Key: %@ != %@".fmt(id, oldKey));
178
174
  });
179
175
 
180
- test("Basic Write", function() {
176
+ test("Basic Write As a Hash", function() {
181
177
 
182
178
  // Test general gets
183
179
  testParent.set('name', 'New Parent Name');
@@ -190,11 +186,12 @@ test("Basic Write", function() {
190
186
  testParent.set('info', {
191
187
  type: 'ChildRecordTest',
192
188
  name: 'New Child Name',
193
- value: 'Red Goo'
189
+ value: 'Red Goo',
190
+ guid: '6001'
194
191
  });
195
192
  var cr = testParent.get('info');
196
193
  // Check Model Class information
197
- ok(SC.kindOf(cr, SC.ChildRecord), "set() with an object creates an actual instance that is a kind of a SC.ChildRecord Object");
194
+ ok(SC.kindOf(cr, SC.Record), "set() with an object creates an actual instance that is a kind of a SC.Record Object");
198
195
  ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest), "set() with an object creates an actual instance of a ChildRecordTest Object");
199
196
 
200
197
  // Check reference information
@@ -216,6 +213,43 @@ test("Basic Write", function() {
216
213
  same(testParent.readAttribute('info'), cr.get('attributes'), "after a set('name', <new>) on child, readAttribute on the parent should be correct for info child attributes");
217
214
  });
218
215
 
216
+ test("Basic Write As a Child Record", function() {
217
+
218
+ // Test general gets
219
+ testParent.set('name', 'New Parent Name');
220
+ equals(testParent.get('name'), 'New Parent Name', "set() should change name attribute");
221
+ testParent.set('nothing', 'nothing');
222
+ equals(testParent.get('nothing'), 'nothing', "set should change non-existent property to a new property");
223
+
224
+ // Test Child Record creation
225
+ var store = testParent.get('store');
226
+ var cr = store.createRecord(NestedRecord.ChildRecordTest, {type: 'ChildRecordTest', name: 'New Child Name', value: 'Red Goo', guid: '6001'});
227
+ // Check Model Class information
228
+ ok(SC.kindOf(cr, SC.Record), "before the set(), check for actual instance that is a kind of a SC.Record Object");
229
+ ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest), "before the set(), check for actual instance of a ChildRecordTest Object");
230
+ testParent.set('info', cr);
231
+ cr = testParent.get('info');
232
+ // Check Model Class information
233
+ ok(SC.kindOf(cr, SC.Record), "set() with an object creates an actual instance that is a kind of a SC.Record Object");
234
+ ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest), "set() with an object creates an actual instance of a ChildRecordTest Object");
235
+
236
+ // Check reference information
237
+ var pm = cr.get('primaryKey');
238
+ var key = cr.get(pm);
239
+ var storeRef = store.find(NestedRecord.ChildRecordTest, key);
240
+ ok(storeRef, 'after a set() with an object, checking that the store has the instance of the child record with proper primary key');
241
+ equals(cr, storeRef, "after a set with an object, checking the parent reference is the same as the direct store reference");
242
+
243
+ // Check for changes on the child bubble to the parent.
244
+ cr.set('name', 'Child Name Change');
245
+ equals(cr.get('name'), 'Child Name Change', "after a set('name', <new>) on child, checking that the value is updated");
246
+ ok(cr.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
247
+ ok(testParent.get('status') & SC.Record.DIRTY, 'check that the parent record is dirty');
248
+ var newCR = testParent.get('info');
249
+ same(newCR, cr, "after a set('name', <new>) on child, checking to see that the parent has recieved the changes from the child record");
250
+ same(testParent.readAttribute('info'), cr.get('attributes'), "after a set('name', <new>) on child, readAttribute on the parent should be correct for info child attributes");
251
+ });
252
+
219
253
  test("Child Status Changed", function() {
220
254
  var cr;
221
255
  cr = testParent.get('info');
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Nested Record Array of SC.ChildRecords Unit Test
2
+ * Nested Record Array of SC.Records Unit Test
3
3
  *
4
4
  * @author Evin Grano
5
5
  */
@@ -12,18 +12,18 @@ var NestedRecord, store, testParent, testParent2;
12
12
  var initModels = function(){
13
13
  NestedRecord.ParentRecordTest = SC.Record.extend({
14
14
  /** Child Record Namespace */
15
- childRecordNamespace: NestedRecord,
15
+ nestedRecordNamespace: NestedRecord,
16
16
 
17
17
  name: SC.Record.attr(String),
18
- elements: SC.Record.toMany('SC.ChildRecord', { nested: true })
18
+ elements: SC.Record.toMany('SC.Record', { nested: true })
19
19
  });
20
20
 
21
- NestedRecord.ChildRecordTest1 = SC.ChildRecord.extend({
21
+ NestedRecord.ChildRecordTest1 = SC.Record.extend({
22
22
  name: SC.Record.attr(String),
23
23
  value: SC.Record.attr(String)
24
24
  });
25
25
 
26
- NestedRecord.ChildRecordTest2 = SC.ChildRecord.extend({
26
+ NestedRecord.ChildRecordTest2 = SC.Record.extend({
27
27
  name: SC.Record.attr(String),
28
28
  info: SC.Record.attr(String),
29
29
  value: SC.Record.attr(String)
@@ -160,7 +160,7 @@ test("Basic Read", function() {
160
160
  ok(SC.instanceOf(arrayOfCRs, SC.ChildArray), "check that get() creates an actual instance of a SC.ChildArray");
161
161
  equals(arrayOfCRs.get('length'), 4, "check that the length of the array of child records is 4");
162
162
  var cr = arrayOfCRs.objectAt(0);
163
- ok(SC.kindOf(cr, SC.ChildRecord), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.ChildRecord Object");
163
+ ok(SC.kindOf(cr, SC.Record), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.Record Object");
164
164
  ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest1), "check that first ChildRecord from the get() creates an actual instance of a ChildRecordTest1 Object");
165
165
 
166
166
  // Check reference information
@@ -209,7 +209,7 @@ test("Basic Write", function() {
209
209
  equals(newArray.get('length'), 3, "after set() on parent, check that the length of the array of child records is 3");
210
210
  var cr = newArray.objectAt(0);
211
211
 
212
- ok(SC.kindOf(cr, SC.ChildRecord), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.ChildRecord Object");
212
+ ok(SC.kindOf(cr, SC.Record), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.Record Object");
213
213
  ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest1), "check that first ChildRecord from the get() creates an actual instance of a ChildRecordTest1 Object");
214
214
  });
215
215
 
@@ -241,7 +241,7 @@ test("Basic Write: reference tests", function() {
241
241
  same(readAttrsArray[0], newCR.get('attributes'), "after a set('name', <new>) on child, readAttribute on the parent should be correct for info child attributes");
242
242
  });
243
243
 
244
- test("Basic Array Functionality: pushObject", function() {
244
+ test("Basic Array Functionality: pushObject w/ HASH", function() {
245
245
  var elements, elementsAttrs, cr, crFirst, crLast;
246
246
  // Add something to the array
247
247
  elements = testParent.get('elements');
@@ -250,7 +250,7 @@ test("Basic Array Functionality: pushObject", function() {
250
250
  elements = testParent.get('elements');
251
251
  equals(elements.get('length'), 5, "after pushObject() on parent, check that the length of the array of child records is 5");
252
252
  cr = elements.objectAt(4);
253
- ok(SC.kindOf(cr, SC.ChildRecord), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.ChildRecord Object");
253
+ ok(SC.kindOf(cr, SC.Record), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.Record Object");
254
254
  ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest1), "check that newly added ChildRecord creates an actual instance of a ChildRecordTest1 Object");
255
255
  equals(cr.get('name'), 'Testikles', "after a pushObject on parent, check to see if it has all the right values for the attributes");
256
256
  ok(cr.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
@@ -265,6 +265,32 @@ test("Basic Array Functionality: pushObject", function() {
265
265
  same(elementsAttrs[4], crLast, "verify that parent attributes are the same as the last individual child attributes");
266
266
  });
267
267
 
268
+ test("Basic Array Functionality: pushObject w/ ChildRecord", function() {
269
+ var elements, elementsAttrs, cr, crFirst, crLast;
270
+ // Add something to the array
271
+ elements = testParent.get('elements');
272
+ // PushObject Tests
273
+ cr = store.createRecord(NestedRecord.ChildRecordTest1, { type: 'ChildRecordTest1', name: 'Testikles', value: 'God Of Fertility'});
274
+ elements.pushObject(cr);
275
+ elements = testParent.get('elements');
276
+ equals(elements.get('length'), 5, "after pushObject() on parent, check that the length of the array of child records is 5");
277
+ cr = elements.objectAt(4);
278
+ ok(SC.kindOf(cr, SC.Record), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.Record Object");
279
+ ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest1), "check that newly added ChildRecord creates an actual instance of a ChildRecordTest1 Object");
280
+ equals(cr.get('name'), 'Testikles', "after a pushObject on parent, check to see if it has all the right values for the attributes");
281
+ ok(cr.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
282
+ ok(testParent.get('status') & SC.Record.DIRTY, 'check that the parent record is dirty');
283
+
284
+ // Verify the Attrs
285
+ elementsAttrs = testParent.readAttribute('elements');
286
+ equals(elementsAttrs.length, 5, "after pushObject() on parent, check that the length of the attribute array of child records is 5");
287
+ crFirst = elements.objectAt(0).get('attributes');
288
+ crLast = elements.objectAt(4).get('attributes');
289
+ same(elementsAttrs[0], crFirst, "verify that parent attributes are the same as the first individual child attributes");
290
+ same(elementsAttrs[4], crLast, "verify that parent attributes are the same as the last individual child attributes");
291
+ });
292
+
293
+
268
294
  test("Basic Array Functionality: popObject", function() {
269
295
  var elements, elementsAttrs, cr, crFirst, crLast;
270
296
  // Add something to the array
@@ -304,7 +330,7 @@ test("Basic Array Functionality: unshiftObject", function() {
304
330
  elements = testParent.get('elements');
305
331
  equals(elements.get('length'), 5, "after pushObject() on parent, check that the length of the array of child records is 5");
306
332
  cr = elements.objectAt(0);
307
- ok(SC.kindOf(cr, SC.ChildRecord), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.ChildRecord Object");
333
+ ok(SC.kindOf(cr, SC.Record), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.Record Object");
308
334
  ok(SC.instanceOf(cr, NestedRecord.ChildRecordTest1), "check that newly added ChildRecord creates an actual instance of a ChildRecordTest1 Object");
309
335
  equals(cr.get('name'), 'Testikles', "after a pushObject on parent, check to see if it has all the right values for the attributes");
310
336
  ok(cr.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
@@ -12,21 +12,21 @@ var NestedRecord, store, testParent, peopleData1, peopleData2, personData1, addr
12
12
  var initModels = function(){
13
13
  NestedRecord.Group = SC.Record.extend({
14
14
  /** Child Record Namespace */
15
- childRecordNamespace: NestedRecord,
15
+ nestedRecordNamespace: NestedRecord,
16
16
 
17
17
  name: SC.Record.attr(String),
18
18
  people: SC.Record.toMany('NestedRecord.Person', { nested: true })
19
19
  });
20
20
 
21
- NestedRecord.Person = SC.ChildRecord.extend({
21
+ NestedRecord.Person = SC.Record.extend({
22
22
  /** Child Record Namespace */
23
- childRecordNamespace: NestedRecord,
23
+ nestedRecordNamespace: NestedRecord,
24
24
 
25
25
  name: SC.Record.attr(String),
26
26
  addresses: SC.Record.toMany('NestedRecord.Address', { nested: true })
27
27
  });
28
28
 
29
- NestedRecord.Address = SC.ChildRecord.extend({
29
+ NestedRecord.Address = SC.Record.extend({
30
30
  street: SC.Record.attr(String),
31
31
  city: SC.Record.attr(String),
32
32
  state: SC.Record.attr(String, {defaultValue: "VA"})
@@ -36,7 +36,7 @@ var initModels = function(){
36
36
  // ..........................................................
37
37
  // Basic SC.ParentRecord with an Array of Children
38
38
  //
39
- module("Complex SC.ChildRecord: Parent > Array of Children > Array of Children", {
39
+ module("Complex SC.Record: Parent > Array of Children > Array of Children", {
40
40
 
41
41
  setup: function() {
42
42
  NestedRecord = SC.Object.create({
@@ -184,7 +184,7 @@ test("Basic Read, Testing the First Child Array", function() {
184
184
  ok(SC.instanceOf(ppl, SC.ChildArray), "check that get() creates an actual instance of a SC.ChildArray");
185
185
  equals(ppl.get('length'), 3, "check that the length of the array of child records is 3");
186
186
  p = ppl.objectAt(0);
187
- ok(SC.kindOf(p, SC.ChildRecord), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.ChildRecord Object");
187
+ ok(SC.kindOf(p, SC.Record), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.Record Object");
188
188
  ok(SC.instanceOf(p, NestedRecord.Person), "check that first ChildRecord from the get() creates an actual instance of a Person Object");
189
189
 
190
190
  // Check reference information
@@ -225,7 +225,7 @@ test("Basic Read, Testing the Second Child Array", function() {
225
225
  ok(SC.instanceOf(addrs, SC.ChildArray), "check that get() creates an actual instance of a SC.ChildArray");
226
226
  equals(addrs.get('length'), 2, "check that the length of the array of child records is 2");
227
227
  a = addrs.objectAt(0);
228
- ok(SC.kindOf(a, SC.ChildRecord), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.ChildRecord Object");
228
+ ok(SC.kindOf(a, SC.Record), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.Record Object");
229
229
  ok(SC.instanceOf(a, NestedRecord.Address), "check that first ChildRecord from the get() creates an actual instance of a Address Object");
230
230
 
231
231
  // Check reference information
@@ -269,7 +269,7 @@ test("Basic Write: Testing the First Child Array", function() {
269
269
  ok(SC.instanceOf(ppl, SC.ChildArray), "check that get() creates an actual instance of a SC.ChildArray");
270
270
  equals(ppl.get('length'), 2, "after set() on parent, check that the length of the array of child records is 2");
271
271
  p = ppl.objectAt(0);
272
- ok(SC.kindOf(p, SC.ChildRecord), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.ChildRecord Object");
272
+ ok(SC.kindOf(p, SC.Record), "check that first ChildRecord from the get() creates an actual instance that is a kind of a SC.Record Object");
273
273
  ok(SC.instanceOf(p, NestedRecord.Person), "check that first ChildRecord from the get() creates an actual instance of a Person Object");
274
274
 
275
275
  // TODO: [EG] Add test to make sure the number of ChildRecords in store is correct when we add store recored clearing
@@ -329,7 +329,7 @@ test("Basic Array Functionality: pushObject", function() {
329
329
  ppl = testParent.get('people');
330
330
  equals(ppl.get('length'), 4, "after pushObject() on parent, check that the length of the array of child records is 4");
331
331
  p = ppl.objectAt(3);
332
- ok(SC.kindOf(p, SC.ChildRecord), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.ChildRecord Object");
332
+ ok(SC.kindOf(p, SC.Record), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.Record Object");
333
333
  ok(SC.instanceOf(p, NestedRecord.Person), "check that newly added ChildRecord creates an actual instance of a Person Object");
334
334
  equals(p.get('name'), 'Testikles, God Of Fertility', "after a pushObject on parent, check to see if it has all the right values for the attributes");
335
335
  ok(p.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
@@ -353,7 +353,7 @@ test("Basic Array Functionality: popObject", function() {
353
353
  ppl = testParent.get('people');
354
354
  equals(ppl.get('length'), 2, "after popObject() on parent, check that the length of the array of child records is 2");
355
355
  p = ppl.objectAt(0);
356
- ok(SC.kindOf(p, SC.ChildRecord), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.ChildRecord Object");
356
+ ok(SC.kindOf(p, SC.Record), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.Record Object");
357
357
  ok(SC.instanceOf(p, NestedRecord.Person), "check that newly added ChildRecord creates an actual instance of a Person Object");
358
358
  equals(p.get('name'), 'Barack Obama', "after a pushObject on parent, check to see if it has all the right values for the attributes");
359
359
  ok(p.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
@@ -390,7 +390,7 @@ test("Basic Array Functionality: unshiftObject", function() {
390
390
  ppl = testParent.get('people');
391
391
  equals(ppl.get('length'), 4, "after unshiftObject() on parent, check that the length of the array of child records is 4");
392
392
  p = ppl.objectAt(0);
393
- ok(SC.kindOf(p, SC.ChildRecord), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.ChildRecord Object");
393
+ ok(SC.kindOf(p, SC.Record), "check that newly added ChildRecord creates an actual instance that is a kind of a SC.Record Object");
394
394
  ok(SC.instanceOf(p, NestedRecord.Person), "check that newly added ChildRecord creates an actual instance of a Person Object");
395
395
  equals(p.get('name'), 'Testikles, God Of Fertility', "after a pushObject on parent, check to see if it has all the right values for the attributes");
396
396
  ok(p.get('status') & SC.Record.DIRTY, 'check that the child record is dirty');
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Complex Nested Records (SC.ChildRecord) Unit Test
2
+ * Complex Nested Records (SC.Record) Unit Test
3
3
  *
4
4
  * @author Evin Grano
5
5
  */
@@ -10,15 +10,15 @@
10
10
  var NestedRecord, store, testParent;
11
11
 
12
12
  var initModels = function(){
13
- NestedRecord.Address = SC.ChildRecord.extend({
13
+ NestedRecord.Address = SC.Record.extend({
14
14
  street: SC.Record.attr(String),
15
15
  city: SC.Record.attr(String),
16
16
  state: SC.Record.attr(String, {defaultValue: 'VA'})
17
17
  });
18
18
 
19
- NestedRecord.Person = SC.ChildRecord.extend({
19
+ NestedRecord.Person = SC.Record.extend({
20
20
  /** Child Record Namespace */
21
- childRecordNamespace: NestedRecord,
21
+ nestedRecordNamespace: NestedRecord,
22
22
 
23
23
  name: SC.Record.attr(String),
24
24
  address: SC.Record.toOne('NestedRecord.Address', { nested: true })
@@ -26,7 +26,7 @@ var initModels = function(){
26
26
 
27
27
  NestedRecord.ParentRecordTest = SC.Record.extend({
28
28
  /** Child Record Namespace */
29
- childRecordNamespace: NestedRecord,
29
+ nestedRecordNamespace: NestedRecord,
30
30
 
31
31
  name: SC.Record.attr(String),
32
32
  person: SC.Record.toOne('NestedRecord.Person', { nested: true })
@@ -209,7 +209,7 @@ function() {
209
209
  // Test Child Record creation
210
210
  var p = testParent.get('person');
211
211
  // Check Model Class information
212
- ok(SC.kindOf(p, SC.ChildRecord), "(parent > child).get() creates an actual instance that is a kind of a SC.ChildRecord Object");
212
+ ok(SC.kindOf(p, SC.Record), "(parent > child).get() creates an actual instance that is a kind of a SC.Record Object");
213
213
  ok(SC.instanceOf(p, NestedRecord.Person), "(parent > child).get() creates an actual instance of a Person Object");
214
214
 
215
215
  // Check reference information
@@ -222,7 +222,7 @@ function() {
222
222
 
223
223
  var a = testParent.getPath('person.address');
224
224
  // Check Model Class information
225
- ok(SC.kindOf(a, SC.ChildRecord), "(parent > child > child) w/ getPath() creates an actual instance that is a kind of a SC.ChildRecord Object");
225
+ ok(SC.kindOf(a, SC.Record), "(parent > child > child) w/ getPath() creates an actual instance that is a kind of a SC.Record Object");
226
226
  ok(SC.instanceOf(a, NestedRecord.Address), "(parent > child > child) w/ getPath() creates an actual instance of an Address Object");
227
227
 
228
228
  // Check reference information
@@ -257,7 +257,7 @@ function() {
257
257
  });
258
258
  p = testParent.get('person');
259
259
  // Check Model Class information
260
- ok(SC.kindOf(p, SC.ChildRecord), "set() with an object creates an actual instance that is a kind of a SC.ChildRecord Object");
260
+ ok(SC.kindOf(p, SC.Record), "set() with an object creates an actual instance that is a kind of a SC.Record Object");
261
261
  ok(SC.instanceOf(p, NestedRecord.Person), "set() with an object creates an actual instance of a ChildRecordTest Object");
262
262
 
263
263
  // Check reference information
@@ -57,12 +57,12 @@ module("SC.Record normalize method", {
57
57
 
58
58
  // A parent record
59
59
  MyApp.FooParent = SC.Record.extend({
60
- childRecordNamespace: MyApp,
60
+ nestedRecordNamespace: MyApp,
61
61
  myChild: SC.ChildAttribute.attr('MyApp.FooChild')
62
62
  });
63
63
 
64
64
  // A child record
65
- MyApp.FooChild = SC.ChildRecord.extend({
65
+ MyApp.FooChild = SC.Record.extend({
66
66
  });
67
67
 
68
68
  MyApp.Bar = SC.Record.extend({
@@ -11,3 +11,4 @@ SC.stringsFor('English', {
11
11
  '_SC.DateTime.monthNames': 'January February March April May June July August September October November December',
12
12
  '_SC.DateTime.abbreviatedMonthNames': 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'
13
13
  }) ;
14
+
@@ -310,6 +310,7 @@ SC.DateTime = SC.Object.extend(SC.Freezable, SC.Copyable,
310
310
  - %M - Minute of the hour (00..59)
311
311
  - %p - Meridian indicator (``AM'' or ``PM'')
312
312
  - %S - Second of the minute (00..60)
313
+ - %s - Milliseconds of the second (000..999)
313
314
  - %U - Week number of the current year,
314
315
  starting with the first Sunday as the first
315
316
  day of the first week (00..53)
@@ -901,7 +902,7 @@ SC.DateTime.mixin(SC.Comparable,
901
902
  parse: function(str, fmt) {
902
903
  // Declared as an object not a literal since in some browsers the literal
903
904
  // retains state across function calls
904
- var re = new RegExp('(?:%([aAbBcdHIjmMpSUWwxXyYZ%])|(.))', "g");
905
+ var re = new RegExp('(?:%([aAbBcdHIjmMpsSUWwxXyYZ%])|(.))', "g");
905
906
  var d, parts, opts = {}, check = {}, scanner = SC.Scanner.create({string: str});
906
907
 
907
908
  if (SC.none(fmt)) fmt = SC.DATETIME_ISO8601;
@@ -922,6 +923,7 @@ SC.DateTime.mixin(SC.Comparable,
922
923
  case 'M': opts.minute = scanner.scanInt(1, 2); break;
923
924
  case 'p': opts.meridian = scanner.scanArray(['AM', 'PM']); break;
924
925
  case 'S': opts.second = scanner.scanInt(1, 2); break;
926
+ case 's': opts.millisecond = scanner.scanInt(1, 3); break;
925
927
  case 'U': throw "%U is not implemented";
926
928
  case 'W': throw "%W is not implemented";
927
929
  case 'w': throw "%w is not implemented";
@@ -1013,6 +1015,7 @@ SC.DateTime.mixin(SC.Comparable,
1013
1015
  case 'M': return this._pad(this._get('minute'));
1014
1016
  case 'p': return this._get('hour') > 11 ? 'PM' : 'AM';
1015
1017
  case 'S': return this._pad(this._get('second'));
1018
+ case 's': return this._pad(this._get('millisecond'), 3);
1016
1019
  case 'u': return this._pad(this._get('utc')); //utc
1017
1020
  case 'U': return this._pad(this._get('week0'));
1018
1021
  case 'W': return this._pad(this._get('week1'));
@@ -1041,7 +1044,7 @@ SC.DateTime.mixin(SC.Comparable,
1041
1044
  // need to move into local time zone for these calculations
1042
1045
  this._setCalcState(start - (timezone * 60000), 0); // so simulate a shifted 'UTC' time
1043
1046
 
1044
- return format.replace(/\%([aAbBcdDHiIjmMpSUWwxXyYZ\%])/g, function() {
1047
+ return format.replace(/\%([aAbBcdDHiIjmMpsSUWwxXyYZ\%])/g, function() {
1045
1048
  var v = that.__toFormattedString.call(that, arguments, start, timezone);
1046
1049
  return v;
1047
1050
  });
@@ -1103,38 +1106,3 @@ SC.Binding.dateTime = function(format) {
1103
1106
  return value ? value.toFormattedString(format) : null;
1104
1107
  });
1105
1108
  };
1106
-
1107
- if (SC.RecordAttribute && !SC.RecordAttribute.transforms[SC.guidFor(SC.DateTime)]) {
1108
-
1109
- /**
1110
- Registers a transform to allow SC.DateTime to be used as a record attribute,
1111
- ie SC.Record.attr(SC.DateTime);
1112
-
1113
- Because SC.RecordAttribute is in the datastore framework and SC.DateTime in
1114
- the foundation framework, and we don't know which framework is being loaded
1115
- first, this chunck of code is duplicated in both frameworks.
1116
-
1117
- IF YOU EDIT THIS CODE MAKE SURE YOU COPY YOUR CHANGES to record_attribute.js.
1118
- */
1119
- SC.RecordAttribute.registerTransform(SC.DateTime, {
1120
-
1121
- /** @private
1122
- Convert a String to a DateTime
1123
- */
1124
- to: function(str, attr) {
1125
- if (SC.none(str) || SC.instanceOf(str, SC.DateTime)) return str;
1126
- var format = attr.get('format');
1127
- return SC.DateTime.parse(str, format ? format : SC.DateTime.recordFormat);
1128
- },
1129
-
1130
- /** @private
1131
- Convert a DateTime to a String
1132
- */
1133
- from: function(dt, attr) {
1134
- if (SC.none(dt)) return dt;
1135
- var format = attr.get('format');
1136
- return dt.toFormattedString(format ? format : SC.DateTime.recordFormat);
1137
- }
1138
- });
1139
-
1140
- }
@@ -2,6 +2,7 @@
2
2
  // Project: DateTime Unit Test
3
3
  // Copyright: ©2010 Martin Ottenwaelter
4
4
  // ==========================================================================
5
+
5
6
  /*globals module test ok equals same stop start */
6
7
 
7
8
  module('Time');
@@ -14,7 +14,7 @@ SC._mapDisplayNamesUseHashForSeenTypes = ['object', 'number', 'boolean', 'array'
14
14
 
15
15
 
16
16
  SC.mapDisplayNames = function(obj, level, path, seenHash, seenArray) {
17
- if (!SC.browser.safari) return ;
17
+ if (!SC.browser.webkit) return ;
18
18
 
19
19
  // Lazily instantiate the hash of types we'll use a hash for the "have we
20
20
  // seen this before?" structure. (Some types are not safe to put in a hash
@@ -20,8 +20,7 @@ SC.designsController = SC.ArrayController.create(SC.CollectionViewDelegate,
20
20
 
21
21
  for(var v in page){
22
22
  if(page.hasOwnProperty(v)){
23
- if(page[v] && page[v].kindOf){
24
-
23
+ if(v !== '__sc_super__' && page[v] && page[v].kindOf){
25
24
  if(page[v].kindOf(iframe.SC.Pane)){
26
25
  designs.push(SC.Object.create({type: 'pane', view: page.get(v), name: v}));
27
26
  }
@@ -252,7 +252,7 @@ SC.ObjectDesigner.mixin({
252
252
  didLoadDesign: function(designedObject, sourceObject, attrs) {
253
253
  designedObject.isDesign = YES ; // indicates that we need a designer.
254
254
  designedObject.designAttrs = attrs;
255
- designedObject.sourceObject = sourceObject;
255
+ //designedObject.sourceObject = sourceObject; TODO: don't need this..
256
256
  },
257
257
 
258
258
  /**
@@ -287,8 +287,8 @@ SC.ObjectDesigner.mixin({
287
287
  object.designer = DesignerClass.create({
288
288
  object: object,
289
289
  objectClass: design,
290
- designAttrs: origDesign.designAttrs,
291
- sourceObject: origDesign.sourceObject
290
+ designAttrs: origDesign.designAttrs
291
+ //sourceObject: origDesign.sourceObject TODO: don't need this
292
292
  });
293
293
  }
294
294
  }
@@ -1135,7 +1135,7 @@ SC.ViewDesigner.mixin({
1135
1135
  didLoadDesign: function(designedView, sourceView, attrs) {
1136
1136
  designedView.isDesign = YES ; // indicates that we need a designer.
1137
1137
  designedView.designAttrs = attrs;
1138
- designedView.sourceView = sourceView;
1138
+ //designedView.sourceView = sourceView; TODO: not sure we need this...
1139
1139
  },
1140
1140
 
1141
1141
  /**
@@ -1170,8 +1170,8 @@ SC.ViewDesigner.mixin({
1170
1170
  view.designer = DesignerClass.create({
1171
1171
  view: view,
1172
1172
  viewClass: design,
1173
- designAttrs: origDesign.designAttrs,
1174
- sourceView: origDesign.sourceView
1173
+ designAttrs: origDesign.designAttrs
1174
+ //sourceView: origDesign.sourceView TODO: not sure we need this...
1175
1175
  });
1176
1176
  }
1177
1177
  }
@@ -14,6 +14,8 @@
14
14
  SC.DesignerDropTarget = SC.ContainerView.extend(
15
15
  /** @scope SC.DesignerDropTarget.prototype */ {
16
16
 
17
+ inGlobalOffset: YES,
18
+
17
19
  // ..........................................................
18
20
  // Key Events
19
21
  //
@@ -106,7 +108,7 @@ SC.DesignerDropTarget = SC.ContainerView.extend(
106
108
  var data = drag.dataForType('SC.Object'),
107
109
  cv = this.get('contentView'),
108
110
  loc = drag.get('location'),
109
- frame = drag.iframeFrame,
111
+ iframeOffset = drag.globalTargetOffset,
110
112
  design, size, newView, defaults, layout;
111
113
  var page = cv.get('page');
112
114
  var designController = page.get('designController'),
@@ -115,13 +117,17 @@ SC.DesignerDropTarget = SC.ContainerView.extend(
115
117
  //TODO: [MB] should we move most of this into the designer's addView?
116
118
  //size and location
117
119
  size = data.get('size');
118
- loc.x = loc.x - frame.x - rootDesignerFrame.x;
119
- loc.y = loc.y - frame.y - rootDesignerFrame.y;
120
+ loc.x = loc.x - iframeOffset.x - rootDesignerFrame.x;
121
+ loc.y = loc.y - iframeOffset.y - rootDesignerFrame.y;
120
122
  //setup design (use eval to make sure code comes from iframe)
123
+ //TODO use new Function("return "+data.get('scClass))() ?...
121
124
  design = eval(data.get('scClass'));
122
125
  defaults = data.get('defaults') || {};
123
126
  layout = defaults.layout || {};
124
127
  layout = SC.merge(layout, {top: loc.y, left: loc.x});
128
+ //pull width and height from ghost if none exists form defaults
129
+ if(!layout.width) layout.width = drag.getPath('ghostView.layout').width;
130
+ if(!layout.height) layout.height = drag.getPath('ghostView.layout').height;
125
131
  defaults.layout = layout;
126
132
  design = design.design(defaults);
127
133
  //drop it in the root designer