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
@@ -10,6 +10,8 @@
10
10
  sc_require('system/state');
11
11
 
12
12
  /**
13
+ @class
14
+
13
15
  The startchart manager mixin allows an object to be a statechart. By becoming a statechart, the
14
16
  object can then be manage a set of its own states.
15
17
 
@@ -163,10 +165,9 @@ sc_require('system/state');
163
165
  into as many files as you see fit.
164
166
 
165
167
  @author Michael Cohen
166
-
167
168
  */
168
169
 
169
- SC.StatechartManager = {
170
+ SC.StatechartManager = /** @scope SC.StatechartManager.prototype */{
170
171
 
171
172
  // Walk like a duck
172
173
  isResponderContext: YES,
@@ -547,7 +548,8 @@ SC.StatechartManager = {
547
548
  trace = this.get('allowStatechartTracing'),
548
549
  rootState = this.get('rootState'),
549
550
  paramState = state,
550
- paramFromCurrentState = fromCurrentState;
551
+ paramFromCurrentState = fromCurrentState,
552
+ msg;
551
553
 
552
554
  state = rootState.getSubstate(state);
553
555
 
@@ -578,7 +580,7 @@ SC.StatechartManager = {
578
580
  // Check to make sure the current state given is actually a current state of this statechart
579
581
  fromCurrentState = rootState.getSubstate(fromCurrentState);
580
582
  if (SC.none(fromCurrentState) || !fromCurrentState.get('isCurrentState')) {
581
- var msg = "Can not to goto state %@. %@ is not a recognized current state in statechart";
583
+ msg = "Can not to goto state %@. %@ is not a recognized current state in statechart";
582
584
  this.statechartLogError(msg.fmt(paramState, paramFromCurrentState));
583
585
  this._gotoStateLocked = NO;
584
586
  return;
@@ -592,8 +594,12 @@ SC.StatechartManager = {
592
594
 
593
595
  if (trace) {
594
596
  this.statechartLogTrace("BEGIN gotoState: %@".fmt(state));
595
- this.statechartLogTrace("starting from current state: %@".fmt(fromCurrentState));
596
- this.statechartLogTrace("current states before: %@".fmt(this.get('currentStates')));
597
+ msg = "starting from current state: %@";
598
+ msg = msg.fmt(fromCurrentState ? fromCurrentState : '---');
599
+ this.statechartLogTrace(msg);
600
+ msg = "current states before: %@";
601
+ msg = msg.fmt(this.getPath('currentStates.length') > 0 ? this.get('currentStates') : '---');
602
+ this.statechartLogTrace(msg);
597
603
  }
598
604
 
599
605
  // If there is a current state to start the transition process from, then determine what
@@ -739,7 +745,7 @@ SC.StatechartManager = {
739
745
  parentState = parentState.get('parentState');
740
746
  }
741
747
 
742
- if (this.get('allowStatechartTracing')) this.statechartLogTrace("exiting state: %@".fmt(state));
748
+ if (this.get('allowStatechartTracing')) this.statechartLogTrace("<-- exiting state: %@".fmt(state));
743
749
 
744
750
  state.set('currentSubstates', []);
745
751
  state.notifyPropertyChange('isCurrentState');
@@ -787,7 +793,7 @@ SC.StatechartManager = {
787
793
  parentState = parentState.get('parentState');
788
794
  }
789
795
 
790
- if (this.get('allowStatechartTracing')) this.statechartLogTrace("entering state: %@".fmt(state));
796
+ if (this.get('allowStatechartTracing')) this.statechartLogTrace("--> entering state: %@".fmt(state));
791
797
 
792
798
  state.notifyPropertyChange('isCurrentState');
793
799
 
@@ -1474,73 +1480,3 @@ SC.Statechart = SC.Object.extend(SC.StatechartManager, {
1474
1480
  });
1475
1481
 
1476
1482
  SC.Statechart.design = SC.Statechart.extend;
1477
-
1478
- /**
1479
- Represents a call that is intended to be asynchronous. This is
1480
- used during a state transition process when either entering or
1481
- exiting a state.
1482
- */
1483
- SC.Async = SC.Object.extend({
1484
-
1485
- func: null,
1486
-
1487
- arg1: null,
1488
-
1489
- arg2: null,
1490
-
1491
- /** @private
1492
- Called by the statechart
1493
- */
1494
- tryToPerform: function(state) {
1495
- var func = this.get('func'),
1496
- arg1 = this.get('arg1'),
1497
- arg2 = this.get('arg2'),
1498
- funcType = SC.typeOf(func);
1499
-
1500
- if (funcType === SC.T_STRING) {
1501
- state.tryToPerform(func, arg1, arg2);
1502
- }
1503
- else if (funcType === SC.T_FUNCTION) {
1504
- func.apply(state, [arg1, arg2]);
1505
- }
1506
- }
1507
-
1508
- });
1509
-
1510
- /**
1511
- Singleton
1512
- */
1513
- SC.Async.mixin({
1514
-
1515
- /**
1516
- Call in either a state's enterState or exitState method when you
1517
- want a state to perform an asynchronous action, such as an animation.
1518
-
1519
- Examples:
1520
-
1521
- SC.State.extend({
1522
-
1523
- enterState: function() {
1524
- return SC.Async.perform('foo');
1525
- },
1526
-
1527
- exitState: function() {
1528
- return SC.Async.perform('bar', 100);
1529
- }
1530
-
1531
- foo: function() { ... },
1532
-
1533
- bar: function(arg) { ... }
1534
-
1535
- });
1536
-
1537
- @param func {String|Function} the functio to be invoked on a state
1538
- @param arg1 Optional. An argument to pass to the given function
1539
- @param arg2 Optional. An argument to pass to the given function
1540
- @return {SC.Async} a new instance of a SC.Async
1541
- */
1542
- perform: function(func, arg1, arg2) {
1543
- return SC.Async.create({ func: func, arg1: arg1, arg2: arg2 });
1544
- }
1545
-
1546
- });
@@ -0,0 +1,464 @@
1
+ // ==========================================================================
2
+ // SC.Statechart Unit Test
3
+ // ==========================================================================
4
+ /*globals SC */
5
+
6
+ var obj, monitor, rootState, a, b, c, d, e, m, n, o, p, x, y;
7
+
8
+ module("SC.Statechart: Destroy Statechart Tests", {
9
+ setup: function() {
10
+
11
+ obj = SC.Object.create(SC.StatechartManager, {
12
+
13
+ initialState: 'A',
14
+ A: SC.State.design(),
15
+ B: SC.State.design(),
16
+ C: SC.State.design(),
17
+ D: SC.State.design(),
18
+ E: SC.State.design(),
19
+ M: SC.State.design(),
20
+ N: SC.State.design(),
21
+ O: SC.State.design(),
22
+ P: SC.State.design(),
23
+ X: SC.State.design(),
24
+ Y: SC.State.design()
25
+
26
+ });
27
+
28
+ obj.initStatechart();
29
+ rootState = obj.get('rootState');
30
+ a = obj.getState('A');
31
+ b = obj.getState('B');
32
+ c = obj.getState('C');
33
+ d = obj.getState('D');
34
+ e = obj.getState('E');
35
+ m = obj.getState('M');
36
+ n = obj.getState('N');
37
+ o = obj.getState('O');
38
+ p = obj.getState('P');
39
+ x = obj.getState('X');
40
+ y = obj.getState('Y');
41
+
42
+ monitor = SC.StatechartMonitor.create({ statechart: obj });
43
+ },
44
+
45
+ teardown: function() {
46
+ obj = monitor = rootState = null;
47
+ a = b = c = d = e = m = n = o = p = x = y = null;
48
+ }
49
+ });
50
+
51
+ test("match against sequence entered A", function() {
52
+ monitor.pushEnteredState(a);
53
+
54
+ var matcher = monitor.matchSequence();
55
+
56
+ ok(matcher.begin().entered(a).end(), "should match entered A");
57
+ ok(matcher.begin().entered('A').end(), "should match entered 'A'");
58
+ ok(!matcher.begin().entered(b).end(), "should not match entered B");
59
+ ok(!matcher.begin().exited(a).end(), "should not match exited A");
60
+ ok(!matcher.begin().exited(b).end(), "should not match exited B");
61
+ ok(!matcher.begin().entered(a, b).end(), "should not match entered [A, B]");
62
+ ok(!matcher.begin().entered(a).entered(b).end(), "should not match entered A, entered B");
63
+ });
64
+
65
+ test("match against sequence exited A", function() {
66
+ monitor.pushExitedState(a);
67
+
68
+ var matcher = monitor.matchSequence();
69
+
70
+ ok(matcher.begin().exited(a).end(), "should match exited A");
71
+ ok(matcher.begin().exited('A').end(), "should match exited 'A'");
72
+ ok(!matcher.begin().exited(b).end(), "should not match exited B");
73
+ ok(!matcher.begin().entered(a).end(), "should not match entered A");
74
+ ok(!matcher.begin().entered(b).end(), "should not match entered B");
75
+ ok(!matcher.begin().exited(a, b).end(), "should not match exited [A, B]");
76
+ ok(!matcher.begin().exited(a).exited(b).end(), "should not match exited A, exited B");
77
+ });
78
+
79
+ test("match against sequence entered A, entered B", function() {
80
+ monitor.pushEnteredState(a);
81
+ monitor.pushEnteredState(b);
82
+
83
+ var matcher = monitor.matchSequence();
84
+
85
+ ok(matcher.begin().entered(a, b).end(), "should match entered [A, B]");
86
+ ok(matcher.begin().entered('A', 'B').end(), "should match entered ['A', 'B']");
87
+ ok(matcher.begin().entered(a).entered(b).end(), "should match entered A, entered B");
88
+ ok(!matcher.begin().entered(a).end(), "should not match entered A");
89
+ ok(!matcher.begin().entered(b).end(), "should not match entered B");
90
+ ok(!matcher.begin().entered(b, a).end(), "should not match entered [B, A]");
91
+ ok(!matcher.begin().entered('B', 'A').end(), "should match entered ['B', 'A']");
92
+ ok(!matcher.begin().entered(b).entered(a).end(), "should not matched entered B, entered A");
93
+ ok(!matcher.begin().entered(a, c).end(), "should not match entered [A, C]");
94
+ ok(!matcher.begin().entered('A', 'C').end(), "should not match entered [A, C]");
95
+ ok(!matcher.begin().entered(a).entered(c).end(), "should not match entered A, entered C");
96
+ ok(!matcher.begin().entered(a, b, c).end(), "should not match entered [A, B, C]");
97
+ });
98
+
99
+ test("match against sequence exited A, exited B", function() {
100
+ monitor.pushExitedState(a);
101
+ monitor.pushExitedState(b);
102
+
103
+ var matcher = monitor.matchSequence();
104
+
105
+ ok(matcher.begin().exited(a, b).end(), "should match exited [A, B]");
106
+ ok(matcher.begin().exited('A', 'B').end(), "should match exited ['A', 'B']");
107
+ ok(matcher.begin().exited(a).exited(b).end(), "should match exited A, entered B");
108
+ ok(!matcher.begin().exited(a).end(), "should not match exited A");
109
+ ok(!matcher.begin().exited(b).end(), "should not match exited B");
110
+ ok(!matcher.begin().exited(b, a).end(), "should not match exited [B, A]");
111
+ ok(!matcher.begin().exited('B', 'A').end(), "should not match exited ['B', 'A']");
112
+ ok(!matcher.begin().exited(b).exited(a).end(), "should not matched exited B, exited A");
113
+ ok(!matcher.begin().exited(a, c).end(), "should not match exited [A, C]");
114
+ ok(!matcher.begin().exited('A', 'C').end(), "should not match exited ['A', 'C']");
115
+ ok(!matcher.begin().exited(a).exited(c).end(), "should not match exited A, exited C");
116
+ });
117
+
118
+ test("match against sequence exited A, entered B", function() {
119
+ monitor.pushExitedState(a);
120
+ monitor.pushEnteredState(b);
121
+
122
+ var matcher = monitor.matchSequence();
123
+
124
+ ok(matcher.begin().exited(a).entered(b).end(), "should match exited A, entered B");
125
+ ok(matcher.begin().exited('A').entered('B').end(), "should match exited 'A', entered 'B'");
126
+ ok(!matcher.begin().entered(a).exited(a).end(), "should not match entered A, exited B");
127
+ ok(!matcher.begin().entered('A').exited('B').end(), "should not match entered 'A', exited 'B'");
128
+ ok(!matcher.begin().exited(a).entered(c).end(), "should not match exited A, entered C");
129
+ ok(!matcher.begin().exited(a).entered(b, c).end(), "should not match exited A, entered [B, C]");
130
+ ok(!matcher.begin().exited(a).entered(b).entered(c).end(), "should not match exited A, entered B, entered C");
131
+ ok(!matcher.begin().exited(a).entered(b).exited(c).end(), "should not match exited A, entered B, exited C");
132
+ });
133
+
134
+ test("match against sequence seq(enter A), seq(enter B)", function() {
135
+ monitor.pushEnteredState(a);
136
+ monitor.pushEnteredState(b);
137
+
138
+ var matcher = monitor.matchSequence();
139
+
140
+ matcher.begin()
141
+ .beginSequence()
142
+ .entered(a)
143
+ .endSequence()
144
+ .beginSequence()
145
+ .entered(b)
146
+ .endSequence()
147
+ .end();
148
+
149
+ ok(matcher.get('match'), "should match seq(entered A), seq(entered B)");
150
+
151
+ matcher.begin()
152
+ .beginSequence()
153
+ .entered(a)
154
+ .entered(b)
155
+ .endSequence()
156
+ .end();
157
+
158
+ ok(matcher.get('match'), "should match seq(entered A, entered B)");
159
+
160
+ matcher.begin()
161
+ .beginSequence()
162
+ .entered(a)
163
+ .entered(b)
164
+ .endSequence()
165
+ .end();
166
+
167
+ ok(matcher.get('match'), "should match seq(entered A, entered B)");
168
+
169
+ matcher.begin()
170
+ .beginSequence()
171
+ .entered(a, b)
172
+ .endSequence()
173
+ .end();
174
+
175
+ ok(matcher.get('match'), "should match seq(entered [A, B]");
176
+
177
+ matcher.begin()
178
+ .beginSequence()
179
+ .entered(a)
180
+ .endSequence()
181
+ .end();
182
+
183
+ ok(!matcher.get('match'), "should not match seq(entered A)");
184
+
185
+ matcher.begin()
186
+ .beginSequence()
187
+ .entered(a)
188
+ .endSequence()
189
+ .beginSequence()
190
+ .entered(c)
191
+ .endSequence()
192
+ .end();
193
+
194
+ ok(!matcher.get('match'), "should not match seq(entered A), seq(entered C)");
195
+
196
+ matcher.begin()
197
+ .beginSequence()
198
+ .entered(a)
199
+ .endSequence()
200
+ .beginSequence()
201
+ .entered(b)
202
+ .endSequence()
203
+ .beginSequence()
204
+ .entered(c)
205
+ .endSequence()
206
+ .end();
207
+
208
+ ok(!matcher.get('match'), "should not match seq(entered A), seq(entered B), seq(entered C)");
209
+ });
210
+
211
+ test("match against sequence con(entered A)", function() {
212
+ monitor.pushEnteredState(a);
213
+
214
+ var matcher = monitor.matchSequence();
215
+
216
+ matcher.begin()
217
+ .beginConcurrent()
218
+ .entered(a)
219
+ .endConcurrent()
220
+ .end();
221
+
222
+ ok(matcher.get('match'), "should match con(entered A)");
223
+
224
+ matcher.begin()
225
+ .beginConcurrent()
226
+ .beginSequence()
227
+ .entered(a)
228
+ .endSequence()
229
+ .endConcurrent()
230
+ .end();
231
+
232
+ ok(matcher.get('match'), "should match con(seq(entered A))");
233
+
234
+ matcher.begin()
235
+ .beginConcurrent()
236
+ .entered(b)
237
+ .endConcurrent()
238
+ .end();
239
+
240
+ ok(!matcher.get('match'), "should match con(entered B)");
241
+
242
+ matcher.begin()
243
+ .beginConcurrent()
244
+ .exited(a)
245
+ .endConcurrent()
246
+ .end();
247
+
248
+ ok(!matcher.get('match'), "should match con(exited B)");
249
+
250
+ matcher.begin()
251
+ .beginConcurrent()
252
+ .entered(a)
253
+ .entered(b)
254
+ .endConcurrent()
255
+ .end();
256
+
257
+ ok(!matcher.get('match'), "should not match con(entered A, entered B)");
258
+
259
+ matcher.begin()
260
+ .beginConcurrent()
261
+ .entered(b)
262
+ .entered(a)
263
+ .endConcurrent()
264
+ .end();
265
+
266
+ ok(!matcher.get('match'), "should not match con(entered B, entered A)");
267
+ });
268
+
269
+ test("match against sequence con(entered A entered B)", function() {
270
+ monitor.pushEnteredState(a);
271
+ monitor.pushEnteredState(b);
272
+
273
+ var matcher = monitor.matchSequence();
274
+
275
+ matcher.begin()
276
+ .beginConcurrent()
277
+ .entered(a)
278
+ .entered(b)
279
+ .endConcurrent()
280
+ .end();
281
+
282
+ ok(matcher.get('match'), "should match con(entered A, entered B)");
283
+
284
+ matcher.begin()
285
+ .beginConcurrent()
286
+ .entered(b)
287
+ .entered(a)
288
+ .endConcurrent()
289
+ .end();
290
+
291
+ ok(matcher.get('match'), "should match con(entered B, entered A)");
292
+
293
+ matcher.begin()
294
+ .beginConcurrent()
295
+ .beginSequence()
296
+ .entered(a)
297
+ .endSequence()
298
+ .entered(b)
299
+ .endConcurrent()
300
+ .end();
301
+
302
+ ok(matcher.get('match'), "should match con(seq(entered A), entered B)");
303
+
304
+ matcher.begin()
305
+ .beginConcurrent()
306
+ .beginSequence()
307
+ .entered(a)
308
+ .endSequence()
309
+ .beginSequence()
310
+ .entered(b)
311
+ .endSequence()
312
+ .endConcurrent()
313
+ .end();
314
+
315
+ ok(matcher.get('match'), "should match con(seq(entered A), seq(entered B))");
316
+
317
+ matcher.begin()
318
+ .beginConcurrent()
319
+ .entered(a, b)
320
+ .endConcurrent()
321
+ .end();
322
+
323
+ ok(matcher.get('match'), "should match con(entered [A, B])");
324
+
325
+ matcher.begin()
326
+ .beginConcurrent()
327
+ .beginSequence()
328
+ .entered(a)
329
+ .entered(b)
330
+ .endSequence()
331
+ .endConcurrent()
332
+ .end();
333
+
334
+ ok(matcher.get('match'), "should match con(entered [A, B])");
335
+
336
+ matcher.begin()
337
+ .beginConcurrent()
338
+ .entered(a)
339
+ .endConcurrent()
340
+ .end();
341
+
342
+ ok(!matcher.get('match'), "should not match con(entered A])");
343
+
344
+ matcher.begin()
345
+ .beginConcurrent()
346
+ .entered(a)
347
+ .entered(c)
348
+ .endConcurrent()
349
+ .end();
350
+
351
+ ok(!matcher.get('match'), "should not match con(entered A, entered C)");
352
+
353
+ matcher.begin()
354
+ .beginConcurrent()
355
+ .entered(a)
356
+ .entered(b)
357
+ .entered(c)
358
+ .endConcurrent()
359
+ .end();
360
+
361
+ ok(!matcher.get('match'), "should not match con(entered A, entered B, entered C)");
362
+
363
+ });
364
+
365
+ test("match against sequence con(entered A entered B)", function() {
366
+ monitor.pushEnteredState(a);
367
+ monitor.pushEnteredState(b);
368
+ monitor.pushEnteredState(x);
369
+ monitor.pushEnteredState(m);
370
+ monitor.pushEnteredState(n);
371
+ monitor.pushEnteredState(y);
372
+ monitor.pushEnteredState(o);
373
+ monitor.pushEnteredState(p);
374
+ monitor.pushEnteredState(c);
375
+
376
+ var matcher = monitor.matchSequence();
377
+
378
+ matcher.begin()
379
+ .entered(a)
380
+ .entered(b)
381
+ .beginConcurrent()
382
+ .beginSequence()
383
+ .entered(x, m, n)
384
+ .endSequence()
385
+ .beginSequence()
386
+ .entered(y, o, p)
387
+ .endSequence()
388
+ .endConcurrent()
389
+ .entered(c)
390
+ .end();
391
+
392
+ ok(matcher.get('match'),
393
+ "should match entered A, entered B, con(seq(entered [X, M, N]), seq(entered [Y, O, P])) entered C)");
394
+
395
+ matcher.begin()
396
+ .entered(a)
397
+ .entered(b)
398
+ .beginConcurrent()
399
+ .beginSequence()
400
+ .entered(y, o, p)
401
+ .endSequence()
402
+ .beginSequence()
403
+ .entered(x, m, n)
404
+ .endSequence()
405
+ .endConcurrent()
406
+ .entered(c)
407
+ .end();
408
+
409
+ ok(matcher.get('match'),
410
+ "should match entered A, entered B, con(seq(entered [Y, O, P]), seq(entered [X, M, N])) entered C)");
411
+
412
+ matcher.begin()
413
+ .entered(a)
414
+ .entered(b)
415
+ .beginConcurrent()
416
+ .beginSequence()
417
+ .entered(x, m)
418
+ .endSequence()
419
+ .beginSequence()
420
+ .entered(y, o, p)
421
+ .endSequence()
422
+ .endConcurrent()
423
+ .entered(c)
424
+ .end();
425
+
426
+ ok(!matcher.get('match'),
427
+ "should not match entered A, entered B, con(seq(entered [X, M]), seq(entered [Y, O, P])) entered C)");
428
+
429
+ matcher.begin()
430
+ .entered(a)
431
+ .entered(b)
432
+ .beginConcurrent()
433
+ .beginSequence()
434
+ .entered(x, m, n)
435
+ .endSequence()
436
+ .beginSequence()
437
+ .entered(y, o)
438
+ .endSequence()
439
+ .endConcurrent()
440
+ .entered(c)
441
+ .end();
442
+
443
+ ok(!matcher.get('match'),
444
+ "should not match entered A, entered B, con(seq(entered [X, M]), seq(entered [Y, O])) entered C)");
445
+
446
+ matcher.begin()
447
+ .entered(a)
448
+ .entered(b)
449
+ .beginConcurrent()
450
+ .beginSequence()
451
+ .entered(x, m, n)
452
+ .endSequence()
453
+ .beginSequence()
454
+ .entered(y, o, p)
455
+ .endSequence()
456
+ .entered(e)
457
+ .endConcurrent()
458
+ .entered(c)
459
+ .end();
460
+
461
+ ok(!matcher.get('match'),
462
+ "should not match entered A, entered B, con(seq(entered [X, M, N]), seq(entered [Y, O, P]), entered E) entered C)");
463
+
464
+ });