sproutcore 1.5.0.rc.1 → 1.5.0.rc.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. data/CHANGELOG +4 -0
  2. data/VERSION.yml +1 -1
  3. data/lib/frameworks/sproutcore/Buildfile +9 -4
  4. data/lib/frameworks/sproutcore/README.md +1 -0
  5. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/QuickLook/Preview.pdf +0 -0
  6. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/QuickLook/Thumbnail.tiff +0 -0
  7. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/data.plist +0 -0
  8. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image10.png +0 -0
  9. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image11.png +0 -0
  10. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image13.png +0 -0
  11. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image15.png +0 -0
  12. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image16.png +0 -0
  13. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image17.png +0 -0
  14. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image18.png +0 -0
  15. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image19.png +0 -0
  16. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image22.tiff +0 -0
  17. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image23.png +0 -0
  18. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image24.png +0 -0
  19. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image25.png +0 -0
  20. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image30.png +0 -0
  21. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image31.png +0 -0
  22. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image8.png +0 -0
  23. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image9.png +0 -0
  24. data/lib/frameworks/sproutcore/frameworks/animation/core.js +23 -25
  25. data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +160 -0
  26. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +73 -82
  27. data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +1 -3
  28. data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/bind.js +110 -7
  29. data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/collection.js +10 -7
  30. data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/localization.js +1 -1
  31. data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/view.js +4 -2
  32. data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions.js → core_foundation/ext/handlebars.js} +0 -57
  33. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/object.js +1 -3
  34. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +11 -0
  35. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/main.js +1 -3
  36. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +2 -4
  37. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/application.js +14 -16
  38. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/builder.js +29 -37
  39. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/datetime.js +0 -0
  40. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +71 -19
  41. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +3 -7
  42. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/page.js +5 -7
  43. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/selection_set.js +1 -3
  44. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +4 -0
  45. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/timer.js +21 -27
  46. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +3 -5
  47. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +3 -3
  48. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/single_enumerable_case.js +1 -1
  49. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +1 -1
  50. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +93 -1
  51. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +1 -1
  52. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertLayouts.js +13 -11
  53. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layer.js +2 -6
  54. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +4 -4
  55. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/theme.js +2 -0
  56. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +4 -4
  57. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template.js +6 -2
  58. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +87 -32
  59. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +21 -25
  60. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +15 -19
  61. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +114 -167
  62. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +4 -4
  63. data/lib/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +4 -6
  64. data/lib/frameworks/sproutcore/frameworks/datastore/models/children_attribute.js +2 -4
  65. data/lib/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +7 -7
  66. data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +18 -20
  67. data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +74 -72
  68. data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +36 -29
  69. data/lib/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +2 -2
  70. data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +97 -78
  71. data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +117 -97
  72. data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +13 -13
  73. data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +111 -108
  74. data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +231 -198
  75. data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +146 -145
  76. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +21 -21
  77. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +49 -50
  78. data/lib/frameworks/sproutcore/frameworks/datetime/{system → frameworks/core/system}/datetime.js +122 -171
  79. data/lib/frameworks/sproutcore/frameworks/datetime/{tests → frameworks/core/tests}/system/datetime.js +0 -0
  80. data/lib/frameworks/sproutcore/frameworks/datetime/{resources → frameworks/localized/resources}/strings.js +0 -0
  81. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +91 -0
  82. data/lib/frameworks/sproutcore/frameworks/desktop/core.js +18 -2
  83. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +23 -16
  84. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +56 -45
  85. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +5 -2
  86. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +21 -19
  87. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +82 -77
  88. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/navigation_builder.js +18 -12
  89. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +29 -17
  90. data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +148 -107
  91. data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +31 -16
  92. data/lib/frameworks/sproutcore/frameworks/desktop/panes/modal.js +16 -13
  93. data/lib/frameworks/sproutcore/frameworks/desktop/panes/palette.js +38 -17
  94. data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +37 -25
  95. data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +247 -144
  96. data/lib/frameworks/sproutcore/frameworks/desktop/panes/select_button.js +155 -100
  97. data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +39 -17
  98. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +9 -6
  99. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +18 -22
  100. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +27 -17
  101. data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +77 -44
  102. data/lib/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +68 -33
  103. data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +168 -110
  104. data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +37 -5
  105. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +187 -123
  106. data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +73 -49
  107. data/lib/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +34 -9
  108. data/lib/frameworks/sproutcore/frameworks/desktop/views/file.js +51 -14
  109. data/lib/frameworks/sproutcore/frameworks/desktop/views/grid.js +38 -8
  110. data/lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js +15 -9
  111. data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +54 -34
  112. data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +113 -42
  113. data/lib/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +84 -28
  114. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +67 -51
  115. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +122 -35
  116. data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation.js +40 -16
  117. data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation_bar.js +28 -18
  118. data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +27 -31
  119. data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +118 -68
  120. data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +117 -61
  121. data/lib/frameworks/sproutcore/frameworks/desktop/views/scene.js +23 -16
  122. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +241 -77
  123. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +134 -69
  124. data/lib/frameworks/sproutcore/frameworks/desktop/views/segment.js +107 -25
  125. data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +125 -48
  126. data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +165 -69
  127. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +73 -24
  128. data/lib/frameworks/sproutcore/frameworks/desktop/views/separator.js +19 -5
  129. data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list.js +16 -4
  130. data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +14 -7
  131. data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +43 -37
  132. data/lib/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +8 -1
  133. data/lib/frameworks/sproutcore/frameworks/desktop/views/stacked.js +14 -3
  134. data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +16 -2
  135. data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +99 -0
  136. data/lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js +13 -1
  137. data/lib/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +58 -8
  138. data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +34 -18
  139. data/lib/frameworks/sproutcore/frameworks/desktop/views/well.js +25 -9
  140. data/lib/frameworks/sproutcore/frameworks/desktop/views/workspace.js +70 -36
  141. data/lib/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +10 -5
  142. data/lib/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +28 -17
  143. data/lib/frameworks/sproutcore/frameworks/foundation/delegates/inline_text_field.js +41 -43
  144. data/lib/frameworks/sproutcore/frameworks/foundation/gestures/pinch.js +42 -4
  145. data/lib/frameworks/sproutcore/frameworks/foundation/gestures/swipe.js +94 -4
  146. data/lib/frameworks/sproutcore/frameworks/foundation/gestures/tap.js +41 -1
  147. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js +2 -0
  148. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +18 -9
  149. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +7 -5
  150. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +7 -8
  151. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_value_support.js +34 -24
  152. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/control.js +48 -18
  153. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +1 -0
  154. data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/misc.js +1 -2
  155. data/lib/frameworks/sproutcore/frameworks/foundation/tasks/preload_bundle.js +1 -1
  156. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +0 -11
  157. data/lib/frameworks/sproutcore/frameworks/foundation/validators/date_time.js +1 -1
  158. data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +8 -0
  159. data/lib/frameworks/sproutcore/frameworks/qunit/README.md +24 -0
  160. data/lib/frameworks/sproutcore/frameworks/qunit/package.json +21 -0
  161. data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.css +215 -0
  162. data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.js +1442 -0
  163. data/lib/frameworks/sproutcore/frameworks/qunit/test/headless.html +24 -0
  164. data/lib/frameworks/sproutcore/frameworks/qunit/test/index.html +18 -0
  165. data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.html +17 -0
  166. data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.js +150 -0
  167. data/lib/frameworks/sproutcore/frameworks/qunit/test/same.js +1421 -0
  168. data/lib/frameworks/sproutcore/frameworks/qunit/test/test.js +314 -0
  169. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +1 -1
  170. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +369 -60
  171. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +2 -405
  172. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +3 -9
  173. data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +50 -45
  174. data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +20 -1
  175. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +0 -9
  176. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +1 -1
  177. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +36 -14
  178. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable.js +0 -34
  179. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable_observers.js +50 -61
  180. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +2 -2
  181. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +1 -1
  182. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +45 -1
  183. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +1 -1
  184. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +5 -0
  185. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/enhance.js +1 -1
  186. data/lib/frameworks/sproutcore/frameworks/testing/core.js +3 -0
  187. data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +0 -1
  188. data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +0 -1
  189. data/lib/gen/html_app/templates/apps/@target_name@/@target_name@.js +1 -1
  190. data/vendor/chance/lib/chance/instance.rb +8 -6
  191. metadata +41 -31
  192. data/lib/frameworks/sproutcore/frameworks/testing/jquery.js +0 -3559
  193. data/lib/frameworks/sproutcore/frameworks/testing/qunit.js +0 -827
