sproutcore 1.0.1046 → 1.0.1049.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1498) hide show
  1. data/DISTRIBUTION.yml +7 -1
  2. data/Gemfile +3 -0
  3. data/Rakefile +179 -91
  4. data/VERSION.yml +4 -4
  5. data/bin/sc-server +1 -2
  6. data/frameworks/sproutcore/Buildfile +35 -12
  7. data/frameworks/sproutcore/Gemfile +8 -0
  8. data/frameworks/sproutcore/Gemfile.lock +33 -0
  9. data/frameworks/sproutcore/README.md +68 -0
  10. data/frameworks/sproutcore/apps/docs/english.lproj/loading.rhtml +1 -1
  11. data/frameworks/sproutcore/apps/greenhouse/README +25 -0
  12. data/frameworks/sproutcore/apps/greenhouse/TODO +72 -0
  13. data/frameworks/sproutcore/apps/greenhouse/beautify.js +1058 -0
  14. data/frameworks/sproutcore/apps/greenhouse/controllers/design.js +20 -0
  15. data/frameworks/sproutcore/apps/greenhouse/controllers/file.js +75 -0
  16. data/frameworks/sproutcore/apps/greenhouse/controllers/files.js +40 -0
  17. data/frameworks/sproutcore/apps/greenhouse/controllers/layout.js +53 -0
  18. data/frameworks/sproutcore/apps/greenhouse/controllers/library.js +243 -0
  19. data/frameworks/sproutcore/apps/greenhouse/controllers/page.js +18 -0
  20. data/frameworks/sproutcore/apps/greenhouse/controllers/property.js +19 -0
  21. data/frameworks/sproutcore/apps/greenhouse/controllers/property_editor.js +17 -0
  22. data/frameworks/sproutcore/apps/greenhouse/controllers/target.js +20 -0
  23. data/frameworks/sproutcore/apps/greenhouse/controllers/targets.js +43 -0
  24. data/frameworks/sproutcore/apps/greenhouse/core.js +67 -0
  25. data/frameworks/sproutcore/apps/greenhouse/core_file.js +124 -0
  26. data/frameworks/sproutcore/apps/greenhouse/data_source.js +250 -0
  27. data/frameworks/sproutcore/apps/greenhouse/english.lproj/app_page.js +377 -0
  28. data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/app-selector.css +111 -0
  29. data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/button.css +310 -0
  30. data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/dock.css +85 -0
  31. data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/general.css +52 -0
  32. data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/main-page.css +120 -0
  33. data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/menu.css +52 -0
  34. data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/modal.css +40 -0
  35. data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/picker.css +188 -0
  36. data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/search.css +60 -0
  37. data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/tabbed.css +68 -0
  38. data/frameworks/sproutcore/apps/greenhouse/english.lproj/css/text-field.css +67 -0
  39. data/frameworks/sproutcore/apps/greenhouse/english.lproj/dialogs.js +278 -0
  40. data/frameworks/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500.eot +0 -0
  41. data/frameworks/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500.otf +0 -0
  42. data/frameworks/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500.woff +0 -0
  43. data/frameworks/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500_italic.eot +0 -0
  44. data/frameworks/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500_italic.otf +0 -0
  45. data/frameworks/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500_italic.woff +0 -0
  46. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/app-selector/choose-app.png +0 -0
  47. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/app-selector/list-item-sel.png +0 -0
  48. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/active-l.png +0 -0
  49. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/active-m.png +0 -0
  50. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/active-r.png +0 -0
  51. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/regular-l.png +0 -0
  52. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/regular-m.png +0 -0
  53. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/regular-r.png +0 -0
  54. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/active-l.png +0 -0
  55. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/active-r.png +0 -0
  56. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/disabled-l.png +0 -0
  57. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/disabled-r.png +0 -0
  58. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/regular-l.png +0 -0
  59. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/regular-r.png +0 -0
  60. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-active-l.png +0 -0
  61. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-active-r.png +0 -0
  62. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-l.png +0 -0
  63. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-r.png +0 -0
  64. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-l.png +0 -0
  65. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-r.png +0 -0
  66. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/active-l.png +0 -0
  67. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/active-m.png +0 -0
  68. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/active-r.png +0 -0
  69. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-active-l.png +0 -0
  70. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-active-r.png +0 -0
  71. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-l.png +0 -0
  72. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-r.png +0 -0
  73. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-l.png +0 -0
  74. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-r.png +0 -0
  75. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-l.png +0 -0
  76. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-r.png +0 -0
  77. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/disabled-l.png +0 -0
  78. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/disabled-m.png +0 -0
  79. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/disabled-r.png +0 -0
  80. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/regular-l.png +0 -0
  81. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/regular-m.png +0 -0
  82. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/regular-r.png +0 -0
  83. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-active-l.png +0 -0
  84. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-active-m.png +0 -0
  85. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-active-r.png +0 -0
  86. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-disabled-l.png +0 -0
  87. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-disabled-m.png +0 -0
  88. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-disabled-r.png +0 -0
  89. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-l.png +0 -0
  90. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-m.png +0 -0
  91. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-r.png +0 -0
  92. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/active-m.png +0 -0
  93. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/disabled-m.png +0 -0
  94. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/regular-m.png +0 -0
  95. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/sel-active-m.png +0 -0
  96. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/sel-disabled-m.png +0 -0
  97. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/sel-m.png +0 -0
  98. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/active-l.png +0 -0
  99. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/active-r.png +0 -0
  100. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/disabled-l.png +0 -0
  101. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/disabled-r.png +0 -0
  102. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/regular-l.png +0 -0
  103. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/regular-r.png +0 -0
  104. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-active-l.png +0 -0
  105. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-active-r.png +0 -0
  106. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-disabled-l.png +0 -0
  107. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-disabled-r.png +0 -0
  108. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-l.png +0 -0
  109. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-r.png +0 -0
  110. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/actions-active.png +0 -0
  111. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/actions.png +0 -0
  112. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/inspector-active.png +0 -0
  113. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/inspector.png +0 -0
  114. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/library-active.png +0 -0
  115. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/library.png +0 -0
  116. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/projects-active.png +0 -0
  117. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/projects.png +0 -0
  118. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/run-active.png +0 -0
  119. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/run.png +0 -0
  120. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/save-active.png +0 -0
  121. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/icons/save.png +0 -0
  122. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/logos/greenhouse-l.png +0 -0
  123. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/logos/greenhouse-s.png +0 -0
  124. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/logos/sproutcore.png +0 -0
  125. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/main-bg.png +0 -0
  126. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/bottom-left.png +0 -0
  127. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/bottom-right.png +0 -0
  128. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/bottom.png +0 -0
  129. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/close-active.png +0 -0
  130. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/close.png +0 -0
  131. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/left.png +0 -0
  132. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/pointer-bottom.png +0 -0
  133. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/pointer-left.png +0 -0
  134. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/pointer-right.png +0 -0
  135. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/pointer-top.png +0 -0
  136. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/right.png +0 -0
  137. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/search-active.png +0 -0
  138. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/search.png +0 -0
  139. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/top-left.png +0 -0
  140. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/top-right.png +0 -0
  141. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/picker/top.png +0 -0
  142. data/frameworks/sproutcore/apps/greenhouse/english.lproj/images/toolbar-bg.png +0 -0
  143. data/frameworks/sproutcore/apps/greenhouse/english.lproj/inspectors.js +365 -0
  144. data/frameworks/sproutcore/apps/greenhouse/english.lproj/loading.rhtml +9 -0
  145. data/frameworks/sproutcore/apps/greenhouse/english.lproj/main_page.js +95 -0
  146. data/frameworks/sproutcore/apps/greenhouse/english.lproj/strings.js +84 -0
  147. data/frameworks/sproutcore/apps/greenhouse/fixtures/file.js +35 -0
  148. data/frameworks/sproutcore/apps/greenhouse/main.js +28 -0
  149. data/frameworks/sproutcore/apps/greenhouse/mixins/drop_down.js +97 -0
  150. data/frameworks/sproutcore/apps/greenhouse/models/design.js +22 -0
  151. data/frameworks/sproutcore/apps/greenhouse/models/dir.js +92 -0
  152. data/frameworks/sproutcore/apps/greenhouse/models/file.js +51 -0
  153. data/frameworks/sproutcore/apps/greenhouse/models/target.js +82 -0
  154. data/frameworks/sproutcore/apps/greenhouse/models/view_config.js +49 -0
  155. data/frameworks/sproutcore/apps/greenhouse/resources/test_page.js +37 -0
  156. data/frameworks/sproutcore/apps/greenhouse/states/inspector.js +144 -0
  157. data/frameworks/sproutcore/apps/greenhouse/states/library.js +133 -0
  158. data/frameworks/sproutcore/apps/greenhouse/states/main.js +223 -0
  159. data/frameworks/sproutcore/apps/greenhouse/states/modals.js +281 -0
  160. data/frameworks/sproutcore/apps/greenhouse/states/ready.js +197 -0
  161. data/frameworks/sproutcore/apps/greenhouse/tests/controllers/design.js +15 -0
  162. data/frameworks/sproutcore/apps/greenhouse/tests/controllers/designs.js +15 -0
  163. data/frameworks/sproutcore/apps/greenhouse/tests/controllers/file.js +15 -0
  164. data/frameworks/sproutcore/apps/greenhouse/tests/controllers/files.js +15 -0
  165. data/frameworks/sproutcore/apps/greenhouse/tests/models/file.js +15 -0
  166. data/frameworks/sproutcore/apps/greenhouse/tests/models/view_config.js +15 -0
  167. data/frameworks/sproutcore/apps/greenhouse/tests/views/list_item.js +15 -0
  168. data/frameworks/sproutcore/apps/greenhouse/views/anchor.js +277 -0
  169. data/frameworks/sproutcore/apps/greenhouse/views/application_list_item.js +19 -0
  170. data/frameworks/sproutcore/apps/greenhouse/views/event_blocker.js +32 -0
  171. data/frameworks/sproutcore/apps/greenhouse/views/label_designer.js +16 -0
  172. data/frameworks/sproutcore/apps/greenhouse/views/list_item.js +42 -0
  173. data/frameworks/sproutcore/apps/greenhouse/views/plist_item.js +39 -0
  174. data/frameworks/sproutcore/apps/greenhouse/views/simple_button.js +157 -0
  175. data/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js +56 -0
  176. data/frameworks/sproutcore/apps/greenhouse/views/web.js +44 -0
  177. data/frameworks/sproutcore/apps/test_controls/Buildfile +0 -0
  178. data/frameworks/sproutcore/apps/test_controls/controllers/categories.js +108 -0
  179. data/frameworks/sproutcore/apps/test_controls/controllers/category.js +31 -0
  180. data/frameworks/sproutcore/apps/test_controls/core.js +29 -0
  181. data/frameworks/sproutcore/apps/test_controls/main.js +14 -0
  182. data/frameworks/sproutcore/apps/test_controls/resources/buttons_page.js +124 -0
  183. data/frameworks/sproutcore/apps/test_controls/resources/checkboxes_page.js +45 -0
  184. data/frameworks/sproutcore/apps/test_controls/resources/flow_layout_page.js +77 -0
  185. data/frameworks/sproutcore/apps/test_controls/resources/list_page.js +40 -0
  186. data/frameworks/sproutcore/apps/test_controls/resources/loading.rhtml +9 -0
  187. data/frameworks/sproutcore/apps/test_controls/resources/main_page.css +54 -0
  188. data/frameworks/sproutcore/apps/test_controls/resources/main_page.js +136 -0
  189. data/frameworks/sproutcore/apps/test_controls/resources/progress_page.js +42 -0
  190. data/frameworks/sproutcore/apps/test_controls/resources/radio_page.js +41 -0
  191. data/frameworks/sproutcore/apps/test_controls/resources/scroll_page.js +76 -0
  192. data/frameworks/sproutcore/apps/test_controls/resources/segmented_page.js +75 -0
  193. data/frameworks/sproutcore/apps/test_controls/resources/select_page.js +60 -0
  194. data/frameworks/sproutcore/apps/test_controls/resources/sliders_page.js +53 -0
  195. data/frameworks/sproutcore/apps/test_controls/resources/strings.js +50 -0
  196. data/frameworks/sproutcore/apps/test_controls/resources/tab_page.js +15 -0
  197. data/frameworks/sproutcore/apps/test_controls/resources/text_field_page.js +40 -0
  198. data/frameworks/sproutcore/apps/tests/core.js +1 -1
  199. data/frameworks/sproutcore/apps/tests/english.lproj/loading.rhtml +1 -1
  200. data/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +2 -2
  201. data/frameworks/sproutcore/apps/tests/main.js +0 -1
  202. data/frameworks/sproutcore/apps/tests/states/no_targets.js +1 -1
  203. data/frameworks/sproutcore/apps/tests/states/ready.js +1 -1
  204. data/frameworks/sproutcore/apps/tests/states/ready_detail.js +1 -1
  205. data/frameworks/sproutcore/apps/tests/states/ready_empty.js +1 -1
  206. data/frameworks/sproutcore/apps/tests/states/ready_list.js +1 -1
  207. data/frameworks/sproutcore/apps/tests/states/ready_loading.js +1 -1
  208. data/frameworks/sproutcore/apps/tests/states/ready_no_tests.js +1 -1
  209. data/frameworks/sproutcore/apps/tests/states/start.js +1 -1
  210. data/frameworks/sproutcore/apps/welcome/controllers/targets.js +7 -0
  211. data/frameworks/sproutcore/apps/welcome/core.js +1 -1
  212. data/frameworks/sproutcore/apps/welcome/english.lproj/images/main-bg.png +0 -0
  213. data/frameworks/sproutcore/apps/welcome/english.lproj/main_page.css +24 -6
  214. data/frameworks/sproutcore/apps/welcome/english.lproj/main_page.js +36 -46
  215. data/frameworks/sproutcore/bin/edit_json.rb +14 -0
  216. data/frameworks/sproutcore/bin/erubis +14 -0
  217. data/frameworks/sproutcore/bin/prettify_json.rb +14 -0
  218. data/frameworks/sproutcore/bin/rackup +14 -0
  219. data/frameworks/sproutcore/bin/rake2thor +14 -0
  220. data/frameworks/sproutcore/bin/sc-build +14 -0
  221. data/frameworks/sproutcore/bin/sc-build-number +14 -0
  222. data/frameworks/sproutcore/bin/sc-docs +14 -0
  223. data/frameworks/sproutcore/bin/sc-gen +14 -0
  224. data/frameworks/sproutcore/bin/sc-init +14 -0
  225. data/frameworks/sproutcore/bin/sc-manifest +14 -0
  226. data/frameworks/sproutcore/bin/sc-server +14 -0
  227. data/frameworks/sproutcore/bin/sproutcore +14 -0
  228. data/frameworks/sproutcore/bin/thin +14 -0
  229. data/frameworks/sproutcore/bin/thor +14 -0
  230. data/frameworks/sproutcore/design/greenhouse-statechart.graffle +9025 -0
  231. data/frameworks/sproutcore/design/greenhouse-statechart.pdf +0 -0
  232. data/frameworks/sproutcore/design/iphone-webapp-loading.psd +0 -0
  233. data/frameworks/sproutcore/frameworks/animation/core.js +349 -116
  234. data/frameworks/sproutcore/frameworks/animation/tests/core.js +78 -16
  235. data/frameworks/sproutcore/frameworks/bootstrap/core.js +1 -1
  236. data/frameworks/sproutcore/frameworks/bootstrap/setup_body_class_names.js +3 -1
  237. data/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +5 -4
  238. data/frameworks/sproutcore/frameworks/bootstrap/system/loader.js +5 -2
  239. data/frameworks/sproutcore/frameworks/core_tools/data_source.js +1 -1
  240. data/frameworks/sproutcore/frameworks/datastore/core.js +1 -1
  241. data/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +1 -1
  242. data/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +1 -1
  243. data/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +1 -1
  244. data/frameworks/sproutcore/frameworks/datastore/debug/json.js +1 -1
  245. data/frameworks/sproutcore/frameworks/datastore/debug/standard_setup.js +1 -1
  246. data/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +122 -0
  247. data/frameworks/sproutcore/frameworks/datastore/models/child_record.js +105 -0
  248. data/frameworks/sproutcore/frameworks/datastore/models/children_attribute.js +81 -0
  249. data/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +1 -1
  250. data/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +1 -1
  251. data/frameworks/sproutcore/frameworks/datastore/models/record.js +247 -82
  252. data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +27 -13
  253. data/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +1 -1
  254. data/frameworks/sproutcore/frameworks/datastore/system/child_array.js +242 -0
  255. data/frameworks/sproutcore/frameworks/datastore/system/many_array.js +3 -3
  256. data/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +34 -18
  257. data/frameworks/sproutcore/frameworks/datastore/system/query.js +124 -47
  258. data/frameworks/sproutcore/frameworks/datastore/system/record_array.js +1 -1
  259. data/frameworks/sproutcore/frameworks/datastore/system/store.js +106 -22
  260. data/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +1 -1
  261. data/frameworks/sproutcore/frameworks/datastore/tests/integration/contact_model.js +1 -1
  262. data/frameworks/sproutcore/frameworks/datastore/tests/integration/cyclical_relationship.js +1 -1
  263. data/frameworks/sproutcore/frameworks/datastore/tests/integration/mail_model.js +1 -1
  264. data/frameworks/sproutcore/frameworks/datastore/tests/integration/test_runner_model.js +1 -1
  265. data/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +12 -1
  266. data/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js +235 -0
  267. data/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +337 -0
  268. data/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array_complex.js +421 -0
  269. data/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_complex.js +304 -0
  270. data/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/parentless.js +134 -0
  271. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +1 -1
  272. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/destroy.js +1 -1
  273. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/error_methods.js +1 -1
  274. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +30 -2
  275. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/readAttribute.js +1 -1
  276. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/refresh.js +1 -1
  277. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/storeDidChangeProperties.js +1 -1
  278. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/unknownProperty.js +1 -1
  279. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +1 -1
  280. data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +35 -4
  281. data/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +49 -2
  282. data/frameworks/sproutcore/frameworks/datastore/tests/system/many_array/core_methods.js +1 -1
  283. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +1 -1
  284. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js +1 -1
  285. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +1 -1
  286. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/core_methods.js +1 -1
  287. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/dataHashDidChange.js +1 -1
  288. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/discardChanges.js +1 -1
  289. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readDataHash.js +1 -1
  290. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readEditableDataHash.js +1 -1
  291. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/removeDataHash.js +1 -1
  292. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +1 -1
  293. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +1 -1
  294. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/compare.js +15 -2
  295. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/contains.js +1 -1
  296. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/containsRecordTypes.js +1 -1
  297. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/copy.js +1 -1
  298. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation.js +1 -1
  299. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation_of_records.js +2 -2
  300. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/expandedRecordTypes.js +1 -1
  301. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/parse.js +15 -1
  302. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/queryWithScope.js +1 -1
  303. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/record_type_is.js +1 -1
  304. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_comparisons.js +1 -1
  305. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_query_extensions.js +1 -1
  306. data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +1 -1
  307. data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js +1 -1
  308. data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +2 -2
  309. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js +1 -1
  310. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitChangesFromNestedStore.js +1 -1
  311. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +1 -1
  312. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +15 -2
  313. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/createRecord.js +1 -1
  314. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataHashDidChange.js +1 -1
  315. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +1 -1
  316. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +1 -1
  317. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/error_methods.js +1 -1
  318. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/find.js +1 -1
  319. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/init.js +1 -1
  320. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushChanges.js +6 -6
  321. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readDataHash.js +1 -1
  322. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/readEditableDataHash.js +1 -1
  323. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/recordDidChange.js +1 -1
  324. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/removeDataHash.js +1 -1
  325. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/retrieveRecord.js +1 -1
  326. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/writeDataHash.js +1 -1
  327. data/frameworks/sproutcore/frameworks/datejs/core.js +1 -1
  328. data/frameworks/sproutcore/frameworks/datejs/extras.js +1 -1
  329. data/frameworks/sproutcore/frameworks/debug/core.js +13 -2
  330. data/frameworks/sproutcore/frameworks/debug/invoke_once_last_debugging.js +40 -25
  331. data/frameworks/sproutcore/frameworks/designer/coders/design.js +1 -10
  332. data/frameworks/sproutcore/frameworks/designer/coders/localization.js +0 -8
  333. data/frameworks/sproutcore/frameworks/designer/controllers/controllers.js +16 -0
  334. data/frameworks/sproutcore/frameworks/designer/controllers/design.js +37 -0
  335. data/frameworks/sproutcore/frameworks/designer/controllers/designs.js +134 -0
  336. data/frameworks/sproutcore/frameworks/designer/controllers/page_design.js +44 -1
  337. data/frameworks/sproutcore/frameworks/designer/controllers/page_files.js +22 -0
  338. data/frameworks/sproutcore/frameworks/designer/core.js +16 -0
  339. data/frameworks/sproutcore/frameworks/designer/css/css_rule.js +1 -1
  340. data/frameworks/sproutcore/frameworks/designer/css/css_style.js +1 -1
  341. data/frameworks/sproutcore/frameworks/designer/css/css_style_sheet.js +1 -1
  342. data/frameworks/sproutcore/frameworks/designer/{views → designers}/button.js +2 -2
  343. data/frameworks/sproutcore/frameworks/designer/{views → designers}/label.js +1 -1
  344. data/frameworks/sproutcore/frameworks/designer/designers/object_designer.js +296 -0
  345. data/frameworks/sproutcore/frameworks/designer/{views → designers}/tab.js +3 -1
  346. data/frameworks/sproutcore/frameworks/designer/designers/text_field.js +15 -0
  347. data/frameworks/sproutcore/frameworks/designer/{views/designer.js → designers/view_designer.js} +282 -22
  348. data/frameworks/sproutcore/frameworks/designer/english.lproj/css/designer.css +96 -0
  349. data/frameworks/sproutcore/frameworks/designer/english.lproj/design_page.js +55 -0
  350. data/frameworks/sproutcore/frameworks/designer/english.lproj/high_light.css +10 -0
  351. data/frameworks/sproutcore/frameworks/designer/english.lproj/images/controller.png +0 -0
  352. data/frameworks/sproutcore/frameworks/designer/english.lproj/images/dock-bg.png +0 -0
  353. data/frameworks/sproutcore/frameworks/designer/english.lproj/images/dock-item-bg.png +0 -0
  354. data/frameworks/sproutcore/frameworks/designer/english.lproj/images/dock-item-divider.png +0 -0
  355. data/frameworks/sproutcore/frameworks/designer/english.lproj/images/dock-item-sel-bg.png +0 -0
  356. data/frameworks/sproutcore/frameworks/designer/english.lproj/images/dock-item-sel-divider.png +0 -0
  357. data/frameworks/sproutcore/frameworks/designer/english.lproj/images/main-bg.png +0 -0
  358. data/frameworks/sproutcore/frameworks/designer/english.lproj/images/page.png +0 -0
  359. data/frameworks/sproutcore/frameworks/designer/english.lproj/images/pane.png +0 -0
  360. data/frameworks/sproutcore/frameworks/designer/english.lproj/images/view.png +0 -0
  361. data/frameworks/sproutcore/frameworks/designer/ext/object.js +26 -0
  362. data/frameworks/sproutcore/frameworks/designer/ext/page.js +1 -1
  363. data/frameworks/sproutcore/frameworks/designer/ext/view.js +16 -0
  364. data/frameworks/sproutcore/frameworks/designer/mixins/snap_lines.js +221 -0
  365. data/frameworks/sproutcore/frameworks/designer/views/designer_drop_target.js +138 -0
  366. data/frameworks/sproutcore/frameworks/designer/views/drawing.js +219 -0
  367. data/frameworks/sproutcore/frameworks/designer/views/high_light.js +66 -0
  368. data/frameworks/sproutcore/frameworks/designer/views/page_item_view.js +130 -0
  369. data/frameworks/sproutcore/frameworks/designer/views/selection_handles.js +1 -0
  370. data/frameworks/sproutcore/frameworks/desktop/core.js +1 -1
  371. data/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +1 -1
  372. data/frameworks/sproutcore/frameworks/desktop/english.lproj/disclosure.css +7 -11
  373. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/cap.png +0 -0
  374. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/downbutton.png +0 -0
  375. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/thumb-bottom.png +0 -0
  376. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/thumb-center.png +0 -0
  377. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/thumb-top.png +0 -0
  378. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/track.png +0 -0
  379. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/upbutton.png +0 -0
  380. data/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +27 -3
  381. data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu.css +3 -5
  382. data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +18 -39
  383. data/frameworks/sproutcore/frameworks/desktop/english.lproj/progress.css +2 -0
  384. data/frameworks/sproutcore/frameworks/desktop/english.lproj/segmented.css +30 -38
  385. data/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +7 -5
  386. data/frameworks/sproutcore/frameworks/desktop/english.lproj/split.css +0 -70
  387. data/frameworks/sproutcore/frameworks/desktop/english.lproj/split_divider.css +0 -3
  388. data/frameworks/sproutcore/frameworks/desktop/english.lproj/tab.css +0 -1
  389. data/frameworks/sproutcore/frameworks/desktop/english.lproj/video.css +3 -0
  390. data/frameworks/sproutcore/frameworks/desktop/mixins/border.js +108 -23
  391. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +681 -0
  392. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +1 -1
  393. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +1 -1
  394. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +1 -1
  395. data/frameworks/sproutcore/frameworks/desktop/mixins/navigation_builder.js +130 -0
  396. data/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +6 -0
  397. data/frameworks/sproutcore/frameworks/desktop/panes/alert.js +8 -7
  398. data/frameworks/sproutcore/frameworks/desktop/panes/menu.js +944 -501
  399. data/frameworks/sproutcore/frameworks/desktop/panes/modal.js +4 -1
  400. data/frameworks/sproutcore/frameworks/desktop/panes/palette.js +10 -1
  401. data/frameworks/sproutcore/frameworks/desktop/panes/panel.js +5 -22
  402. data/frameworks/sproutcore/frameworks/desktop/panes/picker.js +268 -56
  403. data/frameworks/sproutcore/frameworks/desktop/panes/select_button.js +249 -110
  404. data/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +93 -33
  405. data/frameworks/sproutcore/frameworks/desktop/protocols/responder.js +9 -0
  406. data/frameworks/sproutcore/frameworks/desktop/renderers/button.js +147 -0
  407. data/frameworks/sproutcore/frameworks/desktop/renderers/checkbox.js +87 -0
  408. data/frameworks/sproutcore/frameworks/desktop/renderers/checkbox_control.js +103 -0
  409. data/frameworks/sproutcore/frameworks/desktop/renderers/disclosure.js +82 -0
  410. data/frameworks/sproutcore/frameworks/desktop/renderers/disclosure_control.js +103 -0
  411. data/frameworks/sproutcore/frameworks/desktop/renderers/image_button.js +33 -0
  412. data/frameworks/sproutcore/frameworks/desktop/renderers/list_item.js +334 -0
  413. data/frameworks/sproutcore/frameworks/desktop/renderers/masterDetail.js +23 -0
  414. data/frameworks/sproutcore/frameworks/desktop/renderers/panel.js +34 -0
  415. data/frameworks/sproutcore/frameworks/desktop/renderers/picker.js +50 -0
  416. data/frameworks/sproutcore/frameworks/desktop/renderers/segment.js +79 -0
  417. data/frameworks/sproutcore/frameworks/desktop/renderers/segmented.js +172 -0
  418. data/frameworks/sproutcore/frameworks/desktop/renderers/slider.js +86 -0
  419. data/frameworks/sproutcore/frameworks/desktop/renderers/workspace.js +22 -0
  420. data/frameworks/sproutcore/frameworks/desktop/system/drag.js +85 -51
  421. data/frameworks/sproutcore/frameworks/desktop/tests/datetime_recordattribute.js +1 -1
  422. data/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js +1 -1
  423. data/frameworks/sproutcore/frameworks/desktop/tests/mixins/border.js +96 -0
  424. data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/methods.js +1 -1
  425. data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +4 -4
  426. data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +113 -35
  427. data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +215 -51
  428. data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/methods.js +1 -1
  429. data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/ui.js +1 -1
  430. data/frameworks/sproutcore/frameworks/desktop/tests/panes/pane_page.js +1 -1
  431. data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +1 -1
  432. data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +1 -1
  433. data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +1 -1
  434. data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +3 -1
  435. data/frameworks/sproutcore/frameworks/desktop/tests/panes/select_button/methods.js +1 -1
  436. data/frameworks/sproutcore/frameworks/desktop/tests/panes/select_button/ui.js +1 -1
  437. data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/methods.js +1 -1
  438. data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +2 -2
  439. data/frameworks/sproutcore/frameworks/desktop/tests/views/button/methods.js +28 -4
  440. data/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +32 -12
  441. data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +17 -24
  442. data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/ui.js +14 -18
  443. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/content.js +1 -1
  444. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deleteSelection.js +1 -1
  445. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deselect.js +1 -1
  446. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/displayProperties.js +1 -1
  447. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +13 -1
  448. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/layerIdFor.js +1 -1
  449. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/length.js +1 -1
  450. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +46 -5
  451. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/nowShowing.js +1 -1
  452. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/reload.js +1 -1
  453. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/select.js +1 -1
  454. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectNextItem.js +1 -1
  455. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectPreviousItem.js +1 -1
  456. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selection.js +1 -1
  457. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/ui_diagram.js +1 -1
  458. data/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +76 -0
  459. data/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/ui.js +455 -0
  460. data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/methods.js +1 -1
  461. data/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +1 -1
  462. data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/methods.js +1 -1
  463. data/frameworks/sproutcore/frameworks/desktop/tests/views/grid/ui.js +1 -1
  464. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/render.js +1 -1
  465. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowDelegate.js +1 -1
  466. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +1 -1
  467. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowOffsetForContentIndex.js +1 -1
  468. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_alternatingrows.js +1 -1
  469. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +1 -1
  470. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +45 -6
  471. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +7 -7
  472. data/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +129 -21
  473. data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/methods.js +1 -1
  474. data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/ui.js +40 -38
  475. data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/methods.js +1 -1
  476. data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +1 -1
  477. data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/methods.js +24 -17
  478. data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/ui.js +68 -36
  479. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +1 -1
  480. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +22 -63
  481. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller.js +90 -0
  482. data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +8 -8
  483. data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +8 -4
  484. data/frameworks/sproutcore/frameworks/desktop/tests/views/select/methods.js +144 -0
  485. data/frameworks/sproutcore/frameworks/desktop/tests/views/select/ui.js +216 -0
  486. data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +1 -1
  487. data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +1 -1
  488. data/frameworks/sproutcore/frameworks/desktop/tests/views/separator.js +1 -1
  489. data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/methods.js +1 -1
  490. data/frameworks/sproutcore/frameworks/desktop/tests/views/source_list/ui.js +1 -1
  491. data/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js +1 -1
  492. data/frameworks/sproutcore/frameworks/desktop/tests/views/split/ui.js +1 -1
  493. data/frameworks/sproutcore/frameworks/desktop/tests/views/stacked/ui_comments.js +1 -1
  494. data/frameworks/sproutcore/frameworks/desktop/tests/views/static_content.js +46 -0
  495. data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +1 -1
  496. data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +1 -1
  497. data/frameworks/sproutcore/frameworks/desktop/tests/views/web/methods.js +1 -1
  498. data/frameworks/sproutcore/frameworks/desktop/tests/views/web/ui.js +1 -1
  499. data/frameworks/sproutcore/frameworks/desktop/tests/views/well/ui.js +1 -1
  500. data/frameworks/sproutcore/frameworks/desktop/views/button.js +249 -79
  501. data/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +63 -89
  502. data/frameworks/sproutcore/frameworks/desktop/views/collection.js +358 -96
  503. data/frameworks/sproutcore/frameworks/desktop/views/date_field.js +319 -0
  504. data/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +31 -17
  505. data/frameworks/sproutcore/frameworks/desktop/views/file.js +112 -0
  506. data/frameworks/sproutcore/frameworks/desktop/views/grid.js +30 -34
  507. data/frameworks/sproutcore/frameworks/desktop/views/list.js +28 -14
  508. data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +480 -262
  509. data/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +249 -0
  510. data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +443 -381
  511. data/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +74 -66
  512. data/frameworks/sproutcore/frameworks/desktop/views/navigation.js +237 -0
  513. data/frameworks/sproutcore/frameworks/desktop/views/navigation_bar.js +181 -0
  514. data/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +175 -57
  515. data/frameworks/sproutcore/frameworks/desktop/views/progress.js +29 -21
  516. data/frameworks/sproutcore/frameworks/desktop/views/radio.js +196 -204
  517. data/frameworks/sproutcore/frameworks/desktop/views/scene.js +1 -1
  518. data/frameworks/sproutcore/frameworks/desktop/views/scroll.js +1128 -94
  519. data/frameworks/sproutcore/frameworks/desktop/views/scroller.js +569 -153
  520. data/frameworks/sproutcore/frameworks/desktop/views/segmented.js +144 -129
  521. data/frameworks/sproutcore/frameworks/desktop/views/select.js +804 -0
  522. data/frameworks/sproutcore/frameworks/desktop/views/select_field.js +15 -13
  523. data/frameworks/sproutcore/frameworks/desktop/views/slider.js +77 -47
  524. data/frameworks/sproutcore/frameworks/desktop/views/source_list.js +1 -1
  525. data/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +4 -4
  526. data/frameworks/sproutcore/frameworks/desktop/views/split.js +426 -269
  527. data/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +5 -3
  528. data/frameworks/sproutcore/frameworks/desktop/views/stacked.js +1 -1
  529. data/frameworks/sproutcore/frameworks/desktop/views/static_content.js +123 -0
  530. data/frameworks/sproutcore/frameworks/desktop/views/tab.js +59 -63
  531. data/frameworks/sproutcore/frameworks/desktop/views/thumb.js +5 -1
  532. data/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +1 -1
  533. data/frameworks/sproutcore/frameworks/desktop/views/web.js +3 -3
  534. data/frameworks/sproutcore/frameworks/desktop/views/well.js +7 -2
  535. data/frameworks/sproutcore/frameworks/desktop/views/workspace.js +270 -0
  536. data/frameworks/sproutcore/frameworks/documentation/core.js +0 -0
  537. data/frameworks/sproutcore/frameworks/forms/english.lproj/default_styles.css +5 -0
  538. data/frameworks/sproutcore/frameworks/forms/english.lproj/strings.js +15 -0
  539. data/frameworks/sproutcore/frameworks/forms/mixins/auto_hide.js +85 -0
  540. data/frameworks/sproutcore/frameworks/forms/mixins/edit_mode.js +43 -0
  541. data/frameworks/sproutcore/frameworks/forms/renderers/form.js +24 -0
  542. data/frameworks/sproutcore/frameworks/forms/renderers/form_row.js +24 -0
  543. data/frameworks/sproutcore/frameworks/forms/tests/views/form.js +15 -0
  544. data/frameworks/sproutcore/frameworks/forms/tests/views/form_checkbox_field.js +15 -0
  545. data/frameworks/sproutcore/frameworks/forms/tests/views/form_field.js +15 -0
  546. data/frameworks/sproutcore/frameworks/forms/tests/views/form_label.js +15 -0
  547. data/frameworks/sproutcore/frameworks/forms/tests/views/form_radio_field.js +15 -0
  548. data/frameworks/sproutcore/frameworks/forms/tests/views/form_row.js +15 -0
  549. data/frameworks/sproutcore/frameworks/forms/tests/views/form_text_field.js +15 -0
  550. data/frameworks/sproutcore/frameworks/forms/views/form.js +266 -0
  551. data/frameworks/sproutcore/frameworks/forms/views/form_row.js +188 -0
  552. data/frameworks/sproutcore/frameworks/foundation/TESTING +5 -5
  553. data/frameworks/sproutcore/frameworks/foundation/controllers/array.js +11 -2
  554. data/frameworks/sproutcore/frameworks/foundation/controllers/controller.js +2 -2
  555. data/frameworks/sproutcore/frameworks/foundation/controllers/object.js +23 -3
  556. data/frameworks/sproutcore/frameworks/foundation/core.js +34 -3
  557. data/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +2 -3
  558. data/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +2 -1
  559. data/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +4 -0
  560. data/frameworks/sproutcore/frameworks/foundation/english.lproj/core.css +109 -81
  561. data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-logo.png +0 -0
  562. data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-landscape.jpg +0 -0
  563. data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-landscape.png +0 -0
  564. data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-portrait.jpg +0 -0
  565. data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-portrait.png +0 -0
  566. data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup.png +0 -0
  567. data/frameworks/sproutcore/frameworks/foundation/english.lproj/images/sproutcore.png +0 -0
  568. data/frameworks/sproutcore/frameworks/foundation/english.lproj/strings.js +1 -1
  569. data/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +16 -14
  570. data/frameworks/sproutcore/frameworks/foundation/english.lproj/view.css +5 -0
  571. data/frameworks/sproutcore/frameworks/foundation/ext/object.js +1 -1
  572. data/frameworks/sproutcore/frameworks/foundation/ext/run_loop.js +6 -5
  573. data/frameworks/sproutcore/frameworks/foundation/gestures/pinch.js +81 -0
  574. data/frameworks/sproutcore/frameworks/foundation/gestures/swipe.js +142 -0
  575. data/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js +33 -0
  576. data/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +74 -0
  577. data/frameworks/sproutcore/frameworks/foundation/mixins/button.js +4 -2
  578. data/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +1 -1
  579. data/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +2 -2
  580. data/frameworks/sproutcore/frameworks/foundation/mixins/control.js +88 -15
  581. data/frameworks/sproutcore/frameworks/foundation/mixins/editable.js +3 -1
  582. data/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +415 -0
  583. data/frameworks/sproutcore/frameworks/foundation/mixins/gestureable.js +106 -0
  584. data/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +95 -64
  585. data/frameworks/sproutcore/frameworks/foundation/{system → mixins}/responder_context.js +42 -16
  586. data/frameworks/sproutcore/frameworks/foundation/mixins/selection_support.js +64 -83
  587. data/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +7 -53
  588. data/frameworks/sproutcore/frameworks/foundation/mixins/string.js +188 -5
  589. data/frameworks/sproutcore/frameworks/foundation/mixins/tree_item_content.js +1 -1
  590. data/frameworks/sproutcore/frameworks/foundation/mixins/validatable.js +4 -4
  591. data/frameworks/sproutcore/frameworks/foundation/panes/main.js +1 -2
  592. data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +216 -53
  593. data/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +1 -1
  594. data/frameworks/sproutcore/frameworks/foundation/protocols/inline_editor_delegate.js +1 -1
  595. data/frameworks/sproutcore/frameworks/foundation/renderers/control.js +122 -0
  596. data/frameworks/sproutcore/frameworks/foundation/renderers/image.js +51 -0
  597. data/frameworks/sproutcore/frameworks/foundation/renderers/label.js +96 -0
  598. data/frameworks/sproutcore/frameworks/foundation/renderers/renderer.js +316 -0
  599. data/frameworks/sproutcore/frameworks/foundation/renderers/title.js +108 -0
  600. data/frameworks/sproutcore/frameworks/foundation/renderers/view.js +62 -0
  601. data/frameworks/sproutcore/frameworks/foundation/system/application.js +4 -3
  602. data/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +5 -2
  603. data/frameworks/sproutcore/frameworks/foundation/system/browser.js +32 -37
  604. data/frameworks/sproutcore/frameworks/foundation/system/builder.js +1 -1
  605. data/frameworks/sproutcore/frameworks/foundation/system/bundle.js +18 -15
  606. data/frameworks/sproutcore/frameworks/foundation/system/core_query.js +12 -13
  607. data/frameworks/sproutcore/frameworks/foundation/system/cursor.js +6 -5
  608. data/frameworks/sproutcore/frameworks/foundation/system/datetime.js +7 -8
  609. data/frameworks/sproutcore/frameworks/foundation/system/device.js +143 -0
  610. data/frameworks/sproutcore/frameworks/foundation/system/event.js +38 -13
  611. data/frameworks/sproutcore/frameworks/foundation/system/gesture.js +245 -0
  612. data/frameworks/sproutcore/frameworks/foundation/system/image_cache.js +13 -13
  613. data/frameworks/sproutcore/frameworks/foundation/system/json.js +11 -8
  614. data/frameworks/sproutcore/frameworks/foundation/system/locale.js +7 -2
  615. data/frameworks/sproutcore/frameworks/foundation/system/math.js +57 -0
  616. data/frameworks/sproutcore/frameworks/foundation/system/page.js +2 -2
  617. data/frameworks/sproutcore/frameworks/foundation/system/platform.js +189 -0
  618. data/frameworks/sproutcore/frameworks/foundation/system/ready.js +9 -7
  619. data/frameworks/sproutcore/frameworks/foundation/system/render_context.js +155 -62
  620. data/frameworks/sproutcore/frameworks/foundation/system/request.js +21 -1
  621. data/frameworks/sproutcore/frameworks/foundation/system/responder.js +6 -3
  622. data/frameworks/sproutcore/frameworks/foundation/system/response.js +5 -3
  623. data/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +1704 -233
  624. data/frameworks/sproutcore/frameworks/foundation/system/routes.js +340 -445
  625. data/frameworks/sproutcore/frameworks/foundation/system/task_queue.js +150 -0
  626. data/frameworks/sproutcore/frameworks/foundation/system/text_selection.js +1 -1
  627. data/frameworks/sproutcore/frameworks/foundation/system/theme.js +108 -0
  628. data/frameworks/sproutcore/frameworks/foundation/system/time.js +0 -5
  629. data/frameworks/sproutcore/frameworks/foundation/system/timer.js +1 -1
  630. data/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +193 -29
  631. data/frameworks/sproutcore/frameworks/foundation/system/utils.js +133 -60
  632. data/frameworks/sproutcore/frameworks/foundation/tasks/preload_bundle.js +41 -0
  633. data/frameworks/sproutcore/frameworks/foundation/tasks/task.js +17 -0
  634. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/array_case.js +1 -1
  635. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/enum_case.js +1 -1
  636. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/null_case.js +1 -1
  637. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/selection_support.js +318 -0
  638. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/single_case.js +1 -1
  639. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/empty_case.js +1 -1
  640. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/multiple_case.js +1 -1
  641. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_case.js +1 -1
  642. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_enumerable_case.js +87 -1
  643. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/outline_case.js +1 -1
  644. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/selection_support.js +340 -0
  645. data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/methods.js +1 -1
  646. data/frameworks/sproutcore/frameworks/foundation/tests/debug/control_test_pane/ui.js +1 -1
  647. data/frameworks/sproutcore/frameworks/foundation/tests/integration/creating_views.js +1 -1
  648. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/content.js +1 -1
  649. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/displayProperties.js +1 -1
  650. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/keyEquivalents.js +1 -1
  651. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/content.js +1 -1
  652. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/displayProperties.js +1 -1
  653. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/api.js +52 -0
  654. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +227 -0
  655. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/responder_context.js +75 -0
  656. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +17 -0
  657. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js +58 -3
  658. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/validatable/ui.js +74 -0
  659. data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/flat_case.js +1 -1
  660. data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/group_case.js +1 -1
  661. data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/outline_case.js +1 -1
  662. data/frameworks/sproutcore/frameworks/foundation/tests/renderers/renderer/base.js +170 -0
  663. data/frameworks/sproutcore/frameworks/foundation/tests/renderers/renderer/inheritance.js +39 -0
  664. data/frameworks/sproutcore/frameworks/foundation/tests/system/datetime.js +4 -9
  665. data/frameworks/sproutcore/frameworks/foundation/tests/system/locale.js +6 -1
  666. data/frameworks/sproutcore/frameworks/foundation/tests/system/math.js +39 -0
  667. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/begin.js +1 -1
  668. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/element.js +1 -1
  669. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/end.js +6 -1
  670. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/get.js +1 -1
  671. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_attr.js +1 -1
  672. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_basic.js +1 -1
  673. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_className.js +1 -1
  674. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_style.js +12 -3
  675. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/init.js +1 -1
  676. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/join.js +1 -1
  677. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/push_text.js +1 -1
  678. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/tag.js +1 -1
  679. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/update.js +12 -1
  680. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeKeyPane.js +1 -1
  681. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeMainPane.js +1 -1
  682. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/makeMenuPane.js +48 -0
  683. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/targetForAction.js +1 -1
  684. data/frameworks/sproutcore/frameworks/foundation/tests/system/routes.js +333 -14
  685. data/frameworks/sproutcore/frameworks/foundation/tests/system/task_queue.js +43 -0
  686. data/frameworks/sproutcore/frameworks/foundation/tests/system/theme.js +86 -0
  687. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/invokeLater.js +7 -5
  688. data/frameworks/sproutcore/frameworks/foundation/tests/validators/date.js +1 -1
  689. data/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +1 -1
  690. data/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +34 -2
  691. data/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +1 -1
  692. data/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +1 -1
  693. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/append_remove.js +7 -10
  694. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/firstResponder.js +1 -1
  695. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/keyPane.js +1 -1
  696. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/layout.js +31 -0
  697. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/sendEvent.js +1 -1
  698. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/sendTouchEvent.js +267 -0
  699. data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +1 -1
  700. data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +99 -5
  701. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/animation.js +321 -0
  702. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/build.js +85 -0
  703. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/build_children.js +89 -0
  704. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/clippingFrame.js +1 -1
  705. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/convertFrames.js +1 -1
  706. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createChildViews.js +1 -1
  707. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createLayer.js +3 -3
  708. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/destroyLayer.js +1 -1
  709. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/didAppendToDocument.js +1 -1
  710. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/findLayerInParentLayer.js +1 -1
  711. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/init.js +1 -1
  712. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/insertBefore.js +1 -1
  713. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layer.js +1 -1
  714. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutChildViews.js +2 -2
  715. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutDidChange.js +2 -2
  716. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutStyle.js +289 -22
  717. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/nextValidKeyView.js +20 -1
  718. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/parentViewDidChange.js +2 -2
  719. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/prepareContext.js +28 -6
  720. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/removeChild.js +2 -2
  721. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/render.js +50 -7
  722. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/renderer.js +443 -0
  723. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/replaceChild.js +2 -2
  724. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/theme.js +41 -0
  725. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayer.js +4 -4
  726. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayerLocation.js +2 -2
  727. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/viewDidResize.js +7 -6
  728. data/frameworks/sproutcore/frameworks/foundation/validators/credit_card.js +1 -1
  729. data/frameworks/sproutcore/frameworks/foundation/validators/date.js +1 -1
  730. data/frameworks/sproutcore/frameworks/foundation/validators/date_time.js +46 -0
  731. data/frameworks/sproutcore/frameworks/foundation/validators/email.js +1 -1
  732. data/frameworks/sproutcore/frameworks/foundation/validators/not_empty.js +1 -1
  733. data/frameworks/sproutcore/frameworks/foundation/validators/number.js +17 -5
  734. data/frameworks/sproutcore/frameworks/foundation/validators/password.js +1 -1
  735. data/frameworks/sproutcore/frameworks/foundation/validators/positive_integer.js +84 -0
  736. data/frameworks/sproutcore/frameworks/foundation/validators/validator.js +16 -6
  737. data/frameworks/sproutcore/frameworks/foundation/views/container.js +25 -22
  738. data/frameworks/sproutcore/frameworks/foundation/views/field.js +16 -42
  739. data/frameworks/sproutcore/frameworks/foundation/views/image.js +1 -1
  740. data/frameworks/sproutcore/frameworks/foundation/views/label.js +58 -48
  741. data/frameworks/sproutcore/frameworks/foundation/views/text_field.js +321 -133
  742. data/frameworks/sproutcore/frameworks/foundation/views/view.js +1853 -353
  743. data/frameworks/sproutcore/frameworks/jquery/jquery.js +6240 -0
  744. data/frameworks/sproutcore/frameworks/media/resources/controls.png +0 -0
  745. data/frameworks/sproutcore/frameworks/media/resources/playeras3.fla +0 -0
  746. data/frameworks/sproutcore/frameworks/media/resources/video.css +120 -0
  747. data/frameworks/sproutcore/frameworks/media/resources/videoCanvas.swf +0 -0
  748. data/frameworks/sproutcore/frameworks/media/views/audio.js +729 -0
  749. data/frameworks/sproutcore/frameworks/media/views/controls.js +90 -0
  750. data/frameworks/sproutcore/frameworks/media/views/mediaSlider.js +243 -0
  751. data/frameworks/sproutcore/frameworks/media/views/miniControls.js +63 -0
  752. data/frameworks/sproutcore/frameworks/media/views/simpleControls.js +55 -0
  753. data/frameworks/sproutcore/frameworks/media/views/video.js +829 -0
  754. data/frameworks/sproutcore/frameworks/mobile/lib/index.rhtml +2 -3
  755. data/frameworks/sproutcore/frameworks/mobile/tests/views/button/ui.js +9 -2
  756. data/frameworks/sproutcore/frameworks/mobile/views/button.js +5 -4
  757. data/frameworks/sproutcore/frameworks/runtime/core.js +46 -34
  758. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +1 -1
  759. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/indexOf.js +1 -1
  760. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/insertAt.js +1 -1
  761. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js +1 -1
  762. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/popObject.js +1 -1
  763. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/pushObject.js +1 -1
  764. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/rangeObserver.js +1 -1
  765. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeAt.js +1 -1
  766. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js +1 -1
  767. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/replace.js +1 -1
  768. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/shiftObject.js +1 -1
  769. data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/unshiftObject.js +1 -1
  770. data/frameworks/sproutcore/frameworks/runtime/mixins/array.js +36 -2
  771. data/frameworks/sproutcore/frameworks/runtime/mixins/comparable.js +1 -1
  772. data/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +1 -1
  773. data/frameworks/sproutcore/frameworks/runtime/mixins/delegate_support.js +1 -1
  774. data/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +63 -3
  775. data/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +1 -1
  776. data/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +25 -19
  777. data/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +1 -1
  778. data/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +1 -1
  779. data/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +12 -7
  780. data/frameworks/sproutcore/frameworks/runtime/protocols/observable_protocol.js +1 -1
  781. data/frameworks/sproutcore/frameworks/runtime/protocols/sparse_array_delegate.js +1 -1
  782. data/frameworks/sproutcore/frameworks/runtime/system/binding.js +60 -7
  783. data/frameworks/sproutcore/frameworks/runtime/system/enumerator.js +1 -1
  784. data/frameworks/sproutcore/frameworks/runtime/system/error.js +1 -1
  785. data/frameworks/sproutcore/frameworks/runtime/system/index_set.js +2 -1
  786. data/frameworks/sproutcore/frameworks/runtime/system/object.js +37 -7
  787. data/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +1 -1
  788. data/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +39 -10
  789. data/frameworks/sproutcore/frameworks/runtime/system/selection_set.js +1 -1
  790. data/frameworks/sproutcore/frameworks/runtime/system/set.js +1 -1
  791. data/frameworks/sproutcore/frameworks/runtime/system/sparse_array.js +3 -3
  792. data/frameworks/sproutcore/frameworks/runtime/tests/core/clone.js +1 -1
  793. data/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js +1 -1
  794. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +1 -1
  795. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/comparable.js +1 -1
  796. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable.js +12 -1
  797. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +6 -1
  798. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +23 -0
  799. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +1 -1
  800. data/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue/isObservingSuspended.js +1 -1
  801. data/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +126 -0
  802. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +1 -1
  803. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/addEach.js +1 -1
  804. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/clone.js +1 -1
  805. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/contains.js +1 -1
  806. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js +1 -1
  807. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js +1 -1
  808. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexBefore.js +1 -1
  809. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/intersects.js +1 -1
  810. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/max.js +1 -1
  811. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js +11 -1
  812. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/rangeStartForIndex.js +1 -1
  813. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/remove.js +1 -1
  814. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/removeEach.js +1 -1
  815. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/without.js +1 -1
  816. data/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +30 -12
  817. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/create.js +1 -1
  818. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/destroy.js +1 -1
  819. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/objectPropertyDidChange.js +1 -1
  820. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/rangeDidChange.js +1 -1
  821. data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/update.js +1 -1
  822. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/add.js +1 -1
  823. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/copy.js +1 -1
  824. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/indexSetForSource.js +1 -1
  825. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/isEqual.js +1 -1
  826. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/remove.js +1 -1
  827. data/frameworks/sproutcore/frameworks/statechart/core.js +11 -0
  828. data/frameworks/sproutcore/frameworks/statechart/mixins/statechart.js +337 -0
  829. data/frameworks/sproutcore/frameworks/statechart/system/state.js +176 -0
  830. data/frameworks/sproutcore/frameworks/statechart/tests/basic.js +90 -0
  831. data/frameworks/sproutcore/frameworks/statechart/tests/history.js +71 -0
  832. data/frameworks/sproutcore/frameworks/statechart/tests/nested.js +59 -0
  833. data/frameworks/sproutcore/frameworks/statechart/tests/transient.js +148 -0
  834. data/frameworks/sproutcore/frameworks/table/mixins/table_delegate.js +41 -0
  835. data/frameworks/sproutcore/frameworks/table/system/table_column.js +125 -0
  836. data/frameworks/sproutcore/frameworks/table/views/table.js +438 -0
  837. data/frameworks/sproutcore/frameworks/table/views/table_cell.js +62 -0
  838. data/frameworks/sproutcore/frameworks/table/views/table_head.js +158 -0
  839. data/frameworks/sproutcore/frameworks/table/views/table_header.js +212 -0
  840. data/frameworks/sproutcore/frameworks/table/views/table_row.js +155 -0
  841. data/frameworks/sproutcore/frameworks/test +77 -0
  842. data/frameworks/sproutcore/frameworks/testing/core.js +1 -1
  843. data/frameworks/sproutcore/frameworks/testing/extras.js +1 -1
  844. data/frameworks/sproutcore/frameworks/testing/system/dump.js +1 -1
  845. data/frameworks/sproutcore/frameworks/testing/system/equiv.js +1 -1
  846. data/frameworks/sproutcore/frameworks/testing/system/plan.js +1 -1
  847. data/frameworks/sproutcore/frameworks/testing/system/runner.js +2 -2
  848. data/frameworks/sproutcore/frameworks/testing/system/suite.js +1 -1
  849. data/frameworks/sproutcore/frameworks/testing/utils.js +1 -1
  850. data/frameworks/sproutcore/lib/index.rhtml +15 -4
  851. data/frameworks/sproutcore/themes/ace/Buildfile +0 -0
  852. data/frameworks/sproutcore/themes/ace/README.md +161 -0
  853. data/frameworks/sproutcore/themes/ace/build +2 -0
  854. data/frameworks/sproutcore/themes/ace/build-d +2 -0
  855. data/frameworks/sproutcore/themes/ace/chance/README.md +113 -0
  856. data/frameworks/sproutcore/themes/ace/chance/chance.rb +203 -0
  857. data/frameworks/sproutcore/themes/ace/chance/lib/css.rb +202 -0
  858. data/frameworks/sproutcore/themes/ace/chance/lib/slicedice.rb +391 -0
  859. data/frameworks/sproutcore/themes/ace/chance/sc-theme.rb +0 -0
  860. data/frameworks/sproutcore/themes/ace/chance/scripts/setup.rb +126 -0
  861. data/frameworks/sproutcore/themes/ace/mockups/dark.png +0 -0
  862. data/frameworks/sproutcore/themes/ace/mockups/dark.psd +0 -0
  863. data/frameworks/sproutcore/themes/ace/mockups/light.png +0 -0
  864. data/frameworks/sproutcore/themes/ace/mockups/light.psd +0 -0
  865. data/frameworks/sproutcore/themes/ace/resources/images/1.png +0 -0
  866. data/frameworks/sproutcore/themes/ace/resources/images/2.png +0 -0
  867. data/frameworks/sproutcore/themes/ace/resources/images/3.png +0 -0
  868. data/frameworks/sproutcore/themes/ace/resources/theme.css +1832 -0
  869. data/frameworks/sproutcore/themes/ace/scroll_test/resources/images/1.png +0 -0
  870. data/frameworks/sproutcore/themes/ace/scroll_test/resources/images/2.png +0 -0
  871. data/frameworks/sproutcore/themes/ace/scroll_test/resources/images/3.png +0 -0
  872. data/frameworks/sproutcore/themes/ace/scroll_test/resources/theme.css +147 -0
  873. data/frameworks/sproutcore/themes/ace/scroll_test/scrollbars.html +326 -0
  874. data/frameworks/sproutcore/themes/ace/src/body.css +13 -0
  875. data/frameworks/sproutcore/themes/ace/src/collections/list.css +4 -0
  876. data/frameworks/sproutcore/themes/ace/src/collections/list_item.css +7 -0
  877. data/frameworks/sproutcore/themes/ace/src/collections/source_list/selection.png +0 -0
  878. data/frameworks/sproutcore/themes/ace/src/collections/source_list/selection.psd +0 -0
  879. data/frameworks/sproutcore/themes/ace/src/collections/source_list/source_list_view.css +37 -0
  880. data/frameworks/sproutcore/themes/ace/src/containers/container.css +3 -0
  881. data/frameworks/sproutcore/themes/ace/src/containers/masterdetail/master-detail.css +26 -0
  882. data/frameworks/sproutcore/themes/ace/src/containers/split/split.css +4 -0
  883. data/frameworks/sproutcore/themes/ace/src/containers/tab/tab.css +9 -0
  884. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button.js +23 -0
  885. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/active_button.png +0 -0
  886. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/active_button.psd +0 -0
  887. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/button_view.css +53 -0
  888. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/normal_button.png +0 -0
  889. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/normal_button.psd +0 -0
  890. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/selected_active_button.png +0 -0
  891. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/selected_active_button.psd +0 -0
  892. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/selected_button.png +0 -0
  893. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/18px/selected_button.psd +0 -0
  894. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/active_button.png +0 -0
  895. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/active_button.psd +0 -0
  896. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/active_button_capsule.png +0 -0
  897. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/active_button_capsule.psd +0 -0
  898. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/active_button_pointer.png +0 -0
  899. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/active_button_pointer.psd +0 -0
  900. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/button_view.css +144 -0
  901. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/normal_button.png +0 -0
  902. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/normal_button.psd +0 -0
  903. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/normal_button_capsule.png +0 -0
  904. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/normal_button_capsule.psd +0 -0
  905. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/normal_button_pointer.png +0 -0
  906. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/normal_button_pointer.psd +0 -0
  907. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_active_button.png +0 -0
  908. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_active_button.psd +0 -0
  909. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_active_button_capsule.png +0 -0
  910. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_active_button_capsule.psd +0 -0
  911. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_active_button_pointer.png +0 -0
  912. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_active_button_pointer.psd +0 -0
  913. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_button.png +0 -0
  914. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_button.psd +0 -0
  915. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_button_capsule.png +0 -0
  916. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_button_capsule.psd +0 -0
  917. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_button_pointer.png +0 -0
  918. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/24px/selected_button_pointer.psd +0 -0
  919. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/active_button.png +0 -0
  920. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/active_button.psd +0 -0
  921. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/active_button_pointer.png +0 -0
  922. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/active_button_pointer.psd +0 -0
  923. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/button_view_30.css +111 -0
  924. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/normal_button.png +0 -0
  925. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/normal_button.psd +0 -0
  926. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/normal_button_pointer.png +0 -0
  927. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/normal_button_pointer.psd +0 -0
  928. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_active_button.png +0 -0
  929. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_active_button.psd +0 -0
  930. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_active_button_pointer.png +0 -0
  931. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_active_button_pointer.psd +0 -0
  932. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_button.png +0 -0
  933. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_button.psd +0 -0
  934. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_button_pointer.png +0 -0
  935. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/30px/selected_button_pointer.psd +0 -0
  936. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/active_button.png +0 -0
  937. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/active_button.psd +0 -0
  938. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/button_view.css +57 -0
  939. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/normal_button.png +0 -0
  940. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/normal_button.psd +0 -0
  941. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/selected_active_button.png +0 -0
  942. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/selected_active_button.psd +0 -0
  943. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/selected_button.png +0 -0
  944. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/44px/selected_button.psd +0 -0
  945. data/frameworks/sproutcore/themes/ace/src/controls/buttons/button_view/button_view.css +56 -0
  946. data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_closed.png +0 -0
  947. data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_closed.psd +0 -0
  948. data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_closed_active.png +0 -0
  949. data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_closed_active.psd +0 -0
  950. data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_open.png +0 -0
  951. data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_open.psd +0 -0
  952. data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_open_active.png +0 -0
  953. data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_open_active.psd +0 -0
  954. data/frameworks/sproutcore/themes/ace/src/controls/buttons/disclosure_view/disclosure_view.css +64 -0
  955. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox.css +25 -0
  956. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_checked.png +0 -0
  957. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_checked.psd +0 -0
  958. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_checked_active.png +0 -0
  959. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_checked_active.psd +0 -0
  960. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_mixed.png +0 -0
  961. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_mixed.psd +0 -0
  962. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_mixed_active.png +0 -0
  963. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_mixed_active.psd +0 -0
  964. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_unchecked.png +0 -0
  965. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_unchecked.psd +0 -0
  966. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_unchecked_active.png +0 -0
  967. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/14px/checkbox_unchecked_active.psd +0 -0
  968. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox.css +25 -0
  969. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_checked.png +0 -0
  970. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_checked.psd +0 -0
  971. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_checked_active.png +0 -0
  972. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_checked_active.psd +0 -0
  973. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_mixed.png +0 -0
  974. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_mixed.psd +0 -0
  975. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_mixed_active.png +0 -0
  976. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_mixed_active.psd +0 -0
  977. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_unchecked.png +0 -0
  978. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_unchecked.psd +0 -0
  979. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_unchecked_active.png +0 -0
  980. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/16px/checkbox_unchecked_active.psd +0 -0
  981. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/checkbox.css +4 -0
  982. data/frameworks/sproutcore/themes/ace/src/controls/checkboxes/checkbox_control.css +31 -0
  983. data/frameworks/sproutcore/themes/ace/src/controls/progress/progress_view/progress_view.css +70 -0
  984. data/frameworks/sproutcore/themes/ace/src/controls/progress/progress_view/progress_view_content.png +0 -0
  985. data/frameworks/sproutcore/themes/ace/src/controls/progress/progress_view/progress_view_content.psd +0 -0
  986. data/frameworks/sproutcore/themes/ace/src/controls/progress/progress_view/progress_view_indeterminate_content.psd +0 -0
  987. data/frameworks/sproutcore/themes/ace/src/controls/progress/progress_view/progress_view_track.png +0 -0
  988. data/frameworks/sproutcore/themes/ace/src/controls/progress/progress_view/progress_view_track.psd +0 -0
  989. data/frameworks/sproutcore/themes/ace/src/controls/radio/radio.css +61 -0
  990. data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_active.png +0 -0
  991. data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_active.psd +0 -0
  992. data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_mixed.png +0 -0
  993. data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_mixed.psd +0 -0
  994. data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_mixed_active.png +0 -0
  995. data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_mixed_active.psd +0 -0
  996. data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_selected.png +0 -0
  997. data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_selected.psd +0 -0
  998. data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_selected_active.png +0 -0
  999. data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_selected_active.psd +0 -0
  1000. data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_unselected.png +0 -0
  1001. data/frameworks/sproutcore/themes/ace/src/controls/radio/radio_unselected.psd +0 -0
  1002. data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/horizontal.css +77 -0
  1003. data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/thumb.png +0 -0
  1004. data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/thumb.psd +0 -0
  1005. data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/track_and_arrows.png +0 -0
  1006. data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/track_and_arrows.psd +0 -0
  1007. data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/track_and_arrows_active.png +0 -0
  1008. data/frameworks/sproutcore/themes/ace/src/controls/scroll/horizontal/track_and_arrows_active.psd +0 -0
  1009. data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical.psd +0 -0
  1010. data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/thumb.png +0 -0
  1011. data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/thumb.psd +0 -0
  1012. data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/track_and_arrows.png +0 -0
  1013. data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/track_and_arrows.psd +0 -0
  1014. data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/track_and_arrows_active.png +0 -0
  1015. data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/track_and_arrows_active.psd +0 -0
  1016. data/frameworks/sproutcore/themes/ace/src/controls/scroll/vertical/vertical.css +74 -0
  1017. data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented.css +92 -0
  1018. data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_active.png +0 -0
  1019. data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_active.psd +0 -0
  1020. data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_normal.png +0 -0
  1021. data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_normal.psd +0 -0
  1022. data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_selected.png +0 -0
  1023. data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_selected.psd +0 -0
  1024. data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_selected_active.png +0 -0
  1025. data/frameworks/sproutcore/themes/ace/src/controls/segmented/18px/segmented_selected_active.psd +0 -0
  1026. data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented.css +87 -0
  1027. data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_active.png +0 -0
  1028. data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_active.psd +0 -0
  1029. data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_normal.png +0 -0
  1030. data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_normal.psd +0 -0
  1031. data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_selected.png +0 -0
  1032. data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_selected.psd +0 -0
  1033. data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_selected_active.png +0 -0
  1034. data/frameworks/sproutcore/themes/ace/src/controls/segmented/24px/segmented_selected_active.psd +0 -0
  1035. data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented.css +93 -0
  1036. data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_active.png +0 -0
  1037. data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_active.psd +0 -0
  1038. data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_normal.png +0 -0
  1039. data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_normal.psd +0 -0
  1040. data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_selected.png +0 -0
  1041. data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_selected.psd +0 -0
  1042. data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_selected_active.png +0 -0
  1043. data/frameworks/sproutcore/themes/ace/src/controls/segmented/30px/segmented_selected_active.psd +0 -0
  1044. data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented.css +101 -0
  1045. data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_active.png +0 -0
  1046. data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_active.psd +0 -0
  1047. data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_normal.png +0 -0
  1048. data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_normal.psd +0 -0
  1049. data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_selected.png +0 -0
  1050. data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_selected.psd +0 -0
  1051. data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_selected_active.png +0 -0
  1052. data/frameworks/sproutcore/themes/ace/src/controls/segmented/44px/segmented_selected_active.psd +0 -0
  1053. data/frameworks/sproutcore/themes/ace/src/controls/segmented/segmented.css +73 -0
  1054. data/frameworks/sproutcore/themes/ace/src/controls/segmented/segmented.js +0 -0
  1055. data/frameworks/sproutcore/themes/ace/src/controls/select/active_select.png +0 -0
  1056. data/frameworks/sproutcore/themes/ace/src/controls/select/active_select.psd +0 -0
  1057. data/frameworks/sproutcore/themes/ace/src/controls/select/menu.png +0 -0
  1058. data/frameworks/sproutcore/themes/ace/src/controls/select/normal_select.png +0 -0
  1059. data/frameworks/sproutcore/themes/ace/src/controls/select/normal_select.psd +0 -0
  1060. data/frameworks/sproutcore/themes/ace/src/controls/select/select.css +45 -0
  1061. data/frameworks/sproutcore/themes/ace/src/controls/slider/14px/knob.png +0 -0
  1062. data/frameworks/sproutcore/themes/ace/src/controls/slider/14px/knob.psd +0 -0
  1063. data/frameworks/sproutcore/themes/ace/src/controls/slider/14px/knob_active.png +0 -0
  1064. data/frameworks/sproutcore/themes/ace/src/controls/slider/14px/knob_active.psd +0 -0
  1065. data/frameworks/sproutcore/themes/ace/src/controls/slider/14px/slider.css +43 -0
  1066. data/frameworks/sproutcore/themes/ace/src/controls/slider/16px/knob.png +0 -0
  1067. data/frameworks/sproutcore/themes/ace/src/controls/slider/16px/knob.psd +0 -0
  1068. data/frameworks/sproutcore/themes/ace/src/controls/slider/16px/knob_active.png +0 -0
  1069. data/frameworks/sproutcore/themes/ace/src/controls/slider/16px/knob_active.psd +0 -0
  1070. data/frameworks/sproutcore/themes/ace/src/controls/slider/16px/slider.css +44 -0
  1071. data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/knob.png +0 -0
  1072. data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/knob.psd +0 -0
  1073. data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/knob_active.png +0 -0
  1074. data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/knob_active.psd +0 -0
  1075. data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/slider.css +44 -0
  1076. data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/track.png +0 -0
  1077. data/frameworks/sproutcore/themes/ace/src/controls/slider/22px/track.psd +0 -0
  1078. data/frameworks/sproutcore/themes/ace/src/controls/slider/slider.css +3 -0
  1079. data/frameworks/sproutcore/themes/ace/src/controls/slider/slider.js +27 -0
  1080. data/frameworks/sproutcore/themes/ace/src/controls/slider/track.png +0 -0
  1081. data/frameworks/sproutcore/themes/ace/src/controls/slider/track.psd +0 -0
  1082. data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch.psd +0 -0
  1083. data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch_handle.png +0 -0
  1084. data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch_handle.psd +0 -0
  1085. data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch_off.png +0 -0
  1086. data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch_off.psd +0 -0
  1087. data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch_on.png +0 -0
  1088. data/frameworks/sproutcore/themes/ace/src/controls/switch/24px/switch_on.psd +0 -0
  1089. data/frameworks/sproutcore/themes/ace/src/core/loading.css +50 -0
  1090. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/active_button.png +0 -0
  1091. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/active_button.psd +0 -0
  1092. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/active_button_capsule.png +0 -0
  1093. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/active_button_capsule.psd +0 -0
  1094. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/active_button_pointer.png +0 -0
  1095. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/active_button_pointer.psd +0 -0
  1096. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/button_view.css +142 -0
  1097. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/normal_button.png +0 -0
  1098. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/normal_button.psd +0 -0
  1099. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/normal_button_capsule.png +0 -0
  1100. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/normal_button_capsule.psd +0 -0
  1101. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/normal_button_pointer.png +0 -0
  1102. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/normal_button_pointer.psd +0 -0
  1103. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_active_button.png +0 -0
  1104. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_active_button.psd +0 -0
  1105. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_active_button_capsule.png +0 -0
  1106. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_active_button_capsule.psd +0 -0
  1107. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_active_button_pointer.png +0 -0
  1108. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_active_button_pointer.psd +0 -0
  1109. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_button.png +0 -0
  1110. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_button.psd +0 -0
  1111. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_button_capsule.png +0 -0
  1112. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_button_capsule.psd +0 -0
  1113. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_button_pointer.png +0 -0
  1114. data/frameworks/sproutcore/themes/ace/src/dark/buttons/24px/selected_button_pointer.psd +0 -0
  1115. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/active_button.png +0 -0
  1116. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/active_button.psd +0 -0
  1117. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/active_button_pointer.png +0 -0
  1118. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/active_button_pointer.psd +0 -0
  1119. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/button_view_30.css +111 -0
  1120. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/normal_button.png +0 -0
  1121. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/normal_button.psd +0 -0
  1122. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/normal_button_pointer.png +0 -0
  1123. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/normal_button_pointer.psd +0 -0
  1124. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_active_button.png +0 -0
  1125. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_active_button.psd +0 -0
  1126. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_active_button_pointer.png +0 -0
  1127. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_active_button_pointer.psd +0 -0
  1128. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_button.png +0 -0
  1129. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_button.psd +0 -0
  1130. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_button_pointer.png +0 -0
  1131. data/frameworks/sproutcore/themes/ace/src/dark/buttons/30px/selected_button_pointer.psd +0 -0
  1132. data/frameworks/sproutcore/themes/ace/src/dark/buttons/button.css +20 -0
  1133. data/frameworks/sproutcore/themes/ace/src/dark/buttons/button.js +3 -0
  1134. data/frameworks/sproutcore/themes/ace/src/form/iphone/form.js +21 -0
  1135. data/frameworks/sproutcore/themes/ace/src/form/iphone/form_row.js +24 -0
  1136. data/frameworks/sproutcore/themes/ace/src/form/iphone/iphone.css +51 -0
  1137. data/frameworks/sproutcore/themes/ace/src/form/iphone/iphone.js +14 -0
  1138. data/frameworks/sproutcore/themes/ace/src/form/iphone/label.js +32 -0
  1139. data/frameworks/sproutcore/themes/ace/src/panels/pane.css +3 -0
  1140. data/frameworks/sproutcore/themes/ace/src/panels/panel.css +70 -0
  1141. data/frameworks/sproutcore/themes/ace/src/panels/panel.png +0 -0
  1142. data/frameworks/sproutcore/themes/ace/src/panels/panel.psd +0 -0
  1143. data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/checkmark.png +0 -0
  1144. data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/checkmark.psd +0 -0
  1145. data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/checkmark_active.png +0 -0
  1146. data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/checkmark_active.psd +0 -0
  1147. data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/down.png +0 -0
  1148. data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/down.psd +0 -0
  1149. data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/menu.css +154 -0
  1150. data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/menu.png +0 -0
  1151. data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/menu.psd +0 -0
  1152. data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/menu_item.png +0 -0
  1153. data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/menu_item.psd +0 -0
  1154. data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/up.png +0 -0
  1155. data/frameworks/sproutcore/themes/ace/src/panels/picker/menu/up.psd +0 -0
  1156. data/frameworks/sproutcore/themes/ace/src/panels/picker/picker.css +0 -0
  1157. data/frameworks/sproutcore/themes/ace/src/panels/picker/picker.js +1 -0
  1158. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/picker.js +14 -0
  1159. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover.css +271 -0
  1160. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover.js +5 -0
  1161. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover.png +0 -0
  1162. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover.psd +0 -0
  1163. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_empty.png +0 -0
  1164. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_empty.psd +0 -0
  1165. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_notoolbar.png +0 -0
  1166. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_notoolbar.psd +0 -0
  1167. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_pointers.png +0 -0
  1168. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_pointers.psd +0 -0
  1169. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_pointers_notoolbar.png +0 -0
  1170. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_pointers_notoolbar.psd +0 -0
  1171. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/popover_sourcelist.css +5 -0
  1172. data/frameworks/sproutcore/themes/ace/src/panels/picker/popover/workspace.js +51 -0
  1173. data/frameworks/sproutcore/themes/ace/src/theme.js +12 -0
  1174. data/frameworks/sproutcore/themes/ace/src/toolbars/normal/selection.png +0 -0
  1175. data/frameworks/sproutcore/themes/ace/src/toolbars/normal/toolbar.css +8 -0
  1176. data/frameworks/sproutcore/themes/ace/src/toolbars/normal/toolbar.png +0 -0
  1177. data/frameworks/sproutcore/themes/ace/src/toolbars/normal/toolbar.psd +0 -0
  1178. data/frameworks/sproutcore/themes/ace/src/toolbars/panel_header/panel_header.png +0 -0
  1179. data/frameworks/sproutcore/themes/ace/src/toolbars/panel_header/panel_header.psd +0 -0
  1180. data/frameworks/sproutcore/themes/empty_theme/theme.js +16 -0
  1181. data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x.psd +0 -0
  1182. data/frameworks/sproutcore/themes/standard_theme/english.lproj/button.css +75 -2
  1183. data/frameworks/sproutcore/themes/standard_theme/english.lproj/checkbox.css +0 -16
  1184. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-scroller-repeat-x.png +0 -0
  1185. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-scroller-repeat-y.png +0 -0
  1186. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-scroller-sprite.png +0 -0
  1187. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-repeat-x.png +0 -0
  1188. data/frameworks/sproutcore/themes/standard_theme/english.lproj/menu_item_view.css +26 -2
  1189. data/frameworks/sproutcore/themes/standard_theme/english.lproj/radio.css +0 -29
  1190. data/frameworks/sproutcore/themes/standard_theme/english.lproj/scroller.css +155 -0
  1191. data/frameworks/sproutcore/themes/standard_theme/english.lproj/segmented.css +64 -69
  1192. data/frameworks/sproutcore/themes/standard_theme/english.lproj/split_view.css +2 -18
  1193. data/frameworks/sproutcore/themes/standard_theme/english.lproj/tab.css +0 -1
  1194. data/frameworks/sproutcore/themes/standard_theme/english.lproj/table.css +14 -0
  1195. data/gen/responder/Buildfile +18 -0
  1196. data/gen/responder/README +1 -0
  1197. data/gen/responder/USAGE +15 -0
  1198. data/gen/responder/templates/states/@filename@.js +39 -0
  1199. data/{Buildfile → lib/Buildfile} +37 -34
  1200. data/lib/buildtasks/build.rake +103 -0
  1201. data/{buildtasks → lib/buildtasks}/entry.rake +40 -34
  1202. data/{buildtasks → lib/buildtasks}/manifest.rake +285 -239
  1203. data/{buildtasks → lib/buildtasks}/render.rake +5 -5
  1204. data/lib/buildtasks/target.rake +65 -0
  1205. data/lib/sproutcore.rb +58 -53
  1206. data/lib/sproutcore/builders.rb +12 -0
  1207. data/lib/sproutcore/builders/base.rb +19 -20
  1208. data/lib/sproutcore/builders/bundle.rb +17 -17
  1209. data/lib/sproutcore/builders/combine.rb +14 -14
  1210. data/lib/sproutcore/builders/html.rb +68 -62
  1211. data/lib/sproutcore/builders/javascript.rb +40 -26
  1212. data/lib/sproutcore/builders/less.rb +41 -0
  1213. data/lib/sproutcore/builders/minify.rb +20 -25
  1214. data/lib/sproutcore/builders/sass.rb +20 -10
  1215. data/lib/sproutcore/builders/strings.rb +11 -10
  1216. data/lib/sproutcore/builders/stylesheet.rb +28 -12
  1217. data/lib/sproutcore/builders/test.rb +19 -19
  1218. data/lib/sproutcore/builders/test_index.rb +6 -6
  1219. data/lib/sproutcore/buildfile.rb +120 -114
  1220. data/lib/sproutcore/buildfile/build_task.rb +5 -5
  1221. data/lib/sproutcore/buildfile/buildfile_dsl.rb +22 -15
  1222. data/lib/sproutcore/buildfile/cloneable.rb +3 -3
  1223. data/lib/sproutcore/buildfile/early_time.rb +2 -2
  1224. data/lib/sproutcore/buildfile/invocation_chain.rb +3 -3
  1225. data/lib/sproutcore/buildfile/namespace.rb +3 -3
  1226. data/lib/sproutcore/buildfile/string_ext.rb +5 -1
  1227. data/lib/sproutcore/buildfile/task.rb +49 -48
  1228. data/lib/sproutcore/buildfile/task_arguments.rb +28 -8
  1229. data/lib/sproutcore/buildfile/task_manager.rb +19 -17
  1230. data/lib/sproutcore/deprecated/view_helper.rb +2 -2
  1231. data/lib/sproutcore/helpers.rb +11 -0
  1232. data/lib/sproutcore/helpers/cssmin.rb +24 -24
  1233. data/lib/sproutcore/helpers/dom_id_helper.rb +1 -1
  1234. data/lib/sproutcore/helpers/entry_sorter.rb +51 -75
  1235. data/lib/sproutcore/helpers/html5_manifest.rb +88 -0
  1236. data/lib/sproutcore/helpers/packed_optimizer.rb +20 -20
  1237. data/lib/sproutcore/helpers/static_helper.rb +79 -79
  1238. data/lib/sproutcore/helpers/tag_helper.rb +10 -10
  1239. data/lib/sproutcore/helpers/text_helper.rb +2 -2
  1240. data/lib/sproutcore/models.rb +8 -0
  1241. data/lib/sproutcore/models/generator.rb +92 -92
  1242. data/lib/sproutcore/models/hash_struct.rb +42 -27
  1243. data/lib/sproutcore/models/manifest.rb +123 -117
  1244. data/lib/sproutcore/models/manifest_entry.rb +123 -105
  1245. data/lib/sproutcore/models/project.rb +54 -54
  1246. data/lib/sproutcore/models/target.rb +212 -200
  1247. data/lib/sproutcore/rack.rb +7 -0
  1248. data/lib/sproutcore/rack/builder.rb +89 -84
  1249. data/lib/sproutcore/rack/dev.rb +55 -14
  1250. data/lib/sproutcore/rack/docs.rb +4 -4
  1251. data/lib/sproutcore/rack/filesystem.rb +118 -59
  1252. data/lib/sproutcore/rack/proxy.rb +36 -34
  1253. data/lib/sproutcore/rack/service.rb +36 -34
  1254. data/lib/sproutcore/rack/test_runner.rb +4 -4
  1255. data/lib/sproutcore/render_engines/erubis.rb +2 -2
  1256. data/lib/sproutcore/render_engines/haml.rb +2 -2
  1257. data/lib/sproutcore/tools.rb +102 -98
  1258. data/lib/sproutcore/tools/build.rb +27 -22
  1259. data/lib/sproutcore/tools/build_number.rb +3 -3
  1260. data/lib/sproutcore/tools/docs.rb +4 -4
  1261. data/lib/sproutcore/tools/gen.rb +24 -24
  1262. data/lib/sproutcore/tools/init.rb +7 -7
  1263. data/lib/sproutcore/tools/manifest.rb +13 -13
  1264. data/lib/sproutcore/tools/server.rb +11 -11
  1265. data/{vendor → lib/sproutcore/vendor}/github_gem_lint.rb +0 -0
  1266. data/{vendor → lib/sproutcore/vendor}/jsdoc/README.txt +0 -0
  1267. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame.js +0 -0
  1268. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Chain.js +0 -0
  1269. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Dumper.js +0 -0
  1270. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Hash.js +0 -0
  1271. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Link.js +0 -0
  1272. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Namespace.js +0 -0
  1273. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Opt.js +0 -0
  1274. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Reflection.js +0 -0
  1275. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/String.js +0 -0
  1276. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/frame/Testrun.js +0 -0
  1277. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/handlers/FOODOC.js +0 -0
  1278. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/handlers/XMLDOC.js +0 -0
  1279. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/handlers/XMLDOC/DomReader.js +0 -0
  1280. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/handlers/XMLDOC/XMLDoc.js +0 -0
  1281. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/handlers/XMLDOC/XMLParse.js +0 -0
  1282. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC.js +0 -0
  1283. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/DocComment.js +0 -0
  1284. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/DocTag.js +0 -0
  1285. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/JsDoc.js +0 -0
  1286. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/JsPlate.js +0 -0
  1287. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/Lang.js +0 -0
  1288. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/Parser.js +0 -0
  1289. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/PluginManager.js +0 -0
  1290. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/Symbol.js +0 -0
  1291. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/SymbolSet.js +0 -0
  1292. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/TextStream.js +0 -0
  1293. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/Token.js +0 -0
  1294. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/TokenReader.js +0 -0
  1295. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/TokenStream.js +0 -0
  1296. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/Util.js +0 -0
  1297. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/lib/JSDOC/Walker.js +0 -0
  1298. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/main.js +0 -0
  1299. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/commentSrcJson.js +0 -0
  1300. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/frameworkPrototype.js +0 -0
  1301. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/functionCall.js +0 -0
  1302. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/publishSrcHilite.js +0 -0
  1303. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/sproutcoreTags.js +0 -0
  1304. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/symbolLink.js +0 -0
  1305. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/tagParamConfig.js +0 -0
  1306. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/plugins/tagSynonyms.js +0 -0
  1307. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/run.js +0 -0
  1308. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/t/TestDoc.js +0 -0
  1309. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/t/runner.js +0 -0
  1310. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test.js +0 -0
  1311. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/addon.js +0 -0
  1312. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/anon_inner.js +0 -0
  1313. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/augments.js +0 -0
  1314. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/augments2.js +0 -0
  1315. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/borrows.js +0 -0
  1316. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/borrows2.js +0 -0
  1317. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/config.js +0 -0
  1318. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/constructs.js +0 -0
  1319. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/encoding.js +0 -0
  1320. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/encoding_other.js +0 -0
  1321. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/functions_anon.js +0 -0
  1322. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/functions_nested.js +0 -0
  1323. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/global.js +0 -0
  1324. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/globals.js +0 -0
  1325. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/ignore.js +0 -0
  1326. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/inner.js +0 -0
  1327. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/jsdoc_test.js +0 -0
  1328. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/lend.js +0 -0
  1329. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/memberof.js +0 -0
  1330. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/memberof_constructor.js +0 -0
  1331. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/name.js +0 -0
  1332. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/namespace_nested.js +0 -0
  1333. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/nocode.js +0 -0
  1334. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/oblit_anon.js +0 -0
  1335. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/overview.js +0 -0
  1336. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/param_inline.js +0 -0
  1337. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/params_optional.js +0 -0
  1338. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/prototype.js +0 -0
  1339. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/prototype_nested.js +0 -0
  1340. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/prototype_oblit.js +0 -0
  1341. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/prototype_oblit_constructor.js +0 -0
  1342. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/public.js +0 -0
  1343. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/shared.js +0 -0
  1344. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/shared2.js +0 -0
  1345. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/shortcuts.js +0 -0
  1346. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/static_this.js +0 -0
  1347. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/synonyms.js +0 -0
  1348. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/tosource.js +0 -0
  1349. data/{vendor → lib/sproutcore/vendor}/jsdoc/app/test/variable_redefine.js +0 -0
  1350. data/{vendor → lib/sproutcore/vendor}/jsdoc/changes.txt +0 -0
  1351. data/{vendor → lib/sproutcore/vendor}/jsdoc/conf/sample.conf +0 -0
  1352. data/{vendor → lib/sproutcore/vendor}/jsdoc/java/build.xml +0 -0
  1353. data/{vendor → lib/sproutcore/vendor}/jsdoc/java/build_1.4.xml +0 -0
  1354. data/{vendor → lib/sproutcore/vendor}/jsdoc/java/classes/js.jar +0 -0
  1355. data/{vendor → lib/sproutcore/vendor}/jsdoc/java/src/JsDebugRun.java +0 -0
  1356. data/{vendor → lib/sproutcore/vendor}/jsdoc/java/src/JsRun.java +0 -0
  1357. data/{vendor → lib/sproutcore/vendor}/jsdoc/jsdebug.jar +0 -0
  1358. data/{vendor → lib/sproutcore/vendor}/jsdoc/jsrun.jar +0 -0
  1359. data/{vendor → lib/sproutcore/vendor}/jsdoc/t/TestDoc.js +0 -0
  1360. data/{vendor → lib/sproutcore/vendor}/jsdoc/t/runner.js +0 -0
  1361. data/{vendor → lib/sproutcore/vendor}/jsdoc/test.js +0 -0
  1362. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/addon.js +0 -0
  1363. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/anon_inner.js +0 -0
  1364. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/augments.js +0 -0
  1365. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/augments2.js +0 -0
  1366. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/borrows.js +0 -0
  1367. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/borrows2.js +0 -0
  1368. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/config.js +0 -0
  1369. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/constructs.js +0 -0
  1370. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/encoding.js +0 -0
  1371. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/encoding_other.js +0 -0
  1372. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/functions_anon.js +0 -0
  1373. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/functions_nested.js +0 -0
  1374. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/global.js +0 -0
  1375. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/globals.js +0 -0
  1376. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/ignore.js +0 -0
  1377. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/inner.js +0 -0
  1378. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/jsdoc_test.js +0 -0
  1379. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/lend.js +0 -0
  1380. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/memberof.js +0 -0
  1381. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/memberof_constructor.js +0 -0
  1382. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/name.js +0 -0
  1383. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/namespace_nested.js +0 -0
  1384. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/nocode.js +0 -0
  1385. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/oblit_anon.js +0 -0
  1386. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/overview.js +0 -0
  1387. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/param_inline.js +0 -0
  1388. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/params_optional.js +0 -0
  1389. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/prototype.js +0 -0
  1390. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/prototype_nested.js +0 -0
  1391. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/prototype_oblit.js +0 -0
  1392. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/prototype_oblit_constructor.js +0 -0
  1393. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/public.js +0 -0
  1394. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/shared.js +0 -0
  1395. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/shared2.js +0 -0
  1396. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/shortcuts.js +0 -0
  1397. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/static_this.js +0 -0
  1398. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/synonyms.js +0 -0
  1399. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/tosource.js +0 -0
  1400. data/{vendor → lib/sproutcore/vendor}/jsdoc/test/variable_redefine.js +0 -0
  1401. data/{vendor → lib/sproutcore/vendor}/yui-compressor/SCyuicompressor-2.4.2.jar +0 -0
  1402. data/{vendor → lib/sproutcore/vendor}/yui-compressor/yuicompressor-2.4.2.jar +0 -0
  1403. data/lib/sproutcore/version.rb +11 -0
  1404. data/spec/buildtasks/build/copy_spec.rb +16 -16
  1405. data/spec/buildtasks/build/spec_helper.rb +5 -5
  1406. data/spec/buildtasks/manifest/catalog_spec.rb +9 -9
  1407. data/spec/buildtasks/manifest/hide_buildfiles_spec.rb +15 -15
  1408. data/spec/buildtasks/manifest/localize_spec.rb +14 -14
  1409. data/spec/buildtasks/manifest/prepare_build_tasks/bundle_spec.rb +61 -61
  1410. data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +52 -44
  1411. data/spec/buildtasks/manifest/prepare_build_tasks/css_spec.rb +13 -13
  1412. data/spec/buildtasks/manifest/prepare_build_tasks/html_spec.rb +29 -29
  1413. data/spec/buildtasks/manifest/prepare_build_tasks/javascript_spec.rb +11 -11
  1414. data/spec/buildtasks/manifest/prepare_build_tasks/minify_spec.rb +9 -9
  1415. data/spec/buildtasks/manifest/prepare_build_tasks/packed_spec.rb +23 -23
  1416. data/spec/buildtasks/manifest/prepare_build_tasks/sass_spec.rb +15 -15
  1417. data/spec/buildtasks/manifest/prepare_build_tasks/strings_spec.rb +11 -11
  1418. data/spec/buildtasks/manifest/prepare_build_tasks/tests_spec.rb +28 -28
  1419. data/spec/buildtasks/manifest/prepare_spec.rb +7 -7
  1420. data/spec/buildtasks/manifest/spec_helper.rb +6 -6
  1421. data/spec/buildtasks/target_spec.rb +33 -33
  1422. data/spec/fixtures/builder_tests/apps/less_test/sample.less +4 -0
  1423. data/spec/fixtures/builder_tests/apps/sass_test/sample.sass +1 -0
  1424. data/spec/fixtures/builder_tests/apps/sass_test/sample.scss +4 -0
  1425. data/spec/fixtures/buildfiles/basic/Buildfile +0 -5
  1426. data/spec/fixtures/buildfiles/installed/Buildfile +0 -2
  1427. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo3.scss +0 -0
  1428. data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo4.less +0 -0
  1429. data/spec/fixtures/real_world/generators/sample_custom/templates/{filename}.js +1 -0
  1430. data/spec/lib/builders/bundle_spec.rb +79 -78
  1431. data/spec/lib/builders/combine_spec.rb +10 -10
  1432. data/spec/lib/builders/html_spec.rb +134 -133
  1433. data/spec/lib/builders/javascript_spec.rb +11 -10
  1434. data/spec/lib/builders/less_spec.rb +51 -0
  1435. data/spec/lib/builders/sass_spec.rb +38 -9
  1436. data/spec/lib/builders/spec_helper.rb +8 -8
  1437. data/spec/lib/builders/strings_spec.rb +14 -11
  1438. data/spec/lib/builders/stylesheet_spec.rb +9 -8
  1439. data/spec/lib/builders/test_index_spec.rb +10 -9
  1440. data/spec/lib/builders/test_spec.rb +36 -35
  1441. data/spec/lib/buildfile/config_for_spec.rb +15 -15
  1442. data/spec/lib/buildfile/define_spec.rb +14 -14
  1443. data/spec/lib/buildfile/dup_spec.rb +19 -19
  1444. data/spec/lib/buildfile/invoke_spec.rb +38 -33
  1445. data/spec/lib/buildfile/load_spec.rb +21 -19
  1446. data/spec/lib/buildfile/task/dup_spec.rb +14 -14
  1447. data/spec/lib/buildfile/task_defined_spec.rb +3 -3
  1448. data/spec/lib/buildfile_commands/build_task_spec.rb +3 -3
  1449. data/spec/lib/buildfile_commands/config_spec.rb +40 -40
  1450. data/spec/lib/buildfile_commands/import_spec.rb +2 -2
  1451. data/spec/lib/buildfile_commands/namespace_spec.rb +3 -3
  1452. data/spec/lib/buildfile_commands/proxies_spec.rb +12 -12
  1453. data/spec/lib/buildfile_commands/replace_task_spec.rb +7 -7
  1454. data/spec/lib/buildfile_commands/task_spec.rb +6 -6
  1455. data/spec/lib/helpers/packing_optimizer/optimize_spec.rb +5 -5
  1456. data/spec/lib/models/hash_struct/deep_clone_spec.rb +8 -8
  1457. data/spec/lib/models/hash_struct/has_options_spec.rb +10 -10
  1458. data/spec/lib/models/hash_struct/hash_spec.rb +17 -19
  1459. data/spec/lib/models/hash_struct/merge_spec.rb +4 -4
  1460. data/spec/lib/models/hash_struct/method_missing.rb +9 -9
  1461. data/spec/lib/models/manifest/add_entry_spec.rb +7 -7
  1462. data/spec/lib/models/manifest/add_transform_spec.rb +17 -15
  1463. data/spec/lib/models/manifest/build_spec.rb +19 -19
  1464. data/spec/lib/models/manifest/entry_for_spec.rb +30 -30
  1465. data/spec/lib/models/manifest/find_entry.rb +20 -20
  1466. data/spec/lib/models/manifest/prepare_spec.rb +13 -13
  1467. data/spec/lib/models/manifest_entry/cacheable_url_spec.rb +8 -8
  1468. data/spec/lib/models/manifest_entry/hyperdomain_prefix.rb +9 -9
  1469. data/spec/lib/models/manifest_entry/prepare_spec.rb +11 -11
  1470. data/spec/lib/models/project/add_target_spec.rb +7 -7
  1471. data/spec/lib/models/project/buildfile_spec.rb +4 -4
  1472. data/spec/lib/models/project/find_targets_for_spec.rb +17 -17
  1473. data/spec/lib/models/project/load_nearest_project_spec.rb +10 -10
  1474. data/spec/lib/models/project/target_for_spec.rb +6 -6
  1475. data/spec/lib/models/project/targets_spec.rb +13 -13
  1476. data/spec/lib/models/target/compute_build_number_spec.rb +24 -23
  1477. data/spec/lib/models/target/config_spec.rb +6 -6
  1478. data/spec/lib/models/target/expand_required_targets_spec.rb +14 -14
  1479. data/spec/lib/models/target/installed_languages_spec.rb +12 -12
  1480. data/spec/lib/models/target/lproj_for_spec.rb +9 -9
  1481. data/spec/lib/models/target/manifest_for_spec.rb +8 -8
  1482. data/spec/lib/models/target/parent_target_spec.rb +3 -3
  1483. data/spec/lib/models/target/prepare_spec.rb +11 -11
  1484. data/spec/lib/models/target/required_targets_spec.rb +28 -28
  1485. data/spec/lib/models/target/target_for_spec.rb +5 -5
  1486. data/spec/lib/tools/build_number_spec.rb +9 -9
  1487. data/spec/lib/tools/gen_spec.rb +34 -33
  1488. data/spec/lib/tools/tools_spec.rb +20 -19
  1489. data/spec/spec_helper.rb +28 -40
  1490. data/sproutcore.gemspec +33 -0
  1491. metadata +1741 -1056
  1492. data/buildtasks/build.rake +0 -87
  1493. data/buildtasks/target.rake +0 -61
  1494. data/frameworks/sproutcore/README +0 -64
  1495. data/frameworks/sproutcore/frameworks/desktop/english.lproj/scroller.css +0 -26
  1496. data/frameworks/sproutcore/frameworks/desktop/system/root_responder.js +0 -702
  1497. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/methods.js +0 -72
  1498. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/ui.js +0 -71
