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

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 (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
@@ -14,6 +14,8 @@ SC.STRING_TITLEIZE_REGEXP = (/([\s|\-|\_|\n])([^\s|\-|\_|\n]?)/g);
14
14
  SC.STRING_DECAMELIZE_REGEXP = (/([a-z])([A-Z])/g);
15
15
  SC.STRING_DASHERIZE_REGEXP = (/[ _]/g);
16
16
  SC.STRING_DASHERIZE_CACHE = {};
17
+ SC.STRING_TRIM_LEFT_REGEXP = (/^\s+/g);
18
+ SC.STRING_TRIM_RIGHT_REGEXP = (/\s+$/g);
17
19
 
18
20
  /**
19
21
  @namespace
@@ -134,6 +136,8 @@ SC.mixin(SC.String, {
134
136
 
135
137
  var args = SC.$A(arguments);
136
138
  args.shift(); // remove str param
139
+ //to extend String.prototype
140
+ if(args.length>0 && args[0].isSCArray) args=args[0];
137
141
 
138
142
  return SC.String.fmt(localized, args);
139
143
  },
@@ -158,5 +162,62 @@ SC.mixin(SC.String, {
158
162
  args.shift(); // remove def param
159
163
 
160
164
  return SC.String.fmt(localized, args);
165
+ },
166
+
167
+ /**
168
+ Removes any extra whitespace from the edges of the string. This method is
169
+ also aliased as strip().
170
+
171
+ @returns {String} the trimmed string
172
+ */
173
+ trim: jQuery.trim,
174
+
175
+ /**
176
+ Removes any extra whitespace from the left edge of the string.
177
+
178
+ @returns {String} the trimmed string
179
+ */
180
+ trimLeft: function (str) {
181
+ return str.replace(SC.STRING_TRIM_LEFT_REGEXP,"");
182
+ },
183
+
184
+ /**
185
+ Removes any extra whitespace from the right edge of the string.
186
+
187
+ @returns {String} the trimmed string
188
+ */
189
+ trimRight: function (str) {
190
+ return str.replace(SC.STRING_TRIM_RIGHT_REGEXP,"");
161
191
  }
162
192
  });
193
+
194
+
195
+ // IE doesn't support string trimming
196
+ if(String.prototype.trim) {
197
+ SC.supplement(String.prototype,
198
+ /** @scope String.prototype */ {
199
+
200
+ trim: function() {
201
+ return SC.String.trim(this, arguments);
202
+ },
203
+
204
+ trimLeft: function() {
205
+ return SC.String.trimLeft(this, arguments);
206
+ },
207
+
208
+ trimRight: function() {
209
+ return SC.String.trimRight(this, arguments);
210
+ }
211
+ });
212
+ }
213
+
214
+ // We want the version defined here, not in Runtime
215
+ SC.mixin(String.prototype,
216
+ /** @scope String.prototype */ {
217
+
218
+ loc: function() {
219
+ return SC.String.loc(this.toString(), SC.$A(arguments));
220
+ }
221
+
222
+ });
223
+
@@ -117,21 +117,35 @@ SC.mixin( /** @scope SC */ {
117
117
  mobileBuildNumber = userAgent.substring(index + 7, index + 9);
118
118
 
119
119
  if (parseInt(SC.browser.mobileSafari, 0) <= 532 || (mobileBuildNumber <= "8A")) {
120
- result.left = result.left - window.pageXOffset;
121
- result.top = result.top - window.pageYOffset;
120
+ result.left -= window.pageXOffset;
121
+ result.top -= window.pageYOffset;
122
122
  }
123
123
  }
124
124
 
125
125
  // Subtract the scroll offset for viewport coordinates
126
126
  if (relativeToFlag === 'viewport') {
127
- result.left = result.left - window.pageXOffset;
128
- result.top = result.top - window.pageYOffset;
127
+
128
+ if(SC.browser.isIE8OrLower){
129
+ result.left -= $(window).scrollLeft();
130
+ result.top -= $(window).scrollTop();
131
+ }else{
132
+ result.left -= window.pageXOffset;
133
+ result.top -= window.pageYOffset;
134
+ }
129
135
  }
130
136
  }
131
137
 
132
138
  // Translate 'left', 'top' to 'x', 'y'
133
- result.x = result.left;
134
- result.y = result.top;
139
+
140
+ try{
141
+ result.x = result.left;
142
+ result.y = result.top;
143
+ } catch (e) {
144
+ // We need this for IE, when the element is detached, for some strange
145
+ // reason the object returned by element.getBoundingClientRect()
146
+ // is read-only
147
+ result = {x:result.left, y:result.top};
148
+ }
135
149
  delete result.left;
136
150
  delete result.top;
137
151
 
