sproutit-sproutcore 1.0.20090721145251 → 1.0.20090721145280

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. data/Rakefile +3 -3
  2. data/VERSION.yml +2 -2
  3. data/frameworks/sproutcore/Buildfile +0 -1
  4. data/gen/app/templates/apps/@target_name@/core.js +27 -0
  5. data/gen/app/templates/apps/@target_name@/english.lproj/loading.rhtml +9 -0
  6. data/gen/app/templates/apps/@target_name@/english.lproj/main_page.js +22 -0
  7. data/gen/app/templates/apps/@target_name@/english.lproj/strings.js +15 -0
  8. data/gen/app/templates/apps/@target_name@/main.js +30 -0
  9. data/gen/controller/templates/controllers/@filename@.js +18 -0
  10. data/gen/controller/templates/tests/controllers/@filename@.js +15 -0
  11. data/gen/framework/templates/frameworks/@target_name@/core.js +21 -0
  12. data/gen/framework/templates/frameworks/@target_name@/english.lproj/strings.js +15 -0
  13. data/gen/language/templates/@filename@/strings.js +14 -0
  14. data/gen/model/templates/fixtures/@filename@.js +35 -0
  15. data/gen/model/templates/models/@filename@.js +19 -0
  16. data/gen/model/templates/tests/models/@filename@.js +15 -0
  17. data/gen/project/templates/@filename@/Buildfile +7 -0
  18. data/gen/project/templates/@filename@/README +7 -0
  19. data/gen/test/templates/tests/@filename@.js +15 -0
  20. data/gen/theme/templates/themes/@target_name@/english.lproj/strings.js +15 -0
  21. data/gen/view/templates/tests/views/@filename@.js +15 -0
  22. data/gen/view/templates/views/@filename@.js +18 -0
  23. data/lib/sproutcore/models/generator.rb +2 -2
  24. metadata +21 -33
  25. data/frameworks/sproutcore/frameworks/deprecated/core.js +0 -59
  26. data/frameworks/sproutcore/frameworks/deprecated/lib/button_views.rb +0 -330
  27. data/frameworks/sproutcore/frameworks/deprecated/lib/collection_view.rb +0 -83
  28. data/frameworks/sproutcore/frameworks/deprecated/lib/core_views.rb +0 -326
  29. data/frameworks/sproutcore/frameworks/deprecated/lib/form_views.rb +0 -253
  30. data/frameworks/sproutcore/frameworks/deprecated/lib/index.rhtml +0 -75
  31. data/frameworks/sproutcore/frameworks/deprecated/lib/menu_views.rb +0 -93
  32. data/frameworks/sproutcore/frameworks/deprecated/server/rails_server.js +0 -80
  33. data/frameworks/sproutcore/frameworks/deprecated/server/rest_server.js +0 -178
  34. data/frameworks/sproutcore/frameworks/deprecated/server/server.js +0 -673
  35. data/frameworks/sproutcore/frameworks/deprecated/system/animator.js +0 -679
  36. data/frameworks/sproutcore/frameworks/deprecated/system/binding.js +0 -36
  37. data/frameworks/sproutcore/frameworks/deprecated/system/browser.js +0 -75
  38. data/frameworks/sproutcore/frameworks/deprecated/system/classic_responder.js +0 -312
  39. data/frameworks/sproutcore/frameworks/deprecated/system/event.js +0 -58
  40. data/frameworks/sproutcore/frameworks/deprecated/system/globals.js +0 -20
  41. data/frameworks/sproutcore/frameworks/deprecated/system/misc.js +0 -58
  42. data/frameworks/sproutcore/frameworks/deprecated/system/node_descriptor.js +0 -72
  43. data/frameworks/sproutcore/frameworks/deprecated/system/object.js +0 -122
  44. data/frameworks/sproutcore/frameworks/deprecated/system/path_module.js +0 -432
  45. data/frameworks/sproutcore/frameworks/deprecated/system/string.js +0 -107
  46. data/frameworks/sproutcore/frameworks/deprecated/tests/application/application.rhtml +0 -125
  47. data/frameworks/sproutcore/frameworks/deprecated/tests/views/classic_view/clippingFrame.rhtml +0 -401
  48. data/frameworks/sproutcore/frameworks/deprecated/tests/views/classic_view/frame.rhtml +0 -357
  49. data/frameworks/sproutcore/frameworks/deprecated/tests/views/classic_view/isVisibleInWindow.rhtml +0 -147
  50. data/frameworks/sproutcore/frameworks/deprecated/tests/views/collection/base.rhtml +0 -298
  51. data/frameworks/sproutcore/frameworks/deprecated/tests/views/collection/incremental_rendering.rhtml +0 -260
  52. data/frameworks/sproutcore/frameworks/deprecated/tests/views/collection/source_list_rendering.rhtml +0 -143
  53. data/frameworks/sproutcore/frameworks/deprecated/tests/views/popup_button.rhtml +0 -128
  54. data/frameworks/sproutcore/frameworks/deprecated/tests/views/text_field.rhtml +0 -37
  55. data/frameworks/sproutcore/frameworks/deprecated/views/collection.js +0 -24