@@ -2,13 +2,14 @@
2
2
  // Project: SproutCore - JavaScript Application Framework
3
3
  // Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
4
4
  // Portions ©2008-2009 Apple Inc. All rights reserved.
5
- // License: Licened under MIT license (see license.js)
5
+ // License: Licensed under MIT license (see license.js)
6
6
  // ==========================================================================
7
7
 
8
8
  sc_require('system/browser');
9
9
  sc_require('system/event');
10
10
  sc_require('system/cursor');
11
11
  sc_require('system/responder') ;
12
+ sc_require('system/theme');
12
13
 
13
14
  sc_require('mixins/string') ;
14
15
 
@@ -75,14 +76,49 @@ SC.ANCHOR_CENTER = { centerX: 0, centerY: 0 };
75
76
 
76
77
  SC.LAYOUT_AUTO = 'auto';
77
78
 
79
+ /**
80
+ Default property to disable or enable by default the contextMenu
81
+ */
82
+ SC.CONTEXT_MENU_ENABLED = NO;
83
+
84
+ /**
85
+ Default property to disable or enable if the focus can jump to the address
86
+ bar or not.
87
+ */
88
+ SC.TABBING_ONLY_INSIDE_DOCUMENT = YES;
89
+
90
+ /**
91
+ Tells the property (when fetched with themed()) to get its value from the renderer (if any).
92
+ */
93
+ SC.FROM_THEME = "__FROM_THEME__"; // doesn't really matter what it is, so long as it is unique. Readability is a plus.
94
+
78
95
  /** @private - custom array used for child views */
