sproutcore 1.9.2 → 1.10.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (746) hide show
  1. checksums.yaml +15 -0
  2. data/VERSION.yml +2 -2
  3. data/bin/sc-build +12 -9
  4. data/bin/sc-build-number +12 -9
  5. data/bin/sc-docs +12 -15
  6. data/bin/sc-gen +12 -9
  7. data/bin/sc-init +12 -9
  8. data/bin/sc-manifest +12 -9
  9. data/bin/sc-server +12 -9
  10. data/bin/sproutcore +12 -9
  11. data/lib/frameworks/sproutcore/Buildfile +14 -17
  12. data/lib/frameworks/sproutcore/CHANGELOG.md +214 -3
  13. data/lib/frameworks/sproutcore/README.md +4 -1
  14. data/lib/frameworks/sproutcore/apps/greenhouse/Buildfile +13 -0
  15. data/lib/frameworks/sproutcore/{frameworks/experimental/apps/greenhouse/README → apps/greenhouse/README.md} +1 -1
  16. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/TODO +0 -0
  17. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/beautify.js +0 -0
  18. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/design.js +3 -3
  19. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/file.js +3 -3
  20. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/files.js +3 -3
  21. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/layout.js +9 -9
  22. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/library.js +23 -23
  23. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/page.js +1 -1
  24. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/property.js +1 -1
  25. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/property_editor.js +2 -2
  26. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/target.js +1 -1
  27. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/targets.js +12 -12
  28. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/view_configs.js +15 -15
  29. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/core.js +14 -14
  30. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/core_file.js +0 -0
  31. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/data_source.js +42 -42
  32. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/app_page.js +45 -45
  33. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/app-selector.css +0 -0
  34. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/button.css +0 -0
  35. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/dock.css +0 -0
  36. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/general.css +0 -0
  37. data/lib/frameworks/sproutcore/apps/greenhouse/english.lproj/css/icons.css +5 -0
  38. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/main-page.css +0 -0
  39. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/menu.css +0 -0
  40. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/modal.css +0 -0
  41. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/picker.css +0 -0
  42. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/search.css +0 -0
  43. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/text-field.css +0 -0
  44. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/dialogs.js +0 -0
  45. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500.eot +0 -0
  46. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500.otf +0 -0
  47. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500.woff +0 -0
  48. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500_italic.eot +0 -0
  49. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500_italic.otf +0 -0
  50. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500_italic.woff +0 -0
  51. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/app-selector/choose-app.png +0 -0
  52. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/app-selector/list-item-sel.png +0 -0
  53. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/active-l.png +0 -0
  54. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/active-m.png +0 -0
  55. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/active-r.png +0 -0
  56. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/regular-l.png +0 -0
  57. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/regular-m.png +0 -0
  58. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/regular-r.png +0 -0
  59. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/active-l.png +0 -0
  60. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/active-r.png +0 -0
  61. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/disabled-l.png +0 -0
  62. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/disabled-r.png +0 -0
  63. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/regular-l.png +0 -0
  64. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/regular-r.png +0 -0
  65. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-active-l.png +0 -0
  66. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-active-r.png +0 -0
  67. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-l.png +0 -0
  68. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-r.png +0 -0
  69. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-l.png +0 -0
  70. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-r.png +0 -0
  71. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/active-l.png +0 -0
  72. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/active-m.png +0 -0
  73. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/active-r.png +0 -0
  74. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-active-l.png +0 -0
  75. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-active-r.png +0 -0
  76. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-l.png +0 -0
  77. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-r.png +0 -0
  78. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-l.png +0 -0
  79. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-r.png +0 -0
  80. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-sel-l.png +0 -0
  81. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-sel-r.png +0 -0
  82. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/disabled-l.png +0 -0
  83. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/disabled-m.png +0 -0
  84. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/disabled-r.png +0 -0
  85. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/regular-l.png +0 -0
  86. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/regular-m.png +0 -0
  87. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/regular-r.png +0 -0
  88. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-active-l.png +0 -0
  89. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-active-m.png +0 -0
  90. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-active-r.png +0 -0
  91. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-disabled-l.png +0 -0
  92. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-disabled-m.png +0 -0
  93. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-disabled-r.png +0 -0
  94. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-l.png +0 -0
  95. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-m.png +0 -0
  96. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-r.png +0 -0
  97. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/active-m.png +0 -0
  98. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/disabled-m.png +0 -0
  99. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/regular-m.png +0 -0
  100. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/sel-active-m.png +0 -0
  101. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/sel-disabled-m.png +0 -0
  102. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/sel-m.png +0 -0
  103. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/active-l.png +0 -0
  104. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/active-r.png +0 -0
  105. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/disabled-l.png +0 -0
  106. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/disabled-r.png +0 -0
  107. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/regular-l.png +0 -0
  108. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/regular-r.png +0 -0
  109. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-active-l.png +0 -0
  110. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-active-r.png +0 -0
  111. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-disabled-l.png +0 -0
  112. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-disabled-r.png +0 -0
  113. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-l.png +0 -0
  114. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-r.png +0 -0
  115. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/actions-active.png +0 -0
  116. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/actions.png +0 -0
  117. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/inspector-active.png +0 -0
  118. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/inspector.png +0 -0
  119. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/library-active.png +0 -0
  120. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/library.png +0 -0
  121. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/projects-active.png +0 -0
  122. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/projects.png +0 -0
  123. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/run-active.png +0 -0
  124. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/run.png +0 -0
  125. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/save-active.png +0 -0
  126. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/save.png +0 -0
  127. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/logos/greenhouse-l.png +0 -0
  128. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/logos/greenhouse-s.png +0 -0
  129. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/logos/sproutcore.png +0 -0
  130. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/main-bg.png +0 -0
  131. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/bottom-left.png +0 -0
  132. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/bottom-right.png +0 -0
  133. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/bottom.png +0 -0
  134. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/close-active.png +0 -0
  135. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/close.png +0 -0
  136. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/left.png +0 -0
  137. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/pointer-bottom.png +0 -0
  138. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/pointer-left.png +0 -0
  139. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/pointer-right.png +0 -0
  140. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/pointer-top.png +0 -0
  141. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/right.png +0 -0
  142. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/search-active.png +0 -0
  143. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/search.png +0 -0
  144. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/top-left.png +0 -0
  145. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/top-right.png +0 -0
  146. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/top.png +0 -0
  147. data/lib/frameworks/sproutcore/apps/greenhouse/english.lproj/images/sc-icon-sproutcore-16.png +0 -0
  148. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/toolbar-bg.png +0 -0
  149. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/inspectors.js +0 -0
  150. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/loading.rhtml +0 -0
  151. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/main_page.js +0 -0
  152. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/strings.js +0 -0
  153. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/fixtures/file.js +0 -0
  154. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/main.js +5 -5
  155. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/mixins/drop_down.js +14 -14
  156. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/design.js +4 -4
  157. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/dir.js +12 -12
  158. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/file.js +7 -9
  159. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/target.js +12 -12
  160. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/view_config.js +10 -10
  161. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/resources/test_page.js +0 -0
  162. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/inspector.js +11 -11
  163. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/library.js +10 -10
  164. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/main.js +26 -25
  165. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/modals.js +10 -10
  166. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/ready.js +15 -15
  167. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/controllers/design.js +0 -0
  168. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/controllers/designs.js +0 -0
  169. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/controllers/file.js +0 -0
  170. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/controllers/files.js +0 -0
  171. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/models/file.js +0 -0
  172. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/models/view_config.js +0 -0
  173. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/views/list_item.js +0 -0
  174. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/views/plist_item.js +1 -5
  175. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/theme.js +6 -6
  176. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/anchor.js +43 -43
  177. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/application_list_item.js +2 -2
  178. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/event_blocker.js +7 -7
  179. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/label_designer.js +0 -0
  180. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/list_item.js +8 -8
  181. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/plist_item.js +23 -23
  182. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/simple_button.js +31 -31
  183. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/tear_off_picker.js +12 -12
  184. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/web.js +5 -5
  185. data/lib/frameworks/sproutcore/apps/media_examples/core.js +5 -6
  186. data/lib/frameworks/sproutcore/apps/media_examples/views/audio_view.js +16 -17
  187. data/lib/frameworks/sproutcore/apps/media_examples/views/camera_view.js +4 -5
  188. data/lib/frameworks/sproutcore/apps/media_examples/views/capabilities_view.js +17 -18
  189. data/lib/frameworks/sproutcore/apps/media_examples/views/microphone_view.js +4 -5
  190. data/lib/frameworks/sproutcore/apps/media_examples/views/video_view.js +18 -19
  191. data/lib/frameworks/sproutcore/apps/showcase/Buildfile +2 -2
  192. data/lib/frameworks/sproutcore/apps/showcase/README +1 -1
  193. data/lib/frameworks/sproutcore/apps/showcase/controllers/source_tree_controller.js +27 -7
  194. data/lib/frameworks/sproutcore/apps/showcase/core.js +6 -4
  195. data/lib/frameworks/sproutcore/apps/showcase/main.js +2 -1
  196. data/lib/frameworks/sproutcore/apps/showcase/patch.diff +529 -0
  197. data/lib/frameworks/sproutcore/apps/showcase/resources/images/sproutcore-128.png +0 -0
  198. data/lib/frameworks/sproutcore/apps/showcase/resources/main_page.js +3 -2
  199. data/lib/frameworks/sproutcore/apps/showcase/resources/stylesheet.css +35 -16
  200. data/lib/frameworks/sproutcore/apps/showcase/resources/views_page.js +195 -10
  201. data/lib/frameworks/sproutcore/apps/showcase/system/views_item_content.js +2 -1
  202. data/lib/frameworks/sproutcore/apps/showcase/theme.js +2 -1
  203. data/lib/frameworks/sproutcore/apps/showcase/views/checkbox_views.js +2 -1
  204. data/lib/frameworks/sproutcore/apps/showcase/views/date_field_views.js +2 -1
  205. data/lib/frameworks/sproutcore/apps/showcase/views/disclosure_views.js +2 -1
  206. data/lib/frameworks/sproutcore/apps/showcase/views/label_views.js +2 -1
  207. data/lib/frameworks/sproutcore/apps/showcase/views/list_views.js +2 -1
  208. data/lib/frameworks/sproutcore/apps/showcase/views/popup_button_views.js +3 -2
  209. data/lib/frameworks/sproutcore/apps/showcase/views/progress_views.js +2 -1
  210. data/lib/frameworks/sproutcore/apps/showcase/views/radio_views.js +2 -1
  211. data/lib/frameworks/sproutcore/apps/showcase/views/scroll_views.js +2 -1
  212. data/lib/frameworks/sproutcore/apps/showcase/views/segmented_views.js +2 -1
  213. data/lib/frameworks/sproutcore/apps/showcase/views/select_views.js +10 -9
  214. data/lib/frameworks/sproutcore/apps/showcase/views/slider_views.js +2 -1
  215. data/lib/frameworks/sproutcore/apps/showcase/views/source_list_views.js +2 -1
  216. data/lib/frameworks/sproutcore/apps/showcase/views/split_views.js +2 -1
  217. data/lib/frameworks/sproutcore/apps/showcase/views/stacked_views.js +2 -1
  218. data/lib/frameworks/sproutcore/apps/showcase/views/static_content_views.js +2 -1
  219. data/lib/frameworks/sproutcore/apps/showcase/views/tab_views.js +2 -1
  220. data/lib/frameworks/sproutcore/apps/showcase/views/text_field_views.js +2 -1
  221. data/lib/frameworks/sproutcore/apps/showcase/views/toolbar_views.js +2 -1
  222. data/lib/frameworks/sproutcore/apps/showcase/views/views_item_view.js +15 -6
  223. data/lib/frameworks/sproutcore/apps/showcase/views/views_list_view.js +5 -4
  224. data/lib/frameworks/sproutcore/apps/showcase/views/web_views.js +2 -1
  225. data/lib/frameworks/sproutcore/apps/showcase/views/well_views.js +2 -1
  226. data/lib/frameworks/sproutcore/apps/showcase/views/workspace_views.js +2 -1
  227. data/lib/frameworks/sproutcore/apps/statechart_routing/core.js +5 -5
  228. data/lib/frameworks/sproutcore/apps/statechart_routing/resources/login_page.js +15 -15
  229. data/lib/frameworks/sproutcore/apps/statechart_routing/resources/styles.css +3 -0
  230. data/lib/frameworks/sproutcore/apps/tests/controllers/source.js +11 -11
  231. data/lib/frameworks/sproutcore/apps/tests/controllers/target.js +6 -12
  232. data/lib/frameworks/sproutcore/apps/tests/controllers/targets.js +28 -33
  233. data/lib/frameworks/sproutcore/apps/tests/controllers/{detail.js → test.js} +14 -12
  234. data/lib/frameworks/sproutcore/apps/tests/controllers/tests.js +11 -15
  235. data/lib/frameworks/sproutcore/apps/tests/core.js +8 -113
  236. data/lib/frameworks/sproutcore/apps/tests/english.lproj/main_page.css +9 -19
  237. data/lib/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +81 -92
  238. data/lib/frameworks/sproutcore/apps/tests/english.lproj/strings.js +3 -1
  239. data/lib/frameworks/sproutcore/apps/tests/main.js +8 -13
  240. data/lib/frameworks/sproutcore/apps/tests/statechart.js +268 -0
  241. data/lib/frameworks/sproutcore/apps/tests/views/offset_checkbox.js +4 -4
  242. data/lib/frameworks/sproutcore/apps/welcome/controllers/targets.js +16 -16
  243. data/lib/frameworks/sproutcore/apps/welcome/core.js +9 -9
  244. data/lib/frameworks/sproutcore/apps/welcome/english.lproj/images/sproutcore.png +0 -0
  245. data/lib/frameworks/sproutcore/apps/welcome/english.lproj/main_page.js +22 -25
  246. data/lib/frameworks/sproutcore/apps/welcome/main.js +3 -3
  247. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup-landscape.jpg b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup-landscape.jpg +0 -0
  248. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup-landscape.png b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup-landscape.png +0 -0
  249. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup-portrait.jpg b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup-portrait.jpg +0 -0
  250. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup-portrait.png b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup-portrait.png +0 -0
  251. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup.png b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup.png +0 -0
  252. data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +21 -7
  253. data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/request.js +35 -2
  254. data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +142 -75
  255. data/lib/frameworks/sproutcore/frameworks/bootstrap/tests/system/browser.js +20 -2
  256. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/horizontal_stack_layout.js +283 -0
  257. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/vertical_stack_layout.js +284 -0
  258. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +64 -65
  259. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/controller.js +14 -14
  260. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/object.js +8 -8
  261. data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +19 -19
  262. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/run_loop.js +10 -25
  263. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/selection_support.js +12 -6
  264. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/body_overflow.js +53 -34
  265. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/layout.js +30 -24
  266. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/main.js +44 -40
  267. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/manipulation.js +5 -2
  268. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +105 -176
  269. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane_statechart.js +50 -0
  270. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/visibility.js +4 -4
  271. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/view_transition_protocol.js +48 -0
  272. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/browser.js +225 -7
  273. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/core_query.js +54 -34
  274. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/cursor.js +86 -71
  275. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/device.js +35 -35
  276. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +2 -2
  277. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +2 -2
  278. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +283 -120
  279. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/ready.js +36 -37
  280. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +653 -435
  281. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/responder.js +49 -42
  282. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +422 -396
  283. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/selection_set.js +5 -5
  284. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +10 -8
  285. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/theme.js +37 -16
  286. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/timer.js +5 -5
  287. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils/rect.js +1 -1
  288. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +15 -0
  289. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/selection_support.js +21 -0
  290. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/cursor.js +28 -0
  291. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/platform.js +18 -0
  292. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/end.js +17 -17
  293. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_attr.js +9 -9
  294. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_className.js +43 -43
  295. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_style.js +4 -14
  296. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/update.js +18 -30
  297. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +78 -43
  298. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/theme.js +7 -7
  299. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/main_pane.js +4 -3
  300. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/append_remove.js +31 -15
  301. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/child_view.js +47 -2
  302. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/firstResponder.js +32 -31
  303. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/keyPane.js +23 -22
  304. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/layout.js +3 -2
  305. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/sendEvent.js +17 -16
  306. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/animation.js +626 -211
  307. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/border_frame_test.js +174 -0
  308. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/build.js +22 -20
  309. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/childViewLayout_test.js +27 -0
  310. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +11 -10
  311. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertFrames.js +5 -4
  312. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createChildViews.js +10 -6
  313. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createLayer.js +17 -12
  314. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/destroy.js +60 -7
  315. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/destroyLayer.js +19 -26
  316. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/didAppendToDocument.js +14 -13
  317. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/enabled_states_test.js +341 -0
  318. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/findLayerInParentLayer.js +9 -8
  319. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/init.js +26 -16
  320. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/insertBefore.js +28 -68
  321. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/isVisible.js +35 -23
  322. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/isVisibleInWindow.js +93 -78
  323. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js +62 -64
  324. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layer.js +69 -18
  325. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutChildViews.js +26 -21
  326. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js +129 -57
  327. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +436 -238
  328. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/removeChild.js +38 -44
  329. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/render.js +14 -4
  330. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/render_delegate_support.js +29 -20
  331. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/replaceAllChildren_test.js +229 -0
  332. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/updateLayer.js +33 -95
  333. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/viewDidResize.js +87 -39
  334. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view_states_test.js +684 -0
  335. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +767 -625
  336. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/acceleration.js +4 -23
  337. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +645 -77
  338. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/cursor.js +1 -1
  339. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +218 -19
  340. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +648 -321
  341. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout_style.js +326 -534
  342. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +120 -126
  343. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/statechart.js +1526 -0
  344. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +18 -23
  345. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/visibility.js +12 -94
  346. data/lib/frameworks/sproutcore/frameworks/core_tools/core.js +2 -2
  347. data/lib/frameworks/sproutcore/frameworks/core_tools/data_source.js +19 -19
  348. data/lib/frameworks/sproutcore/frameworks/core_tools/models/target.js +43 -27
  349. data/lib/frameworks/sproutcore/frameworks/core_tools/models/test.js +5 -5
  350. data/lib/frameworks/sproutcore/frameworks/core_tools/resources/icons.css +5 -0
  351. data/lib/frameworks/sproutcore/frameworks/core_tools/resources/sc-icon-sproutcore-16.png +0 -0
  352. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +41 -41
  353. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +1 -1
  354. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +90 -90
  355. data/lib/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +1 -1
  356. data/lib/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +31 -31
  357. data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +3 -3
  358. data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +6 -6
  359. data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +1 -1
  360. data/lib/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +1 -1
  361. data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +1 -1
  362. data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +2 -8
  363. data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +74 -48
  364. data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +11 -16
  365. data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +187 -253
  366. data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/cascade.js +5 -5
  367. data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +14 -14
  368. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/data_store.js +49 -9
  369. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +2 -2
  370. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +236 -127
  371. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/instance_management.js +107 -0
  372. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/createRecord.js +17 -0
  373. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +12 -11
  374. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/loadRecord.js +42 -17
  375. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushChanges.js +20 -15
  376. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +205 -92
  377. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/tests/system/datetime.js +61 -25
  378. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/resources/strings.js +39 -9
  379. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +45 -1
  380. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/tests/system/datetime.js +88 -0
  381. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/coders/design.js +0 -0
  382. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/coders/object.js +0 -0
  383. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/controllers.js +3 -3
  384. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/design.js +2 -2
  385. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/designs.js +19 -19
  386. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/page_design.js +44 -44
  387. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/page_files.js +4 -4
  388. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/core.js +0 -0
  389. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/css/css_rule.js +0 -0
  390. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/css/css_style.js +6 -6
  391. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/css/css_style_sheet.js +37 -37
  392. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/button.js +0 -0
  393. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/label.js +0 -0
  394. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/object_designer.js +0 -0
  395. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/tab.js +0 -0
  396. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/text_field.js +0 -0
  397. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/view_designer.js +1 -1
  398. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/css/designer.css +0 -0
  399. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/design_page.js +0 -0
  400. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/high_light.css +0 -0
  401. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/controller.png +0 -0
  402. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-bg.png +0 -0
  403. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-item-bg.png +0 -0
  404. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-item-divider.png +0 -0
  405. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-item-sel-bg.png +0 -0
  406. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-item-sel-divider.png +0 -0
  407. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/main-bg.png +0 -0
  408. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/page.png +0 -0
  409. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/pane.png +0 -0
  410. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/view.png +0 -0
  411. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/selection_handles.css +0 -0
  412. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/ext/binding.js +0 -0
  413. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/ext/object.js +0 -0
  414. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/ext/page.js +0 -0
  415. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/ext/view.js +0 -0
  416. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/mixins/button.js +0 -0
  417. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/mixins/snap_lines.js +0 -0
  418. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/tests/coders/page.js +0 -0
  419. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/tests/designers/view_designer.js +0 -0
  420. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/designer_drop_target.js +36 -37
  421. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/drawing.js +1 -1
  422. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/high_light.js +17 -17
  423. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/page_item_view.js +0 -0
  424. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/selection_handles.js +14 -14
  425. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +1 -2
  426. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +51 -51
  427. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view → desktop}/mixins/split_child.js +63 -52
  428. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view → desktop}/mixins/split_thumb.js +64 -59
  429. data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +113 -112
  430. data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +182 -203
  431. data/lib/frameworks/sproutcore/frameworks/desktop/panes/palette.js +13 -13
  432. data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +51 -29
  433. data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +513 -307
  434. data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +69 -217
  435. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/button.js +31 -26
  436. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/checkbox.js +15 -20
  437. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/collection.js +2 -6
  438. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/disclosure.js +6 -6
  439. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/image_button.js +25 -16
  440. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/panel.js +6 -6
  441. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/picker.js +29 -16
  442. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/popup_button.js +1 -1
  443. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/progress.js +19 -23
  444. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio.js +14 -17
  445. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio_group.js +24 -24
  446. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segment.js +4 -4
  447. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/slider.js +5 -5
  448. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view → desktop}/render_delegates/split.js +0 -0
  449. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view → desktop}/render_delegates/split_divider.js +0 -0
  450. data/lib/frameworks/sproutcore/frameworks/desktop/resources/modal.css +2 -0
  451. data/lib/frameworks/sproutcore/frameworks/desktop/resources/panel.css +1 -1
  452. data/lib/frameworks/sproutcore/frameworks/desktop/resources/segmented.css +24 -98
  453. data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +446 -442
  454. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +42 -21
  455. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +19 -3
  456. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +26 -28
  457. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/ui.js +3 -2
  458. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/pane_page.js +11 -7
  459. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +5 -4
  460. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +32 -26
  461. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +27 -22
  462. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/select_button/methods.js +5 -4
  463. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/select_button/ui.js +0 -2
  464. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +11 -8
  465. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/displayProperties.js +5 -5
  466. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/keyEquivalents.js +9 -11
  467. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +23 -23
  468. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/ui.js +15 -17
  469. data/lib/frameworks/sproutcore/frameworks/desktop/tests/{mixins → views/collection}/collection_fast_path.js +18 -12
  470. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/content.js +46 -53
  471. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +101 -47
  472. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +26 -26
  473. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/reload.js +89 -69
  474. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selection.js +27 -25
  475. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/ui_diagram.js +32 -35
  476. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +1 -0
  477. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/ui.js +6 -11
  478. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +3 -5
  479. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/grid/drag_and_drop.js +103 -8
  480. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/grid/methods.js +76 -38
  481. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/image_button/ui.js +3 -5
  482. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/drag_and_drop.js +91 -3
  483. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/render.js +2 -17
  484. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +70 -38
  485. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_alternatingrows.js +17 -19
  486. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +10 -13
  487. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +37 -30
  488. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +18 -20
  489. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +115 -28
  490. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +0 -2
  491. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +37 -1
  492. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +194 -182
  493. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select/ui.js +2 -3
  494. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +18 -21
  495. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/separator.js +5 -6
  496. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/slider/methods.js +5 -4
  497. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view/tests → desktop/tests/views/split}/children.js +15 -15
  498. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view/tests → desktop/tests/views/split}/dividers.js +0 -0
  499. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js +341 -45
  500. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view/tests → desktop/tests/views/split}/split_child.js +0 -0
  501. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view/tests → desktop/tests/views/split}/split_thumb.js +0 -0
  502. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/ui.js +6 -8
  503. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/stacked/ui_comments.js +49 -52
  504. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +23 -6
  505. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/toolbar/ui.js +2 -4
  506. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/web/ui.js +4 -5
  507. data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +47 -38
  508. data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +24 -24
  509. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +887 -740
  510. data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +2 -2
  511. data/lib/frameworks/sproutcore/frameworks/desktop/views/grid.js +68 -55
  512. data/lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js +3 -3
  513. data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +8 -26
  514. data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +189 -167
  515. data/lib/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +55 -54
  516. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +8 -4
  517. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +145 -146
  518. data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +21 -21
  519. data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +2 -2
  520. data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +66 -66
  521. data/lib/frameworks/sproutcore/frameworks/desktop/views/scene.js +40 -44
  522. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +203 -200
  523. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +11 -12
  524. data/lib/frameworks/sproutcore/frameworks/desktop/views/segment.js +6 -13
  525. data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +87 -112
  526. data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +192 -179
  527. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_button.js +23 -23
  528. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +64 -64
  529. data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +56 -56
  530. data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +784 -714
  531. data/lib/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +21 -39
  532. data/lib/frameworks/sproutcore/frameworks/desktop/views/stacked.js +45 -41
  533. data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +1 -1
  534. data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +4 -10
  535. data/lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js +9 -47
  536. data/lib/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +40 -16
  537. data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +2 -1
  538. data/lib/frameworks/sproutcore/frameworks/desktop/views/workspace.js +62 -50
  539. data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +0 -9
  540. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/device.js +45 -45
  541. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js +16 -16
  542. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +46 -6
  543. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/tests/models/polymorphism/simple.js +16 -2
  544. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/desktop_scroller.js +12 -12
  545. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/ui.js +38 -40
  546. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/ext/menu.js +8 -8
  547. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/views/select.js +20 -20
  548. data/lib/frameworks/sproutcore/frameworks/formatters/formatters/date_formatter.js +16 -16
  549. data/lib/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +26 -14
  550. data/lib/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +43 -43
  551. data/lib/frameworks/sproutcore/frameworks/foundation/debug/test-image.png +0 -0
  552. data/lib/frameworks/sproutcore/frameworks/foundation/delegates/inline_text_field.js +11 -11
  553. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +63 -41
  554. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/button.js +1 -1
  555. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +60 -61
  556. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/control.js +72 -72
  557. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +142 -142
  558. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/gesturable.js +1 -1
  559. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editable.js +1 -1
  560. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inner_frame.js +10 -8
  561. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +36 -29
  562. data/lib/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +4 -4
  563. data/lib/frameworks/sproutcore/frameworks/foundation/protocols/swap_transition_protocol.js +150 -0
  564. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +54 -29
  565. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/image.js +23 -18
  566. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/label.js +12 -11
  567. data/lib/frameworks/sproutcore/frameworks/foundation/resources/benchmark.css +21 -20
  568. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-128.png +0 -0
  569. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-256.png +0 -0
  570. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-32.png +0 -0
  571. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-48.png +0 -0
  572. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-512.png +0 -0
  573. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-64.png +0 -0
  574. data/lib/frameworks/sproutcore/frameworks/foundation/resources/label.css +5 -0
  575. data/lib/frameworks/sproutcore/frameworks/foundation/system/app_cache.js +412 -0
  576. data/lib/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +2 -3
  577. data/lib/frameworks/sproutcore/frameworks/foundation/system/module.js +11 -5
  578. data/lib/frameworks/sproutcore/frameworks/foundation/system/text_selection.js +21 -21
  579. data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/string_measurement.js +8 -3
  580. data/lib/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/selection_support.js +33 -8
  581. data/lib/frameworks/sproutcore/frameworks/foundation/tests/delegates/inline_text_field/inline_text_field.js +2 -1
  582. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/content_display.js +9 -3
  583. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/displayProperties.js +5 -4
  584. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/flowed_layout/tests.js +49 -4
  585. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +29 -21
  586. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +3 -5
  587. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/validatable/ui.js +8 -10
  588. data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/app_cache_test.js +81 -0
  589. data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/image_queue.js +2 -2
  590. data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/utils/pointInElement.js +0 -3
  591. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +40 -1
  592. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/transition_test.js +143 -0
  593. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +5 -7
  594. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +187 -84
  595. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +6 -41
  596. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +51 -7
  597. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +11 -16
  598. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/adjust_bounce_transition.js +80 -0
  599. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/adjust_smooth_transition.js +39 -0
  600. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/adjust_spring_transition.js +77 -0
  601. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/bounce_transition.js +211 -0
  602. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/fade_transition.js +57 -0
  603. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/pop_transition.js +82 -0
  604. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/scale_transition.js +54 -0
  605. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/slide_transition.js +140 -0
  606. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/spring_transition.js +203 -0
  607. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_dissolve_transition.js +67 -0
  608. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_fade_color_transition.js +81 -0
  609. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_move_in_transition.js +104 -0
  610. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_push_transition.js +181 -0
  611. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_reveal_transition.js +90 -0
  612. data/lib/frameworks/sproutcore/frameworks/foundation/validators/validator.js +2 -2
  613. data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +483 -95
  614. data/lib/frameworks/sproutcore/frameworks/foundation/views/field.js +65 -65
  615. data/lib/frameworks/sproutcore/frameworks/foundation/views/image.js +111 -100
  616. data/lib/frameworks/sproutcore/frameworks/foundation/views/inline_text_field.js +30 -222
  617. data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +38 -24
  618. data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +74 -62
  619. data/lib/frameworks/sproutcore/frameworks/jquery/jquery-1.8.3-patched.js +9485 -0
  620. data/lib/frameworks/sproutcore/frameworks/media/media_capabilities.js +4 -4
  621. data/lib/frameworks/sproutcore/frameworks/media/render_delegates/media_slider.js +20 -20
  622. data/lib/frameworks/sproutcore/frameworks/media/resources/video.css +18 -17
  623. data/lib/frameworks/sproutcore/frameworks/media/views/audio.js +19 -19
  624. data/lib/frameworks/sproutcore/frameworks/media/views/controls.js +10 -11
  625. data/lib/frameworks/sproutcore/frameworks/media/views/mini_controls.js +7 -8
  626. data/lib/frameworks/sproutcore/frameworks/media/views/video.js +24 -24
  627. data/lib/frameworks/sproutcore/frameworks/qunit/test/test.js +2 -2
  628. data/lib/frameworks/sproutcore/frameworks/routing/system/routes.js +32 -21
  629. data/lib/frameworks/sproutcore/frameworks/routing/tests/system/routes.js +72 -53
  630. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +164 -156
  631. data/lib/frameworks/sproutcore/frameworks/runtime/ext/array.js +20 -20
  632. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +145 -140
  633. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/comparable.js +1 -1
  634. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +2 -2
  635. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +393 -370
  636. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +3 -3
  637. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +1045 -999
  638. data/lib/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +41 -36
  639. data/lib/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +10 -4
  640. data/lib/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +11 -1
  641. data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +7 -7
  642. data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +275 -205
  643. data/lib/frameworks/sproutcore/frameworks/runtime/system/function.js +27 -27
  644. data/lib/frameworks/sproutcore/frameworks/runtime/system/index_set.js +229 -193
  645. data/lib/frameworks/sproutcore/frameworks/runtime/system/logger.js +24 -24
  646. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +186 -188
  647. data/lib/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +1 -1
  648. data/lib/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +138 -65
  649. data/lib/frameworks/sproutcore/frameworks/runtime/system/set.js +11 -10
  650. data/lib/frameworks/sproutcore/frameworks/runtime/system/string.js +8 -4
  651. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/tupleForPropertyPath.js +4 -0
  652. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/chained.js +112 -23
  653. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +71 -18
  654. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +97 -57
  655. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +22 -22
  656. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/infinite.js +184 -0
  657. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/observer_set.js +63 -1
  658. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/run_loop.js +73 -36
  659. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/set.js +100 -25
  660. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/string.js +7 -0
  661. data/lib/frameworks/sproutcore/frameworks/statechart/debug/sequence_matcher.js +1 -1
  662. data/lib/frameworks/sproutcore/frameworks/statechart/private/state_path_matcher.js +2 -2
  663. data/lib/frameworks/sproutcore/frameworks/statechart/system/history_state.js +32 -32
  664. data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +449 -422
  665. data/lib/frameworks/sproutcore/frameworks/statechart/system/state_route_handler_context.js +19 -19
  666. data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +612 -562
  667. data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/routing/with_concurrent_states/basic.js +115 -62
  668. data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/routing/without_concurrent_states/basic.js +145 -64
  669. data/lib/frameworks/sproutcore/frameworks/statechart/tests/statechart/respond_to_event.js +17 -1
  670. data/lib/frameworks/sproutcore/frameworks/table/views/table_head.js +30 -30
  671. data/lib/frameworks/sproutcore/frameworks/table/views/table_row.js +34 -34
  672. data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/bind.js +1 -1
  673. data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/collection.js +2 -2
  674. data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/view.js +3 -5
  675. data/lib/frameworks/sproutcore/frameworks/template_view/tests/panes/template.js +2 -0
  676. data/lib/frameworks/sproutcore/frameworks/template_view/tests/views/template/core.js +2 -2
  677. data/lib/frameworks/sproutcore/frameworks/template_view/views/bindable_span.js +7 -7
  678. data/lib/frameworks/sproutcore/frameworks/template_view/views/template.js +4 -4
  679. data/lib/frameworks/sproutcore/frameworks/template_view/views/template_collection.js +15 -21
  680. data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +4 -4
  681. data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +35 -35
  682. data/lib/frameworks/sproutcore/scripts/run_sc_server_master.sh +34 -0
  683. data/lib/frameworks/sproutcore/tests/phantomjs_runner.phantomjs +606 -0
  684. data/lib/frameworks/sproutcore/themes/ace/designs/psds/panel/PanelPane.opacity +0 -0
  685. data/lib/frameworks/sproutcore/themes/ace/designs/psds/panel/Pointers.opacity +0 -0
  686. data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/active_button@2x.png +0 -0
  687. data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/normal_button@2x.png +0 -0
  688. data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/selected_active_button@2x.png +0 -0
  689. data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/selected_button@2x.png +0 -0
  690. data/lib/frameworks/sproutcore/themes/ace/resources/button/popup/select.css +3 -4
  691. data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list.css +18 -0
  692. data/lib/frameworks/sproutcore/themes/ace/resources/panel/panel.png +0 -0
  693. data/lib/frameworks/sproutcore/themes/ace/resources/panel/panel@2x.png +0 -0
  694. data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/panel.png +0 -0
  695. data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/panel@2x.png +0 -0
  696. data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/picker.css +34 -14
  697. data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/pointers.png +0 -0
  698. data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/pointers@2x.png +0 -0
  699. data/lib/frameworks/sproutcore/themes/ace/resources/segmented/18px/segmented.css +5 -4
  700. data/lib/frameworks/sproutcore/themes/ace/resources/segmented/24px/segmented.css +7 -2
  701. data/lib/frameworks/sproutcore/themes/ace/resources/segmented/30px/segmented.css +5 -4
  702. data/lib/frameworks/sproutcore/themes/ace/resources/segmented/44px/segmented.css +6 -3
  703. data/lib/frameworks/sproutcore/themes/ace/resources/toolbar/toolbar.css +7 -5
  704. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/button.js +7 -7
  705. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/progress.js +37 -37
  706. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/slider.js +12 -12
  707. data/lib/sproutcore/helpers/static_helper.rb +35 -27
  708. data/sproutcore.gemspec +1 -0
  709. metadata +529 -451
  710. data/lib/frameworks/sproutcore/apps/showcase/resources/images/sproutcore-logo.png +0 -0
  711. data/lib/frameworks/sproutcore/apps/showcase/views/button_views.js +0 -55
  712. data/lib/frameworks/sproutcore/apps/showcase/views/container_views.js +0 -29
  713. data/lib/frameworks/sproutcore/apps/showcase/views/grid_views.js +0 -28
  714. data/lib/frameworks/sproutcore/apps/showcase/views/image_button_views.js +0 -22
  715. data/lib/frameworks/sproutcore/apps/showcase/views/image_views.js +0 -51
  716. data/lib/frameworks/sproutcore/apps/tests/states/no_targets.js +0 -26
  717. data/lib/frameworks/sproutcore/apps/tests/states/ready.js +0 -56
  718. data/lib/frameworks/sproutcore/apps/tests/states/ready_detail.js +0 -41
  719. data/lib/frameworks/sproutcore/apps/tests/states/ready_empty.js +0 -48
  720. data/lib/frameworks/sproutcore/apps/tests/states/ready_list.js +0 -41
  721. data/lib/frameworks/sproutcore/apps/tests/states/ready_loading.js +0 -44
  722. data/lib/frameworks/sproutcore/apps/tests/states/ready_no_tests.js +0 -31
  723. data/lib/frameworks/sproutcore/apps/tests/states/start.js +0 -39
  724. data/lib/frameworks/sproutcore/apps/welcome/tests/controllers/targets.js +0 -15
  725. data/lib/frameworks/sproutcore/frameworks/animation/Buildfile +0 -3
  726. data/lib/frameworks/sproutcore/frameworks/animation/LICENSE +0 -25
  727. data/lib/frameworks/sproutcore/frameworks/animation/README.md +0 -79
  728. data/lib/frameworks/sproutcore/frameworks/animation/core.js +0 -1208
  729. data/lib/frameworks/sproutcore/frameworks/animation/tests/core.js +0 -152
  730. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/parentViewDidChange.js +0 -67
  731. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/prepareContext.js +0 -203
  732. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/updateLayerLocation.js +0 -213
  733. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +0 -163
  734. data/lib/frameworks/sproutcore/frameworks/desktop/tests/mixins/border.js +0 -97
  735. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/tests/methods.js +0 -312
  736. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/split.js +0 -961
  737. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/split_divider.js +0 -40
  738. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/thumb.js +0 -27
  739. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-logo.png +0 -0
  740. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore.png +0 -0
  741. data/lib/frameworks/sproutcore/frameworks/jquery/jquery-buffer.js +0 -394
  742. data/lib/frameworks/sproutcore/frameworks/jquery/jquery-buffered.js +0 -133
  743. data/lib/frameworks/sproutcore/frameworks/jquery/jquery-sc.js +0 -18
  744. data/lib/frameworks/sproutcore/frameworks/jquery/jquery.js +0 -8981
  745. data/lib/frameworks/sproutcore/frameworks/jquery/tests/set_class.js +0 -40
  746. data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/picker.js +0 -0
