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
@@ -4,33 +4,119 @@
4
4
  // Portions ©2008-2011 Apple Inc. All rights reserved.
5
5
  // License: Licensed under MIT license (see license.js)
6
6
  // ==========================================================================
7
+
7
8
  sc_require("system/gesture");
8
9
 
10
+ /*
11
+ TODO Document this class
12
+ */
13
+
14
+ /**
15
+ @static
16
+ @type String
17
+ @constant
18
+ */
9
19
  SC.SWIPE_HORIZONTAL = "X";
20
+
21
+ /**
22
+ @static
23
+ @type String
24
+ @constant
25
+ */
10
26
  SC.SWIPE_VERTICAL = "Y";
27
+
28
+ /**
29
+ @static
30
+ @type String
31
+ @constant
32
+ */
11
33
  SC.SWIPE_ANY = "XY";
34
+
35
+ /**
36
+ @static
37
+ @type String
38
+ @constant
39
+ */
12
40
  SC.SWIPE_LEFT = "LEFT";
41
+
42
+ /**
43
+ @static
44
+ @type String
45
+ @constant
46
+ */
13
47
  SC.SWIPE_RIGHT = "RIGHT";
48
+
49
+ /**
50
+ @static
51
+ @type String
52
+ @constant
53
+ */
14
54
  SC.SWIPE_UP = "UP";
55
+
56
+ /**
57
+ @static
58
+ @type String
59
+ @constant
60
+ */
15
61
  SC.SWIPE_DOWN = "DOWN";
16
62
 
