sproutcore 1.0.1003 → 1.0.1008

Sign up to get free protection for your applications and to get access to all the features.
Files changed (276) hide show
  1. data/Buildfile +15 -3
  2. data/Rakefile +3 -7
  3. data/VERSION.yml +2 -2
  4. data/buildtasks/manifest.rake +2 -0
  5. data/frameworks/sproutcore/Buildfile +2 -0
  6. data/frameworks/sproutcore/HISTORY +218 -203
  7. data/frameworks/sproutcore/README +47 -6
  8. data/frameworks/sproutcore/apps/tests/english.lproj/main_page.css +4 -0
  9. data/frameworks/sproutcore/design/Design Charts.graffle +2945 -4332
  10. data/frameworks/sproutcore/frameworks/bootstrap/README +9 -0
  11. data/frameworks/sproutcore/frameworks/bootstrap/core.js +7 -0
  12. data/frameworks/sproutcore/frameworks/bootstrap/setup_body_class_names.js +10 -0
  13. data/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +28 -0
  14. data/frameworks/sproutcore/frameworks/bootstrap/system/loader.js +45 -0
  15. data/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +9 -8
  16. data/frameworks/sproutcore/frameworks/datastore/models/record.js +49 -9
  17. data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +9 -0
  18. data/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +3 -2
  19. data/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +81 -8
  20. data/frameworks/sproutcore/frameworks/datastore/system/query.js +26 -5
  21. data/frameworks/sproutcore/frameworks/datastore/system/record_array.js +47 -0
  22. data/frameworks/sproutcore/frameworks/datastore/system/store.js +164 -32
  23. data/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +32 -4
  24. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/error_methods.js +56 -0
  25. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +1 -1
  26. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/unknownProperty.js +15 -0
  27. data/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +16 -1
  28. data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +1 -1
  29. data/frameworks/sproutcore/frameworks/datastore/tests/models/single_attribute.js +22 -1
  30. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +32 -1
  31. data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/core_methods.js +70 -0
  32. data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation.js +12 -0
  33. data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js +50 -0
  34. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +9 -9
  35. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +8 -1
  36. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataHashDidChange.js +79 -0
  37. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +24 -0
  38. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/error_methods.js +62 -0
  39. data/frameworks/sproutcore/frameworks/datastore/tests/system/store/init.js +2 -0
  40. data/frameworks/sproutcore/frameworks/debug/core.js +10 -6
  41. data/frameworks/sproutcore/frameworks/designer/controllers/page_design.js +43 -18
  42. data/frameworks/sproutcore/frameworks/designer/core.js +10 -0
  43. data/frameworks/sproutcore/frameworks/designer/english.lproj/selection_handles.css +58 -0
  44. data/frameworks/sproutcore/frameworks/designer/{views/mixins → mixins}/button.js +0 -0
  45. data/frameworks/sproutcore/frameworks/designer/views/{controls/button.js → button.js} +6 -2
  46. data/frameworks/sproutcore/frameworks/designer/views/designer.js +566 -136
  47. data/frameworks/sproutcore/frameworks/designer/views/selection_handles.js +77 -0
  48. data/frameworks/sproutcore/frameworks/desktop/core.js +12 -0
  49. data/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +1 -1
  50. data/frameworks/sproutcore/frameworks/desktop/english.lproj/drag.css +3 -2
  51. data/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +0 -36
  52. data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu.css +14 -0
  53. data/frameworks/sproutcore/frameworks/desktop/english.lproj/modal.css +4 -0
  54. data/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +2 -0
  55. data/frameworks/sproutcore/frameworks/desktop/english.lproj/tab.css +0 -4
  56. data/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +8 -5
  57. data/frameworks/sproutcore/frameworks/desktop/panes/alert.js +2 -2
  58. data/frameworks/sproutcore/frameworks/desktop/panes/menu.js +100 -111
  59. data/frameworks/sproutcore/frameworks/desktop/panes/panel.js +1 -1
  60. data/frameworks/sproutcore/frameworks/desktop/panes/picker.js +51 -13
  61. data/frameworks/sproutcore/frameworks/desktop/panes/{drop_down.js → select_button.js} +70 -109
  62. data/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +8 -0
  63. data/frameworks/sproutcore/frameworks/desktop/system/root_responder.js +69 -23
  64. data/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +4 -4
  65. data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +2 -0
  66. data/frameworks/sproutcore/frameworks/desktop/tests/panes/{dropDown → select_button}/methods.js +15 -11
  67. data/frameworks/sproutcore/frameworks/desktop/tests/panes/{dropDown → select_button}/ui.js +22 -22
  68. data/frameworks/sproutcore/frameworks/desktop/tests/views/button/methods.js +1 -1
  69. data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +0 -1
  70. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deleteSelection.js +1 -1
  71. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deselect.js +19 -3
  72. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +1 -1
  73. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +53 -28
  74. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/select.js +6 -6
  75. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectNextItem.js +23 -9
  76. data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectPreviousItem.js +24 -10
  77. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +1 -1
  78. data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +1 -1
  79. data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +10 -3
  80. data/frameworks/sproutcore/frameworks/desktop/tests/views/radio/methods.js +1 -1
  81. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +50 -28
  82. data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/methods.js +6 -6
  83. data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +3 -3
  84. data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +8 -8
  85. data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +1 -1
  86. data/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +1 -1
  87. data/frameworks/sproutcore/frameworks/desktop/views/button.js +5 -3
  88. data/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +4 -3
  89. data/frameworks/sproutcore/frameworks/desktop/views/collection.js +125 -96
  90. data/frameworks/sproutcore/frameworks/desktop/views/grid.js +1 -0
  91. data/frameworks/sproutcore/frameworks/desktop/views/list.js +68 -18
  92. data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +134 -56
  93. data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +18 -11
  94. data/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +562 -2
  95. data/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +13 -0
  96. data/frameworks/sproutcore/frameworks/desktop/views/progress.js +11 -8
  97. data/frameworks/sproutcore/frameworks/desktop/views/radio.js +7 -7
  98. data/frameworks/sproutcore/frameworks/desktop/views/scroll.js +99 -33
  99. data/frameworks/sproutcore/frameworks/desktop/views/scroller.js +3 -7
  100. data/frameworks/sproutcore/frameworks/desktop/views/segmented.js +0 -7
  101. data/frameworks/sproutcore/frameworks/desktop/views/separator.js +2 -3
  102. data/frameworks/sproutcore/frameworks/desktop/views/slider.js +0 -8
  103. data/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +1 -1
  104. data/frameworks/sproutcore/frameworks/desktop/views/split.js +27 -7
  105. data/frameworks/sproutcore/frameworks/desktop/views/tab.js +2 -6
  106. data/frameworks/sproutcore/frameworks/foundation/controllers/array.js +15 -10
  107. data/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +20 -1
  108. data/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +1 -1
  109. data/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +3 -6
  110. data/frameworks/sproutcore/frameworks/foundation/english.lproj/button_view.css +3 -0
  111. data/frameworks/sproutcore/frameworks/foundation/english.lproj/core.css +8 -0
  112. data/frameworks/sproutcore/frameworks/foundation/english.lproj/inline_editor.css +12 -0
  113. data/frameworks/sproutcore/frameworks/foundation/english.lproj/label.css +11 -0
  114. data/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +13 -0
  115. data/frameworks/sproutcore/frameworks/foundation/mixins/button.js +1 -2
  116. data/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +70 -21
  117. data/frameworks/sproutcore/frameworks/foundation/mixins/selection_support.js +88 -54
  118. data/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +0 -25
  119. data/frameworks/sproutcore/frameworks/foundation/mixins/string.js +23 -2
  120. data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +34 -23
  121. data/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +20 -0
  122. data/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +32 -23
  123. data/frameworks/sproutcore/frameworks/foundation/system/browser.js +2 -2
  124. data/frameworks/sproutcore/frameworks/foundation/system/bundle.js +77 -15
  125. data/frameworks/sproutcore/frameworks/foundation/system/core_query.js +5 -4
  126. data/frameworks/sproutcore/frameworks/foundation/system/cursor.js +1 -1
  127. data/frameworks/sproutcore/frameworks/foundation/system/render_context.js +22 -7
  128. data/frameworks/sproutcore/frameworks/foundation/system/request.js +466 -309
  129. data/frameworks/sproutcore/frameworks/foundation/system/responder.js +2 -1
  130. data/frameworks/sproutcore/frameworks/foundation/system/response.js +457 -0
  131. data/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +66 -15
  132. data/frameworks/sproutcore/frameworks/foundation/system/routes.js +4 -4
  133. data/frameworks/sproutcore/frameworks/foundation/system/timer.js +6 -4
  134. data/frameworks/sproutcore/frameworks/foundation/system/utils.js +46 -8
  135. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/array_case.js +17 -0
  136. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/enum_case.js +18 -5
  137. data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/null_case.js +1 -1
  138. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +0 -2
  139. data/frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js +11 -0
  140. data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/group_case.js +14 -14
  141. data/frameworks/sproutcore/frameworks/foundation/tests/system/builder.js +2 -2
  142. data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_core.js +15 -3
  143. data/frameworks/sproutcore/frameworks/foundation/tests/system/datetime.js +1 -1
  144. data/frameworks/sproutcore/frameworks/foundation/tests/system/locale.js +8 -7
  145. data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/tag.js +3 -2
  146. data/frameworks/sproutcore/frameworks/foundation/tests/system/request.js +51 -44
  147. data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/targetForAction.js +2 -2
  148. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/isPaused.js +4 -4
  149. data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/performAction.js +2 -0
  150. data/frameworks/sproutcore/frameworks/foundation/tests/validators/credit_card.js +9 -9
  151. data/frameworks/sproutcore/frameworks/foundation/tests/validators/number.js +2 -2
  152. data/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +3 -3
  153. data/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +10 -3
  154. data/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +2 -2
  155. data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/append_remove.js +14 -0
  156. data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +5 -5
  157. data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +1 -11
  158. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/clippingFrame.js +2 -2
  159. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/destroyLayer.js +2 -4
  160. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/findLayerInParentLayer.js +2 -4
  161. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/insertBefore.js +1 -1
  162. data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutStyle.js +0 -2
  163. data/frameworks/sproutcore/frameworks/foundation/validators/password.js +5 -5
  164. data/frameworks/sproutcore/frameworks/foundation/validators/validator.js +4 -2
  165. data/frameworks/sproutcore/frameworks/foundation/views/field.js +5 -8
  166. data/frameworks/sproutcore/frameworks/foundation/views/label.js +21 -5
  167. data/frameworks/sproutcore/frameworks/foundation/views/text_field.js +112 -69
  168. data/frameworks/sproutcore/frameworks/foundation/views/view.js +67 -6
  169. data/frameworks/sproutcore/frameworks/runtime/core.js +51 -2
  170. data/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +4 -1
  171. data/frameworks/sproutcore/frameworks/runtime/system/binding.js +2 -1
  172. data/frameworks/sproutcore/frameworks/runtime/system/enumerator.js +5 -4
  173. data/frameworks/sproutcore/frameworks/runtime/system/index_set.js +6 -1
  174. data/frameworks/sproutcore/frameworks/runtime/system/logger.js +408 -0
  175. data/frameworks/sproutcore/frameworks/runtime/system/object.js +15 -4
  176. data/frameworks/sproutcore/frameworks/runtime/system/selection_set.js +30 -2
  177. data/frameworks/sproutcore/frameworks/runtime/tests/core/IsEqual.js +5 -1
  178. data/frameworks/sproutcore/frameworks/runtime/tests/core/beget.js +1 -1
  179. data/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js +3 -3
  180. data/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +2 -0
  181. data/frameworks/sproutcore/frameworks/runtime/tests/core/isArray.js +1 -1
  182. data/frameworks/sproutcore/frameworks/runtime/tests/core/itemType.js +2 -1
  183. data/frameworks/sproutcore/frameworks/runtime/tests/core/tupleForPropertyPath.js +2 -2
  184. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +1 -1
  185. data/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +1 -0
  186. data/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +11 -7
  187. data/frameworks/sproutcore/frameworks/runtime/tests/system/error.js +3 -2
  188. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +18 -1
  189. data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/remove.js +1 -1
  190. data/frameworks/sproutcore/frameworks/runtime/tests/system/logger.js +165 -0
  191. data/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +3 -0
  192. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/copy.js +1 -1
  193. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/indexSetForSource.js +13 -0
  194. data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/remove.js +24 -0
  195. data/frameworks/sproutcore/frameworks/runtime/tests/system/sparse_array.js +32 -13
  196. data/frameworks/sproutcore/frameworks/testing/english.lproj/runner.css +2 -2
  197. data/frameworks/sproutcore/frameworks/testing/english.lproj/testsuite.css +7 -2
  198. data/frameworks/sproutcore/lib/index.rhtml +6 -20
  199. data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x.psd +0 -0
  200. data/frameworks/sproutcore/themes/standard_theme/english.lproj/button.css +0 -1
  201. data/frameworks/sproutcore/themes/standard_theme/english.lproj/checkbox.css +5 -4
  202. data/frameworks/sproutcore/themes/standard_theme/english.lproj/collection.css +4 -3
  203. data/frameworks/sproutcore/themes/standard_theme/english.lproj/disclosure.css +7 -7
  204. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-repeat-x.png +0 -0
  205. data/frameworks/sproutcore/themes/standard_theme/english.lproj/list_item.css +38 -0
  206. data/frameworks/sproutcore/themes/standard_theme/english.lproj/menu.css +20 -0
  207. data/frameworks/sproutcore/themes/standard_theme/english.lproj/progress.css +1 -0
  208. data/frameworks/sproutcore/themes/standard_theme/english.lproj/radio.css +3 -1
  209. data/frameworks/sproutcore/themes/standard_theme/english.lproj/segmented.css +1 -0
  210. data/frameworks/sproutcore/themes/standard_theme/english.lproj/split_view.css +1 -1
  211. data/frameworks/sproutcore/themes/standard_theme/english.lproj/text_field.css +0 -15
  212. data/gen/data-source/Buildfile +18 -0
  213. data/gen/data-source/README +1 -0
  214. data/gen/data-source/USAGE +15 -0
  215. data/gen/data-source/templates/data_sources/@filename@.js +64 -0
  216. data/lib/sproutcore/builders/combine.rb +23 -0
  217. data/lib/sproutcore/builders/javascript.rb +27 -2
  218. data/lib/sproutcore/buildfile/task.rb +1 -1
  219. data/lib/sproutcore/helpers/entry_sorter.rb +2 -2
  220. data/lib/sproutcore/helpers/static_helper.rb +79 -0
  221. data/lib/sproutcore/models/manifest.rb +2 -2
  222. data/lib/sproutcore/models/target.rb +1 -1
  223. data/lib/sproutcore/tools/build.rb +1 -1
  224. data/lib/sproutcore/tools/docs.rb +3 -3
  225. data/lib/sproutcore/tools/gen.rb +17 -15
  226. data/lib/sproutcore/tools/manifest.rb +9 -9
  227. data/lib/sproutcore/tools/server.rb +3 -3
  228. data/lib/sproutcore/tools.rb +259 -250
  229. data/lib/sproutcore.rb +9 -1
  230. data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +2 -2
  231. data/spec/fixtures/entry_for_project/frameworks/unrelated/PLACEHOLDER +0 -0
  232. data/spec/fixtures/ordered_entries/apps/no_requires/{lproj → english.lproj}/strings.js +0 -0
  233. data/spec/fixtures/ordered_entries/apps/no_requires/main.js +1 -0
  234. data/spec/fixtures/ordered_entries/apps/no_requires/resources/main_page.js +1 -0
  235. data/spec/fixtures/ordered_entries/apps/no_requires/t.js +1 -0
  236. data/spec/lib/models/manifest/find_entry.rb +12 -0
  237. data/spec/lib/tools/gen_spec.rb +1 -0
  238. data/spec/lib/tools/tools_spec.rb +1 -0
  239. data/sproutcore-abbot.gemspec +36 -44
  240. metadata +43 -44
  241. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/indicator.gif +0 -0
  242. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sc-theme-sprite.png +0 -0
  243. data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/sticky-note.png +0 -0
  244. data/frameworks/sproutcore/frameworks/desktop/views/form.js +0 -594
  245. data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-sprite.png +0 -0
  246. data/lib/thor/CHANGELOG.rdoc +0 -52
  247. data/lib/thor/LICENSE +0 -20
  248. data/lib/thor/README.markdown +0 -76
  249. data/lib/thor/Rakefile +0 -6
  250. data/lib/thor/Thorfile +0 -45
  251. data/lib/thor/bin/rake2thor +0 -83
  252. data/lib/thor/bin/thor +0 -7
  253. data/lib/thor/lib/thor/error.rb +0 -3
  254. data/lib/thor/lib/thor/options.rb +0 -267
  255. data/lib/thor/lib/thor/ordered_hash.rb +0 -64
  256. data/lib/thor/lib/thor/runner.rb +0 -305
  257. data/lib/thor/lib/thor/task.rb +0 -83
  258. data/lib/thor/lib/thor/task_hash.rb +0 -22
  259. data/lib/thor/lib/thor/tasks/package.rb +0 -18
  260. data/lib/thor/lib/thor/tasks.rb +0 -77
  261. data/lib/thor/lib/thor/util.rb +0 -75
  262. data/lib/thor/lib/thor.rb +0 -170
  263. data/lib/thor/script/destroy +0 -14
  264. data/lib/thor/script/generate +0 -14
  265. data/lib/thor/spec/fixtures/task.thor +0 -10
  266. data/lib/thor/spec/options_spec.rb +0 -271
  267. data/lib/thor/spec/ordered_hash_spec.rb +0 -84
  268. data/lib/thor/spec/spec.opts +0 -1
  269. data/lib/thor/spec/spec_helper.rb +0 -30
  270. data/lib/thor/spec/task_spec.rb +0 -11
  271. data/lib/thor/spec/tasks_spec.rb +0 -28
  272. data/lib/thor/spec/thor_runner_spec.rb +0 -194
  273. data/lib/thor/spec/thor_spec.rb +0 -206
  274. data/lib/thor/spec/util_spec.rb +0 -99
  275. data/lib/thor/task.thor +0 -15
  276. data/lib/thor/thor.gemspec +0 -29
