sproutcore 1.6.0.beta.3-x86-mingw32 → 1.6.0.rc.1-x86-mingw32

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 +150 -106
  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
@@ -21,7 +21,6 @@ test("Frame Recalculation", function() {
21
21
  callCount += 1;
22
22
  }.observes('frame')
23
23
  });
24
-
25
24
  pane.setPath('contentView.contentView', view);
26
25
  pane.append();
27
26
  baseCount = callCount;
@@ -38,7 +37,9 @@ test("Frame Recalculation", function() {
38
37
  callCount = 0;
39
38
 
40
39
  SC.RunLoop.begin().end();
41
- ok(view.get('layer').textContent.indexOf(content) > -1, 'view should rerender when content changes');
40
+ var layer = view.get('layer');
41
+
42
+ ok(layer.innerHTML.indexOf(content) > -1, 'view should rerender when content changes');
42
43
  view.contentLayoutDidChange();
43
44
  ok(callCount > 0, 'frame should recompute after calling contentLayoutDidChange()');
44
45
 
@@ -95,14 +95,15 @@ SC.CheckboxView = SC.ButtonView.extend(SC.StaticLayout,
95
95
  if(!this.get('isEnabled')) {
96
96
  return YES;
97
97
  }
98
- var val = this.get('value');
99
- if (val === this.get('toggleOnValue')) {
100
98
 
101
- this.set('value', this.get('toggleOffValue'));
102
- }
103
- else {
104
- this.set('value', this.get('toggleOnValue'));
99
+ var isOn = this.get('value') === this.get('toggleOnValue');
100
+ this.set('value', isOn ? this.get('toggleOffValue') : this.get('toggleOnValue'));
101
+
102
+ // fire action
103
+ if (this.get('buttonBehavior') !== SC.HOLD_BEHAVIOR) {
104
+ if (this.$().within(evt.target)) { this._action(evt); }
105
105
  }
106
+
106
107
  return YES;
107
108
  },
108
109
 
@@ -2118,6 +2118,20 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate, SC.CollectionConte
2118
2118
  return YES ; // always handle
2119
2119
  },
2120
2120
 
2121
+ insertTab: function(evt) {
2122
+ var view = this.get('nextValidKeyView');
2123
+ if (view) view.becomeFirstResponder();
2124
+ else evt.allowDefault();
2125
+ return YES ; // handled
2126
+ },
2127
+
2128
+ insertBacktab: function(evt) {
2129
+ var view = this.get('previousValidKeyView');
2130
+ if (view) view.becomeFirstResponder();
2131
+ else evt.allowDefault();
2132
+ return YES ; // handled
2133
+ },
2134
+
2121
2135
  // ..........................................................
2122
2136
  // MOUSE EVENTS
2123
2137
  //
@@ -2142,6 +2156,8 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate, SC.CollectionConte
2142
2156
 
2143
2157
  if (!this.get('isEnabled')) return contentIndex > -1;
2144
2158
 
2159
+ if(!this.get('isSelectable')) return NO;
2160
+
2145
2161
  info = this.mouseDownInfo = {
2146
2162
  event: ev,
2147
2163
  itemView: itemView,
@@ -2245,6 +2261,8 @@ SC.CollectionView = SC.View.extend(SC.CollectionViewDelegate, SC.CollectionConte
2245
2261
 
2246
2262
  if (!this.get('isEnabled')) return contentIndex > -1;
2247
2263
 
2264
+ if(!this.get('isSelectable')) return NO;
2265
+
2248
2266
  if (this.get('useToggleSelection')) {
2249
2267
  // Return if clicked outside of elements or if toggle was handled by mouseDown
2250
2268
  if (!view || this.get('selectOnMouseDown')) return NO;
@@ -159,14 +159,13 @@ SC.PopupButtonView = SC.ButtonView.extend(
159
159
 
160
160
  @param {SC.Event} evt
161
161
  */
162
- action: function(evt)
163
- {
162
+ action: function(evt) {
164
163
  var menu = this.get('instantiatedMenu') ;
165
164
 
166
165
  if (!menu) {
167
- //@ if (debug)
166
+ // @if (debug)
168
167
  SC.Logger.warn("SC.PopupButton - Unable to show menu because the menu property is set to %@.".fmt(menu));
169
- //@ endif
168
+ // @endif
170
169
  return NO ;
171
170
  }
172
171
 
@@ -280,8 +279,7 @@ SC.PopupButtonView = SC.ButtonView.extend(
280
279
  alt_shift_z)
281
280
  @param {SC.Event} evt
282
281
  */
283
- performKeyEquivalent: function( charCode, evt )
284
- {
282
+ performKeyEquivalent: function(charCode, evt) {
285
283
  if (!this.get('isEnabled')) return NO ;
286
284
  var menu = this.get('instantiatedMenu') ;
287
285
 
@@ -300,4 +298,3 @@ SC.PopupButtonMenuLoader = SC.Task.extend({
300
298
  if (this.popupButton) this.popupButton._instantiateMenu();
301
299
  }
302
300
  });
303
-
@@ -36,6 +36,7 @@ sc_require('views/segment');
36
36
  - *itemIconKey* - an icon
37
37
  - *itemActionKey* - an optional action to fire when pressed
38
38
  - *itemTargetKey* - an optional target for the action
39
+ - *itemLayerIdKey* - an optional target for the action
39
40
  - *segmentViewClass* - class to be used for creating segments
40
41
 
41
42
  @extends SC.View
@@ -235,6 +236,12 @@ SC.SegmentedView = SC.View.extend(SC.Control,
235
236
  */
236
237
  itemTargetKey: null,
237
238
 
239
+ /**
240
+ The key that contains the layerId for each item.
241
+ @property {String}
242
+ */
243
+ itemLayerIdKey: null,
244
+
238
245
  /**
239
246
  The key that contains the key equivalent for each item. If defined then
240
247
  pressing that key equivalent will be like selecting the tab. Also,
@@ -287,10 +294,10 @@ SC.SegmentedView = SC.View.extend(SC.Control,
287
294
 
288
295
  @type Array
289
296
  */
290
- itemKeys: 'itemTitleKey itemValueKey itemIsEnabledKey itemIconKey itemWidthKey itemToolTipKey itemKeyEquivalentKey'.w(),
297
+ itemKeys: ['itemTitleKey', 'itemValueKey', 'itemIsEnabledKey', 'itemIconKey', 'itemWidthKey', 'itemToolTipKey', 'itemKeyEquivalentKey', 'itemLayerIdKey'],
291
298
 
292
299
  /** @private */
293
- viewKeys: ['title', 'value', 'isEnabled', 'icon', 'width', 'toolTip', 'keyEquivalent'],
300
+ viewKeys: ['title', 'value', 'isEnabled', 'icon', 'width', 'toolTip', 'keyEquivalent', 'layerId'],
294
301
 
295
302
  /** @private
296
303
  Call itemsDidChange once to initialize segment child views for the items that exist at
@@ -835,6 +835,21 @@ SC.SelectButtonView = SC.ButtonView.extend(
835
835
  return this.get('isEnabled');
836
836
  }.property('isEnabled'),
837
837
 
838
+ insertTab: function(evt) {
839
+ var view = this.get('nextValidKeyView');
840
+ if (view) view.becomeFirstResponder();
841
+ else evt.allowDefault();
842
+ return YES ; // handled
843
+ },
844
+
845
+ insertBacktab: function(evt) {
846
+ var view = this.get('previousValidKeyView');
847
+ if (view) view.becomeFirstResponder();
848
+ else evt.allowDefault();
849
+ return YES ; // handled
850
+ },
851
+
852
+
838
853
  /** @private
839
854
  Override the button isSelectedDidChange function in order to not perform any action
840
855
  on selecting the select_button
@@ -948,3 +963,31 @@ SC.SelectButtonView.HUGE_POPUP_MENU_WIDTH_OFFSET = 0;
948
963
  @default -2
949
964
  */
950
965
  SC.SelectButtonView.MENU_WIDTH_OFFSET = -2;
966
+
967
+ /**
968
+ Default metrics for the different control sizes.
969
+ */
970
+ SC.MenuPane.TINY_MENU_ITEM_HEIGHT = 10;
971
+ SC.MenuPane.TINY_MENU_ITEM_SEPARATOR_HEIGHT = 2;
972
+ SC.MenuPane.TINY_MENU_HEIGHT_PADDING = 2;
973
+ SC.MenuPane.TINY_SUBMENU_OFFSET_X = 0;
974
+
975
+ SC.MenuPane.SMALL_MENU_ITEM_HEIGHT = 16;
976
+ SC.MenuPane.SMALL_MENU_ITEM_SEPARATOR_HEIGHT = 7;
977
+ SC.MenuPane.SMALL_MENU_HEIGHT_PADDING = 4;
978
+ SC.MenuPane.SMALL_SUBMENU_OFFSET_X = 2;
979
+
980
+ SC.MenuPane.REGULAR_MENU_ITEM_HEIGHT = 20;
981
+ SC.MenuPane.REGULAR_MENU_ITEM_SEPARATOR_HEIGHT = 9;
982
+ SC.MenuPane.REGULAR_MENU_HEIGHT_PADDING = 6;
983
+ SC.MenuPane.REGULAR_SUBMENU_OFFSET_X = 2;
984
+
985
+ SC.MenuPane.LARGE_MENU_ITEM_HEIGHT = 60;
986
+ SC.MenuPane.LARGE_MENU_ITEM_SEPARATOR_HEIGHT = 20;
987
+ SC.MenuPane.LARGE_MENU_HEIGHT_PADDING = 0;
988
+ SC.MenuPane.LARGE_SUBMENU_OFFSET_X = 4;
989
+
990
+ SC.MenuPane.HUGE_MENU_ITEM_HEIGHT = 20;
991
+ SC.MenuPane.HUGE_MENU_ITEM_SEPARATOR_HEIGHT = 9;
992
+ SC.MenuPane.HUGE_MENU_HEIGHT_PADDING = 0;
993
+ SC.MenuPane.HUGE_SUBMENU_OFFSET_X = 0;
@@ -4,52 +4,54 @@
4
4
  // Portions ©2008-2011 Apple Inc. All rights reserved.
5
5
  // License: Licensed under MIT license (see license.js)
6
6
  // ==========================================================================
7
-
8
7
  /*globals Forms */
9
8
 
10
- /** @class
11
- FormView
12
- FormView is a lot like a normal view. However, in addition to the childViews
13
- collection, it has a fields collection. The items referenced here are NOT
14
- just children; they are explicity stated in the array fields, which works
15
- just like childViews, but marks fields to be laid out automatically.
9
+ sc_require("mixins/emptiness");
10
+ sc_require("mixins/edit_mode");
11
+ sc_require("views/form_row");
16
12
 
17
- Usually, you will place rows into the FormView:
13
+ /**
14
+ @class
18
15
 
19
- childViews: "fullName gender".w(),
20
- contentBinding: 'MyApp.personController',
16
+ FormView is a lot like a normal view. However, in addition to the childViews
17
+ collection, it has a fields collection. The items referenced here are NOT
18
+ just children; they are explicity stated in the array fields, which works
19
+ just like childViews, but marks fields to be laid out automatically.
21
20
 
22
- fullName: SC.FormView.row("Name:", SC.TextFieldView.extend({
23
- layout: {height: 20, width: 150}
24
- })),
21
+ Usually, you will place rows into the FormView:
22
+
23
+ childViews: "fullName gender".w(),
24
+ contentBinding: 'MyApp.personController',
25
25
 
26
- gender: SC.FormView.row("Gender:", SC.RadioView.design({
27
- layout: {width: 150, height: 40, centerY: 0},
28
- items: ["male", "female"]
29
- }))
26
+ fullName: SC.FormView.row("Name:", SC.TextFieldView.extend({
27
+ layout: {height: 20, width: 150}
28
+ })),
30
29
 
31
- The name of the row (ie. 'fullName'), is passed down to the *FieldView, and used as the key
32
- to bind the value property to the content. In this case it will bind content.fullName to the
33
- value property of the textFieldView. Easy!
30
+ gender: SC.FormView.row("Gender:", SC.RadioView.design({
31
+ layout: {width: 150, height: 40, centerY: 0},
32
+ items: ["male", "female"]
33
+ }))
34
34
 
35
- One important thing about the field collection: It can contain any type of
36
- view, including other FormViews or subclasses of FormView.
35
+ The name of the row (ie. 'fullName'), is passed down to the *FieldView, and used as the key
36
+ to bind the value property to the content. In this case it will bind content.fullName to the
37
+ value property of the textFieldView. Easy!
37
38
 
38
- This is important, because this is how you make nice rows that have a
39
- label and a field: these rows are actually subclasses of FormView itself.
39
+ One important thing about the field collection: It can contain any type of
40
+ view, including other FormViews or subclasses of FormView.
40
41
 
41
- ## Editing
42
- The form does not allow editing by default; editing must be started by calling
43
- beginEditing.
42
+ This is important, because this is how you make nice rows that have a
43
+ label and a field: these rows are actually subclasses of FormView itself.
44
44
 
45
+ Editing
46
+ -------
47
+
48
+ The form does not allow editing by default; editing must be started by calling
49
+ beginEditing.
45
50
 
46
- @extends SC.View
47
- @implements SC.Editable
48
- */
49
51
 
50
- sc_require("mixins/emptiness");
51
- sc_require("mixins/edit_mode");
52
- sc_require("views/form_row");
52
+ @extends SC.View
53
+ @implements SC.Editable
54
+ */
53
55
 
54
56
  SC.FormView = SC.View.extend(SC.FlowedLayout, SC.CalculatesEmptiness, SC.FormsEditMode, /** @scope SC.FormView.prototype */ {
55
57
  layoutDirection: SC.LAYOUT_VERTICAL,
@@ -15,9 +15,9 @@ SC.FOCUS_ALL_CONTROLS = YES;
15
15
  SC.ready(function() {
16
16
  var focus = SC.SAFARI_FOCUS_BEHAVIOR;
17
17
  if (focus !== null && focus !== undefined) {
18
- //@ if (debug)
18
+ // @if (debug)
19
19
  SC.Logger.warn("SC.SAFARI_FOCUS_BEHAVIOR is deprecated. Please use SC.FOCUS_ALL_CONTROLS instead");
20
- //@ endif
20
+ // @endif
21
21
  SC.FOCUS_ALL_CONTROLS = SC.SAFARI_FOCUS_BEHAVIOR;
22
22
  }
23
23
  });
@@ -8,7 +8,7 @@
8
8
  sc_require("system/utils/string_measurement");
9
9
 
10
10
  /**
11
- @mixin
11
+ @class
12
12
  Use this mixin to make your view automatically resize based upon its value,
13
13
  title, or other string property. Only works for views that support automatic
14
14
  resizing.
@@ -134,6 +134,9 @@ SC.AutoResize = {
134
134
  // if so, cancel the old request and make a new one
135
135
  SC.AutoResizeManager.cancelMeasurementForView(this, requestedBatchResizeId);
136
136
  SC.AutoResizeManager.scheduleMeasurementForView(this, batchResizeId);
137
+
138
+ // update the requested batchResizeId to the new id
139
+ this._scar_requestedBatchResizeId = batchResizeId;
137
140
  }
138
141
  }.observes('batchResizeId'),
139
142
 
@@ -151,7 +154,7 @@ SC.AutoResize = {
151
154
 
152
155
  this._scar_measurementPending = YES;
153
156
  this._scar_requestedBatchResizeId = batchResizeId;
154
- },
157
+ }.observes('isVisible'),
155
158
 
156
159
  /**
157
160
  Measures the size of the view.
@@ -160,7 +163,8 @@ SC.AutoResize = {
160
163
  */
161
164
  measureSize: function(batch) {
162
165
  var metrics, layer, value = this.get('autoResizeText'),
163
- autoSizePadding, paddingHeight, paddingWidth;
166
+ autoSizePadding, paddingHeight, paddingWidth,
167
+ ignoreEscape = !this.get('escapeHTML');
164
168
 
165
169
  // There are two special cases.
166
170
  // - empty: we should do nothing. The metrics are 0.
@@ -172,7 +176,7 @@ SC.AutoResize = {
172
176
  if (SC.none(value) || value === "") {
173
177
  metrics = { width: 0, height: 0 };
174
178
  } else if (batch) {
175
- metrics = SC.measureString(value);
179
+ metrics = SC.measureString(value, ignoreEscape);
176
180
  } else {
177
181
  // Normal resize pattern: get our own layer, pass it as a template to SC.metricsForString.
178
182
  layer = this.get('autoResizeLayer');
@@ -181,7 +185,7 @@ SC.AutoResize = {
181
185
  return;
182
186
  }
183
187
 
184
- metrics = SC.metricsForString(value, layer);
188
+ metrics = SC.metricsForString(value, layer, this.get('classNames'), ignoreEscape);
185
189
  }
186
190
 
187
191
  // metrics should include padding
@@ -318,13 +322,16 @@ SC.AutoResizeManager = {
318
322
  if (batches.hasOwnProperty(tag)) {
319
323
  views = batches[tag];
320
324
 
321
- // step through until you find one with a layer
325
+ // step through until you find one with a layer and also visible
322
326
  while ((view = views.pop())) {
327
+
328
+ if(!view.get('isVisible')) continue;
329
+
323
330
  layer = view.get('autoResizeLayer');
324
331
 
325
332
  // use the layer to prepare the measurement
326
333
  if(layer) {
327
- SC.prepareStringMeasurement(layer);
334
+ SC.prepareStringMeasurement(layer, view.get('classNames'));
328
335
  view.measureSize(YES);
329
336
  break;
330
337
  }
@@ -332,7 +339,7 @@ SC.AutoResizeManager = {
332
339
 
333
340
  // now measure the rest using the same settings
334
341
  while ((view = views.pop())) {
335
- view.measureSize(YES);
342
+ if(view.get('isVisible')) view.measureSize(YES);
336
343
  }
337
344
 
338
345
  SC.teardownStringMeasurement();
@@ -5,10 +5,7 @@
5
5
  // License: Licensed under MIT license (see license.js)
6
6
  // ==========================================================================
7
7
 
8
- SC.Button = {
9
-
10
- initMixin: function(){
11
- SC.Logger.warn("SC.Button is deprecated and does nothing. Subclass SC.ButtonView instead.");
12
- }
13
-
14
- } ;
8
+ SC.Button.initMixin = function(){
9
+ throw "SC.Button is deprecated as a mixin and is now a subclass of SC.TemplateView. Subclass SC.ButtonView instead.";
10
+ };
11
+
@@ -280,19 +280,22 @@ SC.FlowedLayout = {
280
280
  // if it is a spacer, we must set the dimension that it
281
281
  // expands in to 0.
282
282
  if (view.get('isSpacer')) {
283
- if (this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL) calc.width = 0;
284
- else calc.height = 0;
283
+ if (this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL) {
284
+ calc.width = view.get('layout').minWidth || 0;
285
+ } else {
286
+ calc.height = view.get('layout').minHeight || 0;
287
+ }
285
288
  }
286
289
 
287
290
  // if it has a fillWidth/Height, clear it for later
288
291
  if (
289
292
  this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL && view.get('fillHeight')
290
293
  ) {
291
- calc.height = 0;
294
+ calc.height = view.get('layout').minHeight || 0;
292
295
  } else if (
293
296
  this.get('layoutDirection') === SC.LAYOUT_VERTICAL && view.get('fillWidth')
294
297
  ) {
295
- calc.width = 0;
298
+ calc.width = view.get('layout').minWidth || 0;
296
299
  }
297
300
 
298
301
  // return
@@ -305,12 +308,34 @@ SC.FlowedLayout = {
305
308
  }.property('calculatedWidth', 'calculatedHeight'),
306
309
 
307
310
  /** @private */
311
+
312
+ // the maximum row length when all flexible items are collapsed.
313
+ _scfl_maxCollapsedRowLength: 0,
314
+
315
+ // the total row size when all flexible rows are collapsed.
316
+ _scfl_totalCollapsedRowSize: 0,
317
+
318
+
308
319
  _scfl_calculatedSizeDidChange: function() {
309
320
  if(this.get('autoResize')) {
310
- if(this.get('shouldResizeWidth')) this.adjust('minWidth', this.get('calculatedWidth'));
311
- if(this.get('shouldResizeHeight')) this.adjust('minHeight', this.get('calculatedHeight'));
321
+ if (this.get('layoutDirection') == SC.LAYOUT_VERTICAL) {
322
+ if (this.get('shouldResizeHeight')) {
323
+ this.adjust('minHeight', this.get('_scfl_maximumCollapsedRowLength'));
324
+ }
325
+
326
+ if (this.get('shouldResizeWidth')) {
327
+ this.adjust('minWidth', this.get('_scfl_totalCollapsedRowSize'));
328
+ }
329
+ } else {
330
+ if (this.get('shouldResizeWidth')) {
331
+ this.adjust('minWidth', this.get('_scfl_maximumCollapsedRowLength'));
332
+ }
333
+ if (this.get('shouldResizeHeight')) {
334
+ this.adjust('minHeight', this.get('_scfl_totalCollapsedRowSize'));
335
+ }
336
+ }
312
337
  }
313
- }.observes('autoResize', 'shouldResizeWidth', 'calculatedWidth', 'shouldResizeHeight', 'calculatedHeight'),
338
+ }.observes('autoResize', 'shouldResizeWidth', '_scfl_maximumCollapsedRowLength', '_scfl_totalCollapsedRowSize', 'shouldResizeHeight'),
314
339
 
315
340
  /**
316
341
  @private
@@ -344,6 +369,14 @@ SC.FlowedLayout = {
344
369
  // The rows array starts empty. It will get filled out by the method
345
370
  // _scfl_distributeChildrenIntoRows.
346
371
  rows: undefined,
372
+
373
+
374
+ // the maximum row length where all collapsible items are collapsed.
375
+ maximumCollapsedRowLength: 0,
376
+
377
+ // the total sizes of all rows when collapsed (With flex-height rows
378
+ // at minimum size)
379
+ totalCollapsedRowSize: 0,
347
380
 
348
381
  // These properties are calculated once here, but later used by
349
382
  // the various methods.
@@ -438,12 +471,13 @@ SC.FlowedLayout = {
438
471
  // this must be set before we check if the child is included because even
439
472
  // if it isn't included, we need to remember that there is a line break
440
473
  // for later
441
- newRowPending = newRowPending || (idx !== startingAt && child.get('startsNewRow'));
474
+ newRowPending = newRowPending || (items.length > 0 && child.get('startsNewRow'));
442
475
 
443
476
  if (!this.shouldIncludeChildInFlow(idx, child)) continue;
444
477
 
445
478
  childSize = this.flowSizeForChild(idx, child);
446
479
  spacing = this.flowSpacingForChild(idx, child);
480
+
447
481
  childSpacedSize = {
448
482
  width: childSize.width + spacing.left + spacing.right,
449
483
  height: childSize.height + spacing.top + spacing.bottom
@@ -490,6 +524,7 @@ SC.FlowedLayout = {
490
524
  }
491
525
 
492
526
  row.rowLength = itemOffset;
527
+ row.plan.maximumCollapsedRowLength = Math.max(row.rowLength, row.plan.maximumCollapsedRowLength);
493
528
  row.items = items;
494
529
  return idx;
495
530
  },
@@ -569,6 +604,8 @@ SC.FlowedLayout = {
569
604
  row.shouldExpand = shouldExpand;
570
605
  row.rowLength = position - row.plan.rowStartPadding; // row length does not include padding
571
606
  row.rowSize = rowSize;
607
+
608
+ row.plan.totalCollapsedRowSize += row.rowSize;
572
609
 
573
610
  },
574
611
 
@@ -658,8 +695,9 @@ SC.FlowedLayout = {
658
695
  this.beginPropertyChanges();
659
696
 
660
697
  this.set('calculatedHeight', isVertical ? longestRow : totalSize);
661
-
662
698
  this.set('calculatedWidth', isVertical ? totalSize : longestRow);
699
+ this.set('_scfl_maximumCollapsedRowLength', plan.maximumCollapsedRowLength);
700
+ this.set('_scfl_totalCollapsedRowSize', plan.totalCollapsedRowSize);
663
701
 
664
702
  this.endPropertyChanges();
665
703
  },
@@ -699,11 +737,15 @@ SC.FlowedLayout = {
699
737
 
700
738
  /** @private */
701
739
  _scfl_frameDidChange: function() {
702
- var frame = this.get("frame"), lf = this._scfl_lastFrameSize;
703
- this._scfl_lastFrameSize = frame;
740
+ if (this._scfl_isChangingSize) return;
741
+
742
+ var frame = this.get("frame"), lf = this._scfl_lastFrameSize || {};
743
+ this._scfl_lastFrameSize = SC.clone(frame);
744
+
745
+ if (lf.width == frame.width && lf.height == frame.height) {
746
+ return;
747
+ }
704
748
 
705
- if (lf && lf.width == frame.width && lf.height == frame.height) return;
706
-
707
749
  this.invokeOnce("_scfl_tile");
708
750
  }.observes("frame"),
709
751