79
96
  SC.EMPTY_CHILD_VIEWS_ARRAY = [];
80
97
  SC.EMPTY_CHILD_VIEWS_ARRAY.needsClone = YES;
81
98
 
99
+ /**
100
+ Map to CSS Transforms
101
+ */
102
+ SC.CSS_TRANSFORM_MAP = {
103
+ rotate: function(val){
104
+ if (SC.typeOf(val) === SC.T_NUMBER || val === 0) val += 'deg';
105
+ return 'rotate('+val+')';
106
+ },
107
+ scale: function(val){
108
+ if (SC.typeOf(val) === SC.T_ARRAY) val = val.join(', ');
109
+ return 'scale('+val+')';
110
+ }
111
+ };
112
+
113
+ /**
114
+ Properties that can be animated
115
+ */
116
+ SC.ANIMATABLE_PROPERTIES = ["top", "left", "bottom", "right", "width", "height", "centerX", "centerY", "opacity", "scale", "rotate"];
117
+
82
118
  /**
83
119
  @class
84
120
 
85
- Base class for managing a view. View's provide two functions:
121
+ Base class for managing a view. Views provide two functions:
86
122
 
87
123
  1. They translate state and events into drawing instructions for the
88
124
  web browser and
@@ -119,7 +155,7 @@ SC.EMPTY_CHILD_VIEWS_ARRAY.needsClone = YES;
119
155
  override this behavior with your own custom updating code, you can
120
156
  replace updateLayer() with your own implementation instead.
121
157
 
122
- - *didAppendLayerToDocument:* in theory all DOM setup could be done
158
+ - *didAppendToDocument:* in theory all DOM setup could be done
123
159
  in didCreateLayer() as you already have a DOM element instantiated.
124
160
  However there is cases where the element has to be first appended to the
125
161
  Document because there is either a bug on the browser or you are using
@@ -134,7 +170,7 @@ SC.EMPTY_CHILD_VIEWS_ARRAY.needsClone = YES;
134
170
  SC.View = SC.Responder.extend(SC.DelegateSupport,
135
171
  /** @scope SC.View.prototype */ {
136
172
 
137
- concatenatedProperties: 'outlets displayProperties layoutProperties classNames renderMixin didCreateLayerMixin willDestroyLayerMixin'.w(),
173
+ concatenatedProperties: 'outlets displayProperties layoutProperties classNames renderMixin didCreateLayerMixin willDestroyLayerMixin createRendererMixin updateRendererMixin'.w(),
138
174
 
139
175
  /**
140
176
  The current pane.
@@ -180,6 +216,185 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
180
216
  */
181
217
  backgroundColor: null,
182
218
 
219
+ /**
220
+ Activates use of brower's static layout. To activate, set this
221
+ property to YES.
222
+
223
+ @property {Boolean}
224
+ */
225
+ useStaticLayout: NO,
226
+
227
+ // ..........................................................
228
+ // THEME SUPPORT
229
+ //
230
+
231
+ _baseThemeName: false,
232
+
233
+ /**
234
+ The base theme to start from; the "theme" property looks in this theme.
235
+ baseTheme is inherited from parent's theme property.
236
+ */
237
+ baseTheme: null,
238
+
239
+ /**
240
+ This sets the base theme
241
+ */
242
+ _baseThemeProperty: function(key, value) {
243
+ if (SC.typeOf(value) === SC.T_STRING) {
244
+ this.set("_baseThemeName", value);
245
+ }
246
+
247
+ // find the base theme by name if we have a name.
248
+ if (this.get("_baseThemeName")) {
249
+ var theme = SC.Theme.find(this.get("_baseThemeName"));
250
+ if (theme) return theme;
251
+ }
252
+
253
+ // otherwise, return parent's theme.
254
+ var parent = this.get("parentView");
255
+ if (parent) return parent.get("theme");
256
+
257
+ return SC.Theme.find("sc-base");
258
+ }.property().cacheable(),
259
+
260
+
261
+ _last_theme: null, // used to determine if theme has changed since last time the property was evaluated.
262
+ _themeName: false,
263
+
264
+ // baseTheme is a "property"; since it gets set after extension of the view,
265
+ // we need an observer in addition to it to actually do notifications.
266
+ _baseThemeDidChange: function() {
267
+ this.notifyPropertyChange("theme");
268
+ }.observes("baseTheme"),
269
+
270
+ _themeProperty: function(key, value) {
271
+ // if it is a string, set theme name
272
+ if (SC.typeOf(value) === SC.T_STRING) {
273
+ this.set("_themeName", value);
274
+ }
275
+
276
+ // get the base theme
277
+ var base = this.get("baseTheme");
278
+
279
+ // find theme, if possible
280
+ if (this.get("_themeName")) {
281
+ // Note: theme instance "find" function will search every parent
282
+ // _except_ global (which is not a parent)
283
+ var theme;
284
+ if (base) {
285
+ theme = base.find(this.get("_themeName"));
286
+ if (theme) return theme;
287
+ }
288
+
289
+ theme = SC.Theme.find(this.get("_themeName"));
290
+ if (theme) return theme;
291
+ }
292
+
293
+ // can't find anything, return base.
294
+ return base;
295
+ }.property().cacheable(),
296
+
297
+ _notifyThemeDidChange: function() {
298
+ var len, idx, childViews = this.get("childViews");
299
+ len = childViews.length;
300
+ for (idx = 0; idx < len; idx++){
301
+ childViews[idx].notifyPropertyChange("baseTheme");
302
+ childViews[idx].notifyPropertyChange("theme");
303
+ }
304
+ },
305
+
306
+ /**
307
+ The current theme. You may only set this to a string, and during runtime, the value
308
+ (from get()) will always be a theme object or null.
309
+ */
310
+ theme: null,
311
+
312
+ /**
313
+ Detects when the theme changes. Replaces the layer if necessary.
314
+ */
315
+ _themeDidChange: function() {
316
+ var theme = this.get("theme");
317
+ if (theme === this._last_theme) return;
318
+ this._last_theme = theme;
319
+
320
+ // replace the layer
321
+ if (this.get("layer")) this.replaceLayer();
322
+
323
+ // notify child views
324
+ if (this._hasCreatedChildViews) this._notifyThemeDidChange();
325
+
326
+ // and now, regenerate renderer
327
+ this._generateRenderer();
328
+ }.observes("theme"),
329
+
330
+ /**
331
+ Like "get", but if the value is SC.FROM_THEME, it will find the value from the view's
332
+ renderer, if any; if none, then it will look for <property>Default and return that.
333
+ */
334
+ themed: function(property) {
335
+ var val = this.get(property);
336
+ if (val === SC.FROM_THEME) {
337
+ if (this.renderer) return this.renderer[property];
338
+ else return this.get(property + "Default");
339
+ }
340
+ return val;
341
+ },
342
+
343
+ /**
344
+ @private
345
+ Generates the view's renderer (calling _destroyRenderer on any old ones if needed).
346
+ */
347
+ _generateRenderer: function() {
348
+ var theme = this.get("theme"); // renderers need a theme
349
+
350
+ // reset the renderer (the theme changed, hello!)
351
+ this._destroyRenderer();
352
+
353
+ // now, if we do have a theme, we can try to create the renderer.
354
+ if (theme && theme.isTheme) {
355
+ this._viewRenderer = theme.view();
356
+
357
+ if (this.createRenderer) {
358
+ this.renderer = this.createRenderer(theme);
359
+
360
+ // the renderer was not necessarily successfully created.
361
+ if (this.renderer) {
362
+ var mixins, idx, len;
363
+ this.renderer.contentProvider = this; // set renderer's content provider to this (it will call renderContent, etc. as needed)
364
+ if (mixins = this.createRendererMixin) {
365
+ len = mixins.length;
366
+ for (idx = 0; idx < len; idx++) mixins[idx].call(this, theme);
367
+ }
368
+ }
369
+ }
370
+ }
371
+
372
+ // update!
373
+ this._updateViewRenderer();
374
+ this._updateRenderer();
375
+ },
376
+
377
+ /**
378
+ @private
379
+ Updates the view's renderer, if one exists, calling all mixins to renderer as well.
380
+ */
381
+ _updateRenderer: function() {
382
+ var mixins, idx, len;
383
+ if (this.renderer){
384
+ this.updateRenderer(this.renderer);
385
+ if (mixins = this.updateRendererMixin) {
386
+ len = mixins.length;
387
+ for (idx = 0; idx < len; idx++) mixins[idx].call(this, this.renderer);
388
+ }
389
+ }
390
+ },
391
+
392
+ _destroyRenderer: function() {
393
+ if (!this.renderer) return;
394
+ this.renderer.destroy();
395
+ this.renderer = null;
396
+ },
397
+
183
398
  // ..........................................................
184
399
  // IS ENABLED SUPPORT
185
400
  //
@@ -213,6 +428,38 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
213
428
  if (ret && (pv = this.get('parentView'))) ret = pv.get('isEnabledInPane');
214
429
  return ret ;
215
430
  }.property('parentView', 'isEnabled'),
