sproutcore 1.6.0.beta.3 → 1.6.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (280) hide show
  1. data/CHANGELOG +33 -0
  2. data/Rakefile +213 -10
  3. data/VERSION.yml +1 -1
  4. data/lib/Buildfile +5 -1
  5. data/lib/buildtasks/manifest.rake +7 -1
  6. data/lib/frameworks/sproutcore/Buildfile +3 -2
  7. data/lib/frameworks/sproutcore/CHANGELOG.md +154 -1
  8. data/lib/frameworks/sproutcore/README.md +1 -1
  9. data/lib/frameworks/sproutcore/apps/welcome/english.lproj/main_page.css +9 -0
  10. data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +254 -207
  11. data/lib/frameworks/sproutcore/frameworks/ajax/system/response.js +243 -172
  12. data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/request.js +29 -0
  13. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +5 -0
  14. data/lib/frameworks/sproutcore/frameworks/core_foundation/controls/button.js +6 -2
  15. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/bind.js +36 -14
  16. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/collection.js +3 -3
  17. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +14 -15
  18. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/template.js +14 -14
  19. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/application.js +2 -7
  20. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +3 -3
  21. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +2 -2
  22. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/responder.js +1 -1
  23. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +20 -12
  24. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/string.js +61 -0
  25. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +20 -6
  26. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +42 -0
  27. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controls/button.js +39 -57
  28. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_style.js +5 -3
  29. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +32 -0
  30. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/collection.js +25 -0
  31. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +28 -17
  32. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js +396 -0
  33. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +1 -1
  34. data/lib/frameworks/sproutcore/frameworks/core_foundation/{system → views}/bindable_span.js +2 -1
  35. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +78 -51
  36. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +4 -3
  37. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +2 -1
  38. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/keyboard.js +233 -67
  39. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +3 -1
  40. data/lib/frameworks/sproutcore/frameworks/core_tools/core.js +8 -2
  41. data/lib/frameworks/sproutcore/frameworks/core_tools/data_source.js +1 -1
  42. data/lib/frameworks/sproutcore/frameworks/core_tools/models/target.js +1 -1
  43. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +15 -8
  44. data/lib/frameworks/sproutcore/frameworks/datastore/models/child_record.js +2 -2
  45. data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +1 -0
  46. data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +3 -2
  47. data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +66 -55
  48. data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/data_source.js +190 -0
  49. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +21 -0
  50. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +15 -1
  51. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +0 -1
  52. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +212 -182
  53. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +14 -16
  54. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +1 -1
  55. data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +23 -11
  56. data/lib/frameworks/sproutcore/frameworks/desktop/resources/alert.css +49 -0
  57. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/debug/a_sample_image.jpg +0 -0
  58. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/debug/apple-logo1.jpeg +0 -0
  59. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/debug/iframe.html +0 -0
  60. data/lib/frameworks/sproutcore/frameworks/desktop/resources/disclosure.css +20 -0
  61. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/drag.css +1 -1
  62. data/lib/frameworks/sproutcore/frameworks/desktop/resources/icons.css +214 -0
  63. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/cap.png +0 -0
  64. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/downbutton.png +0 -0
  65. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-alert-16.png +0 -0
  66. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-alert-24.png +0 -0
  67. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-alert-48.png +0 -0
  68. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-bookmark-16.png +0 -0
  69. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-bookmark-24.png +0 -0
  70. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-cancel-24.png +0 -0
  71. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-document-16.png +0 -0
  72. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-document-24.png +0 -0
  73. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-down-24.png +0 -0
  74. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-error-48.png +0 -0
  75. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-favorite-16.png +0 -0
  76. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-favorite-24.png +0 -0
  77. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-folder-16.png +0 -0
  78. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-folder-24.png +0 -0
  79. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-group-16.png +0 -0
  80. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-group-24.png +0 -0
  81. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-help-16.png +0 -0
  82. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-help-24.png +0 -0
  83. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-info-16.png +0 -0
  84. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-info-24.png +0 -0
  85. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-info-48.png +0 -0
  86. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-left-24.png +0 -0
  87. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-options-16.png +0 -0
  88. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-options-24.png +0 -0
  89. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-redo-24.png +0 -0
  90. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-right-24.png +0 -0
  91. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-tools-24.png +0 -0
  92. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-trash-16.png +0 -0
  93. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-trash-24.png +0 -0
  94. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-undo-24.png +0 -0
  95. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-up-24.png +0 -0
  96. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-user-16.png +0 -0
  97. data/lib/frameworks/sproutcore/frameworks/desktop/resources/images/icons/sc-icon-user-24.png +0 -0
  98. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/thumb-bottom.png +0 -0
  99. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/thumb-center.png +0 -0
  100. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/thumb-top.png +0 -0
  101. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/track.png +0 -0
  102. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/images/upbutton.png +0 -0
  103. data/lib/frameworks/sproutcore/frameworks/desktop/resources/list_item.css +145 -0
  104. data/lib/frameworks/sproutcore/frameworks/desktop/resources/menu.css +10 -0
  105. data/lib/frameworks/sproutcore/frameworks/desktop/resources/menu_item_view.css +88 -0
  106. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/modal.css +3 -4
  107. data/lib/frameworks/sproutcore/frameworks/desktop/resources/panel.css +91 -0
  108. data/lib/frameworks/sproutcore/frameworks/desktop/resources/picker.css +37 -0
  109. data/lib/frameworks/sproutcore/frameworks/desktop/resources/progress.css +29 -0
  110. data/lib/frameworks/sproutcore/frameworks/desktop/resources/radio.css +11 -0
  111. data/lib/frameworks/sproutcore/frameworks/desktop/resources/segmented.css +121 -0
  112. data/lib/frameworks/sproutcore/frameworks/desktop/resources/separator.css +20 -0
  113. data/lib/frameworks/sproutcore/frameworks/desktop/resources/slider.css +34 -0
  114. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/split.css +0 -0
  115. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/split_divider.css +0 -0
  116. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/tab.css +0 -0
  117. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/toolbar.css +0 -0
  118. data/lib/frameworks/sproutcore/frameworks/desktop/{english.lproj → resources}/touch-scroller.css +13 -13
  119. data/lib/frameworks/sproutcore/frameworks/desktop/resources/well.css +65 -0
  120. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +114 -103
  121. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/static_content.js +3 -2
  122. data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +7 -6
  123. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +18 -0
  124. data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +4 -7
  125. data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +9 -2
  126. data/lib/frameworks/sproutcore/frameworks/desktop/{panes → views}/select_button.js +43 -0
  127. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form.js +35 -33
  128. data/lib/frameworks/sproutcore/frameworks/foundation/core.js +2 -2
  129. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +15 -8
  130. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/button.js +4 -7
  131. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +55 -13
  132. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +3 -1
  133. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/render_delegate.js +7 -7
  134. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/benchmark.css +0 -0
  135. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/blank.gif +0 -0
  136. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/bootstrap.rhtml +0 -0
  137. data/lib/frameworks/sproutcore/frameworks/foundation/resources/button_view.css +36 -0
  138. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/checkbox_view.css +0 -0
  139. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/debug/control-test-pane.css +0 -0
  140. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/favicon.ico +0 -0
  141. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-logo.png +0 -0
  142. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup-landscape.jpg +0 -0
  143. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup-landscape.png +0 -0
  144. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup-portrait.jpg +0 -0
  145. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup-portrait.png +0 -0
  146. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore-startup.png +0 -0
  147. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/images/sproutcore.png +0 -0
  148. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/inline_editor.css +0 -0
  149. data/lib/frameworks/sproutcore/frameworks/foundation/resources/label.css +47 -0
  150. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/radio_view.css +0 -0
  151. data/lib/frameworks/sproutcore/frameworks/foundation/{english.lproj → resources}/static_layout.css +1 -1
  152. data/lib/frameworks/sproutcore/frameworks/foundation/resources/text_field.css +130 -0
  153. data/lib/frameworks/sproutcore/frameworks/foundation/system/chance.js +5 -1
  154. data/lib/frameworks/sproutcore/frameworks/foundation/system/string.js +0 -43
  155. data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/string_measurement.js +5 -2
  156. data/lib/frameworks/sproutcore/frameworks/foundation/validators/date.js +4 -4
  157. data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +4 -5
  158. data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +1 -1
  159. data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +5 -5
  160. data/lib/frameworks/sproutcore/frameworks/routing/system/routes.js +6 -3
  161. data/lib/frameworks/sproutcore/frameworks/routing/tests/system/routes.js +11 -0
  162. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
  163. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +2 -2
  164. data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +2 -2
  165. data/lib/frameworks/sproutcore/frameworks/runtime/system/error.js +1 -1
  166. data/lib/frameworks/sproutcore/frameworks/runtime/system/logger.js +2 -2
  167. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +2 -2
  168. data/lib/frameworks/sproutcore/frameworks/statechart/debug/monitor.js +4 -73
  169. data/lib/frameworks/sproutcore/frameworks/statechart/debug/sequence_matcher.js +189 -0
  170. data/lib/frameworks/sproutcore/frameworks/statechart/ext/function.js +122 -0
  171. data/lib/frameworks/sproutcore/frameworks/statechart/system/async.js +88 -0
  172. data/lib/frameworks/sproutcore/frameworks/statechart/system/empty_state.js +34 -0
  173. data/lib/frameworks/sproutcore/frameworks/statechart/system/history_state.js +97 -0
  174. data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +7 -189
  175. data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +14 -78
  176. data/lib/frameworks/sproutcore/frameworks/statechart/tests/debug/sequence_matcher.js +464 -0
  177. data/lib/frameworks/sproutcore/frameworks/statechart/tests/event_handling/basic/with_concurrent_states.js +31 -11
  178. data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/async/with_concurrent_states.js +6 -4
  179. data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/with_concurrent_states/advanced.js +40 -6
  180. data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/with_concurrent_states/basic.js +22 -2
  181. data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/standard/with_concurrent_states/intermediate.js +44 -3
  182. data/lib/frameworks/sproutcore/frameworks/testing/core.js +61 -9
  183. data/lib/frameworks/sproutcore/frameworks/testing/{english.lproj → resources}/additions.css +0 -0
  184. data/lib/frameworks/sproutcore/frameworks/testing/{english.lproj → resources}/runner.css +11 -2
  185. data/lib/frameworks/sproutcore/frameworks/testing/{english.lproj → resources}/testsuite.css +0 -0
  186. data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +66 -27
  187. data/lib/frameworks/sproutcore/frameworks/testing/tests/spy_on.js +41 -0
  188. data/lib/frameworks/sproutcore/frameworks/testing/tests/stub_method.js +9 -0
  189. data/lib/frameworks/sproutcore/frameworks/yuireset/resources/core.css +24 -0
  190. data/lib/frameworks/sproutcore/frameworks/yuireset/resources/fonts.css +39 -0
  191. data/lib/frameworks/sproutcore/frameworks/yuireset/resources/reset.css +126 -0
  192. data/lib/frameworks/sproutcore/frameworks/yuireset/resources/view.css +57 -0
  193. data/lib/frameworks/sproutcore/lib/index.rhtml +7 -4
  194. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_checked.png +0 -0
  195. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_checked_active.png +0 -0
  196. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_mixed.png +0 -0
  197. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_mixed_active.png +0 -0
  198. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_unchecked.png +0 -0
  199. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_unchecked_active.png +0 -0
  200. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_checked.png +0 -0
  201. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_checked_active.png +0 -0
  202. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_mixed.png +0 -0
  203. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_mixed_active.png +0 -0
  204. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_unchecked.png +0 -0
  205. data/lib/frameworks/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_unchecked_active.png +0 -0
  206. data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list.css +13 -4
  207. data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list_item.css +16 -14
  208. data/lib/frameworks/sproutcore/themes/ace/resources/menu/menu_item.png +0 -0
  209. data/lib/gen/app/templates/apps/@target_name@/Buildfile +1 -4
  210. data/lib/gen/app/templates/apps/@target_name@/core.js +1 -4
  211. data/lib/gen/app/templates/apps/@target_name@/main.js +1 -4
  212. data/lib/gen/app/templates/apps/@target_name@/resources/main_page.js +1 -4
  213. data/lib/gen/app/templates/apps/@target_name@/theme.js +1 -4
  214. data/lib/gen/controller/templates/controllers/{@filename@.js → @filename@_controller.js} +1 -4
  215. data/lib/gen/controller/templates/tests/controllers/{@filename@.js → @filename@_test.js} +1 -4
  216. data/lib/gen/data-source/templates/data_sources/{@filename@.js → @filename@_data_source.js} +1 -4
  217. data/lib/gen/design/templates/resources/@filename@.js +1 -4
  218. data/lib/gen/framework/templates/frameworks/@target_name@/core.js +1 -4
  219. data/lib/gen/framework/templates/frameworks/@target_name@/english.lproj/strings.js +1 -4
  220. data/lib/gen/html_app/templates/apps/@target_name@/@target_name@.js +1 -4
  221. data/lib/gen/html_app/templates/apps/@target_name@/resources/stylesheets/@target_name@.css +2 -0
  222. data/lib/gen/html_project/templates/@filename@/Buildfile +1 -4
  223. data/lib/gen/html_project/templates/@filename@/README +1 -4
  224. data/lib/gen/language/templates/@filename@/strings.js +1 -4
  225. data/lib/gen/model/templates/fixtures/{@filename@.js → @filename@_fixtures.js} +2 -5
  226. data/lib/gen/model/templates/models/{@filename@.js → @filename@_model.js} +1 -4
  227. data/lib/gen/model/templates/tests/models/{@filename@.js → @filename@_test.js} +1 -4
  228. data/lib/gen/page/templates/pages/@target_name@/Buildfile +1 -4
  229. data/lib/gen/page/templates/pages/@target_name@/core.js +1 -4
  230. data/lib/gen/page/templates/pages/@target_name@/en.lproj/strings.js +1 -4
  231. data/lib/gen/page/templates/pages/@target_name@/resources/body.css +3 -1
  232. data/lib/gen/project/templates/@filename@/Buildfile +1 -4
  233. data/lib/gen/project/templates/@filename@/README +1 -5
  234. data/lib/gen/responder/templates/states/{@filename@.js → @filename@_state.js} +1 -4
  235. data/lib/gen/test/templates/tests/{@filename@.js → @filename@_test.js} +1 -4
  236. data/lib/gen/theme/templates/themes/@target_name@/resources/theme_styles.css +1 -5
  237. data/lib/gen/theme/templates/themes/@target_name@/theme.js +1 -4
  238. data/lib/gen/view/templates/tests/views/{@filename@.js → @filename@_test.js} +1 -4
  239. data/lib/gen/view/templates/views/{@filename@.js → @filename@_view.js} +1 -4
  240. data/lib/sproutcore.rb +4 -1
  241. data/lib/sproutcore/builders/handlebars.rb +1 -1
  242. data/lib/sproutcore/builders/module.rb +2 -2
  243. data/lib/sproutcore/helpers/static_helper.rb +4 -2
  244. data/lib/sproutcore/models/generator.rb +22 -0
  245. data/lib/sproutcore/models/manifest_entry.rb +1 -0
  246. data/lib/sproutcore/models/target.rb +4 -1
  247. data/lib/sproutcore/rack/builder.rb +3 -0
  248. data/lib/sproutcore/tools.rb +11 -11
  249. data/lib/sproutcore/tools/init.rb +10 -22
  250. data/lib/sproutcore/tools/manifest.rb +21 -22
  251. data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +21 -1
  252. data/spec/fixtures/ordered_entries/apps/template_style/a.js +0 -0
  253. data/spec/fixtures/ordered_entries/apps/template_style/template_style.js +0 -0
  254. data/spec/lib/buildfile_commands/build_task_spec.rb +1 -1
  255. data/spec/lib/tools/manifest_spec.rb +11 -0
  256. data/sproutcore.gemspec +2 -2
  257. data/vendor/chance/lib/chance/instance.rb +3 -1
  258. metadata +118 -74
  259. data/lib/frameworks/sproutcore/frameworks/core_foundation/resources/core.css +0 -378
  260. data/lib/frameworks/sproutcore/frameworks/core_foundation/resources/view.css +0 -57
  261. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +0 -56
  262. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/disclosure.css +0 -73
  263. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/icons.css +0 -916
  264. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/images/icons/shared.png +0 -0
  265. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +0 -185
  266. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/menu.css +0 -12
  267. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +0 -101
  268. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/panel.css +0 -91
  269. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/picker.css +0 -35
  270. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/progress.css +0 -33
  271. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/radio.css +0 -10
  272. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/segmented.css +0 -132
  273. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/separator.css +0 -19
  274. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +0 -69
  275. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/strings.js +0 -14
  276. data/lib/frameworks/sproutcore/frameworks/desktop/english.lproj/well.css +0 -71
  277. data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +0 -40
  278. data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/label.css +0 -47
  279. data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +0 -146
  280. data/lib/frameworks/sproutcore/themes/empty_theme/tests/mini_icons.rhtml +0 -69