@@ -6,15 +6,575 @@
6
6
  // ==========================================================================
7
7
 
8
8
  sc_require('views/scroll');
9
- sc_require('mixins/border');
10
9
 
11
10
  /** @class
12
11
 
12
+ Implements a complete scroller view for menus. This class implements the
13
+ arrows displayed in a menu to scroll.
13
14
 
14
- @extends SC.View
15
+ The main difference with SC.ScrollerView is that there is only vertical
16
+ scrollers. Value Syncing between SC.MenuScrollView and SC.MenuScrollerView
17
+ is done using valueBinding.
18
+
19
+ @extends SC.ScrollerView
20
+ @since SproutCore 1.0
21
+ */
22
+
23
+ SC.MenuScrollerView = SC.ScrollerView.extend({
24
+ classNames: ['sc-menu-scroller-view'],
25
+
26
+ // ..........................................................
27
+ // PROPERTIES
28
+ //
29
+
30
+ /**
31
+ Used to set the scrolling direction of the scroller.
32
+ */
33
+ scrollDown: NO,
34
+
35
+ /**
36
+ The scroller offset value. This value will adjust between the minimum
37
+ and maximum values that you set. Default is 0.
38
+
39
+ @property
40
+ */
41
+ value: function(key, val) {
42
+ if (val !== undefined) {
43
+ // Don't enforce the maximum now, because the scroll view could change
44
+ // height and we want our content to stay put when it does.
45
+ this._value = val ;
46
+ } else {
47
+ var value = this._value || 0 ; // default value is at top/left
48
+ return Math.min(value, this.get('maximum')) ;
49
+ }
50
+ }.property('maximum').cacheable(),
51
+
52
+ /**
53
+ The maximum offset value for the scroller. This will be used to calculate
54
+ the internal height/width of the scroller itself. It is not necessarily
55
+ the same as the height of a scroll view's content view.
56
+
57
+ When set less than the height of the scroller, the scroller is disabled.
58
+
59
+ @property {Number}
60
+ */
61
+ maximum: 0,
62
+
63
+ /**
64
+ YES if enable scrollbar, NO to disable it. Scrollbars will automatically
65
+ disable if the maximum scroll width does not exceed their capacity.
66
+
67
+ @property
68
+ */
69
+ isEnabled: YES,
70
+
71
+ /**
72
+ Determine the layout direction. Determines whether the scrollbar should
73
+ appear horizontal or vertical. This must be set when the view is created.
74
+ Changing this once the view has been created will have no effect.
75
+
76
+ @property
77
+ */
78
+ layoutDirection: SC.LAYOUT_VERTICAL,
79
+
80
+ /**
81
+ Amount to scroll one vertical line.
82
+ Defaults to 20px.
83
+ */
84
+ verticalLineScroll: 20,
85
+
86
+ /**
87
+ This function overrides the default function in SC.Scroller as
88
+ menus only have vertical scrolling.
89
+
90
+ @property {String}
91
+ */
92
+ ownerScrollValueKey: function() {
93
+ return 'verticalScrollOffset' ;
94
+ }.property('layoutDirection').cacheable(),
95
+
96
+ // ..........................................................
97
+ // INTERNAL SUPPORT
98
+ //
99
+
100
+ render: function(context, firstTime) {
101
+ context.addClass('sc-vertical') ;
102
+ if (firstTime) {
103
+ if(this.get('scrollDown')){
104
+ context.push('<span class="arrowDown">&nbsp;</span>') ;
105
+ }else{
106
+ context.push('<span class="arrowUp">&nbsp;</span>') ;
107
+ }
108
+ }
109
+ context.setClass('disabled', !this.get('isEnabled')) ;
110
+ },
111
+
112
+ didCreateLayer: function() {
113
+ var callback, amt, layer;
114
+
115
+ callback = this._sc_scroller_scrollDidChange ;
116
+ SC.Event.add(this.$(), 'scroll', this, callback) ;
117
+
118
+ // set scrollOffset first time
119
+ amt = this.get('value') ;
120
+ layer = this.get('layer') ;
121
+
122
+ layer.scrollTop = amt ;
123
+ },
124
+
125
+ willDestroyLayer: function() {
126
+ var callback = this._sc_scroller_scrollDidChange ;
127
+ SC.Event.remove(this.$(), 'scroll', this, callback) ;
128
+ },
129
+
130
+ mouseEntered: function(evt) {
131
+ this.set('isMouseOver', YES);
132
+ this._invokeScrollOnMouseOver();
133
+ },
134
+
135
+ mouseExited: function(evt) {
136
+ this.set('isMouseOver', NO);
137
+ },
138
+
139
+ /** @private */
140
+
141
+ /**
142
+ This function overrides the default function in SC.Scroller.
143
+ SC.MenuScroller and SC.MenuScroll use valueBinding so this function is
144
+ not neccesary.
145
+ */
146
+ _sc_scroller_valueDidChange: function() {
147
+
148
+ }.observes('value'),
149
+
150
+
151
+ // after 50msec, fire event again
152
+ _sc_scroller_armScrollTimer: function() {
153
+ if (!this._sc_scrollTimer) {
154
+ SC.RunLoop.begin() ;
155
+ var method = this._sc_scroller_scrollDidChange ;
156
+ this._sc_scrollTimer = this.invokeLater(method, 50) ;
157
+ SC.RunLoop.end() ;
158
+ }
159
+ },
160
+
161
+ _sc_scroller_scrollDidChange: function() {
162
+ var now = Date.now(),
163
+ last = this._sc_lastScroll,
164
+ layer = this.get('layer'),
165
+ scroll = 0 ;
166
+
167
+ if (last && (now-last)<50) return this._sc_scroller_armScrollTimer() ;
168
+ this._sc_scrollTimer = null ;
169
+ this._sc_lastScroll = now ;
170
+
171
+ SC.RunLoop.begin();
172
+
173
+ if (!this.get('isEnabled')) return ; // nothing to do.
174
+
175
+ this._sc_scrollValue = scroll = layer.scrollTop ;
176
+ this.set('value', scroll) ; // will now enforce minimum and maximum
177
+
178
+ SC.RunLoop.end();
179
+ },
180
+
181
+
182
+ /**
183
+ Scroll the menu if it is is an up or down arrow. This is called by
184
+ the function that simulates mouseOver.
185
+ */
186
+ _scrollMenu: function(){
187
+ var val = this.get('value'), newval;
188
+ if(this.get('scrollDown')) {
189
+ newval = val+this.verticalLineScroll;
190
+ if(newval<=this.get('maximum')){
191
+ this.set('value', newval);
192
+ }
193
+ }
194
+ else {
195
+ newval = val-this.verticalLineScroll;
196
+ if(newval>=0){
197
+ this.set('value', newval);
198
+ }else if(val<=this.verticalLineScroll && val>0){
199
+ this.set('value', 0);
200
+ }
201
+ }
202
+ return YES;
203
+ },
204
+
205
+ /**
206
+ We use this function to simulate mouseOver. It checks for the flag
207
+ isMouseOver which is turned on when mouseEntered is called and turned off
208
+ when mouseExited is called.
209
+ */
210
+ _invokeScrollOnMouseOver: function(){
211
+ this._scrollMenu();
212
+ if(this.get('isMouseOver')){
213
+ this.invokeLater(this._invokeScrollOnMouseOver, 50);
214
+ }
215
+ }
216
+
217
+ });
218
+
219
+ /** @class
220
+
221
+ Implements a scroll view for menus. This class extends SC.ScrollView for
222
+ menus.
223
+
224
+ The main difference with SC.ScrollView is that there is only vertical
225
+ scrolling. Value Syncing between SC.MenuScrollView and SC.MenuScrollerView
226
+ is done using valueBinding.
227
+
228
+ @extends SC.ScrollView
15
229
  @since SproutCore 1.0
16
230
  */
