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
@@ -51,11 +51,12 @@ module("SC.CollectionView Mouse Events", {
51
51
  @param {Number} index the index to click on
52
52
  @param {Boolean} shiftKey simulate shift key pressed
53
53
  @param {Boolean} ctrlKey simulate ctrlKey pressed
54
- @param {IndexSet} expected expected selection
54
+ @param {SC.SelectionSet} expected expected selection
55
+ @param {Number} delay delay before running the test (optional)
55
56
  @returns {void}
56
57
  */
57
58
  function clickOn(view, index, shiftKey, ctrlKey, expected, delay) {
58
- var itemView = view.getPath('childViews.%@'.fmt(index)),
59
+ var itemView = view.itemViewForContentIndex(index),
59
60
  layer = itemView.get('layer'),
60
61
  opts = { shiftKey: shiftKey, ctrlKey: ctrlKey },
61
62
  sel, ev, modifiers;
@@ -78,8 +79,6 @@ function clickOn(view, index, shiftKey, ctrlKey, expected, delay) {
78
79
  if (ctrlKey) modifiers.push('ctrl');
79
80
  modifiers = modifiers.length > 0 ? modifiers.join('+') : 'no modifiers';
80
81
 
81
- expected = SC.SelectionSet.create().add(view.get('content'), expected);
82
-
83
82
  ok(expected.isEqual(sel), 'should have selection: %@ after click with %@ on item[%@], actual: %@'.fmt(expected, modifiers, index, sel));
84
83
  SC.RunLoop.end();
85
84
  if (delay) window.start() ; // starts the test runner
@@ -94,24 +93,50 @@ function clickOn(view, index, shiftKey, ctrlKey, expected, delay) {
94
93
  layer = itemView = null ;
95
94
  }
96
95
 
96
+ /*
97
+ Creates an SC.SelectionSet from a given index.
98
+
99
+ @param {Number} index the index of the content to select
100
+ @returns {SC.SelectionSet}
101
+ */
102
+
103
+ function selectionFromIndex(index) {
104
+ var ret = SC.SelectionSet.create();
105
+ ret.addObject(content.objectAt(index));
106
+
107
+ return ret;
108
+ }
109
+
110
+ /*
111
+ Creates an SC.SelectionSet from a given SC.IndexSet.
112
+
113
+ @param {Number} index the index of the content to select
114
+ @returns {SC.SelectionSet}
115
+ */
116
+ function selectionFromIndexSet(indexSet) {
117
+ var ret = SC.SelectionSet.create();
118
+ ret.add(content, indexSet);
119
+
120
+ return ret;
121
+ }
122
+
97
123
  // ..........................................................
98
124
  // basic click
99
125
  //
100
126
 
101
127
  test("clicking on an item should select it", function() {
102
- clickOn(view, 3, NO, NO, SC.IndexSet.create(3));
128
+ clickOn(view, 3, NO, NO, selectionFromIndex(3));
103
129
  });
104
130
 
105
131
  test("clicking on a selected item should clear selection after 301ms and reselect it", function() {
106
132
  view.select(SC.IndexSet.create(1,5));
107
133
  SC.RootResponder.responder._lastMouseUpAt = null ; // HACK: don't want a doubleClick from previous tests
108
- clickOn(view, 3, NO, NO, SC.IndexSet.create(3), 301);
134
+ clickOn(view, 3, NO, NO, selectionFromIndex(3), 301);
109
135
  });
110
136
 
111
137
  test("clicking on unselected item should clear selection and select it", function() {
112
-
113
138
  view.select(SC.IndexSet.create(1,5));
114
- clickOn(view, 7, NO, NO, SC.IndexSet.create(7));
139
+ clickOn(view, 7, NO, NO, selectionFromIndex(7));
115
140
  });
116
141
 
117
142
  test("first responder", function() {
@@ -124,15 +149,15 @@ test("first responder", function() {
124
149
  //
125
150
 
126
151
  test("ctrl-clicking on unselected item should add to selection", function() {
127
- clickOn(view,3, NO, YES, SC.IndexSet.create(3));
128
- clickOn(view,5, NO, YES, SC.IndexSet.create(3).add(5));
152
+ clickOn(view,3, NO, YES, selectionFromIndex(3));
153
+ clickOn(view,5, NO, YES, selectionFromIndex(3).addObject(content.objectAt(5)));
129
154
  });
130
155
 
131
156
  test("ctrl-clicking on selected item should remove from selection", function() {
132
- clickOn(view,3, NO, YES, SC.IndexSet.create(3));
133
- clickOn(view,5, NO, YES, SC.IndexSet.create(3).add(5));
134
- clickOn(view,3, NO, YES, SC.IndexSet.create(5));
135
- clickOn(view,5, NO, YES, SC.IndexSet.create());
157
+ clickOn(view,3, NO, YES, selectionFromIndex(3));
158
+ clickOn(view,5, NO, YES, selectionFromIndex(3).addObject(content.objectAt(5)));
159
+ clickOn(view,3, NO, YES, selectionFromIndex(5));
160
+ clickOn(view,5, NO, YES, SC.SelectionSet.create());
136
161
  });
137
162
 
138
163
  // ..........................................................
@@ -140,35 +165,35 @@ test("ctrl-clicking on selected item should remove from selection", function() {
140
165
  //
141
166
 
142
167
  test("shift-clicking on an item below should extend the selection", function() {
143
- clickOn(view, 3, NO, NO, SC.IndexSet.create(3));
144
- clickOn(view, 5, YES, NO, SC.IndexSet.create(3,3));
168
+ clickOn(view, 3, NO, NO, selectionFromIndex(3));
169
+ clickOn(view, 5, YES, NO, selectionFromIndexSet(SC.IndexSet.create(3,3)));
145
170
  });
146
171
 
147
172
 
148
173
  test("shift-clicking on an item above should extend the selection", function() {
149
- clickOn(view, 3, NO, NO, SC.IndexSet.create(3));
150
- clickOn(view, 1, YES, NO, SC.IndexSet.create(1,3));
174
+ clickOn(view, 3, NO, NO, selectionFromIndex(3));
175
+ clickOn(view, 1, YES, NO, selectionFromIndexSet(SC.IndexSet.create(1,3)));
151
176
  });
152
177
 
153
178
  test("shift-clicking inside selection first time should reduce selection from top", function() {
154
179
  view.select(SC.IndexSet.create(3,4));
155
- clickOn(view,4, YES, NO, SC.IndexSet.create(3,2));
180
+ clickOn(view,4, YES, NO, selectionFromIndexSet(SC.IndexSet.create(3,2)));
156
181
  });
157
182
 
158
183
  test("shift-click below to extend selection down then shift-click inside selection should reduce selection", function() {
159
- clickOn(view, 3, NO, NO, SC.IndexSet.create(3));
160
- clickOn(view, 5, YES, NO, SC.IndexSet.create(3,3));
161
- clickOn(view,4, YES, NO, SC.IndexSet.create(3,2));
184
+ clickOn(view, 3, NO, NO, selectionFromIndex(3));
185
+ clickOn(view, 5, YES, NO, selectionFromIndexSet(SC.IndexSet.create(3,3)));
186
+ clickOn(view,4, YES, NO, selectionFromIndexSet(SC.IndexSet.create(3,2)));
162
187
  });
163
188
 
164
189
  test("shift-click above to extend selection down then shift-click inside selection should reduce top of selection", function() {
165
- clickOn(view, 3, NO, NO, SC.IndexSet.create(3));
166
- clickOn(view, 1, YES, NO, SC.IndexSet.create(1,3));
167
- clickOn(view,2, YES, NO, SC.IndexSet.create(2,2));
190
+ clickOn(view, 3, NO, NO, selectionFromIndex(3));
191
+ clickOn(view, 1, YES, NO, selectionFromIndexSet(SC.IndexSet.create(1,3)));
192
+ clickOn(view,2, YES, NO, selectionFromIndexSet(SC.IndexSet.create(2,2)));
168
193
  });
169
194
 
170
195
  test("shift-click below bottom of selection then shift click on top of selection should select only top item", function() {
171
- clickOn(view, 3, NO, NO, SC.IndexSet.create(3));
172
- clickOn(view, 5, YES, NO, SC.IndexSet.create(3,3));
173
- clickOn(view,3, YES, NO, SC.IndexSet.create(3));
196
+ clickOn(view, 3, NO, NO, selectionFromIndex(3));
197
+ clickOn(view, 5, YES, NO, selectionFromIndexSet(SC.IndexSet.create(3,3)));
198
+ clickOn(view,3, YES, NO, selectionFromIndex(3));
174
199
  });
@@ -30,16 +30,16 @@ test("calling select(indexes=Number)", function() {
30
30
 
31
31
  view.select(3);
32
32
 
33
- var expected = SC.SelectionSet.create().add(content, 3),
33
+ var expected = SC.SelectionSet.create().addObject(content.objectAt(3)),
34
34
  actual = view.get('selection');
35
- ok(expected.isEqual(actual), 'selection should have index only (expected: %@ actual: %@)'.fmt(expected, actual));
35
+ ok(expected.isEqual(actual), 'selection should have object (expected: %@ actual: %@)'.fmt(expected, actual));
36
36
  });
37
37
 
38
38
  test("calling select(indexes=Number, extend=YES)", function() {
39
39
 
40
40
  var base = SC.SelectionSet.create().add(content, 3,3),
41
41
  next = 1,
42
- expected = base.copy().add(content, next),
42
+ expected = base.copy().addObject(content.objectAt(next)),
43
43
  actual;
44
44
 
45
45
  view.select(SC.IndexSet.create(3,3));
@@ -175,7 +175,7 @@ test("del.collectionViewShouldSelectIndexes - returns empty index set", function
175
175
 
176
176
  view.select(2);
177
177
  view.select(3); // should be ignored
178
- var expected = SC.SelectionSet.create().add(content,2),
178
+ var expected = SC.SelectionSet.create().addObject(content.objectAt(2)),
179
179
  actual = view.get('selection');
180
180
  ok(expected.isEqual(actual), 'selection should not change if delegate does not allow any proposed selected indexes (expected: %@ actual: %@)'.fmt(expected, actual));
181
181
 
@@ -191,7 +191,7 @@ test("del.collectionViewShouldSelectIndexes - delegate returns null", function()
191
191
  };
192
192
 
193
193
  view.select(10); // should be ignored
194
- var expected = SC.SelectionSet.create().add(content,2),
194
+ var expected = SC.SelectionSet.create().addObject(content.objectAt(2)),
195
195
  actual = view.get('selection');
196
196
  ok(expected.isEqual(actual), 'selection should not change if delegate returns null (expected: %@ actual: %@)'.fmt(expected, actual));
197
197
 
@@ -202,7 +202,7 @@ test("del.collectionViewSelectionForProposedSelection - returns indexes", functi
202
202
 
203
203
  del.collectionViewSelectionForProposedSelection = function(v, indexes) {
204
204
 
205
- var expected = SC.SelectionSet.create().add(content,10),
205
+ var expected = SC.SelectionSet.create().addObject(content.objectAt(10)),
206
206
  actual = indexes;
207
207
  ok(expected.isEqual(actual), 'should pass proposed selection to delegate (expected: %@ actual: %@)'.fmt(expected, actual));
208
208
 
@@ -18,13 +18,27 @@ module("SC.CollectionView.selectNextItem", {
18
18
  }
19
19
  });
20
20
 
21
+ /*
22
+ Creates an SC.SelectionSet from a given index.
23
+
24
+ @param {Number} index the index of the content to select
25
+ @returns {SC.SelectionSet}
26
+ */
27
+
28
+ function selectionFromIndex(index) {
29
+ var ret = SC.SelectionSet.create();
30
+ ret.addObject(content.objectAt(index));
31
+
32
+ return ret;
33
+ }
34
+
21
35
  // ..........................................................
22
36
  // BASIC OPERATIONS
23
37
  //
24
38
 
25
39
  test("selectNextItem(extend=undefined, numberOfItems=undefined)", function() {
26
- var sel = SC.SelectionSet.create().add(content,4),
27
- expected = SC.SelectionSet.create().add(content,5),
40
+ var sel = selectionFromIndex(4),
41
+ expected = selectionFromIndex(5),
28
42
  actual;
29
43
 
30
44
  view.set('selection', sel);
@@ -35,8 +49,8 @@ test("selectNextItem(extend=undefined, numberOfItems=undefined)", function() {
35
49
  });
36
50
 
37
51
  test("selectNextItem(extend=NO, numberOfItems=undefined)", function() {
38
- var sel = SC.SelectionSet.create().add(content,4),
39
- expected = SC.SelectionSet.create().add(content,5),
52
+ var sel = selectionFromIndex(4),
53
+ expected = selectionFromIndex(5),
40
54
  actual;
41
55
 
42
56
  view.set('selection', sel);
@@ -47,7 +61,7 @@ test("selectNextItem(extend=NO, numberOfItems=undefined)", function() {
47
61
  });
48
62
 
49
63
  test("selectNextItem(extend=YES, numberOfItems=undefined)", function() {
50
- var sel = SC.SelectionSet.create().add(content,4),
64
+ var sel = selectionFromIndex(4),
51
65
  expected = SC.SelectionSet.create().add(content,4,2),
52
66
  actual;
53
67
 
@@ -59,7 +73,7 @@ test("selectNextItem(extend=YES, numberOfItems=undefined)", function() {
59
73
  });
60
74
 
61
75
  test("selectNextItem(extend=YES, numberOfItems=2)", function() {
62
- var sel = SC.SelectionSet.create().add(content,4),
76
+ var sel = selectionFromIndex(4),
63
77
  expected = SC.SelectionSet.create().add(content,4,3),
64
78
  actual;
65
79
 
@@ -132,7 +146,7 @@ test("anchor test 2 - anchor at end", function() {
132
146
 
133
147
  // TRY 3: should make selection one item long
134
148
  view.selectNextItem(YES);
135
- expected = SC.SelectionSet.create().add(content,7,1);
149
+ expected = selectionFromIndex(7);
136
150
  actual = view.get('selection');
137
151
  ok(expected.isEqual(actual), 'TRY 3: make selection one item long (sel: %@ expected: %@ actual: %@)'.fmt(sel, expected, actual));
138
152
  sel = actual;
@@ -166,8 +180,8 @@ test("anchor test 2 - anchor at end", function() {
166
180
  //
167
181
 
168
182
  test("selectNextItem() when selection is 9..9", function() {
169
- var sel = SC.SelectionSet.create().add(content,9),
170
- expected = SC.SelectionSet.create().add(content,9),
183
+ var sel = selectionFromIndex(9),
184
+ expected = selectionFromIndex(9),
171
185
  actual;
172
186
 
173
187
  view.set('selection', sel);
@@ -18,13 +18,27 @@ module("SC.CollectionView.selectPreviousItem", {
18
18
  }
19
19
  });
20
20
 
21
+ /*
22
+ Creates an SC.SelectionSet from a given index.
23
+
24
+ @param {Number} index the index of the content to select
25
+ @returns {SC.SelectionSet}
26
+ */
27
+
28
+ function selectionFromIndex(index) {
29
+ var ret = SC.SelectionSet.create();
30
+ ret.addObject(content.objectAt(index));
31
+
32
+ return ret;
33
+ }
34
+
21
35
  // ..........................................................
22
36
  // BASIC OPERATIONS
23
37
  //
24
38
 
25
39
  test("selectPreviousItem(extend=undefined, numberOfItems=undefined)", function() {
26
- var sel = SC.SelectionSet.create().add(content,4),
27
- expected = SC.SelectionSet.create().add(content,3),
40
+ var sel = selectionFromIndex(4),
41
+ expected = selectionFromIndex(3),
28
42
  actual;
29
43
 
30
44
  view.set('selection', sel);
@@ -35,8 +49,8 @@ test("selectPreviousItem(extend=undefined, numberOfItems=undefined)", function()
35
49
  });
36
50
 
37
51
  test("selectPreviousItem(extend=NO, numberOfItems=undefined)", function() {
38
- var sel = SC.SelectionSet.create().add(content,4),
39
- expected = SC.SelectionSet.create().add(content,3),
52
+ var sel = selectionFromIndex(4),
53
+ expected = selectionFromIndex(3),
40
54
  actual;
41
55
 
42
56
  view.set('selection', sel);
@@ -47,7 +61,7 @@ test("selectPreviousItem(extend=NO, numberOfItems=undefined)", function() {
47
61
  });
48
62
 
49
63
  test("selectPreviousItem(extend=YES, numberOfItems=undefined)", function() {
50
- var sel = SC.SelectionSet.create().add(content,4),
64
+ var sel = selectionFromIndex(4),
51
65
  expected = SC.SelectionSet.create().add(content,3,2),
52
66
  actual;
53
67
 
@@ -59,7 +73,7 @@ test("selectPreviousItem(extend=YES, numberOfItems=undefined)", function() {
59
73
  });
60
74
 
61
75
  test("selectPreviousItem(extend=YES, numberOfItems=2)", function() {
62
- var sel = SC.SelectionSet.create().add(content,4),
76
+ var sel = selectionFromIndex(4),
63
77
  expected = SC.SelectionSet.create().add(content,2,3),
64
78
  actual;
65
79
 
@@ -89,7 +103,7 @@ test("anchor test", function() {
89
103
 
90
104
  // TRY 2: further reduce selection
91
105
  view.selectPreviousItem(YES);
92
- expected = SC.SelectionSet.create().add(content,2,1);
106
+ expected = selectionFromIndex(2);
93
107
  actual = view.get('selection');
94
108
  ok(expected.isEqual(actual), 'TRY 2: should reduce end of selection again (sel: %@ expected: %@ actual: %@)'.fmt(sel, expected, actual));
95
109
  sel = actual;
@@ -146,7 +160,7 @@ test("anchor test 2", function() {
146
160
 
147
161
  // TRY 3: don't extend. jumps to previous item and resets selection
148
162
  view.selectPreviousItem(NO);
149
- expected = SC.SelectionSet.create().add(content,3,1);
163
+ expected = selectionFromIndex(3);
150
164
  actual = view.get('selection');
151
165
  ok(expected.isEqual(actual), 'TRY 3: not extending clears selection and anchor (sel: %@ expected: %@ actual: %@)'.fmt(sel, expected, actual));
152
166
  sel = actual;
@@ -172,8 +186,8 @@ test("anchor test 2", function() {
172
186
  //
173
187
 
174
188
  test("selectPreviousItem() when selection is 0..0", function() {
175
- var sel = SC.SelectionSet.create().add(content,0),
176
- expected = SC.SelectionSet.create().add(content,0),
189
+ var sel = selectionFromIndex(0),
190
+ expected = selectionFromIndex(0),
177
191
  actual;
178
192
 
179
193
  view.set('selection', sel);
@@ -65,7 +65,7 @@ test("constant row heights", function() {
65
65
 
66
66
  test("constant row heights with rowSpacing", function() {
67
67
  var view = SC.ListView.create({ content: content, rowHeight: 40, rowSpacing: 2, customRowHeightIndexes: null });
68
- verifyRowHeights(view, 42);
68
+ verifyRowHeights(view, 40);
69
69
  });
70
70
 
71
71
  test("custom row heights", function() {
@@ -116,7 +116,7 @@ test("scrolling by small amount should update incremental rendering", function()
116
116
 
117
117
  // SCROLL DOWN ANOTHER LINE
118
118
  SC.run(function() {
119
- scrollView.scrollTo(0,82);
119
+ scrollView.scrollTo(0,83);
120
120
  });
121
121
 
122
122
  // top line should have scrolled out of view
@@ -80,7 +80,10 @@ test("basic", function() {
80
80
  ok(view.$('.sc-inner-head'), 'should have sc-inner-head class');
81
81
  ok(view.$('.sc-inner-tail'), 'should have sc-inner-tail class');
82
82
  equals(view.$('.sc-inner').css("width"), "25%", 'width should be 25%');
83
- equals(view.$('.sc-inner').width(), 84, 'pixel width ');
83
+
84
+ // browsers compute the width after % adjustment differently. just be close
85
+ var v = (SC.browser.msie || SC.browser.mozilla) ? 85 : 84;
86
+ equals(view.$('.sc-inner').width(), v, 'pixel width ');
84
87
 
85
88
  });
86
89
 
@@ -173,7 +176,9 @@ test("changing value from full -> negative number", function() {
173
176
  test("changing value to over maximum", function() {
174
177
  var view = pane.view('progress basic');
175
178
 
176
- equals(view.$('.sc-inner').width(), 84, 'precon - pixel width should be 84');
179
+ // browsers compute the width after % adjustment differently. just be close
180
+ var v = (SC.browser.msie || SC.browser.mozilla) ? 85 : 84;
181
+ equals(view.$('.sc-inner').width(), v, 'precon - pixel width should be fixed');
177
182
  SC.RunLoop.begin();
178
183
  view.set('value', 110);
179
184
  SC.RunLoop.end();
@@ -187,7 +192,9 @@ test("changing value to a string", function() {
187
192
  SC.RunLoop.begin();
188
193
  view.set('value', 25);
189
194
  SC.RunLoop.end();
190
- equals(view.$('.sc-inner').width(), 84, 'precon - pixel width should be 84');
195
+
196
+ var v = (SC.browser.msie || SC.browser.mozilla) ? 85 : 84;
197
+ equals(view.$('.sc-inner').width(), v, 'precon - pixel width should be fixed');
191
198
  SC.RunLoop.begin();
192
199
  view.set('value', 'aString');
193
200
  SC.RunLoop.end();
@@ -5,7 +5,7 @@
5
5
  // License: Licened under MIT license (see license.js)
6
6
  // ==========================================================================
7
7
 
8
- /*global module test htmlbody ok equals same stop start */
8
+ /*global module test htmlbody ok equals same stop start Q$*/
9
9
 
10
10
  var pane, view ;
11
11
  module("SC.RadioView Logic", {
@@ -21,7 +21,9 @@
21
21
 
22
22
  .add("basic3", SC.ScrollView, {
23
23
  contentView: iv,
24
- isHorizontalScrollerVisible: NO
24
+ isHorizontalScrollerVisible: NO,
25
+ autohidesHorizontalScroller: NO,
26
+ autohidesVerticalScroller: NO
25
27
  })
26
28
 
27
29
  .add("disabled", SC.ScrollView, {
@@ -120,40 +122,60 @@
120
122
  test("Setting the scroller to a specific value", function() {
121
123
  var viewsc = pane.view('basic2');
122
124
  // should be testing against the layer.scrollTop property
125
+ SC.RunLoop.begin();
123
126
  viewsc.scrollTo(0, 10);
124
- equals(viewsc.get('verticalScrollOffset'), 10, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
125
- equals(viewsc.get('verticalScrollerView').get('layer').scrollTop, 10, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
127
+ SC.RunLoop.end();
128
+ equals(viewsc.get('verticalScrollOffset'), 10, "1After setting the value to the 10 on a vertical scroller, the verticalscrollOffset property of the layer must be");
129
+ equals(viewsc.get('verticalScrollerView').get('layer').scrollTop, 10, "2After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
130
+ SC.RunLoop.begin();
126
131
  viewsc.scrollTo(0, 0);
127
- equals(viewsc.get('verticalScrollOffset'), 0, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
128
- equals(viewsc.get('verticalScrollerView').get('layer').scrollTop, 0, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
132
+ SC.RunLoop.end();
133
+ equals(viewsc.get('verticalScrollOffset'), 0, "1After setting the value to the 0 on a vertical scroller, the verticalscrollOffset property of the layer must be");
134
+ equals(viewsc.get('verticalScrollerView').get('layer').scrollTop, 0, "2After setting the value to the 0 on a vertical scroller, the scrollTop property of the layer must be");
135
+ SC.RunLoop.begin();
129
136
  viewsc.scrollTo(0, 100);
130
- equals(viewsc.get('verticalScrollOffset'), 100, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
131
- equals(viewsc.get('verticalScrollerView').get('layer').scrollTop, 100, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
137
+ SC.RunLoop.end();
138
+ equals(viewsc.get('verticalScrollOffset'), 100, "1After setting the value to the 100 on a vertical scroller, the verticalscrollOffset property of the layer must be");
139
+ equals(viewsc.get('verticalScrollerView').get('layer').scrollTop, 100, "2After setting the value to the 100 on a vertical scroller, the scrollTop property of the layer must be");
140
+ SC.RunLoop.begin();
132
141
  viewsc.scrollTo(0, -1);
133
- equals(viewsc.get('verticalScrollOffset'), 0, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
134
- equals(viewsc.get('verticalScrollerView').get('layer').scrollTop, 0, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
142
+ SC.RunLoop.end();
143
+ equals(viewsc.get('verticalScrollOffset'), 0, "1After setting the value to the -1 on a vertical scroller, the verticalscrollOffset property of the layer must be");
144
+ equals(viewsc.get('verticalScrollerView').get('layer').scrollTop, 0, "2After setting the value to the -1 on a vertical scroller, the scrollTop property of the layer must be");
145
+ SC.RunLoop.begin();
135
146
  viewsc.scrollTo(0, 101);
136
- equals(viewsc.get('verticalScrollOffset'), 101, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
137
- equals(viewsc.get('verticalScrollerView').get('layer').scrollTop, 101, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
147
+ SC.RunLoop.end();
148
+ equals(viewsc.get('verticalScrollOffset'), 101, "1After setting the value to the 101 on a vertical scroller, the verticalscrollOffset property of the layer must be");
149
+ equals(viewsc.get('verticalScrollerView').get('layer').scrollTop, 101, "2After setting the value to the 101 on a vertical scroller, the scrollTop property of the layer must be");
138
150
 
139
151
  // should be testing against the layer.scrollLeft property
140
- viewsc.set('layoutDirection', SC.LAYOUT_HORIZONTAL);
141
- viewsc.scrollTo(10, 0);
142
- equals(viewsc.get('horizontalScrollOffset'), 10, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
143
- equals(viewsc.get('horizontalScrollerView').get('layer').scrollLeft, 10, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
144
- viewsc.scrollTo(0, 0);
145
- equals(viewsc.get('horizontalScrollOffset'), 0, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
146
- equals(viewsc.get('horizontalScrollerView').get('layer').scrollLeft, 0, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
147
- viewsc.scrollTo(50, 0);
148
- equals(viewsc.get('horizontalScrollOffset'), 50, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
149
- equals(viewsc.get('horizontalScrollerView').get('layer').scrollLeft, 50, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
150
- viewsc.scrollTo( - 1, 0);
151
- equals(viewsc.get('horizontalScrollOffset'), 0, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
152
- equals(viewsc.get('horizontalScrollerView').get('layer').scrollLeft, 0, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
153
- viewsc.scrollTo(101, 0);
154
- equals(viewsc.get('horizontalScrollOffset'), 73, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
155
- equals(viewsc.get('horizontalScrollerView').get('layer').scrollLeft, 73, "After setting the value to the 10 on a vertical scroller, the scrollTop property of the layer must be");
156
- });
152
+ viewsc.set('layoutDirection', SC.LAYOUT_HORIZONTAL);
153
+ SC.RunLoop.begin();
154
+ viewsc.scrollTo(10, 0);
155
+ SC.RunLoop.end();
156
+ equals(viewsc.get('horizontalScrollOffset'), 10, "After setting the value to the 10 on a horizontal scroller, the horizontalScrollOffset property of the layer must be");
157
+ equals(viewsc.get('horizontalScrollerView').get('layer').scrollLeft, 10, "After setting the value to the 10 on a horizontal scroller, the scrollLeft property of the layer must be");
158
+ SC.RunLoop.begin();
159
+ viewsc.scrollTo(0, 0);
160
+ SC.RunLoop.end();
161
+ equals(viewsc.get('horizontalScrollOffset'), 0, "After setting the value to the 0 on a horizontal scroller, the horizontalScrollOffset property of the layer must be");
162
+ equals(viewsc.get('horizontalScrollerView').get('layer').scrollLeft, 0, "After setting the value to the 0 on a horizontal scroller, the scrollLeft property of the layer must be");
163
+ SC.RunLoop.begin();
164
+ viewsc.scrollTo(50, 0);
165
+ SC.RunLoop.end();
166
+ equals(viewsc.get('horizontalScrollOffset'), 50, "After setting the value to the 50 on a horizontal scroller, the horizontalScrollOffset property of the layer must be");
167
+ equals(viewsc.get('horizontalScrollerView').get('layer').scrollLeft, 50, "After setting the value to the 50 on a horizontal scroller, the scrollLeft property of the layer must be");
168
+ SC.RunLoop.begin();
169
+ viewsc.scrollTo( - 1, 0);
170
+ SC.RunLoop.end();
171
+ equals(viewsc.get('horizontalScrollOffset'), 0, "After setting the value to the -1 on a horizontal scroller, the horizontalScrollOffset property of the layer must be");
172
+ equals(viewsc.get('horizontalScrollerView').get('layer').scrollLeft, 0, "After setting the value to the -1 on a horizontal scroller, the scrollLeft property of the layer must be");
173
+ SC.RunLoop.begin();
174
+ viewsc.scrollTo(101, 0);
175
+ SC.RunLoop.end();
176
+ equals(viewsc.get('horizontalScrollOffset'), 73, "After setting the value to the 101 on a horizontal scroller, the horizontalScrollOffset property of the layer must be");
177
+ equals(viewsc.get('horizontalScrollerView').get('layer').scrollLeft, 73, "After setting the value to the 101 on a horizontal scroller, the scrollLeft property of the layer must be");
178
+ });
157
179
 
158
180
 
159
181
  test("non-zero bottom in vertical scrollbar", function() {
@@ -24,7 +24,7 @@ module("SC.ScrollerView",{
24
24
  SC.ScrollerView.extend({
25
25
  layout:{ top: 0, bottom: 0, right: 0, width: 20 },
26
26
  minimum:0,
27
- maximum:100,
27
+ maximum:100
28
28
  })
29
29
 
30
30
  ]
@@ -47,9 +47,9 @@ test("listing the displayProperties",function(){
47
47
  equals(obj.length, 5,'the number of display properties');
48
48
  equals(obj[0],'isFirstResponder','the offset value property');
49
49
  equals(obj[1],'isVisible','the isVisible value property');
50
- equals(obj[2],'minimum','the minimum value property');
51
- equals(obj[3],'maximum','the maximum value property');
52
- equals(obj[4],'isEnabled','the isEnabled offset value property');
50
+ equals(obj[2],'maximum','the maximum value property');
51
+ equals(obj[3],'isEnabled','the isEnabled offset value property');
52
+ equals(obj[4],'layoutDirection','the layoutDirection property');
53
53
 
54
54
  });
55
55
 
@@ -59,8 +59,8 @@ test("testing properties of a scrollerview", function(){
59
59
  equals(NO,view1.get('isEnabled'),'The scroller should be not enabled');
60
60
  equals(SC.LAYOUT_VERTICAL,view.get('layoutDirection'),'The default scroller direction should be vertical');
61
61
  equals(SC.LAYOUT_HORIZONTAL,view1.get('layoutDirection'),'The scroller direction set as vertical during view creation');
62
- equals(0,view.value,'The default offset value set during creation for a scroller should be 0');
63
- equals(15,view1.value,'The offset value should be 15');
62
+ equals(0,view.get('value'),'The default offset value set during creation for a scroller should be 0');
63
+ equals(15,view1.get('value'),'The offset value should be 15');
64
64
  // view1.set('layoutDirection',SC.LAYOUT_VERTICAL);
65
65
  // equals(SC.LAYOUT_VERTICAL,view1.get('layoutDirection'),'The scroller direction set after view creation');
66
66
  });
@@ -8,7 +8,7 @@
8
8
  /*global module test htmlbody ok equals same stop start */
9
9
 
10
10
  var iconURL= "http://www.freeiconsweb.com/Icons/16x16_people_icons/People_046.gif";
11
-
11
+ var pane, view;
12
12
  module("SC.SegmentedView", {
13
13
  setup: function() {
14
14
  SC.RunLoop.begin();
@@ -74,12 +74,12 @@ test("Check that properties are mapped correctly", function() {
74
74
  equals(view._isMouseDown, YES, 'Mouse down flag on mousedown should be ');
75
75
  equals(view.get('activeIndex'), 0, 'The active item is the first segment.');
76
76
 
77
- var elem = view.get('layer').childNodes[1];
77
+ elem = view.get('layer').childNodes[1];
78
78
  SC.Event.trigger(elem, 'mouseup');
79
79
  equals(view._isMouseDown, NO, 'Mouse down flag on mouseup should be ');
80
80
  equals(view.get('activeIndex'), -1, 'Ther shouldnt be any active item');
81
81
 
82
- var elem = view.get('layer').childNodes[2];
82
+ elem = view.get('layer').childNodes[2];
83
83
  SC.Event.trigger(elem, 'mousedown');
84
84
 
85
85
  SC.Event.trigger(elem, 'mousemoved');
@@ -142,8 +142,8 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
142
142
  ok(viewElem.hasClass('sc-view'), '3_empty.hasClass(sc-view) should be YES');
143
143
  ok(viewElem.hasClass('sc-segmented-view'), '3_empty.hasClass(sc-segmented-view) should be YES');
144
144
  for (var i=0, ilen=segments.length; i<ilen; i++){
145
- seg=segments[i];
146
- if(i==0){
145
+ var seg=segments[i];
146
+ if(i===0){
147
147
  ok((seg.className.indexOf('sc-first-segment')>=0), 'first segment has the right classname assigned.');
148
148
  }
149
149
  if(i==segments.length-1){
@@ -152,7 +152,7 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
152
152
  ok((seg.childNodes[0].className.indexOf('sc-button-inner')>=0), 'segment '+i+' should have an inner-button.');
153
153
  ok((seg.childNodes[0].childNodes[0].className.indexOf('sc-button-label')>=0), 'segment '+i+' should have a label.');
154
154
 
155
- if(i!=0 && i!=segments.length-1){
155
+ if(i!==0 && i!=segments.length-1){
156
156
  ok((seg.className.indexOf('sc-middle-segment')>=0), 'middle segment has the right classname assigned.');
157
157
  }
158
158
  viewElem=pane.view('3_items,2_sel,disabled').$();
@@ -168,8 +168,8 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
168
168
  ok(viewElem.hasClass('sc-view'), '3_empty.hasClass(sc-view) should be YES');
169
169
  ok(viewElem.hasClass('sc-segmented-view'), '3_empty.hasClass(sc-segmented-view) should be YES');
170
170
  for (var i=0, ilen=segments.length; i<ilen; i++){
171
- seg=segments[i];
172
- if(i==0){
171
+ var seg=segments[i];
172
+ if(i===0){
173
173
  ok((seg.className.indexOf('sc-first-segment')>=0), 'first segment has the right classname assigned.');
174
174
  }
175
175
  if(i==segments.length-1){
@@ -179,7 +179,7 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
179
179
  ok((seg.childNodes[0].childNodes[0].className.indexOf('sc-button-label')>=0), 'segment '+i+' should have a label.');
180
180
  ok((seg.childNodes[0].childNodes[0].childNodes[0].src.length>0), 'segment '+i+' should have an icon.');
181
181
 
182
- if(i!=0 && i!=segments.length-1){
182
+ if(i!==0 && i!=segments.length-1){
183
183
  ok((seg.className.indexOf('sc-middle-segment')>=0), 'middle segment has the right classname assigned.');
184
184
  }
185
185
  viewElem=pane.view('3_items,2_sel,disabled').$();
@@ -192,7 +192,7 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
192
192
  test("Check that the selected segments have the right classes assigned.", function() {
193
193
  var segments=pane.view('3_empty').$('a');
194
194
  for (var i=0, ilen=segments.length; i<ilen; i++){
195
- seg=segments[i];
195
+ var seg=segments[i];
196
196
  ok((seg.className.indexOf('sel')==-1), 'this element should not be selected.');
197
197
  }
198
198
 
@@ -203,7 +203,7 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
203
203
  var segments=pane.view('3_items,icon,2_sel').$('a');
204
204
  var count=0;
205
205
  for (var i=0, ilen=segments.length; i<ilen; i++){
206
- seg=segments[i];
206
+ var seg=segments[i];
207
207
  if(seg.className.indexOf('sel')!=-1){
208
208
  count++;
209
209
  }