431
+
432
+ /** @private
433
+ Observes the isEnabled property and resigns first responder if set to NO.
434
+ This will avoid cases where, for example, a disabled text field retains
435
+ its focus rings.
436
+
437
+ @observes isEnabled
438
+ */
439
+ _sc_view_isEnabledDidChange: function(){
440
+ if(!this.get('isEnabled') && this.get('isFirstResponder')){
441
+ this.resignFirstResponder();
442
+ }
443
+ }.observes('isEnabled'),
444
+
445
+ // ..........................................................
446
+ // MULTITOUCH SUPPORT
447
+ //
448
+ /**
449
+ Set to YES if you want to receive touch events for each distinct touch (rather than only
450
+ the first touch start and last touch end).
451
+ */
452
+ acceptsMultitouch: NO,
453
+
454
+ /**
455
+ Is YES if the view is currently being touched. NO otherwise.
456
+ */
457
+ hasTouch: NO,
458
+
459
+ /**
460
+ Whether to route touch events to mouse events (defaults to YES)
461
+ */
462
+ routeTouch: YES,
216
463
 
217
464
  // ..........................................................
218
465
  // IS VISIBLE IN WINDOW SUPPORT
@@ -240,6 +487,14 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
240
487
  */
241
488
  isVisibleInWindow: NO,
242
489
 
490
+ /**
491
+ By default we don't disable the context menu. Overriding this property
492
+ can enable/disable the context menu per view.
493
+ */
494
+ isContextMenuEnabled: function() {
495
+ return SC.CONTEXT_MENU_ENABLED;
496
+ }.property(),
497
+
243
498
  /**
244
499
  Recomputes the isVisibleInWindow property based on the visibility of the
245
500
  view and its parent. If the recomputed value differs from the current
@@ -256,45 +511,74 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
256
511
  @returns {SC.View} receiver
257
512
  */
