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
@@ -4,23 +4,23 @@
4
4
 
5
5
  module("credit_card validation - fieldValueForObject()");
6
6
  test("Expects a string of 16 digits. Will split into groups of 4 for display.",function(){
7
- obj=SC.Validator.CreditCard.create();
8
- string = "1234567890123456";
9
- grouped_string = obj.fieldValueForObject("1234567891234567");
7
+ var obj=SC.Validator.CreditCard.create();
8
+ var string = "1234567890123456";
9
+ var grouped_string = obj.fieldValueForObject("1234567891234567");
10
10
  equals(grouped_string,"1234 5678 9123 4567");
11
11
  });
12
12
  test("Removes all whitespace or dashes to make a single string",function(){
13
- obj=SC.Validator.CreditCard.create();
14
- string = "1234 5678-9012-3456";
15
- clean_string = obj.objectForFieldValue(string);
13
+ var obj=SC.Validator.CreditCard.create();
14
+ var string = "1234 5678-9012-3456";
15
+ var clean_string = obj.objectForFieldValue(string);
16
16
  equals(clean_string,"1234567890123456");
17
17
  });
18
18
 
19
19
  test("Checks all valid card numbers or dashes to make a single string",function(){
20
- obj=SC.Validator.CreditCard.create();
21
- invalid_cc = "1234 5678-9012-3456";
20
+ var obj=SC.Validator.CreditCard.create();
21
+ var invalid_cc = "1234 5678-9012-3456";
22
22
  equals(obj.checkNumber(invalid_cc),false);
23
- valid_cc = "4111 1111 1111 1111";
23
+ var valid_cc = "4111 1111 1111 1111";
24
24
  equals(obj.checkNumber(valid_cc),true);
25
25
  });
26
26
 
@@ -14,7 +14,7 @@ test("validate() a number", function() {
14
14
  });
15
15
 