17
- SC.SwipeGesture = SC.Gesture.extend({
63
+ /**
64
+ @class
65
+ @extends SC.Gesture
66
+ */
67
+ SC.SwipeGesture = SC.Gesture.extend(
68
+ /** @scope SC.SwipeGesture.prototype */ {
69
+
70
+ /**
71
+ @type String
72
+ @default "swipe"
73
+ @readOnly
74
+ */
18
75
  name: "swipe",
76
+
77
+ /**
78
+ @type Boolean
79
+ @default YES
80
+ @readOnly
81
+ */
19
82
  acceptsMultitouch: YES,
20
-
83
+
84
+ /**
85
+ @type String
86
+ @default SC.SWIPE_HORIZONTAL
87
+ */
21
88
  direction: SC.SWIPE_HORIZONTAL,
22
89
 
23
90
  /**
24
91
  Will be populated with the current direction of the swipe once
25
92
  one has been determined.
93
+
94
+ @type String
95
+ @default null
26
96
  */
27
97
  currentDirection: null,
28
98
 
99
+ /**
100
+ @type Number
101
+ @default 5
102
+ */
29
103
  startDistance: 5,
104
+
105
+ /**
106
+ @type Number
107
+ @default 40
108
+ */
30
109
  swipeDistance: 40,
31
110
 
32
- tolerance: 0.5, // we accept .5 the distance in the other direction as a swipe
111
+ /**
112
+ Amount of distance in the other direction to consider it a swipe
113
+
114
+ @type Number
115
+ @default 0.5
116
+ */
117
+ tolerance: 0.5,
33
118
 
119
+ /** @private */
34
120
  touchIsInGesture: function(touch, status) {
35
121
  // if we have not "flunked" the touch before, and it has moved
36
122
  if (!status.flunked) {
@@ -67,6 +153,7 @@ SC.SwipeGesture = SC.Gesture.extend({
67
153
  return NO;
68
154
  },
69
155
 
156
+ /** @private */
70
157
  touchStart: function(touch) {
71
158
  var d = this.get("currentDirection"),
72
159
  delta = touch["page" + d] - touch["start" + d],
@@ -79,6 +166,7 @@ SC.SwipeGesture = SC.Gesture.extend({
79
166
  return YES;
80
167
  },
81
168
 
169
+ /** @private */
82
170
  touchesDragged: function(evt, touches) {
83
171
  var touch = touches.firstObject();
84
172
  var d = this.get("currentDirection"),
@@ -98,12 +186,13 @@ SC.SwipeGesture = SC.Gesture.extend({
98
186
  this.release(touch);
99
187
 
100
188
  var allTouches = touch.touchesForResponder(this);
101
- if (!allTouches || allTouches.length == 0) this.cancel(touch, swipeDirection, delta);
189
+ if (!allTouches || allTouches.length === 0) this.cancel(touch, swipeDirection, delta);
102
190
  } else {
103
191
  this.change(touch, swipeDirection, delta);
104
192
  }
105
193
  },
106
194
 
195
+ /** @private */
107
196
  touchEnd: function(touch) {
108
197
  var d = this.get("currentDirection"),
109
198
  o = (d === SC.SWIPE_HORIZONTAL ? "Y" : "X"),
@@ -136,6 +225,7 @@ SC.SwipeGesture = SC.Gesture.extend({
136
225
  }
137
226
  },
138
227
 
228
+ /** @private */
139
229
  cancel: function(){
140
230
  sc_super();
141
231
  this.set('currentDirection', null);
@@ -4,23 +4,57 @@
4
4
  // Author: Peter Wagenet
5
5
  // License: Licensed under MIT license (see license.js)
6
6
  // ==========================================================================
7
+
7
8
  sc_require("system/gesture");
8
9
 
9
- SC.TapGesture = SC.Gesture.extend({
10
+ /**
11
+ @class
12
+ @extends SC.Gesture
13
+ */
14
+ SC.TapGesture = SC.Gesture.extend(
15
+ /** @scope SC.TapGesture.prototype */{
16
+
17
+ /**
18
+ @type String
19
+ @default "tap"
20
+ @readOnly
21
+ */
10
22
  name: "tap",
23
+
24
+ /**
25
+ @type Boolean
26
+ @default NO
27
+ @readOnly
28
+ */
11
29
  acceptsMultitouch: NO,
12
30
 
31
+ /** @private */
13
32
  _tapCount: null,
33
+
34
+ /** @private */
14
35
  _candidateTouch: null,
36
+
37
+ /** @private */
15
38
  _eventTimer: null,
16
39
 
40
+ /**
41
+ @type Number
42
+ @default 20
43
+ */
17
44
  tapWiggle: 10,
45
+
46
+ /**
47
+ @type Number
48
+ @default 200
49
+ */
18
50
  tapDelay: 200,
19
51
 
52
+ /** @private */
20
53
  touchIsInGesture: function(touch, status) {
21
54
  return !touch.tapFlunked;
22
55
  },
23
56
 
57
+ /** @private */
24
58
  touchStart: function(touch) {
25
59
  // We don't want events triggering during a touch, will be reset when touch is over if it's a candidate
26
60
  if (this._eventTimer) this._eventTimer.invalidate();
@@ -42,6 +76,7 @@ SC.TapGesture = SC.Gesture.extend({
42
76
  return YES;
43
77
  },
44
78
 
79
+ /** @private */
45
80
  touchesDragged: function(evt, touches) {
46
81
  var touch = touches[0];
47
82
 
@@ -58,6 +93,7 @@ SC.TapGesture = SC.Gesture.extend({
58
93
  if (tooManyTouches || touchMoved) this._cancelTap(touch);
59
94
  },
60
95
 
96
+ /** @private */
61
97
  touchEnd: function(touch){
62
98
  if (this._calculateDragDistance(touch) > this.get('tapWiggle') || Date.now() - this._candidateTouch.startTime > this.get('tapDelay') ) {
63
99
  // Touch moved too much or took too long
@@ -67,6 +103,7 @@ SC.TapGesture = SC.Gesture.extend({
67
103
  }
68
104
  },
69
105
 
106
+ /** @private */
70
107
  _addTap: function(touch){
71
108
  var self = this;
72
109
 
@@ -85,6 +122,7 @@ SC.TapGesture = SC.Gesture.extend({
85
122
 
86
123
  },
87
124
 
125
+ /** @private */
88
126
  _cancelTap: function(touch){
89
127
  // We don't set this on the touchStatus because the status is
90
128
  // linked to an individual view/gesture and we want this to be
@@ -101,6 +139,7 @@ SC.TapGesture = SC.Gesture.extend({
101
139
 
102
140
  },
103
141
 
142
+ /** @private */
104
143
  _triggerTap: function(touch){
105
144
  this.end(touch, this._tapCount);
106
145
 
@@ -109,6 +148,7 @@ SC.TapGesture = SC.Gesture.extend({
109
148
  this._eventTimer = null;
110
149
  },
111
150
 
151
+ /** @private */
112
152
  _calculateDragDistance: function(touch) {
113
153
  return Math.sqrt(Math.pow(touch.pageX - touch.startX, 2) + Math.pow(touch.pageY - touch.startY, 2));
114
154
  }
@@ -14,6 +14,7 @@
14
14
  @since SproutCore 1.0
15
15
  */
16
16
  SC.AutoMixin = {
17
+
17
18
  /**
18
19
  The mixins to automatically mix in.
19
20
  @property
@@ -36,4 +37,5 @@ SC.AutoMixin = {
36
37
  v = v.create.apply(v, applyMixins);
37
38
  return v;
38
39
  }
40
+
39
41
  };
@@ -45,22 +45,25 @@ SC.AutoResize = {
45
45
  setting 'measuredSize' to the measured value (you can bind to measuredSize
46
46
  and update size manually).
47
47
 
48
- @property {Boolean}
48
+ @type Boolean
49
+ @default YES
49
50
  */
50
51
  shouldAutoResize: YES,
51
52
 
52
53
  /**
53
54
  If NO, prevents SC.AutoResize from doing anything at all.
54
55
 
55
- @property {Boolean}
56
+ @type Boolean
57
+ @default YES
56
58
  */
57
59
  shouldMeasureSize: YES,
58
60
 
59
61
  /**
60
62
  Determines if the view's width should be resized
61
- on calculation. Default is YES.
63
+ on calculation.
62
64
 
63
- @property {Boolean}
65
+ @type Boolean
66
+ @default YES
64
67
  */
65
68
  shouldResizeWidth: YES,
66
69
 
@@ -69,7 +72,8 @@ SC.AutoResize = {
69
72
  on calculation. Default is NO to retain backwards
70
73
  compatibility.
71
74
 
72
- @property {Boolean}
75
+ @type Boolean
76
+ @default NO
73
77
  */
74
78
  shouldResizeHeight: NO,
75
79
 
@@ -79,7 +83,7 @@ SC.AutoResize = {
79
83
  shouldAutoResize to NO, allows you to customize the 'sizing' part, using
80
84
  SC.AutoResize purely for its measuring code.
81
85
 
82
- @property {Rect}
86
+ @type Rect
83
87
  */
84
88
  measuredSize: { width: 0, height: 0 },
85
89
 
@@ -108,14 +112,19 @@ SC.AutoResize = {
108
112
  /**
109
113
  If this property is provided, all views that share the same value for this property will be resized as a batch for increased performance.
110
114
 
111
- @property {String}
115
+ @type String
112
116
  */
113
117
  batchResizeId: null,
114
118
 
119
+ /** @private */
115
120
  _scar_measurementPending: NO,
121
+
122
+ /** @private */
116
123
  _scar_requestedBatchResizeId: null,
117
124
 
118
- // if the batch id changed while a request is out, we have to fix it
125
+ /** @private
126
+ If the batch id changed while a request is out, we have to fix it
127
+ */
119
128
  _scar_batchResizeIdDidChange: function() {
120
129
  var batchResizeId = this.get('batchResizeId'),
121
130
  requestedBatchResizeId = this._scar_requestedBatchResizeId;
@@ -208,7 +217,7 @@ SC.AutoResize = {
208
217
  },
209
218
 
210
219
  /**
211
-
220
+ @private
212
221
  */
213
222
  _scar_valueDidChange: function() {
214
223
  this.scheduleMeasurement();
@@ -5,25 +5,27 @@
5
5
  // License: Licensed under MIT license (see license.js)
6
6
  // ==========================================================================
7
7
 
8
-
9
8
  /**
10
9
  Used for contentIndexDisclosureState(). Indicates open branch node.
11
10
 
12
- @property {Number}
11
+ @type Number
12
+ @constant
13
13
  */
14
14
  SC.BRANCH_OPEN = 0x0011;
15
15
 
16
16
  /**
17
17
  Used for contentIndexDisclosureState(). Indicates closed branch node.
18
18
 
19
- @property {Number}
19
+ @type Number
20
+ @constant
20
21
  */
21
22
  SC.BRANCH_CLOSED = 0x0012;
22
23
 
23
24
  /**
24
25
  Used for contentIndexDisclosureState(). Indicates leaf node.
25
26
 
26
- @property {Number}
27
+ @type Number
28
+ @constant
27
29
  */
28
30
  SC.LEAF_NODE = 0x0020;
29
31
 
@@ -44,7 +46,7 @@ SC.CollectionContent = {
44
46
  /**
45
47
  Used to detect the mixin by SC.CollectionView
46
48
 
47
- @property {Boolean}
49
+ @type Boolean
48
50
  */
49
51
  isCollectionContent: YES,
50
52
 
@@ -15,14 +15,12 @@
15
15
  method on your view. Your updateDisplay() method will then be called at the
16
16
  end of the run loop.
17
17
 
18
- h2. Example
18
+ ## Example
19
19
 
20
- {{{
21
- MyApp.MyViewClass = SC.View.extend(SC.ContentDisplay, {
22
- contentDisplayProperties: 'title isEnabled hasChildren'.w(),
23
- ...
24
- });
25
- }}}
20
+ MyApp.MyViewClass = SC.View.extend(SC.ContentDisplay, {
21
+ contentDisplayProperties: 'title isEnabled hasChildren'.w(),
22
+ ...
23
+ });
26
24
 
27
25
  @since SproutCore 1.0
28
26
  */
@@ -39,7 +37,8 @@ SC.ContentDisplay = {
39
37
  should trigger an update of the display for your view. Changes to the
40
38
  content object will only invoke your display method once per runloop.
41
39
 
42
- @property {Array}
40
+ @type Array
41
+ @default []
43
42
  */
44
43
  contentDisplayProperties: [],
45
44
 
@@ -5,27 +5,32 @@
5
5
  // License: Licensed under MIT license (see license.js)
6
6
  // ==========================================================================
7
7
 
8
- /*
9
- * @mixin
10
- *
11
- * This mixin allows a view to get its value from a content object based
12
- * on the value of its contentValueKey.
13
- *
14
- * {{{
15
- * myView = SC.View.create({
16
- * content: {prop: "abc123"},
17
- *
18
- * contentValueKey: 'prop'
19
- * });
20
- *
21
- * // myView.get('value') will be "abc123"
22
- * }}}
23
- *
24
- * This is useful if you have a nested record structure and want to have
25
- * it be reflected in a nested view structure. If your data structures
26
- * only have primitive values, consider using SC.Control instead.
8
+ /**
9
+ @mixin
10
+
11
+ This mixin allows a view to get its value from a content object based
12
+ on the value of its contentValueKey.
13
+
14
+ myView = SC.View.create({
15
+ content: {prop: "abc123"},
16
+
17
+ contentValueKey: 'prop'
18
+ });
19
+
20
+ // myView.get('value') will be "abc123"
21
+
22
+ This is useful if you have a nested record structure and want to have
23
+ it be reflected in a nested view structure. If your data structures
24
+ only have primitive values, consider using SC.Control instead.
27
25
  */
28
26
  SC.ContentValueSupport = {
27
+
28
+ /**
29
+ Walk like a duck.
30
+
31
+ @type Boolean
32
+ @default YES
33
+ */
29
34
  hasContentValueSupport: YES,
30
35
 
31
36
  /** @private */
@@ -46,7 +51,8 @@ SC.ContentValueSupport = {
46
51
  set a content object and have the control display a single property
47
52
  of that control, then you should use the content property instead.
48
53
 
49
- @property {Object}
54
+ @type Object
55
+ @default null
50
56
  */
51
57
  value: null,
52
58
 
@@ -66,7 +72,8 @@ SC.ContentValueSupport = {
66
72
  collection view, then it would be better to instead bind the value of
67
73
  the control directly to a controller property.
68
74
 
69
- @property {SC.Object}
75
+ @type SC.Object
76
+ @default null
70
77
  */
71
78
  content: null,
72
79
 
@@ -76,7 +83,8 @@ SC.ContentValueSupport = {
76
83
  content object is first set. If you have a displayDelegate, then
77
84
  you can also use the contentValueKey of the displayDelegate.
78
85
 
79
- @property {String}
86
+ @type String
87
+ @default null
80
88
  */
81
89
  contentValueKey: null,
82
90
 
@@ -208,10 +216,12 @@ SC.ContentValueSupport = {
208
216
 
209
217
  }.observes('content'),
210
218
 
211
- // since we always observe *, just call the update function
219
+ /** @private
220
+ Since we always observe *, just call the update function
221
+ */
212
222
  _control_contentValueKeyDidChange: function() {
213
223
  // notify that value did change.
214
224
  this.contentPropertyDidChange(this.get('content'), '*') ;
215
- }.observes('contentValueKey'),
225
+ }.observes('contentValueKey')
216
226
  };
217
227
 
@@ -11,48 +11,57 @@ sc_require('mixins/content_value_support');
11
11
  /**
12
12
  Option for controls to automatically calculate their size (should be default
13
13
  on controls that use renderers).
14
+
15
+ @type String
16
+ @constant
14
17
  */
15
18
  SC.AUTO_CONTROL_SIZE = '__AUTO__';
16
19
 
17
20
  /**
18
21
  Option for HUGE control size.
19
22
 
20
- @property {String}
23
+ @type String
24
+ @constant
21
25
  */
22
26
  SC.JUMBO_CONTROL_SIZE = 'sc-jumbo-size' ;
23
27
 
24
28
  /**
25
29
  Option for HUGE control size.
26
30
 
27
- @property {String}
31
+ @type String
32
+ @constant
28
33
  */
29
34
  SC.HUGE_CONTROL_SIZE = 'sc-huge-size' ;
30
35
 
31
36
  /**
32
37
  Option for large control size.
33
38
 
34
- @property {String}
39
+ @type String
40
+ @constant
35
41
  */
36
42
  SC.LARGE_CONTROL_SIZE = 'sc-large-size' ;
37
43
 
38
44
  /**
39
45
  Option for standard control size.
40
46
 
41
- @property {String}
47
+ @type String
48
+ @constant
42
49
  */
43
50
  SC.REGULAR_CONTROL_SIZE = 'sc-regular-size' ;
44
51
 
45
52
  /**
46
53
  Option for small control size.
47
54
 
48
- @property {String}
55
+ @type String
56
+ @constant
49
57
  */
50
58
  SC.SMALL_CONTROL_SIZE = 'sc-small-size' ;
51
59
 
52
60
  /**
53
61
  Option for tiny control size
54
62
 
55
- @property {String}
63
+ @type String
64
+ @constant
56
65
  */
57
66
  SC.TINY_CONTROL_SIZE = 'sc-tiny-size' ;
58
67
 
@@ -64,7 +73,7 @@ SC.TINY_CONTROL_SIZE = 'sc-tiny-size' ;
64
73
  functionality including showing a selected state, enabled state, focus
65
74
  state, etc.
66
75
 
67
- h2. About Values and Content
76
+ ## About Values and Content
68
77
 
69
78
  Controls typically are used to represent a single value, such as a number,
70
79
  boolean or string. The value a control is managing is typically stored in
@@ -98,7 +107,7 @@ SC.TINY_CONTROL_SIZE = 'sc-tiny-size' ;
98
107
  properties you care about on the content object and update your view if
99
108
  anything you care about has changed.
100
109
 
101
- h2. Delegate Support
110
+ ## Delegate Support
102
111
 
103
112
  Controls can optionally get the contentDisplayProperty from a
104
113
  displayDelegate, if it is set. The displayDelegate is often used to
@@ -107,16 +116,29 @@ SC.TINY_CONTROL_SIZE = 'sc-tiny-size' ;
107
116
  collection view will be automatically set as its displayDelegate.
108
117
 
109
118
  @since SproutCore 1.0
119
+ @extends SC.ContentValueSupport
110
120
  */
111
- SC.Control = SC.mixin(SC.clone(SC.ContentValueSupport), {
121
+ SC.Control = SC.mixin(SC.clone(SC.ContentValueSupport),
122
+ /** @scope SC.Control.prototype */{
112
123
 
124
+ /**
125
+ Walk like a duck
126
+
127
+ @type Boolean
128
+ @default YES
129
+ @readOnly
130
+ */
113
131
  isControl: YES,
114
132
 
115
133
  /**
116
- The selected state of this control. Possible options are YES, NO or
117
- SC.MIXED_STATE.
134
+ The selected state of this control. Possible values:
135
+
136
+ - `YES`
137
+ - `NO`
138
+ - SC.MIXED_STATE.
118
139
 
119
- @property {Boolean}
140
+ @type Boolean
141
+ @default NO
120
142
  */
121
143
  isSelected: NO,
122
144
 
@@ -131,7 +153,8 @@ SC.Control = SC.mixin(SC.clone(SC.ContentValueSupport), {
131
153
  Changing this property value by default will cause the Control mixin to
132
154
  add/remove an 'active' class name to the root element.
133
155
 
134
- @property {Boolean}
156
+ @type Boolean
157
+ @default NO
135
158
  */
136
159
  isActive: NO,
137
160
 
@@ -146,7 +169,8 @@ SC.Control = SC.mixin(SC.clone(SC.ContentValueSupport), {
146
169
  automatically bind the value to the property key you name here on the
147
170
  content object.
148
171
 
149
- @property {String}
172
+ @type String
173
+ @default null
150
174
  */
151
175
  fieldKey: null,
152
176
 
@@ -157,7 +181,8 @@ SC.Control = SC.mixin(SC.clone(SC.ContentValueSupport), {
157
181
  in the error explanation. If you do not set this property, then the
158
182
  fieldKey or the class name will be used to generate a human readable name.
159
183
 
160
- @property {String}
184
+ @type String
185
+ @default null
161
186
  */
162
187
  fieldLabel: null,
163
188
 
@@ -173,7 +198,10 @@ SC.Control = SC.mixin(SC.clone(SC.ContentValueSupport), {
173
198
  Try to localize using the string "ErrorLabel.{ClassName}". Return a
174
199
  humanized form of the class name.
175
200
 
176
- @property {String}
201
+ @field
202
+ @type String
203
+ @observes 'fieldLabel'
204
+ @observes 'fieldKey'
177
205
  */
178
206
  errorLabel: function() {
179
207
  var ret, fk, def ;
@@ -197,7 +225,8 @@ SC.Control = SC.mixin(SC.clone(SC.ContentValueSupport), {
197
225
  a height, performance will be impacted as it must be calculated; if you do
198
226
  this, a warning will be issued. If you don't care, use SC.CALCULATED_CONTROL_SIZE.
199
227
 
200
- @property {String}
228
+ @type String
229
+ @default SC.REGULAR_CONTROL_SIZE
201
230
  */
202
231
  controlSize: SC.REGULAR_CONTROL_SIZE,
203
232
 
@@ -248,6 +277,7 @@ SC.Control = SC.mixin(SC.clone(SC.ContentValueSupport), {
248
277
  this.$input().attr('disabled', disabled);
249
278
  }
250
279
  }
251
- },
280
+ }
281
+
252
282
  });
253
283