258
513
  recomputeIsVisibleInWindow: function(parentViewIsVisible) {
259
- var last = this.get('isVisibleInWindow'),
260
- cur = this.get('isVisible'), parentView ;
514
+ var previous = this.get('isVisibleInWindow'),
515
+ current = this.get('isVisible'),
516
+ parentView;
261
517
 
262
518
  // isVisibleInWindow = isVisible && parentView.isVisibleInWindow
263
519
  // this approach only goes up to the parentView if necessary.
264
- if (cur) {
265
- cur = (parentViewIsVisible === undefined) ?
266
- ((parentView=this.get('parentView')) ?
267
- parentView.get('isVisibleInWindow') : NO) : parentViewIsVisible ;
520
+ if (current) {
521
+ // If we weren't passed in 'parentViewIsVisible' (we generally aren't;
522
+ // it's an optimization), then calculate it.
523
+ if (parentViewIsVisible === undefined) {
524
+ parentView = this.get('parentView');
525
+ parentViewIsVisible = parentView ? parentView.get('isVisibleInWindow') : NO;
526
+ }
527
+ current = current && parentViewIsVisible;
268
528
  }
269
529
 
270
- // if the state has changed, update it and notify children
271
- // if (last !== cur) {
272
- this.set('isVisibleInWindow', cur) ;
273
- this._needsVisibiltyChange = YES ; // update even if we aren't visible
530
+ // If our visibility has changed, then set the new value and notify our
531
+ // child views to update their value.
532
+ //if (previous !== current) {
533
+ this.set('isVisibleInWindow', current) ;
274
534
 
275
535
  var childViews = this.get('childViews'), len = childViews.length, idx;
276
536
  for(idx=0;idx<len;idx++) {
277
- childViews[idx].recomputeIsVisibleInWindow(cur);
537
+ childViews[idx].recomputeIsVisibleInWindow(current);
278
538
  }
279
-
280
- // if we just became visible, update layer + layout if needed...
281
- if (cur) {
282
- if (this.parentViewDidResize) this.parentViewDidResize();
283
-
539
+
540
+
541
+ // We'll also kick off some necessary work when the visibility changes.
542
+ // This more appropriately belongs in a 'isVisibleInWindow' observer or
543
+ // some such helper method because this work is not strictly related to
544
+ // computing the visibility, but view performance is critical, so
545
+ // avoiding the extra observer is worthwhile.
546
+ if (current) {
547
+ // If we just became visible, update layer + layout if needed...
548
+ this.displayDidChange();
549
+
284
550
  if (this.get('childViewsNeedLayout')) {
285
551
  this.invokeOnce(this.layoutChildViewsIfNeeded);
286
552
  }
287
553
  }
288
-
289
- this.set('layerNeedsUpdate', YES) ;
290
-
291
- // if we were firstResponder, resign firstResponder also if no longer
292
- // visible.
293
- if (!cur && this.get('isFirstResponder')) this.resignFirstResponder();
294
-
295
- // }
296
- return this ;
554
+ else {
555
+ // We need to set some internal state to indicate that we went from
556
+ // visible to invisible.
557
+ //
558
+ // (Typically, invisible views are not updated for performance
559
+ // reasons, but if we went from visible to invisible, we need to
560
+ // update once.)
561
+ this._forceLayerUpdateDueToVisibilityChange = YES;
562
+ this.displayDidChange();
563
+
564
+ // Also, if we were previously 'firstResponder', resign it.
565
+ if (this.get('isFirstResponder')) this.resignFirstResponder();
566
+ }
567
+ //}
568
+ return this;
569
+ },
570
+
571
+
572
+ /** @private
573
+ Whenever the view’s visibility changes, we need to recompute whether it is
574
+ actually visible inside the window (a view is only visible in the window
575
+ if it is marked as visibile and its parent view is as well).
576
+ */
577
+ _sc_isVisibleDidChange: function() {
578
+ this.recomputeIsVisibleInWindow();
297
579
  }.observes('isVisible'),
580
+
581
+
298
582
 
299
583
  // ..........................................................
300
584
  // CHILD VIEW SUPPORT
@@ -371,7 +655,10 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
371
655
  if (view.parentView !== this) {
372
656
  throw "%@.removeChild(%@) must belong to parent".fmt(this,view);
373
657
  }
374
-
658
+
659
+ // Animation cleanup
660
+ if (SC.platform.supportsCSSTransitions) this.resetAnimation();
661
+
375
662
  // notify views
376
663
  if (view.willRemoveFromParent) view.willRemoveFromParent() ;
377
664
  if (this.willRemoveChild) this.willRemoveChild(view) ;
@@ -380,8 +667,8 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
380
667
  view.set('parentView', null) ;
381
668
 
382
669
  // remove view from childViews array.
383
- var childViews = this.get('childViews') ;
384
- var idx = childViews.indexOf(view) ;
670
+ var childViews = this.get('childViews'),
671
+ idx = childViews.indexOf(view) ;
385
672
  if (idx>=0) childViews.removeAt(idx);
386
673
 
387
674
  // The DOM will need some fixing up, note this on the view.
@@ -491,6 +778,8 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
491
778
  parentViewDidChange: function() {
492
779
  this.recomputeIsVisibleInWindow() ;
493
780
 
781
+ this.resetBuildState();
782
+ this.notifyPropertyChange("baseTheme");
494
783
  this.set('layerLocationNeedsUpdate', YES) ;
495
784
  this.invokeOnce(this.updateLayerLocationIfNeeded) ;
496
785
 
@@ -504,7 +793,7 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
504
793
  this._invalidatePaneCacheForSelfAndAllChildViews();
505
794
 
506
795
  return this ;
507
- }.observes('isVisible'),
796
+ },
508
797
 
509
798
  /** @private
510
799
  We want to cache the 'pane' property, but it's impossible for us to
@@ -515,13 +804,16 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
515
804
  views, and so on.
516
805
  */
517
806
  _invalidatePaneCacheForSelfAndAllChildViews: function () {
807
+ var childView, childViews = this.get('childViews'),
808
+ len = childViews.length, idx ;
809
+
518
810
  this.notifyPropertyChange('pane');
519
811
 
520
- var childViews = this.get('childViews'),
521
- len = childViews.length, idx ;
522
812
  for (idx=0; idx<len; ++idx) {
523
- var childView = childViews[idx];
524
- if (childView._invalidatePaneCacheForSelfAndAllChildViews) childView._invalidatePaneCacheForSelfAndAllChildViews();
813
+ childView = childViews[idx];
814
+ if (childView._invalidatePaneCacheForSelfAndAllChildViews) {
815
+ childView._invalidatePaneCacheForSelfAndAllChildViews();
816
+ }
525
817
  }
526
818
  },
527
819
 
@@ -600,6 +892,27 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
600
892
  return SC.guidFor(this) ;
601
893
  }.property().cacheable(),
602
894
 
895
+ _lastLayerId: null,
896
+ /**
897
+ Handles changes in the layer id.
898
+ */
899
+ layerIdDidChange: function() {
900
+ var layer = this.get("layer");
901
+ if (layer && this.get("layerId") !== this._lastLayerId) {
902
+ // if we had an earlier one, remove from view hash.
903
+ if (this._lastLayerId) delete SC.View.views[this._lastLayerId];
904
+
905
+ // set the current one as the new old one
906
+ this._lastLayerId = this.get("layerId");
907
+
908
+ // and add the new one
909
+ SC.View.views[this.get("layerId")] = this;
910
+
911
+ // and finally, set the actual layer id.
912
+ layer.id = this.get("layerId");
913
+ }
914
+ }.observes("layerId"),
915
+
603
916
  /**
604
917
  Attempts to discover the layer in the parent layer. The default
605
918
  implementation looks for an element with an ID of layerId (or the view's
@@ -654,6 +967,20 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
654
967
  return elem;
655
968
  },
656
969
 
970
+ /**
971
+ Returns YES if the receiver is a subview of a given view or if it’s
972
+ identical to that view. Otherwise, it returns NO.
973
+
974
+ @property {SC.View} view
975
+ */
976
+ isDescendantOf: function(view) {
977
+ var parentView = this.get('parentView');
978
+
979
+ if(this===view) return YES;
980
+ else if(parentView) return parentView.isDescendantOf(view);
981
+ else return NO;
982
+ },
983
+
657
984
  /**
658
985
  This method is invoked whenever a display property changes. It will set
659
986
  the layerNeedsUpdate method to YES. If you need to perform additional
@@ -701,14 +1028,13 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
701
1028
  You should not override this method. Instead override updateLayer() or
702
1029
  render().
703
1030
 
704
- @param {Boolean} isVisible if true assume view is visible even if it is not.
705
1031
  @returns {SC.View} receiver
706
1032
  @test in updateLayer
707
1033
  */