@@ -287,6 +287,48 @@ test("should invalidate property when property on any enumerable changes", funct
287
287
  equals(recomputed, 0, "does not recalculate after changing key on removed item");
288
288
  });
289
289
 
290
+ test("should invalidate property when property of array item changes after content has changed", function() {
291
+ var inventory = [];
292
+ var recomputed = 0;
293
+
294
+ for (var idx = 0; idx < 20; idx++) {
295
+ inventory.pushObject(SC.Object.create({
296
+ price: 5
297
+ }));
298
+ }
299
+ var restaurant = SC.ArrayController.create({
300
+ content: [],
301
+
302
+ totalCost: function() {
303
+ recomputed++;
304
+ return inventory.reduce(function(prev, item) {
305
+ return prev+item.get('price');
306
+ }, 0);
307
+ }.property('@each.price').cacheable()
308
+ });
309
+
310
+ restaurant.set('content', inventory);
311
+
312
+ equals(restaurant.get('totalCost'), 100, "precond - computes cost of all items");
313
+ inventory[0].set('price', 6);
314
+
315
+ equals(restaurant.get('totalCost'), 101, "recalculates after dependent key on an enumerable item changes");
316
+ inventory[19].set('price', 6);
317
+
318
+ equals(restaurant.get('totalCost'), 102, "recalculates after dependent key on a different item changes");
319
+ inventory.pushObject(SC.Object.create({
320
+ price: 5
321
+ }));
322
+ equals(restaurant.get('totalCost'), 107, "recalculates after adding an item to the enumerable");
323
+
324
+ var item = inventory.popObject();
325
+ equals(restaurant.get('totalCost'), 102, "recalculates after removing an item from the enumerable");
326
+
327
+ recomputed = 0;
328
+ item.set('price', 0);
329
+ equals(recomputed, 0, "does not recalculate after changing key on removed item");
330
+ });
331
+
290
332
  // ..........................................................
291
333
  // VERIFY SC.ARRAY COMPLIANCE
292
334
  //
@@ -1,78 +1,60 @@
1
- var button;
1
+ var button, rootResponder, pane, expectedAction, targetObject, sendActionSpy;
2
2
 
