sproutcore 1.10.3.1 → 1.11.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (380) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG +4 -8
  3. data/VERSION.yml +2 -2
  4. data/lib/frameworks/sproutcore/Buildfile +5 -4
  5. data/lib/frameworks/sproutcore/CHANGELOG.md +274 -40
  6. data/lib/frameworks/sproutcore/CONTRIBUTORS.md +133 -0
  7. data/lib/frameworks/sproutcore/README.md +31 -144
  8. data/lib/frameworks/sproutcore/apps/showcase/controllers/source_tree_controller.js +9 -4
  9. data/lib/frameworks/sproutcore/apps/showcase/resources/stylesheet.css +5 -0
  10. data/lib/frameworks/sproutcore/apps/showcase/system/views_item_content.js +1 -1
  11. data/lib/frameworks/sproutcore/apps/showcase/views/split_views.js +15 -2
  12. data/lib/frameworks/sproutcore/apps/showcase/views/stacked_views.js +1 -1
  13. data/lib/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +11 -1
  14. data/lib/frameworks/sproutcore/frameworks/ajax/mixins/websocket_delegate.js +90 -0
  15. data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +81 -5
  16. data/lib/frameworks/sproutcore/frameworks/ajax/system/response.js +23 -4
  17. data/lib/frameworks/sproutcore/frameworks/ajax/system/websocket.js +475 -0
  18. data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/request.js +149 -26
  19. data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/websocket.js +197 -0
  20. data/lib/frameworks/sproutcore/frameworks/ajax/tests/system/xhr_response_test.js +65 -0
  21. data/lib/frameworks/sproutcore/frameworks/bootstrap/system/loader.js +4 -0
  22. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/horizontal_stack_layout.js +232 -52
  23. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/vertical_stack_layout.js +235 -49
  24. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +23 -13
  25. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/object.js +3 -1
  26. data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +81 -1
  27. data/lib/frameworks/sproutcore/frameworks/core_foundation/english.lproj/ordinal.js +17 -0
  28. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/string.js +7 -0
  29. data/lib/frameworks/sproutcore/frameworks/{desktop/tests/views/disclosure/methods.js → core_foundation/french.lproj/ordinal.js} +7 -4
  30. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/layout.js +2 -6
  31. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/main.js +1 -1
  32. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +104 -69
  33. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane_statechart.js +6 -1
  34. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/child_view_layout_protocol.js +59 -0
  35. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/view_transition_protocol.js +18 -1
  36. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/application.js +192 -0
  37. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/bezier_curves.js +52 -0
  38. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/color.js +384 -64
  39. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/core_query.js +6 -14
  40. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/device.js +21 -35
  41. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +72 -36
  42. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +90 -34
  43. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/platform.js +55 -7
  44. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/render_context.js +20 -15
  45. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/req_anim_frame.js +9 -10
  46. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +763 -542
  47. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/selection_set.js +4 -3
  48. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +1 -7
  49. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/string.js +14 -0
  50. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/touch.js +538 -0
  51. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils/rect.js +56 -1
  52. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +99 -4
  53. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/single_case.js +25 -19
  54. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/core_tests.js +75 -0
  55. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/ext/number_test.js +81 -0
  56. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/action_support.js +4 -4
  57. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/responder_context.js +4 -4
  58. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/string.js +19 -1
  59. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/color.js +36 -20
  60. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/design_modes_test.js +83 -0
  61. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/makeMainPane.js +7 -3
  62. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/mouse_events.js +338 -0
  63. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/root_responder.js +14 -89
  64. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/root_responder/touch.js +106 -0
  65. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +2 -2
  66. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/touch.js +136 -0
  67. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/utils/rect.js +42 -1
  68. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/append_remove.js +11 -0
  69. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/child_view.js +5 -5
  70. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/design_mode_test.js +457 -0
  71. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/sendEvent.js +36 -10
  72. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/background_color.js +44 -0
  73. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/border_frame_test.js +51 -24
  74. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/childViewLayout_test.js +176 -1
  75. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +46 -16
  76. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertFrames.js +69 -15
  77. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/didAppendToDocument.js +2 -2
  78. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layout.js +7 -1
  79. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js +30 -10
  80. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +376 -71
  81. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/static_layout.js +0 -10
  82. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/viewDidResize.js +117 -34
  83. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view_states_test.js +52 -2
  84. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +656 -42
  85. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +159 -38
  86. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/cursor.js +0 -7
  87. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/design_mode.js +206 -0
  88. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +0 -28
  89. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/keyboard.js +21 -6
  90. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +372 -450
  91. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout_style.js +28 -13
  92. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +22 -51
  93. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/statechart.js +59 -30
  94. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +0 -29
  95. data/lib/frameworks/sproutcore/frameworks/datastore/mixins/relationship_support.js +22 -10
  96. data/lib/frameworks/sproutcore/frameworks/datastore/models/children_attribute.js +42 -36
  97. data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +54 -3
  98. data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +178 -59
  99. data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +2 -2
  100. data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +206 -132
  101. data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +214 -118
  102. data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +96 -13
  103. data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +14 -4
  104. data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +82 -42
  105. data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +272 -177
  106. data/lib/frameworks/sproutcore/frameworks/datastore/tests/integration/store_interaction_test.js +54 -0
  107. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/datetime_recordattribute.js +24 -16
  108. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +6 -3
  109. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/data_store.js +267 -35
  110. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js +57 -46
  111. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +150 -53
  112. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array_complex.js +57 -17
  113. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_complex.js +13 -9
  114. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/polymorphism → datastore}/tests/models/polymorphism/many.js +2 -2
  115. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/polymorphism → datastore}/tests/models/polymorphism/simple.js +0 -0
  116. data/lib/frameworks/sproutcore/frameworks/{experimental/frameworks/polymorphism → datastore}/tests/models/polymorphism/single.js +12 -2
  117. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +20 -15
  118. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +9 -2
  119. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/many_array/core_methods.js +80 -14
  120. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/autonomous_dataSourceCallbacks.js +280 -0
  121. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/autonomous_pushChanges.js +232 -0
  122. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +31 -5
  123. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/parse.js +16 -2
  124. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +60 -40
  125. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/materializeRecord.js +78 -0
  126. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +13 -1
  127. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/tests/system/datetime.js +20 -0
  128. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/{resources → english.lproj}/strings.js +0 -0
  129. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/french.lproj/strings.js +45 -0
  130. data/lib/frameworks/sproutcore/frameworks/designer/designers/object_designer.js +7 -3
  131. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +125 -44
  132. data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +139 -48
  133. data/lib/frameworks/sproutcore/frameworks/desktop/panes/draggable.js +202 -0
  134. data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +59 -56
  135. data/lib/frameworks/sproutcore/frameworks/desktop/panes/palette.js +13 -49
  136. data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +466 -305
  137. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +49 -12
  138. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/slider.js +79 -21
  139. data/lib/frameworks/sproutcore/frameworks/desktop/render_delegates/split.js +12 -2
  140. data/lib/frameworks/sproutcore/frameworks/desktop/resources/menu_item_view.css +8 -0
  141. data/lib/frameworks/sproutcore/frameworks/desktop/resources/overlay-scroller.css +187 -0
  142. data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +94 -30
  143. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +163 -3
  144. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +97 -78
  145. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +61 -1
  146. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +7 -3
  147. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +47 -22
  148. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +66 -9
  149. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +21 -11
  150. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +12 -18
  151. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/methods.js +17 -14
  152. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +2 -1
  153. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +9 -6
  154. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/collection_fast_path.js +54 -21
  155. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/content.js +52 -20
  156. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +94 -4
  157. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/keyboard.js +177 -0
  158. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/layerIdFor.js +13 -1
  159. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/length.js +9 -9
  160. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +18 -0
  161. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +104 -0
  162. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +48 -49
  163. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/grid/drag_and_drop.js +22 -18
  164. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/grid/methods.js +17 -5
  165. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/link_view_test.js +136 -0
  166. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/contentIndexesInRect.js +77 -0
  167. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/drag_and_drop.js +53 -16
  168. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/layoutForContentIndex.js +41 -0
  169. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowDelegate.js +25 -25
  170. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowOffsetForContentIndex.js +102 -27
  171. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/{rowHeightForContentIndex.js → rowSizeForContentIndex.js} +7 -6
  172. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +2 -0
  173. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +70 -75
  174. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +29 -30
  175. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +57 -0
  176. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/menu_scroll_view/menu_scroll_view_test.js +206 -0
  177. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +15 -0
  178. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/radio/methods.js +15 -7
  179. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/integration.js +16 -11
  180. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +164 -12
  181. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/scale.js +387 -0
  182. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/touch.js +549 -0
  183. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +214 -45
  184. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroller.js +5 -5
  185. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +73 -22
  186. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +88 -3
  187. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select/methods.js +8 -0
  188. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/slider/methods.js +16 -1
  189. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/slider/ui.js +54 -0
  190. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/dividers.js +21 -2
  191. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/static_content.js +31 -25
  192. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +109 -29
  193. data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +10 -1
  194. data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +3 -0
  195. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +779 -603
  196. data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +106 -7
  197. data/lib/frameworks/sproutcore/frameworks/desktop/views/link_view.js +406 -0
  198. data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +437 -245
  199. data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +13 -0
  200. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +124 -62
  201. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +176 -597
  202. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroller_view.js +206 -0
  203. data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +3 -0
  204. data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +5 -4
  205. data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +3 -0
  206. data/lib/frameworks/sproutcore/frameworks/desktop/views/scene.js +56 -158
  207. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll_view.js +2560 -0
  208. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +458 -242
  209. data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +117 -54
  210. data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +18 -12
  211. data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +162 -34
  212. data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +30 -15
  213. data/lib/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +33 -7
  214. data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +22 -2
  215. data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +47 -22
  216. data/lib/frameworks/sproutcore/frameworks/experimental/Buildfile +0 -6
  217. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form.js +2 -1
  218. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/forms/views/form_row.js +21 -21
  219. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/ext/menu.js +14 -3
  220. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/mixins/select_view_menu.js +24 -10
  221. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/ext/menu_resizing.js +1 -1
  222. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/mixins/select_view_menu/bindings.js +7 -4
  223. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/mixins/select_view_menu/check_selected.js +7 -9
  224. data/lib/frameworks/sproutcore/frameworks/{desktop/tests/panes/select_button/methods.js → experimental/frameworks/select_view/tests/views/select/method.js} +54 -76
  225. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/tests/views/select/selected_item.js +35 -0
  226. data/lib/frameworks/sproutcore/frameworks/{desktop/tests/panes/select_button → experimental/frameworks/select_view/tests/views/select}/ui.js +107 -36
  227. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/select_view/views/select.js +225 -66
  228. data/lib/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +39 -38
  229. data/lib/frameworks/sproutcore/frameworks/foundation/core.js +5 -18
  230. data/lib/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +12 -0
  231. data/lib/frameworks/sproutcore/frameworks/foundation/english.lproj/inflections.js +84 -0
  232. data/lib/frameworks/sproutcore/frameworks/foundation/french.lproj/inflections.js +41 -0
  233. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js +1 -0
  234. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +7 -0
  235. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +3 -4
  236. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/flowed_layout.js +6 -2
  237. data/lib/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +408 -239
  238. data/lib/frameworks/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +1 -1
  239. data/lib/frameworks/sproutcore/frameworks/foundation/resources/text_field.css +2 -1
  240. data/lib/frameworks/sproutcore/frameworks/foundation/spanish.lproj/inflections.js +38 -0
  241. data/lib/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +104 -76
  242. data/lib/frameworks/sproutcore/frameworks/foundation/system/string.js +20 -94
  243. data/lib/frameworks/sproutcore/frameworks/foundation/system/text_selection.js +33 -22
  244. data/lib/frameworks/sproutcore/frameworks/foundation/system/undo_manager.js +475 -0
  245. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_resize_test.js +163 -1
  246. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/flowed_layout/tests.js +41 -0
  247. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +2 -5
  248. data/lib/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/methods.js +268 -0
  249. data/lib/frameworks/sproutcore/frameworks/foundation/tests/system/undo_manager.js +231 -0
  250. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +16 -0
  251. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +27 -0
  252. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +24 -0
  253. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +135 -6
  254. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/fade_transition.js +6 -0
  255. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/pop_transition.js +7 -0
  256. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/scale_transition.js +6 -0
  257. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/slide_transition.js +4 -0
  258. data/lib/frameworks/sproutcore/frameworks/foundation/transitions/swap_dissolve_transition.js +3 -1
  259. data/lib/frameworks/sproutcore/frameworks/foundation/validators/credit_card.js +21 -21
  260. data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +65 -15
  261. data/lib/frameworks/sproutcore/frameworks/foundation/views/image.js +4 -1
  262. data/lib/frameworks/sproutcore/frameworks/foundation/views/label.js +1 -1
  263. data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +193 -213
  264. data/lib/frameworks/sproutcore/frameworks/jquery/{jquery-1.8.3-patched.js → jquery-1.11.1.js} +7507 -6684
  265. data/lib/frameworks/sproutcore/frameworks/routing/system/routes.js +28 -11
  266. data/lib/frameworks/sproutcore/frameworks/routing/tests/system/routes.js +26 -0
  267. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +54 -25
  268. data/lib/frameworks/sproutcore/frameworks/runtime/ext/array.js +0 -6
  269. data/lib/frameworks/sproutcore/frameworks/runtime/ext/number.js +36 -0
  270. data/lib/frameworks/sproutcore/frameworks/runtime/ext/window.js +25 -0
  271. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +3 -3
  272. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +1 -1
  273. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +156 -66
  274. data/lib/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +2 -2
  275. data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +150 -65
  276. data/lib/frameworks/sproutcore/frameworks/runtime/system/index_set.js +57 -11
  277. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +68 -49
  278. data/lib/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +14 -6
  279. data/lib/frameworks/sproutcore/frameworks/runtime/system/string.js +23 -23
  280. data/lib/frameworks/sproutcore/frameworks/runtime/tests/ext/number_test.js +44 -0
  281. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +0 -10
  282. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable.js +340 -285
  283. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +104 -3
  284. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/observer_set.js +14 -1
  285. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/string.js +15 -2
  286. data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +21 -18
  287. data/lib/frameworks/sproutcore/frameworks/statechart/system/statechart.js +52 -19
  288. data/lib/frameworks/sproutcore/frameworks/statechart/tests/event_handling/responder/pane.js +27 -24
  289. data/lib/frameworks/sproutcore/frameworks/template_view/controls/button.js +30 -0
  290. data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/bind.js +1 -1
  291. data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/collection.js +2 -0
  292. data/lib/frameworks/sproutcore/frameworks/template_view/ext/handlebars/view.js +1 -0
  293. data/lib/frameworks/sproutcore/frameworks/template_view/tests/mixins/template_helpers/checkbox_support.js +2 -2
  294. data/lib/frameworks/sproutcore/frameworks/template_view/tests/views/template/handlebars.js +4 -2
  295. data/lib/frameworks/sproutcore/frameworks/template_view/views/bindable_span.js +1 -1
  296. data/lib/frameworks/sproutcore/frameworks/template_view/views/template_collection.js +16 -14
  297. data/lib/frameworks/sproutcore/frameworks/testing/core.js +5 -3
  298. data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +13 -0
  299. data/lib/frameworks/sproutcore/lib/index.rhtml +2 -2
  300. data/lib/frameworks/sproutcore/phantomjs/test_runner.js +28 -7
  301. data/lib/frameworks/sproutcore/scripts/run_sc_server_master.sh +1 -1
  302. data/lib/frameworks/sproutcore/themes/ace/resources/_variables.css +2 -0
  303. data/lib/frameworks/sproutcore/themes/ace/resources/disclosure/ace/disclosure.css +1 -0
  304. data/lib/frameworks/sproutcore/themes/ace/resources/picker/popover/popover.css +3 -4
  305. data/lib/frameworks/sproutcore/themes/ace/resources/scroller/horizontal/horizontal.css +15 -15
  306. data/lib/frameworks/sproutcore/themes/ace/resources/scroller/horizontal/horizontal_overlay.css +74 -0
  307. data/lib/frameworks/sproutcore/themes/ace/resources/scroller/vertical/vertical.css +11 -13
  308. data/lib/frameworks/sproutcore/themes/ace/resources/scroller/vertical/vertical_overlay.css +74 -0
  309. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/jumbo/knob-active.png +0 -0
  310. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/jumbo/knob-active@2x.png +0 -0
  311. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/jumbo/knob.png +0 -0
  312. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/jumbo/knob@2x.png +0 -0
  313. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/{22px → jumbo}/slider.css +9 -4
  314. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/jumbo/track.png +0 -0
  315. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/jumbo/track@2x.png +0 -0
  316. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/knob-active.png +0 -0
  317. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/knob-active@2x.png +0 -0
  318. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/knob.png +0 -0
  319. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/knob@2x.png +0 -0
  320. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/slider.css +32 -0
  321. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/track.png +0 -0
  322. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/regular/track@2x.png +0 -0
  323. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/slider.css +13 -0
  324. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/knob-active.png +0 -0
  325. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/knob-active@2x.png +0 -0
  326. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/knob.png +0 -0
  327. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/knob@2x.png +0 -0
  328. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/slider.css +32 -0
  329. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/track.png +0 -0
  330. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/small/track@2x.png +0 -0
  331. data/lib/frameworks/sproutcore/themes/ace/resources/split/split.css +2 -3
  332. data/lib/sproutcore/builders/chance_file.rb +3 -3
  333. data/lib/sproutcore/helpers/minifier.rb +1 -0
  334. data/vendor/chance/lib/chance/instance.rb +34 -34
  335. data/vendor/chance/lib/chance/instance/spriting.rb +21 -16
  336. metadata +81 -58
  337. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/visibility.js +0 -17
  338. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +0 -710
  339. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +0 -267
  340. data/lib/frameworks/sproutcore/frameworks/desktop/resources/touch-scroller.css +0 -196
  341. data/lib/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +0 -224
  342. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +0 -163
  343. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +0 -177
  344. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +0 -2053
  345. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_button.js +0 -1024
  346. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +0 -404
  347. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/render_delegates/menu_scroller.js +0 -28
  348. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/tests/menu/scroll.js +0 -235
  349. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/views/menu/scroll.js +0 -363
  350. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/menu/views/menu/scroller.js +0 -250
  351. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/README.md +0 -47
  352. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +0 -134
  353. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/desktop_scroller.js +0 -92
  354. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/native_scroll.js +0 -25
  355. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/scroll.js +0 -33
  356. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/render_delegates/touch_scroller.js +0 -76
  357. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/integration.js +0 -25
  358. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/methods.js +0 -143
  359. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/tests/scroll/ui.js +0 -256
  360. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/core_scroll.js +0 -1164
  361. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/core_scroller.js +0 -332
  362. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/desktop/scroll.js +0 -236
  363. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/desktop/scroller.js +0 -347
  364. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/scroll.js +0 -15
  365. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/scroller.js +0 -10
  366. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/touch/scroll.js +0 -804
  367. data/lib/frameworks/sproutcore/frameworks/experimental/frameworks/scroll_view/views/touch/scroller.js +0 -133
  368. data/lib/frameworks/sproutcore/frameworks/foundation/tasks/preload_bundle.js +0 -41
  369. data/lib/frameworks/sproutcore/themes/ace/resources/scroller/horizontal/horizontal_touch.css +0 -91
  370. data/lib/frameworks/sproutcore/themes/ace/resources/scroller/vertical/vertical_touch.css +0 -92
  371. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/14px/knob.png +0 -0
  372. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/14px/knob_active.png +0 -0
  373. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/14px/slider.css +0 -27
  374. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/16px/knob.png +0 -0
  375. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/16px/knob_active.png +0 -0
  376. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/16px/slider.css +0 -27
  377. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/22px/knob.png +0 -0
  378. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/22px/knob_active.png +0 -0
  379. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/22px/track.png +0 -0
  380. data/lib/frameworks/sproutcore/themes/ace/resources/slider/ace/track.png +0 -0
