sproutcore 1.11.0.rc2 → 1.11.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG +10 -0
  3. data/VERSION.yml +1 -1
  4. data/lib/frameworks/sproutcore/CHANGELOG.md +114 -1
  5. data/lib/frameworks/sproutcore/apps/showcase/views/views_item_view.js +1 -7
  6. data/lib/frameworks/sproutcore/apps/showcase/views/views_list_view.js +9 -9
  7. data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +167 -5
  8. data/lib/frameworks/sproutcore/frameworks/ajax/system/response.js +24 -8
  9. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/stack_layout.js +737 -0
  10. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/layout.js +0 -6
  11. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +11 -7
  12. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane_statechart.js +7 -11
  13. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/child_view_layout_protocol.js +8 -3
  14. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/observable_protocol.js +9 -6
  15. data/lib/frameworks/sproutcore/frameworks/{desktop/protocols/responder.js → core_foundation/protocols/responder_protocol.js} +83 -17
  16. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/{sparse_array_delegate.js → sparse_array_delegate_protocol.js} +11 -7
  17. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/view_transition_protocol.js +11 -6
  18. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/color.js +2 -2
  19. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/page.js +0 -22
  20. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +61 -56
  21. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/main_pane.js +2 -2
  22. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/append_remove.js +3 -3
  23. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/animation.js +63 -39
  24. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/border_frame_test.js +28 -28
  25. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createLayer.js +10 -4
  26. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layout.js +102 -1
  27. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js +4 -4
  28. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +103 -103
  29. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/replaceAllChildren_test.js +1 -1
  30. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +77 -1
  31. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view_states_test.js +18 -17
  32. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +42 -49
  33. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +5 -6
  34. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +16 -5
  35. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +241 -102
  36. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout_style.js +1 -4
  37. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +0 -11
  38. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/statechart.js +993 -610
  39. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +3 -2
  40. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +6 -11
  41. data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +94 -27
  42. data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +133 -53
  43. data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +30 -35
  44. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +3 -2
  45. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +73 -29
  46. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/conflictedStoreKeys_test.js +156 -0
  47. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +61 -37
  48. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/find.js +2 -2
  49. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +68 -39
  50. data/lib/frameworks/sproutcore/frameworks/designer/tests/coders/page.js +1 -2
  51. data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +8 -6
  52. data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +80 -14
  53. data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +2 -2
  54. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/{drag_data_source.js → drag_data_source_protocol.js} +16 -10
  55. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/{drag_source.js → drag_source_protocol.js} +28 -26
  56. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/{drop_target.js → drop_target_protocol.js} +73 -75
  57. data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +4 -4
  58. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +39 -23
  59. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +120 -97
  60. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowSizeForContentIndex.js +26 -25
  61. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +3 -3
  62. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +5 -0
  63. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/{dividers.js → dividers_test.js} +38 -38
  64. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +29 -14
  65. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +2 -1
  66. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll_view.js +13 -18
  67. data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +41 -35
  68. data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +14 -14
  69. data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +41 -26
  70. data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +2 -12
  71. data/lib/frameworks/sproutcore/frameworks/foundation/gestures/tap.js +2 -2
  72. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +14 -10
  73. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/gesturable.js +104 -63
  74. data/lib/frameworks/sproutcore/frameworks/foundation/protocols/swap_transition_protocol.js +9 -4
  75. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_mixin_tests.js +1 -2
  76. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_resize_test.js +33 -33
  77. data/lib/frameworks/sproutcore/frameworks/foundation/tests/transitions/view_transitions_test.js +5 -5
  78. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +0 -4
  79. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/transition_test.js +0 -4
  80. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +0 -2
  81. data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +12 -8
  82. data/lib/frameworks/sproutcore/frameworks/media/resources/silence.mp3 +0 -0
  83. data/lib/frameworks/sproutcore/frameworks/media/tests/audio.js +69 -0
  84. data/lib/frameworks/sproutcore/frameworks/media/views/audio.js +1 -0
  85. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
  86. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +11 -4
  87. data/lib/frameworks/sproutcore/frameworks/runtime/protocols/mixin_protocol.js +150 -0
  88. data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +447 -137
  89. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +9 -15
  90. data/lib/frameworks/sproutcore/frameworks/runtime/system/set.js +19 -17
  91. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +188 -16
  92. data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +1 -1
  93. data/lib/frameworks/sproutcore/frameworks/template_view/panes/template.js +0 -3
  94. data/lib/frameworks/sproutcore/frameworks/template_view/tests/panes/template.js +0 -17
  95. data/lib/frameworks/sproutcore/frameworks/template_view/tests/views/template/collection.js +43 -26
  96. data/lib/frameworks/sproutcore/frameworks/template_view/views/bindable_span.js +9 -2
  97. data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list.css +0 -1
  98. data/lib/frameworks/sproutcore/themes/ace/resources/scroll/scroll.css +3 -0
  99. data/sproutcore.gemspec +3 -3
  100. metadata +19 -17
  101. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/horizontal_stack_layout.js +0 -465
  102. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/vertical_stack_layout.js +0 -472
  103. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/build.js +0 -87
  104. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/build_children.js +0 -89