@@ -17,15 +17,13 @@
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
- {{{
21
- SC.mixin(SC.ScrollerView.prototype, {
22
- scrollbarThickness: 14,
23
- capLength: 18,
24
- capOverlap: 14,
25
- buttonOverlap: 11,
26
- buttonLength: 41
27
- });
28
- }}}
20
+ SC.mixin(SC.ScrollerView.prototype, {
21
+ scrollbarThickness: 14,
22
+ capLength: 18,
23
+ capOverlap: 14,
24
+ buttonOverlap: 11,
25
+ buttonLength: 41
26
+ });
29
27
 
30
28
  You can change whether scroll buttons are displayed by setting the
31
29
  hasButtons property.
@@ -36,15 +34,30 @@
36
34
  SC.ScrollerView = SC.View.extend(
37
35
  /** @scope SC.ScrollerView.prototype */ {
38
36
 
37
+ /**
38
+ @type Array
39
+ @default ['sc-scroller-view']
40
+ @see SC.View#classNames
41
+ */
39
42
  classNames: ['sc-scroller-view'],
40
43
 
41
44
  /**
42
- The WAI-ARIA role for scroller view. This property's value should not be
43
- changed.
45
+ @type Array
46
+ @default 'thumbPosition thumbLength isEnabled controlsHidden'.w()
47
+ @see SC.View#displayProperties
48
+ */
49
+ displayProperties: 'thumbPosition thumbLength isEnabled controlsHidden'.w(),
50
+
51
+ /**
52
+ The WAI-ARIA role for scroller view.
44
53
 
45
- @property {String}
54
+ @type String
55
+ @default 'scrollbar'
56
+ @readOnly
46
57
  */
47
58
  ariaRole: 'scrollbar',
59
+
60
+
48
61
  // ..........................................................
49
62
  // PROPERTIES
50
63
  //
@@ -54,12 +67,14 @@ SC.ScrollerView = SC.View.extend(
54
67
  Otherwise, a click on the track will cause a page down.
55
68
 
56
69
  In either case, alt-clicks will perform the opposite behavior.
70
+
71
+ @type Boolean
72
+ @default NO
57
73
  */
58
74
  shouldScrollToClick: NO,
59
75
 
60
76
 
61
- /**
62
- @private
77
+ /** @private
63
78
  The in-touch-scroll value.
64
79
  */
65
80
  _touchScrollValue: NO,
@@ -68,8 +83,11 @@ SC.ScrollerView = SC.View.extend(
68
83
  The value of the scroller.
69
84
 
70
85
  The value represents the position of the scroller's thumb.
71
-
72
- @property {Number}
86
+
87
+ @field
88
+ @type Number
89
+ @observes maximum
90
+ @observes minimum
73
91
  */
74
92
  value: function(key, val) {
75
93
  var minimum = this.get('minimum');
@@ -81,6 +99,10 @@ SC.ScrollerView = SC.View.extend(
81
99
  return Math.max(Math.min(val, this.get('maximum')), minimum) ;
82
100
  }.property('maximum', 'minimum').cacheable(),
83
101
 
102
+ /**
103
+ @type Number
104
+ @observes value
105
+ */
84
106
  displayValue: function() {
85
107
  var ret;
86
108
  if (this.get("_touchScrollValue")) ret = this.get("_touchScrollValue");
@@ -97,7 +119,8 @@ SC.ScrollerView = SC.View.extend(
97
119
  the slot). Note that if the proportion is 1.0 then the control will be
98
120
  disabled.
99
121
 
100
- @property {Number}
122
+ @type Number
123
+ @default 0.0
101
124
  */
102
125
  proportion: 0,
103
126
 
@@ -107,7 +130,8 @@ SC.ScrollerView = SC.View.extend(
107
130
 
108
131
  When set less than the height of the scroller, the scroller is disabled.
109
132
 
110
- @property {Number}
133
+ @type Number
134
+ @default 100
111
135
  */
112
136
  maximum: 100,
113
137
 
@@ -115,7 +139,8 @@ SC.ScrollerView = SC.View.extend(
115
139
  The minimum offset value for the scroller. This will be used to calculate
116
140
  the internal height/width of the scroller itself.
117
141
 
118
- @property {Number}
142
+ @type Number
143
+ @default 0
119
144
  */
120
145
  minimum: 0,
121
146
 
@@ -123,7 +148,10 @@ SC.ScrollerView = SC.View.extend(
123
148
  YES to enable scrollbar, NO to disable it. Scrollbars will automatically
124
149
  disable if the maximum scroll width does not exceed their capacity.
125
150
 
126
- @property
151
+ @field
152
+ @type Boolean
153
+ @default YES
154
+ @observes proportion
127
155
  */
128
156
  isEnabled: function(key, value) {
129
157
  if (value !== undefined) {
@@ -137,26 +165,32 @@ SC.ScrollerView = SC.View.extend(
137
165
  return this.get('proportion') < 1;
138
166
  }.property('proportion').cacheable(),
139
167
 
140
- // to allow setting isEnabled manually
168
+ /** @private */
141
169
  _scsv_isEnabled: undefined,
142
170
 
143
171
  /**
144
172
  Determine the layout direction. Determines whether the scrollbar should
145
173
  appear horizontal or vertical. This must be set when the view is created.
146
- Changing this once the view has been created will have no effect.
174
+ Changing this once the view has been created will have no effect. Possible
175
+ values:
176
+
177
+ - SC.LAYOUT_VERTICAL
178
+ - SC.LAYOUT_HORIZONTAL
147
179
 
148
- @property
180
+ @type String
181
+ @default SC.LAYOUT_VERTICAL
149
182
  */
150
183
  layoutDirection: SC.LAYOUT_VERTICAL,
151
184
 
152
185
  /**
153
186
  Whether or not the scroller should display scroll buttons
154
187
 
155
- @property {Boolean}
188
+ @type Boolean
156
189
  @default YES
157
190
  */
158
191
  hasButtons: YES,
159
192
 
193
+
160
194
  // ..........................................................
161
195
  // DISPLAY METRICS
162
196
  //
@@ -165,21 +199,24 @@ SC.ScrollerView = SC.View.extend(
165
199
  The width (if vertical scroller) or height (if horizontal scroller) of the
166
200
  scrollbar.
167
201
 
168
- @property {Number}
202
+ @type Number
203
+ @default 14
169
204
  */
170
205
  scrollbarThickness: 14,
171
206
 
172
207
  /**
173
208
  The width or height of the cap that encloses the track.
174
209
 
175
- @property {Number}
210
+ @type Number
211
+ @default 18
176
212
  */
177
213
  capLength: 18,
178
214
 
179
215
  /**
180
216
  The amount by which the thumb overlaps the cap.
181
217
 
182
- @property {Number}
218
+ @type Number
219
+ @default 14
183
220
  */
184
221
  capOverlap: 14,
185
222
 
@@ -188,7 +225,8 @@ SC.ScrollerView = SC.View.extend(
188
225
  scroller is not displaying arrows, this is the width or height of the end
189
226
  cap.
190
227
 
191
- @property {Number}
228
+ @type Number
229
+ @defaut 41
192
230
  */
193
231
  buttonLength: 41,
194
232
 
@@ -197,7 +235,8 @@ SC.ScrollerView = SC.View.extend(
197
235
  is not displaying arrows, this is the amount by which the thumb overlaps
198
236
  the end cap.
199
237
 
200
- @property {Number}
238
+ @type Number
239
+ @default 11
201
240
  */
202
241
  buttonOverlap: 11,
203
242
 
@@ -205,7 +244,8 @@ SC.ScrollerView = SC.View.extend(
205
244
  The minimium length that the thumb will be, regardless of how much content
206
245
  is in the scroll view.
207
246
 
208
- @property {Number}
247
+ @type Number
248
+ @default 20
209
249
  */
210
250
  minimumThumbLength: 20,
211
251
 
@@ -213,9 +253,8 @@ SC.ScrollerView = SC.View.extend(
213
253
  // INTERNAL SUPPORT
214
254
  //
215
255
 
216
- displayProperties: 'thumbPosition thumbLength isEnabled controlsHidden'.w(),
217
256
 
218
- /**
257
+ /** @private
219
258
  Generates the HTML that gets displayed to the user.
220
259
 
221
260
  The first time render is called, the HTML will be output to the DOM.
@@ -313,17 +352,17 @@ SC.ScrollerView = SC.View.extend(
313
352
  }
314
353
  },
315
354
 
316
- /**
317
- @private
318
- */
355
+ /** @private */
319
356
  touchScrollDidStart: function(value) {
320
357
  this.set("_touchScrollValue", value);
321
358
  },
322
359
 
360
+ /** @private */
323
361
  touchScrollDidEnd: function(value) {
324
362
  this.set("_touchScrollValue", NO);
325
363
  },
326
364
 
365
+ /** @private */
327
366
  touchScrollDidChange: function(value) {
328
367
  this.set("_touchScrollValue", value);
329
368
  },
@@ -331,7 +370,8 @@ SC.ScrollerView = SC.View.extend(
331
370
  // ..........................................................
332
371
  // THUMB MANAGEMENT
333
372
  //
334
- /**
373
+
374
+ /** @private
335
375
  Adjusts the thumb (for backwards-compatibility calls adjustThumbPosition+adjustThumbSize by default)
336
376
  */
337
377
  adjustThumb: function(thumb, position, length) {
@@ -339,11 +379,10 @@ SC.ScrollerView = SC.View.extend(
339
379
  this.adjustThumbSize(thumb, length);
340
380
  },
341
381
 
342
- /**
382
+ /** @private
343
383
  Updates the position of the thumb DOM element.
344
384
 
345
385
  @param {Number} position the position of the thumb in pixels
346
- @private
347
386
  */
348
387
  adjustThumbPosition: function(thumb, position) {
349
388
  // Don't touch the DOM if the position hasn't changed
@@ -361,6 +400,7 @@ SC.ScrollerView = SC.View.extend(
361
400
  this._thumbPosition = position;
362
401
  },
363
402
 
403
+ /** @private */
364
404
  adjustThumbSize: function(thumb, size) {
365
405
  // Don't touch the DOM if the size hasn't changed
366
406
  if (this._thumbSize === size) return;
@@ -381,7 +421,7 @@ SC.ScrollerView = SC.View.extend(
381
421
  // SCROLLER DIMENSION COMPUTED PROPERTIES
382
422
  //
383
423
 
384
- /**
424
+ /** @private
385
425
  Returns the total length of the track in which the thumb sits.
386
426
 
387
427
  The length of the track is the height or width of the scroller, less the
@@ -389,7 +429,6 @@ SC.ScrollerView = SC.View.extend(
389
429
  position of the thumb relative to the view.
390
430
 
391
431
  @property
392
- @private
393
432
  */
394
433
  trackLength: function() {
395
434
  var scrollerLength = this.get('scrollerLength');
@@ -403,13 +442,12 @@ SC.ScrollerView = SC.View.extend(
403
442
  return scrollerLength;
404
443
  }.property('scrollerLength').cacheable(),
405
444
 
406
- /**
445
+ /** @private
407
446
  Returns the height of the view if this is a vertical scroller or the width
408
447
  of the view if this is a horizontal scroller. This is used when scrolling
409
448
  up and down by page, as well as in various layout calculations.
410
449
 
411
- @property {Number}
412
- @private
450
+ @type Number
413
451
  */
414
452
  scrollerLength: function() {
415
453
  switch (this.get('layoutDirection')) {
@@ -422,12 +460,11 @@ SC.ScrollerView = SC.View.extend(
422
460
  return 0;
423
461
  }.property('frame').cacheable(),
424
462
 
425
- /**
463
+ /** @private
426
464
  The total length of the thumb. The size of the thumb is the
427
465
  length of the track times the content proportion.
428
466
 
429
467
  @property
430
- @private
431
468
  */
432
469
  thumbLength: function() {
433
470
  var length;
@@ -438,12 +475,11 @@ SC.ScrollerView = SC.View.extend(
438
475
  return Math.max(length, this.get('minimumThumbLength'));
439
476
  }.property('trackLength', 'proportion').cacheable(),
440
477
 
441
- /**
478
+ /** @private
442
479
  The position of the thumb in the track.
443
480
 
444
- @property {Number}
481
+ @type Number
445
482
  @isReadOnly
446
- @private
447
483
  */
448
484
  thumbPosition: function() {
449
485
  var value = this.get('displayValue'),
@@ -459,26 +495,24 @@ SC.ScrollerView = SC.View.extend(
459
495
  return Math.floor(isNaN(position) ? 0 : position);
460
496
  }.property('displayValue', 'maximum', 'trackLength', 'thumbLength').cacheable(),
461
497
 
462
- /**
498
+ /** @private
463
499
  YES if the maximum value exceeds the frame size of the scroller. This
464
500
  will hide the thumb and buttons.
465
501
 
466
- @property {Boolean}
502
+ @type Boolean
467
503
  @isReadOnly
468
- @private
469
504
  */
470
505
  controlsHidden: function() {
471
506
  return this.get('proportion') >= 1;
472
507
  }.property('proportion').cacheable(),
473
508
 
509
+
474
510
  // ..........................................................
475
511
  // MOUSE EVENTS
476
512
  //
477
513
 
478
- /**
514
+ /** @private
479
515
  Returns the value for a position within the scroller's frame.
480
-
481
- @private
482
516
  */
483
517
  valueForPosition: function(pos) {
484
518
  var max = this.get('maximum'),
@@ -493,7 +527,7 @@ SC.ScrollerView = SC.View.extend(
493
527
  return value;
494
528
  },
495
529
 
496
- /**
530
+ /** @private
497
531
  Handles mouse down events and adjusts the value property depending where
498
532
  the user clicked.
499
533
 
@@ -512,7 +546,6 @@ SC.ScrollerView = SC.View.extend(
512
546
  are repeated until they release the mouse button.
513
547
 
514
548
  @param evt {SC.Event} the mousedown event
515
- @private
516
549
  */
517
550
  mouseDown: function(evt) {
518
551
  if (!this.get('isEnabled')) return NO;
@@ -604,13 +637,12 @@ SC.ScrollerView = SC.View.extend(
604
637
  return YES;
605
638
  },
606
639
 
607
- /**
640
+ /** @private
608
641
  When the user releases the mouse button, remove any active
609
642
  state from the button controls, and cancel any outstanding
610
643
  timers.
611
644
 
612
645
  @param evt {SC.Event} the mousedown event
613
- @private
614
646
  */
615
647
  mouseUp: function(evt) {
616
648
  var active = this._scs_buttonActive, ret = NO, timer;
@@ -636,7 +668,7 @@ SC.ScrollerView = SC.View.extend(
636
668
  return ret;
637
669
  },
638
670
 
639
- /**
671
+ /** @private
640
672
  If the user began the drag on the thumb, we calculate the difference
641
673
  between the mouse position at click and where it is now. We then
642
674
  offset the thumb by that amount, within the bounds of the track.
@@ -645,7 +677,6 @@ SC.ScrollerView = SC.View.extend(
645
677
  what component they are currently over, changing the scroll direction.
646
678
 
647
679
  @param evt {SC.Event} the mousedragged event
648
- @private
649
680
  */
650
681
  mouseDragged: function(evt) {
651
682
  var value, length, delta, thumbPosition,
@@ -736,15 +767,13 @@ SC.ScrollerView = SC.View.extend(
736
767
  return YES;
737
768
  },
738
769
 
739
- /**
770
+ /** @private
740
771
  Starts a timer that fires after 300ms. This is called when the user
741
772
  clicks a button or inside the track to move a page at a time. If they
742
773
  continue holding the mouse button down, we want to repeat that action
743
774
  after a small delay. This timer will be invalidated in mouseUp.
744
775
 
745
776
  Specify "immediate" as YES if it should not wait.
746
-
747
- @private
748
777
  */
749
778
  startMouseDownTimer: function(action, immediate) {
750
779
  var timer;
@@ -755,11 +784,9 @@ SC.ScrollerView = SC.View.extend(
755
784
  });
756
785
  },
757
786
 
758
- /**
787
+ /** @private
759
788
  Called by the mousedown timer. This method determines the initial
760
789
  user action and repeats it until the timer is invalidated in mouseUp.
761
-
762
- @private
763
790
  */
764
791
  mouseDownTimerDidFire: function() {
765
792
  var scrollerLength = this.get('scrollerLength'),
@@ -798,13 +825,12 @@ SC.ScrollerView = SC.View.extend(
798
825
  });
799
826
  },
800
827
 
801
- /**
828
+ /** @private
802
829
  Given a selector, finds the corresponding DOM element and adds
803
830
  the 'active' class name. Also stores the returned element so that
804
831
  the 'active' class name can be removed during mouseup.
805
832
 
806
833
  @param {String} the selector to find
807
- @private
808
834
  */
809
835
  makeButtonActive: function(selector) {
810
836
  this._scs_buttonActive = this.$(selector).addClass('active');
@@ -812,14 +838,52 @@ SC.ScrollerView = SC.View.extend(
812
838
  });
813
839
 
814
840
  // TODO: Use render delegates to handle rendering.
815
- SC.TouchScrollerView = SC.ScrollerView.extend({
841
+
842
+ /**
843
+ @class
844
+ @extends SC.ScrollerView
845
+ */
846
+ SC.TouchScrollerView = SC.ScrollerView.extend(
847
+ /** @scope SC.TouchScrollerView.prototype */{
848
+
849
+ /**
850
+ @type Array
851
+ @default ['sc-touch-scroller-view']
852
+ @see SC.View#classNames
853
+ */
816
854
  classNames: ['sc-touch-scroller-view'],
855
+
856
+ /**
857
+ @type Number
858
+ @default 12
859
+ */
817
860
  scrollbarThickness: 12,
861
+
862
+ /**
863
+ @type Number
864
+ @default 5
865
+ */
818
866
  capLength: 5,
867
+
868
+ /**
869
+ @type Number
870
+ @default 0
871
+ */
819
872
  capOverlap: 0,
873
+
874
+ /**
875
+ @type Boolean
876
+ @default NO
877
+ */
820
878
  hasButtons: NO,
879
+
880
+ /**
881
+ @type Number
882
+ @default 36
883
+ */
821
884
  buttonOverlap: 36,
822
885
 
886
+ /** @private */
823
887
  adjustThumb: function(thumb, position, length) {
824
888
  var thumbInner = this.$('.thumb-inner');
825
889
  var max = this.get("scrollerLength") - this.capLength, min = this.get("minimum") + this.capLength;
@@ -853,6 +917,7 @@ SC.TouchScrollerView = SC.ScrollerView.extend({
853
917
  this._thumbSize = length;
854
918
  },
855
919
 
920
+ /** @private */
856
921
  render: function(context, firstTime) {
857
922
  var classNames = [],
858
923
  buttons = '',