sproutcore 1.5.0.rc.1 → 1.5.0.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/VERSION.yml +1 -1
- data/lib/frameworks/sproutcore/Buildfile +9 -4
- data/lib/frameworks/sproutcore/README.md +1 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/QuickLook/Preview.pdf +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/QuickLook/Thumbnail.tiff +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/data.plist +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image10.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image11.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image13.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image15.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image16.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image17.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image18.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image19.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image22.tiff +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image23.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image24.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image25.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image30.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image31.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image8.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image9.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/animation/core.js +23 -25
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +160 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +73 -82
- data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/bind.js +110 -7
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/collection.js +10 -7
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/localization.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/view.js +4 -2
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions.js → core_foundation/ext/handlebars.js} +0 -57
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/object.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +11 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/main.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/application.js +14 -16
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/builder.js +29 -37
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/datetime.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +71 -19
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +3 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/page.js +5 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/selection_set.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +4 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/timer.js +21 -27
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +3 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/single_enumerable_case.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +93 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertLayouts.js +13 -11
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layer.js +2 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/theme.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template.js +6 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +87 -32
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +21 -25
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +15 -19
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +114 -167
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +4 -6
- data/lib/frameworks/sproutcore/frameworks/datastore/models/children_attribute.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +18 -20
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +74 -72
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +36 -29
- data/lib/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +97 -78
- data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +117 -97
- data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +13 -13
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +111 -108
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +231 -198
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +146 -145
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +21 -21
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +49 -50
- data/lib/frameworks/sproutcore/frameworks/datetime/{system → frameworks/core/system}/datetime.js +122 -171
- data/lib/frameworks/sproutcore/frameworks/datetime/{tests → frameworks/core/tests}/system/datetime.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/datetime/{resources → frameworks/localized/resources}/strings.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +91 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/core.js +18 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +23 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +56 -45
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +5 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +21 -19
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +82 -77
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/navigation_builder.js +18 -12
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +29 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +148 -107
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +31 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/modal.js +16 -13
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/palette.js +38 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +37 -25
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +247 -144
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/select_button.js +155 -100
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +39 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +9 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +18 -22
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +27 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +77 -44
- data/lib/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +68 -33
- data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +168 -110
- data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +37 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +187 -123
- data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +73 -49
- data/lib/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +34 -9
- data/lib/frameworks/sproutcore/frameworks/desktop/views/file.js +51 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/views/grid.js +38 -8
- data/lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js +15 -9
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +54 -34
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +113 -42
- data/lib/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +84 -28
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +67 -51
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +122 -35
- data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation.js +40 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation_bar.js +28 -18
- data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +27 -31
- data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +118 -68
- data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +117 -61
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scene.js +23 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +241 -77
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +134 -69
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segment.js +107 -25
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +125 -48
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +165 -69
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +73 -24
- data/lib/frameworks/sproutcore/frameworks/desktop/views/separator.js +19 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list.js +16 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +14 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +43 -37
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +8 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/stacked.js +14 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +16 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +99 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js +13 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +58 -8
- data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +34 -18
- data/lib/frameworks/sproutcore/frameworks/desktop/views/well.js +25 -9
- data/lib/frameworks/sproutcore/frameworks/desktop/views/workspace.js +70 -36
- data/lib/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +10 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +28 -17
- data/lib/frameworks/sproutcore/frameworks/foundation/delegates/inline_text_field.js +41 -43
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/pinch.js +42 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/swipe.js +94 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/tap.js +41 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +18 -9
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +7 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +7 -8
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_value_support.js +34 -24
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/control.js +48 -18
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/misc.js +1 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/tasks/preload_bundle.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +0 -11
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/date_time.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +8 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/README.md +24 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/package.json +21 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.css +215 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.js +1442 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/headless.html +24 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/index.html +18 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.html +17 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.js +150 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/same.js +1421 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/test.js +314 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +369 -60
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +2 -405
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +3 -9
- data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +50 -45
- data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +20 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +0 -9
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +36 -14
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable.js +0 -34
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable_observers.js +50 -61
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +45 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +5 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/enhance.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/testing/core.js +3 -0
- data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +0 -1
- data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +0 -1
- data/lib/gen/html_app/templates/apps/@target_name@/@target_name@.js +1 -1
- data/vendor/chance/lib/chance/instance.rb +8 -6
- metadata +41 -31
- data/lib/frameworks/sproutcore/frameworks/testing/jquery.js +0 -3559
- data/lib/frameworks/sproutcore/frameworks/testing/qunit.js +0 -827
@@ -5,6 +5,8 @@
|
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
7
|
|
8
|
+
require("views/toolbar");
|
9
|
+
|
8
10
|
/** @class
|
9
11
|
WorkspaceView manages a content view and two optional toolbars (top and bottom).
|
10
12
|
You want to use WorkspaceView in one of two situations: iPhone apps where the toolbars
|
@@ -12,58 +14,82 @@
|
|
12
14
|
handy!) and iPad apps where you would like the masterIsHidden property to pass through.
|
13
15
|
|
14
16
|
@since SproutCore 1.2
|
17
|
+
@extends SC.View
|
18
|
+
@author Alex Iskander
|
15
19
|
*/
|
20
|
+
SC.WorkspaceView = SC.View.extend(
|
21
|
+
/** @scope SC.WorkspaceView.prototype */ {
|
16
22
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
SC.
|
21
|
-
|
22
|
-
SC.WorkspaceView = SC.View.extend({
|
23
|
+
/**
|
24
|
+
@type Array
|
25
|
+
@default ['sc-workspace-view']
|
26
|
+
@see SC.View#classNames
|
27
|
+
*/
|
23
28
|
classNames: ["sc-workspace-view"],
|
29
|
+
|
24
30
|
/**
|
25
|
-
|
31
|
+
@type Array
|
32
|
+
@default "hasTopToolbar hasBottomToolbar".w()
|
33
|
+
@see SC.View#displayProperties
|
34
|
+
*/
|
35
|
+
displayProperties: "hasTopToolbar hasBottomToolbar".w(),
|
36
|
+
|
37
|
+
/**
|
38
|
+
@type String
|
39
|
+
@default 'workspaceRenderDelegate'
|
40
|
+
*/
|
41
|
+
renderDelegateName: 'workspaceRenderDelegate',
|
42
|
+
|
43
|
+
/**
|
44
|
+
@type SC.View
|
45
|
+
@default SC.ToolbarView
|
26
46
|
*/
|
27
47
|
topToolbar: SC.ToolbarView.extend(),
|
28
48
|
|
29
49
|
/**
|
30
|
-
|
50
|
+
@type SC.View
|
51
|
+
@default null
|
31
52
|
*/
|
32
53
|
bottomToolbar: null,
|
33
54
|
|
34
55
|
/**
|
35
|
-
The content. Must NOT be null.
|
56
|
+
The content. Must NOT be null.
|
57
|
+
|
58
|
+
@type SC.View
|
59
|
+
@default SC.View
|
36
60
|
*/
|
37
61
|
contentView: SC.View.extend(),
|
38
62
|
|
39
63
|
/**
|
40
|
-
|
41
|
-
|
42
|
-
By default, this property is NO. If you want to automatically resize like iPhone
|
64
|
+
If you want to automatically resize the toolbars like iPhone
|
43
65
|
apps should, set to YES.
|
66
|
+
|
67
|
+
@type Boolean
|
68
|
+
@default NO
|
44
69
|
*/
|
45
70
|
autoResizeToolbars: NO,
|
46
71
|
|
47
72
|
/**
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
TODO: move into a renderer or something.
|
73
|
+
@type Number
|
74
|
+
@default 44
|
52
75
|
*/
|
53
76
|
defaultToolbarSize: 44,
|
54
77
|
|
55
78
|
/**
|
56
|
-
|
79
|
+
@type Number
|
80
|
+
@default 44
|
57
81
|
*/
|
58
82
|
largeToolbarSize: 44,
|
59
83
|
|
60
84
|
/**
|
61
|
-
|
85
|
+
@type Number
|
86
|
+
@default 30
|
62
87
|
*/
|
63
88
|
smallToolbarSize: 30,
|
64
89
|
|
65
90
|
/**
|
66
|
-
|
91
|
+
@field
|
92
|
+
@type Number
|
67
93
|
*/
|
68
94
|
toolbarSize: function() {
|
69
95
|
if (!this.get("autoResizeToolbars")) return this.get("defaultToolbarSize");
|
@@ -72,7 +98,14 @@ SC.WorkspaceView = SC.View.extend({
|
|
72
98
|
}.property("autoHideMaster", "orientation"),
|
73
99
|
|
74
100
|
/**
|
75
|
-
Tracks the orientation of the view.
|
101
|
+
Tracks the orientation of the view. Possible values:
|
102
|
+
|
103
|
+
- SC.HORIZONTAL_ORIENTATION
|
104
|
+
- SC.PORTRAIT_ORIENTATION
|
105
|
+
|
106
|
+
@field
|
107
|
+
@type String
|
108
|
+
@default SC.HORIZONTAL_ORIENTATION
|
76
109
|
*/
|
77
110
|
orientation: function() {
|
78
111
|
var f = this.get("frame");
|
@@ -81,11 +114,12 @@ SC.WorkspaceView = SC.View.extend({
|
|
81
114
|
}.property("frame").cacheable(),
|
82
115
|
|
83
116
|
/**
|
84
|
-
|
85
|
-
|
117
|
+
@type Boolean
|
118
|
+
@default NO
|
86
119
|
*/
|
87
120
|
masterIsHidden: NO,
|
88
121
|
|
122
|
+
/** @private */
|
89
123
|
masterIsHiddenDidChange: function() {
|
90
124
|
var t, mih = this.get("masterIsHidden");
|
91
125
|
if (t = this.get("topToolbar")) t.set("masterIsHidden", mih);
|
@@ -104,7 +138,7 @@ SC.WorkspaceView = SC.View.extend({
|
|
104
138
|
this.invokeOnce("_scws_tile");
|
105
139
|
}.observes("toolbarSize"),
|
106
140
|
|
107
|
-
/**
|
141
|
+
/** @private
|
108
142
|
Creates the child views. Specifically, instantiates master and detail views.
|
109
143
|
*/
|
110
144
|
createChildViews: function() {
|
@@ -162,7 +196,7 @@ SC.WorkspaceView = SC.View.extend({
|
|
162
196
|
});
|
163
197
|
},
|
164
198
|
|
165
|
-
/**
|
199
|
+
/** @private
|
166
200
|
Returns YES if a top toolbar is present.
|
167
201
|
*/
|
168
202
|
hasTopToolbar: function() {
|
@@ -170,7 +204,7 @@ SC.WorkspaceView = SC.View.extend({
|
|
170
204
|
return NO;
|
171
205
|
}.property("topToolbar").cacheable(),
|
172
206
|
|
173
|
-
/**
|
207
|
+
/** @private
|
174
208
|
Returns YES if a bottom toolbar is present.
|
175
209
|
*/
|
176
210
|
hasBottomToolbar: function() {
|
@@ -178,29 +212,29 @@ SC.WorkspaceView = SC.View.extend({
|
|
178
212
|
return NO;
|
179
213
|
}.property("bottomToolbar").cacheable(),
|
180
214
|
|
181
|
-
/**
|
215
|
+
/** @private
|
182
216
|
Called by the individual toolbar/contentView observers at runloop end when the toolbars change.
|
183
217
|
*/
|
184
218
|
childDidChange: function() {
|
185
219
|
this._scws_tile();
|
186
220
|
},
|
187
221
|
|
188
|
-
/**
|
222
|
+
/** @private
|
189
223
|
For subclassing, this is the currently displaying top toolbar.
|
190
224
|
*/
|
191
225
|
activeTopToolbar: null,
|
192
226
|
|
193
|
-
/**
|
227
|
+
/** @private
|
194
228
|
For subclassing, this is the currently displaying bottom toolbar.
|
195
229
|
*/
|
196
230
|
activeBottomToolbar: null,
|
197
231
|
|
198
|
-
/**
|
232
|
+
/** @private
|
199
233
|
For subclassing, this is the currently displaying content view.
|
200
234
|
*/
|
201
235
|
activeContentView: null,
|
202
236
|
|
203
|
-
/**
|
237
|
+
/** @private
|
204
238
|
Called when the top toolbar changes. It appends it, removes any old ones, and calls toolbarsDidChange.
|
205
239
|
|
206
240
|
You may want to override this if, for instance, you want to add transitions of some sort (should be trivial).
|
@@ -218,6 +252,9 @@ SC.WorkspaceView = SC.View.extend({
|
|
218
252
|
this.invokeLast("childDidChange");
|
219
253
|
}.observes("topToolbar"),
|
220
254
|
|
255
|
+
/**
|
256
|
+
@private
|
257
|
+
*/
|
221
258
|
bottomToolbarDidChange: function() {
|
222
259
|
var active = this.activeBottomToolbar, replacement = this.get("bottomToolbar");
|
223
260
|
if (active) {
|
@@ -231,6 +268,7 @@ SC.WorkspaceView = SC.View.extend({
|
|
231
268
|
this.invokeLast("childDidChange");
|
232
269
|
}.observes("bottomToolbar"),
|
233
270
|
|
271
|
+
/** @private */
|
234
272
|
contentViewDidChange: function() {
|
235
273
|
var active = this.activeContentView, replacement = this.get("contentView");
|
236
274
|
if (active) {
|
@@ -242,10 +280,6 @@ SC.WorkspaceView = SC.View.extend({
|
|
242
280
|
|
243
281
|
this.activeContentView = replacement;
|
244
282
|
this.invokeLast("childDidChange");
|
245
|
-
}.observes("contentView")
|
246
|
-
|
247
|
-
|
248
|
-
displayProperties: "hasTopToolbar hasBottomToolbar".w(),
|
249
|
-
|
250
|
-
renderDelegateName: 'workspaceRenderDelegate'
|
283
|
+
}.observes("contentView")
|
284
|
+
|
251
285
|
});
|
@@ -7,6 +7,10 @@
|
|
7
7
|
|
8
8
|
sc_require('private/tree_item_observer');
|
9
9
|
|
10
|
+
/*
|
11
|
+
TODO Document more
|
12
|
+
*/
|
13
|
+
|
10
14
|
/**
|
11
15
|
@class
|
12
16
|
|
@@ -16,8 +20,6 @@ sc_require('private/tree_item_observer');
|
|
16
20
|
that the TreeController will also provide an arrangedObjects property that
|
17
21
|
can be used as the content of a CollectionView.
|
18
22
|
|
19
|
-
TODO: Document More
|
20
|
-
|
21
23
|
@extends SC.ObjectController
|
22
24
|
@extends SC.SelectionSupport
|
23
25
|
@since SproutCore 1.0
|
@@ -33,7 +35,8 @@ SC.TreeController = SC.ObjectController.extend(SC.SelectionSupport,
|
|
33
35
|
Set to YES if you want the top-level items in the tree to be displayed as
|
34
36
|
group items in the collection view.
|
35
37
|
|
36
|
-
@
|
38
|
+
@type Boolean
|
39
|
+
@default NO
|
37
40
|
*/
|
38
41
|
treeItemIsGrouped: NO,
|
39
42
|
|
@@ -43,7 +46,8 @@ SC.TreeController = SC.ObjectController.extend(SC.SelectionSupport,
|
|
43
46
|
determine the expansion state of the item. The default is
|
44
47
|
"treeItemIsExpanded"
|
45
48
|
|
46
|
-
@
|
49
|
+
@type String
|
50
|
+
@default "treeItemIsExpanded"
|
47
51
|
*/
|
48
52
|
treeItemIsExpandedKey: "treeItemIsExpanded",
|
49
53
|
|
@@ -51,7 +55,8 @@ SC.TreeController = SC.ObjectController.extend(SC.SelectionSupport,
|
|
51
55
|
Set to the name of the property on your content object that holds the
|
52
56
|
children array for each tree node. The default is "treeItemChildren".
|
53
57
|
|
54
|
-
@
|
58
|
+
@type String
|
59
|
+
@default "treeItemChildren"
|
55
60
|
*/
|
56
61
|
treeItemChildrenKey: "treeItemChildren",
|
57
62
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
|
-
/*global test */
|
7
|
+
/*global test Q$ */
|
8
8
|
|
9
9
|
// TODO: IMPROVE CODE QUALITY. This code was put together quickly in order to
|
10
10
|
// test the SproutCore framework. It does not match up to the project's
|
@@ -16,22 +16,20 @@
|
|
16
16
|
You can use this class in test mode to easily create a palette with views
|
17
17
|
configured in different ways.
|
18
18
|
|
19
|
-
|
19
|
+
# Example
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
}));
|
21
|
+
var pane = SC.ControlTestPane.design()
|
22
|
+
.add('basic', SC.CheckboxView.design({ title: "Hello World" }))
|
23
|
+
.add('disabled', SC.CheckboxView.design({
|
24
|
+
title: "Hello World", isEnabled: NO
|
25
|
+
}));
|
27
26
|
|
28
|
-
|
27
|
+
module("CheckboxView UI", pane);
|
29
28
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
}}}
|
29
|
+
test("basic", function() {
|
30
|
+
var view = pane.view('basic');
|
31
|
+
ok(view.get('isEnabled'), 'should be enabled');
|
32
|
+
});
|
35
33
|
|
36
34
|
@extends SC.Pane
|
37
35
|
@since SproutCore 1.0
|
@@ -45,19 +43,28 @@ SC.ControlTestPane = SC.Pane.extend(
|
|
45
43
|
/**
|
46
44
|
The starting top location for the first row. This will increment as
|
47
45
|
views are added to the pane.
|
46
|
+
|
47
|
+
@type Number
|
48
|
+
@default 0
|
48
49
|
*/
|
49
|
-
top:
|
50
|
+
top: 0,
|
50
51
|
|
51
52
|
/**
|
52
53
|
The default height of each row. This will be used for a view unless you
|
53
54
|
manually specify a height in the view's layout.
|
55
|
+
|
56
|
+
@type Number
|
57
|
+
@default 20
|
54
58
|
*/
|
55
|
-
height:
|
59
|
+
height: 20,
|
56
60
|
|
57
61
|
/**
|
58
62
|
The default padding added to the edges and between each row.
|
63
|
+
|
64
|
+
@type Number
|
65
|
+
@default 4
|
59
66
|
*/
|
60
|
-
padding:
|
67
|
+
padding: 4,
|
61
68
|
|
62
69
|
/**
|
63
70
|
Retrieves the test sample view that was added with the passed key name.
|
@@ -71,6 +78,7 @@ SC.ControlTestPane = SC.Pane.extend(
|
|
71
78
|
return this.childViews[idx].childViews[0];
|
72
79
|
},
|
73
80
|
|
81
|
+
/** @private */
|
74
82
|
init: function() {
|
75
83
|
sc_super();
|
76
84
|
if (!this._views) this._views = {};
|
@@ -168,6 +176,9 @@ SC.ControlTestPane.standardSetup = function() {
|
|
168
176
|
/**
|
169
177
|
Convenience method. Returns the view with the given name on the current
|
170
178
|
pane instance if there is one.
|
179
|
+
|
180
|
+
@param {String} keyName the key used to register the view.
|
181
|
+
@returns {SC.View} view instance
|
171
182
|
*/
|
172
183
|
SC.ControlTestPane.view = function(viewKey) {
|
173
184
|
var pane = this._pane || this._showPane ;
|
@@ -3,47 +3,47 @@
|
|
3
3
|
// Copyright: ©2008-2011 Apple Inc. All rights reserved.
|
4
4
|
// License: Licensed under MIT license (see license.js)
|
5
5
|
// ==========================================================================
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
6
|
+
|
7
|
+
/**
|
8
|
+
@namespace
|
9
|
+
|
10
|
+
This is the default InlineEditorDelegate for SC.LabelView. The default editor
|
11
|
+
is an SC.InlineTextFieldView.
|
12
|
+
|
13
|
+
Only one editor is allowed to be active at a time. If another view requests an
|
14
|
+
editor while an editor is already active, the delegate will first attempt to
|
15
|
+
commit the existing editor, then discard it if commit fails, and fail to
|
16
|
+
acquire if the active editor could not be discarded.
|
17
|
+
|
18
|
+
Each time an editor is required, it instantiates it and appends it to the same
|
19
|
+
pane as the view being edited. The editor is responsible for positioning
|
20
|
+
itself correctly in its beginEditing method.
|
21
|
+
|
22
|
+
@since SproutCore 1.0
|
22
23
|
*/
|
23
|
-
SC.InlineTextFieldDelegate = {
|
24
|
+
SC.InlineTextFieldDelegate = /** @scope SC.InlineTextFieldDelegate */{
|
25
|
+
|
24
26
|
/**
|
25
27
|
The current shared inline editor.
|
26
28
|
|
27
|
-
@
|
29
|
+
@type SC.InlineTextFieldView
|
28
30
|
*/
|
29
31
|
editor: null,
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
* @param {SC.InlineEditable} the label that is requesting an editor
|
46
|
-
* @returns {SC.InlineEditor} the editor the label should use to edit
|
33
|
+
/**
|
34
|
+
If an editor is currently active, dismisses it by first attempting to commit
|
35
|
+
and if that fails attempting to dismiss. If that fails, the acquire fails
|
36
|
+
and returns null.
|
37
|
+
|
38
|
+
Otherwise, it creates the editor as a child of the client view's pane and
|
39
|
+
returns it.
|
40
|
+
|
41
|
+
The default editor is an SC.InlineTextFieldView. The client view may
|
42
|
+
customize this by setting a different inlineEditor as its exampleEditor
|
43
|
+
property.
|
44
|
+
|
45
|
+
@param {SC.InlineEditable} label the label that is requesting an editor
|
46
|
+
@returns {SC.InlineEditor} the editor the label should use to edit
|
47
47
|
*/
|
48
48
|
acquireEditor: function(label) {
|
49
49
|
var editor = this.editor;
|
@@ -71,15 +71,13 @@ SC.InlineTextFieldDelegate = {
|
|
71
71
|
return editor;
|
72
72
|
},
|
73
73
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
* @params {SC.InlineEditor} the editor that should be cleaned up
|
82
|
-
* @returns {Boolean} whether the cleanup succeeded
|
74
|
+
/**
|
75
|
+
Cleans up the given editor by simply removing it from the view hierarchy. The
|
76
|
+
client view should null any references to the editor so it may be garbage
|
77
|
+
collected.
|
78
|
+
|
79
|
+
@params {SC.InlineEditor} editor the editor that should be cleaned up
|
80
|
+
@returns {Boolean} whether the cleanup succeeded
|
83
81
|
*/
|
84
82
|
releaseEditor: function(editor) {
|
85
83
|
editor.removeFromParent();
|
@@ -4,18 +4,47 @@
|
|
4
4
|
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
|
+
|
7
8
|
sc_require("system/gesture");
|
8
9
|
|
9
|
-
|
10
|
+
/*
|
11
|
+
TODO Document this class
|
12
|
+
*/
|
13
|
+
|
14
|
+
/**
|
15
|
+
@class
|
16
|
+
@extends SC.Gesture
|
17
|
+
*/
|
18
|
+
SC.PinchGesture = SC.Gesture.extend(
|
19
|
+
/** @scope SC.PinchGesture.prototype */{
|
20
|
+
|
21
|
+
/**
|
22
|
+
@type String
|
23
|
+
@default "pinch"
|
24
|
+
@readOnly
|
25
|
+
*/
|
10
26
|
name: "pinch",
|
27
|
+
|
28
|
+
/**
|
29
|
+
@type Boolean
|
30
|
+
@default YES
|
31
|
+
@readOnly
|
32
|
+
*/
|
11
33
|
acceptsMultitouch: YES,
|
12
34
|
|
35
|
+
/**
|
36
|
+
@type Number
|
37
|
+
@default 1
|
38
|
+
*/
|
13
39
|
scale: 1,
|
14
40
|
|
15
41
|
/**
|
16
42
|
The default for this method is to loop through each touch one by one to see if it qualifies.
|
17
43
|
Here, however, we want to take the touches when there are 2, and only 2 of them. As a result
|
18
44
|
we can do the work here, with no need to pass them on.
|
45
|
+
|
46
|
+
@param {Event} evt The touch event
|
47
|
+
@param {Array} touches All touches
|
19
48
|
*/
|
20
49
|
unassignedTouchesDidChange: function(evt, touches) {
|
21
50
|
if (touches.length == 2) {
|
@@ -28,10 +57,13 @@ SC.PinchGesture = SC.Gesture.extend({
|
|
28
57
|
We could probably just return YES here, since unassignedTouchesDidChange shouldn't let more
|
29
58
|
than 2 touches through, however, we're double checking here to make sure that we haven't
|
30
59
|
already captured 2 touches.
|
60
|
+
|
61
|
+
@param {Touch} touch
|
62
|
+
@returns {Boolean} YES if there were none or one touches prior to this, NO otherwise
|
31
63
|
*/
|
32
64
|
touchStart: function(touch) {
|
33
65
|
var touches = touch.touchesForResponder(this);
|
34
|
-
if (!touches || touches.length
|
66
|
+
if (!touches || touches.length === 0) {
|
35
67
|
return YES;
|
36
68
|
} else if (touches.length == 1) {
|
37
69
|
this.start([touches[0], touch]);
|
@@ -45,6 +77,9 @@ SC.PinchGesture = SC.Gesture.extend({
|
|
45
77
|
Here we're getting the distance between the 2 touches and comparing it to their starting
|
46
78
|
distance. It's possible we'll want to implement a more complex algorithm to make things
|
47
79
|
a bit smoother. Once we have the relative change, we trigger the pinch action in the view.
|
80
|
+
|
81
|
+
@param {Event} evt
|
82
|
+
@param {Array} touches
|
48
83
|
*/
|
49
84
|
touchesDragged: function(evt, touches) {
|
50
85
|
var touch = touches.firstObject(),
|
@@ -63,13 +98,15 @@ SC.PinchGesture = SC.Gesture.extend({
|
|
63
98
|
|
64
99
|
/**
|
65
100
|
Once one touch has ended we don't need to watch the other so we release all touches.
|
101
|
+
|
102
|
+
@param {SC.Touch} touch
|
66
103
|
*/
|
67
104
|
touchEnd: function(touch) {
|
68
105
|
this._startDistance = null;
|
69
106
|
|
70
107
|
var touches = touch.touchesForResponder(this);
|
71
108
|
|
72
|
-
this.trigger(touches, this.scale)
|
109
|
+
this.trigger(touches, this.scale);
|
73
110
|
this.end(touches, this.scale);
|
74
111
|
|
75
112
|
if (touches) {
|
@@ -78,4 +115,5 @@ SC.PinchGesture = SC.Gesture.extend({
|
|
78
115
|
}, this);
|
79
116
|
}
|
80
117
|
}
|
81
|
-
|
118
|
+
|
119
|
+
});
|