708
1034
  updateLayerIfNeeded: function() {
709
- var viz = this.get('isVisibleInWindow') ;
710
- if ((viz || this._needsVisibiltyChange) && this.get('layerNeedsUpdate')) {
711
- this._needsVisibiltyChange = NO ;
1035
+ var force = this._forceLayerUpdateDueToVisibilityChange,
1036
+ shouldUpdate = (force || this.get('isVisibleInWindow')) && this.get('layerNeedsUpdate');
1037
+ if (shouldUpdate) {
712
1038
  // only update a layer if it already exists
713
1039
  if (this.get('layer')) {
714
1040
  this.beginPropertyChanges() ;
@@ -718,6 +1044,10 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
718
1044
  }
719
1045
  }
720
1046
  else this.set('layerNeedsUpdate', NO) ;
1047
+
1048
+ // If we were forcing the layer update for this round, clear the flag.
1049
+ this._forceLayerUpdateDueToVisibilityChange = NO;
1050
+
721
1051
  return this ;
722
1052
  },
723
1053
 
@@ -736,20 +1066,47 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
736
1066
  do not want your render() method called when updating a layer, then you
737
1067
  should override this method instead.
738
1068
 
1069
+ @param optionalContext provided only for backwards-compatibility.
1070
+
739
1071
  @returns {SC.View} receiver
740
1072
  */
741
- updateLayer: function() {
742
- var context = this.renderContext(this.get('layer')) ;
743
- this.prepareContext(context, NO) ;
744
- context.update() ;
745
- if (context._innerHTMLReplaced) {
746
- var pane = this.get('pane');
747
- if(pane && pane.get('isPaneAttached')) {
748
- this._notifyDidAppendToDocument();
1073
+ updateLayer: function(optionalContext) {
1074
+ var mixins, idx, len, renderer = this.renderer, viewRenderer = this._viewRenderer;
1075
+ this.updateViewSettings();
1076
+
1077
+ // make sure to update any renderers
1078
+ this._updateViewRenderer();
1079
+ this._updateRenderer();
1080
+
1081
+ // Now, update using renderer if possible; render() otherwise
1082
+ if (!this._useRenderFirst && this.createRenderer) {
1083
+ if (renderer) renderer.update();
1084
+ if (viewRenderer) viewRenderer.update();
1085
+ } else {
1086
+ var context = optionalContext || this.renderContext(this.get('layer')) ;
1087
+ this.render(context, NO) ;
1088
+ if (mixins = this.renderMixin) {
1089
+ len = mixins.length;
1090
+ for(idx=0; idx<len; ++idx) mixins[idx].call(this, context, NO) ;
1091
+ }
1092
+
1093
+ context.update() ;
1094
+ if (context._innerHTMLReplaced) {
1095
+ var pane = this.get('pane');
1096
+ if(pane && pane.get('isPaneAttached')) {
1097
+ this._notifyDidAppendToDocument();
1098
+ }
749
1099
  }
750
1100
  }
1101
+
1102
+ // If this view uses static layout, then notify that the frame (likely)
1103
+ // changed.
1104
+ if (this.useStaticLayout) this.viewDidResize();
1105
+
751
1106
  if (this.didUpdateLayer) this.didUpdateLayer(); // call to update DOM
752
- if(this.designer && this.designer.viewDidUpdateLayer) this.designer.viewDidUpdateLayer(); //let the designer know
1107
+ if(this.designer && this.designer.viewDidUpdateLayer) {
1108
+ this.designer.viewDidUpdateLayer(); //let the designer know
1109
+ }
753
1110
  return this ;
754
1111
  },
755
1112
 
@@ -782,7 +1139,7 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
782
1139
  var context = this.renderContext(this.get('tagName')) ;
783
1140
 
784
1141
  // now prepare the content like normal.
785
- this.prepareContext(context, YES) ;
1142
+ this.renderToContext(context) ;
786
1143
  this.set('layer', context.element()) ;
787
1144
 
788
1145
  // now notify the view and its child views..
@@ -796,7 +1153,20 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
796
1153
  invokes the same on all child views.
797
1154
  */
798
1155
  _notifyDidCreateLayer: function() {
1156
+ // notify, not just the view, but also the view renderers
1157
+ this.notifyPropertyChange("layer");
1158
+ this._viewRenderer.attachLayer(this);
1159
+ if (this.renderer) this.renderer.attachLayer(this);
799
1160
  if (this.didCreateLayer) this.didCreateLayer() ;
1161
+
1162
+ // Animation prep
1163
+ if (SC.platform.supportsCSSTransitions) {
1164
+ this.resetAnimation();
1165
+ SC.Event.add(this.get('layer'), SC.platform.cssPrefix+"TransitionEnd", this, this._scv_animationEnd);
1166
+ SC.Event.add(this.get('layer'), "transitionEnd", this, this._scv_animationEnd);
1167
+ }
1168
+
1169
+ // and notify others
800
1170
  var mixins = this.didCreateLayerMixin, len, idx,
801
1171
  childViews = this.get('childViews');
802
1172
  if (mixins) {
@@ -832,10 +1202,26 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
832
1202
  destroyLayer: function() {
833
1203
  var layer = this.get('layer') ;
834
1204
  if (layer) {
1205
+
1206
+ // Teardown animations
1207
+ if (SC.platform.supportsCSSTransitions) {
1208
+ SC.Event.remove(this.get('layer'), SC.platform.cssPrefix+"TransitionEnd", this, this._scv_animationEnd);
1209
+ SC.Event.remove(this.get('layer'), "transitionEnd", this, this._scv_animationEnd);
1210
+ }
1211
+
835
1212
  // Now notify the view and its child views. It will also set the
836
1213
  // layer property to null.
837
1214
  this._notifyWillDestroyLayer() ;
838
1215
 
1216
+ if (this._viewRenderer) {
1217
+ this._viewRenderer.detachLayer();
1218
+ }
1219
+
1220
+ // tell the renderer the layer has gone away
1221
+ if (this.renderer) {
1222
+ this.renderer.detachLayer();
1223
+ }
1224
+
839
1225
  // do final cleanup
840
1226
  if (layer.parentNode) layer.parentNode.removeChild(layer) ;
841
1227
  layer = null ;
@@ -874,53 +1260,134 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
874
1260
  this.set('layer', null) ;
875
1261
  },
876
1262
 
1263
+
1264
+ isLayerProvider: YES,
1265
+ /**
1266
+ @private (semi)
1267
+ Returns the layer. Meant only for use from renderers and such—this is a layer provider function.
1268
+ */
1269
+ getLayer: function() {
1270
+ return this.get("layer");
1271
+ },
1272
+
1273
+ /**
1274
+ @private
1275
+
1276
+ Renders to a context.
1277
+ Rendering only happens for the initial rendering. Further updates happen in updateLayer,
1278
+ and are not done to contexts, but to layers.
1279
+
1280
+ Both renderToContext and updateLayer will call render(context, firstTime) as needed
1281
+ to maintain backwards compatibility, but prefer calling createRenderer.
1282
+
1283
+ Note: You should not generally override nor directly call this method. This method is only
1284
+ called by createLayer to set up the layer initially, and by renderChildViews, to write to
1285
+ a context.
1286
+
1287
+ @param {SC.RenderContext} context the render context.
1288
+ @param {Boolean} firstTime Provided for compatibility when rendering legacy views only.
1289
+ */
1290
+ renderToContext: function(context, firstTime) {
1291
+ var mixins, idx, len;
1292
+
1293
+ this.beginPropertyChanges() ;
1294
+ this.set('layerNeedsUpdate', NO) ;
1295
+
1296
+ this.renderViewSettings(context);
1297
+
1298
+ /* Now, the actual rendering, which will use a renderer if possible */
1299
+ // the renderer will have been created when the theme was found; if it is around,
1300
+ // we just need to ensure it is up-to-date
1301
+ if (this.createRenderer) {
1302
+ // our private version does mixins too! Yay!
1303
+ this._updateRenderer();
1304
+ }
1305
+
1306
+ if (!this._useRenderFirst && this.createRenderer) {
1307
+ if (this.renderer) this.renderer.render(context);
1308
+ } else {
1309
+ if (SC.none(firstTime)) firstTime = YES;
1310
+
1311
+ this.render(context, firstTime);
1312
+ if (mixins = this.renderMixin) {
1313
+ len = mixins.length;
1314
+ for(idx=0; idx<len; ++idx) mixins[idx].call(this, context, firstTime) ;
1315
+ }
1316
+ }
1317
+
1318
+ this.endPropertyChanges() ;
1319
+ },
1320
+
1321
+ /**
1322
+ @private
1323
+ Updates the properties of the renderer used for the view
1324
+ */
1325
+ _updateViewRenderer: function() {
1326
+ if (!this._viewRenderer) return;
1327
+
1328
+ var classNames = this.get('classNames');
1329
+ if (this.get('theme')) {
1330
+ classNames = classNames.concat(this.get("theme").classNames);
1331
+ }
1332
+
1333
+ this._scv_willRenderAnimations();
1334
+
1335
+ this._viewRenderer.attr({
1336
+ layerId: this.layerId ? this.get('layerId') : SC.guidFor(this),
1337
+ classNames: classNames,
1338
+ backgroundColor: this.get('backgroundColor'),
1339
+ cursor: this.get('cursor'),
1340
+ layoutStyle: this.get('layoutStyle'),
1341
+ isTextSelectable: this.get('isTextSelectable'),
1342
+ isEnabled: this.get('isEnabled'),
1343
+ isVisible: this.get('isVisible'),
1344
+ isFirstResponder: this.get('isFirstResponder'),
1345
+ hasStaticLayout: this.get('useStaticLayout')
1346
+ });
1347
+ },
1348
+
1349
+ /**
1350
+ @private
1351
+ Renders view settings (class names and id, for instance) to the context.
1352
+ */
1353
+ renderViewSettings: function(context) {
1354
+ this._updateViewRenderer();
1355
+ this.renderLayout(context, YES); // provide backwards compatibility
1356
+ this._viewRenderer.render(context);
1357
+ },
1358
+
1359
+ /**
1360
+ @private
1361
+ Updates view settings on the context (including class names).
1362
+ */
1363
+ updateViewSettings: function() {
1364
+ this._updateViewRenderer();
1365
+ this._viewRenderer.update();
1366
+ },
1367
+
877
1368
  /**
1369
+ @private
1370
+
878
1371
  Invoked by createLayer() and updateLayer() to actually render a context.
879
1372
  This method calls the render() method on your view along with any
880
1373
  renderMixin() methods supplied by mixins you might have added.
881
1374
 
882
- You should not override this method directly. However, you might call
883
- this method if you choose to override updateLayer() or createLayer().
1375
+ You should not override this method directly. Nor should you call it. It is OLD.
884
1376
 
885
1377
  @param {SC.RenderContext} context the render context
886
1378
  @param {Boolean} firstTime YES if this is creating a layer
887
1379
  @returns {void}
888
1380
  */
889
1381
  prepareContext: function(context, firstTime) {
890
- var mixins, len, idx, layerId, bgcolor, cursor ;
891
-
892
- // do some initial setup only needed at create time.
1382
+ // eventually, firstTime will be removed because it is ugly.
1383
+ // for now, we will sense whether we are doing things the ugly way or not.
1384
+ // if ugly, we will allow updates through.
1385
+ if (SC.none(firstTime)) firstTime = YES; // the GOOD code path :)
893
1386
  if (firstTime) {
894
- // TODO: seems like things will break later if SC.guidFor(this) is used
895
-
896
- layerId = this.layerId ? this.get('layerId') : SC.guidFor(this) ;
897
- context.id(layerId).classNames(this.get('classNames'), YES) ;
898
- this.renderLayout(context, firstTime) ;
899
- }else{
900
- context.resetClassNames();
901
- context.classNames(this.get('classNames'), YES);
902
- }
903
-
904
- // do some standard setup...
905
- if (this.get('isTextSelectable')) context.addClass('allow-select') ;
906
- if (!this.get('isEnabled')) context.addClass('disabled') ;
907
- if (!this.get('isVisible')) context.addClass('hidden') ;
908
- if (this.get('isFirstResponder')) context.addClass('focus');
909
-
910
- bgcolor = this.get('backgroundColor');
911
- if (bgcolor) context.addStyle('backgroundColor', bgcolor);
912
-
913
- cursor = this.get('cursor') ;
914
- if (cursor) context.addClass(cursor.get('className')) ;
915
-
916
- this.beginPropertyChanges() ;
917
- this.set('layerNeedsUpdate', NO) ;
918
- this.render(context, firstTime) ;
919
- if (mixins = this.renderMixin) {
920
- len = mixins.length;
921
- for(idx=0; idx<len; ++idx) mixins[idx].call(this, context, firstTime) ;
1387
+ this.renderToContext(context);
1388
+ } else {
1389
+ this.updateLayer(context);
922
1390
  }
923
- this.endPropertyChanges() ;
924
1391
  },
925
1392
 
926
1393
  /**
@@ -929,21 +1396,62 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
929
1396
  walk down the childView chain, rendering all of the children in a nested
930
1397
  way.
931
1398
 
1399
+ If a context is provided, it is always assumed to be firstTime.
1400
+
1401
+ @deprecated In SproutCore 1.1. Use renderContent and updateContent explicitly instead.
932
1402
  @param {SC.RenderContext} context the context
933
1403
  @param {Boolean} firstName true if the layer is being created
934
1404
  @returns {SC.RenderContext} the render context
935
- @test in render
1405
+ @test in render and renderer
936
1406
  */
937
1407
  renderChildViews: function(context, firstTime) {
1408
+ if (firstTime || context) {
1409
+ // we pass along firstTime for compatibility. Some older (less wise) views may
1410
+ // think it will work. Well, it wouldn't, but we'll make it work.
1411
+ this.renderContent(context, firstTime);
1412
+ } else {
1413
+ this.updateContent(context);
1414
+ }
1415
+ return context;
1416
+ },
1417
+
1418
+ /**
1419
+ @private
1420
+ Views are content suppliers for renderers. That is, views pass themselves to renderers
1421
+ for renderers' "content" properties. Content providers have two functions: renderContent and updateContent.
1422
+ This is the first of those.
1423
+
1424
+ @param {SC.RenderContext} context
1425
+ @param {Boolean} firstTime For compatibility (do not use; if not first time, call updateContent).
1426
+ */
1427
+ renderContent: function(context, firstTime) {
938
1428
  var cv = this.get('childViews'), len = cv.length, idx, view ;
939
1429
  for (idx=0; idx<len; ++idx) {
940
1430
  view = cv[idx] ;
941
1431
  if (!view) continue;
942
1432
  context = context.begin(view.get('tagName')) ;
943
- view.prepareContext(context, firstTime) ;
1433
+ view.renderToContext(context, firstTime);
944
1434
  context = context.end() ;
945
1435
  }
946
- return context ;
1436
+ },
1437
+
1438
+ /**
1439
+ @private
1440
+ Views are content suppliers for renderers. That is, views pass themselves to renderers
1441
+ for renderers' "content" properties. Content providers have two functions: renderContent and updateContent.
1442
+ This is the first of those.
1443
+
1444
+ For old-style rendering, the render context created by the parent renderer is passed along
1445
+ as well.
1446
+ */
1447
+ updateContent: function(optionalContext) {
1448
+ var cv = this.get('childViews'), len = cv.length, idx, view ;
1449
+ for (idx=0; idx<len; ++idx) {
1450
+ view = cv[idx] ;
1451
+ if (!view) continue;
1452
+
1453
+ view.updateLayer(optionalContext);
1454
+ }
947
1455
  },
948
1456
 
949
1457
  /**
@@ -965,19 +1473,29 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
965
1473
  @param {SC.RenderContext} context the render context
966
1474
  @param {Boolean} firstTime YES if this is creating a layer
967
1475
  @returns {void}
968
- */
1476
+ */
969
1477
  render: function(context, firstTime) {
970
- if (firstTime) this.renderChildViews(context, firstTime) ;
1478
+ var renderer = this.renderer;
1479
+ if (this.createRenderer && renderer) {
1480
+ if (firstTime) {
1481
+ renderer.render(context);
1482
+ } else {
1483
+ renderer.update();
1484
+ }
1485
+ } else {
1486
+ if (firstTime) this.renderChildViews(context, firstTime);
1487
+ }
971
1488
  },
972
1489
 
973
1490
 
974
1491
  /** @private -
975
- Invokes the receivers didAppendLayerToDocument() method if it exists and then
976
- invokes the same on all child views.
1492
+ Invokes the receivers didAppendLayerToDocument() method if it exists and
1493
+ then invokes the same on all child views.
977
1494
  */
978
1495
 
979
1496
  _notifyDidAppendToDocument: function() {
980
- if(this.didAppendToDocument) this.didAppendToDocument();
1497
+ if (this.didAppendToDocument) this.didAppendToDocument();
1498
+
981
1499
  var i=0, child, childLen, children = this.get('childViews');
982
1500
  for(i=0, childLen=children.length; i<childLen; i++) {
983
1501
  child = children[i];
@@ -1040,15 +1558,27 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1040
1558
  displayProperties: ['isFirstResponder', 'isVisible'],
1041
1559
 
1042
1560
  /**
1043
- You can set this to an SC.Cursor instance; it's className will
1044
- automatically be added to the layer's classNames. The cursor is only used
1045
- when a layer is first created. If you change the cursor for an element,
1046
- you must destroy and recreate the view layer.
1047
-
1048
- @property {SC.Cursor}
1561
+ You can set this to an SC.Cursor instance; its class name will
1562
+ automatically be added to the layer's classNames, allowing you
1563
+ to efficiently change the cursor for a large group of views with
1564
+ just one change to the SC.Cursor object. The cursor property
1565
+ is only used when the layer is created, so if you need to change
1566
+ it to a different cursor object, you will have to destroy and
1567
+ recreate the view layer. (In this case you might investigate
1568
+ setting cursors using CSS directly instead of SC.Cursor.)
1569
+
1570
+ @property {SC.Cursor String}
1049
1571
  */
1050
1572
  cursor: null,
1051
1573
 
1574
+ /**
1575
+ A child view without a cursor of its own inherits its parent's cursor by
1576
+ default. Set this to NO to prevent this behavior.
1577
+
1578
+ @property {Boolean}
1579
+ */
1580
+ shouldInheritCursor: YES,
1581
+
1052
1582
  // ..........................................................
1053
1583
  // LAYER LOCATION
1054
1584
  //
@@ -1117,11 +1647,12 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1117
1647
  if (!node) {
1118
1648
  this.createLayer() ;
1119
1649
  node = this.get('layer') ;
1650
+ if (!node) return; // can't do anything without a node.
1120
1651
  }
1121
1652
 
1122
- var siblings = parentView.get('childViews') ;
1123
- var nextView = siblings.objectAt(siblings.indexOf(this)+1) ;
1124
- var nextNode = (nextView) ? nextView.get('layer') : null ;
1653
+ var siblings = parentView.get('childViews'),
1654
+ nextView = siblings.objectAt(siblings.indexOf(this)+1),
1655
+ nextNode = (nextView) ? nextView.get('layer') : null ;
1125
1656
 
1126
1657
  // before we add to parent node, make sure that the nextNode exists...
1127
1658
  if (nextView && (!nextNode || nextNode.parentNode!==parentNode)) {
@@ -1129,12 +1660,9 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1129
1660
  nextNode = nextView.get('layer') ;
1130
1661
  }
1131
1662
 
1132
- // add to parentNode if needed. If we do add, then also notify view
1133
- // that its parentView has resized since joining a parentView has the
1134
- // same effect.
1663
+ // add to parentNode if needed.
1135
1664
  if ((node.parentNode!==parentNode) || (node.nextSibling!==nextNode)) {
1136
1665
  parentNode.insertBefore(node, nextNode) ;
1137
- if (this.parentViewDidResize) this.parentViewDidResize() ;
1138
1666
  }
1139
1667
  }
1140
1668
 
@@ -1172,18 +1700,24 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1172
1700
  isKeyResponder: NO,
1173
1701
 
1174
1702
  /**
1175
- This method is invoked just before you lost the key responder status. The passed view is the view that is about to gain keyResponder status. This gives you a chance to do any early setup.
1176
-
1177
- Remember that you can gain/lose key responder status either because another view in the same pane is becoming first responder or because another pane is about to become key.
1703
+ This method is invoked just before you lost the key responder status.
1704
+ The passed view is the view that is about to gain keyResponder status.
1705
+ This gives you a chance to do any early setup. Remember that you can
1706
+ gain/lose key responder status either because another view in the same
1707
+ pane is becoming first responder or because another pane is about to
1708
+ become key.
1178
1709
 
1179
1710
  @param {SC.Responder} responder
1180
1711
  */
1181
1712
  willLoseKeyResponderTo: function(responder) {},
1182
1713
 
1183
1714
  /**
1184
- This method is invoked just before you become the key responder. The passed view is the view that is about to lose keyResponder status. You can use this to do any setup before the view changes.
1185
-
1186
- Remember that you can gain/lose key responder status either because another view in the same pane is becoming first responder or because another pane is about to become key.
1715
+ This method is invoked just before you become the key responder. The
1716
+ passed view is the view that is about to lose keyResponder status. You
1717
+ can use this to do any setup before the view changes.
1718
+ Remember that you can gain/lose key responder status either because
1719
+ another view in the same pane is becoming first responder or because
1720
+ another pane is about to become key.
1187
1721
 
1188
1722
  @param {SC.Responder} responder
1189
1723
  */
@@ -1200,7 +1734,11 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1200
1734
  didBecomeKeyResponderFrom: function(responder) {},
1201
1735
 
1202
1736
  /**
1203
- This method will process a key input event, attempting to convert it to an appropriate action method and sending it up the responder chain. The event is converted using the SC.KEY_BINDINGS hash, which maps key events into method names. If no key binding is found, then the key event will be passed along using an insertText() method.
1737
+ This method will process a key input event, attempting to convert it to
1738
+ an appropriate action method and sending it up the responder chain. The
1739
+ event is converted using the SC.KEY_BINDINGS hash, which maps key events
1740
+ into method names. If no key binding is found, then the key event will
1741
+ be passed along using an insertText() method.
1204
1742
 
1205
1743
  @param {SC.Event} event
1206
1744
  @returns {Object} object that handled event, if any
@@ -1234,7 +1772,9 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1234
1772
  },
1235
1773
 
1236
1774
  /**
1237
- This method is invoked by interpretKeyEvents() when you receive a key event matching some plain text. You can use this to actually insert the text into your application, if needed.
1775
+ This method is invoked by interpretKeyEvents() when you receive a key
1776
+ event matching some plain text. You can use this to actually insert the
1777
+ text into your application, if needed.
1238
1778
 
1239
1779
  @param {SC.Event} event
1240
1780
  @returns {Object} receiver or object that handled event
@@ -1283,13 +1823,19 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1283
1823
  @type SC.View
1284
1824
  */
1285
1825
  nextValidKeyView: function() {
1286
- var seen = [],
1287
- rootView = this.pane(), ret;
1288
- ret = rootView._computeNextValidKeyView(this, seen);
1826
+ var seen = [],
1827
+ rootView = this.pane(), ret = this.get('nextKeyView');
1828
+
1829
+ if(!ret) ret = rootView._computeNextValidKeyView(this, seen);
1830
+
1831
+ if(SC.TABBING_ONLY_INSIDE_DOCUMENT && !ret) {
1832
+ ret = rootView._computeNextValidKeyView(rootView, seen);
1833
+ }
1834
+
1289
1835
  return ret ;
1290
1836
  }.property('nextKeyView'),
1291
1837
 
1292
- _computeNextValidKeyView: function(currentView, seen) {
1838
+ _computeNextValidKeyView: function(currentView, seen) {
1293
1839
  var ret = this.get('nextKeyView'),
1294
1840
  children, i, childLen, child;
1295
1841
  if(this !== currentView && seen.indexOf(currentView)!=-1 &&
@@ -1301,7 +1847,7 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1301
1847
  // find next sibling
1302
1848
  if (!ret) {
1303
1849
  children = this.get('childViews');
1304
- for(i=0, childLen= children.length; i<childLen; i++){
1850
+ for(i=0, childLen = children.length; i<childLen; i++){
1305
1851
  child = children[i];
1306
1852
  if(child.get('isVisibleInWindow') && child.get('isVisible')){
1307
1853
  ret = child._computeNextValidKeyView(currentView, seen);
@@ -1329,8 +1875,8 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1329
1875
  */
1330
1876
  previousValidKeyView: function() {
1331
1877
  var seen = [],
1332
- rootView = this.pane(), ret;
1333
- ret = rootView._computePreviousValidKeyView(this, seen);
1878
+ rootView = this.pane(), ret = this.get('previousKeyView');
1879
+ if(!ret) ret = rootView._computePreviousValidKeyView(this, seen);
1334
1880
  return ret ;
1335
1881
  }.property('previousKeyView'),
1336
1882
 
@@ -1374,6 +1920,32 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1374
1920
 
1375
1921
  sc_super() ;
1376
1922
 
1923
+ // set up theme
1924
+ var baseTheme = this.baseTheme;
1925
+ this.baseTheme = this._baseThemeProperty;
1926
+ this.set("baseTheme", baseTheme);
1927
+
1928
+ var theme = this.theme;
1929
+ this.theme = this._themeProperty;
1930
+ this.set("theme", theme);
1931
+
1932
+ // find render path (to be removed in SC 2.0?)
1933
+ var renderAge = -1, rendererAge = -1, currentAge = 0, c = this.constructor;
1934
+ while (c && c.prototype.render) {
1935
+ if (renderAge < 0 && c.prototype.render !== this.render) renderAge = currentAge;
1936
+ if (rendererAge < 0 && c.prototype.createRenderer !== this.createRenderer) rendererAge = currentAge;
1937
+ if (rendererAge >= 0 && renderAge >= 0) break;
1938
+ currentAge = currentAge + 1;
1939
+ c = c.superclass;
1940
+ }
1941
+
1942
+ // which one?
1943
+ if (renderAge < rendererAge && renderAge >= 0) {
1944
+ this._useRenderFirst = YES;
1945
+ } else {
1946
+ this._useRenderFirst = NO;
1947
+ }
1948
+
1377
1949
  // register for event handling now if we're not a materialized view
1378
1950
  // (materialized views register themselves as needed)
1379
1951
  if (!this.get('isMaterialized')) {
@@ -1385,6 +1957,7 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1385
1957
  // setup child views. be sure to clone the child views array first
1386
1958
  this.childViews = childViews ? childViews.slice() : [] ;
1387
1959
  this.createChildViews() ; // setup child Views
1960
+ this._hasCreatedChildViews = YES;
1388
1961
 
1389
1962
  // register display property observers ..
1390
1963
  // TODO: Optimize into class setup
@@ -1430,18 +2003,20 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1430
2003
  */
1431
2004
  destroy: function() {
1432
2005
  if (this.get('isDestroyed')) return this; // nothing to do
1433
-
1434
- sc_super();
2006
+
2007
+ this._destroy(); // core destroy method
1435
2008
 
1436
2009
  // remove from parent if found
1437
2010
  this.removeFromParent() ;
1438
- this._destroy(); // core destroy method
1439
2011
 
1440
2012
  // unregister for drags
1441
2013
  if (this.get('isDropTarget')) SC.Drag.removeDropTarget(this) ;
1442
2014
 
1443
2015
  // unregister for autoscroll during drags
1444
2016
  if (this.get('isScrollable')) SC.Drag.removeScrollableView(this) ;
2017
+
2018
+ //Do generic destroy. It takes care of mixins and sets isDestroyed to YES.
2019
+ sc_super();
1445
2020
  return this; // done with cleanup
1446
2021
  },
1447
2022
 
@@ -1456,7 +2031,7 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1456
2031
  var childViews = this.get('childViews'), len = childViews.length, idx ;
1457
2032
  if (len) {
1458
2033
  childViews = childViews.slice() ;
1459
- for (idx=0; idx<len; ++idx) childViews[idx]._destroy() ;
2034
+ for (idx=0; idx<len; ++idx) childViews[idx].destroy() ;
1460
2035
  }
1461
2036
 
1462
2037
  // next remove view from global hash
@@ -1464,8 +2039,6 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1464
2039
  delete this._CQ ;
1465
2040
  delete this.page ;
1466
2041
 
1467
- // mark as destroyed so we don't do this again
1468
- this.set('isDestroyed', YES) ;
1469
2042
  return this ;
1470
2043
  },
1471
2044
 
@@ -1550,7 +2123,29 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1550
2123
  // ...........................................
1551
2124
  // LAYOUT
1552
2125
  //
1553
-
2126
+
2127
+ /**
2128
+ The 'frame' property depends on the 'layout' property as well as the
2129
+ parent view’s frame. In order to properly invalidate any cached values,
2130
+ we need to invalidate the cache whenever 'layout' changes. However,
2131
+ observing 'layout' does not guarantee that; the observer might not be run
2132
+ immediately.
2133
+
2134
+ In order to avoid any window of opportunity where the cached frame could
2135
+ be invalid, we need to force layoutDidChange() to always immediately run
2136
+ whenever 'layout' is set.
2137
+ */
2138
+ propertyDidChange: function(key, value, _keepCache) {
2139
+ // If the key is 'layout', we need to call layoutDidChange() immediately
2140
+ // so that if the frame has changed any cached values (for both this view
2141
+ // and any child views) can be appropriately invalidated.
2142
+ if (key === 'layout') this.layoutDidChange();
2143
+
2144
+ // Resume notification as usual.
2145
+ sc_super();
2146
+ },
2147
+
2148
+
1554
2149
  /**
1555
2150
  This convenience method will take the current layout, apply any changes
1556
2151
  you pass and set it again. It is more convenient than having to do this
@@ -1599,13 +2194,221 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1599
2194
  }
1600
2195
  }
1601
2196
  }
2197
+ // now set adjusted layout
2198
+ if (didChange) this.set('layout', layout) ;
1602
2199
 
2200
+ return this ;
2201
+ },
2202
+
2203
+
2204
+ /**
2205
+ Animate a given property using CSS animations.
2206
+
2207
+ Takes a key, value and either a duration, or a hash of options.
2208
+ The options hash has the following parameters
2209
+ - duration: Duration of animation in seconds
2210
+ - callback: Callback method to run when animation completes
2211
+ - timing: Animation timing function
2212
+
2213
+ @param {String|Hash} key
2214
+ @param {Object} value
2215
+ @params {Number|Hash} duration or options
2216
+ @returns {SC.View} receiver
2217
+ */
2218
+ animate: function(keyOrHash, valueOrOptions, optionsOrCallback, callback) {
2219
+ var hash, options;
2220
+
2221
+ if (SC.typeOf(keyOrHash) === SC.T_HASH) {
2222
+ hash = keyOrHash;
2223
+ options = valueOrOptions;
2224
+ callback = optionsOrCallback;
2225
+ } else {
2226
+ hash = {};
2227
+ hash[keyOrHash] = valueOrOptions;
2228
+ options = optionsOrCallback;
2229
+ }
2230
+
2231
+ if (SC.typeOf(options) === SC.T_NUMBER) {
2232
+ options = { duration: options };
2233
+ } else if (SC.typeOf(options) !== SC.T_HASH) {
2234
+ throw "Must provide options hash or duration!";
2235
+ }
2236
+
2237
+ if (callback) options.callback = callback;
2238
+
2239
+
2240
+ var layout = SC.clone(this.get('layout')), didChange = NO, value, cur, animValue, curAnim;
2241
+
2242
+ for(key in hash) {
2243
+ if (!hash.hasOwnProperty(key)) continue;
2244
+ value = hash[key];
2245
+ cur = layout[key];
2246
+
2247
+ if (SC.ANIMATABLE_PROPERTIES.contains(key)) {
2248
+ curAnim = layout['animate'+key.capitalize()];
2249
+
2250
+ if (value === null || value === undefined) {
2251
+ throw "Can only animate to an actual value!";
2252
+ } else {
2253
+ if (cur !== value) didChange = YES;
2254
+
2255
+ // FIXME: We should check more than duration
2256
+ // Also, will we allow people to just set a number instead of a hash? If so, we have to account for that.
2257
+ if (curAnim && curAnim.duration !== options.duration) didChange = YES ;
2258
+
2259
+ layout[key] = value ;
2260
+
2261
+ // I'm pretty sure we want to be cloning this because we may be applying it
2262
+ // to multiple properties which can be edited independently
2263
+ layout['animate'+key.capitalize()] = SC.clone(options);
2264
+ }
2265
+ } else {
2266
+ if (cur !== value) didChange = YES;
2267
+ layout[key] = value;
2268
+ }
2269
+ }
2270
+
1603
2271
  // now set adjusted layout
1604
2272
  if (didChange) this.set('layout', layout) ;
1605
2273
 
1606
2274
  return this ;
1607
2275
  },
1608
-
2276
+
2277
+ /**
2278
+ Resets animation, stopping all existing animations.
2279
+ */
2280
+ resetAnimation: function() {
2281
+ var layout = this.get('layout'), didChange = NO, key;
2282
+ for (key in layout) {
2283
+ if (key.substring(0,7) === 'animate') {
2284
+ didChange = YES;
2285
+ delete layout[key];
2286
+ }
2287
+ }
2288
+ if (didChange) {
2289
+ this.set('layout', layout);
2290
+ this.notifyPropertyChange('layout');
2291
+ }
2292
+ return this;
2293
+ },
2294
+
2295
+ _scv_willRenderAnimations: function(){
2296
+ if (SC.platform.supportsCSSTransitions) {
2297
+ var layer = this.get('layer'),
2298
+ currentStyle = layer ? layer.style : null,
2299
+ newStyle = this.get('layoutStyle'),
2300
+ transitionStyle = newStyle[SC.platform.domCSSPrefix+"Transition"],
2301
+ layout = this.get('layout'),
2302
+ key;
2303
+
2304
+ // Handle existing animations
2305
+ if (this._activeAnimations) {
2306
+ for(key in this._activeAnimations){
2307
+ // TODO: Check for more than duration
2308
+ if (
2309
+ newStyle[key] !== currentStyle[key] ||
2310
+ !this._pendingAnimations || !this._pendingAnimations[key] ||
2311
+ this._activeAnimations[key].duration !== this._pendingAnimations[key].duration
2312
+ ) {
2313
+ var callback = this._activeAnimations[key].callback;
2314
+ if (callback) {
2315
+ if (this._animatedTransforms && this._animatedTransforms.length > 0) {
2316
+ for (idx=0; idx < this._animatedTransforms.length; idx++) {
2317
+ this._scv_runAnimationCallback(callback, null, this._animatedTransforms[idx], YES);
2318
+ }
2319
+ this._animatedTransforms = null;
2320
+ } else {
2321
+ this._scv_runAnimationCallback(callback, null, key, YES);
2322
+ }
2323
+ }
2324
+
2325
+ this._scv_removeAnimationFromLayout(key, YES);
2326
+ }
2327
+ }
2328
+ }
2329
+
2330
+ this._activeAnimations = this._pendingAnimations;
2331
+ this._pendingAnimations = null;
2332
+ } else {
2333
+ // Transitions not supported
2334
+ var key;
2335
+ for (key in this._pendingAnimations) {
2336
+ var callback = this._pendingAnimations[key].callback;
2337
+ if (callback) this._scv_runAnimationCallback(callback, null, key, NO);
2338
+ this._scv_removeAnimationFromLayout(key, NO, YES);
2339
+ }
2340
+ this._activeAnimations = this._pendingAnimations = null;
2341
+ }
2342
+ },
2343
+
2344
+ _scv_removeAnimationFromLayout: function(propertyName, updateStyle, isPending) {
2345
+
2346
+ if (updateStyle) {
2347
+ var layer = this.get('layer'),
2348
+ updatedCSS = [], key;
2349
+ for(key in this._activeAnimations) {
2350
+ if (key !== propertyName) updatedCSS.push(this._activeAnimations[key].css);
2351
+ }
2352
+
2353
+ // FIXME: Not really sure this is the right way to do it, but we don't want to trigger a layout update
2354
+ layer.style[SC.platform.domCSSPrefix+"Transition"] = updatedCSS.join(', ');
2355
+ }
2356
+
2357
+
2358
+ var layout = this.get('layout');
2359
+
2360
+ if (propertyName === '-'+SC.platform.cssPrefix+'-transform' && this._animatedTransforms && this._animatedTransforms.length > 0) {
2361
+ for(idx=0; idx < this._animatedTransforms.length; idx++) {
2362
+ delete layout['animate'+this._animatedTransforms[idx].capitalize()];
2363
+ }
2364
+ this._animatedTransforms = null;
2365
+ }
2366
+ delete layout['animate'+propertyName.capitalize()];
2367
+
2368
+ if (!isPending) delete this._activeAnimations[propertyName];
2369
+ },
2370
+
2371
+ _scv_runAnimationCallback: function(callback, evt, propertyName, cancelled) {
2372
+ if (callback) {
2373
+ if (SC.typeOf(callback) !== SC.T_HASH) callback = { action: callback };
2374
+ callback.source = this;
2375
+ if (!callback.target) callback.target = this;
2376
+ }
2377
+ SC.View.runCallback(callback, { event: evt, propertyName: propertyName, view: this, isCancelled: cancelled });
2378
+ },
2379
+
2380
+ /**
2381
+ Called when animation ends, should not usually be called manually
2382
+ */
2383
+ _scv_animationEnd: function(evt){
2384
+ // WARNING: Sometimes this will get called more than once for a property. Not sure why.
2385
+
2386
+ var propertyName = evt.originalEvent.propertyName,
2387
+ layout = this.get('layout'),
2388
+ animation;
2389
+
2390
+ animation = this._activeAnimations ? this._activeAnimations[propertyName] : null;
2391
+
2392
+ if(animation) {
2393
+ if (animation.callback) {
2394
+ // Charles says this is a good idea
2395
+ SC.RunLoop.begin();
2396
+ // We're using invokeLater so we don't trigger any layout changes from the callbacks until the animations are done
2397
+ if (this._animatedTransforms && this._animatedTransforms.length > 0) {
2398
+ for (idx=0; idx < this._animatedTransforms.length; idx++) {
2399
+ this.invokeLater('_scv_runAnimationCallback', 1, animation.callback, evt, this._animatedTransforms[idx], NO);
2400
+ }
2401
+ } else {
2402
+ this.invokeLater('_scv_runAnimationCallback', 1, animation.callback, evt, propertyName, NO);
2403
+ }
2404
+ SC.RunLoop.end();
2405
+ }
2406
+
2407
+ this._scv_removeAnimationFromLayout(propertyName, YES);
2408
+ }
2409
+ },
2410
+
2411
+
1609
2412
  /**
1610
2413
  The layout describes how you want your view to be positions on the
1611
2414
  screen. You can define the following properties:
@@ -1660,10 +2463,6 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1660
2463
  convertFrameToView: function(frame, targetView) {
1661
2464
  var myX=0, myY=0, targetX=0, targetY=0, view = this, f ;
1662
2465
 
1663
- if (this.get('useStaticLayout')) {
1664
- throw "convertFrameToView is not available with static layout";
1665
- }
1666
-
1667
2466
  // walk up this side
1668
2467
  while (view) {
1669
2468
  f = view.get('frame'); myX += f.x; myY += f.y ;
@@ -1704,15 +2503,12 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1704
2503
  @test in converFrames
1705
2504
  */
1706
2505
  convertFrameFromView: function(frame, targetView) {
1707
- var myX=0, myY=0, targetX=0, targetY=0, view = this, next, f ;
1708
-
1709
- if (this.get('useStaticLayout')) {
1710
- throw "convertFrameToView is not available with static layout";
1711
- }
2506
+ var myX=0, myY=0, targetX=0, targetY=0, view = this, f ;
1712
2507
 
1713
2508
  // walk up this side
1714
- while (view && view.get('frame')) {
1715
- f = view.get('frame'); myX += f.x; myY += f.y ;
2509
+ //Note: Intentional assignment of variable f
2510
+ while (view && (f = view.get('frame'))) {
2511
+ myX += f.x; myY += f.y ;
1716
2512
  view = view.get('parentView') ;
1717
2513
  }
1718
2514
 
@@ -1760,7 +2556,7 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1760
2556
  */
1761
2557
  frame: function() {
1762
2558
  return this.computeFrameWithParentFrame(null) ;
1763
- }.property('layout', 'useStaticLayout').cacheable(),
2559
+ }.property('useStaticLayout').cacheable(), // We depend on the layout, but layoutDidChange will call viewDidChange to check the frame for us
1764
2560
 
1765
2561
  /**
1766
2562
  Computes what the frame of this view would be if the parent were resized
@@ -1780,108 +2576,158 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1780
2576
  computeFrameWithParentFrame: function(pdim) {
1781
2577
  var layout = this.get('layout'),
1782
2578
  f = {} , error, layer, AUTO = SC.LAYOUT_AUTO,
1783
- stLayout = this.get('useStaticLayout') ;
1784
-
1785
- if (layout.width !== undefined &&
1786
- layout.width === SC.LAYOUT_AUTO &&
2579
+ stLayout = this.get('useStaticLayout'),
2580
+ pv = this.get('parentView'),
2581
+ dH, dW, //shortHand for parentDimensions
2582
+ borderTop, borderLeft,
2583
+ lR = layout.right,
2584
+ lL = layout.left,
2585
+ lT = layout.top,
2586
+ lB = layout.bottom,
2587
+ lW = layout.width,
2588
+ lH = layout.height,
2589
+ lcX = layout.centerX,
2590
+ lcY = layout.centerY;
2591
+
2592
+ if (lW !== undefined &&
2593
+ lW === SC.LAYOUT_AUTO &&
1787
2594
  stLayout !== undefined && !stLayout) {
1788
- error = SC.Error.desc("%@.layout() you cannot use width:auto if staticLayout is disabled".fmt(this),"%@".fmt(this), -1) ;
1789
- console.error(error.toString()) ;
1790
- throw error ;
2595
+ error = SC.Error.desc(("%@.layout() cannot use width:auto if "+
2596
+ "staticLayout is disabled").fmt(this), "%@".fmt(this), -1);
2597
+ console.error(error.toString()) ;
2598
+ throw error ;
1791
2599
  }
1792
2600
 
1793
- if (layout.height !== undefined &&
1794
- layout.height === SC.LAYOUT_AUTO &&
2601
+ if (lH !== undefined &&
2602
+ lH === SC.LAYOUT_AUTO &&
1795
2603
  stLayout !== undefined && !stLayout) {
1796
- error = SC.Error.desc("%@.layout() you cannot use height:auto if staticLayout is disabled".fmt(this),"%@".fmt(this), -1) ;
1797
- console.error(error.toString()) ;
2604
+ error = SC.Error.desc(("%@.layout() cannot use height:auto if "+
2605
+ "staticLayout is disabled").fmt(this),"%@".fmt(this), -1);
2606
+ console.error(error.toString()) ;
1798
2607
  throw error ;
1799
2608
  }
1800
2609
 
1801
- if (stLayout) return null; // can't compute
2610
+ if (stLayout) {
2611
+ // need layer to be able to compute rect
2612
+ if (layer = this.get('layer')) {
2613
+ f = SC.viewportOffset(layer); // x,y
2614
+ if (pv) f = pv.convertFrameFromView(f, null);
2615
+
2616
+ /*
2617
+ TODO Can probably have some better width/height values - CC
2618
+ */
2619
+ f.width = layer.offsetWidth;
2620
+ f.height = layer.offsetHeight;
2621
+ return f;
2622
+ }
2623
+ return null; // can't compute
2624
+ }
2625
+
2626
+
2627
+ if (!pdim) pdim = this.computeParentDimensions(layout) ;
2628
+ dH = pdim.height;
2629
+ dW = pdim.width;
1802
2630
 
1803
2631
  // handle left aligned and left/right
1804
- if (!SC.none(layout.left)) {
1805
- f.x = Math.floor(layout.left) ;
1806
- if (layout.width !== undefined) {
1807
- if(layout.width === AUTO) f.width = AUTO ;
1808
- else f.width = Math.floor(layout.width) ;
1809
- } else { // better have layout.right!
1810
- if (!pdim) pdim = this.computeParentDimensions(layout) ;
1811
- f.width = Math.floor(pdim.width - f.x - (layout.right || 0)) ;
2632
+ if (!SC.none(lL)) {
2633
+ if(SC.isPercentage(lL)){
2634
+ f.x = dW*lL;
2635
+ }else{
2636
+ f.x = lL ;
2637
+ }
2638
+ if (lW !== undefined) {
2639
+ if(lW === AUTO) f.width = AUTO ;
2640
+ else if(SC.isPercentage(lW)) f.width = dW*lW ;
2641
+ else f.width = lW ;
2642
+ } else { // better have lR!
2643
+ f.width = dW - f.x ;
2644
+ if(lR && SC.isPercentage(lR)) f.width = f.width - (lR*dW) ;
2645
+ else f.width = f.width - (lR || 0) ;
1812
2646
  }
1813
-
1814
2647
  // handle right aligned
1815
- } else if (!SC.none(layout.right)) {
1816
- if (!pdim) pdim = this.computeParentDimensions(layout) ;
1817
- if (SC.none(layout.width)) {
1818
- f.width = pdim.width - layout.right ;
2648
+ } else if (!SC.none(lR)) {
2649
+ if (SC.none(lW)) {
2650
+ if (SC.isPercentage(lL)) f.width = dW - (dW*lR) ;
2651
+ else f.width = dW - lR ;
1819
2652
  f.x = 0 ;
1820
2653
  } else {
1821
- if(layout.width === AUTO) f.width = AUTO ;
1822
- else f.width = Math.floor(layout.width || 0) ;
1823
- f.x = Math.floor(pdim.width - layout.right - f.width) ;
2654
+ if(lW === AUTO) f.width = AUTO ;
2655
+ else if(SC.isPercentage(lW)) f.width = dW*lW ;
2656
+ else f.width = (lW || 0) ;
2657
+ if (SC.isPercentage(lW)) f.x = dW - (lR*dW) - f.width ;
2658
+ else f.x = dW - lR - f.width ;
1824
2659
  }
1825
2660
 
1826
2661
  // handle centered
1827
- } else if (!SC.none(layout.centerX)) {
1828
- if (!pdim) pdim = this.computeParentDimensions(layout) ;
1829
- if(layout.width === AUTO) f.width = AUTO ;
1830
- else f.width = Math.floor(layout.width || 0) ;
1831
- f.x = Math.floor((pdim.width - f.width)/2 + layout.centerX) ;
2662
+ } else if (!SC.none(lcX)) {
2663
+ if(lW === AUTO) f.width = AUTO ;
2664
+ else if (SC.isPercentage(lW)) f.width = lW*dW ;
2665
+ else f.width = (lW || 0) ;
2666
+ if(SC.isPercentage(lcX)) f.x = (dW - f.width)/2 + (lcX*dW) ;
2667
+ else f.x = (dW - f.width)/2 + lcX ;
1832
2668
  } else {
1833
2669
  f.x = 0 ; // fallback
1834
- if (SC.none(layout.width)) {
1835
- if (!pdim) pdim = this.computeParentDimensions(layout) ;
1836
- f.width = Math.floor(pdim.width) ;
2670
+ if (SC.none(lW)) {
2671
+ f.width = dW ;
1837
2672
  } else {
1838
- if(layout.width === AUTO) f.width = AUTO ;
1839
- else f.width = Math.floor(layout.width || 0) ;
2673
+ if(lW === AUTO) f.width = AUTO ;
2674
+ if (SC.isPercentage(lW)) f.width = lW*dW ;
2675
+ else f.width = (lW || 0) ;
1840
2676
  }
1841
2677
  }
1842
2678
 
1843
2679
  // handle top aligned and top/bottom
1844
- if (!SC.none(layout.top)) {
1845
- f.y = Math.floor(layout.top) ;
1846
- if (layout.height !== undefined) {
1847
- if(layout.height === AUTO) f.height = AUTO ;
1848
- else f.height = Math.floor(layout.height) ;
1849
- } else { // better have layout.bottm!
1850
- if (!pdim) pdim = this.computeParentDimensions(layout) ;
1851
- f.height = Math.floor(pdim.height - f.y - (layout.bottom || 0)) ;
2680
+ if (!SC.none(lT)) {
2681
+ if(SC.isPercentage(lT)) f.y = lT*dH ;
2682
+ else f.y = lT ;
2683
+ if (lH !== undefined) {
2684
+ if(lH === AUTO) f.height = AUTO ;
2685
+ else if(SC.isPercentage(lH)) f.height = lH*dH ;
2686
+ else f.height = lH ;
2687
+ } else { // better have lB!
2688
+ if(lB && SC.isPercentage(lB)) f.height = dH - f.y - (lB*dH) ;
2689
+ else f.height = dH - f.y - (lB || 0) ;
1852
2690
  }
1853
2691
 
1854
2692
  // handle bottom aligned
1855
- } else if (!SC.none(layout.bottom)) {
1856
- if (!pdim) pdim = this.computeParentDimensions(layout) ;
1857
- if (SC.none(layout.height)) {
1858
- f.height = pdim.height - layout.bottom ;
2693
+ } else if (!SC.none(lB)) {
2694
+ if (SC.none(lH)) {
2695
+ if (SC.isPercentage(lB)) f.height = dH - (lB*dH) ;
2696
+ else f.height = dH - lB ;
1859
2697
  f.y = 0 ;
1860
2698
  } else {
1861
- if(layout.height === AUTO) f.height = AUTO ;
1862
- else f.height = Math.floor(layout.height || 0) ;
1863
- f.y = Math.floor(pdim.height - layout.bottom - f.height) ;
2699
+ if(lH === AUTO) f.height = AUTO ;
2700
+ if (lH && SC.isPercentage(lH)) f.height = lH*dH ;
2701
+ else f.height = (lH || 0) ;
2702
+ if (SC.isPercentage(lB)) f.y = dH - (lB*dH) - f.height ;
2703
+ else f.y = dH - lB - f.height ;
1864
2704
  }
1865
2705
 
1866
2706
  // handle centered
1867
- } else if (!SC.none(layout.centerY)) {
1868
- if (!pdim) pdim = this.computeParentDimensions(layout) ;
1869
- if(layout.height === AUTO) f.height = AUTO ;
1870
- else f.height = Math.floor(layout.height || 0) ;
1871
- f.y = Math.floor((pdim.height - f.height)/2 + layout.centerY) ;
2707
+ } else if (!SC.none(lcY)) {
2708
+ if(lH === AUTO) f.height = AUTO ;
2709
+ if (lH && SC.isPercentage(lH)) f.height = lH*dH ;
2710
+ else f.height = (lH || 0) ;
2711
+ if (SC.isPercentage(lcY)) f.y = (dH - f.height)/2 + (lcY*dH) ;
2712
+ else f.y = (dH - f.height)/2 + lcY ;
1872
2713
 
1873
2714
  // fallback
1874
2715
  } else {
1875
2716
  f.y = 0 ; // fallback
1876
- if (SC.none(layout.height)) {
1877
- if (!pdim) pdim = this.computeParentDimensions(layout) ;
1878
- f.height = Math.floor(pdim.height) ;
2717
+ if (SC.none(lH)) {
2718
+ f.height = dH ;
1879
2719
  } else {
1880
- if(layout.height === AUTO) f.height = AUTO ;
1881
- else f.height = Math.floor(layout.height || 0) ;
2720
+ if(lH === AUTO) f.height = AUTO ;
2721
+ if (SC.isPercentage(lH)) f.height = lH*dH ;
2722
+ else f.height = lH || 0 ;
1882
2723
  }
1883
2724
  }
1884
2725
 
2726
+ f.x = Math.floor(f.x);
2727
+ f.y = Math.floor(f.y);
2728
+ if(f.height !== AUTO) f.height = Math.floor(f.height);
2729
+ if(f.width !== AUTO) f.width = Math.floor(f.width);
2730
+
1885
2731
  // if width or height were set to auto and we have a layer, try lookup
1886
2732
  if (f.height === AUTO || f.width === AUTO) {
1887
2733
  layer = this.get('layer');
@@ -1889,6 +2735,24 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1889
2735
  if (f.width === AUTO) f.width = layer ? layer.clientWidth : 0;
1890
2736
  }
1891
2737
 
2738
+ // views with SC.Border mixin applied applied
2739
+ if (this.get('hasBorder')) {
2740
+ borderTop = this.get('borderTop');
2741
+ borderLeft = this.get('borderLeft');
2742
+ f.height -= borderTop+this.get('borderBottom');
2743
+ f.y += borderTop;
2744
+ f.width -= borderLeft+this.get('borderRight');
2745
+ f.x += borderLeft;
2746
+ }
2747
+
2748
+ // Account for special cases inside ScrollView, where we adjust the
2749
+ // element's scrollTop/scrollLeft property for performance reasons.
2750
+ if (pv && pv.isScrollContainer) {
2751
+ pv = pv.get('parentView');
2752
+ f.x -= pv.get('horizontalScrollOffset');
2753
+ f.y -= pv.get('verticalScrollOffset');
2754
+ }
2755
+
1892
2756
  // make sure the width/height fix min/max...
1893
2757
  if (!SC.none(layout.maxHeight) && (f.height > layout.maxHeight)) {
1894
2758
  f.height = layout.maxHeight ;
@@ -1930,36 +2794,72 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1930
2794
 
1931
2795
  /**
1932
2796
  The clipping frame returns the visible portion of the view, taking into
1933
- account the clippingFrame of the parent view. Keep in mind that the
1934
- clippingFrame is in the context of the view itself, not it's parent view.
1935
-
1936
- Normally this will be calculate based on the intersection of your own
1937
- clippingFrame and your parentView's clippingFrame.
2797
+ account the contentClippingFrame of the parent view. Keep in mind that
2798
+ the clippingFrame is in the context of the view itself, not it's parent
2799
+ view.
1938
2800
 
2801
+ Normally this will be calculated based on the intersection of your own
2802
+ clippingFrame and your parentView's contentClippingFrame.
2803
+
1939
2804
  @property {Rect}
1940
2805
  */
1941
2806
  clippingFrame: function() {
1942
- var pv= this.get('parentView'), f = this.get('frame'), ret = f ;
2807
+ var f = this.get('frame'),
2808
+ ret = f,
2809
+ pv, cf;
2810
+
2811
+ if (!f) return null;
2812
+ pv = this.get('parentView');
1943
2813
  if (pv) {
1944
- pv = pv.get('clippingFrame') ;
1945
- ret = SC.intersectRects(pv, f) ;
1946
- }
1947
- ret.x -= f.x ;
1948
- ret.y -= f.y ;
1949
- return ret ;
2814
+ cf = pv.get('contentClippingFrame');
2815
+ if (!cf) return f;
2816
+ ret = SC.intersectRects(cf, f);
2817
+ }
2818
+ ret.x -= f.x;
2819
+ ret.y -= f.y;
2820
+
2821
+ return ret;
1950
2822
  }.property('parentView', 'frame').cacheable(),
1951
2823
 
2824
+ /**
2825
+ The clipping frame child views should intersect with. Normally this is
2826
+ the same as the regular clippingFrame. However, you may override this
2827
+ method if you want the child views to actually draw more or less content
2828
+ than is actually visible for some reason.
2829
+
2830
+ Usually this is only used by the ScrollView to optimize drawing on touch
2831
+ devices.
2832
+
2833
+ @property {Rect}
2834
+ */
2835
+ contentClippingFrame: function() {
2836
+ return this.get("clippingFrame");
2837
+ }.property('clippingFrame').cacheable(),
2838
+
1952
2839
  /** @private
1953
- Whenever the clippingFrame changes, this observer will fire, notifying
1954
- child views that their frames have also changed.
2840
+ This method is invoked whenever the clippingFrame changes, notifying
2841
+ each child view that its clippingFrame has also changed.
1955
2842
  */
1956
2843
  _sc_view_clippingFrameDidChange: function() {
1957
2844
  var cvs = this.get('childViews'), len = cvs.length, idx, cv ;
1958
2845
  for (idx=0; idx<len; ++idx) {
1959
2846
  cv = cvs[idx] ;
1960
- if (!cv.hasStaticLayout) cv.notifyPropertyChange('clippingFrame') ;
2847
+
2848
+ // In SC 1.0 views with static layout did not receive notifications
2849
+ // of frame changes because they didn't support frames. In SC 1.1 they
2850
+ // do support frames, so they should receive notifications. Also in
2851
+ // SC 1.1 SC.StaticLayout is merged into SC.View. The mixin is only
2852
+ // for compatibility. This property is defined on the mixin.
2853
+ //
2854
+ // frame changes should be sent all the time unless this property is
2855
+ // present to indicate that we want the old 1.0 API behavior instead.
2856
+ //
2857
+ if (!cv.useStaticLayout) {
2858
+ cv.notifyPropertyChange('clippingFrame') ;
2859
+ cv._sc_view_clippingFrameDidChange();
2860
+ }
1961
2861
  }
1962
- }.observes('clippingFrame'),
2862
+ },
1963
2863
 
1964
2864
  /**
1965
2865
  This method may be called on your view whenever the parent view resizes.
@@ -1972,40 +2872,68 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
1972
2872
  @test in viewDidResize
1973
2873
  */
1974
2874
  parentViewDidResize: function() {
1975
- var layout = this.get('layout') ;
2875
+ var layout = this.get('layout'), isPercentageFunc, isPercentage, isFixed;
1976
2876
 
1977
2877
  // only resizes if the layout does something other than left/top - fixed
1978
2878
  // size.
1979
- var isFixed = (
2879
+ isFixed = (
1980
2880
  (layout.left !== undefined) && (layout.top !== undefined) &&
1981
2881
  (layout.width !== undefined) && (layout.height !== undefined)
1982
2882
  );
1983
-
1984
- if (!isFixed) {
1985
- this.notifyPropertyChange('frame') ;
1986
- this.viewDidResize() ;
2883
+
2884
+ isPercentageFunc = SC.isPercentage;
2885
+ isPercentage = (isPercentageFunc(layout.left) ||
2886
+ isPercentageFunc(layout.top) ||
2887
+ isPercentageFunc(layout.width) ||
2888
+ isPercentageFunc(layout.right) ||
2889
+ isPercentageFunc(layout.centerX) ||
2890
+ isPercentageFunc(layout.centerY));
2891
+
2892
+ // Do we think there's a chance our frame will have changed as a result?
2893
+ if (!isFixed || isPercentage) {
2894
+ // There's a chance our frame changed. Invoke viewDidResize(), which
2895
+ // will notify about our change to 'frame' (if it actually changed) and
2896
+ // appropriately notify our child views.
2897
+ this.viewDidResize();
1987
2898
  }
1988
2899
  },
1989
-
2900
+
2901
+
2902
+
1990
2903
  /**
1991
2904
  This method is invoked on your view when the view resizes due to a layout
1992
- change or due to the parent view resizing. You can override this method
2905
+ change or potentially due to the parent view resizing (if your view’s size
2906
+ depends on the size of your parent view). You can override this method
1993
2907
  to implement your own layout if you like, such as performing a grid
1994
2908
  layout.
1995
2909
 
1996
- The default implementation simply calls parentViewDidResize on all of
1997
- your children.
2910
+ The default implementation simply notifies about the change to 'frame' and
2911
+ then calls parentViewDidResize on all of your children.
1998
2912
 
1999
2913
  @returns {void}
2000
2914
  */
2001
2915
  viewDidResize: function() {
2916
+ this._viewFrameDidChange();
2917
+
2918
+ // Also notify our children.
2002
2919
  var cv = this.childViews, len = cv.length, idx, view ;
2003
2920
  for (idx=0; idx<len; ++idx) {
2004
- view = cv[idx] ;
2005
- if (view.parentViewDidResize) view.parentViewDidResize() ;
2921
+ view = cv[idx];
2922
+ view.parentViewDidResize();
2006
2923
  }
2007
- }.observes('layout'),
2008
-
2924
+ },
2925
+
2926
+ /** @private
2927
+ Invoked by other views to notify this view that its frame has changed.
2928
+
2929
+ This notifies the view that its frame property has changed,
2930
+ then propagates those changes to its child views.
2931
+ */
2932
+ _viewFrameDidChange: function() {
2933
+ this.notifyPropertyChange('frame');
2934
+ this._sc_view_clippingFrameDidChange();
2935
+ },
2936
+
2009
2937
  // Implementation note: As a general rule, paired method calls, such as
2010
2938
  // beginLiveResize/endLiveResize that are called recursively on the tree
2011
2939
  // should reverse the order when doing the final half of the call. This
@@ -2066,7 +2994,21 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
2066
2994
  if (this.didEndLiveResize) this.didEndLiveResize() ;
2067
2995
  return this ;
2068
2996
  },
2069
-
2997
+
2998
+ /**
2999
+ Setting wantsAcceleratedLayer to YES will use transforms to move the
3000
+ layer when available. On some platforms transforms are hardware accelerated.
3001
+ */
3002
+ wantsAcceleratedLayer: NO,
3003
+
3004
+ /**
3005
+ Specifies whether transforms can be used to move the layer.
3006
+ */
3007
+ hasAcceleratedLayer: function(){
3008
+ return this.get('wantsAcceleratedLayer') && SC.platform.supportsCSSTransforms;
3009
+ }.property('wantsAcceleratedLayer').cacheable(),
3010
+
3011
+
2070
3012
  /**
2071
3013
  layoutStyle describes the current styles to be written to your element
2072
3014
  based on the layout you defined. Both layoutStyle and frame reset when
@@ -2077,69 +3019,143 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
2077
3019
  @property {Hash}
2078
3020
  @readOnly
2079
3021
  */
3022
+
3023
+
2080
3024
  layoutStyle: function() {
2081
3025
  var layout = this.get('layout'), ret = {}, pdim = null, error,
2082
3026
  AUTO = SC.LAYOUT_AUTO,
2083
- stLayout = this.get('useStaticLayout');
2084
-
2085
- if (layout.width !== undefined &&
2086
- layout.width === SC.LAYOUT_AUTO &&
2087
- !stLayout) {
2088
- error= SC.Error.desc("%@.layout() you cannot use width:auto if staticLayout is disabled".fmt(this),"%@".fmt(this),-1);
2089
- console.error(error.toString()) ;
2090
- throw error ;
3027
+ dims = SC._VIEW_DEFAULT_DIMS, loc = dims.length, x, value, key,
3028
+ stLayout = this.get('useStaticLayout'),
3029
+ lR = layout.right,
3030
+ lL = layout.left,
3031
+ lT = layout.top,
3032
+ lB = layout.bottom,
3033
+ lW = layout.width,
3034
+ lH = layout.height,
3035
+ lMW = layout.maxWidth,
3036
+ lMH = layout.maxHeight,
3037
+ lcX = layout.centerX,
3038
+ lcY = layout.centerY,
3039
+ canUseAcceleratedLayer = this.get('hasAcceleratedLayer'),
3040
+ translateTop = null,
3041
+ translateLeft = null;
3042
+ if (lW !== undefined && lW === SC.LAYOUT_AUTO && !stLayout) {
3043
+ error= SC.Error.desc("%@.layout() you cannot use width:auto if ".fmt(this) +
3044
+ "staticLayout is disabled","%@".fmt(this),-1);
3045
+ console.error(error.toString()) ;
3046
+ throw error ;
2091
3047
  }
2092
3048
 
2093
- if (layout.height !== undefined &&
2094
- layout.height === SC.LAYOUT_AUTO &&
2095
- !stLayout) {
2096
- error = SC.Error.desc("%@.layout() you cannot use height:auto if staticLayout is disabled".fmt(this),"%@".fmt(this),-1);
3049
+ if (lH !== undefined && lH === SC.LAYOUT_AUTO && !stLayout) {
3050
+ error = SC.Error.desc("%@.layout() you cannot use height:auto if ".fmt(this) +
3051
+ "staticLayout is disabled","%@".fmt(this),-1);
2097
3052
  console.error(error.toString()) ;
2098
3053
  throw error ;
2099
3054
  }
2100
-
3055
+
3056
+ if (SC.platform.supportsCSSTransforms) {
3057
+ // Check to see if we're using transforms
3058
+ var animatingTransforms = NO, transformAnimationDuration;
3059
+ for(key in layout){
3060
+ if (key.substring(0,7) === 'animate') {
3061
+ if (SC.CSS_TRANSFORM_MAP[key.substring(7).camelize()]) {
3062
+ animatingTransforms = YES;
3063
+
3064
+ if (this._pendingAnimations && this._pendingAnimations['-'+SC.platform.cssPrefix+'-transform']) {
3065
+ throw "Animations of transforms must be executed simultaneously!";
3066
+ }
3067
+
3068
+ // TODO: If we want to allow it to be set as just a number for duration we need to add support here
3069
+ if (transformAnimationDuration && layout[key].duration !== transformAnimationDuration) {
3070
+ console.warn("Can't animate transforms with different durations! Using first duration specified.");
3071
+ layout[key].duration = transformAnimationDuration;
3072
+ }
3073
+ transformAnimationDuration = layout[key].duration;
3074
+
3075
+ // FIXME: There will also be problems if we have conflicting timings and callbacks
3076
+ }
3077
+ }
3078
+ }
3079
+
3080
+ // If we're animating other transforms at different speeds, don't use acceleratedLayer
3081
+ if (
3082
+ animatingTransforms &&
3083
+ (
3084
+ (layout['animateTop'] && layout['animateTop'].duration !== transformAnimationDuration) ||
3085
+ (layout['animateLeft'] && layout['animateLeft'].duration !== transformAnimationDuration)
3086
+ )
3087
+ ) {
3088
+ canUseAcceleratedLayer = NO;
3089
+ }
3090
+ }
3091
+
2101
3092
  // X DIRECTION
2102
-
3093
+
2103
3094
  // handle left aligned and left/right
2104
- if (!SC.none(layout.left)) {
2105
- ret.left = Math.floor(layout.left);
2106
- if (layout.width !== undefined) {
2107
- if(layout.width === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
2108
- else ret.width = Math.floor(layout.width) ;
3095
+ if (!SC.none(lL)) {
3096
+ if(SC.isPercentage(lL)) {
3097
+ ret.left = (lL*100)+"%"; //percentage left
3098
+ } else if (canUseAcceleratedLayer && !SC.empty(lW)) {
3099
+ translateLeft = Math.floor(lL);
3100
+ ret.left = 0;
3101
+ } else {
3102
+ ret.left = Math.floor(lL); //px left
3103
+ }
3104
+ ret.marginLeft = 0 ;
3105
+
3106
+ if (lW !== undefined) {
3107
+ if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
3108
+ else if(SC.isPercentage(lW)) ret.width = (lW*100)+"%"; //percentage width
3109
+ else ret.width = Math.floor(lW) ; //px width
2109
3110
  ret.right = null ;
2110
3111
  } else {
2111
3112
  ret.width = null ;
2112
- ret.right = Math.floor(layout.right || 0) ;
3113
+ if(lR && SC.isPercentage(lR)) ret.right = (lR*100)+"%"; //percentage right
3114
+ else ret.right = Math.floor(lR || 0) ; //px right
2113
3115
  }
2114
- ret.marginLeft = 0 ;
2115
3116
 
2116
3117
  // handle right aligned
2117
- } else if (!SC.none(layout.right)) {
2118
- ret.right = Math.floor(layout.right) ;
3118
+ } else if (!SC.none(lR)) {
3119
+ if(SC.isPercentage(lR)) {
3120
+ ret.right = Math.floor(lR*100)+"%"; //percentage left
3121
+ }else{
3122
+ ret.right = Math.floor(lR) ;
3123
+ }
2119
3124
  ret.marginLeft = 0 ;
2120
3125
 
2121
- if (SC.none(layout.width)) {
2122
- ret.left = 0;
3126
+ if (SC.none(lW)) {
3127
+ if (SC.none(lMW)) ret.left = 0;
2123
3128
  ret.width = null;
2124
3129
  } else {
2125
3130
  ret.left = null ;
2126
- if(layout.width === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
2127
- else ret.width = Math.floor(layout.width || 0) ;
3131
+ if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
3132
+ else if(lW && SC.isPercentage(lW)) ret.width = (lW*100)+"%" ; //percentage width
3133
+ else ret.width = Math.floor(lW || 0) ; //px width
2128
3134
  }
2129
3135
 
2130
3136
  // handle centered
2131
- } else if (!SC.none(layout.centerX)) {
3137
+ } else if (!SC.none(lcX)) {
2132
3138
  ret.left = "50%";
2133
- ret.width = Math.floor(layout.width || 0) ;
2134
- ret.marginLeft = Math.floor(layout.centerX - ret.width/2) ;
3139
+ if(lW && SC.isPercentage(lW)) ret.width = (lW*100)+"%" ; //percentage width
3140
+ else ret.width = Math.floor(lW || 0) ;
3141
+ if(lW && SC.isPercentage(lW) && (SC.isPercentage(lcX) || SC.isPercentage(lcX*-1))){
3142
+ ret.marginLeft = Math.floor((lcX - lW/2)*100)+"%" ;
3143
+ }else if(lW && lW >= 1 && !SC.isPercentage(lcX)){
3144
+ ret.marginLeft = Math.floor(lcX - ret.width/2) ;
3145
+ }else {
3146
+ // This error message happens whenever width is not set.
3147
+ console.warn("You have to set width and centerX using both percentages or pixels");
3148
+ ret.marginLeft = "50%";
3149
+ }
2135
3150
  ret.right = null ;
2136
3151
 
2137
3152
  // if width defined, assume top/left of zero
2138
- } else if (!SC.none(layout.width)) {
3153
+ } else if (!SC.none(lW)) {
2139
3154
  ret.left = 0;
2140
3155
  ret.right = null;
2141
- if(layout.width === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
2142
- else ret.width = Math.floor(layout.width);
3156
+ if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
3157
+ else if(SC.isPercentage(lW)) ret.width = (lW*100)+"%";
3158
+ else ret.width = Math.floor(lW);
2143
3159
  ret.marginLeft = 0;
2144
3160
 
2145
3161
  // fallback, full width.
@@ -2157,44 +3173,65 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
2157
3173
 
2158
3174
  // Y DIRECTION
2159
3175
 
2160
- // handle left aligned and left/right
2161
- if (!SC.none(layout.top)) {
2162
- ret.top = Math.floor(layout.top);
2163
- if (layout.height !== undefined) {
2164
- if(layout.height === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
2165
- else ret.height = Math.floor(layout.height) ;
3176
+ // handle top aligned and left/right
3177
+ if (!SC.none(lT)) {
3178
+ if(SC.isPercentage(lT)) {
3179
+ ret.top = (lT*100)+"%";
3180
+ } else if (canUseAcceleratedLayer && !SC.empty(lH)) {
3181
+ translateTop = Math.floor(lT);
3182
+ ret.top = 0;
3183
+ } else {
3184
+ ret.top = Math.floor(lT);
3185
+ }
3186
+ if (lH !== undefined) {
3187
+ if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
3188
+ else if(SC.isPercentage(lH)) ret.height = (lH*100)+"%" ;
3189
+ else ret.height = Math.floor(lH) ;
2166
3190
  ret.bottom = null ;
2167
3191
  } else {
2168
3192
  ret.height = null ;
2169
- ret.bottom = Math.floor(layout.bottom || 0) ;
3193
+ if(lB && SC.isPercentage(lB)) ret.bottom = (lB*100)+"%" ;
3194
+ else ret.bottom = Math.floor(lB || 0) ;
2170
3195
  }
2171
3196
  ret.marginTop = 0 ;
2172
3197
 
2173
- // handle right aligned
2174
- } else if (!SC.none(layout.bottom)) {
3198
+ // handle bottom aligned
3199
+ } else if (!SC.none(lB)) {
2175
3200
  ret.marginTop = 0 ;
2176
- ret.bottom = Math.floor(layout.bottom) ;
2177
- if (SC.none(layout.height)) {
2178
- ret.top = 0;
3201
+ if(SC.isPercentage(lB)) ret.bottom = (lB*100)+"%";
3202
+ else ret.bottom = Math.floor(lB) ;
3203
+ if (SC.none(lH)) {
3204
+ if (SC.none(lMH)) ret.top = 0;
2179
3205
  ret.height = null ;
2180
3206
  } else {
2181
3207
  ret.top = null ;
2182
- if(layout.height === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
2183
- else ret.height = Math.floor(layout.height || 0) ;
3208
+ if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
3209
+ else if(lH && SC.isPercentage(lH)) ret.height = (lH*100)+"%" ;
3210
+ else ret.height = Math.floor(lH || 0) ;
2184
3211
  }
2185
3212
 
2186
3213
  // handle centered
2187
- } else if (!SC.none(layout.centerY)) {
3214
+ } else if (!SC.none(lcY)) {
2188
3215
  ret.top = "50%";
2189
- ret.height = Math.floor(layout.height || 0) ;
2190
- ret.marginTop = Math.floor(layout.centerY - ret.height/2) ;
2191
3216
  ret.bottom = null ;
2192
-
2193
- } else if (!SC.none(layout.height)) {
3217
+
3218
+ if(lH && SC.isPercentage(lH)) ret.height = (lH*100)+ "%" ;
3219
+ else ret.height = Math.floor(lH || 0) ;
3220
+
3221
+ if(lH && SC.isPercentage(lH) && (SC.isPercentage(lcY) || SC.isPercentage(lcY*-1))){ //height is percentage and lcy too
3222
+ ret.marginTop = Math.floor((lcY - lH/2)*100)+"%" ;
3223
+ }else if(lH && lH >= 1 && !SC.isPercentage(lcY)){
3224
+ ret.marginTop = Math.floor(lcY - ret.height/2) ;
3225
+ }else {
3226
+ console.warn("You have to set height and centerY to use both percentages or pixels");
3227
+ ret.marginTop = "50%";
3228
+ }
3229
+ } else if (!SC.none(lH)) {
2194
3230
  ret.top = 0;
2195
3231
  ret.bottom = null;
2196
- if(layout.height === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
2197
- else ret.height = Math.floor(layout.height || 0) ;
3232
+ if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
3233
+ else if(lH && SC.isPercentage(lH)) ret.height = (lH*100)+"%" ;
3234
+ else ret.height = Math.floor(lH || 0) ;
2198
3235
  ret.marginTop = 0;
2199
3236
 
2200
3237
  // fallback, full width.
@@ -2215,7 +3252,10 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
2215
3252
 
2216
3253
  // if zIndex is set, use it. otherwise let default shine through
2217
3254
  ret.zIndex = SC.none(layout.zIndex) ? null : layout.zIndex.toString();
2218
-
3255
+
3256
+ // if opacity is set, use it. otherwise let default shine through
3257
+ ret.opacity = SC.none(layout.opacity) ? null : layout.opacity.toString();
3258
+
2219
3259
  // if backgroundPosition is set, use it.
2220
3260
  // otherwise let default shine through
2221
3261
  ret.backgroundPosition = SC.none(layout.backgroundPosition) ?
@@ -2224,17 +3264,119 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
2224
3264
 
2225
3265
  // set default values to null to allow built-in CSS to shine through
2226
3266
  // currently applies only to marginLeft & marginTop
2227
- var dims = SC._VIEW_DEFAULT_DIMS, loc = dims.length, x;
2228
3267
  while(--loc >=0) {
2229
3268
  x = dims[loc];
2230
3269
  if (ret[x]===0) ret[x]=null;
2231
3270
  }
2232
-
3271
+
3272
+ if (SC.platform.supportsCSSTransforms) {
3273
+ // Handle transforms
3274
+ var transformAttribute = SC.platform.domCSSPrefix+'Transform',
3275
+ layer = this.get('layer'),
3276
+ // FIXME: This is not the best way to do it, we should track these locally
3277
+ currentTransforms = (layer ? layer.style[transformAttribute] : '').split(' '),
3278
+ halTransforms, specialTransforms = [], idx;
3279
+
3280
+ if (canUseAcceleratedLayer) {
3281
+ // Remove previous transforms
3282
+ if (this._lastAcceleratedTransforms) currentTransforms.removeObjects(this._lastAcceleratedTransforms);
3283
+
3284
+ halTransforms = ['translateX('+(translateLeft || 0)+'px)', 'translateY('+(translateTop || 0)+'px)'];
3285
+
3286
+ // FIXME: This join.match is a bit hackish
3287
+ if (SC.platform.supportsCSS3DTransforms && !currentTransforms.join(' ').match('translateZ')) {
3288
+ halTransforms.push('translateZ(0px)');
3289
+ }
3290
+
3291
+ // Store for next time
3292
+ this._lastAcceleratedTransforms = halTransforms;
3293
+ }
3294
+
3295
+ // Handle special CSS transform attributes
3296
+ var specialTransforms = [], transformName;
3297
+ for(transformName in SC.CSS_TRANSFORM_MAP) {
3298
+ var cleanedTransforms = [], idx;
3299
+ for(idx=0; idx < currentTransforms.length; idx++) {
3300
+ if (!currentTransforms[idx].match(new RegExp('^'+transformName+'\\\('))) {
3301
+ cleanedTransforms.push(currentTransforms[idx]);
3302
+ }
3303
+ }
3304
+ currentTransforms = cleanedTransforms;
3305
+
3306
+ if (layout[transformName]) {
3307
+ specialTransforms.push(SC.CSS_TRANSFORM_MAP[transformName](layout[transformName]));
3308
+ }
3309
+ }
3310
+ specialTransforms = specialTransforms.join(' ');
3311
+
3312
+ var allTransforms = currentTransforms.concat(halTransforms, specialTransforms).without(undefined).without('').join(' ');
3313
+
3314
+ // Set transform attribute
3315
+ if (allTransforms !== '') ret[transformAttribute] = allTransforms;
3316
+ }
3317
+
3318
+ // Temporary fix to not break SC.Animatable
3319
+ if (!this.isAnimatable) {
3320
+
3321
+ // Handle animations
3322
+ var transitions = [], animation, propertyKey;
3323
+ this._animatedTransforms = [];
3324
+
3325
+ for(key in layout) {
3326
+ if (key.substring(0,7) === 'animate') {
3327
+ // FIXME: If we want to allow it to be set as just a number for duration we need to add support here
3328
+ animation = layout[key];
3329
+
3330
+ if (animation.timing) {
3331
+ if (SC.typeOf(animation.timing) != SC.T_STRING) {
3332
+ animation.timing = "cubic-bezier("+animation.timing[0]+", "+animation.timing[1]+", "+
3333
+ animation.timing[2]+", "+animation.timing[3]+")";
3334
+ }
3335
+ } else {
3336
+ animation.timing = 'linear';
3337
+ }
3338
+
3339
+ propertyKey = key.substring(7).camelize();
3340
+
3341
+ // TODO: This is a weird conditional, we can probably clean it up
3342
+ if (
3343
+ SC.platform.supportsCSSTransforms &&
3344
+ (
3345
+ (
3346
+ canUseAcceleratedLayer && (
3347
+ (propertyKey === 'top' && !SC.empty(translateTop)) ||
3348
+ (propertyKey === 'left' && !SC.empty(translateLeft))
3349
+ )
3350
+ ) ||
3351
+ SC.CSS_TRANSFORM_MAP[propertyKey]
3352
+ )
3353
+ ) {
3354
+ this._animatedTransforms.push(propertyKey);
3355
+ propertyKey = '-'+SC.platform.cssPrefix+'-transform';
3356
+ }
3357
+
3358
+ animation.css = propertyKey + " " + animation.duration + "s " + animation.timing;
3359
+
3360
+ // If it's a transform this may have already been set
3361
+ if (!this._pendingAnimations) this._pendingAnimations = {};
3362
+ if (!this._pendingAnimations[propertyKey]) {
3363
+ this._pendingAnimations[propertyKey] = animation;
3364
+ transitions.push(animation.css);
3365
+ }
3366
+ }
3367
+ }
3368
+
3369
+ if (SC.platform.supportsCSSTransitions) ret[SC.platform.domCSSPrefix+"Transition"] = transitions.length > 0 ? transitions.join(", ") : null;
3370
+
3371
+ }
3372
+
3373
+
2233
3374
  // convert any numbers into a number + "px".
2234
- for(var key in ret) {
2235
- var value = ret[key];
3375
+ for(key in ret) {
3376
+ value = ret[key];
2236
3377
  if (typeof value === SC.T_NUMBER) ret[key] = (value + "px");
2237
3378
  }
3379
+
2238
3380
  return ret ;
2239
3381
  }.property().cacheable(),
2240
3382
 
@@ -2250,13 +3392,51 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
2250
3392
  This method is called whenever a property changes that invalidates the
2251
3393
  layout of the view. Changing the layout will do this automatically, but
2252
3394
  you can add others if you want.
3395
+
3396
+ Implementation Note: In a traditional setup, we would simply observe
3397
+ 'layout' here, but as described above in the documentation for our custom
3398
+ implementation of propertyDidChange(), this method must always run
3399
+ immediately after 'layout' is updated to avoid the potential for stale
3400
+ (incorrect) cached 'frame' values.
2253
3401
 
2254
3402
  @returns {SC.View} receiver
2255
3403
  */
2256
3404
  layoutDidChange: function() {
3405
+ // Did our layout change in a way that could cause us to be resized? If
3406
+ // not, then there's no need to invalidate the frames of our child views.
3407
+ var previousLayout = this._previousLayout,
3408
+ currentLayout = this.get('layout'),
3409
+ didResize = YES,
3410
+ previousWidth, previousHeight, currentWidth, currentHeight;
3411
+
3412
+ if (previousLayout && previousLayout !== currentLayout) {
3413
+ // This is a simple check to see whether we think the view may have
3414
+ // resized. We could look for a number of cases, but for now we'll
3415
+ // handle only one simple case: if the width and height are both
3416
+ // specified, and they have not changed.
3417
+ previousWidth = previousLayout.width;
3418
+ if (previousWidth !== undefined) {
3419
+ currentWidth = currentLayout.width;
3420
+ if (previousWidth === currentWidth) {
3421
+ previousHeight = previousLayout.height;
3422
+ if (previousLayout !== undefined) {
3423
+ currentHeight = currentLayout.height;
3424
+ if (previousHeight === currentHeight) didResize = NO;
3425
+ }
3426
+ }
3427
+ }
3428
+ }
3429
+
2257
3430
  this.beginPropertyChanges() ;
2258
- if (this.frame) this.notifyPropertyChange('frame') ;
2259
3431
  this.notifyPropertyChange('layoutStyle') ;
3432
+ if (didResize) {
3433
+ this.viewDidResize();
3434
+ }
3435
+ else {
3436
+ // Even if we didn't resize, our frame might have changed.
3437
+ // viewDidResize() handles this in the other case.
3438
+ this._viewFrameDidChange();
3439
+ }
2260
3440
  this.endPropertyChanges() ;
2261
3441
 
2262
3442
  // notify layoutView...
@@ -2267,10 +3447,10 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
2267
3447
  if (layoutView.get('childViewsNeedLayout')) {
2268
3448
  layoutView.invokeOnce(layoutView.layoutChildViewsIfNeeded);
2269
3449
  }
2270
- }
3450
+ }
2271
3451
 
2272
3452
  return this ;
2273
- }.observes('layout'),
3453
+ },
2274
3454
 
2275
3455
  /**
2276
3456
  This this property to YES whenever the view needs to layout its child
@@ -2335,13 +3515,12 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
2335
3515
  @returns {void}
2336
3516
  */
2337
3517
  layoutChildViews: function() {
2338
- var set = this._needLayoutViews, len = set ? set.length : 0, idx,
2339
- view, context, layer;
2340
- for(idx=0;idx<len;idx++) {
2341
- view = set[idx];
2342
- view.updateLayout();
3518
+ var set = this._needLayoutViews,
3519
+ len = set ? set.length : 0,
3520
+ i;
3521
+ for (i = 0; i < len; ++i) {
3522
+ set[i].updateLayout();
2343
3523
  }
2344
- view = context = layer = null ; // cleanup
2345
3524
  set.clear(); // reset & reuse
2346
3525
  },
2347
3526
 
@@ -2363,6 +3542,10 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
2363
3542
  context = this.renderContext(layer);
2364
3543
  this.renderLayout(context);
2365
3544
  context.update();
3545
+
3546
+ // If this view uses static layout, then notify if the frame changed.
3547
+ // (viewDidResize will do a comparison)
3548
+ if (this.useStaticLayout) this.viewDidResize();
2366
3549
  }
2367
3550
  layer = null ;
2368
3551
  return this ;
@@ -2379,7 +3562,11 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
2379
3562
  @test in layoutChildViews
2380
3563
  */
2381
3564
  renderLayout: function(context, firstTime) {
2382
- context.addStyle(this.get('layoutStyle'));
3565
+ this._viewRenderer.attr({
3566
+ layoutStyle: this.get('layoutStyle')
3567
+ });
3568
+ this._scv_willRenderAnimations();
3569
+ this._viewRenderer.render(context);
2383
3570
  },
2384
3571
 
2385
3572
  /** walk like a duck */
@@ -2404,8 +3591,248 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
2404
3591
  */
2405
3592
  selectStart: function(evt) {
2406
3593
  return this.get('isTextSelectable');
2407
- }
3594
+ },
3595
+
3596
+ /**
3597
+ Used to block the contextMenu per view.
3598
+
3599
+ @param evt {SC.Event} the contextmenu event
3600
+ @returns YES if the contextmenu can show up
3601
+ */
3602
+ contextMenu: function(evt) {
3603
+ if(!this.get('isContextMenuEnabled')) evt.stop();
3604
+ return true;
3605
+ },
3606
+
3607
+ /**
3608
+ A boundary set of distances outside which the touch will not be considered "inside" the view anymore.
3609
+
3610
+ By default, up to 50px on each side.
3611
+ */
3612
+ touchBoundary: { left: 50, right: 50, top: 50, bottom: 50 },
3613
+
3614
+ /**
3615
+ @private
3616
+ A computed property based on frame.
3617
+ */
3618
+ _touchBoundaryFrame: function (){
3619
+ return this.get("parentView").convertFrameToView(this.get('frame'), null);
3620
+ }.property("frame", "parentView").cacheable(),
3621
+
3622
+ /**
3623
+ Returns YES if the provided touch is within the boundary.
3624
+ */
3625
+ touchIsInBoundary: function(touch) {
3626
+ var f = this.get("_touchBoundaryFrame"), maxX = 0, maxY = 0, boundary = this.get("touchBoundary");
3627
+ var x = touch.pageX, y = touch.pageY;
3628
+
3629
+ if (x < f.x) {
3630
+ x = f.x - x;
3631
+ maxX = boundary.left;
3632
+ } else if (x > f.x + f.width) {
3633
+ x = x - (f.x + f.width);
3634
+ maxX = boundary.right;
3635
+ } else {
3636
+ x = 0;
3637
+ maxX = 1;
3638
+ }
3639
+
3640
+ if (y < f.y) {
3641
+ y = f.y - y;
3642
+ maxY = boundary.top;
3643
+ } else if (y > f.y + f.height) {
3644
+ y = y - (f.y + f.height);
3645
+ maxY = boundary.bottom;
3646
+ } else {
3647
+ y = 0;
3648
+ maxY = 1;
3649
+ }
3650
+
3651
+ if (x > 100 || y > 100) return NO;
3652
+ return YES;
3653
+ },
3654
+
3655
+ ///
3656
+ /// BUILDING IN/OUT
3657
+ ///
3658
+
3659
+ /**
3660
+ Call this to append a child while building it in. If the child is not
3661
+ buildable, this is the same as calling appendChild.
3662
+ */
3663
+ buildInChild: function(view) {
3664
+ view.willBuildInToView(this);
3665
+ this.appendChild(view);
3666
+ view.buildInToView(this);
3667
+ },
2408
3668
 
3669
+ /**
3670
+ Call to remove a child after building it out. If the child is not buildable,
3671
+ this will simply call removeChild.
3672
+ */
3673
+ buildOutChild: function(view) {
3674
+ view.buildOutFromView(this);
3675
+ },
3676
+
3677
+ /**
3678
+ Called by child view when build in finishes. By default, does nothing.
3679
+
3680
+ */
3681
+ buildInDidFinishFor: function(child) {
3682
+ },
3683
+
3684
+ /**
3685
+ @private
3686
+ Called by child view when build out finishes. By default removes the child view.
3687
+ */
3688
+ buildOutDidFinishFor: function(child) {
3689
+ this.removeChild(child);
3690
+ },
3691
+
3692
+ /**
3693
+ Whether the view is currently building in.
3694
+ */
3695
+ isBuildingIn: NO,
3696
+
3697
+ /**
3698
+ Whether the view is currently building out.
3699
+ */
3700
+ isBuildingOut: NO,
3701
+
3702
+ /**
3703
+ Implement this, and call didFinishBuildIn when you are done.
3704
+ */
3705
+ buildIn: function() {
3706
+ this.buildInDidFinish();
3707
+ },
3708
+
3709
+ /**
3710
+ Implement this, and call didFinsihBuildOut when you are done.
3711
+ */
3712
+ buildOut: function() {
3713
+ this.buildOutDidFinish();
3714
+ },
3715
+
3716
+ /**
3717
+ This should reset (without animation) any internal states; sometimes called before.
3718
+
3719
+ It is usually called before a build in, by the parent view.
3720
+ */
3721
+ resetBuild: function() {
3722
+
3723
+ },
3724
+
3725
+ /**
3726
+ Implement this if you need to do anything special when cancelling build out;
3727
+ note that buildIn will subsequently be called, so you usually won't need to do
3728
+ anything.
3729
+
3730
+ This is basically called whenever build in happens.
3731
+ */
3732
+ buildOutDidCancel: function() {
3733
+
3734
+ },
3735
+
3736
+ /**
3737
+ Implement this if you need to do anything special when cancelling build in.
3738
+ You probably won't be able to do anything. I mean, what are you gonna do?
3739
+
3740
+ If build in was cancelled, it means build out is probably happening.
3741
+ So, any timers or anything you had going, you can cancel.
3742
+ Then buildOut will happen.
3743
+ */
3744
+ buildInDidCancel: function() {
3745
+
3746
+ },
3747
+
3748
+ /**
3749
+ Call this when you have built in.
3750
+ */
3751
+ buildInDidFinish: function() {
3752
+ this.isBuildingIn = NO;
3753
+ this._buildingInTo.buildInDidFinishFor(this);
3754
+ this._buildingInTo = null;
3755
+ },
3756
+
3757
+ /**
3758
+ Call this when you have finished building out.
3759
+ */
3760
+ buildOutDidFinish: function() {
3761
+ this.isBuildingOut = NO;
3762
+ this._buildingOutFrom.buildOutDidFinishFor(this);
3763
+ this._buildingOutFrom = null;
3764
+ },
3765
+
3766
+ /**
3767
+ Usually called by parentViewDidChange, this resets the build state (calling resetBuild in the process).
3768
+ */
3769
+ resetBuildState: function() {
3770
+ if (this.isBuildingIn) {
3771
+ this.buildInDidCancel();
3772
+ this.isBuildingIn = NO;
3773
+ }
3774
+ if (this.isBuildingOut) {
3775
+ this.buildOutDidCancel();
3776
+ this.isBuildingOut = NO;
3777
+ }
3778
+
3779
+ // finish cleaning up
3780
+ this.buildingInTo = null;
3781
+ this.buildingOutFrom = null;
3782
+
3783
+ this.resetBuild();
3784
+ },
3785
+
3786
+ /**
3787
+ @private (semi)
3788
+ Called by building parent view's buildInChild method. This prepares
3789
+ to build in, but unlike buildInToView, this is called _before_ the child
3790
+ is appended.
3791
+
3792
+ Mostly, this cancels any build out _before_ the view is removed through parent change.
3793
+ */
3794
+ willBuildInToView: function(view) {
3795
+ // stop any current build outs (and if we need to, we also need to build in again)
3796
+ if (this.isBuildingOut) {
3797
+ this.buildOutDidCancel();
3798
+ }
3799
+ },
3800
+
3801
+ /**
3802
+ @private (semi)
3803
+ Called by building parent view's buildInChild method.
3804
+ */
3805
+ buildInToView: function(view) {
3806
+ // if we are already building in, do nothing.
3807
+ if (this.isBuildingIn) return;
3808
+
3809
+ this._buildingInTo = view;
3810
+ this.isBuildingOut = NO;
3811
+ this.isBuildingIn = YES;
3812
+ this.buildIn();
3813
+ },
3814
+
3815
+ /**
3816
+ @private (semi)
3817
+ Called by building parent view's buildOutChild method.
3818
+
3819
+ The supplied view should always be the parent view.
3820
+ */
3821
+ buildOutFromView: function(view) {
3822
+ // if we are already building out, do nothing.
3823
+ if (this.isBuildingOut) return;
3824
+
3825
+ // cancel any build ins
3826
+ if (this.isBuildingIn) {
3827
+ this.buildInDidCancel();
3828
+ }
3829
+
3830
+ // in any case, we need to build out
3831
+ this.isBuildingOut = YES;
3832
+ this.isBuildingIn = NO;
3833
+ this._buildingOutFrom = view;
3834
+ this.buildOut();
3835
+ }
2409
3836
  });
2410
3837
 
2411
3838
  SC.View.mixin(/** @scope SC.View */ {
@@ -2444,47 +3871,66 @@ SC.View.mixin(/** @scope SC.View */ {
2444
3871
  Convert any layout to a Top, Left, Width, Height layout
2445
3872
  */
2446
3873
  convertLayoutToAnchoredLayout: function(layout, parentFrame){
2447
- var ret = {top: 0, left: 0, width: parentFrame.width, height: parentFrame.height};
3874
+ var ret = {top: 0, left: 0, width: parentFrame.width, height: parentFrame.height},
3875
+ pFW = parentFrame.width, pFH = parentFrame.height, //shortHand for parentDimensions
3876
+ lR = layout.right,
3877
+ lL = layout.left,
3878
+ lT = layout.top,
3879
+ lB = layout.bottom,
3880
+ lW = layout.width,
3881
+ lH = layout.height,
3882
+ lcX = layout.centerX,
3883
+ lcY = layout.centerY;
2448
3884
 
2449
3885
  // X Conversion
2450
3886
  // handle left aligned and left/right
2451
- if (!SC.none(layout.left)) {
2452
- ret.left = Math.floor(layout.left);
2453
- if (layout.width !== undefined) {
2454
- if(layout.width === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
2455
- else ret.width = Math.floor(layout.width) ;
3887
+ if (!SC.none(lL)) {
3888
+ if(SC.isPercentage(lL)) ret.left = lL*pFW;
3889
+ else ret.left = lL;
3890
+ if (lW !== undefined) {
3891
+ if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
3892
+ else if(SC.isPercentage(lW)) ret.width = lW*pFW ;
3893
+ else ret.width = lW ;
2456
3894
  } else {
2457
- ret.width = parentFrame.width - ret.left - Math.floor(layout.right || 0);
3895
+ if (lR && SC.isPercentage(lR)) ret.width = pFW - ret.left - (lR*pFW);
3896
+ else ret.width = pFW - ret.left - (lR || 0);
2458
3897
  }
2459
3898
 
2460
3899
  // handle right aligned
2461
- } else if (!SC.none(layout.right)) {
3900
+ } else if (!SC.none(lR)) {
2462
3901
 
2463
3902
  // if no width, calculate it from the parent frame
2464
- if (SC.none(layout.width)) {
3903
+ if (SC.none(lW)) {
2465
3904
  ret.left = 0;
2466
- ret.width = parentFrame.width - Math.floor(layout.right || 0);
3905
+ if(lR && SC.isPercentage(lR)) ret.width = pFW - (lR*pFW);
3906
+ else ret.width = pFW - (lR || 0);
2467
3907
 
2468
3908
  // If has width, calculate the left anchor from the width and right and parent frame
2469
3909
  } else {
2470
- if(layout.width === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
3910
+ if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
2471
3911
  else {
2472
- ret.width = layout.width;
2473
- ret.left = parentFrame.width - (layout.width + layout.right);
3912
+ if (SC.isPercentage(lW)) ret.width = lW*pFW;
3913
+ else ret.width = lW;
3914
+ if (SC.isPercentage(lR)) ret.left = pFW - (ret.width + lR);
3915
+ else ret.left = pFW - (ret.width + lR);
2474
3916
  }
2475
3917
  }
2476
3918
 
2477
3919
  // handle centered
2478
- } else if (!SC.none(layout.centerX)) {
2479
- ret.width = Math.floor(layout.width || 0) ;
2480
- ret.left = Math.floor((parentFrame.width - ret.width)/2) + layout.centerX;
3920
+ } else if (!SC.none(lcX)) {
3921
+ if(lW && SC.isPercentage(lW)) ret.width = (lW*pFW) ;
3922
+ else ret.width = (lW || 0) ;
3923
+ ret.left = ((pFW - ret.width)/2);
3924
+ if (SC.isPercentage(lcX)) ret.left = ret.left + lcX*pFW;
3925
+ else ret.left = ret.left + lcX;
2481
3926
 
2482
3927
  // if width defined, assume left of zero
2483
- } else if (!SC.none(layout.width)) {
3928
+ } else if (!SC.none(lW)) {
2484
3929
  ret.left = 0;
2485
- if(layout.width === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
3930
+ if(lW === SC.LAYOUT_AUTO) ret.width = SC.LAYOUT_AUTO ;
2486
3931
  else {
2487
- ret.width = Math.floor(layout.width);
3932
+ if(SC.isPercentage(lW)) ret.width = lW*pFW;
3933
+ else ret.width = lW;
2488
3934
  }
2489
3935
 
2490
3936
  // fallback, full width.
@@ -2499,48 +3945,67 @@ SC.View.mixin(/** @scope SC.View */ {
2499
3945
 
2500
3946
  // Y Conversion
2501
3947
  // handle left aligned and top/bottom
2502
- if (!SC.none(layout.top)) {
2503
- ret.top = Math.floor(layout.top);
2504
- if (layout.height !== undefined) {
2505
- if(layout.height === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
2506
- else ret.height = Math.floor(layout.height) ;
3948
+ if (!SC.none(lT)) {
3949
+ if(SC.isPercentage(lT)) ret.top = lT*pFH;
3950
+ else ret.top = lT;
3951
+ if (lH !== undefined) {
3952
+ if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
3953
+ else if (SC.isPercentage(lH)) ret.height = lH*pFH;
3954
+ else ret.height = lH ;
2507
3955
  } else {
2508
- ret.height = parentFrame.height - ret.top - Math.floor(layout.bottom || 0);
3956
+ ret.height = pFH - ret.top;
3957
+ if(lB && SC.isPercentage(lB)) ret.height = ret.height - (lB*pFH);
3958
+ else ret.height = ret.height - (lB || 0);
2509
3959
  }
2510
3960
 
2511
3961
  // handle bottom aligned
2512
- } else if (!SC.none(layout.bottom)) {
3962
+ } else if (!SC.none(lB)) {
2513
3963
 
2514
3964
  // if no height, calculate it from the parent frame
2515
- if (SC.none(layout.height)) {
3965
+ if (SC.none(lH)) {
2516
3966
  ret.top = 0;
2517
- ret.height = parentFrame.height - Math.floor(layout.bottom || 0);
3967
+ if (lB && SC.isPercentage(lB)) ret.height = pFH - (lB*pFH);
3968
+ else ret.height = pFH - (lB || 0);
2518
3969
 
2519
3970
  // If has height, calculate the top anchor from the height and bottom and parent frame
2520
3971
  } else {
2521
- if(layout.height === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
3972
+ if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
2522
3973
  else {
2523
- ret.height = layout.height;
2524
- ret.top = parentFrame.height - (layout.height + layout.bottom);
3974
+ if (SC.isPercentage(lH)) ret.height = lH*pFH;
3975
+ else ret.height = lH;
3976
+ ret.top = pFH - ret.height;
3977
+ if (SC.isPercentage(lB)) ret.top = ret.top - (lB*pFH);
3978
+ else ret.top = ret.top - lB;
2525
3979
  }
2526
3980
  }
2527
3981
 
2528
3982
  // handle centered
2529
- } else if (!SC.none(layout.centerY)) {
2530
- ret.height = Math.floor(layout.height || 0) ;
2531
- ret.top = Math.floor((parentFrame.height - ret.height)/2) + layout.centerY;
3983
+ } else if (!SC.none(lcY)) {
3984
+ if(lH && SC.isPercentage(lH)) ret.height = (lH*pFH) ;
3985
+ else ret.height = (lH || 0) ;
3986
+ ret.top = ((pFH - ret.height)/2);
3987
+ if(SC.isPercentage(lcY)) ret.top = ret.top + lcY*pFH;
3988
+ else ret.top = ret.top + lcY;
2532
3989
 
2533
3990
  // if height defined, assume top of zero
2534
- } else if (!SC.none(layout.height)) {
3991
+ } else if (!SC.none(lH)) {
2535
3992
  ret.top = 0;
2536
- if(layout.height === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
2537
- else ret.height = Math.floor(layout.height);
3993
+ if(lH === SC.LAYOUT_AUTO) ret.height = SC.LAYOUT_AUTO ;
3994
+ else if (SC.isPercentage(lH)) ret.height = lH*pFH;
3995
+ else ret.height = lH;
2538
3996
 
2539
3997
  // fallback, full height.
2540
3998
  } else {
2541
3999
  ret.top = 0;
2542
4000
  ret.height = 0;
2543
4001
  }
4002
+
4003
+ if(ret.top) ret.top = Math.floor(ret.top);
4004
+ if(ret.bottom) ret.bottom = Math.floor(ret.bottom);
4005
+ if(ret.left) ret.left = Math.floor(ret.left);
4006
+ if(ret.right) ret.right = Math.floor(ret.right);
4007
+ if(ret.width !== SC.LAYOUT_AUTO) ret.width = Math.floor(ret.width);
4008
+ if(ret.height !== SC.LAYOUT_AUTO) ret.height = Math.floor(ret.height);
2544
4009
 
2545
4010
  // handle min/max
2546
4011
  if (layout.minHeight !== undefined) ret.minHeight = layout.minHeight ;
@@ -2674,9 +4139,10 @@ SC.View.mixin(/** @scope SC.View */ {
2674
4139
  }
2675
4140
 
2676
4141
  // apply localization recursively to childViews
2677
- var childViews = this.prototype.childViews, idx = childViews.length;
4142
+ var childViews = this.prototype.childViews, idx = childViews.length,
4143
+ viewClass;
2678
4144
  while(--idx>=0) {
2679
- var viewClass = childViews[idx];
4145
+ viewClass = childViews[idx];
2680
4146
  loc = childLocs[idx];
2681
4147
  if (loc && viewClass && viewClass.loc) viewClass.loc(loc) ;
2682
4148
  }
@@ -2706,25 +4172,59 @@ SC.View.mixin(/** @scope SC.View */ {
2706
4172
  define an outlet that points to another view or object. The root object
2707
4173
  used for the path will be the receiver.
2708
4174
  */
2709
- SC.outlet = function(path) {
4175
+ SC.outlet = function(path, root) {
2710
4176
  return function(key) {
2711
- return (this[key] = SC.objectForPropertyPath(path, this)) ;
4177
+ return (this[key] = SC.objectForPropertyPath(path, (root !== undefined) ? root : this)) ;
2712
4178
  }.property();
2713
4179
  };
2714
4180
 
2715
4181
  /** @private on unload clear cached divs. */
2716
4182
  SC.View.unload = function() {
2717
-
2718
4183
  // delete view items this way to ensure the views are cleared. The hash
2719
4184
  // itself may be owned by multiple view subclasses.
2720
4185
  var views = SC.View.views;
2721
4186
  if (views) {
2722
- for(var key in views) {
2723
- if (!views.hasOwnProperty(key)) continue ;
2724
- delete views[key];
4187
+ for(var key in views) {
4188
+ if (!views.hasOwnProperty(key)) continue ;
4189
+ delete views[key];
4190
+ }
4191
+ }
4192
+ } ;
4193
+
4194
+ SC.View.runCallback = function(callback){
4195
+ var additionalArgs = SC.$A(arguments).slice(1),
4196
+ typeOfAction = SC.typeOf(callback.action);
4197
+
4198
+ // if the action is a function, just try to call it.
4199
+ if (typeOfAction == SC.T_FUNCTION) {
4200
+ callback.action.apply(callback.target, additionalArgs);
4201
+
4202
+ // otherwise, action should be a string. If it has a period, treat it
4203
+ // like a property path.
4204
+ } else if (typeOfAction === SC.T_STRING) {
4205
+ if (callback.action.indexOf('.') >= 0) {
4206
+ var path = callback.action.split('.') ;
4207
+ var property = path.pop() ;
4208
+
4209
+ var target = SC.objectForPropertyPath(path, window) ;
4210
+ var action = target.get ? target.get(property) : target[property];
4211
+ if (action && SC.typeOf(action) == SC.T_FUNCTION) {
4212
+ action.apply(target, additionalArgs);
4213
+ } else {
4214
+ throw 'SC.Animator could not find a function at %@'.fmt(callback.action) ;
4215
+ }
4216
+
4217
+ // otherwise, try to execute action direction on target or send down
4218
+ // responder chain.
4219
+ // FIXME: Add support for additionalArgs to this
4220
+ // } else {
4221
+ // SC.RootResponder.responder.sendAction(callback.action, callback.target, callback.source, callback.source.get("pane"), null, callback.source);
2725
4222
  }
2726
4223
  }
2727
-
2728
- } ;
4224
+ };
4225
+
4226
+
4227
+ //unload views for IE, trying to collect memory.
4228
+ if(SC.browser.msie) SC.Event.add(window, 'unload', SC.View, SC.View.unload) ;
4229
+
2729
4230
 
2730
- SC.Event.add(window, 'unload', SC.View, SC.View.unload) ;