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
@@ -41,7 +41,7 @@ SC.View.reopen(
41
41
  A child view without a cursor of its own inherits its parent's cursor by
42
42
  default. Set this to NO to prevent this behavior.
43
43
 
44
- @property {Boolean}
44
+ @type Boolean
45
45
  */
46
46
  shouldInheritCursor: YES
47
47
 
@@ -1,20 +1,75 @@
1
1
  sc_require("views/view");
2
2
 
3
+ SC.CoreView.mixin(
4
+ /** @scope SC.CoreView */ {
5
+
6
+ /**
7
+ The view is enabled.
8
+
9
+ @static
10
+ @constant
11
+ */
12
+ ENABLED: 0x08, // 8
13
+
14
+ /**
15
+ The view has been disabled.
16
+
17
+ @static
18
+ @constant
19
+ */
20
+ IS_DISABLED: 0x10, // 16
21
+
22
+ /**
23
+ The view is disabled.
24
+
25
+ @static
26
+ @constant
27
+ */
28
+ DISABLED: 0x11, // 17
29
+
30
+ /**
31
+ The view is enabled itself, but is effectively disabled in the pane due to
32
+ a disabled parent view.
33
+
34
+ @static
35
+ @constant
36
+ */
37
+ DISABLED_BY_PARENT: 0x12 // 18
38
+
39
+ });
40
+
41
+
3
42
  SC.View.reopen(
4
43
  /** @scope SC.View.prototype */ {
5
- // ..........................................................
6
- // IS ENABLED SUPPORT
44
+
45
+ // ------------------------------------------------------------------------
46
+ // Properties
7
47
  //
8
48
 
49
+ /**
50
+ The current enabled state of the view.
51
+
52
+ Views have a few possible enabled states:
53
+
54
+ * SC.CoreView.ENABLED
55
+ * SC.CoreView.DISABLED
56
+ * SC.CoreView.DISABLED_BY_PARENT
57
+
58
+ @type String
59
+ @default SC.CoreView.ENABLED
60
+ @readonly
61
+ */
62
+ enabledState: SC.CoreView.ENABLED,
63
+
9
64
  /**
10
65
  Set to true when the item is enabled. Note that changing this value
11
- will alter the isVisibleInWindow property for this view and any
66
+ will alter the `isEnabledInPane` property for this view and any
12
67
  child views as well as to automatically add or remove a 'disabled' CSS
13
68
  class name.
14
69
 
15
70
  This property is observable and bindable.
16
71
 
17
- @property {Boolean}
72
+ @type Boolean
18
73
  */
19
74
  isEnabled: YES,
20
75
  isEnabledBindingDefault: SC.Binding.oneWay().bool(),
@@ -24,15 +79,72 @@ SC.View.reopen(
24
79
  are enabled in the pane. You should use this property when deciding
25
80
  whether to respond to an incoming event or not.
26
81
 
27
- This property is not observable.
82
+ @type Boolean
83
+ */
84
+ // The previous version used a lazy upward search method. This has better
85
+ // performance, but made isEnabledInPane non-bindable.
86
+ // isEnabledInPane: function() {
87
+ // var ret = this.get('isEnabled'), pv ;
88
+ // if (ret && (pv = this.get('parentView'))) { ret = pv.get('isEnabledInPane'); }
89
+ // return ret ;
90
+ // }.property('parentView', 'isEnabled'),
91
+ isEnabledInPane: function () {
92
+ return this.get('enabledState') === SC.CoreView.ENABLED;
93
+ }.property('enabledState').cacheable(),
94
+
95
+ /**
96
+ By default, setting isEnabled to false on a view will place all of its
97
+ child views in a disabled state. To block this from happening to a
98
+ specific child view and its children, you can set `shouldInheritEnabled`
99
+ to false.
100
+
101
+ In this way you can set `isEnabled` to false on a main pane to disable all
102
+ buttons, collections and other controls within it, but can still keep a
103
+ section of it editable using `shouldInheritEnabled: false`.
28
104
 
29
- @property {Boolean}
105
+ @type Boolean
30
106
  */
31
- isEnabledInPane: function() {
32
- var ret = this.get('isEnabled'), pv ;
33
- if (ret && (pv = this.get('parentView'))) { ret = pv.get('isEnabledInPane'); }
34
- return ret ;
35
- }.property('parentView', 'isEnabled'),
107
+ shouldInheritEnabled: true,
108
+
109
+ // ------------------------------------------------------------------------
110
+ // Actions & Events
111
+ //
112
+
113
+ /** @private */
114
+ _doEnable: function () {
115
+ var handled = true;
116
+
117
+ if (this.get('enabledState') & SC.CoreView.IS_DISABLED) {
118
+ this._callOnChildViews('_parentDidEnableInPane');
119
+ this._gotoEnabledState();
120
+ } else {
121
+ handled = false;
122
+ }
123
+
124
+ return handled;
125
+ },
126
+
127
+ /** @private */
128
+ _doDisable: function () {
129
+ var handled = true;
130
+
131
+ if (this.get('enabledState') !== SC.CoreView.DISABLED) {
132
+ if (this.get('isFirstResponder')) {
133
+ this.resignFirstResponder();
134
+ }
135
+
136
+ this._callOnChildViews('_parentDidDisableInPane');
137
+ this._gotoDisabledState();
138
+ } else {
139
+ handled = false;
140
+ }
141
+
142
+ return handled;
143
+ },
144
+
145
+ // ------------------------------------------------------------------------
146
+ // Methods
147
+ //
36
148
 
37
149
  /** @private
38
150
  Observes the isEnabled property and resigns first responder if set to NO.
@@ -41,18 +153,105 @@ SC.View.reopen(
41
153
 
42
154
  @observes isEnabled
43
155
  */
44
- _sc_view_isEnabledDidChange: function(){
45
- if(!this.get('isEnabled') && this.get('isFirstResponder')){
46
- this.resignFirstResponder();
47
- }
156
+ _sc_view_isEnabledDidChange: function () {
157
+ // Filter the input channel.
158
+ this.invokeOnce(this._doUpdateEnabled);
48
159
  }.observes('isEnabled'),
49
160
 
50
- applyAttributesToContext: function(original, context) {
161
+ /** @private */
162
+ _doUpdateEnabled: function () {
163
+ var state = this.get('viewState');
164
+
165
+ // Call the proper action.
166
+ if (this.get('isEnabled')) {
167
+ this._doEnable();
168
+ } else {
169
+ this._doDisable();
170
+ }
171
+
172
+ // Update the display if in a visible state.
173
+ switch (state) {
174
+ case SC.CoreView.ATTACHED_SHOWN:
175
+ case SC.CoreView.ATTACHED_SHOWING:
176
+ case SC.CoreView.ATTACHED_BUILDING_IN:
177
+ // Update the display.
178
+ this._doUpdateEnabledStyle();
179
+ break;
180
+ default:
181
+ // Indicate that a display update is required the next time we are visible.
182
+ this._enabledStyleNeedsUpdate = true;
183
+ }
184
+ },
185
+
186
+ /** @private Enhance. */
187
+ _executeQueuedUpdates: function (original) {
188
+ original();
189
+
190
+ // Update the layout style of the layer if necessary.
191
+ if (this._enabledStyleNeedsUpdate) {
192
+ this._doUpdateEnabledStyle();
193
+ }
194
+ }.enhance(),
195
+
196
+ /** @private */
197
+ _doUpdateEnabledStyle: function () {
198
+ var isEnabled = this.get('isEnabled');
199
+
200
+ this.$().toggleClass('disabled', !isEnabled);
201
+ this.$().attr('aria-disabled', !isEnabled ? true : null);
202
+
203
+ // Reset that an update is required.
204
+ this._enabledStyleNeedsUpdate = false;
205
+ },
206
+
207
+ /** @private */
208
+ _parentDidEnableInPane: function () {
209
+ var isEnabled = this.get('isEnabled');
210
+
211
+ if (isEnabled) {
212
+ this._gotoEnabledState();
213
+ } else {
214
+ // There's no need to continue to further child views.
215
+ return false;
216
+ }
217
+ },
218
+
219
+ /** @private */
220
+ _parentDidDisableInPane: function () {
51
221
  var isEnabled = this.get('isEnabled');
52
222
 
223
+ if (isEnabled && this.get('shouldInheritEnabled')) {
224
+ this._gotoDisableByParentState();
225
+ } else {
226
+ // There's no need to continue to further child views.
227
+ return false;
228
+ }
229
+ },
230
+
231
+ applyAttributesToContext: function (original, context) {
53
232
  original(context);
54
233
 
55
- context.setClass('disabled', !isEnabled);
56
- context.attr('aria-disabled', !isEnabled ? 'true' : null);
57
- }.enhance()
234
+ if (!this.get('isEnabled')) {
235
+ context.addClass('disabled');
236
+ context.setAttr('aria-disabled', 'true');
237
+ }
238
+
239
+ }.enhance(),
240
+
241
+ /** @private */
242
+ _gotoEnabledState: function () {
243
+ this.set('enabledState', SC.CoreView.ENABLED);
244
+ },
245
+
246
+ /** @private */
247
+ _gotoDisabledState: function () {
248
+ this.set('enabledState', SC.CoreView.DISABLED);
249
+ },
250
+
251
+ /** @private */
252
+ _gotoDisableByParentState: function () {
253
+ // Update the state.
254
+ this.set('enabledState', SC.CoreView.DISABLED_BY_PARENT);
255
+ }
256
+
58
257
  });
@@ -1,5 +1,5 @@
1
1
  sc_require("views/view");
2
- sc_require('views/view/layout_style') ;
2
+ sc_require('views/view/layout_style');
3
3
 
4
4
  /** Select a horizontal layout for various views.*/
5
5
  SC.LAYOUT_HORIZONTAL = 'sc-layout-horizontal';
@@ -32,33 +32,30 @@ SC.ANCHOR_CENTER = { centerX: 0, centerY: 0 };
32
32
 
33
33
  SC.LAYOUT_AUTO = 'auto';
34
34
 
35
+
35
36
  SC.View.reopen(
36
37
  /** @scope SC.View.prototype */ {
37
38
 
38
39
  /**
39
- Set to YES to indicate the view has visibility support added.
40
+ Set to YES to indicate the view has layout support added.
40
41
  */
41
42
  hasLayout: YES,
42
43
 
43
- concatenatedProperties: ["layoutProperties"],
44
-
45
44
  /**
46
45
  Optional background color. Will be applied to the view's element if
47
46
  set. This property is intended for one-off views that need a background
48
47
  element. If you plan to create many view instances it is probably better
49
48
  to use CSS.
50
49
 
51
- @property {String}
50
+ @type String
52
51
  */
53
52
  backgroundColor: null,
54
53
 
55
- displayProperties: ['backgroundColor'],
56
-
57
54
  /**
58
55
  Activates use of brower's static layout. To activate, set this
59
56
  property to YES.
60
57
 
61
- @property {Boolean}
58
+ @type Boolean
62
59
  */
63
60
  useStaticLayout: NO,
64
61
 
@@ -66,13 +63,38 @@ SC.View.reopen(
66
63
  // LAYOUT
67
64
  //
68
65
 
69
- init: function(original) {
66
+ /** @private */
67
+ init: function (original) {
70
68
  original();
71
69
 
72
- // TODO: This makes it impossible to override
73
- this.layoutStyleCalculator = SC.View.LayoutStyleCalculator.create({ view: this });
74
-
75
70
  this._previousLayout = this.get('layout');
71
+
72
+ // Apply the automatic child view layout if it is defined.
73
+ var childViewLayout = this.childViewLayout;
74
+ if (childViewLayout) {
75
+ // Layout the child views once.
76
+ this.set('childViewsNeedLayout', true);
77
+ this.layoutChildViewsIfNeeded();
78
+
79
+ // If the child view layout is live, start observing affecting properties.
80
+ if (this.get('isChildViewLayoutLive')) {
81
+ this.addObserver('childViews.[]', this, this._cvl_childViewsDidChange);
82
+ // DISABLED. this.addObserver('childViewLayout', this, this._cvl_childViewLayoutDidChange);
83
+ this.addObserver('childViewLayoutOptions', this, this._cvl_childViewLayoutDidChange);
84
+
85
+ // Initialize the child views.
86
+ this._cvl_setupChildViewsLiveLayout();
87
+ }
88
+ }
89
+
90
+ }.enhance(),
91
+
92
+ /** @private */
93
+ destroy: function (original) {
94
+ // Clean up.
95
+ this._previousLayout = null;
96
+
97
+ return original();
76
98
  }.enhance(),
77
99
 
78
100
  /**
@@ -86,7 +108,7 @@ SC.View.reopen(
86
108
  be invalid, we need to force layoutDidChange() to always immediately run
87
109
  whenever 'layout' is set.
88
110
  */
89
- propertyDidChange: function(key, value, _keepCache) {
111
+ propertyDidChange: function (key, value, _keepCache) {
90
112
  // If the key is 'layout', we need to call layoutDidChange() immediately
91
113
  // so that if the frame has changed any cached values (for both this view
92
114
  // and any child views) can be appropriately invalidated.
@@ -95,11 +117,11 @@ SC.View.reopen(
95
117
  // changed and if layout is dependent on the property.
96
118
  // If it is we call layoutDidChange.
97
119
  var layoutChange = false;
98
- if(typeof this.layout === "function" && this._kvo_dependents) {
120
+ if (typeof this.layout === "function" && this._kvo_dependents) {
99
121
  var dependents = this._kvo_dependents[key];
100
- if(dependents && dependents.indexOf('layout')!=-1) { layoutChange = true; }
122
+ if (dependents && dependents.indexOf('layout') != -1) { layoutChange = true; }
101
123
  }
102
- if(key==='layout' || layoutChange) { this.layoutDidChange(); }
124
+ if (key === 'layout' || layoutChange) { this.layoutDidChange(); }
103
125
  // Resume notification as usual.
104
126
  sc_super();
105
127
  },
@@ -120,47 +142,45 @@ SC.View.reopen(
120
142
  @param {Object} value
121
143
  @returns {SC.View} receiver
122
144
  */
123
- adjust: function(key, value) {
145
+ adjust: function (key, value) {
124
146
  var layout = this.get('layout'), didChange = NO, cur, hash;
125
147
 
126
- if (key === undefined) { return this ; } // nothing to do.
148
+ if (key === undefined) { return this; } // nothing to do.
127
149
 
128
150
  // handle string case
129
151
  if (SC.typeOf(key) === SC.T_STRING) {
130
152
  // this is copied from below
131
153
  cur = layout[key];
132
154
 
133
- if(value === undefined || cur == value) return this;
155
+ if (value === undefined || cur == value) return this;
134
156
 
135
157
  layout = SC.clone(layout);
136
158
 
137
- if(value === null) {
159
+ if (value === null) {
138
160
  delete layout[key];
139
161
  } else {
140
162
  layout[key] = value;
141
163
  }
142
164
 
143
165
  didChange = YES;
144
- }
145
-
146
- else {
166
+ } else {
147
167
  hash = key;
148
168
 
149
- for(key in hash) {
169
+ for (key in hash) {
150
170
  if (!hash.hasOwnProperty(key)) { continue; }
151
171
 
152
- value = hash[key] ;
153
- cur = layout[key] ;
172
+ value = hash[key];
173
+ cur = layout[key];
154
174
 
155
175
  if (value === undefined || cur == value) { continue; }
156
176
 
157
177
  // only clone the layout the first time we see a change
158
- if(!didChange) layout = SC.clone(layout);
178
+ if (!didChange) layout = SC.clone(layout);
159
179
 
160
180
  if (value === null) {
161
- delete layout[key] ;
181
+ delete layout[key];
162
182
  } else {
163
- layout[key] = value ;
183
+ layout[key] = value;
164
184
  }
165
185
 
166
186
  didChange = YES;
@@ -169,10 +189,30 @@ SC.View.reopen(
169
189
 
170
190
  // now set adjusted layout
171
191
  if (didChange) {
172
- this.set('layout', layout) ;
192
+ var transitionAdjust = this.get('transitionAdjust');
193
+
194
+ if (this.get('viewState') & SC.CoreView.IS_SHOWN && transitionAdjust) {
195
+ // Run the adjust transition.
196
+ this._transitionAdjust(layout);
197
+ } else {
198
+ this.set('layout', layout);
199
+ }
173
200
  }
174
201
 
175
- return this ;
202
+ return this;
203
+ },
204
+
205
+ /** @private Attempts to run a transition adjust, ensuring any showing transitions are stopped in place. */
206
+ _transitionAdjust: function (layout) {
207
+ var transitionAdjust = this.get('transitionAdjust'),
208
+ options = this.get('transitionAdjustOptions') || {};
209
+
210
+ // Execute the adjusting transition.
211
+ transitionAdjust.run(this, options, layout);
212
+ },
213
+
214
+ /** @private */
215
+ didTransitionAdjust: function () {
176
216
  },
177
217
 
178
218
  /**
@@ -196,6 +236,7 @@ SC.View.reopen(
196
236
  - borderRight: right border
197
237
  - borderBottom: bottom border
198
238
  - borderLeft: bottom left
239
+ - opacity: the opacity of the view
199
240
  - zIndex: position above or below other views
200
241
 
201
242
  Note that you can only use certain combinations to set layout. For
@@ -221,7 +262,7 @@ SC.View.reopen(
221
262
  @returns {Boolean} YES if fixed, NO otherwise
222
263
  @test in layoutStyle
223
264
  */
224
- isFixedLayout: function() {
265
+ isFixedLayout: function () {
225
266
  return this.get('isFixedPosition') && this.get('isFixedSize');
226
267
  }.property('isFixedPosition', 'isFixedSize').cacheable(),
227
268
 
@@ -233,7 +274,7 @@ SC.View.reopen(
233
274
  @returns {Boolean} YES if fixed, NO otherwise
234
275
  @test in layoutStyle
235
276
  */
236
- isFixedPosition: function() {
277
+ isFixedPosition: function () {
237
278
  var layout = this.get('layout'),
238
279
  ret;
239
280
 
@@ -245,7 +286,7 @@ SC.View.reopen(
245
286
 
246
287
  // The position may appear fixed, but only if none of the values are percentages.
247
288
  if (ret) {
248
- ret = ( !SC.isPercentage(layout.top) && !SC.isPercentage(layout.left) );
289
+ ret = (!SC.isPercentage(layout.top) && !SC.isPercentage(layout.left));
249
290
  }
250
291
 
251
292
  return ret;
@@ -271,7 +312,7 @@ SC.View.reopen(
271
312
 
272
313
  // The size may appear fixed, but only if none of the values are percentages.
273
314
  if (ret) {
274
- ret = ( !SC.isPercentage(layout.width) && !SC.isPercentage(layout.height) );
315
+ ret = (!SC.isPercentage(layout.width) && !SC.isPercentage(layout.height));
275
316
  }
276
317
 
277
318
  return ret;
@@ -294,28 +335,32 @@ SC.View.reopen(
294
335
  @returns {Rect} converted frame
295
336
  @test in convertFrames
296
337
  */
297
- convertFrameToView: function(frame, targetView) {
298
- var myX=0, myY=0, targetX=0, targetY=0, view = this, f ;
338
+ convertFrameToView: function (frame, targetView) {
339
+ var myX = 0, myY = 0, targetX = 0, targetY = 0, view = this, f;
299
340
 
300
341
  // walk up this side
301
342
  while (view) {
302
- f = view.get('frame'); myX += f.x; myY += f.y ;
303
- view = view.get('layoutView') ;
343
+ f = view.get('frame');
344
+ myX += f.x;
345
+ myY += f.y;
346
+ view = view.get('layoutView');
304
347
  }
305
348
 
306
349
  // walk up other size
307
350
  if (targetView) {
308
- view = targetView ;
351
+ view = targetView;
309
352
  while (view) {
310
- f = view.get('frame'); targetX += f.x; targetY += f.y ;
311
- view = view.get('layoutView') ;
353
+ f = view.get('frame');
354
+ targetX += f.x;
355
+ targetY += f.y;
356
+ view = view.get('layoutView');
312
357
  }
313
358
  }
314
359
 
315
360
  // now we can figure how to translate the origin.
316
- myX = frame.x + myX - targetX ;
317
- myY = frame.y + myY - targetY ;
318
- return { x: myX, y: myY, width: frame.width, height: frame.height } ;
361
+ myX = frame.x + myX - targetX;
362
+ myY = frame.y + myY - targetY;
363
+ return { x: myX, y: myY, width: frame.width, height: frame.height };
319
364
  },
320
365
 
321
366
  /**
@@ -334,29 +379,32 @@ SC.View.reopen(
334
379
  @returns {Rect} converted frame
335
380
  @test in converFrames
336
381
  */
337
- convertFrameFromView: function(frame, targetView) {
338
- var myX=0, myY=0, targetX=0, targetY=0, view = this, f ;
382
+ convertFrameFromView: function (frame, targetView) {
383
+ var myX = 0, myY = 0, targetX = 0, targetY = 0, view = this, f;
339
384
 
340
385
  // walk up this side
341
386
  //Note: Intentional assignment of variable f
342
387
  while (view && (f = view.get('frame'))) {
343
- myX += f.x; myY += f.y ;
344
- view = view.get('parentView') ;
388
+ myX += f.x;
389
+ myY += f.y;
390
+ view = view.get('parentView');
345
391
  }
346
392
 
347
393
  // walk up other size
348
394
  if (targetView) {
349
- view = targetView ;
350
- while(view) {
351
- f = view.get('frame'); targetX += f.x; targetY += f.y ;
352
- view = view.get('parentView') ;
395
+ view = targetView;
396
+ while (view) {
397
+ f = view.get('frame');
398
+ targetX += f.x;
399
+ targetY += f.y;
400
+ view = view.get('parentView');
353
401
  }
354
402
  }
355
403
 
356
404
  // now we can figure how to translate the origin.
357
- myX = frame.x - myX + targetX ;
358
- myY = frame.y - myY + targetY ;
359
- return { x: myX, y: myY, width: frame.width, height: frame.height } ;
405
+ myX = frame.x - myX + targetX;
406
+ myY = frame.y - myY + targetY;
407
+ return { x: myX, y: myY, width: frame.width, height: frame.height };
360
408
  },
361
409
 
362
410
  /**
@@ -368,24 +416,30 @@ SC.View.reopen(
368
416
 
369
417
  @returns {Boolean}
370
418
  */
371
- scrollToVisible: function() {
419
+ scrollToVisible: function () {
372
420
  var pv = this.get('parentView');
373
- while(pv && !pv.get('isScrollable')) { pv = pv.get('parentView'); }
421
+ while (pv && !pv.get('isScrollable')) { pv = pv.get('parentView'); }
374
422
 
375
423
  // found view, first make it scroll itself visible then scroll this.
376
424
  if (pv) {
377
425
  pv.scrollToVisible();
378
426
  return pv.scrollToVisible(this);
379
427
  } else {
380
- return NO ;
428
+ return NO;
381
429
  }
382
430
  },
383
431
 
384
- _adjustForBorder: function(frame, layout){
385
- var borderTop = ((layout.borderTop !== undefined) ? layout.borderTop : layout.border) || 0,
386
- borderLeft = ((layout.borderLeft !== undefined) ? layout.borderLeft : layout.border) || 0,
387
- borderBottom = ((layout.borderBottom !== undefined) ? layout.borderBottom : layout.border) || 0,
388
- borderRight = ((layout.borderRight !== undefined) ? layout.borderRight : layout.border) || 0;
432
+ /** @private */
433
+ _effectiveBorderFor: function (layoutName, layout) {
434
+ return ((layout[layoutName] !== undefined) ? layout[layoutName] : layout.border) || 0;
435
+ },
436
+
437
+ /** @private */
438
+ _adjustForBorder: function (frame, layout) {
439
+ var borderTop = this._effectiveBorderFor('borderTop', layout),
440
+ borderLeft = this._effectiveBorderFor('borderLeft', layout),
441
+ borderBottom = this._effectiveBorderFor('borderBottom', layout),
442
+ borderRight = this._effectiveBorderFor('borderRight', layout);
389
443
 
390
444
  frame.x += borderLeft; // The border on the left pushes the frame to the right
391
445
  frame.y += borderTop; // The border on the top pushes the frame down
@@ -410,7 +464,7 @@ SC.View.reopen(
410
464
  @param {Rect} pdim the projected parent dimensions
411
465
  @returns {Rect} the computed frame
412
466
  */
413
- computeFrameWithParentFrame: function(original, pdim) {
467
+ computeFrameWithParentFrame: function (original, pdim) {
414
468
  var f, layout = this.get('layout');
415
469
 
416
470
  // We can't predict the frame for static layout, so just return the view's
@@ -435,124 +489,124 @@ SC.View.reopen(
435
489
  lcY = layout.centerY;
436
490
 
437
491
  if (lW === AUTO) {
438
- error = SC.Error.desc(("%@.layout() cannot use width:auto if "+
439
- "staticLayout is disabled").fmt(this), "%@".fmt(this), -1);
440
- SC.Logger.error(error.toString()) ;
441
- throw error ;
492
+ error = SC.Error.desc(("%@.layout() cannot use width:auto if " +
493
+ "staticLayout is disabled").fmt(this), "%@".fmt(this), -1);
494
+ SC.Logger.error(error.toString());
495
+ throw error;
442
496
  }
443
497
 
444
498
  if (lH === AUTO) {
445
- error = SC.Error.desc(("%@.layout() cannot use height:auto if "+
446
- "staticLayout is disabled").fmt(this),"%@".fmt(this), -1);
447
- SC.Logger.error(error.toString()) ;
448
- throw error ;
499
+ error = SC.Error.desc(("%@.layout() cannot use height:auto if " +
500
+ "staticLayout is disabled").fmt(this), "%@".fmt(this), -1);
501
+ SC.Logger.error(error.toString());
502
+ throw error;
449
503
  }
450
504
 
451
- if (!pdim) { pdim = this.computeParentDimensions(layout) ; }
505
+ if (!pdim) { pdim = this.computeParentDimensions(layout); }
452
506
  dH = pdim.height;
453
507
  dW = pdim.width;
454
508
 
455
509
  // handle left aligned and left/right
456
510
  if (!SC.none(lL)) {
457
- if(SC.isPercentage(lL)){
458
- f.x = dW*lL;
459
- }else{
460
- f.x = lL ;
511
+ if (SC.isPercentage(lL)) {
512
+ f.x = dW * lL;
513
+ } else {
514
+ f.x = lL;
461
515
  }
462
516
  if (lW !== undefined) {
463
- if(lW === AUTO) { f.width = AUTO ; }
464
- else if(SC.isPercentage(lW)) { f.width = dW*lW ; }
465
- else { f.width = lW ; }
517
+ if (lW === AUTO) { f.width = AUTO; }
518
+ else if (SC.isPercentage(lW)) { f.width = dW * lW; }
519
+ else { f.width = lW; }
466
520
  } else { // better have lR!
467
- f.width = dW - f.x ;
468
- if(lR && SC.isPercentage(lR)) { f.width = f.width - (lR*dW) ; }
469
- else { f.width = f.width - (lR || 0) ; }
521
+ f.width = dW - f.x;
522
+ if (lR && SC.isPercentage(lR)) { f.width = f.width - (lR * dW); }
523
+ else { f.width = f.width - (lR || 0); }
470
524
  }
471
525
  // handle right aligned
472
526
  } else if (!SC.none(lR)) {
473
527
  if (SC.none(lW)) {
474
528
  if (SC.isPercentage(lR)) {
475
- f.width = dW - (dW*lR) ;
529
+ f.width = dW - (dW * lR);
476
530
  }
477
- else f.width = dW - lR ;
478
- f.x = 0 ;
531
+ else f.width = dW - lR;
532
+ f.x = 0;
479
533
  } else {
480
- if(lW === AUTO) f.width = AUTO ;
481
- else if(SC.isPercentage(lW)) f.width = dW*lW ;
482
- else f.width = (lW || 0) ;
483
- if (SC.isPercentage(lW)) f.x = dW - (lR*dW) - f.width ;
484
- else f.x = dW - lR - f.width ;
534
+ if (lW === AUTO) f.width = AUTO;
535
+ else if (SC.isPercentage(lW)) f.width = dW * lW;
536
+ else f.width = (lW || 0);
537
+ if (SC.isPercentage(lW)) f.x = dW - (lR * dW) - f.width;
538
+ else f.x = dW - lR - f.width;
485
539
  }
486
540
 
487
541
  // handle centered
488
542
  } else if (!SC.none(lcX)) {
489
- if(lW === AUTO) f.width = AUTO ;
490
- else if (SC.isPercentage(lW)) f.width = lW*dW ;
491
- else f.width = (lW || 0) ;
492
- if(SC.isPercentage(lcX)) f.x = (dW - f.width)/2 + (lcX*dW) ;
493
- else f.x = (dW - f.width)/2 + lcX ;
543
+ if (lW === AUTO) f.width = AUTO;
544
+ else if (SC.isPercentage(lW)) f.width = lW * dW;
545
+ else f.width = (lW || 0);
546
+ if (SC.isPercentage(lcX)) f.x = (dW - f.width) / 2 + (lcX * dW);
547
+ else f.x = (dW - f.width) / 2 + lcX;
494
548
  } else {
495
- f.x = 0 ; // fallback
549
+ f.x = 0; // fallback
496
550
  if (SC.none(lW)) {
497
- f.width = dW ;
551
+ f.width = dW;
498
552
  } else {
499
- if(lW === AUTO) f.width = AUTO ;
500
- if (SC.isPercentage(lW)) f.width = lW*dW ;
501
- else f.width = (lW || 0) ;
553
+ if (lW === AUTO) f.width = AUTO;
554
+ if (SC.isPercentage(lW)) f.width = lW * dW;
555
+ else f.width = (lW || 0);
502
556
  }
503
557
  }
504
558
 
505
559
  // handle top aligned and top/bottom
506
560
  if (!SC.none(lT)) {
507
- if(SC.isPercentage(lT)) f.y = lT*dH ;
508
- else f.y = lT ;
561
+ if (SC.isPercentage(lT)) f.y = lT * dH;
562
+ else f.y = lT;
509
563
  if (lH !== undefined) {
510
- if(lH === AUTO) f.height = AUTO ;
511
- else if(SC.isPercentage(lH)) f.height = lH*dH ;
512
- else f.height = lH ;
564
+ if (lH === AUTO) f.height = AUTO;
565
+ else if (SC.isPercentage(lH)) f.height = lH * dH;
566
+ else f.height = lH;
513
567
  } else { // better have lB!
514
- if(lB && SC.isPercentage(lB)) f.height = dH - f.y - (lB*dH) ;
515
- else f.height = dH - f.y - (lB || 0) ;
568
+ if (lB && SC.isPercentage(lB)) f.height = dH - f.y - (lB * dH);
569
+ else f.height = dH - f.y - (lB || 0);
516
570
  }
517
571
 
518
572
  // handle bottom aligned
519
573
  } else if (!SC.none(lB)) {
520
574
  if (SC.none(lH)) {
521
- if (SC.isPercentage(lB)) f.height = dH - (lB*dH) ;
522
- else f.height = dH - lB ;
523
- f.y = 0 ;
575
+ if (SC.isPercentage(lB)) f.height = dH - (lB * dH);
576
+ else f.height = dH - lB;
577
+ f.y = 0;
524
578
  } else {
525
- if(lH === AUTO) f.height = AUTO ;
526
- if (lH && SC.isPercentage(lH)) f.height = lH*dH ;
527
- else f.height = (lH || 0) ;
528
- if (SC.isPercentage(lB)) f.y = dH - (lB*dH) - f.height ;
529
- else f.y = dH - lB - f.height ;
579
+ if (lH === AUTO) f.height = AUTO;
580
+ if (lH && SC.isPercentage(lH)) f.height = lH * dH;
581
+ else f.height = (lH || 0);
582
+ if (SC.isPercentage(lB)) f.y = dH - (lB * dH) - f.height;
583
+ else f.y = dH - lB - f.height;
530
584
  }
531
585
 
532
586
  // handle centered
533
587
  } else if (!SC.none(lcY)) {
534
- if(lH === AUTO) f.height = AUTO ;
535
- if (lH && SC.isPercentage(lH)) f.height = lH*dH ;
536
- else f.height = (lH || 0) ;
537
- if (SC.isPercentage(lcY)) f.y = (dH - f.height)/2 + (lcY*dH) ;
538
- else f.y = (dH - f.height)/2 + lcY ;
588
+ if (lH === AUTO) f.height = AUTO;
589
+ if (lH && SC.isPercentage(lH)) f.height = lH * dH;
590
+ else f.height = (lH || 0);
591
+ if (SC.isPercentage(lcY)) f.y = (dH - f.height) / 2 + (lcY * dH);
592
+ else f.y = (dH - f.height) / 2 + lcY;
539
593
 
540
594
  // fallback
541
595
  } else {
542
- f.y = 0 ; // fallback
596
+ f.y = 0; // fallback
543
597
  if (SC.none(lH)) {
544
- f.height = dH ;
598
+ f.height = dH;
545
599
  } else {
546
- if(lH === AUTO) f.height = AUTO ;
547
- if (SC.isPercentage(lH)) f.height = lH*dH ;
548
- else f.height = lH || 0 ;
600
+ if (lH === AUTO) f.height = AUTO;
601
+ if (SC.isPercentage(lH)) f.height = lH * dH;
602
+ else f.height = lH || 0;
549
603
  }
550
604
  }
551
605
 
552
606
  f.x = Math.floor(f.x);
553
607
  f.y = Math.floor(f.y);
554
- if(f.height !== AUTO) f.height = Math.floor(f.height);
555
- if(f.width !== AUTO) f.width = Math.floor(f.width);
608
+ if (f.height !== AUTO) f.height = Math.floor(f.height);
609
+ if (f.width !== AUTO) f.width = Math.floor(f.width);
556
610
 
557
611
  // if width or height were set to auto and we have a layer, try lookup
558
612
  if (f.height === AUTO || f.width === AUTO) {
@@ -573,30 +627,30 @@ SC.View.reopen(
573
627
 
574
628
  // make sure the width/height fix min/max...
575
629
  if (!SC.none(layout.maxHeight) && (f.height > layout.maxHeight)) {
576
- f.height = layout.maxHeight ;
630
+ f.height = layout.maxHeight;
577
631
  }
578
632
 
579
633
  if (!SC.none(layout.minHeight) && (f.height < layout.minHeight)) {
580
- f.height = layout.minHeight ;
634
+ f.height = layout.minHeight;
581
635
  }
582
636
 
583
637
  if (!SC.none(layout.maxWidth) && (f.width > layout.maxWidth)) {
584
- f.width = layout.maxWidth ;
638
+ f.width = layout.maxWidth;
585
639
  }
586
640
 
587
641
  if (!SC.none(layout.minWidth) && (f.width < layout.minWidth)) {
588
- f.width = layout.minWidth ;
642
+ f.width = layout.minWidth;
589
643
  }
590
644
 
591
645
  // make sure width/height are never < 0
592
- if (f.height < 0) f.height = 0 ;
593
- if (f.width < 0) f.width = 0 ;
646
+ if (f.height < 0) f.height = 0;
647
+ if (f.width < 0) f.width = 0;
594
648
 
595
649
  return f;
596
650
  }.enhance(),
597
651
 
598
- computeParentDimensions: function(frame) {
599
- var ret, pv = this.get('parentView'), pf = (pv) ? pv.get('frame') : null ;
652
+ computeParentDimensions: function (frame) {
653
+ var ret, pv = this.get('parentView'), pf = (pv) ? pv.get('frame') : null;
600
654
 
601
655
  if (pf) {
602
656
  ret = { width: pf.width, height: pf.height };
@@ -607,27 +661,26 @@ SC.View.reopen(
607
661
  height: (f.top || 0) + (f.height || 0) + (f.bottom || 0)
608
662
  };
609
663
  }
610
- return ret ;
664
+ return ret;
611
665
  },
612
666
 
613
667
  /**
614
668
  The frame of the view including the borders
615
669
  */
616
- borderFrame: function(){
670
+ borderFrame: function () {
617
671
  var layout = this.get('layout'),
618
672
  frame = this.get('frame'),
619
- defaultBorder = layout.border,
620
- topBorder = ((layout.topBorder !== undefined) ? layout.topBorder : layout.border) || 0,
621
- rightBorder = ((layout.rightBorder !== undefined) ? layout.rightBorder : layout.border) || 0,
622
- bottomBorder = ((layout.bottomBorder !== undefined) ? layout.bottomBorder : layout.border) || 0,
623
- leftBorder = ((layout.leftBorder !== undefined) ? layout.leftBorder : layout.border) || 0;
624
-
625
- return {
626
- x: frame.x - leftBorder,
627
- y: frame.y - topBorder,
628
- width: frame.width + leftBorder + rightBorder,
629
- height: frame.height + topBorder + bottomBorder
630
- };
673
+ borderTop = this._effectiveBorderFor('borderTop', layout),
674
+ borderRight = this._effectiveBorderFor('borderRight', layout),
675
+ borderBottom = this._effectiveBorderFor('borderBottom', layout),
676
+ borderLeft = this._effectiveBorderFor('borderLeft', layout);
677
+
678
+ return frame ? {
679
+ x: frame.x - borderLeft,
680
+ y: frame.y - borderTop,
681
+ width: frame.width + borderLeft + borderRight,
682
+ height: frame.height + borderTop + borderBottom
683
+ } : null;
631
684
  }.property('frame').cacheable(),
632
685
 
633
686
  /**
@@ -640,14 +693,14 @@ SC.View.reopen(
640
693
  @returns {void}
641
694
  @test in viewDidResize
642
695
  */
643
- parentViewDidResize: function() {
696
+ parentViewDidResize: function () {
644
697
  var positionMayHaveChanged,
645
698
  sizeMayHaveChanged;
646
699
 
647
700
  // If this view uses static layout, our "do we think the frame changed?"
648
701
  // result of isFixedLayout is not applicable and we simply have to assume
649
702
  // that the frame may have changed.
650
- sizeMayHaveChanged = this.useStaticLayout || !this.get('isFixedSize');
703
+ sizeMayHaveChanged = this.get('useStaticLayout') || !this.get('isFixedSize');
651
704
  positionMayHaveChanged = !this.get('isFixedPosition');
652
705
 
653
706
  if (sizeMayHaveChanged) {
@@ -659,8 +712,6 @@ SC.View.reopen(
659
712
  }
660
713
  },
661
714
 
662
-
663
-
664
715
  /**
665
716
  This method is invoked on your view when the view resizes due to a layout
666
717
  change or potentially due to the parent view resizing (if your view’s size
@@ -673,12 +724,12 @@ SC.View.reopen(
673
724
 
674
725
  @returns {void}
675
726
  */
676
- viewDidResize: function() {
727
+ viewDidResize: function () {
677
728
  this._viewFrameDidChange();
678
729
 
679
730
  // Also notify our children.
680
- var cv = this.childViews, len, idx, view ;
681
- for (idx=0; idx<(len= cv.length); ++idx) {
731
+ var cv = this.childViews, len, idx, view;
732
+ for (idx = 0; idx < (len = cv.length); ++idx) {
682
733
  view = cv[idx];
683
734
  view.tryToPerform('parentViewDidResize');
684
735
  }
@@ -690,9 +741,9 @@ SC.View.reopen(
690
741
  This notifies the view that its frame property has changed,
691
742
  then propagates those changes to its child views.
692
743
  */
693
- _viewFrameDidChange: function() {
744
+ _viewFrameDidChange: function () {
694
745
  this.notifyPropertyChange('frame');
695
- this._sc_view_clippingFrameDidChange();
746
+ this._callOnChildViews('_sc_view_clippingFrameDidChange');
696
747
  },
697
748
 
698
749
  // Implementation note: As a general rule, paired method calls, such as
@@ -702,7 +753,7 @@ SC.View.reopen(
702
753
  //
703
754
  // -> View A.beginXXX()
704
755
  // -> View B.beginXXX()
705
- // -> View C.begitXXX()
756
+ // -> View C.beginXXX()
706
757
  // -> View D.beginXXX()
707
758
  //
708
759
  // ...later on, endXXX methods are called in reverse order of beginXXX...
@@ -722,17 +773,17 @@ SC.View.reopen(
722
773
  @returns {SC.View} receiver
723
774
  @test in viewDidResize
724
775
  */
725
- beginLiveResize: function() {
776
+ beginLiveResize: function () {
726
777
  // call before children have been notified...
727
- if (this.willBeginLiveResize) this.willBeginLiveResize() ;
778
+ if (this.willBeginLiveResize) this.willBeginLiveResize();
728
779
 
729
780
  // notify children in order
730
- var ary = this.get('childViews'), len = ary.length, idx, view ;
731
- for (idx=0; idx<len; ++idx) {
732
- view = ary[idx] ;
781
+ var ary = this.get('childViews'), len = ary.length, idx, view;
782
+ for (idx = 0; idx < len; ++idx) {
783
+ view = ary[idx];
733
784
  if (view.beginLiveResize) view.beginLiveResize();
734
785
  }
735
- return this ;
786
+ return this;
736
787
  },
737
788
 
738
789
  /**
@@ -743,25 +794,25 @@ SC.View.reopen(
743
794
  @returns {SC.View} receiver
744
795
  @test in viewDidResize
745
796
  */
746
- endLiveResize: function() {
797
+ endLiveResize: function () {
747
798
  // notify children in *reverse* order
748
- var ary = this.get('childViews'), len = ary.length, idx, view ;
749
- for (idx=len-1; idx>=0; --idx) { // loop backwards
750
- view = ary[idx] ;
751
- if (view.endLiveResize) view.endLiveResize() ;
799
+ var ary = this.get('childViews'), len = ary.length, idx, view;
800
+ for (idx = len - 1; idx >= 0; --idx) { // loop backwards
801
+ view = ary[idx];
802
+ if (view.endLiveResize) view.endLiveResize();
752
803
  }
753
804
 
754
805
  // call *after* all children have been notified...
755
- if (this.didEndLiveResize) this.didEndLiveResize() ;
756
- return this ;
806
+ if (this.didEndLiveResize) this.didEndLiveResize();
807
+ return this;
757
808
  },
758
809
 
759
810
  /**
760
811
  The view responsible for laying out this view. The default version
761
812
  returns the current parent view.
762
813
  */
763
- layoutView: function() {
764
- return this.get('parentView') ;
814
+ layoutView: function () {
815
+ return this.get('parentView');
765
816
  }.property('parentView').cacheable(),
766
817
 
767
818
  /**
@@ -777,87 +828,77 @@ SC.View.reopen(
777
828
 
778
829
  @returns {SC.View} receiver
779
830
  */
780
- layoutDidChange: function() {
781
- // Did our layout change in a way that could cause us to be resized? If
782
- // not, then there's no need to invalidate the frames of our child views.
783
- var previousLayout = this._previousLayout,
784
- currentLayout = this.get('layout'),
785
- didResize = YES,
786
- previousWidth, previousHeight, currentWidth, currentHeight;
787
-
831
+ layoutDidChange: function () {
832
+ var currentLayout = this.get('layout');
788
833
 
789
- // Handle old style rotation
834
+ // Handle old style rotation.
790
835
  if (!SC.none(currentLayout.rotate)) {
836
+ //@if (debug)
837
+ SC.Logger.warn('Developer Warning: Please set rotateX instead of rotate.');
838
+ //@endif
791
839
  if (SC.none(currentLayout.rotateX)) {
792
840
  currentLayout.rotateX = currentLayout.rotate;
793
- SC.Logger.warn('Please set rotateX instead of rotate');
794
841
  }
795
- }
796
- if (!SC.none(currentLayout.rotateX)) {
797
- currentLayout.rotate = currentLayout.rotateX;
798
- } else {
799
842
  delete currentLayout.rotate;
800
843
  }
801
844
 
802
- var animations = currentLayout.animations;
803
- if (animations) {
804
- if (!SC.none(animations.rotate)) {
805
- if (SC.none(animations.rotateX)) {
806
- animations.rotateX = animations.rotate;
807
- SC.Logger.warn('Please animate rotateX instead of rotate');
808
- }
809
- }
810
- if (!SC.none(animations.rotateX)) {
811
- animations.rotate = animations.rotateX;
812
- } else {
813
- delete animations.rotate;
845
+ // Optimize notifications depending on if we resized or just moved.
846
+ this._checkForResize();
847
+
848
+ // Notify layoutView/parentView, unless we are transitioning.
849
+ var layoutView = this.get('layoutView');
850
+ if (layoutView) {
851
+ layoutView.set('childViewsNeedLayout', YES);
852
+ layoutView.layoutDidChangeFor(this);
853
+
854
+ // Check if childViewsNeedLayout is still true.
855
+ if (layoutView.get('childViewsNeedLayout')) {
856
+ layoutView.invokeOnce(layoutView.layoutChildViewsIfNeeded);
814
857
  }
858
+ } else {
859
+ this.invokeOnce(this.updateLayout);
815
860
  }
816
861
 
817
- if (previousLayout && previousLayout !== currentLayout) {
818
- // This is a simple check to see whether we think the view may have
819
- // resized. We could look for a number of cases, but for now we'll
820
- // handle only one simple case: if the width and height are both
821
- // specified, and they have not changed.
822
- previousWidth = previousLayout.width;
823
- if (previousWidth !== undefined) {
824
- currentWidth = currentLayout.width;
825
- if (previousWidth === currentWidth) {
826
- previousHeight = previousLayout.height;
827
- if (previousLayout !== undefined) {
828
- currentHeight = currentLayout.height;
829
- if (previousHeight === currentHeight) didResize = NO;
830
- }
831
- }
862
+ return this;
863
+ },
864
+
865
+ /** @private */
866
+ _checkForResize: function () {
867
+ // Did our layout change in a way that could cause us to be resized? If
868
+ // not, then there's no need to invalidate the frames of our child views.
869
+ var previousLayout = this._previousLayout,
870
+ currentLayout = this.get('layout'),
871
+ didResize = true;
872
+
873
+ // We test the new layout to see if we believe it will affect the view's frame.
874
+ // Since all the child view frames may depend on the parent's frame, it's
875
+ // best only to notify a frame change when it actually happens.
876
+ if (previousLayout && !SC.none(previousLayout.width) && !SC.none(previousLayout.height) && previousLayout !== currentLayout) {
877
+ var currentTest,
878
+ previousTest;
879
+
880
+ // This code already exists in _adjustForBorder, so we use it to test the effective width/height.
881
+ // TODO: consider checking min/max sizes
882
+ previousTest = this._adjustForBorder({ x: 0, y: 0, width: previousLayout.width, height: previousLayout.height },
883
+ previousLayout);
884
+ currentTest = this._adjustForBorder({ x: 0, y: 0, width: currentLayout.width || 0, height: currentLayout.height || 0 },
885
+ currentLayout);
886
+
887
+ if (previousTest.width === currentTest.width && previousTest.height === currentTest.height) {
888
+ didResize = false;
832
889
  }
833
890
  }
834
891
 
835
- this.beginPropertyChanges() ;
836
- this.notifyPropertyChange('hasAcceleratedLayer');
837
- this.notifyPropertyChange('layoutStyle') ;
838
892
  if (didResize) {
839
893
  this.viewDidResize();
840
- }
841
- else {
842
- // Even if we didn't resize, our frame might have changed.
843
- // viewDidResize() handles this in the other case.
894
+ } else {
895
+ // Even if we didn't resize, our frame may have changed
896
+ // TODO: consider checking for position changes by testing the resulting frame against the cached frame. This is difficult to do.
844
897
  this._viewFrameDidChange();
845
898
  }
846
- this.endPropertyChanges() ;
847
-
848
- // notify layoutView...
849
- var layoutView = this.get('layoutView');
850
- if (layoutView) {
851
- layoutView.set('childViewsNeedLayout', YES);
852
- layoutView.layoutDidChangeFor(this) ;
853
- if (layoutView.get('childViewsNeedLayout')) {
854
- layoutView.invokeOnce(layoutView.layoutChildViewsIfNeeded);
855
- }
856
- }
857
899
 
900
+ // Cache the last layout to fine-tune notifications when the layout changes.
858
901
  this._previousLayout = currentLayout;
859
-
860
- return this ;
861
902
  },
862
903
 
863
904
  /**
@@ -865,7 +906,7 @@ SC.View.reopen(
865
906
  views. Normally this property is set automatically whenever the layout
866
907
  property for a child view changes.
867
908
 
868
- @property {Boolean}
909
+ @type Boolean
869
910
  */
870
911
  childViewsNeedLayout: NO,
871
912
 
@@ -888,8 +929,10 @@ SC.View.reopen(
888
929
  @param {SC.View} childView the view whose layout has changed.
889
930
  @returns {void}
890
931
  */
891
- layoutDidChangeFor: function(childView) {
892
- var set = this._needLayoutViews ;
932
+ layoutDidChangeFor: function (childView) {
933
+ var set = this._needLayoutViews;
934
+
935
+ // Track this view.
893
936
  if (!set) set = this._needLayoutViews = SC.CoreSet.create();
894
937
  set.add(childView);
895
938
  },
@@ -898,17 +941,18 @@ SC.View.reopen(
898
941
  Called your layout method if the view currently needs to layout some
899
942
  child views.
900
943
 
901
- @param {Boolean} isVisible if true assume view is visible even if it is not.
944
+ @param {Boolean} force if true assume view is visible even if it is not.
902
945
  @returns {SC.View} receiver
903
946
  @test in layoutChildViews
904
947
  */
905
- layoutChildViewsIfNeeded: function(isVisible) {
906
- if (!isVisible) isVisible = this.get('isVisibleInWindow');
907
- if (isVisible && this.get('childViewsNeedLayout')) {
948
+ layoutChildViewsIfNeeded: function (force) {
949
+ if (this.get('childViewsNeedLayout')) {
950
+ this.layoutChildViews(force);
951
+
908
952
  this.set('childViewsNeedLayout', NO);
909
- this.layoutChildViews();
910
953
  }
911
- return this ;
954
+
955
+ return this;
912
956
  },
913
957
 
914
958
  /**
@@ -917,19 +961,90 @@ SC.View.reopen(
917
961
  own layout updating method if you want, though usually the better option
918
962
  is to override the layout method from the parent view.
919
963
 
920
- The default implementation of this method simply calls the renderLayout()
964
+ The default implementation of this method simply calls the updateLayout()
921
965
  method on the views that need layout.
922
966
 
967
+ @param {Boolean} force Force the update to the layer's layout style immediately even if the view is not in a shown state. Otherwise the style will be updated when the view returns to a shown state.
923
968
  @returns {void}
924
969
  */
925
- layoutChildViews: function() {
926
- var set = this._needLayoutViews,
927
- len = set ? set.length : 0,
928
- i;
929
- for (i = 0; i < len; ++i) {
930
- set[i].updateLayout();
970
+ layoutChildViews: function (force) {
971
+ var childViewLayout = this.childViewLayout,
972
+ set, len, i;
973
+
974
+ // Allow the child view layout plugin to layout all child views.
975
+ if (childViewLayout) {
976
+ // Adjust all other child views right now.
977
+ // Note: this will add the affected child views to the set so they will be updated only once in this run loop
978
+ childViewLayout.layoutChildViews(this);
979
+ }
980
+
981
+ // Retreive these values after they may have been updated by adjustments by
982
+ // the childViewLayout plugin.
983
+ set = this._needLayoutViews;
984
+ if (set) {
985
+ for (i = 0, len = set.length; i < len; ++i) {
986
+ set[i].updateLayout(force);
987
+ }
988
+
989
+ set.clear(); // reset & reuse
990
+ }
991
+ },
992
+
993
+ /** @private Called when the child view layout plugin or options change. */
994
+ _cvl_childViewLayoutDidChange: function () {
995
+ this.set('childViewsNeedLayout', true);
996
+
997
+ // Filter the input channel.
998
+ this.invokeOnce(this.layoutChildViewsIfNeeded);
999
+ },
1000
+
1001
+ /** @private Called when the child views change. */
1002
+ _cvl_childViewsDidChange: function () {
1003
+ this._cvl_teardownChildViewsLiveLayout();
1004
+ this._cvl_setupChildViewsLiveLayout();
1005
+
1006
+ this.set('childViewsNeedLayout', true);
1007
+
1008
+ // Filter the input channel.
1009
+ this.invokeOnce(this.layoutChildViewsIfNeeded);
1010
+ },
1011
+
1012
+ /** @private Add observers to the child views for automatic child view layout. */
1013
+ _cvl_setupChildViewsLiveLayout: function () {
1014
+ var childViewLayout = this.childViewLayout,
1015
+ childViews,
1016
+ childLayoutProperties = childViewLayout.childLayoutProperties || [];
1017
+
1018
+ // Create a reference to the current child views so that we can clean them if they change.
1019
+ childViews = this._cvl_childViews = this.get('childViews');
1020
+ for (var i = 0, len = childLayoutProperties.length; i < len; i++) {
1021
+ var observedProperty = childLayoutProperties[i];
1022
+
1023
+ for (var j = 0, jlen = childViews.get('length'); j < jlen; j++) {
1024
+ var childView = childViews.objectAt(j);
1025
+ if (!childView.get('useAbsoluteLayout') && !childView.get('useStaticLayout')) {
1026
+ childView.addObserver(observedProperty, this, this._cvl_childViewLayoutDidChange);
1027
+ }
1028
+ }
1029
+ }
1030
+ },
1031
+
1032
+ /** @private Remove observers from the child views for automatic child view layout. */
1033
+ _cvl_teardownChildViewsLiveLayout: function () {
1034
+ var childViewLayout = this.childViewLayout,
1035
+ childViews = this._cvl_childViews || [],
1036
+ childLayoutProperties = childViewLayout.childLayoutProperties || [];
1037
+
1038
+ for (var i = 0, len = childLayoutProperties.length; i < len; i++) {
1039
+ var observedProperty = childLayoutProperties[i];
1040
+
1041
+ for (var j = 0, jlen = childViews.get('length'); j < jlen; j++) {
1042
+ var childView = childViews.objectAt(j);
1043
+ if (!childView.get('useAbsoluteLayout') && !childView.get('useStaticLayout')) {
1044
+ childView.removeObserver(observedProperty, this, this._cvl_childViewLayoutDidChange);
1045
+ }
1046
+ }
931
1047
  }
932
- set.clear(); // reset & reuse
933
1048
  },
934
1049
 
935
1050
  /**
@@ -941,22 +1056,14 @@ SC.View.reopen(
941
1056
  You will not usually override this method, but you may call it if you
942
1057
  implement layoutChildViews() in a view yourself.
943
1058
 
1059
+ @param {Boolean} force Force the update to the layer's layout style immediately even if the view is not in a shown state. Otherwise the style will be updated when the view returns to a shown state.
944
1060
  @returns {SC.View} receiver
945
1061
  @test in layoutChildViews
946
1062
  */
947
- updateLayout: function() {
948
- var layer = this.get('layer'), context;
949
- if (layer) {
950
- context = this.renderContext(layer);
951
- this.renderLayout(context, NO);
952
- context.update();
953
-
954
- // If this view uses static layout, then notify if the frame changed.
955
- // (viewDidResize will do a comparison)
956
- if (this.useStaticLayout) this.viewDidResize();
957
- }
958
- layer = null ;
959
- return this ;
1063
+ updateLayout: function (force) {
1064
+ this._doUpdateLayout(force);
1065
+
1066
+ return this;
960
1067
  },
961
1068
 
962
1069
  /**
@@ -969,25 +1076,245 @@ SC.View.reopen(
969
1076
  @returns {void}
970
1077
  @test in layoutChildViews
971
1078
  */
972
- renderLayout: function(context, firstTime) {
973
- this.get('layoutStyleCalculator').willRenderAnimations();
974
- context.addStyle(this.get('layoutStyle'));
975
- this.get('layoutStyleCalculator').didRenderAnimations();
1079
+ renderLayout: function (context) {
1080
+ context.setStyle(this.get('layoutStyle'));
976
1081
  },
977
1082
 
978
- _renderLayerSettings: function(original, context, firstTime) {
979
- original(context, firstTime);
980
- this.renderLayout(context, firstTime);
981
- }.enhance(),
982
-
983
- applyAttributesToContext: function(original, context) {
1083
+ applyAttributesToContext: function (original, context) {
984
1084
  original(context);
985
1085
 
1086
+ // Have to pass 'true' for second argument for legacy.
1087
+ this.renderLayout(context, true);
1088
+
986
1089
  if (this.get('useStaticLayout')) { context.addClass('sc-static-layout'); }
987
- if (this.get('backgroundColor')) {
988
- context.css('backgroundColor', this.get('backgroundColor'));
1090
+
1091
+ var backgroundColor = this.get('backgroundColor');
1092
+ if (backgroundColor) {
1093
+ context.setStyle('backgroundColor', backgroundColor);
1094
+ }
1095
+ }.enhance(),
1096
+
1097
+ // ------------------------------------------------------------------------
1098
+ // Child View Layouts
1099
+ //
1100
+
1101
+ /**
1102
+ The child view layout plugin to use when laying out child views.
1103
+
1104
+ You can set this property to a child layout plugin object to
1105
+ automatically set and adjust the layouts of this view's child views
1106
+ according to some specific layout style. For instance, SproutCore includes
1107
+ two such plugins, SC.View.VERTICAL_STACK and SC.View.HORIZONTAL_STACK.
1108
+
1109
+ SC.View.VERTICAL_STACK will arrange child views in order in a vertical
1110
+ stack, which only requires that the height of each child view be specified.
1111
+ Likewise, SC.View.HORIZONTAL_STACK does the same in the horizontal
1112
+ direction, which requires that the width of each child view be specified.
1113
+
1114
+ Where child layout plugins are extremely useful, besides simplifying
1115
+ the amount of layout code you need to write, is that they can update the
1116
+ layouts automatically as things change. For more details and examples,
1117
+ please see the documentation for SC.View.VERTICAL_STACK and
1118
+ SC.View.HORIZONTAL_STACK.
1119
+
1120
+ To define your own child view layout plugin, simply create an object that
1121
+ conforms to the SC.ChildViewLayoutProtocol protocol.
1122
+
1123
+ **Note** This should only be set once and is not bindable.
1124
+
1125
+ @type Object
1126
+ @default null
1127
+ */
1128
+ childViewLayout: null,
1129
+
1130
+ /**
1131
+ The options for the given child view layout plugin.
1132
+
1133
+ These options are specific to the current child layout plugin being used and
1134
+ are used to modify the applied layouts. For example, SC.View.VERTICAL_STACK
1135
+ accepts options like:
1136
+
1137
+ childViewLayoutOptions: {
1138
+ paddingAfter: 20,
1139
+ paddingBefore: 20,
1140
+ spacing: 10
1141
+ }
1142
+
1143
+ To determine what options may be used for a given plugin and to see what the
1144
+ default options are, please refer to the documentation for the child layout
1145
+ plugin being used.
1146
+
1147
+ @type Object
1148
+ @default null
1149
+ */
1150
+ childViewLayoutOptions: null,
1151
+
1152
+ /**
1153
+ Whether the view and its child views should be monitored for changes that
1154
+ affect the current child view layout.
1155
+
1156
+ When `true` and using a childViewLayout plugin, the view and its child views
1157
+ will be observed for any changes that would affect the layout of all the
1158
+ child views. For example, if `isChildViewLayout` is true and using
1159
+ SC.View.VERTICAL_STACK, if any child view's height or visibility changes
1160
+ all of the child views will be re-adjusted.
1161
+
1162
+ If you only want to automatically layout the child views once, you can
1163
+ set this to `false` to improve performance.
1164
+
1165
+ @type Boolean
1166
+ @default true
1167
+ */
1168
+ isChildViewLayoutLive: true,
1169
+
1170
+ // ------------------------------------------------------------------------
1171
+ // Statechart
1172
+ //
1173
+
1174
+ /** @private Update this view's layout action. */
1175
+ _doUpdateLayout: function (force) {
1176
+ var isRendered = this.get('_isRendered'),
1177
+ isVisibleInWindow = this.get('isVisibleInWindow'),
1178
+ handled = true;
1179
+
1180
+ if (isRendered) {
1181
+ if (isVisibleInWindow || force) {
1182
+ // Only in the visible states do we allow updates without being forced.
1183
+ this._doUpdateLayoutStyle();
1184
+ } else {
1185
+ // Otherwise mark the view as needing an update when we enter a shown state again.
1186
+ this._layoutStyleNeedsUpdate = true;
1187
+ }
1188
+ } else {
1189
+ handled = false;
1190
+ }
1191
+
1192
+ return handled;
1193
+ },
1194
+
1195
+ /** @private */
1196
+ _doUpdateLayoutStyle: function () {
1197
+ var context;
1198
+
1199
+ context = this.renderContext(this.get('layer'));
1200
+ context.setStyle(this.get('layoutStyle'));
1201
+ context.update();
1202
+
1203
+ // Reset that an update is required.
1204
+ this._layoutStyleNeedsUpdate = false;
1205
+
1206
+ // Notify updated.
1207
+ this._updatedLayout();
1208
+ },
1209
+
1210
+ /** @private Enhance. */
1211
+ _executeQueuedUpdates: function (original) {
1212
+ original();
1213
+
1214
+ // Update the layout style of the layer if necessary.
1215
+ if (this._layoutStyleNeedsUpdate) {
1216
+ this._doUpdateLayoutStyle();
1217
+ }
1218
+ }.enhance(),
1219
+
1220
+ /** @private Override: Notify on attached (avoids notify of frame changed). */
1221
+ _notifyAttached: function () {
1222
+ // If we are using static layout then we don't know the frame until appended to the document.
1223
+ if (this.get('useStaticLayout') || !this.get('isFixedLayout')) {
1224
+ // We call viewDidResize so that it calls parentViewDidResize on all child views.
1225
+ this.viewDidResize();
989
1226
  }
990
- }.enhance()
1227
+
1228
+ // Notify.
1229
+ if (this.didAppendToDocument) { this.didAppendToDocument(); }
1230
+ },
1231
+
1232
+ /** @private Override: The 'adopted' event (uses _checkForResize so our childViews are notified if our frame changes). */
1233
+ _adopted: function (beforeView) {
1234
+ // Our frame may change once we've been adopted to a parent.
1235
+ this._checkForResize();
1236
+ },
1237
+
1238
+ /** @private Extension: The 'orphaned' event. */
1239
+ _orphaned: function (oldParentView) {
1240
+ sc_super();
1241
+
1242
+ // Our frame may change once we've been removed from a parent.
1243
+ if (!this.isDestroyed) { this._checkForResize(); }
1244
+ },
1245
+
1246
+ /** @private Extension: The 'updatedContent' event. */
1247
+ _updatedContent: function () {
1248
+ sc_super();
1249
+
1250
+ // If this view uses static layout, then notify that the frame (likely)
1251
+ // changed.
1252
+ if (this.get('useStaticLayout')) { this.viewDidResize(); }
1253
+ },
1254
+
1255
+ /** @private The 'updatedLayout' event. */
1256
+ _updatedLayout: function () {
1257
+ // Notify.
1258
+ this.didRenderAnimations();
1259
+ },
1260
+
1261
+ // ------------------------------------------------------------------------
1262
+ // Transitions
1263
+ //
1264
+
1265
+ /**
1266
+ The transition plugin to use when this view is moved or resized by adjusting
1267
+ its layout.
1268
+
1269
+ SC.CoreView uses a pluggable transition architecture where the transition
1270
+ setup, execution and cleanup can be handled by a plugin. This allows you
1271
+ to create complex transition animations and share them across all your views
1272
+ with only a single line of code.
1273
+
1274
+ There are a number of pre-built transition adjust plugins available in
1275
+ the SproutCore foundation framework:
1276
+
1277
+ SC.View.SMOOTH_ADJUST
1278
+ SC.View.BOUNCE_ADJUST
1279
+ SC.View.SPRING_ADJUST
1280
+
1281
+ To create a custom transition plugin simply create a regular JavaScript
1282
+ object that conforms to the SC.ViewTransitionProtocol protocol.
1283
+
1284
+ NOTE: When creating custom transition adjust plugins, be aware that SC.View
1285
+ will not call the `setup` method of the plugin, only the `run` method.
1286
+
1287
+ @type Object (SC.ViewTransitionProtocol)
1288
+ @default null
1289
+ @since Version 1.10
1290
+ */
1291
+ transitionAdjust: null,
1292
+
1293
+ /**
1294
+ The options for the given `transitionAdjust` plugin.
1295
+
1296
+ These options are specific to the current transition plugin used and are
1297
+ used to modify the transition animation. To determine what options
1298
+ may be used for a given plugin and to see what the default options are,
1299
+ see the documentation for the transition plugin being used.
1300
+
1301
+ Most transitions will accept a duration and timing option, but may
1302
+ also use other options. For example, SC.View.BOUNCE_ADJUST accepts options
1303
+ like:
1304
+
1305
+ transitionAdjustOptions: {
1306
+ bounciness: 0.5, // how much the adjustment should bounce back each time
1307
+ bounces: 4, // the number of bounces
1308
+ duration: 0.25,
1309
+ delay: 1
1310
+ }
1311
+
1312
+ @type Object
1313
+ @default null
1314
+ @since Version 1.10
1315
+ */
1316
+ transitionAdjustOptions: null
1317
+
991
1318
  });
992
1319
 
993
1320
  SC.View.mixin(
@@ -996,7 +1323,7 @@ SC.View.mixin(
996
1323
  /**
997
1324
  Convert any layout to a Top, Left, Width, Height layout
998
1325
  */
999
- convertLayoutToAnchoredLayout: function(layout, parentFrame){
1326
+ convertLayoutToAnchoredLayout: function (layout, parentFrame) {
1000
1327
  var ret = {top: 0, left: 0, width: parentFrame.width, height: parentFrame.height},
1001
1328
  pFW = parentFrame.width, pFH = parentFrame.height, //shortHand for parentDimensions
1002
1329
  lR = layout.right,
@@ -1011,14 +1338,14 @@ SC.View.mixin(
1011
1338
  // X Conversion
1012
1339
  // handle left aligned and left/right
1013
1340
  if (!SC.none(lL)) {
1014
- if(SC.isPercentage(lL)) ret.left = lL*pFW;
1341
+ if (SC.isPercentage(lL)) ret.left = lL * pFW;
1015
1342
  else ret.left = lL;
1016
1343
  if (lW !== undefined) {
1017
- if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
1018
- else if(SC.isPercentage(lW)) ret.width = lW*pFW ;
1019
- else ret.width = lW ;
1344
+ if (lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO;
1345
+ else if (SC.isPercentage(lW)) ret.width = lW * pFW;
1346
+ else ret.width = lW;
1020
1347
  } else {
1021
- if (lR && SC.isPercentage(lR)) ret.width = pFW - ret.left - (lR*pFW);
1348
+ if (lR && SC.isPercentage(lR)) ret.width = pFW - ret.left - (lR * pFW);
1022
1349
  else ret.width = pFW - ret.left - (lR || 0);
1023
1350
  }
1024
1351
 
@@ -1028,14 +1355,14 @@ SC.View.mixin(
1028
1355
  // if no width, calculate it from the parent frame
1029
1356
  if (SC.none(lW)) {
1030
1357
  ret.left = 0;
1031
- if(lR && SC.isPercentage(lR)) ret.width = pFW - (lR*pFW);
1358
+ if (lR && SC.isPercentage(lR)) ret.width = pFW - (lR * pFW);
1032
1359
  else ret.width = pFW - (lR || 0);
1033
1360
 
1034
1361
  // If has width, calculate the left anchor from the width and right and parent frame
1035
1362
  } else {
1036
- if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
1363
+ if (lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO;
1037
1364
  else {
1038
- if (SC.isPercentage(lW)) ret.width = lW*pFW;
1365
+ if (SC.isPercentage(lW)) ret.width = lW * pFW;
1039
1366
  else ret.width = lW;
1040
1367
  if (SC.isPercentage(lR)) ret.left = pFW - (ret.width + lR);
1041
1368
  else ret.left = pFW - (ret.width + lR);
@@ -1044,18 +1371,18 @@ SC.View.mixin(
1044
1371
 
1045
1372
  // handle centered
1046
1373
  } else if (!SC.none(lcX)) {
1047
- if(lW && SC.isPercentage(lW)) ret.width = (lW*pFW) ;
1048
- else ret.width = (lW || 0) ;
1049
- ret.left = ((pFW - ret.width)/2);
1050
- if (SC.isPercentage(lcX)) ret.left = ret.left + lcX*pFW;
1374
+ if (lW && SC.isPercentage(lW)) ret.width = (lW * pFW);
1375
+ else ret.width = (lW || 0);
1376
+ ret.left = ((pFW - ret.width) / 2);
1377
+ if (SC.isPercentage(lcX)) ret.left = ret.left + lcX * pFW;
1051
1378
  else ret.left = ret.left + lcX;
1052
1379
 
1053
1380
  // if width defined, assume left of zero
1054
1381
  } else if (!SC.none(lW)) {
1055
1382
  ret.left = 0;
1056
- if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
1383
+ if (lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO;
1057
1384
  else {
1058
- if(SC.isPercentage(lW)) ret.width = lW*pFW;
1385
+ if (SC.isPercentage(lW)) ret.width = lW * pFW;
1059
1386
  else ret.width = lW;
1060
1387
  }
1061
1388
 
@@ -1066,21 +1393,21 @@ SC.View.mixin(
1066
1393
  }
1067
1394
 
1068
1395
  // handle min/max
1069
- if (layout.minWidth !== undefined) ret.minWidth = layout.minWidth ;
1070
- if (layout.maxWidth !== undefined) ret.maxWidth = layout.maxWidth ;
1396
+ if (layout.minWidth !== undefined) ret.minWidth = layout.minWidth;
1397
+ if (layout.maxWidth !== undefined) ret.maxWidth = layout.maxWidth;
1071
1398
 
1072
1399
  // Y Conversion
1073
1400
  // handle left aligned and top/bottom
1074
1401
  if (!SC.none(lT)) {
1075
- if(SC.isPercentage(lT)) ret.top = lT*pFH;
1402
+ if (SC.isPercentage(lT)) ret.top = lT * pFH;
1076
1403
  else ret.top = lT;
1077
1404
  if (lH !== undefined) {
1078
- if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
1079
- else if (SC.isPercentage(lH)) ret.height = lH*pFH;
1080
- else ret.height = lH ;
1405
+ if (lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO;
1406
+ else if (SC.isPercentage(lH)) ret.height = lH * pFH;
1407
+ else ret.height = lH;
1081
1408
  } else {
1082
1409
  ret.height = pFH - ret.top;
1083
- if(lB && SC.isPercentage(lB)) ret.height = ret.height - (lB*pFH);
1410
+ if (lB && SC.isPercentage(lB)) ret.height = ret.height - (lB * pFH);
1084
1411
  else ret.height = ret.height - (lB || 0);
1085
1412
  }
1086
1413
 
@@ -1090,34 +1417,34 @@ SC.View.mixin(
1090
1417
  // if no height, calculate it from the parent frame
1091
1418
  if (SC.none(lH)) {
1092
1419
  ret.top = 0;
1093
- if (lB && SC.isPercentage(lB)) ret.height = pFH - (lB*pFH);
1420
+ if (lB && SC.isPercentage(lB)) ret.height = pFH - (lB * pFH);
1094
1421
  else ret.height = pFH - (lB || 0);
1095
1422
 
1096
1423
  // If has height, calculate the top anchor from the height and bottom and parent frame
1097
1424
  } else {
1098
- if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
1425
+ if (lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO;
1099
1426
  else {
1100
- if (SC.isPercentage(lH)) ret.height = lH*pFH;
1427
+ if (SC.isPercentage(lH)) ret.height = lH * pFH;
1101
1428
  else ret.height = lH;
1102
1429
  ret.top = pFH - ret.height;
1103
- if (SC.isPercentage(lB)) ret.top = ret.top - (lB*pFH);
1430
+ if (SC.isPercentage(lB)) ret.top = ret.top - (lB * pFH);
1104
1431
  else ret.top = ret.top - lB;
1105
1432
  }
1106
1433
  }
1107
1434
 
1108
1435
  // handle centered
1109
1436
  } else if (!SC.none(lcY)) {
1110
- if(lH && SC.isPercentage(lH)) ret.height = (lH*pFH) ;
1111
- else ret.height = (lH || 0) ;
1112
- ret.top = ((pFH - ret.height)/2);
1113
- if(SC.isPercentage(lcY)) ret.top = ret.top + lcY*pFH;
1437
+ if (lH && SC.isPercentage(lH)) ret.height = (lH * pFH);
1438
+ else ret.height = (lH || 0);
1439
+ ret.top = ((pFH - ret.height) / 2);
1440
+ if (SC.isPercentage(lcY)) ret.top = ret.top + lcY * pFH;
1114
1441
  else ret.top = ret.top + lcY;
1115
1442
 
1116
1443
  // if height defined, assume top of zero
1117
1444
  } else if (!SC.none(lH)) {
1118
1445
  ret.top = 0;
1119
- if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
1120
- else if (SC.isPercentage(lH)) ret.height = lH*pFH;
1446
+ if (lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO;
1447
+ else if (SC.isPercentage(lH)) ret.height = lH * pFH;
1121
1448
  else ret.height = lH;
1122
1449
 
1123
1450
  // fallback, full height.
@@ -1126,16 +1453,16 @@ SC.View.mixin(
1126
1453
  ret.height = 0;
1127
1454
  }
1128
1455
 
1129
- if(ret.top) ret.top = Math.floor(ret.top);
1130
- if(ret.bottom) ret.bottom = Math.floor(ret.bottom);
1131
- if(ret.left) ret.left = Math.floor(ret.left);
1132
- if(ret.right) ret.right = Math.floor(ret.right);
1133
- if(ret.width !== SC.LAYOUT_AUTO) ret.width = Math.floor(ret.width);
1134
- if(ret.height !== SC.LAYOUT_AUTO) ret.height = Math.floor(ret.height);
1456
+ if (ret.top) ret.top = Math.floor(ret.top);
1457
+ if (ret.bottom) ret.bottom = Math.floor(ret.bottom);
1458
+ if (ret.left) ret.left = Math.floor(ret.left);
1459
+ if (ret.right) ret.right = Math.floor(ret.right);
1460
+ if (ret.width !== SC.LAYOUT_AUTO) ret.width = Math.floor(ret.width);
1461
+ if (ret.height !== SC.LAYOUT_AUTO) ret.height = Math.floor(ret.height);
1135
1462
 
1136
1463
  // handle min/max
1137
- if (layout.minHeight !== undefined) ret.minHeight = layout.minHeight ;
1138
- if (layout.maxHeight !== undefined) ret.maxHeight = layout.maxHeight ;
1464
+ if (layout.minHeight !== undefined) ret.minHeight = layout.minHeight;
1465
+ if (layout.maxHeight !== undefined) ret.maxHeight = layout.maxHeight;
1139
1466
 
1140
1467
  return ret;
1141
1468
  },
@@ -1143,7 +1470,7 @@ SC.View.mixin(
1143
1470
  /**
1144
1471
  For now can only convert Top/Left/Width/Height to a Custom Layout
1145
1472
  */
1146
- convertLayoutToCustomLayout: function(layout, layoutParams, parentFrame){
1473
+ convertLayoutToCustomLayout: function (layout, layoutParams, parentFrame) {
1147
1474
  // TODO: [EG] Create Top/Left/Width/Height to a Custom Layout conversion
1148
1475
  }
1149
1476
  });