sproutcore 1.9.2 → 1.10.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (746) hide show
  1. checksums.yaml +15 -0
  2. data/VERSION.yml +2 -2
  3. data/bin/sc-build +12 -9
  4. data/bin/sc-build-number +12 -9
  5. data/bin/sc-docs +12 -15
  6. data/bin/sc-gen +12 -9
  7. data/bin/sc-init +12 -9
  8. data/bin/sc-manifest +12 -9
  9. data/bin/sc-server +12 -9
  10. data/bin/sproutcore +12 -9
  11. data/lib/frameworks/sproutcore/Buildfile +14 -17
  12. data/lib/frameworks/sproutcore/CHANGELOG.md +214 -3
  13. data/lib/frameworks/sproutcore/README.md +4 -1
  14. data/lib/frameworks/sproutcore/apps/greenhouse/Buildfile +13 -0
  15. data/lib/frameworks/sproutcore/{frameworks/experimental/apps/greenhouse/README → apps/greenhouse/README.md} +1 -1
  16. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/TODO +0 -0
  17. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/beautify.js +0 -0
  18. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/design.js +3 -3
  19. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/file.js +3 -3
  20. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/files.js +3 -3
  21. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/layout.js +9 -9
  22. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/library.js +23 -23
  23. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/page.js +1 -1
  24. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/property.js +1 -1
  25. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/property_editor.js +2 -2
  26. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/target.js +1 -1
  27. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/targets.js +12 -12
  28. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/controllers/view_configs.js +15 -15
  29. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/core.js +14 -14
  30. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/core_file.js +0 -0
  31. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/data_source.js +42 -42
  32. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/app_page.js +45 -45
  33. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/app-selector.css +0 -0
  34. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/button.css +0 -0
  35. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/dock.css +0 -0
  36. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/general.css +0 -0
  37. data/lib/frameworks/sproutcore/apps/greenhouse/english.lproj/css/icons.css +5 -0
  38. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/main-page.css +0 -0
  39. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/menu.css +0 -0
  40. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/modal.css +0 -0
  41. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/picker.css +0 -0
  42. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/search.css +0 -0
  43. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/css/text-field.css +0 -0
  44. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/dialogs.js +0 -0
  45. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500.eot +0 -0
  46. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500.otf +0 -0
  47. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500.woff +0 -0
  48. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500_italic.eot +0 -0
  49. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500_italic.otf +0 -0
  50. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/fonts/museosans_500_italic.woff +0 -0
  51. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/app-selector/choose-app.png +0 -0
  52. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/app-selector/list-item-sel.png +0 -0
  53. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/active-l.png +0 -0
  54. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/active-m.png +0 -0
  55. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/active-r.png +0 -0
  56. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/regular-l.png +0 -0
  57. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/regular-m.png +0 -0
  58. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule-xl/regular-r.png +0 -0
  59. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/active-l.png +0 -0
  60. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/active-r.png +0 -0
  61. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/disabled-l.png +0 -0
  62. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/disabled-r.png +0 -0
  63. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/regular-l.png +0 -0
  64. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/regular-r.png +0 -0
  65. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-active-l.png +0 -0
  66. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-active-r.png +0 -0
  67. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-l.png +0 -0
  68. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-r.png +0 -0
  69. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-l.png +0 -0
  70. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/capsule/sel-r.png +0 -0
  71. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/active-l.png +0 -0
  72. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/active-m.png +0 -0
  73. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/active-r.png +0 -0
  74. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-active-l.png +0 -0
  75. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-active-r.png +0 -0
  76. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-l.png +0 -0
  77. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-r.png +0 -0
  78. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-l.png +0 -0
  79. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-r.png +0 -0
  80. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-sel-l.png +0 -0
  81. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/cap-sel-r.png +0 -0
  82. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/disabled-l.png +0 -0
  83. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/disabled-m.png +0 -0
  84. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/disabled-r.png +0 -0
  85. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/regular-l.png +0 -0
  86. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/regular-m.png +0 -0
  87. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/regular-r.png +0 -0
  88. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-active-l.png +0 -0
  89. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-active-m.png +0 -0
  90. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-active-r.png +0 -0
  91. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-disabled-l.png +0 -0
  92. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-disabled-m.png +0 -0
  93. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-disabled-r.png +0 -0
  94. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-l.png +0 -0
  95. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-m.png +0 -0
  96. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/dark/sel-r.png +0 -0
  97. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/active-m.png +0 -0
  98. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/disabled-m.png +0 -0
  99. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/regular-m.png +0 -0
  100. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/sel-active-m.png +0 -0
  101. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/sel-disabled-m.png +0 -0
  102. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/shared/sel-m.png +0 -0
  103. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/active-l.png +0 -0
  104. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/active-r.png +0 -0
  105. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/disabled-l.png +0 -0
  106. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/disabled-r.png +0 -0
  107. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/regular-l.png +0 -0
  108. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/regular-r.png +0 -0
  109. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-active-l.png +0 -0
  110. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-active-r.png +0 -0
  111. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-disabled-l.png +0 -0
  112. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-disabled-r.png +0 -0
  113. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-l.png +0 -0
  114. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/buttons/square/sel-r.png +0 -0
  115. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/actions-active.png +0 -0
  116. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/actions.png +0 -0
  117. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/inspector-active.png +0 -0
  118. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/inspector.png +0 -0
  119. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/library-active.png +0 -0
  120. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/library.png +0 -0
  121. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/projects-active.png +0 -0
  122. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/projects.png +0 -0
  123. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/run-active.png +0 -0
  124. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/run.png +0 -0
  125. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/save-active.png +0 -0
  126. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/icons/save.png +0 -0
  127. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/logos/greenhouse-l.png +0 -0
  128. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/logos/greenhouse-s.png +0 -0
  129. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/logos/sproutcore.png +0 -0
  130. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/main-bg.png +0 -0
  131. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/bottom-left.png +0 -0
  132. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/bottom-right.png +0 -0
  133. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/bottom.png +0 -0
  134. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/close-active.png +0 -0
  135. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/close.png +0 -0
  136. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/left.png +0 -0
  137. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/pointer-bottom.png +0 -0
  138. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/pointer-left.png +0 -0
  139. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/pointer-right.png +0 -0
  140. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/pointer-top.png +0 -0
  141. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/right.png +0 -0
  142. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/search-active.png +0 -0
  143. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/search.png +0 -0
  144. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/top-left.png +0 -0
  145. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/top-right.png +0 -0
  146. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/picker/top.png +0 -0
  147. data/lib/frameworks/sproutcore/apps/greenhouse/english.lproj/images/sc-icon-sproutcore-16.png +0 -0
  148. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/images/toolbar-bg.png +0 -0
  149. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/inspectors.js +0 -0
  150. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/loading.rhtml +0 -0
  151. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/main_page.js +0 -0
  152. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/english.lproj/strings.js +0 -0
  153. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/fixtures/file.js +0 -0
  154. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/main.js +5 -5
  155. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/mixins/drop_down.js +14 -14
  156. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/design.js +4 -4
  157. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/dir.js +12 -12
  158. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/file.js +7 -9
  159. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/target.js +12 -12
  160. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/models/view_config.js +10 -10
  161. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/resources/test_page.js +0 -0
  162. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/inspector.js +11 -11
  163. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/library.js +10 -10
  164. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/main.js +26 -25
  165. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/modals.js +10 -10
  166. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/states/ready.js +15 -15
  167. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/controllers/design.js +0 -0
  168. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/controllers/designs.js +0 -0
  169. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/controllers/file.js +0 -0
  170. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/controllers/files.js +0 -0
  171. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/models/file.js +0 -0
  172. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/models/view_config.js +0 -0
  173. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/views/list_item.js +0 -0
  174. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/tests/views/plist_item.js +1 -5
  175. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/theme.js +6 -6
  176. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/anchor.js +43 -43
  177. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/application_list_item.js +2 -2
  178. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/event_blocker.js +7 -7
  179. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/label_designer.js +0 -0
  180. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/list_item.js +8 -8
  181. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/plist_item.js +23 -23
  182. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/simple_button.js +31 -31
  183. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/tear_off_picker.js +12 -12
  184. data/lib/frameworks/sproutcore/{frameworks/experimental/apps → apps}/greenhouse/views/web.js +5 -5
  185. data/lib/frameworks/sproutcore/apps/media_examples/core.js +5 -6
  186. data/lib/frameworks/sproutcore/apps/media_examples/views/audio_view.js +16 -17
  187. data/lib/frameworks/sproutcore/apps/media_examples/views/camera_view.js +4 -5
  188. data/lib/frameworks/sproutcore/apps/media_examples/views/capabilities_view.js +17 -18
  189. data/lib/frameworks/sproutcore/apps/media_examples/views/microphone_view.js +4 -5
  190. data/lib/frameworks/sproutcore/apps/media_examples/views/video_view.js +18 -19
  191. data/lib/frameworks/sproutcore/apps/showcase/Buildfile +2 -2
  192. data/lib/frameworks/sproutcore/apps/showcase/README +1 -1
  193. data/lib/frameworks/sproutcore/apps/showcase/controllers/source_tree_controller.js +27 -7
  194. data/lib/frameworks/sproutcore/apps/showcase/core.js +6 -4
  195. data/lib/frameworks/sproutcore/apps/showcase/main.js +2 -1
  196. data/lib/frameworks/sproutcore/apps/showcase/patch.diff +529 -0
  197. data/lib/frameworks/sproutcore/apps/showcase/resources/images/sproutcore-128.png +0 -0
  198. data/lib/frameworks/sproutcore/apps/showcase/resources/main_page.js +3 -2
  199. data/lib/frameworks/sproutcore/apps/showcase/resources/stylesheet.css +35 -16
  200. data/lib/frameworks/sproutcore/apps/showcase/resources/views_page.js +195 -10
  201. data/lib/frameworks/sproutcore/apps/showcase/system/views_item_content.js +2 -1
  202. data/lib/frameworks/sproutcore/apps/showcase/theme.js +2 -1
  203. data/lib/frameworks/sproutcore/apps/showcase/views/checkbox_views.js +2 -1
  204. data/lib/frameworks/sproutcore/apps/showcase/views/date_field_views.js +2 -1
  205. data/lib/frameworks/sproutcore/apps/showcase/views/disclosure_views.js +2 -1
  206. data/lib/frameworks/sproutcore/apps/showcase/views/label_views.js +2 -1
  207. data/lib/frameworks/sproutcore/apps/showcase/views/list_views.js +2 -1
  208. data/lib/frameworks/sproutcore/apps/showcase/views/popup_button_views.js +3 -2
  209. data/lib/frameworks/sproutcore/apps/showcase/views/progress_views.js +2 -1
  210. data/lib/frameworks/sproutcore/apps/showcase/views/radio_views.js +2 -1
  211. data/lib/frameworks/sproutcore/apps/showcase/views/scroll_views.js +2 -1
  212. data/lib/frameworks/sproutcore/apps/showcase/views/segmented_views.js +2 -1
  213. data/lib/frameworks/sproutcore/apps/showcase/views/select_views.js +10 -9
  214. data/lib/frameworks/sproutcore/apps/showcase/views/slider_views.js +2 -1
  215. data/lib/frameworks/sproutcore/apps/showcase/views/source_list_views.js +2 -1
  216. data/lib/frameworks/sproutcore/apps/showcase/views/split_views.js +2 -1
  217. data/lib/frameworks/sproutcore/apps/showcase/views/stacked_views.js +2 -1
  218. data/lib/frameworks/sproutcore/apps/showcase/views/static_content_views.js +2 -1
  219. data/lib/frameworks/sproutcore/apps/showcase/views/tab_views.js +2 -1
  220. data/lib/frameworks/sproutcore/apps/showcase/views/text_field_views.js +2 -1
  221. data/lib/frameworks/sproutcore/apps/showcase/views/toolbar_views.js +2 -1
  222. data/lib/frameworks/sproutcore/apps/showcase/views/views_item_view.js +15 -6
  223. data/lib/frameworks/sproutcore/apps/showcase/views/views_list_view.js +5 -4
  224. data/lib/frameworks/sproutcore/apps/showcase/views/web_views.js +2 -1
  225. data/lib/frameworks/sproutcore/apps/showcase/views/well_views.js +2 -1
  226. data/lib/frameworks/sproutcore/apps/showcase/views/workspace_views.js +2 -1
  227. data/lib/frameworks/sproutcore/apps/statechart_routing/core.js +5 -5
  228. data/lib/frameworks/sproutcore/apps/statechart_routing/resources/login_page.js +15 -15
  229. data/lib/frameworks/sproutcore/apps/statechart_routing/resources/styles.css +3 -0
  230. data/lib/frameworks/sproutcore/apps/tests/controllers/source.js +11 -11
  231. data/lib/frameworks/sproutcore/apps/tests/controllers/target.js +6 -12
  232. data/lib/frameworks/sproutcore/apps/tests/controllers/targets.js +28 -33
  233. data/lib/frameworks/sproutcore/apps/tests/controllers/{detail.js → test.js} +14 -12
  234. data/lib/frameworks/sproutcore/apps/tests/controllers/tests.js +11 -15
  235. data/lib/frameworks/sproutcore/apps/tests/core.js +8 -113
  236. data/lib/frameworks/sproutcore/apps/tests/english.lproj/main_page.css +9 -19
  237. data/lib/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +81 -92
  238. data/lib/frameworks/sproutcore/apps/tests/english.lproj/strings.js +3 -1
  239. data/lib/frameworks/sproutcore/apps/tests/main.js +8 -13
  240. data/lib/frameworks/sproutcore/apps/tests/statechart.js +268 -0
  241. data/lib/frameworks/sproutcore/apps/tests/views/offset_checkbox.js +4 -4
  242. data/lib/frameworks/sproutcore/apps/welcome/controllers/targets.js +16 -16
  243. data/lib/frameworks/sproutcore/apps/welcome/core.js +9 -9
  244. data/lib/frameworks/sproutcore/apps/welcome/english.lproj/images/sproutcore.png +0 -0
  245. data/lib/frameworks/sproutcore/apps/welcome/english.lproj/main_page.js +22 -25
  246. data/lib/frameworks/sproutcore/apps/welcome/main.js +3 -3
  247. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup-landscape.jpg b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup-landscape.jpg +0 -0
  248. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup-landscape.png b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup-landscape.png +0 -0
  249. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup-portrait.jpg b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup-portrait.jpg +0 -0
  250. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup-portrait.png b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup-portrait.png +0 -0
  251. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-startup.png b/data/lib/frameworks/sproutcore/design/Assorted → Images/sproutcore-startup.png +0 -0
  252. data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +21 -7
  253. data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/request.js +35 -2
  254. data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +142 -75
  255. data/lib/frameworks/sproutcore/frameworks/bootstrap/tests/system/browser.js +20 -2
  256. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/horizontal_stack_layout.js +283 -0
  257. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/vertical_stack_layout.js +284 -0
  258. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +64 -65
  259. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/controller.js +14 -14
  260. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/object.js +8 -8
  261. data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +19 -19
  262. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/run_loop.js +10 -25
  263. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/selection_support.js +12 -6
  264. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/body_overflow.js +53 -34
  265. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/layout.js +30 -24
  266. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/main.js +44 -40
  267. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/manipulation.js +5 -2
  268. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +105 -176
  269. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane_statechart.js +50 -0
  270. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/visibility.js +4 -4
  271. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/view_transition_protocol.js +48 -0
  272. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/browser.js +225 -7
  273. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/core_query.js +54 -34
  274. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/cursor.js +86 -71
  275. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/device.js +35 -35
  276. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +2 -2
  277. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +2 -2
  278. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +283 -120
  279. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/ready.js +36 -37
  280. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +653 -435
  281. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/responder.js +49 -42
  282. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +422 -396
  283. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/selection_set.js +5 -5
  284. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +10 -8
  285. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/theme.js +37 -16
  286. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/timer.js +5 -5
  287. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils/rect.js +1 -1
  288. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +15 -0
  289. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/selection_support.js +21 -0
  290. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/cursor.js +28 -0
  291. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/platform.js +18 -0
  292. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/end.js +17 -17
  293. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_attr.js +9 -9
  294. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_className.js +43 -43
  295. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_style.js +4 -14
  296. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/render_context/update.js +18 -30
  297. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +78 -43
  298. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/theme.js +7 -7
  299. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/main_pane.js +4 -3
  300. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/append_remove.js +31 -15
  301. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/child_view.js +47 -2
  302. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/firstResponder.js +32 -31
  303. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/keyPane.js +23 -22
  304. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/layout.js +3 -2
  305. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/sendEvent.js +17 -16
  306. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/animation.js +626 -211
  307. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/border_frame_test.js +174 -0
  308. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/build.js +22 -20
  309. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/childViewLayout_test.js +27 -0
  310. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +11 -10
  311. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertFrames.js +5 -4
  312. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createChildViews.js +10 -6
  313. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createLayer.js +17 -12
  314. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/destroy.js +60 -7
  315. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/destroyLayer.js +19 -26
  316. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/didAppendToDocument.js +14 -13
  317. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/enabled_states_test.js +341 -0
  318. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/findLayerInParentLayer.js +9 -8
  319. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/init.js +26 -16
  320. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/insertBefore.js +28 -68
  321. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/isVisible.js +35 -23
  322. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/isVisibleInWindow.js +93 -78
  323. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js +62 -64
  324. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layer.js +69 -18
  325. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutChildViews.js +26 -21
  326. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js +129 -57
  327. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +436 -238
  328. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/removeChild.js +38 -44
  329. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/render.js +14 -4
  330. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/render_delegate_support.js +29 -20
  331. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/replaceAllChildren_test.js +229 -0
  332. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/updateLayer.js +33 -95
  333. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/viewDidResize.js +87 -39
  334. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view_states_test.js +684 -0
  335. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +767 -625
  336. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/acceleration.js +4 -23
  337. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +645 -77
  338. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/cursor.js +1 -1
  339. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +218 -19
  340. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +648 -321
  341. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout_style.js +326 -534
  342. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +120 -126
  343. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/statechart.js +1526 -0
  344. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +18 -23
  345. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/visibility.js +12 -94
  346. data/lib/frameworks/sproutcore/frameworks/core_tools/core.js +2 -2
  347. data/lib/frameworks/sproutcore/frameworks/core_tools/data_source.js +19 -19
  348. data/lib/frameworks/sproutcore/frameworks/core_tools/models/target.js +43 -27
  349. data/lib/frameworks/sproutcore/frameworks/core_tools/models/test.js +5 -5
  350. data/lib/frameworks/sproutcore/frameworks/core_tools/resources/icons.css +5 -0
  351. data/lib/frameworks/sproutcore/frameworks/core_tools/resources/sc-icon-sproutcore-16.png +0 -0
  352. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +41 -41
  353. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +1 -1
  354. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +90 -90
  355. data/lib/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +1 -1
  356. data/lib/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +31 -31
  357. data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +3 -3
  358. data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +6 -6
  359. data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +1 -1
  360. data/lib/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +1 -1
  361. data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +1 -1
  362. data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +2 -8
  363. data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +74 -48
  364. data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +11 -16
  365. data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +187 -253
  366. data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/cascade.js +5 -5
  367. data/lib/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +14 -14
  368. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/data_store.js +49 -9
  369. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +2 -2
  370. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +236 -127
  371. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/instance_management.js +107 -0
  372. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/createRecord.js +17 -0
  373. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +12 -11
  374. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/loadRecord.js +42 -17
  375. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushChanges.js +20 -15
  376. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +205 -92
  377. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/tests/system/datetime.js +61 -25
  378. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/resources/strings.js +39 -9
  379. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +45 -1
  380. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/tests/system/datetime.js +88 -0
  381. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/coders/design.js +0 -0
  382. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/coders/object.js +0 -0
  383. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/controllers.js +3 -3
  384. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/design.js +2 -2
  385. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/designs.js +19 -19
  386. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/page_design.js +44 -44
  387. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/controllers/page_files.js +4 -4
  388. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/core.js +0 -0
  389. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/css/css_rule.js +0 -0
  390. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/css/css_style.js +6 -6
  391. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/css/css_style_sheet.js +37 -37
  392. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/button.js +0 -0
  393. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/label.js +0 -0
  394. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/object_designer.js +0 -0
  395. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/tab.js +0 -0
  396. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/text_field.js +0 -0
  397. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/designers/view_designer.js +1 -1
  398. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/css/designer.css +0 -0
  399. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/design_page.js +0 -0
  400. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/high_light.css +0 -0
  401. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/controller.png +0 -0
  402. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-bg.png +0 -0
  403. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-item-bg.png +0 -0
  404. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-item-divider.png +0 -0
  405. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-item-sel-bg.png +0 -0
  406. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/dock-item-sel-divider.png +0 -0
  407. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/main-bg.png +0 -0
  408. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/page.png +0 -0
  409. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/pane.png +0 -0
  410. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/images/view.png +0 -0
  411. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/english.lproj/selection_handles.css +0 -0
  412. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/ext/binding.js +0 -0
  413. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/ext/object.js +0 -0
  414. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/ext/page.js +0 -0
  415. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/ext/view.js +0 -0
  416. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/mixins/button.js +0 -0
  417. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/mixins/snap_lines.js +0 -0
  418. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/tests/coders/page.js +0 -0
  419. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/tests/designers/view_designer.js +0 -0
  420. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/designer_drop_target.js +36 -37
  421. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/drawing.js +1 -1
  422. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/high_light.js +17 -17
  423. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/page_item_view.js +0 -0
  424. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/designer → designer}/views/selection_handles.js +14 -14
  425. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +1 -2
  426. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +51 -51
  427. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view → desktop}/mixins/split_child.js +63 -52
  428. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view → desktop}/mixins/split_thumb.js +64 -59
  429. data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +113 -112
  430. data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +182 -203
  431. data/lib/frameworks/sproutcore/frameworks/desktop/panes/palette.js +13 -13
  432. data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +51 -29
  433. data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +513 -307
  434. data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +69 -217
  435. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/button.js +31 -26
  436. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/checkbox.js +15 -20
  437. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/collection.js +2 -6
  438. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/disclosure.js +6 -6
  439. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/image_button.js +25 -16
  440. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/panel.js +6 -6
  441. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/picker.js +29 -16
  442. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/popup_button.js +1 -1
  443. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/progress.js +19 -23
  444. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio.js +14 -17
  445. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/radio_group.js +24 -24
  446. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/segment.js +4 -4
  447. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/slider.js +5 -5
  448. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view → desktop}/render_delegates/split.js +0 -0
  449. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view → desktop}/render_delegates/split_divider.js +0 -0
  450. data/lib/frameworks/sproutcore/frameworks/desktop/resources/modal.css +2 -0
  451. data/lib/frameworks/sproutcore/frameworks/desktop/resources/panel.css +1 -1
  452. data/lib/frameworks/sproutcore/frameworks/desktop/resources/segmented.css +24 -98
  453. data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +446 -442
  454. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +42 -21
  455. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +19 -3
  456. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +26 -28
  457. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/ui.js +3 -2
  458. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/pane_page.js +11 -7
  459. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +5 -4
  460. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +32 -26
  461. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +27 -22
  462. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/select_button/methods.js +5 -4
  463. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/select_button/ui.js +0 -2
  464. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +11 -8
  465. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/displayProperties.js +5 -5
  466. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/keyEquivalents.js +9 -11
  467. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +23 -23
  468. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/ui.js +15 -17
  469. data/lib/frameworks/sproutcore/frameworks/desktop/tests/{mixins → views/collection}/collection_fast_path.js +18 -12
  470. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/content.js +46 -53
  471. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +101 -47
  472. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +26 -26
  473. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/reload.js +89 -69
  474. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selection.js +27 -25
  475. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/ui_diagram.js +32 -35
  476. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +1 -0
  477. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/ui.js +6 -11
  478. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +3 -5
  479. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/grid/drag_and_drop.js +103 -8
  480. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/grid/methods.js +76 -38
  481. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/image_button/ui.js +3 -5
  482. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/drag_and_drop.js +91 -3
  483. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/render.js +2 -17
  484. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +70 -38
  485. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_alternatingrows.js +17 -19
  486. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +10 -13
  487. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +37 -30
  488. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +18 -20
  489. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +115 -28
  490. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +0 -2
  491. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +37 -1
  492. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +194 -182
  493. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select/ui.js +2 -3
  494. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +18 -21
  495. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/separator.js +5 -6
  496. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/slider/methods.js +5 -4
  497. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view/tests → desktop/tests/views/split}/children.js +15 -15
  498. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view/tests → desktop/tests/views/split}/dividers.js +0 -0
  499. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/methods.js +341 -45
  500. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view/tests → desktop/tests/views/split}/split_child.js +0 -0
  501. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/split_view/tests → desktop/tests/views/split}/split_thumb.js +0 -0
  502. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/ui.js +6 -8
  503. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/stacked/ui_comments.js +49 -52
  504. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +23 -6
  505. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/toolbar/ui.js +2 -4
  506. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/web/ui.js +4 -5
  507. data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +47 -38
  508. data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +24 -24
  509. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +887 -740
  510. data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +2 -2
  511. data/lib/frameworks/sproutcore/frameworks/desktop/views/grid.js +68 -55
  512. data/lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js +3 -3
  513. data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +8 -26
  514. data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +189 -167
  515. data/lib/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +55 -54
  516. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +8 -4
  517. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +145 -146
  518. data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +21 -21
  519. data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +2 -2
  520. data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +66 -66
  521. data/lib/frameworks/sproutcore/frameworks/desktop/views/scene.js +40 -44
  522. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +203 -200
  523. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +11 -12
  524. data/lib/frameworks/sproutcore/frameworks/desktop/views/segment.js +6 -13
  525. data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +87 -112
  526. data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +192 -179
  527. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_button.js +23 -23
  528. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +64 -64
  529. data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +56 -56
  530. data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +784 -714
  531. data/lib/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +21 -39
  532. data/lib/frameworks/sproutcore/frameworks/desktop/views/stacked.js +45 -41
  533. data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +1 -1
  534. data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +4 -10
  535. data/lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js +9 -47
  536. data/lib/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +40 -16
  537. data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +2 -1
  538. data/lib/frameworks/sproutcore/frameworks/desktop/views/workspace.js +62 -50
  539. data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +0 -9
  540. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/device.js +45 -45
  541. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js +16 -16
  542. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +46 -6
  543. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/tests/models/polymorphism/simple.js +16 -2
  544. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/desktop_scroller.js +12 -12
  545. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/ui.js +38 -40
  546. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/ext/menu.js +8 -8
  547. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/views/select.js +20 -20
  548. data/lib/frameworks/sproutcore/frameworks/formatters/formatters/date_formatter.js +16 -16
  549. data/lib/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +26 -14
  550. data/lib/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +43 -43
  551. data/lib/frameworks/sproutcore/frameworks/foundation/debug/test-image.png +0 -0
  552. data/lib/frameworks/sproutcore/frameworks/foundation/delegates/inline_text_field.js +11 -11
  553. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +63 -41
  554. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/button.js +1 -1
  555. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +60 -61
  556. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/control.js +72 -72
  557. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +142 -142
  558. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/gesturable.js +1 -1
  559. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_editable.js +1 -1
  560. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inner_frame.js +10 -8
  561. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +36 -29
  562. data/lib/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +4 -4
  563. data/lib/frameworks/sproutcore/frameworks/foundation/protocols/swap_transition_protocol.js +150 -0
  564. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +54 -29
  565. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/image.js +23 -18
  566. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/label.js +12 -11
  567. data/lib/frameworks/sproutcore/frameworks/foundation/resources/benchmark.css +21 -20
  568. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-128.png +0 -0
  569. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-256.png +0 -0
  570. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-32.png +0 -0
  571. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-48.png +0 -0
  572. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-512.png +0 -0
  573. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-64.png +0 -0
  574. data/lib/frameworks/sproutcore/frameworks/foundation/resources/label.css +5 -0
  575. data/lib/frameworks/sproutcore/frameworks/foundation/system/app_cache.js +412 -0
  576. data/lib/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +2 -3
  577. data/lib/frameworks/sproutcore/frameworks/foundation/system/module.js +11 -5
  578. data/lib/frameworks/sproutcore/frameworks/foundation/system/text_selection.js +21 -21
  579. data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/string_measurement.js +8 -3
  580. data/lib/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/selection_support.js +33 -8
  581. data/lib/frameworks/sproutcore/frameworks/foundation/tests/delegates/inline_text_field/inline_text_field.js +2 -1
  582. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/content_display.js +9 -3
  583. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/control/displayProperties.js +5 -4
  584. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/flowed_layout/tests.js +49 -4
  585. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +29 -21
  586. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +3 -5
  587. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/validatable/ui.js +8 -10
  588. data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/app_cache_test.js +81 -0
  589. data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/image_queue.js +2 -2
  590. data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/utils/pointInElement.js +0 -3
  591. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +40 -1
  592. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/transition_test.js +143 -0
  593. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +5 -7
  594. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +187 -84
  595. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +6 -41
  596. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +51 -7
  597. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +11 -16
  598. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/adjust_bounce_transition.js +80 -0
  599. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/adjust_smooth_transition.js +39 -0
  600. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/adjust_spring_transition.js +77 -0
  601. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/bounce_transition.js +211 -0
  602. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/fade_transition.js +57 -0
  603. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/pop_transition.js +82 -0
  604. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/scale_transition.js +54 -0
  605. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/slide_transition.js +140 -0
  606. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/spring_transition.js +203 -0
  607. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_dissolve_transition.js +67 -0
  608. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_fade_color_transition.js +81 -0
  609. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_move_in_transition.js +104 -0
  610. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_push_transition.js +181 -0
  611. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_reveal_transition.js +90 -0
  612. data/lib/frameworks/sproutcore/frameworks/foundation/validators/validator.js +2 -2
  613. data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +483 -95
  614. data/lib/frameworks/sproutcore/frameworks/foundation/views/field.js +65 -65
  615. data/lib/frameworks/sproutcore/frameworks/foundation/views/image.js +111 -100
  616. data/lib/frameworks/sproutcore/frameworks/foundation/views/inline_text_field.js +30 -222
  617. data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +38 -24
  618. data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +74 -62
  619. data/lib/frameworks/sproutcore/frameworks/jquery/jquery-1.8.3-patched.js +9485 -0
  620. data/lib/frameworks/sproutcore/frameworks/media/media_capabilities.js +4 -4
  621. data/lib/frameworks/sproutcore/frameworks/media/render_delegates/media_slider.js +20 -20
  622. data/lib/frameworks/sproutcore/frameworks/media/resources/video.css +18 -17
  623. data/lib/frameworks/sproutcore/frameworks/media/views/audio.js +19 -19
  624. data/lib/frameworks/sproutcore/frameworks/media/views/controls.js +10 -11
  625. data/lib/frameworks/sproutcore/frameworks/media/views/mini_controls.js +7 -8
  626. data/lib/frameworks/sproutcore/frameworks/media/views/video.js +24 -24
  627. data/lib/frameworks/sproutcore/frameworks/qunit/test/test.js +2 -2
  628. data/lib/frameworks/sproutcore/frameworks/routing/system/routes.js +32 -21
  629. data/lib/frameworks/sproutcore/frameworks/routing/tests/system/routes.js +72 -53
  630. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +164 -156
  631. data/lib/frameworks/sproutcore/frameworks/runtime/ext/array.js +20 -20
  632. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +145 -140
  633. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/comparable.js +1 -1
  634. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +2 -2
  635. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +393 -370
  636. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +3 -3
  637. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +1045 -999
  638. data/lib/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +41 -36
  639. data/lib/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +10 -4
  640. data/lib/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +11 -1
  641. data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +7 -7
  642. data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +275 -205
  643. data/lib/frameworks/sproutcore/frameworks/runtime/system/function.js +27 -27
  644. data/lib/frameworks/sproutcore/frameworks/runtime/system/index_set.js +229 -193
  645. data/lib/frameworks/sproutcore/frameworks/runtime/system/logger.js +24 -24
  646. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +186 -188
  647. data/lib/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +1 -1
  648. data/lib/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +138 -65
  649. data/lib/frameworks/sproutcore/frameworks/runtime/system/set.js +11 -10
  650. data/lib/frameworks/sproutcore/frameworks/runtime/system/string.js +8 -4
  651. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/tupleForPropertyPath.js +4 -0
  652. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/chained.js +112 -23
  653. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +71 -18
  654. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +97 -57
  655. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +22 -22
  656. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/infinite.js +184 -0
  657. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/observer_set.js +63 -1
  658. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/run_loop.js +73 -36
  659. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/set.js +100 -25
  660. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/string.js +7 -0
  661. data/lib/frameworks/sproutcore/frameworks/statechart/debug/sequence_matcher.js +1 -1
  662. data/lib/frameworks/sproutcore/frameworks/statechart/private/state_path_matcher.js +2 -2
  663. data/lib/frameworks/sproutcore/frameworks/statechart/system/history_state.js +32 -32
  664. data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +449 -422
  665. data/lib/frameworks/sproutcore/frameworks/statechart/system/state_route_handler_context.js +19 -19
  666. data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +612 -562
  667. data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/routing/with_concurrent_states/basic.js +115 -62
  668. data/lib/frameworks/sproutcore/frameworks/statechart/tests/state_transitioning/routing/without_concurrent_states/basic.js +145 -64
  669. data/lib/frameworks/sproutcore/frameworks/statechart/tests/statechart/respond_to_event.js +17 -1
  670. data/lib/frameworks/sproutcore/frameworks/table/views/table_head.js +30 -30
  671. data/lib/frameworks/sproutcore/frameworks/table/views/table_row.js +34 -34
  672. data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/bind.js +1 -1
  673. data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/collection.js +2 -2
  674. data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/view.js +3 -5
  675. data/lib/frameworks/sproutcore/frameworks/template_view/tests/panes/template.js +2 -0
  676. data/lib/frameworks/sproutcore/frameworks/template_view/tests/views/template/core.js +2 -2
  677. data/lib/frameworks/sproutcore/frameworks/template_view/views/bindable_span.js +7 -7
  678. data/lib/frameworks/sproutcore/frameworks/template_view/views/template.js +4 -4
  679. data/lib/frameworks/sproutcore/frameworks/template_view/views/template_collection.js +15 -21
  680. data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +4 -4
  681. data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +35 -35
  682. data/lib/frameworks/sproutcore/scripts/run_sc_server_master.sh +34 -0
  683. data/lib/frameworks/sproutcore/tests/phantomjs_runner.phantomjs +606 -0
  684. data/lib/frameworks/sproutcore/themes/ace/designs/psds/panel/PanelPane.opacity +0 -0
  685. data/lib/frameworks/sproutcore/themes/ace/designs/psds/panel/Pointers.opacity +0 -0
  686. data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/active_button@2x.png +0 -0
  687. data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/normal_button@2x.png +0 -0
  688. data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/selected_active_button@2x.png +0 -0
  689. data/lib/frameworks/sproutcore/themes/ace/resources/button/ace/44px/selected_button@2x.png +0 -0
  690. data/lib/frameworks/sproutcore/themes/ace/resources/button/popup/select.css +3 -4
  691. data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list.css +18 -0
  692. data/lib/frameworks/sproutcore/themes/ace/resources/panel/panel.png +0 -0
  693. data/lib/frameworks/sproutcore/themes/ace/resources/panel/panel@2x.png +0 -0
  694. data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/panel.png +0 -0
  695. data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/panel@2x.png +0 -0
  696. data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/picker.css +34 -14
  697. data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/pointers.png +0 -0
  698. data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/pointers@2x.png +0 -0
  699. data/lib/frameworks/sproutcore/themes/ace/resources/segmented/18px/segmented.css +5 -4
  700. data/lib/frameworks/sproutcore/themes/ace/resources/segmented/24px/segmented.css +7 -2
  701. data/lib/frameworks/sproutcore/themes/ace/resources/segmented/30px/segmented.css +5 -4
  702. data/lib/frameworks/sproutcore/themes/ace/resources/segmented/44px/segmented.css +6 -3
  703. data/lib/frameworks/sproutcore/themes/ace/resources/toolbar/toolbar.css +7 -5
  704. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/button.js +7 -7
  705. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/progress.js +37 -37
  706. data/lib/frameworks/sproutcore/themes/legacy_theme/render_delegates/slider.js +12 -12
  707. data/lib/sproutcore/helpers/static_helper.rb +35 -27
  708. data/sproutcore.gemspec +1 -0
  709. metadata +529 -451
  710. data/lib/frameworks/sproutcore/apps/showcase/resources/images/sproutcore-logo.png +0 -0
  711. data/lib/frameworks/sproutcore/apps/showcase/views/button_views.js +0 -55
  712. data/lib/frameworks/sproutcore/apps/showcase/views/container_views.js +0 -29
  713. data/lib/frameworks/sproutcore/apps/showcase/views/grid_views.js +0 -28
  714. data/lib/frameworks/sproutcore/apps/showcase/views/image_button_views.js +0 -22
  715. data/lib/frameworks/sproutcore/apps/showcase/views/image_views.js +0 -51
  716. data/lib/frameworks/sproutcore/apps/tests/states/no_targets.js +0 -26
  717. data/lib/frameworks/sproutcore/apps/tests/states/ready.js +0 -56
  718. data/lib/frameworks/sproutcore/apps/tests/states/ready_detail.js +0 -41
  719. data/lib/frameworks/sproutcore/apps/tests/states/ready_empty.js +0 -48
  720. data/lib/frameworks/sproutcore/apps/tests/states/ready_list.js +0 -41
  721. data/lib/frameworks/sproutcore/apps/tests/states/ready_loading.js +0 -44
  722. data/lib/frameworks/sproutcore/apps/tests/states/ready_no_tests.js +0 -31
  723. data/lib/frameworks/sproutcore/apps/tests/states/start.js +0 -39
  724. data/lib/frameworks/sproutcore/apps/welcome/tests/controllers/targets.js +0 -15
  725. data/lib/frameworks/sproutcore/frameworks/animation/Buildfile +0 -3
  726. data/lib/frameworks/sproutcore/frameworks/animation/LICENSE +0 -25
  727. data/lib/frameworks/sproutcore/frameworks/animation/README.md +0 -79
  728. data/lib/frameworks/sproutcore/frameworks/animation/core.js +0 -1208
  729. data/lib/frameworks/sproutcore/frameworks/animation/tests/core.js +0 -152
  730. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/parentViewDidChange.js +0 -67
  731. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/prepareContext.js +0 -203
  732. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/updateLayerLocation.js +0 -213
  733. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +0 -163
  734. data/lib/frameworks/sproutcore/frameworks/desktop/tests/mixins/border.js +0 -97
  735. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/tests/methods.js +0 -312
  736. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/split.js +0 -961
  737. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/split_divider.js +0 -40
  738. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/split_view/views/thumb.js +0 -27
  739. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore-logo.png +0 -0
  740. data/lib/frameworks/sproutcore/frameworks/foundation/resources/images/sproutcore.png +0 -0
  741. data/lib/frameworks/sproutcore/frameworks/jquery/jquery-buffer.js +0 -394
  742. data/lib/frameworks/sproutcore/frameworks/jquery/jquery-buffered.js +0 -133
  743. data/lib/frameworks/sproutcore/frameworks/jquery/jquery-sc.js +0 -18
  744. data/lib/frameworks/sproutcore/frameworks/jquery/jquery.js +0 -8981
  745. data/lib/frameworks/sproutcore/frameworks/jquery/tests/set_class.js +0 -40
  746. data/lib/frameworks/sproutcore/themes/ace/resources/picker/ace/picker.js +0 -0