@@ -26,3 +26,399 @@ test("Views only attempt to call performKeyEquivalent on child views that suppor
26
26
 
27
27
  ok(performKeyEquivalentCalled > 0, "performKeyEquivalent is called on the view that supports it");
28
28
  });
29
+
30
+ /**
31
+ nextValidKeyView tests
32
+ */
33
+
34
+ test("nextValidKeyView is receiver if it is the only view that acceptsFirstResponder", function() {
35
+ var testView = SC.View.extend({acceptsFirstResponder: YES}),
36
+ pane = SC.Pane.create({
37
+ childViews: ['view1', 'view2'],
38
+
39
+ view1: SC.View.extend({
40
+ childViews: ['view3', 'view4'],
41
+
42
+ view3: SC.View,
43
+
44
+ view4: testView
45
+ }),
46
+
47
+ view2: SC.View.extend({
48
+ childViews: ['view5', 'view6'],
49
+
50
+ view5: SC.View,
51
+
52
+ view6: SC.View
53
+ })
54
+ });
55
+
56
+ // fake the pane being attached
57
+ pane.set('isPaneAttached', YES);
58
+ pane.recomputeIsVisibleInWindow();
59
+
60
+ equals(pane.view1.view4.get('nextValidKeyView'), pane.view1.view4, "nextValidKeyView is receiver");
61
+ });
62
+
63
+ test("nextValidKeyView is null if no views have acceptsFirstResponder === YES", function() {
64
+ var testView = SC.View.extend({acceptsFirstResponder: YES}),
65
+ pane = SC.Pane.create({
66
+ childViews: ['view1', 'view2'],
67
+
68
+ view1: SC.View.extend({
69
+ childViews: ['view3', 'view4'],
70
+
71
+ view3: SC.View,
72
+
73
+ view4: SC.View
74
+ }),
75
+
76
+ view2: SC.View.extend({
77
+ childViews: ['view5', 'view6'],
78
+
79
+ view5: SC.View,
80
+
81
+ view6: SC.View
82
+ })
83
+ });
84
+
85
+ // fake the pane being attached
86
+ pane.set('isPaneAttached', YES);
87
+ pane.recomputeIsVisibleInWindow();
88
+
89
+ ok(SC.none(pane.view1.view4.get('nextValidKeyView')), "nextValidKeyView is null");
90
+ });
91
+
92
+ test("firstKeyView and nextKeyView of parents are respected", function() {
93
+ var testView = SC.View.extend({acceptsFirstResponder: YES}),
94
+ pane = SC.Pane.create({
95
+ childViews: ['view1', 'view2', 'view7'],
96
+
97
+ view1: SC.View.extend({
98
+ childViews: ['view3', 'view4'],
99
+
100
+ view3: testView,
101
+
102
+ view4: testView
103
+ }),
104
+
105
+ view2: SC.View.extend({
106
+ childViews: ['view5', 'view6'],
107
+
108
+ view5: testView,
109
+
110
+ view6: testView
111
+ }),
112
+
113
+ view7: SC.View.extend({
114
+ childViews: ['view8', 'view9'],
115
+
116
+ view8: testView,
117
+
118
+ view9: testView
119
+ })
120
+ });
121
+
122
+ // fake the pane being attached
123
+ pane.set('isPaneAttached', YES);
124
+ pane.recomputeIsVisibleInWindow();
125
+
126
+ equals(pane.view2.view6.get('nextValidKeyView'), pane.view7.view8, "order is correct when first and next not set");
127
+
128
+ pane.set('firstKeyView', pane.view2);
129
+ pane.view2.set('nextKeyView', pane.view1);
130
+ pane.view1.set('nextKeyView', pane.view7);
131
+
132
+ equals(pane.view2.view6.get('nextValidKeyView'), pane.view1.view3, "order is respected when first and next are set");
133
+ });
134
+
135
+ test("nextValidKeyView is chosen correctly when nextKeyView is not a sibling", function() {
136
+ var testView = SC.View.extend({acceptsFirstResponder: YES}),
137
+ pane = SC.Pane.create({
138
+ childViews: ['view1', 'view2'],
139
+
140
+ view1: SC.View.extend({
141
+ childViews: ['view3', 'view4'],
142
+
143
+ view3: SC.View,
144
+
145
+ view4: testView
146
+ }),
147
+
148
+ view2: SC.View.extend({
149
+ childViews: ['view5', 'view6'],
150
+
151
+ view5: testView,
152
+
153
+ view6: SC.View
154
+ })
155
+ });
156
+
157
+ // fake the pane being attached
158
+ pane.set('isPaneAttached', YES);
159
+ pane.recomputeIsVisibleInWindow();
160
+
161
+ pane.view1.view4.set('nextKeyView', pane.view2.view5);
162
+ pane.view2.view5.set('nextKeyView', pane.view1.view4);
163
+
164
+ equals(pane.view1.view4.get('nextValidKeyView'), pane.view2.view5, "nextValidKeyView is correct");
165
+ equals(pane.view2.view5.get('nextValidKeyView'), pane.view1.view4, "nextValidKeyView is correct");
166
+ });
167
+
168
+ test("nextValidKeyView is chosen correctly when child of parent's previous sibling has nextKeyView set", function() {
169
+ var testView = SC.View.extend({acceptsFirstResponder: YES}),
170
+ pane = SC.Pane.create({
171
+ childViews: ['view1', 'view2'],
172
+
173
+ view1: SC.View.extend({
174
+ childViews: ['view3', 'view4'],
175
+
176
+ view3: testView,
177
+
178
+ view4: testView
179
+ }),
180
+
181
+ view2: SC.View.extend({
182
+ childViews: ['view5', 'view6'],
183
+
184
+ view5: testView,
185
+
186
+ view6: testView
187
+ })
188
+ });
189
+
190
+ pane.view1.view3.set('nextKeyView', pane.view1.view4);
191
+
192
+ // fake the pane being attached
193
+ pane.set('isPaneAttached', YES);
194
+ pane.recomputeIsVisibleInWindow();
195
+
196
+ equals(pane.view2.view5.get('nextValidKeyView'), pane.view2.view6, "nextValidKeyView chosen is next sibling");
197
+ });
198
+
199
+ test("nextValidKeyView checks for acceptsFirstResponder", function() {
200
+ var pane = SC.Pane.create({
201
+ childViews: ['view1', 'view2'],
202
+
203
+ view1: SC.View.extend({
204
+ acceptsFirstResponder: YES
205
+ }),
206
+
207
+ view2: SC.View.extend({
208
+ acceptsFirstResponder: NO
209
+ })
210
+ });
211
+
212
+ pane.view1.set('nextKeyView', pane.view2);
213
+
214
+ // fake the pane being attached
215
+ pane.set('isPaneAttached', YES);
216
+ pane.recomputeIsVisibleInWindow();
217
+
218
+ ok(pane.view1.get('nextValidKeyView') !== pane.view2, "nextValidKeyView is not nextKeyView because nextKeyView acceptsFirstResponder === NO");
219
+ });
220
+
221
+ test("nextValidKeyView prioritizes parent's lastKeyView even if nextKeyView is set", function() {
222
+ var testView = SC.View.extend({acceptsFirstResponder: YES}),
223
+ pane = SC.Pane.create({
224
+ childViews: ['view1', 'view2'],
225
+
226
+ view1: SC.View.extend({
227
+ childViews: ['view3', 'view4'],
228
+
229
+ lastKeyView: function() {
230
+ return this.view3;
231
+ }.property(),
232
+
233
+ view3: testView,
234
+
235
+ view4: testView
236
+ }),
237
+
238
+ view2: SC.View.extend({
239
+ childViews: ['view5', 'view6'],
240
+
241
+ view5: testView,
242
+
243
+ view6: testView
244
+ })
245
+ });
246
+
247
+ // fake the pane being attached
248
+ pane.set('isPaneAttached', YES);
249
+ pane.recomputeIsVisibleInWindow();
250
+
251
+ equals(pane.view1.view3.get('nextValidKeyView'), pane.view2.view5, "lastKeyView was respected; views after lastKeyView were skipped");
252
+ });
253
+
254
+ /**
255
+ previousValidKeyView tests
256
+ */
257
+
258
+ test("previousValidKeyView is receiver if it is the only view that acceptsFirstResponder", function() {
259
+ var testView = SC.View.extend({acceptsFirstResponder: YES}),
260
+ pane = SC.Pane.create({
261
+ childViews: ['view1', 'view2'],
262
+
263
+ view1: SC.View.extend({
264
+ childViews: ['view3', 'view4'],
265
+
266
+ view3: SC.View,
267
+
268
+ view4: testView
269
+ }),
270
+
271
+ view2: SC.View.extend({
272
+ childViews: ['view5', 'view6'],
273
+
274
+ view5: SC.View,
275
+
276
+ view6: SC.View
277
+ })
278
+ });
279
+
280
+ // fake the pane being attached
281
+ pane.set('isPaneAttached', YES);
282
+ pane.recomputeIsVisibleInWindow();
283
+
284
+ equals(pane.view1.view4.get('previousValidKeyView'), pane.view1.view4, "previousValidKeyView is receiver");
285
+ });
286
+
287
+ test("previousValidKeyView is null if no views have acceptsFirstResponder === YES", function() {
288
+ var testView = SC.View.extend({acceptsFirstResponder: YES}),
289
+ pane = SC.Pane.create({
290
+ childViews: ['view1', 'view2'],
291
+
292
+ view1: SC.View.extend({
293
+ childViews: ['view3', 'view4'],
294
+
295
+ view3: SC.View,
296
+
297
+ view4: SC.View
298
+ }),
299
+
300
+ view2: SC.View.extend({
301
+ childViews: ['view5', 'view6'],
302
+
303
+ view5: SC.View,
304
+
305
+ view6: SC.View
306
+ })
307
+ });
308
+
309
+ // fake the pane being attached
310
+ pane.set('isPaneAttached', YES);
311
+ pane.recomputeIsVisibleInWindow();
312
+
313
+ ok(SC.none(pane.view1.view4.get('previousValidKeyView')), "previousValidKeyView is null");
314
+ });
315
+
316
+ test("lastKeyView and previousKeyView of parents are respected", function() {
317
+ var testView = SC.View.extend({acceptsFirstResponder: YES}),
318
+ pane = SC.Pane.create({
319
+ childViews: ['view1', 'view2', 'view7'],
320
+
321
+ view1: SC.View.extend({
322
+ childViews: ['view3', 'view4'],
323
+
324
+ view3: testView,
325
+
326
+ view4: testView
327
+ }),
328
+
329
+ view2: SC.View.extend({
330
+ childViews: ['view5', 'view6'],
331
+
332
+ view5: testView,
333
+
334
+ view6: testView
335
+ }),
336
+
337
+ view7: SC.View.extend({
338
+ childViews: ['view8', 'view9'],
339
+
340
+ view8: testView,
341
+
342
+ view9: testView
343
+ })
344
+ });
345
+
346
+ // fake the pane being attached
347
+ pane.set('isPaneAttached', YES);
348
+ pane.recomputeIsVisibleInWindow();
349
+
350
+ equals(pane.view2.view5.get('previousValidKeyView'), pane.view1.view4, "order is correct when last and previous not set");
351
+
352
+ pane.set('lastKeyView', pane.view2);
353
+ pane.view2.set('previousKeyView', pane.view7);
354
+ pane.view1.set('previousKeyView', pane.view1);
355
+
356
+ equals(pane.view2.view5.get('previousValidKeyView'), pane.view7.view9, "order is respected when last and previous are set");
357
+ });
358
+
359
+ test("previousValidKeyView is chosen correctly when previousKeyView is not a sibling", function() {
360
+ var testView = SC.View.extend({acceptsFirstResponder: YES}),
361
+ pane = SC.Pane.create({
362
+ childViews: ['view1', 'view2'],
363
+
364
+ view1: SC.View.extend({
365
+ childViews: ['view3', 'view4'],
366
+
367
+ view3: SC.View,
368
+
369
+ view4: testView
370
+ }),
371
+
372
+ view2: SC.View.extend({
373
+ childViews: ['view5', 'view6'],
374
+
375
+ view5: testView,
376
+
377
+ view6: SC.View
378
+ })
379
+ });
380
+
381
+ // fake the pane being attached
382
+ pane.set('isPaneAttached', YES);
383
+ pane.recomputeIsVisibleInWindow();
384
+
385
+ pane.view1.view4.set('previousKeyView', pane.view2.view5);
386
+ pane.view2.view5.set('previousKeyView', pane.view1.view4);
387
+
388
+ equals(pane.view1.view4.get('previousValidKeyView'), pane.view2.view5, "previousValidKeyView is correct");
389
+ equals(pane.view2.view5.get('previousValidKeyView'), pane.view1.view4, "previousValidKeyView is correct");
390
+ });
391
+
392
+ test("previousValidKeyView prioritizes parent's firstKeyView even if previousKeyView is set", function() {
393
+ var testView = SC.View.extend({acceptsFirstResponder: YES}),
394
+ pane = SC.Pane.create({
395
+ childViews: ['view1', 'view2'],
396
+
397
+ view1: SC.View.extend({
398
+ childViews: ['view3', 'view4'],
399
+
400
+ view3: testView,
401
+
402
+ view4: testView
403
+ }),
404
+
405
+ view2: SC.View.extend({
406
+ childViews: ['view5', 'view6'],
407
+
408
+ firstKeyView: function() {
409
+ return this.view6;
410
+ }.property(),
411
+
412
+ view5: testView,
413
+
414
+ view6: testView
415
+ })
416
+ });
417
+
418
+ // fake the pane being attached
419
+ pane.set('isPaneAttached', YES);
420
+ pane.recomputeIsVisibleInWindow();
421
+
422
+ equals(pane.view2.view6.get('previousValidKeyView'), pane.view1.view4, "firstKeyView was respected; views before firstKeyView were skipped");
423
+ });
424
+
@@ -56,7 +56,7 @@ test("it still works with the backward compatible theme property when extending"
56
56
  }.observes('theme')