17
231
  SC.MenuScrollView = SC.ScrollView.extend({
18
232
 
233
+ classNames: ['sc-menu-scroll-view'],
234
+
235
+ // ..........................................................
236
+ // PROPERTIES
237
+ //
238
+
239
+
240
+ /**
241
+ The maximum horizontal scroll offset allowed given the current contentView
242
+ size and the size of the scroll view. If horizontal scrolling is
243
+ disabled, this will always return 0.
244
+
245
+ @property {Number}
246
+ */
247
+ maximumHorizontalScrollOffset: function() {
248
+ }.property(),
249
+
250
+
251
+ // ..........................................................
252
+ // SCROLLERS
253
+ //
254
+
255
+ /**
256
+ YES if the view should maintain a horizontal scroller. This property
257
+ must be set when the view is created.
258
+
259
+ @property {Boolean}
260
+ */
261
+ hasHorizontalScroller: NO,
262
+
263
+ /**
264
+ The horizontal scroller view class. This will be replaced with a view
265
+ instance when the ScrollView is created unless hasHorizontalScroller is
266
+ NO.
267
+
268
+ @property {SC.View}
269
+ */
270
+ horizontalScrollerView: SC.MenuScrollerView,
271
+
272
+ /**
273
+ YES if the horizontal scroller should be visible. You can change this
274
+ property value anytime to show or hide the horizontal scroller. If you
275
+ do not want to use a horizontal scroller at all, you should instead set
276
+ hasHorizontalScroller to NO to avoid creating a scroller view in the
277
+ first place.
278
+
279
+ @property {Boolean}
280
+ */
281
+ isHorizontalScrollerVisible: NO,
282
+
283
+ /**
284
+ Returns YES if the view both has a horizontal scroller, the scroller is
285
+ visible.
286
+
287
+ @property {Boolean}
288
+ */
289
+ canScrollHorizontal: function() {
290
+ return false;
291
+ }.property('isHorizontalScrollerVisible').cacheable(),
292
+
293
+ /**
294
+ If YES, the horizontal scroller will autohide if the contentView is
295
+ smaller than the visible area. You must set hasHorizontalScroller to YES
296
+ for this property to have any effect.
297
+ */
298
+ autohidesHorizontalScroller: NO,
299
+
300
+ /**
301
+ YES if the view shuld maintain a vertical scroller. This property must
302
+ be set when the view is created.
303
+
304
+ @property {Boolean}
305
+ */
306
+ hasVerticalScroller: YES,
307
+
308
+ /**
309
+ The vertical scroller view class. This will be replaced with a view
310
+ instance when the ScrollView is created unless hasVerticalScroller is NO.
311
+
312
+ @property {SC.View}
313
+ */
314
+ verticalScrollerView: SC.MenuScrollerView,
315
+ verticalScrollerView2: SC.MenuScrollerView,
316
+
317
+ /**
318
+ YES if the vertical scroller should be visible. For SC.MenuScroll the
319
+ vertical scroller is always there we just hide the arrows to scroll.
320
+
321
+ @property {Boolean}
322
+ */
323
+ isVerticalScrollerVisible: YES,
324
+
325
+
326
+ canScrollVertical: function() {
327
+ return YES;
328
+ }.property('isVerticalScrollerVisible').cacheable(),
329
+
330
+ /**
331
+ If YES, the vertical scroller will autohide if the contentView is
332
+ smaller than the visible area. You must set hasVerticalScroller to YES
333
+ for this property to have any effect.
334
+ */
335
+ autohidesVerticalScroller: YES,
336
+
337
+ /**
338
+ Use this property to set the 'bottom' offset of your vertical scroller,
339
+ to make room for a thumb view or other accessory view. Default is 0.
340
+
341
+ @property {Number}
342
+ */
343
+ verticalScrollerBottom: 0,
344
+
345
+
346
+ // ..........................................................
347
+ // CUSTOM VIEWS
348
+ //
349
+
350
+ /**
351
+ The container view that will contain your main content view. You can
352
+ replace this property with your own custom subclass if you prefer.
353
+
354
+ @type {SC.ContainerView}
355
+ */
356
+ containerView: SC.ContainerView,
357
+
358
+ // ..........................................................
359
+ // METHODS
360
+ //
361
+
362
+
363
+ /**
364
+ Adjusts the layout for the various internal views. This method is called
365
+ once when the scroll view is first configured and then anytime a scroller
366
+ is shown or hidden. You can call this method yourself as well to retile.
367
+
368
+ You may also want to override this method to handle layout for any
369
+ additional controls you have added to the view.
370
+ */
371
+ tile: function() {
372
+ // get vertical scroller/determine if we should have a scroller
373
+ var hasScroller, vscroll, vscroll2, hasVertical, clip, clipLayout, viewportHeight;
374
+ hasScroller = this.get('hasVerticalScroller');
375
+ vscroll = hasScroller ? this.get('verticalScrollerView') : null ;
376
+ vscroll2 = hasScroller ? this.get('verticalScrollerView2') : null ;
377
+ hasVertical = vscroll && this.get('isVerticalScrollerVisible') ;
378
+
379
+ // get the containerView
380
+ clip = this.get('containerView') ;
381
+ clipLayout = { left: 0, top: 0 } ;
382
+
383
+ if (hasVertical) {
384
+ viewportHeight =0;
385
+ var view = this.get('contentView'), view2,
386
+ f = (view) ? view.get('frame') : null,
387
+ height = (f) ? f.height : 0,
388
+ elem = this.containerView.$()[0],
389
+ verticalOffset = this.get('verticalScrollOffset'),
390
+ topArrowInvisible = { height: 0, top: 0, right: 0, left: 0 },
391
+ topArrowVisible = { height: this.verticalLineScroll, top: 0, right: 0, left: 0 },
392
+ bottomArrowVisible = { height: this.verticalLineScroll, bottom: 0, right: 0, left: 0 },
393
+ bottomArrowInvisible = { height: 0, bottom: 0, right: 0, left: 0 };
394
+
395
+ if(elem) viewportHeight = elem.offsetHeight;
396
+
397
+ if(verticalOffset===0){
398
+ clipLayout.top = 0 ;
399
+ clipLayout.bottom = this.verticalLineScroll;
400
+ vscroll.set('layout', topArrowInvisible) ;
401
+ vscroll2.set('layout', bottomArrowVisible) ;
402
+ }else if(verticalOffset>=(height-viewportHeight-this.verticalLineScroll)){
403
+ clipLayout.top = this.verticalLineScroll ;
404
+ clipLayout.bottom = 0 ;
405
+ vscroll.set('layout', topArrowVisible) ;
406
+ vscroll2.set('layout', bottomArrowInvisible) ;
407
+ }else{
408
+ clipLayout.top = this.verticalLineScroll ;
409
+ clipLayout.bottom = this.verticalLineScroll ;
410
+ vscroll.set('layout', topArrowVisible) ;
411
+ vscroll2.set('layout', bottomArrowVisible) ;
412
+ }
413
+ }
414
+ if (vscroll){
415
+ vscroll.set('isVisible', hasVertical) ;
416
+ vscroll2.set('isVisible', hasVertical) ;
417
+ }
418
+ clip.set('layout', clipLayout) ;
419
+ },
420
+
421
+ /** @private
422
+ Called whenever a scroller visibility changes. Calls the tile() method.
423
+ */
424
+ scrollerVisibilityDidChange: function() {
425
+ this.tile();
426
+ }.observes('isVerticalScrollerVisible', 'isHorizontalScrollerVisible', 'verticalScrollOffset'),
427
+
428
+
429
+ // ..........................................................
430
+ // INTERNAL SUPPORT
431
+ //
432
+
433
+ /** @private
434
+ Instantiate scrollers & container views as needed. Replace their classes
435
+ in the regular properties.
436
+ */
437
+ createChildViews: function() {
438
+ var childViews = [], view, view2 ;
439
+
440
+ // create the containerView. We must always have a container view.
441
+ // also, setup the contentView as the child of the containerView...
442
+ if (SC.none(view = this.containerView)) view = SC.ContainerView;
443
+
444
+ childViews.push(this.containerView = this.createChildView(view, {
445
+ contentView: this.contentView
446
+ }));
447
+
448
+ // and replace our own contentView...
449
+ this.contentView = this.containerView.get('contentView');
450
+
451
+ // create a vertical scroller
452
+ if ((view=this.verticalScrollerView) && (view2=this.verticalScrollerView2)) {
453
+ if (this.get('hasVerticalScroller')) {
454
+ view = this.verticalScrollerView = this.createChildView(view, {
455
+ layout: {top: 0, left: 0, right: 0, height: this.verticalLineScroll},
456
+ valueBinding: '*owner.verticalScrollOffset'
457
+ }) ;
458
+ childViews.push(view);
459
+ view2 = this.verticalScrollerView2 = this.createChildView(view2, {
460
+ scrollDown: YES,
461
+ layout: {bottom: 0, left: 0, right: 0, height: this.verticalLineScroll},
462
+ valueBinding: '*owner.verticalScrollOffset'
463
+ }) ;
464
+ childViews.push(view2);
465
+ } else {
466
+ this.verticalScrollerView = null ;
467
+ this.verticalScrollerView2 = null ;
468
+ }
469
+ }
470
+
471
+ // set childViews array.
472
+ this.childViews = childViews ;
473
+
474
+ this.contentViewFrameDidChange() ; // setup initial display...
475
+ this.tile() ; // set up initial tiling
476
+ },
477
+
478
+ init: function() {
479
+ sc_super();
480
+
481
+ // start observing initial content view. The content view's frame has
482
+ // already been setup in prepareDisplay so we don't need to call
483
+ // viewFrameDidChange...
484
+ this._scroll_contentView = this.get('contentView') ;
485
+ var contentView = this._scroll_contentView ;
486
+
487
+ if (contentView) {
488
+ contentView.addObserver('frame', this, this.contentViewFrameDidChange) ;
489
+ }
490
+
491
+ if (this.get('isVisibleInWindow')) this._scsv_registerAutoscroll() ;
492
+ },
493
+
494
+ /** @private Registers/deregisters view with SC.Drag for autoscrolling */
495
+ _scsv_registerAutoscroll: function() {
496
+ if (this.get('isVisibleInWindow')) SC.Drag.addScrollableView(this);
497
+ else SC.Drag.removeScrollableView(this);
498
+ }.observes('isVisibleInWindow'),
499
+
500
+ /** @private
501
+ Whenever the contentView is changed, we need to observe the content view's
502
+ frame to be notified whenever it's size changes.
503
+ */
504
+ contentViewDidChange: function() {
505
+ var newView = this.get('contentView'),
506
+ oldView = this._scroll_contentView,
507
+ f = this.contentViewFrameDidChange ;
508
+
509
+ if (newView !== oldView) {
510
+
511
+ // stop observing old content view
512
+ if (oldView) oldView.removeObserver('frame', this, f);
513
+
514
+ // update cache
515
+ this._scroll_contentView = newView;
516
+ if (newView) newView.addObserver('frame', this, f);
517
+
518
+ // replace container
519
+ this.containerView.set('content', newView);
520
+
521
+ this.contentViewFrameDidChange();
522
+ }
523
+ }.observes('contentView'),
524
+
525
+ /** @private
526
+ Invoked whenever the contentView's frame changes. This will update the
527
+ scroller maxmimum and optionally update the scroller visibility if the
528
+ size of the contentView changes. We don't care about the origin since
529
+ that is tracked separately from the offset values.
530
+ */
531
+ contentViewFrameDidChange: function() {
532
+ var view = this.get('contentView'), view2,
533
+ f = (view) ? view.get('frame') : null,
534
+ width = (f) ? f.width : 0,
535
+ height = (f) ? f.height : 0,
536
+ dim = this.get('frame'),
537
+ viewportHeight, elem ;
538
+
539
+ // cache out scroll settings...
540
+ //if ((width === this._scroll_contentWidth) && (height === this._scroll_contentHeight)) return ;
541
+ this._scroll_contentWidth = width;
542
+ this._scroll_contentHeight = height ;
543
+
544
+ if (this.get('hasVerticalScroller') && (view = this.get('verticalScrollerView')) && (view2 = this.get('verticalScrollerView2'))) {
545
+ height -= 1 ; // accurately account for our layout
546
+ // decide if it should be visible or not
547
+ if (this.get('autohidesVerticalScroller')) {
548
+ this.set('isVerticalScrollerVisible', height > dim.height);
549
+ }
550
+ height -= this.get('verticalScrollerBottom') ;
551
+ viewportHeight = 0;
552
+ elem = this.containerView.$()[0];
553
+ if(elem) viewportHeight = elem.offsetHeight;
554
+ height = height - viewportHeight;
555
+ view.setIfChanged('maximum', height) ;
556
+ view2.setIfChanged('maximum', height) ;
557
+ }
558
+ },
559
+
560
+ /** @private
561
+ Whenever the horizontal scroll offset changes, update the scrollers and
562
+ edit the location of the contentView.
563
+ */
564
+ _scroll_horizontalScrollOffsetDidChange: function() {
565
+ }.observes('horizontalScrollOffset'),
566
+
567
+ /** @private
568
+ Whenever the vertical scroll offset changes, update the scrollers and
569
+ edit the location of the contentView.
570
+ */
571
+ _scroll_verticalScrollOffsetDidChange: function() {
572
+ var offset = this.get('verticalScrollOffset') ;
573
+
574
+ // update the offset for the contentView...
575
+ var contentView = this.get('contentView');
576
+ if (contentView) contentView.adjust('top', 0-offset) ;
577
+
578
+ }.observes('verticalScrollOffset')
19
579
 
20
580
  });