16
16
  test("Checking fieldValueForObject" ,function(){
17
- obj = {};
17
+ var obj = {};
18
18
  var value;
19
19
  value = SC.Validator.Number.fieldValueForObject(obj,'','');
20
20
  equals(SC.T_HASH,SC.typeOf(value),'Returns an object');
@@ -27,7 +27,7 @@ test("Checking fieldValueForObject" ,function(){
27
27
  });
28
28
 
29
29
  test("Checking objectForFieldValue" ,function(){
30
- obj = {};
30
+ var obj = {};
31
31
  var value = '';
32
32
  value = SC.Validator.Number.objectForFieldValue('','','');
33
33
  equals(null,value,'Returns null for an empty string parameter');
@@ -10,15 +10,15 @@
10
10
  // htmlbody('<style> .sc-control-test-pane .wrapper { overflow: none; } </style>');
11
11
 
12
12
  (function() {
13
- var pane = SC.ControlTestPane.design({ height: 100 })
13
+ var pane = SC.ControlTestPane.design({ height: 100 });
14
14
 
15
15
  pane.add("basic", SC.ContainerView, {
16
16
  isEnabled: YES
17
- })
17
+ });
18
18
 
19
19
  pane.add("disabled", SC.ContainerView, {
20
20
  isEnabled: NO
21
- })
21
+ });
22
22
 
23
23
  // .add("disabled - single selection", SC.ListView, {
24
24
  // isEnabled: NO,
@@ -13,7 +13,7 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
13
13
 
14
14
  var pane = SC.ControlTestPane.design()
15
15
  .add("image_not_loaded", SC.ImageView, {
16
- value: appleURL, layout : {width: 200, height: 300}
16
+ value: null, layout : {width: 200, height: 300}
17
17
  })
18
18
  .add("image_loaded", SC.ImageView, {
19
19
  value: appleURL, status:'loaded', layout : {width: 200, height: 300}
@@ -26,8 +26,15 @@ htmlbody('<style> .sc-static-layout { border: 1px red dotted; } </style>');
26
26
 
27
27
 
28
28
  test("Verify that all the rendering properties of an image that is being loaded are correct", function() {
29
- ok(pane.view('image_not_loaded').get('isVisibleInWindow'), 'image_not_loaded is visible in window');
30
- ok((pane.view('image_not_loaded').$().attr('src').indexOf('blank.gif')!=-1), "The src should be set to the blank URL.");
29
+ var view = pane.view('image_not_loaded');
30
+
31
+ ok(view.get('isVisibleInWindow'), 'image_not_loaded is visible in window');
32
+
33
+ view.set('value', appleURL);
34
+ ok(view.get('status') !== 'loaded', 'PRECOND - status should not be loaded (status=%@)'.fmt(view.get('status')));
35
+
36
+ var url = view.$().attr('src')
37
+ ok((url.indexOf('blank.gif')!=-1), "The src should be blank URL. url = %@".fmt(url));
31
38
  });
32
39
 
33
40
  test("Verify that all the rendering properties of an image that is loaded are correct", function() {
@@ -140,8 +140,8 @@ test("Check that the title is set or not and if it is in the appropriate element
140
140
  var viewElem=pane.view('basic').$();
141
141
  equals(viewElem.text(), 'hello', 'has a value set');
142
142
 
143
- var viewElem=pane.view('centered,icon').$('img');
144
- ok((viewElem!=null), 'should have an image corresponding to an icon');
143
+ viewElem=pane.view('centered,icon').$('img');
144
+ ok((viewElem!==null), 'should have an image corresponding to an icon');
145
145
 
146
146
  });
147
147
 
@@ -31,6 +31,20 @@ test("adding to document for first time", function() {
31
31
 
32
32
  });
33
33
 
34
+ test("adding a pane twice should have no effect", function() {
35
+ var cnt = 0;
36
+ var pane = SC.Pane.create();
37
+ pane._tmp_paneDidAttach = pane.paneDidAttach;
38
+ pane.paneDidAttach = function() {
39
+ cnt++;
40
+ return this._tmp_paneDidAttach.apply(this, arguments);
41
+ };
42
+
43
+ pane.append();
44
+ pane.append();
45
+ equals(cnt, 1, 'should only append once');
46
+ });
47
+
34
48
  test("readding pane", function() {
35
49
  var pane = SC.Pane.create();
36
50
  var elem1 = Q$('body').get(0), elem2 = Q$('#appendtest').get(0);
@@ -5,13 +5,13 @@
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
 
11
11
  // note: need to test interaction with Validators here
12
12
  // possibly move Validator support to TextFieldView specifically.
13
13
 
14
- var pane, view ;
14
+ var pane, view, view1;
15
15
  module("SC.TextFieldView",{
16
16
  setup: function() {
17
17
  SC.RunLoop.begin();
@@ -68,9 +68,9 @@ test("isEnabled=NO should add disabled class", function() {
68
68
  // });
69
69
 
70
70
  test("isEnabled and isEditable mapping", function() {
71
- obj= SC.TextFieldView.create();
72
- obj.set('isEnabled',false)
71
+ var obj= SC.TextFieldView.create();
72
+ obj.set('isEnabled',false);
73
73
  equals(obj.get('isEditable'),false);
74
- obj.set('isEnabled',true)
74
+ obj.set('isEnabled',true);
75
75
  equals(obj.get('isEditable'),true);
76
76
  });
@@ -247,6 +247,7 @@ test("Setting the selection to a non-SC.TextSelection value should fail", functi
247
247
  test("Setting and then getting back the selection", function() {
248
248
  var view = pane.view('with value');
249
249
  var fieldElement = view.$input()[0];
250
+ fieldElement.focus();
250
251
  fieldElement.size = 10; // Avoid Firefox 3.5 issue
251
252
 
252
253
  var newSelection = SC.TextSelection.create({start:2, end:5});
@@ -281,9 +282,7 @@ test("Adding left accessory view", function() {
281
282
  // The hint and padding elements should automatically have their 'left'
282
283
  // values set to the accessory view's offset + width
283
284
  // (18 = 2 left offset + 16 width)
284
- var hintElement = view.$('.sc-hint')[0];
285
285
  var paddingElement = view.$('.padding')[0];
286
- ok(hintElement.style.left === '18px', 'hint element should get 18px left');
287
286
  ok(paddingElement.style.left === '18px', 'padding element should get 18px left');
288
287
 
289
288
  // Test removing the accessory view.
@@ -291,7 +290,6 @@ test("Adding left accessory view", function() {
291
290
  view.set('leftAccessoryView', null);
292
291
  SC.RunLoop.end();
293
292
  ok(view.get('childViews').length === 0, 'after removing the left accessory view there should be no child views left');
294
- ok(!hintElement.style.left, 'after removing the left accessory view the hint element should have no left style');
295
293
  ok(!paddingElement.style.left, 'after removing the left accessory view the padding element should have no left style');
296
294
  });
297
295
 
@@ -314,9 +312,7 @@ test("Adding right accessory view", function() {
314
312
  // The hint and padding elements should automatically have their 'right'
315
313
  // values set to the accessory view's offset + width
316
314
  // (20 = 3 right offset + 17 width)
317
- var hintElement = view.$('.sc-hint')[0];
318
315
  var paddingElement = view.$('.padding')[0];
319
- ok(hintElement.style.right === '20px', 'hint element should get 20px right');
320
316
  ok(paddingElement.style.right === '20px', 'padding element should get 20px right');
321
317
 
322
318
 
@@ -339,7 +335,6 @@ test("Adding right accessory view", function() {
339
335
  view.set('rightAccessoryView', null);
340
336
  SC.RunLoop.end();
341
337
  ok(view.get('childViews').length === 0, 'after removing the right accessory view there should be no child views left');
342
- ok(!hintElement.style.right, 'after removing the right accessory view the hint element should have no right style');
343
338
  ok(!paddingElement.style.right, 'after removing the right accessory view the padding element should have no right style');
344
339
  });
345
340
 
@@ -365,11 +360,8 @@ test("Adding both left and right accessory views", function() {
365
360
  // 'right' values set to the accessory views' offset + width
366
361
  // * left: 18 = 2 left offset + 16 width)
367
362
  // * right: 20 = 3 left offset + 17 width)
368
- var hintElement = view.$('.sc-hint')[0];
369
363
  var paddingElement = view.$('.padding')[0];
370
- ok(hintElement.style.left === '18px', 'hint element should get 18px left');
371
364
  ok(paddingElement.style.left === '18px', 'padding element should get 18px left');
372
- ok(hintElement.style.right === '20px', 'hint element should get 20px right');
373
365
  ok(paddingElement.style.right === '20px', 'padding element should get 20px right');
374
366
 
375
367
 
@@ -378,13 +370,11 @@ test("Adding both left and right accessory views", function() {
378
370
  view.set('rightAccessoryView', null);
379
371
  SC.RunLoop.end();
380
372
  ok(view.get('childViews').length === 1, 'after removing the right accessory view there should be one child view left (the left accessory view)');
381
- ok(!hintElement.style.right, 'after removing the right accessory view the hint element should have no right style');
382
373
  ok(!paddingElement.style.right, 'after removing the right accessory view the padding element should have no right style');
383
374
  SC.RunLoop.begin();
384
375
  view.set('leftAccessoryView', null);
385
376
  SC.RunLoop.end();
386
377
  ok(view.get('childViews').length === 0, 'after removing both accessory views there should be no child views left');
387
- ok(!hintElement.style.left, 'after removing the left accessory view the hint element should have no left style');
388
378
  ok(!paddingElement.style.left, 'after removing the left accessory view the padding element should have no left style');
389
379
  });
390
380
 
@@ -112,7 +112,7 @@ test("notifies receiver and each child if parent clipping frame changes", functi
112
112
  // This should not happen. If this is the case, fix the view code so that
113
113
  // it does not invalidate frame more than once before you change this
114
114
  // number.
115
- equals(callCount, 2, 'should invoke observer on child and nested child');
115
+ equals(callCount, 4, 'should invoke observer on child and nested child');
116
116
  });
117
117
 
118
118
 
@@ -128,6 +128,6 @@ test("does not notify child views of clippingFrame changes if child view hasStat
128
128
  // now, adjust layout of child so that clipping frame will change...
129
129
  a.adjust('top', -50);
130
130
 
131
- equals(callCount, 1, 'should invoke observer on child only');
131
+ equals(callCount, 2, 'should invoke observer on child only');
132
132
  });
133
133
 
@@ -75,10 +75,8 @@ test("removes layer from parentNode if in DOM", function() {
75
75
 
76
76
  view.destroyLayer();
77
77
 
78
- if(layer.parentNode)
79
- equals(layer.parentNode.nodeType, 11, 'layer no longer in parent node');
80
- else
81
- equals(layer.parentNode, null, 'layer no longer in parent node');
78
+ if(layer.parentNode) equals(layer.parentNode.nodeType, 11, 'layer no longer in parent node');
79
+ else equals(layer.parentNode, null, 'layer no longer in parent node');
82
80
  layer = null; // cleanup
83
81
  });
84
82
 
@@ -43,10 +43,8 @@ test("discovers layer by finding element with matching layerId - when DOM is in
43
43
  });
44
44
 
45
45
  test("discovers layer by finding element with matching layerId - when parent DOM is NOT in document", function() {
46
- if(parentDom.parentNode)
47
- equals(parentDom.parentNode.nodeType, 11, 'precond - NOT in parent doc');
48
- else
49
- equals(parentDom.parentNode, null, 'precond - NOT in parent doc');
46
+ if(parentDom.parentNode) equals(parentDom.parentNode.nodeType, 11, 'precond - NOT in parent doc');
47
+ else equals(parentDom.parentNode, null, 'precond - NOT in parent doc');
50
48
  equals(view.findLayerInParentLayer(parentDom), childDom, 'found childDom');
51
49
  });
52
50
 
@@ -42,7 +42,7 @@ test("insertBefore(child, null) appends child to end of parent.childView's array
42
42
  test("insertBefore(child, otherChild) inserts child before other child view", function() {
43
43
 
44
44
  var otherChild = parent.childViews[0]; // get current first child
45
- ok(otherChild, 'precond - otherChild is not null')
45
+ ok(otherChild, 'precond - otherChild is not null');
46
46
  parent.insertBefore(child, otherChild);
47
47
  equals(parent.childViews[0], child, 'child inserted before other child');
48
48
  });
@@ -39,7 +39,6 @@ function performLayoutTest(layout, no_f, no_s, with_f, with_s) {
39
39
  child.set('layout', layout) ;
40
40
 
41
41
  // test
42
- same(child.get('frame'), no_f, "FRAME NO PARENT".fmt(SC.inspect(child.get('frame')), SC.inspect(no_f))) ;
43
42
  keys.forEach(function(key) {
44
43
  equals(child.get('layoutStyle')[key], no_s[key], "STYLE NO PARENT %@".fmt(key)) ;
45
44
  });
@@ -50,7 +49,6 @@ function performLayoutTest(layout, no_f, no_s, with_f, with_s) {
50
49
  SC.RunLoop.end();
51
50
 
52
51
  // test again
53
- same(child.get('frame'), with_f, "FRAME WITH PARENT".fmt(SC.inspect(child.get('frame')), SC.inspect(with_f))) ;
54
52
  keys.forEach(function(key) {
55
53
  equals(child.get('layoutStyle')[key], with_s[key], "STYLE NO PARENT %@".fmt(key)) ;
56
54
  });
@@ -26,7 +26,7 @@ SC.Validator.Password = SC.Validator.extend(
26
26
  },
27
27
 
28
28
  validate: function(force) {
29
- if (!this.fields || this.fields.length == 0) return true ;
29
+ if (!this.fields || this.fields.length === 0) return true ;
30
30
 
31
31
  var empty = false ;
32
32
  var notEmpty = false ;
@@ -35,22 +35,22 @@ SC.Validator.Password = SC.Validator.extend(
35
35
  this.fields.forEach(function(field) {
36
36
  var curValue = field.get('fieldValue') ;
37
37
  if (curValue != value) ret= false ;
38
- if (!curValue || curValue.length == 0) empty = true ;
38
+ if (!curValue || curValue.length === 0) empty = true ;
39
39
  if (curValue && curValue.length > 0) notEmpty = true ;
40
40
  }) ;
41
41
 
42
42
  // if forces, valid OK if there was an empty. If not forced, valid OK
43
43
  // only if all fields match AND they are not all empty.
44
44
  if (force) {
45
- return (notEmpty == false) ? false : ret ;
45
+ return (notEmpty === false) ? false : ret ;
46
46
  } else {
47
- return (empty == true) ? true : ret ;
47
+ return (empty === true) ? true : ret ;
48
48
  }
49
49
  },
50
50
 
51
51
  // update field states
52
52
  updateFields: function(form,valid) {
53
- if (!this.fields || this.fields.length == 0) return true ;
53
+ if (!this.fields || this.fields.length === 0) return true ;
54
54
  var err = "Invalid.Password".loc();
55
55
  var topField = this._field ;
56
56
  this.fields.forEach(function(f) {
@@ -296,8 +296,9 @@ SC.Validator.mixin(/** @scope SC.Validator */ {
296
296
  method you define in your subclass.
297
297
  */
298
298
  fieldValueForObject: function(object, form, field) {
299
- if (this.prototype && this.prototype.fieldValueForObject)
299
+ if (this.prototype && this.prototype.fieldValueForObject) {
300
300
  return this.prototype.fieldValueForObject(object,form,field) ;
301
+ }
301
302
  else return null ;
302
303
  },
303
304
 
@@ -306,8 +307,9 @@ SC.Validator.mixin(/** @scope SC.Validator */ {
306
307
  method you define in your subclass.
307
308
  */
308
309
  objectForFieldValue: function(value, form, field) {
309
- if (this.prototype && this.prototype.objectForFieldValue)
310
+ if (this.prototype && this.prototype.objectForFieldValue) {
310
311
  return this.prototype.objectForFieldValue(value,form,field) ;
312
+ }
311
313
  else return null ;
312
314
  }
313
315
 
@@ -42,6 +42,9 @@ SC.FieldView = SC.View.extend(SC.Control, SC.Validatable,
42
42
  */
43
43
  followSafariTabFocusBehavior: NO,
44
44
 
45
+
46
+ _field_isMouseDown: NO,
47
+
45
48
  /**
46
49
  The raw value of the field itself. This is computed from the 'value'
47
50
  property by passing it through any validator you might have set. This is
@@ -225,11 +228,7 @@ SC.FieldView = SC.View.extend(SC.Control, SC.Validatable,
225
228
  event. But first, set isActive to YES.
226
229
  */
227
230
  mouseDown: function(evt) {
228
- if (this.get('isEnabled')) {
229
- this.set('isActive', YES);
230
- this.becomeFirstResponder();
231
- this._field_isMouseDown = YES;
232
- }
231
+ this._field_isMouseDown = YES;
233
232
  evt.allowDefault();
234
233
  return YES;
235
234
  },
@@ -252,8 +251,6 @@ SC.FieldView = SC.View.extend(SC.Control, SC.Validatable,
252
251
  return YES;
253
252
  },
254
253
 
255
- _field_isMouseDown: NO,
256
-
257
254
  /** @private
258
255
  on mouse up, remove the isActive class and then allow the browser to do
259
256
  its normal thing.
@@ -261,7 +258,7 @@ SC.FieldView = SC.View.extend(SC.Control, SC.Validatable,
261
258
  mouseUp: function(evt) {
262
259
  // track independently in case isEnabled has changed
263
260
  if (this._field_isMouseDown) this.set('isActive', NO);
264
- this._field_isMouseDown = false;
261
+ this._field_isMouseDown = NO;
265
262
  evt.allowDefault();
266
263
  return YES ;
267
264
  },
@@ -74,6 +74,11 @@ SC.LabelView = SC.View.extend(SC.Control,
74
74
  */
75
75
  value: '',
76
76
 
77
+ /**
78
+ The hint to display if no value is set. Should be used only if isEditable
79
+ is set to YES.
80
+ */
81
+ hint: null,
77
82
 
78
83
  /**
79
84
  The exampleInlineTextFieldView property is by default a
@@ -97,6 +102,11 @@ SC.LabelView = SC.View.extend(SC.Control,
97
102
  */
98
103
  textAlign: SC.ALIGN_LEFT,
99
104
 
105
+ /**
106
+ If you want the inline editor to be multiline set this property to YES.
107
+ */
108
+ isInlineEditorMultiline: NO,
109
+
100
110
  /**
101
111
  [RO] The value that will actually be displayed.
102
112
 
@@ -192,7 +202,7 @@ SC.LabelView = SC.View.extend(SC.Control,
192
202
  delegate: this,
193
203
  exampleElement: el,
194
204
  value: value,
195
- multiline: NO,
205
+ multiline: this.get('isInlineEditorMultiline'),
196
206
  isCollection: NO,
197
207
  validator: this.get('validator'),
198
208
  exampleInlineTextFieldView: this.get('exampleInlineTextFieldView')
@@ -256,8 +266,9 @@ SC.LabelView = SC.View.extend(SC.Control,
256
266
  _TEMPORARY_CLASS_HASH: {},
257
267
 
258
268
  render: function(context, firstTime) {
259
- var value = this.get('displayValue');
260
- var icon = this.get('icon') ;
269
+ var value = this.get('displayValue'),
270
+ icon = this.get('icon'),
271
+ hint = this.get('hint');
261
272
 
262
273
  // add icon if needed
263
274
  if (icon) {
@@ -267,8 +278,13 @@ SC.LabelView = SC.View.extend(SC.Control,
267
278
  context.push(icon);
268
279
  }
269
280
 
270
- // add display value
271
- context.push(value);
281
+ // if there is a hint set and no value, render the hint
282
+ // otherwise, render the value
283
+ if (hint && (!value || value === '')) {
284
+ context.push('<span class="sc-hint">', hint, '</span>');
285
+ } else {
286
+ context.push(value);
287
+ }
272
288
 
273
289
  // and setup alignment and font-weight on styles
274
290
  context.addStyle('text-align', this.get('textAlign'))