@@ -1,143 +0,0 @@
1
- <% content_for('final') do %>
2
- <script>
3
-
4
- // create some item data...
5
- [
6
- { guid: '1001', name: 'item one', group: '1' },
7
- { guid: '1002', name: 'item two', group: '1' },
8
- { guid: '1003', name: 'item three', group: '2' },
9
- { guid: '1004', name: 'item four', group: '3' },
10
- { guid: '1005', name: 'item five', group: '3' },
11
- { guid: '1006', name: 'item six', group: '3' }
12
- ].each(function(o){ SC.Store.addRecord(SC.Record.create(o)); });
13
-
14
- // a collection to hold the items...
15
- testCollection = SC.Record.collection();
16
- testCollection.refresh();
17
-
18
- // a controller for the collection...
19
- testController = SC.CollectionController.create();
20
-
21
- Test.context("A grouped SC.SourceListView with its content set to a SC.CollectionController", {
22
-
23
- "Item views should be the same width as the SC.CollectionView": function()
24
- {
25
- var widthOfFirstItemView = function() {
26
- var itemView = testSourceListView.get('itemViews')[0] ;
27
- return (itemView) ? itemView.get('frame').width : null ;
28
- } ;
29
-
30
- widthOfFirstItemView().shouldEqual(testSourceListView.get('frame').width) ;
31
-
32
- SC.Store.addRecord( SC.Record.create({ guid: '0999', name: 'item zero', group: '1' }) );
33
-
34
- widthOfFirstItemView().shouldEqual(testSourceListView.get('frame').width) ;
35
- },
36
-
37
- "Group views should be the same width as the SC.CollectionView": function()
38
- {
39
- var widthOfFirstGroupView = function() {
40
- var groupView = testSourceListView.get('groupViews')[0] ;
41
- return (groupView) ? groupView.get('frame').width : null ;
42
- } ;
43
-
44
- widthOfFirstGroupView().shouldEqual(testSourceListView.get('frame').width) ;
45
- },
46
-
47
- setup: function()
48
- {
49
- // add a scroll view wrapper.
50
- scrollView = SC.ScrollView.create() ;
51
- scrollView.set('frame', { x: 10, y: 10, width: 100, height: 30 }) ;
52
- SC.window.appendChild(scrollView) ;
53
-
54
- // create the view...
55
- testSourceListView = SC.SourceListView.create({
56
- contentValueKey: 'name',
57
- groupBy: 'group',
58
- contentBinding: 'testController.arrangedObjects',
59
- selectionBinding: 'testController.selection'
60
- }) ;
61
- scrollView.set('content', testSourceListView) ;
62
-
63
- testController.set('content', testCollection) ;
64
- SC.Binding.flushPendingChanges() ;
65
- },
66
-
67
- teardown: function()
68
- {
69
- // remove the view from SC.window
70
- testSourceListView.removeFromParent() ;
71
- scrollView.removeFromParent() ;
72
-
73
- delete testSourceListView ;
74
- delete scrollView ;
75
-
76
- testController.set('content', null) ;
77
- }
78
-
79
- });
80
-
81
- Test.context("A grouped SC.SourceListView with its content set to a SC.CollectionController, after the containing SC.ScrollView has been resized", {
82
-
83
-
84
- "Item views should be the same width as the SC.CollectionView": function()
85
- {
86
- var widthOfFirstItemView = function() {
87
- var itemView = testSourceListView.get('itemViews')[0] ;
88
- return (itemView) ? itemView.get('frame').width : null ;
89
- } ;
90
-
91
- widthOfFirstItemView().shouldEqual(testSourceListView.get('frame').width) ;
92
-
93
- SC.Store.addRecord( SC.Record.create({ guid: '0999', name: 'item zero', group: '1' }) );
94
-
95
- widthOfFirstItemView().shouldEqual(testSourceListView.get('frame').width) ;
96
- },
97
-
98
- "Group views should be the same width as the SC.CollectionView": function()
99
- {
100
- var widthOfFirstGroupView = function() {
101
- var groupView = testSourceListView.get('groupViews')[0] ;
102
- return (groupView) ? groupView.get('frame').width : null ;
103
- } ;
104
-
105
- widthOfFirstGroupView().shouldEqual(testSourceListView.get('frame').width) ;
106
- },
107
-
108
- setup: function()
109
- {
110
- // add a scroll view wrapper.
111
- scrollView = SC.ScrollView.create() ;
112
- scrollView.set('frame', { x: 10, y: 10, width: 100, height: 30 }) ;
113
- SC.window.appendChild(scrollView) ;
114
-
115
- // create the view...
116
- testSourceListView = SC.SourceListView.create({
117
- contentValueKey: 'name',
118
- groupBy: 'group',
119
- contentBinding: 'testController.arrangedObjects',
120
- selectionBinding: 'testController.selection'
121
- }) ;
122
- scrollView.set('content', testSourceListView) ;
123
-
124
- testController.set('content', testCollection) ;
125
- SC.Binding.flushPendingChanges() ;
126
- },
127
-
128
- teardown: function()
129
- {
130
- // remove the view from SC.window
131
- testSourceListView.removeFromParent() ;
132
- scrollView.removeFromParent() ;
133
-
134
- delete testSourceListView ;
135
- delete scrollView ;
136
-
137
- testController.set('content', null) ;
138
- }
139
-
140
- });
141
-
142
- </script>
143
- <% end %>
@@ -1,128 +0,0 @@
1
- <% content_for('final') do %>
2
- <script>
3
-
4
-
5
- Test.context("A SC.PopupButtonView with no configured menu", {
6
-
7
- "Should return null when asked for it's menu": function()
8
- {
9
- for (var i=0, n=this.buttons.length; i < n; i++)
10
- {
11
- (buttons[i].get('menu') == null).shouldEqual(true);
12
- }
13
- },
14
- "Should return false if asked to trigger it's action": function()
15
- {
16
- for (var i=0, n=this.buttons.length; i < n; i++)
17
- {
18
- this.buttons[i].action().shouldEqual(false);
19
- }
20
- },
21
- "Should not perform keyEquivalents": function()
22
- {
23
- for (var i=0, n=this.buttons.length; i < n; i++)
24
- {
25
- this.buttons[i].performKeyEquivalent('alt_shift_z').shouldEqual(false);
26
- }
27
- },
28
- setup: function()
29
- {
30
- this.buttons = [
31
- SC.PopupButtonView.viewFor(null),
32
- SC.PopupButtonView.extend({ menuName: '' }).viewFor(null),
33
- SC.PopupButtonView.extend({ menuName: 'foobarMenu' }).viewFor(null),
34
- SC.PopupButtonView.extend({ menuName: false }).viewFor(null),
35
- SC.PopupButtonView.extend({ menuName: null }).viewFor(null)
36
- ];
37
- },
38
-
39
- teardown: function()
40
- {
41
- delete this.buttons;
42
- }
43
-
44
- });
45
-
46
-
47
- Test.context("A SC.PopupButtonView with a properly configured menu", {
48
-
49
- "Should return a menu of the correct type": function()
50
- {
51
- (this.button.get('menu') != null).shouldEqual(true);
52
- this.button.get('menu').kindOf(SC.PopupMenuView).shouldEqual(true);
53
- },
54
- "Should return true if asked to trigger it's action": function()
55
- {
56
- this.button.action().shouldEqual(true);
57
- },
58
- "Should toggle the menu's visibility when triggering the action": function()
59
- {
60
- // for some reason this actually equals true... not sure why...
61
- equals(NO, this.button.get('menu').get('isVisible'), "button.menu.isVisible 1") ;
62
- this.button.action();
63
- SC.Binding.flushPendingChanges(); // menus use a binding...
64
-
65
- equals(YES, this.button.get('menu').get('isVisible'), "button.menu.isVisible 2") ;
66
- this.button.action();
67
- SC.Binding.flushPendingChanges(); // menus use a binding...
68
-
69
- equals(NO, this.button.get('menu').get('isVisible'), "button.menu.isVisible 3") ;
70
- },
71
- "Should have it's isSelected state bound to the menu's visibility": function()
72
- {
73
- // either by triggering the action...
74
- this.button.get('isSelected').shouldEqual(false);
75
-
76
- this.button.action();
77
- SC.Binding.flushPendingChanges(); // menus use a binding...
78
- this.button.get('isSelected').shouldEqual(true);
79
-
80
- this.button.action();
81
- SC.Binding.flushPendingChanges(); // menus use a binding...
82
- this.button.get('isSelected').shouldEqual(false);
83
-
84
- // or by showing/hiding the menu...
85
- this.button.get('menu').set('isVisible', true);
86
- SC.Binding.flushPendingChanges(); // menus use a binding...
87
- this.button.get('isSelected').shouldEqual(true);
88
-
89
- this.button.get('menu').set('isVisible', false);
90
- SC.Binding.flushPendingChanges(); // menus use a binding...
91
- this.button.get('isSelected').shouldEqual(false);
92
- },
93
- "Should send performKeyEquivalent messages to it's menu": function()
94
- {
95
- this.button.get('menu').performKeyEquivalent('alt_shift_z', {}).shouldEqual(true);
96
- this.button.performKeyEquivalent('alt_shift_z', {}).shouldEqual(true);
97
- },
98
- "Should not send performKeyEquivalent messages to it's menu if disabled": function()
99
- {
100
- this.button.set('isEnabled', false);
101
- this.button.performKeyEquivalent('alt_shift_z', {}).shouldEqual(false);
102
- },
103
- "Should not performKeyEquivalent for disabled menu items": function()
104
- {
105
- this.button.performKeyEquivalent('alt_shift_d', {}).shouldEqual(false);
106
- },
107
- setup: function()
108
- {
109
- this.menu = SC.PopupMenuView.extend({ paneType: "menu" }).create();
110
- this.menu.appendChild( SC.MenuItemView.extend({ keyEquivalent: "alt_shift_z" }).create() );
111
- this.menu.appendChild( SC.MenuItemView.extend({ keyEquivalent: "alt_shift_d", isEnabled: false }).create() );
112
-
113
- this.button = SC.PopupButtonView.create();
114
- this.button.set('menu', this.menu);
115
- },
116
- teardown: function()
117
- {
118
- delete this.menu;
119
- delete this.button;
120
- }
121
-
122
- });
123
-
124
-
125
-
126
-
127
- </script>
128
- <% end %>
@@ -1,37 +0,0 @@
1
- <% content_for('final') do %>
2
- <script>
3
-
4
- Test.context("A SC.TextFieldView", {
5
-
6
- "Should allow text navigation keys when focused": function()
7
- {
8
- this.field.becomeFirstResponder();
9
- this.field.get('isFirstResponder').shouldEqual(true);
10
-
11
- var keynames = $w('backspace delete home end left right up down');
12
- for (var i=0, n=keynames.length; i < n; i++)
13
- {
14
- // var event = SC.Mock.KeyEvent.create({
15
- // type: 'keydown',
16
- // keyCode: SC.KEY_CODES[ keynames[i] ]
17
- // });
18
- SC.window._onkeydown(event).shouldEqual(true);
19
- event.stopped.shouldEqual(false);
20
- }
21
- },
22
-
23
- setup: function()
24
- {
25
- this.field = SC.TextFieldView.create();
26
- SC.window.appendChild(this.field);
27
- },
28
- teardown: function()
29
- {
30
- SC.window.removeChild(this.field);
31
- delete this.field;
32
- }
33
-
34
- });
35
-
36
- </script>
37
- <% end %>
@@ -1,24 +0,0 @@
1
- // ==========================================================================
2
- // SproutCore -- JavaScript Application Framework
3
- // copyright 2006-2008, Sprout Systems, Inc. and contributors.
4
- // ==========================================================================
5
-
6
- SC.mixin( SC.CollectionView.prototype, {
7
-
8
- // ======================================================================
9
- // DEPRECATED APIS (Still available for compatibility)
10
-
11
- /** @private
12
- If set to false, this method will prevent you from deselecting all of
13
- the items in your view. This is better implemented using a controller
14
- that prohibits empty selection.
15
- */
16
- allowDeselectAll: YES,
17
-
18
- /** @private */
19
- itemExistsInCollection: function(view) { return this.hasItemView(view); },
20
-
21
- /** @private */
22
- viewForContentRecord: function(rec) { return this.itemViewForContent(rec); }
23
-
24
- });