@@ -63,6 +63,19 @@ SC.PopupButtonView = SC.ButtonView.extend({
63
63
  if (!menu) return NO ;
64
64
  menu.popup(this, this.preferMatrix) ;
65
65
  return YES;
66
+ },
67
+
68
+ /**
69
+ @private
70
+
71
+ Holding down the button should display the menu pane.
72
+ */
73
+ mouseDown: function(evt) {
74
+ if (!this.get('isEnabled')) return YES ; // handled event, but do nothing
75
+ this.set('isActive', YES);
76
+ this._isMouseDown = YES;
77
+ this._action() ;
78
+ return YES ;
66
79
  }
67
80
 
68
81
  });
@@ -155,7 +155,7 @@ SC.ProgressView = SC.View.extend(SC.Control, {
155
155
  displayProperties: 'value minimum maximum isIndeterminate'.w(),
156
156
 
157
157
  render: function(context, firstTime) {
158
-
158
+ var inner, animatedBackground;
159
159
  var isIndeterminate = this.get('isIndeterminate');
160
160
  var isRunning = this.get('isRunning');
161
161
  var isEnabled = this.get('isEnabled');
@@ -197,14 +197,17 @@ SC.ProgressView = SC.View.extend(SC.Control, {
197
197
  }
198
198
  else {
199
199
  context.setClass(classNames);
200
- this.$('.sc-inner').css('width', value).css('left',offset);
201
- if (this.get('animatedBackgroundMatrix').length === 3 ) {
202
- this.$('.sc-inner').css('backgroundPosition', '0px -'+
203
- (this.get('animatedBackgroundMatrix')[0] +
204
- this.get('animatedBackgroundMatrix')[1]*this._currentBackground)+'px');
205
- if(this._currentBackground===this.get('animatedBackgroundMatrix')[2]-1
206
- || this._currentBackground===0)
200
+ inner = this.$('.sc-inner');
201
+ animatedBackground = this.get('animatedBackgroundMatrix');
202
+ inner.css('width', value).css('left',offset);
203
+ if (animatedBackground.length === 3 ) {
204
+ inner.css('backgroundPosition', '0px -'+
205
+ (animatedBackground[0] +
206
+ animatedBackground[1]*this._currentBackground)+'px');
207
+ if(this._currentBackground===animatedBackground[2]-1
208
+ || this._currentBackground===0){
207
209
  this._nextBackground *= -1;
210
+ }
208
211
  this._currentBackground += this._nextBackground;
209
212
  }
210
213
  }
@@ -118,8 +118,7 @@ SC.RadioView = SC.FieldView.extend(
118
118
  titleKey = this.get('itemTitleKey'), valueKey = this.get('itemValueKey'),
119
119
  isEnabledKey = this.get('itemIsEnabledKey'),
120
120
  iconKey = this.get('itemIconKey');
121
-
122
- var ret = [], max = (items)? items.length : 0 ;
121
+ var ret = [], max = (items)? items.get('length') : 0 ;
123
122
  var item, title, value, idx, isArray, isEnabled, icon;
124
123
 
125
124
  for(idx=0;idx<max;idx++) {
@@ -241,7 +240,7 @@ SC.RadioView = SC.FieldView.extend(
241
240
  input = this.$(input);
242
241
  idx = parseInt(input.val(),0);
243
242
  item = (idx>=0) ? items[idx] : null;
244
-
243
+
245
244
  input.attr('disabled', (!item[2]) ? 'disabled' : null);
246
245
  selectionState = this._getSelectionState(item, value, isArray, true);
247
246
 
@@ -336,22 +335,23 @@ SC.RadioView = SC.FieldView.extend(
336
335
  didCreateLayer: function() {
337
336
  this.setFieldValue(this.get('fieldValue'));
338
337
  var inputElems=this.$input();
339
- for( var i=0; i<inputElems.length; i++){
338
+ for( var i=0, inputLen = inputElems.length; i<inputLen; i++){
340
339
  SC.Event.add(inputElems[i], 'click', this, this._field_fieldValueDidChange) ;
341
340
  }
342
341
  },
343
342
 
344
343
  willDestroyLayer: function() {
345
344
  var inputElems=this.$input();
346
- for( var i=0; i<inputElems.length; i++){
345
+ for( var i=0, inputLen = inputElems.length; i<inputLen; i++){
347
346
  SC.Event.remove(this.$input()[i], 'click', this, this._field_fieldValueDidChange);
348
347
  }
349
348
 
350
349
  },
351
350
 
352
351
  mouseDown: function(evt) {
353
- this.$input()[0].focus();
354
- sc_super();
352
+ this.set('isActive', YES);
353
+ this._field_isMouseDown = YES;
354
+ return YES;
355
355
  }
356
356
 
357
357
  });