@@ -1,87 +0,0 @@
1
- // ==========================================================================
2
- // Project: SproutCore - JavaScript Application Framework
3
- // Copyright: ©2006-2011 Apple Inc. and contributors.
4
- // License: Licensed under MIT license (see license.js)
5
- // ==========================================================================
6
- /*global module test ok */
7
-
8
- var buildableView, parent;
9
- module('SC.Buildable', {
10
- setup: function () {
11
- parent = SC.View.create();
12
- buildableView = SC.View.create({
13
- buildIn: function () {
14
- this.called_any = YES;
15
- this.called_buildIn = YES;
16
- },
17
-
18
- resetBuild: function () {
19
- this.called_any = YES;
20
- this.called_resetBuild = YES;
21
- },
22
-
23
- buildOut: function () {
24
- this.called_any = YES;
25
- this.called_buildOut = YES;
26
- },
27
-
28
- buildOutDidCancel: function () {
29
- this.called_any = YES;
30
- this.called_buildOutDidCancel = YES;
31
- },
32
-
33
- buildInDidCancel: function () {
34
- this.called_any = YES;
35
- this.called_buildInDidCancel = YES;
36
- }
37
- });
38
- },
39
-
40
- teardown: function () {
41
- parent.destroy();
42
- buildableView.destroy();
43
- }
44
- });
45
-
46
- test("resetBuildState calls resetBuild", function (){
47
- ok(!buildableView.called_any, "Nothing should have happened yet.");
48
- buildableView.resetBuildState();
49
- ok(buildableView.called_resetBuild, "reset should have been called");
50
- });
51
-
52
- test("changing parent view calls resetBuild", function () {
53
- ok(!buildableView.called_any, "Nothing should have happened yet.");
54
- parent.appendChild(buildableView);
55
- ok(buildableView.called_resetBuild, "reset should have been called");
56
- });
57
-
58
- test("buildInToView starts build in", function () {
59
- buildableView.willBuildInToView(parent);
60
- ok(!buildableView.isBuildingIn, "Should not be building in yet.");
61
- buildableView.buildInToView(parent);
62
- ok(buildableView.isBuildingIn, "Should now be building in.");
63
- ok(buildableView.called_buildIn, "Build in should have been called.");
64
- });
65
-
66
- test("buildOutFromView starts build out", function () {
67
- buildableView.willBuildInToView(parent);
68
- buildableView.buildInToView(parent);
69
- buildableView.buildInDidFinish(); // hack this in here, because our implementations above purposefully don't.
70
-
71
- ok(!buildableView.isBuildingOut, "Should not yet be building out.");
72
- buildableView.buildOutFromView(parent);
73
- ok(buildableView.isBuildingOut, "View should now be building out.");
74
- });
75
-
76
- test("resetBuildState cancels buildOut", function () {
77
- buildableView.willBuildInToView(parent);
78
- buildableView.buildInToView(parent);
79
- buildableView.buildInDidFinish(); // hack this in here, because our implementations above purposefully don't.
80
-
81
- buildableView.buildOutFromView(parent);
82
- ok(buildableView.isBuildingOut, "View should now be building out.");
83
-
84
- buildableView.resetBuildState(parent);
85
- ok(!buildableView.isBuildingOut, "View should no longer be building out.");
86
- ok(buildableView.called_buildOutDidCancel, "Cancel ought to have been called.");
87
- });
@@ -1,89 +0,0 @@
1
- // ==========================================================================
2
- // Project: SproutCore - JavaScript Application Framework
3
- // Copyright: ©2006-2011 Apple Inc. and contributors.
4
- // License: Licensed under MIT license (see license.js)
5
- // ==========================================================================
6
- /*global module test equals context ok same */
7
-
8
- var buildableView, parent;
9
- module('SC.Buildable', {
10
- setup: function() {
11
- parent = SC.View.create({
12
- buildInDidFinishFor: function() {
13
- sc_super();
14
- this.called_buildInDidFinishFor = YES;
15
- },
16
- buildOutDidFinishFor: function() {
17
- sc_super();
18
- this.called_buildOutDidFinishFor = YES;
19
- }
20
- });
21
- buildableView = SC.View.create({
22
- buildIn: function() {
23
- this.called_any = YES;
24
- this.called_buildIn = YES;
25
- },
26
-
27
- resetBuild: function() {
28
- this.called_any = YES;
29
- this.called_resetBuild = YES;
30
- },
31
-
32
- buildOut: function() {
33
- this.called_any = YES;
34
- this.called_buildOut = YES;
35
- },
36
-
37
- buildOutDidCancel: function() {
38
- this.called_any = YES;
39
- this.called_buildOutDidCancel = YES;
40
- },
41
-
42
- buildInDidCancel: function() {
43
- this.called_any = YES;
44
- this.called_buildInDidCancel = YES;
45
- }
46
- });
47
- },
48
-
49
- teardown: function() {
50
- }
51
- });
52
-
53
- test("Calling buildInChild adds child and builds it in.", function(){
54
- var v = buildableView, p = parent;
55
- p.buildInChild(v);
56
-
57
- // check right after build in is called
58
- ok(v.called_buildIn, "child started build in.");
59
- ok(v.isBuildingIn, "child is building in.");
60
- ok(!p.called_buildInDidFinishFor, "child has not finished building in, according to parent.");
61
-
62
- // the parent view should be set already
63
- equals(v.get("parentView"), p, "Parent view should be the parent");
64
-
65
- // finish build in
66
- v.buildInDidFinish();
67
-
68
- // now check that the view registered that finish
69
- ok(p.called_buildInDidFinishFor, "child has finished building in, according to parent.");
70
- });
71
-
72
-
73
- test("Calling buildOutChild builds out the child, and only removes it when done.", function() {
74
- var v = buildableView, p = parent;
75
- p.buildInChild(v);
76
- v.buildInDidFinish();
77
-
78
- p.buildOutChild(v);
79
- ok(v.called_buildOut, "child started build out.");
80
- ok(v.isBuildingOut, "child is building out.");
81
- ok(!p.called_buildOutDidFinishFor, "child has not finished building out, according to parent.");
82
- equals(v.get("parentView"), p, "Parent view should still be the former parent");
83
-
84
- // finish build out
85
- v.buildOutDidFinish();
86
-
87
- ok(p.called_buildOutDidFinishFor, "child has finished building out, according to parent.");
88
- equals(v.get("parentView"), null, "Parent view is now null");
89
- });