@@ -17,7 +17,7 @@
17
17
  You can either create a subclass of ScrollerView with the new values, or
18
18
  provide your own in your theme:
19
19
 
20
- SC.mixin(SC.ScrollerView.prototype, {
20
+ SC.ScrollerView = SC.ScrollerView.extend({
21
21
  scrollbarThickness: 14,
22
22
  capLength: 18,
23
23
  capOverlap: 14,
@@ -26,7 +26,10 @@
26
26
  });
27
27
 
28
28
  You can change whether scroll buttons are displayed by setting the
29
- hasButtons property.
29
+ `hasButtons` property.
30
+
31
+ By default, `SC.ScrollerView` has a persistent gutter. If you would like a
32
+ gutterless scroller that supports fading, see `SC.OverlayScrollerView`.
30
33
 
31
34
  @extends SC.View
32
35
  @since SproutCore 1.0
@@ -34,21 +37,21 @@
34
37
  SC.ScrollerView = SC.View.extend(
35
38
  /** @scope SC.ScrollerView.prototype */ {
36
39
 
37
- /**
40
+ /** @private
38
41
  @type Array
39
42
  @default ['sc-scroller-view']
40
43
  @see SC.View#classNames
41
44
  */
42
45
  classNames: ['sc-scroller-view'],
43
46
 
44
- /**
47
+ /** @private
45
48
  @type Array
46
- @default 'thumbPosition thumbLength controlsHidden'.w()
49
+ @default ['thumbPosition', 'thumbLength', 'controlsHidden']
47
50
  @see SC.View#displayProperties
48
51
  */
49
52
  displayProperties: ['thumbPosition', 'thumbLength', 'controlsHidden'],
50
53
 
51
- /**
54
+ /** @private
52
55
  The WAI-ARIA role for scroller view.
53
56
 
54
57
  @type String
@@ -73,12 +76,6 @@ SC.ScrollerView = SC.View.extend(
73
76
  */
74
77
  shouldScrollToClick: NO,
75
78
 
76
-
77
- /** @private
78
- The in-touch-scroll value.
79
- */
80
- _touchScrollValue: NO,
81
-
82
79
  /**
83
80
  The value of the scroller.
84
81
 
@@ -86,29 +83,21 @@ SC.ScrollerView = SC.View.extend(
86
83
 
87
84
  @field
88
85
  @type Number
89
- @observes maximum
90
- @observes minimum
86
+ @default null
91
87
  */
92
- value: function(key, val) {
93
- var minimum = this.get('minimum');
94
- if (val !== undefined) {
95
- this._scs_value = val;
96
- }
97
-
98
- val = this._scs_value || minimum; // default value is at top/left
99
- return Math.max(Math.min(val, this.get('maximum')), minimum) ;
100
- }.property('maximum', 'minimum').cacheable(),
88
+ value: null,
101
89
 
102
90
  /**
91
+ The displayed value of the scroller.
92
+
93
+ This is the value of the scroller constrained within the minimum and maximum values.
94
+
103
95
  @type Number
104
96
  @observes value
105
97
  */
106
- displayValue: function() {
107
- var ret;
108
- if (this.get("_touchScrollValue")) ret = this.get("_touchScrollValue");
109
- else ret = this.get("value");
110
- return ret;
111
- }.property("value", "_touchScrollValue").cacheable(),
98
+ displayValue: function () {
99
+ return Math.max(Math.min(this.get("value"), this.get('maximum')), this.get('minimum'));
100
+ }.property("value", 'minimum', 'maximum').cacheable(),
112
101
 
113
102
  /**
114
103
  The portion of the track that the thumb should fill. Usually the
@@ -131,9 +120,9 @@ SC.ScrollerView = SC.View.extend(
131
120
  When set less than the height of the scroller, the scroller is disabled.
132
121
 
133
122
  @type Number
134
- @default 100
123
+ @default 0
135
124
  */
136
- maximum: 100,
125
+ maximum: 0,
137
126
 
138
127
  /**
139
128
  The minimum offset value for the scroller. This will be used to calculate
@@ -153,7 +142,7 @@ SC.ScrollerView = SC.View.extend(
153
142
  @default YES
154
143
  @observes proportion
155
144
  */
156
- isEnabled: function(key, value) {
145
+ isEnabled: function (key, value) {
157
146
  if (value !== undefined) {
158
147
  this._scsv_isEnabled = value;
159
148
  }
@@ -236,9 +225,9 @@ SC.ScrollerView = SC.View.extend(
236
225
  the end cap.
237
226
 
238
227
  @type Number
239
- @default 11
228
+ @default 9
240
229
  */
241
- buttonOverlap: 11,
230
+ buttonOverlap: 9,
242
231
 
243
232
  /**
244
233
  The minimium length that the thumb will be, regardless of how much content
@@ -264,25 +253,23 @@ SC.ScrollerView = SC.View.extend(
264
253
  @param {Boolean} firstTime YES if this is creating a layer
265
254
  @private
266
255
  */
267
- render: function(context, firstTime) {
256
+ render: function (context, firstTime) {
268
257
  var ariaOrientation = 'vertical',
269
- classNames = {},
270
- buttons = '',
271
- parentView = this.get('parentView'),
272
- layoutDirection = this.get('layoutDirection'),
273
- thumbPosition, thumbLength, thumbCenterLength, thumbElement,
274
- value, max, scrollerLength, length, pct;
258
+ classNames = {},
259
+ parentView = this.get('parentView'),
260
+ layoutDirection = this.get('layoutDirection'),
261
+ thumbPosition, thumbLength, thumbElement;
275
262
 
276
263
  // We set a class name depending on the layout direction so that we can
277
264
  // style them differently using CSS.
278
265
  switch (layoutDirection) {
279
- case SC.LAYOUT_VERTICAL:
280
- classNames['sc-vertical'] = YES;
281
- break;
282
- case SC.LAYOUT_HORIZONTAL:
283
- classNames['sc-horizontal'] = YES;
284
- ariaOrientation = 'horizontal';
285
- break;
266
+ case SC.LAYOUT_VERTICAL:
267
+ classNames['sc-vertical'] = YES;
268
+ break;
269
+ case SC.LAYOUT_HORIZONTAL:
270
+ classNames['sc-horizontal'] = YES;
271
+ ariaOrientation = 'horizontal';
272
+ break;
286
273
  }
287
274
 
288
275
  // The appearance of the scroller changes if disabled
@@ -311,8 +298,7 @@ SC.ScrollerView = SC.View.extend(
311
298
  context.setAttr('aria-valuemax', this.get('maximum'));
312
299
  context.setAttr('aria-valuemin', this.get('minimum'));
313
300
  context.setAttr('aria-valuenow', this.get('value'));
314
- context.setAttr('aria-controls' , parentView.getPath('contentView.layerId'));
315
-
301
+ context.setAttr('aria-controls', parentView.getPath('contentView.layerId'));
316
302
  } else {
317
303
  // The HTML has already been generated, so all we have to do is
318
304
  // reposition and resize the thumb
@@ -326,14 +312,15 @@ SC.ScrollerView = SC.View.extend(
326
312
 
327
313
  //addressing accessibility
328
314
  context.setAttr('aria-valuenow', this.get('value'));
329
-
315
+ if (this.didChangeFor('render-min', 'minimum')) context.setAttr('aria-valuemin', this.get('minimum'));
316
+ if (this.didChangeFor('render-max', 'maximum')) context.setAttr('aria-valuemax', this.get('maximum'));
330
317
  }
331
318
  },
332
319
 
333
- renderThumb: function(context, layoutDirection, thumbLength, thumbPosition) {
320
+ renderThumb: function (context, layoutDirection, thumbLength, thumbPosition) {
334
321
  var styleString;
335
- if(layoutDirection === SC.LAYOUT_HORIZONTAL) styleString = 'width: '+thumbLength+'px; left: ' + thumbPosition + 'px;';
336
- else styleString = 'height: '+thumbLength+'px; top: ' + thumbPosition + 'px;';
322
+ if (layoutDirection === SC.LAYOUT_HORIZONTAL) styleString = 'width: ' + thumbLength + 'px; left: ' + thumbPosition + 'px;';
323
+ else styleString = 'height: ' + thumbLength + 'px; top: ' + thumbPosition + 'px;';
337
324
 
338
325
  context.push('<div class="thumb" style="%@">'.fmt(styleString),
339
326
  '<div class="thumb-center"></div>',
@@ -342,7 +329,7 @@ SC.ScrollerView = SC.View.extend(
342
329
 
343
330
  },
344
331
 
345
- renderButtons: function(context, hasButtons) {
332
+ renderButtons: function (context, hasButtons) {
346
333
  if (hasButtons) {
347
334
  context.push('<div class="button-bottom"></div><div class="button-top"></div>');
348
335
  } else {
@@ -350,35 +337,6 @@ SC.ScrollerView = SC.View.extend(
350
337
  }
351
338
  },
352
339
 
353
- /** @private */
354
- touchScrollDidStart: function(value) {
355
- this.set("_touchScrollValue", value);
356
- },
357
-
358
- /** @private */
359
- touchScrollDidEnd: function(value) {
360
- SC.run(function () {
361
- this.set("_touchScrollValue", NO);
362
- }, this);
363
- },
364
-
365
- /* @private Internal property used to track the rate of touch scroll change events. */
366
- _lastTouchScrollTime: null,
367
-
368
- /** @private */
369
- touchScrollDidChange: function(value) {
370
- // Fast path! Don't try to update too soon.
371
- if (Date.now() - this._lastTouchScrollTime < 30) { return; }
372
-
373
- // TODO: perform a raw update that doesn't require the run loop.
374
- SC.run(function () {
375
- this.set("_touchScrollValue", value);
376
- }, this);
377
-
378
- // Track the last time we updated.
379
- this._lastTouchScrollTime = Date.now();
380
- },
381
-
382
340
  // ..........................................................
383
341
  // THUMB MANAGEMENT
384
342
  //
@@ -386,7 +344,7 @@ SC.ScrollerView = SC.View.extend(
386
344
  /** @private
387
345
  Adjusts the thumb (for backwards-compatibility calls adjustThumbPosition+adjustThumbSize by default)
388
346
  */
389
- adjustThumb: function(thumb, position, length) {
347
+ adjustThumb: function (thumb, position, length) {
390
348
  this.adjustThumbPosition(thumb, position);
391
349
  this.adjustThumbSize(thumb, length);
392
350
  },
@@ -396,34 +354,104 @@ SC.ScrollerView = SC.View.extend(
396
354
 
397
355
  @param {Number} position the position of the thumb in pixels
398
356
  */
399
- adjustThumbPosition: function(thumb, position) {
400
- // Don't touch the DOM if the position hasn't changed
401
- if (this._thumbPosition === position) return;
357
+ adjustThumbPosition: function (thumb, thumbPosition) {
358
+ var transformAttribute = SC.browser.experimentalCSSNameFor('transform'),
359
+ thumbEl = thumb[0];
360
+
361
+ // Don't touch the DOM if the position hasn't changed.
362
+ if (this._thumbPosition !== thumbPosition) {
363
+ // Consider that the parent view may be animating its final position, then we need to also animate
364
+ // our final position.
365
+ var parentView = this.get('parentView'),
366
+ parentIsAnimating = parentView._sc_isAnimating;
367
+
368
+ if (SC.platform.supportsCSSTransitions) {
369
+ var transitionStyle = SC.browser.experimentalStyleNameFor('transition');
370
+
371
+ if (parentIsAnimating) {
372
+ var duration = parentView._sc_animationDuration,
373
+ timing = parentView._sc_animationTiming.toString();
374
+
375
+ // Will use translation transform to position thumb.
376
+ if (SC.platform.supportsCSSTransforms) {
377
+ thumbEl.style[transitionStyle] = transformAttribute + ' ' + duration + 's ' + timing;
378
+
379
+ // Will use top/left style to position thumb.
380
+ } else {
381
+ switch (this.get('layoutDirection')) {
382
+ case SC.LAYOUT_VERTICAL:
383
+ thumbEl.style[transitionStyle] = 'top ' + duration + 's ' + timing;
384
+ break;
385
+ case SC.LAYOUT_HORIZONTAL:
386
+ thumbEl.style[transitionStyle] = 'left ' + duration + 's ' + timing;
387
+ break;
388
+ }
389
+ }
390
+
391
+ // No duration, clear any previous transition.
392
+ } else {
393
+ thumbEl.style[transitionStyle] = '';
394
+ }
395
+ }
402
396
 
403
- switch (this.get('layoutDirection')) {
397
+
398
+ // Position the thumb.
399
+ var transformStyle;
400
+ switch (this.get('layoutDirection')) {
404
401
  case SC.LAYOUT_VERTICAL:
405
- thumb.css('top', position);
402
+
403
+ // Use translation transform to position thumb.
404
+ if (SC.platform.supportsCSSTransforms) {
405
+ transformStyle = 'translateX(0px) translateY(' + thumbPosition + 'px)';
406
+
407
+ // TODO: Is this a necessary check?
408
+ if (SC.platform.supportsCSS3DTransforms) { transformStyle += ' translateZ(0px)'; }
409
+
410
+ thumbEl.style[transformAttribute] = transformStyle;
411
+
412
+ // Use top style to position thumb.
413
+ } else {
414
+ thumbEl.style.top = thumbPosition;
415
+ }
416
+
406
417
  break;
418
+
407
419
  case SC.LAYOUT_HORIZONTAL:
408
- thumb.css('left', position);
420
+ // Use translation transform to position thumb.
421
+ if (SC.platform.supportsCSSTransforms) {
422
+
423
+ transformStyle = 'translateX(' + thumbPosition + 'px) translateY(0px)';
424
+
425
+ // TODO: Is this a necessary check?
426
+ if (SC.platform.supportsCSS3DTransforms) { transformStyle += ' translateZ(0px)'; }
427
+
428
+ thumbEl.style[transformAttribute] = transformStyle;
429
+
430
+ // Use left style to position thumb.
431
+ } else {
432
+ thumbEl.style.left = thumbPosition;
433
+ }
434
+
409
435
  break;
436
+ }
410
437
  }
411
438
 
412
- this._thumbPosition = position;
439
+ // Cache these values to check for changes.
440
+ this._thumbPosition = thumbPosition;
413
441
  },
414
442
 
415
443
  /** @private */
416
- adjustThumbSize: function(thumb, size) {
444
+ adjustThumbSize: function (thumb, size) {
417
445
  // Don't touch the DOM if the size hasn't changed
418
446
  if (this._thumbSize === size) return;
419
447
 
420
448
  switch (this.get('layoutDirection')) {
421
- case SC.LAYOUT_VERTICAL:
422
- thumb.css('height', Math.max(size, this.get('minimumThumbLength')));
423
- break;
424
- case SC.LAYOUT_HORIZONTAL:
425
- thumb.css('width', Math.max(size, this.get('minimumThumbLength')));
426
- break;
449
+ case SC.LAYOUT_VERTICAL:
450
+ thumb.css('height', Math.max(size, this.get('minimumThumbLength')));
451
+ break;
452
+ case SC.LAYOUT_HORIZONTAL:
453
+ thumb.css('width', Math.max(size, this.get('minimumThumbLength')));
454
+ break;
427
455
  }
428
456
 
429
457
  this._thumbSize = size;
@@ -442,11 +470,12 @@ SC.ScrollerView = SC.View.extend(
442
470
 
443
471
  @property
444
472
  */
445
- trackLength: function() {
473
+ trackLength: function () {
446
474
  var scrollerLength = this.get('scrollerLength');
447
475
 
448
476
  // Subtract the size of the top/left cap
449
- scrollerLength -= this.capLength - this.capOverlap;
477
+ scrollerLength -= this.get('capLength') - this.get('capOverlap');
478
+
450
479
  // Subtract the size of the scroll buttons, or the end cap if they are
451
480
  // not shown.
452
481
  scrollerLength -= this.buttonLength - this.buttonOverlap;
@@ -461,12 +490,12 @@ SC.ScrollerView = SC.View.extend(
461
490
 
462
491
  @type Number
463
492
  */
464
- scrollerLength: function() {
493
+ scrollerLength: function () {
465
494
  switch (this.get('layoutDirection')) {
466
- case SC.LAYOUT_VERTICAL:
467
- return this.get('frame').height;
468
- case SC.LAYOUT_HORIZONTAL:
469
- return this.get('frame').width;
495
+ case SC.LAYOUT_VERTICAL:
496
+ return this.get('frame').height;
497
+ case SC.LAYOUT_HORIZONTAL:
498
+ return this.get('frame').width;
470
499
  }
471
500
 
472
501
  return 0;
@@ -478,14 +507,26 @@ SC.ScrollerView = SC.View.extend(
478
507
 
479
508
  @property
480
509
  */
481
- thumbLength: function() {
482
- var length;
510
+ thumbLength: function () {
511
+ var value = this.get('value'),
512
+ maximum = this.get('maximum'),
513
+ minimum = this.get('minimum'),
514
+ proportion = this.get('proportion'),
515
+ length;
516
+
517
+ // If the value is beyond the minimum or maximums, shrink our thumb length to represent the amount
518
+ // of over scroll. Do this proportionally for the best effect!
519
+ if (value < minimum) {
520
+ proportion -= (minimum - value) / maximum;
521
+ } else if (value > maximum) {
522
+ proportion -= (value - maximum) / maximum;
523
+ }
483
524
 
484
- length = Math.floor(this.get('trackLength') * this.get('proportion'));
525
+ length = Math.floor(this.get('trackLength') * proportion);
485
526
  length = isNaN(length) ? 0 : length;
486
527
 
487
528
  return Math.max(length, this.get('minimumThumbLength'));
488
- }.property('trackLength', 'proportion').cacheable(),
529
+ }.property('value', 'minimum', 'maximum', 'trackLength', 'proportion').cacheable(),
489
530
 
490
531
  /** @private
491
532
  The position of the thumb in the track.
@@ -493,15 +534,15 @@ SC.ScrollerView = SC.View.extend(
493
534
  @type Number
494
535
  @isReadOnly
495
536
  */
496
- thumbPosition: function() {
497
- var value = this.get('displayValue'),
498
- max = this.get('maximum'),
537
+ thumbPosition: function () {
538
+ var displayValue = this.get('displayValue'),
539
+ maximum = this.get('maximum'),
499
540
  trackLength = this.get('trackLength'),
500
541
  thumbLength = this.get('thumbLength'),
501
542
  capLength = this.get('capLength'),
502
543
  capOverlap = this.get('capOverlap'), position;
503
544
 
504
- position = (value/max)*(trackLength-thumbLength);
545
+ position = (displayValue / maximum) * (trackLength - thumbLength);
505
546
  position += capLength - capOverlap; // account for the top/left cap
506
547
 
507
548
  return Math.floor(isNaN(position) ? 0 : position);
@@ -514,10 +555,29 @@ SC.ScrollerView = SC.View.extend(
514
555
  @type Boolean
515
556
  @isReadOnly
516
557
  */
517
- controlsHidden: function() {
558
+ controlsHidden: function () {
518
559
  return this.get('proportion') >= 1;
519
560
  }.property('proportion').cacheable(),
520
561
 
562
+ // ..........................................................
563
+ // FADE SUPPORT
564
+ // Controls how the scroller fades in and out. Override these methods to implement
565
+ // different fading.
566
+ //
567
+
568
+ /*
569
+ Implement to support ScrollView's overlay fade procedure.
570
+
571
+ @param {Number} duration
572
+ */
573
+ fadeIn: null,
574
+
575
+ /*
576
+ Implement to support ScrollView's overlay fade procedure.
577
+
578
+ @param {Number} duration
579
+ */
580
+ fadeOut: null,
521
581
 
522
582
  // ..........................................................
523
583
  // MOUSE EVENTS
@@ -526,7 +586,7 @@ SC.ScrollerView = SC.View.extend(
526
586
  /** @private
527
587
  Returns the value for a position within the scroller's frame.
528
588
  */
529
- valueForPosition: function(pos) {
589
+ valueForPosition: function (pos) {
530
590
  var max = this.get('maximum'),
531
591
  trackLength = this.get('trackLength'),
532
592
  thumbLength = this.get('thumbLength'),
@@ -559,7 +619,10 @@ SC.ScrollerView = SC.View.extend(
559
619
 
560
620
  @param evt {SC.Event} the mousedown event
561
621
  */
562
- mouseDown: function(evt) {
622
+ mouseDown: function (evt) {
623
+ // Fast path, reject secondary clicks.
624
+ if (evt.which !== 1) return false;
625
+
563
626
  if (!this.get('isEnabledInPane')) return NO;
564
627
 
565
628
  // keep note of altIsDown for later.
@@ -568,7 +631,7 @@ SC.ScrollerView = SC.View.extend(
568
631
 
569
632
  var target = evt.target,
570
633
  thumbPosition = this.get('thumbPosition'),
571
- value, clickLocation, clickOffset,
634
+ clickLocation,
572
635
  scrollerLength = this.get('scrollerLength');
573
636
 
574
637
  // Determine the subcontrol that was clicked
@@ -607,36 +670,35 @@ SC.ScrollerView = SC.View.extend(
607
670
  var scrollToClick = this.get("shouldScrollToClick");
608
671
  if (evt.altKey) scrollToClick = !scrollToClick;
609
672
 
610
- var trackLength = this.get('trackLength'),
611
- thumbLength = this.get('thumbLength'),
673
+ var thumbLength = this.get('thumbLength'),
612
674
  frame = this.convertFrameFromView({ x: evt.pageX, y: evt.pageY }),
613
675
  mousePosition;
614
676
 
615
677
  switch (this.get('layoutDirection')) {
616
- case SC.LAYOUT_VERTICAL:
617
- this._mouseDownLocation = mousePosition = frame.y;
618
- break;
619
- case SC.LAYOUT_HORIZONTAL:
620
- this._mouseDownLocation = mousePosition = frame.x;
621
- break;
678
+ case SC.LAYOUT_VERTICAL:
679
+ this._mouseDownLocation = mousePosition = frame.y;
680
+ break;
681
+ case SC.LAYOUT_HORIZONTAL:
682
+ this._mouseDownLocation = mousePosition = frame.x;
683
+ break;
622
684
  }
623
685
 
624
686
  if (scrollToClick) {
625
- this.set('value', this.valueForPosition(mousePosition - (thumbLength / 2)));
687
+ this.set('value', Math.min(this.get('maximum'), Math.max(this.get('minimum'), this.valueForPosition(mousePosition - (thumbLength / 2)))));
626
688
 
627
689
  // and start a normal mouse down
628
690
  thumbPosition = this.get('thumbPosition');
629
691
 
630
692
  this._thumbDragging = YES;
631
- this._thumbOffset = {x: frame.x - thumbPosition, y: frame.y - thumbPosition };
632
- this._mouseDownLocation = {x:evt.pageX, y:evt.pageY};
693
+ this._thumbOffset = { x: frame.x - thumbPosition, y: frame.y - thumbPosition };
694
+ this._mouseDownLocation = { x: evt.pageX, y: evt.pageY };
633
695
  this._thumbPositionAtDragStart = thumbPosition;
634
696
  this._valueAtDragStart = this.get("value");
635
697
  } else {
636
698
  // Move the thumb up or down a page depending on whether the click
637
699
  // was above or below the thumb
638
700
  if (mousePosition < thumbPosition) {
639
- this.decrementProperty('value',scrollerLength);
701
+ this.decrementProperty('value', scrollerLength);
640
702
  this.startMouseDownTimer('page');
641
703
  } else {
642
704
  this.incrementProperty('value', scrollerLength);
@@ -656,7 +718,7 @@ SC.ScrollerView = SC.View.extend(
656
718
 
657
719
  @param evt {SC.Event} the mousedown event
658
720
  */
659
- mouseUp: function(evt) {
721
+ mouseUp: function (evt) {
660
722
  var active = this._scs_buttonActive, ret = NO, timer;
661
723
 
662
724
  // If we have an element that was set as active in mouseDown,
@@ -690,33 +752,31 @@ SC.ScrollerView = SC.View.extend(
690
752
 
691
753
  @param evt {SC.Event} the mousedragged event
692
754
  */
693
- mouseDragged: function(evt) {
755
+ mouseDragged: function (evt) {
694
756
  if (!this.get('isEnabledInPane')) return NO;
695
757
 
696
- var value, length, delta, thumbPosition,
697
- target = evt.target,
758
+ var length, delta, thumbPosition,
698
759
  thumbPositionAtDragStart = this._thumbPositionAtDragStart,
699
760
  isScrollingUp = this._isScrollingUp,
700
761
  isScrollingDown = this._isScrollingDown,
701
- active = this._scs_buttonActive,
702
- timer;
762
+ active = this._scs_buttonActive;
703
763
 
704
764
  // Only move the thumb if the user clicked on the thumb during mouseDown
705
765
  if (this._thumbDragging) {
706
766
 
707
767
  switch (this.get('layoutDirection')) {
708
- case SC.LAYOUT_VERTICAL:
709
- delta = (evt.pageY - this._mouseDownLocation.y);
710
- break;
711
- case SC.LAYOUT_HORIZONTAL:
712
- delta = (evt.pageX - this._mouseDownLocation.x);
713
- break;
768
+ case SC.LAYOUT_VERTICAL:
769
+ delta = (evt.pageY - this._mouseDownLocation.y);
770
+ break;
771
+ case SC.LAYOUT_HORIZONTAL:
772
+ delta = (evt.pageX - this._mouseDownLocation.x);
773
+ break;
714
774
  }
715
775
 
716
776
  // if we are in alt now, but were not before, update the old thumb position to the new one
717
777
  if (evt.altKey) {
718
778
  if (!this._altIsDown || (this._shiftIsDown !== evt.shiftKey)) {
719
- thumbPositionAtDragStart = this._thumbPositionAtDragStart = thumbPositionAtDragStart+delta;
779
+ thumbPositionAtDragStart = this._thumbPositionAtDragStart = thumbPositionAtDragStart + delta;
720
780
  delta = 0;
721
781
  this._mouseDownLocation = { x: evt.pageX, y: evt.pageY };
722
782
  this._valueAtDragStart = this.get("value");
@@ -726,31 +786,30 @@ SC.ScrollerView = SC.View.extend(
726
786
  // Too bad.
727
787
  if (evt.shiftKey) delta = -delta;
728
788
 
729
- this.set('value', Math.round(this._valueAtDragStart + delta * 2));
789
+ this.set('value', Math.min(this.get('maximum'), Math.max(this.get('minimum'), Math.round(this._valueAtDragStart + delta * 2))));
730
790
  } else {
731
791
  thumbPosition = thumbPositionAtDragStart + delta;
732
792
  length = this.get('trackLength') - this.get('thumbLength');
733
- this.set('value', Math.round( (thumbPosition/length) * this.get('maximum')));
793
+ this.set('value', Math.min(this.get('maximum'), Math.max(this.get('minimum'), Math.round((thumbPosition / length) * this.get('maximum')))));
734
794
  }
735
795
 
736
796
  } else if (isScrollingUp || isScrollingDown) {
737
797
  var nowScrollingUp = NO, nowScrollingDown = NO;
738
798
 
739
799
  var topButtonRect = this.$('.button-top')[0].getBoundingClientRect();
740
- var bottomButtonRect = this.$('.button-bottom')[0].getBoundingClientRect();
741
800
 
742
801
  switch (this.get('layoutDirection')) {
743
- case SC.LAYOUT_VERTICAL:
744
- if (evt.clientY < topButtonRect.bottom) nowScrollingUp = YES;
745
- else nowScrollingDown = YES;
746
- break;
747
- case SC.LAYOUT_HORIZONTAL:
748
- if (evt.clientX < topButtonRect.right) nowScrollingUp = YES;
749
- else nowScrollingDown = YES;
750
- break;
802
+ case SC.LAYOUT_VERTICAL:
803
+ if (evt.clientY < topButtonRect.bottom) nowScrollingUp = YES;
804
+ else nowScrollingDown = YES;
805
+ break;
806
+ case SC.LAYOUT_HORIZONTAL:
807
+ if (evt.clientX < topButtonRect.right) nowScrollingUp = YES;
808
+ else nowScrollingDown = YES;
809
+ break;
751
810
  }
752
811
 
753
- if ((nowScrollingUp || nowScrollingDown) && nowScrollingUp !== isScrollingUp){
812
+ if ((nowScrollingUp || nowScrollingDown) && nowScrollingUp !== isScrollingUp) {
754
813
  //
755
814
  // STOP OLD
756
815
  //
@@ -758,7 +817,7 @@ SC.ScrollerView = SC.View.extend(
758
817
  // If we have an element that was set as active in mouseDown,
759
818
  // remove its active state
760
819
  if (active) {
761
- active.removeClass('active');
820
+ active.removeClass('active');
762
821
  }
763
822
 
764
823
  // Stop firing repeating events after mouseup
@@ -770,8 +829,8 @@ SC.ScrollerView = SC.View.extend(
770
829
  this.makeButtonActive('.button-bottom');
771
830
  }
772
831
 
773
- this._isScrollingUp = nowScrollingUp;
774
- this._isScrollingDown = nowScrollingDown;
832
+ this._isScrollingUp = nowScrollingUp;
833
+ this._isScrollingDown = nowScrollingDown;
775
834
  }
776
835
  }
777
836
 
@@ -789,12 +848,12 @@ SC.ScrollerView = SC.View.extend(
789
848
 
790
849
  Specify "immediate" as YES if it should not wait.
791
850
  */
792
- startMouseDownTimer: function(action, immediate) {
793
- var timer;
794
-
851
+ startMouseDownTimer: function (action, immediate) {
795
852
  this._mouseDownTimerAction = action;
796
853
  this._mouseDownTimer = SC.Timer.schedule({
797
- target: this, action: this.mouseDownTimerDidFire, interval: immediate ? 0 : 300
854
+ target: this,
855
+ action: this.mouseDownTimerDidFire,
856
+ interval: immediate ? 0 : 300
798
857
  });
799
858
  },
800
859
 
@@ -802,7 +861,7 @@ SC.ScrollerView = SC.View.extend(
802
861
  Called by the mousedown timer. This method determines the initial
803
862
  user action and repeats it until the timer is invalidated in mouseUp.
804
863
  */
805
- mouseDownTimerDidFire: function() {
864
+ mouseDownTimerDidFire: function () {
806
865
  var scrollerLength = this.get('scrollerLength'),
807
866
  mouseLocation = SC.device.get('mouseLocation'),
808
867
  thumbPosition = this.get('thumbPosition'),
@@ -810,32 +869,34 @@ SC.ScrollerView = SC.View.extend(
810
869
  timerInterval = 50;
811
870
 
812
871
  switch (this.get('layoutDirection')) {
813
- case SC.LAYOUT_VERTICAL:
814
- mouseLocation = this.convertFrameFromView(mouseLocation).y;
815
- break;
816
- case SC.LAYOUT_HORIZONTAL:
817
- mouseLocation = this.convertFrameFromView(mouseLocation).x;
818
- break;
872
+ case SC.LAYOUT_VERTICAL:
873
+ mouseLocation = this.convertFrameFromView(mouseLocation).y;
874
+ break;
875
+ case SC.LAYOUT_HORIZONTAL:
876
+ mouseLocation = this.convertFrameFromView(mouseLocation).x;
877
+ break;
819
878
  }
820
879
 
821
880
  switch (this._mouseDownTimerAction) {
822
- case 'scrollDown':
823
- this.incrementProperty('value', this._altIsDown ? scrollerLength : 30);
824
- break;
825
- case 'scrollUp':
826
- this.decrementProperty('value', this._altIsDown ? scrollerLength : 30);
827
- break;
828
- case 'page':
829
- timerInterval = 150;
830
- if (mouseLocation < thumbPosition) {
831
- this.decrementProperty('value', scrollerLength);
832
- } else if (mouseLocation > thumbPosition+thumbLength) {
833
- this.incrementProperty('value', scrollerLength);
834
- }
881
+ case 'scrollDown':
882
+ this.incrementProperty('value', this._altIsDown ? scrollerLength : 30);
883
+ break;
884
+ case 'scrollUp':
885
+ this.decrementProperty('value', this._altIsDown ? scrollerLength : 30);
886
+ break;
887
+ case 'page':
888
+ timerInterval = 150;
889
+ if (mouseLocation < thumbPosition) {
890
+ this.decrementProperty('value', scrollerLength);
891
+ } else if (mouseLocation > thumbPosition + thumbLength) {
892
+ this.incrementProperty('value', scrollerLength);
893
+ }
835
894
  }
836
895
 
837
896
  this._mouseDownTimer = SC.Timer.schedule({
838
- target: this, action: this.mouseDownTimerDidFire, interval: timerInterval
897
+ target: this,
898
+ action: this.mouseDownTimerDidFire,
899
+ interval: timerInterval
839
900
  });
840
901
  },
841
902
 
@@ -846,26 +907,50 @@ SC.ScrollerView = SC.View.extend(
846
907
 
847
908
  @param {String} the selector to find
848
909
  */
849
- makeButtonActive: function(selector) {
910
+ makeButtonActive: function (selector) {
850
911
  this._scs_buttonActive = this.$(selector).addClass('active');
851
912
  }
852
913
  });
853
914
 
854
- // TODO: Use render delegates to handle rendering.
855
-
856
915
  /**
916
+ A fading, transparent-backed scroll bar. Suitable for use as an overlaid scroller. (Note
917
+ that to achieve the overlay effect, you must still set `verticalOverlay` and
918
+ `horizontalOverlay` on your `ScrollView`.)
919
+
857
920
  @class
858
921
  @extends SC.ScrollerView
859
922
  */
860
- SC.TouchScrollerView = SC.ScrollerView.extend(
861
- /** @scope SC.TouchScrollerView.prototype */{
923
+ SC.OverlayScrollerView = SC.ScrollerView.extend(
924
+ /** @scope SC.OverlayScrollerView.prototype */{
925
+
926
+ // ..........................................................
927
+ // FADE SUPPORT
928
+ // Controls how the scroller fades in and out. Override these methods to implement
929
+ // different fading.
930
+ //
931
+
932
+ /*
933
+ Supports ScrollView's overlay fade procedure.
934
+ */
935
+ fadeIn: function () {
936
+ this.$().toggleClass('fade-in', true);
937
+ this.$().toggleClass('fade-out', false);
938
+ },
939
+
940
+ /*
941
+ Supports ScrollView's overlay fade procedure.
942
+ */
943
+ fadeOut: function () {
944
+ this.$().toggleClass('fade-in', false);
945
+ this.$().toggleClass('fade-out', true);
946
+ },
862
947
 
863
948
  /**
864
949
  @type Array
865
- @default ['sc-touch-scroller-view']
950
+ @default ['sc-touch-scroller-view', 'sc-overlay-scroller-view]
866
951
  @see SC.View#classNames
867
952
  */
868
- classNames: ['sc-touch-scroller-view'],
953
+ classNames: ['sc-touch-scroller-view', 'sc-overlay-scroller-view'],
869
954
 
870
955
  /**
871
956
  @type Number
@@ -875,9 +960,9 @@ SC.TouchScrollerView = SC.ScrollerView.extend(
875
960
 
876
961
  /**
877
962
  @type Number
878
- @default 5
963
+ @default 3
879
964
  */
880
- capLength: 5,
965
+ capLength: 3,
881
966
 
882
967
  /**
883
968
  @type Number
@@ -886,66 +971,172 @@ SC.TouchScrollerView = SC.ScrollerView.extend(
886
971
  capOverlap: 0,
887
972
 
888
973
  /**
889
- @type Boolean
890
- @default NO
974
+ @type Number
975
+ @default 3
891
976
  */
892
- hasButtons: NO,
977
+ buttonLength: 3,
893
978
 
894
979
  /**
895
980
  @type Number
896
- @default 36
981
+ @default 0
897
982
  */
898
- buttonOverlap: 36,
983
+ buttonOverlap: 0,
984
+
985
+ /**
986
+ @type Boolean
987
+ @default NO
988
+ */
989
+ hasButtons: NO,
899
990
 
900
991
  /** @private */
901
- adjustThumb: function(thumb, position, length) {
902
- var thumbInner = this.$('.thumb-inner');
903
- var max = this.get("scrollerLength") - this.capLength, min = this.get("minimum") + this.capLength;
992
+ adjustThumb: function (thumb, thumbPosition, thumbLength) {
993
+ var transformAttribute = SC.browser.experimentalCSSNameFor('transform'),
994
+ thumbEl = thumb[0],
995
+ thumbInner = this.$('.thumb-inner'),
996
+ thumbInnerEl = thumbInner[0];
997
+
998
+ // Don't touch the DOM if the position hasn't changed.
999
+ if (this._thumbPosition !== thumbPosition) {
1000
+ // Consider that the parent view may be animating its final position, then we need to also animate
1001
+ // our final position.
1002
+ var parentView = this.get('parentView'),
1003
+ parentIsAnimating = parentView._sc_isAnimating;
1004
+
1005
+ if (SC.platform.supportsCSSTransitions) {
1006
+ var transitionStyle = SC.browser.experimentalStyleNameFor('transition');
1007
+
1008
+ if (parentIsAnimating) {
1009
+ var duration = parentView._sc_animationDuration,
1010
+ timing = parentView._sc_animationTiming.toString();
1011
+
1012
+ // Will use translation transform to position thumb.
1013
+ if (SC.platform.supportsCSSTransforms) {
1014
+ thumbEl.style[transitionStyle] = transformAttribute + ' ' + duration + 's ' + timing;
1015
+
1016
+ if (this._thumbSize !== thumbLength) {
1017
+ thumbInnerEl.style[transitionStyle] = transformAttribute + ' ' + duration + 's ' + timing;
1018
+ }
1019
+
1020
+ // Will use top/left style to position thumb.
1021
+ } else {
1022
+ switch (this.get('layoutDirection')) {
1023
+ case SC.LAYOUT_VERTICAL:
1024
+ thumbEl.style[transitionStyle] = 'top ' + duration + 's ' + timing;
1025
+
1026
+ if (this._thumbSize !== thumbLength) {
1027
+ thumbInnerEl.style[transitionStyle] = 'top ' + duration + 's ' + timing;
1028
+ }
1029
+
1030
+ break;
1031
+ case SC.LAYOUT_HORIZONTAL:
1032
+ thumbEl.style[transitionStyle] = 'left ' + duration + 's ' + timing;
1033
+
1034
+ if (this._thumbSize !== thumbLength) {
1035
+ thumbInnerEl.style[transitionStyle] = 'left ' + duration + 's ' + timing;
1036
+ }
1037
+
1038
+ break;
1039
+ }
1040
+ }
1041
+
1042
+ // No duration, clear any previous transition.
1043
+ } else {
1044
+ thumbEl.style[transitionStyle] = '';
1045
+ thumbInnerEl.style[transitionStyle] = '';
1046
+ }
1047
+ }
904
1048
 
905
- if (position + length > max) {
906
- position = Math.min(max - 20, position);
907
- length = max - position;
908
- }
909
1049
 
910
- if (position < min) {
911
- length -= min - position;
912
- position = min;
913
- }
914
-
915
- switch (this.get('layoutDirection')) {
1050
+ // Position the thumb.
1051
+ var transformStyle;
1052
+ switch (this.get('layoutDirection')) {
916
1053
  case SC.LAYOUT_VERTICAL:
917
- if (this._thumbPosition !== position) thumb.css('-webkit-transform', 'translate3d(0px,' + position + 'px,0px)');
918
- if (this._thumbSize !== length) {
919
- thumbInner.css('-webkit-transform', 'translate3d(0px,' + Math.round(length - 1044) + 'px,0px)');
1054
+
1055
+ // Use translation transform to position thumb.
1056
+ if (SC.platform.supportsCSSTransforms) {
1057
+ transformStyle = 'translateX(0px) translateY(' + thumbPosition + 'px)';
1058
+
1059
+ // TODO: Is this a necessary check?
1060
+ if (SC.platform.supportsCSS3DTransforms) { transformStyle += ' translateZ(0px)'; }
1061
+
1062
+ thumbEl.style[transformAttribute] = transformStyle;
1063
+ // thumb.css(transformCSS, 'translate3d(0px,' + thumbPosition + 'px,0px)');
1064
+
1065
+ if (this._thumbSize !== thumbLength) {
1066
+ transformStyle = 'translateX(0px) translateY(' + Math.round(thumbLength - 1044) + 'px)';
1067
+
1068
+ // TODO: Is this a necessary check?
1069
+ if (SC.platform.supportsCSS3DTransforms) { transformStyle += ' translateZ(0px)'; }
1070
+
1071
+ // thumbInner.css(transformCSS, 'translate3d(0px,' + Math.round(thumbLength - 1044) + 'px,0px)');
1072
+ thumbInnerEl.style[transformAttribute] = transformStyle;
1073
+ }
1074
+
1075
+ // Use top style to position thumb.
1076
+ } else {
1077
+ thumbEl.style.top = thumbPosition;
1078
+
1079
+ if (this._thumbSize !== thumbLength) {
1080
+ thumbInnerEl.style.top = Math.round(thumbLength - 1044);
1081
+ }
920
1082
  }
1083
+
921
1084
  break;
1085
+
922
1086
  case SC.LAYOUT_HORIZONTAL:
923
- if (this._thumbPosition !== position) thumb.css('-webkit-transform', 'translate3d(' + position + 'px,0px,0px)');
924
- if (this._thumbSize !== length) {
925
- thumbInner.css('-webkit-transform', 'translate3d(' + Math.round(length - 1044) + 'px,0px,0px)');
1087
+ // Use translation transform to position thumb.
1088
+ if (SC.platform.supportsCSSTransforms) {
1089
+
1090
+ transformStyle = 'translateX(' + thumbPosition + 'px) translateY(0px)';
1091
+
1092
+ // TODO: Is this a necessary check?
1093
+ if (SC.platform.supportsCSS3DTransforms) { transformStyle += ' translateZ(0px)'; }
1094
+
1095
+ thumbEl.style[transformAttribute] = transformStyle;
1096
+ // thumb.css(transformCSS, 'translate3d(0px,' + thumbPosition + 'px,0px)');
1097
+
1098
+ if (this._thumbSize !== thumbLength) {
1099
+ transformStyle = 'translateX(' + Math.round(thumbLength - 1044) + 'px) translateY(0px)';
1100
+
1101
+ // TODO: Is this a necessary check?
1102
+ if (SC.platform.supportsCSS3DTransforms) { transformStyle += ' translateZ(0px)'; }
1103
+
1104
+ // thumbInner.css(transformCSS, 'translate3d(0px,' + Math.round(thumbLength - 1044) + 'px,0px)');
1105
+ thumbInnerEl.style[transformAttribute] = transformStyle;
1106
+ }
1107
+
1108
+ // Use left style to position thumb.
1109
+ } else {
1110
+ thumbEl.style.left = thumbPosition;
1111
+
1112
+ if (this._thumbSize !== thumbLength) {
1113
+ thumbInnerEl.style.left = Math.round(thumbLength - 1044);
1114
+ }
926
1115
  }
1116
+
927
1117
  break;
1118
+ }
928
1119
  }
929
1120
 
930
- this._thumbPosition = position;
931
- this._thumbSize = length;
1121
+ // Cache these values to check for changes.
1122
+ this._thumbPosition = thumbPosition;
1123
+ this._thumbSize = thumbLength;
932
1124
  },
933
1125
 
934
1126
  /** @private */
935
- render: function(context, firstTime) {
1127
+ render: function (context, firstTime) {
936
1128
  var classNames = [],
937
- thumbPosition, thumbLength, thumbCenterLength, thumbElement,
938
- value, max, scrollerLength, length, pct;
1129
+ thumbPosition, thumbLength, thumbElement;
939
1130
 
940
1131
  // We set a class name depending on the layout direction so that we can
941
1132
  // style them differently using CSS.
942
1133
  switch (this.get('layoutDirection')) {
943
- case SC.LAYOUT_VERTICAL:
944
- classNames.push('sc-vertical');
945
- break;
946
- case SC.LAYOUT_HORIZONTAL:
947
- classNames.push('sc-horizontal');
948
- break;
1134
+ case SC.LAYOUT_VERTICAL:
1135
+ classNames.push('sc-vertical');
1136
+ break;
1137
+ case SC.LAYOUT_HORIZONTAL:
1138
+ classNames.push('sc-horizontal');
1139
+ break;
949
1140
  }
950
1141
 
951
1142
  // Whether to hide the thumb and buttons
@@ -961,15 +1152,14 @@ SC.TouchScrollerView = SC.ScrollerView.extend(
961
1152
 
962
1153
  // If this is the first time, generate the actual HTML
963
1154
  if (firstTime) {
964
- context.push('<div class="track"></div>'+
1155
+ context.push('<div class="track"></div>' +
965
1156
  '<div class="cap"></div>');
966
1157
  this.renderButtons(context, this.get('hasButtons'));
967
- this.renderThumb(context, this.get('layoutDirection'), thumbLength);
968
- }
1158
+ this.renderThumb(context, thumbPosition, thumbLength);
969
1159
 
970
- else {
971
- // The HTML has already been generated, so all we have to do is
972
- // reposition and resize the thumb
1160
+ // The HTML has already been generated, so all we have to do is
1161
+ // reposition and resize the thumb
1162
+ } else {
973
1163
 
974
1164
  // If we aren't displaying controls don't bother
975
1165
  if (this.get('controlsHidden')) return;
@@ -980,17 +1170,43 @@ SC.TouchScrollerView = SC.ScrollerView.extend(
980
1170
  }
981
1171
  },
982
1172
 
983
- renderThumb: function(context, layoutDirection, thumbLength) {
984
- // where is this magic number from?
985
- thumbLength -= 1044;
986
- layoutDirection = (layoutDirection === SC.LAYOUT_HORIZONTAL ? 'X' : 'Y');
1173
+ /** @private */
1174
+ renderThumb: function (context, thumbPosition, thumbLength) {
1175
+ var transformCSS = SC.browser.experimentalCSSNameFor('transform'),
1176
+ thumbPositionStyle, thumbSizeStyle;
1177
+
1178
+ switch (this.get('layoutDirection')) {
1179
+ case SC.LAYOUT_VERTICAL:
1180
+ thumbPositionStyle = transformCSS + ': translate3d(0px,' + thumbPosition + 'px,0px)';
1181
+ // where is this magic number from?
1182
+ thumbSizeStyle = transformCSS + ': translateY(' + (thumbLength - 1044) + 'px)'.fmt();
1183
+ break;
1184
+ case SC.LAYOUT_HORIZONTAL:
1185
+ thumbPositionStyle = transformCSS + ': translate3d(' + thumbPosition + 'px,0px,0px)';
1186
+ thumbSizeStyle = transformCSS + ': translateX(' + (thumbLength - 1044) + 'px)'.fmt();
1187
+ break;
1188
+ }
987
1189
 
988
- context.push('<div class="thumb">'+
989
- '<div class="thumb-top"></div>'+
990
- '<div class="thumb-clip">'+
991
- '<div class="thumb-inner" style="-webkit-transform: translate%@(%@px);">'.fmt(layoutDirection, thumbLength)+
992
- '<div class="thumb-center"></div>'+
1190
+ context.push('<div class="thumb" style="%@;">'.fmt(thumbPositionStyle) +
1191
+ '<div class="thumb-top"></div>' +
1192
+ '<div class="thumb-clip">' +
1193
+ '<div class="thumb-inner" style="%@;">'.fmt(thumbSizeStyle) +
1194
+ '<div class="thumb-center"></div>' +
993
1195
  '<div class="thumb-bottom"></div></div></div></div>');
994
1196
 
1197
+ // Cache these values to check for changes.
1198
+ this._thumbPosition = thumbPosition;
1199
+ this._thumbSize = thumbLength;
1200
+ }
1201
+ });
1202
+
1203
+
1204
+ /* @private Old inaccurate name retained for backward compatibility. */
1205
+ SC.TouchScrollerView = SC.OverlayScrollerView.extend({
1206
+ //@if(debug)
1207
+ init: function () {
1208
+ SC.warn('Developer Warning: SC.TouchScrollerView has been renamed SC.OverlayScrollerView. SC.TouchScrollerView will be removed entirely in a future version.');
1209
+ return sc_super();
995
1210
  }
1211
+ //@endif
996
1212
  });