57
57
  });
58
58
 
59
- view = View.create();
59
+ var view = View.create();
60
60
  equals(SC.Theme.find('sc-base'), view.get('theme'));
61
61
  view.set('themeName', 'hello');
62
62
  equals(1, count, "theme observers should get called");
@@ -11,7 +11,8 @@ sc_require('views/template');
11
11
  set up. When the associated property changes, just the template for this view
12
12
  will re-render.
13
13
  */
14
- SC._BindableSpan = SC.TemplateView.extend({
14
+ SC._BindableSpan = SC.TemplateView.extend(
15
+ /** @scope SC._BindableSpan.prototype */{
15
16
  /**
16
17
  The type of HTML tag to use. To ensure compatibility with
17
18
  Internet Explorer 7, a <span> tag is used to ensure that inline elements are
@@ -1,6 +1,15 @@
1
1
  sc_require('views/template');
2
2
 
3
- SC.TemplateCollectionView = SC.TemplateView.extend({
3
+ /** @class
4
+
5
+ @author Tom Dale
6
+ @author Yehuda Katz
7
+ @extends SC.TemplateView
8
+ @since SproutCore 1.5
9
+ */
10
+ SC.TemplateCollectionView = SC.TemplateView.extend(
11
+ /** @scope SC.TemplateCollectionView.prototype */{
12
+
4
13
  tagName: 'ul',
5
14
  content: null,
6
15
  template: SC.Handlebars.compile(''),
@@ -127,9 +136,11 @@ SC.TemplateCollectionView = SC.TemplateView.extend({
127
136
  }.observes('content'),
128
137
 
129
138
  arrayContentWillChange: function(start, removedCount, addedCount) {
139
+ if (!this.get('layer')) { return; }
140
+
130
141
  // If the contents were empty before and this template collection has an empty view
131
142
  // remove it now.
132
- emptyView = this.get('emptyView');
143
+ var emptyView = this.get('emptyView');
133
144
  if (emptyView) { emptyView.$().remove(); emptyView.removeFromParent(); }
134
145
 
135
146
  // Loop through child views that correspond with the removed items.
@@ -167,59 +178,62 @@ SC.TemplateCollectionView = SC.TemplateView.extend({
167
178
  addedViews = [],
168
179
  renderFunc, childView, itemOptions, elem, insertAtElement, item, itemElem, idx, len;
169
180
 
170
- var addedObjects = content.slice(start, start+addedCount);
171
-
172
- // If we have content to display, create a view for
173
- // each item.
174
- itemOptions = this.get('itemViewOptions') || {};
175
-
176
- elem = this.$();
177
- insertAtElement = elem.find('li')[start-1] || null;
178
- len = addedObjects.get('length');
179
-
180
- // TODO: This logic is duplicated from the view helper. Refactor
181
- // it so we can share logic.
182
- var itemAttrs = {
183
- "id": itemOptions.id,
184
- "class": itemOptions['class'],
185
- "classBinding": itemOptions.classBinding
186
- };
187
-
188
- renderFunc = function(context) {
189
- sc_super();
190
- SC.Handlebars.ViewHelper.applyAttributes(itemAttrs, this, context);
191
- };
192
-
193
- itemOptions = SC.clone(itemOptions);
194
- delete itemOptions.id;
195
- delete itemOptions['class'];
196
- delete itemOptions.classBinding;
197
-
198
- for (idx = 0; idx < len; idx++) {
199
- item = addedObjects.objectAt(idx);
200
- view = this.createChildView(itemViewClass.extend(itemOptions, {
201
- content: item,
202
- render: renderFunc
203
- }));
204
-
205
- var contextProperty = view.get('contextProperty');
206
- if (contextProperty) {
207
- view.set('context', view.get(contextProperty));
208
- }
209
-
210
- itemElem = view.createLayer().$();
211
- if (!insertAtElement) {
212
- elem.append(itemElem);
213
- } else {
214
- itemElem.insertAfter(insertAtElement);
181
+ if (content) {
182
+ var addedObjects = content.slice(start, start+addedCount);
183
+
184
+ // If we have content to display, create a view for
185
+ // each item.
186
+ itemOptions = this.get('itemViewOptions') || {};
187
+
188
+ elem = this.$();
189
+ insertAtElement = elem.find('li')[start-1] || null;
190
+ len = addedObjects.get('length');
191
+
192
+ // TODO: This logic is duplicated from the view helper. Refactor
193
+ // it so we can share logic.
194
+ var itemAttrs = {
195
+ "id": itemOptions.id,
196
+ "class": itemOptions['class'],
197
+ "classBinding": itemOptions.classBinding
198
+ };
199
+
200
+ renderFunc = function(context) {
201
+ sc_super();
202
+ SC.Handlebars.ViewHelper.applyAttributes(itemAttrs, this, context);
203
+ };
204
+
205
+ itemOptions = SC.clone(itemOptions);
206
+ delete itemOptions.id;
207
+ delete itemOptions['class'];
208
+ delete itemOptions.classBinding;
209
+
210
+ for (idx = 0; idx < len; idx++) {
211
+ item = addedObjects.objectAt(idx);
212
+ view = this.createChildView(itemViewClass.extend(itemOptions, {
213
+ content: item,
214
+ render: renderFunc,
215
+ tagName: itemViewClass.prototype.tagName || this.get('itemTagName')
216
+ }));
217
+
218
+ var contextProperty = view.get('contextProperty');
219
+ if (contextProperty) {
220
+ view.set('context', view.get(contextProperty));
221
+ }
222
+
223
+ itemElem = view.createLayer().$();
224
+ if (!insertAtElement) {
225
+ elem.append(itemElem);
226
+ } else {
227
+ itemElem.insertAfter(insertAtElement);
228
+ }
229
+ insertAtElement = itemElem;
230
+
231
+ addedViews.push(view);
215
232
  }
216
- insertAtElement = itemElem;
217
233
 
218
- addedViews.push(view);
234
+ childViews.replace(start, 0, addedViews);
219
235
  }
220
236
 
221
- childViews.replace(start, 0, addedViews);
222
-
223
237
  var inverseTemplate = this.get('inverseTemplate');
224
238
  if (childViews.get('length') === 0 && inverseTemplate) {
225
239
  view = this.createChildView(SC.TemplateView.extend({
@@ -237,6 +251,19 @@ SC.TemplateCollectionView = SC.TemplateView.extend({
237
251
  this.invokeLast('invalidateFrame');
238
252
  },
239
253
 
254
+ itemTagName: function() {
255
+ switch(this.get('tagName')) {
256
+ case 'ul':
257
+ case 'ol':
258
+ return 'li';
259
+ case 'table':
260
+ case 'thead':
261
+ case 'tbody':
262
+ case 'tfoot':
263
+ return 'tr'
264
+ }
265
+ }.property('tagName'),
266
+
240
267
  invalidateFrame: function() {
241
268
  this.notifyPropertyChange('frame');
242
269
  }