3
3
  module("SC.Button", {
4
4
  setup: function() {
5
- button = SC.Button.create();
5
+ expectedAction = 'myAction';
6
+ targetObject = SC.Object.create({
7
+ myAction: function() {
8
+ }
9
+ });
10
+
11
+ var rootResponder = {sendAction: function(){} };
12
+ sendActionSpy = CoreTest.spyOn(rootResponder, 'sendAction');
6
13
 
7
- pane = SC.MainPane.create({
8
- childViews: [button]
14
+ pane = SC.Object.create({
15
+ rootResponder: rootResponder
9
16
  });
10
- pane.append();
11
- },
12
17
 
13
- teardown: function() {
14
- pane.remove();
18
+ button = SC.Button.create({
19
+ target: targetObject,
20
+ action: 'myAction',
21
+ pane: pane
22
+ });
15
23
  }
16
24
  });
17
25
 
18
- function synthesizeEvent(type, view) {
19
- var event = new SC.Event({
20
- type: type,
21
- target: view.get('layer')
22
- });
23
- SC.RootResponder.responder[type](event);
24
- }
25
-
26
- test("should trigger an action when clicked", function() {
27
- var wasClicked = false;
28
-
29
- var actionObject = SC.Object.create({
30
- myAction: function() {
31
- wasClicked = true;
32
- }
33
- });
34
-
35
- button.target = actionObject;
36
- button.action = 'myAction';
26
+ test("#mouseUp - triggers the action when mouse is over the button", function() {
27
+ button.set('isActive', true);
37
28
 
38
- synthesizeEvent('mousedown', button);
39
- synthesizeEvent('mouseup', button);
29
+ button.mouseUp();
40
30
 
41
- ok(wasClicked);
31
+ ok(sendActionSpy.wasCalledWith(expectedAction, targetObject, button, pane, null, button), 'triggers the action');
42
32
  });
43
33
 
44
- test("should not trigger action if mouse leaves area before mouseup", function() {
45
- var wasClicked = false;
34
+ test("#mouseUp - does not trigger action if mouse is not over the button", function() {
35
+ button.set('isActive', false);
46
36
 
47
- var actionObject = SC.Object.create({
48
- myAction: function() {
49
- wasClicked = true;
50
- }
51
- });
52
-
53
- var otherButton = SC.Button.create();
54
- pane.appendChild(otherButton);
37
+ button.mouseUp();
38
+ ok(!sendActionSpy.wasCalled, 'should not trigger the action');
39
+ });
55
40
 
56
- button.target = actionObject;
57
- button.action = 'myAction';
41
+ test('#mouseUp - makes the button no longer active', function () {
42
+ button.set('isActive', true);
43
+ button.mouseUp();
58
44
 
59
- synthesizeEvent('mousedown', button);
60
- synthesizeEvent('mousemove', button);
61
- ok(button.get('isActive'), "becomes active when hovered");
62
- synthesizeEvent('mousemove', otherButton);
63
- ok(!button.get('isActive'), "loses active state if mouse exits");
64
- synthesizeEvent('mouseup', button);
45
+ equals(button.get('isActive'), false, 'should set the button to not be active');
46
+ });
65
47
 
66
- ok(!wasClicked);
48
+ test('#mouseDown - makes the button active', function() {
49
+ button.set('isActive', false);
50
+ button.mouseDown();
67
51
 
68
- wasClicked = false;
52
+ equals(button.get('isActive'), true, 'should set the button to be active');
53
+ });
69
54
 
70
- synthesizeEvent('mousedown', button);
71
- synthesizeEvent('mousemove', button);
72
- synthesizeEvent('mousemove', otherButton);
73
- synthesizeEvent('mousemove', button);
74
- synthesizeEvent('mouseup', button);
55
+ test('#mouseExited - makes but button no longer active', function() {
56
+ button.set('isActive', false);
57
+ button.mouseExited();
75
58
 
76
- ok(wasClicked);
59
+ equals(button.get('isActive'), false, 'should set the button to no longer be active');
77
60
  });
78
-
@@ -52,9 +52,11 @@ test("extracts styles from element on first retrieval", function() {
52
52
 
53
53
  var result = context.styles();
54
54
 
55
-
56
- same(result, { color: 'black', height: '20px', borderTop: '1px solid hotpink', WebkitColumnCount: '3' }, 'extracted style. This is failing in IE8 because it return styles like cOLOR.');
57
-
55
+ if(SC.browser.msie){
56
+ same(result, { color: 'black', height: '20px', borderTop: 'hotpink 1px solid', WebkitColumnCount: '3' }, 'extracted style. This is failing in IE8 because it return styles like cOLOR.');
57
+ }else{
58
+ same(result, { color: 'black', height: '20px', borderTop: '1px solid hotpink', WebkitColumnCount: '3' }, 'extracted style. This is failing in IE8 because it return styles like cOLOR.');
59
+ }
58
60
  equals(context.styles(), result, "should reuse same instance thereafter");
59
61
  });
60
62
 
@@ -77,6 +77,38 @@ test("element to be added is at idx < length of array ", function() {
77
77
  equals(5, ary.get('length'), "length") ;
78
78
  });
79
79
 
80
+ test("should work with @each dependent keys", function() {
81
+ var array = SC.SparseArray.create();
82
+
83
+ array.pushObject(SC.Object.create({
84
+ value: 5
85
+ }));
86
+ array.provideLength(1);
87
+
88
+ var obj = SC.Object.create({
89
+ total: function() {
90
+ return this.get('content').reduce(function(prev, item) {
91
+ return prev + item.get('value');
92
+ }, 0);
93
+ }.property('content.@each.value'),
94
+
95
+ content: array
96
+ });
97
+
98
+ equals(obj.get('total'), 5, "precond - computes total of all objects");
99
+
100
+ array.pushObject(SC.Object.create({
101
+ value: 10
102
+ }));
103
+
104
+ equals(obj.get('total'), 15, "recomputes when a new object is added");
105
+
106
+ array.objectAt(1).set('value', 15);
107
+
108
+ equals(obj.get('total'), 20, "recomputes when value property on child object changes");
109
+
110
+ });
111
+
80
112
 
81
113
  test("modifying a range should not require the rest of the array to refetch", function() {
82
114
  var del = {
@@ -247,3 +247,28 @@ test("should re-render when the content object changes", function() {
247
247
  equals(view.$('li:eq(0)').text(), "ramalamadingdong");
248
248
 
249
249
  });
250
+
251
+ test("should allow changes to content object before layer is created", function() {
252
+ var view = SC.TemplateCollectionView.create({
253
+ content: null
254
+ });
255
+
256
+ view.set('content', []);
257
+ view.set('content', [1, 2, 3]);
258
+ view.set('content', [1, 2]);
259
+
260
+ view.createLayer();
261
+ ok(view.$('li').length);
262
+ });
263
+
264
+ test("should allow changing content property to be null", function() {
265
+ var view = SC.TemplateCollectionView.create({
266
+ content: [1, 2, 3]
267
+ });
268
+
269
+ view.createLayer();
270
+ equals(view.$('li').length, 3, "precond - creates three elements");
271
+
272
+ view.set('content', null);
273
+ equals(view.$('li').length, 0, "should not create any li elements");
274
+ });
@@ -1,9 +1,10 @@
1
1
  // ==========================================================================
2
2
  // Project: SproutCore - JavaScript Application Framework
3
3
  // Copyright: ©2006-2011 Strobe Inc. and contributors.
4
- // ©2008-2011 Apple Inc. All rights reserved.
5
4
  // License: Licensed under MIT license (see license.js)
6
5
  // ==========================================================================
6
+
7
+ /*globals TemplateTests module */
7
8
  /**
8
9
  This module specifically tests integration with Handlebars and SproutCore-specific
9
10
  Handlebars extensions.
@@ -293,23 +294,29 @@ test("Handlebars templates update properties if a content object changes", funct
293
294
  equals(view.$('h2').text(), "brown coffee", "precond - renders color correctly");
294
295
  equals(view.$('#price').text(), '$4', "precond - renders price correctly");
295
296
 
296
- view.set('coffee', SC.Object.create({
297
- color: "mauve",
298
- price: "$4.50"
299
- }));
297
+ SC.run(function() {
298
+ view.set('coffee', SC.Object.create({
299
+ color: "mauve",
300
+ price: "$4.50"
301
+ }));
302
+ });
300
303
 
301
304
  equals(view.$('h2').text(), "mauve coffee", "should update name field when content changes");
302
305
  equals(view.$('#price').text(), "$4.50", "should update price field when content changes");
303
306
 
304
- view.set('coffee', SC.Object.create({
305
- color: "mauve",
306
- price: "$5.50"
307
- }));
307
+ SC.run(function() {
308
+ view.set('coffee', SC.Object.create({
309
+ color: "mauve",
310
+ price: "$5.50"
311
+ }));
312
+ });
308
313
 
309
314
  equals(view.$('h2').text(), "mauve coffee", "should update name field when content changes");
310
315
  equals(view.$('#price').text(), "$5.50", "should update price field when content changes");
311
316
 
312
- view.setPath('coffee.price', "$5");
317
+ SC.run(function() {
318
+ view.setPath('coffee.price', "$5");
319
+ });
313
320
 
314
321
  equals(view.$('#price').text(), "$5", "should update price field when price property is changed");
315
322
  });
@@ -334,11 +341,11 @@ test("Template updates correctly if a path is passed to the bind helper", functi
334
341
 
335
342
  equals(view.$('h1').text(), "$4", "precond - renders price");
336
343
 
337
- view.setPath('coffee.price', "$5");
344
+ SC.run(function() { view.setPath('coffee.price', "$5"); });
338
345
 
339
346
  equals(view.$('h1').text(), "$5", "updates when property changes");
340
347
 
341
- view.set('coffee', { price: "$6" });
348
+ SC.run(function() { view.set('coffee', { price: "$6" }); });
342
349
  equals(view.$('h1').text(), "$6", "updates when parent property changes");
343
350
  });
344
351
 
@@ -354,7 +361,7 @@ test("Template updates correctly if a path is passed to the bind helper and the
354
361
  price: "$4"
355
362
  });
356
363
 
357
- controller.set('content', realObject);
364
+ SC.run(function() { controller.set('content', realObject); });
358
365
 
359
366
  var view = SC.TemplateView.create({
360
367
  templateName: 'menu',
@@ -367,7 +374,7 @@ test("Template updates correctly if a path is passed to the bind helper and the
367
374
 
368
375
  equals(view.$('h1').text(), "$4", "precond - renders price");
369
376
 
370
- realObject.set('price', "$5");
377
+ SC.run(function() { realObject.set('price', "$5"); });
371
378
 
372
379
  equals(view.$('h1').text(), "$5", "updates when property is set on real object");
373
380
 
@@ -907,8 +914,10 @@ test("should be able to bind boolean element attributes using {{bindAttr}}", fun
907
914
  ok(!view.$('input').attr('disabled'), 'attribute does not exist upon initial render');
908
915
  ok(view.$('input').attr('checked'), 'attribute is present upon initial render');
909
916
 
910
- content.set('isDisabled', true);
911
- content.set('isChecked', false);
917
+ SC.run(function() {
918
+ content.set('isDisabled', true);
919
+ content.set('isChecked', false);
920
+ });
912
921
 
913
922
  ok(view.$('input').attr('disabled'), 'attribute exists after update');
914
923
  ok(!view.$('input').attr('checked'), 'attribute is not present after update');
@@ -931,7 +940,9 @@ test("should be able to add multiple classes using {{bindAttr class}}", function
931
940
  ok(view.$('div').hasClass('is-awesome-sauce'), "dasherizes first property and sets classname");
932
941
  ok(view.$('div').hasClass('is-also-cool'), "dasherizes second property and sets classname");
933
942
 
934
- content.set('isAwesomeSauce', false);
943
+ SC.run(function() {
944
+ content.set('isAwesomeSauce', false);
945
+ });
935
946
 
936
947
  ok(!view.$('div').hasClass('is-awesome-sauce'), "removes dasherized class when property is set to false");
937
948
  });