@@ -5,30 +5,29 @@
5
5
  // License: Licensed under MIT license (see license.js)
6
6
  // ==========================================================================
7
7
 
8
- /*global main */
9
8
 
10
9
  SC.BENCHMARK_LOG_READY = YES;
11
10
 
12
- sc_require('system/event') ;
11
+ sc_require('system/event');
13
12
 
14
13
  SC.mixin({
15
14
  isReady: NO,
16
-
15
+
17
16
  /**
18
17
  Allows apps to avoid automatically attach the ready handlers if they
19
18
  want to by setting this flag to YES
20
-
21
- @property {Boolean}
19
+
20
+ @type Boolean
22
21
  */
23
22
  suppressOnReady: SC.suppressOnReady ? YES : NO,
24
-
23
+
25
24
  /**
26
25
  Allows apps to avoid automatically invoking main() when onReady is called
27
-
28
- @property {Boolean}
26
+
27
+ @type Boolean
29
28
  */
30
29
  suppressMain: SC.suppressMain ? YES : NO,
31
-
30
+
32
31
  /**
33
32
  Add the passed target and method to the queue of methods to invoke when
34
33
  the document is ready. These methods will be called after the document
@@ -43,62 +42,62 @@ SC.mixin({
43
42
  @param method {Function} method name or function to execute
44
43
  @returns {SC}
45
44
  */
46
- ready: function(target, method) {
45
+ ready: function (target, method) {
47
46
  var queue = SC._readyQueue;
48
-
47
+
49
48
  // normalize
50
49
  if (method === undefined) {
51
- method = target; target = null ;
50
+ method = target;
51
+ target = null;
52
52
  } else if (SC.typeOf(method) === SC.T_STRING) {
53
- method = target[method] ;
53
+ method = target[method];
54
54
  }
55
55
 
56
- if(SC.isReady) {
57
- jQuery(document).ready(function() { method.call(target); });
56
+ if (SC.isReady) {
57
+ jQuery(document).ready(function () { method.call(target); });
58
+ } else {
59
+ if (!queue) SC._readyQueue = [];
60
+ SC._readyQueue.push(function () { method.call(target); });
58
61
  }
59
- else {
60
- if(!queue) SC._readyQueue = [];
61
- SC._readyQueue.push(function() { method.call(target); });
62
- }
63
-
64
- return this ;
62
+
63
+ return this;
65
64
  },
66
65
 
67
66
  onReady: {
68
- done: function() {
69
- if(SC.isReady) return;
70
-
67
+ done: function () {
68
+ if (SC.isReady) return;
69
+
71
70
  SC.isReady = true;
72
-
71
+
73
72
  SC.RunLoop.begin();
74
-
73
+
75
74
  SC.Locale.createCurrentLocale();
76
75
  var loc = SC.Locale.currentLanguage.toLowerCase();
77
76
  jQuery("body").addClass(loc);
78
-
77
+
79
78
  jQuery("html").attr("lang", loc);
80
-
79
+
81
80
  jQuery("#loading").remove();
82
-
81
+
83
82
  var queue = SC._readyQueue, idx, len;
84
-
85
- if(queue) {
86
- for(idx=0,len=queue.length;idx<len;idx++) {
83
+
84
+ if (queue) {
85
+ for (idx = 0, len = queue.length; idx < len; idx++) {
87
86
  queue[idx].call();
88
87
  }
89
88
  SC._readyQueue = null;
90
89
  }
91
-
92
- if(window.main && !SC.suppressMain && (SC.mode === SC.APP_MODE)) { window.main(); }
90
+
91
+ if (window.main && !SC.suppressMain && (SC.mode === SC.APP_MODE)) { window.main(); }
93
92
  SC.RunLoop.end();
94
93
  }
95
94
  }
96
95
 
97
- }) ;
96
+ });
98
97
 
99
98
  // let apps ignore the regular onReady handling if they need to
100
- if(!SC.suppressOnReady) {
101
- jQuery.event.special.ready._default = SC.onReady.done;
99
+ if (!SC.suppressOnReady) {
100
+ $(document).ready(SC.onReady.done);
102
101
  }
103
102
 
104
103
  // default to app mode. When loading unit tests, this will run in test mode
@@ -17,7 +17,7 @@ SC.MODE_APPEND = 'append';
17
17
  SC.MODE_PREPEND = 'prepend';
18
18
 
19
19
  /** list of numeric properties that should not have 'px' appended */
20
- SC.NON_PIXEL_PROPERTIES = ['zIndex', 'fontWeight', 'opacity'];
20
+ SC.NON_PIXEL_PROPERTIES = ['zIndex', 'opacity'];
21
21
 
22
22
  /** a list of styles that get expanded into multiple properties, add more as you discover them */
23
23
  SC.COMBO_STYLES = {
@@ -70,51 +70,50 @@ SC.RenderContext = SC.Builder.create(
70
70
  @param {String|DOMElement} tagNameOrElement
71
71
  @returns {SC.RenderContext} receiver
72
72
  */
73
- init: function(tagNameOrElement, prevContext) {
74
- var strings, tagNameOrElementIsString;
73
+ init: function (tagNameOrElement, prevContext) {
74
+ var tagNameOrElementIsString;
75
75
 
76
76
  // if a prevContext was passed, setup with that first...
77
77
  if (prevContext) {
78
- this.prevObject = prevContext ;
79
- this.strings = prevContext.strings ;
80
- this.offset = prevContext.length + prevContext.offset ;
78
+ this.prevObject = prevContext;
79
+ this.strings = prevContext.strings;
80
+ this.offset = prevContext.length + prevContext.offset;
81
81
  }
82
82
 
83
- if (!this.strings) this.strings = [] ;
83
+ if (!this.strings) this.strings = [];
84
84
 
85
85
  // if tagName is string, just setup for rendering new tagName
86
86
  if (tagNameOrElement === undefined) {
87
- tagNameOrElement = 'div' ;
88
- tagNameOrElementIsString = YES ;
87
+ tagNameOrElement = 'div';
88
+ tagNameOrElementIsString = YES;
89
89
  }
90
90
  else if (tagNameOrElement === 'div' || tagNameOrElement === 'label' || tagNameOrElement === 'a') {
91
91
  // Fast path for common tags.
92
- tagNameOrElementIsString = YES ;
92
+ tagNameOrElementIsString = YES;
93
93
  }
94
94
  else if (SC.typeOf(tagNameOrElement) === SC.T_STRING) {
95
- tagNameOrElement = tagNameOrElement.toLowerCase() ;
96
- tagNameOrElementIsString = YES ;
95
+ tagNameOrElement = tagNameOrElement.toLowerCase();
96
+ tagNameOrElementIsString = YES;
97
97
  }
98
98
 
99
99
  if (tagNameOrElementIsString) {
100
- this._tagName = tagNameOrElement ;
101
- this._needsTag = YES ; // used to determine if end() needs to wrap tag
102
- this.needsContent = YES ;
100
+ this._tagName = tagNameOrElement;
101
+ this._needsTag = YES; // used to determine if end() needs to wrap tag
102
+ this.needsContent = YES;
103
103
 
104
104
  // increase length of all contexts to leave space for opening tag
105
105
  var c = this;
106
- while(c) { c.length++; c = c.prevObject; }
106
+ while (c) { c.length++; c = c.prevObject; }
107
107
 
108
108
  this.strings.push(null);
109
109
  this._selfClosing = this.SELF_CLOSING.contains(tagNameOrElement);
110
+ } else {
111
+ this._elem = tagNameOrElement;
112
+ this._needsTag = NO;
113
+ this.length = 0;
114
+ this.needsContent = NO;
110
115
  }
111
- else {
112
- this._elem = tagNameOrElement ;
113
- this._needsTag = NO ;
114
- this.length = 0 ;
115
- this.needsContent = NO ;
116
- }
117
- return this ;
116
+ return this;
118
117
  },
119
118
 
120
119
  // ..........................................................
@@ -126,7 +125,7 @@ SC.RenderContext = SC.Builder.create(
126
125
  /**
127
126
  The current working array of strings.
128
127
 
129
- @property {Array}
128
+ @type Array
130
129
  */
131
130
  strings: null,
132
131
 
@@ -134,7 +133,7 @@ SC.RenderContext = SC.Builder.create(
134
133
  this initial offset into the strings array where this context instance
135
134
  has its opening tag.
136
135
 
137
- @property {Number}
136
+ @type Number
138
137
  */
139
138
  offset: 0,
140
139
 
@@ -142,7 +141,7 @@ SC.RenderContext = SC.Builder.create(
142
141
  the current number of strings owned by the context, including the opening
143
142
  tag.
144
143
 
145
- @property {Number}
144
+ @type Number
146
145
  */
147
146
  length: 0,
148
147
 
@@ -155,7 +154,7 @@ SC.RenderContext = SC.Builder.create(
155
154
  You probably do not want to change this property unless you know what you
156
155
  are doing.
157
156
 
158
- @property {String}
157
+ @type String
159
158
  */
160
159
  updateMode: SC.MODE_REPLACE,
161
160
 
@@ -178,29 +177,57 @@ SC.RenderContext = SC.Builder.create(
178
177
  @param {Number} idx the index
179
178
  @returns {String|Array}
180
179
  */
181
- get: function(idx) {
180
+ get: function (idx) {
182
181
  var strings = this.strings || [];
183
- return (idx === undefined) ? strings.slice(this.offset, this.length) : strings[idx+this.offset];
182
+ return (idx === undefined) ? strings.slice(this.offset, this.length) : strings[idx + this.offset];
183
+ },
184
+
185
+ /** @deprecated */
186
+ html: function (line) {
187
+ //@if(debug)
188
+ SC.warn("Developer Warning: SC.RenderContext:html() is no longer used to push HTML strings. Please use `push()` instead.");
189
+ //@endif
190
+ return this.push(line);
184
191
  },
185
192
 
186
193
  /**
187
- Adds a string to the render context for later joining. Note that you can
188
- pass multiple arguments to this method and each item will be pushed.
194
+ Adds a string to the render context for later joining and insertion. To
195
+ HTML escape the string, see the similar text() method instead.
196
+
197
+ Note: You can pass multiple string arguments to this method and each will
198
+ be pushed.
199
+
200
+ When used in render() for example,
201
+
202
+ MyApp.MyView = SC.View.extend({
203
+
204
+ innerText: '',
189
205
 
190
- @param {String} line the liene to add to the string.
206
+ render: function (context) {
207
+ var innerText = this.get('innerText');
208
+
209
+ // This will be pushed into the DOM all at once.
210
+ context.push('<div class="inner-div">', innerText, '<span class="inner-span">**</span></div>');
211
+ }
212
+
213
+ });
214
+
215
+ @param {String} line the HTML to add to the context
191
216
  @returns {SC.RenderContext} receiver
192
217
  */
193
- push: function(line) {
218
+ push: function (line) {
194
219
  var strings = this.strings, len = arguments.length;
195
220
  if (!strings) this.strings = strings = []; // create array lazily
196
221
 
197
222
  if (len > 1) {
198
- strings.push.apply(strings, arguments) ;
199
- } else strings.push(line);
223
+ strings.push.apply(strings, arguments);
224
+ } else {
225
+ strings.push(line);
226
+ }
200
227
 
201
228
  // adjust string length for context and all parents...
202
229
  var c = this;
203
- while(c) { c.length += len; c = c.prevObject; }
230
+ while (c) { c.length += len; c = c.prevObject; }
204
231
 
205
232
  this.needsContent = YES;
206
233
 
@@ -208,33 +235,55 @@ SC.RenderContext = SC.Builder.create(
208
235
  },
209
236
 
210
237
  /**
211
- Pushes the passed string onto the array, but first escapes the string
212
- to ensure that no user-entered HTML is processed as HTML.
238
+ Pushes the passed string to the render context for later joining and
239
+ insertion, but first escapes the string to ensure that no user-entered HTML
240
+ is processed as HTML. To push the string without escaping, see the similar
241
+ push() method instead.
242
+
243
+ Note: You can pass multiple string arguments to this method and each will
244
+ be escaped and pushed.
245
+
246
+ When used in render() for example,
213
247
 
214
- @param {String} line one or mroe lines of text to add
248
+ MyApp.MyView = SC.View.extend({
249
+
250
+ userText: '<script src="http://maliciousscripts.com"></script>',
251
+
252
+ render: function (context) {
253
+ var userText = this.get('userText');
254
+
255
+ // Pushes "&lt;script src="http://maliciousscripts.com"&gt;&lt;/script&gt;" in the DOM
256
+ context.text(userText);
257
+ }
258
+
259
+ });
260
+
261
+ @param {String} line the text to add to the context
215
262
  @returns {SC.RenderContext} receiver
216
263
  */
217
- text: function(line) {
218
- var len = arguments.length, idx=0;
219
- for(idx=0;idx<len;idx++) {
264
+ text: function () {
265
+ var len = arguments.length,
266
+ idx = 0;
267
+
268
+ for (idx = 0; idx < len; idx++) {
220
269
  this.push(SC.RenderContext.escapeHTML(arguments[idx]));
221
270
  }
222
- return this ;
271
+
272
+ return this;
223
273
  },
224
274
 
225
275
  /**
226
- Joins the strings together, returning the result. But first, this will
227
- end any open tags.
276
+ Joins the strings together, closes any open tags and returns the final result.
228
277
 
229
278
  @param {String} joinChar optional string to use in joins. def empty string
230
279
  @returns {String} joined string
231
280
  */
232
- join: function(joinChar) {
281
+ join: function (joinChar) {
233
282
  // generate tag if needed...
234
283
  if (this._needsTag) this.end();
235
284
 
236
285
  var strings = this.strings;
237
- return strings ? strings.join(joinChar || '') : '' ;
286
+ return strings ? strings.join(joinChar || '') : '';
238
287
  },
239
288
 
240
289
  // ..........................................................
@@ -247,7 +296,7 @@ SC.RenderContext = SC.Builder.create(
247
296
 
248
297
  @returns {SC.RenderContext} new context
249
298
  */
250
- begin: function(tagNameOrElement) {
299
+ begin: function (tagNameOrElement) {
251
300
  return SC.RenderContext(tagNameOrElement, this);
252
301
  },
253
302
 
@@ -258,22 +307,22 @@ SC.RenderContext = SC.Builder.create(
258
307
 
259
308
  @returns {DOMElement} the element
260
309
  */
261
- element: function() {
310
+ element: function () {
262
311
  return this._elem ? this._elem : SC.$(this.join())[0];
263
312
  },
264
313
 
265
314
  /**
266
315
  Removes an element with the passed id in the currently managed element.
267
316
  */
268
- remove: function(elementId) {
269
- if (!elementId) return ;
317
+ remove: function (elementId) {
318
+ if (!elementId) return;
270
319
 
271
- var el, elem = this._elem ;
272
- if (!elem || !elem.removeChild) return ;
320
+ var el, elem = this._elem;
321
+ if (!elem || !elem.removeChild) return;
273
322
 
274
- el = document.getElementById(elementId) ;
323
+ el = document.getElementById(elementId);
275
324
  if (el) {
276
- el = elem.removeChild(el) ;
325
+ el = elem.removeChild(el);
277
326
  el = null;
278
327
  }
279
328
  },
@@ -291,35 +340,35 @@ SC.RenderContext = SC.Builder.create(
291
340
 
292
341
  @returns {SC.RenderContext} previous context or null if top
293
342
  */
294
- update: function() {
343
+ update: function () {
295
344
  var elem = this._elem,
296
345
  mode = this.updateMode,
297
346
  cq, value, factory, cur, next;
298
347
 
299
- this._innerHTMLReplaced = NO;
348
+ // this._innerHTMLReplaced = NO;
300
349
 
301
350
  if (!elem) {
302
- // throw "Cannot update context because there is no source element";
303
- return ;
351
+ // throw new Error("Cannot update context because there is no source element");
352
+ return;
304
353
  }
305
354
 
306
355
  cq = this.$();
307
356
 
308
357
  // replace innerHTML
309
- if (this.length>0) {
310
- this._innerHTMLReplaced = YES;
358
+ if (this.length > 0) {
359
+ // this._innerHTMLReplaced = YES;
311
360
  if (mode === SC.MODE_REPLACE) {
312
361
  cq.html(this.join());
313
362
  } else {
314
363
  factory = elem.cloneNode(false);
315
- factory.innerHTML = this.join() ;
316
- cur = factory.firstChild ;
317
- while(cur) {
318
- next = cur.nextSibling ;
364
+ factory.innerHTML = this.join();
365
+ cur = factory.firstChild;
366
+ while (cur) {
367
+ next = cur.nextSibling;
319
368
  elem.insertBefore(cur, next);
320
- cur = next ;
369
+ cur = next;
321
370
  }
322
- cur = next = factory = null ; // cleanup
371
+ cur = next = factory = null; // cleanup
323
372
  }
324
373
  }
325
374
 
@@ -330,13 +379,9 @@ SC.RenderContext = SC.Builder.create(
330
379
  cq.attr('id', value);
331
380
  }
332
381
 
333
- // flush jQuery buffers
334
- jQuery.Buffer.flush();
335
-
336
-
337
382
  // now cleanup element...
338
- elem = this._elem = null ;
339
- return this.prevObject || this ;
383
+ elem = this._elem = null;
384
+ return this.prevObject || this;
340
385
  },
341
386
 
342
387
  // these are temporary objects are reused by end() to avoid memory allocs.
@@ -353,7 +398,7 @@ SC.RenderContext = SC.Builder.create(
353
398
 
354
399
  @returns {SC.RenderContext}
355
400
  */
356
- end: function() {
401
+ end: function () {
357
402
  // NOTE: If you modify this method, be careful to consider memory usage
358
403
  // and performance here. This method is called frequently during renders
359
404
  // and we want it to be as fast as possible.
@@ -361,17 +406,17 @@ SC.RenderContext = SC.Builder.create(
361
406
  // generate opening tag.
362
407
 
363
408
  // get attributes first. Copy in className + styles...
364
- var tag = '', styleStr='', pair, joined, key , value,
365
- attrs = this._attrs, className = this._classNames,
409
+ var tag = '', styleStr = '', key, value,
410
+ attrs = this._attrs, className = this._classes,
366
411
  id = this._id, styles = this._styles, strings, selfClosing;
367
412
 
368
413
  // add tag to tag array
369
- tag = '<' + this._tagName ;
414
+ tag = '<' + this._tagName;
370
415
 
371
416
  // add any attributes...
372
417
  if (attrs || className || styles || id) {
373
- if (!attrs) attrs = this._DEFAULT_ATTRS ;
374
- if (id) attrs.id = id ;
418
+ if (!attrs) attrs = this._DEFAULT_ATTRS;
419
+ if (id) attrs.id = id;
375
420
  // old versions of safari (5.0)!!!! throw an error if we access
376
421
  // attrs.class. meh...
377
422
  if (className) attrs['class'] = className.join(' ');
@@ -379,29 +424,31 @@ SC.RenderContext = SC.Builder.create(
379
424
  // add in styles. note how we avoid memory allocs here to keep things
380
425
  // fast...
381
426
  if (styles) {
382
- for(key in styles) {
383
- if(!styles.hasOwnProperty(key)) continue ;
427
+ for (key in styles) {
428
+ if (!styles.hasOwnProperty(key)) continue;
384
429
  value = styles[key];
385
430
  if (value === null) continue; // skip empty styles
386
431
  if (typeof value === SC.T_NUMBER && !SC.NON_PIXEL_PROPERTIES.contains(key)) value += "px";
387
- styleStr = styleStr + this._dasherizeStyleName(key)+": "+value + "; ";
432
+ styleStr = styleStr + this._dasherizeStyleName(key) + ": " + value + "; ";
388
433
  }
389
434
  attrs.style = styleStr;
390
435
  }
391
436
 
392
437
  // now convert attrs hash to tag array...
393
438
  tag = tag + ' '; // add space for joining0
394
- for(key in attrs) {
395
- if (!attrs.hasOwnProperty(key)) continue ;
439
+ for (key in attrs) {
440
+ if (!attrs.hasOwnProperty(key)) continue;
396
441
  value = attrs[key];
397
- if (value === null) continue ; // skip empty attrs
442
+ if (value === null) continue; // skip empty attrs
398
443
  tag = tag + key + '="' + value + '" ';
399
444
  }
400
445
 
401
446
  // if we are using the DEFAULT_ATTRS temporary object, make sure we
402
447
  // reset.
403
448
  if (attrs === this._DEFAULT_ATTRS) {
404
- delete attrs.style; delete attrs['class']; delete attrs.id;
449
+ delete attrs.style;
450
+ delete attrs['class'];
451
+ delete attrs.id;
405
452
  }
406
453
 
407
454
  }
@@ -409,8 +456,8 @@ SC.RenderContext = SC.Builder.create(
409
456
  // this is self closing if there is no content in between and selfClosing
410
457
  // is not set to false.
411
458
  strings = this.strings;
412
- selfClosing = (this._selfClosing === NO) ? NO : (this.length === 1) ;
413
- tag = tag + (selfClosing ? ' />' : '>') ;
459
+ selfClosing = (this._selfClosing === NO) ? NO : (this.length === 1);
460
+ tag = tag + (selfClosing ? ' />' : '>');
414
461
 
415
462
  strings[this.offset] = tag;
416
463
 
@@ -420,12 +467,12 @@ SC.RenderContext = SC.Builder.create(
420
467
 
421
468
  // increase length of receiver and all parents
422
469
  var c = this;
423
- while(c) { c.length++; c = c.prevObject; }
470
+ while (c) { c.length++; c = c.prevObject; }
424
471
  }
425
472
 
426
473
  // if there was a source element, cleanup to avoid memory leaks
427
474
  this._elem = null;
428
- return this.prevObject || this ;
475
+ return this.prevObject || this;
429
476
  },
430
477
 
431
478
  /**
@@ -435,7 +482,7 @@ SC.RenderContext = SC.Builder.create(
435
482
  @param {Hash} opts optional tag options. defaults to empty options.
436
483
  @returns {SC.RenderContext} receiver
437
484
  */
438
- tag: function(tagName, opts) {
485
+ tag: function (tagName, opts) {
439
486
  return this.begin(tagName, opts).end();
440
487
  },
441
488
 
@@ -449,14 +496,14 @@ SC.RenderContext = SC.Builder.create(
449
496
  @param {String} tagName pass to set tag name.
450
497
  @returns {String|SC.RenderContext} tag name or receiver
451
498
  */
452
- tagName: function(tagName) {
499
+ tagName: function (tagName) {
453
500
  if (tagName === undefined) {
454
501
  if (!this._tagName && this._elem) this._tagName = this._elem.tagName;
455
502
  return this._tagName;
456
503
  } else {
457
504
  this._tagName = tagName;
458
505
  this._tagNameDidChange = YES;
459
- return this ;
506
+ return this;
460
507
  }
461
508
  },
462
509
 
@@ -466,10 +513,10 @@ SC.RenderContext = SC.Builder.create(
466
513
  @param {String} idName the id or set
467
514
  @returns {String|SC.RenderContext} id or receiver
468
515
  */
469
- id: function(idName) {
516
+ id: function (idName) {
470
517
  if (idName === undefined) {
471
518
  if (!this._id && this._elem) this._id = this._elem.id;
472
- return this._id ;
519
+ return this._id;
473
520
  } else {
474
521
  this._id = idName;
475
522
  this._idDidChange = YES;
@@ -481,299 +528,391 @@ SC.RenderContext = SC.Builder.create(
481
528
  // CSS CLASS NAMES SUPPORT
482
529
  //
483
530
 
484
- /**
485
- Reads the current classNames array or sets the array if a param is passed.
486
- Note that if you get the classNames array and then modify it, you MUST
487
- call this method again to set the array or else it may not be copied to
488
- the element.
531
+ /** @deprecated */
532
+ classNames: function (deprecatedArg) {
533
+ if (deprecatedArg) {
534
+ //@if(debug)
535
+ SC.warn("Developer Warning: SC.RenderContext:classNames() (renamed to classes()) is no longer used to set classes, only to retrieve them. Please use `setClass()` instead.");
536
+ //@endif
537
+ return this.setClass(deprecatedArg);
538
+ } else {
539
+ //@if(debug)
540
+ SC.warn("Developer Warning: SC.RenderContext:classNames() has been renamed to classes() to better match the API of setClass() and resetClasses(). Please use `classes()` instead.");
541
+ //@endif
542
+ return this.classes();
543
+ }
544
+ },
489
545
 
490
- If you do pass a classNames array, you can also pass YES for the
491
- cloneOnModify param. This will cause the context to clone the class names
492
- before making any further edits. This is useful is you have a shared
493
- array of class names you want to start with but edits should not change
494
- the shared array.
546
+ /**
547
+ Retrieves the class names for the current context.
495
548
 
496
- @param {Array} classNames array
497
- @param {Boolean} cloneOnModify
498
- @returns {Array|SC.RenderContext} classNames array or receiver
549
+ @returns {Array} classNames array
499
550
  */
500
- classNames: function(classNames, cloneOnModify) {
501
- if (this._elem) {
502
- if (classNames) {
503
- this.$().resetClassNames().addClass(classNames);
504
- return this;
551
+ classes: function () {
552
+ if (!this._classes) {
553
+ if (this._elem) {
554
+ // Get the classes from the element.
555
+ var attr = this.$().attr('class');
556
+
557
+ if (attr && (attr = attr.toString()).length > 0) {
558
+ this._classes = attr.split(/\s/);
559
+ } else {
560
+ // No class on the element.
561
+ this._classes = [];
562
+ }
505
563
  } else {
506
- return this.$().attr('class').split(' ');
564
+ this._classes = [];
507
565
  }
508
566
  }
509
567
 
510
- if (classNames === undefined) {
511
- if (this._cloneClassNames) {
512
- this._classNames = (this._classNames || []).slice();
513
- this._cloneClassNames = NO ;
514
- }
515
-
516
- // if there are no class names, create an empty array but don't modify.
517
- if (!this._classNames) this._classNames = [];
518
-
519
- return this._classNames ;
520
- } else {
521
- this._classNames = classNames ;
522
- this._cloneClassNames = cloneOnModify || NO ;
523
- this._classNamesDidChange = YES ;
524
- return this ;
525
- }
568
+ return this._classes;
526
569
  },
527
570
 
528
571
  /**
529
- Returns YES if the outer tag current has the passed class name, NO
530
- otherwise.
572
+ Adds a class or classes to the current context.
531
573
 
532
- @param {String} className the class name
533
- @returns {Boolean}
574
+ This is a convenience method that simply calls setClass(nameOrClasses, YES).
575
+
576
+ @param {String|Array} nameOrClasses a class name or an array of class names
577
+ @returns {SC.RenderContext} receiver
534
578
  */
535
- hasClass: function(className) {
536
- if (this._elem) {
537
- return this.$().hasClass(className);
579
+ addClass: function (nameOrClasses) {
580
+ // Convert arrays into objects for use by setClass
581
+ if (SC.typeOf(nameOrClasses) === SC.T_ARRAY) {
582
+ for (var i = 0, length = nameOrClasses.length, obj = {}; i < length; i++) {
583
+ obj[nameOrClasses[i]] = YES;
584
+ }
585
+ nameOrClasses = obj;
538
586
  }
539
- return this.classNames().indexOf(className) >= 0;
587
+
588
+ return this.setClass(nameOrClasses, YES);
540
589
  },
541
590
 
542
591
  /**
543
- Adds the specified className to the current tag, if it does not already
544
- exist. This method has no effect if there is no open tag.
592
+ Removes the specified class name from the current context.
545
593
 
546
- If there is an element backing this RenderContext, buffered jQuery is
547
- used to perform the update.
594
+ This is a convenience method that simply calls setClass(name, NO).
548
595
 
549
- @param {String|Array} nameOrClasses the class name or an array of classes
596
+ @param {String} name the class to remove
550
597
  @returns {SC.RenderContext} receiver
551
598
  */
552
- addClass: function(nameOrClasses) {
553
- if(nameOrClasses === undefined || nameOrClasses === null) {
554
- SC.Logger.warn('You are adding an undefined or empty class'+ this.toString());
555
- return this;
556
- }
599
+ removeClass: function (name) {
600
+ return this.setClass(name, NO);
601
+ },
557
602
 
558
- if (this._elem) {
559
- if (SC.typeOf(nameOrClasses) === SC.T_STRING) {
560
- this.$().addClass(nameOrClasses);
561
- } else {
562
- var idx, len = nameOrClasses.length;
563
- for (idx = 0; idx < len; idx++) this.$().addClass(nameOrClasses[idx]);
564
- }
565
- return this;
566
- }
603
+ /**
604
+ Sets or unsets class names on the current context.
567
605
 
568
- var classNames = this.classNames() ; // handles cloning ,etc.
569
- if(SC.typeOf(nameOrClasses) === SC.T_STRING){
570
- if (classNames.indexOf(nameOrClasses)<0) {
571
- classNames.push(nameOrClasses);
572
- this._classNamesDidChange = YES ;
573
- }
574
- } else {
575
- var cl;
576
- for(var i = 0, iLen= nameOrClasses.length; i<iLen; i++){
577
- cl = nameOrClasses[i];
578
- if (classNames.indexOf(cl)<0) {
579
- classNames.push(cl);
580
- this._classNamesDidChange = YES ;
581
- }
582
- }
583
- }
606
+ You can either pass a single class name and a boolean indicating whether
607
+ the value should be added or removed, or you can pass a hash with all
608
+ the class names you want to add or remove with a boolean indicating
609
+ whether they should be there or not.
584
610
 
585
- return this;
586
- },
611
+ When used in render() for example,
587
612
 
588
- /**
589
- Removes the specified className from the current tag. This method has
590
- no effect if there is not an open tag.
613
+ MyApp.MyView = SC.View.extend({
614
+
615
+ isAdministrator: NO,
616
+
617
+ render: function (context) {
618
+ var isAdministrator = this.get('isAdministrator');
591
619
 
592
- If there is an actual DOM element backing this render context,
593
- the modification will be written immediately to a buffered jQuery instance.
620
+ // Sets the 'is-admin' class appropriately.
621
+ context.setClass('is-admin', isAdministrator);
622
+ }
623
+
624
+ });
594
625
 
595
- @param {String} className the class to add
626
+ @param {String|Hash} nameOrClasses either a single class name or a hash of class names with boolean values indicating whether to add or remove the class
627
+ @param {Boolean} shouldAdd if a single class name for nameOrClasses is passed, this
596
628
  @returns {SC.RenderContext} receiver
597
629
  */
598
- removeClass: function(className) {
599
- if (this._elem) {
600
- this.$().removeClass(className);
601
- return this;
602
- }
630
+ setClass: function (nameOrClasses, shouldAdd) {
631
+ var didChange = NO,
632
+ classes = this.classes();
633
+
634
+ // Add the updated classes to the internal classes object.
635
+ if (SC.typeOf(nameOrClasses) === SC.T_ARRAY) {
636
+ //@if(debug)
637
+ SC.warn("Developer Warning: SC.RenderContext:setClass() should not be passed an array of class names. To remain compatible with calls to the deprecated classNames() function, all classes on the current context will be replaced with the given array, but it would be more accurate in the future to call resetClasses() and addClass() or setClass(hash) instead. Please update your code accordingly.");
638
+ //@endif
639
+ this.resetClasses();
640
+ classes = this.classes();
641
+
642
+ for (var i = 0, length = nameOrClasses.length; i < length; i++) {
643
+ didChange = this._setClass(classes, nameOrClasses[i], YES) || didChange;
644
+ }
645
+ } else if (SC.typeOf(nameOrClasses) === SC.T_HASH) {
646
+ for (var name in nameOrClasses) {
647
+ if (!nameOrClasses.hasOwnProperty(name)) continue;
603
648
 
604
- var classNames = this._classNames, idx;
605
- if (classNames && (idx=classNames.indexOf(className))>=0) {
606
- if (this._cloneClassNames) {
607
- classNames = this._classNames = classNames.slice();
608
- this._cloneClassNames = NO ;
649
+ shouldAdd = nameOrClasses[name];
650
+ didChange = this._setClass(classes, name, shouldAdd) || didChange;
609
651
  }
652
+ } else {
653
+ didChange = this._setClass(classes, nameOrClasses, shouldAdd);
654
+ }
610
655
 
611
- // if className is found, just null it out. This will end up adding an
612
- // extra space to the generated HTML but it is faster than trying to
613
- // recompact the array.
614
- classNames[idx] = null;
615
- this._classNamesDidChange = YES ;
656
+ if (didChange) {
657
+ this._classesDidChange = YES;
658
+
659
+ // Apply the styles to the element if we have one already.
660
+ if (this._elem) {
661
+ this.$().attr('class', classes.join(' '));
662
+ }
616
663
  }
617
664
 
618
665
  return this;
619
666
  },
620
667
 
668
+ /** @private */
669
+ _setClass: function (classes, name, shouldAdd) {
670
+ var didChange = NO,
671
+ idx;
672
+
673
+ idx = classes.indexOf(name);
674
+ if (idx >= 0 && !shouldAdd) {
675
+ classes.splice(idx, 1);
676
+ didChange = YES;
677
+ } else if (idx < 0 && shouldAdd) {
678
+ classes.push(name);
679
+ didChange = YES;
680
+ }
681
+
682
+ return didChange;
683
+ },
684
+
621
685
  /**
622
- Removes all classnames from the context. If the context represents an
623
- element, this will be handled in CoreQuery.
686
+ Returns YES if the outer tag current has the passed class name, NO
687
+ otherwise.
624
688
 
625
- @returns {SC.RenderContext} receiver
689
+ @param {String} name the class name
690
+ @returns {Boolean}
626
691
  */
627
- resetClassNames: function() {
692
+ hasClass: function (name) {
628
693
  if (this._elem) {
629
- this.$().resetClassNames();
630
- return this;
694
+ return this.$().hasClass(name);
631
695
  }
632
696
 
633
- this._classNames = [];
634
- this._classNamesDidChange = YES ;
635
- return this;
697
+ return this.classes().indexOf(name) >= 0;
698
+ },
699
+
700
+ /** @deprecated */
701
+ resetClassNames: function () {
702
+ //@if(debug)
703
+ SC.warn("Developer Warning: SC.RenderContext:resetClassNames() has been renamed to resetClasses to better match the API of classes(GET) and setClass(SET). Please use `resetClasses()` instead.");
704
+ //@endif
705
+ return this.resetClasses();
636
706
  },
637
707
 
638
708
  /**
639
- You can either pass a single class name and a boolean indicating whether
640
- the value should be added or removed, or you can pass a hash with all
641
- the class names you want to add or remove with a boolean indicating
642
- whether they should be there or not.
709
+ Removes all class names from the context.
643
710
 
644
- This is far more efficient than using addClass/removeClass.
711
+ Be aware that setClass() only effects the class names specified. If there
712
+ are existing class names that are not modified by a call to setClass(), they
713
+ will remain on the context. For example, if you call addClass('a') and
714
+ addClass('b') followed by setClass({ b:NO }), the 'b' class will be
715
+ removed, but the 'a' class will be unaffected.
645
716
 
646
- If this context represents an element, this uses the buffered jQuery to
647
- ensure all planned DOM operations stay in-sync.
717
+ If you want to call setClass() or addClass() to replace all classes, you
718
+ should call this method first.
648
719
 
649
- @param {String|Hash} className class name or hash of classNames + bools
650
- @param {Boolean} shouldAdd for class name if a string was passed
651
720
  @returns {SC.RenderContext} receiver
652
721
  */
653
- setClass: function(className, shouldAdd) {
654
- if (this._elem) {
655
- this.$().setClass(className, shouldAdd);
656
- return this;
657
- }
722
+ resetClasses: function () {
723
+ var didChange = NO,
724
+ classes = this.classes();
658
725
 
659
- var classNames, idx, key, didChange;
660
-
661
- // simple form
662
- if (shouldAdd !== undefined) {
663
- return shouldAdd ? this.addClass(className) : this.removeClass(className);
664
- // bulk form
665
- } else {
666
- classNames = this._classNames ;
667
- if (!classNames) classNames = this._classNames = [];
726
+ // Check for changes.
727
+ didChange = classes.length;
668
728
 
669
- if (this._cloneClassNames) {
670
- classNames = this._classNames = classNames.slice();
671
- this._cloneClassNames = NO ;
672
- }
729
+ // Reset.
730
+ this._classes = [];
731
+ if (didChange) {
732
+ this._classesDidChange = YES;
673
733
 
674
- didChange = NO;
675
- for(key in className) {
676
- if (!className.hasOwnProperty(key)) continue ;
677
- idx = classNames.indexOf(key);
678
- if (className[key]) {
679
- if (idx<0) { classNames.push(key); didChange = YES; }
680
- } else {
681
- if (idx>=0) { classNames[idx] = null; didChange = YES; }
682
- }
734
+ // Apply the styles to the element if we have one already.
735
+ if (this._elem) {
736
+ this.$().attr('class', '');
683
737
  }
684
- if (didChange) this._classNamesDidChange = YES;
685
738
  }
686
739
 
687
- return this ;
740
+ return this;
688
741
  },
689
742
 
690
743
  // ..........................................................
691
744
  // CSS Styles Support
692
745
  //
693
746
 
747
+ /** @private */
694
748
  _STYLE_REGEX: /-?\s*([^:\s]+)\s*:\s*([^;]+)\s*;?/g,
695
749
 
696
750
  /**
697
- Retrieves or sets the current styles for the outer tag. If you retrieve
698
- the styles hash to edit it, you must set the hash again in order for it
699
- to be applied to the element on rendering.
751
+ Retrieves the current styles for the context.
700
752
 
701
- Optionally you can also pass YES to the cloneOnModify param to cause the
702
- styles has to be cloned before it is edited. This is useful if you want
703
- to start with a shared style hash and then optionally modify it for each
704
- context.
705
-
706
- @param {Hash} styles styles hash
707
- @param {Boolean} cloneOnModify
708
- @returns {Hash|SC.RenderContext} styles hash or receiver
753
+ @returns {Object} styles hash
709
754
  */
710
- styles: function(styles, cloneOnModify) {
711
- if (this._elem) {
712
- if (styles) {
713
- this.$().resetStyles().css(styles);
714
- }
715
- return this.$().styles();
755
+ styles: function (deprecatedArg) {
756
+ // Fast path!
757
+ if (deprecatedArg) {
758
+ //@if(debug)
759
+ SC.warn("Developer Warning: SC.RenderContext:styles() is no longer used to set styles, only to retrieve them. Please use `setStyle(%@)` instead.".fmt(deprecatedArg));
760
+ //@endif
761
+ return this.setStyle(deprecatedArg);
716
762
  }
717
763
 
718
- var attr, regex, match;
719
- if (styles === undefined) {
764
+ if (!this._styles) {
765
+ if (this._elem) {
766
+ // Get the styles from the element.
767
+ var attr = this.$().attr('style');
720
768
 
721
- // no styles are defined yet but we do have a source element. Lazily
722
- // extract styles from element.
723
- if (!this._styles && this._elem) {
724
- // parse style...
725
- attr = this.$().attr('style');
726
-
727
- if (attr && (attr = attr.toString()).length>0) {
769
+ if (attr && (attr = attr.toString()).length > 0) {
728
770
  // Ensure attributes are lower case for IE
729
- if(SC.browser.name === SC.BROWSER.ie) {
771
+ if (SC.browser.name === SC.BROWSER.ie) {
730
772
  attr = attr.toLowerCase();
731
773
  }
732
- styles = {};
774
+ var styles = {},
775
+ match,
776
+ regex = this._STYLE_REGEX;
733
777
 
734
- regex = this._STYLE_REGEX ;
735
778
  regex.lastIndex = 0;
736
-
737
- while(match = regex.exec(attr)) styles[this._camelizeStyleName(match[1])] = match[2];
779
+ while (match = regex.exec(attr)) {
780
+ styles[this._camelizeStyleName(match[1])] = match[2];
781
+ }
738
782
 
739
783
  this._styles = styles;
740
- this._cloneStyles = NO;
741
-
742
784
  } else {
785
+ // No style on the element.
743
786
  this._styles = {};
744
787
  }
745
-
746
- // if there is no element or we do have styles, possibly clone them
747
- // before returning.
748
788
  } else {
749
- if (!this._styles) {
750
- this._styles = {};
751
- } else {
752
- if (this._cloneStyles) {
753
- this._styles = SC.clone(this._styles);
754
- this._cloneStyles = NO ;
755
- }
756
- }
789
+ this._styles = {};
757
790
  }
791
+ }
792
+
793
+ return this._styles;
794
+ },
758
795
 
759
- return this._styles ;
796
+ /**
797
+ Adds the specified style to the current context.
798
+
799
+ This is a convenience method that simply calls setStyle(nameOrStyles, value).
760
800
 
761
- // set the styles if passed.
801
+ @param {String|Object} nameOrStyles the name of a style or a hash of style names with values
802
+ @param {String|Number} value style value if a single style name for nameOrStyles is passed
803
+ @returns {SC.RenderContext} receiver
804
+ */
805
+ addStyle: function (nameOrStyles, value) {
806
+ //@if(debug)
807
+ // Notify when this function isn't being used properly (in debug mode only).
808
+ /*jshint eqnull:true*/
809
+ if (SC.typeOf(nameOrStyles) === SC.T_STRING && value == null) {
810
+ SC.warn("Developer Warning: SC.RenderContext:addStyle is not meant to be used to remove attributes by setting the value to null or undefined. It would be more correct to use setStyle(%@, %@).".fmt(nameOrStyles, value));
811
+ }
812
+ //@endif
813
+ return this.setStyle(nameOrStyles, value);
814
+ },
815
+
816
+ /**
817
+ Removes the specified style from the current context.
818
+
819
+ This is a convenience method that simply calls setStyle(name, undefined).
820
+
821
+ @param {String} styleName the name of the style to remove
822
+ @returns {SC.RenderContext} receiver
823
+ */
824
+ removeStyle: function (styleName) {
825
+ return this.setStyle(styleName);
826
+ },
827
+
828
+ /** @deprecated */
829
+ css: function (nameOrStyles, value) {
830
+ //@if(debug)
831
+ SC.warn("Developer Warning: In order to simplify the API to a few core functions, SC.RenderContext:css() has been deprecated in favor of setStyle which performs the same function. Please use `setStyle(%@, %@)` instead.".fmt(nameOrStyles, value));
832
+ //@endif
833
+ return this.setStyle(nameOrStyles, value);
834
+ },
835
+
836
+ /**
837
+ Sets or unsets a style or styles on the context.
838
+
839
+ Passing a value will set the value for the given style name, passing a null
840
+ or undefined value will unset any current value for the given style name and
841
+ remove it.
842
+
843
+ Be aware that setStyle() only effects the styles specified. If there
844
+ are existing styles that are not modified by a call to setStyle(), they
845
+ will remain on the context. For example, if you call addStyle('margin-left', 10)
846
+ and addStyle('margin-right', 10) followed by setClass({ 'margin-right': null }),
847
+ the 'margin-right' style will be removed, but the 'margin-left' style will
848
+ be unaffected.
849
+
850
+ If you want to call setStyle() or addStyle() to replace all styles, you
851
+ should call resetStyles() method first.
852
+
853
+ When used in render() for example,
854
+
855
+ MyApp.MyView = SC.View.extend({
856
+
857
+ textColor: 'blue',
858
+
859
+ // By default this syle will not appear since the value is null.
860
+ fontFamily: null,
861
+
862
+ render: function (context) {
863
+ var textColor = this.get('textColor'),
864
+ fontFamily = this.get('fontFamily');
865
+
866
+ // Set the `color` and `fontFamily` styles.
867
+ context.setStyle({
868
+ color: textColor,
869
+ fontFamily: fontFamily
870
+ });
871
+ }
872
+ });
873
+
874
+ @param {String|Object} nameOrStyles the name of a style or a hash of style names with values
875
+ @param {String|Number} [value] style value if a single style name for nameOrStyles is passed
876
+ @returns {SC.RenderContext} receiver
877
+ */
878
+ setStyle: function (nameOrStyles, value) {
879
+ var didChange = NO,
880
+ styles = this.styles();
881
+
882
+ // Add the updated styles to the internal styles object.
883
+ if (SC.typeOf(nameOrStyles) === SC.T_HASH) {
884
+ for (var key in nameOrStyles) {
885
+ if (!nameOrStyles.hasOwnProperty(key)) continue;
886
+
887
+ value = nameOrStyles[key];
888
+
889
+ didChange = this._deleteComboStyles(styles, key) || didChange;
890
+ didChange = this._setOnHash(styles, key, value) || didChange;
891
+ }
762
892
  } else {
763
- this._styles = styles ;
764
- this._cloneStyles = cloneOnModify || NO ;
765
- this._stylesDidChange = YES ;
766
- return this ;
893
+ didChange = this._deleteComboStyles(styles, nameOrStyles);
894
+ didChange = this._setOnHash(styles, nameOrStyles, value) || didChange;
895
+ }
896
+
897
+ if (didChange) {
898
+
899
+ // Set the styles on the element if we have one already.
900
+ if (this._elem) {
901
+ // Note: jQuery .css doesn't remove old styles
902
+ this.$().css(styles);
903
+ }
767
904
  }
905
+
906
+ return this;
768
907
  },
769
908
 
770
- _deleteComboStyles: function(styles, key) {
909
+ /** @private */
910
+ _deleteComboStyles: function (styles, key) {
771
911
  var comboStyles = SC.COMBO_STYLES[key],
772
912
  didChange = NO, tmp;
773
913
 
774
914
  if (comboStyles) {
775
-
776
- for (var idx=0, idxLen = comboStyles.length; idx < idxLen; idx++) {
915
+ for (var idx = 0, idxLen = comboStyles.length; idx < idxLen; idx++) {
777
916
  tmp = comboStyles[idx];
778
917
  if (styles[tmp]) {
779
918
  delete styles[tmp];
@@ -781,159 +920,245 @@ SC.RenderContext = SC.Builder.create(
781
920
  }
782
921
  }
783
922
  }
923
+
924
+ return didChange;
925
+ },
926
+
927
+ /** @private Sets or unsets the key:value on the hash and returns whether a change occurred. */
928
+ _setOnHash: function (hash, key, value) {
929
+ /*jshint eqnull:true*/
930
+ var cur = hash[key],
931
+ didChange = true;
932
+
933
+ if (cur == null && value != null) {
934
+ hash[key] = value;
935
+ } else if (cur != null && value == null) {
936
+ // Unset using '' so that jQuery will remove the value, null is not reliable (ex. WebkitTransform)
937
+ hash[key] = '';
938
+ } else if (cur != value) {
939
+ hash[key] = value;
940
+ } else {
941
+ didChange = false;
942
+ }
943
+
784
944
  return didChange;
785
945
  },
786
946
 
787
947
  /**
788
- Clears all of the tag's styles.
948
+ Removes all styles from the context.
949
+
950
+ Be aware that setStyle() only effects the styles specified. If there
951
+ are existing styles that are not modified by a call to setStyle(), they
952
+ will remain on the context. For example, if you call addStyle('margin-left', 10)
953
+ and addStyle('margin-right', 10) followed by setClass({ 'margin-right': null }),
954
+ the 'margin-right' style will be removed, but the 'margin-left' style will
955
+ be unaffected.
956
+
957
+ If you want to call setStyle() or addStyle() to replace all styles, you
958
+ should call this method first.
959
+
789
960
  @returns {SC.RenderContext} receiver
790
961
  */
791
- resetStyles: function() {
792
- this.styles({});
962
+ resetStyles: function () {
963
+ var didChange = NO,
964
+ styles = this.styles();
965
+
966
+ // Check for changes (i.e. are there any properties in the object).
967
+ for (var key in styles) {
968
+ if (!styles.hasOwnProperty(key)) continue;
969
+
970
+ didChange = YES;
971
+ }
972
+
973
+ // Reset.
974
+ this._styles = {};
975
+ if (didChange) {
976
+ // Apply the styles to the element if we have one already.
977
+ if (this._elem) {
978
+ this.$().attr('style', '');
979
+ }
980
+ }
981
+
793
982
  return this;
794
983
  },
795
984
 
985
+ // ..........................................................
986
+ // ARBITRARY ATTRIBUTES SUPPORT
987
+ //
796
988
 
797
989
  /**
798
- Apply the passed styles to the tag. You can pass either a single key
799
- value pair or a hash of styles. Note that if you set a style on an
800
- existing element, it will replace any existing styles on the element.
990
+ Retrieves the current attributes for the context, less the class and style
991
+ attributes.
801
992
 
802
- @param {String|Hash} nameOrStyles the style name or a hash of styles
803
- @param {String|Number} value style value if string name was passed
804
- @returns {SC.RenderContext} receiver
805
- */
806
- addStyle: function(nameOrStyles, value) {
807
- if (this._elem) {
808
- this.$().css(nameOrStyles, value);
809
- return this;
810
- }
993
+ If you retrieve the attributes hash to edit it, you must pass the hash back
994
+ to setAttr in order for it to be applied to the element on rendering.
995
+
996
+ Use classes() or styles() to get those specific attributes.
811
997
 
812
- // get the current hash of styles. This will extract the styles and
813
- // clone them if needed. This will get the actual styles hash so we can
814
- // edit it directly.
815
- var key, didChange = NO, styles = this.styles();
816
-
817
- // simple form
818
- if (typeof nameOrStyles === SC.T_STRING) {
819
- if (value === undefined) { // reader
820
- return styles[nameOrStyles];
821
- } else { // writer
822
- didChange = this._deleteComboStyles(styles, nameOrStyles);
823
- if (styles[nameOrStyles] !== value) {
824
- styles[nameOrStyles] = value ;
825
- didChange = YES ;
998
+ @returns {Object} attributes hash
999
+ */
1000
+ attrs: function () {
1001
+ if (!this._attrs) {
1002
+ if (this._elem) {
1003
+ // Get the attributes from the element.
1004
+ var attrs = {},
1005
+ elAttrs = this._elem.attributes,
1006
+ length = elAttrs.length;
1007
+
1008
+ for (var i = 0, attr, name; i < length; i++) {
1009
+ attr = elAttrs.item(i);
1010
+ name = attr.nodeName;
1011
+ if (name.match(/^(?!class|style).*$/i)) {
1012
+ attrs[name] = attr.nodeValue;
1013
+ }
826
1014
  }
827
- if (didChange) this._stylesDidChange = YES;
1015
+
1016
+ this._attrs = attrs;
1017
+ } else {
1018
+ this._attrs = {};
828
1019
  }
1020
+ }
829
1021
 
830
- // bulk form
831
- } else {
832
- for(key in nameOrStyles) {
833
- if (!nameOrStyles.hasOwnProperty(key)) continue ;
834
- didChange = didChange || this._deleteComboStyles(styles, key);
835
- value = nameOrStyles[key];
836
- if (styles[key] !== value) {
837
- styles[key] = value;
838
- didChange = YES;
839
- }
1022
+ return this._attrs;
1023
+ },
1024
+
1025
+ /** @deprecated */
1026
+ attr: function (nameOrAttrs, value) {
1027
+ // Fast path.
1028
+ if (nameOrAttrs) {
1029
+
1030
+ if (SC.typeOf(nameOrAttrs) === SC.T_HASH || value !== undefined) {
1031
+ //@if(debug)
1032
+ SC.warn("Developer Warning: SC.RenderContext:attr() is no longer used to set attributes. Please use `setAttr()` instead, which matches the API of setClass() and setStyle().");
1033
+ //@endif
1034
+ return this.setAttr(nameOrAttrs, value);
1035
+ } else {
1036
+ //@if(debug)
1037
+ SC.warn("Developer Warning: SC.RenderContext:attr() is no longer used to get an attribute. Please use `attrs()` instead to retrieve the hash and check properties on it directly, which matches the API of classes() and styles().");
1038
+ //@endif
1039
+ return this.attrs()[nameOrAttrs];
840
1040
  }
841
- if (didChange) this._stylesDidChange = YES ;
842
1041
  }
1042
+ //@if(debug)
1043
+ SC.warn("Developer Warning: SC.RenderContext:attr() is no longer used to get attributes. Please use `attrs()` instead, which matches the API of classes() and styles().");
1044
+ //@endif
843
1045
 
844
- return this ;
1046
+ return this.attrs();
845
1047
  },
846
1048
 
847
1049
  /**
848
- Removes the named style from the style hash.
1050
+ Adds the specified attribute to the current context.
849
1051
 
850
- Note that if you delete a style, the style will not actually be removed
851
- from the style hash. Instead, its value will be set to null.
1052
+ This is a convenience method that simply calls setAttr(nameOrAttrs, value).
852
1053
 
853
- @param {String} styleName
1054
+ @param {String|Object} nameOrAttrs the name of an attribute or a hash of attribute names with values
1055
+ @param {String|Number} value attribute value if a single attribute name for nameOrAttrs is passed
854
1056
  @returns {SC.RenderContext} receiver
855
1057
  */
856
- removeStyle: function(styleName) {
857
- if (this._elem) {
858
- this.$().css(styleName, null);
859
- return this;
860
- }
861
-
862
- // avoid case where no styles have been defined
863
- if (!this._styles) return this;
864
-
865
- // get styles hash. this will clone if needed.
866
- var styles = this.styles();
867
- if (styles[styleName]) {
868
- styles[styleName] = null;
869
- this._stylesDidChange = YES ;
1058
+ addAttr: function (nameOrAttrs, value) {
1059
+ //@if(debug)
1060
+ // Notify when this function isn't being used properly (in debug mode only).
1061
+ /*jshint eqnull:true*/
1062
+ if (SC.typeOf(nameOrAttrs) === SC.T_STRING && value == null) {
1063
+ SC.warn("Developer Warning: SC.RenderContext:addAttr is not meant to be used to remove attributes by setting the value to null or undefined. It would be more correct to use setAttr(%@, %@).".fmt(nameOrAttrs, value));
870
1064
  }
1065
+ //@endif
1066
+ return this.setAttr(nameOrAttrs, value);
871
1067
  },
872
1068
 
873
- // ..........................................................
874
- // ARBITRARY ATTRIBUTES SUPPORT
875
- //
876
-
877
1069
  /**
878
- Sets the named attribute on the tag. Note that if you set the 'class'
879
- attribute or the 'styles' attribute, it will be ignored. Use the
880
- relevant class name and style methods instead.
1070
+ Removes the specified attribute from the current context.
881
1071
 
882
- @param {String|Hash} nameOrAttrs the attr name or hash of attrs.
883
- @param {String} value attribute value if attribute name was passed
1072
+ This is a convenience method that simply calls setAttr(name, undefined).
1073
+
1074
+ @param {String} styleName the name of the attribute to remove
884
1075
  @returns {SC.RenderContext} receiver
885
1076
  */
886
- attr: function(nameOrAttrs, value) {
887
- if (this._elem) {
888
- this.$().attr(nameOrAttrs, value);
889
- return this;
1077
+ removeAttr: function (name) {
1078
+ //@if(debug)
1079
+ // Notify when this function isn't being used properly (in debug mode only).
1080
+ if (name.match(/^(class|style)$/i)) {
1081
+ SC.error("Developer Error: SC.RenderContext:removeAttr is not meant to be used to remove the style or class attribute. You should use resetClasses() or resetStyles().");
890
1082
  }
1083
+ //@endif
1084
+
1085
+ return this.setAttr(name);
1086
+ },
1087
+
1088
+ /**
1089
+ Sets or unsets an attribute or attributes on the context. Passing a value
1090
+ will set the value for the given attribute name, passing a null or undefined
1091
+ value will unset any current value for the given attribute name and remove
1092
+ it.
1093
+
1094
+ When used in render() for example,
1095
+
1096
+ MyApp.MyView = SC.View.extend({
1097
+
1098
+ // By default this syle will not appear since the value is null.
1099
+ title: null,
891
1100
 
1101
+ render: function (context) {
1102
+ var title = this.get('title');
892
1103
 
893
- var key, attrs = this._attrs, didChange = NO ;
894
- if (!attrs) this._attrs = attrs = {} ;
1104
+ // Set the `title` and `data-test` attributes.
1105
+ context.setAttr({
1106
+ title: title,
1107
+ 'data-test': SC.buildMode === 'test'
1108
+ });
1109
+ }
1110
+ });
895
1111
 
896
- // simple form
897
- if (typeof nameOrAttrs === SC.T_STRING) {
898
- if (value === undefined) { // getter
899
- return attrs[nameOrAttrs];
900
- } else { // setter
901
- if (attrs[nameOrAttrs] !== value) {
902
- attrs[nameOrAttrs] = value ;
903
- this._attrsDidChange = YES ;
1112
+ @param {String|Object} nameOrAttrs the name of an attribute or a hash of attribute names with values
1113
+ @param {String} [value] attribute value if a single attribute name for nameOrAttrs is passed
1114
+ @returns {SC.RenderContext} receiver
1115
+ */
1116
+ setAttr: function (nameOrAttrs, value) {
1117
+ var didChange = NO,
1118
+ attrs = this.attrs(),
1119
+ key;
1120
+
1121
+ //@if(debug)
1122
+ // Add some developer support to prevent improper use (in debug mode only).
1123
+ var foundImproperUse = NO;
1124
+ if (SC.typeOf(nameOrAttrs) === SC.T_HASH) {
1125
+
1126
+ for (key in nameOrAttrs) {
1127
+ if (key.match(/^(class|style)$/i)) {
1128
+ foundImproperUse = YES;
904
1129
  }
905
1130
  }
1131
+ } else if (nameOrAttrs.match(/^(class|style)$/i)) {
1132
+ foundImproperUse = YES;
1133
+ }
1134
+
1135
+ if (foundImproperUse) {
1136
+ SC.error("Developer Error: setAttr() is not meant to set class or style attributes. Only classes and styles added with their relevant methods will be used. Please use setClass() or setStyle().");
1137
+ }
1138
+ //@endif
1139
+
1140
+ // Add the updated attrs to the internal attrs object.
1141
+ if (SC.typeOf(nameOrAttrs) === SC.T_HASH) {
1142
+ for (key in nameOrAttrs) {
1143
+ if (!nameOrAttrs.hasOwnProperty(key)) continue;
906
1144
 
907
- // bulk form
908
- } else {
909
- for(key in nameOrAttrs) {
910
- if (!nameOrAttrs.hasOwnProperty(key)) continue ;
911
1145
  value = nameOrAttrs[key];
912
- if (attrs[key] !== value) {
913
- attrs[key] = value ;
914
- didChange = YES ;
915
- }
1146
+ didChange = this._setOnHash(attrs, key, value) || didChange;
916
1147
  }
917
- if (didChange) this._attrsDidChange = YES ;
1148
+ } else {
1149
+ didChange = this._setOnHash(attrs, nameOrAttrs, value);
918
1150
  }
919
1151
 
920
- return this ;
921
- },
922
-
923
- /**
924
- Sets the named attribute on the tag. Note that if you set the 'class'
925
- attribute or the 'styles' attribute, it will be ignored. Use the
926
- relevant class name and style methods instead.
1152
+ if (didChange) {
1153
+ this._attrsDidChange = YES;
927
1154
 
928
- @param {String|Hash} nameOrAttrs the attr name or hash of attrs.
929
- @param {String} value attribute value if attribute name was passed
930
- @returns {SC.RenderContext} receiver
931
- */
932
- removeAttr: function(name) {
933
- if (this._elem) {
934
- this.$().removeAttr(name);
935
- return this;
1155
+ // Apply the attrs to the element if we have one already.
1156
+ if (this._elem) {
1157
+ this.$().attr(nameOrAttrs, value);
1158
+ }
936
1159
  }
1160
+
1161
+ return this;
937
1162
  },
938
1163
 
939
1164
  //
@@ -946,9 +1171,9 @@ SC.RenderContext = SC.Builder.create(
946
1171
 
947
1172
  Renderers may use this to modify DOM.
948
1173
  */
949
- $: function(sel) {
1174
+ $: function (sel) {
950
1175
  var ret, elem = this._elem;
951
- ret = !elem ? SC.$.buffer([]) : (sel === undefined) ? SC.$.buffer(elem) : SC.$.buffer(sel, elem);
1176
+ ret = !elem ? SC.$([]) : (sel === undefined) ? SC.$(elem) : SC.$(sel, elem);
952
1177
  elem = null;
953
1178
  return ret;
954
1179
  },
@@ -956,13 +1181,13 @@ SC.RenderContext = SC.Builder.create(
956
1181
 
957
1182
  /** @private
958
1183
  */
959
- _camelizeStyleName: function(name) {
1184
+ _camelizeStyleName: function (name) {
960
1185
  // IE wants the first letter lowercase so we can allow normal behavior
961
1186
  var needsCap = name.match(/^-(webkit|moz|o)-/),
962
1187
  camelized = SC.String.camelize(name);
963
1188
 
964
1189
  if (needsCap) {
965
- return camelized.substr(0,1).toUpperCase() + camelized.substr(1);
1190
+ return camelized.substr(0, 1).toUpperCase() + camelized.substr(1);
966
1191
  } else {
967
1192
  return camelized;
968
1193
  }
@@ -971,45 +1196,38 @@ SC.RenderContext = SC.Builder.create(
971
1196
  /** @private
972
1197
  Converts camelCased style names to dasherized forms
973
1198
  */
974
- _dasherizeStyleName: function(name) {
1199
+ _dasherizeStyleName: function (name) {
975
1200
  var dasherized = SC.String.dasherize(name);
976
- if (dasherized.match(/^(webkit|moz|ms|o)-/)) { dasherized = '-'+dasherized; }
1201
+ if (dasherized.match(/^(webkit|moz|ms|o)-/)) { dasherized = '-' + dasherized; }
977
1202
  return dasherized;
978
1203
  }
979
1204
 
980
1205
  });
981
1206
 
982
- /**
983
- html is an alias for push(). Makes the object more CoreQuery like
984
- */
985
- SC.RenderContext.fn.html = SC.RenderContext.fn.push;
986
-
987
- /**
988
- css is an alias for addStyle(). This this object more CoreQuery like.
989
- */
990
- SC.RenderContext.fn.css = SC.RenderContext.fn.addStyle;
991
-
992
- (function() {
993
- var _escapeHTMLRegex = /[&<>]/g, _escapeHTMLMethod = function(match) {
994
- switch(match) {
995
- case '&': return '&amp;';
996
- case '<': return '&lt;';
997
- case '>': return '&gt;';
1207
+ (function () {
1208
+ var _escapeHTMLRegex = /[&<>]/g, _escapeHTMLMethod = function (match) {
1209
+ switch (match) {
1210
+ case '&':
1211
+ return '&amp;';
1212
+ case '<':
1213
+ return '&lt;';
1214
+ case '>':
1215
+ return '&gt;';
998
1216
  }
999
1217
  };
1000
1218
 
1001
- /**
1002
- Helper method escapes the passed string to ensure HTML is displayed as
1003
- plain text. You should make sure you pass all user-entered data through
1004
- this method to avoid errors. You can also do this with the text() helper
1005
- method on a render context.
1219
+ /**
1220
+ Helper method escapes the passed string to ensure HTML is displayed as
1221
+ plain text. You should make sure you pass all user-entered data through
1222
+ this method to avoid errors. You can also do this with the text() helper
1223
+ method on a render context.
1006
1224
 
1007
- @param {String|Number} text value to escape
1008
- @returns {String} string with all HTML values properly escaped
1009
- */
1010
- SC.RenderContext.escapeHTML = function(text) {
1225
+ @param {String|Number} text value to escape
1226
+ @returns {String} string with all HTML values properly escaped
1227
+ */
1228
+ SC.RenderContext.escapeHTML = function (text) {
1011
1229
  if (!text) return '';
1012
1230
  if (SC.typeOf(text) === SC.T_NUMBER) { text = text.toString(); }
1013
1231
  return text.replace(_escapeHTMLRegex, _escapeHTMLMethod);
1014
- };
1232
+ };
1015
1233
  })();