@@ -12,20 +12,20 @@
12
12
  var a, b, c ; // global variables
13
13
 
14
14
  module("creating SC.Set instances", {
15
-
15
+
16
16
  setup: function() {
17
17
  // create objects...
18
18
  a = { name: "a" } ;
19
19
  b = { name: "b" } ;
20
20
  c = { name: "c" } ;
21
21
  },
22
-
22
+
23
23
  teardown: function() {
24
24
  a = undefined ;
25
25
  b = undefined ;
26
26
  c = undefined ;
27
27
  }
28
-
28
+
29
29
  });
30
30
 
31
31
  test("SC.Set.create() should create empty set", function() {
@@ -33,6 +33,16 @@ test("SC.Set.create() should create empty set", function() {
33
33
  equals(set.length, 0) ;
34
34
  });
35
35
 
36
+
37
+ test("SC.Set.getEach() should work", function () {
38
+ var set = SC.Set.create([a,b,c]),
39
+ names = set.getEach('name');
40
+
41
+ ok(names.contains("a"), "Set.getEach array should contain 'a'");
42
+ ok(names.contains("b"), "Set.getEach array should contain 'b'");
43
+ ok(names.contains("c"), "Set.getEach array should contain 'c'");
44
+ });
45
+
36
46
  test("SC.Set.create([1,2,3]) should create set with three items in them", function() {
37
47
  var set = SC.Set.create([a,b,c]) ;
38
48
  equals(set.length, 3) ;
@@ -45,9 +55,9 @@ test("SC.Set.create() should accept anything that implements SC.Array", function
45
55
  var arrayLikeObject = SC.Object.create(SC.Array, {
46
56
  _content: [a,b,c],
47
57
  length: 3,
48
- objectAt: function(idx) { return this._content[idx]; }
58
+ objectAt: function(idx) { return this._content[idx]; }
49
59
  }) ;
50
-
60
+
51
61
  var set = SC.Set.create(arrayLikeObject) ;
52
62
  equals(set.length, 3) ;
53
63
  equals(set.contains(a), YES) ;
@@ -57,23 +67,23 @@ test("SC.Set.create() should accept anything that implements SC.Array", function
57
67
 
58
68
  var set ; // global variables
59
69
 
60
- // The tests below also end up testing the contains() method pretty
70
+ // The tests below also end up testing the contains() method pretty
61
71
  // exhaustively.
62
72
  module("SC.Set.add + SC.Set.contains", {
63
-
73
+
64
74
  setup: function() {
65
75
  set = SC.Set.create() ;
66
76
  },
67
-
77
+
68
78
  teardown: function() {
69
79
  set = undefined ;
70
80
  }
71
-
81
+
72
82
  });
73
83
 
74
84
  test("should add an SC.Object", function() {
75
85
  var obj = SC.Object.create() ;
76
-
86
+
77
87
  var oldLength = set.length ;
78
88
  set.add(obj) ;
79
89
  equals(set.contains(obj), YES, "contains()") ;
@@ -82,7 +92,7 @@ test("should add an SC.Object", function() {
82
92
 
83
93
  test("should add a regular hash", function() {
84
94
  var obj = {} ;
85
-
95
+
86
96
  var oldLength = set.length ;
87
97
  set.add(obj) ;
88
98
  equals(set.contains(obj), YES, "contains()") ;
@@ -91,7 +101,7 @@ test("should add a regular hash", function() {
91
101
 
92
102
  test("should add a string", function() {
93
103
  var obj = "String!" ;
94
-
104
+
95
105
  var oldLength = set.length ;
96
106
  set.add(obj) ;
97
107
  equals(set.contains(obj), YES, "contains()") ;
@@ -100,7 +110,7 @@ test("should add a string", function() {
100
110
 
101
111
  test("should add a number", function() {
102
112
  var obj = 23 ;
103
-
113
+
104
114
  var oldLength = set.length ;
105
115
  set.add(obj) ;
106
116
  equals(set.contains(obj), YES, "contains()") ;
@@ -129,7 +139,7 @@ test("should add 0", function() {
129
139
 
130
140
  test("should add a function", function() {
131
141
  var obj = function() { return "Test function"; } ;
132
-
142
+
133
143
  var oldLength = set.length ;
134
144
  set.add(obj) ;
135
145
  equals(set.contains(obj), YES, "contains()") ;
@@ -155,15 +165,80 @@ test("adding an item, removing it, adding another item", function() {
155
165
  set.add(item1) ; // add to set
156
166
  set.remove(item1) ; //remove from set
157
167
  set.add(item2) ;
158
-
168
+
159
169
  equals(set.contains(item1), NO, "set.contains(item1)") ;
160
-
170
+
161
171
  set.add(item1) ; // re-add to set
162
172
  equals(set.length, 2, "set.length") ;
163
173
  });
164
174
 
175
+ /**
176
+ This test illustrates a problem with SC.Set. It stored references to objects
177
+ at increasing indexes and removed references to the objects by ignoring the
178
+ index and overwriting it with a new object if it comes along. However, if
179
+ a lot of objects are added very quickly, they will be retained indefinitely
180
+ even after remove is called, until the same number of new objects are added
181
+ later.
182
+ */
183
+ test("adding and removing items should not retain references to removed objects", function() {
184
+ var guid1, guid2,
185
+ idx1, idx2,
186
+ item1 = "item1",
187
+ item2 = "item2";
188
+
189
+ guid1 = SC.guidFor(item1);
190
+ guid2 = SC.guidFor(item2);
191
+
192
+ // add to set
193
+ set.add(item1);
194
+ set.add(item2);
195
+
196
+ idx1 = set[guid1];
197
+ idx2 = set[guid2];
198
+
199
+ equals(set.length, 2, "set.length");
200
+ equals(set[idx1], item1, "item1 is at index %@ on the set".fmt(idx1));
201
+ equals(set[idx2], item2, "item2 is at index %@ on the set".fmt(idx2));
202
+ equals(set[guid1], 0, "guid for item1, %@, references index %@ on the set".fmt(guid1, idx1));
203
+ equals(set[guid2], 1, "guid for item2, %@, references index %@ on the set".fmt(guid2, idx2));
204
+
205
+ // remove from set
206
+ set.remove(item1);
207
+ set.remove(item2);
208
+
209
+ equals(set.length, 0, "set.length");
210
+ equals(set[idx1], undefined, "item1 is no longer at index %@ on the set".fmt(idx1));
211
+ equals(set[idx2], undefined, "item2 is no longer at index %@ on the set".fmt(idx2));
212
+ equals(set[guid1], undefined, "guid for item1, %@, is no longer on the set".fmt(guid1));
213
+ equals(set[guid2], undefined, "guid for item2, %@, is no longer on the set".fmt(guid2));
214
+
215
+ // add to set
216
+ set.add(item1);
217
+ set.add(item2);
218
+
219
+ idx1 = set[guid1];
220
+ idx2 = set[guid2];
221
+
222
+ equals(set.length, 2, "set.length");
223
+ equals(set[idx1], item1, "item1 is at index %@ on the set".fmt(idx1));
224
+ equals(set[idx2], item2, "item2 is at index %@ on the set".fmt(idx2));
225
+ equals(set[guid1], 0, "guid for item1, %@, references index %@ on the set".fmt(guid1, idx1));
226
+ equals(set[guid2], 1, "guid for item2, %@, references index %@ on the set".fmt(guid2, idx2));
227
+
228
+ // remove from set in reverse order
229
+ set.remove(item2);
230
+ set.remove(item1);
231
+
232
+ equals(set.length, 0, "set.length");
233
+ equals(set[idx1], undefined, "item1 is no longer at index %@ on the set".fmt(idx1));
234
+ equals(set[idx2], undefined, "item2 is no longer at index %@ on the set".fmt(idx2));
235
+ equals(set[guid1], undefined, "guid for item1, %@, is no longer on the set".fmt(guid1));
236
+ equals(set[guid2], undefined, "guid for item2, %@, is no longer on the set".fmt(guid2));
237
+ });
238
+
239
+
165
240
  module("SC.Set.remove + SC.Set.contains", {
166
-
241
+
167
242
  // generate a set with every type of object, but none of the specific
168
243
  // ones we add in the tests below...
169
244
  setup: function() {
@@ -173,11 +248,11 @@ module("SC.Set.remove + SC.Set.contains", {
173
248
  "Not the String",
174
249
  16, true, false, 0]) ;
175
250
  },
176
-
251
+
177
252
  teardown: function() {
178
253
  set = undefined ;
179
254
  }
180
-
255
+
181
256
  });
182
257
 
183
258
  test("should remove an SC.Object and reduce length", function() {
@@ -185,7 +260,7 @@ test("should remove an SC.Object and reduce length", function() {
185
260
  set.add(obj) ;
186
261
  equals(set.contains(obj), YES) ;
187
262
  var oldLength = set.length ;
188
-
263
+
189
264
  set.remove(obj) ;
190
265
  equals(set.contains(obj), NO, "should be removed") ;
191
266
  equals(set.length, oldLength-1, "should be 1 shorter") ;
@@ -196,7 +271,7 @@ test("should remove a regular hash and reduce length", function() {
196
271
  set.add(obj) ;
197
272
  equals(set.contains(obj), YES) ;
198
273
  var oldLength = set.length ;
199
-
274
+
200
275
  set.remove(obj) ;
201
276
  equals(set.contains(obj), NO, "should be removed") ;
202
277
  equals(set.length, oldLength-1, "should be 1 shorter") ;
@@ -207,7 +282,7 @@ test("should remove a string and reduce length", function() {
207
282
  set.add(obj) ;
208
283
  equals(set.contains(obj), YES) ;
209
284
  var oldLength = set.length ;
210
-
285
+
211
286
  set.remove(obj) ;
212
287
  equals(set.contains(obj), NO, "should be removed") ;
213
288
  equals(set.length, oldLength-1, "should be 1 shorter") ;
@@ -218,7 +293,7 @@ test("should remove a number and reduce length", function() {
218
293
  set.add(obj) ;
219
294
  equals(set.contains(obj), YES) ;
220
295
  var oldLength = set.length ;
221
-
296
+
222
297
  set.remove(obj) ;
223
298
  equals(set.contains(obj), NO, "should be removed") ;
224
299
  equals(set.length, oldLength-1, "should be 1 shorter") ;
@@ -247,7 +322,7 @@ test("should remove a function and reduce length", function() {
247
322
  set.add(obj) ;
248
323
  equals(set.contains(obj), YES) ;
249
324
  var oldLength = set.length ;
250
-
325
+
251
326
  set.remove(obj) ;
252
327
  equals(set.contains(obj), NO, "should be removed") ;
253
328
  equals(set.length, oldLength-1, "should be 1 shorter") ;
@@ -291,7 +366,7 @@ module("SC.Set.pop + SC.Set.clone", {
291
366
  "Not the String",
292
367
  16, false]) ;
293
368
  },
294
-
369
+
295
370
  teardown: function() {
296
371
  set = undefined ;
297
372
  }
@@ -7,6 +7,9 @@
7
7
 
8
8
  /*globals module test ok isObj equals expects */
9
9
 
10
+ // Note that these unit tests are calling SC.String.fmt directly, which has a different
11
+ // signature than String.prototype.fmt does.
12
+
10
13
  module("String Formatting");
11
14
  test("Passing ordered arguments", function() {
12
15
  equals(SC.String.fmt("%@, %@%@", ["Hello", "World", "!"]), "Hello, World!");
@@ -24,6 +27,10 @@ test("Passing named arguments", function() {
24
27
  ]), "Hello, World!");
25
28
  });
26
29
 
30
+ test("Passing incomplete named arguments", function() {
31
+ equals( SC.String.fmt("%{first}, %{last}%{punctuation}", [{first: 'Hello', punctuation: '!'}]), "Hello, %{last}!", "Formatting a string with an incomplete set of named arguments should leave unspecified named arguments in place." );
32
+ })
33
+
27
34
  test("Passing arguments with formatters", function() {
28
35
  var F = function(value) {
29
36
  return "$" + value;
@@ -26,7 +26,7 @@ SC.StatechartSequenceMatcher = SC.Object.extend({
26
26
  this.endSequence();
27
27
 
28
28
  if (this._stack.length > 0) {
29
- throw "can not match sequence. sequence matcher has been left in an invalid state";
29
+ throw new Error("can not match sequence. sequence matcher has been left in an invalid state");
30
30
  }
31
31
 
32
32
  var monitor = this.statechartMonitor,
@@ -113,7 +113,7 @@ SC.StatePathMatcher = SC.Object.extend(
113
113
  if (part.indexOf('~') >= 0) {
114
114
  part = part.split('~');
115
115
  if (part.length > 2) {
116
- throw "Invalid use of '~' at part %@".fmt(i);
116
+ throw new Error("Invalid use of '~' at part %@".fmt(i));
117
117
  }
118
118
  token = SC.StatePathMatcher._ExpandToken.create({
119
119
  start: part[0], end: part[1]
@@ -122,7 +122,7 @@ SC.StatePathMatcher = SC.Object.extend(
122
122
 
123
123
  else if (part === 'this') {
124
124
  if (tokens.length > 0) {
125
- throw "Invalid use of 'this' at part %@".fmt(i);
125
+ throw new Error("Invalid use of 'this' at part %@".fmt(i));
126
126
  }
127
127
  token = SC.StatePathMatcher._ThisToken.create();
128
128
  }
@@ -13,28 +13,28 @@ sc_require('system/state');
13
13
  @class
14
14
 
15
15
  Represents a history state that can be assigned to a SC.State object's
16
- initialSubstate property.
17
-
18
- If a SC.HistoryState object is assigned to a state's initial substate,
19
- then after a state is entered the statechart will refer to the history
20
- state object to determine the next course of action. If the state has
21
- its historyState property assigned then the that state will be entered,
16
+ initialSubstate property.
17
+
18
+ If a SC.HistoryState object is assigned to a state's initial substate,
19
+ then after a state is entered the statechart will refer to the history
20
+ state object to determine the next course of action. If the state has
21
+ its historyState property assigned then the that state will be entered,
22
22
  otherwise the default state assigned to history state object will be entered.
23
-
23
+
24
24
  An example of how to use:
25
-
25
+
26
26
  stateA: SC.State.design({
27
-
27
+
28
28
  initialSubstate: SC.HistoryState({
29
29
  defaultState: 'stateB'
30
30
  }),
31
-
31
+
32
32
  stateB: SC.State.design({ ... }),
33
-
33
+
34
34
  stateC: SC.State.design({ ... })
35
-
35
+
36
36
  })
37
-
37
+
38
38
  @author Michael Cohen
39
39
  @extends SC.Object
40
40
  */
@@ -42,43 +42,43 @@ SC.HistoryState = SC.Object.extend(
42
42
  /** @scope SC.HistoryState.prototype */{
43
43
 
44
44
  /**
45
- Used to indicate if the statechart should recurse the
45
+ Used to indicate if the statechart should recurse the
46
46
  history states after entering the this object's parent state
47
-
48
- @property {Boolean}
47
+
48
+ @type Boolean
49
49
  */
50
50
  isRecursive: NO,
51
-
51
+
52
52
  /**
53
53
  The default state to enter if the parent state does not
54
- yet have its historyState property assigned to something
54
+ yet have its historyState property assigned to something
55
55
  other than null.
56
-
56
+
57
57
  The value assigned to this property must be the name of an
58
58
  immediate substate that belongs to the parent state. The
59
59
  statechart will manage the property upon initialization.
60
-
61
- @property {String}
60
+
61
+ @type String
62
62
  */
63
63
  defaultState: null,
64
-
64
+
65
65
  /** @private
66
- Managed by the statechart
67
-
66
+ Managed by the statechart
67
+
68
68
  The statechart that owns this object.
69
69
  */
70
70
  statechart: null,
71
-
71
+
72
72
  /** @private
73
- Managed by the statechart
74
-
73
+ Managed by the statechart
74
+
75
75
  The state that owns this object
76
76
  */
77
77
  parentState: null,
78
-
78
+
79
79
  /**
80
- Used by the statechart during a state transition process.
81
-
80
+ Used by the statechart during a state transition process.
81
+
82
82
  Returns a state to enter based on whether the parent state has
83
83
  its historyState property assigned. If not then this object's
84
84
  assigned default state is returned.
@@ -88,10 +88,10 @@ SC.HistoryState = SC.Object.extend(
88
88
  historyState = this.getPath('parentState.historyState');
89
89
  return !!historyState ? historyState : defaultState;
90
90
  }.property().cacheable(),
91
-
91
+
92
92
  /** @private */
93
93
  parentHistoryStateDidChange: function() {
94
94
  this.notifyPropertyChange('state');
95
95
  }.observes('*parentState.historyState')
96
-
96
+
97
97
  });
@@ -10,12 +10,12 @@
10
10
  /**
11
11
  @class
12
12
 
13
- Represents a state within a statechart.
14
-
15
- The statechart actively manages all states belonging to it. When a state is created,
16
- it immediately registers itself with it parent states.
17
-
18
- You do not create an instance of a state itself. The statechart manager will go through its
13
+ Represents a state within a statechart.
14
+
15
+ The statechart actively manages all states belonging to it. When a state is created,
16
+ it immediately registers itself with it parent states.
17
+
18
+ You do not create an instance of a state itself. The statechart manager will go through its
19
19
  state heirarchy and create the states itself.
20
20
 
21
21
  For more information on using statecharts, see SC.StatechartManager.
@@ -26,130 +26,149 @@
26
26
  SC.State = SC.Object.extend(
27
27
  /** @lends SC.State.prototype */ {
28
28
 
29
+ //@if(debug)
30
+ /* BEGIN DEBUG ONLY PROPERTIES AND METHODS */
31
+
32
+ /**
33
+ Indicates if this state should trace actions. Useful for debugging
34
+ purposes. Managed by the statechart.
35
+
36
+ @see SC.StatechartManager#trace
37
+
38
+ @type Boolean
39
+ */
40
+ trace: function() {
41
+ var key = this.getPath('statechart.statechartTraceKey');
42
+ return this.getPath('statechart.%@'.fmt(key));
43
+ }.property().cacheable(),
44
+
45
+ /** @private */
46
+ _statechartTraceDidChange: function() {
47
+ this.notifyPropertyChange('trace');
48
+ },
49
+
50
+ /**
51
+ Used to log a state trace message
52
+ */
53
+ stateLogTrace: function(msg) {
54
+ var sc = this.get('statechart');
55
+ sc.statechartLogTrace("%@: %@".fmt(this, msg));
56
+ },
57
+
58
+ /* END DEBUG ONLY PROPERTIES AND METHODS */
59
+ //@endif
60
+
29
61
  /**
30
62
  The name of the state
31
-
32
- @property {String}
63
+
64
+ @type String
33
65
  */
34
66
  name: null,
35
-
67
+
36
68
  /**
37
69
  This state's parent state. Managed by the statechart
38
-
39
- @property {State}
70
+
71
+ @type State
40
72
  */
41
73
  parentState: null,
42
-
74
+
43
75
  /**
44
76
  This state's history state. Can be null. Managed by the statechart.
45
-
46
- @property {State}
77
+
78
+ @type State
47
79
  */
48
80
  historyState: null,
49
-
81
+
50
82
  /**
51
- Used to indicate the initial substate of this state to enter into.
52
-
53
- You assign the value with the name of the state. Upon creation of
54
- the state, the statechart will automatically change the property
83
+ Used to indicate the initial substate of this state to enter into.
84
+
85
+ You assign the value with the name of the state. Upon creation of
86
+ the state, the statechart will automatically change the property
55
87
  to be a corresponding state object
56
-
88
+
57
89
  The substate is only to be this state's immediate substates. If
58
90
  no initial substate is assigned then this states initial substate
59
91
  will be an instance of an empty state (SC.EmptyState).
60
-
92
+
61
93
  Note that a statechart's root state must always have an explicity
62
94
  initial substate value assigned else an error will be thrown.
63
-
95
+
64
96
  @property {String|State}
65
97
  */
66
98
  initialSubstate: null,
67
-
99
+
68
100
  /**
69
101
  Used to indicates if this state's immediate substates are to be
70
- concurrent (orthogonal) to each other.
71
-
72
- @property {Boolean}
102
+ concurrent (orthogonal) to each other.
103
+
104
+ @type Boolean
73
105
  */
74
106
  substatesAreConcurrent: NO,
75
-
107
+
76
108
  /**
77
109
  The immediate substates of this state. Managed by the statechart.
78
-
79
- @property {Array}
110
+
111
+ @type Array
80
112
  */
81
113
  substates: null,
82
-
114
+
83
115
  /**
84
116
  The statechart that this state belongs to. Assigned by the owning
85
117
  statechart.
86
-
87
- @property {Statechart}
118
+
119
+ @type Statechart
88
120
  */
89
121
  statechart: null,
90
-
122
+
91
123
  /**
92
124
  Indicates if this state has been initialized by the statechart
93
-
125
+
94
126
  @propety {Boolean}
95
127
  */
96
128
  stateIsInitialized: NO,
97
-
129
+
98
130
  /**
99
131
  An array of this state's current substates. Managed by the statechart
100
-
132
+
101
133
  @propety {Array}
102
134
  */
103
135
  currentSubstates: null,
104
-
105
- /**
136
+
137
+ /**
106
138
  An array of this state's substates that are currently entered. Managed by
107
139
  the statechart.
108
-
109
- @property {Array}
140
+
141
+ @type Array
110
142
  */
111
143
  enteredSubstates: null,
112
-
144
+
113
145
  /**
114
- Can optionally assign what route this state is to represent.
115
-
146
+ Can optionally assign what route this state is to represent.
147
+
116
148
  If assigned then this state will be notified to handle the route when triggered
117
- any time the app's location changes and matches this state's assigned route.
118
- The handler invoked is this state's {@link #routeTriggered} method.
119
-
120
- The value assigned to this property is dependent on the underlying routing
121
- mechanism used by the application. The default routing mechanism is to use
149
+ any time the app's location changes and matches this state's assigned route.
150
+ The handler invoked is this state's {@link #routeTriggered} method.
151
+
152
+ The value assigned to this property is dependent on the underlying routing
153
+ mechanism used by the application. The default routing mechanism is to use
122
154
  SC.routes.
123
-
155
+
124
156
  @property {String|Hash}
125
-
157
+
126
158
  @see #routeTriggered
127
159
  @see #location
128
160
  @see SC.StatechartDelegate
129
161
  */
130
162
  representRoute: null,
131
-
132
- /**
133
- Indicates if this state should trace actions. Useful for debugging
134
- purposes. Managed by the statechart.
135
-
136
- @see SC.StatechartManager#trace
137
-
138
- @property {Boolean}
139
- */
140
- trace: function() {
141
- var key = this.getPath('statechart.statechartTraceKey');
142
- return this.getPath('statechart.%@'.fmt(key));
143
- }.property().cacheable(),
144
-
145
- /**
163
+
164
+ /**
146
165
  Indicates who the owner is of this state. If not set on the statechart
147
166
  then the owner is the statechart, otherwise it is the assigned
148
167
  object. Managed by the statechart.
149
-
168
+
150
169
  @see SC.StatechartManager#owner
151
-
152
- @property {SC.Object}
170
+
171
+ @type SC.Object
153
172
  */
154
173
  owner: function() {
155
174
  var sc = this.get('statechart'),
@@ -157,26 +176,26 @@ SC.State = SC.Object.extend(
157
176
  owner = sc ? sc.get(key) : null;
158
177
  return owner ? owner : sc;
159
178
  }.property().cacheable(),
160
-
179
+
161
180
  /**
162
181
  Returns the statechart's assigned delegate. A statechart delegate is one
163
- that adheres to the {@link SC.StatechartDelegate} mixin.
164
-
165
- @property {SC.Object}
166
-
182
+ that adheres to the {@link SC.StatechartDelegate} mixin.
183
+
184
+ @type SC.Object
185
+
167
186
  @see SC.StatechartDelegate
168
187
  */
169
188
  statechartDelegate: function() {
170
189
  return this.getPath('statechart.statechartDelegate');
171
190
  }.property().cacheable(),
172
-
191
+
173
192
  /**
174
- A volatile property used to get and set the app's current location.
175
-
176
- This computed property defers to the the statechart's delegate to
193
+ A volatile property used to get and set the app's current location.
194
+
195
+ This computed property defers to the the statechart's delegate to
177
196
  actually update and acquire the app's location.
178
-
179
- Note: Binding for this pariticular case is discouraged since in most
197
+
198
+ Note: Binding for this particular case is discouraged since in most
180
199
  cases we need the location value immediately. If we were to use
181
200
  bindings then the location value wouldn't be updated until at least
182
201
  the end of one run loop. It is also advised that the delegate not
@@ -184,23 +203,23 @@ SC.State = SC.Object.extend(
184
203
  `statechartAcquireLocationForState` methods implemented where bindings
185
204
  are used since they will inadvertenly stall the location value from
186
205
  propogating immediately.
187
-
188
- @property {String}
189
-
206
+
207
+ @type String
208
+
190
209
  @see SC.StatechartDelegate#statechartUpdateLocationForState
191
210
  @see SC.StatechartDelegate#statechartAcquireLocationForState
192
211
  */
193
212
  location: function(key, value) {
194
213
  var sc = this.get('statechart'),
195
214
  del = this.get('statechartDelegate');
196
-
215
+
197
216
  if (value !== undefined) {
198
217
  del.statechartUpdateLocationForState(sc, value, this);
199
218
  }
200
-
219
+
201
220
  return del.statechartAcquireLocationForState(sc, this);
202
221
  }.property().idempotent(),
203
-
222
+
204
223
  init: function() {
205
224
  sc_super();
206
225
 
@@ -209,40 +228,46 @@ SC.State = SC.Object.extend(
209
228
  this._registeredRegExpEventHandlers = [];
210
229
  this._registeredStateObserveHandlers = {};
211
230
  this._registeredSubstatePaths = {};
212
- this._registeredSubstates = [];
231
+ this._registeredSubstates = [];
213
232
  this._isEnteringState = NO;
214
233
  this._isExitingState = NO;
215
234
 
216
235
  // Setting up observes this way is faster then using .observes,
217
236
  // which adds a noticable increase in initialization time.
218
-
237
+
219
238
  var sc = this.get('statechart'),
220
- ownerKey = sc ? sc.get('statechartOwnerKey') : null,
221
- traceKey = sc ? sc.get('statechartTraceKey') : null;
239
+ ownerKey = sc ? sc.get('statechartOwnerKey') : null;
222
240
 
223
241
  if (sc) {
224
242
  sc.addObserver(ownerKey, this, '_statechartOwnerDidChange');
243
+
244
+ //@if(debug)
245
+ var traceKey = sc ? sc.get('statechartTraceKey') : null;
225
246
  sc.addObserver(traceKey, this, '_statechartTraceDidChange');
247
+ //@endif
226
248
  }
227
249
  },
228
-
250
+
229
251
  destroy: function() {
230
252
  var sc = this.get('statechart'),
231
- ownerKey = sc ? sc.get('statechartOwnerKey') : null,
232
- traceKey = sc ? sc.get('statechartTraceKey') : null;
253
+ ownerKey = sc ? sc.get('statechartOwnerKey') : null;
233
254
 
234
255
  if (sc) {
235
256
  sc.removeObserver(ownerKey, this, '_statechartOwnerDidChange');
257
+
258
+ //@if(debug)
259
+ var traceKey = sc ? sc.get('statechartTraceKey') : null;
236
260
  sc.removeObserver(traceKey, this, '_statechartTraceDidChange');
261
+ //@endif
237
262
  }
238
-
263
+
239
264
  var substates = this.get('substates');
240
265
  if (substates) {
241
266
  substates.forEach(function(state) {
242
267
  state.destroy();
243
268
  });
244
- }
245
-
269
+ }
270
+
246
271
  this._teardownAllStateObserveHandlers();
247
272
 
248
273
  this.set('substates', null);
@@ -253,9 +278,12 @@ SC.State = SC.Object.extend(
253
278
  this.set('initialSubstate', null);
254
279
  this.set('statechart', null);
255
280
 
281
+ //@if(debug)
256
282
  this.notifyPropertyChange('trace');
283
+ //@endif
284
+
257
285
  this.notifyPropertyChange('owner');
258
-
286
+
259
287
  this._registeredEventHandlers = null;
260
288
  this._registeredStringEventHandlers = null;
261
289
  this._registeredRegExpEventHandlers = null;
@@ -271,11 +299,11 @@ SC.State = SC.Object.extend(
271
299
  */
272
300
  initState: function() {
273
301
  if (this.get('stateIsInitialized')) return;
274
-
302
+
275
303
  this._registerWithParentStates();
276
304
  this._setupRouteHandling();
277
-
278
- var key = null,
305
+
306
+ var key = null,
279
307
  value = null,
280
308
  state = null,
281
309
  substates = [],
@@ -287,40 +315,40 @@ SC.State = SC.Object.extend(
287
315
  len = 0,
288
316
  valueIsFunc = NO,
289
317
  historyState = null;
290
-
318
+
291
319
  this.set('substates', substates);
292
-
320
+
293
321
  if (SC.kindOf(initialSubstate, SC.HistoryState) && initialSubstate.isClass) {
294
322
  historyState = this.createSubstate(initialSubstate);
295
323
  this.set('initialSubstate', historyState);
296
-
324
+
297
325
  if (SC.none(historyState.get('defaultState'))) {
298
326
  this.stateLogError("Initial substate is invalid. History state requires the name of a default state to be set");
299
327
  this.set('initialSubstate', null);
300
328
  historyState = null;
301
329
  }
302
330
  }
303
-
331
+
304
332
  // Iterate through all this state's substates, if any, create them, and then initialize
305
333
  // them. This causes a recursive process.
306
334
  for (key in this) {
307
335
  value = this[key];
308
336
  valueIsFunc = SC.typeOf(value) === SC.T_FUNCTION;
309
-
337
+
310
338
  if (valueIsFunc && value.isEventHandler) {
311
339
  this._registerEventHandler(key, value);
312
340
  continue;
313
341
  }
314
-
342
+
315
343
  if (valueIsFunc && value.isStateObserveHandler) {
316
344
  this._registerStateObserveHandler(key, value);
317
345
  continue;
318
346
  }
319
-
347
+
320
348
  if (valueIsFunc && value.statePlugin) {
321
349
  value = value.apply(this);
322
350
  }
323
-
351
+
324
352
  if (SC.kindOf(value, SC.State) && value.isClass && this[key] !== this.constructor) {
325
353
  state = this._addSubstate(key, value);
326
354
  if (key === initialSubstate) {
@@ -332,16 +360,16 @@ SC.State = SC.Object.extend(
332
360
  }
333
361
  }
334
362
  }
335
-
363
+
336
364
  if (!SC.none(initialSubstate) && !matchedInitialSubstate) {
337
365
  this.stateLogError("Unable to set initial substate %@ since it did not match any of state's %@ substates".fmt(initialSubstate, this));
338
366
  }
339
-
367
+
340
368
  if (substates.length === 0) {
341
369
  if (!SC.none(initialSubstate)) {
342
370
  this.stateLogWarning("Unable to make %@ an initial substate since state %@ has no substates".fmt(initialSubstate, this));
343
371
  }
344
- }
372
+ }
345
373
  else if (substates.length > 0) {
346
374
  state = this._addEmptyInitialSubstateIfNeeded();
347
375
  if (!state && initialSubstate && substatesAreConcurrent) {
@@ -349,22 +377,22 @@ SC.State = SC.Object.extend(
349
377
  this.stateLogWarning("Can not use %@ as initial substate since substates are all concurrent for state %@".fmt(initialSubstate, this));
350
378
  }
351
379
  }
352
-
380
+
353
381
  this.notifyPropertyChange('substates');
354
382
  this.set('currentSubstates', []);
355
383
  this.set('enteredSubstates', []);
356
384
  this.set('stateIsInitialized', YES);
357
385
  },
358
-
359
- /** @private
360
-
386
+
387
+ /** @private
388
+
361
389
  Used to bind this state with a route this state is to represent if a route has been assigned.
362
-
363
- When invoked, the method will delegate the actual binding strategy to the statechart delegate
390
+
391
+ When invoked, the method will delegate the actual binding strategy to the statechart delegate
364
392
  via the delegate's {@link SC.StatechartDelegate#statechartBindStateToRoute} method.
365
-
393
+
366
394
  Note that a state cannot be bound to a route if this state is a concurrent state.
367
-
395
+
368
396
  @see #representRoute
369
397
  @see SC.StatechartDelegate#statechartBindStateToRoute
370
398
  */
@@ -373,34 +401,34 @@ SC.State = SC.Object.extend(
373
401
  sc = this.get('statechart'),
374
402
  del = this.get('statechartDelegate');
375
403
 
376
- if (!route) return;
377
-
404
+ if (SC.none(route)) return;
405
+
378
406
  if (this.get('isConcurrentState')) {
379
407
  this.stateLogError("State %@ cannot handle route '%@' since state is concurrent".fmt(this, route));
380
408
  return;
381
409
  }
382
-
410
+
383
411
  del.statechartBindStateToRoute(sc, this, route, this.routeTriggered);
384
412
  },
385
-
386
- /**
413
+
414
+ /**
387
415
  Main handler that gets triggered whenever the app's location matches this state's assigned
388
- route.
389
-
416
+ route.
417
+
390
418
  When invoked the handler will first refer to the statechart delegate to determine if it
391
- should actually handle the route via the delegate's
392
- {@see SC.StatechartDelegate#statechartShouldStateHandleTriggeredRoute} method. If the
419
+ should actually handle the route via the delegate's
420
+ {@see SC.StatechartDelegate#statechartShouldStateHandleTriggeredRoute} method. If the
393
421
  delegate allows the handling of the route then the state will continue on with handling
394
- the triggered route by calling the state's {@link #handleTriggeredRoute} method, otherwise
395
- the state will cancel the handling and inform the delegate through the delegate's
422
+ the triggered route by calling the state's {@link #handleTriggeredRoute} method, otherwise
423
+ the state will cancel the handling and inform the delegate through the delegate's
396
424
  {@see SC.StatechartDelegate#statechartStateCancelledHandlingRoute} method.
397
-
398
- The handler will create a state route context ({@link SC.StateRouteContext}) object
399
- that packages information about what is being currently handled. This context object gets
400
- passed along to the delegate's invoked methods as well as the state transition process.
401
-
425
+
426
+ The handler will create a state route context ({@link SC.StateRouteContext}) object
427
+ that packages information about what is being currently handled. This context object gets
428
+ passed along to the delegate's invoked methods as well as the state transition process.
429
+
402
430
  Note that this method is not intended to be directly called or overridden.
403
-
431
+
404
432
  @see #representRoute
405
433
  @see SC.StatechartDelegate#statechartShouldStateHandleRoute
406
434
  @see SC.StatechartDelegate#statechartStateCancelledHandlingRoute
@@ -409,59 +437,61 @@ SC.State = SC.Object.extend(
409
437
  */
410
438
  routeTriggered: function(params) {
411
439
  if (this._isEnteringState) return;
412
-
440
+
413
441
  var sc = this.get('statechart'),
414
442
  del = this.get('statechartDelegate'),
415
443
  loc = this.get('location');
416
-
444
+
417
445
  var attr = {
418
446
  state: this,
419
447
  location: loc,
420
448
  params: params,
421
449
  handler: this.routeTriggered
422
450
  };
423
-
451
+
424
452
  var context = this.createStateRouteHandlerContext(attr);
425
453
 
426
454
  if (del.statechartShouldStateHandleTriggeredRoute(sc, this, context)) {
455
+ //@if(debug)
427
456
  if (this.get('trace') && loc) {
428
457
  this.stateLogTrace("will handle route '%@'".fmt(loc));
429
458
  }
459
+ //@endif
430
460
  this.handleTriggeredRoute(context);
431
461
  } else {
432
462
  del.statechartStateCancelledHandlingTriggeredRoute(sc, this, context);
433
463
  }
434
464
  },
435
-
465
+
436
466
  /**
437
467
  Constructs a new instance of a state routing context object.
438
-
468
+
439
469
  @param {Hash} attr attributes to apply to the constructed object
440
470
  @return {SC.StateRouteContext}
441
-
471
+
442
472
  @see #handleRoute
443
473
  */
444
474
  createStateRouteHandlerContext: function(attr) {
445
475
  return SC.StateRouteHandlerContext.create(attr);
446
476
  },
447
-
477
+
448
478
  /**
449
479
  Invoked by this state's {@link #routeTriggered} method if the state is
450
- actually allowed to handle the triggered route.
451
-
480
+ actually allowed to handle the triggered route.
481
+
452
482
  By default the method invokes a state transition to this state.
453
483
  */
454
484
  handleTriggeredRoute: function(context) {
455
485
  this.gotoState(this, context);
456
486
  },
457
-
487
+
458
488
  /** @private */
459
489
  _addEmptyInitialSubstateIfNeeded: function() {
460
490
  var initialSubstate = this.get('initialSubstate'),
461
491
  substatesAreConcurrent = this.get('substatesAreConcurrent');
462
-
492
+
463
493
  if (initialSubstate || substatesAreConcurrent) return null;
464
-
494
+
465
495
  var state = this.createSubstate(SC.EmptyState);
466
496
  this.set('initialSubstate', state);
467
497
  this.get('substates').push(state);
@@ -470,11 +500,11 @@ SC.State = SC.Object.extend(
470
500
  this.stateLogWarning("state %@ has no initial substate defined. Will default to using an empty state as initial substate".fmt(this));
471
501
  return state;
472
502
  },
473
-
503
+
474
504
  /** @private */
475
505
  _addSubstate: function(name, state, attr) {
476
506
  var substates = this.get('substates');
477
-
507
+
478
508
  attr = SC.clone(attr) || {};
479
509
  attr.name = name;
480
510
  state = this.createSubstate(state, attr);
@@ -483,31 +513,31 @@ SC.State = SC.Object.extend(
483
513
  state.initState();
484
514
  return state;
485
515
  },
486
-
516
+
487
517
  /**
488
518
  Used to dynamically add a substate to this state. Once added successfully you
489
519
  are then able to go to it from any other state within the owning statechart.
490
-
520
+
491
521
  A couple of notes when adding a substate:
492
-
493
- - If this state does not have any substates, then in addition to the
494
- substate being added, an empty state will also be added and set as the
522
+
523
+ - If this state does not have any substates, then in addition to the
524
+ substate being added, an empty state will also be added and set as the
495
525
  initial substate. To make the added substate the initial substate, set
496
526
  this object's initialSubstate property.
497
-
498
- - If this state is a current state, the added substate will not be entered.
499
-
500
- - If this state is entered and its substates are concurrent, the added
501
- substate will not be entered.
502
-
527
+
528
+ - If this state is a current state, the added substate will not be entered.
529
+
530
+ - If this state is entered and its substates are concurrent, the added
531
+ substate will not be entered.
532
+
503
533
  If this state is either entered or current and you'd like the added substate
504
534
  to take affect, you will need to explicitly reenter this state by calling
505
535
  its `reenter` method.
506
-
536
+
507
537
  Be aware that the name of the state you are adding must not conflict with
508
- the name of a property on this state or else you will get an error.
538
+ the name of a property on this state or else you will get an error.
509
539
  In addition, this state must be initialized to add substates.
510
-
540
+
511
541
  @param {String} name a unique name for the given substate.
512
542
  @param {SC.State} state a class that derives from `SC.State`
513
543
  @param {Hash} [attr] liternal to be applied to the substate
@@ -518,12 +548,12 @@ SC.State = SC.Object.extend(
518
548
  this.stateLogError("Can not add substate. name required");
519
549
  return null;
520
550
  }
521
-
551
+
522
552
  if (this[name] !== undefined) {
523
553
  this.stateLogError("Can not add substate '%@'. Already a defined property".fmt(name));
524
554
  return null;
525
555
  }
526
-
556
+
527
557
  if (!this.get('stateIsInitialized')) {
528
558
  this.stateLogError("Can not add substate '%@'. this state is not yet initialized".fmt(name));
529
559
  return null;
@@ -537,21 +567,21 @@ SC.State = SC.Object.extend(
537
567
  attr = state;
538
568
  state = SC.State;
539
569
  }
540
-
570
+
541
571
  var stateIsValid = SC.kindOf(state, SC.State) && state.isClass;
542
-
572
+
543
573
  if (!stateIsValid) {
544
574
  this.stateLogError("Can not add substate '%@'. must provide a state class".fmt(name));
545
575
  return null;
546
576
  }
547
-
577
+
548
578
  state = this._addSubstate(name, state, attr);
549
579
  this._addEmptyInitialSubstateIfNeeded();
550
580
  this.notifyPropertyChange('substates');
551
-
581
+
552
582
  return state;
553
583
  },
554
-
584
+
555
585
  /**
556
586
  creates a substate for this state
557
587
  */
@@ -562,9 +592,9 @@ SC.State = SC.Object.extend(
562
592
  statechart: this.get('statechart')
563
593
  }, attr);
564
594
  },
565
-
566
- /** @private
567
-
595
+
596
+ /** @private
597
+
568
598
  Registers event handlers with this state. Event handlers are special
569
599
  functions on the state that are intended to handle more than one event. This
570
600
  compared to basic functions that only respond to a single event that reflects
@@ -575,12 +605,12 @@ SC.State = SC.Object.extend(
575
605
  event = null,
576
606
  len = events.length,
577
607
  i = 0;
578
-
608
+
579
609
  this._registeredEventHandlers[name] = handler;
580
-
610
+
581
611
  for (; i < len; i += 1) {
582
612
  event = events[i];
583
-
613
+
584
614
  if (SC.typeOf(event) === SC.T_STRING) {
585
615
  this._registeredStringEventHandlers[event] = {
586
616
  name: name,
@@ -588,7 +618,7 @@ SC.State = SC.Object.extend(
588
618
  };
589
619
  continue;
590
620
  }
591
-
621
+
592
622
  if (event instanceof RegExp) {
593
623
  this._registeredRegExpEventHandlers.push({
594
624
  name: name,
@@ -597,36 +627,36 @@ SC.State = SC.Object.extend(
597
627
  });
598
628
  continue;
599
629
  }
600
-
630
+
601
631
  this.stateLogError("Invalid event %@ for event handler %@ in state %@".fmt(event, name, this));
602
632
  }
603
633
  },
604
-
605
- /** @private
606
-
634
+
635
+ /** @private
636
+
607
637
  Registers state observe handlers with this state. State observe handlers behave just like
608
- when you apply observes() on a method but will only be active when the state is currently
638
+ when you apply observes() on a method but will only be active when the state is currently
609
639
  entered, otherwise the handlers are inactive until the next time the state is entered
610
640
  */
611
641
  _registerStateObserveHandler: function(name, handler) {
612
- var i = 0,
613
- args = handler.args,
614
- len = args.length,
642
+ var i = 0,
643
+ args = handler.args,
644
+ len = args.length,
615
645
  arg, validHandlers = YES;
616
-
646
+
617
647
  for (; i < len; i += 1) {
618
648
  arg = args[i];
619
- if (SC.typeOf(arg) !== SC.T_STRING || SC.empty(arg)) {
649
+ if (SC.typeOf(arg) !== SC.T_STRING || SC.empty(arg)) {
620
650
  this.stateLogError("Invalid argument %@ for state observe handler %@ in state %@".fmt(arg, name, this));
621
651
  validHandlers = NO;
622
652
  }
623
653
  }
624
-
654
+
625
655
  if (!validHandlers) return;
626
-
656
+
627
657
  this._registeredStateObserveHandlers[name] = handler.args;
628
658
  },
629
-
659
+
630
660
  /** @private
631
661
  Will traverse up through this state's parent states to register
632
662
  this state with them.
@@ -638,82 +668,82 @@ SC.State = SC.Object.extend(
638
668
  parent = parent.get('parentState');
639
669
  }
640
670
  },
641
-
671
+
642
672
  /** @private
643
673
  Will register a given state as a substate of this state
644
674
  */
645
675
  _registerSubstate: function(state) {
646
676
  var path = state.pathRelativeTo(this);
647
- if (SC.none(path)) return;
648
-
677
+ if (SC.none(path)) return;
678
+
649
679
  this._registeredSubstates.push(state);
650
-
680
+
651
681
  // Keep track of states based on their relative path
652
- // to this state.
682
+ // to this state.
653
683
  var regPaths = this._registeredSubstatePaths;
654
684
  if (regPaths[state.get('name')] === undefined) {
655
685
  regPaths[state.get('name')] = { };
656
686
  }
657
-
687
+
658
688
  var paths = regPaths[state.get('name')];
659
689
  paths[path] = state;
660
690
  },
661
-
691
+
662
692
  /**
663
693
  Will generate path for a given state that is relative to this state. It is
664
694
  required that the given state is a substate of this state.
665
-
695
+
666
696
  If the heirarchy of the given state to this state is the following:
667
- A > B > C, where A is this state and C is the given state, then the
697
+ A > B > C, where A is this state and C is the given state, then the
668
698
  relative path generated will be "B.C"
669
699
  */
670
700
  pathRelativeTo: function(state) {
671
701
  var path = this.get('name'),
672
702
  parent = this.get('parentState');
673
-
703
+
674
704
  while (!SC.none(parent) && parent !== state) {
675
705
  path = "%@.%@".fmt(parent.get('name'), path);
676
706
  parent = parent.get('parentState');
677
707
  }
678
-
708
+
679
709
  if (parent !== state && state !== this) {
680
710
  this.stateLogError('Can not generate relative path from %@ since it not a parent state of %@'.fmt(state, this));
681
711
  return null;
682
712
  }
683
-
713
+
684
714
  return path;
685
715
  },
686
-
716
+
687
717
  /**
688
- Used to get a substate of this state that matches a given value.
689
-
690
- If the value is a state object, then the value will be returned if it is indeed
691
- a substate of this state, otherwise null is returned.
692
-
693
- If the given value is a string, then the string is assumed to be a path expression
718
+ Used to get a substate of this state that matches a given value.
719
+
720
+ If the value is a state object, then the value will be returned if it is indeed
721
+ a substate of this state, otherwise null is returned.
722
+
723
+ If the given value is a string, then the string is assumed to be a path expression
694
724
  to a substate. The value is then parsed to find the closes match. For path expression
695
725
  syntax, refer to the {@link SC.StatePathMatcher} class.
696
-
697
- If there is no match then null is returned. If there is more than one match then null
698
- is return and an error is generated indicating ambiguity of the given value.
699
-
700
- An optional callback can be provided to handle the scenario when either no
726
+
727
+ If there is no match then null is returned. If there is more than one match then null
728
+ is return and an error is generated indicating ambiguity of the given value.
729
+
730
+ An optional callback can be provided to handle the scenario when either no
701
731
  substate is found or there is more than one match. The callback is then given
702
732
  the opportunity to further handle the outcome and return a result which the
703
733
  getSubstate method will then return. The callback should have the following
704
734
  signature:
705
-
706
- function(state, value, paths)
707
-
735
+
736
+ function(state, value, paths)
737
+
708
738
  - state: The state getState was invoked on
709
- - value: The value supplied to getState
739
+ - value: The value supplied to getState
710
740
  - paths: An array of substate paths that matched the given value
711
-
712
- If there were no matches then `paths` is not provided to the callback.
713
-
741
+
742
+ If there were no matches then `paths` is not provided to the callback.
743
+
714
744
  You can also optionally provide a target that the callback is invoked on. If no
715
- target is provided then this state is used as the target.
716
-
745
+ target is provided then this state is used as the target.
746
+
717
747
  @param value {State|String} used to identify a substate of this state
718
748
  @param [callback] {Function} the callback
719
749
  @param [target] {Object} the target
@@ -722,66 +752,66 @@ SC.State = SC.Object.extend(
722
752
  if (!value) return null;
723
753
 
724
754
  var valueType = SC.typeOf(value);
725
-
726
- // If the value is an object then just check if the value is
727
- // a registered substate of this state, and if so return it.
755
+
756
+ // If the value is an object then just check if the value is
757
+ // a registered substate of this state, and if so return it.
728
758
  if (valueType === SC.T_OBJECT) {
729
759
  return this._registeredSubstates.indexOf(value) > -1 ? value : null;
730
760
  }
731
-
761
+
732
762
  if (valueType !== SC.T_STRING) {
733
763
  this.stateLogError("Can not find matching subtype. value must be an object or string: %@".fmt(value));
734
764
  return null;
735
765
  }
736
-
737
- var matcher = SC.StatePathMatcher.create({ state: this, expression: value }),
766
+
767
+ var matcher = SC.StatePathMatcher.create({ state: this, expression: value }),
738
768
  matches = [], key;
739
769
 
740
770
  if (matcher.get('tokens').length === 0) return null;
741
771
 
742
772
  var paths = this._registeredSubstatePaths[matcher.get('lastPart')];
743
773
  if (!paths) return this._notifySubstateNotFound(callback, target, value);
744
-
774
+
745
775
  for (key in paths) {
746
776
  if (matcher.match(key)) {
747
777
  matches.push(paths[key]);
748
778
  }
749
779
  }
750
-
780
+
751
781
  if (matches.length === 1) return matches[0];
752
-
782
+
753
783
  if (matches.length > 1) {
754
784
  var keys = [];
755
785
  for (key in paths) { keys.push(key); }
756
-
786
+
757
787
  if (callback) return this._notifySubstateNotFound(callback, target, value, keys);
758
-
788
+
759
789
  var msg = "Can not find substate matching '%@' in state %@. Ambiguous with the following: %@";
760
790
  this.stateLogError(msg.fmt(value, this.get('fullPath'), keys.join(', ')));
761
- }
762
-
791
+ }
792
+
763
793
  return this._notifySubstateNotFound(callback, target, value);
764
794
  },
765
-
795
+
766
796
  /** @private */
767
797
  _notifySubstateNotFound: function(callback, target, value, keys) {
768
798
  return callback ? callback.call(target || this, this, value, keys) : null;
769
799
  },
770
-
800
+
771
801
  /**
772
- Will attempt to get a state relative to this state.
773
-
802
+ Will attempt to get a state relative to this state.
803
+
774
804
  A state is returned based on the following:
775
-
805
+
776
806
  1. First check this state's substates for a match; and
777
807
  2. If no matching substate then attempt to get the state from
778
808
  this state's parent state.
779
-
809
+
780
810
  Therefore states are recursively traversed up to the root state
781
811
  to identify a match, and if found is ultimately returned, otherwise
782
812
  null is returned. In the case that the value supplied is ambiguous
783
813
  an error message is returned.
784
-
814
+
785
815
  The value provided can either be a state object or a state path expression.
786
816
  For path expression syntax, refer to the {@link SC.StatePathMatcher} class.
787
817
  */
@@ -790,66 +820,66 @@ SC.State = SC.Object.extend(
790
820
  if (SC.kindOf(value, SC.State)) return value;
791
821
  return this.getSubstate(value, this._handleSubstateNotFound);
792
822
  },
793
-
823
+
794
824
  /** @private */
795
825
  _handleSubstateNotFound: function(state, value, keys) {
796
826
  var parentState = this.get('parentState');
797
-
827
+
798
828
  if (parentState) return parentState.getState(value);
799
-
829
+
800
830
  if (keys) {
801
831
  var msg = "Can not find state matching '%@'. Ambiguous with the following: %@";
802
832
  this.stateLogError(msg.fmt(value, keys.join(', ')));
803
833
  }
804
-
834
+
805
835
  return null;
806
836
  },
807
-
837
+
808
838
  /**
809
839
  Used to go to a state in the statechart either directly from this state if it is a current state,
810
840
  or from the first relative current state from this state.
811
-
841
+
812
842
  If the value given is a string then it is considered a state path expression. The path is then
813
843
  used to find a state relative to this state based on rules of the {@link #getState} method.
814
-
844
+
815
845
  @param value {SC.State|String} the state to go to
816
846
  @param [context] {Hash|Object} context object that will be supplied to all states that are
817
- exited and entered during the state transition process. Context can not be an instance of
847
+ exited and entered during the state transition process. Context can not be an instance of
818
848
  SC.State.
819
849
  */
820
850
  gotoState: function(value, context) {
821
851
  var state = this.getState(value);
822
-
852
+
823
853
  if (!state) {
824
854
  var msg = "can not go to state %@ from state %@. Invalid value.";
825
855
  this.stateLogError(msg.fmt(value, this));
826
856
  return;
827
- }
857
+ }
828
858
 
829
859
  var from = this.findFirstRelativeCurrentState(state);
830
- this.get('statechart').gotoState(state, from, false, context);
860
+ this.get('statechart').gotoState(state, from, false, context);
831
861
  },
832
-
862
+
833
863
  /**
834
864
  Used to go to a given state's history state in the statechart either directly from this state if it
835
- is a current state or from one of this state's current substates.
836
-
865
+ is a current state or from one of this state's current substates.
866
+
837
867
  If the value given is a string then it is considered a state path expression. The path is then
838
868
  used to find a state relative to this state based on rules of the {@link #getState} method.
839
-
869
+
840
870
  Method can be called in the following ways:
841
-
871
+
842
872
  // With one argument
843
873
  gotoHistoryState(<value>)
844
-
874
+
845
875
  // With two arguments
846
876
  gotoHistoryState(<value>, <boolean | hash>)
847
-
877
+
848
878
  // With three arguments
849
879
  gotoHistoryState(<value>, <boolean>, <hash>)
850
-
880
+
851
881
  Where <value> is either a string or a SC.State object and <hash> is a regular JS hash object.
852
-
882
+
853
883
  @param value {SC.State|String} the state whose history state to go to
854
884
  @param [recusive] {Boolean} indicates whether to follow history states recusively starting
855
885
  from the given state
@@ -858,13 +888,13 @@ SC.State = SC.Object.extend(
858
888
  */
859
889
  gotoHistoryState: function(value, recursive, context) {
860
890
  var state = this.getState(value);
861
-
891
+
862
892
  if (!state) {
863
893
  var msg = "can not go to history state %@ from state %@. Invalid value.";
864
894
  this.stateLogError(msg.fmt(value, this));
865
895
  return;
866
896
  }
867
-
897
+
868
898
  var from = this.findFirstRelativeCurrentState(state);
869
899
  this.get('statechart').gotoHistoryState(state, from, recursive, context);
870
900
  },
@@ -875,11 +905,11 @@ SC.State = SC.Object.extend(
875
905
  resumeGotoState: function() {
876
906
  this.get('statechart').resumeGotoState();
877
907
  },
878
-
908
+
879
909
  /**
880
910
  Used to check if a given state is a current substate of this state. Mainly used in cases
881
911
  when this state is a concurrent state.
882
-
912
+
883
913
  @param state {State|String} either a state object or the name of a state
884
914
  @returns {Boolean} true is the given state is a current substate, otherwise false is returned
885
915
  */
@@ -887,11 +917,11 @@ SC.State = SC.Object.extend(
887
917
  if (SC.typeOf(state) === SC.T_STRING) state = this.get('statechart').getState(state);
888
918
  var current = this.get('currentSubstates');
889
919
  return !!current && current.indexOf(state) >= 0;
890
- },
891
-
920
+ },
921
+
892
922
  /**
893
- Used to check if a given state is a substate of this state that is currently entered.
894
-
923
+ Used to check if a given state is a substate of this state that is currently entered.
924
+
895
925
  @param state {State|String} either a state object of the name of a state
896
926
  @returns {Boolean} true if the given state is a entered substate, otherwise false is returned
897
927
  */
@@ -900,54 +930,54 @@ SC.State = SC.Object.extend(
900
930
  var entered = this.get('enteredSubstates');
901
931
  return !!entered && entered.indexOf(state) >= 0;
902
932
  },
903
-
933
+
904
934
  /**
905
935
  Indicates if this state is the root state of the statechart.
906
-
907
- @property {Boolean}
936
+
937
+ @type Boolean
908
938
  */
909
939
  isRootState: function() {
910
940
  return this.getPath('statechart.rootState') === this;
911
941
  }.property(),
912
-
942
+
913
943
  /**
914
944
  Indicates if this state is a current state of the statechart.
915
-
916
- @property {Boolean}
945
+
946
+ @type Boolean
917
947
  */
918
948
  isCurrentState: function() {
919
949
  return this.stateIsCurrentSubstate(this);
920
950
  }.property('currentSubstates').cacheable(),
921
-
951
+
922
952
  /**
923
953
  Indicates if this state is a concurrent state
924
-
925
- @property {Boolean}
954
+
955
+ @type Boolean
926
956
  */
927
957
  isConcurrentState: function() {
928
958
  return this.getPath('parentState.substatesAreConcurrent');
929
959
  }.property(),
930
-
960
+
931
961
  /**
932
- Indicates if this state is a currently entered state.
933
-
962
+ Indicates if this state is a currently entered state.
963
+
934
964
  A state is currently entered if during a state transition process the
935
- state's enterState method was invoked, but only after its exitState method
965
+ state's enterState method was invoked, but only after its exitState method
936
966
  was called, if at all.
937
967
  */
938
968
  isEnteredState: function() {
939
969
  return this.stateIsEnteredSubstate(this);
940
970
  }.property('enteredSubstates').cacheable(),
941
-
971
+
942
972
  /**
943
973
  Indicate if this state has any substates
944
-
974
+
945
975
  @propety {Boolean}
946
976
  */
947
977
  hasSubstates: function() {
948
978
  return this.getPath('substates.length') > 0;
949
979
  }.property('substates'),
950
-
980
+
951
981
  /**
952
982
  Indicates if this state has any current substates
953
983
  */
@@ -955,7 +985,7 @@ SC.State = SC.Object.extend(
955
985
  var current = this.get('currentSubstates');
956
986
  return !!current && current.get('length') > 0;
957
987
  }.property('currentSubstates').cacheable(),
958
-
988
+
959
989
  /**
960
990
  Indicates if this state has any currently entered substates
961
991
  */
@@ -965,24 +995,24 @@ SC.State = SC.Object.extend(
965
995
  }.property('enteredSubstates').cacheable(),
966
996
 
967
997
  /**
968
- Will attempt to find a current state in the statechart that is relative to
969
- this state.
970
-
998
+ Will attempt to find a current state in the statechart that is relative to
999
+ this state.
1000
+
971
1001
  Ordered set of rules to find a relative current state:
972
-
1002
+
973
1003
  1. If this state is a current state then it will be returned
974
-
1004
+
975
1005
  2. If this state has no current states and this state has a parent state then
976
1006
  return parent state's first relative current state, otherwise return null
977
-
1007
+
978
1008
  3. If this state has more than one current state then use the given anchor state
979
1009
  to get a corresponding substate that can be used to find a current state relative
980
- to the substate, if a substate was found.
981
-
1010
+ to the substate, if a substate was found.
1011
+
982
1012
  4. If (3) did not find a relative current state then default to returning
983
- this state's first current substate.
1013
+ this state's first current substate.
984
1014
 
985
- @param anchor {State|String} Optional. a substate of this state used to help direct
1015
+ @param anchor {State|String} Optional. a substate of this state used to help direct
986
1016
  finding a current state
987
1017
  @return {SC.State} a current state
988
1018
  */
@@ -1001,13 +1031,13 @@ SC.State = SC.Object.extend(
1001
1031
  anchor = this.getSubstate(anchor);
1002
1032
  if (anchor) return anchor.findFirstRelativeCurrentState();
1003
1033
  }
1004
-
1034
+
1005
1035
  return currentSubstates[0];
1006
1036
  },
1007
1037
 
1008
1038
  /**
1009
1039
  Used to re-enter this state. Call this only when the state a current state of
1010
- the statechart.
1040
+ the statechart.
1011
1041
  */
1012
1042
  reenter: function() {
1013
1043
  if (this.get('isEnteredState')) {
@@ -1016,55 +1046,57 @@ SC.State = SC.Object.extend(
1016
1046
  SC.Logger.error('Can not re-enter state %@ since it is not an entered state in the statechart'.fmt(this));
1017
1047
  }
1018
1048
  },
1019
-
1049
+
1020
1050
  /**
1021
1051
  Called by the statechart to allow a state to try and handle the given event. If the
1022
1052
  event is handled by the state then YES is returned, otherwise NO.
1023
-
1053
+
1024
1054
  There is a particular order in how an event is handled by a state:
1025
-
1055
+
1026
1056
  1. Basic function whose name matches the event
1027
1057
  2. Registered event handler that is associated with an event represented as a string
1028
1058
  3. Registered event handler that is associated with events matching a regular expression
1029
1059
  4. The unknownEvent function
1030
-
1060
+
1031
1061
  Use of event handlers that are associated with events matching a regular expression may
1032
1062
  incur a performance hit, so they should be used sparingly.
1033
-
1063
+
1034
1064
  The unknownEvent function is only invoked if the state has it, otherwise it is skipped. Note that
1035
1065
  you should be careful when using unknownEvent since it can be either abused or cause unexpected
1036
1066
  behavior.
1037
-
1067
+
1038
1068
  Example of a state using all four event handling techniques:
1039
-
1069
+
1040
1070
  SC.State.extend({
1041
-
1071
+
1042
1072
  // Basic function handling event 'foo'
1043
1073
  foo: function(arg1, arg2) { ... },
1044
-
1074
+
1045
1075
  // event handler that handles 'frozen' and 'canuck'
1046
1076
  eventHandlerA: function(event, arg1, arg2) {
1047
1077
  ...
1048
1078
  }.handleEvent('frozen', 'canuck'),
1049
-
1079
+
1050
1080
  // event handler that handles events matching the regular expression /num\d/
1051
1081
  // ex. num1, num2
1052
1082
  eventHandlerB: function(event, arg1, arg2) {
1053
1083
  ...
1054
1084
  }.handleEvent(/num\d/),
1055
-
1085
+
1056
1086
  // Handle any event that was not handled by some other
1057
1087
  // method on the state
1058
1088
  unknownEvent: function(event, arg1, arg2) {
1059
-
1089
+
1060
1090
  }
1061
-
1091
+
1062
1092
  });
1063
1093
  */
1064
1094
  tryToHandleEvent: function(event, arg1, arg2) {
1095
+ //@if(debug)
1096
+ var trace = this.get('trace');
1097
+ //@endif
1065
1098
 
1066
- var trace = this.get('trace'),
1067
- sc = this.get('statechart'),
1099
+ var sc = this.get('statechart'),
1068
1100
  ret;
1069
1101
 
1070
1102
  // First check if the name of the event is the same as a registered event handler. If so,
@@ -1072,203 +1104,211 @@ SC.State = SC.Object.extend(
1072
1104
  if (this._registeredEventHandlers[event]) {
1073
1105
  this.stateLogWarning("state %@ can not handle event '%@' since it is a registered event handler".fmt(this, event));
1074
1106
  return NO;
1075
- }
1076
-
1107
+ }
1108
+
1077
1109
  if (this._registeredStateObserveHandlers[event]) {
1078
1110
  this.stateLogWarning("state %@ can not handle event '%@' since it is a registered state observe handler".fmt(this, event));
1079
1111
  return NO;
1080
1112
  }
1081
-
1113
+
1082
1114
  // Now begin by trying a basic method on the state to respond to the event
1083
1115
  if (SC.typeOf(this[event]) === SC.T_FUNCTION) {
1116
+ //@if(debug)
1084
1117
  if (trace) this.stateLogTrace("will handle event '%@'".fmt(event));
1118
+ //@endif
1085
1119
  sc.stateWillTryToHandleEvent(this, event, event);
1086
1120
  ret = (this[event](arg1, arg2) !== NO);
1087
1121
  sc.stateDidTryToHandleEvent(this, event, event, ret);
1088
1122
  return ret;
1089
1123
  }
1090
-
1124
+
1091
1125
  // Try an event handler that is associated with an event represented as a string
1092
1126
  var handler = this._registeredStringEventHandlers[event];
1093
1127
  if (handler) {
1128
+ //@if(debug)
1094
1129
  if (trace) this.stateLogTrace("%@ will handle event '%@'".fmt(handler.name, event));
1130
+ //@endif
1095
1131
  sc.stateWillTryToHandleEvent(this, event, handler.name);
1096
1132
  ret = (handler.handler.call(this, event, arg1, arg2) !== NO);
1097
1133
  sc.stateDidTryToHandleEvent(this, event, handler.name, ret);
1098
1134
  return ret;
1099
1135
  }
1100
-
1136
+
1101
1137
  // Try an event handler that is associated with events matching a regular expression
1102
-
1138
+
1103
1139
  var len = this._registeredRegExpEventHandlers.length,
1104
1140
  i = 0;
1105
-
1141
+
1106
1142
  for (; i < len; i += 1) {
1107
1143
  handler = this._registeredRegExpEventHandlers[i];
1108
1144
  if (event.match(handler.regexp)) {
1145
+ //@if(debug)
1109
1146
  if (trace) this.stateLogTrace("%@ will handle event '%@'".fmt(handler.name, event));
1147
+ //@endif
1110
1148
  sc.stateWillTryToHandleEvent(this, event, handler.name);
1111
1149
  ret = (handler.handler.call(this, event, arg1, arg2) !== NO);
1112
1150
  sc.stateDidTryToHandleEvent(this, event, handler.name, ret);
1113
1151
  return ret;
1114
1152
  }
1115
1153
  }
1116
-
1117
- // Final attempt. If the state has an unknownEvent function then invoke it to
1154
+
1155
+ // Final attempt. If the state has an unknownEvent function then invoke it to
1118
1156
  // handle the event
1119
1157
  if (SC.typeOf(this['unknownEvent']) === SC.T_FUNCTION) {
1158
+ //@if(debug)
1120
1159
  if (trace) this.stateLogTrace("unknownEvent will handle event '%@'".fmt(event));
1160
+ //@endif
1121
1161
  sc.stateWillTryToHandleEvent(this, event, 'unknownEvent');
1122
1162
  ret = (this.unknownEvent(event, arg1, arg2) !== NO);
1123
1163
  sc.stateDidTryToHandleEvent(this, event, 'unknownEvent', ret);
1124
1164
  return ret;
1125
1165
  }
1126
-
1166
+
1127
1167
  // Nothing was able to handle the given event for this state
1128
1168
  return NO;
1129
1169
  },
1130
-
1170
+
1131
1171
  /**
1132
- Called whenever this state is to be entered during a state transition process. This
1133
- is useful when you want the state to perform some initial set up procedures.
1134
-
1172
+ Called whenever this state is to be entered during a state transition process. This
1173
+ is useful when you want the state to perform some initial set up procedures.
1174
+
1135
1175
  If when entering the state you want to perform some kind of asynchronous action, such
1136
- as an animation or fetching remote data, then you need to return an asynchronous
1176
+ as an animation or fetching remote data, then you need to return an asynchronous
1137
1177
  action, which is done like so:
1138
-
1178
+
1139
1179
  enterState: function() {
1140
1180
  return this.performAsync('foo');
1141
1181
  }
1142
-
1182
+
1143
1183
  After returning an action to be performed asynchronously, the statechart will suspend
1144
1184
  the active state transition process. In order to resume the process, you must call
1145
- this state's resumeGotoState method or the statechart's resumeGotoState. If no asynchronous
1185
+ this state's resumeGotoState method or the statechart's resumeGotoState. If no asynchronous
1146
1186
  action is to be perform, then nothing needs to be returned.
1147
-
1187
+
1148
1188
  When the enterState method is called, an optional context value may be supplied if
1149
1189
  one was provided to the gotoState method.
1150
-
1151
- In the case that the context being supplied is a state context object
1190
+
1191
+ In the case that the context being supplied is a state context object
1152
1192
  ({@link SC.StateRouteHandlerContext}), an optional `enterStateByRoute` method can be invoked
1153
1193
  on this state if the state has implemented the method. If `enterStateByRoute` is
1154
1194
  not part of this state then the `enterState` method will be invoked by default. The
1155
- `enterStateByRoute` is simply a convenience method that helps removes checks to
1156
- determine if the context provide is a state route context object.
1157
-
1195
+ `enterStateByRoute` is simply a convenience method that helps removes checks to
1196
+ determine if the context provide is a state route context object.
1197
+
1158
1198
  @param {Hash} [context] value if one was supplied to gotoState when invoked
1159
-
1199
+
1160
1200
  @see #representRoute
1161
1201
  */
1162
1202
  enterState: function(context) { },
1163
-
1203
+
1164
1204
  /**
1165
- Notification called just before enterState is invoked.
1166
-
1167
- Note: This is intended to be used by the owning statechart but it can be overridden if
1205
+ Notification called just before enterState is invoked.
1206
+
1207
+ Note: This is intended to be used by the owning statechart but it can be overridden if
1168
1208
  you need to do something special.
1169
-
1209
+
1170
1210
  @param {Hash} [context] value if one was supplied to gotoState when invoked
1171
1211
  @see #enterState
1172
1212
  */
1173
- stateWillBecomeEntered: function(context) {
1213
+ stateWillBecomeEntered: function(context) {
1174
1214
  this._isEnteringState = YES;
1175
1215
  },
1176
-
1216
+
1177
1217
  /**
1178
- Notification called just after enterState is invoked.
1179
-
1180
- Note: This is intended to be used by the owning statechart but it can be overridden if
1218
+ Notification called just after enterState is invoked.
1219
+
1220
+ Note: This is intended to be used by the owning statechart but it can be overridden if
1181
1221
  you need to do something special.
1182
-
1222
+
1183
1223
  @param context {Hash} Optional value if one was supplied to gotoState when invoked
1184
1224
  @see #enterState
1185
1225
  */
1186
- stateDidBecomeEntered: function(context) {
1226
+ stateDidBecomeEntered: function(context) {
1187
1227
  this._setupAllStateObserveHandlers();
1188
1228
  this._isEnteringState = NO;
1189
1229
  },
1190
-
1230
+
1191
1231
  /**
1192
- Called whenever this state is to be exited during a state transition process. This is
1232
+ Called whenever this state is to be exited during a state transition process. This is
1193
1233
  useful when you want the state to peform some clean up procedures.
1194
-
1234
+
1195
1235
  If when exiting the state you want to perform some kind of asynchronous action, such
1196
- as an animation or fetching remote data, then you need to return an asynchronous
1236
+ as an animation or fetching remote data, then you need to return an asynchronous
1197
1237
  action, which is done like so:
1198
-
1238
+
1199
1239
  exitState: function() {
1200
1240
  return this.performAsync('foo');
1201
1241
  }
1202
-
1242
+
1203
1243
  After returning an action to be performed asynchronously, the statechart will suspend
1204
1244
  the active state transition process. In order to resume the process, you must call
1205
- this state's resumeGotoState method or the statechart's resumeGotoState. If no asynchronous
1245
+ this state's resumeGotoState method or the statechart's resumeGotoState. If no asynchronous
1206
1246
  action is to be perform, then nothing needs to be returned.
1207
-
1247
+
1208
1248
  When the exitState method is called, an optional context value may be supplied if
1209
1249
  one was provided to the gotoState method.
1210
-
1250
+
1211
1251
  @param context {Hash} Optional value if one was supplied to gotoState when invoked
1212
1252
  */
1213
1253
  exitState: function(context) { },
1214
-
1254
+
1215
1255
  /**
1216
- Notification called just before exitState is invoked.
1217
-
1218
- Note: This is intended to be used by the owning statechart but it can be overridden
1256
+ Notification called just before exitState is invoked.
1257
+
1258
+ Note: This is intended to be used by the owning statechart but it can be overridden
1219
1259
  if you need to do something special.
1220
-
1260
+
1221
1261
  @param context {Hash} Optional value if one was supplied to gotoState when invoked
1222
1262
  @see #exitState
1223
1263
  */
1224
- stateWillBecomeExited: function(context) {
1264
+ stateWillBecomeExited: function(context) {
1225
1265
  this._isExitingState = YES;
1226
1266
  this._teardownAllStateObserveHandlers();
1227
1267
  },
1228
-
1268
+
1229
1269
  /**
1230
- Notification called just after exitState is invoked.
1231
-
1232
- Note: This is intended to be used by the owning statechart but it can be overridden
1270
+ Notification called just after exitState is invoked.
1271
+
1272
+ Note: This is intended to be used by the owning statechart but it can be overridden
1233
1273
  if you need to do something special.
1234
-
1274
+
1235
1275
  @param context {Hash} Optional value if one was supplied to gotoState when invoked
1236
1276
  @see #exitState
1237
1277
  */
1238
- stateDidBecomeExited: function(context) {
1278
+ stateDidBecomeExited: function(context) {
1239
1279
  this._isExitingState = NO;
1240
1280
  },
1241
-
1242
- /** @private
1243
-
1281
+
1282
+ /** @private
1283
+
1244
1284
  Used to setup all the state observer handlers. Should be done when
1245
1285
  the state has been entered.
1246
1286
  */
1247
1287
  _setupAllStateObserveHandlers: function() {
1248
1288
  this._configureAllStateObserveHandlers('addObserver');
1249
1289
  },
1250
-
1251
- /** @private
1252
-
1290
+
1291
+ /** @private
1292
+
1253
1293
  Used to teardown all the state observer handlers. Should be done when
1254
1294
  the state is being exited.
1255
1295
  */
1256
1296
  _teardownAllStateObserveHandlers: function() {
1257
1297
  this._configureAllStateObserveHandlers('removeObserver');
1258
1298
  },
1259
-
1260
- /** @private
1261
-
1299
+
1300
+ /** @private
1301
+
1262
1302
  Primary method used to either add or remove this state as an observer
1263
1303
  based on all the state observe handlers that have been registered with
1264
1304
  this state.
1265
-
1305
+
1266
1306
  Note: The code to add and remove the state as an observer has been
1267
1307
  taken from the observerable mixin and made slightly more generic. However,
1268
1308
  having this code in two different places is not ideal, but for now this
1269
1309
  will have to do. In the future the code should be refactored so that
1270
- there is one common function that both the observerable mixin and the
1271
- statechart framework use.
1310
+ there is one common function that both the observerable mixin and the
1311
+ statechart framework use.
1272
1312
  */
1273
1313
  _configureAllStateObserveHandlers: function(action) {
1274
1314
  var key, values, value, dotIndex, path, observer, i, root;
@@ -1277,10 +1317,10 @@ SC.State = SC.Object.extend(
1277
1317
  values = this._registeredStateObserveHandlers[key];
1278
1318
  for (i = 0; i < values.length; i += 1) {
1279
1319
  path = values[i]; observer = key;
1280
-
1320
+
1281
1321
  // Use the dot index in the path to determine how the state
1282
1322
  // should add itself as an observer.
1283
-
1323
+
1284
1324
  dotIndex = path.indexOf('.');
1285
1325
 
1286
1326
  if (dotIndex < 0) {
@@ -1303,23 +1343,23 @@ SC.State = SC.Object.extend(
1303
1343
  }
1304
1344
  }
1305
1345
  },
1306
-
1346
+
1307
1347
  /**
1308
1348
  Call when an asynchronous action need to be performed when either entering or exiting
1309
1349
  a state.
1310
-
1350
+
1311
1351
  @see enterState
1312
1352
  @see exitState
1313
1353
  */
1314
1354
  performAsync: function(func, arg1, arg2) {
1315
1355
  return SC.Async.perform(func, arg1, arg2);
1316
1356
  },
1317
-
1357
+
1318
1358
  /** @override
1319
-
1359
+
1320
1360
  Returns YES if this state can respond to the given event, otherwise
1321
1361
  NO is returned
1322
-
1362
+
1323
1363
  @param event {String} the value to check
1324
1364
  @returns {Boolean}
1325
1365
  */
@@ -1328,78 +1368,65 @@ SC.State = SC.Object.extend(
1328
1368
  if (SC.typeOf(this[event]) === SC.T_FUNCTION) return true;
1329
1369
  if (this._registeredStringEventHandlers[event]) return true;
1330
1370
  if (this._registeredStateObserveHandlers[event]) return false;
1331
-
1371
+
1332
1372
  var len = this._registeredRegExpEventHandlers.length,
1333
1373
  i = 0,
1334
1374
  handler;
1335
-
1375
+
1336
1376
  for (; i < len; i += 1) {
1337
1377
  handler = this._registeredRegExpEventHandlers[i];
1338
1378
  if (event.match(handler.regexp)) return true;
1339
1379
  }
1340
-
1380
+
1341
1381
  return SC.typeOf(this['unknownEvent']) === SC.T_FUNCTION;
1342
1382
  },
1343
-
1383
+
1344
1384
  /**
1345
1385
  Returns the path for this state relative to the statechart's
1346
- root state.
1347
-
1386
+ root state.
1387
+
1348
1388
  The path is a dot-notation string representing the path from
1349
1389
  this state to the statechart's root state, but without including
1350
1390
  the root state in the path. For instance, if the name of this
1351
1391
  state if "foo" and the parent state's name is "bar" where bar's
1352
1392
  parent state is the root state, then the full path is "bar.foo"
1353
-
1354
- @property {String}
1393
+
1394
+ @type String
1355
1395
  */
1356
1396
  fullPath: function() {
1357
1397
  var root = this.getPath('statechart.rootState');
1358
1398
  if (!root) return this.get('name');
1359
1399
  return this.pathRelativeTo(root);
1360
1400
  }.property('name', 'parentState').cacheable(),
1361
-
1401
+
1362
1402
  toString: function() {
1363
1403
  return this.get('fullPath');
1364
1404
  },
1365
-
1405
+
1366
1406
  /** @private */
1367
1407
  _enteredSubstatesDidChange: function() {
1368
1408
  this.notifyPropertyChange('enteredSubstates');
1369
1409
  }.observes('*enteredSubstates.[]'),
1370
-
1410
+
1371
1411
  /** @private */
1372
1412
  _currentSubstatesDidChange: function() {
1373
1413
  this.notifyPropertyChange('currentSubstates');
1374
1414
  }.observes('*currentSubstates.[]'),
1375
1415
 
1376
- /** @private */
1377
- _statechartTraceDidChange: function() {
1378
- this.notifyPropertyChange('trace');
1379
- },
1380
-
1381
1416
  /** @private */
1382
1417
  _statechartOwnerDidChange: function() {
1383
1418
  this.notifyPropertyChange('owner');
1384
1419
  },
1385
-
1386
- /**
1387
- Used to log a state trace message
1388
- */
1389
- stateLogTrace: function(msg) {
1390
- var sc = this.get('statechart');
1391
- sc.statechartLogTrace("%@: %@".fmt(this, msg));
1392
- },
1393
1420
 
1394
- /**
1421
+ /**
1395
1422
  Used to log a state warning message
1396
1423
  */
1397
1424
  stateLogWarning: function(msg) {
1398
1425
  var sc = this.get('statechart');
1399
1426
  sc.statechartLogWarning(msg);
1400
1427
  },
1401
-
1402
- /**
1428
+
1429
+ /**
1403
1430
  Used to log a state error message
1404
1431
  */
1405
1432
  stateLogError: function(msg) {
@@ -1413,9 +1440,9 @@ SC.State = SC.Object.extend(
1413
1440
  Use this when you want to plug-in a state into a statechart. This is beneficial
1414
1441
  in cases where you split your statechart's states up into multiple files and
1415
1442
  don't want to fuss with the sc_require construct.
1416
-
1443
+
1417
1444
  Example:
1418
-
1445
+
1419
1446
  MyApp.statechart = SC.Statechart.create({
1420
1447
  rootState: SC.State.design({
1421
1448
  initialSubstate: 'a',
@@ -1423,7 +1450,7 @@ SC.State = SC.Object.extend(
1423
1450
  b: SC.State.plugin('path.to.another.state.class')
1424
1451
  })
1425
1452
  });
1426
-
1453
+
1427
1454
  You can also supply hashes the plugin feature in order to enhance a state or
1428
1455
  implement required functionality:
1429
1456